diff -Nru sumo-1.5.0+dfsg1/build/package/sumo.spec sumo-1.6.0+dfsg1/build/package/sumo.spec --- sumo-1.5.0+dfsg1/build/package/sumo.spec 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/build/package/sumo.spec 2020-04-27 21:47:56.000000000 +0000 @@ -31,6 +31,9 @@ BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: python +%if 0%{?suse_version} +BuildRequires: python-xml +%endif BuildRequires: help2man BuildRequires: pkgconfig BuildRequires: unzip diff -Nru sumo-1.5.0+dfsg1/build/wix/sumo.wxs sumo-1.6.0+dfsg1/build/wix/sumo.wxs --- sumo-1.5.0+dfsg1/build/wix/sumo.wxs 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/build/wix/sumo.wxs 2020-04-27 21:47:56.000000000 +0000 @@ -1,9 +1,9 @@ + Language='1033' Codepage='1252' Version='1.6.0' Manufacturer='Eclipse'> - @@ -14,7 +14,7 @@ - MODIFYENV + MODIFYENV diff -Nru sumo-1.5.0+dfsg1/CMakeLists.txt sumo-1.6.0+dfsg1/CMakeLists.txt --- sumo-1.5.0+dfsg1/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -8,6 +8,7 @@ option(PROFILING "Enable output of profiling data (applies to gcc/clang builds only)" false) option(COVERAGE "Enable output of coverage data (applies to gcc/clang builds only)" false) option(SUMO_UTILS "Enable generation of a shared library for the utility functions for option handling, XML parsing etc." false) +option(FMI "Enable generation of an FMI library for SUMO" false) set(BINARY_SUFFIX "" CACHE STRING "Append the suffix to every generated binary") set(COMPILE_DEFINITIONS "" CACHE STRING "Macros or defines to add when compiling") @@ -24,13 +25,13 @@ endif () project(SUMO) -set(PACKAGE_VERSION "1.5.0") +set(PACKAGE_VERSION "1.6.0") cmake_minimum_required(VERSION 3.1) set(CMAKE_COLOR_MAKEFILE ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/cmake_modules/") -set(ENABLED_FEATURES "${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}") +set(ENABLED_FEATURES "${CMAKE_SYSTEM} ${CMAKE_SYSTEM_PROCESSOR} ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION} ${CMAKE_BUILD_TYPE}") if (COMPILE_DEFINITIONS) add_compile_definitions(${COMPILE_DEFINITIONS}) @@ -40,7 +41,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread -Wall -pedantic -Wextra") - set(ENABLED_FEATURES "${ENABLED_FEATURES} ${CMAKE_BUILD_TYPE}") if (PROFILING) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") set(ENABLED_FEATURES "${ENABLED_FEATURES} Profiling") @@ -64,8 +64,9 @@ if (MULTITHREADED_BUILD) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") endif () - if (MSVC_VERSION GREATER 1919) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /experimental:external /external:W3") + if (MSVC_VERSION GREATER 1914) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /experimental:external /external:W2") + set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "/external:I ") endif () # exporting symbols for shared libraries needs to enabled explicitly set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) @@ -82,6 +83,9 @@ if (SUMO_UTILS) set(ENABLED_FEATURES "${ENABLED_FEATURES} SumoUtilsLibrary") endif () +if (FMI) + set(ENABLED_FEATURES "${ENABLED_FEATURES} FMI") +endif () set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin) @@ -263,18 +267,18 @@ find_package(XercesC REQUIRED) if (XercesC_FOUND) - include_directories(${XercesC_INCLUDE_DIRS}) + include_directories(SYSTEM ${XercesC_INCLUDE_DIRS}) endif (XercesC_FOUND) find_package(Proj) if (PROJ_FOUND) - include_directories(${PROJ_INCLUDE_DIR}) + include_directories(SYSTEM ${PROJ_INCLUDE_DIR}) set(ENABLED_FEATURES "${ENABLED_FEATURES} Proj") endif (PROJ_FOUND) find_package(FOX) if (FOX_FOUND) - include_directories(${FOX_INCLUDE_DIR}) + include_directories(SYSTEM ${FOX_INCLUDE_DIR}) add_definitions(${FOX_CXX_FLAGS}) add_definitions(-DFLOAT_MATH_FUNCTIONS) set(HAVE_FOX 1) @@ -284,14 +288,14 @@ find_package(X11) if (X11_FOUND) link_directories(${X11_LIBRARY_DIR}) - include_directories(${X11_INCLUDE_DIR}) + include_directories(SYSTEM ${X11_INCLUDE_DIR}) endif (X11_FOUND) find_package(ZLIB) if (ZLIB_FOUND) set(HAVE_ZLIB 1) link_directories(${ZLIB_LIBRARY_DIR}) - include_directories(${ZLIB_INCLUDE_DIR}) + include_directories(SYSTEM ${ZLIB_INCLUDE_DIR}) endif () find_package(SWIG 3.0) @@ -302,7 +306,7 @@ if (CHECK_OPTIONAL_LIBS) find_package(GDAL) if (GDAL_FOUND) - include_directories(${GDAL_INCLUDE_DIR}) + include_directories(SYSTEM ${GDAL_INCLUDE_DIR}) set(HAVE_GDAL 1) set(ENABLED_FEATURES "${ENABLED_FEATURES} GDAL") else (GDAL_FOUND) @@ -311,21 +315,21 @@ find_package(FFMPEG) if (FFMPEG_FOUND) - include_directories(${FFMPEG_INCLUDE_DIR}) + include_directories(SYSTEM ${FFMPEG_INCLUDE_DIR}) set(HAVE_FFMPEG 1) set(ENABLED_FEATURES "${ENABLED_FEATURES} FFmpeg") endif () find_package(OpenSceneGraph 3.4.0 COMPONENTS osgGA osgViewer osgUtil osgDB osgText) if (OPENSCENEGRAPH_FOUND) - include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}) + include_directories(SYSTEM ${OPENSCENEGRAPH_INCLUDE_DIRS}) set(HAVE_OSG 1) set(ENABLED_FEATURES "${ENABLED_FEATURES} OSG") endif () find_package(GL2PS) if (GL2PS_FOUND) - include_directories(${GL2PS_INCLUDE_DIR}) + include_directories(SYSTEM ${GL2PS_INCLUDE_DIR}) set(HAVE_GL2PS 1) set(ENABLED_FEATURES "${ENABLED_FEATURES} GL2PS") endif (GL2PS_FOUND) @@ -334,7 +338,7 @@ # TODO: Probably may be used in 32bit build as well. find_package(Eigen3 3.2 MODULE) if (EIGEN3_FOUND) - include_directories(${EIGEN3_INCLUDE_DIR}) + include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR}) set(HAVE_EIGEN 1) # see config.h.cmake for #cmakedefine set(ENABLED_FEATURES "${ENABLED_FEATURES} Eigen") endif (EIGEN3_FOUND) @@ -425,11 +429,6 @@ get_filename_component(JAVA_HOME ${JAVA_BIN} DIRECTORY) set(MVN_COMMAND_PREFIX ${CMAKE_COMMAND} -E env JAVA_HOME=${JAVA_HOME}) endif () - add_custom_target(cadyts - COMMAND ${MVN_COMMAND_PREFIX} ${MVN_EXECUTABLE} --batch-mode -f tools/contributed/calibration/pom.xml clean install - COMMAND ${CMAKE_COMMAND} -E copy tools/contributed/calibration/utilities/target/floetteroed-utilities-master-SNAPSHOT.jar bin - COMMAND ${CMAKE_COMMAND} -E copy tools/contributed/calibration/cadyts/target/cadyts-master-SNAPSHOT.jar bin - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_custom_target(traas COMMAND ${MVN_COMMAND_PREFIX} ${MVN_EXECUTABLE} --batch-mode -f tools/contributed/traas/pom.xml clean install COMMAND ${CMAKE_COMMAND} -E copy tools/contributed/traas/target/traas-1.0-jar-with-dependencies.jar bin/TraaS.jar @@ -447,7 +446,7 @@ add_dependencies(lisum-gui lisum-core) add_custom_target(lisum) add_dependencies(lisum lisum-gui lisum-core) - set(JAVA_TARGETS cadyts traas lisum-core lisum-gui) + set(JAVA_TARGETS traas lisum-core lisum-gui) foreach (JAVAT ${JAVA_TARGETS}) set_property(TARGET ${JAVAT} PROPERTY EXCLUDE_FROM_DEFAULT_BUILD TRUE) set_property(TARGET ${JAVAT} PROPERTY FOLDER "java") @@ -559,12 +558,13 @@ COMMAND mkdir sumo-${PACKAGE_VERSION}/include COMMAND cp ${CMAKE_BINARY_DIR}/src/version.h sumo-${PACKAGE_VERSION}/include COMMAND zip -rq sumo-src-${PACKAGE_VERSION}.zip sumo-${PACKAGE_VERSION} - COMMAND tar czf sumo-src-${PACKAGE_VERSION}.tar.gz 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 tar -czf sumo-debian-src-${PACKAGE_VERSION}.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 tar -czf sumo-all-${PACKAGE_VERSION}.tar.gz sumo-${PACKAGE_VERSION} COMMAND rm -rf sumo-${PACKAGE_VERSION} sumo-${PACKAGE_VERSION}.zip WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) add_dependencies(dist examples doc ${JAVA_TARGETS}) diff -Nru sumo-1.5.0+dfsg1/cmake-variants.yaml sumo-1.6.0+dfsg1/cmake-variants.yaml --- sumo-1.5.0+dfsg1/cmake-variants.yaml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/cmake-variants.yaml 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,30 @@ +buildType: + default: debug + description: My option + choices: + debug: + short: Debug + long: Build with debug info + buildType: Debug + release: + short: Release + long: Optimize binaries + buildType: Release + +useFMI: + default: 'no' + description: My option + choices: + 'yes': + short: FMI + long: Enable the use of FMI + settings: + FMI: 'yes' + 'no': + short: 'No FMI' + long: Do not build the FMI library + settings: + FMI: 'no' + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/activitygenConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/activitygenConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/activitygenConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/activitygenConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - diff -Nru sumo-1.5.0+dfsg1/data/xsd/additional_file.xsd sumo-1.6.0+dfsg1/data/xsd/additional_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/additional_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/additional_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -221,6 +221,7 @@ + @@ -370,6 +371,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/baseTypes.xsd sumo-1.6.0+dfsg1/data/xsd/baseTypes.xsd --- sumo-1.5.0+dfsg1/data/xsd/baseTypes.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/baseTypes.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -327,6 +327,16 @@ + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/connections_file.xsd sumo-1.6.0+dfsg1/data/xsd/connections_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/connections_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/connections_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -38,6 +38,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/det_e1meso_file.xsd sumo-1.6.0+dfsg1/data/xsd/det_e1meso_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/det_e1meso_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/det_e1meso_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -23,6 +23,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/dfrouterConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/dfrouterConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/dfrouterConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/dfrouterConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - diff -Nru sumo-1.5.0+dfsg1/data/xsd/duarouterConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/duarouterConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/duarouterConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/duarouterConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -76,6 +76,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/edgediff_file.xsd sumo-1.6.0+dfsg1/data/xsd/edgediff_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/edgediff_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/edgediff_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -52,6 +52,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/edgerelations_file.xsd sumo-1.6.0+dfsg1/data/xsd/edgerelations_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/edgerelations_file.xsd 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/edgerelations_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/edges_file.xsd sumo-1.6.0+dfsg1/data/xsd/edges_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/edges_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/edges_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -55,6 +55,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/jtrrouterConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/jtrrouterConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/jtrrouterConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/jtrrouterConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - diff -Nru sumo-1.5.0+dfsg1/data/xsd/marouterConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/marouterConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/marouterConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/marouterConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -58,6 +58,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/meandataTypes.xsd sumo-1.6.0+dfsg1/data/xsd/meandataTypes.xsd --- sumo-1.5.0+dfsg1/data/xsd/meandataTypes.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/meandataTypes.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -29,6 +29,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/netconvertConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/netconvertConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/netconvertConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/netconvertConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -150,6 +150,7 @@ + @@ -159,6 +160,7 @@ + @@ -301,8 +303,10 @@ + + @@ -335,6 +339,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/net_file.xsd sumo-1.6.0+dfsg1/data/xsd/net_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/net_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/net_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -46,6 +46,7 @@ + @@ -75,17 +76,18 @@ - - - - - - - - + + + + + + + + + @@ -139,6 +141,7 @@ + @@ -204,6 +207,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/netgenerateConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/netgenerateConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/netgenerateConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/netgenerateConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -134,6 +134,7 @@ + @@ -143,6 +144,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/nodes_file.xsd sumo-1.6.0+dfsg1/data/xsd/nodes_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/nodes_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/nodes_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -41,6 +41,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/od2tripsConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/od2tripsConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/od2tripsConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/od2tripsConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - diff -Nru sumo-1.5.0+dfsg1/data/xsd/polyconvertConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/polyconvertConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/polyconvertConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/polyconvertConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -33,6 +33,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/ptlines_file.xsd sumo-1.6.0+dfsg1/data/xsd/ptlines_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/ptlines_file.xsd 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/ptlines_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/routeTypes.xsd sumo-1.6.0+dfsg1/data/xsd/routeTypes.xsd --- sumo-1.5.0+dfsg1/data/xsd/routeTypes.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/routeTypes.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -674,6 +674,8 @@ + + @@ -702,6 +704,7 @@ + @@ -717,6 +720,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/state_file.xsd sumo-1.6.0+dfsg1/data/xsd/state_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/state_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/state_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -24,14 +24,23 @@ + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/statistic_file.xsd sumo-1.6.0+dfsg1/data/xsd/statistic_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/statistic_file.xsd 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/statistic_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/stopinfo_file.xsd sumo-1.6.0+dfsg1/data/xsd/stopinfo_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/stopinfo_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/stopinfo_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -22,6 +22,7 @@ + diff -Nru sumo-1.5.0+dfsg1/data/xsd/sumoConfiguration.xsd sumo-1.6.0+dfsg1/data/xsd/sumoConfiguration.xsd --- sumo-1.5.0+dfsg1/data/xsd/sumoConfiguration.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/sumoConfiguration.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -1,6 +1,6 @@ - @@ -74,6 +74,7 @@ + @@ -93,6 +94,7 @@ + @@ -101,11 +103,13 @@ - + + + @@ -120,6 +124,7 @@ + @@ -171,6 +176,7 @@ + @@ -187,6 +193,8 @@ + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/tripinfo_file.xsd sumo-1.6.0+dfsg1/data/xsd/tripinfo_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/tripinfo_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/tripinfo_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -21,23 +21,23 @@ - + - - + + - + - + - - + + @@ -46,7 +46,13 @@ - + + + + + + + @@ -118,13 +124,14 @@ - + - - + + - + + @@ -132,11 +139,11 @@ - + - + - + @@ -151,13 +158,14 @@ - + - - + + - + + diff -Nru sumo-1.5.0+dfsg1/data/xsd/turns_file.xsd sumo-1.6.0+dfsg1/data/xsd/turns_file.xsd --- sumo-1.5.0+dfsg1/data/xsd/turns_file.xsd 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/data/xsd/turns_file.xsd 2020-04-27 21:47:56.000000000 +0000 @@ -29,6 +29,7 @@ + diff -Nru sumo-1.5.0+dfsg1/debian/changelog sumo-1.6.0+dfsg1/debian/changelog --- sumo-1.5.0+dfsg1/debian/changelog 2020-02-16 08:51:34.000000000 +0000 +++ sumo-1.6.0+dfsg1/debian/changelog 2020-04-29 09:32:49.000000000 +0000 @@ -1,8 +1,8 @@ -sumo (1.5.0+dfsg1-5~eoan) eoan; urgency=medium +sumo (1.6.0+dfsg1-1~eoan) eoan; urgency=medium * new upstream version - -- Michael Behrisch Sun, 16 Feb 2020 08:51:34 +0000 + -- Michael Behrisch Wed, 29 Apr 2020 11:32:49 +0200 sumo (1.4.0+dfsg1-5) bionic; urgency=medium diff -Nru sumo-1.5.0+dfsg1/docs/examples/dfrouter/test.dfrocfg sumo-1.6.0+dfsg1/docs/examples/dfrouter/test.dfrocfg --- sumo-1.5.0+dfsg1/docs/examples/dfrouter/test.dfrocfg 2020-02-10 23:04:11.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/examples/dfrouter/test.dfrocfg 2020-04-27 22:06:15.000000000 +0000 @@ -1,6 +1,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/examples/jtrrouter/turns/test.jtrrcfg sumo-1.6.0+dfsg1/docs/examples/jtrrouter/turns/test.jtrrcfg --- sumo-1.5.0+dfsg1/docs/examples/jtrrouter/turns/test.jtrrcfg 2020-02-10 23:04:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/examples/jtrrouter/turns/test.jtrrcfg 2020-04-27 22:06:15.000000000 +0000 @@ -1,6 +1,6 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/examples/sumo/model_railroad/test.sumocfg sumo-1.6.0+dfsg1/docs/examples/sumo/model_railroad/test.sumocfg --- sumo-1.5.0+dfsg1/docs/examples/sumo/model_railroad/test.sumocfg 2020-02-10 23:04:15.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/examples/sumo/model_railroad/test.sumocfg 2020-04-27 22:06:21.000000000 +0000 @@ -1,6 +1,6 @@ - - + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/allclasses.html sumo-1.6.0+dfsg1/docs/javadoc/traas/allclasses.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/allclasses.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/allclasses.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,102 @@ + + + + + +All Classes (traas 1.0 API) + + + + + + + + + + + + + +

All Classes

+
+ +
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/allclasses-index.html sumo-1.6.0+dfsg1/docs/javadoc/traas/allclasses-index.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/allclasses-index.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/allclasses-index.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,478 @@ + + + + + +All Classes (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

All Classes

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/allpackages-index.html sumo-1.6.0+dfsg1/docs/javadoc/traas/allpackages-index.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/allpackages-index.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/allpackages-index.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,208 @@ + + + + + +All Packages (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

All Packages

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/constant-values.html sumo-1.6.0+dfsg1/docs/javadoc/traas/constant-values.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/constant-values.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/constant-values.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,3522 @@ + + + + + +Constant Field Values (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Constant Field Values

+
+

Contents

+ +
+
+
+ + +
+

de.tudresden.*

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Edge.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Edge (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Edge

+
+
No usage of de.tudresden.sumo.cmd.Edge
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Gui.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Gui (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Gui

+
+
No usage of de.tudresden.sumo.cmd.Gui
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Inductionloop.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Inductionloop (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Inductionloop

+
+
No usage of de.tudresden.sumo.cmd.Inductionloop
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Junction.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Junction (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Junction

+
+
No usage of de.tudresden.sumo.cmd.Junction
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lanearea.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Lanearea (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Lanearea

+
+
No usage of de.tudresden.sumo.cmd.Lanearea
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Lane.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Lane (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Lane

+
+
No usage of de.tudresden.sumo.cmd.Lane
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Multientryexit.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Multientryexit (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Multientryexit

+
+
No usage of de.tudresden.sumo.cmd.Multientryexit
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Person.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Person (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Person

+
+
No usage of de.tudresden.sumo.cmd.Person
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Poi.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Poi (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Poi

+
+
No usage of de.tudresden.sumo.cmd.Poi
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Polygon.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Polygon (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Polygon

+
+
No usage of de.tudresden.sumo.cmd.Polygon
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Route.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Route (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Route

+
+
No usage of de.tudresden.sumo.cmd.Route
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Simulation.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Simulation (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Simulation

+
+
No usage of de.tudresden.sumo.cmd.Simulation
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Trafficlight.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Trafficlight (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Trafficlight

+
+
No usage of de.tudresden.sumo.cmd.Trafficlight
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicle.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Vehicle (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Vehicle

+
+
No usage of de.tudresden.sumo.cmd.Vehicle
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/class-use/Vehicletype.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.cmd.Vehicletype (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.cmd.Vehicletype

+
+
No usage of de.tudresden.sumo.cmd.Vehicletype
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Edge.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,1037 @@ + + + + + +Edge (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Edge

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Edge
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Edge
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Edge() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadaptTraveltime​(java.lang.String edgeID, + double time) +
      Adapt the travel time value (in s) used for (re-)routing on the given + edge.
      +
      static SumoCommandadaptTraveltime​(java.lang.String edgeID, + double time, + double begin, + double end) +
      Adapt the travel time value (in s) used for (re-)routing on the given + edge.
      +
      static SumoCommandgetAdaptedTraveltime​(java.lang.String edgeID, + double time) +
      Returns the travel time value (in s) used for (re-)routing.
      +
      static SumoCommandgetCO2Emission​(java.lang.String edgeID) +
      Returns the CO2 emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandgetCOEmission​(java.lang.String edgeID) +
      Returns the CO emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandgetEffort​(java.lang.String edgeID, + double time) +
      Returns the effort value used for (re-)routing.
      +
      static SumoCommandgetElectricityConsumption​(java.lang.String edgeID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandgetFuelConsumption​(java.lang.String edgeID) +
      Returns the fuel consumption (in ml) on the given edge during the last + time step.
      +
      static SumoCommandgetHCEmission​(java.lang.String edgeID) +
      Returns the HC emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandgetIDCount() +
      Returns the number of edges in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of all edges in the network.
      +
      static SumoCommandgetLaneNumber​(java.lang.String edgeID) 
      static SumoCommandgetLastStepHaltingNumber​(java.lang.String edgeID) +
      Returns the total number of halting vehicles on the given edge within the + last time step.
      +
      static SumoCommandgetLastStepLength​(java.lang.String edgeID) +
      Returns the total vehicle length (in m) on the given edge within the last + time step.
      +
      static SumoCommandgetLastStepMeanSpeed​(java.lang.String edgeID) +
      Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
      +
      static SumoCommandgetLastStepOccupancy​(java.lang.String edgeID) +
      Returns the percentage of time (in %) the detector was occupied by a + vehicle.
      +
      static SumoCommandgetLastStepPersonIDs​(java.lang.String edgeID) +
      Returns the ids of the persons on the given edge during the last time step.
      +
      static SumoCommandgetLastStepVehicleIDs​(java.lang.String edgeID) +
      Returns the list of IDs of the vehicles on the given edge within the last + simulation step.
      +
      static SumoCommandgetLastStepVehicleNumber​(java.lang.String edgeID) +
      Returns the total number of vehicles on this edge within the last time + step.
      +
      static SumoCommandgetNoiseEmission​(java.lang.String edgeID) +
      Returns the noise emissions (in db)on the given edge within the last time + step.
      +
      static SumoCommandgetNOxEmission​(java.lang.String edgeID) +
      Returns the NOx emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandgetParameter​(java.lang.String edgeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPMxEmission​(java.lang.String edgeID) +
      Returns the particular matter emissions (in mg) on the given edge on this + edge during the last time step.
      +
      static SumoCommandgetTraveltime​(java.lang.String edgeID) +
      Returns the estimated travel time (in s) on the given edge on this edge + within the last time step.
      +
      static SumoCommandgetWaitingTime​(java.lang.String edgeID) +
      Returns the waiting time (in s) on the given edge on this edge + within the last time step.
      +
      static SumoCommandsetEffort​(java.lang.String edgeID, + double effort) +
      Adapt the effort value used for (re-)routing on the given edge.
      +
      static SumoCommandsetEffort​(java.lang.String edgeID, + double effort, + double begin, + double end) +
      Adapt the effort value used for (re-)routing on the given edge.
      +
      static SumoCommandsetMaxSpeed​(java.lang.String edgeID, + double speed) +
      Set a new maximum speed (in m/s) for all lanes of the edge.
      +
      static SumoCommandsetParameter​(java.lang.String edgeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Edge

        +
        public Edge()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAdaptedTraveltime

        +
        public static SumoCommand getAdaptedTraveltime​(java.lang.String edgeID,
        +                                               double time)
        +
        Returns the travel time value (in s) used for (re-)routing.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        time - the point of time the returned value is valid for
        +
        Returns:
        +
        the travel time value (in s)
        +
        +
      • +
      + + + +
        +
      • +

        getCO2Emission

        +
        public static SumoCommand getCO2Emission​(java.lang.String edgeID)
        +
        Returns the CO2 emissions (in mg) on the given edge during the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the CO2 emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getCOEmission

        +
        public static SumoCommand getCOEmission​(java.lang.String edgeID)
        +
        Returns the CO emissions (in mg) on the given edge during the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the CO emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getEffort

        +
        public static SumoCommand getEffort​(java.lang.String edgeID,
        +                                    double time)
        +
        Returns the effort value used for (re-)routing.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        time - the point of time the returned value is valid for
        +
        Returns:
        +
        the edge effort value (in s), -1 is returned if such a value does + not exist
        +
        +
      • +
      + + + +
        +
      • +

        getElectricityConsumption

        +
        public static SumoCommand getElectricityConsumption​(java.lang.String edgeID)
        +
        Returns the electricity consumption in ml for the last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the edge effort value (in s), -1 is returned if such a value does + not exist
        +
        +
      • +
      + + + +
        +
      • +

        getFuelConsumption

        +
        public static SumoCommand getFuelConsumption​(java.lang.String edgeID)
        +
        Returns the fuel consumption (in ml) on the given edge during the last + time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the fuel consumption (in ml)
        +
        +
      • +
      + + + +
        +
      • +

        getHCEmission

        +
        public static SumoCommand getHCEmission​(java.lang.String edgeID)
        +
        Returns the HC emissions (in mg) on the given edge during the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the HC emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of edges in the network.
        +
        +
        Returns:
        +
        the number of edges
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of all edges in the network.
        +
        +
        Returns:
        +
        a list of IDs of all edges
        +
        +
      • +
      + + + +
        +
      • +

        getLaneNumber

        +
        public static SumoCommand getLaneNumber​(java.lang.String edgeID)
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        Returns the number of lanes of this edge
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepHaltingNumber

        +
        public static SumoCommand getLastStepHaltingNumber​(java.lang.String edgeID)
        +
        Returns the total number of halting vehicles on the given edge within the + last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        number of halting vehicle, a speed of less than 0.1 m/s is + considered a halt
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepLength

        +
        public static SumoCommand getLastStepLength​(java.lang.String edgeID)
        +
        Returns the total vehicle length (in m) on the given edge within the last + time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        total vehicle length (in m)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanSpeed

        +
        public static SumoCommand getLastStepMeanSpeed​(java.lang.String edgeID)
        +
        Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the average speed (in m/s)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepPersonIDs

        +
        public static SumoCommand getLastStepPersonIDs​(java.lang.String edgeID)
        +
        Returns the ids of the persons on the given edge during the last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the average speed (in m/s)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepOccupancy

        +
        public static SumoCommand getLastStepOccupancy​(java.lang.String edgeID)
        +
        Returns the percentage of time (in %) the detector was occupied by a + vehicle.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the occupancy (in %)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleIDs

        +
        public static SumoCommand getLastStepVehicleIDs​(java.lang.String edgeID)
        +
        Returns the list of IDs of the vehicles on the given edge within the last + simulation step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the IDs of the vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleNumber

        +
        public static SumoCommand getLastStepVehicleNumber​(java.lang.String edgeID)
        +
        Returns the total number of vehicles on this edge within the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the total number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getNOxEmission

        +
        public static SumoCommand getNOxEmission​(java.lang.String edgeID)
        +
        Returns the NOx emissions (in mg) on the given edge during the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the NOx emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getNoiseEmission

        +
        public static SumoCommand getNoiseEmission​(java.lang.String edgeID)
        +
        Returns the noise emissions (in db)on the given edge within the last time + step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the noise emissions (in db)
        +
        +
      • +
      + + + +
        +
      • +

        getPMxEmission

        +
        public static SumoCommand getPMxEmission​(java.lang.String edgeID)
        +
        Returns the particular matter emissions (in mg) on the given edge on this + edge during the last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the particular matter emissions(in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getTraveltime

        +
        public static SumoCommand getTraveltime​(java.lang.String edgeID)
        +
        Returns the estimated travel time (in s) on the given edge on this edge + within the last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the estimated travel time
        +
        +
      • +
      + + + +
        +
      • +

        getWaitingTime

        +
        public static SumoCommand getWaitingTime​(java.lang.String edgeID)
        +
        Returns the waiting time (in s) on the given edge on this edge + within the last time step.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        Returns:
        +
        the waiting time
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String edgeID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String edgeID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        adaptTraveltime

        +
        public static SumoCommand adaptTraveltime​(java.lang.String edgeID,
        +                                          double time)
        +
        Adapt the travel time value (in s) used for (re-)routing on the given + edge.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        time - travel time value (in s)
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        adaptTraveltime

        +
        public static SumoCommand adaptTraveltime​(java.lang.String edgeID,
        +                                          double time,
        +                                          double begin,
        +                                          double end)
        +
        Adapt the travel time value (in s) used for (re-)routing on the given + edge.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        time - travel time value (in s)
        +
        begin - begin value
        +
        end - end value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEffort

        +
        public static SumoCommand setEffort​(java.lang.String edgeID,
        +                                    double effort)
        +
        Adapt the effort value used for (re-)routing on the given edge.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        effort - effort value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEffort

        +
        public static SumoCommand setEffort​(java.lang.String edgeID,
        +                                    double effort,
        +                                    double begin,
        +                                    double end)
        +
        Adapt the effort value used for (re-)routing on the given edge.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        effort - effort value
        +
        begin - begin value
        +
        end - end value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeed

        +
        public static SumoCommand setMaxSpeed​(java.lang.String edgeID,
        +                                      double speed)
        +
        Set a new maximum speed (in m/s) for all lanes of the edge.
        +
        +
        Parameters:
        +
        edgeID - a string identifying the edge
        +
        speed - maximum speed (in m/s)
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Gui.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,589 @@ + + + + + +Gui (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Gui

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Gui
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Gui
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Gui() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetBoundary​(java.lang.String viewID) +
      Returns the coordinates of the lower left and the upper right corner of + the currently visible view.
      +
      static SumoCommandgetIDList() +
      Returns the list of available views (open windows).
      +
      static SumoCommandgetOffset​(java.lang.String viewID) +
      Returns the x and y offset of the center of the current view.
      +
      static SumoCommandgetSchema​(java.lang.String viewID) +
      Returns the name of the current coloring scheme.
      +
      static SumoCommandgetZoom​(java.lang.String viewID) +
      Returns the current zoom factor.
      +
      static SumoCommandscreenshot​(java.lang.String viewID, + java.lang.String filename) +
      Save a screenshot for the given view to the given filename.
      +
      static SumoCommandsetBoundary​(java.lang.String viewID, + double xmin, + double ymin, + double xmax, + double ymax) +
      Set the current boundary for the given view (see getBoundary()).
      +
      static SumoCommandsetOffset​(java.lang.String viewID, + double x, + double y) +
      Set the current offset for the given view.
      +
      static SumoCommandsetSchema​(java.lang.String viewID, + java.lang.String schemeName) +
      Set the current coloring scheme for the given view.
      +
      static SumoCommandsetZoom​(java.lang.String viewID, + double zoom) +
      Set the current zoom factor for the given view.
      +
      static SumoCommandtrackVehicle​(java.lang.String viewID, + java.lang.String vehID) +
      Start visually tracking the given vehicle on the given view.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Gui

        +
        public Gui()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getBoundary

        +
        public static SumoCommand getBoundary​(java.lang.String viewID)
        +
        Returns the coordinates of the lower left and the upper right corner of + the currently visible view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        Returns:
        +
        coordinates of the lower left and the upper right corner of the + visible network
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns the list of available views (open windows).
        +
        +
        Returns:
        +
        list of available views
        +
        +
      • +
      + + + +
        +
      • +

        getOffset

        +
        public static SumoCommand getOffset​(java.lang.String viewID)
        +
        Returns the x and y offset of the center of the current view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        Returns:
        +
        the x and y offset of the center of the visible network
        +
        +
      • +
      + + + +
        +
      • +

        getSchema

        +
        public static SumoCommand getSchema​(java.lang.String viewID)
        +
        Returns the name of the current coloring scheme.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        Returns:
        +
        the visualization scheme (e.g. "standard")
        +
        +
      • +
      + + + +
        +
      • +

        getZoom

        +
        public static SumoCommand getZoom​(java.lang.String viewID)
        +
        Returns the current zoom factor.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        Returns:
        +
        the current zoom level (in %)
        +
        +
      • +
      + + + +
        +
      • +

        screenshot

        +
        public static SumoCommand screenshot​(java.lang.String viewID,
        +                                     java.lang.String filename)
        +
        Save a screenshot for the given view to the given filename.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        filename - a string to name the file, the fileformat is guessed from the + extension, the available formats differ from platform to + platform but should at least include ps, svg and pdf, on linux + probably gif, png and jpg as well
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setBoundary

        +
        public static SumoCommand setBoundary​(java.lang.String viewID,
        +                                      double xmin,
        +                                      double ymin,
        +                                      double xmax,
        +                                      double ymax)
        +
        Set the current boundary for the given view (see getBoundary()).
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        xmin - x-coordinate (double) of the lower left corner of the current + view
        +
        ymin - y-coordinate (double) of the lower left corner of the current + view
        +
        xmax - x-coordinate (double) of the upper right corner of the current + view
        +
        ymax - y-coordinate (double) of the upper right corner of the current + view
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setOffset

        +
        public static SumoCommand setOffset​(java.lang.String viewID,
        +                                    double x,
        +                                    double y)
        +
        Set the current offset for the given view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        x - x-offset of the center of the visible network
        +
        y - y-offset of the center of the visible network
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSchema

        +
        public static SumoCommand setSchema​(java.lang.String viewID,
        +                                    java.lang.String schemeName)
        +
        Set the current coloring scheme for the given view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        schemeName - the coloring scheme
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setZoom

        +
        public static SumoCommand setZoom​(java.lang.String viewID,
        +                                  double zoom)
        +
        Set the current zoom factor for the given view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        zoom - desired zoom factor
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        trackVehicle

        +
        public static SumoCommand trackVehicle​(java.lang.String viewID,
        +                                       java.lang.String vehID)
        +
        Start visually tracking the given vehicle on the given view.
        +
        +
        Parameters:
        +
        viewID - a string identifying the view in the simulation GUI
        +
        vehID - a string identifying the vehicle
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Inductionloop.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,587 @@ + + + + + +Inductionloop (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Inductionloop

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Inductionloop
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Inductionloop
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Inductionloop() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetIDCount() +
      Returns the number of all induction loops in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all induction loops within the scenario.
      +
      static SumoCommandgetLaneID​(java.lang.String loopID) +
      Returns the ID of the lane the loop is placed at.
      +
      static SumoCommandgetLastStepMeanLength​(java.lang.String loopID) +
      Returns the mean length of vehicles (in m) which were on the detector in + the last step.
      +
      static SumoCommandgetLastStepMeanSpeed​(java.lang.String loopID) +
      Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
      +
      static SumoCommandgetLastStepOccupancy​(java.lang.String loopID) +
      Returns the percentage of time (in %) the detector was occupied by a + vehicle within the last time step.
      +
      static SumoCommandgetLastStepVehicleIDs​(java.lang.String loopID) +
      Returns the list of IDs of vehicles that were on the named induction loop + in the last simulation step.
      +
      static SumoCommandgetLastStepVehicleNumber​(java.lang.String loopID) +
      Returns the number of vehicles that were on the named induction loop + within the last simulation step.
      +
      static SumoCommandgetParameter​(java.lang.String loopID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPosition​(java.lang.String loopID) +
      Returns the position (in m) of the induction loop at it's lane, counted + from the lane's begin.
      +
      static SumoCommandgetTimeSinceDetection​(java.lang.String loopID) +
      Return the time (in s) since last detection.
      +
      static SumoCommandgetVehicleData​(java.lang.String loopID) +
      A complex structure containing several information about vehicles which + passed the detector.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Inductionloop

        +
        public Inductionloop()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all induction loops within the scenario.
        +
        +
        Returns:
        +
        list of IDs of all induction loops in the network
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all induction loops in the network.
        +
        +
        Returns:
        +
        the number of detectors
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String loopID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        param - a string personIDentifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        getLaneID

        +
        public static SumoCommand getLaneID​(java.lang.String loopID)
        +
        Returns the ID of the lane the loop is placed at.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        a string identifying the lane
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanLength

        +
        public static SumoCommand getLastStepMeanLength​(java.lang.String loopID)
        +
        Returns the mean length of vehicles (in m) which were on the detector in + the last step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        average length of the vehicles (in m)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanSpeed

        +
        public static SumoCommand getLastStepMeanSpeed​(java.lang.String loopID)
        +
        Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        average speed of the vehicles (in m/s)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepOccupancy

        +
        public static SumoCommand getLastStepOccupancy​(java.lang.String loopID)
        +
        Returns the percentage of time (in %) the detector was occupied by a + vehicle within the last time step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        occupancy of the detector (in %)
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleIDs

        +
        public static SumoCommand getLastStepVehicleIDs​(java.lang.String loopID)
        +
        Returns the list of IDs of vehicles that were on the named induction loop + in the last simulation step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        list of all vehicleIDs
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleNumber

        +
        public static SumoCommand getLastStepVehicleNumber​(java.lang.String loopID)
        +
        Returns the number of vehicles that were on the named induction loop + within the last simulation step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        total number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String loopID)
        +
        Returns the position (in m) of the induction loop at it's lane, counted + from the lane's begin.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        position of the detector, counted from the lane's begin
        +
        +
      • +
      + + + +
        +
      • +

        getTimeSinceDetection

        +
        public static SumoCommand getTimeSinceDetection​(java.lang.String loopID)
        +
        Return the time (in s) since last detection.
        +
        +
        Parameters:
        +
        loopID - a string identifying the induction loop
        +
        Returns:
        +
        time since last detection (in s)
        +
        +
      • +
      + + + +
        +
      • +

        getVehicleData

        +
        public static SumoCommand getVehicleData​(java.lang.String loopID)
        +
        A complex structure containing several information about vehicles which + passed the detector.
        +
        +
        Parameters:
        +
        loopID - a SumoStringList containing induction loops
        +
        Returns:
        +
        several information about vehicles which passed the detector.
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Junction.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,386 @@ + + + + + +Junction (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Junction

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Junction
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Junction
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Junction() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetIDCount() +
      Returns the number of all junctions in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all junctions within the scenario.
      +
      static SumoCommandgetPosition​(java.lang.String junctionID) +
      Returns the position of the named junction.
      +
      static SumoCommandgetShape​(java.lang.String junctionID) +
      getShape
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Junction

        +
        public Junction()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all junctions within the scenario.
        +
        +
        Returns:
        +
        list of IDs of all junctions in the network
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all junctions in the network.
        +
        +
        Returns:
        +
        the number of junctions
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String junctionID)
        +
        Returns the position of the named junction.
        +
        +
        Parameters:
        +
        junctionID - a string identifying the junction
        +
        Returns:
        +
        the coordinates of the center of the junction
        +
        +
      • +
      + + + +
        +
      • +

        getShape

        +
        public static SumoCommand getShape​(java.lang.String junctionID)
        +
        getShape
        +
        +
        Parameters:
        +
        junctionID - a string identifying the junction
        +
        Returns:
        +
        the shape
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lanearea.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,570 @@ + + + + + +Lanearea (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Lanearea

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Lanearea
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Lanearea
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Lanearea

        +
        public Lanearea()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of all areal detectors in the network.
        +
        +
        Returns:
        +
        a list of IDs of all areal detectors
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleNumber

        +
        public static SumoCommand getLastStepVehicleNumber​(java.lang.String loopID)
        +
        Returns the number of vehicles on the detector
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        numeber of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of the areal detectors in the network.
        +
        +
        Returns:
        +
        the number of areal detectors
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepHaltingNumber

        +
        public static SumoCommand getLastStepHaltingNumber​(java.lang.String loopID)
        +
        Returns the number of vehicles which were halting during the last time step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        numeber of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleIDs

        +
        public static SumoCommand getLastStepVehicleIDs​(java.lang.String loopID)
        +
        Returns the list of ids of vehicles that were on the named detector in the last simulation step.
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        a list of all vehicles on the detector
        +
        +
      • +
      + + + +
        +
      • +

        getJamLengthVehicle

        +
        public static SumoCommand getJamLengthVehicle​(java.lang.String loopID)
        +
        getJamLengthVehicle
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        jam length in vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getJamLengthMeters

        +
        public static SumoCommand getJamLengthMeters​(java.lang.String loopID)
        +
        getJamLengthMeters
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        jam length in [m]
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanSpeed

        +
        public static SumoCommand getLastStepMeanSpeed​(java.lang.String loopID)
        +
        getLastStepMeanSpeed
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        last step mean speed
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepOccupancy

        +
        public static SumoCommand getLastStepOccupancy​(java.lang.String loopID)
        +
        getLastStepOccupancy
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        last step occupancy
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String loopID)
        +
        getPosition
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        position of the vehicle in m
        +
        +
      • +
      + + + +
        +
      • +

        getLaneID

        +
        public static SumoCommand getLaneID​(java.lang.String loopID)
        +
        getLaneID
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        lane ID of the detector
        +
        +
      • +
      + + + +
        +
      • +

        getLength

        +
        public static SumoCommand getLength​(java.lang.String loopID)
        +
        getlength
        +
        +
        Parameters:
        +
        loopID - a string identifying the loop
        +
        Returns:
        +
        lane ID of the detector
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Lane.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,1148 @@ + + + + + +Lane (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Lane

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Lane
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Lane
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Lane() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetAllowed​(java.lang.String laneID) +
      Returns a list of allowed vehicle classes.
      +
      static SumoCommandgetCO2Emission​(java.lang.String laneID) +
      Returns the CO2 emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandgetCOEmission​(java.lang.String laneID) +
      Returns the CO emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandgetDisallowed​(java.lang.String laneID) +
      Returns a list of disallowed vehicle classes.
      +
      static SumoCommandgetEdgeID​(java.lang.String laneID) +
      Returns the ID of the edge this lane belongs to.
      +
      static SumoCommandgetElectricityConsumption​(java.lang.String laneID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandgetFoes​(java.lang.String laneID, + java.lang.String toLane) +
      Returns the ids of incoming lanes that have right of way over the connection from laneID to toLaneID
      +
      static SumoCommandgetFuelConsumption​(java.lang.String laneID) +
      Returns the fuel consumption (in ml) on the given lane during the last + time step.
      +
      static SumoCommandgetHCEmission​(java.lang.String laneID) +
      Returns the HC emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all lanes in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all lanes in the network.
      +
      static SumoCommandgetInternalFoes​(java.lang.String laneID) +
      Returns the ids of internal lanes that are in conflict with the given internal lane id
      +
      static SumoCommandgetLastStepHaltingNumber​(java.lang.String laneID) +
      Returns the total number of halting vehicles on the given lane within the + last time step.
      +
      static SumoCommandgetLastStepLength​(java.lang.String laneID) +
      Returns the total vehicle length (in m) on the given lane during the last + time step.
      +
      static SumoCommandgetLastStepMeanSpeed​(java.lang.String laneID) +
      Returns the mean speed (in m/s) on the given lane within the last time + step.
      +
      static SumoCommandgetLastStepOccupancy​(java.lang.String laneID) +
      Returns the occupancy (in %) on the given lane during the last time step.
      +
      static SumoCommandgetLastStepVehicleIDs​(java.lang.String laneID) +
      Returns the IDs of the vehicles on the given lane within the last time + step.
      +
      static SumoCommandgetLastStepVehicleNumber​(java.lang.String laneID) +
      Returns number of vehicles on this lane within the last time step.
      +
      static SumoCommandgetLength​(java.lang.String laneID) +
      Returns the length (in m) of the named lane.
      +
      static SumoCommandgetLinkNumber​(java.lang.String laneID) +
      Returns the number of links outgoing from this lane.
      +
      static SumoCommandgetLinks​(java.lang.String laneID) +
      Returns descriptions of the links (in m) outgoing from this lane.
      +
      static SumoCommandgetMaxSpeed​(java.lang.String laneID) +
      Returns the maximum speed (in m/s) allowed on this lane.
      +
      static SumoCommandgetNoiseEmission​(java.lang.String laneID) +
      Returns the noise emissions (in db) on the given lane during the last + time step.
      +
      static SumoCommandgetNOxEmission​(java.lang.String laneID) +
      Returns the NOx emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandgetParameter​(java.lang.String laneID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPMxEmission​(java.lang.String laneID) +
      Returns the particular matter emissions (in mg) on the given lane during + the last time step.
      +
      static SumoCommandgetShape​(java.lang.String laneID) +
      Returns this lane's shape.
      +
      static SumoCommandgetTraveltime​(java.lang.String laneID) +
      Returns the estimated travel time (in s) on the given lane during the + last time step.
      +
      static SumoCommandgetWaitingTime​(java.lang.String laneID) +
      getWaitingTime
      +
      static SumoCommandgetWidth​(java.lang.String laneID) +
      Returns the width (in m) of the named lane.
      +
      static SumoCommandsetAllowed​(java.lang.String laneID, + SumoStringList allowedClasses) +
      Set a list of allowed vehicle classes.
      +
      static SumoCommandsetDisallowed​(java.lang.String laneID, + SumoStringList disallowedClasses) +
      Set a list of disallowed vehicle classes.
      +
      static SumoCommandsetLength​(java.lang.String laneID, + double length) +
      Set the length (in m) of the named lane.
      +
      static SumoCommandsetMaxSpeed​(java.lang.String laneID, + double speed) +
      Set the maximum speed (in m/s) allowed on this lane.
      +
      static SumoCommandsetParameter​(java.lang.String laneID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Lane

        +
        public Lane()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAllowed

        +
        public static SumoCommand getAllowed​(java.lang.String laneID)
        +
        Returns a list of allowed vehicle classes.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        list of allowed vehicle classes. An empty list means all vehicles + are allowed.
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all lanes in the network.
        +
        +
        Returns:
        +
        the number of lanes
        +
        +
      • +
      + + + +
        +
      • +

        getCO2Emission

        +
        public static SumoCommand getCO2Emission​(java.lang.String laneID)
        +
        Returns the CO2 emissions (in mg) on the given lane during the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the CO2 emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getCOEmission

        +
        public static SumoCommand getCOEmission​(java.lang.String laneID)
        +
        Returns the CO emissions (in mg) on the given lane during the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the CO emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getDisallowed

        +
        public static SumoCommand getDisallowed​(java.lang.String laneID)
        +
        Returns a list of disallowed vehicle classes.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        list of disallowed vehicle classes
        +
        +
      • +
      + + + +
        +
      • +

        getEdgeID

        +
        public static SumoCommand getEdgeID​(java.lang.String laneID)
        +
        Returns the ID of the edge this lane belongs to.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the id of the edge this lane belongs to
        +
        +
      • +
      + + + +
        +
      • +

        getElectricityConsumption

        +
        public static SumoCommand getElectricityConsumption​(java.lang.String laneID)
        +
        Returns the electricity consumption in ml for the last time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the energy consumption
        +
        +
      • +
      + + + +
        +
      • +

        getFoes

        +
        public static SumoCommand getFoes​(java.lang.String laneID,
        +                                  java.lang.String toLane)
        +
        Returns the ids of incoming lanes that have right of way over the connection from laneID to toLaneID
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        toLane - a string identifying the target lane
        +
        Returns:
        +
        the energy consumption
        +
        +
      • +
      + + + +
        +
      • +

        getInternalFoes

        +
        public static SumoCommand getInternalFoes​(java.lang.String laneID)
        +
        Returns the ids of internal lanes that are in conflict with the given internal lane id
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the energy consumption
        +
        +
      • +
      + + + +
        +
      • +

        getFuelConsumption

        +
        public static SumoCommand getFuelConsumption​(java.lang.String laneID)
        +
        Returns the fuel consumption (in ml) on the given lane during the last + time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the fuel consumption (in ml)
        +
        +
      • +
      + + + +
        +
      • +

        getHCEmission

        +
        public static SumoCommand getHCEmission​(java.lang.String laneID)
        +
        Returns the HC emissions (in mg) on the given lane during the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the HC emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all lanes in the network.
        +
        +
        Returns:
        +
        a list of IDs of all lanes
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepHaltingNumber

        +
        public static SumoCommand getLastStepHaltingNumber​(java.lang.String laneID)
        +
        Returns the total number of halting vehicles on the given lane within the + last time step. A speed of less than 0.1 m/s is considered a halt.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        number of halting vehicles within the last time step
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepLength

        +
        public static SumoCommand getLastStepLength​(java.lang.String laneID)
        +
        Returns the total vehicle length (in m) on the given lane during the last + time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        vehicle length (in m) within the last time step
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanSpeed

        +
        public static SumoCommand getLastStepMeanSpeed​(java.lang.String laneID)
        +
        Returns the mean speed (in m/s) on the given lane within the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the average speed (in m/s) within the last time step
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepOccupancy

        +
        public static SumoCommand getLastStepOccupancy​(java.lang.String laneID)
        +
        Returns the occupancy (in %) on the given lane during the last time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the percentage of time the lane was occupied
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleIDs

        +
        public static SumoCommand getLastStepVehicleIDs​(java.lang.String laneID)
        +
        Returns the IDs of the vehicles on the given lane within the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        list of IDs of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleNumber

        +
        public static SumoCommand getLastStepVehicleNumber​(java.lang.String laneID)
        +
        Returns number of vehicles on this lane within the last time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLength

        +
        public static SumoCommand getLength​(java.lang.String laneID)
        +
        Returns the length (in m) of the named lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        length of the named lane (in m)
        +
        +
      • +
      + + + +
        +
      • +

        getLinkNumber

        +
        public static SumoCommand getLinkNumber​(java.lang.String laneID)
        +
        Returns the number of links outgoing from this lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        number of connections to successive lanes
        +
        +
      • +
      + + + +
        +
      • +

        getLinks

        +
        public static SumoCommand getLinks​(java.lang.String laneID)
        +
        Returns descriptions of the links (in m) outgoing from this lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        a list containing IDs of sucessor lanes
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSpeed

        +
        public static SumoCommand getMaxSpeed​(java.lang.String laneID)
        +
        Returns the maximum speed (in m/s) allowed on this lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        maximum allowed speed (in m/s)
        +
        +
      • +
      + + + +
        +
      • +

        getNOxEmission

        +
        public static SumoCommand getNOxEmission​(java.lang.String laneID)
        +
        Returns the NOx emissions (in mg) on the given lane during the last time + step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the NOx emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getNoiseEmission

        +
        public static SumoCommand getNoiseEmission​(java.lang.String laneID)
        +
        Returns the noise emissions (in db) on the given lane during the last + time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the noise emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String laneID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        laneID - a string identifying the edge
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String laneID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getPMxEmission

        +
        public static SumoCommand getPMxEmission​(java.lang.String laneID)
        +
        Returns the particular matter emissions (in mg) on the given lane during + the last time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the particular matter emissions (in mg)
        +
        +
      • +
      + + + +
        +
      • +

        getShape

        +
        public static SumoCommand getShape​(java.lang.String laneID)
        +
        Returns this lane's shape.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        list of position describing the geometry
        +
        +
      • +
      + + + +
        +
      • +

        getTraveltime

        +
        public static SumoCommand getTraveltime​(java.lang.String laneID)
        +
        Returns the estimated travel time (in s) on the given lane during the + last time step.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        estimated travel time (in s)
        +
        +
      • +
      + + + +
        +
      • +

        getWidth

        +
        public static SumoCommand getWidth​(java.lang.String laneID)
        +
        Returns the width (in m) of the named lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        width of lane (in m)
        +
        +
      • +
      + + + +
        +
      • +

        getWaitingTime

        +
        public static SumoCommand getWaitingTime​(java.lang.String laneID)
        +
        getWaitingTime
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        Returns:
        +
        the waiting time of the lane (in s)
        +
        +
      • +
      + + + +
        +
      • +

        setAllowed

        +
        public static SumoCommand setAllowed​(java.lang.String laneID,
        +                                     SumoStringList allowedClasses)
        +
        Set a list of allowed vehicle classes.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        allowedClasses - allowed vehicle classes
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setDisallowed

        +
        public static SumoCommand setDisallowed​(java.lang.String laneID,
        +                                        SumoStringList disallowedClasses)
        +
        Set a list of disallowed vehicle classes.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        disallowedClasses - not allowed vehicle classes
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLength

        +
        public static SumoCommand setLength​(java.lang.String laneID,
        +                                    double length)
        +
        Set the length (in m) of the named lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        length - new length (in m) of the lane
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeed

        +
        public static SumoCommand setMaxSpeed​(java.lang.String laneID,
        +                                      double speed)
        +
        Set the maximum speed (in m/s) allowed on this lane.
        +
        +
        Parameters:
        +
        laneID - a string identifying a lane
        +
        speed - maximum velocity allowed (in m/s)
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Multientryexit.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,442 @@ + + + + + +Multientryexit (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Multientryexit

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Multientryexit
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Multientryexit
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Multientryexit() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetIDCount() +
      Returns the number of all multi-entry/multi-exit detectors in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all multi-entry/multi-exit detectors within the + scenario.
      +
      static SumoCommandgetLastStepHaltingNumber​(java.lang.String detID) +
      Returns the number of vehicles which were halting during the last time + step.
      +
      static SumoCommandgetLastStepMeanSpeed​(java.lang.String detID) +
      Returns the mean speed of vehicles (in m/s) that have been within the + named multi-entry/multi-exit detector within the last simulation step.
      +
      static SumoCommandgetLastStepVehicleIDs​(java.lang.String detID) +
      Returns the list of IDs of vehicles that have been within the named + multi-entry/multi-exit detector in the last simulation step.
      +
      static SumoCommandgetLastStepVehicleNumber​(java.lang.String detID) +
      Returns the number of vehicles that have been within the named + multi-entry/multi-exit detector within the last simulation step.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Multientryexit

        +
        public Multientryexit()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all multi-entry/multi-exit detectors within the + scenario.
        +
        +
        Returns:
        +
        list of IDs of all detectors
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all multi-entry/multi-exit detectors in the network.
        +
        +
        Returns:
        +
        the number of detectors
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepHaltingNumber

        +
        public static SumoCommand getLastStepHaltingNumber​(java.lang.String detID)
        +
        Returns the number of vehicles which were halting during the last time + step.
        +
        +
        Parameters:
        +
        detID - a string identifying the multi-entry/multi-exit detector
        +
        Returns:
        +
        number of halting vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepMeanSpeed

        +
        public static SumoCommand getLastStepMeanSpeed​(java.lang.String detID)
        +
        Returns the mean speed of vehicles (in m/s) that have been within the + named multi-entry/multi-exit detector within the last simulation step.
        +
        +
        Parameters:
        +
        detID - a string identifying the multi-entry/multi-exit detector
        +
        Returns:
        +
        average speed within the last time step
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleIDs

        +
        public static SumoCommand getLastStepVehicleIDs​(java.lang.String detID)
        +
        Returns the list of IDs of vehicles that have been within the named + multi-entry/multi-exit detector in the last simulation step.
        +
        +
        Parameters:
        +
        detID - a string identifying the multi-entry/multi-exit detector
        +
        Returns:
        +
        list of IDs of all vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getLastStepVehicleNumber

        +
        public static SumoCommand getLastStepVehicleNumber​(java.lang.String detID)
        +
        Returns the number of vehicles that have been within the named + multi-entry/multi-exit detector within the last simulation step.
        +
        +
        Parameters:
        +
        detID - a string identifying the multi-entry/multi-exit detector
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,224 @@ + + + + + +de.tudresden.sumo.cmd (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.sumo.cmd

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,179 @@ + + + + + +de.tudresden.sumo.cmd Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.sumo.cmd

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Package de.tudresden.sumo.cmd (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.sumo.cmd

+
+
No usage of de.tudresden.sumo.cmd
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Person.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,1267 @@ + + + + + +Person (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Person

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Person
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Person
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Person() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadd​(java.lang.String personID, + java.lang.String edgeID, + double pos, + double depart, + java.lang.String typeID) +
      Inserts a new person to the simulation at the given edge, position and + time (in s).
      +
      static SumoCommandappendDrivingStage​(java.lang.String personID, + java.lang.String toEdge, + java.lang.String lines, + java.lang.String stopID) +
      Appends a driving stage to the plan of the given person + The lines parameter should be a space-separated list of line ids
      +
      static SumoCommandappendWaitingStage​(java.lang.String personID, + double duration, + java.lang.String description, + java.lang.String stopID) +
      Appends a waiting stage with duration in s to the plan of the given person
      +
      static SumoCommandappendWalkingStage​(java.lang.String personID, + SumoStringList edges, + double arrivalPos, + double duration, + double speed, + java.lang.String stopID) +
      Appends a walking stage to the plan of the given person + The walking speed can either be specified, computed from the duration parameter (in s) or taken from the type of the person
      +
      static SumoCommandgetAngle​(java.lang.String personID) +
      get angle
      +
      static SumoCommandgetColor​(java.lang.String personID) +
      get lane position
      +
      static SumoCommandgetEdges​(java.lang.String personID) +
      get edges
      +
      static SumoCommandgetEdges​(java.lang.String personID, + int nextStageIndex) +
      get edges
      +
      static SumoCommandgetIDCount() +
      Returns the number of all persons in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of personIDs of all persons
      +
      static SumoCommandgetLanePosition​(java.lang.String personID) +
      get lane position
      +
      static SumoCommandgetLength​(java.lang.String personID) +
      get length
      +
      static SumoCommandgetMinGap​(java.lang.String personID) +
      get minGap
      +
      static SumoCommandgetNextEdge​(java.lang.String personID) +
      get next edge
      +
      static SumoCommandgetParameter​(java.lang.String personID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPersonNumber​(java.lang.String personID) +
      get person number
      +
      static SumoCommandgetPosition​(java.lang.String personID) +
      get position
      +
      static SumoCommandgetPosition3D​(java.lang.String personID) +
      get position3D
      +
      static SumoCommandgetRemainingStages​(java.lang.String personID) +
      get remaining stages
      +
      static SumoCommandgetRoadID​(java.lang.String personID) +
      get road ID
      +
      static SumoCommandgetSpeed​(java.lang.String personID) +
      get speed
      +
      static SumoCommandgetStage​(java.lang.String personID, + int nextStageIndex) +
      get stage
      +
      static SumoCommandgetTypeID​(java.lang.String personID) +
      get type ID
      +
      static SumoCommandgetVehicle​(java.lang.String personID) +
      get vehicle
      +
      static SumoCommandgetWaitingTime​(java.lang.String personID) +
      get waiting time
      +
      static SumoCommandgetWidth​(java.lang.String personID) +
      get width
      +
      static SumoCommandmoveToXY​(java.lang.String personID, + java.lang.String edgeID, + double x, + double y, + double angle, + byte keepRoute) +
      Place person at the given x,y coordinates and force it's angle to + the given value (for drawing).
      +
      static SumoCommandremoveStage​(java.lang.String personID, + int nextStageIndex) +
      Removes the nth next stage + nextStageIndex must be lower then value of getRemainingStages(personID) + nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
      +
      static SumoCommandrerouteTraveltime​(java.lang.String personID) +
      rerouteTraveltime + + Computes a new route for the person using the global edge traveltime information.
      +
      static SumoCommandsetColor​(java.lang.String personID, + SumoColor color) +
      sets color for person with the given ID.
      +
      static SumoCommandsetHeight​(java.lang.String personID, + double height) +
      Sets the height in m for this person.
      +
      static SumoCommandsetLength​(java.lang.String personID, + double length) +
      Sets the length in m for the given person.
      +
      static SumoCommandsetMinGap​(java.lang.String personID, + double minGap) +
      Sets the offset (gap to front person if halting) for this vehicle.
      +
      static SumoCommandsetParameter​(java.lang.String personID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetSpeed​(java.lang.String personID, + double speed) +
      Sets the maximum speed in m/s for the named person for subsequent step.
      +
      static SumoCommandsetType​(java.lang.String personID, + java.lang.String typeID) +
      Sets the id of the type for the named person.
      +
      static SumoCommandsetWidth​(java.lang.String personID, + double width) +
      Sets the width in m for this person.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Person

        +
        public Person()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public static SumoCommand add​(java.lang.String personID,
        +                              java.lang.String edgeID,
        +                              double pos,
        +                              double depart,
        +                              java.lang.String typeID)
        +
        Inserts a new person to the simulation at the given edge, position and + time (in s). This function should be followed by appending Stages or the person + will immediatly vanish on departure.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        edgeID - edgeID
        +
        pos - pos
        +
        depart - depart
        +
        typeID - typeID
        +
        +
      • +
      + + + +
        +
      • +

        appendWaitingStage

        +
        public static SumoCommand appendWaitingStage​(java.lang.String personID,
        +                                             double duration,
        +                                             java.lang.String description,
        +                                             java.lang.String stopID)
        +
        Appends a waiting stage with duration in s to the plan of the given person
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        duration - duration
        +
        description - description
        +
        stopID - stopID
        +
        +
      • +
      + + + +
        +
      • +

        appendWalkingStage

        +
        public static SumoCommand appendWalkingStage​(java.lang.String personID,
        +                                             SumoStringList edges,
        +                                             double arrivalPos,
        +                                             double duration,
        +                                             double speed,
        +                                             java.lang.String stopID)
        +
        Appends a walking stage to the plan of the given person + The walking speed can either be specified, computed from the duration parameter (in s) or taken from the type of the person
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        edges - edges
        +
        arrivalPos - arrivalPos
        +
        duration - duration
        +
        speed - speed
        +
        stopID - stopID
        +
        +
      • +
      + + + +
        +
      • +

        appendDrivingStage

        +
        public static SumoCommand appendDrivingStage​(java.lang.String personID,
        +                                             java.lang.String toEdge,
        +                                             java.lang.String lines,
        +                                             java.lang.String stopID)
        +
        Appends a driving stage to the plan of the given person + The lines parameter should be a space-separated list of line ids
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        toEdge - toEdge
        +
        lines - lines
        +
        stopID - stopID
        +
        +
      • +
      + + + +
        +
      • +

        removeStage

        +
        public static SumoCommand removeStage​(java.lang.String personID,
        +                                      int nextStageIndex)
        +
        Removes the nth next stage + nextStageIndex must be lower then value of getRemainingStages(personID) + nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        nextStageIndex - nextStageIndex
        +
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        public static SumoCommand setSpeed​(java.lang.String personID,
        +                                   double speed)
        +
        Sets the maximum speed in m/s for the named person for subsequent step.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        speed - speed
        +
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public static SumoCommand setType​(java.lang.String personID,
        +                                  java.lang.String typeID)
        +
        Sets the id of the type for the named person.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        typeID - typeID
        +
        +
      • +
      + + + +
        +
      • +

        setWidth

        +
        public static SumoCommand setWidth​(java.lang.String personID,
        +                                   double width)
        +
        Sets the width in m for this person.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        width - width
        +
        +
      • +
      + + + +
        +
      • +

        setHeight

        +
        public static SumoCommand setHeight​(java.lang.String personID,
        +                                    double height)
        +
        Sets the height in m for this person.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        height - height
        +
        +
      • +
      + + + +
        +
      • +

        setLength

        +
        public static SumoCommand setLength​(java.lang.String personID,
        +                                    double length)
        +
        Sets the length in m for the given person.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        length - length
        +
        +
      • +
      + + + +
        +
      • +

        setMinGap

        +
        public static SumoCommand setMinGap​(java.lang.String personID,
        +                                    double minGap)
        +
        Sets the offset (gap to front person if halting) for this vehicle.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        minGap - minGap
        +
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public static SumoCommand setColor​(java.lang.String personID,
        +                                   SumoColor color)
        +
        sets color for person with the given ID. + i.e. (255,0,0,0) for the color red. + The fourth integer (alpha) is only used when drawing persons with raster images
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        color - color
        +
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public static SumoCommand getColor​(java.lang.String personID)
        +
        get lane position
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        The position of the person along the lane measured in m.
        +
        +
      • +
      + + + +
        +
      • +

        getLength

        +
        public static SumoCommand getLength​(java.lang.String personID)
        +
        get length
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        Returns the length in m of the given person.
        +
        +
      • +
      + + + +
        +
      • +

        getWaitingTime

        +
        public static SumoCommand getWaitingTime​(java.lang.String personID)
        +
        get waiting time
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        The waiting time of a person is defined as the time (in seconds) spent with a + speed below 0.1m/s since the last time it was faster than 0.1m/s. + (basically, the waiting time of a person is reset to 0 every time it moves).
        +
        +
      • +
      + + + +
        +
      • +

        getWidth

        +
        public static SumoCommand getWidth​(java.lang.String personID)
        +
        get width
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        Returns the width in m of this person.
        +
        +
      • +
      + + + +
        +
      • +

        getNextEdge

        +
        public static SumoCommand getNextEdge​(java.lang.String personID)
        +
        get next edge
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        If the person is walking, returns the next edge on the persons route + (including crossing and walkingareas). If there is no further edge or the + person is in another stage, returns the empty string.
        +
        +
      • +
      + + + +
        +
      • +

        getEdges

        +
        public static SumoCommand getEdges​(java.lang.String personID)
        +
        get edges
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        If the person is walking, returns the next edge on the persons route + (including crossing and walkingareas). If there is no further edge or the + person is in another stage, returns the empty string.
        +
        +
      • +
      + + + +
        +
      • +

        getEdges

        +
        public static SumoCommand getEdges​(java.lang.String personID,
        +                                   int nextStageIndex)
        +
        get edges
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        nextStageIndex -
        +
        Returns:
        +
        Returns a list of all edges in the next stage. + For waiting stages this is a single edge + For walking stages this is the complete route + For driving stages this is [origin, destination] + + nextStageIndex 0 retrieves value for the current stage. + nextStageIndex must be lower then value of getRemainingStages(personID)
        +
        +
      • +
      + + + +
        +
      • +

        getStage

        +
        public static SumoCommand getStage​(java.lang.String personID,
        +                                   int nextStageIndex)
        +
        get stage
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        nextStageIndex -
        +
        Returns:
        +
        Returns the type of the nth next stage + 0 for not-yet-departed + 1 for waiting + 2 for walking + 3 for driving + nextStageIndex 0 retrieves value for the current stage. + nextStageIndex must be lower then value of getRemainingStages(personID)
        +
        +
      • +
      + + + +
        +
      • +

        getRemainingStages

        +
        public static SumoCommand getRemainingStages​(java.lang.String personID)
        +
        get remaining stages
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        Returns the number of remaining stages (at least 1)
        +
        +
      • +
      + + + +
        +
      • +

        getVehicle

        +
        public static SumoCommand getVehicle​(java.lang.String personID)
        +
        get vehicle
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        Returns the id of the current vehicle if the person is in stage driving + and has entered a vehicle. + Return the empty string otherwise
        +
        +
      • +
      + + + +
        +
      • +

        getLanePosition

        +
        public static SumoCommand getLanePosition​(java.lang.String personID)
        +
        get lane position
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        The position of the person along the lane measured in m.
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all persons in the network.
        +
        +
        Returns:
        +
        the number of persons in the network
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of personIDs of all persons
        +
        +
        Returns:
        +
        list of IDs of all persons
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String personID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        param - a string personIDentifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String personID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        public static SumoCommand getSpeed​(java.lang.String personID)
        +
        get speed
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the speed in m/s
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String personID)
        +
        get position
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the position 2D
        +
        +
      • +
      + + + +
        +
      • +

        getPosition3D

        +
        public static SumoCommand getPosition3D​(java.lang.String personID)
        +
        get position3D
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the position 3D
        +
        +
      • +
      + + + +
        +
      • +

        getAngle

        +
        public static SumoCommand getAngle​(java.lang.String personID)
        +
        get angle
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the angle
        +
        +
      • +
      + + + +
        +
      • +

        getRoadID

        +
        public static SumoCommand getRoadID​(java.lang.String personID)
        +
        get road ID
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the personID of the road
        +
        +
      • +
      + + + +
        +
      • +

        getTypeID

        +
        public static SumoCommand getTypeID​(java.lang.String personID)
        +
        get type ID
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the type ID of the person
        +
        +
      • +
      + + + +
        +
      • +

        getPersonNumber

        +
        public static SumoCommand getPersonNumber​(java.lang.String personID)
        +
        get person number
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the person number
        +
        +
      • +
      + + + +
        +
      • +

        getMinGap

        +
        public static SumoCommand getMinGap​(java.lang.String personID)
        +
        get minGap
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        the value for the minimum Ggap of the person
        +
        +
      • +
      + + + +
        +
      • +

        rerouteTraveltime

        +
        public static SumoCommand rerouteTraveltime​(java.lang.String personID)
        +
        rerouteTraveltime + + Computes a new route for the person using the global edge traveltime information.
        +
        +
        Parameters:
        +
        personID - a string personIDentifying the person
        +
        Returns:
        +
        SumoComand
        +
        +
      • +
      + + + +
        +
      • +

        moveToXY

        +
        public static SumoCommand moveToXY​(java.lang.String personID,
        +                                   java.lang.String edgeID,
        +                                   double x,
        +                                   double y,
        +                                   double angle,
        +                                   byte keepRoute)
        +
        Place person at the given x,y coordinates and force it's angle to + the given value (for drawing). + If the angle is set to INVALID_DOUBLE_VALUE, the vehicle assumes the + natural angle of the edge on which it is driving. + If keepRoute is set to 1, the closest position + within the existing route is taken. If keepRoute is set to 0, the vehicle may move to + any edge in the network but it's route then only consists of that edge. + If keepRoute is set to 2 the person has all the freedom of keepRoute=0 + but in addition to that may even move outside the road network. + edgeID is an optional placement hint to resolve ambiguities
        +
        +
        Parameters:
        +
        personID - person id
        +
        edgeID - edge id
        +
        x - x
        +
        y - y
        +
        angle - angle
        +
        keepRoute - keepRoute
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Poi.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,609 @@ + + + + + +Poi (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Poi

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Poi
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Poi
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Poi() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadd​(java.lang.String poiID, + double x, + double y, + SumoColor color, + java.lang.String poiType, + int layer) +
      Add a new point-of-interest.
      +
      static SumoCommandgetColor​(java.lang.String poiID) +
      Returns the color of this poi.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all Poi's in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all poi.
      +
      static SumoCommandgetParameter​(java.lang.String poiID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPosition​(java.lang.String poiID) +
      Returns the position of this poi.
      +
      static SumoCommandgetType​(java.lang.String poiID) +
      Returns the type of the poi.
      +
      static SumoCommandremove​(java.lang.String poiID, + int layer) +
      Remove a poi.
      +
      static SumoCommandsetColor​(java.lang.String poiID, + SumoColor color) +
      Set the color of this poi.
      +
      static SumoCommandsetParameter​(java.lang.String poiID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetPosition​(java.lang.String poiID, + double x, + double y) +
      Set the position of this poi.
      +
      static SumoCommandsetType​(java.lang.String poiID, + java.lang.String poiType) +
      Set the type of the poi.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Poi

        +
        public Poi()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public static SumoCommand add​(java.lang.String poiID,
        +                              double x,
        +                              double y,
        +                              SumoColor color,
        +                              java.lang.String poiType,
        +                              int layer)
        +
        Add a new point-of-interest.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        x - x-coordinate of the point
        +
        y - y-coordinate of the point
        +
        color - value (r,g,b,a) of color
        +
        poiType - a string identifying the type of a poi
        +
        layer - an integer identifying the layer
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all Poi's in the network.
        +
        +
        Returns:
        +
        the number of POI's in the network
        +
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public static SumoCommand getColor​(java.lang.String poiID)
        +
        Returns the color of this poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        Returns:
        +
        color value
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all poi.
        +
        +
        Returns:
        +
        a list of IDs of all points of interest
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String poiID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        poiID - a string identifying the poi
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String poiID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String poiID)
        +
        Returns the position of this poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        Returns:
        +
        position of the point
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public static SumoCommand getType​(java.lang.String poiID)
        +
        Returns the type of the poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        Returns:
        +
        type of the point
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public static SumoCommand remove​(java.lang.String poiID,
        +                                 int layer)
        +
        Remove a poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        layer - an integer identifying the layer
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public static SumoCommand setColor​(java.lang.String poiID,
        +                                   SumoColor color)
        +
        Set the color of this poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        color - value (r,g,b,a) of color
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setPosition

        +
        public static SumoCommand setPosition​(java.lang.String poiID,
        +                                      double x,
        +                                      double y)
        +
        Set the position of this poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        x - x-coordinate of the point
        +
        y - y-coordinate of the point
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public static SumoCommand setType​(java.lang.String poiID,
        +                                  java.lang.String poiType)
        +
        Set the type of the poi.
        +
        +
        Parameters:
        +
        poiID - a string identifying the point-of-interest
        +
        poiType - a string identifying the type of a poi
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Polygon.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,657 @@ + + + + + +Polygon (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Polygon

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Polygon
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Polygon
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Polygon() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadd​(java.lang.String polygonID, + SumoGeometry shape, + SumoColor color, + boolean fill, + java.lang.String polygonType, + int layer) +
      Add a new polygon.
      +
      static SumoCommandgetColor​(java.lang.String polygonID) +
      Returns the color of this polygon.
      +
      static SumoCommandgetFilled​(java.lang.String polygonID) +
      Returns the shape of this polygon.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all Polygons in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all polygons.
      +
      static SumoCommandgetParameter​(java.lang.String polygonID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetShape​(java.lang.String polygonID) +
      Returns the shape of this polygon.
      +
      static SumoCommandgetType​(java.lang.String polygonID) +
      Returns the type of the polygon.
      +
      static SumoCommandremove​(java.lang.String polygonID, + int layer) +
      Remove a polygon.
      +
      static SumoCommandsetColor​(java.lang.String polygonID, + SumoColor color) +
      Set the color of this polygon.
      +
      static SumoCommandsetFilled​(java.lang.String polygonID, + boolean fill) +
      Set the color of this polygon.
      +
      static SumoCommandsetParameter​(java.lang.String polygonID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetShape​(java.lang.String polygonID, + SumoStringList shape) +
      Set the shape of this polygon.
      +
      static SumoCommandsetType​(java.lang.String polygonID, + java.lang.String polygonType) +
      Set the type of the polygon.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Polygon

        +
        public Polygon()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getColor

        +
        public static SumoCommand getColor​(java.lang.String polygonID)
        +
        Returns the color of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        Returns:
        +
        color of the polygon
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all polygons.
        +
        +
        Returns:
        +
        a list of IDs of all polygons
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all Polygons in the network.
        +
        +
        Returns:
        +
        the number of polygons in the network
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String polygonID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String polygonID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getShape

        +
        public static SumoCommand getShape​(java.lang.String polygonID)
        +
        Returns the shape of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon return the shape of the + polygon
        +
        Returns:
        +
        the shape
        +
        +
      • +
      + + + +
        +
      • +

        getFilled

        +
        public static SumoCommand getFilled​(java.lang.String polygonID)
        +
        Returns the shape of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon return the shape of the + polygon
        +
        Returns:
        +
        the shape
        +
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public static SumoCommand getType​(java.lang.String polygonID)
        +
        Returns the type of the polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        Returns:
        +
        type of the polygon
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public static SumoCommand add​(java.lang.String polygonID,
        +                              SumoGeometry shape,
        +                              SumoColor color,
        +                              boolean fill,
        +                              java.lang.String polygonType,
        +                              int layer)
        +
        Add a new polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        shape - shape of the polygon
        +
        color - value (r,g,b,a) of color
        +
        fill - polygon is filled if the value is != 0
        +
        polygonType - type of the polygon
        +
        layer - an integer identifying the layer
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public static SumoCommand remove​(java.lang.String polygonID,
        +                                 int layer)
        +
        Remove a polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        layer - an integer identifying the layer
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public static SumoCommand setColor​(java.lang.String polygonID,
        +                                   SumoColor color)
        +
        Set the color of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        color - value (r,g,b,a) of color
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setFilled

        +
        public static SumoCommand setFilled​(java.lang.String polygonID,
        +                                    boolean fill)
        +
        Set the color of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        fill - parameter if polygon should be filled
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setShape

        +
        public static SumoCommand setShape​(java.lang.String polygonID,
        +                                   SumoStringList shape)
        +
        Set the shape of this polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        shape - shape of the polygon
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public static SumoCommand setType​(java.lang.String polygonID,
        +                                  java.lang.String polygonType)
        +
        Set the type of the polygon.
        +
        +
        Parameters:
        +
        polygonID - a string identifying the polygon
        +
        polygonType - type of the polygon
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Route.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,444 @@ + + + + + +Route (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Route

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Route
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Route
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Route() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadd​(java.lang.String routeID, + SumoStringList edges) +
      Add a new route.
      +
      static SumoCommandgetEdges​(java.lang.String routeID) +
      Returns the IDs of the edges this route covers.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all Routes in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all currently loaded routes.
      +
      static SumoCommandgetParameter​(java.lang.String routeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandsetParameter​(java.lang.String routeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Route

        +
        public Route()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getEdges

        +
        public static SumoCommand getEdges​(java.lang.String routeID)
        +
        Returns the IDs of the edges this route covers.
        +
        +
        Parameters:
        +
        routeID - a string identifying the route
        +
        Returns:
        +
        a list of IDs of the edges
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all currently loaded routes.
        +
        +
        Returns:
        +
        a list of ID's of all routes
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all Routes in the network.
        +
        +
        Returns:
        +
        the number of routes in the network
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String routeID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        routeID - a string identifying the route
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String routeID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public static SumoCommand add​(java.lang.String routeID,
        +                              SumoStringList edges)
        +
        Add a new route.
        +
        +
        Parameters:
        +
        routeID - a string identifying the route
        +
        edges - list of edges the new route is following
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Simulation.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,1217 @@ + + + + + +Simulation (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Simulation

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Simulation
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Simulation
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Simulation

        +
        public Simulation()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        convert2D

        +
        public static SumoCommand convert2D​(java.lang.String edgeID,
        +                                    double pos,
        +                                    byte laneIndex,
        +                                    java.lang.String toGeo)
        +
        convert2D
        +
        +
        Parameters:
        +
        edgeID - edge id
        +
        pos - pos
        +
        laneIndex - index
        +
        toGeo - geo
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        convert3D

        +
        public static SumoCommand convert3D​(java.lang.String edgeID,
        +                                    double pos,
        +                                    byte laneIndex,
        +                                    java.lang.String toGeo)
        +
        convert3D
        +
        +
        Parameters:
        +
        edgeID - edge id
        +
        pos - pos
        +
        laneIndex - index
        +
        toGeo - geo
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        convertGeo

        +
        public static SumoCommand convertGeo​(double x,
        +                                     double y,
        +                                     boolean fromGeo)
        +
        convertGeo
        +
        +
        Parameters:
        +
        x - x
        +
        y - y
        +
        fromGeo - geo
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        convertRoad

        +
        public static SumoCommand convertRoad​(double x,
        +                                      double y,
        +                                      boolean isGeo,
        +                                      java.lang.String vClass)
        +
        convertRoad
        +
        +
        Parameters:
        +
        x - x
        +
        y - y
        +
        isGeo - geo
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getArrivedIDList

        +
        public static SumoCommand getArrivedIDList()
        +
        Returns a list of IDs of vehicles which arrived in this time step.
        +
        +
        Returns:
        +
        list of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getArrivedNumber

        +
        public static SumoCommand getArrivedNumber()
        +
        Returns the number of vehicles which arrived in this time step.
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getBusStopWaiting

        +
        public static SumoCommand getBusStopWaiting()
        +
        Returns the current waiting time on bus stops(in ms).
        +
        +
        Returns:
        +
        waiting time
        +
        +
      • +
      + + + +
        +
      • +

        getParkingEndingVehiclesIDList

        +
        public static SumoCommand getParkingEndingVehiclesIDList()
        +
        getParkingEndingVehiclesIDList()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getParkingEndingVehiclesNumber

        +
        public static SumoCommand getParkingEndingVehiclesNumber()
        +
        getParkingEndingVehiclesNumber()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getParkingStartingVehiclesIDList

        +
        public static SumoCommand getParkingStartingVehiclesIDList()
        +
        getParkingStartingVehiclesIDList()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getParkingStartingVehiclesNumber

        +
        public static SumoCommand getParkingStartingVehiclesNumber()
        +
        getParkingStartingVehiclesNumber()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getStopEndingVehiclesIDList

        +
        public static SumoCommand getStopEndingVehiclesIDList()
        +
        getStopEndingVehiclesIDList()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getCollidingVehiclesNumber

        +
        public static SumoCommand getCollidingVehiclesNumber()
        +
        getCollidingVehiclesNumber()
        +
        +
        Returns:
        +
        Return number of vehicles involved in a collision (typically 2 per collision).
        +
        +
      • +
      + + + +
        +
      • +

        getCollidingVehiclesIDList

        +
        public static SumoCommand getCollidingVehiclesIDList()
        +
        getCollidingVehiclesNumber()
        +
        +
        Returns:
        +
        Return Ids of vehicles involved in a collision (typically 2 per collision)
        +
        +
      • +
      + + + +
        +
      • +

        getEmergencyStoppingVehiclesNumber

        +
        public static SumoCommand getEmergencyStoppingVehiclesNumber()
        +
        getEmergencyStoppingVehiclesNumber()
        +
        +
        Returns:
        +
        Return number of vehicles that performed an emergency stop in the last step
        +
        +
      • +
      + + + +
        +
      • +

        getEmergencyStoppingVehiclesIDList

        +
        public static SumoCommand getEmergencyStoppingVehiclesIDList()
        +
        getEmergencyStoppingVehiclesIDList()
        +
        +
        Returns:
        +
        Return Ids of vehicles that peformed an emergency stop in the last step
        +
        +
      • +
      + + + +
        +
      • +

        getStopEndingVehiclesNumber

        +
        public static SumoCommand getStopEndingVehiclesNumber()
        +
        getStopEndingVehiclesNumber()
        +
        +
        Returns:
        +
        number of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getStopStartingVehiclesIDList

        +
        public static SumoCommand getStopStartingVehiclesIDList()
        +
        getStopStartingVehiclesIDList()
        +
        +
        Returns:
        +
        list of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getStopStartingVehiclesNumber

        +
        public static SumoCommand getStopStartingVehiclesNumber()
        +
        getStopStartingVehiclesIDList()
        +
        +
        Returns:
        +
        list of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getCurrentTime

        +
        public static SumoCommand getCurrentTime()
        +
        getCurrentTime
        +
        +
        Returns:
        +
        current time in ms (integer). Note: this method only supports a simulation time up to 24 days and is only kept for legacy reasons
        +
        +
      • +
      + + + +
        +
      • +

        getTime

        +
        public static SumoCommand getTime()
        +
        getTime
        +
        +
        Returns:
        +
        current time in s (double)
        +
        +
      • +
      + + + +
        +
      • +

        getDeltaT

        +
        public static SumoCommand getDeltaT()
        +
        getDeltaT
        +
        +
        Returns:
        +
        delat time
        +
        +
      • +
      + + + +
        +
      • +

        getDepartedIDList

        +
        public static SumoCommand getDepartedIDList()
        +
        Returns a list of IDs of vehicles which departed in this time step.
        +
        +
        Returns:
        +
        list of IDs of vehicles which departed in this time step.
        +
        +
      • +
      + + + +
        +
      • +

        getDepartedNumber

        +
        public static SumoCommand getDepartedNumber()
        +
        Returns the number of vehicles which departed in this time step.
        +
        +
        Returns:
        +
        the number of vehicles which departed in this time step.
        +
        +
      • +
      + + + +
        +
      • +

        getDistance2D

        +
        public static SumoCommand getDistance2D​(double x1,
        +                                        double y1,
        +                                        double x2,
        +                                        double y2,
        +                                        boolean isGeo,
        +                                        boolean isDriving)
        +
        +
        Parameters:
        +
        x1 - x1
        +
        y1 - y1
        +
        x2 - x2
        +
        y2 - y2
        +
        isGeo - is geo
        +
        isDriving - is driving
        +
        Returns:
        +
        distance
        +
        +
      • +
      + + + +
        +
      • +

        getDistanceRoad

        +
        public static SumoCommand getDistanceRoad​(java.lang.String edgeID1,
        +                                          double pos1,
        +                                          java.lang.String edgeID2,
        +                                          double pos2,
        +                                          boolean isDriving)
        +
        +
        Parameters:
        +
        edgeID1 - first edge
        +
        pos1 - first position
        +
        edgeID2 - second edge
        +
        pos2 - second position
        +
        isDriving - is drinving
        +
        Returns:
        +
        the distance in [m]
        +
        +
      • +
      + + + +
        +
      • +

        getEndingTeleportIDList

        +
        public static SumoCommand getEndingTeleportIDList()
        +
        Returns a list of IDs of vehicles which ended to be teleported in this time step.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getEndingTeleportNumber

        +
        public static SumoCommand getEndingTeleportNumber()
        +
        Returns the number of vehicles which ended to be teleported in this time step.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getLoadedIDList

        +
        public static SumoCommand getLoadedIDList()
        +
        Returns a list of IDs of vehicles which were loaded in this time step.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getLoadedNumber

        +
        public static SumoCommand getLoadedNumber()
        +
        Return the number of vehicles which were loaded in this time step. * @return SumoCommand
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getMinExpectedNumber

        +
        public static SumoCommand getMinExpectedNumber()
        +
        Returns the number of vehicles which are in the net plus the ones still waiting to start.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getNetBoundary

        +
        public static SumoCommand getNetBoundary()
        +
        Returns the boundary box of the simulation network.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getStartingTeleportIDList

        +
        public static SumoCommand getStartingTeleportIDList()
        +
        Returns a list of IDs of vehicles which started to teleport in this time step.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getStartingTeleportNumber

        +
        public static SumoCommand getStartingTeleportNumber()
        +
        Returns the number of vehicles which started to teleport in this time step.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        clearPending

        +
        public static SumoCommand clearPending​(java.lang.String routeID)
        +
        Clear pending
        +
        +
        Parameters:
        +
        routeID - route id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        saveState

        +
        public static SumoCommand saveState​(java.lang.String filename)
        +
        save state
        +
        +
        Parameters:
        +
        filename -
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        findRoute

        +
        public static SumoCommand findRoute​(java.lang.String fromEdge,
        +                                    java.lang.String toEdge,
        +                                    java.lang.String vType,
        +                                    double depart,
        +                                    int routingMode)
        +
        findRoute
        +
        +
        Parameters:
        +
        fromEdge - first edge
        +
        toEdge - second edge
        +
        vType - vehicle type
        +
        depart - depart
        +
        routingMode - routing mode
        +
        Returns:
        +
        the route
        +
        +
      • +
      + + + +
        +
      • +

        findIntermodalRoute

        +
        public static SumoCommand findIntermodalRoute​(java.lang.String fromEdge,
        +                                              java.lang.String toEdge,
        +                                              java.lang.String modes,
        +                                              double depart,
        +                                              int routingMode,
        +                                              double speed,
        +                                              double walkingFactor,
        +                                              double departPos,
        +                                              double arrivalPos,
        +                                              double departPosLat,
        +                                              java.lang.String pType,
        +                                              java.lang.String vType,
        +                                              java.lang.String destStop)
        +
        findIntermodalRoute
        +
        +
        Parameters:
        +
        fromEdge - first edge
        +
        toEdge - second edge
        +
        modes - modes
        +
        depart - depart
        +
        routingMode - routing mode
        +
        speed - speed
        +
        walkingFactor - walkingFactor
        +
        departPos - departPos
        +
        arrivalPos - arrivalPos
        +
        departPosLat - departPosLat
        +
        pType - pType
        +
        vType - vType
        +
        destStop - destStop
        +
        Returns:
        +
        the route
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Trafficlight.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,804 @@ + + + + + +Trafficlight (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Trafficlight

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Trafficlight
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Trafficlight
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Trafficlight() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetCompleteRedYellowGreenDefinition​(java.lang.String tlsID) +
      Returns the complete traffic light program.
      +
      static SumoCommandgetControlledJunctions​(java.lang.String tlsID) +
      Returns the junctions controlled by the traffic light
      +
      static SumoCommandgetControlledLanes​(java.lang.String tlsID) +
      Returns the list of lanes which are controlled by the named traffic light.
      +
      static SumoCommandgetControlledLinks​(java.lang.String tlsID) +
      Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.
      +
      static SumoCommandgetExternalState​(java.lang.String tlsID) +
      Returns the external state
      +
      static SumoCommandgetIDCount() +
      Returns the number of all traffic lights in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of IDs of all traffic lights within the scenario.
      +
      static SumoCommandgetNextSwitch​(java.lang.String tlsID) +
      Returns the assumed time (in ms) at which the TLS changes the phase.
      +
      static SumoCommandgetParameter​(java.lang.String tlsID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPhase​(java.lang.String tlsID) +
      Returns the index of the current phase in the current program.
      +
      static SumoCommandgetPhaseDuration​(java.lang.String tlsID) +
      getPhaseDuration
      +
      static SumoCommandgetPhaseName​(java.lang.String tlsID) +
      Returns the name of the current phase in the current program.
      +
      static SumoCommandgetProgram​(java.lang.String tlsID) +
      Returns the id of the current program.
      +
      static SumoCommandgetRedYellowGreenState​(java.lang.String tlsID) +
      Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.
      +
      static SumoCommandsetCompleteRedYellowGreenDefinition​(java.lang.String tlsID, + SumoTLSProgram tls) +
      Set the complete traffic light program.
      +
      static SumoCommandsetParameter​(java.lang.String tlsID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetPhase​(java.lang.String tlsID, + int index) +
      Set the index of the current phase in the current program.
      +
      static SumoCommandsetPhaseDuration​(java.lang.String tlsID, + double phaseDuration) +
      Set the duration of the currently active phase (in s?).
      +
      static SumoCommandsetPhaseName​(java.lang.String tlsID, + java.lang.String name) +
      Set the name of the current phase in the current program.
      +
      static SumoCommandsetProgram​(java.lang.String tlsID, + java.lang.String programID) +
      Set the id of the current program.
      +
      static SumoCommandsetRedYellowGreenState​(java.lang.String tlsID, + java.lang.String state) +
      Set the named tl's state as a tuple of light definitions.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Trafficlight

        +
        public Trafficlight()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCompleteRedYellowGreenDefinition

        +
        public static SumoCommand getCompleteRedYellowGreenDefinition​(java.lang.String tlsID)
        +
        Returns the complete traffic light program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        program definition
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all traffic lights in the network.
        +
        +
        Returns:
        +
        number of traffic lights
        +
        +
      • +
      + + + +
        +
      • +

        getPhaseDuration

        +
        public static SumoCommand getPhaseDuration​(java.lang.String tlsID)
        +
        getPhaseDuration
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        phase duration
        +
        +
      • +
      + + + +
        +
      • +

        getControlledLanes

        +
        public static SumoCommand getControlledLanes​(java.lang.String tlsID)
        +
        Returns the list of lanes which are controlled by the named traffic light.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        list of controlled lanes
        +
        +
      • +
      + + + +
        +
      • +

        getControlledLinks

        +
        public static SumoCommand getControlledLinks​(java.lang.String tlsID)
        +
        Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        list of controlled links
        +
        +
      • +
      + + + +
        +
      • +

        getControlledJunctions

        +
        public static SumoCommand getControlledJunctions​(java.lang.String tlsID)
        +
        Returns the junctions controlled by the traffic light
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        list of controlled junctions
        +
        +
      • +
      + + + +
        +
      • +

        getExternalState

        +
        public static SumoCommand getExternalState​(java.lang.String tlsID)
        +
        Returns the external state
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        compound of the external state
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of IDs of all traffic lights within the scenario.
        +
        +
        Returns:
        +
        a list of IDs of all TLS
        +
        +
      • +
      + + + +
        +
      • +

        getNextSwitch

        +
        public static SumoCommand getNextSwitch​(java.lang.String tlsID)
        +
        Returns the assumed time (in ms) at which the TLS changes the phase.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        absolute time, counting from simulation start, at which TLS may change
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String tlsID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String tlsID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getPhase

        +
        public static SumoCommand getPhase​(java.lang.String tlsID)
        +
        Returns the index of the current phase in the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        index of the current phase
        +
        +
      • +
      + + + +
        +
      • +

        getPhaseName

        +
        public static SumoCommand getPhaseName​(java.lang.String tlsID)
        +
        Returns the name of the current phase in the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        name of the current phase
        +
        +
      • +
      + + + +
        +
      • +

        getProgram

        +
        public static SumoCommand getProgram​(java.lang.String tlsID)
        +
        Returns the id of the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        index of the current program
        +
        +
      • +
      + + + +
        +
      • +

        getRedYellowGreenState

        +
        public static SumoCommand getRedYellowGreenState​(java.lang.String tlsID)
        +
        Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setCompleteRedYellowGreenDefinition

        +
        public static SumoCommand setCompleteRedYellowGreenDefinition​(java.lang.String tlsID,
        +                                                              SumoTLSProgram tls)
        +
        Set the complete traffic light program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        tls - complete program definition
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setPhase

        +
        public static SumoCommand setPhase​(java.lang.String tlsID,
        +                                   int index)
        +
        Set the index of the current phase in the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        index - an integer identifying the phase (it must be between 0 and the number of phases known to the current program of the tls - 1)
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setPhaseName

        +
        public static SumoCommand setPhaseName​(java.lang.String tlsID,
        +                                       java.lang.String name)
        +
        Set the name of the current phase in the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        name - a string with the phase name
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setPhaseDuration

        +
        public static SumoCommand setPhaseDuration​(java.lang.String tlsID,
        +                                           double phaseDuration)
        +
        Set the duration of the currently active phase (in s?).
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        phaseDuration - remaining duration of the current phase
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setProgram

        +
        public static SumoCommand setProgram​(java.lang.String tlsID,
        +                                     java.lang.String programID)
        +
        Set the id of the current program.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        programID - a string identifying the program
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setRedYellowGreenState

        +
        public static SumoCommand setRedYellowGreenState​(java.lang.String tlsID,
        +                                                 java.lang.String state)
        +
        Set the named tl's state as a tuple of light definitions.
        +
        +
        Parameters:
        +
        tlsID - a string identifying the traffic light
        +
        state - as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicle.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,3618 @@ + + + + + +Vehicle (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Vehicle

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Vehicle
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Vehicle
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Vehicle() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandadd​(java.lang.String vehID, + java.lang.String typeID, + java.lang.String routeID, + int depart, + double pos, + double speed, + byte lane) +
      Add a new vehicle.
      +
      static SumoCommandaddFull​(java.lang.String vehID, + java.lang.String routeID, + java.lang.String typeID, + java.lang.String depart, + java.lang.String departLane, + java.lang.String departPosition, + java.lang.String departSpeed, + java.lang.String arrivalLane, + java.lang.String arrivalPosition, + java.lang.String arrivalSpeed, + java.lang.String fromTAZ, + java.lang.String toTAZ, + java.lang.String line, + int person_capacity, + int person_number) +
      Add a new vehicle.
      +
      static SumoCommandchangeLane​(java.lang.String vehID, + byte laneIndex, + double duration) +
      Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.
      +
      static SumoCommandchangeSublane​(java.lang.String vehID, + double latDist) +
      Forces a lateral change by the given amount (negative values indicate changing to the right, positive to the left) + This will override any other lane change motivations but conform to + safety-constraints as configured by laneChangeMode.
      +
      static SumoCommandchangeTarget​(java.lang.String vehID, + java.lang.String edgeID) +
      The vehicle's destination edge is set to the given.
      +
      static SumoCommandgetAccel​(java.lang.String vehID) +
      Returns the acceleration of the named vehicle within the last step.
      +
      static SumoCommandgetAccumulatedWaitingTime​(java.lang.String vehID) +
      Returns the vehicle class.
      +
      static SumoCommandgetActionStepLength​(java.lang.String vehID) +
      Returns the action step length for this vehicle.
      +
      static SumoCommandgetAdaptedTraveltime​(java.lang.String vehID, + double time, + java.lang.String edgeID) +
      Returns the edge travel time for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandgetAllowedSpeed​(java.lang.String vehID) +
      Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
      +
      static SumoCommandgetAngle​(java.lang.String vehID) +
      Returns the angle of the named vehicle within the last time step.
      +
      static SumoCommandgetApparentDecel​(java.lang.String vehID) +
      Returns the apparent deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandgetBestLanes​(java.lang.String vehID) +
      getBestLanes
      +
      static SumoCommandgetCO2Emission​(java.lang.String vehID) +
      Returns the CO2 emission in mg for the last time step.
      +
      static SumoCommandgetCOEmission​(java.lang.String vehID) +
      Returns the CO emission in mg for the last time step.
      +
      static SumoCommandgetColor​(java.lang.String vehID) +
      Returns the vehicle's color (RGBA).
      +
      static SumoCommandgetDecel​(java.lang.String vehID) +
      Returns the deceleration of the named vehicle within the last time step.
      +
      static SumoCommandgetDistance​(java.lang.String vehID) +
      Get the distance to the starting point acts as a odometer
      +
      static SumoCommandgetDrivingDistance​(java.lang.String vehID, + java.lang.String edgeID, + double pos, + byte laneID) +
      Returns the driving distance (in m) of the named vehicle within the last tine step.
      +
      static SumoCommandgetDrivingDistance2D​(java.lang.String vehID, + double x, + double y) +
      getDrivingDistance2D
      +
      static SumoCommandgetEffort​(java.lang.String vehID, + double time, + java.lang.String edgeID) +
      Returns the edge effort for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandgetElectricityConsumption​(java.lang.String vehID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandgetEmergencyDecel​(java.lang.String vehID) +
      Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandgetEmissionClass​(java.lang.String vehID) +
      Returns the emission class of the named vehicle.
      +
      static SumoCommandgetFuelConsumption​(java.lang.String vehID) +
      Returns the fuel consumption in ml for the last time step.
      +
      static SumoCommandgetHCEmission​(java.lang.String vehID) +
      Returns the HC emission (in mg) during the last time step.
      +
      static SumoCommandgetHeight​(java.lang.String vehID) +
      Returns the height in m of this vehicle.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all vehicles in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of ids of all vehicles currently running within the scenario.
      +
      static SumoCommandgetImperfection​(java.lang.String vehID) +
      getImperfection
      +
      static SumoCommandgetLaneChangeMode​(java.lang.String vehID) +
      Gets the vehicle's lane change mode as a bitset.
      +
      static SumoCommandgetLaneChangeState​(java.lang.String vehID, + int direction) +
      Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandgetLaneID​(java.lang.String vehID) +
      Returns the id of the lane the named vehicle was at within the last step.
      +
      static SumoCommandgetLaneIndex​(java.lang.String vehID) +
      Returns the index of the lane the named vehicle was at within the last step.
      +
      static SumoCommandgetLanePosition​(java.lang.String vehID) +
      Returns the position of the vehicle along the lane (in m).
      +
      static SumoCommandgetLastActionTime​(java.lang.String vehID) +
      Returns the time of last action point for this vehicle.
      +
      static SumoCommandgetLateralAlignment​(java.lang.String vehID) +
      Returns The preferred lateral alignment of the vehicle
      +
      static SumoCommandgetLateralLanePosition​(java.lang.String vehID) +
      Returns The lateral position of the vehicle on its current lane measured in m.
      +
      static SumoCommandgetLeader​(java.lang.String vehID, + double dist) +
      Return the leading vehicle id together with the distance.
      +
      static SumoCommandgetLength​(java.lang.String vehID) +
      Returns the length (in m) of the named vehicle.
      +
      static SumoCommandgetLine​(java.lang.String vehID) +
      Returns the length (in m) of the named vehicle.
      +
      static SumoCommandgetMaxSpeed​(java.lang.String vehID) +
      Returns the maximum speed(in m/s) of the named vehicle.
      +
      static SumoCommandgetMaxSpeedLat​(java.lang.String vehID) +
      Returns the maximum lateral speed in m/s of this vehicle.
      +
      static SumoCommandgetMinGap​(java.lang.String vehID) +
      Returns the minimum gap (in m) between this vehicle and the vehicle before it.
      +
      static SumoCommandgetMinGapLat​(java.lang.String vehID) +
      Returns The desired lateral gap of this vehicle at 50km/h in m
      +
      static SumoCommandgetNextStops​(java.lang.String vehID) +
      Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...]
      +
      static SumoCommandgetNextTLS​(java.lang.String vehID) +
      Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
      +
      static SumoCommandgetNoiseEmission​(java.lang.String vehID) +
      Returns the noise emission (in db) generated by the vehicle during the last time step.
      +
      static SumoCommandgetNOxEmission​(java.lang.String vehID) +
      Returns the NOx emissions (in mg) generated by the vehicle during the last time step.
      +
      static SumoCommandgetParameter​(java.lang.String vehID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetPersonIDList​(java.lang.String vehID) +
      Returns the list of persons which includes those defined using attribute 'personNumber' + as well as -objects which are riding in this vehicle.
      +
      static SumoCommandgetPersonNumber​(java.lang.String vehID) +
      getPersonNumber
      +
      static SumoCommandgetPMxEmission​(java.lang.String vehID) +
      Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.
      +
      static SumoCommandgetPosition​(java.lang.String vehID) +
      Returns the position of the named vehicle within the last step [m,m].
      +
      static SumoCommandgetPosition3D​(java.lang.String vehID) +
      Returns the position of the named vehicle within the last step [m,m,m].
      +
      static SumoCommandgetRoadID​(java.lang.String vehID) +
      Returns the id of the edge the named vehicle was at within the last step.
      +
      static SumoCommandgetRoute​(java.lang.String vehID) +
      Returns the ids of the edges the vehicle's route is made of.
      +
      static SumoCommandgetRouteID​(java.lang.String vehID) +
      Returns the id of the route of the named vehicle.
      +
      static SumoCommandgetRouteIndex​(java.lang.String vehID) +
      Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed
      +
      static SumoCommandgetRoutingMode​(java.lang.String vehID) +
      returns the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
      +
      static SumoCommandgetShapeClass​(java.lang.String vehID) +
      getShapeClass
      +
      static SumoCommandgetSignals​(java.lang.String vehID) +
      getSignals
      +
      static SumoCommandgetSlope​(java.lang.String vehID) +
      getSlope
      +
      static SumoCommandgetSpeed​(java.lang.String vehID) +
      Returns the speed (in m/s) of the named vehicle within the last step.
      +
      static SumoCommandgetSpeedDeviation​(java.lang.String vehID) +
      Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.
      +
      static SumoCommandgetSpeedFactor​(java.lang.String vehID) +
      Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
      +
      static SumoCommandgetSpeedMode​(java.lang.String vehID) +
      Returns the speed mode of a vehicle
      +
      static SumoCommandgetSpeedWithoutTraCI​(java.lang.String vehID) +
      getSpeedWithoutTraCI
      +
      static SumoCommandgetStopState​(java.lang.String vehID) +
      Returns information in regard to stopping: The returned integer is defined as 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop with each of these flags defined as 0 or 1
      +
      static SumoCommandgetTau​(java.lang.String vehID) +
      getTau
      +
      static SumoCommandgetTypeID​(java.lang.String vehID) +
      Returns the id of the type of the named vehicle.
      +
      static SumoCommandgetVehicleClass​(java.lang.String vehID) +
      Returns the vehicle class.
      +
      static SumoCommandgetVia​(java.lang.String vehID) +
      Returns the ids of via edges for this vehicle
      +
      static SumoCommandgetWaitingTime​(java.lang.String vehID) +
      The waiting time of a vehicle is defined as the time (in seconds) spent with a speed below 0.1m/s since the last time it was faster than 0.1m/s.
      +
      static SumoCommandgetWidth​(java.lang.String vehID) +
      Returns the vehicle's width (in m).
      +
      static SumoCommandisAtBusStop​(java.lang.String vehID) +
      isAtBusStop
      +
      static SumoCommandisAtContainerStop​(java.lang.String vehID) +
      Return whether the vehicle is stopped at a container stop
      +
      static SumoCommandisRouteValid​(java.lang.String vehID) +
      Returns whether the Route is valid.
      +
      static SumoCommandisStopped​(java.lang.String vehID) +
      isStopped
      +
      static SumoCommandisStoppedParking​(java.lang.String vehID) +
      isStoppedParking
      +
      static SumoCommandisStoppedTriggered​(java.lang.String vehID) +
      Return whether the vehicle is stopped and waiting for a person or container
      +
      static SumoCommandmoveTo​(java.lang.String vehID, + java.lang.String laneID, + double pos) +
      Moves the vehicle to a new position.
      +
      static SumoCommandmoveToXY​(java.lang.String vehID, + java.lang.String edgeID, + int lane, + double x, + double y, + double angle, + byte keepRoute) +
      Place vehicle at the given x,y coordinates and force it's angle to + the given value (for drawing).
      +
      static SumoCommandremove​(java.lang.String vehID, + byte reason) +
      Removes vehicle with the given ID for the given reason.
      +
      static SumoCommandrerouteEffort​(java.lang.String vehID) +
      Computes a new route using the vehicle's internal and the global edge effort information.
      +
      static SumoCommandrerouteParkingArea​(java.lang.String vehID, + java.lang.String parkingAreaID) +
      Changes the next parking area in parkingAreaID, updates the vehicle route, + and preserve consistency in case of passengers/containers on board.
      +
      static SumoCommandrerouteTraveltime​(java.lang.String vehID) +
      Computes a new route using the vehicle's internal and the global edge travel time information.
      +
      static SumoCommandresume​(java.lang.String vehID) +
      Continue after a stop
      +
      static SumoCommandsetAccel​(java.lang.String vehID, + double accel) +
      Sets the acceleration of the named vehicle.
      +
      static SumoCommandsetActionStepLength​(java.lang.String vehID, + double actionStepLength, + boolean resetActionOffset) +
      Sets the action step length for this vehicle.
      +
      static SumoCommandsetAdaptedTraveltime​(java.lang.String vehID, + double begTime, + double endTime, + java.lang.String edgeID, + double time) +
      Sets the edge travel time of the named vehicle.
      +
      static SumoCommandsetApparentDecel​(java.lang.String vehID, + double decel) +
      Sets the apparent deceleration in m/s^2 for this vehicle.
      +
      static SumoCommandsetBusStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a bus stop with the given parameters.
      +
      static SumoCommandsetChargingStationStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a stop at a chargingStation with the given parameters.
      +
      static SumoCommandsetColor​(java.lang.String vehID, + SumoColor color) +
      Sets the vehicle's color (RGBA).
      +
      static SumoCommandsetContainerStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a container stop with the given parameters.
      +
      static SumoCommandsetDecel​(java.lang.String vehID, + double decel) +
      Sets the deceleration of the named vehicle.
      +
      static SumoCommandsetEffort​(java.lang.String vehID, + int begTime, + int endTime, + java.lang.String edgeID, + double effort) +
      Sets the edge effort for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandsetEmergencyDecel​(java.lang.String vehID, + double decel) +
      Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
      +
      static SumoCommandsetEmissionClass​(java.lang.String vehID, + java.lang.String clazz) +
      Sets the emission class of the named vehicle.
      +
      static SumoCommandsetHeight​(java.lang.String vehID, + double height) +
      Sets the height in m for this vehicle.
      +
      static SumoCommandsetImperfection​(java.lang.String vehID, + double imperfection) +
      setImperfection
      +
      static SumoCommandsetLaneChangeMode​(java.lang.String vehID, + int lcm) +
      Sets the vehicle's lane change mode as a bitset.
      +
      static SumoCommandsetLateralAlignment​(java.lang.String vehID, + java.lang.String align) +
      Sets the preferred lateral alignment for this vehicle.
      +
      static SumoCommandsetLength​(java.lang.String vehID, + double length) +
      Sets the length (in m) of the named vehicle.
      +
      static SumoCommandsetLine​(java.lang.String vehID, + java.lang.String line) +
      Sets the line information for this vehicle.
      +
      static SumoCommandsetMaxSpeed​(java.lang.String vehID, + double speed) +
      Sets the maximum speed (in m/s) of the named vehicle.
      +
      static SumoCommandsetMaxSpeedLat​(java.lang.String vehID, + double speed) +
      Sets the maximum lateral speed in m/s for this vehicle.
      +
      static SumoCommandsetMinGap​(java.lang.String vehID, + double minGap) +
      Sets the minimum gap (in m) between this vehicle and the vehicle before it.
      +
      static SumoCommandsetMinGapLat​(java.lang.String vehID, + double minGapLat) +
      Sets the minimum lateral gap of the vehicle at 50km/h in m
      +
      static SumoCommandsetParameter​(java.lang.String vehID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetParkingAreaStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a stop at a parkingArea with the given parameters.
      +
      static SumoCommandsetRoute​(java.lang.String vehID, + SumoStringList edgeList) +
      Sets the IDs of the edges the vehicle's route is made of.
      +
      static SumoCommandsetRouteID​(java.lang.String vehID, + java.lang.String routeID) +
      Sets the id of the route of the named vehicle.
      +
      static SumoCommandsetRoutingMode​(java.lang.String vehID, + int routingMode) +
      sets the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
      +
      static SumoCommandsetShapeClass​(java.lang.String vehID, + java.lang.String clazz) +
      setShapeClass
      +
      static SumoCommandsetSignals​(java.lang.String vehID, + int signals) +
      setSignals
      +
      static SumoCommandsetSpeed​(java.lang.String vehID, + double speed) +
      Sets the speed (in m/s) of the named vehicle.
      +
      static SumoCommandsetSpeedDeviation​(java.lang.String vehID, + double deviation) +
      Sets the standard deviation of the estimated maximum speed.
      +
      static SumoCommandsetSpeedFactor​(java.lang.String vehID, + double factor) +
      Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
      +
      static SumoCommandsetSpeedMode​(java.lang.String vehID, + int sm) +
      Sets the vehicle's speed mode as a bitset.
      +
      static SumoCommandsetStop​(java.lang.String vehID, + java.lang.String edgeID, + double pos, + byte laneIndex, + double duration, + SumoStopFlags sf, + double startPos, + double until) +
      Lets the vehicle stop at the given edge, at the given position and lane.
      +
      static SumoCommandsetTau​(java.lang.String vehID, + double tau) +
      setTau
      +
      static SumoCommandsetType​(java.lang.String vehID, + java.lang.String typeID) +
      Sets the id of the type for the named vehicle.
      +
      static SumoCommandsetVehicleClass​(java.lang.String vehID, + java.lang.String clazz) +
      Sets the vehicle class.
      +
      static SumoCommandsetVia​(java.lang.String vehID, + SumoStringList edgeList) +
      Sets the line information for this vehicle.
      +
      static SumoCommandsetWidth​(java.lang.String vehID, + double width) +
      Sets the vehicle's width (in m).
      +
      static SumoCommandslowDown​(java.lang.String vehID, + double speed, + double duration) +
      Reduces the speed to the given for the given amount of time.
      +
      static SumoCommandupdateBestLanes​(java.lang.String vehID) +
      Inserts the information about the travel time of edge "edgeID" valid + from begin time to end time into the vehicle's internal edge weights + container.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Vehicle

        +
        public Vehicle()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAccel

        +
        public static SumoCommand getAccel​(java.lang.String vehID)
        +
        Returns the acceleration of the named vehicle within the last step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        acceleration
        +
        +
      • +
      + + + +
        +
      • +

        getActionStepLength

        +
        public static SumoCommand getActionStepLength​(java.lang.String vehID)
        +
        Returns the action step length for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        action step length for this vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all vehicles in the network.
        +
        +
        Returns:
        +
        current number of vehicles in the network
        +
        +
      • +
      + + + +
        +
      • +

        getAdaptedTraveltime

        +
        public static SumoCommand getAdaptedTraveltime​(java.lang.String vehID,
        +                                               double time,
        +                                               java.lang.String edgeID)
        +
        Returns the edge travel time for the given time as stored in the vehicle's internal container.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        time - time
        +
        edgeID - id of the edge
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getAngle

        +
        public static SumoCommand getAngle​(java.lang.String vehID)
        +
        Returns the angle of the named vehicle within the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        angle
        +
        +
      • +
      + + + +
        +
      • +

        getApparentDecel

        +
        public static SumoCommand getApparentDecel​(java.lang.String vehID)
        +
        Returns the apparent deceleration in m/s^2 of this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        angle
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSpeedLat

        +
        public static SumoCommand getMaxSpeedLat​(java.lang.String vehID)
        +
        Returns the maximum lateral speed in m/s of this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        angle
        +
        +
      • +
      + + + +
        +
      • +

        getMinGapLat

        +
        public static SumoCommand getMinGapLat​(java.lang.String vehID)
        +
        Returns The desired lateral gap of this vehicle at 50km/h in m
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        angle
        +
        +
      • +
      + + + +
        +
      • +

        getAllowedSpeed

        +
        public static SumoCommand getAllowedSpeed​(java.lang.String vehID)
        +
        Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        allowed speed
        +
        +
      • +
      + + + +
        +
      • +

        getHeight

        +
        public static SumoCommand getHeight​(java.lang.String vehID)
        +
        Returns the height in m of this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        height in m
        +
        +
      • +
      + + + +
        +
      • +

        getLateralLanePosition

        +
        public static SumoCommand getLateralLanePosition​(java.lang.String vehID)
        +
        Returns The lateral position of the vehicle on its current lane measured in m.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        the leading vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getLaneChangeState

        +
        public static SumoCommand getLaneChangeState​(java.lang.String vehID,
        +                                             int direction)
        +
        Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        direction - direction
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getEmergencyDecel

        +
        public static SumoCommand getEmergencyDecel​(java.lang.String vehID)
        +
        Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getLastActionTime

        +
        public static SumoCommand getLastActionTime​(java.lang.String vehID)
        +
        Returns the time of last action point for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        time of last action point for this vehicle.
        +
        +
      • +
      + + + +
        +
      • +

        getLateralAlignment

        +
        public static SumoCommand getLateralAlignment​(java.lang.String vehID)
        +
        Returns The preferred lateral alignment of the vehicle
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        the leading vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getLaneChangeMode

        +
        public static SumoCommand getLaneChangeMode​(java.lang.String vehID)
        +
        Gets the vehicle's lane change mode as a bitset.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        vehicle's lane change mode as a bitset.
        +
        +
      • +
      + + + +
        +
      • +

        getLeader

        +
        public static SumoCommand getLeader​(java.lang.String vehID,
        +                                    double dist)
        +
        Return the leading vehicle id together with the distance. + The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        dist - distance
        +
        Returns:
        +
        the leading vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getPersonNumber

        +
        public static SumoCommand getPersonNumber​(java.lang.String vehID)
        +
        getPersonNumber
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        person number
        +
        +
      • +
      + + + +
        +
      • +

        getBestLanes

        +
        public static SumoCommand getBestLanes​(java.lang.String vehID)
        +
        getBestLanes
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        list of the best lanes
        +
        +
      • +
      + + + +
        +
      • +

        getCO2Emission

        +
        public static SumoCommand getCO2Emission​(java.lang.String vehID)
        +
        Returns the CO2 emission in mg for the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for co2
        +
        +
      • +
      + + + +
        +
      • +

        getCOEmission

        +
        public static SumoCommand getCOEmission​(java.lang.String vehID)
        +
        Returns the CO emission in mg for the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for co2
        +
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public static SumoCommand getColor​(java.lang.String vehID)
        +
        Returns the vehicle's color (RGBA).
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        color
        +
        +
      • +
      + + + +
        +
      • +

        getDecel

        +
        public static SumoCommand getDecel​(java.lang.String vehID)
        +
        Returns the deceleration of the named vehicle within the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getDrivingDistance

        +
        public static SumoCommand getDrivingDistance​(java.lang.String vehID,
        +                                             java.lang.String edgeID,
        +                                             double pos,
        +                                             byte laneID)
        +
        Returns the driving distance (in m) of the named vehicle within the last tine step.
        +
        +
        Parameters:
        +
        vehID - id
        +
        edgeID - edge id
        +
        pos - pos
        +
        laneID - lane id
        +
        Returns:
        +
        the distance
        +
        +
      • +
      + + + +
        +
      • +

        getDrivingDistance2D

        +
        public static SumoCommand getDrivingDistance2D​(java.lang.String vehID,
        +                                               double x,
        +                                               double y)
        +
        getDrivingDistance2D
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        x - x
        +
        y - y
        +
        Returns:
        +
        the distance
        +
        +
      • +
      + + + +
        +
      • +

        getDistance

        +
        public static SumoCommand getDistance​(java.lang.String vehID)
        +
        Get the distance to the starting point acts as a odometer
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        the current distance of the vehicle (odometer)
        +
        +
      • +
      + + + +
        +
      • +

        getEffort

        +
        public static SumoCommand getEffort​(java.lang.String vehID,
        +                                    double time,
        +                                    java.lang.String edgeID)
        +
        Returns the edge effort for the given time as stored in the vehicle's internal container.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        time - time
        +
        edgeID - edge id
        +
        Returns:
        +
        the effort
        +
        +
      • +
      + + + +
        +
      • +

        getEmissionClass

        +
        public static SumoCommand getEmissionClass​(java.lang.String vehID)
        +
        Returns the emission class of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        emission class
        +
        +
      • +
      + + + +
        +
      • +

        getElectricityConsumption

        +
        public static SumoCommand getElectricityConsumption​(java.lang.String vehID)
        +
        Returns the electricity consumption in ml for the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        energy consumption
        +
        +
      • +
      + + + +
        +
      • +

        getFuelConsumption

        +
        public static SumoCommand getFuelConsumption​(java.lang.String vehID)
        +
        Returns the fuel consumption in ml for the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        fuel consumption
        +
        +
      • +
      + + + +
        +
      • +

        getHCEmission

        +
        public static SumoCommand getHCEmission​(java.lang.String vehID)
        +
        Returns the HC emission (in mg) during the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for hc
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of ids of all vehicles currently running within the scenario.
        +
        +
        Returns:
        +
        list of vehicles
        +
        +
      • +
      + + + +
        +
      • +

        getImperfection

        +
        public static SumoCommand getImperfection​(java.lang.String vehID)
        +
        getImperfection
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for imperfection
        +
        +
      • +
      + + + +
        +
      • +

        getLaneID

        +
        public static SumoCommand getLaneID​(java.lang.String vehID)
        +
        Returns the id of the lane the named vehicle was at within the last step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        lane id
        +
        +
      • +
      + + + +
        +
      • +

        getLaneIndex

        +
        public static SumoCommand getLaneIndex​(java.lang.String vehID)
        +
        Returns the index of the lane the named vehicle was at within the last step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        lane index
        +
        +
      • +
      + + + +
        +
      • +

        getLanePosition

        +
        public static SumoCommand getLanePosition​(java.lang.String vehID)
        +
        Returns the position of the vehicle along the lane (in m).
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        lane position
        +
        +
      • +
      + + + +
        +
      • +

        getLength

        +
        public static SumoCommand getLength​(java.lang.String vehID)
        +
        Returns the length (in m) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        length
        +
        +
      • +
      + + + +
        +
      • +

        getLine

        +
        public static SumoCommand getLine​(java.lang.String vehID)
        +
        Returns the length (in m) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        length
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSpeed

        +
        public static SumoCommand getMaxSpeed​(java.lang.String vehID)
        +
        Returns the maximum speed(in m/s) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        max speed
        +
        +
      • +
      + + + +
        +
      • +

        getMinGap

        +
        public static SumoCommand getMinGap​(java.lang.String vehID)
        +
        Returns the minimum gap (in m) between this vehicle and the vehicle before it.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        min gap
        +
        +
      • +
      + + + +
        +
      • +

        getNextTLS

        +
        public static SumoCommand getNextTLS​(java.lang.String vehID)
        +
        Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        next traffic lights (compound)
        +
        +
      • +
      + + + +
        +
      • +

        getNextStops

        +
        public static SumoCommand getNextStops​(java.lang.String vehID)
        +
        Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...] + where integer stopFlag is defined as: + 1 * stopped + + 2 * parking + + 4 * personTriggered + + 8 * containerTriggered + + 16 * isBusStop + + 32 * isContainerStop + + 64 * chargingStation + + 128 * parkingarea + with each of these flags defined as 0 or 1.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        next traffic lights (compound)
        +
        +
      • +
      + + + +
        +
      • +

        getNOxEmission

        +
        public static SumoCommand getNOxEmission​(java.lang.String vehID)
        +
        Returns the NOx emissions (in mg) generated by the vehicle during the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for nox
        +
        +
      • +
      + + + +
        +
      • +

        getNoiseEmission

        +
        public static SumoCommand getNoiseEmission​(java.lang.String vehID)
        +
        Returns the noise emission (in db) generated by the vehicle during the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for noise emission
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String vehID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        SumoCommand (String)
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String vehID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getPMxEmission

        +
        public static SumoCommand getPMxEmission​(java.lang.String vehID)
        +
        Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        value for pmx
        +
        +
      • +
      + + + +
        +
      • +

        getPosition

        +
        public static SumoCommand getPosition​(java.lang.String vehID)
        +
        Returns the position of the named vehicle within the last step [m,m].
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        position 2D
        +
        +
      • +
      + + + +
        +
      • +

        getPosition3D

        +
        public static SumoCommand getPosition3D​(java.lang.String vehID)
        +
        Returns the position of the named vehicle within the last step [m,m,m].
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        position 3D
        +
        +
      • +
      + + + +
        +
      • +

        getRoadID

        +
        public static SumoCommand getRoadID​(java.lang.String vehID)
        +
        Returns the id of the edge the named vehicle was at within the last step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        road id
        +
        +
      • +
      + + + +
        +
      • +

        getRoute

        +
        public static SumoCommand getRoute​(java.lang.String vehID)
        +
        Returns the ids of the edges the vehicle's route is made of.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        route
        +
        +
      • +
      + + + +
        +
      • +

        getRouteID

        +
        public static SumoCommand getRouteID​(java.lang.String vehID)
        +
        Returns the id of the route of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        route id
        +
        +
      • +
      + + + +
        +
      • +

        getRouteIndex

        +
        public static SumoCommand getRouteIndex​(java.lang.String vehID)
        +
        Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        route index
        +
        +
      • +
      + + + +
        +
      • +

        getRoutingMode

        +
        public static SumoCommand getRoutingMode​(java.lang.String vehID)
        +
        returns the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        current routing mode
        +
        +
      • +
      + + + +
        +
      • +

        getShapeClass

        +
        public static SumoCommand getShapeClass​(java.lang.String vehID)
        +
        getShapeClass
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        shape class
        +
        +
      • +
      + + + +
        +
      • +

        getSignals

        +
        public static SumoCommand getSignals​(java.lang.String vehID)
        +
        getSignals
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        the signal state of the vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getSlope

        +
        public static SumoCommand getSlope​(java.lang.String vehID)
        +
        getSlope
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        the slope at the current position of the vehicle in degrees
        +
        +
      • +
      + + + +
        +
      • +

        getSpeed

        +
        public static SumoCommand getSpeed​(java.lang.String vehID)
        +
        Returns the speed (in m/s) of the named vehicle within the last step.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed in m/s
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedDeviation

        +
        public static SumoCommand getSpeedDeviation​(java.lang.String vehID)
        +
        Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed deviation
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedFactor

        +
        public static SumoCommand getSpeedFactor​(java.lang.String vehID)
        +
        Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed factor
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedMode

        +
        public static SumoCommand getSpeedMode​(java.lang.String vehID)
        +
        Returns the speed mode of a vehicle
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed mode
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedWithoutTraCI

        +
        public static SumoCommand getSpeedWithoutTraCI​(java.lang.String vehID)
        +
        getSpeedWithoutTraCI
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed in m/s
        +
        +
      • +
      + + + +
        +
      • +

        getStopState

        +
        public static SumoCommand getStopState​(java.lang.String vehID)
        +
        Returns information in regard to stopping: The returned integer is defined as 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop with each of these flags defined as 0 or 1
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        speed in m/s
        +
        +
      • +
      + + + +
        +
      • +

        getTau

        +
        public static SumoCommand getTau​(java.lang.String vehID)
        +
        getTau
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        tau
        +
        +
      • +
      + + + +
        +
      • +

        getVia

        +
        public static SumoCommand getVia​(java.lang.String vehID)
        +
        Returns the ids of via edges for this vehicle
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        ids of via edges for this vehicle
        +
        +
      • +
      + + + +
        +
      • +

        getWaitingTime

        +
        public static SumoCommand getWaitingTime​(java.lang.String vehID)
        +
        The waiting time of a vehicle is defined as the time (in seconds) spent with a speed below 0.1m/s since the last time it was faster than 0.1m/s. (basically, the waiting time of a vehicle is reset to 0 every time it moves).
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        waiting time
        +
        +
      • +
      + + + +
        +
      • +

        getTypeID

        +
        public static SumoCommand getTypeID​(java.lang.String vehID)
        +
        Returns the id of the type of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        type id
        +
        +
      • +
      + + + +
        +
      • +

        getPersonIDList

        +
        public static SumoCommand getPersonIDList​(java.lang.String vehID)
        +
        Returns the list of persons which includes those defined using attribute 'personNumber' + as well as -objects which are riding in this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        vehicle class
        +
        +
      • +
      + + + +
        +
      • +

        getVehicleClass

        +
        public static SumoCommand getVehicleClass​(java.lang.String vehID)
        +
        Returns the vehicle class.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        vehicle class
        +
        +
      • +
      + + + +
        +
      • +

        getAccumulatedWaitingTime

        +
        public static SumoCommand getAccumulatedWaitingTime​(java.lang.String vehID)
        +
        Returns the vehicle class.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        vehicle class
        +
        +
      • +
      + + + +
        +
      • +

        getWidth

        +
        public static SumoCommand getWidth​(java.lang.String vehID)
        +
        Returns the vehicle's width (in m).
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        width
        +
        +
      • +
      + + + +
        +
      • +

        isStopped

        +
        public static SumoCommand isStopped​(java.lang.String vehID)
        +
        isStopped
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        stop
        +
        +
      • +
      + + + +
        +
      • +

        isStoppedTriggered

        +
        public static SumoCommand isStoppedTriggered​(java.lang.String vehID)
        +
        Return whether the vehicle is stopped and waiting for a person or container
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        stop
        +
        +
      • +
      + + + +
        +
      • +

        isAtContainerStop

        +
        public static SumoCommand isAtContainerStop​(java.lang.String vehID)
        +
        Return whether the vehicle is stopped at a container stop
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        stop
        +
        +
      • +
      + + + +
        +
      • +

        isStoppedParking

        +
        public static SumoCommand isStoppedParking​(java.lang.String vehID)
        +
        isStoppedParking
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        stop
        +
        +
      • +
      + + + +
        +
      • +

        isAtBusStop

        +
        public static SumoCommand isAtBusStop​(java.lang.String vehID)
        +
        isAtBusStop
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        stop
        +
        +
      • +
      + + + +
        +
      • +

        isRouteValid

        +
        public static SumoCommand isRouteValid​(java.lang.String vehID)
        +
        Returns whether the Route is valid.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        route valid
        +
        +
      • +
      + + + +
        +
      • +

        slowDown

        +
        public static SumoCommand slowDown​(java.lang.String vehID,
        +                                   double speed,
        +                                   double duration)
        +
        Reduces the speed to the given for the given amount of time.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        speed - speed
        +
        duration - duration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public static SumoCommand add​(java.lang.String vehID,
        +                              java.lang.String typeID,
        +                              java.lang.String routeID,
        +                              int depart,
        +                              double pos,
        +                              double speed,
        +                              byte lane)
        +
        Add a new vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        typeID - type id
        +
        routeID - route id
        +
        depart - depart
        +
        pos - position
        +
        speed - speed
        +
        lane - lane
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        addFull

        +
        public static SumoCommand addFull​(java.lang.String vehID,
        +                                  java.lang.String routeID,
        +                                  java.lang.String typeID,
        +                                  java.lang.String depart,
        +                                  java.lang.String departLane,
        +                                  java.lang.String departPosition,
        +                                  java.lang.String departSpeed,
        +                                  java.lang.String arrivalLane,
        +                                  java.lang.String arrivalPosition,
        +                                  java.lang.String arrivalSpeed,
        +                                  java.lang.String fromTAZ,
        +                                  java.lang.String toTAZ,
        +                                  java.lang.String line,
        +                                  int person_capacity,
        +                                  int person_number)
        +
        Add a new vehicle.
        +
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        changeLane

        +
        public static SumoCommand changeLane​(java.lang.String vehID,
        +                                     byte laneIndex,
        +                                     double duration)
        +
        Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        laneIndex - lane index
        +
        duration - duration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        changeTarget

        +
        public static SumoCommand changeTarget​(java.lang.String vehID,
        +                                       java.lang.String edgeID)
        +
        The vehicle's destination edge is set to the given. The route is rebuilt.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        edgeID - edge id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        changeSublane

        +
        public static SumoCommand changeSublane​(java.lang.String vehID,
        +                                        double latDist)
        +
        Forces a lateral change by the given amount (negative values indicate changing to the right, positive to the left) + This will override any other lane change motivations but conform to + safety-constraints as configured by laneChangeMode.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        latDist - latDist
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        moveTo

        +
        public static SumoCommand moveTo​(java.lang.String vehID,
        +                                 java.lang.String laneID,
        +                                 double pos)
        +
        Moves the vehicle to a new position.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        laneID - lane id
        +
        pos - position
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        moveToXY

        +
        public static SumoCommand moveToXY​(java.lang.String vehID,
        +                                   java.lang.String edgeID,
        +                                   int lane,
        +                                   double x,
        +                                   double y,
        +                                   double angle,
        +                                   byte keepRoute)
        +
        Place vehicle at the given x,y coordinates and force it's angle to + the given value (for drawing). If keepRoute is set to 1, the closest position + within the existing route is taken. If keepRoute is set to 0, the vehicle may move to + any edge in the network but it's route then only consists of that edge. + If keepRoute is set to 2 the vehicle has all the freedom of keepRoute=1 + but in addition to that may even move outside the road network. + edgeID and lane are optional placement hints to resolve ambiguities
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        edgeID - edge id
        +
        lane - lane
        +
        x - x
        +
        y - y
        +
        angle - angle
        +
        keepRoute - keepRoute
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public static SumoCommand remove​(java.lang.String vehID,
        +                                 byte reason)
        +
        Removes vehicle with the given ID for the given reason. Reasons are defined in module constants and start with REMOVE_
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        reason - reason
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        rerouteEffort

        +
        public static SumoCommand rerouteEffort​(java.lang.String vehID)
        +
        Computes a new route using the vehicle's internal and the global edge effort information.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        rerouteTraveltime

        +
        public static SumoCommand rerouteTraveltime​(java.lang.String vehID)
        +
        Computes a new route using the vehicle's internal and the global edge travel time information.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setAccel

        +
        public static SumoCommand setAccel​(java.lang.String vehID,
        +                                   double accel)
        +
        Sets the acceleration of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        accel - acceleration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setAdaptedTraveltime

        +
        public static SumoCommand setAdaptedTraveltime​(java.lang.String vehID,
        +                                               double begTime,
        +                                               double endTime,
        +                                               java.lang.String edgeID,
        +                                               double time)
        +
        Sets the edge travel time of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        begTime - begin time
        +
        endTime - end time
        +
        edgeID - edge id
        +
        time - time
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLateralAlignment

        +
        public static SumoCommand setLateralAlignment​(java.lang.String vehID,
        +                                              java.lang.String align)
        +
        Sets the preferred lateral alignment for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        align - align
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setApparentDecel

        +
        public static SumoCommand setApparentDecel​(java.lang.String vehID,
        +                                           double decel)
        +
        Sets the apparent deceleration in m/s^2 for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        decel - decel
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMinGapLat

        +
        public static SumoCommand setMinGapLat​(java.lang.String vehID,
        +                                       double minGapLat)
        +
        Sets the minimum lateral gap of the vehicle at 50km/h in m
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        minGapLat - minGapLat
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public static SumoCommand setColor​(java.lang.String vehID,
        +                                   SumoColor color)
        +
        Sets the vehicle's color (RGBA).
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        color - color
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setDecel

        +
        public static SumoCommand setDecel​(java.lang.String vehID,
        +                                   double decel)
        +
        Sets the deceleration of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        decel - deceleration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setHeight

        +
        public static SumoCommand setHeight​(java.lang.String vehID,
        +                                    double height)
        +
        Sets the height in m for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        height - in m
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLaneChangeMode

        +
        public static SumoCommand setLaneChangeMode​(java.lang.String vehID,
        +                                            int lcm)
        +
        Sets the vehicle's lane change mode as a bitset.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        lcm - lane change model
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEmergencyDecel

        +
        public static SumoCommand setEmergencyDecel​(java.lang.String vehID,
        +                                            double decel)
        +
        Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        decel - decel
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setRoute

        +
        public static SumoCommand setRoute​(java.lang.String vehID,
        +                                   SumoStringList edgeList)
        +
        Sets the IDs of the edges the vehicle's route is made of.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        edgeList - edges list
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setRoutingMode

        +
        public static SumoCommand setRoutingMode​(java.lang.String vehID,
        +                                         int routingMode)
        +
        sets the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        routingMode - routingMode
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public static SumoCommand setType​(java.lang.String vehID,
        +                                  java.lang.String typeID)
        +
        Sets the id of the type for the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        typeID - type id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEffort

        +
        public static SumoCommand setEffort​(java.lang.String vehID,
        +                                    int begTime,
        +                                    int endTime,
        +                                    java.lang.String edgeID,
        +                                    double effort)
        +
        Sets the edge effort for the given time as stored in the vehicle's internal container.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        begTime - begin time
        +
        endTime - end time
        +
        edgeID - edge id
        +
        effort - effort
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEmissionClass

        +
        public static SumoCommand setEmissionClass​(java.lang.String vehID,
        +                                           java.lang.String clazz)
        +
        Sets the emission class of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        clazz - emission class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setImperfection

        +
        public static SumoCommand setImperfection​(java.lang.String vehID,
        +                                          double imperfection)
        +
        setImperfection
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        imperfection - imperfection
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLength

        +
        public static SumoCommand setLength​(java.lang.String vehID,
        +                                    double length)
        +
        Sets the length (in m) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        length - length
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setActionStepLength

        +
        public static SumoCommand setActionStepLength​(java.lang.String vehID,
        +                                              double actionStepLength,
        +                                              boolean resetActionOffset)
        +
        Sets the action step length for this vehicle. If resetActionOffset == True (default), the + next action point is scheduled immediately. if If resetActionOffset == False, the interval + between the last and the next action point is updated to match the given value, or if the latter + is smaller than the time since the last action point, the next action follows immediately.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        actionStepLength - actionStepLength
        +
        resetActionOffset - resetActionOffset
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLine

        +
        public static SumoCommand setLine​(java.lang.String vehID,
        +                                  java.lang.String line)
        +
        Sets the line information for this vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        line - line
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setVia

        +
        public static SumoCommand setVia​(java.lang.String vehID,
        +                                 SumoStringList edgeList)
        +
        Sets the line information for this vehicle. + changes the via edges to the given edges list (to be used during + subsequent rerouting calls). + + Note: a single edgeId as argument is allowed as shorthand for a list of length 1
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        edgeList - edges
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeed

        +
        public static SumoCommand setMaxSpeed​(java.lang.String vehID,
        +                                      double speed)
        +
        Sets the maximum speed (in m/s) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        speed - speed
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeedLat

        +
        public static SumoCommand setMaxSpeedLat​(java.lang.String vehID,
        +                                         double speed)
        +
        Sets the maximum lateral speed in m/s for this vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        speed - speed
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMinGap

        +
        public static SumoCommand setMinGap​(java.lang.String vehID,
        +                                    double minGap)
        +
        Sets the minimum gap (in m) between this vehicle and the vehicle before it.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        minGap - minimum gap
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setRouteID

        +
        public static SumoCommand setRouteID​(java.lang.String vehID,
        +                                     java.lang.String routeID)
        +
        Sets the id of the route of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        routeID - route id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setShapeClass

        +
        public static SumoCommand setShapeClass​(java.lang.String vehID,
        +                                        java.lang.String clazz)
        +
        setShapeClass
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        clazz - shape class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSignals

        +
        public static SumoCommand setSignals​(java.lang.String vehID,
        +                                     int signals)
        +
        setSignals
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        signals - signals
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeed

        +
        public static SumoCommand setSpeed​(java.lang.String vehID,
        +                                   double speed)
        +
        Sets the speed (in m/s) of the named vehicle.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        speed - speed
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeedDeviation

        +
        public static SumoCommand setSpeedDeviation​(java.lang.String vehID,
        +                                            double deviation)
        +
        Sets the standard deviation of the estimated maximum speed.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        deviation - deviation
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeedFactor

        +
        public static SumoCommand setSpeedFactor​(java.lang.String vehID,
        +                                         double factor)
        +
        Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        factor - factor
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeedMode

        +
        public static SumoCommand setSpeedMode​(java.lang.String vehID,
        +                                       int sm)
        +
        Sets the vehicle's speed mode as a bitset.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        sm - speed mode
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setStop

        +
        public static SumoCommand setStop​(java.lang.String vehID,
        +                                  java.lang.String edgeID,
        +                                  double pos,
        +                                  byte laneIndex,
        +                                  double duration,
        +                                  SumoStopFlags sf,
        +                                  double startPos,
        +                                  double until)
        +
        Lets the vehicle stop at the given edge, at the given position and lane. The vehicle will stop for the given duration. Re-issuing a stop command with the same lane and position allows changing the duration.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        edgeID - edge id
        +
        pos - positon
        +
        laneIndex - lane index
        +
        duration - duration
        +
        sf - stop flags
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setChargingStationStop

        +
        public static SumoCommand setChargingStationStop​(java.lang.String vehID,
        +                                                 java.lang.String stopID,
        +                                                 double duration,
        +                                                 double until)
        +
        Adds or modifies a stop at a chargingStation with the given parameters. The duration and the until attribute are in seconds.
        +
        +
        Parameters:
        +
        vehID -
        +
        stopID -
        +
        duration -
        +
        until -
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setBusStop

        +
        public static SumoCommand setBusStop​(java.lang.String vehID,
        +                                     java.lang.String stopID,
        +                                     double duration,
        +                                     double until)
        +
        Adds or modifies a bus stop with the given parameters. The duration and the until attribute are in seconds.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        stopID -
        +
        duration -
        +
        until -
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setContainerStop

        +
        public static SumoCommand setContainerStop​(java.lang.String vehID,
        +                                           java.lang.String stopID,
        +                                           double duration,
        +                                           double until)
        +
        Adds or modifies a container stop with the given parameters. The duration and the until attribute are in seconds.
        +
        +
        Parameters:
        +
        vehID - id of the vehicle
        +
        stopID -
        +
        duration -
        +
        until -
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setParkingAreaStop

        +
        public static SumoCommand setParkingAreaStop​(java.lang.String vehID,
        +                                             java.lang.String stopID,
        +                                             double duration,
        +                                             double until)
        +
        Adds or modifies a stop at a parkingArea with the given parameters. The duration and the until attribute are in seconds.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        stopID - stopID
        +
        duration - duration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        resume

        +
        public static SumoCommand resume​(java.lang.String vehID)
        +
        Continue after a stop
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setTau

        +
        public static SumoCommand setTau​(java.lang.String vehID,
        +                                 double tau)
        +
        setTau
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        tau - tau
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setVehicleClass

        +
        public static SumoCommand setVehicleClass​(java.lang.String vehID,
        +                                          java.lang.String clazz)
        +
        Sets the vehicle class.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        clazz - vehicle class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setWidth

        +
        public static SumoCommand setWidth​(java.lang.String vehID,
        +                                   double width)
        +
        Sets the vehicle's width (in m).
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        width - width
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        updateBestLanes

        +
        public static SumoCommand updateBestLanes​(java.lang.String vehID)
        +
        Inserts the information about the travel time of edge "edgeID" valid + from begin time to end time into the vehicle's internal edge weights + container. + If the time is not specified, any previously set values for that edge + are removed. + If begTime or endTime are not specified the value is set for the whole + simulation duration.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        rerouteParkingArea

        +
        public static SumoCommand rerouteParkingArea​(java.lang.String vehID,
        +                                             java.lang.String parkingAreaID)
        +
        Changes the next parking area in parkingAreaID, updates the vehicle route, + and preserve consistency in case of passengers/containers on board.
        +
        +
        Parameters:
        +
        vehID - vehicle id
        +
        parkingAreaID - parkingAreaID
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/cmd/Vehicletype.html 2020-04-27 22:06:56.000000000 +0000 @@ -0,0 +1,1401 @@ + + + + + +Vehicletype (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Vehicletype

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.cmd.Vehicletype
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Vehicletype
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow, Evamarie Wiessner
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Vehicletype() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static SumoCommandgetAccel​(java.lang.String typeID) +
      Returns the maximum acceleration of the named vehicle class.
      +
      static SumoCommandgetApparentDecel​(java.lang.String typeID) +
      Returns The preferred lateral alignment of the type
      +
      static SumoCommandgetColor​(java.lang.String typeID) +
      Returns the vehicle type's color.
      +
      static SumoCommandgetDecel​(java.lang.String typeID) +
      Returns the maximum deceleration of the names vehicle type.
      +
      static SumoCommandgetEmergencyDecel​(java.lang.String typeID) +
      Returns the maximal physically possible deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandgetEmissionClass​(java.lang.String typeID) +
      Returns the emission class of the named vehicle type.
      +
      static SumoCommandgetHeight​(java.lang.String typeID) +
      Returns the height in m of vehicles of this type.
      +
      static SumoCommandgetIDCount() +
      Returns the number of all vehicle types in the network.
      +
      static SumoCommandgetIDList() +
      Returns a list of all known vehicle types.
      +
      static SumoCommandgetImperfection​(java.lang.String typeID) +
      getImperfection
      +
      static SumoCommandgetLateralAlignment​(java.lang.String typeID) +
      Returns The preferred lateral alignment of the type
      +
      static SumoCommandgetLength​(java.lang.String typeID) +
      Returns the length of the named vehicle type.
      +
      static SumoCommandgetMaxSpeed​(java.lang.String typeID) +
      Return the maximum speed of the named vehicle type.
      +
      static SumoCommandgetMaxSpeedLat​(java.lang.String typeID) +
      Returns the maximum lateral speed in m/s of this type.
      +
      static SumoCommandgetMinGap​(java.lang.String typeID) +
      Returns the minimum headway gap of the named vehicle type.
      +
      static SumoCommandgetMinGapLat​(java.lang.String typeID) +
      Returns The desired lateral gap of this type at 50km/h in m
      +
      static SumoCommandgetParameter​(java.lang.String typeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandgetShapeClass​(java.lang.String typeID) +
      getShapeClass
      +
      static SumoCommandgetSpeedDeviation​(java.lang.String typeID) +
      Returns the speed deviation of the named vehicle type.
      +
      static SumoCommandgetSpeedFactor​(java.lang.String typeID) +
      Return the speed factor of the names vehicle type.
      +
      static SumoCommandgetTau​(java.lang.String typeID) +
      getTau
      +
      static SumoCommandgetVehicleClass​(java.lang.String typeID) +
      Returns the vehicle class of the names vehicle type.
      +
      static SumoCommandgetWidth​(java.lang.String typeID) +
      Returns the width of the named vehicle type.
      +
      static SumoCommandsetAccel​(java.lang.String typeID, + double accel) +
      Sets the vehicle type's wished maximum acceleration to the given value.
      +
      static SumoCommandsetApparentDecel​(java.lang.String typeID, + double decel) +
      Sets the apparent deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandsetColor​(java.lang.String typeID, + SumoColor color) +
      Sets the vehicle type's color.
      +
      static SumoCommandsetDecel​(java.lang.String typeID, + double decel) +
      Sets the vehicle type's wished maximum deceleration to the given value.
      +
      static SumoCommandsetEmergencyDecel​(java.lang.String typeID, + double decel) +
      Sets the maximal physically possible deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandsetEmissionClass​(java.lang.String typeID, + java.lang.String clazz) +
      Sets the vehicle type's emission class to the given value.
      +
      static SumoCommandsetHeight​(java.lang.String typeID, + double height) +
      Sets the height in m of vehicles of this type.
      +
      static SumoCommandsetImperfection​(java.lang.String typeID, + double imperfection) +
      setImperfection
      +
      static SumoCommandsetLateralAlignment​(java.lang.String typeID, + java.lang.String latAlignment) +
      Sets the preferred lateral alignment of this type.
      +
      static SumoCommandsetLength​(java.lang.String typeID, + double length) +
      Sets the vehicle type's length to the given value.
      +
      static SumoCommandsetMaxSpeed​(java.lang.String typeID, + double speed) +
      Sets the vehicle type's maximum speed to the given value.
      +
      static SumoCommandsetMaxSpeedLat​(java.lang.String typeID, + double speed) +
      Sets the maximum lateral speed of this type.
      +
      static SumoCommandsetMinGap​(java.lang.String typeID, + double minGap) +
      Sets the vehicle type's minimum headway gap to the given value.
      +
      static SumoCommandsetMinGapLat​(java.lang.String typeID, + double minGapLat) +
      setImperfection
      +
      static SumoCommandsetParameter​(java.lang.String typeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandsetShapeClass​(java.lang.String typeID, + java.lang.String clazz) +
      setShapeClass
      +
      static SumoCommandsetSpeedDeviation​(java.lang.String typeID, + double deviation) +
      Sets the vehicle type's speed deviation to the given value.
      +
      static SumoCommandsetSpeedFactor​(java.lang.String typeID, + double factor) +
      Sets the vehicle type's speed factor to the given value.
      +
      static SumoCommandsetTau​(java.lang.String typeID, + double tau) +
      setTau
      +
      static SumoCommandsetVehicleClass​(java.lang.String typeID, + java.lang.String clazz) +
      Sets the vehicle type's vehicle class to the given value.
      +
      static SumoCommandsetWidth​(java.lang.String typeID, + double width) +
      Sets the vehicle type's width to the given value.
      +
      static SumoCommandsetWidth​(java.lang.String typeID, + java.lang.String newTypeID) +
      Duplicates the vType with ID origTypeID.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Vehicletype

        +
        public Vehicletype()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getAccel

        +
        public static SumoCommand getAccel​(java.lang.String typeID)
        +
        Returns the maximum acceleration of the named vehicle class.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        acceleration
        +
        +
      • +
      + + + +
        +
      • +

        getIDCount

        +
        public static SumoCommand getIDCount()
        +
        Returns the number of all vehicle types in the network.
        +
        +
        Returns:
        +
        number of vehicle types
        +
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public static SumoCommand getColor​(java.lang.String typeID)
        +
        Returns the vehicle type's color.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        color color
        +
        +
      • +
      + + + +
        +
      • +

        getDecel

        +
        public static SumoCommand getDecel​(java.lang.String typeID)
        +
        Returns the maximum deceleration of the names vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getEmergencyDecel

        +
        public static SumoCommand getEmergencyDecel​(java.lang.String typeID)
        +
        Returns the maximal physically possible deceleration in m/s^2 of vehicles of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getLateralAlignment

        +
        public static SumoCommand getLateralAlignment​(java.lang.String typeID)
        +
        Returns The preferred lateral alignment of the type
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getHeight

        +
        public static SumoCommand getHeight​(java.lang.String typeID)
        +
        Returns the height in m of vehicles of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getApparentDecel

        +
        public static SumoCommand getApparentDecel​(java.lang.String typeID)
        +
        Returns The preferred lateral alignment of the type
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getMinGapLat

        +
        public static SumoCommand getMinGapLat​(java.lang.String typeID)
        +
        Returns The desired lateral gap of this type at 50km/h in m
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSpeedLat

        +
        public static SumoCommand getMaxSpeedLat​(java.lang.String typeID)
        +
        Returns the maximum lateral speed in m/s of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        deceleration
        +
        +
      • +
      + + + +
        +
      • +

        getEmissionClass

        +
        public static SumoCommand getEmissionClass​(java.lang.String typeID)
        +
        Returns the emission class of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        emission class
        +
        +
      • +
      + + + +
        +
      • +

        getIDList

        +
        public static SumoCommand getIDList()
        +
        Returns a list of all known vehicle types.
        +
        +
        Returns:
        +
        list of vechicle types
        +
        +
      • +
      + + + +
        +
      • +

        getImperfection

        +
        public static SumoCommand getImperfection​(java.lang.String typeID)
        +
        getImperfection
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        imperfection
        +
        +
      • +
      + + + +
        +
      • +

        getLength

        +
        public static SumoCommand getLength​(java.lang.String typeID)
        +
        Returns the length of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        length
        +
        +
      • +
      + + + +
        +
      • +

        getMaxSpeed

        +
        public static SumoCommand getMaxSpeed​(java.lang.String typeID)
        +
        Return the maximum speed of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        max speed
        +
        +
      • +
      + + + +
        +
      • +

        getMinGap

        +
        public static SumoCommand getMinGap​(java.lang.String typeID)
        +
        Returns the minimum headway gap of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        min gap
        +
        +
      • +
      + + + +
        +
      • +

        getParameter

        +
        public static SumoCommand getParameter​(java.lang.String typeID,
        +                                       java.lang.String param)
        +
        Returns the chosen parameter
        +
        +
        Parameters:
        +
        typeID - a string identifying the vehicle type
        +
        param - a string identifying the parameter
        +
        Returns:
        +
        the specific parameter
        +
        +
      • +
      + + + +
        +
      • +

        setParameter

        +
        public static SumoCommand setParameter​(java.lang.String typeID,
        +                                       java.lang.String param,
        +                                       java.lang.String value)
        +
        Sets the chosen parameter
        +
        +
        Parameters:
        +
        vehID - a string identifying the vehicle
        +
        param - a string identifying the parameter
        +
        value - a string identifying the new value
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        getShapeClass

        +
        public static SumoCommand getShapeClass​(java.lang.String typeID)
        +
        getShapeClass
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        shape class
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedDeviation

        +
        public static SumoCommand getSpeedDeviation​(java.lang.String typeID)
        +
        Returns the speed deviation of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        speed deviation
        +
        +
      • +
      + + + +
        +
      • +

        getSpeedFactor

        +
        public static SumoCommand getSpeedFactor​(java.lang.String typeID)
        +
        Return the speed factor of the names vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        speed factor
        +
        +
      • +
      + + + +
        +
      • +

        getTau

        +
        public static SumoCommand getTau​(java.lang.String typeID)
        +
        getTau
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        tau
        +
        +
      • +
      + + + +
        +
      • +

        getVehicleClass

        +
        public static SumoCommand getVehicleClass​(java.lang.String typeID)
        +
        Returns the vehicle class of the names vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        vehicle class
        +
        +
      • +
      + + + +
        +
      • +

        getWidth

        +
        public static SumoCommand getWidth​(java.lang.String typeID)
        +
        Returns the width of the named vehicle type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        Returns:
        +
        width
        +
        +
      • +
      + + + +
        +
      • +

        setAccel

        +
        public static SumoCommand setAccel​(java.lang.String typeID,
        +                                   double accel)
        +
        Sets the vehicle type's wished maximum acceleration to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        accel - acceleration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setColor

        +
        public static SumoCommand setColor​(java.lang.String typeID,
        +                                   SumoColor color)
        +
        Sets the vehicle type's color.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        color - color
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setDecel

        +
        public static SumoCommand setDecel​(java.lang.String typeID,
        +                                   double decel)
        +
        Sets the vehicle type's wished maximum deceleration to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        decel - deceleration
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEmissionClass

        +
        public static SumoCommand setEmissionClass​(java.lang.String typeID,
        +                                           java.lang.String clazz)
        +
        Sets the vehicle type's emission class to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        clazz - emission class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMinGapLat

        +
        public static SumoCommand setMinGapLat​(java.lang.String typeID,
        +                                       double minGapLat)
        +
        setImperfection
        +
        +
        Parameters:
        +
        typeID - type id
        +
        minGapLat - minGapLat
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeedLat

        +
        public static SumoCommand setMaxSpeedLat​(java.lang.String typeID,
        +                                         double speed)
        +
        Sets the maximum lateral speed of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        speed - speed
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setApparentDecel

        +
        public static SumoCommand setApparentDecel​(java.lang.String typeID,
        +                                           double decel)
        +
        Sets the apparent deceleration in m/s^2 of vehicles of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        decel - decel
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setImperfection

        +
        public static SumoCommand setImperfection​(java.lang.String typeID,
        +                                          double imperfection)
        +
        setImperfection
        +
        +
        Parameters:
        +
        typeID - type id
        +
        imperfection - imperfection
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLateralAlignment

        +
        public static SumoCommand setLateralAlignment​(java.lang.String typeID,
        +                                              java.lang.String latAlignment)
        +
        Sets the preferred lateral alignment of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        latAlignment - latAlignment
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setHeight

        +
        public static SumoCommand setHeight​(java.lang.String typeID,
        +                                    double height)
        +
        Sets the height in m of vehicles of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        height - height
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setEmergencyDecel

        +
        public static SumoCommand setEmergencyDecel​(java.lang.String typeID,
        +                                            double decel)
        +
        Sets the maximal physically possible deceleration in m/s^2 of vehicles of this type.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        decel - decel
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setLength

        +
        public static SumoCommand setLength​(java.lang.String typeID,
        +                                    double length)
        +
        Sets the vehicle type's length to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        length - length
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMaxSpeed

        +
        public static SumoCommand setMaxSpeed​(java.lang.String typeID,
        +                                      double speed)
        +
        Sets the vehicle type's maximum speed to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        speed - speed
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setMinGap

        +
        public static SumoCommand setMinGap​(java.lang.String typeID,
        +                                    double minGap)
        +
        Sets the vehicle type's minimum headway gap to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        minGap - minimum gap
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setShapeClass

        +
        public static SumoCommand setShapeClass​(java.lang.String typeID,
        +                                        java.lang.String clazz)
        +
        setShapeClass
        +
        +
        Parameters:
        +
        typeID - type id
        +
        clazz - shape class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeedDeviation

        +
        public static SumoCommand setSpeedDeviation​(java.lang.String typeID,
        +                                            double deviation)
        +
        Sets the vehicle type's speed deviation to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        deviation - deviation
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setSpeedFactor

        +
        public static SumoCommand setSpeedFactor​(java.lang.String typeID,
        +                                         double factor)
        +
        Sets the vehicle type's speed factor to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        factor - factor
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setTau

        +
        public static SumoCommand setTau​(java.lang.String typeID,
        +                                 double tau)
        +
        setTau
        +
        +
        Parameters:
        +
        typeID - type id
        +
        tau - tau
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setVehicleClass

        +
        public static SumoCommand setVehicleClass​(java.lang.String typeID,
        +                                          java.lang.String clazz)
        +
        Sets the vehicle type's vehicle class to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        clazz - vehicle class
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setWidth

        +
        public static SumoCommand setWidth​(java.lang.String typeID,
        +                                   double width)
        +
        Sets the vehicle type's width to the given value.
        +
        +
        Parameters:
        +
        typeID - type id
        +
        width - width
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      + + + +
        +
      • +

        setWidth

        +
        public static SumoCommand setWidth​(java.lang.String typeID,
        +                                   java.lang.String newTypeID)
        +
        Duplicates the vType with ID origTypeID. The newly created vType is assigned the ID newTypeID
        +
        +
        Parameters:
        +
        typeID - type id
        +
        newTypeID - newTypeID
        +
        Returns:
        +
        SumoCommand
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/class-use/Constants.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.config.Constants (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.config.Constants

+
+
No usage of de.tudresden.sumo.config.Constants
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/Constants.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,8902 @@ + + + + + +Constants (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Constants

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.config.Constants
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Constants
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+ +
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,168 @@ + + + + + +de.tudresden.sumo.config (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.sumo.config

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Constants 
    +
  • +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,165 @@ + + + + + +de.tudresden.sumo.config Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.sumo.config

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/config/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Package de.tudresden.sumo.config (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.sumo.config

+
+
No usage of de.tudresden.sumo.config
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ContextSubscription.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.ContextSubscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.ContextSubscription

+
+
No usage of de.tudresden.sumo.subscription.ContextSubscription
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/ResponseType.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,253 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.ResponseType (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.ResponseType

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscribtionVariable.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.SubscribtionVariable (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.SubscribtionVariable

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionContext.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,237 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.SubscriptionContext (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.SubscriptionContext

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/Subscription.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,251 @@ + + + + + +Uses of Interface de.tudresden.sumo.subscription.Subscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
de.tudresden.sumo.subscription.Subscription

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SubscriptionObject.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,200 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.SubscriptionObject (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.SubscriptionObject

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/SumoDomain.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,237 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.SumoDomain (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.SumoDomain

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/class-use/VariableSubscription.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.subscription.VariableSubscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.subscription.VariableSubscription

+
+
No usage of de.tudresden.sumo.subscription.VariableSubscription
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ContextSubscription.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,480 @@ + + + + + +ContextSubscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ContextSubscription

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.subscription.ContextSubscription
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Subscription
    +
    +
    +
    public class ContextSubscription
    +extends java.lang.Object
    +implements Subscription
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + + + + + +
        +
      • +

        start

        +
        public double start
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public double stop
        +
      • +
      + + + +
        +
      • +

        objectID

        +
        public java.lang.String objectID
        +
      • +
      + + + +
        +
      • +

        contextDomain

        +
        public SumoDomain contextDomain
        +
      • +
      + + + +
        +
      • +

        contextRange

        +
        public double contextRange
        +
      • +
      + + + +
        +
      • +

        commands

        +
        public java.util.LinkedList<java.lang.Integer> commands
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ContextSubscription

        +
        public ContextSubscription()
        +
      • +
      + + + +
        +
      • +

        ContextSubscription

        +
        public ContextSubscription​(SubscriptionContext context,
        +                           double start,
        +                           double stop,
        +                           java.lang.String objectID,
        +                           SumoDomain contextDomain,
        +                           double contextRange)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addCommand

        +
        public void addCommand​(int cmd)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,218 @@ + + + + + +de.tudresden.sumo.subscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.sumo.subscription

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,190 @@ + + + + + +de.tudresden.sumo.subscription Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.sumo.subscription

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,247 @@ + + + + + +Uses of Package de.tudresden.sumo.subscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.sumo.subscription

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/ResponseType.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,799 @@ + + + + + +ResponseType (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum ResponseType

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<ResponseType>
    • +
    • +
        +
      • de.tudresden.sumo.subscription.ResponseType
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<ResponseType>
    +
    +
    +
    public enum ResponseType
    +extends java.lang.Enum<ResponseType>
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Enum Constant Detail

      + + + + + + + +
        +
      • +

        EDGE_VARIABLE

        +
        public static final ResponseType EDGE_VARIABLE
        +
      • +
      + + + +
        +
      • +

        AREAL_DETECTOR_VARIABLE

        +
        public static final ResponseType AREAL_DETECTOR_VARIABLE
        +
      • +
      + + + +
        +
      • +

        PERSON_VARIABLE

        +
        public static final ResponseType PERSON_VARIABLE
        +
      • +
      + + + +
        +
      • +

        MULTI_ENTRY_EXIT_DETECTOR_VARIABLE

        +
        public static final ResponseType MULTI_ENTRY_EXIT_DETECTOR_VARIABLE
        +
      • +
      + + + +
        +
      • +

        JUNCTION_VARIABLE

        +
        public static final ResponseType JUNCTION_VARIABLE
        +
      • +
      + + + +
        +
      • +

        VEHICLE_VARIABLE

        +
        public static final ResponseType VEHICLE_VARIABLE
        +
      • +
      + + + +
        +
      • +

        INDUCTIONLOOP_VARIABLE

        +
        public static final ResponseType INDUCTIONLOOP_VARIABLE
        +
      • +
      + + + +
        +
      • +

        GUI_VARIABLE

        +
        public static final ResponseType GUI_VARIABLE
        +
      • +
      + + + +
        +
      • +

        POI_VARIABLE

        +
        public static final ResponseType POI_VARIABLE
        +
      • +
      + + + +
        +
      • +

        VEHICLETYPE_VARIABLE

        +
        public static final ResponseType VEHICLETYPE_VARIABLE
        +
      • +
      + + + +
        +
      • +

        LANE_VARIABLE

        +
        public static final ResponseType LANE_VARIABLE
        +
      • +
      + + + +
        +
      • +

        POLYGON_VARIABLE

        +
        public static final ResponseType POLYGON_VARIABLE
        +
      • +
      + + + +
        +
      • +

        TL_VARIABLE

        +
        public static final ResponseType TL_VARIABLE
        +
      • +
      + + + +
        +
      • +

        ROUTE_VARIABLE

        +
        public static final ResponseType ROUTE_VARIABLE
        +
      • +
      + + + +
        +
      • +

        SIM_VARIABLE

        +
        public static final ResponseType SIM_VARIABLE
        +
      • +
      + + + +
        +
      • +

        POLYGON_CONTEXT

        +
        public static final ResponseType POLYGON_CONTEXT
        +
      • +
      + + + +
        +
      • +

        EDGE_CONTEXT

        +
        public static final ResponseType EDGE_CONTEXT
        +
      • +
      + + + +
        +
      • +

        AREAL_DETECTOR_CONTEXT

        +
        public static final ResponseType AREAL_DETECTOR_CONTEXT
        +
      • +
      + + + +
        +
      • +

        PERSON_CONTEXT

        +
        public static final ResponseType PERSON_CONTEXT
        +
      • +
      + + + +
        +
      • +

        POI_CONTEXT

        +
        public static final ResponseType POI_CONTEXT
        +
      • +
      + + + +
        +
      • +

        GUI_CONTEXT

        +
        public static final ResponseType GUI_CONTEXT
        +
      • +
      + + + +
        +
      • +

        MULTI_ENTRY_EXIT_DETECTOR_CONTEXT

        +
        public static final ResponseType MULTI_ENTRY_EXIT_DETECTOR_CONTEXT
        +
      • +
      + + + +
        +
      • +

        INDUCTIONLOOP_CONTEXT

        +
        public static final ResponseType INDUCTIONLOOP_CONTEXT
        +
      • +
      + + + +
        +
      • +

        ROUTE_CONTEXT

        +
        public static final ResponseType ROUTE_CONTEXT
        +
      • +
      + + + +
        +
      • +

        VEHICLE_CONTEXT

        +
        public static final ResponseType VEHICLE_CONTEXT
        +
      • +
      + + + +
        +
      • +

        VEHICLETYPE_CONTEXT

        +
        public static final ResponseType VEHICLETYPE_CONTEXT
        +
      • +
      + + + +
        +
      • +

        JUNCTION_CONTEXT

        +
        public static final ResponseType JUNCTION_CONTEXT
        +
      • +
      + + + +
        +
      • +

        SIM_CONTEXT

        +
        public static final ResponseType SIM_CONTEXT
        +
      • +
      + + + +
        +
      • +

        LANE_CONTEXT

        +
        public static final ResponseType LANE_CONTEXT
        +
      • +
      + + + +
        +
      • +

        TL_CONTEXT

        +
        public static final ResponseType TL_CONTEXT
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ResponseType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ResponseType c : ResponseType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ResponseType valueOf​(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        isVariable

        +
        public boolean isVariable()
        +
      • +
      + + + +
        +
      • +

        isContext

        +
        public boolean isContext()
        +
      • +
      + + + +
        +
      • +

        getType

        +
        public static ResponseType getType​(int response)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscribtionVariable.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,563 @@ + + + + + +SubscribtionVariable (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SubscribtionVariable

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<SubscribtionVariable>
    • +
    • +
        +
      • de.tudresden.sumo.subscription.SubscribtionVariable
      • +
      +
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SubscribtionVariable[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SubscribtionVariable c : SubscribtionVariable.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SubscribtionVariable valueOf​(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getID

        +
        public int getID()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionContext.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,563 @@ + + + + + +SubscriptionContext (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SubscriptionContext

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<SubscriptionContext>
    • +
    • +
        +
      • de.tudresden.sumo.subscription.SubscriptionContext
      • +
      +
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SubscriptionContext[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SubscriptionContext c : SubscriptionContext.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SubscriptionContext valueOf​(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getID

        +
        public int getID()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/Subscription.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,256 @@ + + + + + +Subscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface Subscription

+
+
+
+ +
+
+ +
+
+
    +
  • + +
    + +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SubscriptionObject.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,447 @@ + + + + + +SubscriptionObject (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SubscriptionObject

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.subscription.SubscriptionObject
    • +
    +
  • +
+
+
    +
  • +
    +
    public class SubscriptionObject
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SubscriptionObject​(java.lang.String id, + ResponseType response, + int variable, + int status, + int return_type, + SumoObject object) 
      SubscriptionObject​(java.lang.String id, + ResponseType response, + int domain, + java.lang.String name, + int variable, + int status, + int return_type, + SumoObject object) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        id

        +
        public java.lang.String id
        +
      • +
      + + + + + + + +
        +
      • +

        domain

        +
        public int domain
        +
      • +
      + + + +
        +
      • +

        name

        +
        public java.lang.String name
        +
      • +
      + + + +
        +
      • +

        variable

        +
        public int variable
        +
      • +
      + + + +
        +
      • +

        status

        +
        public int status
        +
      • +
      + + + +
        +
      • +

        return_type

        +
        public int return_type
        +
      • +
      + + + + +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SubscriptionObject

        +
        public SubscriptionObject​(java.lang.String id,
        +                          ResponseType response,
        +                          int domain,
        +                          java.lang.String name,
        +                          int variable,
        +                          int status,
        +                          int return_type,
        +                          SumoObject object)
        +
      • +
      + + + +
        +
      • +

        SubscriptionObject

        +
        public SubscriptionObject​(java.lang.String id,
        +                          ResponseType response,
        +                          int variable,
        +                          int status,
        +                          int return_type,
        +                          SumoObject object)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/SumoDomain.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,472 @@ + + + + + +SumoDomain (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SumoDomain

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Enum<SumoDomain>
    • +
    • +
        +
      • de.tudresden.sumo.subscription.SumoDomain
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable, java.lang.Comparable<SumoDomain>
    +
    +
    +
    public enum SumoDomain
    +extends java.lang.Enum<SumoDomain>
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      intgetID() 
      static SumoDomainvalueOf​(java.lang.String name) +
      Returns the enum constant of this type with the specified name.
      +
      static SumoDomain[]values() +
      Returns an array containing the constants of this enum type, in +the order they are declared.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Enum

        +clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +getClass, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SumoDomain[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SumoDomain c : SumoDomain.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SumoDomain valueOf​(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getID

        +
        public int getID()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/subscription/VariableSubscription.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,434 @@ + + + + + +VariableSubscription (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class VariableSubscription

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.subscription.VariableSubscription
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Subscription
    +
    +
    +
    public class VariableSubscription
    +extends java.lang.Object
    +implements Subscription
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.util.LinkedList<java.lang.Integer>commands 
      java.lang.StringobjectID 
      doublestart 
      doublestop 
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidaddCommand​(int cmd) 
      CommandgetCommand() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        start

        +
        public double start
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public double stop
        +
      • +
      + + + +
        +
      • +

        objectID

        +
        public java.lang.String objectID
        +
      • +
      + + + +
        +
      • +

        commands

        +
        public java.util.LinkedList<java.lang.Integer> commands
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        VariableSubscription

        +
        public VariableSubscription()
        +
      • +
      + + + +
        +
      • +

        VariableSubscription

        +
        public VariableSubscription​(SubscribtionVariable sv,
        +                            double start,
        +                            double stop,
        +                            java.lang.String objectID)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addCommand

        +
        public void addCommand​(int cmd)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/CommandProcessor.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.sumo.util.CommandProcessor (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.CommandProcessor

+
+
No usage of de.tudresden.sumo.util.CommandProcessor
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/ConvertHelper.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/ConvertHelper.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/ConvertHelper.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/ConvertHelper.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,196 @@ + + + + + +Uses of Class de.tudresden.sumo.util.ConvertHelper (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.ConvertHelper

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observable.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,241 @@ + + + + + +Uses of Class de.tudresden.sumo.util.Observable (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.Observable

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Observer.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Interface de.tudresden.sumo.util.Observer (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
de.tudresden.sumo.util.Observer

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Query.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.sumo.util.Query (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.Query

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/SumoCommand.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,3462 @@ + + + + + +Uses of Class de.tudresden.sumo.util.SumoCommand (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.SumoCommand

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + +
    Packages that use SumoCommand 
    PackageDescription
    de.tudresden.sumo.cmd 
    de.tudresden.sumo.util 
    it.polito.appeal.traci 
    +
  • +
  • +
      +
    • +
      + + +

      Uses of SumoCommand in de.tudresden.sumo.cmd

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in de.tudresden.sumo.cmd that return SumoCommand 
      Modifier and TypeMethodDescription
      static SumoCommandEdge.adaptTraveltime​(java.lang.String edgeID, + double time) +
      Adapt the travel time value (in s) used for (re-)routing on the given + edge.
      +
      static SumoCommandEdge.adaptTraveltime​(java.lang.String edgeID, + double time, + double begin, + double end) +
      Adapt the travel time value (in s) used for (re-)routing on the given + edge.
      +
      static SumoCommandPerson.add​(java.lang.String personID, + java.lang.String edgeID, + double pos, + double depart, + java.lang.String typeID) +
      Inserts a new person to the simulation at the given edge, position and + time (in s).
      +
      static SumoCommandPoi.add​(java.lang.String poiID, + double x, + double y, + SumoColor color, + java.lang.String poiType, + int layer) +
      Add a new point-of-interest.
      +
      static SumoCommandPolygon.add​(java.lang.String polygonID, + SumoGeometry shape, + SumoColor color, + boolean fill, + java.lang.String polygonType, + int layer) +
      Add a new polygon.
      +
      static SumoCommandRoute.add​(java.lang.String routeID, + SumoStringList edges) +
      Add a new route.
      +
      static SumoCommandVehicle.add​(java.lang.String vehID, + java.lang.String typeID, + java.lang.String routeID, + int depart, + double pos, + double speed, + byte lane) +
      Add a new vehicle.
      +
      static SumoCommandVehicle.addFull​(java.lang.String vehID, + java.lang.String routeID, + java.lang.String typeID, + java.lang.String depart, + java.lang.String departLane, + java.lang.String departPosition, + java.lang.String departSpeed, + java.lang.String arrivalLane, + java.lang.String arrivalPosition, + java.lang.String arrivalSpeed, + java.lang.String fromTAZ, + java.lang.String toTAZ, + java.lang.String line, + int person_capacity, + int person_number) +
      Add a new vehicle.
      +
      static SumoCommandPerson.appendDrivingStage​(java.lang.String personID, + java.lang.String toEdge, + java.lang.String lines, + java.lang.String stopID) +
      Appends a driving stage to the plan of the given person + The lines parameter should be a space-separated list of line ids
      +
      static SumoCommandPerson.appendWaitingStage​(java.lang.String personID, + double duration, + java.lang.String description, + java.lang.String stopID) +
      Appends a waiting stage with duration in s to the plan of the given person
      +
      static SumoCommandPerson.appendWalkingStage​(java.lang.String personID, + SumoStringList edges, + double arrivalPos, + double duration, + double speed, + java.lang.String stopID) +
      Appends a walking stage to the plan of the given person + The walking speed can either be specified, computed from the duration parameter (in s) or taken from the type of the person
      +
      static SumoCommandVehicle.changeLane​(java.lang.String vehID, + byte laneIndex, + double duration) +
      Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.
      +
      static SumoCommandVehicle.changeSublane​(java.lang.String vehID, + double latDist) +
      Forces a lateral change by the given amount (negative values indicate changing to the right, positive to the left) + This will override any other lane change motivations but conform to + safety-constraints as configured by laneChangeMode.
      +
      static SumoCommandVehicle.changeTarget​(java.lang.String vehID, + java.lang.String edgeID) +
      The vehicle's destination edge is set to the given.
      +
      static SumoCommandSimulation.clearPending​(java.lang.String routeID) +
      Clear pending
      +
      static SumoCommandSimulation.convert2D​(java.lang.String edgeID, + double pos, + byte laneIndex, + java.lang.String toGeo) +
      convert2D
      +
      static SumoCommandSimulation.convert3D​(java.lang.String edgeID, + double pos, + byte laneIndex, + java.lang.String toGeo) +
      convert3D
      +
      static SumoCommandSimulation.convertGeo​(double x, + double y, + boolean fromGeo) +
      convertGeo
      +
      static SumoCommandSimulation.convertRoad​(double x, + double y, + boolean isGeo, + java.lang.String vClass) +
      convertRoad
      +
      static SumoCommandSimulation.findIntermodalRoute​(java.lang.String fromEdge, + java.lang.String toEdge, + java.lang.String modes, + double depart, + int routingMode, + double speed, + double walkingFactor, + double departPos, + double arrivalPos, + double departPosLat, + java.lang.String pType, + java.lang.String vType, + java.lang.String destStop) +
      findIntermodalRoute
      +
      static SumoCommandSimulation.findRoute​(java.lang.String fromEdge, + java.lang.String toEdge, + java.lang.String vType, + double depart, + int routingMode) +
      findRoute
      +
      static SumoCommandVehicle.getAccel​(java.lang.String vehID) +
      Returns the acceleration of the named vehicle within the last step.
      +
      static SumoCommandVehicletype.getAccel​(java.lang.String typeID) +
      Returns the maximum acceleration of the named vehicle class.
      +
      static SumoCommandVehicle.getAccumulatedWaitingTime​(java.lang.String vehID) +
      Returns the vehicle class.
      +
      static SumoCommandVehicle.getActionStepLength​(java.lang.String vehID) +
      Returns the action step length for this vehicle.
      +
      static SumoCommandEdge.getAdaptedTraveltime​(java.lang.String edgeID, + double time) +
      Returns the travel time value (in s) used for (re-)routing.
      +
      static SumoCommandVehicle.getAdaptedTraveltime​(java.lang.String vehID, + double time, + java.lang.String edgeID) +
      Returns the edge travel time for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandLane.getAllowed​(java.lang.String laneID) +
      Returns a list of allowed vehicle classes.
      +
      static SumoCommandVehicle.getAllowedSpeed​(java.lang.String vehID) +
      Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
      +
      static SumoCommandPerson.getAngle​(java.lang.String personID) +
      get angle
      +
      static SumoCommandVehicle.getAngle​(java.lang.String vehID) +
      Returns the angle of the named vehicle within the last time step.
      +
      static SumoCommandVehicle.getApparentDecel​(java.lang.String vehID) +
      Returns the apparent deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandVehicletype.getApparentDecel​(java.lang.String typeID) +
      Returns The preferred lateral alignment of the type
      +
      static SumoCommandSimulation.getArrivedIDList() +
      Returns a list of IDs of vehicles which arrived in this time step.
      +
      static SumoCommandSimulation.getArrivedNumber() +
      Returns the number of vehicles which arrived in this time step.
      +
      static SumoCommandVehicle.getBestLanes​(java.lang.String vehID) +
      getBestLanes
      +
      static SumoCommandGui.getBoundary​(java.lang.String viewID) +
      Returns the coordinates of the lower left and the upper right corner of + the currently visible view.
      +
      static SumoCommandSimulation.getBusStopWaiting() +
      Returns the current waiting time on bus stops(in ms).
      +
      static SumoCommandEdge.getCO2Emission​(java.lang.String edgeID) +
      Returns the CO2 emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandLane.getCO2Emission​(java.lang.String laneID) +
      Returns the CO2 emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandVehicle.getCO2Emission​(java.lang.String vehID) +
      Returns the CO2 emission in mg for the last time step.
      +
      static SumoCommandEdge.getCOEmission​(java.lang.String edgeID) +
      Returns the CO emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandLane.getCOEmission​(java.lang.String laneID) +
      Returns the CO emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandVehicle.getCOEmission​(java.lang.String vehID) +
      Returns the CO emission in mg for the last time step.
      +
      static SumoCommandSimulation.getCollidingVehiclesIDList() +
      getCollidingVehiclesNumber()
      +
      static SumoCommandSimulation.getCollidingVehiclesNumber() +
      getCollidingVehiclesNumber()
      +
      static SumoCommandPerson.getColor​(java.lang.String personID) +
      get lane position
      +
      static SumoCommandPoi.getColor​(java.lang.String poiID) +
      Returns the color of this poi.
      +
      static SumoCommandPolygon.getColor​(java.lang.String polygonID) +
      Returns the color of this polygon.
      +
      static SumoCommandVehicle.getColor​(java.lang.String vehID) +
      Returns the vehicle's color (RGBA).
      +
      static SumoCommandVehicletype.getColor​(java.lang.String typeID) +
      Returns the vehicle type's color.
      +
      static SumoCommandTrafficlight.getCompleteRedYellowGreenDefinition​(java.lang.String tlsID) +
      Returns the complete traffic light program.
      +
      static SumoCommandTrafficlight.getControlledJunctions​(java.lang.String tlsID) +
      Returns the junctions controlled by the traffic light
      +
      static SumoCommandTrafficlight.getControlledLanes​(java.lang.String tlsID) +
      Returns the list of lanes which are controlled by the named traffic light.
      +
      static SumoCommandTrafficlight.getControlledLinks​(java.lang.String tlsID) +
      Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.
      +
      static SumoCommandSimulation.getCurrentTime() +
      getCurrentTime
      +
      static SumoCommandVehicle.getDecel​(java.lang.String vehID) +
      Returns the deceleration of the named vehicle within the last time step.
      +
      static SumoCommandVehicletype.getDecel​(java.lang.String typeID) +
      Returns the maximum deceleration of the names vehicle type.
      +
      static SumoCommandSimulation.getDeltaT() +
      getDeltaT
      +
      static SumoCommandSimulation.getDepartedIDList() +
      Returns a list of IDs of vehicles which departed in this time step.
      +
      static SumoCommandSimulation.getDepartedNumber() +
      Returns the number of vehicles which departed in this time step.
      +
      static SumoCommandLane.getDisallowed​(java.lang.String laneID) +
      Returns a list of disallowed vehicle classes.
      +
      static SumoCommandVehicle.getDistance​(java.lang.String vehID) +
      Get the distance to the starting point acts as a odometer
      +
      static SumoCommandSimulation.getDistance2D​(double x1, + double y1, + double x2, + double y2, + boolean isGeo, + boolean isDriving) 
      static SumoCommandSimulation.getDistanceRoad​(java.lang.String edgeID1, + double pos1, + java.lang.String edgeID2, + double pos2, + boolean isDriving) 
      static SumoCommandVehicle.getDrivingDistance​(java.lang.String vehID, + java.lang.String edgeID, + double pos, + byte laneID) +
      Returns the driving distance (in m) of the named vehicle within the last tine step.
      +
      static SumoCommandVehicle.getDrivingDistance2D​(java.lang.String vehID, + double x, + double y) +
      getDrivingDistance2D
      +
      static SumoCommandLane.getEdgeID​(java.lang.String laneID) +
      Returns the ID of the edge this lane belongs to.
      +
      static SumoCommandPerson.getEdges​(java.lang.String personID) +
      get edges
      +
      static SumoCommandPerson.getEdges​(java.lang.String personID, + int nextStageIndex) +
      get edges
      +
      static SumoCommandRoute.getEdges​(java.lang.String routeID) +
      Returns the IDs of the edges this route covers.
      +
      static SumoCommandEdge.getEffort​(java.lang.String edgeID, + double time) +
      Returns the effort value used for (re-)routing.
      +
      static SumoCommandVehicle.getEffort​(java.lang.String vehID, + double time, + java.lang.String edgeID) +
      Returns the edge effort for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandEdge.getElectricityConsumption​(java.lang.String edgeID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandLane.getElectricityConsumption​(java.lang.String laneID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandVehicle.getElectricityConsumption​(java.lang.String vehID) +
      Returns the electricity consumption in ml for the last time step.
      +
      static SumoCommandVehicle.getEmergencyDecel​(java.lang.String vehID) +
      Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandVehicletype.getEmergencyDecel​(java.lang.String typeID) +
      Returns the maximal physically possible deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandSimulation.getEmergencyStoppingVehiclesIDList() +
      getEmergencyStoppingVehiclesIDList()
      +
      static SumoCommandSimulation.getEmergencyStoppingVehiclesNumber() +
      getEmergencyStoppingVehiclesNumber()
      +
      static SumoCommandVehicle.getEmissionClass​(java.lang.String vehID) +
      Returns the emission class of the named vehicle.
      +
      static SumoCommandVehicletype.getEmissionClass​(java.lang.String typeID) +
      Returns the emission class of the named vehicle type.
      +
      static SumoCommandSimulation.getEndingTeleportIDList() +
      Returns a list of IDs of vehicles which ended to be teleported in this time step.
      +
      static SumoCommandSimulation.getEndingTeleportNumber() +
      Returns the number of vehicles which ended to be teleported in this time step.
      +
      static SumoCommandTrafficlight.getExternalState​(java.lang.String tlsID) +
      Returns the external state
      +
      static SumoCommandPolygon.getFilled​(java.lang.String polygonID) +
      Returns the shape of this polygon.
      +
      static SumoCommandLane.getFoes​(java.lang.String laneID, + java.lang.String toLane) +
      Returns the ids of incoming lanes that have right of way over the connection from laneID to toLaneID
      +
      static SumoCommandEdge.getFuelConsumption​(java.lang.String edgeID) +
      Returns the fuel consumption (in ml) on the given edge during the last + time step.
      +
      static SumoCommandLane.getFuelConsumption​(java.lang.String laneID) +
      Returns the fuel consumption (in ml) on the given lane during the last + time step.
      +
      static SumoCommandVehicle.getFuelConsumption​(java.lang.String vehID) +
      Returns the fuel consumption in ml for the last time step.
      +
      static SumoCommandEdge.getHCEmission​(java.lang.String edgeID) +
      Returns the HC emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandLane.getHCEmission​(java.lang.String laneID) +
      Returns the HC emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandVehicle.getHCEmission​(java.lang.String vehID) +
      Returns the HC emission (in mg) during the last time step.
      +
      static SumoCommandVehicle.getHeight​(java.lang.String vehID) +
      Returns the height in m of this vehicle.
      +
      static SumoCommandVehicletype.getHeight​(java.lang.String typeID) +
      Returns the height in m of vehicles of this type.
      +
      static SumoCommandEdge.getIDCount() +
      Returns the number of edges in the network.
      +
      static SumoCommandInductionloop.getIDCount() +
      Returns the number of all induction loops in the network.
      +
      static SumoCommandJunction.getIDCount() +
      Returns the number of all junctions in the network.
      +
      static SumoCommandLane.getIDCount() +
      Returns the number of all lanes in the network.
      +
      static SumoCommandLanearea.getIDCount() +
      Returns the number of the areal detectors in the network.
      +
      static SumoCommandMultientryexit.getIDCount() +
      Returns the number of all multi-entry/multi-exit detectors in the network.
      +
      static SumoCommandPerson.getIDCount() +
      Returns the number of all persons in the network.
      +
      static SumoCommandPoi.getIDCount() +
      Returns the number of all Poi's in the network.
      +
      static SumoCommandPolygon.getIDCount() +
      Returns the number of all Polygons in the network.
      +
      static SumoCommandRoute.getIDCount() +
      Returns the number of all Routes in the network.
      +
      static SumoCommandTrafficlight.getIDCount() +
      Returns the number of all traffic lights in the network.
      +
      static SumoCommandVehicle.getIDCount() +
      Returns the number of all vehicles in the network.
      +
      static SumoCommandVehicletype.getIDCount() +
      Returns the number of all vehicle types in the network.
      +
      static SumoCommandEdge.getIDList() +
      Returns a list of all edges in the network.
      +
      static SumoCommandGui.getIDList() +
      Returns the list of available views (open windows).
      +
      static SumoCommandInductionloop.getIDList() +
      Returns a list of IDs of all induction loops within the scenario.
      +
      static SumoCommandJunction.getIDList() +
      Returns a list of IDs of all junctions within the scenario.
      +
      static SumoCommandLane.getIDList() +
      Returns a list of IDs of all lanes in the network.
      +
      static SumoCommandLanearea.getIDList() +
      Returns a list of all areal detectors in the network.
      +
      static SumoCommandMultientryexit.getIDList() +
      Returns a list of IDs of all multi-entry/multi-exit detectors within the + scenario.
      +
      static SumoCommandPerson.getIDList() +
      Returns a list of personIDs of all persons
      +
      static SumoCommandPoi.getIDList() +
      Returns a list of IDs of all poi.
      +
      static SumoCommandPolygon.getIDList() +
      Returns a list of IDs of all polygons.
      +
      static SumoCommandRoute.getIDList() +
      Returns a list of IDs of all currently loaded routes.
      +
      static SumoCommandTrafficlight.getIDList() +
      Returns a list of IDs of all traffic lights within the scenario.
      +
      static SumoCommandVehicle.getIDList() +
      Returns a list of ids of all vehicles currently running within the scenario.
      +
      static SumoCommandVehicletype.getIDList() +
      Returns a list of all known vehicle types.
      +
      static SumoCommandVehicle.getImperfection​(java.lang.String vehID) +
      getImperfection
      +
      static SumoCommandVehicletype.getImperfection​(java.lang.String typeID) +
      getImperfection
      +
      static SumoCommandLane.getInternalFoes​(java.lang.String laneID) +
      Returns the ids of internal lanes that are in conflict with the given internal lane id
      +
      static SumoCommandLanearea.getJamLengthMeters​(java.lang.String loopID) +
      getJamLengthMeters
      +
      static SumoCommandLanearea.getJamLengthVehicle​(java.lang.String loopID) +
      getJamLengthVehicle
      +
      static SumoCommandVehicle.getLaneChangeMode​(java.lang.String vehID) +
      Gets the vehicle's lane change mode as a bitset.
      +
      static SumoCommandVehicle.getLaneChangeState​(java.lang.String vehID, + int direction) +
      Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
      +
      static SumoCommandInductionloop.getLaneID​(java.lang.String loopID) +
      Returns the ID of the lane the loop is placed at.
      +
      static SumoCommandLanearea.getLaneID​(java.lang.String loopID) +
      getLaneID
      +
      static SumoCommandVehicle.getLaneID​(java.lang.String vehID) +
      Returns the id of the lane the named vehicle was at within the last step.
      +
      static SumoCommandVehicle.getLaneIndex​(java.lang.String vehID) +
      Returns the index of the lane the named vehicle was at within the last step.
      +
      static SumoCommandEdge.getLaneNumber​(java.lang.String edgeID) 
      static SumoCommandPerson.getLanePosition​(java.lang.String personID) +
      get lane position
      +
      static SumoCommandVehicle.getLanePosition​(java.lang.String vehID) +
      Returns the position of the vehicle along the lane (in m).
      +
      static SumoCommandVehicle.getLastActionTime​(java.lang.String vehID) +
      Returns the time of last action point for this vehicle.
      +
      static SumoCommandEdge.getLastStepHaltingNumber​(java.lang.String edgeID) +
      Returns the total number of halting vehicles on the given edge within the + last time step.
      +
      static SumoCommandLane.getLastStepHaltingNumber​(java.lang.String laneID) +
      Returns the total number of halting vehicles on the given lane within the + last time step.
      +
      static SumoCommandLanearea.getLastStepHaltingNumber​(java.lang.String loopID) +
      Returns the number of vehicles which were halting during the last time step.
      +
      static SumoCommandMultientryexit.getLastStepHaltingNumber​(java.lang.String detID) +
      Returns the number of vehicles which were halting during the last time + step.
      +
      static SumoCommandEdge.getLastStepLength​(java.lang.String edgeID) +
      Returns the total vehicle length (in m) on the given edge within the last + time step.
      +
      static SumoCommandLane.getLastStepLength​(java.lang.String laneID) +
      Returns the total vehicle length (in m) on the given lane during the last + time step.
      +
      static SumoCommandInductionloop.getLastStepMeanLength​(java.lang.String loopID) +
      Returns the mean length of vehicles (in m) which were on the detector in + the last step.
      +
      static SumoCommandEdge.getLastStepMeanSpeed​(java.lang.String edgeID) +
      Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
      +
      static SumoCommandInductionloop.getLastStepMeanSpeed​(java.lang.String loopID) +
      Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
      +
      static SumoCommandLane.getLastStepMeanSpeed​(java.lang.String laneID) +
      Returns the mean speed (in m/s) on the given lane within the last time + step.
      +
      static SumoCommandLanearea.getLastStepMeanSpeed​(java.lang.String loopID) +
      getLastStepMeanSpeed
      +
      static SumoCommandMultientryexit.getLastStepMeanSpeed​(java.lang.String detID) +
      Returns the mean speed of vehicles (in m/s) that have been within the + named multi-entry/multi-exit detector within the last simulation step.
      +
      static SumoCommandEdge.getLastStepOccupancy​(java.lang.String edgeID) +
      Returns the percentage of time (in %) the detector was occupied by a + vehicle.
      +
      static SumoCommandInductionloop.getLastStepOccupancy​(java.lang.String loopID) +
      Returns the percentage of time (in %) the detector was occupied by a + vehicle within the last time step.
      +
      static SumoCommandLane.getLastStepOccupancy​(java.lang.String laneID) +
      Returns the occupancy (in %) on the given lane during the last time step.
      +
      static SumoCommandLanearea.getLastStepOccupancy​(java.lang.String loopID) +
      getLastStepOccupancy
      +
      static SumoCommandEdge.getLastStepPersonIDs​(java.lang.String edgeID) +
      Returns the ids of the persons on the given edge during the last time step.
      +
      static SumoCommandEdge.getLastStepVehicleIDs​(java.lang.String edgeID) +
      Returns the list of IDs of the vehicles on the given edge within the last + simulation step.
      +
      static SumoCommandInductionloop.getLastStepVehicleIDs​(java.lang.String loopID) +
      Returns the list of IDs of vehicles that were on the named induction loop + in the last simulation step.
      +
      static SumoCommandLane.getLastStepVehicleIDs​(java.lang.String laneID) +
      Returns the IDs of the vehicles on the given lane within the last time + step.
      +
      static SumoCommandLanearea.getLastStepVehicleIDs​(java.lang.String loopID) +
      Returns the list of ids of vehicles that were on the named detector in the last simulation step.
      +
      static SumoCommandMultientryexit.getLastStepVehicleIDs​(java.lang.String detID) +
      Returns the list of IDs of vehicles that have been within the named + multi-entry/multi-exit detector in the last simulation step.
      +
      static SumoCommandEdge.getLastStepVehicleNumber​(java.lang.String edgeID) +
      Returns the total number of vehicles on this edge within the last time + step.
      +
      static SumoCommandInductionloop.getLastStepVehicleNumber​(java.lang.String loopID) +
      Returns the number of vehicles that were on the named induction loop + within the last simulation step.
      +
      static SumoCommandLane.getLastStepVehicleNumber​(java.lang.String laneID) +
      Returns number of vehicles on this lane within the last time step.
      +
      static SumoCommandLanearea.getLastStepVehicleNumber​(java.lang.String loopID) +
      Returns the number of vehicles on the detector
      +
      static SumoCommandMultientryexit.getLastStepVehicleNumber​(java.lang.String detID) +
      Returns the number of vehicles that have been within the named + multi-entry/multi-exit detector within the last simulation step.
      +
      static SumoCommandVehicle.getLateralAlignment​(java.lang.String vehID) +
      Returns The preferred lateral alignment of the vehicle
      +
      static SumoCommandVehicletype.getLateralAlignment​(java.lang.String typeID) +
      Returns The preferred lateral alignment of the type
      +
      static SumoCommandVehicle.getLateralLanePosition​(java.lang.String vehID) +
      Returns The lateral position of the vehicle on its current lane measured in m.
      +
      static SumoCommandVehicle.getLeader​(java.lang.String vehID, + double dist) +
      Return the leading vehicle id together with the distance.
      +
      static SumoCommandLane.getLength​(java.lang.String laneID) +
      Returns the length (in m) of the named lane.
      +
      static SumoCommandLanearea.getLength​(java.lang.String loopID) +
      getlength
      +
      static SumoCommandPerson.getLength​(java.lang.String personID) +
      get length
      +
      static SumoCommandVehicle.getLength​(java.lang.String vehID) +
      Returns the length (in m) of the named vehicle.
      +
      static SumoCommandVehicletype.getLength​(java.lang.String typeID) +
      Returns the length of the named vehicle type.
      +
      static SumoCommandVehicle.getLine​(java.lang.String vehID) +
      Returns the length (in m) of the named vehicle.
      +
      static SumoCommandLane.getLinkNumber​(java.lang.String laneID) +
      Returns the number of links outgoing from this lane.
      +
      static SumoCommandLane.getLinks​(java.lang.String laneID) +
      Returns descriptions of the links (in m) outgoing from this lane.
      +
      static SumoCommandSimulation.getLoadedIDList() +
      Returns a list of IDs of vehicles which were loaded in this time step.
      +
      static SumoCommandSimulation.getLoadedNumber() +
      Return the number of vehicles which were loaded in this time step
      +
      static SumoCommandLane.getMaxSpeed​(java.lang.String laneID) +
      Returns the maximum speed (in m/s) allowed on this lane.
      +
      static SumoCommandVehicle.getMaxSpeed​(java.lang.String vehID) +
      Returns the maximum speed(in m/s) of the named vehicle.
      +
      static SumoCommandVehicletype.getMaxSpeed​(java.lang.String typeID) +
      Return the maximum speed of the named vehicle type.
      +
      static SumoCommandVehicle.getMaxSpeedLat​(java.lang.String vehID) +
      Returns the maximum lateral speed in m/s of this vehicle.
      +
      static SumoCommandVehicletype.getMaxSpeedLat​(java.lang.String typeID) +
      Returns the maximum lateral speed in m/s of this type.
      +
      static SumoCommandSimulation.getMinExpectedNumber() +
      Returns the number of vehicles which are in the net plus the ones still waiting to start.
      +
      static SumoCommandPerson.getMinGap​(java.lang.String personID) +
      get minGap
      +
      static SumoCommandVehicle.getMinGap​(java.lang.String vehID) +
      Returns the minimum gap (in m) between this vehicle and the vehicle before it.
      +
      static SumoCommandVehicletype.getMinGap​(java.lang.String typeID) +
      Returns the minimum headway gap of the named vehicle type.
      +
      static SumoCommandVehicle.getMinGapLat​(java.lang.String vehID) +
      Returns The desired lateral gap of this vehicle at 50km/h in m
      +
      static SumoCommandVehicletype.getMinGapLat​(java.lang.String typeID) +
      Returns The desired lateral gap of this type at 50km/h in m
      +
      static SumoCommandSimulation.getNetBoundary() +
      Returns the boundary box of the simulation network.
      +
      static SumoCommandPerson.getNextEdge​(java.lang.String personID) +
      get next edge
      +
      static SumoCommandVehicle.getNextStops​(java.lang.String vehID) +
      Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...]
      +
      static SumoCommandTrafficlight.getNextSwitch​(java.lang.String tlsID) +
      Returns the assumed time (in ms) at which the TLS changes the phase.
      +
      static SumoCommandVehicle.getNextTLS​(java.lang.String vehID) +
      Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
      +
      static SumoCommandEdge.getNoiseEmission​(java.lang.String edgeID) +
      Returns the noise emissions (in db)on the given edge within the last time + step.
      +
      static SumoCommandLane.getNoiseEmission​(java.lang.String laneID) +
      Returns the noise emissions (in db) on the given lane during the last + time step.
      +
      static SumoCommandVehicle.getNoiseEmission​(java.lang.String vehID) +
      Returns the noise emission (in db) generated by the vehicle during the last time step.
      +
      static SumoCommandEdge.getNOxEmission​(java.lang.String edgeID) +
      Returns the NOx emissions (in mg) on the given edge during the last time + step.
      +
      static SumoCommandLane.getNOxEmission​(java.lang.String laneID) +
      Returns the NOx emissions (in mg) on the given lane during the last time + step.
      +
      static SumoCommandVehicle.getNOxEmission​(java.lang.String vehID) +
      Returns the NOx emissions (in mg) generated by the vehicle during the last time step.
      +
      static SumoCommandGui.getOffset​(java.lang.String viewID) +
      Returns the x and y offset of the center of the current view.
      +
      static SumoCommandEdge.getParameter​(java.lang.String edgeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandInductionloop.getParameter​(java.lang.String loopID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandLane.getParameter​(java.lang.String laneID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandPerson.getParameter​(java.lang.String personID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandPoi.getParameter​(java.lang.String poiID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandPolygon.getParameter​(java.lang.String polygonID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandRoute.getParameter​(java.lang.String routeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandTrafficlight.getParameter​(java.lang.String tlsID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandVehicle.getParameter​(java.lang.String vehID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandVehicletype.getParameter​(java.lang.String typeID, + java.lang.String param) +
      Returns the chosen parameter
      +
      static SumoCommandSimulation.getParkingEndingVehiclesIDList() +
      getParkingEndingVehiclesIDList()
      +
      static SumoCommandSimulation.getParkingEndingVehiclesNumber() +
      getParkingEndingVehiclesNumber()
      +
      static SumoCommandSimulation.getParkingStartingVehiclesIDList() +
      getParkingStartingVehiclesIDList()
      +
      static SumoCommandSimulation.getParkingStartingVehiclesNumber() +
      getParkingStartingVehiclesNumber()
      +
      static SumoCommandVehicle.getPersonIDList​(java.lang.String vehID) +
      Returns the list of persons which includes those defined using attribute 'personNumber' + as well as -objects which are riding in this vehicle.
      +
      static SumoCommandPerson.getPersonNumber​(java.lang.String personID) +
      get person number
      +
      static SumoCommandVehicle.getPersonNumber​(java.lang.String vehID) +
      getPersonNumber
      +
      static SumoCommandTrafficlight.getPhase​(java.lang.String tlsID) +
      Returns the index of the current phase in the current program.
      +
      static SumoCommandTrafficlight.getPhaseDuration​(java.lang.String tlsID) +
      getPhaseDuration
      +
      static SumoCommandTrafficlight.getPhaseName​(java.lang.String tlsID) +
      Returns the name of the current phase in the current program.
      +
      static SumoCommandEdge.getPMxEmission​(java.lang.String edgeID) +
      Returns the particular matter emissions (in mg) on the given edge on this + edge during the last time step.
      +
      static SumoCommandLane.getPMxEmission​(java.lang.String laneID) +
      Returns the particular matter emissions (in mg) on the given lane during + the last time step.
      +
      static SumoCommandVehicle.getPMxEmission​(java.lang.String vehID) +
      Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.
      +
      static SumoCommandInductionloop.getPosition​(java.lang.String loopID) +
      Returns the position (in m) of the induction loop at it's lane, counted + from the lane's begin.
      +
      static SumoCommandJunction.getPosition​(java.lang.String junctionID) +
      Returns the position of the named junction.
      +
      static SumoCommandLanearea.getPosition​(java.lang.String loopID) +
      getPosition
      +
      static SumoCommandPerson.getPosition​(java.lang.String personID) +
      get position
      +
      static SumoCommandPoi.getPosition​(java.lang.String poiID) +
      Returns the position of this poi.
      +
      static SumoCommandVehicle.getPosition​(java.lang.String vehID) +
      Returns the position of the named vehicle within the last step [m,m].
      +
      static SumoCommandPerson.getPosition3D​(java.lang.String personID) +
      get position3D
      +
      static SumoCommandVehicle.getPosition3D​(java.lang.String vehID) +
      Returns the position of the named vehicle within the last step [m,m,m].
      +
      static SumoCommandTrafficlight.getProgram​(java.lang.String tlsID) +
      Returns the id of the current program.
      +
      static SumoCommandTrafficlight.getRedYellowGreenState​(java.lang.String tlsID) +
      Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.
      +
      static SumoCommandPerson.getRemainingStages​(java.lang.String personID) +
      get remaining stages
      +
      static SumoCommandPerson.getRoadID​(java.lang.String personID) +
      get road ID
      +
      static SumoCommandVehicle.getRoadID​(java.lang.String vehID) +
      Returns the id of the edge the named vehicle was at within the last step.
      +
      static SumoCommandVehicle.getRoute​(java.lang.String vehID) +
      Returns the ids of the edges the vehicle's route is made of.
      +
      static SumoCommandVehicle.getRouteID​(java.lang.String vehID) +
      Returns the id of the route of the named vehicle.
      +
      static SumoCommandVehicle.getRouteIndex​(java.lang.String vehID) +
      Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed
      +
      static SumoCommandVehicle.getRoutingMode​(java.lang.String vehID) +
      returns the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
      +
      static SumoCommandGui.getSchema​(java.lang.String viewID) +
      Returns the name of the current coloring scheme.
      +
      static SumoCommandJunction.getShape​(java.lang.String junctionID) +
      getShape
      +
      static SumoCommandLane.getShape​(java.lang.String laneID) +
      Returns this lane's shape.
      +
      static SumoCommandPolygon.getShape​(java.lang.String polygonID) +
      Returns the shape of this polygon.
      +
      static SumoCommandVehicle.getShapeClass​(java.lang.String vehID) +
      getShapeClass
      +
      static SumoCommandVehicletype.getShapeClass​(java.lang.String typeID) +
      getShapeClass
      +
      static SumoCommandVehicle.getSignals​(java.lang.String vehID) +
      getSignals
      +
      static SumoCommandVehicle.getSlope​(java.lang.String vehID) +
      getSlope
      +
      static SumoCommandPerson.getSpeed​(java.lang.String personID) +
      get speed
      +
      static SumoCommandVehicle.getSpeed​(java.lang.String vehID) +
      Returns the speed (in m/s) of the named vehicle within the last step.
      +
      static SumoCommandVehicle.getSpeedDeviation​(java.lang.String vehID) +
      Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.
      +
      static SumoCommandVehicletype.getSpeedDeviation​(java.lang.String typeID) +
      Returns the speed deviation of the named vehicle type.
      +
      static SumoCommandVehicle.getSpeedFactor​(java.lang.String vehID) +
      Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
      +
      static SumoCommandVehicletype.getSpeedFactor​(java.lang.String typeID) +
      Return the speed factor of the names vehicle type.
      +
      static SumoCommandVehicle.getSpeedMode​(java.lang.String vehID) +
      Returns the speed mode of a vehicle
      +
      static SumoCommandVehicle.getSpeedWithoutTraCI​(java.lang.String vehID) +
      getSpeedWithoutTraCI
      +
      static SumoCommandPerson.getStage​(java.lang.String personID, + int nextStageIndex) +
      get stage
      +
      static SumoCommandSimulation.getStartingTeleportIDList() +
      Returns a list of IDs of vehicles which started to teleport in this time step.
      +
      static SumoCommandSimulation.getStartingTeleportNumber() +
      Returns the number of vehicles which started to teleport in this time step.
      +
      static SumoCommandSimulation.getStopEndingVehiclesIDList() +
      getStopEndingVehiclesIDList()
      +
      static SumoCommandSimulation.getStopEndingVehiclesNumber() +
      getStopEndingVehiclesNumber()
      +
      static SumoCommandSimulation.getStopStartingVehiclesIDList() +
      getStopStartingVehiclesIDList()
      +
      static SumoCommandSimulation.getStopStartingVehiclesNumber() +
      getStopStartingVehiclesIDList()
      +
      static SumoCommandVehicle.getStopState​(java.lang.String vehID) +
      Returns information in regard to stopping: The returned integer is defined as 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop with each of these flags defined as 0 or 1
      +
      static SumoCommandVehicle.getTau​(java.lang.String vehID) +
      getTau
      +
      static SumoCommandVehicletype.getTau​(java.lang.String typeID) +
      getTau
      +
      static SumoCommandSimulation.getTime() +
      getTime
      +
      static SumoCommandInductionloop.getTimeSinceDetection​(java.lang.String loopID) +
      Return the time (in s) since last detection.
      +
      static SumoCommandEdge.getTraveltime​(java.lang.String edgeID) +
      Returns the estimated travel time (in s) on the given edge on this edge + within the last time step.
      +
      static SumoCommandLane.getTraveltime​(java.lang.String laneID) +
      Returns the estimated travel time (in s) on the given lane during the + last time step.
      +
      static SumoCommandPoi.getType​(java.lang.String poiID) +
      Returns the type of the poi.
      +
      static SumoCommandPolygon.getType​(java.lang.String polygonID) +
      Returns the type of the polygon.
      +
      static SumoCommandPerson.getTypeID​(java.lang.String personID) +
      get type ID
      +
      static SumoCommandVehicle.getTypeID​(java.lang.String vehID) +
      Returns the id of the type of the named vehicle.
      +
      static SumoCommandPerson.getVehicle​(java.lang.String personID) +
      get vehicle
      +
      static SumoCommandVehicle.getVehicleClass​(java.lang.String vehID) +
      Returns the vehicle class.
      +
      static SumoCommandVehicletype.getVehicleClass​(java.lang.String typeID) +
      Returns the vehicle class of the names vehicle type.
      +
      static SumoCommandInductionloop.getVehicleData​(java.lang.String loopID) +
      A complex structure containing several information about vehicles which + passed the detector.
      +
      static SumoCommandVehicle.getVia​(java.lang.String vehID) +
      Returns the ids of via edges for this vehicle
      +
      static SumoCommandEdge.getWaitingTime​(java.lang.String edgeID) +
      Returns the waiting time (in s) on the given edge on this edge + within the last time step.
      +
      static SumoCommandLane.getWaitingTime​(java.lang.String laneID) +
      getWaitingTime
      +
      static SumoCommandPerson.getWaitingTime​(java.lang.String personID) +
      get waiting time
      +
      static SumoCommandVehicle.getWaitingTime​(java.lang.String vehID) +
      The waiting time of a vehicle is defined as the time (in seconds) spent with a speed below 0.1m/s since the last time it was faster than 0.1m/s.
      +
      static SumoCommandLane.getWidth​(java.lang.String laneID) +
      Returns the width (in m) of the named lane.
      +
      static SumoCommandPerson.getWidth​(java.lang.String personID) +
      get width
      +
      static SumoCommandVehicle.getWidth​(java.lang.String vehID) +
      Returns the vehicle's width (in m).
      +
      static SumoCommandVehicletype.getWidth​(java.lang.String typeID) +
      Returns the width of the named vehicle type.
      +
      static SumoCommandGui.getZoom​(java.lang.String viewID) +
      Returns the current zoom factor.
      +
      static SumoCommandVehicle.isAtBusStop​(java.lang.String vehID) +
      isAtBusStop
      +
      static SumoCommandVehicle.isAtContainerStop​(java.lang.String vehID) +
      Return whether the vehicle is stopped at a container stop
      +
      static SumoCommandVehicle.isRouteValid​(java.lang.String vehID) +
      Returns whether the Route is valid.
      +
      static SumoCommandVehicle.isStopped​(java.lang.String vehID) +
      isStopped
      +
      static SumoCommandVehicle.isStoppedParking​(java.lang.String vehID) +
      isStoppedParking
      +
      static SumoCommandVehicle.isStoppedTriggered​(java.lang.String vehID) +
      Return whether the vehicle is stopped and waiting for a person or container
      +
      static SumoCommandVehicle.moveTo​(java.lang.String vehID, + java.lang.String laneID, + double pos) +
      Moves the vehicle to a new position.
      +
      static SumoCommandPerson.moveToXY​(java.lang.String personID, + java.lang.String edgeID, + double x, + double y, + double angle, + byte keepRoute) +
      Place person at the given x,y coordinates and force it's angle to + the given value (for drawing).
      +
      static SumoCommandVehicle.moveToXY​(java.lang.String vehID, + java.lang.String edgeID, + int lane, + double x, + double y, + double angle, + byte keepRoute) +
      Place vehicle at the given x,y coordinates and force it's angle to + the given value (for drawing).
      +
      static SumoCommandPoi.remove​(java.lang.String poiID, + int layer) +
      Remove a poi.
      +
      static SumoCommandPolygon.remove​(java.lang.String polygonID, + int layer) +
      Remove a polygon.
      +
      static SumoCommandVehicle.remove​(java.lang.String vehID, + byte reason) +
      Removes vehicle with the given ID for the given reason.
      +
      static SumoCommandPerson.removeStage​(java.lang.String personID, + int nextStageIndex) +
      Removes the nth next stage + nextStageIndex must be lower then value of getRemainingStages(personID) + nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
      +
      static SumoCommandVehicle.rerouteEffort​(java.lang.String vehID) +
      Computes a new route using the vehicle's internal and the global edge effort information.
      +
      static SumoCommandVehicle.rerouteParkingArea​(java.lang.String vehID, + java.lang.String parkingAreaID) +
      Changes the next parking area in parkingAreaID, updates the vehicle route, + and preserve consistency in case of passengers/containers on board.
      +
      static SumoCommandPerson.rerouteTraveltime​(java.lang.String personID) +
      rerouteTraveltime + + Computes a new route for the person using the global edge traveltime information.
      +
      static SumoCommandVehicle.rerouteTraveltime​(java.lang.String vehID) +
      Computes a new route using the vehicle's internal and the global edge travel time information.
      +
      static SumoCommandVehicle.resume​(java.lang.String vehID) +
      Continue after a stop
      +
      static SumoCommandSimulation.saveState​(java.lang.String filename) +
      save state
      +
      static SumoCommandGui.screenshot​(java.lang.String viewID, + java.lang.String filename) +
      Save a screenshot for the given view to the given filename.
      +
      static SumoCommandVehicle.setAccel​(java.lang.String vehID, + double accel) +
      Sets the acceleration of the named vehicle.
      +
      static SumoCommandVehicletype.setAccel​(java.lang.String typeID, + double accel) +
      Sets the vehicle type's wished maximum acceleration to the given value.
      +
      static SumoCommandVehicle.setActionStepLength​(java.lang.String vehID, + double actionStepLength, + boolean resetActionOffset) +
      Sets the action step length for this vehicle.
      +
      static SumoCommandVehicle.setAdaptedTraveltime​(java.lang.String vehID, + double begTime, + double endTime, + java.lang.String edgeID, + double time) +
      Sets the edge travel time of the named vehicle.
      +
      static SumoCommandLane.setAllowed​(java.lang.String laneID, + SumoStringList allowedClasses) +
      Set a list of allowed vehicle classes.
      +
      static SumoCommandVehicle.setApparentDecel​(java.lang.String vehID, + double decel) +
      Sets the apparent deceleration in m/s^2 for this vehicle.
      +
      static SumoCommandVehicletype.setApparentDecel​(java.lang.String typeID, + double decel) +
      Sets the apparent deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandGui.setBoundary​(java.lang.String viewID, + double xmin, + double ymin, + double xmax, + double ymax) +
      Set the current boundary for the given view (see getBoundary()).
      +
      static SumoCommandVehicle.setBusStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a bus stop with the given parameters.
      +
      static SumoCommandVehicle.setChargingStationStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a stop at a chargingStation with the given parameters.
      +
      static SumoCommandPerson.setColor​(java.lang.String personID, + SumoColor color) +
      sets color for person with the given ID.
      +
      static SumoCommandPoi.setColor​(java.lang.String poiID, + SumoColor color) +
      Set the color of this poi.
      +
      static SumoCommandPolygon.setColor​(java.lang.String polygonID, + SumoColor color) +
      Set the color of this polygon.
      +
      static SumoCommandVehicle.setColor​(java.lang.String vehID, + SumoColor color) +
      Sets the vehicle's color (RGBA).
      +
      static SumoCommandVehicletype.setColor​(java.lang.String typeID, + SumoColor color) +
      Sets the vehicle type's color.
      +
      static SumoCommandTrafficlight.setCompleteRedYellowGreenDefinition​(java.lang.String tlsID, + SumoTLSProgram tls) +
      Set the complete traffic light program.
      +
      static SumoCommandVehicle.setContainerStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a container stop with the given parameters.
      +
      static SumoCommandVehicle.setDecel​(java.lang.String vehID, + double decel) +
      Sets the deceleration of the named vehicle.
      +
      static SumoCommandVehicletype.setDecel​(java.lang.String typeID, + double decel) +
      Sets the vehicle type's wished maximum deceleration to the given value.
      +
      static SumoCommandLane.setDisallowed​(java.lang.String laneID, + SumoStringList disallowedClasses) +
      Set a list of disallowed vehicle classes.
      +
      static SumoCommandEdge.setEffort​(java.lang.String edgeID, + double effort) +
      Adapt the effort value used for (re-)routing on the given edge.
      +
      static SumoCommandEdge.setEffort​(java.lang.String edgeID, + double effort, + double begin, + double end) +
      Adapt the effort value used for (re-)routing on the given edge.
      +
      static SumoCommandVehicle.setEffort​(java.lang.String vehID, + int begTime, + int endTime, + java.lang.String edgeID, + double effort) +
      Sets the edge effort for the given time as stored in the vehicle's internal container.
      +
      static SumoCommandVehicle.setEmergencyDecel​(java.lang.String vehID, + double decel) +
      Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
      +
      static SumoCommandVehicletype.setEmergencyDecel​(java.lang.String typeID, + double decel) +
      Sets the maximal physically possible deceleration in m/s^2 of vehicles of this type.
      +
      static SumoCommandVehicle.setEmissionClass​(java.lang.String vehID, + java.lang.String clazz) +
      Sets the emission class of the named vehicle.
      +
      static SumoCommandVehicletype.setEmissionClass​(java.lang.String typeID, + java.lang.String clazz) +
      Sets the vehicle type's emission class to the given value.
      +
      static SumoCommandPolygon.setFilled​(java.lang.String polygonID, + boolean fill) +
      Set the color of this polygon.
      +
      static SumoCommandPerson.setHeight​(java.lang.String personID, + double height) +
      Sets the height in m for this person.
      +
      static SumoCommandVehicle.setHeight​(java.lang.String vehID, + double height) +
      Sets the height in m for this vehicle.
      +
      static SumoCommandVehicletype.setHeight​(java.lang.String typeID, + double height) +
      Sets the height in m of vehicles of this type.
      +
      static SumoCommandVehicle.setImperfection​(java.lang.String vehID, + double imperfection) +
      setImperfection
      +
      static SumoCommandVehicletype.setImperfection​(java.lang.String typeID, + double imperfection) +
      setImperfection
      +
      static SumoCommandVehicle.setLaneChangeMode​(java.lang.String vehID, + int lcm) +
      Sets the vehicle's lane change mode as a bitset.
      +
      static SumoCommandVehicle.setLateralAlignment​(java.lang.String vehID, + java.lang.String align) +
      Sets the preferred lateral alignment for this vehicle.
      +
      static SumoCommandVehicletype.setLateralAlignment​(java.lang.String typeID, + java.lang.String latAlignment) +
      Sets the preferred lateral alignment of this type.
      +
      static SumoCommandLane.setLength​(java.lang.String laneID, + double length) +
      Set the length (in m) of the named lane.
      +
      static SumoCommandPerson.setLength​(java.lang.String personID, + double length) +
      Sets the length in m for the given person.
      +
      static SumoCommandVehicle.setLength​(java.lang.String vehID, + double length) +
      Sets the length (in m) of the named vehicle.
      +
      static SumoCommandVehicletype.setLength​(java.lang.String typeID, + double length) +
      Sets the vehicle type's length to the given value.
      +
      static SumoCommandVehicle.setLine​(java.lang.String vehID, + java.lang.String line) +
      Sets the line information for this vehicle.
      +
      static SumoCommandEdge.setMaxSpeed​(java.lang.String edgeID, + double speed) +
      Set a new maximum speed (in m/s) for all lanes of the edge.
      +
      static SumoCommandLane.setMaxSpeed​(java.lang.String laneID, + double speed) +
      Set the maximum speed (in m/s) allowed on this lane.
      +
      static SumoCommandVehicle.setMaxSpeed​(java.lang.String vehID, + double speed) +
      Sets the maximum speed (in m/s) of the named vehicle.
      +
      static SumoCommandVehicletype.setMaxSpeed​(java.lang.String typeID, + double speed) +
      Sets the vehicle type's maximum speed to the given value.
      +
      static SumoCommandVehicle.setMaxSpeedLat​(java.lang.String vehID, + double speed) +
      Sets the maximum lateral speed in m/s for this vehicle.
      +
      static SumoCommandVehicletype.setMaxSpeedLat​(java.lang.String typeID, + double speed) +
      Sets the maximum lateral speed of this type.
      +
      static SumoCommandPerson.setMinGap​(java.lang.String personID, + double minGap) +
      Sets the offset (gap to front person if halting) for this vehicle.
      +
      static SumoCommandVehicle.setMinGap​(java.lang.String vehID, + double minGap) +
      Sets the minimum gap (in m) between this vehicle and the vehicle before it.
      +
      static SumoCommandVehicletype.setMinGap​(java.lang.String typeID, + double minGap) +
      Sets the vehicle type's minimum headway gap to the given value.
      +
      static SumoCommandVehicle.setMinGapLat​(java.lang.String vehID, + double minGapLat) +
      Sets the minimum lateral gap of the vehicle at 50km/h in m
      +
      static SumoCommandVehicletype.setMinGapLat​(java.lang.String typeID, + double minGapLat) +
      setImperfection
      +
      static SumoCommandGui.setOffset​(java.lang.String viewID, + double x, + double y) +
      Set the current offset for the given view.
      +
      static SumoCommandEdge.setParameter​(java.lang.String edgeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandLane.setParameter​(java.lang.String laneID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandPerson.setParameter​(java.lang.String personID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandPoi.setParameter​(java.lang.String poiID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandPolygon.setParameter​(java.lang.String polygonID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandRoute.setParameter​(java.lang.String routeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandTrafficlight.setParameter​(java.lang.String tlsID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandVehicle.setParameter​(java.lang.String vehID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandVehicletype.setParameter​(java.lang.String typeID, + java.lang.String param, + java.lang.String value) +
      Sets the chosen parameter
      +
      static SumoCommandVehicle.setParkingAreaStop​(java.lang.String vehID, + java.lang.String stopID, + double duration, + double until) +
      Adds or modifies a stop at a parkingArea with the given parameters.
      +
      static SumoCommandTrafficlight.setPhase​(java.lang.String tlsID, + int index) +
      Set the index of the current phase in the current program.
      +
      static SumoCommandTrafficlight.setPhaseDuration​(java.lang.String tlsID, + double phaseDuration) +
      Set the duration of the currently active phase (in s?).
      +
      static SumoCommandTrafficlight.setPhaseName​(java.lang.String tlsID, + java.lang.String name) +
      Set the name of the current phase in the current program.
      +
      static SumoCommandPoi.setPosition​(java.lang.String poiID, + double x, + double y) +
      Set the position of this poi.
      +
      static SumoCommandTrafficlight.setProgram​(java.lang.String tlsID, + java.lang.String programID) +
      Set the id of the current program.
      +
      static SumoCommandTrafficlight.setRedYellowGreenState​(java.lang.String tlsID, + java.lang.String state) +
      Set the named tl's state as a tuple of light definitions.
      +
      static SumoCommandVehicle.setRoute​(java.lang.String vehID, + SumoStringList edgeList) +
      Sets the IDs of the edges the vehicle's route is made of.
      +
      static SumoCommandVehicle.setRouteID​(java.lang.String vehID, + java.lang.String routeID) +
      Sets the id of the route of the named vehicle.
      +
      static SumoCommandVehicle.setRoutingMode​(java.lang.String vehID, + int routingMode) +
      sets the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
      +
      static SumoCommandGui.setSchema​(java.lang.String viewID, + java.lang.String schemeName) +
      Set the current coloring scheme for the given view.
      +
      static SumoCommandPolygon.setShape​(java.lang.String polygonID, + SumoStringList shape) +
      Set the shape of this polygon.
      +
      static SumoCommandVehicle.setShapeClass​(java.lang.String vehID, + java.lang.String clazz) +
      setShapeClass
      +
      static SumoCommandVehicletype.setShapeClass​(java.lang.String typeID, + java.lang.String clazz) +
      setShapeClass
      +
      static SumoCommandVehicle.setSignals​(java.lang.String vehID, + int signals) +
      setSignals
      +
      static SumoCommandPerson.setSpeed​(java.lang.String personID, + double speed) +
      Sets the maximum speed in m/s for the named person for subsequent step.
      +
      static SumoCommandVehicle.setSpeed​(java.lang.String vehID, + double speed) +
      Sets the speed (in m/s) of the named vehicle.
      +
      static SumoCommandVehicle.setSpeedDeviation​(java.lang.String vehID, + double deviation) +
      Sets the standard deviation of the estimated maximum speed.
      +
      static SumoCommandVehicletype.setSpeedDeviation​(java.lang.String typeID, + double deviation) +
      Sets the vehicle type's speed deviation to the given value.
      +
      static SumoCommandVehicle.setSpeedFactor​(java.lang.String vehID, + double factor) +
      Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
      +
      static SumoCommandVehicletype.setSpeedFactor​(java.lang.String typeID, + double factor) +
      Sets the vehicle type's speed factor to the given value.
      +
      static SumoCommandVehicle.setSpeedMode​(java.lang.String vehID, + int sm) +
      Sets the vehicle's speed mode as a bitset.
      +
      static SumoCommandVehicle.setStop​(java.lang.String vehID, + java.lang.String edgeID, + double pos, + byte laneIndex, + double duration, + SumoStopFlags sf, + double startPos, + double until) +
      Lets the vehicle stop at the given edge, at the given position and lane.
      +
      static SumoCommandVehicle.setTau​(java.lang.String vehID, + double tau) +
      setTau
      +
      static SumoCommandVehicletype.setTau​(java.lang.String typeID, + double tau) +
      setTau
      +
      static SumoCommandPerson.setType​(java.lang.String personID, + java.lang.String typeID) +
      Sets the id of the type for the named person.
      +
      static SumoCommandPoi.setType​(java.lang.String poiID, + java.lang.String poiType) +
      Set the type of the poi.
      +
      static SumoCommandPolygon.setType​(java.lang.String polygonID, + java.lang.String polygonType) +
      Set the type of the polygon.
      +
      static SumoCommandVehicle.setType​(java.lang.String vehID, + java.lang.String typeID) +
      Sets the id of the type for the named vehicle.
      +
      static SumoCommandVehicle.setVehicleClass​(java.lang.String vehID, + java.lang.String clazz) +
      Sets the vehicle class.
      +
      static SumoCommandVehicletype.setVehicleClass​(java.lang.String typeID, + java.lang.String clazz) +
      Sets the vehicle type's vehicle class to the given value.
      +
      static SumoCommandVehicle.setVia​(java.lang.String vehID, + SumoStringList edgeList) +
      Sets the line information for this vehicle.
      +
      static SumoCommandPerson.setWidth​(java.lang.String personID, + double width) +
      Sets the width in m for this person.
      +
      static SumoCommandVehicle.setWidth​(java.lang.String vehID, + double width) +
      Sets the vehicle's width (in m).
      +
      static SumoCommandVehicletype.setWidth​(java.lang.String typeID, + double width) +
      Sets the vehicle type's width to the given value.
      +
      static SumoCommandVehicletype.setWidth​(java.lang.String typeID, + java.lang.String newTypeID) +
      Duplicates the vType with ID origTypeID.
      +
      static SumoCommandGui.setZoom​(java.lang.String viewID, + double zoom) +
      Set the current zoom factor for the given view.
      +
      static SumoCommandVehicle.slowDown​(java.lang.String vehID, + double speed, + double duration) +
      Reduces the speed to the given for the given amount of time.
      +
      static SumoCommandGui.trackVehicle​(java.lang.String viewID, + java.lang.String vehID) +
      Start visually tracking the given vehicle on the given view.
      +
      static SumoCommandVehicle.updateBestLanes​(java.lang.String vehID) +
      Inserts the information about the travel time of edge "edgeID" valid + from begin time to end time into the vehicle's internal edge weights + container.
      +
      +
      +
    • +
    • +
      + + +

      Uses of SumoCommand in de.tudresden.sumo.util

      + + + + + + + + + + + + + + + + + + + + + + + + +
      Methods in de.tudresden.sumo.util with parameters of type SumoCommand 
      Modifier and TypeMethodDescription
      java.lang.ObjectCommandProcessor.do_job_get​(SumoCommand sc) 
      voidCommandProcessor.do_job_set​(SumoCommand sc) 
      java.lang.ObjectSumo.get_cmd​(SumoCommand cmd) 
      +
      +
    • +
    • +
      + + +

      Uses of SumoCommand in it.polito.appeal.traci

      + + + + + + + + + + + + + + + + + + + +
      Methods in it.polito.appeal.traci with parameters of type SumoCommand 
      Modifier and TypeMethodDescription
      java.lang.ObjectSumoTraciConnection.do_job_get​(SumoCommand cmd) 
      voidSumoTraciConnection.do_job_set​(SumoCommand cmd) 
      +
      +
    • +
    +
  • +
+
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Sumo.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Sumo.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Sumo.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/class-use/Sumo.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,196 @@ + + + + + +Uses of Class de.tudresden.sumo.util.Sumo (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.sumo.util.Sumo

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/CommandProcessor.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,496 @@ + + + + + +CommandProcessor (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CommandProcessor

+
+
+ +
+
    +
  • +
    +
    public class CommandProcessor
    +extends Query
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CommandProcessor

        +
        public CommandProcessor​(java.net.Socket sock)
        +                 throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        do_job_set

        +
        public void do_job_set​(SumoCommand sc)
        +                throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        do_subscription

        +
        public void do_subscription​(Subscription cs)
        +                     throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        do_SimulationStep

        +
        public void do_SimulationStep​(double targetTime)
        +                       throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        do_setOrder

        +
        public void do_setOrder​(int index)
        +                 throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        do_close

        +
        public void do_close()
        +              throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + + + + + +
        +
      • +

        do_job_get

        +
        public java.lang.Object do_job_get​(SumoCommand sc)
        +                            throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + + + + + + +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/ConvertHelper.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/ConvertHelper.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/ConvertHelper.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/ConvertHelper.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,490 @@ + + + + + +ConvertHelper (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ConvertHelper

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.util.ConvertHelper
    • +
    +
  • +
+
+
    +
  • +
    +
    public class ConvertHelper
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ConvertHelper

        +
        public ConvertHelper​(Log logger)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getByte

        +
        public byte getByte​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getInt

        +
        public int getInt​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getDouble

        +
        public double getDouble​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getStringList

        +
        public SumoStringList getStringList​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getColor

        +
        public SumoColor getColor​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getString

        +
        public java.lang.String getString​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getPosition2D

        +
        public SumoPosition2D getPosition2D​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getPosition3D

        +
        public SumoPosition3D getPosition3D​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getRoadPosition

        +
        public SumoRoadPosition getRoadPosition​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getPolygon

        +
        public SumoGeometry getPolygon​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getBoundingBox

        +
        public SumoBoundingBox getBoundingBox​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getLaneLinks

        +
        public SumoLinkList getLaneLinks​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getVehicleData

        +
        public SumoVehicleData getVehicleData​(java.lang.Object obj)
        +
      • +
      + + + +
        +
      • +

        getTLSProgram

        +
        public SumoTLSController getTLSProgram​(java.lang.Object obj)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observable.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,326 @@ + + + + + +Observable (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Observable

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.util.Observable
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    Query
    +
    +
    +
    public class Observable
    +extends java.lang.Object
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Observable

        +
        public Observable()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addObserver

        +
        public void addObserver​(Observer observer)
        +
      • +
      + + + + +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Observer.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,254 @@ + + + + + +Observer (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface Observer

+
+
+
+
    +
  • +
    +
    public interface Observer
    +
  • +
+
+
+ +
+
+ +
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,203 @@ + + + + + +de.tudresden.sumo.util (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.sumo.util

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,182 @@ + + + + + +de.tudresden.sumo.util Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.sumo.util

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + +Uses of Package de.tudresden.sumo.util (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.sumo.util

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Query.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Query.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Query.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Query.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,624 @@ + + + + + +Query (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Query

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Query

        +
        public Query​(java.net.Socket sock)
        +      throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        doQuery

        +
        protected ResponseMessage doQuery​(RequestMessage msg)
        +                           throws java.io.IOException
        +
        Sends a request message to SUMO and returns a response message.
        +
        +
        Parameters:
        +
        msg -
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        queryAndVerify

        +
        protected ResponseMessage queryAndVerify​(RequestMessage reqMsg)
        +                                  throws java.io.IOException
        +
        Like doQuery(RequestMessage); in addition, verifies that all + responses are successful and and the statuses match the requests.
        +
        +
        Parameters:
        +
        reqMsg -
        +
        Returns:
        +
        the verified response message
        +
        Throws:
        +
        java.io.IOException
        +
        See Also:
        +
        doQuery(RequestMessage)
        +
        +
      • +
      + + + +
        +
      • +

        doQuerySingle

        +
        protected ResponseContainer doQuerySingle​(Command request)
        +                                   throws java.io.IOException
        +
        Like doQuery(RequestMessage), but good for one-command/ + one-response queries.
        +
        +
        Parameters:
        +
        request -
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        doSetOrder

        +
        protected void doSetOrder​(int index)
        +                   throws java.io.IOException
        +
        Set multi-client ordering index
        +
        +
        Parameters:
        +
        index -
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        doClose

        +
        protected void doClose()
        +                throws java.io.IOException
        +
        Disconnect client from the sumo server
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        doSimulationStep

        +
        protected void doSimulationStep​(double targetTime)
        +                         throws java.io.IOException
        +
        Do next time step and update subscription results
        +
        +
        Parameters:
        +
        targetTime -
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        queryAndVerifySingle

        +
        protected ResponseContainer queryAndVerifySingle​(Command request)
        +                                          throws java.io.IOException
        +
        Like queryAndVerify(RequestMessage), but good for one-command/ + one-response queries.
        +
        +
        Parameters:
        +
        request -
        +
        Returns:
        +
        the response container for the specified request
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + +
        +
      • +

        fireAndForget

        +
        protected void fireAndForget​(Command request)
        +
        fireAndForget function
        +
        +
        Parameters:
        +
        request -
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        getOutStream

        +
        public java.io.DataOutputStream getOutStream()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/SumoCommand.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,524 @@ + + + + + +SumoCommand (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoCommand

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.util.SumoCommand
    • +
    +
  • +
+
+
    +
  • +
    +
    public class SumoCommand
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      intinput1 
      intinput2 
      java.util.LinkedList<java.lang.Object>raw 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoCommand​(java.lang.Object input1, + java.lang.Object input3) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object[] array, + java.lang.Object response, + java.lang.Object output_type) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object input3, + java.lang.Object input) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object input3, + java.lang.Object[] array) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object input3, + java.lang.Object[] array, + java.lang.Object response, + java.lang.Object output_type) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object input3, + java.lang.Object response, + java.lang.Object output_type) 
      SumoCommand​(java.lang.Object input1, + java.lang.Object input2, + java.lang.Object input3, + java.lang.Object response, + java.lang.Object output_type, + java.lang.String info) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      Commandget_command() 
      java.lang.Object[]get_raw() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        raw

        +
        public java.util.LinkedList<java.lang.Object> raw
        +
      • +
      + + + +
        +
      • +

        input1

        +
        public int input1
        +
      • +
      + + + +
        +
      • +

        input2

        +
        public int input2
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object input3,
        +                   java.lang.Object response,
        +                   java.lang.Object output_type)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object input3,
        +                   java.lang.Object response,
        +                   java.lang.Object output_type,
        +                   java.lang.String info)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object input3,
        +                   java.lang.Object[] array,
        +                   java.lang.Object response,
        +                   java.lang.Object output_type)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input3)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object input3,
        +                   java.lang.Object[] array)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object input3,
        +                   java.lang.Object input)
        +
      • +
      + + + +
        +
      • +

        SumoCommand

        +
        public SumoCommand​(java.lang.Object input1,
        +                   java.lang.Object input2,
        +                   java.lang.Object[] array,
        +                   java.lang.Object response,
        +                   java.lang.Object output_type)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        get_raw

        +
        public java.lang.Object[] get_raw()
        +
      • +
      + + + +
        +
      • +

        get_command

        +
        public Command get_command()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Sumo.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Sumo.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Sumo.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/sumo/util/Sumo.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,457 @@ + + + + + +Sumo (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Sumo

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.sumo.util.Sumo
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Sumo
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Sumo() 
      Sumo​(Config conf) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voiddo_timestep() 
      java.lang.Objectget_cmd​(SumoCommand cmd) 
      booleanset_cmd​(java.lang.Object in) 
      voidstart​(java.lang.String sumo_bin, + java.lang.String configFile) 
      voidstart​(java.lang.String sumo_bin, + java.lang.String net_file, + java.lang.String route_file) 
      voidstart_ws() 
      voidstop_instance() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Sumo

        +
        public Sumo()
        +
      • +
      + + + +
        +
      • +

        Sumo

        +
        public Sumo​(Config conf)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public void start​(java.lang.String sumo_bin,
        +                  java.lang.String configFile)
        +
      • +
      + + + +
        +
      • +

        start

        +
        public void start​(java.lang.String sumo_bin,
        +                  java.lang.String net_file,
        +                  java.lang.String route_file)
        +
      • +
      + + + +
        +
      • +

        set_cmd

        +
        public boolean set_cmd​(java.lang.Object in)
        +
      • +
      + + + +
        +
      • +

        get_cmd

        +
        public java.lang.Object get_cmd​(SumoCommand cmd)
        +
      • +
      + + + +
        +
      • +

        do_timestep

        +
        public void do_timestep()
        +
      • +
      + + + +
        +
      • +

        start_ws

        +
        public void start_ws()
        +
      • +
      + + + +
        +
      • +

        stop_instance

        +
        public void stop_instance()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Service.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Service.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Service.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Service.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Interface de.tudresden.ws.Service (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
de.tudresden.ws.Service

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ServiceImpl.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ServiceImpl.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ServiceImpl.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ServiceImpl.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.ServiceImpl (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.ServiceImpl

+
+
No usage of de.tudresden.ws.ServiceImpl
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ShutdownHook.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ShutdownHook.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ShutdownHook.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/ShutdownHook.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.ShutdownHook (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.ShutdownHook

+
+
No usage of de.tudresden.ws.ShutdownHook
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Traci.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Traci.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Traci.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/Traci.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class de.tudresden.ws.Traci (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.Traci

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/WebService.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/WebService.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/WebService.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/class-use/WebService.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.WebService (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.WebService

+
+
No usage of de.tudresden.ws.WebService
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/class-use/Config.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/class-use/Config.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/class-use/Config.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/class-use/Config.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,216 @@ + + + + + +Uses of Class de.tudresden.ws.conf.Config (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.conf.Config

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/Config.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/Config.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/Config.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/Config.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,550 @@ + + + + + +Config (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Config

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.conf.Config
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Config
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static java.lang.Stringconfig_file 
      java.text.SimpleDateFormatdf 
      static java.lang.Stringhost 
      java.util.Datelastactiontime 
      Loglogger 
      java.lang.Stringname 
      static java.lang.Stringport 
      booleanrunning 
      static java.lang.Stringsumo_bin 
      java.util.HashMap<java.lang.String,​java.lang.String>sumo_output 
      static java.lang.Stringurl 
      java.lang.Stringversion 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Config() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.Stringget_actiontime() 
      java.lang.Stringget_url() 
      booleanread_config​(java.lang.String filename) 
      voidrefresh_actiontime() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        running

        +
        public boolean running
        +
      • +
      + + + +
        +
      • +

        df

        +
        public java.text.SimpleDateFormat df
        +
      • +
      + + + +
        +
      • +

        host

        +
        public static java.lang.String host
        +
      • +
      + + + +
        +
      • +

        port

        +
        public static java.lang.String port
        +
      • +
      + + + +
        +
      • +

        url

        +
        public static java.lang.String url
        +
      • +
      + + + +
        +
      • +

        name

        +
        public java.lang.String name
        +
      • +
      + + + +
        +
      • +

        sumo_bin

        +
        public static java.lang.String sumo_bin
        +
      • +
      + + + +
        +
      • +

        config_file

        +
        public static java.lang.String config_file
        +
      • +
      + + + +
        +
      • +

        sumo_output

        +
        public java.util.HashMap<java.lang.String,​java.lang.String> sumo_output
        +
      • +
      + + + +
        +
      • +

        lastactiontime

        +
        public java.util.Date lastactiontime
        +
      • +
      + + + +
        +
      • +

        version

        +
        public java.lang.String version
        +
      • +
      + + + +
        +
      • +

        logger

        +
        public Log logger
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Config

        +
        public Config()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        read_config

        +
        public boolean read_config​(java.lang.String filename)
        +
      • +
      + + + +
        +
      • +

        get_url

        +
        public java.lang.String get_url()
        +
      • +
      + + + +
        +
      • +

        refresh_actiontime

        +
        public void refresh_actiontime()
        +
      • +
      + + + +
        +
      • +

        get_actiontime

        +
        public java.lang.String get_actiontime()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,168 @@ + + + + + +de.tudresden.ws.conf (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.ws.conf

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Config 
    +
  • +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,165 @@ + + + + + +de.tudresden.ws.conf Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.ws.conf

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • de.tudresden.ws.conf.Config
    • +
    +
  • +
+
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/conf/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,206 @@ + + + + + +Uses of Package de.tudresden.ws.conf (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.ws.conf

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoBestLanes (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoBestLanes

+
+
No usage of de.tudresden.ws.container.SumoBestLanes
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.SumoBestLane.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.SumoBestLane.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.SumoBestLane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBestLanes.SumoBestLane.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoBestLanes.SumoBestLane (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoBestLanes.SumoBestLane

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoBoundingBox.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoBoundingBox (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoBoundingBox

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoColor.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,379 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoColor (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoColor

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoGeometry.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,283 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoGeometry (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoGeometry

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLeader.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoLeader (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoLeader

+
+
No usage of de.tudresden.ws.container.SumoLeader
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLink.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,297 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoLink (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoLink

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLinkList.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLinkList.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLinkList.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoLinkList.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoLinkList (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoLinkList

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoNextTLS (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoNextTLS

+
+
No usage of de.tudresden.ws.container.SumoNextTLS
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.NextTLS.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.NextTLS.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.NextTLS.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoNextTLS.NextTLS.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoNextTLS.NextTLS (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoNextTLS.NextTLS

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoObject.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoObject.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoObject.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoObject.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,376 @@ + + + + + +Uses of Interface de.tudresden.ws.container.SumoObject (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
de.tudresden.ws.container.SumoObject

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition2D.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,281 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoPosition2D (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoPosition2D

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPosition3D.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,225 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoPosition3D (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoPosition3D

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPrimitive.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPrimitive.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPrimitive.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoPrimitive.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoPrimitive (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoPrimitive

+
+
No usage of de.tudresden.ws.container.SumoPrimitive
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoRoadPosition.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,223 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoRoadPosition (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoRoadPosition

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStage.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoStage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoStage

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStopFlags.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,236 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoStopFlags (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoStopFlags

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStringList.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStringList.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStringList.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoStringList.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,561 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoStringList (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoStringList

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSController.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoTLSController (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoTLSController

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSPhase.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,209 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoTLSPhase (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoTLSPhase

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoTLSProgram.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,280 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoTLSProgram (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoTLSProgram

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,220 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoVehicleData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoVehicleData

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.VehicleData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.VehicleData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.VehicleData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleData.VehicleData.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoVehicleData.VehicleData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoVehicleData.VehicleData

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignal.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoVehicleSignal (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoVehicleSignal

+
+
No usage of de.tudresden.ws.container.SumoVehicleSignal
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/class-use/SumoVehicleSignalState.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,219 @@ + + + + + +Uses of Class de.tudresden.ws.container.SumoVehicleSignalState (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.container.SumoVehicleSignalState

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,278 @@ + + + + + +de.tudresden.ws.container (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.ws.container

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,207 @@ + + + + + +de.tudresden.ws.container Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.ws.container

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+
    +
  • java.lang.Object +
      +
    • java.lang.Enum<E> (implements java.lang.Comparable<T>, java.io.Serializable) + +
    • +
    +
  • +
+
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,409 @@ + + + + + +Uses of Package de.tudresden.ws.container (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.ws.container

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,410 @@ + + + + + +SumoBestLanes (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoBestLanes

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoBestLanes
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoBestLanes
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoBestLanes() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(java.lang.String laneID, + double length, + double occupation, + int offset, + int allowsContinuation, + java.util.LinkedList<java.lang.String> ll) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoBestLanes

        +
        public SumoBestLanes()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public void add​(java.lang.String laneID,
        +                double length,
        +                double occupation,
        +                int offset,
        +                int allowsContinuation,
        +                java.util.LinkedList<java.lang.String> ll)
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.SumoBestLane.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.SumoBestLane.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.SumoBestLane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBestLanes.SumoBestLane.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,396 @@ + + + + + +SumoBestLanes.SumoBestLane (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoBestLanes.SumoBestLane

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoBestLanes.SumoBestLane
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    SumoBestLanes
    +
    +
    +
    public class SumoBestLanes.SumoBestLane
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      intallowsContinuation 
      java.lang.StringlaneID 
      doublelength 
      java.util.LinkedList<java.lang.String>ll 
      doubleoccupation 
      intoffset 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoBestLane​(java.lang.String laneID, + double length, + double occupation, + int offset, + int allowsContinuation, + java.util.LinkedList<java.lang.String> ll) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        ll

        +
        public java.util.LinkedList<java.lang.String> ll
        +
      • +
      + + + +
        +
      • +

        laneID

        +
        public java.lang.String laneID
        +
      • +
      + + + +
        +
      • +

        length

        +
        public double length
        +
      • +
      + + + +
        +
      • +

        occupation

        +
        public double occupation
        +
      • +
      + + + +
        +
      • +

        offset

        +
        public int offset
        +
      • +
      + + + +
        +
      • +

        allowsContinuation

        +
        public int allowsContinuation
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoBestLane

        +
        public SumoBestLane​(java.lang.String laneID,
        +                    double length,
        +                    double occupation,
        +                    int offset,
        +                    int allowsContinuation,
        +                    java.util.LinkedList<java.lang.String> ll)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoBoundingBox.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,424 @@ + + + + + +SumoBoundingBox (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoBoundingBox

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoBoundingBox
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoBoundingBox
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doublex_max 
      doublex_min 
      doubley_max 
      doubley_min 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoBoundingBox() 
      SumoBoundingBox​(double x_min, + double y_min, + double x_max, + double y_max) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        x_min

        +
        public double x_min
        +
      • +
      + + + +
        +
      • +

        y_min

        +
        public double y_min
        +
      • +
      + + + +
        +
      • +

        x_max

        +
        public double x_max
        +
      • +
      + + + +
        +
      • +

        y_max

        +
        public double y_max
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoBoundingBox

        +
        public SumoBoundingBox()
        +
      • +
      + + + +
        +
      • +

        SumoBoundingBox

        +
        public SumoBoundingBox​(double x_min,
        +                       double y_min,
        +                       double x_max,
        +                       double y_max)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoColor.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,424 @@ + + + + + +SumoColor (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoColor

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoColor
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoColor
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      bytea 
      byteb 
      byteg 
      byter 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoColor() 
      SumoColor​(int r, + int g, + int b, + int a) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        r

        +
        public byte r
        +
      • +
      + + + +
        +
      • +

        g

        +
        public byte g
        +
      • +
      + + + +
        +
      • +

        b

        +
        public byte b
        +
      • +
      + + + +
        +
      • +

        a

        +
        public byte a
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoColor

        +
        public SumoColor()
        +
      • +
      + + + +
        +
      • +

        SumoColor

        +
        public SumoColor​(int r,
        +                 int g,
        +                 int b,
        +                 int a)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoGeometry.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,391 @@ + + + + + +SumoGeometry (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoGeometry

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoGeometry
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoGeometry
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.util.LinkedList<SumoPosition2D>coords 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoGeometry() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(SumoPosition2D pos) 
      voidfromString​(java.lang.String shape) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoGeometry

        +
        public SumoGeometry()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        fromString

        +
        public void fromString​(java.lang.String shape)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLeader.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,393 @@ + + + + + +SumoLeader (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoLeader

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoLeader
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoLeader
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doubledist 
      java.lang.StringvehID 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoLeader​(java.lang.String vehID, + double dist) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanisValid() 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        vehID

        +
        public java.lang.String vehID
        +
      • +
      + + + +
        +
      • +

        dist

        +
        public double dist
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoLeader

        +
        public SumoLeader​(java.lang.String vehID,
        +                  double dist)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isValid

        +
        public boolean isValid()
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLink.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,534 @@ + + + + + +SumoLink (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoLink

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoLink
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoLink
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoLink​(java.lang.String notInternal, + java.lang.String internal, + byte priority, + byte isOpen, + byte hasFoe, + double length, + java.lang.String state, + java.lang.String direction) 
      SumoLink​(java.lang.String from, + java.lang.String to, + java.lang.String over) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        from

        +
        public java.lang.String from
        +
      • +
      + + + +
        +
      • +

        to

        +
        public java.lang.String to
        +
      • +
      + + + +
        +
      • +

        over

        +
        public java.lang.String over
        +
      • +
      + + + +
        +
      • +

        notInternalLane

        +
        public java.lang.String notInternalLane
        +
      • +
      + + + +
        +
      • +

        internalLane

        +
        public java.lang.String internalLane
        +
      • +
      + + + +
        +
      • +

        state

        +
        public java.lang.String state
        +
      • +
      + + + +
        +
      • +

        direction

        +
        public java.lang.String direction
        +
      • +
      + + + +
        +
      • +

        hasPriority

        +
        public byte hasPriority
        +
      • +
      + + + +
        +
      • +

        isOpen

        +
        public byte isOpen
        +
      • +
      + + + +
        +
      • +

        hasApproachingFoe

        +
        public byte hasApproachingFoe
        +
      • +
      + + + +
        +
      • +

        length

        +
        public double length
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoLink

        +
        public SumoLink​(java.lang.String from,
        +                java.lang.String to,
        +                java.lang.String over)
        +
      • +
      + + + +
        +
      • +

        SumoLink

        +
        public SumoLink​(java.lang.String notInternal,
        +                java.lang.String internal,
        +                byte priority,
        +                byte isOpen,
        +                byte hasFoe,
        +                double length,
        +                java.lang.String state,
        +                java.lang.String direction)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLinkList.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLinkList.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLinkList.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoLinkList.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,807 @@ + + + + + +SumoLinkList (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoLinkList

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoLinkList
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(int index, + SumoLink element) 
      booleanadd​(SumoLink element) 
      booleanaddAll​(int index, + java.util.Collection<? extends SumoLink> elements) 
      booleanaddAll​(java.util.Collection<? extends SumoLink> elements) 
      voidclear() 
      booleancontains​(java.lang.Object element) 
      booleancontainsAll​(java.util.Collection<?> elements) 
      SumoLinkget​(int index) 
      intindexOf​(java.lang.Object element) 
      booleanisEmpty() 
      java.util.Iterator<SumoLink>iterator() 
      intlastIndexOf​(java.lang.Object element) 
      java.util.ListIterator<SumoLink>listIterator() 
      java.util.ListIterator<SumoLink>listIterator​(int index) 
      SumoLinkremove​(int index) 
      booleanremove​(java.lang.Object element) 
      booleanremoveAll​(java.util.Collection<?> elements) 
      booleanretainAll​(java.util.Collection<?> elements) 
      SumoLinkset​(int index, + SumoLink element) 
      intsize() 
      java.util.List<SumoLink>subList​(int from, + int to) 
      java.lang.Object[]toArray() 
      <T> T[]toArray​(T[] element) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.Collection

        +parallelStream, removeIf, stream, toArray
      • +
      +
        +
      • + + +

        Methods inherited from interface java.lang.Iterable

        +forEach
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.List

        +equals, hashCode, replaceAll, sort, spliterator
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoLinkList

        +
        public SumoLinkList()
        +
      • +
      + + + +
        +
      • +

        SumoLinkList

        +
        public SumoLinkList​(java.util.List<SumoLink> list)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public void add​(int index,
        +                SumoLink element)
        +
        +
        Specified by:
        +
        add in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        addAll

        +
        public boolean addAll​(java.util.Collection<? extends SumoLink> elements)
        +
        +
        Specified by:
        +
        addAll in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        addAll in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        addAll

        +
        public boolean addAll​(int index,
        +                      java.util.Collection<? extends SumoLink> elements)
        +
        +
        Specified by:
        +
        addAll in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        clear

        +
        public void clear()
        +
        +
        Specified by:
        +
        clear in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        clear in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        contains

        +
        public boolean contains​(java.lang.Object element)
        +
        +
        Specified by:
        +
        contains in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        contains in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        containsAll

        +
        public boolean containsAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        containsAll in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        containsAll in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public SumoLink get​(int index)
        +
        +
        Specified by:
        +
        get in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        indexOf

        +
        public int indexOf​(java.lang.Object element)
        +
        +
        Specified by:
        +
        indexOf in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        +
        Specified by:
        +
        isEmpty in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        isEmpty in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        lastIndexOf

        +
        public int lastIndexOf​(java.lang.Object element)
        +
        +
        Specified by:
        +
        lastIndexOf in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        listIterator

        +
        public java.util.ListIterator<SumoLink> listIterator()
        +
        +
        Specified by:
        +
        listIterator in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        listIterator

        +
        public java.util.ListIterator<SumoLink> listIterator​(int index)
        +
        +
        Specified by:
        +
        listIterator in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public boolean remove​(java.lang.Object element)
        +
        +
        Specified by:
        +
        remove in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        remove in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public SumoLink remove​(int index)
        +
        +
        Specified by:
        +
        remove in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        removeAll

        +
        public boolean removeAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        removeAll in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        removeAll in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        retainAll

        +
        public boolean retainAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        retainAll in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        retainAll in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        set

        +
        public SumoLink set​(int index,
        +                    SumoLink element)
        +
        +
        Specified by:
        +
        set in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        size

        +
        public int size()
        +
        +
        Specified by:
        +
        size in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        size in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        subList

        +
        public java.util.List<SumoLink> subList​(int from,
        +                                        int to)
        +
        +
        Specified by:
        +
        subList in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        toArray

        +
        public java.lang.Object[] toArray()
        +
        +
        Specified by:
        +
        toArray in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        toArray in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + + + +
        +
      • +

        toArray

        +
        public <T> T[] toArray​(T[] element)
        +
        +
        Specified by:
        +
        toArray in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        toArray in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public boolean add​(SumoLink element)
        +
        +
        Specified by:
        +
        add in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        add in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        public java.util.Iterator<SumoLink> iterator()
        +
        +
        Specified by:
        +
        iterator in interface java.util.Collection<SumoLink>
        +
        Specified by:
        +
        iterator in interface java.lang.Iterable<SumoLink>
        +
        Specified by:
        +
        iterator in interface java.util.List<SumoLink>
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,406 @@ + + + + + +SumoNextTLS (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoNextTLS

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoNextTLS
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoNextTLS
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      + + + + + + + + + + + + +
      Nested Classes 
      Modifier and TypeClassDescription
      class SumoNextTLS.NextTLS 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.util.LinkedList<SumoNextTLS.NextTLS>ll 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoNextTLS() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(java.lang.String tlsID, + int ix, + double dist, + java.lang.String state) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoNextTLS

        +
        public SumoNextTLS()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public void add​(java.lang.String tlsID,
        +                int ix,
        +                double dist,
        +                java.lang.String state)
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.NextTLS.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.NextTLS.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.NextTLS.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoNextTLS.NextTLS.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,322 @@ + + + + + +SumoNextTLS.NextTLS (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoNextTLS.NextTLS

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoNextTLS.NextTLS
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    SumoNextTLS
    +
    +
    +
    public class SumoNextTLS.NextTLS
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.lang.StringtlsID 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      NextTLS​(java.lang.String tlsID, + int ix, + double dist, + java.lang.String state) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        tlsID

        +
        public java.lang.String tlsID
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        NextTLS

        +
        public NextTLS​(java.lang.String tlsID,
        +               int ix,
        +               double dist,
        +               java.lang.String state)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoObject.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoObject.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoObject.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoObject.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,196 @@ + + + + + +SumoObject (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface SumoObject

+
+ +
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition2D.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,392 @@ + + + + + +SumoPosition2D (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoPosition2D

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoPosition2D
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoPosition2D
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doublex 
      doubley 
      +
    • +
    +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        x

        +
        public double x
        +
      • +
      + + + +
        +
      • +

        y

        +
        public double y
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoPosition2D

        +
        public SumoPosition2D()
        +
      • +
      + + + +
        +
      • +

        SumoPosition2D

        +
        public SumoPosition2D​(double x,
        +                      double y)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPosition3D.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,408 @@ + + + + + +SumoPosition3D (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoPosition3D

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoPosition3D
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoPosition3D
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doublex 
      doubley 
      doublez 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoPosition3D() 
      SumoPosition3D​(double x, + double y, + double z) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        x

        +
        public double x
        +
      • +
      + + + +
        +
      • +

        y

        +
        public double y
        +
      • +
      + + + +
        +
      • +

        z

        +
        public double z
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoPosition3D

        +
        public SumoPosition3D()
        +
      • +
      + + + +
        +
      • +

        SumoPosition3D

        +
        public SumoPosition3D​(double x,
        +                      double y,
        +                      double z)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPrimitive.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPrimitive.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPrimitive.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoPrimitive.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,331 @@ + + + + + +SumoPrimitive (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoPrimitive

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoPrimitive
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoPrimitive
    +extends java.lang.Object
    +implements SumoObject
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.lang.Stringtype 
      java.lang.Objectval 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoPrimitive​(java.lang.Object o) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        val

        +
        public java.lang.Object val
        +
      • +
      + + + +
        +
      • +

        type

        +
        public java.lang.String type
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoPrimitive

        +
        public SumoPrimitive​(java.lang.Object o)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoRoadPosition.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,349 @@ + + + + + +SumoRoadPosition (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoRoadPosition

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoRoadPosition
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoRoadPosition
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Jakob Erdmann
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.lang.StringedgeID 
      intlaneIndex 
      doublepos 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoRoadPosition() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        edgeID

        +
        public java.lang.String edgeID
        +
      • +
      + + + +
        +
      • +

        pos

        +
        public double pos
        +
      • +
      + + + +
        +
      • +

        laneIndex

        +
        public int laneIndex
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoRoadPosition

        +
        public SumoRoadPosition()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStage.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,489 @@ + + + + + +SumoStage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoStage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoStage
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoStage
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Jakob Erdmann
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoStage() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        type

        +
        public int type
        +
      • +
      + + + +
        +
      • +

        vType

        +
        public java.lang.String vType
        +
      • +
      + + + +
        +
      • +

        line

        +
        public java.lang.String line
        +
      • +
      + + + +
        +
      • +

        destStop

        +
        public java.lang.String destStop
        +
      • +
      + + + + + + + +
        +
      • +

        travelTime

        +
        public double travelTime
        +
      • +
      + + + +
        +
      • +

        cost

        +
        public double cost
        +
      • +
      + + + +
        +
      • +

        length

        +
        public double length
        +
      • +
      + + + +
        +
      • +

        intended

        +
        public java.lang.String intended
        +
      • +
      + + + +
        +
      • +

        depart

        +
        public double depart
        +
      • +
      + + + +
        +
      • +

        departPos

        +
        public double departPos
        +
      • +
      + + + +
        +
      • +

        arrivalPos

        +
        public double arrivalPos
        +
      • +
      + + + +
        +
      • +

        description

        +
        public java.lang.String description
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoStage

        +
        public SumoStage()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStopFlags.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,482 @@ + + + + + +SumoStopFlags (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoStopFlags

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoStopFlags
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoStopFlags
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoStopFlags​(boolean parking, + boolean triggered, + boolean containerTriggered, + boolean isBusStop, + boolean isContainerStop, + boolean isChargingStationStop, + boolean isParkingAreaStop) 
      SumoStopFlags​(byte id) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      bytegetID() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        stopped

        +
        public boolean stopped
        +
      • +
      + + + +
        +
      • +

        parking

        +
        public boolean parking
        +
      • +
      + + + +
        +
      • +

        triggered

        +
        public boolean triggered
        +
      • +
      + + + +
        +
      • +

        containerTriggered

        +
        public boolean containerTriggered
        +
      • +
      + + + +
        +
      • +

        isBusStop

        +
        public boolean isBusStop
        +
      • +
      + + + +
        +
      • +

        isContainerStop

        +
        public boolean isContainerStop
        +
      • +
      + + + +
        +
      • +

        isChargingStationStop

        +
        public boolean isChargingStationStop
        +
      • +
      + + + +
        +
      • +

        isParkingAreaStop

        +
        public boolean isParkingAreaStop
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoStopFlags

        +
        public SumoStopFlags​(boolean parking,
        +                     boolean triggered,
        +                     boolean containerTriggered,
        +                     boolean isBusStop,
        +                     boolean isContainerStop,
        +                     boolean isChargingStationStop,
        +                     boolean isParkingAreaStop)
        +
      • +
      + + + +
        +
      • +

        SumoStopFlags

        +
        public SumoStopFlags​(byte id)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getID

        +
        public byte getID()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStringList.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStringList.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStringList.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoStringList.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,807 @@ + + + + + +SumoStringList (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoStringList

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoStringList
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject, java.io.Serializable, java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.List<java.lang.String>
    +
    +
    +
    public class SumoStringList
    +extends java.lang.Object
    +implements java.util.List<java.lang.String>, java.io.Serializable, SumoObject
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoStringList() 
      SumoStringList​(java.util.List<java.lang.String> list) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(int index, + java.lang.String element) 
      booleanadd​(java.lang.String element) 
      booleanaddAll​(int index, + java.util.Collection<? extends java.lang.String> elements) 
      booleanaddAll​(java.util.Collection<? extends java.lang.String> elements) 
      voidclear() 
      booleancontains​(java.lang.Object element) 
      booleancontainsAll​(java.util.Collection<?> elements) 
      java.lang.Stringget​(int index) 
      intindexOf​(java.lang.Object element) 
      booleanisEmpty() 
      java.util.Iterator<java.lang.String>iterator() 
      intlastIndexOf​(java.lang.Object element) 
      java.util.ListIterator<java.lang.String>listIterator() 
      java.util.ListIterator<java.lang.String>listIterator​(int index) 
      java.lang.Stringremove​(int index) 
      booleanremove​(java.lang.Object element) 
      booleanremoveAll​(java.util.Collection<?> elements) 
      booleanretainAll​(java.util.Collection<?> elements) 
      java.lang.Stringset​(int index, + java.lang.String element) 
      intsize() 
      java.util.List<java.lang.String>subList​(int from, + int to) 
      java.lang.Object[]toArray() 
      <T> T[]toArray​(T[] element) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.Collection

        +parallelStream, removeIf, stream, toArray
      • +
      +
        +
      • + + +

        Methods inherited from interface java.lang.Iterable

        +forEach
      • +
      +
        +
      • + + +

        Methods inherited from interface java.util.List

        +equals, hashCode, replaceAll, sort, spliterator
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoStringList

        +
        public SumoStringList()
        +
      • +
      + + + +
        +
      • +

        SumoStringList

        +
        public SumoStringList​(java.util.List<java.lang.String> list)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public void add​(int index,
        +                java.lang.String element)
        +
        +
        Specified by:
        +
        add in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        addAll

        +
        public boolean addAll​(java.util.Collection<? extends java.lang.String> elements)
        +
        +
        Specified by:
        +
        addAll in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        addAll in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        addAll

        +
        public boolean addAll​(int index,
        +                      java.util.Collection<? extends java.lang.String> elements)
        +
        +
        Specified by:
        +
        addAll in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        clear

        +
        public void clear()
        +
        +
        Specified by:
        +
        clear in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        clear in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        contains

        +
        public boolean contains​(java.lang.Object element)
        +
        +
        Specified by:
        +
        contains in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        contains in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        containsAll

        +
        public boolean containsAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        containsAll in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        containsAll in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        get

        +
        public java.lang.String get​(int index)
        +
        +
        Specified by:
        +
        get in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        indexOf

        +
        public int indexOf​(java.lang.Object element)
        +
        +
        Specified by:
        +
        indexOf in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        public boolean isEmpty()
        +
        +
        Specified by:
        +
        isEmpty in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        isEmpty in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        lastIndexOf

        +
        public int lastIndexOf​(java.lang.Object element)
        +
        +
        Specified by:
        +
        lastIndexOf in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        listIterator

        +
        public java.util.ListIterator<java.lang.String> listIterator()
        +
        +
        Specified by:
        +
        listIterator in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        listIterator

        +
        public java.util.ListIterator<java.lang.String> listIterator​(int index)
        +
        +
        Specified by:
        +
        listIterator in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public boolean remove​(java.lang.Object element)
        +
        +
        Specified by:
        +
        remove in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        remove in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        remove

        +
        public java.lang.String remove​(int index)
        +
        +
        Specified by:
        +
        remove in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        removeAll

        +
        public boolean removeAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        removeAll in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        removeAll in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        retainAll

        +
        public boolean retainAll​(java.util.Collection<?> elements)
        +
        +
        Specified by:
        +
        retainAll in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        retainAll in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        set

        +
        public java.lang.String set​(int index,
        +                            java.lang.String element)
        +
        +
        Specified by:
        +
        set in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        size

        +
        public int size()
        +
        +
        Specified by:
        +
        size in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        size in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        subList

        +
        public java.util.List<java.lang.String> subList​(int from,
        +                                                int to)
        +
        +
        Specified by:
        +
        subList in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        toArray

        +
        public java.lang.Object[] toArray()
        +
        +
        Specified by:
        +
        toArray in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        toArray in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + + + +
        +
      • +

        toArray

        +
        public <T> T[] toArray​(T[] element)
        +
        +
        Specified by:
        +
        toArray in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        toArray in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        public boolean add​(java.lang.String element)
        +
        +
        Specified by:
        +
        add in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        add in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        iterator

        +
        public java.util.Iterator<java.lang.String> iterator()
        +
        +
        Specified by:
        +
        iterator in interface java.util.Collection<java.lang.String>
        +
        Specified by:
        +
        iterator in interface java.lang.Iterable<java.lang.String>
        +
        Specified by:
        +
        iterator in interface java.util.List<java.lang.String>
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSController.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,391 @@ + + + + + +SumoTLSController (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoTLSController

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoTLSController
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoTLSController
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      java.util.HashMap<java.lang.String,​SumoTLSProgram>programs 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoTLSController() 
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        programs

        +
        public java.util.HashMap<java.lang.String,​SumoTLSProgram> programs
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoTLSController

        +
        public SumoTLSController()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addProgram

        +
        public void addProgram​(SumoTLSProgram logic)
        +
      • +
      + + + +
        +
      • +

        get

        +
        public SumoTLSProgram get​(java.lang.String prog_name)
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSPhase.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,471 @@ + + + + + +SumoTLSPhase (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoTLSPhase

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoTLSPhase
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoTLSPhase
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doubleduration 
      doublemaxDur 
      doubleminDur 
      java.lang.Stringname 
      java.util.ArrayList<java.lang.Integer>next 
      java.lang.Stringphasedef 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoTLSPhase() 
      SumoTLSPhase​(double duration, + double minDur, + double maxDur, + java.lang.String phasedef, + java.util.ArrayList<java.lang.Integer> next, + java.lang.String name) 
      SumoTLSPhase​(int duration, + java.lang.String phasedef) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        duration

        +
        public double duration
        +
      • +
      + + + +
        +
      • +

        minDur

        +
        public double minDur
        +
      • +
      + + + +
        +
      • +

        maxDur

        +
        public double maxDur
        +
      • +
      + + + +
        +
      • +

        phasedef

        +
        public java.lang.String phasedef
        +
      • +
      + +
        +
      • +

        next

        +
        public java.util.ArrayList<java.lang.Integer> next
        +
      • +
      + + + +
        +
      • +

        name

        +
        public java.lang.String name
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoTLSPhase

        +
        public SumoTLSPhase()
        +
      • +
      + + + +
        +
      • +

        SumoTLSPhase

        +
        public SumoTLSPhase​(double duration,
        +                    double minDur,
        +                    double maxDur,
        +                    java.lang.String phasedef,
        +                    java.util.ArrayList<java.lang.Integer> next,
        +                    java.lang.String name)
        +
      • +
      + + + +
        +
      • +

        SumoTLSPhase

        +
        public SumoTLSPhase​(int duration,
        +                    java.lang.String phasedef)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoTLSProgram.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,466 @@ + + + + + +SumoTLSProgram (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoTLSProgram

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoTLSProgram
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoTLSProgram
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      intcurrentPhaseIndex 
      java.util.HashMap<java.lang.String,​java.lang.String>params 
      java.util.ArrayList<SumoTLSPhase>phases 
      java.lang.StringsubID 
      inttype 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoTLSProgram() 
      SumoTLSProgram​(java.lang.String subID, + int type, + int currentPhaseIndex) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(SumoTLSPhase phase) 
      voidaddParam​(java.lang.String key, + java.lang.String value) 
      java.lang.StringtoString() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        subID

        +
        public java.lang.String subID
        +
      • +
      + + + +
        +
      • +

        type

        +
        public int type
        +
      • +
      + + + +
        +
      • +

        currentPhaseIndex

        +
        public int currentPhaseIndex
        +
      • +
      + + + +
        +
      • +

        phases

        +
        public java.util.ArrayList<SumoTLSPhase> phases
        +
      • +
      + + + +
        +
      • +

        params

        +
        public java.util.HashMap<java.lang.String,​java.lang.String> params
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoTLSProgram

        +
        public SumoTLSProgram()
        +
      • +
      + + + +
        +
      • +

        SumoTLSProgram

        +
        public SumoTLSProgram​(java.lang.String subID,
        +                      int type,
        +                      int currentPhaseIndex)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        addParam

        +
        public void addParam​(java.lang.String key,
        +                     java.lang.String value)
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,386 @@ + + + + + +SumoVehicleData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoVehicleData

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoVehicleData
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoVehicleData
    +extends java.lang.Object
    +implements SumoObject
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoVehicleData() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidadd​(java.lang.String vehID, + double length, + double entry_time, + double leave_time, + java.lang.String typeID) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoVehicleData

        +
        public SumoVehicleData()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        public void add​(java.lang.String vehID,
        +                double length,
        +                double entry_time,
        +                double leave_time,
        +                java.lang.String typeID)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.VehicleData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.VehicleData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.VehicleData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleData.VehicleData.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,380 @@ + + + + + +SumoVehicleData.VehicleData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoVehicleData.VehicleData

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoVehicleData.VehicleData
    • +
    +
  • +
+
+
    +
  • +
    +
    Enclosing class:
    +
    SumoVehicleData
    +
    +
    +
    public static class SumoVehicleData.VehicleData
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      doubleentry_time 
      doubleleave_time 
      doublelength 
      java.lang.StringtypeID 
      java.lang.StringvehID 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      VehicleData​(java.lang.String vehID, + double length, + double entry_time, + double leave_time, + java.lang.String typeID) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        vehID

        +
        public java.lang.String vehID
        +
      • +
      + + + +
        +
      • +

        length

        +
        public double length
        +
      • +
      + + + +
        +
      • +

        entry_time

        +
        public double entry_time
        +
      • +
      + + + +
        +
      • +

        leave_time

        +
        public double leave_time
        +
      • +
      + + + +
        +
      • +

        typeID

        +
        public java.lang.String typeID
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        VehicleData

        +
        public VehicleData​(java.lang.String vehID,
        +                   double length,
        +                   double entry_time,
        +                   double leave_time,
        +                   java.lang.String typeID)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignal.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,317 @@ + + + + + +SumoVehicleSignal (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoVehicleSignal

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.container.SumoVehicleSignal
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    SumoObject
    +
    +
    +
    public class SumoVehicleSignal
    +extends java.lang.Object
    +implements SumoObject
    +
    +
    Author:
    +
    Mario Krumnow, Anja Liebscher
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoVehicleSignal​(int code) 
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoVehicleSignal

        +
        public SumoVehicleSignal​(int code)
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/container/SumoVehicleSignalState.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,555 @@ + + + + + +SumoVehicleSignalState (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Enum SumoVehicleSignalState

+
+
+
    +
  • java.lang.Object
  • +
  • + +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static SumoVehicleSignalState[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (SumoVehicleSignalState c : SumoVehicleSignalState.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static SumoVehicleSignalState valueOf​(java.lang.String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        +
        java.lang.NullPointerException - if the argument is null
        +
        +
      • +
      + + + +
        +
      • +

        getPos

        +
        public int getPos()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,272 @@ + + + + + +Uses of Interface de.tudresden.ws.log.Log (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Interface
de.tudresden.ws.log.Log

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log_txt.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log_txt.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log_txt.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/class-use/Log_txt.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class de.tudresden.ws.log.Log_txt (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.tudresden.ws.log.Log_txt

+
+
No usage of de.tudresden.ws.log.Log_txt
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,300 @@ + + + + + +Log (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface Log

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    Log_txt
    +
    +
    +
    public interface Log
    +
    The Interface Logger.
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      voidtxt_output​(boolean txt_output) 
      voidwrite​(java.lang.StackTraceElement[] el) 
      voidwrite​(java.lang.String input, + int priority) 
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        void write​(java.lang.String input,
        +           int priority)
        +
        +
        Parameters:
        +
        input - input
        +
        priority - priority level
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        void write​(java.lang.StackTraceElement[] el)
        +
        +
        Parameters:
        +
        el - stacktrace
        +
        +
      • +
      + + + +
        +
      • +

        txt_output

        +
        void txt_output​(boolean txt_output)
        +
        +
        Parameters:
        +
        txt_output - boolean text output
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log_txt.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log_txt.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log_txt.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/Log_txt.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,362 @@ + + + + + +Log_txt (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Log_txt

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.log.Log_txt
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Log
    +
    +
    +
    public class Log_txt
    +extends java.lang.Object
    +implements Log
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Log_txt() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidtxt_output​(boolean txt_output) 
      voidwrite​(java.lang.StackTraceElement[] el) 
      voidwrite​(java.lang.String input, + int priority) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Log_txt

        +
        public Log_txt()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        write

        +
        public void write​(java.lang.String input,
        +                  int priority)
        +
        +
        Specified by:
        +
        write in interface Log
        +
        Parameters:
        +
        input - input
        +
        priority - priority level
        +
        +
      • +
      + + + +
        +
      • +

        write

        +
        public void write​(java.lang.StackTraceElement[] el)
        +
        +
        Specified by:
        +
        write in interface Log
        +
        Parameters:
        +
        el - stacktrace
        +
        +
      • +
      + + + +
        +
      • +

        txt_output

        +
        public void txt_output​(boolean txt_output)
        +
        +
        Specified by:
        +
        txt_output in interface Log
        +
        Parameters:
        +
        txt_output - boolean text output
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,185 @@ + + + + + +de.tudresden.ws.log (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.ws.log

+
+
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Log +
    The Interface Logger.
    +
    +
  • +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Log_txt 
    +
  • +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,171 @@ + + + + + +de.tudresden.ws.log Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.ws.log

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • de.tudresden.ws.log.Log_txt (implements de.tudresden.ws.log.Log)
    • +
    +
  • +
+
+
+

Interface Hierarchy

+
    +
  • de.tudresden.ws.log.Log
  • +
+
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/log/package-use.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,256 @@ + + + + + +Uses of Package de.tudresden.ws.log (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.ws.log

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,195 @@ + + + + + +de.tudresden.ws (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.tudresden.ws

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,181 @@ + + + + + +de.tudresden.ws Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.tudresden.ws

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object + +
  • +
+
+
+

Interface Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/package-use.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,189 @@ + + + + + +Uses of Package de.tudresden.ws (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.tudresden.ws

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Service.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Service.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Service.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Service.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,388 @@ + + + + + +Service (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Interface Service

+
+
+
+
    +
  • +
    +
    All Known Implementing Classes:
    +
    ServiceImpl
    +
    +
    +
    public interface Service
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      voidaddOption​(java.lang.String name, + java.lang.String value) 
      voiddoTimestep() 
      java.lang.Stringget_Status​(java.lang.String user) 
      java.lang.StringLastActionTime() 
      voidsetConfig​(java.lang.String filename) 
      voidsetSumoBinary​(java.lang.String filename) 
      java.lang.Stringstart​(java.lang.String user) 
      java.lang.Stringstop​(java.lang.String user) 
      java.lang.StringTXT_output​(boolean input) 
      java.lang.Stringversion() 
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        java.lang.String start​(java.lang.String user)
        +
      • +
      + + + +
        +
      • +

        stop

        +
        java.lang.String stop​(java.lang.String user)
        +
      • +
      + + + +
        +
      • +

        addOption

        +
        void addOption​(java.lang.String name,
        +               java.lang.String value)
        +
      • +
      + + + +
        +
      • +

        doTimestep

        +
        void doTimestep()
        +
      • +
      + + + +
        +
      • +

        setConfig

        +
        void setConfig​(java.lang.String filename)
        +
      • +
      + + + +
        +
      • +

        setSumoBinary

        +
        void setSumoBinary​(java.lang.String filename)
        +
      • +
      + + + +
        +
      • +

        get_Status

        +
        java.lang.String get_Status​(java.lang.String user)
        +
      • +
      + + + +
        +
      • +

        LastActionTime

        +
        java.lang.String LastActionTime()
        +
      • +
      + + + +
        +
      • +

        version

        +
        java.lang.String version()
        +
      • +
      + + + +
        +
      • +

        TXT_output

        +
        java.lang.String TXT_output​(boolean input)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ServiceImpl.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ServiceImpl.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ServiceImpl.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ServiceImpl.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,493 @@ + + + + + +ServiceImpl (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ServiceImpl

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Service
    +
    +
    +
    public class ServiceImpl
    +extends Traci
    +implements Service
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ServiceImpl

        +
        public ServiceImpl​(Config conf)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        start

        +
        public java.lang.String start​(java.lang.String user)
        +
        +
        Specified by:
        +
        start in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        stop

        +
        public java.lang.String stop​(java.lang.String user)
        +
        +
        Specified by:
        +
        stop in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        get_Status

        +
        public java.lang.String get_Status​(java.lang.String user)
        +
        +
        Specified by:
        +
        get_Status in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        LastActionTime

        +
        public java.lang.String LastActionTime()
        +
        +
        Specified by:
        +
        LastActionTime in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        version

        +
        public java.lang.String version()
        +
        +
        Specified by:
        +
        version in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        TXT_output

        +
        public java.lang.String TXT_output​(boolean input)
        +
        +
        Specified by:
        +
        TXT_output in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        addOption

        +
        public void addOption​(java.lang.String name,
        +                      java.lang.String value)
        +
        +
        Specified by:
        +
        addOption in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        doTimestep

        +
        public void doTimestep()
        +
        +
        Specified by:
        +
        doTimestep in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        setConfig

        +
        public void setConfig​(java.lang.String filename)
        +
        +
        Specified by:
        +
        setConfig in interface Service
        +
        +
      • +
      + + + +
        +
      • +

        setSumoBinary

        +
        public void setSumoBinary​(java.lang.String filename)
        +
        +
        Specified by:
        +
        setSumoBinary in interface Service
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ShutdownHook.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ShutdownHook.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ShutdownHook.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/ShutdownHook.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,399 @@ + + + + + +ShutdownHook (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ShutdownHook

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Thread
    • +
    • +
        +
      • de.tudresden.ws.ShutdownHook
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.lang.Runnable
    +
    +
    +
    public class ShutdownHook
    +extends java.lang.Thread
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Nested Class Summary

      +
        +
      • + + +

        Nested classes/interfaces inherited from class java.lang.Thread

        +java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Field Summary

      +
        +
      • + + +

        Fields inherited from class java.lang.Thread

        +MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      ShutdownHook() +
      Instantiates a new shutdown hook.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      booleanisshutdown() 
      voidrun() 
      voidsetshutdown​(boolean shutdown) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Thread

        +activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ShutdownHook

        +
        public ShutdownHook()
        +
        Instantiates a new shutdown hook.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        run

        +
        public void run()
        +
        +
        Specified by:
        +
        run in interface java.lang.Runnable
        +
        Overrides:
        +
        run in class java.lang.Thread
        +
        +
      • +
      + + + +
        +
      • +

        setshutdown

        +
        public void setshutdown​(boolean shutdown)
        +
      • +
      + + + +
        +
      • +

        isshutdown

        +
        public boolean isshutdown()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Traci.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Traci.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Traci.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/Traci.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,4612 @@ + + + + + +Traci (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Traci

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.Traci
    • +
    +
  • +
+
+
    +
  • +
    +
    Direct Known Subclasses:
    +
    ServiceImpl
    +
    +
    +
    public class Traci
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Traci

        +
        public Traci()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        Edge_adaptTraveltime

        +
        public void Edge_adaptTraveltime​(java.lang.String edgeID,
        +                                 int time)
        +
      • +
      + + + +
        +
      • +

        Edge_setEffort

        +
        public void Edge_setEffort​(java.lang.String edgeID,
        +                           double effort)
        +
      • +
      + + + +
        +
      • +

        Edge_setMaxSpeed

        +
        public void Edge_setMaxSpeed​(java.lang.String edgeID,
        +                             double speed)
        +
      • +
      + + + +
        +
      • +

        Vehicle_add

        +
        public void Vehicle_add​(java.lang.String vehID,
        +                        java.lang.String typeID,
        +                        java.lang.String routeID,
        +                        int depart,
        +                        double pos,
        +                        double speed,
        +                        byte lane)
        +
      • +
      + + + +
        +
      • +

        Vehicle_changeLane

        +
        public void Vehicle_changeLane​(java.lang.String vehID,
        +                               byte laneIndex,
        +                               double duration)
        +
      • +
      + + + +
        +
      • +

        Vehicle_changeTarget

        +
        public void Vehicle_changeTarget​(java.lang.String vehID,
        +                                 java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_moveTo

        +
        public void Vehicle_moveTo​(java.lang.String vehID,
        +                           java.lang.String laneID,
        +                           double pos)
        +
      • +
      + + + +
        +
      • +

        Vehicle_remove

        +
        public void Vehicle_remove​(java.lang.String vehID,
        +                           byte reason)
        +
      • +
      + + + +
        +
      • +

        Vehicle_rerouteEffort

        +
        public void Vehicle_rerouteEffort​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_rerouteTraveltime

        +
        public void Vehicle_rerouteTraveltime​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setAccel

        +
        public void Vehicle_setAccel​(java.lang.String vehID,
        +                             double accel)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setAdaptedTraveltime

        +
        public void Vehicle_setAdaptedTraveltime​(java.lang.String vehID,
        +                                         int begTime,
        +                                         int endTime,
        +                                         java.lang.String edgeID,
        +                                         double time)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setColor

        +
        public void Vehicle_setColor​(java.lang.String vehID,
        +                             SumoColor color)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setDecel

        +
        public void Vehicle_setDecel​(java.lang.String vehID,
        +                             double decel)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setEffort

        +
        public void Vehicle_setEffort​(java.lang.String vehID,
        +                              int begTime,
        +                              int endTime,
        +                              java.lang.String edgeID,
        +                              double effort)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setEmissionClass

        +
        public void Vehicle_setEmissionClass​(java.lang.String vehID,
        +                                     java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setImperfection

        +
        public void Vehicle_setImperfection​(java.lang.String vehID,
        +                                    double imperfection)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setLength

        +
        public void Vehicle_setLength​(java.lang.String vehID,
        +                              double length)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setMaxSpeed

        +
        public void Vehicle_setMaxSpeed​(java.lang.String vehID,
        +                                double speed)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setMinGap

        +
        public void Vehicle_setMinGap​(java.lang.String vehID,
        +                              double minGap)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setRouteID

        +
        public void Vehicle_setRouteID​(java.lang.String vehID,
        +                               java.lang.String routeID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setShapeClass

        +
        public void Vehicle_setShapeClass​(java.lang.String vehID,
        +                                  java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setSignals

        +
        public void Vehicle_setSignals​(java.lang.String vehID,
        +                               int signals)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setSpeed

        +
        public void Vehicle_setSpeed​(java.lang.String vehID,
        +                             double speed)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setSpeedDeviation

        +
        public void Vehicle_setSpeedDeviation​(java.lang.String vehID,
        +                                      double deviation)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setSpeedFactor

        +
        public void Vehicle_setSpeedFactor​(java.lang.String vehID,
        +                                   double factor)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setStop

        +
        public void Vehicle_setStop​(java.lang.String vehID,
        +                            java.lang.String edgeID,
        +                            double pos,
        +                            byte laneIndex,
        +                            double duration,
        +                            SumoStopFlags stopType,
        +                            double startPos,
        +                            double until)
        +
      • +
      + + + +
        +
      • +

        Vehicle_resume

        +
        public void Vehicle_resume​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setTau

        +
        public void Vehicle_setTau​(java.lang.String vehID,
        +                           double tau)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setVehicleClass

        +
        public void Vehicle_setVehicleClass​(java.lang.String vehID,
        +                                    java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setWidth

        +
        public void Vehicle_setWidth​(java.lang.String vehID,
        +                             double width)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_setCompleteRedYellowGreenDefinition

        +
        public void Trafficlights_setCompleteRedYellowGreenDefinition​(java.lang.String tlsID,
        +                                                              SumoTLSProgram tls)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_setPhase

        +
        public void Trafficlights_setPhase​(java.lang.String tlsID,
        +                                   int index)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_setPhaseDuration

        +
        public void Trafficlights_setPhaseDuration​(java.lang.String tlsID,
        +                                           int phaseDuration)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_setProgram

        +
        public void Trafficlights_setProgram​(java.lang.String tlsID,
        +                                     java.lang.String programID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_setRedYellowGreenState

        +
        public void Trafficlights_setRedYellowGreenState​(java.lang.String tlsID,
        +                                                 java.lang.String state)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setAccel

        +
        public void Vehicletype_setAccel​(java.lang.String typeID,
        +                                 double accel)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setColor

        +
        public void Vehicletype_setColor​(java.lang.String typeID,
        +                                 SumoColor color)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setDecel

        +
        public void Vehicletype_setDecel​(java.lang.String typeID,
        +                                 double decel)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setEmissionClass

        +
        public void Vehicletype_setEmissionClass​(java.lang.String typeID,
        +                                         java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setImperfection

        +
        public void Vehicletype_setImperfection​(java.lang.String typeID,
        +                                        double imperfection)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setLength

        +
        public void Vehicletype_setLength​(java.lang.String typeID,
        +                                  double length)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setMaxSpeed

        +
        public void Vehicletype_setMaxSpeed​(java.lang.String typeID,
        +                                    double speed)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setMinGap

        +
        public void Vehicletype_setMinGap​(java.lang.String typeID,
        +                                  double minGap)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setShapeClass

        +
        public void Vehicletype_setShapeClass​(java.lang.String typeID,
        +                                      java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setSpeedDeviation

        +
        public void Vehicletype_setSpeedDeviation​(java.lang.String typeID,
        +                                          double deviation)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setSpeedFactor

        +
        public void Vehicletype_setSpeedFactor​(java.lang.String typeID,
        +                                       double factor)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setTau

        +
        public void Vehicletype_setTau​(java.lang.String typeID,
        +                               double tau)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setVehicleClass

        +
        public void Vehicletype_setVehicleClass​(java.lang.String typeID,
        +                                        java.lang.String clazz)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_setWidth

        +
        public void Vehicletype_setWidth​(java.lang.String typeID,
        +                                 double width)
        +
      • +
      + + + +
        +
      • +

        Lane_setAllowed

        +
        public void Lane_setAllowed​(java.lang.String laneID,
        +                            SumoStringList allowedClasses)
        +
      • +
      + + + +
        +
      • +

        Lane_setDisallowed

        +
        public void Lane_setDisallowed​(java.lang.String laneID,
        +                               SumoStringList disallowedClasses)
        +
      • +
      + + + +
        +
      • +

        Lane_setLength

        +
        public void Lane_setLength​(java.lang.String laneID,
        +                           double length)
        +
      • +
      + + + +
        +
      • +

        Lane_setMaxSpeed

        +
        public void Lane_setMaxSpeed​(java.lang.String laneID,
        +                             double speed)
        +
      • +
      + + + +
        +
      • +

        Polygon_add

        +
        public void Polygon_add​(java.lang.String polygonID,
        +                        SumoGeometry shape,
        +                        SumoColor color,
        +                        boolean fill,
        +                        java.lang.String polygonType,
        +                        int layer)
        +
      • +
      + + + +
        +
      • +

        Polygon_remove

        +
        public void Polygon_remove​(java.lang.String polygonID,
        +                           int layer)
        +
      • +
      + + + +
        +
      • +

        Polygon_setColor

        +
        public void Polygon_setColor​(java.lang.String polygonID,
        +                             SumoColor color)
        +
      • +
      + + + +
        +
      • +

        Polygon_setShape

        +
        public void Polygon_setShape​(java.lang.String polygonID,
        +                             SumoStringList shape)
        +
      • +
      + + + +
        +
      • +

        Polygon_setType

        +
        public void Polygon_setType​(java.lang.String polygonID,
        +                            java.lang.String polygonType)
        +
      • +
      + + + +
        +
      • +

        Poi_remove

        +
        public void Poi_remove​(java.lang.String poiID,
        +                       int layer)
        +
      • +
      + + + +
        +
      • +

        Poi_setColor

        +
        public void Poi_setColor​(java.lang.String poiID,
        +                         SumoColor color)
        +
      • +
      + + + +
        +
      • +

        Poi_setPosition

        +
        public void Poi_setPosition​(java.lang.String poiID,
        +                            double x,
        +                            double y)
        +
      • +
      + + + +
        +
      • +

        Poi_setType

        +
        public void Poi_setType​(java.lang.String poiID,
        +                        java.lang.String poiType)
        +
      • +
      + + + +
        +
      • +

        GUI_screenshot

        +
        public void GUI_screenshot​(java.lang.String viewID,
        +                           java.lang.String filename)
        +
      • +
      + + + +
        +
      • +

        GUI_setBoundary

        +
        public void GUI_setBoundary​(java.lang.String viewID,
        +                            double xmin,
        +                            double ymin,
        +                            double xmax,
        +                            double ymax)
        +
      • +
      + + + +
        +
      • +

        GUI_setOffset

        +
        public void GUI_setOffset​(java.lang.String viewID,
        +                          double x,
        +                          double y)
        +
      • +
      + + + +
        +
      • +

        GUI_setSchema

        +
        public void GUI_setSchema​(java.lang.String viewID,
        +                          java.lang.String schemeName)
        +
      • +
      + + + +
        +
      • +

        GUI_setZoom

        +
        public void GUI_setZoom​(java.lang.String viewID,
        +                        double zoom)
        +
      • +
      + + + +
        +
      • +

        GUI_trackVehicle

        +
        public void GUI_trackVehicle​(java.lang.String viewID,
        +                             java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Route_add

        +
        public void Route_add​(java.lang.String routeID,
        +                      SumoStringList edges)
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getIDList

        +
        public SumoStringList Multientryexit_getIDList()
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getIDCount

        +
        public int Multientryexit_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getLastStepHaltingNumber

        +
        public int Multientryexit_getLastStepHaltingNumber​(java.lang.String detID)
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getLastStepMeanSpeed

        +
        public double Multientryexit_getLastStepMeanSpeed​(java.lang.String detID)
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getLastStepVehicleIDs

        +
        public SumoStringList Multientryexit_getLastStepVehicleIDs​(java.lang.String detID)
        +
      • +
      + + + +
        +
      • +

        Multientryexit_getLastStepVehicleNumber

        +
        public int Multientryexit_getLastStepVehicleNumber​(java.lang.String detID)
        +
      • +
      + + + +
        +
      • +

        Edge_getAdaptedTraveltime

        +
        public double Edge_getAdaptedTraveltime​(java.lang.String edgeID,
        +                                        int time)
        +
      • +
      + + + +
        +
      • +

        Edge_getCO2Emission

        +
        public double Edge_getCO2Emission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getCOEmission

        +
        public double Edge_getCOEmission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getEffort

        +
        public double Edge_getEffort​(java.lang.String edgeID,
        +                             int time)
        +
      • +
      + + + +
        +
      • +

        Edge_getElectricityConsumption

        +
        public double Edge_getElectricityConsumption​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getFuelConsumption

        +
        public double Edge_getFuelConsumption​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getHCEmission

        +
        public double Edge_getHCEmission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getIDCount

        +
        public int Edge_getIDCount()
        +
      • +
      + + + + + + + +
        +
      • +

        Edge_getLastStepHaltingNumber

        +
        public int Edge_getLastStepHaltingNumber​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getLastStepLength

        +
        public double Edge_getLastStepLength​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getLastStepMeanSpeed

        +
        public double Edge_getLastStepMeanSpeed​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getLastStepOccupancy

        +
        public double Edge_getLastStepOccupancy​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getLastStepVehicleIDs

        +
        public SumoStringList Edge_getLastStepVehicleIDs​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getLastStepVehicleNumber

        +
        public int Edge_getLastStepVehicleNumber​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getNOxEmission

        +
        public double Edge_getNOxEmission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getNoiseEmission

        +
        public double Edge_getNoiseEmission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getPMxEmission

        +
        public double Edge_getPMxEmission​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getTraveltime

        +
        public double Edge_getTraveltime​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Edge_getWaitingTime

        +
        public double Edge_getWaitingTime​(java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Lanearea_getIDList

        +
        public SumoStringList Lanearea_getIDList()
        +
      • +
      + + + +
        +
      • +

        Lanearea_getIDCount

        +
        public int Lanearea_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Lanearea_getJamLengthVehicle

        +
        public int Lanearea_getJamLengthVehicle​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Lanearea_getJamLengthMeters

        +
        public double Lanearea_getJamLengthMeters​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Lanearea_getLastStepMeanSpeed

        +
        public double Lanearea_getLastStepMeanSpeed​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Lanearea_getLastStepOccupancy

        +
        public double Lanearea_getLastStepOccupancy​(java.lang.String loopID)
        +
      • +
      + + + + + + + +
        +
      • +

        Person_getIDCount

        +
        public int Person_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Person_getSpeed

        +
        public double Person_getSpeed​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getPosition

        +
        public SumoPosition2D Person_getPosition​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getPosition3D

        +
        public SumoPosition3D Person_getPosition3D​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getAngle

        +
        public int Person_getAngle​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getRoadID

        +
        public java.lang.String Person_getRoadID​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getTypeID

        +
        public java.lang.String Person_getTypeID​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getLanePosition

        +
        public double Person_getLanePosition​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getColor

        +
        public SumoColor Person_getColor​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getPersonNumber

        +
        public int Person_getPersonNumber​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getLength

        +
        public double Person_getLength​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getWaitingTime

        +
        public double Person_getWaitingTime​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Person_getMinGap

        +
        public double Person_getMinGap​(java.lang.String personID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getAccel

        +
        public double Vehicle_getAccel​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getAdaptedTraveltime

        +
        public double Vehicle_getAdaptedTraveltime​(java.lang.String vehID,
        +                                           int time,
        +                                           java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getAngle

        +
        public double Vehicle_getAngle​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getBestLanes

        +
        public SumoStringList Vehicle_getBestLanes​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getCO2Emission

        +
        public double Vehicle_getCO2Emission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getCOEmission

        +
        public double Vehicle_getCOEmission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getColor

        +
        public SumoColor Vehicle_getColor​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getDecel

        +
        public double Vehicle_getDecel​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getDrivingDistance

        +
        public double Vehicle_getDrivingDistance​(java.lang.String vehID,
        +                                         java.lang.String edgeID,
        +                                         double pos,
        +                                         byte laneID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getDrivingDistance2D

        +
        public double Vehicle_getDrivingDistance2D​(java.lang.String vehID,
        +                                           double x,
        +                                           double y)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getEffort

        +
        public double Vehicle_getEffort​(java.lang.String vehID,
        +                                int time,
        +                                java.lang.String edgeID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getEmissionClass

        +
        public java.lang.String Vehicle_getEmissionClass​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getFuelConsumption

        +
        public double Vehicle_getFuelConsumption​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getHCEmission

        +
        public double Vehicle_getHCEmission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getIDList

        +
        public SumoStringList Vehicle_getIDList()
        +
      • +
      + + + +
        +
      • +

        Vehicle_getIDCount

        +
        public int Vehicle_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Vehicle_getImperfection

        +
        public double Vehicle_getImperfection​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getAllowedSpeed

        +
        public double Vehicle_getAllowedSpeed​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getPersonNumber

        +
        public int Vehicle_getPersonNumber​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getDistance

        +
        public double Vehicle_getDistance​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getElectricityConsumption

        +
        public double Vehicle_getElectricityConsumption​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getWaitingTime

        +
        public double Vehicle_getWaitingTime​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getLaneID

        +
        public java.lang.String Vehicle_getLaneID​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getLaneIndex

        +
        public int Vehicle_getLaneIndex​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getLanePosition

        +
        public double Vehicle_getLanePosition​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getLeader

        +
        public java.lang.String Vehicle_getLeader​(java.lang.String vehID,
        +                                          double dist)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getLength

        +
        public double Vehicle_getLength​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getMaxSpeed

        +
        public double Vehicle_getMaxSpeed​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getMinGap

        +
        public double Vehicle_getMinGap​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getNOxEmission

        +
        public double Vehicle_getNOxEmission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getNoiseEmission

        +
        public double Vehicle_getNoiseEmission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getPMxEmission

        +
        public double Vehicle_getPMxEmission​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getPosition

        +
        public SumoPosition2D Vehicle_getPosition​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getPosition3D

        +
        public SumoPosition3D Vehicle_getPosition3D​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getRoadID

        +
        public java.lang.String Vehicle_getRoadID​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getRoute

        +
        public SumoStringList Vehicle_getRoute​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getRouteID

        +
        public java.lang.String Vehicle_getRouteID​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getShapeClass

        +
        public java.lang.String Vehicle_getShapeClass​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSignals

        +
        public int Vehicle_getSignals​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSlope

        +
        public double Vehicle_getSlope​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSpeed

        +
        public double Vehicle_getSpeed​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSpeedDeviation

        +
        public double Vehicle_getSpeedDeviation​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSpeedFactor

        +
        public double Vehicle_getSpeedFactor​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSpeedMode

        +
        public double Vehicle_getSpeedMode​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getSpeedWithoutTraCI

        +
        public double Vehicle_getSpeedWithoutTraCI​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getTau

        +
        public double Vehicle_getTau​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getTypeID

        +
        public java.lang.String Vehicle_getTypeID​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getVehicleClass

        +
        public java.lang.String Vehicle_getVehicleClass​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_getWidth

        +
        public double Vehicle_getWidth​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_isRouteValid

        +
        public int Vehicle_isRouteValid​(java.lang.String vehID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setRoute

        +
        public void Vehicle_setRoute​(java.lang.String vehID,
        +                             SumoStringList edgeList)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setLaneChangeMode

        +
        public void Vehicle_setLaneChangeMode​(java.lang.String vehID,
        +                                      int lcm)
        +
      • +
      + + + +
        +
      • +

        Vehicle_setType

        +
        public void Vehicle_setType​(java.lang.String vehID,
        +                            java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicle_slowDown

        +
        public void Vehicle_slowDown​(java.lang.String vehID,
        +                             double speed,
        +                             double duration)
        +
      • +
      + + + +
        +
      • +

        GUI_clearPending

        +
        public void GUI_clearPending​(java.lang.String routeID)
        +
      • +
      + + + +
        +
      • +

        Simulation_convert2D

        +
        public SumoStringList Simulation_convert2D​(java.lang.String edgeID,
        +                                           double pos,
        +                                           byte laneIndex,
        +                                           java.lang.String toGeo)
        +
      • +
      + + + +
        +
      • +

        Simulation_convert3D

        +
        public SumoStringList Simulation_convert3D​(java.lang.String edgeID,
        +                                           double pos,
        +                                           byte laneIndex,
        +                                           java.lang.String toGeo)
        +
      • +
      + + + +
        +
      • +

        Simulation_convertGeo

        +
        public SumoStringList Simulation_convertGeo​(double x,
        +                                            double y,
        +                                            boolean fromGeo)
        +
      • +
      + + + +
        +
      • +

        Simulation_convertRoad

        +
        public SumoRoadPosition Simulation_convertRoad​(double x,
        +                                               double y,
        +                                               boolean isGeo,
        +                                               java.lang.String vClass)
        +
      • +
      + + + +
        +
      • +

        Simulation_getArrivedIDList

        +
        public SumoStringList Simulation_getArrivedIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getArrivedNumber

        +
        public int Simulation_getArrivedNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getCurrentTime

        +
        public int Simulation_getCurrentTime()
        +
      • +
      + + + +
        +
      • +

        Simulation_getBusStopWaiting

        +
        public int Simulation_getBusStopWaiting()
        +
      • +
      + + + +
        +
      • +

        Simulation_getParkingEndingVehiclesIDList

        +
        public SumoStringList Simulation_getParkingEndingVehiclesIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getParkingEndingVehiclesNumber

        +
        public int Simulation_getParkingEndingVehiclesNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getParkingStartingVehiclesIDList

        +
        public SumoStringList Simulation_getParkingStartingVehiclesIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getParkingStartingVehiclesNumber

        +
        public int Simulation_getParkingStartingVehiclesNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStopEndingVehiclesIDList

        +
        public SumoStringList Simulation_getStopEndingVehiclesIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStopEndingVehiclesNumber

        +
        public int Simulation_getStopEndingVehiclesNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStopStartingVehiclesIDList

        +
        public SumoStringList Simulation_getStopStartingVehiclesIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStopStartingVehiclesNumber

        +
        public int Simulation_getStopStartingVehiclesNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getDeltaT

        +
        public int Simulation_getDeltaT()
        +
      • +
      + + + +
        +
      • +

        Simulation_getDepartedIDList

        +
        public SumoStringList Simulation_getDepartedIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getDepartedNumber

        +
        public int Simulation_getDepartedNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getDistance2D

        +
        public double Simulation_getDistance2D​(double x1,
        +                                       double y1,
        +                                       double x2,
        +                                       double y2,
        +                                       boolean isGeo,
        +                                       boolean isDriving)
        +
      • +
      + + + +
        +
      • +

        Simulation_getDistanceRoad

        +
        public double Simulation_getDistanceRoad​(java.lang.String edgeID1,
        +                                         double pos1,
        +                                         java.lang.String edgeID2,
        +                                         double pos2,
        +                                         boolean isDriving)
        +
      • +
      + + + +
        +
      • +

        Simulation_getEndingTeleportIDList

        +
        public SumoStringList Simulation_getEndingTeleportIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getEndingTeleportNumber

        +
        public int Simulation_getEndingTeleportNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getLoadedIDList

        +
        public SumoStringList Simulation_getLoadedIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getLoadedNumber

        +
        public int Simulation_getLoadedNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getMinExpectedNumber

        +
        public int Simulation_getMinExpectedNumber()
        +
      • +
      + + + +
        +
      • +

        Simulation_getNetBoundary

        +
        public SumoStringList Simulation_getNetBoundary()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStartingTeleportIDList

        +
        public SumoStringList Simulation_getStartingTeleportIDList()
        +
      • +
      + + + +
        +
      • +

        Simulation_getStartingTeleportNumber

        +
        public int Simulation_getStartingTeleportNumber()
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getCompleteRedYellowGreenDefinition

        +
        public SumoTLSController Trafficlights_getCompleteRedYellowGreenDefinition​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getControlledLanes

        +
        public SumoStringList Trafficlights_getControlledLanes​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getControlledLinks

        +
        public SumoStringList Trafficlights_getControlledLinks​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getIDList

        +
        public SumoStringList Trafficlights_getIDList()
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getIDCount

        +
        public int Trafficlights_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getNextSwitch

        +
        public int Trafficlights_getNextSwitch​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getPhaseDuration

        +
        public int Trafficlights_getPhaseDuration​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getPhase

        +
        public int Trafficlights_getPhase​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getProgram

        +
        public java.lang.String Trafficlights_getProgram​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Trafficlights_getRedYellowGreenState

        +
        public java.lang.String Trafficlights_getRedYellowGreenState​(java.lang.String tlsID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getAccel

        +
        public double Vehicletype_getAccel​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getColor

        +
        public SumoColor Vehicletype_getColor​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getDecel

        +
        public double Vehicletype_getDecel​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getEmissionClass

        +
        public java.lang.String Vehicletype_getEmissionClass​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getIDList

        +
        public SumoStringList Vehicletype_getIDList()
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getIDCount

        +
        public int Vehicletype_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getImperfection

        +
        public double Vehicletype_getImperfection​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getLength

        +
        public double Vehicletype_getLength​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getMaxSpeed

        +
        public double Vehicletype_getMaxSpeed​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getMinGap

        +
        public double Vehicletype_getMinGap​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getShapeClass

        +
        public java.lang.String Vehicletype_getShapeClass​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getSpeedDeviation

        +
        public double Vehicletype_getSpeedDeviation​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getSpeedFactor

        +
        public double Vehicletype_getSpeedFactor​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getTau

        +
        public double Vehicletype_getTau​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getVehicleClass

        +
        public java.lang.String Vehicletype_getVehicleClass​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Vehicletype_getWidth

        +
        public double Vehicletype_getWidth​(java.lang.String typeID)
        +
      • +
      + + + +
        +
      • +

        Lane_getAllowed

        +
        public SumoStringList Lane_getAllowed​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getCO2Emission

        +
        public double Lane_getCO2Emission​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getCOEmission

        +
        public double Lane_getCOEmission​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getDisallowed

        +
        public SumoStringList Lane_getDisallowed​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getEdgeID

        +
        public java.lang.String Lane_getEdgeID​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getElectricityConsumption

        +
        public java.lang.String Lane_getElectricityConsumption​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getFuelConsumption

        +
        public double Lane_getFuelConsumption​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getHCEmission

        +
        public double Lane_getHCEmission​(java.lang.String laneID)
        +
      • +
      + + + + + + + +
        +
      • +

        Lane_getIDCount

        +
        public int Lane_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepHaltingNumber

        +
        public int Lane_getLastStepHaltingNumber​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepLength

        +
        public double Lane_getLastStepLength​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepMeanSpeed

        +
        public double Lane_getLastStepMeanSpeed​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepOccupancy

        +
        public double Lane_getLastStepOccupancy​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepVehicleIDs

        +
        public SumoStringList Lane_getLastStepVehicleIDs​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLastStepVehicleNumber

        +
        public int Lane_getLastStepVehicleNumber​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLength

        +
        public double Lane_getLength​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLinkNumber

        +
        public byte Lane_getLinkNumber​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getLinks

        +
        public SumoLinkList Lane_getLinks​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getMaxSpeed

        +
        public double Lane_getMaxSpeed​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getWaitingTime

        +
        public double Lane_getWaitingTime​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getNOxEmission

        +
        public double Lane_getNOxEmission​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getNoiseEmission

        +
        public double Lane_getNoiseEmission​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getPMxEmission

        +
        public double Lane_getPMxEmission​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getShape

        +
        public SumoGeometry Lane_getShape​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getTraveltime

        +
        public double Lane_getTraveltime​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Lane_getWidth

        +
        public double Lane_getWidth​(java.lang.String laneID)
        +
      • +
      + + + +
        +
      • +

        Polygon_getColor

        +
        public SumoColor Polygon_getColor​(java.lang.String polygonID)
        +
      • +
      + + + +
        +
      • +

        Polygon_getIDList

        +
        public SumoStringList Polygon_getIDList()
        +
      • +
      + + + +
        +
      • +

        Polygon_getIDCount

        +
        public int Polygon_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Polygon_getShape

        +
        public SumoGeometry Polygon_getShape​(java.lang.String polygonID)
        +
      • +
      + + + +
        +
      • +

        Polygon_getType

        +
        public java.lang.String Polygon_getType​(java.lang.String polygonID)
        +
      • +
      + + + +
        +
      • +

        Poi_add

        +
        public void Poi_add​(java.lang.String poiID,
        +                    double x,
        +                    double y,
        +                    SumoColor color,
        +                    java.lang.String poiType,
        +                    int layer)
        +
      • +
      + + + +
        +
      • +

        Poi_getColor

        +
        public SumoColor Poi_getColor​(java.lang.String poiID)
        +
      • +
      + + + + + + + +
        +
      • +

        Poi_getIDCount

        +
        public int Poi_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Poi_getPosition

        +
        public SumoPosition2D Poi_getPosition​(java.lang.String poiID)
        +
      • +
      + + + +
        +
      • +

        Poi_getType

        +
        public java.lang.String Poi_getType​(java.lang.String poiID)
        +
      • +
      + + + +
        +
      • +

        Junction_getIDList

        +
        public SumoStringList Junction_getIDList()
        +
      • +
      + + + +
        +
      • +

        Junction_getShape

        +
        public SumoGeometry Junction_getShape​(java.lang.String junctionID)
        +
      • +
      + + + +
        +
      • +

        Junction_getIDCount

        +
        public int Junction_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Junction_getPosition

        +
        public SumoPosition2D Junction_getPosition​(java.lang.String junctionID)
        +
      • +
      + + + +
        +
      • +

        GUI_getBoundary

        +
        public SumoBoundingBox GUI_getBoundary​(java.lang.String viewID)
        +
      • +
      + + + + + + + +
        +
      • +

        GUI_getOffset

        +
        public SumoPosition2D GUI_getOffset​(java.lang.String viewID)
        +
      • +
      + + + +
        +
      • +

        GUI_getSchema

        +
        public java.lang.String GUI_getSchema​(java.lang.String viewID)
        +
      • +
      + + + +
        +
      • +

        GUI_getZoom

        +
        public double GUI_getZoom​(java.lang.String viewID)
        +
      • +
      + + + +
        +
      • +

        Route_getEdges

        +
        public SumoStringList Route_getEdges​(java.lang.String routeID)
        +
      • +
      + + + + + + + +
        +
      • +

        Route_getIDCount

        +
        public int Route_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getIDList

        +
        public SumoStringList Inductionloop_getIDList()
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getIDCount

        +
        public int Inductionloop_getIDCount()
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLaneID

        +
        public java.lang.String Inductionloop_getLaneID​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLastStepMeanLength

        +
        public double Inductionloop_getLastStepMeanLength​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLastStepMeanSpeed

        +
        public double Inductionloop_getLastStepMeanSpeed​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLastStepOccupancy

        +
        public double Inductionloop_getLastStepOccupancy​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLastStepVehicleIDs

        +
        public SumoStringList Inductionloop_getLastStepVehicleIDs​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getLastStepVehicleNumber

        +
        public int Inductionloop_getLastStepVehicleNumber​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getPosition

        +
        public double Inductionloop_getPosition​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getTimeSinceDetection

        +
        public double Inductionloop_getTimeSinceDetection​(java.lang.String loopID)
        +
      • +
      + + + +
        +
      • +

        Inductionloop_getVehicleData

        +
        public SumoVehicleData Inductionloop_getVehicleData​(java.lang.String loopID)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/WebService.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/WebService.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/WebService.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/tudresden/ws/WebService.html 2020-04-27 22:06:57.000000000 +0000 @@ -0,0 +1,312 @@ + + + + + +WebService (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class WebService

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.tudresden.ws.WebService
    • +
    +
  • +
+
+
    +
  • +
    +
    public class WebService
    +extends java.lang.Object
    +
    +
    Author:
    +
    Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      WebService() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Static Methods Concrete Methods 
      Modifier and TypeMethodDescription
      static voidmain​(java.lang.String[] args) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        WebService

        +
        public WebService()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        main

        +
        public static void main​(java.lang.String[] args)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/class-use/Storage.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,270 @@ + + + + + +Uses of Class de.uniluebeck.itm.tcpip.Storage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
de.uniluebeck.itm.tcpip.Storage

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-summary.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,168 @@ + + + + + +de.uniluebeck.itm.tcpip (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package de.uniluebeck.itm.tcpip

+
+
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Storage 
    +
  • +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-tree.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,165 @@ + + + + + +de.uniluebeck.itm.tcpip Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package de.uniluebeck.itm.tcpip

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • de.uniluebeck.itm.tcpip.Storage (implements java.io.Serializable)
    • +
    +
  • +
+
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/package-use.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,206 @@ + + + + + +Uses of Package de.uniluebeck.itm.tcpip (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
de.uniluebeck.itm.tcpip

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/de/uniluebeck/itm/tcpip/Storage.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,1043 @@ + + + + + +Storage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Storage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • de.uniluebeck.itm.tcpip.Storage
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    java.io.Serializable
    +
    +
    +
    public class Storage
    +extends java.lang.Object
    +implements java.io.Serializable
    +
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Storage() 
      Storage​(byte[] packet) 
      Storage​(byte[] packet, + int offset, + int length) 
      Storage​(short[] packet) 
      Storage​(short[] packet, + int offset, + int length) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.Stringdebug() 
      java.util.List<java.lang.Byte>getStorageList() +
      Retrieve the internal list that is used to store the data
      +
      intposition() 
      shortreadByte() +
      Read a byte value from the List
      +
      doublereadDouble() +
      Read a Double value, that was split up into 8 bytes
      +
      floatreadFloat() +
      Read a Float value, that was split up into 4 bytes
      +
      intreadInt() +
      Read a signed integer value, that was split up into 4 bytes
      +
      intreadShort() +
      Read a short value from the list
      +
      java.lang.StringreadStringASCII() +
      Read a String from the list, that was encoded using ASCII
      +
      java.lang.StringreadStringISOLATIN1() +
      Read a String from the list, that was encoded using ISO-LATIN1
      +
      java.lang.StringreadStringUTF16BE() +
      Read a String from the list, that was encoded using UTF-16 Big Endian
      +
      java.lang.StringreadStringUTF16LE() +
      Read a String from the list, that was encoded using UTF-16 Little Endian
      +
      java.lang.StringreadStringUTF8() +
      Read a String from the list, that was encoded using UTF-8
      +
      shortreadUnsignedByte() 
      voidreset() 
      intsize() +
      Retrieve the Size of the internal storage list
      +
      java.lang.StringtoString() 
      booleanvalidPos() 
      voidwriteByte​(int value) 
      voidwriteByte​(short value) +
      Write a byte value to the List + a signed value will be converted to its unsigned equivalent first
      +
      voidwriteDouble​(double value) +
      Write a Double to the list + the value is beeing split up into 8 bytes in msb first order
      +
      voidwriteFloat​(float value) +
      Write a Float to the list + the float value is beeing split up into 4 bytes in msb first order
      +
      voidwriteInt​(int value) +
      Write an signed Integer to the list + the int value is being split up into 4 bytes in msb first order
      +
      voidwriteShort​(int value) +
      Write a signed short value to the list
      +
      voidwriteStringASCII​(java.lang.String value) +
      Write a string to the list by encoding the characters in ASCII
      +
      voidwriteStringISOLATIN1​(java.lang.String value) +
      Write a string to the list by encoding the characters in ISO-LATIN1
      +
      voidwriteStringUTF16BE​(java.lang.String value) +
      Write a string to the list by encoding the characters in UTF-16 Big Endian
      +
      voidwriteStringUTF16LE​(java.lang.String value) +
      Write a string to the list by encoding the characters in UTF-16 Little Endian
      +
      voidwriteStringUTF8​(java.lang.String value) +
      Write a string to the list by encoding the characters in UTF-8
      +
      voidwriteUnsignedByte​(int value) 
      voidwriteUnsignedByte​(short value) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Storage

        +
        public Storage()
        +
      • +
      + + + +
        +
      • +

        Storage

        +
        public Storage​(byte[] packet)
        +
      • +
      + + + +
        +
      • +

        Storage

        +
        public Storage​(byte[] packet,
        +               int offset,
        +               int length)
        +
      • +
      + + + +
        +
      • +

        Storage

        +
        public Storage​(short[] packet)
        +
      • +
      + + + +
        +
      • +

        Storage

        +
        public Storage​(short[] packet,
        +               int offset,
        +               int length)
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        validPos

        +
        public boolean validPos()
        +
      • +
      + + + +
        +
      • +

        position

        +
        public int position()
        +
      • +
      + + + +
        +
      • +

        writeByte

        +
        public void writeByte​(short value)
        +               throws java.lang.IllegalArgumentException
        +
        Write a byte value to the List + a signed value will be converted to its unsigned equivalent first
        +
        +
        Parameters:
        +
        value - the byte to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeByte

        +
        public void writeByte​(int value)
        +               throws java.lang.IllegalArgumentException
        +
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readByte

        +
        public short readByte()
        +               throws java.lang.IllegalStateException
        +
        Read a byte value from the List
        +
        +
        Returns:
        +
        the read byte as an Integer value (unsigned)
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeUnsignedByte

        +
        public void writeUnsignedByte​(short value)
        +                       throws java.lang.IllegalArgumentException
        +
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeUnsignedByte

        +
        public void writeUnsignedByte​(int value)
        +                       throws java.lang.IllegalArgumentException
        +
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readUnsignedByte

        +
        public short readUnsignedByte()
        +                       throws java.lang.IllegalStateException
        +
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeShort

        +
        public void writeShort​(int value)
        +                throws java.lang.IllegalArgumentException
        +
        Write a signed short value to the list
        +
        +
        Parameters:
        +
        value - the short value to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readShort

        +
        public int readShort()
        +              throws java.lang.IllegalStateException
        +
        Read a short value from the list
        +
        +
        Returns:
        +
        the read short value as an Integer
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeInt

        +
        public void writeInt​(int value)
        +              throws java.lang.IllegalArgumentException
        +
        Write an signed Integer to the list + the int value is being split up into 4 bytes in msb first order
        +
        +
        Parameters:
        +
        value - the int value to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readInt

        +
        public int readInt()
        +            throws java.lang.IllegalStateException
        +
        Read a signed integer value, that was split up into 4 bytes
        +
        +
        Returns:
        +
        the read int value
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeFloat

        +
        public void writeFloat​(float value)
        +                throws java.lang.IllegalArgumentException
        +
        Write a Float to the list + the float value is beeing split up into 4 bytes in msb first order
        +
        +
        Parameters:
        +
        value - the float value to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readFloat

        +
        public float readFloat()
        +                throws java.lang.IllegalStateException
        +
        Read a Float value, that was split up into 4 bytes
        +
        +
        Returns:
        +
        the read float value
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeDouble

        +
        public void writeDouble​(double value)
        +                 throws java.lang.IllegalArgumentException
        +
        Write a Double to the list + the value is beeing split up into 8 bytes in msb first order
        +
        +
        Parameters:
        +
        value - the double value to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readDouble

        +
        public double readDouble()
        +                  throws java.lang.IllegalStateException
        +
        Read a Double value, that was split up into 8 bytes
        +
        +
        Returns:
        +
        the read double value
        +
        Throws:
        +
        java.lang.IllegalStateException
        +
        +
      • +
      + + + +
        +
      • +

        writeStringUTF8

        +
        public void writeStringUTF8​(java.lang.String value)
        +                     throws java.lang.IllegalArgumentException
        +
        Write a string to the list by encoding the characters in UTF-8
        +
        +
        Parameters:
        +
        value - the String to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeStringASCII

        +
        public void writeStringASCII​(java.lang.String value)
        +                      throws java.lang.IllegalArgumentException
        +
        Write a string to the list by encoding the characters in ASCII
        +
        +
        Parameters:
        +
        value - the String to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeStringISOLATIN1

        +
        public void writeStringISOLATIN1​(java.lang.String value)
        +                          throws java.lang.IllegalArgumentException
        +
        Write a string to the list by encoding the characters in ISO-LATIN1
        +
        +
        Parameters:
        +
        value - the String to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeStringUTF16BE

        +
        public void writeStringUTF16BE​(java.lang.String value)
        +                        throws java.lang.IllegalArgumentException
        +
        Write a string to the list by encoding the characters in UTF-16 Big Endian
        +
        +
        Parameters:
        +
        value - the String to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        writeStringUTF16LE

        +
        public void writeStringUTF16LE​(java.lang.String value)
        +                        throws java.lang.IllegalArgumentException
        +
        Write a string to the list by encoding the characters in UTF-16 Little Endian
        +
        +
        Parameters:
        +
        value - the String to be written
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readStringUTF8

        +
        public java.lang.String readStringUTF8()
        +                                throws java.lang.IllegalArgumentException
        +
        Read a String from the list, that was encoded using UTF-8
        +
        +
        Returns:
        +
        the read String
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readStringASCII

        +
        public java.lang.String readStringASCII()
        +                                 throws java.lang.IllegalArgumentException
        +
        Read a String from the list, that was encoded using ASCII
        +
        +
        Returns:
        +
        the read String
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readStringISOLATIN1

        +
        public java.lang.String readStringISOLATIN1()
        +                                     throws java.lang.IllegalArgumentException
        +
        Read a String from the list, that was encoded using ISO-LATIN1
        +
        +
        Returns:
        +
        the read String
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readStringUTF16BE

        +
        public java.lang.String readStringUTF16BE()
        +                                   throws java.lang.IllegalArgumentException
        +
        Read a String from the list, that was encoded using UTF-16 Big Endian
        +
        +
        Returns:
        +
        the read String
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        readStringUTF16LE

        +
        public java.lang.String readStringUTF16LE()
        +                                   throws java.lang.IllegalArgumentException
        +
        Read a String from the list, that was encoded using UTF-16 Little Endian
        +
        +
        Returns:
        +
        the read String
        +
        Throws:
        +
        java.lang.IllegalArgumentException
        +
        +
      • +
      + + + +
        +
      • +

        reset

        +
        public void reset()
        +
      • +
      + + + +
        +
      • +

        size

        +
        public int size()
        +
        Retrieve the Size of the internal storage list
        +
        +
        Returns:
        +
        size of the storage list
        +
        +
      • +
      + + + +
        +
      • +

        getStorageList

        +
        public java.util.List<java.lang.Byte> getStorageList()
        +
        Retrieve the internal list that is used to store the data
        +
        +
        Returns:
        +
        the internal storage list
        +
        +
      • +
      + + + +
        +
      • +

        toString

        +
        public java.lang.String toString()
        +
        +
        Overrides:
        +
        toString in class java.lang.Object
        +
        +
      • +
      + + + +
        +
      • +

        debug

        +
        public java.lang.String debug()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/deprecated-list.html sumo-1.6.0+dfsg1/docs/javadoc/traas/deprecated-list.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/deprecated-list.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/deprecated-list.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Deprecated List (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Deprecated API

+

Contents

+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/element-list sumo-1.6.0+dfsg1/docs/javadoc/traas/element-list --- sumo-1.5.0+dfsg1/docs/javadoc/traas/element-list 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/element-list 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,11 @@ +de.tudresden.sumo.cmd +de.tudresden.sumo.config +de.tudresden.sumo.subscription +de.tudresden.sumo.util +de.tudresden.ws +de.tudresden.ws.conf +de.tudresden.ws.container +de.tudresden.ws.log +de.uniluebeck.itm.tcpip +it.polito.appeal.traci +it.polito.appeal.traci.protocol diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/help-doc.html sumo-1.6.0+dfsg1/docs/javadoc/traas/help-doc.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/help-doc.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/help-doc.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,282 @@ + + + + + +API Help (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

How This API Document Is Organized

+
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.
+
+
+
    +
  • +
    +

    Overview

    +

    The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.

    +
    +
  • +
  • +
    +

    Package

    +

    Each package has a page that contains a list of its classes and interfaces, with a summary for each. These pages may contain six categories:

    +
      +
    • Interfaces
    • +
    • Classes
    • +
    • Enums
    • +
    • Exceptions
    • +
    • Errors
    • +
    • Annotation Types
    • +
    +
    +
  • +
  • +
    +

    Class or Interface

    +

    Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:

    +
      +
    • Class Inheritance Diagram
    • +
    • Direct Subclasses
    • +
    • All Known Subinterfaces
    • +
    • All Known Implementing Classes
    • +
    • Class or Interface Declaration
    • +
    • Class or Interface Description
    • +
    +
    +
      +
    • Nested Class Summary
    • +
    • Field Summary
    • +
    • Property Summary
    • +
    • Constructor Summary
    • +
    • Method Summary
    • +
    +
    +
      +
    • Field Detail
    • +
    • Property Detail
    • +
    • Constructor Detail
    • +
    • Method Detail
    • +
    +

    Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.

    +
    +
  • +
  • +
    +

    Annotation Type

    +

    Each annotation type has its own separate page with the following sections:

    +
      +
    • Annotation Type Declaration
    • +
    • Annotation Type Description
    • +
    • Required Element Summary
    • +
    • Optional Element Summary
    • +
    • Element Detail
    • +
    +
    +
  • +
  • +
    +

    Enum

    +

    Each enum has its own separate page with the following sections:

    +
      +
    • Enum Declaration
    • +
    • Enum Description
    • +
    • Enum Constant Summary
    • +
    • Enum Constant Detail
    • +
    +
    +
  • +
  • +
    +

    Use

    +

    Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its "Use" page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.

    +
    +
  • +
  • +
    +

    Tree (Class Hierarchy)

    +

    There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. Classes are organized by inheritance structure starting with java.lang.Object. Interfaces do not inherit from java.lang.Object.

    +
      +
    • When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
    • +
    • When viewing a particular package, class or interface page, clicking on "Tree" displays the hierarchy for only that package.
    • +
    +
    +
  • +
  • +
    +

    Deprecated API

    +

    The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.

    +
    +
  • +
  • +
    +

    Index

    +

    The Index contains an alphabetic index of all classes, interfaces, constructors, methods, and fields, as well as lists of all packages and all classes.

    +
    +
  • +
  • +
    +

    All Classes

    +

    The All Classes link shows all classes and interfaces except non-static nested types.

    +
    +
  • +
  • +
    +

    Serialized Form

    +

    Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.

    +
    +
  • +
  • +
    +

    Constant Field Values

    +

    The Constant Field Values page lists the static final fields and their values.

    +
    +
  • +
  • +
    +

    Search

    +

    You can search for definitions of modules, packages, types, fields, methods and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader".

    +
    +
  • +
+
+This help file applies to API documentation generated by the standard doclet.
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/index-all.html sumo-1.6.0+dfsg1/docs/javadoc/traas/index-all.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/index-all.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/index-all.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,4931 @@ + + + + + +Index (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
A B C D E F G H I J L M N O P Q R S T U V W X Y Z 
All Classes All Packages + + +

A

+
+
a - Variable in class de.tudresden.ws.container.SumoColor
+
 
+
adaptTraveltime(String, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Adapt the travel time value (in s) used for (re-)routing on the given + edge.
+
+
adaptTraveltime(String, double, double, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Adapt the travel time value (in s) used for (re-)routing on the given + edge.
+
+
add(int, SumoLink) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
add(int, String) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
add(SumoLink) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
add(SumoPosition2D) - Method in class de.tudresden.ws.container.SumoGeometry
+
 
+
add(SumoTLSPhase) - Method in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
add(String) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
add(String, double, double, double, String) - Method in class de.tudresden.ws.container.SumoVehicleData
+
 
+
add(String, double, double, int, int, LinkedList<String>) - Method in class de.tudresden.ws.container.SumoBestLanes
+
 
+
add(String, double, double, SumoColor, String, int) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Add a new point-of-interest.
+
+
add(String, int, double, String) - Method in class de.tudresden.ws.container.SumoNextTLS
+
 
+
add(String, SumoGeometry, SumoColor, boolean, String, int) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Add a new polygon.
+
+
add(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Route
+
+
Add a new route.
+
+
add(String, String, double, double, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Inserts a new person to the simulation at the given edge, position and + time (in s).
+
+
add(String, String, String, int, double, double, byte) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Add a new vehicle.
+
+
ADD - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ADD_FULL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
addAll(int, Collection<? extends SumoLink>) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
addAll(int, Collection<? extends String>) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
addAll(Collection<? extends SumoLink>) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
addAll(Collection<? extends String>) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
addCommand(int) - Method in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
addCommand(int) - Method in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
addFull(String, String, String, String, String, String, String, String, String, String, String, String, String, int, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Add a new vehicle.
+
+
addObserver(Observer) - Method in class de.tudresden.sumo.util.Observable
+
 
+
addObserver(Observer) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
addOption(String, String) - Method in interface de.tudresden.ws.Service
+
 
+
addOption(String, String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
addOption(String, String) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
+
Adds a custom option to the SUMO command line before executing it.
+
+
addParam(String, String) - Method in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
addProgram(SumoTLSProgram) - Method in class de.tudresden.ws.container.SumoTLSController
+
 
+
allowsContinuation - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
append(Command) - Method in class it.polito.appeal.traci.protocol.RequestMessage
+
+
Adds a command to the tail of this message.
+
+
APPEND_STAGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
appendDrivingStage(String, String, String, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Appends a driving stage to the plan of the given person + The lines parameter should be a space-separated list of line ids
+
+
appendWaitingStage(String, double, String, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Appends a waiting stage with duration in s to the plan of the given person
+
+
appendWalkingStage(String, SumoStringList, double, double, double, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Appends a walking stage to the plan of the given person + The walking speed can either be specified, computed from the duration parameter (in s) or taken from the type of the person
+
+
areal_detector - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
areal_detector - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
AREAL_DETECTOR_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
AREAL_DETECTOR_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
ARRIVALFLAG_LANE_CURRENT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ARRIVALFLAG_POS_MAX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ARRIVALFLAG_POS_RANDOM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ARRIVALFLAG_SPEED_CURRENT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
arrivalPos - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
AUTOMATIC_CONTEXT_SUBSCRIPTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
AUTOMATIC_VARIABLES_SUBSCRIPTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
+ + + +

B

+
+
b - Variable in class de.tudresden.ws.container.SumoColor
+
 
+
+ + + +

C

+
+
changeLane(String, byte, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Forces a lane change to the lane with the given index; if successful, the lane will be chosen for the given amount of time.
+
+
changeSublane(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Forces a lateral change by the given amount (negative values indicate changing to the right, positive to the left) + This will override any other lane change motivations but conform to + safety-constraints as configured by laneChangeMode.
+
+
changeTarget(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
The vehicle's destination edge is set to the given.
+
+
clear() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
clear() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
clearPending(String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Clear pending
+
+
close() - Method in class it.polito.appeal.traci.SumoTraciConnection
+
+
Closes the connection, quits the simulator, frees any stale + resource and makes all Vehicle instances inactive.
+
+
CloseQuery - Class in it.polito.appeal.traci
+
 
+
CloseQuery(Socket) - Constructor for class it.polito.appeal.traci.CloseQuery
+
 
+
CMD_ADD_SUBSCRIPTION_FILTER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_CHANGELANE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_CHANGESUBLANE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_CHANGETARGET - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_CLEAR_PENDING_VEHICLES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_CLOSE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_BUSSTOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_CALIBRATOR_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_CHARGINGSTATION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_EDGE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_GUI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_INDUCTIONLOOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_JUNCTION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_LANE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_LANEAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_MEANDATA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_MULTIENTRYEXIT_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_OVERHEADWIRE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_PARKINGAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_PERSON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_POI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_POLYGON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_REROUTER_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_ROUTE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_ROUTEPROBE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_SIM_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_TL_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_VARIABLESPEEDSIGN_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_VEHICLE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GET_VEHICLETYPE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_GETVERSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_LOAD - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_MESSAGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_OPENGAP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_REROUTE_EFFORT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_REROUTE_TO_PARKING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_REROUTE_TRAVELTIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_RESUME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SAVE_SIMSTATE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_BUSSTOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_CALIBRATOR_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_CHARGINGSTATION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_EDGE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_FLOW - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_GUI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_JUNCTION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_LANE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_OVERHEADWIRE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_PARKINGAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_PERSON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_POI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_POLYGON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_REROUTER_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_ROUTE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_ROUTEPROBE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_SIM_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_TL_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_VARIABLESPEEDSIGN_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_VEHICLE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SET_VEHICLETYPE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SETORDER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SIMSTEP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SLOWDOWN - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_STOP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_BUSSTOP_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_BUSSTOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_CALIBRATOR_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_CALIBRATOR_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_EDGE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_EDGE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_GUI_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_GUI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_JUNCTION_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_JUNCTION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_LANE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_LANE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_LANEAREA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_LANEAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_MEANDATA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_MEANDATA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_PARKINGAREA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_PARKINGAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_PERSON_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_PERSON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_POI_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_POI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_POLYGON_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_POLYGON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_REROUTER_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_REROUTER_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_ROUTE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_ROUTE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_SIM_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_SIM_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_TL_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_TL_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VEHICLE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VEHICLE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
Command - Class in it.polito.appeal.traci.protocol
+
+
Represents a single TraCI command, with its identifier and content.
+
+
Command(int) - Constructor for class it.polito.appeal.traci.protocol.Command
+
+
Creates a command with a given identifier and an empty content.
+
+
Command(Storage) - Constructor for class it.polito.appeal.traci.protocol.Command
+
+
Builds a command from a Storage received from the other endpoint.
+
+
CommandProcessor - Class in de.tudresden.sumo.util
+
 
+
CommandProcessor(Socket) - Constructor for class de.tudresden.sumo.util.CommandProcessor
+
 
+
commands - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
commands - Variable in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
commands() - Method in class it.polito.appeal.traci.protocol.RequestMessage
+
 
+
Config - Class in de.tudresden.ws.conf
+
 
+
Config() - Constructor for class de.tudresden.ws.conf.Config
+
 
+
config_file - Static variable in class de.tudresden.ws.conf.Config
+
 
+
conn - Variable in class de.tudresden.sumo.util.Sumo
+
 
+
Constants - Class in de.tudresden.sumo.config
+
 
+
Constants() - Constructor for class de.tudresden.sumo.config.Constants
+
 
+
containerTriggered - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
contains(Object) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
contains(Object) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
containsAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
containsAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
content() - Method in class it.polito.appeal.traci.protocol.Command
+
+
Returns the content.
+
+
context - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
contextDomain - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
contextRange - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
ContextSubscription - Class in de.tudresden.sumo.subscription
+
 
+
ContextSubscription() - Constructor for class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
ContextSubscription(SubscriptionContext, double, double, String, SumoDomain, double) - Constructor for class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
convert2D(String, double, byte, String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
convert2D
+
+
convert3D(String, double, byte, String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
convert3D
+
+
convertGeo(double, double, boolean) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
convertGeo
+
+
ConvertHelper - Class in de.tudresden.sumo.util
+
 
+
ConvertHelper(Log) - Constructor for class de.tudresden.sumo.util.ConvertHelper
+
 
+
convertRoad(double, double, boolean, String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
convertRoad
+
+
coords - Variable in class de.tudresden.ws.container.SumoGeometry
+
 
+
COPY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
cost - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
currentPhaseIndex - Variable in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
+ + + +

D

+
+
de.tudresden.sumo.cmd - package de.tudresden.sumo.cmd
+
 
+
de.tudresden.sumo.config - package de.tudresden.sumo.config
+
 
+
de.tudresden.sumo.subscription - package de.tudresden.sumo.subscription
+
 
+
de.tudresden.sumo.util - package de.tudresden.sumo.util
+
 
+
de.tudresden.ws - package de.tudresden.ws
+
 
+
de.tudresden.ws.conf - package de.tudresden.ws.conf
+
 
+
de.tudresden.ws.container - package de.tudresden.ws.container
+
 
+
de.tudresden.ws.log - package de.tudresden.ws.log
+
 
+
de.uniluebeck.itm.tcpip - package de.uniluebeck.itm.tcpip
+
 
+
debug() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
depart - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
DEPARTFLAG_CONTAINER_TRIGGERED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_LANE_ALLOWED_FREE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_LANE_BEST_FREE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_LANE_FIRST_ALLOWED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_LANE_FREE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_LANE_RANDOM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_NOW - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_POS_BASE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_POS_FREE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_POS_LAST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_POS_RANDOM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_POS_RANDOM_FREE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_SPEED_MAX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_SPEED_RANDOM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
DEPARTFLAG_TRIGGERED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
departPos - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
description - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
description() - Method in class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
destStop - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
df - Variable in class de.tudresden.ws.conf.Config
+
 
+
direction - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
dist - Variable in class de.tudresden.ws.container.SumoLeader
+
 
+
DISTANCE_REQUEST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
do_close() - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_job_get(SumoCommand) - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_job_get(SumoCommand) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
do_job_set(SumoCommand) - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_job_set(SumoCommand) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
do_setOrder(int) - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_SimulationStep(double) - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_subscription(Subscription) - Method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
do_subscription(Subscription) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
do_timestep() - Method in class de.tudresden.sumo.util.Sumo
+
 
+
do_timestep() - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
do_timestep(double) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
doClose() - Method in class de.tudresden.sumo.util.Query
+
+
Disconnect client from the sumo server
+
+
doCommand() - Method in class it.polito.appeal.traci.CloseQuery
+
 
+
domain - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
doQuery(RequestMessage) - Method in class de.tudresden.sumo.util.Query
+
+
Sends a request message to SUMO and returns a response message.
+
+
doQuerySingle(Command) - Method in class de.tudresden.sumo.util.Query
+
+
Like Query.doQuery(RequestMessage), but good for one-command/ + one-response queries.
+
+
doSetOrder(int) - Method in class de.tudresden.sumo.util.Query
+
+
Set multi-client ordering index
+
+
doSimulationStep(double) - Method in class de.tudresden.sumo.util.Query
+
+
Do next time step and update subscription results
+
+
doTimestep() - Method in interface de.tudresden.ws.Service
+
 
+
doTimestep() - Method in class de.tudresden.ws.ServiceImpl
+
 
+
duration - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
+ + + +

E

+
+
edge - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
edge - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Edge - Class in de.tudresden.sumo.cmd
+
 
+
Edge() - Constructor for class de.tudresden.sumo.cmd.Edge
+
 
+
Edge_adaptTraveltime(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
EDGE_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Edge_getAdaptedTraveltime(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getCO2Emission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getCOEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getEffort(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getElectricityConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getFuelConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getHCEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepHaltingNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepMeanSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepOccupancy(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepVehicleIDs(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getLastStepVehicleNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getNoiseEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getNOxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getPMxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getTraveltime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_getWaitingTime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_setEffort(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Edge_setMaxSpeed(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
EDGE_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
edgeID - Variable in class de.tudresden.ws.container.SumoRoadPosition
+
 
+
edges - de.tudresden.sumo.subscription.SumoDomain
+
 
+
edges - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
entry_time - Variable in class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
+ + + +

F

+
+
FILTER_TYPE_DOWNSTREAM_DIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_FIELD_OF_VISION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_LANES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_LATERAL_DIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_LEAD_FOLLOW - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_NONE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_NOOPPOSITE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_TURN - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_UPSTREAM_DIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_VCLASS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FILTER_TYPE_VTYPE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FIND_INTERMODAL_ROUTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
FIND_ROUTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
findIntermodalRoute(String, String, String, double, int, double, double, double, double, double, String, String, String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
findIntermodalRoute
+
+
findRoute(String, String, String, double, int) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
findRoute
+
+
fireAndForget(Command) - Method in class de.tudresden.sumo.util.Query
+
+
fireAndForget function
+
+
from - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
fromString(String) - Method in class de.tudresden.ws.container.SumoGeometry
+
 
+
+ + + +

G

+
+
g - Variable in class de.tudresden.ws.container.SumoColor
+
 
+
GENERIC_ATTRIBUTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
get(int) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
get(int) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
get(String) - Method in class de.tudresden.ws.container.SumoTLSController
+
 
+
get_actiontime() - Method in class de.tudresden.ws.conf.Config
+
 
+
get_cmd(SumoCommand) - Method in class de.tudresden.sumo.util.Sumo
+
 
+
get_command() - Method in class de.tudresden.sumo.util.SumoCommand
+
 
+
get_raw() - Method in class de.tudresden.sumo.util.SumoCommand
+
 
+
get_Status(String) - Method in interface de.tudresden.ws.Service
+
 
+
get_Status(String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
get_url() - Method in class de.tudresden.ws.conf.Config
+
 
+
getAccel(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the acceleration of the named vehicle within the last step.
+
+
getAccel(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the maximum acceleration of the named vehicle class.
+
+
getAccumulatedWaitingTime(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the vehicle class.
+
+
getActionStepLength(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the action step length for this vehicle.
+
+
getAdaptedTraveltime(String, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the travel time value (in s) used for (re-)routing.
+
+
getAdaptedTraveltime(String, double, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the edge travel time for the given time as stored in the vehicle's internal container.
+
+
getAllowed(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns a list of allowed vehicle classes.
+
+
getAllowedSpeed(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
+
+
getAngle(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get angle
+
+
getAngle(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the angle of the named vehicle within the last time step.
+
+
getApparentDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the apparent deceleration in m/s^2 of this vehicle.
+
+
getApparentDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns The preferred lateral alignment of the type
+
+
getArrivedIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns a list of IDs of vehicles which arrived in this time step.
+
+
getArrivedNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the number of vehicles which arrived in this time step.
+
+
getBestLanes(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getBestLanes
+
+
getBoundary(String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Returns the coordinates of the lower left and the upper right corner of + the currently visible view.
+
+
getBoundingBox(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getBusStopWaiting() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the current waiting time on bus stops(in ms).
+
+
getByte(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getCO2Emission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the CO2 emissions (in mg) on the given edge during the last time + step.
+
+
getCO2Emission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the CO2 emissions (in mg) on the given lane during the last time + step.
+
+
getCO2Emission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the CO2 emission in mg for the last time step.
+
+
getCOEmission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the CO emissions (in mg) on the given edge during the last time + step.
+
+
getCOEmission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the CO emissions (in mg) on the given lane during the last time + step.
+
+
getCOEmission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the CO emission in mg for the last time step.
+
+
getCollidingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getCollidingVehiclesNumber()
+
+
getCollidingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getCollidingVehiclesNumber()
+
+
getColor(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getColor(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get lane position
+
+
getColor(String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns the color of this poi.
+
+
getColor(String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the color of this polygon.
+
+
getColor(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the vehicle's color (RGBA).
+
+
getColor(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the vehicle type's color.
+
+
getCommand() - Method in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
getCommand() - Method in interface de.tudresden.sumo.subscription.Subscription
+
 
+
getCommand() - Method in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
getCompleteRedYellowGreenDefinition(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the complete traffic light program.
+
+
getControlledJunctions(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the junctions controlled by the traffic light
+
+
getControlledLanes(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the list of lanes which are controlled by the named traffic light.
+
+
getControlledLinks(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the links controlled by the traffic light, sorted by the signal index and described by giving the incoming, outgoing, and via lane.
+
+
getCurrentTime() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getCurrentTime
+
+
getDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the deceleration of the named vehicle within the last time step.
+
+
getDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the maximum deceleration of the names vehicle type.
+
+
getDeltaT() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getDeltaT
+
+
getDepartedIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns a list of IDs of vehicles which departed in this time step.
+
+
getDepartedNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the number of vehicles which departed in this time step.
+
+
getDisallowed(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns a list of disallowed vehicle classes.
+
+
getDistance(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Get the distance to the starting point acts as a odometer
+
+
getDistance2D(double, double, double, double, boolean, boolean) - Static method in class de.tudresden.sumo.cmd.Simulation
+
 
+
getDistanceRoad(String, double, String, double, boolean) - Static method in class de.tudresden.sumo.cmd.Simulation
+
 
+
getDouble(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getDrivingDistance(String, String, double, byte) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the driving distance (in m) of the named vehicle within the last tine step.
+
+
getDrivingDistance2D(String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getDrivingDistance2D
+
+
getEdgeID(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the ID of the edge this lane belongs to.
+
+
getEdges(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get edges
+
+
getEdges(String) - Static method in class de.tudresden.sumo.cmd.Route
+
+
Returns the IDs of the edges this route covers.
+
+
getEdges(String, int) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get edges
+
+
getEffort(String, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the effort value used for (re-)routing.
+
+
getEffort(String, double, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the edge effort for the given time as stored in the vehicle's internal container.
+
+
getElectricityConsumption(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the electricity consumption in ml for the last time step.
+
+
getElectricityConsumption(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the electricity consumption in ml for the last time step.
+
+
getElectricityConsumption(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the electricity consumption in ml for the last time step.
+
+
getEmergencyDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
+
+
getEmergencyDecel(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the maximal physically possible deceleration in m/s^2 of vehicles of this type.
+
+
getEmergencyStoppingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getEmergencyStoppingVehiclesIDList()
+
+
getEmergencyStoppingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getEmergencyStoppingVehiclesNumber()
+
+
getEmissionClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the emission class of the named vehicle.
+
+
getEmissionClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the emission class of the named vehicle type.
+
+
getEndingTeleportIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns a list of IDs of vehicles which ended to be teleported in this time step.
+
+
getEndingTeleportNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the number of vehicles which ended to be teleported in this time step.
+
+
getExternalState(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the external state
+
+
getFilled(String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the shape of this polygon.
+
+
getFoes(String, String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the ids of incoming lanes that have right of way over the connection from laneID to toLaneID
+
+
getFuelConsumption(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the fuel consumption (in ml) on the given edge during the last + time step.
+
+
getFuelConsumption(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the fuel consumption (in ml) on the given lane during the last + time step.
+
+
getFuelConsumption(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the fuel consumption in ml for the last time step.
+
+
getHCEmission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the HC emissions (in mg) on the given edge during the last time + step.
+
+
getHCEmission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the HC emissions (in mg) on the given lane during the last time + step.
+
+
getHCEmission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the HC emission (in mg) during the last time step.
+
+
getHeight(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the height in m of this vehicle.
+
+
getHeight(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the height in m of vehicles of this type.
+
+
getID() - Method in enum de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
getID() - Method in enum de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
getID() - Method in enum de.tudresden.sumo.subscription.SumoDomain
+
 
+
getID() - Method in class de.tudresden.ws.container.SumoStopFlags
+
 
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the number of edges in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the number of all induction loops in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Junction
+
+
Returns the number of all junctions in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the number of all lanes in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
Returns the number of the areal detectors in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns the number of all multi-entry/multi-exit detectors in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Person
+
+
Returns the number of all persons in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns the number of all Poi's in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the number of all Polygons in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Route
+
+
Returns the number of all Routes in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the number of all traffic lights in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the number of all vehicles in the network.
+
+
getIDCount() - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the number of all vehicle types in the network.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns a list of all edges in the network.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Returns the list of available views (open windows).
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns a list of IDs of all induction loops within the scenario.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Junction
+
+
Returns a list of IDs of all junctions within the scenario.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns a list of IDs of all lanes in the network.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
Returns a list of all areal detectors in the network.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns a list of IDs of all multi-entry/multi-exit detectors within the + scenario.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Person
+
+
Returns a list of personIDs of all persons
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns a list of IDs of all poi.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns a list of IDs of all polygons.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Route
+
+
Returns a list of IDs of all currently loaded routes.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns a list of IDs of all traffic lights within the scenario.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns a list of ids of all vehicles currently running within the scenario.
+
+
getIDList() - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns a list of all known vehicle types.
+
+
getImperfection(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getImperfection
+
+
getImperfection(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
getImperfection
+
+
getInt(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getInternalFoes(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the ids of internal lanes that are in conflict with the given internal lane id
+
+
getJamLengthMeters(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getJamLengthMeters
+
+
getJamLengthVehicle(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getJamLengthVehicle
+
+
getLaneChangeMode(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Gets the vehicle's lane change mode as a bitset.
+
+
getLaneChangeState(String, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
+
+
getLaneID(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the ID of the lane the loop is placed at.
+
+
getLaneID(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getLaneID
+
+
getLaneID(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the id of the lane the named vehicle was at within the last step.
+
+
getLaneIndex(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the index of the lane the named vehicle was at within the last step.
+
+
getLaneLinks(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getLaneNumber(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
 
+
getLanePosition(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get lane position
+
+
getLanePosition(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the position of the vehicle along the lane (in m).
+
+
getLastActionTime(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the time of last action point for this vehicle.
+
+
getLastStepHaltingNumber(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the total number of halting vehicles on the given edge within the + last time step.
+
+
getLastStepHaltingNumber(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the total number of halting vehicles on the given lane within the + last time step.
+
+
getLastStepHaltingNumber(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
Returns the number of vehicles which were halting during the last time step.
+
+
getLastStepHaltingNumber(String) - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns the number of vehicles which were halting during the last time + step.
+
+
getLastStepLength(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the total vehicle length (in m) on the given edge within the last + time step.
+
+
getLastStepLength(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the total vehicle length (in m) on the given lane during the last + time step.
+
+
getLastStepMeanLength(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the mean length of vehicles (in m) which were on the detector in + the last step.
+
+
getLastStepMeanSpeed(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
+
+
getLastStepMeanSpeed(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the mean speed of vehicles (in m/s) that were on the named + induction loop within the last simulation step.
+
+
getLastStepMeanSpeed(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the mean speed (in m/s) on the given lane within the last time + step.
+
+
getLastStepMeanSpeed(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getLastStepMeanSpeed
+
+
getLastStepMeanSpeed(String) - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns the mean speed of vehicles (in m/s) that have been within the + named multi-entry/multi-exit detector within the last simulation step.
+
+
getLastStepOccupancy(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the percentage of time (in %) the detector was occupied by a + vehicle.
+
+
getLastStepOccupancy(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the percentage of time (in %) the detector was occupied by a + vehicle within the last time step.
+
+
getLastStepOccupancy(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the occupancy (in %) on the given lane during the last time step.
+
+
getLastStepOccupancy(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getLastStepOccupancy
+
+
getLastStepPersonIDs(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the ids of the persons on the given edge during the last time step.
+
+
getLastStepVehicleIDs(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the list of IDs of the vehicles on the given edge within the last + simulation step.
+
+
getLastStepVehicleIDs(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the list of IDs of vehicles that were on the named induction loop + in the last simulation step.
+
+
getLastStepVehicleIDs(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the IDs of the vehicles on the given lane within the last time + step.
+
+
getLastStepVehicleIDs(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
Returns the list of ids of vehicles that were on the named detector in the last simulation step.
+
+
getLastStepVehicleIDs(String) - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns the list of IDs of vehicles that have been within the named + multi-entry/multi-exit detector in the last simulation step.
+
+
getLastStepVehicleNumber(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the total number of vehicles on this edge within the last time + step.
+
+
getLastStepVehicleNumber(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the number of vehicles that were on the named induction loop + within the last simulation step.
+
+
getLastStepVehicleNumber(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns number of vehicles on this lane within the last time step.
+
+
getLastStepVehicleNumber(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
Returns the number of vehicles on the detector
+
+
getLastStepVehicleNumber(String) - Static method in class de.tudresden.sumo.cmd.Multientryexit
+
+
Returns the number of vehicles that have been within the named + multi-entry/multi-exit detector within the last simulation step.
+
+
getLateralAlignment(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns The preferred lateral alignment of the vehicle
+
+
getLateralAlignment(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns The preferred lateral alignment of the type
+
+
getLateralLanePosition(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns The lateral position of the vehicle on its current lane measured in m.
+
+
getLeader(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Return the leading vehicle id together with the distance.
+
+
getLength(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the length (in m) of the named lane.
+
+
getLength(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getlength
+
+
getLength(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get length
+
+
getLength(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the length (in m) of the named vehicle.
+
+
getLength(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the length of the named vehicle type.
+
+
getLine(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the length (in m) of the named vehicle.
+
+
getLinkNumber(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the number of links outgoing from this lane.
+
+
getLinks(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns descriptions of the links (in m) outgoing from this lane.
+
+
getLoadedIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns a list of IDs of vehicles which were loaded in this time step.
+
+
getLoadedNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Return the number of vehicles which were loaded in this time step
+
+
getMaxSpeed(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the maximum speed (in m/s) allowed on this lane.
+
+
getMaxSpeed(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the maximum speed(in m/s) of the named vehicle.
+
+
getMaxSpeed(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Return the maximum speed of the named vehicle type.
+
+
getMaxSpeedLat(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the maximum lateral speed in m/s of this vehicle.
+
+
getMaxSpeedLat(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the maximum lateral speed in m/s of this type.
+
+
getMinExpectedNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the number of vehicles which are in the net plus the ones still waiting to start.
+
+
getMinGap(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get minGap
+
+
getMinGap(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the minimum gap (in m) between this vehicle and the vehicle before it.
+
+
getMinGap(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the minimum headway gap of the named vehicle type.
+
+
getMinGapLat(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns The desired lateral gap of this vehicle at 50km/h in m
+
+
getMinGapLat(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns The desired lateral gap of this type at 50km/h in m
+
+
getNetBoundary() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the boundary box of the simulation network.
+
+
getNextEdge(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get next edge
+
+
getNextStops(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...]
+
+
getNextSwitch(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the assumed time (in ms) at which the TLS changes the phase.
+
+
getNextTLS(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
+
+
getNoiseEmission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the noise emissions (in db)on the given edge within the last time + step.
+
+
getNoiseEmission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the noise emissions (in db) on the given lane during the last + time step.
+
+
getNoiseEmission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the noise emission (in db) generated by the vehicle during the last time step.
+
+
getNOxEmission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the NOx emissions (in mg) on the given edge during the last time + step.
+
+
getNOxEmission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the NOx emissions (in mg) on the given lane during the last time + step.
+
+
getNOxEmission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the NOx emissions (in mg) generated by the vehicle during the last time step.
+
+
getOffset(String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Returns the x and y offset of the center of the current view.
+
+
getOutStream() - Method in class de.tudresden.sumo.util.Query
+
 
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Route
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the chosen parameter
+
+
getParameter(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the chosen parameter
+
+
getParkingEndingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getParkingEndingVehiclesIDList()
+
+
getParkingEndingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getParkingEndingVehiclesNumber()
+
+
getParkingStartingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getParkingStartingVehiclesIDList()
+
+
getParkingStartingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getParkingStartingVehiclesNumber()
+
+
getPersonIDList(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the list of persons which includes those defined using attribute 'personNumber' + as well as -objects which are riding in this vehicle.
+
+
getPersonNumber(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get person number
+
+
getPersonNumber(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getPersonNumber
+
+
getPhase(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the index of the current phase in the current program.
+
+
getPhaseDuration(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
getPhaseDuration
+
+
getPhaseName(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the name of the current phase in the current program.
+
+
getPMxEmission(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the particular matter emissions (in mg) on the given edge on this + edge during the last time step.
+
+
getPMxEmission(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the particular matter emissions (in mg) on the given lane during + the last time step.
+
+
getPMxEmission(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the particular matter emissions (in mg) generated by the vehicle during the last time step.
+
+
getPolygon(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getPos() - Method in enum de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Returns the position (in m) of the induction loop at it's lane, counted + from the lane's begin.
+
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Junction
+
+
Returns the position of the named junction.
+
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Lanearea
+
+
getPosition
+
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get position
+
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns the position of this poi.
+
+
getPosition(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the position of the named vehicle within the last step [m,m].
+
+
getPosition2D(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getPosition3D(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getPosition3D(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get position3D
+
+
getPosition3D(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the position of the named vehicle within the last step [m,m,m].
+
+
getProgram(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the id of the current program.
+
+
getRedYellowGreenState(String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Returns the named tl's state as a tuple of light definitions from rRgGyYoO, for red, green, yellow, off, where lower case letters mean that the stream has to decelerate.
+
+
getRemainingStages(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get remaining stages
+
+
getResponse() - Method in class it.polito.appeal.traci.protocol.ResponseContainer
+
 
+
getRoadID(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get road ID
+
+
getRoadID(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the id of the edge the named vehicle was at within the last step.
+
+
getRoadPosition(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getRoute(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the ids of the edges the vehicle's route is made of.
+
+
getRouteID(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the id of the route of the named vehicle.
+
+
getRouteIndex(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the index of the current edge within the vehicles route or -1 if the vehicle has not yet departed
+
+
getRoutingMode(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
returns the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
+
+
getSchema(String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Returns the name of the current coloring scheme.
+
+
getShape(String) - Static method in class de.tudresden.sumo.cmd.Junction
+
+
getShape
+
+
getShape(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns this lane's shape.
+
+
getShape(String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the shape of this polygon.
+
+
getShapeClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getShapeClass
+
+
getShapeClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
getShapeClass
+
+
getSignals(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getSignals
+
+
getSlope(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getSlope
+
+
getSpeed(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get speed
+
+
getSpeed(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the speed (in m/s) of the named vehicle within the last step.
+
+
getSpeedDeviation(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the standard deviation of the estimated maximum speed (see speed factor) divided by this speed.
+
+
getSpeedDeviation(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the speed deviation of the named vehicle type.
+
+
getSpeedFactor(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
+
+
getSpeedFactor(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Return the speed factor of the names vehicle type.
+
+
getSpeedMode(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the speed mode of a vehicle
+
+
getSpeedWithoutTraCI(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getSpeedWithoutTraCI
+
+
getStage(String, int) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get stage
+
+
getStartingTeleportIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns a list of IDs of vehicles which started to teleport in this time step.
+
+
getStartingTeleportNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
Returns the number of vehicles which started to teleport in this time step.
+
+
getState(SumoVehicleSignalState) - Method in class de.tudresden.ws.container.SumoVehicleSignal
+
 
+
getStatus() - Method in class it.polito.appeal.traci.protocol.ResponseContainer
+
+
Returns the status response
+
+
getStopEndingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getStopEndingVehiclesIDList()
+
+
getStopEndingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getStopEndingVehiclesNumber()
+
+
getStopStartingVehiclesIDList() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getStopStartingVehiclesIDList()
+
+
getStopStartingVehiclesNumber() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getStopStartingVehiclesIDList()
+
+
getStopState(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns information in regard to stopping: The returned integer is defined as 1 * stopped + 2 * parking + 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop + 32 * isContainerStop with each of these flags defined as 0 or 1
+
+
getStorageList() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Retrieve the internal list that is used to store the data
+
+
getString(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getStringList(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getSubResponses() - Method in class it.polito.appeal.traci.protocol.ResponseContainer
+
 
+
getTau(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
getTau
+
+
getTau(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
getTau
+
+
getTime() - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
getTime
+
+
getTimeSinceDetection(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
Return the time (in s) since last detection.
+
+
getTLSProgram(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getTraveltime(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the estimated travel time (in s) on the given edge on this edge + within the last time step.
+
+
getTraveltime(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the estimated travel time (in s) on the given lane during the + last time step.
+
+
getType(int) - Static method in enum de.tudresden.sumo.subscription.ResponseType
+
 
+
getType(String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Returns the type of the poi.
+
+
getType(String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Returns the type of the polygon.
+
+
getTypeID(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get type ID
+
+
getTypeID(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the id of the type of the named vehicle.
+
+
getVehicle(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get vehicle
+
+
getVehicleClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the vehicle class.
+
+
getVehicleClass(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the vehicle class of the names vehicle type.
+
+
getVehicleData(Object) - Method in class de.tudresden.sumo.util.ConvertHelper
+
 
+
getVehicleData(String) - Static method in class de.tudresden.sumo.cmd.Inductionloop
+
+
A complex structure containing several information about vehicles which + passed the detector.
+
+
getVia(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the ids of via edges for this vehicle
+
+
getWaitingTime(String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Returns the waiting time (in s) on the given edge on this edge + within the last time step.
+
+
getWaitingTime(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
getWaitingTime
+
+
getWaitingTime(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get waiting time
+
+
getWaitingTime(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
The waiting time of a vehicle is defined as the time (in seconds) spent with a speed below 0.1m/s since the last time it was faster than 0.1m/s.
+
+
getWidth(String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Returns the width (in m) of the named lane.
+
+
getWidth(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
get width
+
+
getWidth(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns the vehicle's width (in m).
+
+
getWidth(String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Returns the width of the named vehicle type.
+
+
getZoom(String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Returns the current zoom factor.
+
+
gui - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
gui - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Gui - Class in de.tudresden.sumo.cmd
+
 
+
Gui() - Constructor for class de.tudresden.sumo.cmd.Gui
+
 
+
GUI_clearPending(String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
GUI_getBoundary(String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
GUI_getOffset(String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_getSchema(String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_getZoom(String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_screenshot(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_setBoundary(String, double, double, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_setOffset(String, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_setSchema(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_setZoom(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_trackVehicle(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
GUI_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
+ + + +

H

+
+
hasApproachingFoe - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
hasPriority - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
host - Static variable in class de.tudresden.ws.conf.Config
+
 
+
+ + + +

I

+
+
id - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
id() - Method in class it.polito.appeal.traci.protocol.Command
+
+
Returns the type identifier.
+
+
id() - Method in class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
ID_COUNT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
indexOf(Object) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
indexOf(Object) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
Inductionloop - Class in de.tudresden.sumo.cmd
+
 
+
Inductionloop() - Constructor for class de.tudresden.sumo.cmd.Inductionloop
+
 
+
INDUCTIONLOOP_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Inductionloop_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLaneID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLastStepMeanLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLastStepMeanSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLastStepOccupancy(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLastStepVehicleIDs(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getLastStepVehicleNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getPosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getTimeSinceDetection(String) - Method in class de.tudresden.ws.Traci
+
 
+
Inductionloop_getVehicleData(String) - Method in class de.tudresden.ws.Traci
+
 
+
INDUCTIONLOOP_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
inductive_loop - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
inductive_loop - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
inductive_loops - de.tudresden.sumo.subscription.SumoDomain
+
 
+
init(Sumo, Log, ConvertHelper) - Method in class de.tudresden.ws.Traci
+
 
+
input1 - Variable in class de.tudresden.sumo.util.SumoCommand
+
 
+
input2 - Variable in class de.tudresden.sumo.util.SumoCommand
+
 
+
intended - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
internalLane - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
INVALID_DOUBLE_VALUE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
INVALID_INT_VALUE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
isAtBusStop(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
isAtBusStop
+
+
isAtContainerStop(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Return whether the vehicle is stopped at a container stop
+
+
isBusStop - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
isChargingStationStop - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
isClosed() - Method in class it.polito.appeal.traci.SumoTraciConnection
+
+
Returns true if the connection was closed by the user, or if + an IOException was thrown after the connection was made.
+
+
isContainerStop - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
isContext() - Method in enum de.tudresden.sumo.subscription.ResponseType
+
 
+
isEmpty() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
isEmpty() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
isOpen - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
isParkingAreaStop - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
isRouteValid(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Returns whether the Route is valid.
+
+
isshutdown() - Method in class de.tudresden.ws.ShutdownHook
+
 
+
isStopped(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
isStopped
+
+
isStoppedParking(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
isStoppedParking
+
+
isStoppedTriggered(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Return whether the vehicle is stopped and waiting for a person or container
+
+
isValid() - Method in class de.tudresden.ws.container.SumoLeader
+
 
+
isVariable() - Method in enum de.tudresden.sumo.subscription.ResponseType
+
 
+
it.polito.appeal.traci - package it.polito.appeal.traci
+
 
+
it.polito.appeal.traci.protocol - package it.polito.appeal.traci.protocol
+
 
+
iterator() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
iterator() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
+ + + +

J

+
+
JAM_LENGTH_METERS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
JAM_LENGTH_VEHICLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
junction - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
junction - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
junction - de.tudresden.sumo.subscription.SumoDomain
+
 
+
Junction - Class in de.tudresden.sumo.cmd
+
 
+
Junction() - Constructor for class de.tudresden.sumo.cmd.Junction
+
 
+
JUNCTION_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Junction_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Junction_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Junction_getPosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Junction_getShape(String) - Method in class de.tudresden.ws.Traci
+
 
+
JUNCTION_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
+ + + +

L

+
+
lane - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
lane - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Lane - Class in de.tudresden.sumo.cmd
+
 
+
Lane() - Constructor for class de.tudresden.sumo.cmd.Lane
+
 
+
LANE_ALLOWED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LANE_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
LANE_DISALLOWED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LANE_EDGE_ID - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
Lane_getAllowed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getCO2Emission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getCOEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getDisallowed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getEdgeID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getElectricityConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getFuelConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getHCEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepHaltingNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepMeanSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepOccupancy(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepVehicleIDs(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLastStepVehicleNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLinkNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getLinks(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getMaxSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getNoiseEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getNOxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getPMxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getShape(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getTraveltime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getWaitingTime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_getWidth(String) - Method in class de.tudresden.ws.Traci
+
 
+
LANE_LINK_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LANE_LINKS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
Lane_setAllowed(String, SumoStringList) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_setDisallowed(String, SumoStringList) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_setLength(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Lane_setMaxSpeed(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
LANE_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
Lanearea - Class in de.tudresden.sumo.cmd
+
 
+
Lanearea() - Constructor for class de.tudresden.sumo.cmd.Lanearea
+
 
+
Lanearea_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Lanearea_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Lanearea_getJamLengthMeters(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lanearea_getJamLengthVehicle(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lanearea_getLastStepMeanSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Lanearea_getLastStepOccupancy(String) - Method in class de.tudresden.ws.Traci
+
 
+
laneID - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
laneIndex - Variable in class de.tudresden.ws.container.SumoRoadPosition
+
 
+
lanes - de.tudresden.sumo.subscription.SumoDomain
+
 
+
LAST_STEP_LENGTH - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_MEAN_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_OCCUPANCY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_PERSON_ID_LIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_TIME_SINCE_DETECTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_VEHICLE_DATA - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_VEHICLE_HALTING_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_VEHICLE_ID_LIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LAST_STEP_VEHICLE_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
lastactiontime - Variable in class de.tudresden.ws.conf.Config
+
 
+
LastActionTime() - Method in interface de.tudresden.ws.Service
+
 
+
LastActionTime() - Method in class de.tudresden.ws.ServiceImpl
+
 
+
lastIndexOf(Object) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
lastIndexOf(Object) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
LCA_AMBACKBLOCKER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_AMBACKBLOCKER_STANDING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_AMBLOCKINGFOLLOWER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_AMBLOCKINGFOLLOWER_DONTBRAKE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_AMBLOCKINGLEADER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_FOLLOWER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_LEADER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_LEFT_FOLLOWER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_LEFT_LEADER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_RIGHT_FOLLOWER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_BY_RIGHT_LEADER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_LEFT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_BLOCKED_RIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_CHANGE_REASONS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_CHANGE_TO_HELP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_COOPERATIVE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_INSUFFICIENT_SPACE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_INSUFFICIENT_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_KEEPRIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_LEFT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_MLEFT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_MRIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_NONE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_OVERLAPPING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_RIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_SPEEDGAIN - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_STAY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_STRATEGIC - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_SUBLANE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_TRACI - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_UNKNOWN - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_URGENT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_WANTS_LANECHANGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
LCA_WANTS_LANECHANGE_OR_STAY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
leave_time - Variable in class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
length - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
length - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
length - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
length - Variable in class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
line - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
listIterator() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
listIterator() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
listIterator(int) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
listIterator(int) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
ll - Variable in class de.tudresden.ws.container.SumoBestLanes
+
 
+
ll - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
ll - Variable in class de.tudresden.ws.container.SumoNextTLS
+
 
+
ll - Variable in class de.tudresden.ws.container.SumoVehicleData
+
 
+
Log - Interface in de.tudresden.ws.log
+
+
The Interface Logger.
+
+
Log_txt - Class in de.tudresden.ws.log
+
 
+
Log_txt() - Constructor for class de.tudresden.ws.log.Log_txt
+
 
+
logger - Variable in class de.tudresden.ws.conf.Config
+
 
+
+ + + +

M

+
+
main(String[]) - Static method in class de.tudresden.ws.WebService
+
 
+
MAX_ORDER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
maxDur - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
me_detector - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
me_detector - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
minDur - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
MOVE_TO_XY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
moveTo(String, String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Moves the vehicle to a new position.
+
+
moveToXY(String, String, double, double, double, byte) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Place person at the given x,y coordinates and force it's angle to + the given value (for drawing).
+
+
moveToXY(String, String, int, double, double, double, byte) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Place vehicle at the given x,y coordinates and force it's angle to + the given value (for drawing).
+
+
MULTI_ENTRY_EXIT_DETECTOR_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
MULTI_ENTRY_EXIT_DETECTOR_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
Multientryexit - Class in de.tudresden.sumo.cmd
+
 
+
Multientryexit() - Constructor for class de.tudresden.sumo.cmd.Multientryexit
+
 
+
Multientryexit_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Multientryexit_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Multientryexit_getLastStepHaltingNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Multientryexit_getLastStepMeanSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Multientryexit_getLastStepVehicleIDs(String) - Method in class de.tudresden.ws.Traci
+
 
+
Multientryexit_getLastStepVehicleNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
+ + + +

N

+
+
name - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
name - Variable in class de.tudresden.ws.conf.Config
+
 
+
name - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
next - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
NextTLS(String, int, double, String) - Constructor for class de.tudresden.ws.container.SumoNextTLS.NextTLS
+
 
+
notifyObservers(SubscriptionObject) - Method in class de.tudresden.sumo.util.Observable
+
 
+
notInternalLane - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
+ + + +

O

+
+
object - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
objectID - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
objectID - Variable in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
Observable - Class in de.tudresden.sumo.util
+
 
+
Observable() - Constructor for class de.tudresden.sumo.util.Observable
+
 
+
Observer - Interface in de.tudresden.sumo.util
+
 
+
occupation - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
offset - Variable in class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
over - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
+ + + +

P

+
+
params - Variable in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
parking - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
person - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
person - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Person - Class in de.tudresden.sumo.cmd
+
 
+
Person() - Constructor for class de.tudresden.sumo.cmd.Person
+
 
+
PERSON_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Person_getAngle(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getColor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Person_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Person_getLanePosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getMinGap(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getPersonNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getPosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getPosition3D(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getRoadID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getTypeID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Person_getWaitingTime(String) - Method in class de.tudresden.ws.Traci
+
 
+
PERSON_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
persons - de.tudresden.sumo.subscription.SumoDomain
+
 
+
phasedef - Variable in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
phases - Variable in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
poi - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
poi - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
poi - de.tudresden.sumo.subscription.SumoDomain
+
 
+
Poi - Class in de.tudresden.sumo.cmd
+
 
+
Poi() - Constructor for class de.tudresden.sumo.cmd.Poi
+
 
+
Poi_add(String, double, double, SumoColor, String, int) - Method in class de.tudresden.ws.Traci
+
 
+
POI_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Poi_getColor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Poi_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Poi_getPosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_getType(String) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_remove(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_setColor(String, SumoColor) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_setPosition(String, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
Poi_setType(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
POI_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
polygon - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
polygon - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Polygon - Class in de.tudresden.sumo.cmd
+
 
+
Polygon() - Constructor for class de.tudresden.sumo.cmd.Polygon
+
 
+
Polygon_add(String, SumoGeometry, SumoColor, boolean, String, int) - Method in class de.tudresden.ws.Traci
+
 
+
POLYGON_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Polygon_getColor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_getShape(String) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_getType(String) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_remove(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_setColor(String, SumoColor) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_setShape(String, SumoStringList) - Method in class de.tudresden.ws.Traci
+
 
+
Polygon_setType(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
POLYGON_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
polygons - de.tudresden.sumo.subscription.SumoDomain
+
 
+
port - Static variable in class de.tudresden.ws.conf.Config
+
 
+
pos - Variable in class de.tudresden.ws.container.SumoRoadPosition
+
 
+
position() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
POSITION_2D - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
POSITION_3D - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
POSITION_CONVERSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
POSITION_LON_LAT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
POSITION_LON_LAT_ALT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
POSITION_ROADMAP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
printSumoError(boolean) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
printSumoOutput(boolean) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
programs - Variable in class de.tudresden.ws.container.SumoTLSController
+
 
+
+ + + +

Q

+
+
Query - Class in de.tudresden.sumo.util
+
 
+
Query(Socket) - Constructor for class de.tudresden.sumo.util.Query
+
 
+
queryAndVerify(RequestMessage) - Method in class de.tudresden.sumo.util.Query
+
+
Like Query.doQuery(RequestMessage); in addition, verifies that all + responses are successful and and the statuses match the requests.
+
+
queryAndVerifySingle(Command) - Method in class de.tudresden.sumo.util.Query
+
+
Like Query.queryAndVerify(RequestMessage), but good for one-command/ + one-response queries.
+
+
+ + + +

R

+
+
r - Variable in class de.tudresden.ws.container.SumoColor
+
 
+
raw - Variable in class de.tudresden.sumo.util.SumoCommand
+
 
+
rawSize() - Method in class it.polito.appeal.traci.protocol.Command
+
+
Returns the expected size of the serialized form of this command.
+
+
read(int, Storage) - Static method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
read_config(String) - Method in class de.tudresden.ws.conf.Config
+
 
+
readByte() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a byte value from the List
+
+
readDouble() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a Double value, that was split up into 8 bytes
+
+
readFloat() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a Float value, that was split up into 4 bytes
+
+
readInt() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a signed integer value, that was split up into 4 bytes
+
+
readShort() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a short value from the list
+
+
readStage(Storage) - Static method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
readStringASCII() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a String from the list, that was encoded using ASCII
+
+
readStringISOLATIN1() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a String from the list, that was encoded using ISO-LATIN1
+
+
readStringUTF16BE() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a String from the list, that was encoded using UTF-16 Big Endian
+
+
readStringUTF16LE() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a String from the list, that was encoded using UTF-16 Little Endian
+
+
readStringUTF8() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Read a String from the list, that was encoded using UTF-8
+
+
readUnsignedByte() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
refresh_actiontime() - Method in class de.tudresden.ws.conf.Config
+
 
+
remove(int) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
remove(int) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
remove(Object) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
remove(Object) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
remove(String, byte) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Removes vehicle with the given ID for the given reason.
+
+
remove(String, int) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Remove a poi.
+
+
remove(String, int) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Remove a polygon.
+
+
REMOVE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_ARRIVED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_PARKING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_STAGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_TELEPORT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_TELEPORT_ARRIVED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REMOVE_VAPORIZED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
removeAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
removeAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
removeStage(String, int) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Removes the nth next stage + nextStageIndex must be lower then value of getRemainingStages(personID) + nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
+
+
REPLACE_STAGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REQUEST_AIRDIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
REQUEST_DRIVINGDIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RequestMessage - Class in it.polito.appeal.traci.protocol
+
+
Represents a TraCI messages used to send Commands from the client to + server (i.e. requests).
+
+
RequestMessage() - Constructor for class it.polito.appeal.traci.protocol.RequestMessage
+
 
+
rerouteEffort(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Computes a new route using the vehicle's internal and the global edge effort information.
+
+
rerouteParkingArea(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Changes the next parking area in parkingAreaID, updates the vehicle route, + and preserve consistency in case of passengers/containers on board.
+
+
rerouteTraveltime(String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
rerouteTraveltime + + Computes a new route for the person using the global edge traveltime information.
+
+
rerouteTraveltime(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Computes a new route using the vehicle's internal and the global edge travel time information.
+
+
reset() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
response - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
RESPONSE_GET_BUSSTOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_CALIBRATOR_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_CHARGINGSTATION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_EDGE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_GUI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_INDUCTIONLOOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_JUNCTION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_LANE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_LANEAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_MEANDATA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_MULTIENTRYEXIT_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_OVERHEADWIRE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_PARKINGAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_PERSON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_POI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_POLYGON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_REROUTER_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_ROUTE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_ROUTEPROBE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_SIM_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_TL_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_VEHICLE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_GET_VEHICLETYPE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_EDGE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_EDGE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_GUI_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_GUI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_LANE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_LANE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_PERSON_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_PERSON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_POI_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_POI_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_POLYGON_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_POLYGON_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_REROUTER_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_REROUTER_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_ROUTE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_ROUTE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_SIM_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_SIM_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_TL_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_TL_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ResponseContainer - Class in it.polito.appeal.traci.protocol
+
+
Represents all the information related to a given request.
+
+
ResponseContainer(StatusResponse, Command) - Constructor for class it.polito.appeal.traci.protocol.ResponseContainer
+
+
Constructor for a response container with status response and a response + command.
+
+
ResponseContainer(StatusResponse, Command, List<Command>) - Constructor for class it.polito.appeal.traci.protocol.ResponseContainer
+
+
Constructor for a response container with status response, response + command and zero or more sub-responses.
+
+
ResponseMessage - Class in it.polito.appeal.traci.protocol
+
+
Represents a message sent from the server.
+
+
ResponseMessage(DataInputStream) - Constructor for class it.polito.appeal.traci.protocol.ResponseMessage
+
+
Constructor that unpacks all the data from a DataInputStream, + populating the list of ResponseContainers.
+
+
responses() - Method in class it.polito.appeal.traci.protocol.ResponseMessage
+
 
+
ResponseType - Enum in de.tudresden.sumo.subscription
+
 
+
result() - Method in class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
resume(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Continue after a stop
+
+
retainAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
retainAll(Collection<?>) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
return_type - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
route - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
route - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Route - Class in de.tudresden.sumo.cmd
+
 
+
Route() - Constructor for class de.tudresden.sumo.cmd.Route
+
 
+
Route_add(String, SumoStringList) - Method in class de.tudresden.ws.Traci
+
 
+
ROUTE_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Route_getEdges(String) - Method in class de.tudresden.ws.Traci
+
 
+
Route_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Route_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
ROUTE_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
ROUTING_MODE_AGGREGATED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ROUTING_MODE_COMBINED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ROUTING_MODE_DEFAULT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
ROUTING_MODE_EFFORT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RTYPE_ERR - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RTYPE_NOTIMPLEMENTED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
RTYPE_OK - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
run() - Method in class de.tudresden.ws.ShutdownHook
+
 
+
running - Variable in class de.tudresden.ws.conf.Config
+
 
+
runServer() - Method in class it.polito.appeal.traci.SumoTraciConnection
+
+
Runs a SUMO instance and tries to connect at it.
+
+
runServer(int) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
+
Runs a SUMO instance and tries to connect at it.
+
+
+ + + +

S

+
+
saveState(String) - Static method in class de.tudresden.sumo.cmd.Simulation
+
+
save state
+
+
screenshot(String, String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Save a screenshot for the given view to the given filename.
+
+
Service - Interface in de.tudresden.ws
+
 
+
ServiceImpl - Class in de.tudresden.ws
+
 
+
ServiceImpl(Config) - Constructor for class de.tudresden.ws.ServiceImpl
+
 
+
set(int, SumoLink) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
set(int, String) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
set_cmd(Object) - Method in class de.tudresden.sumo.util.Sumo
+
 
+
setAccel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the acceleration of the named vehicle.
+
+
setAccel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's wished maximum acceleration to the given value.
+
+
setActionStepLength(String, double, boolean) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the action step length for this vehicle.
+
+
setAdaptedTraveltime(String, double, double, String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the edge travel time of the named vehicle.
+
+
setAllowed(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Set a list of allowed vehicle classes.
+
+
setApparentDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the apparent deceleration in m/s^2 for this vehicle.
+
+
setApparentDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the apparent deceleration in m/s^2 of vehicles of this type.
+
+
setBoundary(String, double, double, double, double) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Set the current boundary for the given view (see getBoundary()).
+
+
setBusStop(String, String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Adds or modifies a bus stop with the given parameters.
+
+
setChargingStationStop(String, String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Adds or modifies a stop at a chargingStation with the given parameters.
+
+
setColor(String, SumoColor) - Static method in class de.tudresden.sumo.cmd.Person
+
+
sets color for person with the given ID.
+
+
setColor(String, SumoColor) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Set the color of this poi.
+
+
setColor(String, SumoColor) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Set the color of this polygon.
+
+
setColor(String, SumoColor) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the vehicle's color (RGBA).
+
+
setColor(String, SumoColor) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's color.
+
+
setCompleteRedYellowGreenDefinition(String, SumoTLSProgram) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the complete traffic light program.
+
+
setConfig(String) - Method in interface de.tudresden.ws.Service
+
 
+
setConfig(String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
setContainerStop(String, String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Adds or modifies a container stop with the given parameters.
+
+
setDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the deceleration of the named vehicle.
+
+
setDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's wished maximum deceleration to the given value.
+
+
setDisallowed(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Set a list of disallowed vehicle classes.
+
+
setEffort(String, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Adapt the effort value used for (re-)routing on the given edge.
+
+
setEffort(String, double, double, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Adapt the effort value used for (re-)routing on the given edge.
+
+
setEffort(String, int, int, String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the edge effort for the given time as stored in the vehicle's internal container.
+
+
setEmergencyDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
+
+
setEmergencyDecel(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the maximal physically possible deceleration in m/s^2 of vehicles of this type.
+
+
setEmissionClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the emission class of the named vehicle.
+
+
setEmissionClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's emission class to the given value.
+
+
setFilled(String, boolean) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Set the color of this polygon.
+
+
setHeight(String, double) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the height in m for this person.
+
+
setHeight(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the height in m for this vehicle.
+
+
setHeight(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the height in m of vehicles of this type.
+
+
setImperfection(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
setImperfection
+
+
setImperfection(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
setImperfection
+
+
setLaneChangeMode(String, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the vehicle's lane change mode as a bitset.
+
+
setLateralAlignment(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the preferred lateral alignment for this vehicle.
+
+
setLateralAlignment(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the preferred lateral alignment of this type.
+
+
setLength(String, double) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Set the length (in m) of the named lane.
+
+
setLength(String, double) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the length in m for the given person.
+
+
setLength(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the length (in m) of the named vehicle.
+
+
setLength(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's length to the given value.
+
+
setLine(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the line information for this vehicle.
+
+
setMaxSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Set a new maximum speed (in m/s) for all lanes of the edge.
+
+
setMaxSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Set the maximum speed (in m/s) allowed on this lane.
+
+
setMaxSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the maximum speed (in m/s) of the named vehicle.
+
+
setMaxSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's maximum speed to the given value.
+
+
setMaxSpeedLat(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the maximum lateral speed in m/s for this vehicle.
+
+
setMaxSpeedLat(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the maximum lateral speed of this type.
+
+
setMinGap(String, double) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the offset (gap to front person if halting) for this vehicle.
+
+
setMinGap(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the minimum gap (in m) between this vehicle and the vehicle before it.
+
+
setMinGap(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's minimum headway gap to the given value.
+
+
setMinGapLat(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the minimum lateral gap of the vehicle at 50km/h in m
+
+
setMinGapLat(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
setImperfection
+
+
setOffset(String, double, double) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Set the current offset for the given view.
+
+
setOrder(int) - Method in class it.polito.appeal.traci.SumoTraciConnection
+
 
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Edge
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Lane
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Route
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the chosen parameter
+
+
setParameter(String, String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the chosen parameter
+
+
setParkingAreaStop(String, String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Adds or modifies a stop at a parkingArea with the given parameters.
+
+
setPhase(String, int) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the index of the current phase in the current program.
+
+
setPhaseDuration(String, double) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the duration of the currently active phase (in s?).
+
+
setPhaseName(String, String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the name of the current phase in the current program.
+
+
setPosition(String, double, double) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Set the position of this poi.
+
+
setProgram(String, String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the id of the current program.
+
+
setRedYellowGreenState(String, String) - Static method in class de.tudresden.sumo.cmd.Trafficlight
+
+
Set the named tl's state as a tuple of light definitions.
+
+
setRoute(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the IDs of the edges the vehicle's route is made of.
+
+
setRouteID(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the id of the route of the named vehicle.
+
+
setRoutingMode(String, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
sets the current routing mode: + tc.ROUTING_MODE_DEFAULT : use weight storages and fall-back to edge speeds (default) + tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
+
+
setSchema(String, String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Set the current coloring scheme for the given view.
+
+
setShape(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Set the shape of this polygon.
+
+
setShapeClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
setShapeClass
+
+
setShapeClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
setShapeClass
+
+
setshutdown(boolean) - Method in class de.tudresden.ws.ShutdownHook
+
 
+
setSignals(String, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
setSignals
+
+
setSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the maximum speed in m/s for the named person for subsequent step.
+
+
setSpeed(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the speed (in m/s) of the named vehicle.
+
+
setSpeedDeviation(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the standard deviation of the estimated maximum speed.
+
+
setSpeedDeviation(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's speed deviation to the given value.
+
+
setSpeedFactor(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the factor by which the driver multiplies the speed read from street signs to estimate "real" maximum allowed speed.
+
+
setSpeedFactor(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's speed factor to the given value.
+
+
setSpeedMode(String, int) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the vehicle's speed mode as a bitset.
+
+
setStop(String, String, double, byte, double, SumoStopFlags, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Lets the vehicle stop at the given edge, at the given position and lane.
+
+
setSumoBinary(String) - Method in interface de.tudresden.ws.Service
+
 
+
setSumoBinary(String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
setTau(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
setTau
+
+
setTau(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
setTau
+
+
setType(String, String) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the id of the type for the named person.
+
+
setType(String, String) - Static method in class de.tudresden.sumo.cmd.Poi
+
+
Set the type of the poi.
+
+
setType(String, String) - Static method in class de.tudresden.sumo.cmd.Polygon
+
+
Set the type of the polygon.
+
+
setType(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the id of the type for the named vehicle.
+
+
setVehicleClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the vehicle class.
+
+
setVehicleClass(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's vehicle class to the given value.
+
+
setVia(String, SumoStringList) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the line information for this vehicle.
+
+
setWidth(String, double) - Static method in class de.tudresden.sumo.cmd.Person
+
+
Sets the width in m for this person.
+
+
setWidth(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Sets the vehicle's width (in m).
+
+
setWidth(String, double) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Sets the vehicle type's width to the given value.
+
+
setWidth(String, String) - Static method in class de.tudresden.sumo.cmd.Vehicletype
+
+
Duplicates the vType with ID origTypeID.
+
+
setZoom(String, double) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Set the current zoom factor for the given view.
+
+
ShutdownHook - Class in de.tudresden.ws
+
 
+
ShutdownHook() - Constructor for class de.tudresden.ws.ShutdownHook
+
+
Instantiates a new shutdown hook.
+
+
SIM_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
SIM_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
simulation - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
simulation - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Simulation - Class in de.tudresden.sumo.cmd
+
 
+
Simulation() - Constructor for class de.tudresden.sumo.cmd.Simulation
+
 
+
Simulation_convert2D(String, double, byte, String) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_convert3D(String, double, byte, String) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_convertGeo(double, double, boolean) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_convertRoad(double, double, boolean, String) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getArrivedIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getArrivedNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getBusStopWaiting() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getCurrentTime() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getDeltaT() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getDepartedIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getDepartedNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getDistance2D(double, double, double, double, boolean, boolean) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getDistanceRoad(String, double, String, double, boolean) - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getEndingTeleportIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getEndingTeleportNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getLoadedIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getLoadedNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getMinExpectedNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getNetBoundary() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getParkingEndingVehiclesIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getParkingEndingVehiclesNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getParkingStartingVehiclesIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getParkingStartingVehiclesNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStartingTeleportIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStartingTeleportNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStopEndingVehiclesIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStopEndingVehiclesNumber() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStopStartingVehiclesIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Simulation_getStopStartingVehiclesNumber() - Method in class de.tudresden.ws.Traci
+
 
+
size() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
size() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
size() - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Retrieve the Size of the internal storage list
+
+
slowDown(String, double, double) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Reduces the speed to the given for the given amount of time.
+
+
STAGE_ACCESS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_DRIVING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_TRANSHIP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_TRIP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_WAITING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_WAITING_FOR_DEPART - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STAGE_WALKING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
start - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
start - Variable in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
start(String) - Method in interface de.tudresden.ws.Service
+
 
+
start(String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
start(String, String) - Method in class de.tudresden.sumo.util.Sumo
+
 
+
start(String, String, String) - Method in class de.tudresden.sumo.util.Sumo
+
 
+
start_ws() - Method in class de.tudresden.sumo.util.Sumo
+
 
+
state - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
status - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
STATUS_ONLY_RESPONSES - Static variable in class it.polito.appeal.traci.protocol.ResponseMessage
+
+
The list of IDs of responses that have no response commands.
+
+
StatusResponse - Class in it.polito.appeal.traci.protocol
+
 
+
StatusResponse(int) - Constructor for class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
StatusResponse(int, int, String) - Constructor for class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
StatusResponse(Storage) - Constructor for class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
stop - Variable in class de.tudresden.sumo.subscription.ContextSubscription
+
 
+
stop - Variable in class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
stop(String) - Method in interface de.tudresden.ws.Service
+
 
+
stop(String) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
STOP_BUS_STOP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_CHARGING_STATION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_CONTAINER_STOP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_CONTAINER_TRIGGERED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_DEFAULT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
stop_instance() - Method in class de.tudresden.sumo.util.Sumo
+
 
+
STOP_PARKING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_PARKING_AREA - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
STOP_TRIGGERED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
stopped - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
Storage - Class in de.uniluebeck.itm.tcpip
+
 
+
Storage() - Constructor for class de.uniluebeck.itm.tcpip.Storage
+
 
+
Storage(byte[]) - Constructor for class de.uniluebeck.itm.tcpip.Storage
+
 
+
Storage(byte[], int, int) - Constructor for class de.uniluebeck.itm.tcpip.Storage
+
 
+
Storage(short[]) - Constructor for class de.uniluebeck.itm.tcpip.Storage
+
 
+
Storage(short[], int, int) - Constructor for class de.uniluebeck.itm.tcpip.Storage
+
 
+
subID - Variable in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
subList(int, int) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
subList(int, int) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
SubscribtionVariable - Enum in de.tudresden.sumo.subscription
+
 
+
Subscription - Interface in de.tudresden.sumo.subscription
+
 
+
SubscriptionContext - Enum in de.tudresden.sumo.subscription
+
 
+
SubscriptionObject - Class in de.tudresden.sumo.subscription
+
 
+
SubscriptionObject(String, ResponseType, int, int, int, SumoObject) - Constructor for class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
SubscriptionObject(String, ResponseType, int, String, int, int, int, SumoObject) - Constructor for class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
Sumo - Class in de.tudresden.sumo.util
+
 
+
Sumo() - Constructor for class de.tudresden.sumo.util.Sumo
+
 
+
Sumo(Config) - Constructor for class de.tudresden.sumo.util.Sumo
+
 
+
sumo_bin - Static variable in class de.tudresden.ws.conf.Config
+
 
+
sumo_output - Variable in class de.tudresden.ws.conf.Config
+
 
+
SumoBestLane(String, double, double, int, int, LinkedList<String>) - Constructor for class de.tudresden.ws.container.SumoBestLanes.SumoBestLane
+
 
+
SumoBestLanes - Class in de.tudresden.ws.container
+
 
+
SumoBestLanes() - Constructor for class de.tudresden.ws.container.SumoBestLanes
+
 
+
SumoBestLanes.SumoBestLane - Class in de.tudresden.ws.container
+
 
+
SumoBoundingBox - Class in de.tudresden.ws.container
+
 
+
SumoBoundingBox() - Constructor for class de.tudresden.ws.container.SumoBoundingBox
+
 
+
SumoBoundingBox(double, double, double, double) - Constructor for class de.tudresden.ws.container.SumoBoundingBox
+
 
+
SumoColor - Class in de.tudresden.ws.container
+
 
+
SumoColor() - Constructor for class de.tudresden.ws.container.SumoColor
+
 
+
SumoColor(int, int, int, int) - Constructor for class de.tudresden.ws.container.SumoColor
+
 
+
SumoCommand - Class in de.tudresden.sumo.util
+
 
+
SumoCommand(Object, Object) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object[], Object, Object) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object, Object) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object, Object[]) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object, Object[], Object, Object) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object, Object, Object) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoCommand(Object, Object, Object, Object, Object, String) - Constructor for class de.tudresden.sumo.util.SumoCommand
+
 
+
SumoDomain - Enum in de.tudresden.sumo.subscription
+
 
+
SumoGeometry - Class in de.tudresden.ws.container
+
 
+
SumoGeometry() - Constructor for class de.tudresden.ws.container.SumoGeometry
+
 
+
SumoLeader - Class in de.tudresden.ws.container
+
 
+
SumoLeader(String, double) - Constructor for class de.tudresden.ws.container.SumoLeader
+
 
+
SumoLink - Class in de.tudresden.ws.container
+
 
+
SumoLink(String, String, byte, byte, byte, double, String, String) - Constructor for class de.tudresden.ws.container.SumoLink
+
 
+
SumoLink(String, String, String) - Constructor for class de.tudresden.ws.container.SumoLink
+
 
+
SumoLinkList - Class in de.tudresden.ws.container
+
 
+
SumoLinkList() - Constructor for class de.tudresden.ws.container.SumoLinkList
+
 
+
SumoLinkList(List<SumoLink>) - Constructor for class de.tudresden.ws.container.SumoLinkList
+
 
+
SumoNextTLS - Class in de.tudresden.ws.container
+
 
+
SumoNextTLS() - Constructor for class de.tudresden.ws.container.SumoNextTLS
+
 
+
SumoNextTLS.NextTLS - Class in de.tudresden.ws.container
+
 
+
SumoObject - Interface in de.tudresden.ws.container
+
 
+
SumoPosition2D - Class in de.tudresden.ws.container
+
 
+
SumoPosition2D() - Constructor for class de.tudresden.ws.container.SumoPosition2D
+
 
+
SumoPosition2D(double, double) - Constructor for class de.tudresden.ws.container.SumoPosition2D
+
 
+
SumoPosition3D - Class in de.tudresden.ws.container
+
 
+
SumoPosition3D() - Constructor for class de.tudresden.ws.container.SumoPosition3D
+
 
+
SumoPosition3D(double, double, double) - Constructor for class de.tudresden.ws.container.SumoPosition3D
+
 
+
SumoPrimitive - Class in de.tudresden.ws.container
+
 
+
SumoPrimitive(Object) - Constructor for class de.tudresden.ws.container.SumoPrimitive
+
 
+
SumoRoadPosition - Class in de.tudresden.ws.container
+
 
+
SumoRoadPosition() - Constructor for class de.tudresden.ws.container.SumoRoadPosition
+
 
+
SumoStage - Class in de.tudresden.ws.container
+
 
+
SumoStage() - Constructor for class de.tudresden.ws.container.SumoStage
+
 
+
SumoStopFlags - Class in de.tudresden.ws.container
+
 
+
SumoStopFlags(boolean, boolean, boolean, boolean, boolean, boolean, boolean) - Constructor for class de.tudresden.ws.container.SumoStopFlags
+
 
+
SumoStopFlags(byte) - Constructor for class de.tudresden.ws.container.SumoStopFlags
+
 
+
SumoStringList - Class in de.tudresden.ws.container
+
 
+
SumoStringList() - Constructor for class de.tudresden.ws.container.SumoStringList
+
 
+
SumoStringList(List<String>) - Constructor for class de.tudresden.ws.container.SumoStringList
+
 
+
SumoTLSController - Class in de.tudresden.ws.container
+
 
+
SumoTLSController() - Constructor for class de.tudresden.ws.container.SumoTLSController
+
 
+
SumoTLSPhase - Class in de.tudresden.ws.container
+
 
+
SumoTLSPhase() - Constructor for class de.tudresden.ws.container.SumoTLSPhase
+
 
+
SumoTLSPhase(double, double, double, String, ArrayList<Integer>, String) - Constructor for class de.tudresden.ws.container.SumoTLSPhase
+
 
+
SumoTLSPhase(int, String) - Constructor for class de.tudresden.ws.container.SumoTLSPhase
+
 
+
SumoTLSProgram - Class in de.tudresden.ws.container
+
 
+
SumoTLSProgram() - Constructor for class de.tudresden.ws.container.SumoTLSProgram
+
 
+
SumoTLSProgram(String, int, int) - Constructor for class de.tudresden.ws.container.SumoTLSProgram
+
 
+
SumoTraciConnection - Class in it.polito.appeal.traci
+
+
Models a TCP/IP connection to a local or remote SUMO server via the TraCI + protocol.
+
+
SumoTraciConnection(int) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String, int, boolean) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String, String) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String, String, String) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String, String, String, String) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(String, String, String, String, String) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoTraciConnection(SocketAddress) - Constructor for class it.polito.appeal.traci.SumoTraciConnection
+
 
+
SumoVehicleData - Class in de.tudresden.ws.container
+
 
+
SumoVehicleData() - Constructor for class de.tudresden.ws.container.SumoVehicleData
+
 
+
SumoVehicleData.VehicleData - Class in de.tudresden.ws.container
+
 
+
SumoVehicleSignal - Class in de.tudresden.ws.container
+
 
+
SumoVehicleSignal(int) - Constructor for class de.tudresden.ws.container.SumoVehicleSignal
+
 
+
SumoVehicleSignalState - Enum in de.tudresden.ws.container
+
 
+
+ + + +

T

+
+
TL_COMPLETE_DEFINITION_RYG - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_COMPLETE_PROGRAM_RYG - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
TL_CONTROLLED_JUNCTIONS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_CONTROLLED_LANES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_CONTROLLED_LINKS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_CURRENT_PHASE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_CURRENT_PROGRAM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_EXTERNAL_STATE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_NEXT_SWITCH - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_PHASE_DURATION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_PHASE_INDEX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_PROGRAM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_RED_YELLOW_GREEN_STATE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TL_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
tlsID - Variable in class de.tudresden.ws.container.SumoNextTLS.NextTLS
+
 
+
to - Variable in class de.tudresden.ws.container.SumoLink
+
 
+
toArray() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
toArray() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
toArray(T[]) - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
toArray(T[]) - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoBestLanes
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoBoundingBox
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoColor
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoGeometry
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoLeader
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoLink
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoLinkList
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoNextTLS
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoPosition2D
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoPosition3D
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoStringList
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoTLSController
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoTLSPhase
+
 
+
toString() - Method in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
toString() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
Traci - Class in de.tudresden.ws
+
 
+
Traci() - Constructor for class de.tudresden.ws.Traci
+
 
+
TRACI_ID_LIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TRACI_VERSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TraCIException - Exception in it.polito.appeal.traci
+
 
+
TraCIException() - Constructor for exception it.polito.appeal.traci.TraCIException
+
 
+
TraCIException(String) - Constructor for exception it.polito.appeal.traci.TraCIException
+
 
+
TraCIException.UnexpectedData - Exception in it.polito.appeal.traci
+
 
+
TraCIException.UnexpectedDatatype - Exception in it.polito.appeal.traci
+
 
+
TraCIException.UnexpectedResponse - Exception in it.polito.appeal.traci
+
 
+
trackVehicle(String, String) - Static method in class de.tudresden.sumo.cmd.Gui
+
+
Start visually tracking the given vehicle on the given view.
+
+
trafficlight - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
trafficlight - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Trafficlight - Class in de.tudresden.sumo.cmd
+
 
+
Trafficlight() - Constructor for class de.tudresden.sumo.cmd.Trafficlight
+
 
+
Trafficlights_getCompleteRedYellowGreenDefinition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getControlledLanes(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getControlledLinks(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getNextSwitch(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getPhase(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getPhaseDuration(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getProgram(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_getRedYellowGreenState(String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_setCompleteRedYellowGreenDefinition(String, SumoTLSProgram) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_setPhase(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_setPhaseDuration(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_setProgram(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Trafficlights_setRedYellowGreenState(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
travelTime - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
triggered - Variable in class de.tudresden.ws.container.SumoStopFlags
+
 
+
txt_output(boolean) - Method in class de.tudresden.ws.log.Log_txt
+
 
+
txt_output(boolean) - Method in interface de.tudresden.ws.log.Log
+
 
+
TXT_output(boolean) - Method in interface de.tudresden.ws.Service
+
 
+
TXT_output(boolean) - Method in class de.tudresden.ws.ServiceImpl
+
 
+
type - Variable in class de.tudresden.ws.container.SumoPrimitive
+
 
+
type - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
type - Variable in class de.tudresden.ws.container.SumoTLSProgram
+
 
+
TYPE_BYTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_COLOR - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_COMPOUND - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_DOUBLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_DOUBLELIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_INTEGER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_POLYGON - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_STRING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_STRINGLIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
TYPE_UBYTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
typeID - Variable in class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
+ + + +

U

+
+
UnexpectedData(String, Object, Object) - Constructor for exception it.polito.appeal.traci.TraCIException.UnexpectedData
+
 
+
UnexpectedDatatype(int, int) - Constructor for exception it.polito.appeal.traci.TraCIException.UnexpectedDatatype
+
 
+
UnexpectedResponse(int, int) - Constructor for exception it.polito.appeal.traci.TraCIException.UnexpectedResponse
+
 
+
UNKNOWN - de.tudresden.sumo.subscription.ResponseType
+
 
+
update(Observable, SubscriptionObject) - Method in interface de.tudresden.sumo.util.Observer
+
 
+
updateBestLanes(String) - Static method in class de.tudresden.sumo.cmd.Vehicle
+
+
Inserts the information about the travel time of edge "edgeID" valid + from begin time to end time into the vehicle's internal edge weights + container.
+
+
url - Static variable in class de.tudresden.ws.conf.Config
+
 
+
+ + + +

V

+
+
val - Variable in class de.tudresden.ws.container.SumoPrimitive
+
 
+
validPos() - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
valueOf(String) - Static method in enum de.tudresden.sumo.subscription.ResponseType
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum de.tudresden.sumo.subscription.SubscribtionVariable
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum de.tudresden.sumo.subscription.SubscriptionContext
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum de.tudresden.sumo.subscription.SumoDomain
+
+
Returns the enum constant of this type with the specified name.
+
+
valueOf(String) - Static method in enum de.tudresden.ws.container.SumoVehicleSignalState
+
+
Returns the enum constant of this type with the specified name.
+
+
values() - Static method in enum de.tudresden.sumo.subscription.ResponseType
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum de.tudresden.sumo.subscription.SubscribtionVariable
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum de.tudresden.sumo.subscription.SubscriptionContext
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum de.tudresden.sumo.subscription.SumoDomain
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
values() - Static method in enum de.tudresden.ws.container.SumoVehicleSignalState
+
+
Returns an array containing the constants of this enum type, in +the order they are declared.
+
+
VAR_ACCEL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ACCELERATION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ACCUMULATED_WAITING_TIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ACTIONSTEPLENGTH - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ADD_DYNAMICS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ALLOWED_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ANGLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_APPARENT_DECEL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ARRIVED_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ARRIVED_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_BEGIN - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_BEST_LANES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_BUS_STOP_ID_LIST - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_BUS_STOP_WAITING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_BUS_STOP_WAITING_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_CO2EMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_COEMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_COLLIDING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_COLLIDING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_COLOR - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_CURRENT_TRAVELTIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_DECEL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_DELTA_T - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_DEPARTED_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_DEPARTED_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_DISTANCE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EDGE_EFFORT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EDGE_TRAVELTIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EDGES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ELECTRICITYCONSUMPTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EMERGENCY_DECEL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EMERGENCYSTOPPING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_EMISSIONCLASS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_END - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_FILL - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_FOES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_FOLLOW_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_FUELCONSUMPTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_HAS_VIEW - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_HCEMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_HEIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_HIGHLIGHT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_IMAGEFILE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_IMPERFECTION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_INSERTED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LANE_ID - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LANE_INDEX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LANECHANGE_MODE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LANEPOSITION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LANEPOSITION_LAT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LASTACTIONTIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LATALIGNMENT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LEADER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LENGTH - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LINE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LOADED_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_LOADED_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MAXSPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MAXSPEED_LAT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MIN_EXPECTED_VEHICLES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MINGAP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MINGAP_LAT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_MOVE_TO - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NAME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NEIGHBORS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NET_BOUNDING_BOX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NEXT_EDGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NEXT_STOPS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NEXT_TLS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NOISEEMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_NOXEMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARAMETER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_ENDING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_ENDING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_MANEUVERING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_MANEUVERING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_STARTING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PARKING_STARTING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PASSED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PERSON_CAPACITY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PERSON_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_PMXEMISSION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_POSITION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_POSITION3D - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_REMOVED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROAD_ID - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTE_ID - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTE_INDEX - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTE_PROBE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTE_VALID - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_ROUTING_MODE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SCREENSHOT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SECURE_GAP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SHAPE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SHAPECLASS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SIGNALS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SLOPE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEED_DEVIATION - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEED_FACTOR - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEED_LAT - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEED_WITHOUT_TRACI - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_SPEEDSETMODE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STAGE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STAGES_REMAINING - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_DELAY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_ENDING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_ENDING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_SPEED - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_STARTING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOP_STARTING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_STOPSTATE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TAU - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TELEPORT_ENDING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TELEPORT_ENDING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TELEPORT_STARTING_VEHICLES_IDS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TELEPORT_STARTING_VEHICLES_NUMBER - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TIME_STEP - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TRACK_VEHICLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_TYPE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_UPDATE_BESTLANES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VEHICLE - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VEHICLECLASS - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VEHSPERHOUR - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VIA - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VIEW_BOUNDARY - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VIEW_OFFSET - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VIEW_SCHEMA - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VIEW_ZOOM - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_VTYPES - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_WAITING_TIME - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
VAR_WIDTH - Static variable in class de.tudresden.sumo.config.Constants
+
 
+
variable - Variable in class de.tudresden.sumo.subscription.SubscriptionObject
+
 
+
VariableSubscription - Class in de.tudresden.sumo.subscription
+
 
+
VariableSubscription() - Constructor for class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
VariableSubscription(SubscribtionVariable, double, double, String) - Constructor for class de.tudresden.sumo.subscription.VariableSubscription
+
 
+
VEH_SIGNAL_BACKDRIVE - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_BLINKER_EMERGENCY - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_BLINKER_LEFT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_BLINKER_RIGHT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_BRAKELIGHT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_DOOR_OPEN_LEFT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_DOOR_OPEN_RIGHT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_EMERGENCY_BLUE - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_EMERGENCY_RED - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_EMERGENCY_YELLOW - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_FOGLIGHT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_FRONTLIGHT - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_HIGHBEAM - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
VEH_SIGNAL_WIPER - de.tudresden.ws.container.SumoVehicleSignalState
+
 
+
vehicle - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
vehicle - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Vehicle - Class in de.tudresden.sumo.cmd
+
 
+
Vehicle() - Constructor for class de.tudresden.sumo.cmd.Vehicle
+
 
+
Vehicle_add(String, String, String, int, double, double, byte) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_changeLane(String, byte, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_changeTarget(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
VEHICLE_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Vehicle_getAccel(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getAdaptedTraveltime(String, int, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getAllowedSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getAngle(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getBestLanes(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getCO2Emission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getCOEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getColor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getDecel(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getDistance(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getDrivingDistance(String, String, double, byte) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getDrivingDistance2D(String, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getEffort(String, int, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getElectricityConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getEmissionClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getFuelConsumption(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getHCEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getImperfection(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getLaneID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getLaneIndex(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getLanePosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getLeader(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getMaxSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getMinGap(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getNoiseEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getNOxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getPersonNumber(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getPMxEmission(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getPosition(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getPosition3D(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getRoadID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getRoute(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getRouteID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getShapeClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSignals(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSlope(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSpeedDeviation(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSpeedFactor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSpeedMode(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getSpeedWithoutTraCI(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getTau(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getTypeID(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getVehicleClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getWaitingTime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_getWidth(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_isRouteValid(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_moveTo(String, String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_remove(String, byte) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_rerouteEffort(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_rerouteTraveltime(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_resume(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setAccel(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setAdaptedTraveltime(String, int, int, String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setColor(String, SumoColor) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setDecel(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setEffort(String, int, int, String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setEmissionClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setImperfection(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setLaneChangeMode(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setLength(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setMaxSpeed(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setMinGap(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setRoute(String, SumoStringList) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setRouteID(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setShapeClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setSignals(String, int) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setSpeed(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setSpeedDeviation(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setSpeedFactor(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setStop(String, String, double, byte, double, SumoStopFlags, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setTau(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setType(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setVehicleClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_setWidth(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicle_slowDown(String, double, double) - Method in class de.tudresden.ws.Traci
+
 
+
VEHICLE_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
VehicleData(String, double, double, double, String) - Constructor for class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
vehicles - de.tudresden.sumo.subscription.SumoDomain
+
 
+
vehicleType - de.tudresden.sumo.subscription.SubscribtionVariable
+
 
+
vehicleType - de.tudresden.sumo.subscription.SubscriptionContext
+
 
+
Vehicletype - Class in de.tudresden.sumo.cmd
+
 
+
Vehicletype() - Constructor for class de.tudresden.sumo.cmd.Vehicletype
+
 
+
VEHICLETYPE_CONTEXT - de.tudresden.sumo.subscription.ResponseType
+
 
+
Vehicletype_getAccel(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getColor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getDecel(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getEmissionClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getIDCount() - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getIDList() - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getImperfection(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getLength(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getMaxSpeed(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getMinGap(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getShapeClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getSpeedDeviation(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getSpeedFactor(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getTau(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getVehicleClass(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_getWidth(String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setAccel(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setColor(String, SumoColor) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setDecel(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setEmissionClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setImperfection(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setLength(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setMaxSpeed(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setMinGap(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setShapeClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setSpeedDeviation(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setSpeedFactor(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setTau(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setVehicleClass(String, String) - Method in class de.tudresden.ws.Traci
+
 
+
Vehicletype_setWidth(String, double) - Method in class de.tudresden.ws.Traci
+
 
+
VEHICLETYPE_VARIABLE - de.tudresden.sumo.subscription.ResponseType
+
 
+
vehID - Variable in class de.tudresden.ws.container.SumoLeader
+
 
+
vehID - Variable in class de.tudresden.ws.container.SumoVehicleData.VehicleData
+
 
+
verify(String, int, byte) - Static method in class de.tudresden.sumo.util.Query
+
 
+
verify(String, int, short) - Static method in class de.tudresden.sumo.util.Query
+
 
+
verify(String, Object, Object) - Static method in class de.tudresden.sumo.util.Query
+
 
+
verifyGetVarResponse(Command, int, int, String) - Static method in class de.tudresden.sumo.util.CommandProcessor
+
 
+
verifyGetVarResponse(Command, int, int, String) - Static method in class de.tudresden.sumo.util.Query
+
 
+
version - Variable in class de.tudresden.ws.conf.Config
+
 
+
version() - Method in interface de.tudresden.ws.Service
+
 
+
version() - Method in class de.tudresden.ws.ServiceImpl
+
 
+
vType - Variable in class de.tudresden.ws.container.SumoStage
+
 
+
+ + + +

W

+
+
WebService - Class in de.tudresden.ws
+
 
+
WebService() - Constructor for class de.tudresden.ws.WebService
+
 
+
write(StackTraceElement[]) - Method in class de.tudresden.ws.log.Log_txt
+
 
+
write(StackTraceElement[]) - Method in interface de.tudresden.ws.log.Log
+
 
+
write(String, int) - Method in class de.tudresden.ws.log.Log_txt
+
 
+
write(String, int) - Method in interface de.tudresden.ws.log.Log
+
 
+
writeByte(int) - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
writeByte(short) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a byte value to the List + a signed value will be converted to its unsigned equivalent first
+
+
writeDouble(double) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a Double to the list + the value is beeing split up into 8 bytes in msb first order
+
+
writeFloat(float) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a Float to the list + the float value is beeing split up into 4 bytes in msb first order
+
+
writeInt(int) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write an signed Integer to the list + the int value is being split up into 4 bytes in msb first order
+
+
writeRawTo(Storage) - Method in class it.polito.appeal.traci.protocol.Command
+
+
Writes the serialized form of this command to the given Storage + object.
+
+
writeShort(int) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a signed short value to the list
+
+
writeStringASCII(String) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a string to the list by encoding the characters in ASCII
+
+
writeStringISOLATIN1(String) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a string to the list by encoding the characters in ISO-LATIN1
+
+
writeStringUTF16BE(String) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a string to the list by encoding the characters in UTF-16 Big Endian
+
+
writeStringUTF16LE(String) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a string to the list by encoding the characters in UTF-16 Little Endian
+
+
writeStringUTF8(String) - Method in class de.uniluebeck.itm.tcpip.Storage
+
+
Write a string to the list by encoding the characters in UTF-8
+
+
writeTo(Storage) - Method in class it.polito.appeal.traci.protocol.StatusResponse
+
 
+
writeTo(DataOutputStream) - Method in class it.polito.appeal.traci.protocol.RequestMessage
+
+
Writes the commands to the specified DataOutputStream object, in + the same order as the calls of RequestMessage.append(Command).
+
+
writeUnsignedByte(int) - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
writeUnsignedByte(short) - Method in class de.uniluebeck.itm.tcpip.Storage
+
 
+
+ + + +

X

+
+
x - Variable in class de.tudresden.ws.container.SumoPosition2D
+
 
+
x - Variable in class de.tudresden.ws.container.SumoPosition3D
+
 
+
x_max - Variable in class de.tudresden.ws.container.SumoBoundingBox
+
 
+
x_min - Variable in class de.tudresden.ws.container.SumoBoundingBox
+
 
+
+ + + +

Y

+
+
y - Variable in class de.tudresden.ws.container.SumoPosition2D
+
 
+
y - Variable in class de.tudresden.ws.container.SumoPosition3D
+
 
+
y_max - Variable in class de.tudresden.ws.container.SumoBoundingBox
+
 
+
y_min - Variable in class de.tudresden.ws.container.SumoBoundingBox
+
 
+
+ + + +

Z

+
+
z - Variable in class de.tudresden.ws.container.SumoPosition3D
+
 
+
+A B C D E F G H I J L M N O P Q R S T U V W X Y Z 
All Classes All Packages
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/index.html sumo-1.6.0+dfsg1/docs/javadoc/traas/index.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/index.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/index.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,204 @@ + + + + + +Overview (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+

traas 1.0 API

+
+
+ +
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/CloseQuery.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class it.polito.appeal.traci.CloseQuery (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.CloseQuery

+
+
No usage of it.polito.appeal.traci.CloseQuery
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/SumoTraciConnection.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,194 @@ + + + + + +Uses of Class it.polito.appeal.traci.SumoTraciConnection (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.SumoTraciConnection

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,204 @@ + + + + + +Uses of Class it.polito.appeal.traci.TraCIException (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.TraCIException

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedData.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,257 @@ + + + + + +Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.TraCIException.UnexpectedData

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedDatatype.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedDatatype (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.TraCIException.UnexpectedDatatype

+
+
No usage of it.polito.appeal.traci.TraCIException.UnexpectedDatatype
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/class-use/TraCIException.UnexpectedResponse.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,150 @@ + + + + + +Uses of Class it.polito.appeal.traci.TraCIException.UnexpectedResponse (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.TraCIException.UnexpectedResponse

+
+
No usage of it.polito.appeal.traci.TraCIException.UnexpectedResponse
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/CloseQuery.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,342 @@ + + + + + +CloseQuery (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class CloseQuery

+
+
+ +
+
    +
  • +
    +
    public class CloseQuery
    +extends Query
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CloseQuery

        +
        public CloseQuery​(java.net.Socket sock)
        +           throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        doCommand

        +
        public void doCommand()
        +               throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-summary.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,202 @@ + + + + + +it.polito.appeal.traci (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package it.polito.appeal.traci

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-tree.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,196 @@ + + + + + +it.polito.appeal.traci Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package it.polito.appeal.traci

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/package-use.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,217 @@ + + + + + +Uses of Package it.polito.appeal.traci (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
it.polito.appeal.traci

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/Command.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,386 @@ + + + + + +Uses of Class it.polito.appeal.traci.protocol.Command (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.protocol.Command

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/RequestMessage.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,204 @@ + + + + + +Uses of Class it.polito.appeal.traci.protocol.RequestMessage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.protocol.RequestMessage

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseContainer.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,231 @@ + + + + + +Uses of Class it.polito.appeal.traci.protocol.ResponseContainer (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.protocol.ResponseContainer

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/ResponseMessage.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,204 @@ + + + + + +Uses of Class it.polito.appeal.traci.protocol.ResponseMessage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.protocol.ResponseMessage

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/class-use/StatusResponse.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,222 @@ + + + + + +Uses of Class it.polito.appeal.traci.protocol.StatusResponse (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Class
it.polito.appeal.traci.protocol.StatusResponse

+
+
+ +
+
+ + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/Command.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,426 @@ + + + + + +Command (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class Command

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.protocol.Command
    • +
    +
  • +
+
+
    +
  • +
    +
    public class Command
    +extends java.lang.Object
    +
    Represents a single TraCI command, with its identifier and content. It can + be used either as a request (i.e. from client to server) and as a response + (i.e. from server to client). The "command" term reflects the description + in the wiki. + Each command is characterized by a type identifier and a variable-sized + content. The command can be constructed either from a data block (a + Storage) or from scratch; its content can be read or written to a + Storage.
    +
    +
    Author:
    +
    Enrico Gueli <enrico.gueli@polito.it>
    +
    See Also:
    +
    Messages
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      Command​(int id) +
      Creates a command with a given identifier and an empty content.
      +
      Command​(Storage rawStorage) +
      Builds a command from a Storage received from the other endpoint.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      Storagecontent() +
      Returns the content.
      +
      intid() +
      Returns the type identifier.
      +
      intrawSize() +
      Returns the expected size of the serialized form of this command.
      +
      voidwriteRawTo​(Storage out) +
      Writes the serialized form of this command to the given Storage + object.
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Command

        +
        public Command​(Storage rawStorage)
        +
        Builds a command from a Storage received from the other endpoint. +

        + Note that this will advance the storage's internal pointer to the next + data.

        +
        +
        Parameters:
        +
        rawStorage - raw storage
        +
        +
      • +
      + + + +
        +
      • +

        Command

        +
        public Command​(int id)
        +
        Creates a command with a given identifier and an empty content.
        +
        +
        Parameters:
        +
        id - id
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        id

        +
        public int id()
        +
        Returns the type identifier.
        +
        +
        Returns:
        +
        the id
        +
        +
      • +
      + + + +
        +
      • +

        content

        +
        public Storage content()
        +
        Returns the content.
        +
        +
        Returns:
        +
        the content
        +
        +
      • +
      + + + +
        +
      • +

        writeRawTo

        +
        public void writeRawTo​(Storage out)
        +
        Writes the serialized form of this command to the given Storage + object. +

        + Note: this will advance the internal pointer of the given storage.

        +
        +
        Parameters:
        +
        out - output
        +
        +
      • +
      + + + +
        +
      • +

        rawSize

        +
        public int rawSize()
        +
        Returns the expected size of the serialized form of this command.
        +
        +
        Returns:
        +
        raw size
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-summary.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,193 @@ + + + + + +it.polito.appeal.traci.protocol (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Package it.polito.appeal.traci.protocol

+
+
+
    +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    Command +
    Represents a single TraCI command, with its identifier and content.
    +
    RequestMessage +
    Represents a TraCI messages used to send Commands from the client to + server (i.e. requests).
    +
    ResponseContainer +
    Represents all the information related to a given request.
    +
    ResponseMessage +
    Represents a message sent from the server.
    +
    StatusResponse 
    +
  • +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-tree.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,169 @@ + + + + + +it.polito.appeal.traci.protocol Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Hierarchy For Package it.polito.appeal.traci.protocol

+Package Hierarchies: + +
+
+
+

Class Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/package-use.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,262 @@ + + + + + +Uses of Package it.polito.appeal.traci.protocol (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+
+

Uses of Package
it.polito.appeal.traci.protocol

+
+
+ +
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/RequestMessage.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,368 @@ + + + + + +RequestMessage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class RequestMessage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.protocol.RequestMessage
    • +
    +
  • +
+
+
    +
  • +
    +
    public class RequestMessage
    +extends java.lang.Object
    +
    Represents a TraCI messages used to send Commands from the client to + server (i.e. requests). After construction, the commands are appended one + after one with append(Command). The whole message, along with its + length header, can be then retrieved in a serialized form via the + writeTo(DataOutputStream) method.
    +
    +
    Author:
    +
    Enrico Gueli <enrico.gueli@polito.it>
    +
    See Also:
    +
    TraCI/Protocol#Messages
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      RequestMessage() 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidappend​(Command c) +
      Adds a command to the tail of this message.
      +
      java.util.List<Command>commands() 
      voidwriteTo​(java.io.DataOutputStream dos) +
      Writes the commands to the specified DataOutputStream object, in + the same order as the calls of append(Command).
      +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RequestMessage

        +
        public RequestMessage()
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        append

        +
        public void append​(Command c)
        +
        Adds a command to the tail of this message.
        +
        +
        Parameters:
        +
        c - c
        +
        Throws:
        +
        java.lang.NullPointerException - if the command is null.
        +
        +
      • +
      + + + +
        +
      • +

        writeTo

        +
        public void writeTo​(java.io.DataOutputStream dos)
        +             throws java.io.IOException
        +
        Writes the commands to the specified DataOutputStream object, in + the same order as the calls of append(Command).
        +
        +
        Parameters:
        +
        dos - data output stream
        +
        Throws:
        +
        java.io.IOException - Exception
        +
        +
      • +
      + + + +
        +
      • +

        commands

        +
        public java.util.List<Command> commands()
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseContainer.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,402 @@ + + + + + +ResponseContainer (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ResponseContainer

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.protocol.ResponseContainer
    • +
    +
  • +
+
+
    +
  • +
    +
    public class ResponseContainer
    +extends java.lang.Object
    +
    Represents all the information related to a given request. It contains a + mandatory status response, an optional response command and an optional list + of sub-responses.
    +
    +
    Author:
    +
    Enrico Gueli <enrico.gueli@polito.it>
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ResponseContainer

        +
        public ResponseContainer​(StatusResponse status,
        +                         Command response,
        +                         java.util.List<Command> subResponses)
        +
        Constructor for a response container with status response, response + command and zero or more sub-responses.
        +
        +
        Parameters:
        +
        status - status
        +
        response - response
        +
        subResponses - sub response
        +
        +
      • +
      + + + +
        +
      • +

        ResponseContainer

        +
        public ResponseContainer​(StatusResponse status,
        +                         Command response)
        +
        Constructor for a response container with status response and a response + command.
        +
        +
        Parameters:
        +
        status - status
        +
        response - response
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getStatus

        +
        public StatusResponse getStatus()
        +
        Returns the status response
        +
        +
        Returns:
        +
        the status
        +
        +
      • +
      + + + +
        +
      • +

        getResponse

        +
        public Command getResponse()
        +
        +
        Returns:
        +
        the response command. It may return null if there is + no response to such command (i.e. a command that changes + something in the simulation state or the close command)
        +
        +
      • +
      + + + +
        +
      • +

        getSubResponses

        +
        public java.util.List<Command> getSubResponses()
        +
        +
        Returns:
        +
        the sub-responses of this response container. It may return + null if there are no sub-responses to such command + (i.e. commands different than CMD_SIMSTEP2)
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/ResponseMessage.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,387 @@ + + + + + +ResponseMessage (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class ResponseMessage

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.protocol.ResponseMessage
    • +
    +
  • +
+
+
    +
  • +
    +
    public class ResponseMessage
    +extends java.lang.Object
    +
    Represents a message sent from the server. A response message is made of an + ordered collection of status responses, response commands and/or sub-responses.
    +
    +
    Author:
    +
    Enrico Gueli <enrico.gueli@polito.it>
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Summary

      + + + + + + + + + + + + +
      Fields 
      Modifier and TypeFieldDescription
      static int[]STATUS_ONLY_RESPONSES +
      The list of IDs of responses that have no response commands.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      ResponseMessage​(java.io.DataInputStream dis) +
      Constructor that unpacks all the data from a DataInputStream, + populating the list of ResponseContainers.
      +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.util.List<ResponseContainer>responses() 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Field Detail

      + + + +
        +
      • +

        STATUS_ONLY_RESPONSES

        +
        public static final int[] STATUS_ONLY_RESPONSES
        +
        The list of IDs of responses that have no response commands.
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ResponseMessage

        +
        public ResponseMessage​(java.io.DataInputStream dis)
        +                throws java.io.IOException
        +
        Constructor that unpacks all the data from a DataInputStream, + populating the list of ResponseContainers. +

        + A response message is made of individual packets. It is assumed that the + first packet is always a status response. According to the status + response, different data are expected next: +

          +
        • if the status response is not Constants.RTYPE_OK, another + status response or the end of the stream are expected.
        • +
        • if the status ID is equal to Constants.CMD_SIMSTEP, it is + expected an integer representing N and N following sub-responses;
        • +
        • if the status ID matches one of the commands in + STATUS_ONLY_RESPONSES , it is expected another status response; +
        • if the status ID doesn't match any of the above, it is expected a + response command. +
        + A new ResponseMessage, collecting all the data that belong to the + same request, is built and appended to an internal list.
        +
        +
        Parameters:
        +
        dis - dis
        +
        Throws:
        +
        java.io.IOException - Exception
        +
        +
      • +
      +
    • +
    +
    + +
    + +
    +
  • +
+
+
+
+ + + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/protocol/StatusResponse.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,398 @@ + + + + + +StatusResponse (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class StatusResponse

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.protocol.StatusResponse
    • +
    +
  • +
+
+
    +
  • +
    +
    public class StatusResponse
    +extends java.lang.Object
    +
  • +
+
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      java.lang.Stringdescription() 
      intid() 
      intresult() 
      voidwriteTo​(Storage out) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        StatusResponse

        +
        public StatusResponse​(int id)
        +
      • +
      + + + +
        +
      • +

        StatusResponse

        +
        public StatusResponse​(int id,
        +                      int result,
        +                      java.lang.String description)
        +
      • +
      + + + +
        +
      • +

        StatusResponse

        +
        public StatusResponse​(Storage packet)
        +               throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        id

        +
        public int id()
        +
      • +
      + + + +
        +
      • +

        result

        +
        public int result()
        +
        +
        Returns:
        +
        the result
        +
        +
      • +
      + + + +
        +
      • +

        description

        +
        public java.lang.String description()
        +
        +
        Returns:
        +
        the description
        +
        +
      • +
      + + + +
        +
      • +

        writeTo

        +
        public void writeTo​(Storage out)
        +             throws java.io.IOException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/SumoTraciConnection.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,701 @@ + + + + + +SumoTraciConnection (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class SumoTraciConnection

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • it.polito.appeal.traci.SumoTraciConnection
    • +
    +
  • +
+
+
    +
  • +
    +
    public class SumoTraciConnection
    +extends java.lang.Object
    +
    Models a TCP/IP connection to a local or remote SUMO server via the TraCI + protocol.
    +
    +
    Author:
    +
    Enrico Gueli <enrico.gueli@gmail.com>, Mario Krumnow
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      SumoTraciConnection​(int remotePort) 
      SumoTraciConnection​(java.lang.String sumo_bin) 
      SumoTraciConnection​(java.lang.String configFile, + int randomSeed, + boolean useGeoOffset) 
      SumoTraciConnection​(java.lang.String sumo_bin, + java.lang.String configFile) 
      SumoTraciConnection​(java.lang.String sumo_bin, + java.lang.String net_file, + java.lang.String route_file) 
      SumoTraciConnection​(java.lang.String sumo_bin, + java.lang.String net_file, + java.lang.String route_file, + java.lang.String additional_file) 
      SumoTraciConnection​(java.lang.String sumo_bin, + java.lang.String net_file, + java.lang.String route_file, + java.lang.String additional_file, + java.lang.String gui_settings) 
      SumoTraciConnection​(java.net.SocketAddress sockAddr) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Concrete Methods 
      Modifier and TypeMethodDescription
      voidaddObserver​(Observer o) 
      voidaddOption​(java.lang.String option, + java.lang.String value) +
      Adds a custom option to the SUMO command line before executing it.
      +
      voidclose() +
      Closes the connection, quits the simulator, frees any stale + resource and makes all Vehicle instances inactive.
      +
      java.lang.Objectdo_job_get​(SumoCommand cmd) 
      voiddo_job_set​(SumoCommand cmd) 
      voiddo_subscription​(Subscription cs) 
      voiddo_timestep() 
      voiddo_timestep​(double targetTime) 
      booleanisClosed() +
      Returns true if the connection was closed by the user, or if + an IOException was thrown after the connection was made.
      +
      voidprintSumoError​(boolean b) 
      voidprintSumoOutput​(boolean b) 
      voidrunServer() +
      Runs a SUMO instance and tries to connect at it.
      +
      voidrunServer​(int _remotePort) +
      Runs a SUMO instance and tries to connect at it.
      +
      voidsetOrder​(int index) 
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String sumo_bin)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String sumo_bin,
        +                           java.lang.String net_file,
        +                           java.lang.String route_file)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String sumo_bin,
        +                           java.lang.String net_file,
        +                           java.lang.String route_file,
        +                           java.lang.String additional_file)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String sumo_bin,
        +                           java.lang.String net_file,
        +                           java.lang.String route_file,
        +                           java.lang.String additional_file,
        +                           java.lang.String gui_settings)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String sumo_bin,
        +                           java.lang.String configFile)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.lang.String configFile,
        +                           int randomSeed,
        +                           boolean useGeoOffset)
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(int remotePort)
        +                    throws java.io.IOException,
        +                           java.lang.InterruptedException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        java.lang.InterruptedException
        +
        +
      • +
      + + + +
        +
      • +

        SumoTraciConnection

        +
        public SumoTraciConnection​(java.net.SocketAddress sockAddr)
        +                    throws java.io.IOException,
        +                           java.lang.InterruptedException
        +
        +
        Throws:
        +
        java.io.IOException
        +
        java.lang.InterruptedException
        +
        +
      • +
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        addOption

        +
        public void addOption​(java.lang.String option,
        +                      java.lang.String value)
        +
        Adds a custom option to the SUMO command line before executing it.
        +
        +
        Parameters:
        +
        option - the option name, in long form (e.g. "no-warnings" + instead of "W") and without initial dashes
        +
        value - the option value, or null if the option has no + value
        +
        +
      • +
      + + + +
        +
      • +

        runServer

        +
        public void runServer()
        +               throws java.io.IOException
        +
        Runs a SUMO instance and tries to connect at it.
        +
        +
        Throws:
        +
        java.io.IOException - if something wrong occurs while starting SUMO or connecting + at it.
        +
        +
      • +
      + + + +
        +
      • +

        runServer

        +
        public void runServer​(int _remotePort)
        +               throws java.io.IOException
        +
        Runs a SUMO instance and tries to connect at it.
        +
        +
        Throws:
        +
        java.io.IOException - if something wrong occurs while starting SUMO or connecting + at it.
        +
        +
      • +
      + + + +
        +
      • +

        close

        +
        public void close()
        +
        Closes the connection, quits the simulator, frees any stale + resource and makes all Vehicle instances inactive.
        +
      • +
      + + + +
        +
      • +

        isClosed

        +
        public boolean isClosed()
        +
        Returns true if the connection was closed by the user, or if + an IOException was thrown after the connection was made.
        +
        +
        Returns:
        +
        boolean
        +
        See Also:
        +
        close()
        +
        +
      • +
      + + + +
        +
      • +

        do_job_set

        +
        public void do_job_set​(SumoCommand cmd)
        +                throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        do_job_get

        +
        public java.lang.Object do_job_get​(SumoCommand cmd)
        +                            throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        setOrder

        +
        public void setOrder​(int index)
        +              throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        do_timestep

        +
        public void do_timestep()
        +                 throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        do_timestep

        +
        public void do_timestep​(double targetTime)
        +                 throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        addObserver

        +
        public void addObserver​(Observer o)
        +
      • +
      + + + +
        +
      • +

        do_subscription

        +
        public void do_subscription​(Subscription cs)
        +                     throws java.lang.Exception
        +
        +
        Throws:
        +
        java.lang.Exception
        +
        +
      • +
      + + + +
        +
      • +

        printSumoOutput

        +
        public void printSumoOutput​(boolean b)
        +
      • +
      + + + +
        +
      • +

        printSumoError

        +
        public void printSumoError​(boolean b)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,350 @@ + + + + + +TraCIException (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TraCIException

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • +
        +
      • java.lang.Exception
      • +
      • +
          +
        • java.io.IOException
        • +
        • +
            +
          • it.polito.appeal.traci.TraCIException
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
    + +
    + +
    + +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        TraCIException

        +
        public TraCIException()
        +
      • +
      + + + +
        +
      • +

        TraCIException

        +
        public TraCIException​(java.lang.String msg)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedData.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,334 @@ + + + + + +TraCIException.UnexpectedData (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TraCIException.UnexpectedData

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • java.lang.Throwable
    • +
    • + +
    • +
    +
  • +
+
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      UnexpectedData​(java.lang.String what, + java.lang.Object expected, + java.lang.Object got) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UnexpectedData

        +
        public UnexpectedData​(java.lang.String what,
        +                      java.lang.Object expected,
        +                      java.lang.Object got)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedDatatype.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,333 @@ + + + + + +TraCIException.UnexpectedDatatype (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TraCIException.UnexpectedDatatype

+
+
+ +
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      UnexpectedDatatype​(int expected, + int got) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UnexpectedDatatype

        +
        public UnexpectedDatatype​(int expected,
        +                          int got)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/it/polito/appeal/traci/TraCIException.UnexpectedResponse.html 2020-04-27 22:06:58.000000000 +0000 @@ -0,0 +1,333 @@ + + + + + +TraCIException.UnexpectedResponse (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+ +
+
+ +

Class TraCIException.UnexpectedResponse

+
+
+ +
+ +
+
+
    +
  • + +
    + +
    + +
    +
      +
    • + + +

      Constructor Summary

      + + + + + + + + + + +
      Constructors 
      ConstructorDescription
      UnexpectedResponse​(int expected, + int got) 
      +
    • +
    +
    + +
    +
      +
    • + + +

      Method Summary

      +
        +
      • + + +

        Methods inherited from class java.lang.Throwable

        +addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • +
      +
        +
      • + + +

        Methods inherited from class java.lang.Object

        +clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • +
      +
    • +
    +
    +
  • +
+
+
+
    +
  • + +
    +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UnexpectedResponse

        +
        public UnexpectedResponse​(int expected,
        +                          int got)
        +
      • +
      +
    • +
    +
    +
  • +
+
+
+
+ +
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/external/jquery/jquery.js sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/external/jquery/jquery.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/external/jquery/jquery.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/external/jquery/jquery.js 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,10364 @@ +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var document = window.document; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + + + + var preservedScriptAttributes = { + type: true, + src: true, + noModule: true + }; + + function DOMEval( code, doc, node ) { + doc = doc || document; + + var i, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + if ( node[ i ] ) { + script[ i ] = node[ i ]; + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.3.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android <=4.0 only + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && Array.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + DOMEval( code ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android <=4.0 only + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-08-08 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement("fieldset"); + + try { + return !!fn( el ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID filter and find + if ( support.getById ) { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( el ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( el ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( el ) { + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE <=9 only + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + // Make a writable jQuery.Event from the native event object + var event = jQuery.event.fix( nativeEvent ); + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + /* eslint-disable max-len */ + + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, + + /* eslint-enable */ + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + div.style.position = "absolute"; + scrollboxSizeVal = div.offsetWidth === 36 || "absolute"; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }, + + cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style; + +// Return a css property mapped to a potentially vendor prefixed property +function vendorPropName( name ) { + + // Shortcut for names that are not vendor prefixed + if ( name in emptyStyle ) { + return name; + } + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a property mapped along what jQuery.cssProps suggests or to +// a vendor prefixed property. +function finalPropName( name ) { + var ret = jQuery.cssProps[ name ]; + if ( !ret ) { + ret = jQuery.cssProps[ name ] = vendorPropName( name ) || name; + } + return ret; +} + +function setPositiveNumber( elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + ) ); + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + val = curCSS( elem, dimension, styles ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox; + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + // Check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = valueIsBorderBox && + ( support.boxSizingReliable() || val === elem.style[ dimension ] ); + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + if ( val === "auto" || + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) { + + val = elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ]; + + // offsetWidth/offsetHeight provide border-box values + valueIsBorderBox = true; + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + if ( type === "number" ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra && boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ); + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && support.scrollboxSize() === styles.position ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && + ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || + jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = Date.now(); + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce++ ) + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + "throws": true + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( "\r\n"; + +// inject VBScript +document.write(IEBinaryToArray_ByteStr_Script); + +global.JSZipUtils._getBinaryFromXHR = function (xhr) { + var binary = xhr.responseBody; + var byteMapping = {}; + for ( var i = 0; i < 256; i++ ) { + for ( var j = 0; j < 256; j++ ) { + byteMapping[ String.fromCharCode( i + (j << 8) ) ] = + String.fromCharCode(i) + String.fromCharCode(j); + } + } + var rawBytes = IEBinaryToArray_ByteStr(binary); + var lastChr = IEBinaryToArray_ByteStr_Last(binary); + return rawBytes.replace(/[\s\S]/g, function( match ) { + return byteMapping[match]; + }) + lastChr; +}; + +// enforcing Stuk's coding style +// vim: set shiftwidth=4 softtabstop=4: + +},{}]},{},[1]) +; diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils-ie.min.js sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils-ie.min.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils-ie.min.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils-ie.min.js 2020-04-27 22:07:01.000000000 +0000 @@ -0,0 +1,10 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils.js sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/jquery/jszip-utils/dist/jszip-utils.js 2020-04-27 22:07:01.000000000 +0000 @@ -0,0 +1,118 @@ +/*! + +JSZipUtils - A collection of cross-browser utilities to go along with JSZip. + + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o + +(c) 2014 Stuart Knightley, David Duponchel +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. + +*/ +!function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g)","url":"add(java.lang.String,double,double,int,int,java.util.LinkedList)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"add(String, double, double, SumoColor, String, int)","url":"add(java.lang.String,double,double,de.tudresden.ws.container.SumoColor,java.lang.String,int)"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS","l":"add(String, int, double, String)","url":"add(java.lang.String,int,double,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"add(String, String, double, double, String)","url":"add(java.lang.String,java.lang.String,double,double,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"add(String, String, String, int, double, double, byte)","url":"add(java.lang.String,java.lang.String,java.lang.String,int,double,double,byte)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"add(String, SumoGeometry, SumoColor, boolean, String, int)","url":"add(java.lang.String,de.tudresden.ws.container.SumoGeometry,de.tudresden.ws.container.SumoColor,boolean,java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"add(String, SumoStringList)","url":"add(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"add(String)","url":"add(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"add(SumoLink)","url":"add(de.tudresden.ws.container.SumoLink)"},{"p":"de.tudresden.ws.container","c":"SumoGeometry","l":"add(SumoPosition2D)","url":"add(de.tudresden.ws.container.SumoPosition2D)"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"add(SumoTLSPhase)","url":"add(de.tudresden.ws.container.SumoTLSPhase)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"addAll(Collection)","url":"addAll(java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"addAll(Collection)","url":"addAll(java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"addAll(int, Collection)","url":"addAll(int,java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"addAll(int, Collection)","url":"addAll(int,java.util.Collection)"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"addCommand(int)"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"addCommand(int)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"addFull(String, String, String, String, String, String, String, String, String, String, String, String, String, int, int)","url":"addFull(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,int)"},{"p":"de.tudresden.sumo.util","c":"Observable","l":"addObserver(Observer)","url":"addObserver(de.tudresden.sumo.util.Observer)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"addObserver(Observer)","url":"addObserver(de.tudresden.sumo.util.Observer)"},{"p":"de.tudresden.ws","c":"Service","l":"addOption(String, String)","url":"addOption(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"addOption(String, String)","url":"addOption(java.lang.String,java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"addOption(String, String)","url":"addOption(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"addParam(String, String)","url":"addParam(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoTLSController","l":"addProgram(SumoTLSProgram)","url":"addProgram(de.tudresden.ws.container.SumoTLSProgram)"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"allowsContinuation"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"APPEND_STAGE"},{"p":"it.polito.appeal.traci.protocol","c":"RequestMessage","l":"append(Command)","url":"append(it.polito.appeal.traci.protocol.Command)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"appendDrivingStage(String, String, String, String)","url":"appendDrivingStage(java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"appendWaitingStage(String, double, String, String)","url":"appendWaitingStage(java.lang.String,double,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"appendWalkingStage(String, SumoStringList, double, double, double, String)","url":"appendWalkingStage(java.lang.String,de.tudresden.ws.container.SumoStringList,double,double,double,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"areal_detector"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"areal_detector"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"AREAL_DETECTOR_CONTEXT"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"AREAL_DETECTOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ARRIVALFLAG_LANE_CURRENT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ARRIVALFLAG_POS_MAX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ARRIVALFLAG_POS_RANDOM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ARRIVALFLAG_SPEED_CURRENT"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"arrivalPos"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"AUTOMATIC_CONTEXT_SUBSCRIPTION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"AUTOMATIC_VARIABLES_SUBSCRIPTION"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"b"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"changeLane(String, byte, double)","url":"changeLane(java.lang.String,byte,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"changeSublane(String, double)","url":"changeSublane(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"changeTarget(String, String)","url":"changeTarget(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"clear()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"clear()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"clearPending(String)","url":"clearPending(java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"close()"},{"p":"it.polito.appeal.traci","c":"CloseQuery","l":"CloseQuery(Socket)","url":"%3Cinit%3E(java.net.Socket)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_ADD_SUBSCRIPTION_FILTER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_CHANGELANE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_CHANGESUBLANE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_CHANGETARGET"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_CLEAR_PENDING_VEHICLES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_CLOSE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_BUSSTOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_CALIBRATOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_CHARGINGSTATION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_EDGE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_GUI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_INDUCTIONLOOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_LANE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_LANEAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_MEANDATA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_MULTIENTRYEXIT_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_OVERHEADWIRE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_PARKINGAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_PERSON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_POI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_REROUTER_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_ROUTEPROBE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_SIM_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_TL_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_VARIABLESPEEDSIGN_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GET_VEHICLETYPE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_GETVERSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_LOAD"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_MESSAGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_OPENGAP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_REROUTE_EFFORT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_REROUTE_TO_PARKING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_REROUTE_TRAVELTIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_RESUME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SAVE_SIMSTATE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_BUSSTOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_CALIBRATOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_CHARGINGSTATION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_EDGE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_FLOW"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_GUI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_LANE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_OVERHEADWIRE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_PARKINGAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_PERSON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_POI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_REROUTER_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_ROUTEPROBE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_SIM_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_TL_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_VARIABLESPEEDSIGN_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SET_VEHICLETYPE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SETORDER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SIMSTEP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SLOWDOWN"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_STOP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_BUSSTOP_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_BUSSTOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_CALIBRATOR_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_CALIBRATOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_EDGE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_EDGE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_GUI_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_GUI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_JUNCTION_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_LANE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_LANE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_LANEAREA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_LANEAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_MEANDATA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_MEANDATA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_PARKINGAREA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_PARKINGAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_PERSON_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_PERSON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_POI_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_POI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_POLYGON_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_REROUTER_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_REROUTER_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_ROUTE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_SIM_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_SIM_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_TL_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_TL_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VEHICLE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"Command(int)","url":"%3Cinit%3E(int)"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"Command(Storage)","url":"%3Cinit%3E(de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"CommandProcessor(Socket)","url":"%3Cinit%3E(java.net.Socket)"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"commands"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"commands"},{"p":"it.polito.appeal.traci.protocol","c":"RequestMessage","l":"commands()"},{"p":"de.tudresden.ws.conf","c":"Config","l":"config_file"},{"p":"de.tudresden.ws.conf","c":"Config","l":"Config()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"conn"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"Constants()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"containerTriggered"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"contains(Object)","url":"contains(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"contains(Object)","url":"contains(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"containsAll(Collection)","url":"containsAll(java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"containsAll(Collection)","url":"containsAll(java.util.Collection)"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"content()"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"context"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"contextDomain"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"contextRange"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"ContextSubscription()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"ContextSubscription(SubscriptionContext, double, double, String, SumoDomain, double)","url":"%3Cinit%3E(de.tudresden.sumo.subscription.SubscriptionContext,double,double,java.lang.String,de.tudresden.sumo.subscription.SumoDomain,double)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"convert2D(String, double, byte, String)","url":"convert2D(java.lang.String,double,byte,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"convert3D(String, double, byte, String)","url":"convert3D(java.lang.String,double,byte,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"convertGeo(double, double, boolean)","url":"convertGeo(double,double,boolean)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"ConvertHelper(Log)","url":"%3Cinit%3E(de.tudresden.ws.log.Log)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"convertRoad(double, double, boolean, String)","url":"convertRoad(double,double,boolean,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoGeometry","l":"coords"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"COPY"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"cost"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"currentPhaseIndex"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"debug()"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"depart"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_CONTAINER_TRIGGERED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_LANE_ALLOWED_FREE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_LANE_BEST_FREE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_LANE_FIRST_ALLOWED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_LANE_FREE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_LANE_RANDOM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_NOW"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_POS_BASE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_POS_FREE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_POS_LAST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_POS_RANDOM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_POS_RANDOM_FREE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_SPEED_MAX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_SPEED_RANDOM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DEPARTFLAG_TRIGGERED"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"departPos"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"description"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"description()"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"destStop"},{"p":"de.tudresden.ws.conf","c":"Config","l":"df"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"direction"},{"p":"de.tudresden.ws.container","c":"SumoLeader","l":"dist"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"DISTANCE_REQUEST"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_close()"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_job_get(SumoCommand)","url":"do_job_get(de.tudresden.sumo.util.SumoCommand)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"do_job_get(SumoCommand)","url":"do_job_get(de.tudresden.sumo.util.SumoCommand)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_job_set(SumoCommand)","url":"do_job_set(de.tudresden.sumo.util.SumoCommand)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"do_job_set(SumoCommand)","url":"do_job_set(de.tudresden.sumo.util.SumoCommand)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_setOrder(int)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_SimulationStep(double)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"do_subscription(Subscription)","url":"do_subscription(de.tudresden.sumo.subscription.Subscription)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"do_subscription(Subscription)","url":"do_subscription(de.tudresden.sumo.subscription.Subscription)"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"do_timestep()"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"do_timestep()"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"do_timestep(double)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"doClose()"},{"p":"it.polito.appeal.traci","c":"CloseQuery","l":"doCommand()"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"domain"},{"p":"de.tudresden.sumo.util","c":"Query","l":"doQuery(RequestMessage)","url":"doQuery(it.polito.appeal.traci.protocol.RequestMessage)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"doQuerySingle(Command)","url":"doQuerySingle(it.polito.appeal.traci.protocol.Command)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"doSetOrder(int)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"doSimulationStep(double)"},{"p":"de.tudresden.ws","c":"Service","l":"doTimestep()"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"doTimestep()"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"duration"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"edge"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"edge"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_adaptTraveltime(String, int)","url":"Edge_adaptTraveltime(java.lang.String,int)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"EDGE_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getAdaptedTraveltime(String, int)","url":"Edge_getAdaptedTraveltime(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getCO2Emission(String)","url":"Edge_getCO2Emission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getCOEmission(String)","url":"Edge_getCOEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getEffort(String, int)","url":"Edge_getEffort(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getElectricityConsumption(String)","url":"Edge_getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getFuelConsumption(String)","url":"Edge_getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getHCEmission(String)","url":"Edge_getHCEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepHaltingNumber(String)","url":"Edge_getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepLength(String)","url":"Edge_getLastStepLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepMeanSpeed(String)","url":"Edge_getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepOccupancy(String)","url":"Edge_getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepVehicleIDs(String)","url":"Edge_getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getLastStepVehicleNumber(String)","url":"Edge_getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getNoiseEmission(String)","url":"Edge_getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getNOxEmission(String)","url":"Edge_getNOxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getPMxEmission(String)","url":"Edge_getPMxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getTraveltime(String)","url":"Edge_getTraveltime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_getWaitingTime(String)","url":"Edge_getWaitingTime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_setEffort(String, double)","url":"Edge_setEffort(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Edge_setMaxSpeed(String, double)","url":"Edge_setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"EDGE_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"Edge()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoRoadPosition","l":"edgeID"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"edges"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"edges"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"entry_time"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_DOWNSTREAM_DIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_FIELD_OF_VISION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_LANES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_LATERAL_DIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_LEAD_FOLLOW"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_NONE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_NOOPPOSITE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_TURN"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_UPSTREAM_DIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_VCLASS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FILTER_TYPE_VTYPE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FIND_INTERMODAL_ROUTE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"FIND_ROUTE"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"findIntermodalRoute(String, String, String, double, int, double, double, double, double, double, String, String, String)","url":"findIntermodalRoute(java.lang.String,java.lang.String,java.lang.String,double,int,double,double,double,double,double,java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"findRoute(String, String, String, double, int)","url":"findRoute(java.lang.String,java.lang.String,java.lang.String,double,int)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"fireAndForget(Command)","url":"fireAndForget(it.polito.appeal.traci.protocol.Command)"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"from"},{"p":"de.tudresden.ws.container","c":"SumoGeometry","l":"fromString(String)","url":"fromString(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"g"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"GENERIC_ATTRIBUTE"},{"p":"de.tudresden.ws.conf","c":"Config","l":"get_actiontime()"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"get_cmd(SumoCommand)","url":"get_cmd(de.tudresden.sumo.util.SumoCommand)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"get_command()"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"get_raw()"},{"p":"de.tudresden.ws","c":"Service","l":"get_Status(String)","url":"get_Status(java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"get_Status(String)","url":"get_Status(java.lang.String)"},{"p":"de.tudresden.ws.conf","c":"Config","l":"get_url()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"get(int)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"get(int)"},{"p":"de.tudresden.ws.container","c":"SumoTLSController","l":"get(String)","url":"get(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getAccel(String)","url":"getAccel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getAccel(String)","url":"getAccel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getAccumulatedWaitingTime(String)","url":"getAccumulatedWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getActionStepLength(String)","url":"getActionStepLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getAdaptedTraveltime(String, double, String)","url":"getAdaptedTraveltime(java.lang.String,double,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getAdaptedTraveltime(String, double)","url":"getAdaptedTraveltime(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getAllowed(String)","url":"getAllowed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getAllowedSpeed(String)","url":"getAllowedSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getAngle(String)","url":"getAngle(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getAngle(String)","url":"getAngle(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getApparentDecel(String)","url":"getApparentDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getApparentDecel(String)","url":"getApparentDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getArrivedIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getArrivedNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getBestLanes(String)","url":"getBestLanes(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"getBoundary(String)","url":"getBoundary(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getBoundingBox(Object)","url":"getBoundingBox(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getBusStopWaiting()"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getByte(Object)","url":"getByte(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getCO2Emission(String)","url":"getCO2Emission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getCO2Emission(String)","url":"getCO2Emission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getCO2Emission(String)","url":"getCO2Emission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getCOEmission(String)","url":"getCOEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getCOEmission(String)","url":"getCOEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getCOEmission(String)","url":"getCOEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getCollidingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getCollidingVehiclesNumber()"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getColor(Object)","url":"getColor(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getColor(String)","url":"getColor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getColor(String)","url":"getColor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getColor(String)","url":"getColor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getColor(String)","url":"getColor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getColor(String)","url":"getColor(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"getCommand()"},{"p":"de.tudresden.sumo.subscription","c":"Subscription","l":"getCommand()"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"getCommand()"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getCompleteRedYellowGreenDefinition(String)","url":"getCompleteRedYellowGreenDefinition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getControlledJunctions(String)","url":"getControlledJunctions(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getControlledLanes(String)","url":"getControlledLanes(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getControlledLinks(String)","url":"getControlledLinks(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getCurrentTime()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getDecel(String)","url":"getDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getDecel(String)","url":"getDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getDeltaT()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getDepartedIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getDepartedNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getDisallowed(String)","url":"getDisallowed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getDistance(String)","url":"getDistance(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getDistance2D(double, double, double, double, boolean, boolean)","url":"getDistance2D(double,double,double,double,boolean,boolean)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getDistanceRoad(String, double, String, double, boolean)","url":"getDistanceRoad(java.lang.String,double,java.lang.String,double,boolean)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getDouble(Object)","url":"getDouble(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getDrivingDistance(String, String, double, byte)","url":"getDrivingDistance(java.lang.String,java.lang.String,double,byte)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getDrivingDistance2D(String, double, double)","url":"getDrivingDistance2D(java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getEdgeID(String)","url":"getEdgeID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getEdges(String, int)","url":"getEdges(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getEdges(String)","url":"getEdges(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"getEdges(String)","url":"getEdges(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getEffort(String, double, String)","url":"getEffort(java.lang.String,double,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getEffort(String, double)","url":"getEffort(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getElectricityConsumption(String)","url":"getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getElectricityConsumption(String)","url":"getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getElectricityConsumption(String)","url":"getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getEmergencyDecel(String)","url":"getEmergencyDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getEmergencyDecel(String)","url":"getEmergencyDecel(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getEmergencyStoppingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getEmergencyStoppingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getEmissionClass(String)","url":"getEmissionClass(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getEmissionClass(String)","url":"getEmissionClass(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getEndingTeleportIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getEndingTeleportNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getExternalState(String)","url":"getExternalState(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getFilled(String)","url":"getFilled(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getFoes(String, String)","url":"getFoes(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getFuelConsumption(String)","url":"getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getFuelConsumption(String)","url":"getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getFuelConsumption(String)","url":"getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getHCEmission(String)","url":"getHCEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getHCEmission(String)","url":"getHCEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getHCEmission(String)","url":"getHCEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getHeight(String)","url":"getHeight(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getHeight(String)","url":"getHeight(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"getID()"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"getID()"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"getID()"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"getID()"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Junction","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getIDCount()"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Junction","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getImperfection(String)","url":"getImperfection(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getImperfection(String)","url":"getImperfection(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getInt(Object)","url":"getInt(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getInternalFoes(String)","url":"getInternalFoes(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getJamLengthMeters(String)","url":"getJamLengthMeters(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getJamLengthVehicle(String)","url":"getJamLengthVehicle(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLaneChangeMode(String)","url":"getLaneChangeMode(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLaneChangeState(String, int)","url":"getLaneChangeState(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLaneID(String)","url":"getLaneID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLaneID(String)","url":"getLaneID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLaneID(String)","url":"getLaneID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLaneIndex(String)","url":"getLaneIndex(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getLaneLinks(Object)","url":"getLaneLinks(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLaneNumber(String)","url":"getLaneNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getLanePosition(String)","url":"getLanePosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLanePosition(String)","url":"getLanePosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLastActionTime(String)","url":"getLastActionTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepHaltingNumber(String)","url":"getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepHaltingNumber(String)","url":"getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLastStepHaltingNumber(String)","url":"getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getLastStepHaltingNumber(String)","url":"getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepLength(String)","url":"getLastStepLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepLength(String)","url":"getLastStepLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLastStepMeanLength(String)","url":"getLastStepMeanLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepMeanSpeed(String)","url":"getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLastStepMeanSpeed(String)","url":"getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepMeanSpeed(String)","url":"getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLastStepMeanSpeed(String)","url":"getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getLastStepMeanSpeed(String)","url":"getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepOccupancy(String)","url":"getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLastStepOccupancy(String)","url":"getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepOccupancy(String)","url":"getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLastStepOccupancy(String)","url":"getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepPersonIDs(String)","url":"getLastStepPersonIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepVehicleIDs(String)","url":"getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLastStepVehicleIDs(String)","url":"getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepVehicleIDs(String)","url":"getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLastStepVehicleIDs(String)","url":"getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getLastStepVehicleIDs(String)","url":"getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getLastStepVehicleNumber(String)","url":"getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getLastStepVehicleNumber(String)","url":"getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLastStepVehicleNumber(String)","url":"getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLastStepVehicleNumber(String)","url":"getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"getLastStepVehicleNumber(String)","url":"getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLateralAlignment(String)","url":"getLateralAlignment(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getLateralAlignment(String)","url":"getLateralAlignment(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLateralLanePosition(String)","url":"getLateralLanePosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLeader(String, double)","url":"getLeader(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLength(String)","url":"getLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getLength(String)","url":"getLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getLength(String)","url":"getLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLength(String)","url":"getLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getLength(String)","url":"getLength(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getLine(String)","url":"getLine(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLinkNumber(String)","url":"getLinkNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getLinks(String)","url":"getLinks(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getLoadedIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getLoadedNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getMaxSpeed(String)","url":"getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getMaxSpeed(String)","url":"getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getMaxSpeed(String)","url":"getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getMaxSpeedLat(String)","url":"getMaxSpeedLat(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getMaxSpeedLat(String)","url":"getMaxSpeedLat(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getMinExpectedNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getMinGap(String)","url":"getMinGap(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getMinGap(String)","url":"getMinGap(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getMinGap(String)","url":"getMinGap(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getMinGapLat(String)","url":"getMinGapLat(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getMinGapLat(String)","url":"getMinGapLat(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getNetBoundary()"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getNextEdge(String)","url":"getNextEdge(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getNextStops(String)","url":"getNextStops(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getNextSwitch(String)","url":"getNextSwitch(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getNextTLS(String)","url":"getNextTLS(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getNoiseEmission(String)","url":"getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getNoiseEmission(String)","url":"getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getNoiseEmission(String)","url":"getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getNOxEmission(String)","url":"getNOxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getNOxEmission(String)","url":"getNOxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getNOxEmission(String)","url":"getNOxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"getOffset(String)","url":"getOffset(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"getOutStream()"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getParameter(String, String)","url":"getParameter(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getParkingEndingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getParkingEndingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getParkingStartingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getParkingStartingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getPersonIDList(String)","url":"getPersonIDList(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getPersonNumber(String)","url":"getPersonNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getPersonNumber(String)","url":"getPersonNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getPhase(String)","url":"getPhase(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getPhaseDuration(String)","url":"getPhaseDuration(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getPhaseName(String)","url":"getPhaseName(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getPMxEmission(String)","url":"getPMxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getPMxEmission(String)","url":"getPMxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getPMxEmission(String)","url":"getPMxEmission(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getPolygon(Object)","url":"getPolygon(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"getPos()"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Junction","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getPosition(String)","url":"getPosition(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getPosition2D(Object)","url":"getPosition2D(java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getPosition3D(Object)","url":"getPosition3D(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getPosition3D(String)","url":"getPosition3D(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getPosition3D(String)","url":"getPosition3D(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getProgram(String)","url":"getProgram(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"getRedYellowGreenState(String)","url":"getRedYellowGreenState(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getRemainingStages(String)","url":"getRemainingStages(java.lang.String)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseContainer","l":"getResponse()"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getRoadID(String)","url":"getRoadID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getRoadID(String)","url":"getRoadID(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getRoadPosition(Object)","url":"getRoadPosition(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getRoute(String)","url":"getRoute(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getRouteID(String)","url":"getRouteID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getRouteIndex(String)","url":"getRouteIndex(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getRoutingMode(String)","url":"getRoutingMode(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"getSchema(String)","url":"getSchema(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Junction","l":"getShape(String)","url":"getShape(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getShape(String)","url":"getShape(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getShape(String)","url":"getShape(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getShapeClass(String)","url":"getShapeClass(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getShapeClass(String)","url":"getShapeClass(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSignals(String)","url":"getSignals(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSlope(String)","url":"getSlope(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getSpeed(String)","url":"getSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSpeed(String)","url":"getSpeed(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSpeedDeviation(String)","url":"getSpeedDeviation(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getSpeedDeviation(String)","url":"getSpeedDeviation(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSpeedFactor(String)","url":"getSpeedFactor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getSpeedFactor(String)","url":"getSpeedFactor(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSpeedMode(String)","url":"getSpeedMode(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getSpeedWithoutTraCI(String)","url":"getSpeedWithoutTraCI(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getStage(String, int)","url":"getStage(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStartingTeleportIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStartingTeleportNumber()"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignal","l":"getState(SumoVehicleSignalState)","url":"getState(de.tudresden.ws.container.SumoVehicleSignalState)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseContainer","l":"getStatus()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStopEndingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStopEndingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStopStartingVehiclesIDList()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getStopStartingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getStopState(String)","url":"getStopState(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"getStorageList()"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getString(Object)","url":"getString(java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getStringList(Object)","url":"getStringList(java.lang.Object)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseContainer","l":"getSubResponses()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getTau(String)","url":"getTau(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getTau(String)","url":"getTau(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"getTime()"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getTimeSinceDetection(String)","url":"getTimeSinceDetection(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getTLSProgram(Object)","url":"getTLSProgram(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getTraveltime(String)","url":"getTraveltime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getTraveltime(String)","url":"getTraveltime(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"getType(int)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"getType(String)","url":"getType(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"getType(String)","url":"getType(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getTypeID(String)","url":"getTypeID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getTypeID(String)","url":"getTypeID(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getVehicle(String)","url":"getVehicle(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getVehicleClass(String)","url":"getVehicleClass(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getVehicleClass(String)","url":"getVehicleClass(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"ConvertHelper","l":"getVehicleData(Object)","url":"getVehicleData(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"getVehicleData(String)","url":"getVehicleData(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getVia(String)","url":"getVia(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"getWaitingTime(String)","url":"getWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getWaitingTime(String)","url":"getWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getWaitingTime(String)","url":"getWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getWaitingTime(String)","url":"getWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"getWidth(String)","url":"getWidth(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"getWidth(String)","url":"getWidth(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"getWidth(String)","url":"getWidth(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"getWidth(String)","url":"getWidth(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"getZoom(String)","url":"getZoom(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"gui"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"gui"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_clearPending(String)","url":"GUI_clearPending(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"GUI_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_getBoundary(String)","url":"GUI_getBoundary(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_getOffset(String)","url":"GUI_getOffset(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_getSchema(String)","url":"GUI_getSchema(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_getZoom(String)","url":"GUI_getZoom(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_screenshot(String, String)","url":"GUI_screenshot(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_setBoundary(String, double, double, double, double)","url":"GUI_setBoundary(java.lang.String,double,double,double,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_setOffset(String, double, double)","url":"GUI_setOffset(java.lang.String,double,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_setSchema(String, String)","url":"GUI_setSchema(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_setZoom(String, double)","url":"GUI_setZoom(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"GUI_trackVehicle(String, String)","url":"GUI_trackVehicle(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"GUI_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"Gui()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"hasApproachingFoe"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"hasPriority"},{"p":"de.tudresden.ws.conf","c":"Config","l":"host"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"id"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ID_COUNT"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"id()"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"id()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"indexOf(Object)","url":"indexOf(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"indexOf(Object)","url":"indexOf(java.lang.Object)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"INDUCTIONLOOP_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLaneID(String)","url":"Inductionloop_getLaneID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLastStepMeanLength(String)","url":"Inductionloop_getLastStepMeanLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLastStepMeanSpeed(String)","url":"Inductionloop_getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLastStepOccupancy(String)","url":"Inductionloop_getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLastStepVehicleIDs(String)","url":"Inductionloop_getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getLastStepVehicleNumber(String)","url":"Inductionloop_getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getPosition(String)","url":"Inductionloop_getPosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getTimeSinceDetection(String)","url":"Inductionloop_getTimeSinceDetection(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Inductionloop_getVehicleData(String)","url":"Inductionloop_getVehicleData(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"INDUCTIONLOOP_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Inductionloop","l":"Inductionloop()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"inductive_loop"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"inductive_loop"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"inductive_loops"},{"p":"de.tudresden.ws","c":"Traci","l":"init(Sumo, Log, ConvertHelper)","url":"init(de.tudresden.sumo.util.Sumo,de.tudresden.ws.log.Log,de.tudresden.sumo.util.ConvertHelper)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"input1"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"input2"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"intended"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"internalLane"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"INVALID_DOUBLE_VALUE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"INVALID_INT_VALUE"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isAtBusStop(String)","url":"isAtBusStop(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isAtContainerStop(String)","url":"isAtContainerStop(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"isBusStop"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"isChargingStationStop"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"isClosed()"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"isContainerStop"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"isContext()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"isEmpty()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"isEmpty()"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"isOpen"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"isParkingAreaStop"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isRouteValid(String)","url":"isRouteValid(java.lang.String)"},{"p":"de.tudresden.ws","c":"ShutdownHook","l":"isshutdown()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isStopped(String)","url":"isStopped(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isStoppedParking(String)","url":"isStoppedParking(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"isStoppedTriggered(String)","url":"isStoppedTriggered(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLeader","l":"isValid()"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"isVariable()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"iterator()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"iterator()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"JAM_LENGTH_METERS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"JAM_LENGTH_VEHICLE"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"junction"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"junction"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"junction"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"JUNCTION_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Junction_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Junction_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Junction_getPosition(String)","url":"Junction_getPosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Junction_getShape(String)","url":"Junction_getShape(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Junction","l":"Junction()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"lane"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"lane"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LANE_ALLOWED"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"LANE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LANE_DISALLOWED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LANE_EDGE_ID"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getAllowed(String)","url":"Lane_getAllowed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getCO2Emission(String)","url":"Lane_getCO2Emission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getCOEmission(String)","url":"Lane_getCOEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getDisallowed(String)","url":"Lane_getDisallowed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getEdgeID(String)","url":"Lane_getEdgeID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getElectricityConsumption(String)","url":"Lane_getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getFuelConsumption(String)","url":"Lane_getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getHCEmission(String)","url":"Lane_getHCEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepHaltingNumber(String)","url":"Lane_getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepLength(String)","url":"Lane_getLastStepLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepMeanSpeed(String)","url":"Lane_getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepOccupancy(String)","url":"Lane_getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepVehicleIDs(String)","url":"Lane_getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLastStepVehicleNumber(String)","url":"Lane_getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLength(String)","url":"Lane_getLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLinkNumber(String)","url":"Lane_getLinkNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getLinks(String)","url":"Lane_getLinks(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getMaxSpeed(String)","url":"Lane_getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getNoiseEmission(String)","url":"Lane_getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getNOxEmission(String)","url":"Lane_getNOxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getPMxEmission(String)","url":"Lane_getPMxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getShape(String)","url":"Lane_getShape(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getTraveltime(String)","url":"Lane_getTraveltime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getWaitingTime(String)","url":"Lane_getWaitingTime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_getWidth(String)","url":"Lane_getWidth(java.lang.String)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LANE_LINK_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LANE_LINKS"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_setAllowed(String, SumoStringList)","url":"Lane_setAllowed(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_setDisallowed(String, SumoStringList)","url":"Lane_setDisallowed(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_setLength(String, double)","url":"Lane_setLength(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lane_setMaxSpeed(String, double)","url":"Lane_setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"LANE_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"Lane()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getJamLengthMeters(String)","url":"Lanearea_getJamLengthMeters(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getJamLengthVehicle(String)","url":"Lanearea_getJamLengthVehicle(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getLastStepMeanSpeed(String)","url":"Lanearea_getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Lanearea_getLastStepOccupancy(String)","url":"Lanearea_getLastStepOccupancy(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lanearea","l":"Lanearea()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"laneID"},{"p":"de.tudresden.ws.container","c":"SumoRoadPosition","l":"laneIndex"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"lanes"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_LENGTH"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_MEAN_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_OCCUPANCY"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_PERSON_ID_LIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_TIME_SINCE_DETECTION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_VEHICLE_DATA"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_VEHICLE_HALTING_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_VEHICLE_ID_LIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LAST_STEP_VEHICLE_NUMBER"},{"p":"de.tudresden.ws.conf","c":"Config","l":"lastactiontime"},{"p":"de.tudresden.ws","c":"Service","l":"LastActionTime()"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"LastActionTime()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"lastIndexOf(Object)","url":"lastIndexOf(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"lastIndexOf(Object)","url":"lastIndexOf(java.lang.Object)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_AMBACKBLOCKER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_AMBACKBLOCKER_STANDING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_AMBLOCKINGFOLLOWER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_AMBLOCKINGFOLLOWER_DONTBRAKE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_AMBLOCKINGLEADER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_FOLLOWER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_LEADER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_LEFT_FOLLOWER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_LEFT_LEADER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_RIGHT_FOLLOWER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_BY_RIGHT_LEADER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_LEFT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_BLOCKED_RIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_CHANGE_REASONS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_CHANGE_TO_HELP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_COOPERATIVE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_INSUFFICIENT_SPACE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_INSUFFICIENT_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_KEEPRIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_LEFT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_MLEFT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_MRIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_NONE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_OVERLAPPING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_RIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_SPEEDGAIN"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_STAY"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_STRATEGIC"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_SUBLANE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_TRACI"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_UNKNOWN"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_URGENT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_WANTS_LANECHANGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"LCA_WANTS_LANECHANGE_OR_STAY"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"leave_time"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"length"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"length"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"length"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"length"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"line"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"listIterator()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"listIterator()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"listIterator(int)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"listIterator(int)"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes","l":"ll"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"ll"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS","l":"ll"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData","l":"ll"},{"p":"de.tudresden.ws.log","c":"Log_txt","l":"Log_txt()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.conf","c":"Config","l":"logger"},{"p":"de.tudresden.ws","c":"WebService","l":"main(String[])","url":"main(java.lang.String[])"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"MAX_ORDER"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"maxDur"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"me_detector"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"me_detector"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"minDur"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"MOVE_TO_XY"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"moveTo(String, String, double)","url":"moveTo(java.lang.String,java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"moveToXY(String, String, double, double, double, byte)","url":"moveToXY(java.lang.String,java.lang.String,double,double,double,byte)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"moveToXY(String, String, int, double, double, double, byte)","url":"moveToXY(java.lang.String,java.lang.String,int,double,double,double,byte)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"MULTI_ENTRY_EXIT_DETECTOR_CONTEXT"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"MULTI_ENTRY_EXIT_DETECTOR_VARIABLE"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getLastStepHaltingNumber(String)","url":"Multientryexit_getLastStepHaltingNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getLastStepMeanSpeed(String)","url":"Multientryexit_getLastStepMeanSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getLastStepVehicleIDs(String)","url":"Multientryexit_getLastStepVehicleIDs(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Multientryexit_getLastStepVehicleNumber(String)","url":"Multientryexit_getLastStepVehicleNumber(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Multientryexit","l":"Multientryexit()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"name"},{"p":"de.tudresden.ws.conf","c":"Config","l":"name"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"name"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"next"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS.NextTLS","l":"NextTLS(String, int, double, String)","url":"%3Cinit%3E(java.lang.String,int,double,java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"Observable","l":"notifyObservers(SubscriptionObject)","url":"notifyObservers(de.tudresden.sumo.subscription.SubscriptionObject)"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"notInternalLane"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"object"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"objectID"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"objectID"},{"p":"de.tudresden.sumo.util","c":"Observable","l":"Observable()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"occupation"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"offset"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"over"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"params"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"parking"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"person"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"person"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"PERSON_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getAngle(String)","url":"Person_getAngle(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getColor(String)","url":"Person_getColor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getLanePosition(String)","url":"Person_getLanePosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getLength(String)","url":"Person_getLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getMinGap(String)","url":"Person_getMinGap(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getPersonNumber(String)","url":"Person_getPersonNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getPosition(String)","url":"Person_getPosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getPosition3D(String)","url":"Person_getPosition3D(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getRoadID(String)","url":"Person_getRoadID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getSpeed(String)","url":"Person_getSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getTypeID(String)","url":"Person_getTypeID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Person_getWaitingTime(String)","url":"Person_getWaitingTime(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"PERSON_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"Person()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"persons"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"phasedef"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"phases"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"poi"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"poi"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"poi"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_add(String, double, double, SumoColor, String, int)","url":"Poi_add(java.lang.String,double,double,de.tudresden.ws.container.SumoColor,java.lang.String,int)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"POI_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_getColor(String)","url":"Poi_getColor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_getPosition(String)","url":"Poi_getPosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_getType(String)","url":"Poi_getType(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_remove(String, int)","url":"Poi_remove(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_setColor(String, SumoColor)","url":"Poi_setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_setPosition(String, double, double)","url":"Poi_setPosition(java.lang.String,double,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Poi_setType(String, String)","url":"Poi_setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"POI_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"Poi()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"polygon"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"polygon"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_add(String, SumoGeometry, SumoColor, boolean, String, int)","url":"Polygon_add(java.lang.String,de.tudresden.ws.container.SumoGeometry,de.tudresden.ws.container.SumoColor,boolean,java.lang.String,int)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"POLYGON_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_getColor(String)","url":"Polygon_getColor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_getShape(String)","url":"Polygon_getShape(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_getType(String)","url":"Polygon_getType(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_remove(String, int)","url":"Polygon_remove(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_setColor(String, SumoColor)","url":"Polygon_setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_setShape(String, SumoStringList)","url":"Polygon_setShape(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.ws","c":"Traci","l":"Polygon_setType(String, String)","url":"Polygon_setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"Polygon()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"polygons"},{"p":"de.tudresden.ws.conf","c":"Config","l":"port"},{"p":"de.tudresden.ws.container","c":"SumoRoadPosition","l":"pos"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_2D"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_3D"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_CONVERSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_LON_LAT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_LON_LAT_ALT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"POSITION_ROADMAP"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"position()"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"printSumoError(boolean)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"printSumoOutput(boolean)"},{"p":"de.tudresden.ws.container","c":"SumoTLSController","l":"programs"},{"p":"de.tudresden.sumo.util","c":"Query","l":"Query(Socket)","url":"%3Cinit%3E(java.net.Socket)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"queryAndVerify(RequestMessage)","url":"queryAndVerify(it.polito.appeal.traci.protocol.RequestMessage)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"queryAndVerifySingle(Command)","url":"queryAndVerifySingle(it.polito.appeal.traci.protocol.Command)"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"r"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"raw"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"rawSize()"},{"p":"de.tudresden.ws.conf","c":"Config","l":"read_config(String)","url":"read_config(java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"read(int, Storage)","url":"read(int,de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readByte()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readDouble()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readFloat()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readInt()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readShort()"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"readStage(Storage)","url":"readStage(de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readStringASCII()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readStringISOLATIN1()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readStringUTF16BE()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readStringUTF16LE()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readStringUTF8()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"readUnsignedByte()"},{"p":"de.tudresden.ws.conf","c":"Config","l":"refresh_actiontime()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_ARRIVED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_PARKING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_STAGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_TELEPORT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_TELEPORT_ARRIVED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REMOVE_VAPORIZED"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"remove(int)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"remove(int)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"remove(Object)","url":"remove(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"remove(Object)","url":"remove(java.lang.Object)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"remove(String, byte)","url":"remove(java.lang.String,byte)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"remove(String, int)","url":"remove(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"remove(String, int)","url":"remove(java.lang.String,int)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"removeAll(Collection)","url":"removeAll(java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"removeAll(Collection)","url":"removeAll(java.util.Collection)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"removeStage(String, int)","url":"removeStage(java.lang.String,int)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REPLACE_STAGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REQUEST_AIRDIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"REQUEST_DRIVINGDIST"},{"p":"it.polito.appeal.traci.protocol","c":"RequestMessage","l":"RequestMessage()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"rerouteEffort(String)","url":"rerouteEffort(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"rerouteParkingArea(String, String)","url":"rerouteParkingArea(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"rerouteTraveltime(String)","url":"rerouteTraveltime(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"rerouteTraveltime(String)","url":"rerouteTraveltime(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"reset()"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"response"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_BUSSTOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_CALIBRATOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_CHARGINGSTATION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_EDGE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_GUI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_INDUCTIONLOOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_LANE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_LANEAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_MEANDATA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_MULTIENTRYEXIT_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_OVERHEADWIRE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_PARKINGAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_PERSON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_POI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_REROUTER_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_ROUTEPROBE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_SIM_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_TL_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_GET_VEHICLETYPE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_EDGE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_EDGE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_GUI_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_GUI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_LANE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_LANE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_PERSON_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_PERSON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_POI_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_POI_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_POLYGON_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_POLYGON_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_REROUTER_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_REROUTER_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_ROUTE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_SIM_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_SIM_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_TL_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_TL_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseContainer","l":"ResponseContainer(StatusResponse, Command, List)","url":"%3Cinit%3E(it.polito.appeal.traci.protocol.StatusResponse,it.polito.appeal.traci.protocol.Command,java.util.List)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseContainer","l":"ResponseContainer(StatusResponse, Command)","url":"%3Cinit%3E(it.polito.appeal.traci.protocol.StatusResponse,it.polito.appeal.traci.protocol.Command)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseMessage","l":"ResponseMessage(DataInputStream)","url":"%3Cinit%3E(java.io.DataInputStream)"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseMessage","l":"responses()"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"result()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"resume(String)","url":"resume(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"retainAll(Collection)","url":"retainAll(java.util.Collection)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"retainAll(Collection)","url":"retainAll(java.util.Collection)"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"return_type"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"route"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"route"},{"p":"de.tudresden.ws","c":"Traci","l":"Route_add(String, SumoStringList)","url":"Route_add(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"ROUTE_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Route_getEdges(String)","url":"Route_getEdges(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Route_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Route_getIDList()"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"ROUTE_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"Route()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ROUTING_MODE_AGGREGATED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ROUTING_MODE_COMBINED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ROUTING_MODE_DEFAULT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"ROUTING_MODE_EFFORT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RTYPE_ERR"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RTYPE_NOTIMPLEMENTED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"RTYPE_OK"},{"p":"de.tudresden.ws","c":"ShutdownHook","l":"run()"},{"p":"de.tudresden.ws.conf","c":"Config","l":"running"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"runServer()"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"runServer(int)"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"saveState(String)","url":"saveState(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"screenshot(String, String)","url":"screenshot(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"ServiceImpl(Config)","url":"%3Cinit%3E(de.tudresden.ws.conf.Config)"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"set_cmd(Object)","url":"set_cmd(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"set(int, String)","url":"set(int,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"set(int, SumoLink)","url":"set(int,de.tudresden.ws.container.SumoLink)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setAccel(String, double)","url":"setAccel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setAccel(String, double)","url":"setAccel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setActionStepLength(String, double, boolean)","url":"setActionStepLength(java.lang.String,double,boolean)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setAdaptedTraveltime(String, double, double, String, double)","url":"setAdaptedTraveltime(java.lang.String,double,double,java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"setAllowed(String, SumoStringList)","url":"setAllowed(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setApparentDecel(String, double)","url":"setApparentDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setApparentDecel(String, double)","url":"setApparentDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"setBoundary(String, double, double, double, double)","url":"setBoundary(java.lang.String,double,double,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setBusStop(String, String, double, double)","url":"setBusStop(java.lang.String,java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setChargingStationStop(String, String, double, double)","url":"setChargingStationStop(java.lang.String,java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setColor(String, SumoColor)","url":"setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"setColor(String, SumoColor)","url":"setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"setColor(String, SumoColor)","url":"setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setColor(String, SumoColor)","url":"setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setColor(String, SumoColor)","url":"setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setCompleteRedYellowGreenDefinition(String, SumoTLSProgram)","url":"setCompleteRedYellowGreenDefinition(java.lang.String,de.tudresden.ws.container.SumoTLSProgram)"},{"p":"de.tudresden.ws","c":"Service","l":"setConfig(String)","url":"setConfig(java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"setConfig(String)","url":"setConfig(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setContainerStop(String, String, double, double)","url":"setContainerStop(java.lang.String,java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setDecel(String, double)","url":"setDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setDecel(String, double)","url":"setDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"setDisallowed(String, SumoStringList)","url":"setDisallowed(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"setEffort(String, double, double, double)","url":"setEffort(java.lang.String,double,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"setEffort(String, double)","url":"setEffort(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setEffort(String, int, int, String, double)","url":"setEffort(java.lang.String,int,int,java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setEmergencyDecel(String, double)","url":"setEmergencyDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setEmergencyDecel(String, double)","url":"setEmergencyDecel(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setEmissionClass(String, String)","url":"setEmissionClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setEmissionClass(String, String)","url":"setEmissionClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"setFilled(String, boolean)","url":"setFilled(java.lang.String,boolean)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setHeight(String, double)","url":"setHeight(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setHeight(String, double)","url":"setHeight(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setHeight(String, double)","url":"setHeight(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setImperfection(String, double)","url":"setImperfection(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setImperfection(String, double)","url":"setImperfection(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setLaneChangeMode(String, int)","url":"setLaneChangeMode(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setLateralAlignment(String, String)","url":"setLateralAlignment(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setLateralAlignment(String, String)","url":"setLateralAlignment(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"setLength(String, double)","url":"setLength(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setLength(String, double)","url":"setLength(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setLength(String, double)","url":"setLength(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setLength(String, double)","url":"setLength(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setLine(String, String)","url":"setLine(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"setMaxSpeed(String, double)","url":"setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"setMaxSpeed(String, double)","url":"setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setMaxSpeed(String, double)","url":"setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setMaxSpeed(String, double)","url":"setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setMaxSpeedLat(String, double)","url":"setMaxSpeedLat(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setMaxSpeedLat(String, double)","url":"setMaxSpeedLat(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setMinGap(String, double)","url":"setMinGap(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setMinGap(String, double)","url":"setMinGap(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setMinGap(String, double)","url":"setMinGap(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setMinGapLat(String, double)","url":"setMinGapLat(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setMinGapLat(String, double)","url":"setMinGapLat(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"setOffset(String, double, double)","url":"setOffset(java.lang.String,double,double)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"setOrder(int)"},{"p":"de.tudresden.sumo.cmd","c":"Edge","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Lane","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Route","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setParameter(String, String, String)","url":"setParameter(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setParkingAreaStop(String, String, double, double)","url":"setParkingAreaStop(java.lang.String,java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setPhase(String, int)","url":"setPhase(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setPhaseDuration(String, double)","url":"setPhaseDuration(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setPhaseName(String, String)","url":"setPhaseName(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"setPosition(String, double, double)","url":"setPosition(java.lang.String,double,double)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setProgram(String, String)","url":"setProgram(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"setRedYellowGreenState(String, String)","url":"setRedYellowGreenState(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setRoute(String, SumoStringList)","url":"setRoute(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setRouteID(String, String)","url":"setRouteID(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setRoutingMode(String, int)","url":"setRoutingMode(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"setSchema(String, String)","url":"setSchema(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"setShape(String, SumoStringList)","url":"setShape(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setShapeClass(String, String)","url":"setShapeClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setShapeClass(String, String)","url":"setShapeClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"ShutdownHook","l":"setshutdown(boolean)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setSignals(String, int)","url":"setSignals(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setSpeed(String, double)","url":"setSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setSpeed(String, double)","url":"setSpeed(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setSpeedDeviation(String, double)","url":"setSpeedDeviation(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setSpeedDeviation(String, double)","url":"setSpeedDeviation(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setSpeedFactor(String, double)","url":"setSpeedFactor(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setSpeedFactor(String, double)","url":"setSpeedFactor(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setSpeedMode(String, int)","url":"setSpeedMode(java.lang.String,int)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setStop(String, String, double, byte, double, SumoStopFlags, double, double)","url":"setStop(java.lang.String,java.lang.String,double,byte,double,de.tudresden.ws.container.SumoStopFlags,double,double)"},{"p":"de.tudresden.ws","c":"Service","l":"setSumoBinary(String)","url":"setSumoBinary(java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"setSumoBinary(String)","url":"setSumoBinary(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setTau(String, double)","url":"setTau(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setTau(String, double)","url":"setTau(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setType(String, String)","url":"setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Poi","l":"setType(String, String)","url":"setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Polygon","l":"setType(String, String)","url":"setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setType(String, String)","url":"setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setVehicleClass(String, String)","url":"setVehicleClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setVehicleClass(String, String)","url":"setVehicleClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setVia(String, SumoStringList)","url":"setVia(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.sumo.cmd","c":"Person","l":"setWidth(String, double)","url":"setWidth(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"setWidth(String, double)","url":"setWidth(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setWidth(String, double)","url":"setWidth(java.lang.String,double)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"setWidth(String, String)","url":"setWidth(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"setZoom(String, double)","url":"setZoom(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"ShutdownHook","l":"ShutdownHook()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"SIM_CONTEXT"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"SIM_VARIABLE"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"simulation"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"simulation"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_convert2D(String, double, byte, String)","url":"Simulation_convert2D(java.lang.String,double,byte,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_convert3D(String, double, byte, String)","url":"Simulation_convert3D(java.lang.String,double,byte,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_convertGeo(double, double, boolean)","url":"Simulation_convertGeo(double,double,boolean)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_convertRoad(double, double, boolean, String)","url":"Simulation_convertRoad(double,double,boolean,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getArrivedIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getArrivedNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getBusStopWaiting()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getCurrentTime()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getDeltaT()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getDepartedIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getDepartedNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getDistance2D(double, double, double, double, boolean, boolean)","url":"Simulation_getDistance2D(double,double,double,double,boolean,boolean)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getDistanceRoad(String, double, String, double, boolean)","url":"Simulation_getDistanceRoad(java.lang.String,double,java.lang.String,double,boolean)"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getEndingTeleportIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getEndingTeleportNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getLoadedIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getLoadedNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getMinExpectedNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getNetBoundary()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getParkingEndingVehiclesIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getParkingEndingVehiclesNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getParkingStartingVehiclesIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getParkingStartingVehiclesNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStartingTeleportIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStartingTeleportNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStopEndingVehiclesIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStopEndingVehiclesNumber()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStopStartingVehiclesIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Simulation_getStopStartingVehiclesNumber()"},{"p":"de.tudresden.sumo.cmd","c":"Simulation","l":"Simulation()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"size()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"size()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"size()"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"slowDown(String, double, double)","url":"slowDown(java.lang.String,double,double)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_ACCESS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_DRIVING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_TRANSHIP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_TRIP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_WAITING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_WAITING_FOR_DEPART"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STAGE_WALKING"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"start"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"start"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"start_ws()"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"start(String, String, String)","url":"start(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"start(String, String)","url":"start(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Service","l":"start(String)","url":"start(java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"start(String)","url":"start(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"state"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"status"},{"p":"it.polito.appeal.traci.protocol","c":"ResponseMessage","l":"STATUS_ONLY_RESPONSES"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"StatusResponse(int, int, String)","url":"%3Cinit%3E(int,int,java.lang.String)"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"StatusResponse(int)","url":"%3Cinit%3E(int)"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"StatusResponse(Storage)","url":"%3Cinit%3E(de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.tudresden.sumo.subscription","c":"ContextSubscription","l":"stop"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"stop"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_BUS_STOP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_CHARGING_STATION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_CONTAINER_STOP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_CONTAINER_TRIGGERED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_DEFAULT"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"stop_instance()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_PARKING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_PARKING_AREA"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"STOP_TRIGGERED"},{"p":"de.tudresden.ws","c":"Service","l":"stop(String)","url":"stop(java.lang.String)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"stop(String)","url":"stop(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"stopped"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"Storage()","url":"%3Cinit%3E()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"Storage(byte[], int, int)","url":"%3Cinit%3E(byte[],int,int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"Storage(byte[])","url":"%3Cinit%3E(byte[])"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"Storage(short[], int, int)","url":"%3Cinit%3E(short[],int,int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"Storage(short[])","url":"%3Cinit%3E(short[])"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"subID"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"subList(int, int)","url":"subList(int,int)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"subList(int, int)","url":"subList(int,int)"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"SubscriptionObject(String, ResponseType, int, int, int, SumoObject)","url":"%3Cinit%3E(java.lang.String,de.tudresden.sumo.subscription.ResponseType,int,int,int,de.tudresden.ws.container.SumoObject)"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"SubscriptionObject(String, ResponseType, int, String, int, int, int, SumoObject)","url":"%3Cinit%3E(java.lang.String,de.tudresden.sumo.subscription.ResponseType,int,java.lang.String,int,int,int,de.tudresden.ws.container.SumoObject)"},{"p":"de.tudresden.ws.conf","c":"Config","l":"sumo_bin"},{"p":"de.tudresden.ws.conf","c":"Config","l":"sumo_output"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"Sumo()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.util","c":"Sumo","l":"Sumo(Config)","url":"%3Cinit%3E(de.tudresden.ws.conf.Config)"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes.SumoBestLane","l":"SumoBestLane(String, double, double, int, int, LinkedList)","url":"%3Cinit%3E(java.lang.String,double,double,int,int,java.util.LinkedList)"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes","l":"SumoBestLanes()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"SumoBoundingBox()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"SumoBoundingBox(double, double, double, double)","url":"%3Cinit%3E(double,double,double,double)"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"SumoColor()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"SumoColor(int, int, int, int)","url":"%3Cinit%3E(int,int,int,int)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object, Object, Object, String)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object, Object, Object)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object, Object)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object, Object[], Object, Object)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object[],java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object, Object[])","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object,java.lang.Object[])"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object, Object[], Object, Object)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object,java.lang.Object[],java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"SumoCommand","l":"SumoCommand(Object, Object)","url":"%3Cinit%3E(java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoGeometry","l":"SumoGeometry()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoLeader","l":"SumoLeader(String, double)","url":"%3Cinit%3E(java.lang.String,double)"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"SumoLink(String, String, byte, byte, byte, double, String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String,byte,byte,byte,double,java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"SumoLink(String, String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"SumoLinkList()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"SumoLinkList(List)","url":"%3Cinit%3E(java.util.List)"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS","l":"SumoNextTLS()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoPosition2D","l":"SumoPosition2D()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoPosition2D","l":"SumoPosition2D(double, double)","url":"%3Cinit%3E(double,double)"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"SumoPosition3D()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"SumoPosition3D(double, double, double)","url":"%3Cinit%3E(double,double,double)"},{"p":"de.tudresden.ws.container","c":"SumoPrimitive","l":"SumoPrimitive(Object)","url":"%3Cinit%3E(java.lang.Object)"},{"p":"de.tudresden.ws.container","c":"SumoRoadPosition","l":"SumoRoadPosition()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"SumoStage()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"SumoStopFlags(boolean, boolean, boolean, boolean, boolean, boolean, boolean)","url":"%3Cinit%3E(boolean,boolean,boolean,boolean,boolean,boolean,boolean)"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"SumoStopFlags(byte)","url":"%3Cinit%3E(byte)"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"SumoStringList()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"SumoStringList(List)","url":"%3Cinit%3E(java.util.List)"},{"p":"de.tudresden.ws.container","c":"SumoTLSController","l":"SumoTLSController()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"SumoTLSPhase()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"SumoTLSPhase(double, double, double, String, ArrayList, String)","url":"%3Cinit%3E(double,double,double,java.lang.String,java.util.ArrayList,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"SumoTLSPhase(int, String)","url":"%3Cinit%3E(int,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"SumoTLSProgram()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"SumoTLSProgram(String, int, int)","url":"%3Cinit%3E(java.lang.String,int,int)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(int)","url":"%3Cinit%3E(int)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(SocketAddress)","url":"%3Cinit%3E(java.net.SocketAddress)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String, int, boolean)","url":"%3Cinit%3E(java.lang.String,int,boolean)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String, String, String, String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String, String, String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String,java.lang.String,java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String, String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String,java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String, String)","url":"%3Cinit%3E(java.lang.String,java.lang.String)"},{"p":"it.polito.appeal.traci","c":"SumoTraciConnection","l":"SumoTraciConnection(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData","l":"SumoVehicleData()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignal","l":"SumoVehicleSignal(int)","url":"%3Cinit%3E(int)"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_COMPLETE_DEFINITION_RYG"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_COMPLETE_PROGRAM_RYG"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"TL_CONTEXT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_CONTROLLED_JUNCTIONS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_CONTROLLED_LANES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_CONTROLLED_LINKS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_CURRENT_PHASE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_CURRENT_PROGRAM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_EXTERNAL_STATE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_NEXT_SWITCH"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_PHASE_DURATION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_PHASE_INDEX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_PROGRAM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TL_RED_YELLOW_GREEN_STATE"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"TL_VARIABLE"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS.NextTLS","l":"tlsID"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"to"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"toArray()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"toArray()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"toArray(T[])"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"toArray(T[])"},{"p":"de.tudresden.ws.container","c":"SumoBestLanes","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoColor","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoGeometry","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoLeader","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoLink","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoLinkList","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoNextTLS","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoPosition2D","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoStringList","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoTLSController","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoTLSPhase","l":"toString()"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"toString()"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"toString()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TRACI_ID_LIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TRACI_VERSION"},{"p":"de.tudresden.ws","c":"Traci","l":"Traci()","url":"%3Cinit%3E()"},{"p":"it.polito.appeal.traci","c":"TraCIException","l":"TraCIException()","url":"%3Cinit%3E()"},{"p":"it.polito.appeal.traci","c":"TraCIException","l":"TraCIException(String)","url":"%3Cinit%3E(java.lang.String)"},{"p":"de.tudresden.sumo.cmd","c":"Gui","l":"trackVehicle(String, String)","url":"trackVehicle(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"trafficlight"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"trafficlight"},{"p":"de.tudresden.sumo.cmd","c":"Trafficlight","l":"Trafficlight()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getCompleteRedYellowGreenDefinition(String)","url":"Trafficlights_getCompleteRedYellowGreenDefinition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getControlledLanes(String)","url":"Trafficlights_getControlledLanes(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getControlledLinks(String)","url":"Trafficlights_getControlledLinks(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getNextSwitch(String)","url":"Trafficlights_getNextSwitch(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getPhase(String)","url":"Trafficlights_getPhase(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getPhaseDuration(String)","url":"Trafficlights_getPhaseDuration(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getProgram(String)","url":"Trafficlights_getProgram(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_getRedYellowGreenState(String)","url":"Trafficlights_getRedYellowGreenState(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_setCompleteRedYellowGreenDefinition(String, SumoTLSProgram)","url":"Trafficlights_setCompleteRedYellowGreenDefinition(java.lang.String,de.tudresden.ws.container.SumoTLSProgram)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_setPhase(String, int)","url":"Trafficlights_setPhase(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_setPhaseDuration(String, int)","url":"Trafficlights_setPhaseDuration(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_setProgram(String, String)","url":"Trafficlights_setProgram(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Trafficlights_setRedYellowGreenState(String, String)","url":"Trafficlights_setRedYellowGreenState(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"travelTime"},{"p":"de.tudresden.ws.container","c":"SumoStopFlags","l":"triggered"},{"p":"de.tudresden.ws.log","c":"Log","l":"txt_output(boolean)"},{"p":"de.tudresden.ws.log","c":"Log_txt","l":"txt_output(boolean)"},{"p":"de.tudresden.ws","c":"Service","l":"TXT_output(boolean)"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"TXT_output(boolean)"},{"p":"de.tudresden.ws.container","c":"SumoPrimitive","l":"type"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"type"},{"p":"de.tudresden.ws.container","c":"SumoTLSProgram","l":"type"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_BYTE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_COLOR"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_COMPOUND"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_DOUBLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_DOUBLELIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_INTEGER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_POLYGON"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_STRING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_STRINGLIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"TYPE_UBYTE"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"typeID"},{"p":"it.polito.appeal.traci","c":"TraCIException.UnexpectedData","l":"UnexpectedData(String, Object, Object)","url":"%3Cinit%3E(java.lang.String,java.lang.Object,java.lang.Object)"},{"p":"it.polito.appeal.traci","c":"TraCIException.UnexpectedDatatype","l":"UnexpectedDatatype(int, int)","url":"%3Cinit%3E(int,int)"},{"p":"it.polito.appeal.traci","c":"TraCIException.UnexpectedResponse","l":"UnexpectedResponse(int, int)","url":"%3Cinit%3E(int,int)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"UNKNOWN"},{"p":"de.tudresden.sumo.util","c":"Observer","l":"update(Observable, SubscriptionObject)","url":"update(de.tudresden.sumo.util.Observable,de.tudresden.sumo.subscription.SubscriptionObject)"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"updateBestLanes(String)","url":"updateBestLanes(java.lang.String)"},{"p":"de.tudresden.ws.conf","c":"Config","l":"url"},{"p":"de.tudresden.ws.container","c":"SumoPrimitive","l":"val"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"validPos()"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"valueOf(String)","url":"valueOf(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"valueOf(String)","url":"valueOf(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"valueOf(String)","url":"valueOf(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"valueOf(String)","url":"valueOf(java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"valueOf(String)","url":"valueOf(java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"values()"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"values()"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"values()"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"values()"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"values()"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ACCEL"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ACCELERATION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ACCUMULATED_WAITING_TIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ACTIONSTEPLENGTH"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ADD_DYNAMICS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ALLOWED_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ANGLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_APPARENT_DECEL"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ARRIVED_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ARRIVED_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_BEGIN"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_BEST_LANES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_BUS_STOP_ID_LIST"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_BUS_STOP_WAITING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_BUS_STOP_WAITING_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_CO2EMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_COEMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_COLLIDING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_COLLIDING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_COLOR"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_CURRENT_TRAVELTIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_DECEL"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_DELTA_T"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_DEPARTED_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_DEPARTED_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_DISTANCE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EDGE_EFFORT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EDGE_TRAVELTIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EDGES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ELECTRICITYCONSUMPTION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EMERGENCY_DECEL"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EMERGENCYSTOPPING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_EMISSIONCLASS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_END"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_FILL"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_FOES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_FOLLOW_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_FUELCONSUMPTION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_HAS_VIEW"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_HCEMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_HEIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_HIGHLIGHT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_IMAGEFILE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_IMPERFECTION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_INSERTED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LANE_ID"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LANE_INDEX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LANECHANGE_MODE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LANEPOSITION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LANEPOSITION_LAT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LASTACTIONTIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LATALIGNMENT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LEADER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LENGTH"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LINE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LOADED_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_LOADED_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MAXSPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MAXSPEED_LAT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MIN_EXPECTED_VEHICLES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MINGAP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MINGAP_LAT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_MOVE_TO"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NAME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NEIGHBORS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NET_BOUNDING_BOX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NEXT_EDGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NEXT_STOPS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NEXT_TLS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NOISEEMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_NOXEMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARAMETER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_ENDING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_ENDING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_MANEUVERING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_MANEUVERING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_STARTING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PARKING_STARTING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PASSED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PERSON_CAPACITY"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PERSON_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_PMXEMISSION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_POSITION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_POSITION3D"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_REMOVED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROAD_ID"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTE_ID"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTE_INDEX"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTE_PROBE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTE_VALID"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_ROUTING_MODE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SCREENSHOT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SECURE_GAP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SHAPE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SHAPECLASS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SIGNALS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SLOPE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEED_DEVIATION"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEED_FACTOR"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEED_LAT"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEED_WITHOUT_TRACI"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_SPEEDSETMODE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STAGE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STAGES_REMAINING"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_DELAY"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_ENDING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_ENDING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_SPEED"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_STARTING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOP_STARTING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_STOPSTATE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TAU"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TELEPORT_ENDING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TELEPORT_ENDING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TELEPORT_STARTING_VEHICLES_IDS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TELEPORT_STARTING_VEHICLES_NUMBER"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TIME_STEP"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TRACK_VEHICLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_TYPE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_UPDATE_BESTLANES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VEHICLE"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VEHICLECLASS"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VEHSPERHOUR"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VIA"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VIEW_BOUNDARY"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VIEW_OFFSET"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VIEW_SCHEMA"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VIEW_ZOOM"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_VTYPES"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_WAITING_TIME"},{"p":"de.tudresden.sumo.config","c":"Constants","l":"VAR_WIDTH"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionObject","l":"variable"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"VariableSubscription()","url":"%3Cinit%3E()"},{"p":"de.tudresden.sumo.subscription","c":"VariableSubscription","l":"VariableSubscription(SubscribtionVariable, double, double, String)","url":"%3Cinit%3E(de.tudresden.sumo.subscription.SubscribtionVariable,double,double,java.lang.String)"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_BACKDRIVE"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_BLINKER_EMERGENCY"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_BLINKER_LEFT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_BLINKER_RIGHT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_BRAKELIGHT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_DOOR_OPEN_LEFT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_DOOR_OPEN_RIGHT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_EMERGENCY_BLUE"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_EMERGENCY_RED"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_EMERGENCY_YELLOW"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_FOGLIGHT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_FRONTLIGHT"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_HIGHBEAM"},{"p":"de.tudresden.ws.container","c":"SumoVehicleSignalState","l":"VEH_SIGNAL_WIPER"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"vehicle"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"vehicle"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_add(String, String, String, int, double, double, byte)","url":"Vehicle_add(java.lang.String,java.lang.String,java.lang.String,int,double,double,byte)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_changeLane(String, byte, double)","url":"Vehicle_changeLane(java.lang.String,byte,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_changeTarget(String, String)","url":"Vehicle_changeTarget(java.lang.String,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"VEHICLE_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getAccel(String)","url":"Vehicle_getAccel(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getAdaptedTraveltime(String, int, String)","url":"Vehicle_getAdaptedTraveltime(java.lang.String,int,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getAllowedSpeed(String)","url":"Vehicle_getAllowedSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getAngle(String)","url":"Vehicle_getAngle(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getBestLanes(String)","url":"Vehicle_getBestLanes(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getCO2Emission(String)","url":"Vehicle_getCO2Emission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getCOEmission(String)","url":"Vehicle_getCOEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getColor(String)","url":"Vehicle_getColor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getDecel(String)","url":"Vehicle_getDecel(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getDistance(String)","url":"Vehicle_getDistance(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getDrivingDistance(String, String, double, byte)","url":"Vehicle_getDrivingDistance(java.lang.String,java.lang.String,double,byte)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getDrivingDistance2D(String, double, double)","url":"Vehicle_getDrivingDistance2D(java.lang.String,double,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getEffort(String, int, String)","url":"Vehicle_getEffort(java.lang.String,int,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getElectricityConsumption(String)","url":"Vehicle_getElectricityConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getEmissionClass(String)","url":"Vehicle_getEmissionClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getFuelConsumption(String)","url":"Vehicle_getFuelConsumption(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getHCEmission(String)","url":"Vehicle_getHCEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getImperfection(String)","url":"Vehicle_getImperfection(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getLaneID(String)","url":"Vehicle_getLaneID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getLaneIndex(String)","url":"Vehicle_getLaneIndex(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getLanePosition(String)","url":"Vehicle_getLanePosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getLeader(String, double)","url":"Vehicle_getLeader(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getLength(String)","url":"Vehicle_getLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getMaxSpeed(String)","url":"Vehicle_getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getMinGap(String)","url":"Vehicle_getMinGap(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getNoiseEmission(String)","url":"Vehicle_getNoiseEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getNOxEmission(String)","url":"Vehicle_getNOxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getPersonNumber(String)","url":"Vehicle_getPersonNumber(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getPMxEmission(String)","url":"Vehicle_getPMxEmission(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getPosition(String)","url":"Vehicle_getPosition(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getPosition3D(String)","url":"Vehicle_getPosition3D(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getRoadID(String)","url":"Vehicle_getRoadID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getRoute(String)","url":"Vehicle_getRoute(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getRouteID(String)","url":"Vehicle_getRouteID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getShapeClass(String)","url":"Vehicle_getShapeClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSignals(String)","url":"Vehicle_getSignals(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSlope(String)","url":"Vehicle_getSlope(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSpeed(String)","url":"Vehicle_getSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSpeedDeviation(String)","url":"Vehicle_getSpeedDeviation(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSpeedFactor(String)","url":"Vehicle_getSpeedFactor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSpeedMode(String)","url":"Vehicle_getSpeedMode(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getSpeedWithoutTraCI(String)","url":"Vehicle_getSpeedWithoutTraCI(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getTau(String)","url":"Vehicle_getTau(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getTypeID(String)","url":"Vehicle_getTypeID(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getVehicleClass(String)","url":"Vehicle_getVehicleClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getWaitingTime(String)","url":"Vehicle_getWaitingTime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_getWidth(String)","url":"Vehicle_getWidth(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_isRouteValid(String)","url":"Vehicle_isRouteValid(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_moveTo(String, String, double)","url":"Vehicle_moveTo(java.lang.String,java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_remove(String, byte)","url":"Vehicle_remove(java.lang.String,byte)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_rerouteEffort(String)","url":"Vehicle_rerouteEffort(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_rerouteTraveltime(String)","url":"Vehicle_rerouteTraveltime(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_resume(String)","url":"Vehicle_resume(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setAccel(String, double)","url":"Vehicle_setAccel(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setAdaptedTraveltime(String, int, int, String, double)","url":"Vehicle_setAdaptedTraveltime(java.lang.String,int,int,java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setColor(String, SumoColor)","url":"Vehicle_setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setDecel(String, double)","url":"Vehicle_setDecel(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setEffort(String, int, int, String, double)","url":"Vehicle_setEffort(java.lang.String,int,int,java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setEmissionClass(String, String)","url":"Vehicle_setEmissionClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setImperfection(String, double)","url":"Vehicle_setImperfection(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setLaneChangeMode(String, int)","url":"Vehicle_setLaneChangeMode(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setLength(String, double)","url":"Vehicle_setLength(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setMaxSpeed(String, double)","url":"Vehicle_setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setMinGap(String, double)","url":"Vehicle_setMinGap(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setRoute(String, SumoStringList)","url":"Vehicle_setRoute(java.lang.String,de.tudresden.ws.container.SumoStringList)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setRouteID(String, String)","url":"Vehicle_setRouteID(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setShapeClass(String, String)","url":"Vehicle_setShapeClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setSignals(String, int)","url":"Vehicle_setSignals(java.lang.String,int)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setSpeed(String, double)","url":"Vehicle_setSpeed(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setSpeedDeviation(String, double)","url":"Vehicle_setSpeedDeviation(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setSpeedFactor(String, double)","url":"Vehicle_setSpeedFactor(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setStop(String, String, double, byte, double, SumoStopFlags, double, double)","url":"Vehicle_setStop(java.lang.String,java.lang.String,double,byte,double,de.tudresden.ws.container.SumoStopFlags,double,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setTau(String, double)","url":"Vehicle_setTau(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setType(String, String)","url":"Vehicle_setType(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setVehicleClass(String, String)","url":"Vehicle_setVehicleClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_setWidth(String, double)","url":"Vehicle_setWidth(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicle_slowDown(String, double, double)","url":"Vehicle_slowDown(java.lang.String,double,double)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"VEHICLE_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Vehicle","l":"Vehicle()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"VehicleData(String, double, double, double, String)","url":"%3Cinit%3E(java.lang.String,double,double,double,java.lang.String)"},{"p":"de.tudresden.sumo.subscription","c":"SumoDomain","l":"vehicles"},{"p":"de.tudresden.sumo.subscription","c":"SubscribtionVariable","l":"vehicleType"},{"p":"de.tudresden.sumo.subscription","c":"SubscriptionContext","l":"vehicleType"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"VEHICLETYPE_CONTEXT"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getAccel(String)","url":"Vehicletype_getAccel(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getColor(String)","url":"Vehicletype_getColor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getDecel(String)","url":"Vehicletype_getDecel(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getEmissionClass(String)","url":"Vehicletype_getEmissionClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getIDCount()"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getIDList()"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getImperfection(String)","url":"Vehicletype_getImperfection(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getLength(String)","url":"Vehicletype_getLength(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getMaxSpeed(String)","url":"Vehicletype_getMaxSpeed(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getMinGap(String)","url":"Vehicletype_getMinGap(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getShapeClass(String)","url":"Vehicletype_getShapeClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getSpeedDeviation(String)","url":"Vehicletype_getSpeedDeviation(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getSpeedFactor(String)","url":"Vehicletype_getSpeedFactor(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getTau(String)","url":"Vehicletype_getTau(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getVehicleClass(String)","url":"Vehicletype_getVehicleClass(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_getWidth(String)","url":"Vehicletype_getWidth(java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setAccel(String, double)","url":"Vehicletype_setAccel(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setColor(String, SumoColor)","url":"Vehicletype_setColor(java.lang.String,de.tudresden.ws.container.SumoColor)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setDecel(String, double)","url":"Vehicletype_setDecel(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setEmissionClass(String, String)","url":"Vehicletype_setEmissionClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setImperfection(String, double)","url":"Vehicletype_setImperfection(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setLength(String, double)","url":"Vehicletype_setLength(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setMaxSpeed(String, double)","url":"Vehicletype_setMaxSpeed(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setMinGap(String, double)","url":"Vehicletype_setMinGap(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setShapeClass(String, String)","url":"Vehicletype_setShapeClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setSpeedDeviation(String, double)","url":"Vehicletype_setSpeedDeviation(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setSpeedFactor(String, double)","url":"Vehicletype_setSpeedFactor(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setTau(String, double)","url":"Vehicletype_setTau(java.lang.String,double)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setVehicleClass(String, String)","url":"Vehicletype_setVehicleClass(java.lang.String,java.lang.String)"},{"p":"de.tudresden.ws","c":"Traci","l":"Vehicletype_setWidth(String, double)","url":"Vehicletype_setWidth(java.lang.String,double)"},{"p":"de.tudresden.sumo.subscription","c":"ResponseType","l":"VEHICLETYPE_VARIABLE"},{"p":"de.tudresden.sumo.cmd","c":"Vehicletype","l":"Vehicletype()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.container","c":"SumoLeader","l":"vehID"},{"p":"de.tudresden.ws.container","c":"SumoVehicleData.VehicleData","l":"vehID"},{"p":"de.tudresden.sumo.util","c":"Query","l":"verify(String, int, byte)","url":"verify(java.lang.String,int,byte)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"verify(String, int, short)","url":"verify(java.lang.String,int,short)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"verify(String, Object, Object)","url":"verify(java.lang.String,java.lang.Object,java.lang.Object)"},{"p":"de.tudresden.sumo.util","c":"CommandProcessor","l":"verifyGetVarResponse(Command, int, int, String)","url":"verifyGetVarResponse(it.polito.appeal.traci.protocol.Command,int,int,java.lang.String)"},{"p":"de.tudresden.sumo.util","c":"Query","l":"verifyGetVarResponse(Command, int, int, String)","url":"verifyGetVarResponse(it.polito.appeal.traci.protocol.Command,int,int,java.lang.String)"},{"p":"de.tudresden.ws.conf","c":"Config","l":"version"},{"p":"de.tudresden.ws","c":"Service","l":"version()"},{"p":"de.tudresden.ws","c":"ServiceImpl","l":"version()"},{"p":"de.tudresden.ws.container","c":"SumoStage","l":"vType"},{"p":"de.tudresden.ws","c":"WebService","l":"WebService()","url":"%3Cinit%3E()"},{"p":"de.tudresden.ws.log","c":"Log","l":"write(StackTraceElement[])","url":"write(java.lang.StackTraceElement[])"},{"p":"de.tudresden.ws.log","c":"Log_txt","l":"write(StackTraceElement[])","url":"write(java.lang.StackTraceElement[])"},{"p":"de.tudresden.ws.log","c":"Log","l":"write(String, int)","url":"write(java.lang.String,int)"},{"p":"de.tudresden.ws.log","c":"Log_txt","l":"write(String, int)","url":"write(java.lang.String,int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeByte(int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeByte(short)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeDouble(double)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeFloat(float)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeInt(int)"},{"p":"it.polito.appeal.traci.protocol","c":"Command","l":"writeRawTo(Storage)","url":"writeRawTo(de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeShort(int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeStringASCII(String)","url":"writeStringASCII(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeStringISOLATIN1(String)","url":"writeStringISOLATIN1(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeStringUTF16BE(String)","url":"writeStringUTF16BE(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeStringUTF16LE(String)","url":"writeStringUTF16LE(java.lang.String)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeStringUTF8(String)","url":"writeStringUTF8(java.lang.String)"},{"p":"it.polito.appeal.traci.protocol","c":"RequestMessage","l":"writeTo(DataOutputStream)","url":"writeTo(java.io.DataOutputStream)"},{"p":"it.polito.appeal.traci.protocol","c":"StatusResponse","l":"writeTo(Storage)","url":"writeTo(de.uniluebeck.itm.tcpip.Storage)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeUnsignedByte(int)"},{"p":"de.uniluebeck.itm.tcpip","c":"Storage","l":"writeUnsignedByte(short)"},{"p":"de.tudresden.ws.container","c":"SumoPosition2D","l":"x"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"x"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"x_max"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"x_min"},{"p":"de.tudresden.ws.container","c":"SumoPosition2D","l":"y"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"y"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"y_max"},{"p":"de.tudresden.ws.container","c":"SumoBoundingBox","l":"y_min"},{"p":"de.tudresden.ws.container","c":"SumoPosition3D","l":"z"}] \ No newline at end of file Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/javadoc/traas/member-search-index.zip and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/javadoc/traas/member-search-index.zip differ diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/overview-summary.html sumo-1.6.0+dfsg1/docs/javadoc/traas/overview-summary.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/overview-summary.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/overview-summary.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + +traas 1.0 API + + + + + + + +
+ +

index.html

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/overview-tree.html sumo-1.6.0+dfsg1/docs/javadoc/traas/overview-tree.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/overview-tree.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/overview-tree.html 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,299 @@ + + + + + +Class Hierarchy (traas 1.0 API) + + + + + + + + + + + + + + + +
+ +
+
+ +
+
+

Class Hierarchy

+ +
+
+

Interface Hierarchy

+ +
+
+

Enum Hierarchy

+ +
+
+
+
+ +

Copyright © 2020. All rights reserved.

+
+ + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/package-search-index.js sumo-1.6.0+dfsg1/docs/javadoc/traas/package-search-index.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/package-search-index.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/package-search-index.js 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1 @@ +packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"de.tudresden.sumo.cmd"},{"l":"de.tudresden.sumo.config"},{"l":"de.tudresden.sumo.subscription"},{"l":"de.tudresden.sumo.util"},{"l":"de.tudresden.ws"},{"l":"de.tudresden.ws.conf"},{"l":"de.tudresden.ws.container"},{"l":"de.tudresden.ws.log"},{"l":"de.uniluebeck.itm.tcpip"},{"l":"it.polito.appeal.traci"},{"l":"it.polito.appeal.traci.protocol"}] \ No newline at end of file Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/javadoc/traas/package-search-index.zip and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/javadoc/traas/package-search-index.zip differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/javadoc/traas/resources/glass.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/javadoc/traas/resources/glass.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/javadoc/traas/resources/x.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/javadoc/traas/resources/x.png differ diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/script.js sumo-1.6.0+dfsg1/docs/javadoc/traas/script.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/script.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/script.js 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var moduleSearchIndex; +var packageSearchIndex; +var typeSearchIndex; +var memberSearchIndex; +var tagSearchIndex; +function loadScripts(doc, tag) { + createElem(doc, tag, 'jquery/jszip/dist/jszip.js'); + createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js'); + if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || + window.navigator.userAgent.indexOf('Edge/') > 0) { + createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js'); + } + createElem(doc, tag, 'search.js'); + + $.get(pathtoroot + "module-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) { + var zip = new JSZip(data); + zip.load(data); + moduleSearchIndex = JSON.parse(zip.file("module-search-index.json").asText()); + }); + }); + $.get(pathtoroot + "package-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { + var zip = new JSZip(data); + zip.load(data); + packageSearchIndex = JSON.parse(zip.file("package-search-index.json").asText()); + }); + }); + $.get(pathtoroot + "type-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { + var zip = new JSZip(data); + zip.load(data); + typeSearchIndex = JSON.parse(zip.file("type-search-index.json").asText()); + }); + }); + $.get(pathtoroot + "member-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { + var zip = new JSZip(data); + zip.load(data); + memberSearchIndex = JSON.parse(zip.file("member-search-index.json").asText()); + }); + }); + $.get(pathtoroot + "tag-search-index.zip") + .done(function() { + JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { + var zip = new JSZip(data); + zip.load(data); + tagSearchIndex = JSON.parse(zip.file("tag-search-index.json").asText()); + }); + }); + if (!moduleSearchIndex) { + createElem(doc, tag, 'module-search-index.js'); + } + if (!packageSearchIndex) { + createElem(doc, tag, 'package-search-index.js'); + } + if (!typeSearchIndex) { + createElem(doc, tag, 'type-search-index.js'); + } + if (!memberSearchIndex) { + createElem(doc, tag, 'member-search-index.js'); + } + if (!tagSearchIndex) { + createElem(doc, tag, 'tag-search-index.js'); + } + $(window).resize(function() { + $('.navPadding').css('padding-top', $('.fixedNav').css("height")); + }); +} + +function createElem(doc, tag, path) { + var script = doc.createElement(tag); + var scriptElement = doc.getElementsByTagName(tag)[0]; + script.src = pathtoroot + path; + scriptElement.parentNode.insertBefore(script, scriptElement); +} + +function show(type) { + count = 0; + for (var key in data) { + var row = document.getElementById(key); + if ((data[key] & type) !== 0) { + row.style.display = ''; + row.className = (count++ % 2) ? rowColor : altColor; + } + else + row.style.display = 'none'; + } + updateTabs(type); +} + +function updateTabs(type) { + for (var value in tabs) { + var sNode = document.getElementById(tabs[value][0]); + var spanNode = sNode.firstChild; + if (value == type) { + sNode.className = activeTableTab; + spanNode.innerHTML = tabs[value][1]; + } + else { + sNode.className = tableTab; + spanNode.innerHTML = "" + tabs[value][1] + ""; + } + } +} + +function updateModuleFrame(pFrame, cFrame) { + top.packageFrame.location = pFrame; + top.classFrame.location = cFrame; +} diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/search.js sumo-1.6.0+dfsg1/docs/javadoc/traas/search.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/search.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/search.js 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +var noResult = {l: "No results found"}; +var catModules = "Modules"; +var catPackages = "Packages"; +var catTypes = "Types"; +var catMembers = "Members"; +var catSearchTags = "SearchTags"; +var highlight = "$&"; +var camelCaseRegexp = ""; +var secondaryMatcher = ""; +function getHighlightedText(item) { + var ccMatcher = new RegExp(camelCaseRegexp); + var label = item.replace(ccMatcher, highlight); + if (label === item) { + label = item.replace(secondaryMatcher, highlight); + } + return label; +} +function getURLPrefix(ui) { + var urlPrefix=""; + if (useModuleDirectories) { + var slash = "/"; + if (ui.item.category === catModules) { + return ui.item.l + slash; + } else if (ui.item.category === catPackages && ui.item.m) { + return ui.item.m + slash; + } else if ((ui.item.category === catTypes && ui.item.p) || ui.item.category === catMembers) { + $.each(packageSearchIndex, function(index, item) { + if (ui.item.p == item.l) { + urlPrefix = item.m + slash; + } + }); + return urlPrefix; + } else { + return urlPrefix; + } + } + return urlPrefix; +} +var watermark = 'Search'; +$(function() { + $("#search").val(''); + $("#search").prop("disabled", false); + $("#reset").prop("disabled", false); + $("#search").val(watermark).addClass('watermark'); + $("#search").blur(function() { + if ($(this).val().length == 0) { + $(this).val(watermark).addClass('watermark'); + } + }); + $("#search").on('click keydown', function() { + if ($(this).val() == watermark) { + $(this).val('').removeClass('watermark'); + } + }); + $("#reset").click(function() { + $("#search").val(''); + $("#search").focus(); + }); + $("#search").focus(); + $("#search")[0].setSelectionRange(0, 0); +}); +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function() { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function(ul, items) { + var rMenu = this, + currentCategory = ""; + rMenu.menu.bindings = $(); + $.each(items, function(index, item) { + var li; + if (item.l !== noResult.l && item.category !== currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = rMenu._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.l); + li.attr("class", "resultItem"); + } else { + li.attr("aria-label", item.l); + li.attr("class", "resultItem"); + } + }); + }, + _renderItem: function(ul, item) { + var label = ""; + if (item.category === catModules) { + label = getHighlightedText(item.l); + } else if (item.category === catPackages) { + label = (item.m) + ? getHighlightedText(item.m + "/" + item.l) + : getHighlightedText(item.l); + } else if (item.category === catTypes) { + label = (item.p) + ? getHighlightedText(item.p + "." + item.l) + : getHighlightedText(item.l); + } else if (item.category === catMembers) { + label = getHighlightedText(item.p + "." + (item.c + "." + item.l)); + } else if (item.category === catSearchTags) { + label = getHighlightedText(item.l); + } else { + label = item.l; + } + var li = $("
  • ").appendTo(ul); + var div = $("
    ").appendTo(li); + if (item.category === catSearchTags) { + if (item.d) { + div.html(label + " (" + item.h + ")
    " + + item.d + "
    "); + } else { + div.html(label + " (" + item.h + ")"); + } + } else { + div.html(label); + } + return li; + } +}); +$(function() { + $("#search").catcomplete({ + minLength: 1, + delay: 100, + source: function(request, response) { + var result = new Array(); + var presult = new Array(); + var tresult = new Array(); + var mresult = new Array(); + var tgresult = new Array(); + var secondaryresult = new Array(); + var displayCount = 0; + var exactMatcher = new RegExp("^" + $.ui.autocomplete.escapeRegex(request.term) + "$", "i"); + camelCaseRegexp = ($.ui.autocomplete.escapeRegex(request.term)).split(/(?=[A-Z])/).join("([a-z0-9_$]*?)"); + var camelCaseMatcher = new RegExp("^" + camelCaseRegexp); + secondaryMatcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i"); + + // Return the nested innermost name from the specified object + function nestedName(e) { + return e.l.substring(e.l.lastIndexOf(".") + 1); + } + + function concatResults(a1, a2) { + a1 = a1.concat(a2); + a2.length = 0; + return a1; + } + + if (moduleSearchIndex) { + var mdleCount = 0; + $.each(moduleSearchIndex, function(index, item) { + item.category = catModules; + if (exactMatcher.test(item.l)) { + result.push(item); + mdleCount++; + } else if (camelCaseMatcher.test(item.l)) { + result.push(item); + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + displayCount = mdleCount; + result = concatResults(result, secondaryresult); + } + if (packageSearchIndex) { + var pCount = 0; + var pkg = ""; + $.each(packageSearchIndex, function(index, item) { + item.category = catPackages; + pkg = (item.m) + ? (item.m + "/" + item.l) + : item.l; + if (exactMatcher.test(item.l)) { + presult.push(item); + pCount++; + } else if (camelCaseMatcher.test(pkg)) { + presult.push(item); + } else if (secondaryMatcher.test(pkg)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(presult, secondaryresult)); + displayCount = (pCount > displayCount) ? pCount : displayCount; + } + if (typeSearchIndex) { + var tCount = 0; + $.each(typeSearchIndex, function(index, item) { + item.category = catTypes; + var s = nestedName(item); + if (exactMatcher.test(s)) { + tresult.push(item); + tCount++; + } else if (camelCaseMatcher.test(s)) { + tresult.push(item); + } else if (secondaryMatcher.test(item.p + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tresult, secondaryresult)); + displayCount = (tCount > displayCount) ? tCount : displayCount; + } + if (memberSearchIndex) { + var mCount = 0; + $.each(memberSearchIndex, function(index, item) { + item.category = catMembers; + var s = nestedName(item); + if (exactMatcher.test(s)) { + mresult.push(item); + mCount++; + } else if (camelCaseMatcher.test(s)) { + mresult.push(item); + } else if (secondaryMatcher.test(item.c + "." + item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(mresult, secondaryresult)); + displayCount = (mCount > displayCount) ? mCount : displayCount; + } + if (tagSearchIndex) { + var tgCount = 0; + $.each(tagSearchIndex, function(index, item) { + item.category = catSearchTags; + if (exactMatcher.test(item.l)) { + tgresult.push(item); + tgCount++; + } else if (secondaryMatcher.test(item.l)) { + secondaryresult.push(item); + } + }); + result = result.concat(concatResults(tgresult, secondaryresult)); + displayCount = (tgCount > displayCount) ? tgCount : displayCount; + } + displayCount = (displayCount > 500) ? displayCount : 500; + var counter = function() { + var count = {Modules: 0, Packages: 0, Types: 0, Members: 0, SearchTags: 0}; + var f = function(item) { + count[item.category] += 1; + return (count[item.category] <= displayCount); + }; + return f; + }(); + response(result.filter(counter)); + }, + response: function(event, ui) { + if (!ui.content.length) { + ui.content.push(noResult); + } else { + $("#search").empty(); + } + }, + autoFocus: true, + position: { + collision: "flip" + }, + select: function(event, ui) { + if (ui.item.l !== noResult.l) { + var url = getURLPrefix(ui); + if (ui.item.category === catModules) { + if (useModuleDirectories) { + url += "module-summary.html"; + } else { + url = ui.item.l + "-summary.html"; + } + } else if (ui.item.category === catPackages) { + if (ui.item.url) { + url = ui.item.url; + } else { + url += ui.item.l.replace(/\./g, '/') + "/package-summary.html"; + } + } else if (ui.item.category === catTypes) { + if (ui.item.url) { + url = ui.item.url; + } else if (ui.item.p === "") { + url += ui.item.l + ".html"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.l + ".html"; + } + } else if (ui.item.category === catMembers) { + if (ui.item.p === "") { + url += ui.item.c + ".html" + "#"; + } else { + url += ui.item.p.replace(/\./g, '/') + "/" + ui.item.c + ".html" + "#"; + } + if (ui.item.url) { + url += ui.item.url; + } else { + url += ui.item.l; + } + } else if (ui.item.category === catSearchTags) { + url += ui.item.u; + } + if (top !== window) { + parent.classFrame.location = pathtoroot + url; + } else { + window.location.href = pathtoroot + url; + } + $("#search").focus(); + } + } + }); +}); diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/serialized-form.html sumo-1.6.0+dfsg1/docs/javadoc/traas/serialized-form.html --- sumo-1.5.0+dfsg1/docs/javadoc/traas/serialized-form.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/serialized-form.html 2020-04-27 22:06:59.000000000 +0000 @@ -0,0 +1,262 @@ + + + + + +Serialized Form (traas 1.0 API) + + + + + + + + + + + + + + + +
    + +
    +
    +
    +

    Serialized Form

    +
    +
    + +
    +
    +
    + +

    Copyright © 2020. All rights reserved.

    +
    + + diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/stylesheet.css sumo-1.6.0+dfsg1/docs/javadoc/traas/stylesheet.css --- sumo-1.5.0+dfsg1/docs/javadoc/traas/stylesheet.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/stylesheet.css 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1,906 @@ +/* + * Javadoc style sheet + */ + +@import url('resources/fonts/dejavu.css'); + +/* + * Styles for individual HTML elements. + * + * These are styles that are specific to individual HTML elements. Changing them affects the style of a particular + * HTML element throughout the page. + */ + +body { + background-color:#ffffff; + color:#353833; + font-family:'DejaVu Sans', Arial, Helvetica, sans-serif; + font-size:14px; + margin:0; + padding:0; + height:100%; + width:100%; +} +iframe { + margin:0; + padding:0; + height:100%; + width:100%; + overflow-y:scroll; + border:none; +} +a:link, a:visited { + text-decoration:none; + color:#4A6782; +} +a[href]:hover, a[href]:focus { + text-decoration:none; + color:#bb7a2a; +} +a[name] { + color:#353833; +} +a[name]:before, a[name]:target, a[id]:before, a[id]:target { + content:""; + display:inline-block; + position:relative; + padding-top:129px; + margin-top:-129px; +} +pre { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; +} +h1 { + font-size:20px; +} +h2 { + font-size:18px; +} +h3 { + font-size:16px; + font-style:italic; +} +h4 { + font-size:13px; +} +h5 { + font-size:12px; +} +h6 { + font-size:11px; +} +ul { + list-style-type:disc; +} +code, tt { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; + margin-top:8px; + line-height:1.4em; +} +dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + padding-top:4px; +} +table tr td dt code { + font-family:'DejaVu Sans Mono', monospace; + font-size:14px; + vertical-align:top; + padding-top:4px; +} +sup { + font-size:8px; +} + +/* + * Styles for HTML generated by javadoc. + * + * These are style classes that are used by the standard doclet to generate HTML documentation. + */ + +/* + * Styles for document title and copyright. + */ +.clear { + clear:both; + height:0px; + overflow:hidden; +} +.aboutLanguage { + float:right; + padding:0px 21px; + font-size:11px; + z-index:200; + margin-top:-9px; +} +.legalCopy { + margin-left:.5em; +} +.bar a, .bar a:link, .bar a:visited, .bar a:active { + color:#FFFFFF; + text-decoration:none; +} +.bar a:hover, .bar a:focus { + color:#bb7a2a; +} +.tab { + background-color:#0066FF; + color:#ffffff; + padding:8px; + width:5em; + font-weight:bold; +} +/* + * Styles for navigation bar. + */ +.bar { + background-color:#4D7A97; + color:#FFFFFF; + padding:.8em .5em .4em .8em; + height:auto;/*height:1.8em;*/ + font-size:11px; + margin:0; +} +.navPadding { + padding-top: 107px; +} +.fixedNav { + position:fixed; + width:100%; + z-index:999; + background-color:#ffffff; +} +.topNav { + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.bottomNav { + margin-top:10px; + background-color:#4D7A97; + color:#FFFFFF; + float:left; + padding:0; + width:100%; + clear:right; + height:2.8em; + padding-top:10px; + overflow:hidden; + font-size:12px; +} +.subNav { + background-color:#dee3e9; + float:left; + width:100%; + overflow:hidden; + font-size:12px; +} +.subNav div { + clear:left; + float:left; + padding:0 0 5px 6px; + text-transform:uppercase; +} +ul.navList, ul.subNavList { + float:left; + margin:0 25px 0 0; + padding:0; +} +ul.navList li{ + list-style:none; + float:left; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch { + float:right; + margin:0 0 0 0; + padding:0; +} +ul.navListSearch li { + list-style:none; + float:right; + padding: 5px 6px; + text-transform:uppercase; +} +ul.navListSearch li label { + position:relative; + right:-16px; +} +ul.subNavList li { + list-style:none; + float:left; +} +.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited { + color:#FFFFFF; + text-decoration:none; + text-transform:uppercase; +} +.topNav a:hover, .bottomNav a:hover { + text-decoration:none; + color:#bb7a2a; + text-transform:uppercase; +} +.navBarCell1Rev { + background-color:#F8981D; + color:#253441; + margin: auto 5px; +} +.skipNav { + position:absolute; + top:auto; + left:-9999px; + overflow:hidden; +} +/* + * Styles for page header and footer. + */ +.header, .footer { + clear:both; + margin:0 20px; + padding:5px 0 0 0; +} +.indexNav { + position:relative; + font-size:12px; + background-color:#dee3e9; +} +.indexNav ul { + margin-top:0; + padding:5px; +} +.indexNav ul li { + display:inline; + list-style-type:none; + padding-right:10px; + text-transform:uppercase; +} +.indexNav h1 { + font-size:13px; +} +.title { + color:#2c4557; + margin:10px 0; +} +.subTitle { + margin:5px 0 0 0; +} +.header ul { + margin:0 0 15px 0; + padding:0; +} +.footer ul { + margin:20px 0 5px 0; +} +.header ul li, .footer ul li { + list-style:none; + font-size:13px; +} +/* + * Styles for headings. + */ +div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + background-color:#dee3e9; + border:1px solid #d0d9e0; + margin:0 0 6px -8px; + padding:7px 5px; +} +ul.blockList ul.blockList li.blockList h3 { + padding:0; + margin:15px 0; +} +ul.blockList li.blockList h2 { + padding:0px 0 20px 0; +} +/* + * Styles for page layout containers. + */ +.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer, +.allClassesContainer, .allPackagesContainer { + clear:both; + padding:10px 20px; + position:relative; +} +.indexContainer { + margin:10px; + position:relative; + font-size:12px; +} +.indexContainer h2 { + font-size:13px; + padding:0 0 3px 0; +} +.indexContainer ul { + margin:0; + padding:0; +} +.indexContainer ul li { + list-style:none; + padding-top:2px; +} +.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt { + font-size:12px; + font-weight:bold; + margin:10px 0 0 0; + color:#4E4E4E; +} +.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd { + margin:5px 0 10px 0px; + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +.serializedFormContainer dl.nameValue dt { + margin-left:1px; + font-size:1.1em; + display:inline; + font-weight:bold; +} +.serializedFormContainer dl.nameValue dd { + margin:0 0 0 1px; + font-size:1.1em; + display:inline; +} +/* + * Styles for lists. + */ +li.circle { + list-style:circle; +} +ul.horizontal li { + display:inline; + font-size:0.9em; +} +ul.inheritance { + margin:0; + padding:0; +} +ul.inheritance li { + display:inline; + list-style:none; +} +ul.inheritance li ul.inheritance { + margin-left:15px; + padding-left:15px; + padding-top:1px; +} +ul.blockList, ul.blockListLast { + margin:10px 0 10px 0; + padding:0; +} +ul.blockList li.blockList, ul.blockListLast li.blockList { + list-style:none; + margin-bottom:15px; + line-height:1.4; +} +ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList { + padding:0px 20px 5px 10px; + border:1px solid #ededed; + background-color:#f8f8f8; +} +ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList { + padding:0 0 5px 8px; + background-color:#ffffff; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockList { + margin-left:0; + padding-left:0; + padding-bottom:15px; + border:none; +} +ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast { + list-style:none; + border-bottom:none; + padding-bottom:0; +} +table tr td dl, table tr td dl dt, table tr td dl dd { + margin-top:0; + margin-bottom:1px; +} +/* + * Styles for tables. + */ +.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary, +.requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + width:100%; + border-spacing:0; + border-left:1px solid #EEE; + border-right:1px solid #EEE; + border-bottom:1px solid #EEE; +} +.overviewSummary, .memberSummary, .requiresSummary, .packagesSummary, .providesSummary, .usesSummary { + padding:0px; +} +.overviewSummary caption, .memberSummary caption, .typeSummary caption, +.useSummary caption, .constantsSummary caption, .deprecatedSummary caption, +.requiresSummary caption, .packagesSummary caption, .providesSummary caption, .usesSummary caption { + position:relative; + text-align:left; + background-repeat:no-repeat; + color:#253441; + font-weight:bold; + clear:none; + overflow:hidden; + padding:0px; + padding-top:10px; + padding-left:1px; + margin:0px; + white-space:pre; +} +.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link, +.constantsSummary caption a:link, .deprecatedSummary caption a:link, +.requiresSummary caption a:link, .packagesSummary caption a:link, .providesSummary caption a:link, +.usesSummary caption a:link, +.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover, +.constantsSummary caption a:hover, .deprecatedSummary caption a:hover, +.requiresSummary caption a:hover, .packagesSummary caption a:hover, .providesSummary caption a:hover, +.usesSummary caption a:hover, +.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active, +.constantsSummary caption a:active, .deprecatedSummary caption a:active, +.requiresSummary caption a:active, .packagesSummary caption a:active, .providesSummary caption a:active, +.usesSummary caption a:active, +.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited, +.constantsSummary caption a:visited, .deprecatedSummary caption a:visited, +.requiresSummary caption a:visited, .packagesSummary caption a:visited, .providesSummary caption a:visited, +.usesSummary caption a:visited { + color:#FFFFFF; +} +.useSummary caption a:link, .useSummary caption a:hover, .useSummary caption a:active, +.useSummary caption a:visited { + color:#1f389c; +} +.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span, +.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span, +.requiresSummary caption span, .packagesSummary caption span, .providesSummary caption span, +.usesSummary caption span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + padding-bottom:7px; + display:inline-block; + float:left; + background-color:#F8981D; + border: none; + height:16px; +} +.memberSummary caption span.activeTableTab span, .packagesSummary caption span.activeTableTab span, +.overviewSummary caption span.activeTableTab span, .typeSummary caption span.activeTableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#F8981D; + height:16px; +} +.memberSummary caption span.tableTab span, .packagesSummary caption span.tableTab span, +.overviewSummary caption span.tableTab span, .typeSummary caption span.tableTab span { + white-space:nowrap; + padding-top:5px; + padding-left:12px; + padding-right:12px; + margin-right:3px; + display:inline-block; + float:left; + background-color:#4D7A97; + height:16px; +} +.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab, +.packagesSummary caption span.tableTab, .packagesSummary caption span.activeTableTab, +.overviewSummary caption span.tableTab, .overviewSummary caption span.activeTableTab, +.typeSummary caption span.tableTab, .typeSummary caption span.activeTableTab { + padding-top:0px; + padding-left:0px; + padding-right:0px; + background-image:none; + float:none; + display:inline; +} +.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd, +.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd, +.requiresSummary .tabEnd, .packagesSummary .tabEnd, .providesSummary .tabEnd, .usesSummary .tabEnd { + display:none; + width:5px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .activeTableTab .tabEnd, .packagesSummary .activeTableTab .tabEnd, +.overviewSummary .activeTableTab .tabEnd, .typeSummary .activeTableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + float:left; + background-color:#F8981D; +} +.memberSummary .tableTab .tabEnd, .packagesSummary .tableTab .tabEnd, +.overviewSummary .tableTab .tabEnd, .typeSummary .tableTab .tabEnd { + display:none; + width:5px; + margin-right:3px; + position:relative; + background-color:#4D7A97; + float:left; +} +.rowColor th, .altColor th { + font-weight:normal; +} +.overviewSummary td, .memberSummary td, .typeSummary td, +.useSummary td, .constantsSummary td, .deprecatedSummary td, +.requiresSummary td, .packagesSummary td, .providesSummary td, .usesSummary td { + text-align:left; + padding:0px 0px 12px 10px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .useSummary th, +.constantsSummary th, .packagesSummary th, td.colFirst, td.colSecond, td.colLast, .useSummary td, +.constantsSummary td { + vertical-align:top; + padding-right:0px; + padding-top:8px; + padding-bottom:3px; +} +th.colFirst, th.colSecond, th.colLast, th.colConstructorName, th.colDeprecatedItemName, .constantsSummary th, +.packagesSummary th { + background:#dee3e9; + text-align:left; + padding:8px 3px 3px 7px; +} +td.colFirst, th.colFirst { + font-size:13px; +} +td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedItemName, th.colLast { + font-size:13px; +} +.constantsSummary th, .packagesSummary th { + font-size:13px; +} +.providesSummary th.colFirst, .providesSummary th.colLast, .providesSummary td.colFirst, +.providesSummary td.colLast { + white-space:normal; + font-size:13px; +} +.overviewSummary td.colFirst, .overviewSummary th.colFirst, +.requiresSummary td.colFirst, .requiresSummary th.colFirst, +.packagesSummary td.colFirst, .packagesSummary td.colSecond, .packagesSummary th.colFirst, .packagesSummary th, +.usesSummary td.colFirst, .usesSummary th.colFirst, +.providesSummary td.colFirst, .providesSummary th.colFirst, +.memberSummary td.colFirst, .memberSummary th.colFirst, +.memberSummary td.colSecond, .memberSummary th.colSecond, .memberSummary th.colConstructorName, +.typeSummary td.colFirst, .typeSummary th.colFirst { + vertical-align:top; +} +.packagesSummary th.colLast, .packagesSummary td.colLast { + white-space:normal; +} +td.colFirst a:link, td.colFirst a:visited, +td.colSecond a:link, td.colSecond a:visited, +th.colFirst a:link, th.colFirst a:visited, +th.colSecond a:link, th.colSecond a:visited, +th.colConstructorName a:link, th.colConstructorName a:visited, +th.colDeprecatedItemName a:link, th.colDeprecatedItemName a:visited, +.constantValuesContainer td a:link, .constantValuesContainer td a:visited, +.allClassesContainer td a:link, .allClassesContainer td a:visited, +.allPackagesContainer td a:link, .allPackagesContainer td a:visited { + font-weight:bold; +} +.tableSubHeadingColor { + background-color:#EEEEFF; +} +.altColor, .altColor th { + background-color:#FFFFFF; +} +.rowColor, .rowColor th { + background-color:#EEEEEF; +} +/* + * Styles for contents. + */ +.description pre { + margin-top:0; +} +.deprecatedContent { + margin:0; + padding:10px 0; +} +.docSummary { + padding:0; +} +ul.blockList ul.blockList ul.blockList li.blockList h3 { + font-style:normal; +} +div.block { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; +} +td.colLast div { + padding-top:0px; +} +td.colLast a { + padding-bottom:3px; +} +/* + * Styles for formatting effect. + */ +.sourceLineNo { + color:green; + padding:0 30px 0 0; +} +h1.hidden { + visibility:hidden; + overflow:hidden; + font-size:10px; +} +.block { + display:block; + margin:3px 10px 2px 0px; + color:#474747; +} +.deprecatedLabel, .descfrmTypeLabel, .implementationLabel, .memberNameLabel, .memberNameLink, +.moduleLabelInPackage, .moduleLabelInType, .overrideSpecifyLabel, .packageLabelInType, +.packageHierarchyLabel, .paramLabel, .returnLabel, .seeLabel, .simpleTagLabel, +.throwsLabel, .typeNameLabel, .typeNameLink, .searchTagLink { + font-weight:bold; +} +.deprecationComment, .emphasizedPhrase, .interfaceName { + font-style:italic; +} +.deprecationBlock { + font-size:14px; + font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif; + border-style:solid; + border-width:thin; + border-radius:10px; + padding:10px; + margin-bottom:10px; + margin-right:10px; + display:inline-block; +} +div.block div.deprecationComment, div.block div.block span.emphasizedPhrase, +div.block div.block span.interfaceName { + font-style:normal; +} +div.contentContainer ul.blockList li.blockList h2 { + padding-bottom:0px; +} +/* + * Styles for IFRAME. + */ +.mainContainer { + margin:0 auto; + padding:0; + height:100%; + width:100%; + position:fixed; + top:0; + left:0; +} +.leftContainer { + height:100%; + position:fixed; + width:320px; +} +.leftTop { + position:relative; + float:left; + width:315px; + top:0; + left:0; + height:30%; + border-right:6px solid #ccc; + border-bottom:6px solid #ccc; +} +.leftBottom { + position:relative; + float:left; + width:315px; + bottom:0; + left:0; + height:70%; + border-right:6px solid #ccc; + border-top:1px solid #000; +} +.rightContainer { + position:absolute; + left:320px; + top:0; + bottom:0; + height:100%; + right:0; + border-left:1px solid #000; +} +.rightIframe { + margin:0; + padding:0; + height:100%; + right:30px; + width:100%; + overflow:visible; + margin-bottom:30px; +} +/* + * Styles specific to HTML5 elements. + */ +main, nav, header, footer, section { + display:block; +} +/* + * Styles for javadoc search. + */ +.ui-autocomplete-category { + font-weight:bold; + font-size:15px; + padding:7px 0 7px 3px; + background-color:#4D7A97; + color:#FFFFFF; +} +.resultItem { + font-size:13px; +} +.ui-autocomplete { + max-height:85%; + max-width:65%; + overflow-y:scroll; + overflow-x:scroll; + white-space:nowrap; + box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23); +} +ul.ui-autocomplete { + position:fixed; + z-index:999999; +} +ul.ui-autocomplete li { + float:left; + clear:both; + width:100%; +} +.resultHighlight { + font-weight:bold; +} +#search { + background-image:url('resources/glass.png'); + background-size:13px; + background-repeat:no-repeat; + background-position:2px 3px; + padding-left:20px; + position:relative; + right:-18px; +} +#reset { + background-color: rgb(255,255,255); + background-image:url('resources/x.png'); + background-position:center; + background-repeat:no-repeat; + background-size:12px; + border:0 none; + width:16px; + height:17px; + position:relative; + left:-4px; + top:-4px; + font-size:0px; +} +.watermark { + color:#545454; +} +.searchTagDescResult { + font-style:italic; + font-size:11px; +} +.searchTagHolderResult { + font-style:italic; + font-size:12px; +} +.searchTagResult:before, .searchTagResult:target { + color:red; +} +.moduleGraph span { + display:none; + position:absolute; +} +.moduleGraph:hover span { + display:block; + margin: -100px 0 0 100px; + z-index: 1; +} +.methodSignature { + white-space:normal; +} + +/* + * Styles for user-provided tables. + * + * borderless: + * No borders, vertical margins, styled caption. + * This style is provided for use with existing doc comments. + * In general, borderless tables should not be used for layout purposes. + * + * plain: + * Plain borders around table and cells, vertical margins, styled caption. + * Best for small tables or for complex tables for tables with cells that span + * rows and columns, when the "striped" style does not work well. + * + * striped: + * Borders around the table and vertical borders between cells, striped rows, + * vertical margins, styled caption. + * Best for tables that have a header row, and a body containing a series of simple rows. + */ + +table.borderless, +table.plain, +table.striped { + margin-top: 10px; + margin-bottom: 10px; +} +table.borderless > caption, +table.plain > caption, +table.striped > caption { + font-weight: bold; + font-size: smaller; +} +table.borderless th, table.borderless td, +table.plain th, table.plain td, +table.striped th, table.striped td { + padding: 2px 5px; +} +table.borderless, +table.borderless > thead > tr > th, table.borderless > tbody > tr > th, table.borderless > tr > th, +table.borderless > thead > tr > td, table.borderless > tbody > tr > td, table.borderless > tr > td { + border: none; +} +table.borderless > thead > tr, table.borderless > tbody > tr, table.borderless > tr { + background-color: transparent; +} +table.plain { + border-collapse: collapse; + border: 1px solid black; +} +table.plain > thead > tr, table.plain > tbody tr, table.plain > tr { + background-color: transparent; +} +table.plain > thead > tr > th, table.plain > tbody > tr > th, table.plain > tr > th, +table.plain > thead > tr > td, table.plain > tbody > tr > td, table.plain > tr > td { + border: 1px solid black; +} +table.striped { + border-collapse: collapse; + border: 1px solid black; +} +table.striped > thead { + background-color: #E3E3E3; +} +table.striped > thead > tr > th, table.striped > thead > tr > td { + border: 1px solid black; +} +table.striped > tbody > tr:nth-child(even) { + background-color: #EEE +} +table.striped > tbody > tr:nth-child(odd) { + background-color: #FFF +} +table.striped > tbody > tr > th, table.striped > tbody > tr > td { + border-left: 1px solid black; + border-right: 1px solid black; +} +table.striped > tbody > tr > th { + font-weight: normal; +} diff -Nru sumo-1.5.0+dfsg1/docs/javadoc/traas/type-search-index.js sumo-1.6.0+dfsg1/docs/javadoc/traas/type-search-index.js --- sumo-1.5.0+dfsg1/docs/javadoc/traas/type-search-index.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/javadoc/traas/type-search-index.js 2020-04-27 22:07:00.000000000 +0000 @@ -0,0 +1 @@ +typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"it.polito.appeal.traci","l":"CloseQuery"},{"p":"it.polito.appeal.traci.protocol","l":"Command"},{"p":"de.tudresden.sumo.util","l":"CommandProcessor"},{"p":"de.tudresden.ws.conf","l":"Config"},{"p":"de.tudresden.sumo.config","l":"Constants"},{"p":"de.tudresden.sumo.subscription","l":"ContextSubscription"},{"p":"de.tudresden.sumo.util","l":"ConvertHelper"},{"p":"de.tudresden.sumo.cmd","l":"Edge"},{"p":"de.tudresden.sumo.cmd","l":"Gui"},{"p":"de.tudresden.sumo.cmd","l":"Inductionloop"},{"p":"de.tudresden.sumo.cmd","l":"Junction"},{"p":"de.tudresden.sumo.cmd","l":"Lane"},{"p":"de.tudresden.sumo.cmd","l":"Lanearea"},{"p":"de.tudresden.ws.log","l":"Log"},{"p":"de.tudresden.ws.log","l":"Log_txt"},{"p":"de.tudresden.sumo.cmd","l":"Multientryexit"},{"p":"de.tudresden.ws.container","l":"SumoNextTLS.NextTLS"},{"p":"de.tudresden.sumo.util","l":"Observable"},{"p":"de.tudresden.sumo.util","l":"Observer"},{"p":"de.tudresden.sumo.cmd","l":"Person"},{"p":"de.tudresden.sumo.cmd","l":"Poi"},{"p":"de.tudresden.sumo.cmd","l":"Polygon"},{"p":"de.tudresden.sumo.util","l":"Query"},{"p":"it.polito.appeal.traci.protocol","l":"RequestMessage"},{"p":"it.polito.appeal.traci.protocol","l":"ResponseContainer"},{"p":"it.polito.appeal.traci.protocol","l":"ResponseMessage"},{"p":"de.tudresden.sumo.subscription","l":"ResponseType"},{"p":"de.tudresden.sumo.cmd","l":"Route"},{"p":"de.tudresden.ws","l":"Service"},{"p":"de.tudresden.ws","l":"ServiceImpl"},{"p":"de.tudresden.ws","l":"ShutdownHook"},{"p":"de.tudresden.sumo.cmd","l":"Simulation"},{"p":"it.polito.appeal.traci.protocol","l":"StatusResponse"},{"p":"de.uniluebeck.itm.tcpip","l":"Storage"},{"p":"de.tudresden.sumo.subscription","l":"SubscribtionVariable"},{"p":"de.tudresden.sumo.subscription","l":"Subscription"},{"p":"de.tudresden.sumo.subscription","l":"SubscriptionContext"},{"p":"de.tudresden.sumo.subscription","l":"SubscriptionObject"},{"p":"de.tudresden.sumo.util","l":"Sumo"},{"p":"de.tudresden.ws.container","l":"SumoBestLanes.SumoBestLane"},{"p":"de.tudresden.ws.container","l":"SumoBestLanes"},{"p":"de.tudresden.ws.container","l":"SumoBoundingBox"},{"p":"de.tudresden.ws.container","l":"SumoColor"},{"p":"de.tudresden.sumo.util","l":"SumoCommand"},{"p":"de.tudresden.sumo.subscription","l":"SumoDomain"},{"p":"de.tudresden.ws.container","l":"SumoGeometry"},{"p":"de.tudresden.ws.container","l":"SumoLeader"},{"p":"de.tudresden.ws.container","l":"SumoLink"},{"p":"de.tudresden.ws.container","l":"SumoLinkList"},{"p":"de.tudresden.ws.container","l":"SumoNextTLS"},{"p":"de.tudresden.ws.container","l":"SumoObject"},{"p":"de.tudresden.ws.container","l":"SumoPosition2D"},{"p":"de.tudresden.ws.container","l":"SumoPosition3D"},{"p":"de.tudresden.ws.container","l":"SumoPrimitive"},{"p":"de.tudresden.ws.container","l":"SumoRoadPosition"},{"p":"de.tudresden.ws.container","l":"SumoStage"},{"p":"de.tudresden.ws.container","l":"SumoStopFlags"},{"p":"de.tudresden.ws.container","l":"SumoStringList"},{"p":"de.tudresden.ws.container","l":"SumoTLSController"},{"p":"de.tudresden.ws.container","l":"SumoTLSPhase"},{"p":"de.tudresden.ws.container","l":"SumoTLSProgram"},{"p":"it.polito.appeal.traci","l":"SumoTraciConnection"},{"p":"de.tudresden.ws.container","l":"SumoVehicleData"},{"p":"de.tudresden.ws.container","l":"SumoVehicleSignal"},{"p":"de.tudresden.ws.container","l":"SumoVehicleSignalState"},{"p":"de.tudresden.ws","l":"Traci"},{"p":"it.polito.appeal.traci","l":"TraCIException"},{"p":"de.tudresden.sumo.cmd","l":"Trafficlight"},{"p":"it.polito.appeal.traci","l":"TraCIException.UnexpectedData"},{"p":"it.polito.appeal.traci","l":"TraCIException.UnexpectedDatatype"},{"p":"it.polito.appeal.traci","l":"TraCIException.UnexpectedResponse"},{"p":"de.tudresden.sumo.subscription","l":"VariableSubscription"},{"p":"de.tudresden.sumo.cmd","l":"Vehicle"},{"p":"de.tudresden.ws.container","l":"SumoVehicleData.VehicleData"},{"p":"de.tudresden.sumo.cmd","l":"Vehicletype"},{"p":"de.tudresden.ws","l":"WebService"}] \ No newline at end of file Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/javadoc/traas/type-search-index.zip and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/javadoc/traas/type-search-index.zip differ diff -Nru sumo-1.5.0+dfsg1/docs/man/activitygen.1 sumo-1.6.0+dfsg1/docs/man/activitygen.1 --- sumo-1.5.0+dfsg1/docs/man/activitygen.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/activitygen.1 2020-04-27 22:06:18.000000000 +0000 @@ -0,0 +1,160 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO activitygen Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 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 +.IP +traffic simulation SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Use FILE as SUMO\-network to create trips for +.TP +\fB\-s\fR, \fB\-\-stat\-file\fR FILE +Loads the SUMO\-statistics FILE +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output files. +The special string 'TIME' is replaced by +the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the comma +for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the comma +for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Write generated trips to FILE +.PP +Processing Options: +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR INT +Sets the time of beginning of the simulation +during the first day (in seconds) +.TP +\fB\-e\fR, \fB\-\-end\fR INT +Sets the time of ending of the simulation +during the last day (in seconds) +.TP +\fB\-\-duration\-d\fR INT +Sets the duration of the simulation in days +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO network +inputs ("never", "auto" or "always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type whenever +more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-debug\fR +Detailed messages about every single step +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator with +the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator with +the given value +.SH EXAMPLES +.IP +activitygen \-\-net\-file .net.xml \-\-stat\-file .stat.xml \-\-output .rou.xml \-\-rand +.IP +generate a trips file from a stats file on a given net using arbitrary random seed +.IP +activitygen \-\-net\-file .net.xml \-\-stat\-file .stat.xml \-\-output .rou.xml \-\-duration\-d +.IP +generate a trips file from a stats file on a given net for numerous days (with fixed random seed) +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 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.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/dfrouter.1 sumo-1.6.0+dfsg1/docs/man/dfrouter.1 --- sumo-1.5.0+dfsg1/docs/man/dfrouter.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/dfrouter.1 2020-04-27 22:06:17.000000000 +0000 @@ -0,0 +1,298 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO dfrouter Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- Builds vehicle routes for SUMO using detector values +.SH SYNOPSIS +.B dfrouter +[\fI\,OPTION\/\fR]\fI\,*\/\fR +.SH DESCRIPTION +Eclipse SUMO dfrouter Version 1.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Builds vehicle routes for SUMO using detector values. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Loads the SUMO\-network FILE +.TP +\fB\-d\fR, \fB\-\-detector\-files\fR FILE +Loads detector descriptions from FILE +.TP +\fB\-f\fR, \fB\-\-measure\-files\fR FILE +Loads detector flows from FILE(s) +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-routes\-output\fR FILE +Saves computed routes to FILE +.TP +\fB\-\-routes\-for\-all\fR +Forces DFROUTER to compute routes for +in\-between detectors +.TP +\fB\-\-detector\-output\fR FILE +Saves typed detectors to FILE +.TP +\fB\-\-detectors\-poi\-output\fR FILE +Saves detector positions as pois to FILE +.TP +\fB\-\-emitters\-output\fR FILE +Saves emitter definitions for source +detectors to FILE +.TP +\fB\-\-vtype\fR +Add vehicle types to the emitters file +(PKW, LKW) +.TP +\fB\-\-vtype\-output\fR FILE +Write generated vehicle types into +separate FILE instead of including them +into the emitters\-output +.TP +\fB\-\-emitters\-poi\-output\fR FILE +Saves emitter positions as pois to FILE +.TP +\fB\-\-variable\-speed\-sign\-output\fR FILE +Saves variable seed sign definitions for +sink detectors to FILE +.TP +\fB\-\-end\-reroute\-output\fR FILE +Saves rerouter definitions for sink +detectors to FILE +.HP +\fB\-\-validation\-output\fR FILE +.HP +\fB\-\-validation\-output\fR.add\-sources +.SS "Processing Options:" +.TP +\fB\-\-guess\-empty\-flows\fR +Derive missing flow values from upstream +or downstream (not working!) +.TP +\fB\-h\fR, \fB\-\-highway\-mode\fR +Switches to highway\-mode +.TP +\fB\-\-ignore\-invalid\-detectors\fR +Only warn about unparseable detectors +.TP +\fB\-\-revalidate\-detectors\fR +Recomputes detector types even if given +.TP +\fB\-\-revalidate\-routes\fR +Recomputes routes even if given +.TP +\fB\-\-keep\-unfinished\-routes\fR +Keeps routes even if they have exhausted +max\-search\-depth +.TP +\fB\-\-keep\-longer\-routes\fR +Keeps routes even if a shorter one +exists +.TP +\fB\-\-max\-search\-depth\fR INT +Number of edges to follow a route +without passing a detector +.TP +\fB\-\-emissions\-only\fR +Writes only emission times +.TP +\fB\-\-disallowed\-edges\fR STR[] +Do not route on these edges +.TP +\fB\-\-keep\-turnarounds\fR +Allow turnarounds as route continuations +.TP +\fB\-\-min\-route\-length\fR FLOAT +Minimum distance in meters between start +and end node of every route +.TP +\fB\-\-randomize\-flows\fR +generate random departure times for +emitted vehicles +.TP +\fB\-\-time\-factor\fR TIME +Multiply flow times with TIME to get +seconds +.TP +\fB\-\-time\-offset\fR TIME +Subtracts TIME seconds from (scaled) +flow times +.TP +\fB\-\-time\-step\fR TIME +Expected distance between two successive +data sets +.TP +\fB\-\-calibrator\-output\fR +Write calibrators to FILE +.HP +\fB\-\-include\-unused\-routes\fR +.HP +\fB\-\-revalidate\-flows\fR +.TP +\fB\-\-remove\-empty\-detectors\fR +Removes empty detectors from the list +.HP +\fB\-\-strict\-sources\fR +.TP +\fB\-\-respect\-concurrent\-inflows\fR +Try to determine further inflows to an +inbetween detector when computing split +probabilities +.TP +\fB\-\-scale\fR FLOAT +Scale factor for flows +.SS "Defaults Options:" +.TP +\fB\-\-departlane\fR STR +Assigns a default depart lane +.TP +\fB\-\-departpos\fR STR +Assigns a default depart position +.TP +\fB\-\-departspeed\fR STR +Assigns a default depart speed +.TP +\fB\-\-arrivallane\fR STR +Assigns a default arrival lane +.TP +\fB\-\-arrivalpos\fR STR +Assigns a default arrival position +.TP +\fB\-\-arrivalspeed\fR STR +Assigns a default arrival speed +.TP +\fB\-\-speeddev\fR FLOAT +The default speed deviation of vehicles +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time; +Previous defs will be discarded +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time; +Later defs will be discarded; +Defaults to one day +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-report\-empty\-detectors\fR +Lists detectors with no flow (enable \fB\-v\fR) +.TP +\fB\-\-print\-absolute\-flows\fR +Prints aggregated detector flows +.TP +\fB\-\-no\-step\-log\fR +Disable console output of route parsing +step +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +dfrouter \-c +.IP +run routing with options from file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO dfrouter Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/duarouter.1 sumo-1.6.0+dfsg1/docs/man/duarouter.1 --- sumo-1.5.0+dfsg1/docs/man/duarouter.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/duarouter.1 2020-04-27 22:06:17.000000000 +0000 @@ -0,0 +1,391 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO duarouter Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Shortest path router and DUE computer for the microscopic, multi\-modal traffic +.IP +simulation SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Use FILE as SUMO\-network to route on +.TP +\fB\-a\fR, \fB\-\-additional\-files\fR FILE +Read additional network data (districts, +bus stops) from FILE(s) +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Read sumo routes, alternatives, flows, +and trips from FILE(s) +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.TP +\fB\-\-junction\-taz\fR +Initialize a TAZ for every junction to +use attributes toJunction and +fromJunction +.TP +\fB\-w\fR, \fB\-\-weight\-files\fR FILE +Read network weights from FILE(s) +.TP +\fB\-\-lane\-weight\-files\fR FILE +Read lane\-based network weights from +FILE(s) +.TP +\fB\-x\fR, \fB\-\-weight\-attribute\fR STR +Name of the xml attribute which gives the +edge weight +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Write generated routes to FILE +.TP +\fB\-\-vtype\-output\fR FILE +Write used vehicle types into separate +FILE +.TP +\fB\-\-keep\-vtype\-distributions\fR +Keep vTypeDistribution ids when writing +vehicles and their types +.TP +\fB\-\-alternatives\-output\fR FILE +Write generated route alternatives to +FILE +.TP +\fB\-\-intermodal\-network\-output\fR FILE +Write edge splits and connectivity to +FILE +.TP +\fB\-\-intermodal\-weight\-output\fR FILE +Write intermodal edges with lengths and +travel times to FILE +.TP +\fB\-\-write\-trips\fR +Write trips instead of vehicles (for +validating trip input) +.TP +\fB\-\-write\-trips\fR.geo +Write trips with geo\-coordinates +.TP +\fB\-\-write\-trips\fR.junctions +Write trips with fromJunction and +toJunction +.TP +\fB\-\-exit\-times\fR +Write exit times (weights) for each edge +.SS "Processing Options:" +.TP +\fB\-\-unsorted\-input\fR +Assume input is unsorted +.TP +\fB\-s\fR, \fB\-\-route\-steps\fR TIME +Load routes for the next number of +seconds ahead +.TP +\fB\-\-no\-internal\-links\fR +Disable (junction) internal links +.TP +\fB\-\-randomize\-flows\fR +generate random departure times for flow +input +.TP +\fB\-\-max\-alternatives\fR INT +Prune the number of alternatives to INT +.TP +\fB\-\-remove\-loops\fR +Remove loops within the route; +Remove turnarounds at start and end of +the route +.TP +\fB\-\-repair\fR +Tries to correct a false route +.TP +\fB\-\-repair\fR.from +Tries to correct an invalid starting edge +by using the first usable edge instead +.TP +\fB\-\-repair\fR.to +Tries to correct an invalid destination +edge by using the last usable edge +instead +.TP +\fB\-\-weights\fR.interpolate +Interpolate edge weights at interval +boundaries +.TP +\fB\-\-weights\fR.minor\-penalty FLOAT +Apply the given time penalty when +computing routing costs for minor\-link +internal lanes +.TP +\fB\-\-with\-taz\fR +Use origin and destination zones +(districts) for in\- and output +.TP +\fB\-\-mapmatch\fR.distance FLOAT +Maximum distance when mapping input +coordinates (fromXY etc.) to the road +network +.TP +\fB\-\-mapmatch\fR.junctions +Match postions to junctions instead of +edges +.TP +\fB\-\-bulk\-routing\fR +Aggregate routing queries with the same +origin +.TP +\fB\-\-routing\-threads\fR INT +The number of parallel execution threads +used for routing +.TP +\fB\-\-restriction\-params\fR STR[] +Comma separated list of param keys to +compare for additional restrictions +.TP +\fB\-\-weights\fR.expand +Expand weights behind the simulation's +end +.TP +\fB\-\-weights\fR.random\-factor FLOAT +Edge weights for routing are dynamically +disturbed by a random factor drawn +uniformly from [1,FLOAT) +.TP +\fB\-\-routing\-algorithm\fR STR +Select among routing algorithms +['dijkstra', 'astar', 'CH', 'CHWrapper'] +.TP +\fB\-\-weight\-period\fR TIME +Aggregation period for the given weight +files; +triggers rebuilding of Contraction +Hierarchy +.TP +\fB\-\-weights\fR.priority\-factor FLOAT +Consider edge priorities in addition to +travel times, weighted by factor +.TP +\fB\-\-astar\fR.all\-distances FILE +Initialize lookup table for astar from +the given file (generated by marouter +\fB\-\-all\-pairs\-output\fR) +.TP +\fB\-\-astar\fR.landmark\-distances FILE +Initialize lookup table for astar +ALT\-variant from the given file +.TP +\fB\-\-astar\fR.save\-landmark\-distances FILE +Save lookup table for astar ALT\-variant +to the given file +.TP +\fB\-\-gawron\fR.beta FLOAT +Use FLOAT as Gawron's beta +.TP +\fB\-\-gawron\fR.a FLOAT +Use FLOAT as Gawron's a +.TP +\fB\-\-keep\-all\-routes\fR +Save routes with near zero probability +.TP +\fB\-\-skip\-new\-routes\fR +Only reuse routes from input, do not +calculate new ones +.TP +\fB\-\-ptline\-routing\fR +Route all public transport input +.TP +\fB\-\-logit\fR +Use c\-logit model (deprecated in favor of +\fB\-\-route\-choice\-method\fR logit) +.TP +\fB\-\-route\-choice\-method\fR STR +Choose a route choice method: gawron, +logit, or lohse +.TP +\fB\-\-logit\fR.beta FLOAT +Use FLOAT as logit's beta +.TP +\fB\-\-logit\fR.gamma FLOAT +Use FLOAT as logit's gamma +.TP +\fB\-\-logit\fR.theta FLOAT +Use FLOAT as logit's theta (negative +values mean auto\-estimation) +.TP +\fB\-\-persontrip\fR.walkfactor FLOAT +Use FLOAT as a factor on pedestrian +maximum speed during intermodal routing +.TP +\fB\-\-persontrip\fR.transfer.car\-walk STR[] +Where are mode changes from car to +walking allowed (possible values: +\&'parkingAreas', 'ptStops', +\&'allJunctions', 'taxi' and combinations) +.SS "Defaults Options:" +.TP +\fB\-\-departlane\fR STR +Assigns a default depart lane +.TP +\fB\-\-departpos\fR STR +Assigns a default depart position +.TP +\fB\-\-departspeed\fR STR +Assigns a default depart speed +.TP +\fB\-\-arrivallane\fR STR +Assigns a default arrival lane +.TP +\fB\-\-arrivalpos\fR STR +Assigns a default arrival position +.TP +\fB\-\-arrivalspeed\fR STR +Assigns a default arrival speed +.TP +\fB\-\-defaults\-override\fR +Defaults will override given values +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time; +Previous trips will be discarded +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time; +Later trips will be discarded; +Defaults to the maximum time that SUMO +can represent +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue if a route could not be build +.TP +\fB\-\-stats\-period\fR INT +Defines how often statistics shall be +printed +.TP +\fB\-\-no\-step\-log\fR +Disable console output of route parsing +step +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +duarouter \-c +.IP +run routing with options from file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO duarouter Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/emissionsDrivingCycle.1 sumo-1.6.0+dfsg1/docs/man/emissionsDrivingCycle.1 --- sumo-1.5.0+dfsg1/docs/man/emissionsDrivingCycle.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/emissionsDrivingCycle.1 2020-04-27 22:06:20.000000000 +0000 @@ -0,0 +1,180 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO emissionsDrivingCycle Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 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:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-t\fR, \fB\-\-timeline\-file\fR FILE +Defines the file to read the driving cycle +from. +.TP +\fB\-\-timeline\-file\fR.skip INT +Skips the firs NUM lines. +.TP +\fB\-\-timeline\-file\fR.separator STR +Defines the entry separator. +.TP +\fB\-n\fR, \fB\-\-netstate\-file\fR FILE +Defines the netstate, route and trajectory +files to read the driving cycles from. +.TP +\fB\-e\fR, \fB\-\-emission\-class\fR STR +Defines for which emission class the +emissions shall be generated. +.SS "Processing Options:" +.TP +\fB\-a\fR, \fB\-\-compute\-a\fR +If set, the acceleration is computed instead +of being read from the file. +.TP +\fB\-\-compute\-a\fR.forward +If set, the acceleration for time t is +computed from v(t+1) \- v(t) instead of v(t) +\- v(t\-1). +.TP +\fB\-\-compute\-a\fR.zero\-correction +If set, the acceleration for time t is set +to 0 if the speed is 0. +.TP +\fB\-s\fR, \fB\-\-skip\-first\fR +If set, the first line of the read file is +skipped. +.TP +\fB\-\-kmh\fR +If set, the given speed is interpreted as +being given in km/h. +.TP +\fB\-\-have\-slope\fR +If set, the fourth column is read and used +as slope (in deg). +.TP +\fB\-\-slope\fR FLOAT +Sets a global slope (in deg) that is used if +the file does not contain slope +information. +.SS "Output Options:" +.TP +\fB\-o\fR, \fB\-\-output\fR STR +Defines the file to write the emission cycle +results into. +.TP +\fB\-\-emission\-output\fR FILE +Save the emission values of each vehicle in +XML +.TP +\fB\-\-sum\-output\fR FILE +Save the aggregated and normed emission +values of each vehicle in CSV +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output files. +The special string 'TIME' is replaced by +the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the comma +for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the comma +for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than seconds +.SS "Emissions Options:" +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO network +inputs ("never", "auto" or "always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type whenever +more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-q\fR, \fB\-\-quiet\fR +Not writing anything. +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO emissionsDrivingCycle Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/emissionsMap.1 sumo-1.6.0+dfsg1/docs/man/emissionsMap.1 --- sumo-1.5.0+dfsg1/docs/man/emissionsMap.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/emissionsMap.1 2020-04-27 22:06:19.000000000 +0000 @@ -0,0 +1,162 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO emissionsMap Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 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:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Processing Options:" +.TP +\fB\-i\fR, \fB\-\-iterate\fR +If set, maps for all available emissions are +written. +.TP +\fB\-e\fR, \fB\-\-emission\-class\fR STR +Defines the name of the emission class to +generate the map for. +.TP +\fB\-\-v\-min\fR FLOAT +Defines the minimum velocity boundary of the +map to generate (in m/s). +.TP +\fB\-\-v\-max\fR FLOAT +Defines the maximum velocity boundary of the +map to generate (in m/s). +.TP +\fB\-\-v\-step\fR FLOAT +Defines the velocity step size (in m/s). +.TP +\fB\-\-a\-min\fR FLOAT +Defines the minimum acceleration boundary of +the map to generate (in m/s^2). +.TP +\fB\-\-a\-max\fR FLOAT +Defines the maximum acceleration boundary of +the map to generate (in m/s^2). +.TP +\fB\-\-a\-step\fR FLOAT +Defines the acceleration step size (in +m/s^2). +.TP +\fB\-\-s\-min\fR FLOAT +Defines the minimum slope boundary of the +map to generate (in deg). +.TP +\fB\-\-s\-max\fR FLOAT +Defines the maximum slope boundary of the +map to generate (in deg). +.TP +\fB\-\-s\-step\fR FLOAT +Defines the slope step size (in deg). +.SS "Output Options:" +.TP +\fB\-o\fR, \fB\-\-output\fR STR +Defines the file (or the path if \fB\-\-iterate\fR +was set) to write the map(s) into. +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output files. +The special string 'TIME' is replaced by +the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the comma +for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the comma +for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than seconds +.SS "Emissions Options:" +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO network +inputs ("never", "auto" or "always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type whenever +more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO emissionsMap Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/jtrrouter.1 sumo-1.6.0+dfsg1/docs/man/jtrrouter.1 --- sumo-1.5.0+dfsg1/docs/man/jtrrouter.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/jtrrouter.1 2020-04-27 22:06:17.000000000 +0000 @@ -0,0 +1,301 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO jtrrouter Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Router for the microscopic, multi\-modal traffic simulation SUMO based on +.IP +junction turning ratios. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Use FILE as SUMO\-network to route on +.TP +\fB\-a\fR, \fB\-\-additional\-files\fR FILE +Read additional network data (districts, bus +stops) from FILE(s) +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Read sumo routes, alternatives, flows, and +trips from FILE(s) +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.TP +\fB\-\-junction\-taz\fR +Initialize a TAZ for every junction to use +attributes toJunction and fromJunction +.TP +\fB\-t\fR, \fB\-\-turn\-ratio\-files\fR FILE +Read turning ratios from FILE(s) +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output files. +The special string 'TIME' is replaced by +the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the comma +for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the comma +for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Write generated routes to FILE +.TP +\fB\-\-vtype\-output\fR FILE +Write used vehicle types into separate FILE +.TP +\fB\-\-keep\-vtype\-distributions\fR +Keep vTypeDistribution ids when writing +vehicles and their types +.TP +\fB\-\-exit\-times\fR +Write exit times (weights) for each edge +.SS "Processing Options:" +.TP +\fB\-\-unsorted\-input\fR +Assume input is unsorted +.TP +\fB\-s\fR, \fB\-\-route\-steps\fR TIME +Load routes for the next number of seconds +ahead +.TP +\fB\-\-no\-internal\-links\fR +Disable (junction) internal links +.TP +\fB\-\-randomize\-flows\fR +generate random departure times for flow +input +.TP +\fB\-\-max\-alternatives\fR INT +Prune the number of alternatives to INT +.TP +\fB\-\-remove\-loops\fR +Remove loops within the route; +Remove turnarounds at start and end of the +route +.TP +\fB\-\-repair\fR +Tries to correct a false route +.TP +\fB\-\-repair\fR.from +Tries to correct an invalid starting edge by +using the first usable edge instead +.TP +\fB\-\-repair\fR.to +Tries to correct an invalid destination edge +by using the last usable edge instead +.TP +\fB\-\-weights\fR.interpolate +Interpolate edge weights at interval +boundaries +.TP +\fB\-\-weights\fR.minor\-penalty FLOAT +Apply the given time penalty when computing +routing costs for minor\-link internal lanes +.TP +\fB\-\-with\-taz\fR +Use origin and destination zones (districts) +for in\- and output +.TP +\fB\-\-mapmatch\fR.distance FLOAT +Maximum distance when mapping input +coordinates (fromXY etc.) to the road +network +.TP +\fB\-\-mapmatch\fR.junctions +Match postions to junctions instead of edges +.TP +\fB\-\-bulk\-routing\fR +Aggregate routing queries with the same +origin +.TP +\fB\-\-routing\-threads\fR INT +The number of parallel execution threads +used for routing +.TP +\fB\-\-restriction\-params\fR STR[] +Comma separated list of param keys to +compare for additional restrictions +.TP +\fB\-\-max\-edges\-factor\fR FLOAT +Routes are cut off when the route edges to +net edges ratio is larger than FLOAT +.TP +\fB\-T\fR, \fB\-\-turn\-defaults\fR STR[] +Use STR[] as default turn definition +.TP +\fB\-\-sink\-edges\fR STR[] +Use STR[] as list of sink edges +.TP +\fB\-A\fR, \fB\-\-accept\-all\-destinations\fR +Whether all edges are allowed as sink edges +.TP +\fB\-i\fR, \fB\-\-ignore\-vclasses\fR +Ignore road restrictions based on vehicle +class +.TP +\fB\-\-allow\-loops\fR +Allow to re\-use a road +.TP +\fB\-S\fR, \fB\-\-sources\-are\-sinks\fR +Use all source edges as sink edges. +.TP +\fB\-D\fR, \fB\-\-discount\-sources\fR +Subtract upstream flow when inserting a new +flow. When option \fB\-\-sources\-are\-sinks\fR is +set, the upstream flow is limited to the +value of the source flow and the remainig +part termines. +.SS "Defaults Options:" +.TP +\fB\-\-departlane\fR STR +Assigns a default depart lane +.TP +\fB\-\-departpos\fR STR +Assigns a default depart position +.TP +\fB\-\-departspeed\fR STR +Assigns a default depart speed +.TP +\fB\-\-arrivallane\fR STR +Assigns a default arrival lane +.TP +\fB\-\-arrivalpos\fR STR +Assigns a default arrival position +.TP +\fB\-\-arrivalspeed\fR STR +Assigns a default arrival speed +.TP +\fB\-\-defaults\-override\fR +Defaults will override given values +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time; +Previous trips will be discarded +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time; +Later trips will be discarded; +Defaults to the maximum time that SUMO can +represent +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO network +inputs ("never", "auto" or "always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type whenever +more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue if a route could not be build +.TP +\fB\-\-stats\-period\fR INT +Defines how often statistics shall be +printed +.TP +\fB\-\-no\-step\-log\fR +Disable console output of route parsing step +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator with +the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator with +the given value +.SH EXAMPLES +.IP +jtrrouter \-c +.IP +run with routing options defined in file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO jtrrouter Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/marouter.1 sumo-1.6.0+dfsg1/docs/man/marouter.1 --- sumo-1.5.0+dfsg1/docs/man/marouter.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/marouter.1 2020-04-27 22:06:18.000000000 +0000 @@ -0,0 +1,347 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO marouter Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 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:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Use FILE as SUMO\-network to route on +.TP +\fB\-d\fR, \fB\-\-additional\-files\fR FILE +Read additional network data (districts, +bus stops) from FILE +.TP +\fB\-m\fR, \fB\-\-od\-matrix\-files\fR FILE +Loads O/D\-files from FILE(s) +.TP +\fB\-\-od\-amitran\-files\fR FILE +Loads O/D\-matrix in Amitran format from +FILE(s) +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Read sumo\-routes or trips from FILE(s) +.TP +\fB\-w\fR, \fB\-\-weight\-files\fR FILE +Read network weights from FILE(s) +.TP +\fB\-\-lane\-weight\-files\fR FILE +Read lane\-based network weights from +FILE(s) +.TP +\fB\-x\fR, \fB\-\-weight\-attribute\fR STR +Name of the xml attribute which gives the +edge weight +.TP +\fB\-\-weight\-adaption\fR FLOAT +The travel time influence of prior +intervals +.TP +\fB\-\-taz\-param\fR STR[] +Parameter key(s) defining source (and +sink) taz +.TP +\fB\-\-junction\-taz\fR +Initialize a TAZ for every junction to use +attributes toJunction and fromJunction +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Write flow definitions with route +distributions to FILE +.TP +\fB\-\-vtype\-output\fR FILE +Write used vehicle types into separate +FILE +.TP +\fB\-\-ignore\-vehicle\-type\fR +Does not save vtype information +.TP +\fB\-\-netload\-output\fR FILE +Writes edge loads and final costs into +FILE +.TP +\fB\-\-all\-pairs\-output\fR FILE +Writes complete distance matrix into FILE +.TP +\fB\-\-exit\-times\fR +Write exit times (weights) for each edge +.SS "Processing Options:" +.TP +\fB\-\-aggregation\-interval\fR TIME +Defines the time interval when aggregating +single vehicle input; +Defaults to one hour +.TP +\fB\-\-max\-alternatives\fR INT +Prune the number of alternatives to INT +.TP +\fB\-\-weights\fR.interpolate +Interpolate edge weights at interval +boundaries +.TP +\fB\-\-weights\fR.expand +Expand weights behind the simulation's end +.TP +\fB\-\-weights\fR.priority\-factor FLOAT +Consider edge priorities in addition to +travel times, weighted by factor +.TP +\fB\-\-routing\-algorithm\fR STR +Select among routing algorithms +['dijkstra', 'astar', 'CH', 'CHWrapper'] +.TP +\fB\-\-bulk\-routing\fR.vtypes +Aggregate routing queries with the same +origin for different vehicle types +.TP +\fB\-\-routing\-threads\fR INT +The number of parallel execution threads +used for routing +.TP +\fB\-\-weight\-period\fR TIME +Aggregation period for the given weight +files; +triggers rebuilding of Contraction +Hierarchy +.TP +\fB\-s\fR, \fB\-\-scale\fR FLOAT +Scales the loaded flows by FLOAT +.TP +\fB\-\-vtype\fR STR +Defines the name of the vehicle type to +use +.TP +\fB\-\-prefix\fR STR +Defines the prefix for vehicle flow names +.TP +\fB\-\-timeline\fR STR[] +Uses STR[] as a timeline definition +.TP +\fB\-\-timeline\fR.day\-in\-hours +Uses STR as a 24h\-timeline definition +.TP +\fB\-\-additive\-traffic\fR +Keep traffic flows of all time slots in +the net +.TP +\fB\-\-assignment\-method\fR STR +Choose a assignment method: incremental, +UE or SUE +.TP +\fB\-\-tolerance\fR FLOAT +Use FLOAT as tolerance when checking for +SUE stability +.TP +\fB\-\-left\-turn\-penalty\fR FLOAT +Use left\-turn penalty FLOAT to calculate +link travel time when searching routes +.TP +\fB\-\-paths\fR INT +Use INTEGER as the number of paths needed +to be searched for each OD pair at each +iteration +.TP +\fB\-\-paths\fR.penalty FLOAT +Penalize existing routes with FLOAT to +find secondary routes +.TP +\fB\-\-upperbound\fR FLOAT +Use FLOAT as the upper bound to determine +auxiliary link cost +.TP +\fB\-\-lowerbound\fR FLOAT +Use FLOAT as the lower bound to determine +auxiliary link cost +.TP +\fB\-i\fR, \fB\-\-max\-iterations\fR INT +maximal number of iterations for new route +searching in incremental and stochastic +user assignment +.TP +\fB\-\-max\-inner\-iterations\fR INT +maximal number of inner iterations for +user equilibrium calcuation in the +stochastic user assignment +.TP +\fB\-\-route\-choice\-method\fR STR +Choose a route choice method: gawron, +logit, or lohse +.TP +\fB\-\-gawron\fR.beta FLOAT +Use FLOAT as Gawron's beta +.TP +\fB\-\-gawron\fR.a FLOAT +Use FLOAT as Gawron's a +.TP +\fB\-\-keep\-all\-routes\fR +Save routes with near zero probability +.TP +\fB\-\-skip\-new\-routes\fR +Only reuse routes from input, do not +calculate new ones +.TP +\fB\-\-logit\fR.beta FLOAT +Use FLOAT as (c\-)logit's beta for the +commonality factor +.TP +\fB\-\-logit\fR.gamma FLOAT +Use FLOAT as (c\-)logit's gamma for the +commonality factor +.TP +\fB\-\-logit\fR.theta FLOAT +Use FLOAT as (c\-)logit's theta +.SS "Defaults Options:" +.TP +\fB\-\-flow\-output\fR.departlane STR +Assigns a default depart lane +.TP +\fB\-\-flow\-output\fR.departpos STR +Assigns a default depart position +.TP +\fB\-\-flow\-output\fR.departspeed STR +Assigns a default depart speed +.TP +\fB\-\-flow\-output\fR.arrivallane STR +Assigns a default arrival lane +.TP +\fB\-\-flow\-output\fR.arrivalpos STR +Assigns a default arrival position +.TP +\fB\-\-flow\-output\fR.arrivalspeed STR +Assigns a default arrival speed +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time; +Previous trips will be discarded +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time; +Later trips will be discarded; +Defaults to the maximum time that SUMO +can represent +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue if a route could not be build +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +marouter \-c +.IP +run routing with options from file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO marouter Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/netconvert.1 sumo-1.6.0+dfsg1/docs/man/netconvert.1 --- sumo-1.5.0+dfsg1/docs/man/netconvert.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/netconvert.1 2020-04-27 22:06:18.000000000 +0000 @@ -0,0 +1,1182 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO netconvert Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Network importer / builder for the microscopic, multi\-modal traffic simulation +.IP +SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-s\fR, \fB\-\-sumo\-net\-file\fR FILE +Read SUMO\-net from FILE +.TP +\fB\-n\fR, \fB\-\-node\-files\fR FILE +Read XML\-node defs from FILE +.TP +\fB\-e\fR, \fB\-\-edge\-files\fR FILE +Read XML\-edge defs from FILE +.TP +\fB\-x\fR, \fB\-\-connection\-files\fR FILE +Read XML\-connection defs from FILE +.TP +\fB\-i\fR, \fB\-\-tllogic\-files\fR FILE +Read XML\-traffic light defs from FILE +.TP +\fB\-t\fR, \fB\-\-type\-files\fR FILE +Read XML\-type defs from FILE +.TP +\fB\-\-ptstop\-files\fR FILE +Reads public transport stops from FILE +.TP +\fB\-\-ptline\-files\fR FILE +Reads public transport lines from FILE +.TP +\fB\-\-polygon\-files\fR FILE +Reads polygons from FILE for embedding +in network where applicable +.TP +\fB\-\-shapefile\-prefix\fR FILE +Read shapefiles (ArcView, Tiger, ...) +from files starting with 'FILE' +.TP +\fB\-\-dlr\-navteq\-prefix\fR FILE +Read converted Navteq GDF data +(unsplitted Elmar\-network) from path +\&'FILE' +.TP +\fB\-\-osm\-files\fR FILE +Read OSM\-network from path 'FILE(s)' +.TP +\fB\-\-opendrive\-files\fR FILE +Read OpenDRIVE\-network from FILE +.TP +\fB\-\-visum\-file\fR FILE +Read VISUM\-net from FILE +.TP +\fB\-\-vissim\-file\fR FILE +Read VISSIM\-net from FILE +.TP +\fB\-\-robocup\-dir\fR FILE +Read RoboCup\-net from DIR +.TP +\fB\-\-matsim\-files\fR FILE +Read MATsim\-net from FILE +.TP +\fB\-\-itsumo\-files\fR FILE +Read ITSUMO\-net from FILE +.TP +\fB\-\-heightmap\fR.shapefiles FILE +Read heightmap from ArcGIS shapefile +.TP +\fB\-\-heightmap\fR.geotiff FILE +Read heightmap from GeoTIFF +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +The generated net will be written to +FILE +.TP +\fB\-\-plain\-output\-prefix\fR FILE +Prefix of files to write plain xml +nodes, edges and connections to +.TP +\fB\-\-junctions\fR.join\-output FILE +Writes information about joined +junctions to FILE (can be loaded as +additional node\-file to reproduce joins +.TP +\fB\-\-prefix\fR STR +Defines a prefix for edge and junction +names +.TP +\fB\-\-amitran\-output\fR FILE +The generated net will be written to +FILE using Amitran format +.TP +\fB\-\-matsim\-output\fR FILE +The generated net will be written to +FILE using MATsim format +.TP +\fB\-\-opendrive\-output\fR FILE +The generated net will be written to +FILE using OpenDRIVE format +.TP +\fB\-\-dlr\-navteq\-output\fR FILE +The generated net will be written to +dlr\-navteq files with the given PREFIX +.TP +\fB\-\-dlr\-navteq\fR.precision INT +The network coordinates are written with +the specified level of output precision +.TP +\fB\-\-output\fR.street\-names +Street names will be included in the +output (if available) +.TP +\fB\-\-output\fR.original\-names +Writes original names, if given, as +parameter +.TP +\fB\-\-street\-sign\-output\fR FILE +Writes street signs as POIs to FILE +.TP +\fB\-\-ptstop\-output\fR FILE +Writes public transport stops to FILE +.TP +\fB\-\-ptline\-output\fR FILE +Writes public transport lines to FILE +.TP +\fB\-\-ptline\-clean\-up\fR +Clean\-up pt stops that are not served by +any line +.TP +\fB\-\-parking\-output\fR FILE +Writes parking areas to FILE +.TP +\fB\-\-railway\fR.topology.output FILE +Analyse topology of the railway network +.TP +\fB\-\-polygon\-output\fR FILE +Write shapes that are embedded in the +network input and that are not +supported by polyconvert (OpenDRIVE) +.TP +\fB\-\-opendrive\-output\fR.straight\-threshold FLOAT +Builds parameterized curves +whenever the angular change between +straight segments exceeds FLOAT degrees +.SS "Projection Options:" +.TP +\fB\-\-simple\-projection\fR +Uses a simple method for projection +.TP +\fB\-\-proj\fR.scale FLOAT +Scaling factor for input coordinates +.TP +\fB\-\-proj\fR.rotate FLOAT +Rotation (clockwise degrees) for input +coordinates +.TP +\fB\-\-proj\fR.utm +Determine the UTM zone (for a universal +transversal mercator projection based +on the WGS84 ellipsoid) +.TP +\fB\-\-proj\fR.dhdn +Determine the DHDN zone (for a +transversal mercator projection based +on the bessel ellipsoid, +"Gauss\-Krueger") +.TP +\fB\-\-proj\fR STR +Uses STR as proj.4 definition for +projection +.TP +\fB\-\-proj\fR.inverse +Inverses projection +.TP +\fB\-\-proj\fR.dhdnutm +Convert from Gauss\-Krueger to UTM +.TP +\fB\-\-proj\fR.plain\-geo +Write geo coordinates in plain\-xml +.SS "Processing Options:" +.TP +\fB\-\-speed\-in\-kmh\fR +vmax is parsed as given in km/h (some) +.TP +\fB\-\-construction\-date\fR STR +Use YYYY\-MM\-DD date to determine the +readiness of features under +construction +.TP +\fB\-\-flatten\fR +Remove all z\-data +.TP +\fB\-\-plain\fR.extend\-edge\-shape +If edge shapes do not end at the node +positions, extend them +.TP +\fB\-\-numerical\-ids\fR +Remaps alphanumerical IDs of nodes and +edges to ensure that all IDs are +integers +.TP +\fB\-\-numerical\-ids\fR.node\-start INT +Remaps IDs of nodes to integers starting +at INT +.TP +\fB\-\-numerical\-ids\fR.edge\-start INT +Remaps IDs of edges to integers starting +at INT +.TP +\fB\-\-reserved\-ids\fR FILE +Ensures that generated ids do not +included any of the typed IDs from FILE +(SUMO\-GUI selection file format) +.TP +\fB\-\-dismiss\-vclasses\fR +Removes vehicle class restrictions from +imported edges +.TP +\fB\-\-geometry\fR.split +Splits edges across geometry nodes +.TP +\fB\-R\fR, \fB\-\-geometry\fR.remove +Replace nodes which only define edge +geometry by geometry points (joins +edges) +.TP +\fB\-\-geometry\fR.remove.keep\-edges.explicit STR[] +Ensure that the given list of +edges is not modified +.TP +\fB\-\-geometry\fR.remove.keep\-edges.input\-file FILE +Ensure that the edges in FILE +are not modified (Each id on a single +line. Selection files from SUMO\-GUI are +also supported) +.TP +\fB\-\-geometry\fR.remove.min\-length FLOAT +Allow merging edges with differing +attributes when their length is below +min\-length +.TP +\fB\-\-geometry\fR.remove.width\-tolerance FLOAT +Allow merging edges with differing +lane widths if the difference is below +FLOAT +.TP +\fB\-\-geometry\fR.max\-segment\-length FLOAT +splits geometry to restrict segment +length +.TP +\fB\-\-geometry\fR.min\-dist FLOAT +reduces too similar geometry points +.TP +\fB\-\-geometry\fR.max\-angle FLOAT +Warn about edge geometries with an angle +above DEGREES in successive segments +.TP +\fB\-\-geometry\fR.min\-radius FLOAT +Warn about edge geometries with a +turning radius less than METERS at the +start or end +.TP +\fB\-\-geometry\fR.min\-radius.fix +Straighten edge geometries to avoid +turning radii less than +geometry.min\-radius +.TP +\fB\-\-geometry\fR.min\-radius.fix.railways +Straighten edge geometries to avoid +turning radii less than +geometry.min\-radius (only railways) +.TP +\fB\-\-geometry\fR.junction\-mismatch\-threshold FLOAT +Warn if the junction shape is +to far away from the original node +position +.TP +\fB\-\-geometry\fR.check\-overlap FLOAT +Warn if edges overlap by more than the +given threshold value +.TP +\fB\-\-geometry\fR.check\-overlap.vertical\-threshold FLOAT +Ignore overlapping edges +if they are separated vertically by the +given threshold. +.TP +\fB\-\-geometry\fR.avoid\-overlap +Modify edge geometries to avoid overlap +at junctions +.TP +\fB\-\-join\-lanes\fR +join adjacent lanes that have the same +permissions and which do not admit +lane\-changing (sidewalks and disallowed +lanes) +.TP +\fB\-\-ptline\fR.match\-dist FLOAT +Matches stops outside the road network +to the referencing pt line when below +the given distance +.TP +\fB\-\-ptstop\-output\fR.no\-bidi +Skips automatic generation of stops on +the bidi\-edge of a loaded stop +.TP +\fB\-\-geometry\fR.max\-grade FLOAT +Warn about edge geometries with a grade +in % above FLOAT. +.TP +\fB\-\-geometry\fR.max\-grade.fix +Smooth edge edge geometries with a grade +in above the warning threshold. +.TP +\fB\-\-offset\fR.disable\-normalization +Turn off normalizing node positions +.TP +\fB\-\-offset\fR.x FLOAT +Adds FLOAT to net x\-positions +.TP +\fB\-\-offset\fR.y FLOAT +Adds FLOAT to net y\-positions +.TP +\fB\-\-offset\fR.z FLOAT +Adds FLOAT to net z\-positions +.TP +\fB\-\-flip\-y\-axis\fR +Flips the y\-coordinate along zero +.TP +\fB\-\-roundabouts\fR.guess +Enable roundabout\-guessing +.TP +\fB\-\-opposites\fR.guess +Enable guessing of opposite direction +lanes usable for overtaking +.TP +\fB\-\-opposites\fR.guess.fix\-lengths +Ensure that opposite edges have the same +length +.TP +\fB\-\-fringe\fR.guess +Enable guessing of network fringe nodes +.TP +\fB\-\-lefthand\fR +Assumes left\-hand traffic on the network +.TP +\fB\-\-edges\fR.join +Merges edges which connect the same +nodes and are close to each other +(recommended for VISSIM import) +.TP +\fB\-\-speed\fR.offset FLOAT +Modifies all edge speeds by adding FLOAT +.TP +\fB\-\-speed\fR.factor FLOAT +Modifies all edge speeds by multiplying +by FLOAT +.TP +\fB\-\-speed\fR.minimum FLOAT +Modifies all edge speeds to at least +FLOAT +.SS "Building Defaults Options:" +.TP +\fB\-L\fR, \fB\-\-default\fR.lanenumber INT +The default number of lanes in an edge +.TP +\fB\-\-default\fR.lanewidth FLOAT +The default width of lanes +.TP +\fB\-\-default\fR.spreadtype STR +The default method for computing lane +shapes from edge shapes +.TP +\fB\-S\fR, \fB\-\-default\fR.speed FLOAT +The default speed on an edge (in m/s) +.TP +\fB\-P\fR, \fB\-\-default\fR.priority INT +The default priority of an edge +.TP +\fB\-\-default\fR.type STR +The default edge type +.TP +\fB\-\-default\fR.sidewalk\-width FLOAT +The default width of added sidewalks +.TP +\fB\-\-default\fR.bikelane\-width FLOAT +The default width of added bike lanes +.TP +\fB\-\-default\fR.crossing\-width FLOAT +The default width of a pedestrian +crossing +.TP +\fB\-\-default\fR.disallow STR +The default for disallowed vehicle +classes +.TP +\fB\-\-default\fR.junctions.keep\-clear +Whether junctions should be kept clear +by default +.TP +\fB\-\-default\fR.junctions.radius FLOAT +The default turning radius of +intersections +.TP +\fB\-\-default\fR.connection\-length FLOAT +The default length when overriding +connection lengths +.TP +\fB\-\-default\fR.right\-of\-way STR +The default algorithm for computing +right of way rules ('default', +\&'edgePriority') +.SS "TLS Building Options:" +.TP +\fB\-\-tls\fR.discard\-loaded +Does not instatiate traffic lights +loaded from other formats than +plain\-XML +.TP +\fB\-\-tls\fR.discard\-simple +Does not instatiate traffic lights at +geometry\-like nodes loaded from other +formats than plain\-XML +.TP +\fB\-\-tls\fR.set STR[] +Interprets STR[] as list of junctions to +be controlled by TLS +.TP +\fB\-\-tls\fR.unset STR[] +Interprets STR[] as list of junctions to +be not controlled by TLS +.TP +\fB\-\-tls\fR.guess +Turns on TLS guessing +.TP +\fB\-\-tls\fR.guess.threshold FLOAT +Sets minimum value for the sum of all +incoming lane speeds when guessing TLS +.TP +\fB\-\-tls\fR.taz\-nodes +Sets district nodes as tls\-controlled +.TP +\fB\-\-tls\fR.guess.joining +Includes node clusters into guess +.TP +\fB\-\-tls\fR.join +Tries to cluster tls\-controlled nodes +.TP +\fB\-\-tls\fR.join\-dist FLOAT +Determines the maximal distance for +joining traffic lights (defaults to 20) +.TP +\fB\-\-tls\fR.uncontrolled\-within +Do not control edges that lie fully +within a joined traffic light. This may +cause collisions but allows old traffic +light plans to be used +.TP +\fB\-\-tls\fR.ignore\-internal\-junction\-jam +Do not build mutually conflicting +response matrix, potentially ignoring +vehicles that are stuck at an internal +junction when their phase has ended +.TP +\fB\-\-tls\fR.guess\-signals +Interprets tls nodes surrounding an +intersection as signal positions for a +larger TLS. This is typical pattern for +OSM\-derived networks +.TP +\fB\-\-tls\fR.guess\-signals.dist FLOAT +Distance for interpreting nodes as +signal locations +.TP +\fB\-\-tls\fR.cycle.time INT +Use INT as cycle duration +.TP +\fB\-\-tls\fR.green.time INT +Use INT as green phase duration +.TP +\fB\-D\fR, \fB\-\-tls\fR.yellow.min\-decel FLOAT +Defines smallest vehicle deceleration +.TP +\fB\-\-tls\fR.yellow.patch\-small +Given yellow times are patched even if +being too short +.TP +\fB\-\-tls\fR.yellow.time INT +Set INT as fixed time for yellow phase +durations +.TP +\fB\-\-tls\fR.red.time INT +Set INT as fixed time for red phase +duration at traffic lights that do not +have a conflicting flow +.TP +\fB\-\-tls\fR.allred.time INT +Set INT as fixed time for intermediate +red phase after every switch +.TP +\fB\-\-tls\fR.minor\-left.max\-speed FLOAT +Use FLOAT as threshold for allowing +left\-turning vehicles to move in the +same phase as oncoming straight\-going +vehicles +.TP +\fB\-\-tls\fR.left\-green.time INT +Use INT as green phase duration for left +turns (s). Setting this value to 0 +disables additional left\-turning phases +.TP +\fB\-\-tls\fR.crossing\-min.time INT +Use INT as minimum green duration for +pedestrian crossings (s). +.TP +\fB\-\-tls\fR.crossing\-clearance.time INT +Use INT as clearance time for pedestrian +crossings (s). +.TP +\fB\-\-tls\fR.scramble.time INT +Use INT as green phase duration for +pedestrian scramble phase (s). +.TP +\fB\-\-tls\fR.half\-offset STR[] +TLSs in STR[] will be shifted by +half\-phase +.TP +\fB\-\-tls\fR.quarter\-offset STR[] +TLSs in STR[] will be shifted by +quarter\-phase +.TP +\fB\-\-tls\fR.default\-type STR +TLSs with unspecified type will use STR +as their algorithm +.TP +\fB\-\-tls\fR.layout STR +Set phase layout four grouping opposite +directions or grouping all movements +for one incoming edge ['opposites', +\&'incoming'] +.TP +\fB\-\-tls\fR.min\-dur INT +Default minimum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.max\-dur INT +Default maximum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.group\-signals +Assign the same tls link index to +connections that share the same states +.TP +\fB\-\-tls\fR.ungroup\-signals +Assign a distinct tls link index to +every connection +.SS "Ramp Guessing Options:" +.TP +\fB\-\-ramps\fR.guess +Enable ramp\-guessing +.TP +\fB\-\-ramps\fR.guess\-acceleration\-lanes +Guess on\-ramps and mark acceleration +lanes if they exist but do not add new +lanes +.TP +\fB\-\-ramps\fR.max\-ramp\-speed FLOAT +Treat edges with speed > FLOAT as no +ramps +.TP +\fB\-\-ramps\fR.min\-highway\-speed FLOAT +Treat edges with speed < FLOAT as no +highways +.TP +\fB\-\-ramps\fR.ramp\-length FLOAT +Use FLOAT as ramp\-length +.TP +\fB\-\-ramps\fR.min\-weave\-length FLOAT +Use FLOAT as minimum ramp\-length +.TP +\fB\-\-ramps\fR.set STR[] +Tries to handle the given edges as ramps +.TP +\fB\-\-ramps\fR.unset STR[] +Do not consider the given edges as ramps +.TP +\fB\-\-ramps\fR.no\-split +Avoids edge splitting +.SS "Edge Removal Options:" +.TP +\fB\-\-keep\-edges\fR.min\-speed FLOAT +Only keep edges with speed in +meters/second > FLOAT +.TP +\fB\-\-remove\-edges\fR.explicit STR[] +Remove edges in STR[] +.TP +\fB\-\-keep\-edges\fR.explicit STR[] +Only keep edges in STR[] or those which +are kept due to other keep\-edges or +remove\-edges options +.TP +\fB\-\-keep\-edges\fR.input\-file FILE +Only keep edges in FILE (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) or those +which are kept due to other keep\-edges +or remove\-edges options +.TP +\fB\-\-remove\-edges\fR.input\-file FILE +Remove edges in FILE. (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) +.TP +\fB\-\-keep\-edges\fR.postload +Remove edges after joining +.TP +\fB\-\-keep\-edges\fR.in\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +CARTESIAN corner coordinates + or as polygon +) +.TP +\fB\-\-keep\-edges\fR.in\-geo\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +GEODETIC corner coordinates + or as +polygon ) +.TP +\fB\-\-keep\-edges\fR.by\-vclass STR[] +Only keep edges which allow one of the +vclasss in STR[] +.TP +\fB\-\-remove\-edges\fR.by\-vclass STR[] +Remove edges which allow only vclasses +from STR[] +.TP +\fB\-\-keep\-edges\fR.by\-type STR[] +Only keep edges where type is in STR[] +.TP +\fB\-\-keep\-edges\fR.components INT +Only keep the INT largest weakly +connected components +.TP +\fB\-\-remove\-edges\fR.by\-type STR[] +Remove edges where type is in STR[] +.TP +\fB\-\-remove\-edges\fR.isolated +Removes isolated edges +.SS "Unregulated Nodes Options:" +.TP +\fB\-\-keep\-nodes\-unregulated\fR +All nodes will be unregulated +.TP +\fB\-\-keep\-nodes\-unregulated\fR.explicit STR[] +Do not regulate nodes in STR[] +.TP +\fB\-\-keep\-nodes\-unregulated\fR.district\-nodes +Do not regulate district nodes +.SS "Junctions Options:" +.TP +\fB\-\-junctions\fR.right\-before\-left.speed\-threshold FLOAT +Allow building +right\-before\-left junctions when the +incoming edge speeds are below FLOAT +(m/s) +.TP +\fB\-\-no\-internal\-links\fR +Omits internal links +.TP +\fB\-\-no\-turnarounds\fR +Disables building turnarounds +.TP +\fB\-\-no\-turnarounds\fR.tls +Disables building turnarounds at +tls\-controlled junctions +.TP +\fB\-\-no\-turnarounds\fR.geometry +Disables building turnarounds at +geometry\-like junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-deadend +Disables building turnarounds except at +dead end junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-turnlane +Disables building turnarounds except at +at junctions with a dedicated turning +lane +.TP +\fB\-\-no\-turnarounds\fR.fringe +Disables building turnarounds at fringe +junctions +.TP +\fB\-\-no\-left\-connections\fR +Disables building connections to left +.TP +\fB\-\-junctions\fR.join +Joins junctions that are close to each +other (recommended for OSM import) +.TP +\fB\-\-junctions\fR.join\-dist FLOAT +Determines the maximal distance for +joining junctions (defaults to 10) +.TP +\fB\-\-junctions\fR.join\-exclude STR[] +Interprets STR[] as list of junctions to +exclude from joining +.TP +\fB\-\-junctions\fR.corner\-detail INT +Generate INT intermediate points to +smooth out intersection corners +.TP +\fB\-\-junctions\fR.internal\-link\-detail INT +Generate INT intermediate points to +smooth out lanes within the +intersection +.TP +\fB\-\-junctions\fR.scurve\-stretch FLOAT +Generate longer intersections to allow +for smooth s\-curves when the number of +lanes changes +.TP +\fB\-\-junctions\fR.join\-turns +Builds common edges for turning +connections with common from\- and +to\-edge. This causes discrepancies +between geometrical length and assigned +length due to averaging but enables +lane\-changing while turning +.TP +\fB\-\-junctions\fR.limit\-turn\-speed FLOAT +Limits speed on junctions to an average +lateral acceleration of at most FLOAT +m/s^2) +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle FLOAT +Do not limit turn speed for +angular changes below FLOAT (degrees). +The value is subtracted from the +geometric angle before computing the +turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle.railway FLOAT +Do not limit turn speed +for angular changes below FLOAT +(degrees) on railway edges. The value +is subtracted from the geometric angle +before computing the turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.straight FLOAT +Warn about turn speed +limits that reduce the speed of +straight connections by more than FLOAT +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.turn FLOAT +Warn about turn speed limits +that reduce the speed of turning +connections (no u\-turns) by more than +FLOAT +.TP +\fB\-\-junctions\fR.small\-radius FLOAT +Default radius for junctions that do not +require wide vehicle turns +.TP +\fB\-\-rectangular\-lane\-cut\fR +Forces rectangular cuts between lanes +and intersections +.TP +\fB\-\-check\-lane\-foes\fR.roundabout +Allow driving onto a multi\-lane road if +there are foes on other lanes (at +roundabouts) +.TP +\fB\-\-check\-lane\-foes\fR.all +Allow driving onto a multi\-lane road if +there are foes on other lanes +(everywhere) +.SS "Pedestrian Options:" +.TP +\fB\-\-sidewalks\fR.guess +Guess pedestrian sidewalks based on edge +speed +.TP +\fB\-\-sidewalks\fR.guess.max\-speed FLOAT +Add sidewalks for edges with a speed +equal or below the given limit +.TP +\fB\-\-sidewalks\fR.guess.min\-speed FLOAT +Add sidewalks for edges with a speed +above the given limit +.TP +\fB\-\-sidewalks\fR.guess.from\-permissions +Add sidewalks for edges that allow +pedestrians on any of their lanes +regardless of speed +.TP +\fB\-\-sidewalks\fR.guess.exclude STR[] +Do not guess sidewalks for the given +list of edges +.TP +\fB\-\-crossings\fR.guess +Guess pedestrian crossings based on the +presence of sidewalks +.TP +\fB\-\-crossings\fR.guess.speed\-threshold FLOAT +At uncontrolled nodes, do not build +crossings across edges with a speed +above the threshold +.TP +\fB\-\-walkingareas\fR +Always build walking areas even if there +are no crossings +.SS "Bicycle Options:" +.TP +\fB\-\-bikelanes\fR.guess +Guess bike lanes based on edge speed +.TP +\fB\-\-bikelanes\fR.guess.max\-speed FLOAT +Add bike lanes for edges with a speed +equal or below the given limit +.TP +\fB\-\-bikelanes\fR.guess.min\-speed FLOAT +Add bike lanes for edges with a speed +above the given limit +.TP +\fB\-\-bikelanes\fR.guess.from\-permissions +Add bike lanes for edges that allow +bicycles on any of their lanes +regardless of speed +.TP +\fB\-\-bikelanes\fR.guess.exclude STR[] +Do not guess bikelanes for the given +list of edges +.SS "Railway Options:" +.TP +\fB\-\-railway\fR.signals.discard +Discard all railway signal information +loaded from other formats than +plain\-xml +.TP +\fB\-\-railway\fR.topology.repair +Repair topology of the railway network +.TP +\fB\-\-railway\fR.topology.repair.connect\-straight +Allow bidiretional rail use +wherever rails with opposite directions +meet at a straight angle +.TP +\fB\-\-railway\fR.topology.repair.stop\-turn +Add turn\-around connections at all +loaded stops. +.TP +\fB\-\-railway\fR.topology.all\-bidi +Make all rails usable in both direction +.TP +\fB\-\-railway\fR.topology.all\-bidi.input\-file FILE +Make all rails edge ids from +FILE usable in both direction +.TP +\fB\-\-railway\fR.topology.direction\-priority +Set 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 +.TP +\fB\-\-railway\fR.max\-accesses INT +The maximum roud accesses registered per +rail stops +.TP +\fB\-\-railway\fR.access\-factor FLOAT +The walking length of the access is +computed as air\-line distance +multiplied by FLOAT +.SS "Formats Options:" +.TP +\fB\-\-osm\fR.skip\-duplicates\-check +Skips the check for duplicate nodes and +edges +.TP +\fB\-\-osm\fR.elevation +Imports elevation data +.TP +\fB\-\-osm\fR.layer\-elevation FLOAT +Reconstruct (relative) elevation based +on layer data. Each layer is raised by +FLOAT m +.TP +\fB\-\-osm\fR.layer\-elevation.max\-grade FLOAT +Maximum grade threshold in % at 50km/h +when reconstrucing elevation based on +layer data. The value is scaled +according to road speed. +.TP +\fB\-\-osm\fR.oneway\-spread\-right +Whether one\-way roads should be spread +to the side instead of centered +.TP +\fB\-\-osm\fR.stop\-output.length FLOAT +The default length of a public transport +stop in FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.bus FLOAT +The default length of a bus stop in +FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.tram FLOAT +The default length of a tram stop in +FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.train FLOAT +The default length of a train stop in +FLOAT m +.TP +\fB\-\-osm\fR.all\-attributes +Whether additional attributes shall be +imported +.TP +\fB\-\-matsim\fR.keep\-length +The edge lengths given in the +MATSIM\-file will be kept +.TP +\fB\-\-matsim\fR.lanes\-from\-capacity +The lane number will be computed from +the capacity +.TP +\fB\-\-shapefile\fR.street\-id STR +Read edge ids from column STR +.TP +\fB\-\-shapefile\fR.from\-id STR +Read from\-node ids from column STR +.TP +\fB\-\-shapefile\fR.to\-id STR +Read to\-node ids from column STR +.TP +\fB\-\-shapefile\fR.type\-id STR +Read type ids from column STR +.TP +\fB\-\-shapefile\fR.laneNumber STR +Read lane number from column STR +.TP +\fB\-\-shapefile\fR.speed STR +Read speed from column STR +.TP +\fB\-\-shapefile\fR.name STR +Read (non\-unique) name from column STR +.TP +\fB\-\-shapefile\fR.node\-join\-dist FLOAT +Distance threshold for determining +whether distinct shapes are connected +(used when from\-id and to\-id are not +available) +.TP +\fB\-\-shapefile\fR.add\-params STR[] +Add the list of field names as edge +params +.TP +\fB\-\-shapefile\fR.use\-defaults\-on\-failure +Uses edge type defaults on problems +.TP +\fB\-\-shapefile\fR.all\-bidirectional +Insert edges in both directions +.TP +\fB\-\-shapefile\fR.guess\-projection +Guess the proper projection +.TP +\fB\-\-shapefile\fR.traditional\-axis\-mapping +Use traditional axis order (lon, lat) +.TP +\fB\-\-vissim\fR.join\-distance FLOAT +Structure join offset +.TP +\fB\-\-vissim\fR.default\-speed FLOAT +Use FLOAT as default speed +.TP +\fB\-\-vissim\fR.speed\-norm FLOAT +Factor for edge velocity +.TP +\fB\-\-vissim\fR.report\-unset\-speeds +Writes lanes without an explicit speed +set +.TP +\fB\-\-visum\fR.language\-file FILE +Load language mappings from FILE +.TP +\fB\-\-visum\fR.use\-type\-priority +Uses priorities from types +.TP +\fB\-\-visum\fR.use\-type\-laneno +Uses lane numbers from types +.TP +\fB\-\-visum\fR.use\-type\-speed +Uses speeds from types +.TP +\fB\-\-visum\fR.connector\-speeds FLOAT +Sets connector speed +.TP +\fB\-\-visum\fR.connectors\-lane\-number INT +Sets connector lane number +.TP +\fB\-\-visum\fR.no\-connectors +Excludes connectors +.TP +\fB\-\-visum\fR.recompute\-lane\-number +Computes the number of lanes from the +edges' capacities +.TP +\fB\-\-visum\fR.verbose\-warnings +Prints all warnings, some of which are +due to VISUM misbehaviour +.TP +\fB\-\-visum\fR.lanes\-from\-capacity.norm FLOAT +The factor for flow to no. lanes +conversion +.TP +\fB\-\-opendrive\fR.import\-all\-lanes +Imports all lane types +.TP +\fB\-\-opendrive\fR.ignore\-widths +Whether lane widths shall be ignored. +.TP +\fB\-\-opendrive\fR.curve\-resolution FLOAT +The geometry resolution in m when +importing curved geometries as line +segments. +.TP +\fB\-\-opendrive\fR.advance\-stopline FLOAT +Allow stop lines to be built beyond the +start of the junction if the geometries +allow so +.TP +\fB\-\-opendrive\fR.min\-width FLOAT +The minimum lane width for determining +start or end of variable\-width lanes +.TP +\fB\-\-opendrive\fR.internal\-shapes +Import internal lane shapes +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue on broken input +.TP +\fB\-\-ignore\-errors\fR.connections +Continue on invalid connections +.TP +\fB\-\-show\-errors\fR.connections\-first\-try +Show errors in connections at parsing +.TP +\fB\-\-ignore\-errors\fR.edge\-type +Continue on unknown edge types +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +netconvert \-c +.IP +generate net with options read from file +.IP +netconvert \-n ./nodes.xml \-e ./edges.xml \-v \-t ./owntypes.xml +.IP +generate net with given nodes, edges, and edge types doing verbose output +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO netconvert Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/netedit.1 sumo-1.6.0+dfsg1/docs/man/netedit.1 --- sumo-1.5.0+dfsg1/docs/man/netedit.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/netedit.1 2020-04-27 22:06:19.000000000 +0000 @@ -0,0 +1,1259 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO netedit Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- Road network editor for the traffic simulation SUMO +.SH SYNOPSIS +.B netedit +[\fI\,OPTION\/\fR]\fI\,*\/\fR +.SH DESCRIPTION +Eclipse SUMO netedit Version 1.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Graphical editor for SUMO networks. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-\-new\fR +Start with a new network +.TP +\fB\-s\fR, \fB\-\-sumo\-net\-file\fR FILE +Read SUMO\-net from FILE +.TP +\fB\-n\fR, \fB\-\-node\-files\fR FILE +Read XML\-node defs from FILE +.TP +\fB\-e\fR, \fB\-\-edge\-files\fR FILE +Read XML\-edge defs from FILE +.TP +\fB\-x\fR, \fB\-\-connection\-files\fR FILE +Read XML\-connection defs from FILE +.TP +\fB\-i\fR, \fB\-\-tllogic\-files\fR FILE +Read XML\-traffic light defs from FILE +.TP +\fB\-t\fR, \fB\-\-type\-files\fR FILE +Read XML\-type defs from FILE +.TP +\fB\-\-shapefile\-prefix\fR FILE +Read shapefiles (ArcView, Tiger, ...) +from files starting with 'FILE' +.TP +\fB\-\-dlr\-navteq\-prefix\fR FILE +Read converted Navteq GDF data +(unsplitted Elmar\-network) from path +\&'FILE' +.TP +\fB\-\-osm\-files\fR FILE +Read OSM\-network from path 'FILE(s)' +.TP +\fB\-\-opendrive\-files\fR FILE +Read OpenDRIVE\-network from FILE +.TP +\fB\-\-visum\-file\fR FILE +Read VISUM\-net from FILE +.TP +\fB\-\-vissim\-file\fR FILE +Read VISSIM\-net from FILE +.TP +\fB\-\-robocup\-dir\fR FILE +Read RoboCup\-net from DIR +.TP +\fB\-\-matsim\-files\fR FILE +Read MATsim\-net from FILE +.TP +\fB\-\-itsumo\-files\fR FILE +Read ITSUMO\-net from FILE +.TP +\fB\-\-heightmap\fR.shapefiles FILE +Read heightmap from ArcGIS shapefile +.TP +\fB\-\-heightmap\fR.geotiff FILE +Read heightmap from GeoTIFF +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +The generated net will be written to +FILE +.TP +\fB\-\-plain\-output\-prefix\fR FILE +Prefix of files to write plain xml +nodes, edges and connections to +.TP +\fB\-\-junctions\fR.join\-output FILE +Writes information about joined +junctions to FILE (can be loaded as +additional node\-file to reproduce joins +.TP +\fB\-\-prefix\fR STR +Defines a prefix for edge and junction +names +.TP +\fB\-\-amitran\-output\fR FILE +The generated net will be written to +FILE using Amitran format +.TP +\fB\-\-matsim\-output\fR FILE +The generated net will be written to +FILE using MATsim format +.TP +\fB\-\-opendrive\-output\fR FILE +The generated net will be written to +FILE using OpenDRIVE format +.TP +\fB\-\-dlr\-navteq\-output\fR FILE +The generated net will be written to +dlr\-navteq files with the given PREFIX +.TP +\fB\-\-dlr\-navteq\fR.precision INT +The network coordinates are written with +the specified level of output precision +.TP +\fB\-\-output\fR.street\-names +Street names will be included in the +output (if available) +.TP +\fB\-\-output\fR.original\-names +Writes original names, if given, as +parameter +.TP +\fB\-\-street\-sign\-output\fR FILE +Writes street signs as POIs to FILE +.TP +\fB\-\-ptstop\-output\fR FILE +Writes public transport stops to FILE +.TP +\fB\-\-ptline\-output\fR FILE +Writes public transport lines to FILE +.TP +\fB\-\-ptline\-clean\-up\fR +Clean\-up pt stops that are not served by +any line +.TP +\fB\-\-parking\-output\fR FILE +Writes parking areas to FILE +.TP +\fB\-\-railway\fR.topology.output FILE +Analyse topology of the railway network +.TP +\fB\-\-polygon\-output\fR FILE +Write shapes that are embedded in the +network input and that are not +supported by polyconvert (OpenDRIVE) +.TP +\fB\-\-opendrive\-output\fR.straight\-threshold FLOAT +Builds parameterized curves +whenever the angular change between +straight segments exceeds FLOAT degrees +.SS "Projection Options:" +.TP +\fB\-\-simple\-projection\fR +Uses a simple method for projection +.TP +\fB\-\-proj\fR.scale FLOAT +Scaling factor for input coordinates +.TP +\fB\-\-proj\fR.rotate FLOAT +Rotation (clockwise degrees) for input +coordinates +.TP +\fB\-\-proj\fR.utm +Determine the UTM zone (for a universal +transversal mercator projection based +on the WGS84 ellipsoid) +.TP +\fB\-\-proj\fR.dhdn +Determine the DHDN zone (for a +transversal mercator projection based +on the bessel ellipsoid, +"Gauss\-Krueger") +.TP +\fB\-\-proj\fR STR +Uses STR as proj.4 definition for +projection +.TP +\fB\-\-proj\fR.inverse +Inverses projection +.TP +\fB\-\-proj\fR.dhdnutm +Convert from Gauss\-Krueger to UTM +.TP +\fB\-\-proj\fR.plain\-geo +Write geo coordinates in plain\-xml +.SS "Processing Options:" +.TP +\fB\-\-default\fR.action\-step\-length FLOAT +Length of the default interval length +between action points for the +car\-following and lane\-change models +(in seconds). If not specified, the +simulation step\-length is used per +default. Vehicle\- or VType\-specific +settings override the default. Must be +a multiple of the simulation +step\-length. +.TP +\fB\-\-speed\-in\-kmh\fR +vmax is parsed as given in km/h (some) +.TP +\fB\-\-construction\-date\fR STR +Use YYYY\-MM\-DD date to determine the +readiness of features under +construction +.TP +\fB\-\-flatten\fR +Remove all z\-data +.TP +\fB\-\-plain\fR.extend\-edge\-shape +If edge shapes do not end at the node +positions, extend them +.TP +\fB\-\-numerical\-ids\fR +Remaps alphanumerical IDs of nodes and +edges to ensure that all IDs are +integers +.TP +\fB\-\-numerical\-ids\fR.node\-start INT +Remaps IDs of nodes to integers starting +at INT +.TP +\fB\-\-numerical\-ids\fR.edge\-start INT +Remaps IDs of edges to integers starting +at INT +.TP +\fB\-\-reserved\-ids\fR FILE +Ensures that generated ids do not +included any of the typed IDs from FILE +(SUMO\-GUI selection file format) +.TP +\fB\-\-dismiss\-vclasses\fR +Removes vehicle class restrictions from +imported edges +.TP +\fB\-\-geometry\fR.split +Splits edges across geometry nodes +.TP +\fB\-R\fR, \fB\-\-geometry\fR.remove +Replace nodes which only define edge +geometry by geometry points (joins +edges) +.TP +\fB\-\-geometry\fR.remove.keep\-edges.explicit STR[] +Ensure that the given list of +edges is not modified +.TP +\fB\-\-geometry\fR.remove.keep\-edges.input\-file FILE +Ensure that the edges in FILE +are not modified (Each id on a single +line. Selection files from SUMO\-GUI are +also supported) +.TP +\fB\-\-geometry\fR.remove.min\-length FLOAT +Allow merging edges with differing +attributes when their length is below +min\-length +.TP +\fB\-\-geometry\fR.remove.width\-tolerance FLOAT +Allow merging edges with differing +lane widths if the difference is below +FLOAT +.TP +\fB\-\-geometry\fR.max\-segment\-length FLOAT +splits geometry to restrict segment +length +.TP +\fB\-\-geometry\fR.min\-dist FLOAT +reduces too similar geometry points +.TP +\fB\-\-geometry\fR.max\-angle FLOAT +Warn about edge geometries with an angle +above DEGREES in successive segments +.TP +\fB\-\-geometry\fR.min\-radius FLOAT +Warn about edge geometries with a +turning radius less than METERS at the +start or end +.TP +\fB\-\-geometry\fR.min\-radius.fix +Straighten edge geometries to avoid +turning radii less than +geometry.min\-radius +.TP +\fB\-\-geometry\fR.min\-radius.fix.railways +Straighten edge geometries to avoid +turning radii less than +geometry.min\-radius (only railways) +.TP +\fB\-\-geometry\fR.junction\-mismatch\-threshold FLOAT +Warn if the junction shape is +to far away from the original node +position +.TP +\fB\-\-geometry\fR.check\-overlap FLOAT +Warn if edges overlap by more than the +given threshold value +.TP +\fB\-\-geometry\fR.check\-overlap.vertical\-threshold FLOAT +Ignore overlapping edges +if they are separated vertically by the +given threshold. +.TP +\fB\-\-geometry\fR.avoid\-overlap +Modify edge geometries to avoid overlap +at junctions +.TP +\fB\-\-join\-lanes\fR +join adjacent lanes that have the same +permissions and which do not admit +lane\-changing (sidewalks and disallowed +lanes) +.TP +\fB\-\-ptline\fR.match\-dist FLOAT +Matches stops outside the road network +to the referencing pt line when below +the given distance +.TP +\fB\-\-ptstop\-output\fR.no\-bidi +Skips automatic generation of stops on +the bidi\-edge of a loaded stop +.TP +\fB\-\-geometry\fR.max\-grade FLOAT +Warn about edge geometries with a grade +in % above FLOAT. +.TP +\fB\-\-geometry\fR.max\-grade.fix +Smooth edge edge geometries with a grade +in above the warning threshold. +.TP +\fB\-\-offset\fR.disable\-normalization +Turn off normalizing node positions +.TP +\fB\-\-offset\fR.x FLOAT +Adds FLOAT to net x\-positions +.TP +\fB\-\-offset\fR.y FLOAT +Adds FLOAT to net y\-positions +.TP +\fB\-\-offset\fR.z FLOAT +Adds FLOAT to net z\-positions +.TP +\fB\-\-flip\-y\-axis\fR +Flips the y\-coordinate along zero +.TP +\fB\-\-roundabouts\fR.guess +Enable roundabout\-guessing +.TP +\fB\-\-opposites\fR.guess +Enable guessing of opposite direction +lanes usable for overtaking +.TP +\fB\-\-opposites\fR.guess.fix\-lengths +Ensure that opposite edges have the same +length +.TP +\fB\-\-fringe\fR.guess +Enable guessing of network fringe nodes +.TP +\fB\-\-lefthand\fR +Assumes left\-hand traffic on the network +.TP +\fB\-\-edges\fR.join +Merges edges which connect the same +nodes and are close to each other +(recommended for VISSIM import) +.TP +\fB\-\-speed\fR.offset FLOAT +Modifies all edge speeds by adding FLOAT +.TP +\fB\-\-speed\fR.factor FLOAT +Modifies all edge speeds by multiplying +by FLOAT +.TP +\fB\-\-speed\fR.minimum FLOAT +Modifies all edge speeds to at least +FLOAT +.SS "Building Defaults Options:" +.TP +\fB\-L\fR, \fB\-\-default\fR.lanenumber INT +The default number of lanes in an edge +.TP +\fB\-\-default\fR.lanewidth FLOAT +The default width of lanes +.TP +\fB\-\-default\fR.spreadtype STR +The default method for computing lane +shapes from edge shapes +.TP +\fB\-S\fR, \fB\-\-default\fR.speed FLOAT +The default speed on an edge (in m/s) +.TP +\fB\-P\fR, \fB\-\-default\fR.priority INT +The default priority of an edge +.TP +\fB\-\-default\fR.type STR +The default edge type +.TP +\fB\-\-default\fR.sidewalk\-width FLOAT +The default width of added sidewalks +.TP +\fB\-\-default\fR.bikelane\-width FLOAT +The default width of added bike lanes +.TP +\fB\-\-default\fR.crossing\-width FLOAT +The default width of a pedestrian +crossing +.TP +\fB\-\-default\fR.disallow STR +The default for disallowed vehicle +classes +.TP +\fB\-\-default\fR.junctions.keep\-clear +Whether junctions should be kept clear +by default +.TP +\fB\-\-default\fR.junctions.radius FLOAT +The default turning radius of +intersections +.TP +\fB\-\-default\fR.connection\-length FLOAT +The default length when overriding +connection lengths +.TP +\fB\-\-default\fR.right\-of\-way STR +The default algorithm for computing +right of way rules ('default', +\&'edgePriority') +.SS "TLS Building Options:" +.TP +\fB\-\-tls\fR.discard\-loaded +Does not instatiate traffic lights +loaded from other formats than +plain\-XML +.TP +\fB\-\-tls\fR.discard\-simple +Does not instatiate traffic lights at +geometry\-like nodes loaded from other +formats than plain\-XML +.TP +\fB\-\-tls\fR.set STR[] +Interprets STR[] as list of junctions to +be controlled by TLS +.TP +\fB\-\-tls\fR.unset STR[] +Interprets STR[] as list of junctions to +be not controlled by TLS +.TP +\fB\-\-tls\fR.guess +Turns on TLS guessing +.TP +\fB\-\-tls\fR.guess.threshold FLOAT +Sets minimum value for the sum of all +incoming lane speeds when guessing TLS +.TP +\fB\-\-tls\fR.taz\-nodes +Sets district nodes as tls\-controlled +.TP +\fB\-\-tls\fR.guess.joining +Includes node clusters into guess +.TP +\fB\-\-tls\fR.join +Tries to cluster tls\-controlled nodes +.TP +\fB\-\-tls\fR.join\-dist FLOAT +Determines the maximal distance for +joining traffic lights (defaults to 20) +.TP +\fB\-\-tls\fR.uncontrolled\-within +Do not control edges that lie fully +within a joined traffic light. This may +cause collisions but allows old traffic +light plans to be used +.TP +\fB\-\-tls\fR.ignore\-internal\-junction\-jam +Do not build mutually conflicting +response matrix, potentially ignoring +vehicles that are stuck at an internal +junction when their phase has ended +.TP +\fB\-\-tls\fR.guess\-signals +Interprets tls nodes surrounding an +intersection as signal positions for a +larger TLS. This is typical pattern for +OSM\-derived networks +.TP +\fB\-\-tls\fR.guess\-signals.dist FLOAT +Distance for interpreting nodes as +signal locations +.TP +\fB\-\-tls\fR.cycle.time INT +Use INT as cycle duration +.TP +\fB\-\-tls\fR.green.time INT +Use INT as green phase duration +.TP +\fB\-D\fR, \fB\-\-tls\fR.yellow.min\-decel FLOAT +Defines smallest vehicle deceleration +.TP +\fB\-\-tls\fR.yellow.patch\-small +Given yellow times are patched even if +being too short +.TP +\fB\-\-tls\fR.yellow.time INT +Set INT as fixed time for yellow phase +durations +.TP +\fB\-\-tls\fR.red.time INT +Set INT as fixed time for red phase +duration at traffic lights that do not +have a conflicting flow +.TP +\fB\-\-tls\fR.allred.time INT +Set INT as fixed time for intermediate +red phase after every switch +.TP +\fB\-\-tls\fR.minor\-left.max\-speed FLOAT +Use FLOAT as threshold for allowing +left\-turning vehicles to move in the +same phase as oncoming straight\-going +vehicles +.TP +\fB\-\-tls\fR.left\-green.time INT +Use INT as green phase duration for left +turns (s). Setting this value to 0 +disables additional left\-turning phases +.TP +\fB\-\-tls\fR.crossing\-min.time INT +Use INT as minimum green duration for +pedestrian crossings (s). +.TP +\fB\-\-tls\fR.crossing\-clearance.time INT +Use INT as clearance time for pedestrian +crossings (s). +.TP +\fB\-\-tls\fR.scramble.time INT +Use INT as green phase duration for +pedestrian scramble phase (s). +.TP +\fB\-\-tls\fR.half\-offset STR[] +TLSs in STR[] will be shifted by +half\-phase +.TP +\fB\-\-tls\fR.quarter\-offset STR[] +TLSs in STR[] will be shifted by +quarter\-phase +.TP +\fB\-\-tls\fR.default\-type STR +TLSs with unspecified type will use STR +as their algorithm +.TP +\fB\-\-tls\fR.layout STR +Set phase layout four grouping opposite +directions or grouping all movements +for one incoming edge ['opposites', +\&'incoming'] +.TP +\fB\-\-tls\fR.min\-dur INT +Default minimum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.max\-dur INT +Default maximum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.group\-signals +Assign the same tls link index to +connections that share the same states +.TP +\fB\-\-tls\fR.ungroup\-signals +Assign a distinct tls link index to +every connection +.SS "Ramp Guessing Options:" +.TP +\fB\-\-ramps\fR.guess +Enable ramp\-guessing +.TP +\fB\-\-ramps\fR.guess\-acceleration\-lanes +Guess on\-ramps and mark acceleration +lanes if they exist but do not add new +lanes +.TP +\fB\-\-ramps\fR.max\-ramp\-speed FLOAT +Treat edges with speed > FLOAT as no +ramps +.TP +\fB\-\-ramps\fR.min\-highway\-speed FLOAT +Treat edges with speed < FLOAT as no +highways +.TP +\fB\-\-ramps\fR.ramp\-length FLOAT +Use FLOAT as ramp\-length +.TP +\fB\-\-ramps\fR.min\-weave\-length FLOAT +Use FLOAT as minimum ramp\-length +.TP +\fB\-\-ramps\fR.set STR[] +Tries to handle the given edges as ramps +.TP +\fB\-\-ramps\fR.unset STR[] +Do not consider the given edges as ramps +.TP +\fB\-\-ramps\fR.no\-split +Avoids edge splitting +.SS "Edge Removal Options:" +.TP +\fB\-\-keep\-edges\fR.min\-speed FLOAT +Only keep edges with speed in +meters/second > FLOAT +.TP +\fB\-\-remove\-edges\fR.explicit STR[] +Remove edges in STR[] +.TP +\fB\-\-keep\-edges\fR.explicit STR[] +Only keep edges in STR[] or those which +are kept due to other keep\-edges or +remove\-edges options +.TP +\fB\-\-keep\-edges\fR.input\-file FILE +Only keep edges in FILE (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) or those +which are kept due to other keep\-edges +or remove\-edges options +.TP +\fB\-\-remove\-edges\fR.input\-file FILE +Remove edges in FILE. (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) +.TP +\fB\-\-keep\-edges\fR.postload +Remove edges after joining +.TP +\fB\-\-keep\-edges\fR.in\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +CARTESIAN corner coordinates + or as polygon +) +.TP +\fB\-\-keep\-edges\fR.in\-geo\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +GEODETIC corner coordinates + or as +polygon ) +.TP +\fB\-\-keep\-edges\fR.by\-vclass STR[] +Only keep edges which allow one of the +vclasss in STR[] +.TP +\fB\-\-remove\-edges\fR.by\-vclass STR[] +Remove edges which allow only vclasses +from STR[] +.TP +\fB\-\-keep\-edges\fR.by\-type STR[] +Only keep edges where type is in STR[] +.TP +\fB\-\-keep\-edges\fR.components INT +Only keep the INT largest weakly +connected components +.TP +\fB\-\-remove\-edges\fR.by\-type STR[] +Remove edges where type is in STR[] +.TP +\fB\-\-remove\-edges\fR.isolated +Removes isolated edges +.SS "Unregulated Nodes Options:" +.TP +\fB\-\-keep\-nodes\-unregulated\fR +All nodes will be unregulated +.TP +\fB\-\-keep\-nodes\-unregulated\fR.explicit STR[] +Do not regulate nodes in STR[] +.TP +\fB\-\-keep\-nodes\-unregulated\fR.district\-nodes +Do not regulate district nodes +.SS "Junctions Options:" +.TP +\fB\-\-junctions\fR.right\-before\-left.speed\-threshold FLOAT +Allow building +right\-before\-left junctions when the +incoming edge speeds are below FLOAT +(m/s) +.TP +\fB\-\-no\-internal\-links\fR +Omits internal links +.TP +\fB\-\-no\-turnarounds\fR +Disables building turnarounds +.TP +\fB\-\-no\-turnarounds\fR.tls +Disables building turnarounds at +tls\-controlled junctions +.TP +\fB\-\-no\-turnarounds\fR.geometry +Disables building turnarounds at +geometry\-like junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-deadend +Disables building turnarounds except at +dead end junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-turnlane +Disables building turnarounds except at +at junctions with a dedicated turning +lane +.TP +\fB\-\-no\-turnarounds\fR.fringe +Disables building turnarounds at fringe +junctions +.TP +\fB\-\-no\-left\-connections\fR +Disables building connections to left +.TP +\fB\-\-junctions\fR.join +Joins junctions that are close to each +other (recommended for OSM import) +.TP +\fB\-\-junctions\fR.join\-dist FLOAT +Determines the maximal distance for +joining junctions (defaults to 10) +.TP +\fB\-\-junctions\fR.join\-exclude STR[] +Interprets STR[] as list of junctions to +exclude from joining +.TP +\fB\-\-junctions\fR.corner\-detail INT +Generate INT intermediate points to +smooth out intersection corners +.TP +\fB\-\-junctions\fR.internal\-link\-detail INT +Generate INT intermediate points to +smooth out lanes within the +intersection +.TP +\fB\-\-junctions\fR.scurve\-stretch FLOAT +Generate longer intersections to allow +for smooth s\-curves when the number of +lanes changes +.TP +\fB\-\-junctions\fR.join\-turns +Builds common edges for turning +connections with common from\- and +to\-edge. This causes discrepancies +between geometrical length and assigned +length due to averaging but enables +lane\-changing while turning +.TP +\fB\-\-junctions\fR.limit\-turn\-speed FLOAT +Limits speed on junctions to an average +lateral acceleration of at most FLOAT +m/s^2) +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle FLOAT +Do not limit turn speed for +angular changes below FLOAT (degrees). +The value is subtracted from the +geometric angle before computing the +turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle.railway FLOAT +Do not limit turn speed +for angular changes below FLOAT +(degrees) on railway edges. The value +is subtracted from the geometric angle +before computing the turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.straight FLOAT +Warn about turn speed +limits that reduce the speed of +straight connections by more than FLOAT +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.turn FLOAT +Warn about turn speed limits +that reduce the speed of turning +connections (no u\-turns) by more than +FLOAT +.TP +\fB\-\-junctions\fR.small\-radius FLOAT +Default radius for junctions that do not +require wide vehicle turns +.TP +\fB\-\-rectangular\-lane\-cut\fR +Forces rectangular cuts between lanes +and intersections +.TP +\fB\-\-check\-lane\-foes\fR.roundabout +Allow driving onto a multi\-lane road if +there are foes on other lanes (at +roundabouts) +.TP +\fB\-\-check\-lane\-foes\fR.all +Allow driving onto a multi\-lane road if +there are foes on other lanes +(everywhere) +.SS "Pedestrian Options:" +.TP +\fB\-\-sidewalks\fR.guess +Guess pedestrian sidewalks based on edge +speed +.TP +\fB\-\-sidewalks\fR.guess.max\-speed FLOAT +Add sidewalks for edges with a speed +equal or below the given limit +.TP +\fB\-\-sidewalks\fR.guess.min\-speed FLOAT +Add sidewalks for edges with a speed +above the given limit +.TP +\fB\-\-sidewalks\fR.guess.from\-permissions +Add sidewalks for edges that allow +pedestrians on any of their lanes +regardless of speed +.TP +\fB\-\-sidewalks\fR.guess.exclude STR[] +Do not guess sidewalks for the given +list of edges +.TP +\fB\-\-crossings\fR.guess +Guess pedestrian crossings based on the +presence of sidewalks +.TP +\fB\-\-crossings\fR.guess.speed\-threshold FLOAT +At uncontrolled nodes, do not build +crossings across edges with a speed +above the threshold +.TP +\fB\-\-walkingareas\fR +Always build walking areas even if there +are no crossings +.SS "Bicycle Options:" +.TP +\fB\-\-bikelanes\fR.guess +Guess bike lanes based on edge speed +.TP +\fB\-\-bikelanes\fR.guess.max\-speed FLOAT +Add bike lanes for edges with a speed +equal or below the given limit +.TP +\fB\-\-bikelanes\fR.guess.min\-speed FLOAT +Add bike lanes for edges with a speed +above the given limit +.TP +\fB\-\-bikelanes\fR.guess.from\-permissions +Add bike lanes for edges that allow +bicycles on any of their lanes +regardless of speed +.TP +\fB\-\-bikelanes\fR.guess.exclude STR[] +Do not guess bikelanes for the given +list of edges +.SS "Railway Options:" +.TP +\fB\-\-railway\fR.signals.discard +Discard all railway signal information +loaded from other formats than +plain\-xml +.TP +\fB\-\-railway\fR.topology.repair +Repair topology of the railway network +.TP +\fB\-\-railway\fR.topology.repair.connect\-straight +Allow bidiretional rail use +wherever rails with opposite directions +meet at a straight angle +.TP +\fB\-\-railway\fR.topology.repair.stop\-turn +Add turn\-around connections at all +loaded stops. +.TP +\fB\-\-railway\fR.topology.all\-bidi +Make all rails usable in both direction +.TP +\fB\-\-railway\fR.topology.all\-bidi.input\-file FILE +Make all rails edge ids from +FILE usable in both direction +.TP +\fB\-\-railway\fR.topology.direction\-priority +Set 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 +.TP +\fB\-\-railway\fR.max\-accesses INT +The maximum roud accesses registered per +rail stops +.TP +\fB\-\-railway\fR.access\-factor FLOAT +The walking length of the access is +computed as air\-line distance +multiplied by FLOAT +.SS "Formats Options:" +.TP +\fB\-\-osm\fR.skip\-duplicates\-check +Skips the check for duplicate nodes and +edges +.TP +\fB\-\-osm\fR.elevation +Imports elevation data +.TP +\fB\-\-osm\fR.layer\-elevation FLOAT +Reconstruct (relative) elevation based +on layer data. Each layer is raised by +FLOAT m +.TP +\fB\-\-osm\fR.layer\-elevation.max\-grade FLOAT +Maximum grade threshold in % at 50km/h +when reconstrucing elevation based on +layer data. The value is scaled +according to road speed. +.TP +\fB\-\-osm\fR.oneway\-spread\-right +Whether one\-way roads should be spread +to the side instead of centered +.TP +\fB\-\-osm\fR.stop\-output.length FLOAT +The default length of a public transport +stop in FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.bus FLOAT +The default length of a bus stop in +FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.tram FLOAT +The default length of a tram stop in +FLOAT m +.TP +\fB\-\-osm\fR.stop\-output.length.train FLOAT +The default length of a train stop in +FLOAT m +.TP +\fB\-\-osm\fR.all\-attributes +Whether additional attributes shall be +imported +.TP +\fB\-\-matsim\fR.keep\-length +The edge lengths given in the +MATSIM\-file will be kept +.TP +\fB\-\-matsim\fR.lanes\-from\-capacity +The lane number will be computed from +the capacity +.TP +\fB\-\-shapefile\fR.street\-id STR +Read edge ids from column STR +.TP +\fB\-\-shapefile\fR.from\-id STR +Read from\-node ids from column STR +.TP +\fB\-\-shapefile\fR.to\-id STR +Read to\-node ids from column STR +.TP +\fB\-\-shapefile\fR.type\-id STR +Read type ids from column STR +.TP +\fB\-\-shapefile\fR.laneNumber STR +Read lane number from column STR +.TP +\fB\-\-shapefile\fR.speed STR +Read speed from column STR +.TP +\fB\-\-shapefile\fR.name STR +Read (non\-unique) name from column STR +.TP +\fB\-\-shapefile\fR.node\-join\-dist FLOAT +Distance threshold for determining +whether distinct shapes are connected +(used when from\-id and to\-id are not +available) +.TP +\fB\-\-shapefile\fR.add\-params STR[] +Add the list of field names as edge +params +.TP +\fB\-\-shapefile\fR.use\-defaults\-on\-failure +Uses edge type defaults on problems +.TP +\fB\-\-shapefile\fR.all\-bidirectional +Insert edges in both directions +.TP +\fB\-\-shapefile\fR.guess\-projection +Guess the proper projection +.TP +\fB\-\-shapefile\fR.traditional\-axis\-mapping +Use traditional axis order (lon, lat) +.TP +\fB\-\-vissim\fR.join\-distance FLOAT +Structure join offset +.TP +\fB\-\-vissim\fR.default\-speed FLOAT +Use FLOAT as default speed +.TP +\fB\-\-vissim\fR.speed\-norm FLOAT +Factor for edge velocity +.TP +\fB\-\-vissim\fR.report\-unset\-speeds +Writes lanes without an explicit speed +set +.TP +\fB\-\-visum\fR.language\-file FILE +Load language mappings from FILE +.TP +\fB\-\-visum\fR.use\-type\-priority +Uses priorities from types +.TP +\fB\-\-visum\fR.use\-type\-laneno +Uses lane numbers from types +.TP +\fB\-\-visum\fR.use\-type\-speed +Uses speeds from types +.TP +\fB\-\-visum\fR.connector\-speeds FLOAT +Sets connector speed +.TP +\fB\-\-visum\fR.connectors\-lane\-number INT +Sets connector lane number +.TP +\fB\-\-visum\fR.no\-connectors +Excludes connectors +.TP +\fB\-\-visum\fR.recompute\-lane\-number +Computes the number of lanes from the +edges' capacities +.TP +\fB\-\-visum\fR.verbose\-warnings +Prints all warnings, some of which are +due to VISUM misbehaviour +.TP +\fB\-\-visum\fR.lanes\-from\-capacity.norm FLOAT +The factor for flow to no. lanes +conversion +.TP +\fB\-\-opendrive\fR.import\-all\-lanes +Imports all lane types +.TP +\fB\-\-opendrive\fR.ignore\-widths +Whether lane widths shall be ignored. +.TP +\fB\-\-opendrive\fR.curve\-resolution FLOAT +The geometry resolution in m when +importing curved geometries as line +segments. +.TP +\fB\-\-opendrive\fR.advance\-stopline FLOAT +Allow stop lines to be built beyond the +start of the junction if the geometries +allow so +.TP +\fB\-\-opendrive\fR.min\-width FLOAT +The minimum lane width for determining +start or end of variable\-width lanes +.TP +\fB\-\-opendrive\fR.internal\-shapes +Import internal lane shapes +.SS "Netedit Options:" +.TP +\fB\-a\fR, \fB\-\-additional\-files\fR FILE +Load additional and shapes descriptions +from FILE(s) +.TP +\fB\-\-additionals\-output\fR STR +file in which additionals must be saved +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Load demand elements descriptions from +FILE(s) +.TP +\fB\-\-demandelements\-output\fR STR +file in which demand elements must be +saved +.TP +\fB\-d\fR, \fB\-\-data\-files\fR FILE +Load data elements descriptions from +FILE(s) +.TP +\fB\-\-dataelements\-output\fR STR +file in which data elements must be +saved +.TP +\fB\-\-TLSPrograms\-output\fR STR +file in which TLS Programs must be saved +.SS "Visualisation Options:" +.TP +\fB\-\-disable\-laneIcons\fR +Disable icons of special lanes +.HP +\fB\-T\fR, \fB\-\-disable\-textures\fR +.TP +\fB\-g\fR, \fB\-\-gui\-settings\-file\fR FILE +Load visualisation settings from FILE +.TP +\fB\-\-registry\-viewport\fR +Load current viewport from registry +.TP +\fB\-\-window\-size\fR STR[] +Create initial window with the given x,y +size +.TP +\fB\-\-window\-pos\fR STR[] +Create initial window at the given x,y +position +.TP +\fB\-\-gui\-testing\fR +Enable overlay for screen recognition +.TP +\fB\-\-gui\-testing\-debug\fR +Enable output messages during +GUI\-Testing +.TP +\fB\-\-gui\-testing\-debug\-gl\fR +Enable output messages during +GUI\-Testing specific of gl functions +.TP +\fB\-\-gui\-testing\fR.setting\-output FILE +Save gui settings in the given +settings\-output file +.SS "Time Options:" +.TP +\fB\-\-begin\fR TIME +Defines the begin time in seconds; +The simulation starts at this time +.TP +\fB\-\-end\fR TIME +Defines the end time in seconds; +The simulation ends at this time +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue on broken input +.TP +\fB\-\-ignore\-errors\fR.connections +Continue on invalid connections +.TP +\fB\-\-show\-errors\fR.connections\-first\-try +Show errors in connections at parsing +.TP +\fB\-\-ignore\-errors\fR.edge\-type +Continue on unknown edge types +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +netedit \-\-new +.IP +start plain GUI with empty net +.IP +netedit \-s +.IP +edit SUMO network +.IP +netedit \-c +.IP +edit net with options read from file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO netedit Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/netgenerate.1 sumo-1.6.0+dfsg1/docs/man/netgenerate.1 --- sumo-1.5.0+dfsg1/docs/man/netgenerate.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/netgenerate.1 2020-04-27 22:06:19.000000000 +0000 @@ -0,0 +1,805 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO netgenerate Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Synthetic network generator for the microscopic, multi\-modal traffic simulation +.IP +SUMO. +.IP +Either "\-\-grid", "\-\-spider" or "\-\-rand" must be supplied. +.IP +In dependance to these switches other options are used. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Grid Network Options:" +.TP +\fB\-g\fR, \fB\-\-grid\fR +Forces NETGEN to build a grid\-like +network +.TP +\fB\-\-grid\fR.number INT +The number of junctions in both dirs +.TP +\fB\-\-grid\fR.length FLOAT +The length of streets in both dirs +.TP +\fB\-\-grid\fR.x\-number INT +The number of junctions in x\-dir; +Overrides \fB\-\-grid\-number\fR +.TP +\fB\-\-grid\fR.y\-number INT +The number of junctions in y\-dir; +Overrides \fB\-\-grid\-number\fR +.TP +\fB\-\-grid\fR.x\-length FLOAT +The length of horizontal streets; +Overrides \fB\-\-grid\-length\fR +.TP +\fB\-\-grid\fR.y\-length FLOAT +The length of vertical streets; +Overrides \fB\-\-grid\-length\fR +.TP +\fB\-\-grid\fR.attach\-length FLOAT +The length of streets attached at the +boundary; +0 means no streets are attached +.SS "Spider Network Options:" +.TP +\fB\-s\fR, \fB\-\-spider\fR +Forces NETGEN to build a spider\-net\-like +network +.TP +\fB\-\-spider\fR.arm\-number INT +The number of axes within the net +.TP +\fB\-\-spider\fR.circle\-number INT +The number of circles of the net +.TP +\fB\-\-spider\fR.space\-radius FLOAT +The distances between the circles +.TP +\fB\-\-spider\fR.omit\-center +Omit the central node of the network +.SS "Random Network Options:" +.TP +\fB\-r\fR, \fB\-\-rand\fR +Forces NETGEN to build a random network +.TP +\fB\-\-rand\fR.iterations INT +Describes how many times an edge shall +be added to the net +.TP +\fB\-\-rand\fR.bidi\-probability FLOAT +Defines the probability to build a +reverse edge +.TP +\fB\-\-rand\fR.max\-distance FLOAT +The maximum distance for each edge +.TP +\fB\-\-rand\fR.min\-distance FLOAT +The minimum distance for each edge +.TP +\fB\-\-rand\fR.min\-angle FLOAT +The minimum angle for each pair of +(bidirectional) roads in DEGREES +.TP +\fB\-\-rand\fR.num\-tries INT +The number of tries for creating each +node +.TP +\fB\-\-rand\fR.connectivity FLOAT +Probability for roads to continue at +each node +.TP +\fB\-\-rand\fR.neighbor\-dist1 FLOAT +Probability for a node having exactly 1 +neighbor +.TP +\fB\-\-rand\fR.neighbor\-dist2 FLOAT +Probability for a node having exactly 2 +neighbors +.TP +\fB\-\-rand\fR.neighbor\-dist3 FLOAT +Probability for a node having exactly 3 +neighbors +.TP +\fB\-\-rand\fR.neighbor\-dist4 FLOAT +Probability for a node having exactly 4 +neighbors +.TP +\fB\-\-rand\fR.neighbor\-dist5 FLOAT +Probability for a node having exactly 5 +neighbors +.TP +\fB\-\-rand\fR.neighbor\-dist6 FLOAT +Probability for a node having exactly 6 +neighbors +.TP +\fB\-\-rand\fR.random\-lanenumber +Draw lane numbers randomly from +[1,default.lanenumber] +.TP +\fB\-\-rand\fR.random\-priority +Draw edge priority randomly from +[1,default.priority] +.TP +\fB\-\-rand\fR.grid +Place nodes on a regular grid with +spacing rand.min\-distance +.SS "Input Options:" +.TP +\fB\-t\fR, \fB\-\-type\-files\fR FILE +Read edge\-type defs from FILE +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-\-alphanumerical\-ids\fR +The Ids of generated nodes use an +alphanumerical code for easier +readability when possible +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +The generated net will be written to +FILE +.TP +\fB\-\-plain\-output\-prefix\fR FILE +Prefix of files to write plain xml +nodes, edges and connections to +.TP +\fB\-\-junctions\fR.join\-output FILE +Writes information about joined +junctions to FILE (can be loaded as +additional node\-file to reproduce joins +.TP +\fB\-\-prefix\fR STR +Defines a prefix for edge and junction +names +.TP +\fB\-\-amitran\-output\fR FILE +The generated net will be written to +FILE using Amitran format +.TP +\fB\-\-matsim\-output\fR FILE +The generated net will be written to +FILE using MATsim format +.TP +\fB\-\-opendrive\-output\fR FILE +The generated net will be written to +FILE using OpenDRIVE format +.TP +\fB\-\-dlr\-navteq\-output\fR FILE +The generated net will be written to +dlr\-navteq files with the given PREFIX +.TP +\fB\-\-dlr\-navteq\fR.precision INT +The network coordinates are written with +the specified level of output precision +.TP +\fB\-\-output\fR.street\-names +Street names will be included in the +output (if available) +.TP +\fB\-\-output\fR.original\-names +Writes original names, if given, as +parameter +.TP +\fB\-\-street\-sign\-output\fR FILE +Writes street signs as POIs to FILE +.TP +\fB\-\-opendrive\-output\fR.straight\-threshold FLOAT +Builds parameterized curves +whenever the angular change between +straight segments exceeds FLOAT degrees +.SS "Processing Options:" +.TP +\fB\-\-turn\-lanes\fR INT +Generate INT left\-turn lanes +.TP +\fB\-\-turn\-lanes\fR.length FLOAT +Set the length of generated turning +lanes to FLOAT +.TP +\fB\-\-perturb\-x\fR STR +Apply random spatial pertubation in x +direction according the the given +distribution +.TP +\fB\-\-perturb\-y\fR STR +Apply random spatial pertubation in y +direction according the the given +distribution +.TP +\fB\-\-perturb\-z\fR STR +Apply random spatial pertubation in z +direction according the the given +distribution +.TP +\fB\-\-numerical\-ids\fR +Remaps alphanumerical IDs of nodes and +edges to ensure that all IDs are +integers +.TP +\fB\-\-numerical\-ids\fR.node\-start INT +Remaps IDs of nodes to integers starting +at INT +.TP +\fB\-\-numerical\-ids\fR.edge\-start INT +Remaps IDs of edges to integers starting +at INT +.TP +\fB\-\-reserved\-ids\fR FILE +Ensures that generated ids do not +included any of the typed IDs from FILE +(SUMO\-GUI selection file format) +.TP +\fB\-\-geometry\fR.max\-grade FLOAT +Warn about edge geometries with a grade +in % above FLOAT. +.TP +\fB\-\-geometry\fR.max\-grade.fix +Smooth edge edge geometries with a grade +in above the warning threshold. +.TP +\fB\-\-offset\fR.disable\-normalization +Turn off normalizing node positions +.TP +\fB\-\-offset\fR.x FLOAT +Adds FLOAT to net x\-positions +.TP +\fB\-\-offset\fR.y FLOAT +Adds FLOAT to net y\-positions +.TP +\fB\-\-offset\fR.z FLOAT +Adds FLOAT to net z\-positions +.TP +\fB\-\-flip\-y\-axis\fR +Flips the y\-coordinate along zero +.TP +\fB\-\-roundabouts\fR.guess +Enable roundabout\-guessing +.TP +\fB\-\-opposites\fR.guess +Enable guessing of opposite direction +lanes usable for overtaking +.TP +\fB\-\-opposites\fR.guess.fix\-lengths +Ensure that opposite edges have the same +length +.TP +\fB\-\-fringe\fR.guess +Enable guessing of network fringe nodes +.TP +\fB\-\-lefthand\fR +Assumes left\-hand traffic on the network +.TP +\fB\-\-edges\fR.join +Merges edges which connect the same +nodes and are close to each other +(recommended for VISSIM import) +.SS "Building Defaults Options:" +.TP +\fB\-L\fR, \fB\-\-default\fR.lanenumber INT +The default number of lanes in an edge +.TP +\fB\-\-default\fR.lanewidth FLOAT +The default width of lanes +.TP +\fB\-\-default\fR.spreadtype STR +The default method for computing lane +shapes from edge shapes +.TP +\fB\-S\fR, \fB\-\-default\fR.speed FLOAT +The default speed on an edge (in m/s) +.TP +\fB\-P\fR, \fB\-\-default\fR.priority INT +The default priority of an edge +.TP +\fB\-\-default\fR.type STR +The default edge type +.TP +\fB\-\-default\fR.sidewalk\-width FLOAT +The default width of added sidewalks +.TP +\fB\-\-default\fR.bikelane\-width FLOAT +The default width of added bike lanes +.TP +\fB\-\-default\fR.crossing\-width FLOAT +The default width of a pedestrian +crossing +.TP +\fB\-\-default\fR.disallow STR +The default for disallowed vehicle +classes +.TP +\fB\-\-default\fR.junctions.keep\-clear +Whether junctions should be kept clear +by default +.TP +\fB\-\-default\fR.junctions.radius FLOAT +The default turning radius of +intersections +.TP +\fB\-\-default\fR.connection\-length FLOAT +The default length when overriding +connection lengths +.TP +\fB\-\-default\fR.right\-of\-way STR +The default algorithm for computing +right of way rules ('default', +\&'edgePriority') +.TP +\fB\-j\fR, \fB\-\-default\-junction\-type\fR STR +[traffic_light|priority|right_before_left|traffic_light_right_on_red|priority_stop|allway_stop|...] Determines junction type (see wiki/Networks/PlainXML#Node_types) +.SS "TLS Building Options:" +.TP +\fB\-\-tls\fR.set STR[] +Interprets STR[] as list of junctions to +be controlled by TLS +.TP +\fB\-\-tls\fR.unset STR[] +Interprets STR[] as list of junctions to +be not controlled by TLS +.TP +\fB\-\-tls\fR.guess +Turns on TLS guessing +.TP +\fB\-\-tls\fR.guess.threshold FLOAT +Sets minimum value for the sum of all +incoming lane speeds when guessing TLS +.TP +\fB\-\-tls\fR.guess.joining +Includes node clusters into guess +.TP +\fB\-\-tls\fR.join +Tries to cluster tls\-controlled nodes +.TP +\fB\-\-tls\fR.join\-dist FLOAT +Determines the maximal distance for +joining traffic lights (defaults to 20) +.TP +\fB\-\-tls\fR.uncontrolled\-within +Do not control edges that lie fully +within a joined traffic light. This may +cause collisions but allows old traffic +light plans to be used +.TP +\fB\-\-tls\fR.ignore\-internal\-junction\-jam +Do not build mutually conflicting +response matrix, potentially ignoring +vehicles that are stuck at an internal +junction when their phase has ended +.TP +\fB\-\-tls\fR.cycle.time INT +Use INT as cycle duration +.TP +\fB\-\-tls\fR.green.time INT +Use INT as green phase duration +.TP +\fB\-D\fR, \fB\-\-tls\fR.yellow.min\-decel FLOAT +Defines smallest vehicle deceleration +.TP +\fB\-\-tls\fR.yellow.patch\-small +Given yellow times are patched even if +being too short +.TP +\fB\-\-tls\fR.yellow.time INT +Set INT as fixed time for yellow phase +durations +.TP +\fB\-\-tls\fR.red.time INT +Set INT as fixed time for red phase +duration at traffic lights that do not +have a conflicting flow +.TP +\fB\-\-tls\fR.allred.time INT +Set INT as fixed time for intermediate +red phase after every switch +.TP +\fB\-\-tls\fR.minor\-left.max\-speed FLOAT +Use FLOAT as threshold for allowing +left\-turning vehicles to move in the +same phase as oncoming straight\-going +vehicles +.TP +\fB\-\-tls\fR.left\-green.time INT +Use INT as green phase duration for left +turns (s). Setting this value to 0 +disables additional left\-turning phases +.TP +\fB\-\-tls\fR.crossing\-min.time INT +Use INT as minimum green duration for +pedestrian crossings (s). +.TP +\fB\-\-tls\fR.crossing\-clearance.time INT +Use INT as clearance time for pedestrian +crossings (s). +.TP +\fB\-\-tls\fR.scramble.time INT +Use INT as green phase duration for +pedestrian scramble phase (s). +.TP +\fB\-\-tls\fR.half\-offset STR[] +TLSs in STR[] will be shifted by +half\-phase +.TP +\fB\-\-tls\fR.quarter\-offset STR[] +TLSs in STR[] will be shifted by +quarter\-phase +.TP +\fB\-\-tls\fR.default\-type STR +TLSs with unspecified type will use STR +as their algorithm +.TP +\fB\-\-tls\fR.layout STR +Set phase layout four grouping opposite +directions or grouping all movements +for one incoming edge ['opposites', +\&'incoming'] +.TP +\fB\-\-tls\fR.min\-dur INT +Default minimum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.max\-dur INT +Default maximum phase duration for +traffic lights with variable phase +length +.TP +\fB\-\-tls\fR.group\-signals +Assign the same tls link index to +connections that share the same states +.TP +\fB\-\-tls\fR.ungroup\-signals +Assign a distinct tls link index to +every connection +.SS "Edge Removal Options:" +.TP +\fB\-\-keep\-edges\fR.min\-speed FLOAT +Only keep edges with speed in +meters/second > FLOAT +.TP +\fB\-\-remove\-edges\fR.explicit STR[] +Remove edges in STR[] +.TP +\fB\-\-keep\-edges\fR.explicit STR[] +Only keep edges in STR[] or those which +are kept due to other keep\-edges or +remove\-edges options +.TP +\fB\-\-keep\-edges\fR.input\-file FILE +Only keep edges in FILE (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) or those +which are kept due to other keep\-edges +or remove\-edges options +.TP +\fB\-\-remove\-edges\fR.input\-file FILE +Remove edges in FILE. (Each id on a +single line. Selection files from +SUMO\-GUI are also supported) +.TP +\fB\-\-keep\-edges\fR.in\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +CARTESIAN corner coordinates + or as polygon +) +.TP +\fB\-\-keep\-edges\fR.in\-geo\-boundary STR[] +Only keep edges which are located within +the given boundary (given either as +GEODETIC corner coordinates + or as +polygon ) +.SS "Unregulated Nodes Options:" +.TP +\fB\-\-keep\-nodes\-unregulated\fR +All nodes will be unregulated +.TP +\fB\-\-keep\-nodes\-unregulated\fR.explicit STR[] +Do not regulate nodes in STR[] +.TP +\fB\-\-keep\-nodes\-unregulated\fR.district\-nodes +Do not regulate district nodes +.SS "Junctions Options:" +.TP +\fB\-\-junctions\fR.right\-before\-left.speed\-threshold FLOAT +Allow building +right\-before\-left junctions when the +incoming edge speeds are below FLOAT +(m/s) +.TP +\fB\-\-no\-internal\-links\fR +Omits internal links +.TP +\fB\-\-no\-turnarounds\fR +Disables building turnarounds +.TP +\fB\-\-no\-turnarounds\fR.tls +Disables building turnarounds at +tls\-controlled junctions +.TP +\fB\-\-no\-turnarounds\fR.geometry +Disables building turnarounds at +geometry\-like junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-deadend +Disables building turnarounds except at +dead end junctions +.TP +\fB\-\-no\-turnarounds\fR.except\-turnlane +Disables building turnarounds except at +at junctions with a dedicated turning +lane +.TP +\fB\-\-no\-turnarounds\fR.fringe +Disables building turnarounds at fringe +junctions +.TP +\fB\-\-no\-left\-connections\fR +Disables building connections to left +.TP +\fB\-\-junctions\fR.join +Joins junctions that are close to each +other (recommended for OSM import) +.TP +\fB\-\-junctions\fR.join\-dist FLOAT +Determines the maximal distance for +joining junctions (defaults to 10) +.TP +\fB\-\-junctions\fR.corner\-detail INT +Generate INT intermediate points to +smooth out intersection corners +.TP +\fB\-\-junctions\fR.internal\-link\-detail INT +Generate INT intermediate points to +smooth out lanes within the +intersection +.TP +\fB\-\-junctions\fR.scurve\-stretch FLOAT +Generate longer intersections to allow +for smooth s\-curves when the number of +lanes changes +.TP +\fB\-\-junctions\fR.join\-turns +Builds common edges for turning +connections with common from\- and +to\-edge. This causes discrepancies +between geometrical length and assigned +length due to averaging but enables +lane\-changing while turning +.TP +\fB\-\-junctions\fR.limit\-turn\-speed FLOAT +Limits speed on junctions to an average +lateral acceleration of at most FLOAT +m/s^2) +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle FLOAT +Do not limit turn speed for +angular changes below FLOAT (degrees). +The value is subtracted from the +geometric angle before computing the +turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.min\-angle.railway FLOAT +Do not limit turn speed +for angular changes below FLOAT +(degrees) on railway edges. The value +is subtracted from the geometric angle +before computing the turning radius. +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.straight FLOAT +Warn about turn speed +limits that reduce the speed of +straight connections by more than FLOAT +.TP +\fB\-\-junctions\fR.limit\-turn\-speed.warn.turn FLOAT +Warn about turn speed limits +that reduce the speed of turning +connections (no u\-turns) by more than +FLOAT +.TP +\fB\-\-junctions\fR.small\-radius FLOAT +Default radius for junctions that do not +require wide vehicle turns +.TP +\fB\-\-rectangular\-lane\-cut\fR +Forces rectangular cuts between lanes +and intersections +.TP +\fB\-\-check\-lane\-foes\fR.roundabout +Allow driving onto a multi\-lane road if +there are foes on other lanes (at +roundabouts) +.TP +\fB\-\-check\-lane\-foes\fR.all +Allow driving onto a multi\-lane road if +there are foes on other lanes +(everywhere) +.SS "Pedestrian Options:" +.TP +\fB\-\-sidewalks\fR.guess +Guess pedestrian sidewalks based on edge +speed +.TP +\fB\-\-sidewalks\fR.guess.max\-speed FLOAT +Add sidewalks for edges with a speed +equal or below the given limit +.TP +\fB\-\-sidewalks\fR.guess.min\-speed FLOAT +Add sidewalks for edges with a speed +above the given limit +.TP +\fB\-\-sidewalks\fR.guess.from\-permissions +Add sidewalks for edges that allow +pedestrians on any of their lanes +regardless of speed +.TP +\fB\-\-sidewalks\fR.guess.exclude STR[] +Do not guess sidewalks for the given +list of edges +.TP +\fB\-\-crossings\fR.guess +Guess pedestrian crossings based on the +presence of sidewalks +.TP +\fB\-\-crossings\fR.guess.speed\-threshold FLOAT +At uncontrolled nodes, do not build +crossings across edges with a speed +above the threshold +.TP +\fB\-\-walkingareas\fR +Always build walking areas even if there +are no crossings +.SS "Bicycle Options:" +.TP +\fB\-\-bikelanes\fR.guess +Guess bike lanes based on edge speed +.TP +\fB\-\-bikelanes\fR.guess.max\-speed FLOAT +Add bike lanes for edges with a speed +equal or below the given limit +.TP +\fB\-\-bikelanes\fR.guess.min\-speed FLOAT +Add bike lanes for edges with a speed +above the given limit +.TP +\fB\-\-bikelanes\fR.guess.from\-permissions +Add bike lanes for edges that allow +bicycles on any of their lanes +regardless of speed +.TP +\fB\-\-bikelanes\fR.guess.exclude STR[] +Do not guess bikelanes for the given +list of edges +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.SH EXAMPLES +.IP +netgenerate \-c +.IP +create net from given configuration +.IP +netgenerate \-\-grid [grid\-network options] \-o +.IP +create grid net +.IP +netgenerate \-\-spider [spider\-network options] \-o +.IP +create spider net +.IP +netgenerate \-\-rand [random\-network options] \-o +.IP +create random net +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO netgenerate Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/od2trips.1 sumo-1.6.0+dfsg1/docs/man/od2trips.1 --- sumo-1.5.0+dfsg1/docs/man/od2trips.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/od2trips.1 2020-04-27 22:06:18.000000000 +0000 @@ -0,0 +1,217 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO od2trips Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Importer of O/D\-matrices for the microscopic, multi\-modal traffic simulation +.IP +SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-taz\-files\fR FILE +Loads TAZ (districts; +also from networks) from FILE(s) +.TP +\fB\-d\fR, \fB\-\-od\-matrix\-files\fR FILE +Loads O/D\-files from FILE(s) +.TP +\fB\-\-od\-amitran\-files\fR FILE +Loads O/D\-matrix in Amitran format from +FILE(s) +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output files. +The special string 'TIME' is replaced by +the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the comma +for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the comma +for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Writes trip definitions into FILE +.TP +\fB\-\-flow\-output\fR FILE +Writes flow definitions into FILE +.TP +\fB\-\-flow\-output\fR.probability +Writes probabilistic flow instead of evenly +spaced flow +.TP +\fB\-\-pedestrians\fR +Writes pedestrians instead of vehicles +.TP +\fB\-\-persontrips\fR +Writes persontrips instead of vehicles +.TP +\fB\-\-ignore\-vehicle\-type\fR +Does not save vtype information +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time; +Previous trips will be discarded +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time; +Later trips will be discarded; +Defaults to the maximum time that SUMO can +represent +.SS "Processing Options:" +.TP +\fB\-s\fR, \fB\-\-scale\fR FLOAT +Scales the loaded flows by FLOAT +.TP +\fB\-\-spread\fR.uniform +Spreads trips uniformly over each time +period +.TP +\fB\-\-different\-source\-sink\fR +Always choose source and sink edge which are +not identical +.TP +\fB\-\-vtype\fR STR +Defines the name of the vehicle type to use +.TP +\fB\-\-prefix\fR STR +Defines the prefix for vehicle names +.TP +\fB\-\-timeline\fR STR[] +Uses STR[] as a timeline definition +.TP +\fB\-\-timeline\fR.day\-in\-hours +Uses STR as a 24h\-timeline definition +.TP +\fB\-\-no\-step\-log\fR +Disable console output of current time step +.SS "Defaults Options:" +.TP +\fB\-\-departlane\fR STR +Assigns a default depart lane +.TP +\fB\-\-departpos\fR STR +Assigns a default depart position +.TP +\fB\-\-departspeed\fR STR +Assigns a default depart speed +.TP +\fB\-\-arrivallane\fR STR +Assigns a default arrival lane +.TP +\fB\-\-arrivalpos\fR STR +Assigns a default arrival position +.TP +\fB\-\-arrivalspeed\fR STR +Assigns a default arrival speed +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO network +inputs ("never", "auto" or "always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type whenever +more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-ignore\-errors\fR +Continue on broken input +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator with +the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator with +the given value +.SH EXAMPLES +.IP +od2trips \-c +.IP +run with configuration file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO od2trips Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/polyconvert.1 sumo-1.6.0+dfsg1/docs/man/polyconvert.1 --- sumo-1.5.0+dfsg1/docs/man/polyconvert.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/polyconvert.1 2020-04-27 22:06:19.000000000 +0000 @@ -0,0 +1,285 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO polyconvert Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- 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.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +Importer of polygons and POIs for the microscopic, multi\-modal traffic +.IP +simulation SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) into +FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Loads SUMO\-network FILE as reference to +offset and projection +.TP +\fB\-\-dlr\-navteq\-poly\-files\fR FILE +Reads polygons from FILE assuming they're +coded in DLR\-Navteq (Elmar)\-format +.TP +\fB\-\-dlr\-navteq\-poi\-files\fR FILE +Reads pois from FILE+ assuming they're +coded in DLR\-Navteq (Elmar)\-format +.TP +\fB\-\-visum\-files\fR FILE +Reads polygons from FILE assuming it's a +Visum\-net +.TP +\fB\-\-xml\-files\fR FILE +Reads pois and shapes from FILE assuming +they're coded in XML +.TP +\fB\-\-osm\-files\fR FILE +Reads pois from FILE+ assuming they're +coded in OSM +.TP +\fB\-\-osm\fR.keep\-full\-type +The type will be made of the key\-value \- +pair +.TP +\fB\-\-osm\fR.use\-name +The id will be set from the given 'name' +attribute +.TP +\fB\-\-osm\fR.merge\-relations FLOAT +If FLOAT >= 0, assemble one polygon from +all ways of a relation if they all connect +with gaps below FLOAT +.TP +\fB\-\-shapefile\-prefixes\fR FILE +Reads shapes from shapefiles FILE+ +.TP +\fB\-\-shapefile\fR.guess\-projection +Guesses the shapefile's projection +.TP +\fB\-\-shapefile\fR.traditional\-axis\-mapping +Use traditional axis order (lon, lat) +.TP +\fB\-\-shapefile\fR.id\-column STR +Defines in which column the id can be found +.TP +\fB\-\-shapefile\fR.type\-columns STR[] +Defines which columns form the type id +(comma separated list) +.TP +\fB\-\-shapefile\fR.use\-running\-id +A running number will be used as id +.TP +\fB\-\-shapefile\fR.add\-param +Extract all additional columns as params +.TP +\fB\-\-shapefile\fR.fill STR +[auto|true|false]. Forces the 'fill' status +to the given value. Default 'auto' tries +to determine it from the data type +.TP +\fB\-\-type\-file\fR FILE +Reads types from FILE +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second or +day:hour:minute:second rathern than +seconds +.TP +\fB\-o\fR, \fB\-\-output\-file\fR FILE +Write generated polygons/pois to FILE +.TP +\fB\-\-dlr\-tdp\-output\fR FILE +Write generated polygons/pois to a dlr\-tdp +file with the given prefix +.SS "Projection Options:" +.TP +\fB\-\-simple\-projection\fR +Uses a simple method for projection +.TP +\fB\-\-proj\fR.scale FLOAT +Scaling factor for input coordinates +.TP +\fB\-\-proj\fR.rotate FLOAT +Rotation (clockwise degrees) for input +coordinates +.TP +\fB\-\-proj\fR.utm +Determine the UTM zone (for a universal +transversal mercator projection based on +the WGS84 ellipsoid) +.TP +\fB\-\-proj\fR.dhdn +Determine the DHDN zone (for a transversal +mercator projection based on the bessel +ellipsoid, "Gauss\-Krueger") +.TP +\fB\-\-proj\fR STR +Uses STR as proj.4 definition for +projection +.TP +\fB\-\-proj\fR.inverse +Inverses projection +.TP +\fB\-\-proj\fR.dhdnutm +Convert from Gauss\-Krueger to UTM +.TP +\fB\-\-proj\fR.plain\-geo +Write geo coordinates in output +.SS "Pruning Options:" +.TP +\fB\-\-prune\fR.in\-net +Enables pruning on net boundaries +.TP +\fB\-\-prune\fR.in\-net.offsets STR +Uses STR as offset definition added to the +net boundaries +.TP +\fB\-\-prune\fR.boundary STR +Uses STR as pruning boundary +.TP +\fB\-\-prune\fR.keep\-list STR +Items in STR will be kept though out of +boundary +.TP +\fB\-\-prune\fR.explicit STR[] +Items with names in STR[] will be removed +.SS "Processing Options:" +.TP +\fB\-\-offset\fR.x FLOAT +Adds FLOAT to net x\-positions +.TP +\fB\-\-offset\fR.y FLOAT +Adds FLOAT to net y\-positions +.TP +\fB\-\-offset\fR.z FLOAT +Adds FLOAT to net z\-positions +.TP +\fB\-\-all\-attributes\fR +Imports all attributes as key/value pairs +.TP +\fB\-\-ignore\-errors\fR +Continue on broken input +.TP +\fB\-\-poi\-layer\-offset\fR FLOAT +Adds FLOAT to the layer value for each poi +(i.e. to raise it above polygons) +.SS "Building Defaults Options:" +.TP +\fB\-\-color\fR STR +Sets STR as default color +.TP +\fB\-\-prefix\fR STR +Sets STR as default prefix +.TP +\fB\-\-type\fR STR +Sets STR as default type +.TP +\fB\-\-fill\fR +Fills polygons by default +.TP +\fB\-\-layer\fR FLOAT +Sets FLOAT as default layer +.TP +\fB\-\-discard\fR +Sets default action to discard +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML inputs +("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.SH EXAMPLES +.IP +polyconvert \-c +.IP +run with configuration options set in file +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO polyconvert Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/sumo.1 sumo-1.6.0+dfsg1/docs/man/sumo.1 --- sumo-1.5.0+dfsg1/docs/man/sumo.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/sumo.1 2020-04-27 22:06:17.000000000 +0000 @@ -0,0 +1,1255 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- A microscopic, multi-modal traffic simulation +.SH SYNOPSIS +.B sumo +[\fI\,OPTION\/\fR]\fI\,*\/\fR +.SH DESCRIPTION +Eclipse SUMO Version 1.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +A microscopic, multi\-modal traffic simulation. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Load road network description from FILE +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Load routes descriptions from FILE(s) +.TP +\fB\-a\fR, \fB\-\-additional\-files\fR FILE +Load further descriptions from FILE(s) +.TP +\fB\-w\fR, \fB\-\-weight\-files\fR FILE +Load edge/lane weights for online +rerouting from FILE +.TP +\fB\-x\fR, \fB\-\-weight\-attribute\fR STR +Name of the xml attribute which gives +the edge weight +.TP +\fB\-\-load\-state\fR FILE +Loads a network state from FILE +.TP +\fB\-\-load\-state\fR.offset TIME +Shifts all times loaded from a saved +state by the given offset +.TP +\fB\-\-load\-state\fR.remove\-vehicles STR[] +Removes vehicles with the given IDs from +the loaded state +.TP +\fB\-\-junction\-taz\fR +Initialize a TAZ for every junction to +use attributes toJunction and +fromJunction +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-\-netstate\-dump\fR FILE +Save complete network states into FILE +.TP +\fB\-\-netstate\-dump\fR.empty\-edges +Write also empty edges completely when +dumping +.TP +\fB\-\-netstate\-dump\fR.precision INT +Write positions and speeds with the +given precision (default 2) +.TP +\fB\-\-emission\-output\fR FILE +Save the emission values of each vehicle +.TP +\fB\-\-emission\-output\fR.precision INT +Write emission values with the given +precision (default 2) +.TP +\fB\-\-battery\-output\fR FILE +Save the battery values of each vehicle +.TP +\fB\-\-battery\-output\fR.precision INT +Write battery values with the given +precision (default 2) +.TP +\fB\-\-elechybrid\-output\fR FILE +Save the elecHybrid values of each +vehicle +.TP +\fB\-\-elechybrid\-output\fR.precision INT +Write elecHybrid values with the given +precision (default 2) +.TP +\fB\-\-elechybrid\-output\fR.aggregated +Write elecHybrid values into one +aggregated file +.TP +\fB\-\-chargingstations\-output\fR FILE +Write data of charging stations +.TP +\fB\-\-overheadwiresegments\-output\fR FILE +Write data of overhead wire segments +.TP +\fB\-\-substations\-output\fR FILE +Write data of electrical substation +stations +.TP +\fB\-\-fcd\-output\fR FILE +Save the Floating Car Data +.TP +\fB\-\-fcd\-output\fR.geo +Save the Floating Car Data using +geo\-coordinates (lon/lat) +.TP +\fB\-\-fcd\-output\fR.signals +Add the vehicle signal state to the FCD +output (brake lights etc.) +.TP +\fB\-\-fcd\-output\fR.distance +Add kilometrage to the FCD output +(linear referencing) +.TP +\fB\-\-fcd\-output\fR.acceleration +Add acceleration to the FCD output +.TP +\fB\-\-fcd\-output\fR.params STR[] +Add generic parameter values to the FCD +output +.TP +\fB\-\-fcd\-output\fR.filter\-edges.input\-file FILE +Restrict fcd output to the edge +selection from the given input file +.TP +\fB\-\-full\-output\fR FILE +Save a lot of information for each +timestep (very redundant) +.TP +\fB\-\-queue\-output\fR FILE +Save the vehicle queues at the junctions +(experimental) +.TP +\fB\-\-vtk\-output\fR FILE +Save complete vehicle positions +inclusive speed values in the VTK +Format (usage: \fI\,/path/out\/\fP will produce +/path/out_$TIMESTEP$.vtp files) +.TP +\fB\-\-amitran\-output\fR FILE +Save the vehicle trajectories in the +Amitran format +.TP +\fB\-\-summary\-output\fR FILE +Save aggregated vehicle departure info +into FILE +.TP +\fB\-\-tripinfo\-output\fR FILE +Save single vehicle trip info into FILE +.TP +\fB\-\-tripinfo\-output\fR.write\-unfinished +Write tripinfo output for vehicles which +have not arrived at simulation end +.TP +\fB\-\-vehroute\-output\fR FILE +Save single vehicle route info into FILE +.TP +\fB\-\-vehroute\-output\fR.exit\-times +Write the exit times for all edges +.TP +\fB\-\-vehroute\-output\fR.last\-route +Write the last route only +.TP +\fB\-\-vehroute\-output\fR.sorted +Sorts the output by departure time +.TP +\fB\-\-vehroute\-output\fR.dua +Write the output in the duarouter +alternatives style +.TP +\fB\-\-vehroute\-output\fR.cost +Write costs for all routes +.TP +\fB\-\-vehroute\-output\fR.intended\-depart +Write the output with the intended +instead of the real departure time +.TP +\fB\-\-vehroute\-output\fR.route\-length +Include total route length in the output +.TP +\fB\-\-vehroute\-output\fR.write\-unfinished +Write vehroute output for vehicles which +have not arrived at simulation end +.TP +\fB\-\-vehroute\-output\fR.skip\-ptlines +Skip vehroute output for public +transport vehicles +.TP +\fB\-\-vehroute\-output\fR.incomplete +Include invalid routes and route stubs +in vehroute output +.TP +\fB\-\-vehroute\-output\fR.stop\-edges +Include information about edges between +stops +.TP +\fB\-\-link\-output\fR FILE +Save links states into FILE +.TP +\fB\-\-railsignal\-block\-output\fR FILE +Save railsignal\-blocks into FILE +.TP +\fB\-\-bt\-output\fR FILE +Save bluetooth visibilities into FILE +(in conjunction with device.btreceiver +and device.btsender) +.TP +\fB\-\-lanechange\-output\fR FILE +Record lane changes and their +motivations for all vehicles into FILE +.TP +\fB\-\-lanechange\-output\fR.started +Record start of lane change manoeuvres +.TP +\fB\-\-lanechange\-output\fR.ended +Record end of lane change manoeuvres +.TP +\fB\-\-lanechange\-output\fR.xy +Record coordinates of lane change +manoeuvres +.TP +\fB\-\-stop\-output\fR FILE +Record stops and loading/unloading of +passenger and containers for all +vehicles into FILE +.TP +\fB\-\-statistic\-output\fR FILE +Write overall statistics into FILE +.TP +\fB\-\-save\-state\fR.times STR[] +Use TIME[] as times at which a network +state written +.TP +\fB\-\-save\-state\fR.period TIME +save state repeatedly after TIME period +.TP +\fB\-\-save\-state\fR.prefix FILE +Prefix for network states +.TP +\fB\-\-save\-state\fR.suffix STR +Suffix for network states (.xml.gz or +\&.xml) +.TP +\fB\-\-save\-state\fR.files FILE +Files for network states +.TP +\fB\-\-save\-state\fR.rng +Save random number generator states +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time in seconds; +The simulation starts at this time +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time in seconds; +The simulation ends at this time +.TP +\fB\-\-step\-length\fR TIME +Defines the step duration in seconds +.SS "Processing Options:" +.TP +\fB\-\-step\-method\fR.ballistic +Whether to use ballistic method for the +positional update of vehicles (default +is a semi\-implicit Euler method). +.TP +\fB\-\-extrapolate\-departpos\fR +Whether vehicles that depart between +simulation steps should extrapolate the +depart position +.TP +\fB\-\-threads\fR INT +Defines the number of threads for +parallel simulation +.TP +\fB\-\-lateral\-resolution\fR FLOAT +Defines the resolution in m when +handling lateral positioning within a +lane (with \fB\-1\fR all vehicles drive at the +center of their lane +.TP +\fB\-s\fR, \fB\-\-route\-steps\fR TIME +Load routes for the next number of +seconds ahead +.TP +\fB\-\-no\-internal\-links\fR +Disable (junction) internal links +.TP +\fB\-\-ignore\-junction\-blocker\fR TIME +Ignore vehicles which block the junction +after they have been standing for +SECONDS (\fB\-1\fR means never ignore) +.TP +\fB\-\-ignore\-route\-errors\fR +(1) Do not check whether routes are +connected. (2) Allow inserting a +vehicle in a situation which requires +emergency braking. +.TP +\fB\-\-ignore\-accidents\fR +Do not check whether accidents occur +.TP +\fB\-\-collision\fR.action STR +How to deal with collisions: +[none,warn,teleport,remove] +.TP +\fB\-\-collision\fR.stoptime TIME +Let vehicle stop for TIME before +performing collision.action (except for +action 'none') +.TP +\fB\-\-collision\fR.check\-junctions +Enables collisions checks on junctions +.TP +\fB\-\-collision\fR.mingap\-factor FLOAT +Sets the fraction of minGap that must be +maintained to avoid collision +detection. If a negative value is +given, the carFollowModel parameter is +used +.TP +\fB\-\-max\-num\-vehicles\fR INT +Delay vehicle insertion to stay within +the given maximum number +.TP +\fB\-\-max\-num\-teleports\fR INT +Abort the simulation if the given +maximum number of teleports is exceeded +.TP +\fB\-\-scale\fR FLOAT +Scale demand by the given factor (by +discarding or duplicating vehicles) +.TP +\fB\-\-time\-to\-teleport\fR TIME +Specify how long a vehicle may wait +until being teleported, defaults to +300, non\-positive values disable +teleporting +.TP +\fB\-\-time\-to\-teleport\fR.highways TIME +The waiting time after which vehicles on +a fast road (speed > 69m/s) are +teleported if they are on a +non\-continuing lane +.TP +\fB\-\-waiting\-time\-memory\fR TIME +Length of time interval, over which +accumulated waiting time is taken into +account (default is 100s.) +.TP +\fB\-\-max\-depart\-delay\fR TIME +How long vehicles wait for departure +before being skipped, defaults to \fB\-1\fR +which means vehicles are never skipped +.TP +\fB\-\-sloppy\-insert\fR +Whether insertion on an edge shall not +be repeated in same step once failed +.TP +\fB\-\-eager\-insert\fR +Whether each vehicle is checked +separately for insertion on an edge +.TP +\fB\-\-random\-depart\-offset\fR TIME +Each vehicle receives a random offset to +its depart value drawn uniformly from +[0, TIME] +.TP +\fB\-\-lanechange\fR.duration TIME +Duration of a lane change maneuver +(default 0) +.TP +\fB\-\-lanechange\fR.overtake\-right +Whether overtaking on the right on +motorways is permitted +.TP +\fB\-\-tls\fR.all\-off +Switches off all traffic lights. +.TP +\fB\-\-tls\fR.actuated.show\-detectors +Sets default visibility for actuation +detectors +.TP +\fB\-\-tls\fR.delay_based.detector\-range FLOAT +Sets default range for detecting +delayed vehicles +.TP +\fB\-\-time\-to\-impatience\fR TIME +Specify how long a vehicle may wait +until impatience grows from 0 to 1, +defaults to 300, non\-positive values +disable impatience growth +.TP +\fB\-\-default\fR.action\-step\-length FLOAT +Length of the default interval length +between action points for the +car\-following and lane\-change models +(in seconds). If not specified, the +simulation step\-length is used per +default. Vehicle\- or VType\-specific +settings override the default. Must be +a multiple of the simulation +step\-length. +.TP +\fB\-\-default\fR.carfollowmodel STR +Select default car following model +(Krauss, IDM, ...) +.TP +\fB\-\-default\fR.speeddev FLOAT +Select default speed deviation. A +negative value implies vClass specific +defaults (0.1 for the default passenger +class +.TP +\fB\-\-default\fR.emergencydecel STR +Select default emergencyDecel value +among ('decel', 'default', FLOAT) which +sets the value either to the same as +the deceleration value, a vClass\-class +specific default or the given FLOAT in +m/s^2 +.TP +\fB\-\-overhead\-wire\-solver\fR +Use Kirchhoff's laws for solving +overhead wire circuit +.TP +\fB\-\-emergencydecel\fR.warning\-threshold FLOAT +Sets the fraction of emergency +decel capability that must be used to +trigger a warning. +.TP +\fB\-\-parking\fR.maneuver +Whether parking simulation includes +manoeuvering time and associated lane +blocking +.TP +\fB\-\-pedestrian\fR.model STR +Select among pedestrian models +['nonInteracting', 'striping', +\&'remote'] +.TP +\fB\-\-pedestrian\fR.striping.stripe\-width FLOAT +Width of parallel stripes for +segmenting a sidewalk (meters) for use +with model 'striping' +.TP +\fB\-\-pedestrian\fR.striping.dawdling FLOAT +Factor for random slow\-downs [0,1] for +use with model 'striping' +.TP +\fB\-\-pedestrian\fR.striping.jamtime TIME +Time in seconds after which pedestrians +start squeezing through a jam when +using model 'striping' (non\-positive +values disable squeezing) +.TP +\fB\-\-pedestrian\fR.striping.jamtime.crossing TIME +Time in seconds after which +pedestrians start squeezing through a +jam while on a pedestrian crossing when +using model 'striping' (non\-positive +values disable squeezing) +.TP +\fB\-\-pedestrian\fR.striping.reserve\-oncoming FLOAT +Fraction of stripes to reserve +for oncoming pedestrians +.TP +\fB\-\-pedestrian\fR.striping.reserve\-oncoming.junctions FLOAT +Fraction of stripes +to reserve for oncoming pedestrians on +crossings and walkingareas +.TP +\fB\-\-pedestrian\fR.remote.address STR +The address (host:port) of the external +simulation +.TP +\fB\-\-ride\fR.stop\-tolerance FLOAT +Tolerance to apply when matching +pedestrian and vehicle positions on +boarding at individual stops +.SS "Routing Options:" +.TP +\fB\-\-routing\-algorithm\fR STR +Select among routing algorithms +['dijkstra', 'astar', 'CH', +\&'CHWrapper'] +.TP +\fB\-\-weights\fR.random\-factor FLOAT +Edge weights for routing are dynamically +disturbed by a random factor drawn +uniformly from [1,FLOAT) +.TP +\fB\-\-weights\fR.minor\-penalty FLOAT +Apply the given time penalty when +computing minimum routing costs for +minor\-link internal lanes +.TP +\fB\-\-weights\fR.priority\-factor FLOAT +Consider edge priorities in addition to +travel times, weighted by factor +.TP +\fB\-\-astar\fR.all\-distances FILE +Initialize lookup table for astar from +the given file (generated by marouter +\fB\-\-all\-pairs\-output\fR) +.TP +\fB\-\-astar\fR.landmark\-distances FILE +Initialize lookup table for astar +ALT\-variant from the given file +.TP +\fB\-\-persontrip\fR.walkfactor FLOAT +Use FLOAT as a factor on pedestrian +maximum speed during intermodal routing +.TP +\fB\-\-persontrip\fR.transfer.car\-walk STR[] +Where are mode changes from car to +walking allowed (possible values: +\&'parkingAreas', 'ptStops', +\&'allJunctions', 'taxi' and +combinations) +.TP +\fB\-\-device\fR.rerouting.probability FLOAT +The probability for a vehicle to have a +\&'rerouting' device +.TP +\fB\-\-device\fR.rerouting.explicit STR[] +Assign a 'rerouting' device to named +vehicles +.TP +\fB\-\-device\fR.rerouting.deterministic +The 'rerouting' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.rerouting.period TIME +The period with which the vehicle shall +be rerouted +.TP +\fB\-\-device\fR.rerouting.pre\-period TIME +The rerouting period before depart +.TP +\fB\-\-device\fR.rerouting.adaptation\-weight FLOAT +The weight of prior edge weights +for exponential moving average +.TP +\fB\-\-device\fR.rerouting.adaptation\-steps INT +The number of steps for moving +average weight of prior edge weights +.TP +\fB\-\-device\fR.rerouting.adaptation\-interval TIME +The interval for updating the +edge weights +.TP +\fB\-\-device\fR.rerouting.with\-taz +Use zones (districts) as routing startand endpoints +.TP +\fB\-\-device\fR.rerouting.init\-with\-loaded\-weights +Use weight files given with +option \fB\-\-weight\-files\fR for initializing +edge weights +.TP +\fB\-\-device\fR.rerouting.threads INT +The number of parallel execution threads +used for rerouting +.TP +\fB\-\-device\fR.rerouting.synchronize +Let rerouting happen at the same time +for all vehicles +.TP +\fB\-\-device\fR.rerouting.railsignal +Allow rerouting triggered by rail +signals. +.TP +\fB\-\-device\fR.rerouting.bike\-speeds +Compute separate average speeds for +bicycles +.TP +\fB\-\-device\fR.rerouting.output FILE +Save adapting weights to FILE +.TP +\fB\-\-person\-device\fR.rerouting.probability FLOAT +The probability for a person to +have a 'rerouting' device +.TP +\fB\-\-person\-device\fR.rerouting.explicit STR[] +Assign a 'rerouting' device to +named persons +.TP +\fB\-\-person\-device\fR.rerouting.deterministic +The 'rerouting' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-person\-device\fR.rerouting.period TIME +The period with which the person shall +be rerouted +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-duration\-log\fR.disable +Disable performance reports for +individual simulation steps +.TP +\fB\-t\fR, \fB\-\-duration\-log\fR.statistics +Enable statistics on vehicle trips +.TP +\fB\-\-no\-step\-log\fR +Disable console output of current +simulation step +.TP +\fB\-\-step\-log\fR.period INT +Number of simulation steps between +step\-log outputs +.SS "Emissions Options:" +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.TP +\fB\-\-device\fR.emissions.probability FLOAT +The probability for a vehicle to have a +\&'emissions' device +.TP +\fB\-\-device\fR.emissions.explicit STR[] +Assign a 'emissions' device to named +vehicles +.TP +\fB\-\-device\fR.emissions.deterministic +The 'emissions' devices are set +deterministic using a fraction of 1000 +.SS "Communication Options:" +.TP +\fB\-\-device\fR.btreceiver.probability FLOAT +The probability for a vehicle to have +a 'btreceiver' device +.TP +\fB\-\-device\fR.btreceiver.explicit STR[] +Assign a 'btreceiver' device to named +vehicles +.TP +\fB\-\-device\fR.btreceiver.deterministic +The 'btreceiver' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.btreceiver.range FLOAT +The range of the bt receiver +.TP +\fB\-\-device\fR.btreceiver.all\-recognitions +Whether all recognition point shall be +written +.TP +\fB\-\-device\fR.btreceiver.offtime FLOAT +The offtime used for calculating +detection probability (in seconds) +.TP +\fB\-\-device\fR.btsender.probability FLOAT +The probability for a vehicle to have a +\&'btsender' device +.TP +\fB\-\-device\fR.btsender.explicit STR[] +Assign a 'btsender' device to named +vehicles +.TP +\fB\-\-device\fR.btsender.deterministic +The 'btsender' devices are set +deterministic using a fraction of 1000 +.SS "Battery Options:" +.TP +\fB\-\-device\fR.battery.probability FLOAT +The probability for a vehicle to have a +\&'battery' device +.TP +\fB\-\-device\fR.battery.explicit STR[] +Assign a 'battery' device to named +vehicles +.TP +\fB\-\-device\fR.battery.deterministic +The 'battery' devices are set +deterministic using a fraction of 1000 +.SS "Example Device Options:" +.TP +\fB\-\-device\fR.example.probability FLOAT +The probability for a vehicle to have a +\&'example' device +.TP +\fB\-\-device\fR.example.explicit STR[] +Assign a 'example' device to named +vehicles +.TP +\fB\-\-device\fR.example.deterministic +The 'example' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.example.parameter FLOAT +An exemplary parameter which can be used +by all instances of the example device +.SS "SSM Device Options:" +.TP +\fB\-\-device\fR.ssm.probability FLOAT +The probability for a vehicle to have a +\&'ssm' device +.TP +\fB\-\-device\fR.ssm.explicit STR[] +Assign a 'ssm' device to named vehicles +.TP +\fB\-\-device\fR.ssm.deterministic +The 'ssm' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.ssm.measures STR +Specifies which measures will be logged +(as a space separated sequence of IDs +in ('TTC', 'DRAC', 'PET')). +.TP +\fB\-\-device\fR.ssm.thresholds STR +Specifies thresholds corresponding to +the specified measures (see +documentation and watch the order!). +Only events exceeding the thresholds +will be logged. +.TP +\fB\-\-device\fR.ssm.trajectories +Specifies whether trajectories will be +logged (if false, only the extremal +values and times are reported, this is +the default). +.TP +\fB\-\-device\fR.ssm.range FLOAT +Specifies the detection range in meters +(default is 50.00m.). For vehicles +below this distance from the equipped +vehicle, SSM values are traced. +.TP +\fB\-\-device\fR.ssm.extratime FLOAT +Specifies the time in seconds to be +logged after a conflict is over +(default is 5.00secs.). Required >0 if +PET is to be calculated for crossing +conflicts. +.TP +\fB\-\-device\fR.ssm.file STR +Give a global default filename for the +SSM output. +.TP +\fB\-\-device\fR.ssm.geo +Whether to use coordinates of the +original reference system in output +(default is false). +.SS "ToC Device Options:" +.TP +\fB\-\-device\fR.toc.probability FLOAT +The probability for a vehicle to have a +\&'toc' device +.TP +\fB\-\-device\fR.toc.explicit STR[] +Assign a 'toc' device to named vehicles +.TP +\fB\-\-device\fR.toc.deterministic +The 'toc' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.toc.manualType STR +Vehicle type for manual driving regime. +.TP +\fB\-\-device\fR.toc.automatedType STR +Vehicle type for automated driving +regime. +.TP +\fB\-\-device\fR.toc.responseTime FLOAT +Average response time needed by a driver +to take back control. +.TP +\fB\-\-device\fR.toc.recoveryRate FLOAT +Recovery rate for the driver's awareness +after a ToC. +.TP +\fB\-\-device\fR.toc.lcAbstinence FLOAT +Attention level below which a driver +restrains from performing lane changes +(value in [0,1]). +.TP +\fB\-\-device\fR.toc.initialAwareness FLOAT +Average awareness a driver has initially +after a ToC (value in [0,1]). +.TP +\fB\-\-device\fR.toc.mrmDecel FLOAT +Deceleration rate applied during a +\&'minimum risk maneuver'. +.TP +\fB\-\-device\fR.toc.dynamicToCThreshold FLOAT +Time, which the vehicle requires to +have ahead to continue in automated +mode. The default value of 0 indicates +no dynamic triggering of ToCs. +.TP +\fB\-\-device\fR.toc.dynamicMRMProbability FLOAT +Probability that a dynamically +triggered TOR is not answered in time. +.TP +\fB\-\-device\fR.toc.mrmKeepRight +If true, the vehicle tries to change to +the right during an MRM. +.TP +\fB\-\-device\fR.toc.mrmSafeSpot STR +If set, the vehicle tries to reach the +given named stopping place during an +MRM. +.TP +\fB\-\-device\fR.toc.mrmSafeSpotDuration FLOAT +Duration the vehicle stays at the +safe spot after an MRM. +.TP +\fB\-\-device\fR.toc.maxPreparationAccel FLOAT +Maximal acceleration that may be +applied during the ToC preparation +phase. +.TP +\fB\-\-device\fR.toc.ogNewTimeHeadway FLOAT +Timegap for ToC preparation phase. +.TP +\fB\-\-device\fR.toc.ogNewSpaceHeadway FLOAT +Additional spacing for ToC preparation +phase. +.TP +\fB\-\-device\fR.toc.ogMaxDecel FLOAT +Maximal deceleration applied for +establishing increased gap in ToC +preparation phase. +.TP +\fB\-\-device\fR.toc.ogChangeRate FLOAT +Rate of adaptation towards the increased +headway during ToC preparation. +.TP +\fB\-\-device\fR.toc.useColorScheme +Whether a coloring scheme shall by +applied to indicate the different ToC +stages. +.TP +\fB\-\-device\fR.toc.file STR +Switches on output by specifying an +output filename. +.SS "Driver State Device Options:" +.TP +\fB\-\-device\fR.driverstate.probability FLOAT +The probability for a vehicle to have +a 'driverstate' device +.TP +\fB\-\-device\fR.driverstate.explicit STR[] +Assign a 'driverstate' device to named +vehicles +.TP +\fB\-\-device\fR.driverstate.deterministic +The 'driverstate' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.driverstate.initialAwareness FLOAT +Initial value assigned to the +driver's awareness. +.TP +\fB\-\-device\fR.driverstate.errorTimeScaleCoefficient FLOAT +Time scale for the +error process. +.TP +\fB\-\-device\fR.driverstate.errorNoiseIntensityCoefficient FLOAT +Noise intensity +driving the error process. +.TP +\fB\-\-device\fR.driverstate.speedDifferenceErrorCoefficient FLOAT +General scaling +coefficient for applying the error to +the perceived speed difference (error +also scales with distance). +.TP +\fB\-\-device\fR.driverstate.headwayErrorCoefficient FLOAT +General scaling +coefficient for applying the error to +the perceived distance (error also +scales with distance). +.TP +\fB\-\-device\fR.driverstate.speedDifferenceChangePerceptionThreshold FLOAT +Base +threshold for recognizing changes in +the speed difference (threshold also +scales with distance). +.TP +\fB\-\-device\fR.driverstate.headwayChangePerceptionThreshold FLOAT +Base threshold +for recognizing changes in the headway +(threshold also scales with distance). +.TP +\fB\-\-device\fR.driverstate.minAwareness FLOAT +Minimal admissible value for the +driver's awareness. +.TP +\fB\-\-device\fR.driverstate.maximalReactionTime FLOAT +Maximal reaction time +(~action step length) induced by +decreased awareness level (reached for +awareness=minAwareness). +.SS "Bluelight Device Options:" +.TP +\fB\-\-device\fR.bluelight.probability FLOAT +The probability for a vehicle to have a +\&'bluelight' device +.TP +\fB\-\-device\fR.bluelight.explicit STR[] +Assign a 'bluelight' device to named +vehicles +.TP +\fB\-\-device\fR.bluelight.deterministic +The 'bluelight' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.bluelight.parameter FLOAT +An exemplary parameter which can be used +by all instances of the example device +.SS "FCD Device Options:" +.TP +\fB\-\-device\fR.fcd.probability FLOAT +The probability for a vehicle to have a +\&'fcd' device +.TP +\fB\-\-device\fR.fcd.explicit STR[] +Assign a 'fcd' device to named vehicles +.TP +\fB\-\-device\fR.fcd.deterministic +The 'fcd' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.fcd.period STR +Recording period for FCD\-data +.TP +\fB\-\-device\fR.fcd.radius FLOAT +Record objects in a radius around +equipped vehicles +.TP +\fB\-\-person\-device\fR.fcd.probability FLOAT +The probability for a person to have a +\&'fcd' device +.TP +\fB\-\-person\-device\fR.fcd.explicit STR[] +Assign a 'fcd' device to named persons +.TP +\fB\-\-person\-device\fR.fcd.deterministic +The 'fcd' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-person\-device\fR.fcd.period STR +Recording period for FCD\-data +.SS "ElecHybrid Device Options:" +.TP +\fB\-\-device\fR.elechybrid.probability FLOAT +The probability for a vehicle to have +a 'elechybrid' device +.TP +\fB\-\-device\fR.elechybrid.explicit STR[] +Assign a 'elechybrid' device to named +vehicles +.TP +\fB\-\-device\fR.elechybrid.deterministic +The 'elechybrid' devices are set +deterministic using a fraction of 1000 +.SS "Taxi Device Options:" +.TP +\fB\-\-device\fR.taxi.probability FLOAT +The probability for a vehicle to have a +\&'taxi' device +.TP +\fB\-\-device\fR.taxi.explicit STR[] +Assign a 'taxi' device to named vehicles +.TP +\fB\-\-device\fR.taxi.deterministic +The 'taxi' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm STR +The dispatch algorithm +[greedy|greedyClosest|greedyShared] +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm.output STR +Write information from the +dispatch algorithm to FILE +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm.params STR +Load dispatch algorithm +parameters in format +KEY1:VALUE1[,KEY2:VALUE] +.TP +\fB\-\-device\fR.taxi.dispatch\-period TIME +The period between successive calls to +the dispatcher +.SS "Tripinfo Device Options:" +.TP +\fB\-\-device\fR.tripinfo.probability FLOAT +The probability for a vehicle to have a +\&'tripinfo' device +.TP +\fB\-\-device\fR.tripinfo.explicit STR[] +Assign a 'tripinfo' device to named +vehicles +.TP +\fB\-\-device\fR.tripinfo.deterministic +The 'tripinfo' devices are set +deterministic using a fraction of 1000 +.SS "TraCI Server Options:" +.TP +\fB\-\-remote\-port\fR INT +Enables TraCI Server if set +.TP +\fB\-\-num\-clients\fR INT +Expected number of connecting clients +.SS "Mesoscopic Options:" +.TP +\fB\-\-mesosim\fR +Enables mesoscopic simulation +.TP +\fB\-\-meso\-edgelength\fR FLOAT +Length of an edge segment in mesoscopic +simulation +.TP +\fB\-\-meso\-tauff\fR TIME +Factor for calculating the net free\-free +headway time +.TP +\fB\-\-meso\-taufj\fR TIME +Factor for calculating the net free\-jam +headway time +.TP +\fB\-\-meso\-taujf\fR TIME +Factor for calculating the jam\-free +headway time +.TP +\fB\-\-meso\-taujj\fR TIME +Factor for calculating the jam\-jam +headway time +.TP +\fB\-\-meso\-jam\-threshold\fR 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) +.TP +\fB\-\-meso\-multi\-queue\fR +Enable multiple queues at edge ends +.TP +\fB\-\-meso\-junction\-control\fR +Enable mesoscopic traffic light and +priority junction handling +.TP +\fB\-\-meso\-junction\-control\fR.limited +Enable mesoscopic traffic light and +priority junction handling for +saturated links. This prevents faulty +traffic lights from hindering flow in +low\-traffic situations +.TP +\fB\-\-meso\-tls\-penalty\fR FLOAT +Apply scaled time penalties when driving +across tls controlled junctions based +on green split instead of checking +actual phases +.TP +\fB\-\-meso\-minor\-penalty\fR TIME +Apply fixed time penalty when driving +across a minor link. When using +\fB\-\-meso\-junction\-control\fR.limited, the +penalty is not applied whenever limited +control is active. +.TP +\fB\-\-meso\-overtaking\fR +Enable mesoscopic overtaking +.TP +\fB\-\-meso\-recheck\fR TIME +Time interval for rechecking insertion +into the next segment after failure +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.TP +\fB\-\-thread\-rngs\fR INT +Number of pre\-allocated random number +generators to ensure repeatable +multi\-threaded simulations (should be +at least the number of threads for +repeatable simulations). +.SS "GUI Only Options:" +.TP +\fB\-g\fR, \fB\-\-gui\-settings\-file\fR FILE +Load visualisation settings from FILE +.TP +\fB\-Q\fR, \fB\-\-quit\-on\-end\fR +Quits the GUI when the simulation stops +.TP +\fB\-G\fR, \fB\-\-game\fR +Start the GUI in gaming mode +.TP +\fB\-\-game\fR.mode STR +Select the game type ('tls', 'drt') +.TP +\fB\-S\fR, \fB\-\-start\fR +Start the simulation after loading +.TP +\fB\-B\fR, \fB\-\-breakpoints\fR STR[] +Use TIME[] as times when the simulation +should halt +.TP +\fB\-\-edgedata\-files\fR FILE +Load edge/lane weights for visualization +from FILE +.TP +\fB\-D\fR, \fB\-\-demo\fR +Restart the simulation after ending +(demo mode) +.TP +\fB\-T\fR, \fB\-\-disable\-textures\fR +Do not load background pictures +.TP +\fB\-\-registry\-viewport\fR +Load current viewport from registry +.TP +\fB\-\-window\-size\fR STR[] +Create initial window with the given x,y +size +.TP +\fB\-\-window\-pos\fR STR[] +Create initial window at the given x,y +position +.TP +\fB\-\-tracker\-interval\fR FLOAT +The aggregation period for value tracker +windows +.TP +\fB\-\-gui\-testing\fR +Enable ovelay for screen recognition +.TP +\fB\-\-gui\-testing\-debug\fR +Enable output messages during +GUI\-Testing +.TP +\fB\-\-gui\-testing\fR.setting\-output FILE +Save gui settings in the given +settingsoutput file +.SH EXAMPLES +.IP +sumo \-b 0 \-e 1000 \-n net.xml \-r routes.xml +.IP +start a simulation from time 0 to 1000 with given net and routes +.IP +sumo \-c munich_config.cfg +.IP +start with a configuration file +.IP +sumo \-\-help +.IP +print help +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/sumo-gui.1 sumo-1.6.0+dfsg1/docs/man/sumo-gui.1 --- sumo-1.5.0+dfsg1/docs/man/sumo-gui.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/sumo-gui.1 2020-04-27 22:06:17.000000000 +0000 @@ -0,0 +1,1255 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH ECLIPSE "1" "April 2020" "Eclipse SUMO GUI Version 1.6.0" "User Commands" +.SH NAME +Eclipse \- GUI version of the simulation SUMO +.SH SYNOPSIS +.B sumo-gui +[\fI\,OPTION\/\fR]\fI\,*\/\fR +.SH DESCRIPTION +Eclipse SUMO GUI Version 1.6.0 +.IP +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +GUI version of the microscopic, multi\-modal traffic simulation SUMO. +.SS "Configuration Options:" +.TP +\fB\-c\fR, \fB\-\-configuration\-file\fR FILE +Loads the named config on startup +.TP +\fB\-C\fR, \fB\-\-save\-configuration\fR FILE +Saves current configuration into FILE +.TP +\fB\-\-save\-template\fR FILE +Saves a configuration template (empty) +into FILE +.TP +\fB\-\-save\-schema\fR FILE +Saves the configuration schema into FILE +.TP +\fB\-\-save\-commented\fR +Adds comments to saved template, +configuration, or schema +.SS "Input Options:" +.TP +\fB\-n\fR, \fB\-\-net\-file\fR FILE +Load road network description from FILE +.TP +\fB\-r\fR, \fB\-\-route\-files\fR FILE +Load routes descriptions from FILE(s) +.TP +\fB\-a\fR, \fB\-\-additional\-files\fR FILE +Load further descriptions from FILE(s) +.TP +\fB\-w\fR, \fB\-\-weight\-files\fR FILE +Load edge/lane weights for online +rerouting from FILE +.TP +\fB\-x\fR, \fB\-\-weight\-attribute\fR STR +Name of the xml attribute which gives +the edge weight +.TP +\fB\-\-load\-state\fR FILE +Loads a network state from FILE +.TP +\fB\-\-load\-state\fR.offset TIME +Shifts all times loaded from a saved +state by the given offset +.TP +\fB\-\-load\-state\fR.remove\-vehicles STR[] +Removes vehicles with the given IDs from +the loaded state +.TP +\fB\-\-junction\-taz\fR +Initialize a TAZ for every junction to +use attributes toJunction and +fromJunction +.SS "Output Options:" +.TP +\fB\-\-write\-license\fR +Include license info into every output +file +.TP +\fB\-\-output\-prefix\fR STR +Prefix which is applied to all output +files. The special string 'TIME' is +replaced by the current time. +.TP +\fB\-\-precision\fR INT +Defines the number of digits after the +comma for floating point output +.TP +\fB\-\-precision\fR.geo INT +Defines the number of digits after the +comma for lon,lat output +.TP +\fB\-H\fR, \fB\-\-human\-readable\-time\fR +Write time values as hour:minute:second +or day:hour:minute:second rathern than +seconds +.TP +\fB\-\-netstate\-dump\fR FILE +Save complete network states into FILE +.TP +\fB\-\-netstate\-dump\fR.empty\-edges +Write also empty edges completely when +dumping +.TP +\fB\-\-netstate\-dump\fR.precision INT +Write positions and speeds with the +given precision (default 2) +.TP +\fB\-\-emission\-output\fR FILE +Save the emission values of each vehicle +.TP +\fB\-\-emission\-output\fR.precision INT +Write emission values with the given +precision (default 2) +.TP +\fB\-\-battery\-output\fR FILE +Save the battery values of each vehicle +.TP +\fB\-\-battery\-output\fR.precision INT +Write battery values with the given +precision (default 2) +.TP +\fB\-\-elechybrid\-output\fR FILE +Save the elecHybrid values of each +vehicle +.TP +\fB\-\-elechybrid\-output\fR.precision INT +Write elecHybrid values with the given +precision (default 2) +.TP +\fB\-\-elechybrid\-output\fR.aggregated +Write elecHybrid values into one +aggregated file +.TP +\fB\-\-chargingstations\-output\fR FILE +Write data of charging stations +.TP +\fB\-\-overheadwiresegments\-output\fR FILE +Write data of overhead wire segments +.TP +\fB\-\-substations\-output\fR FILE +Write data of electrical substation +stations +.TP +\fB\-\-fcd\-output\fR FILE +Save the Floating Car Data +.TP +\fB\-\-fcd\-output\fR.geo +Save the Floating Car Data using +geo\-coordinates (lon/lat) +.TP +\fB\-\-fcd\-output\fR.signals +Add the vehicle signal state to the FCD +output (brake lights etc.) +.TP +\fB\-\-fcd\-output\fR.distance +Add kilometrage to the FCD output +(linear referencing) +.TP +\fB\-\-fcd\-output\fR.acceleration +Add acceleration to the FCD output +.TP +\fB\-\-fcd\-output\fR.params STR[] +Add generic parameter values to the FCD +output +.TP +\fB\-\-fcd\-output\fR.filter\-edges.input\-file FILE +Restrict fcd output to the edge +selection from the given input file +.TP +\fB\-\-full\-output\fR FILE +Save a lot of information for each +timestep (very redundant) +.TP +\fB\-\-queue\-output\fR FILE +Save the vehicle queues at the junctions +(experimental) +.TP +\fB\-\-vtk\-output\fR FILE +Save complete vehicle positions +inclusive speed values in the VTK +Format (usage: \fI\,/path/out\/\fP will produce +/path/out_$TIMESTEP$.vtp files) +.TP +\fB\-\-amitran\-output\fR FILE +Save the vehicle trajectories in the +Amitran format +.TP +\fB\-\-summary\-output\fR FILE +Save aggregated vehicle departure info +into FILE +.TP +\fB\-\-tripinfo\-output\fR FILE +Save single vehicle trip info into FILE +.TP +\fB\-\-tripinfo\-output\fR.write\-unfinished +Write tripinfo output for vehicles which +have not arrived at simulation end +.TP +\fB\-\-vehroute\-output\fR FILE +Save single vehicle route info into FILE +.TP +\fB\-\-vehroute\-output\fR.exit\-times +Write the exit times for all edges +.TP +\fB\-\-vehroute\-output\fR.last\-route +Write the last route only +.TP +\fB\-\-vehroute\-output\fR.sorted +Sorts the output by departure time +.TP +\fB\-\-vehroute\-output\fR.dua +Write the output in the duarouter +alternatives style +.TP +\fB\-\-vehroute\-output\fR.cost +Write costs for all routes +.TP +\fB\-\-vehroute\-output\fR.intended\-depart +Write the output with the intended +instead of the real departure time +.TP +\fB\-\-vehroute\-output\fR.route\-length +Include total route length in the output +.TP +\fB\-\-vehroute\-output\fR.write\-unfinished +Write vehroute output for vehicles which +have not arrived at simulation end +.TP +\fB\-\-vehroute\-output\fR.skip\-ptlines +Skip vehroute output for public +transport vehicles +.TP +\fB\-\-vehroute\-output\fR.incomplete +Include invalid routes and route stubs +in vehroute output +.TP +\fB\-\-vehroute\-output\fR.stop\-edges +Include information about edges between +stops +.TP +\fB\-\-link\-output\fR FILE +Save links states into FILE +.TP +\fB\-\-railsignal\-block\-output\fR FILE +Save railsignal\-blocks into FILE +.TP +\fB\-\-bt\-output\fR FILE +Save bluetooth visibilities into FILE +(in conjunction with device.btreceiver +and device.btsender) +.TP +\fB\-\-lanechange\-output\fR FILE +Record lane changes and their +motivations for all vehicles into FILE +.TP +\fB\-\-lanechange\-output\fR.started +Record start of lane change manoeuvres +.TP +\fB\-\-lanechange\-output\fR.ended +Record end of lane change manoeuvres +.TP +\fB\-\-lanechange\-output\fR.xy +Record coordinates of lane change +manoeuvres +.TP +\fB\-\-stop\-output\fR FILE +Record stops and loading/unloading of +passenger and containers for all +vehicles into FILE +.TP +\fB\-\-statistic\-output\fR FILE +Write overall statistics into FILE +.TP +\fB\-\-save\-state\fR.times STR[] +Use TIME[] as times at which a network +state written +.TP +\fB\-\-save\-state\fR.period TIME +save state repeatedly after TIME period +.TP +\fB\-\-save\-state\fR.prefix FILE +Prefix for network states +.TP +\fB\-\-save\-state\fR.suffix STR +Suffix for network states (.xml.gz or +\&.xml) +.TP +\fB\-\-save\-state\fR.files FILE +Files for network states +.TP +\fB\-\-save\-state\fR.rng +Save random number generator states +.SS "Time Options:" +.TP +\fB\-b\fR, \fB\-\-begin\fR TIME +Defines the begin time in seconds; +The simulation starts at this time +.TP +\fB\-e\fR, \fB\-\-end\fR TIME +Defines the end time in seconds; +The simulation ends at this time +.TP +\fB\-\-step\-length\fR TIME +Defines the step duration in seconds +.SS "Processing Options:" +.TP +\fB\-\-step\-method\fR.ballistic +Whether to use ballistic method for the +positional update of vehicles (default +is a semi\-implicit Euler method). +.TP +\fB\-\-extrapolate\-departpos\fR +Whether vehicles that depart between +simulation steps should extrapolate the +depart position +.TP +\fB\-\-threads\fR INT +Defines the number of threads for +parallel simulation +.TP +\fB\-\-lateral\-resolution\fR FLOAT +Defines the resolution in m when +handling lateral positioning within a +lane (with \fB\-1\fR all vehicles drive at the +center of their lane +.TP +\fB\-s\fR, \fB\-\-route\-steps\fR TIME +Load routes for the next number of +seconds ahead +.TP +\fB\-\-no\-internal\-links\fR +Disable (junction) internal links +.TP +\fB\-\-ignore\-junction\-blocker\fR TIME +Ignore vehicles which block the junction +after they have been standing for +SECONDS (\fB\-1\fR means never ignore) +.TP +\fB\-\-ignore\-route\-errors\fR +(1) Do not check whether routes are +connected. (2) Allow inserting a +vehicle in a situation which requires +emergency braking. +.TP +\fB\-\-ignore\-accidents\fR +Do not check whether accidents occur +.TP +\fB\-\-collision\fR.action STR +How to deal with collisions: +[none,warn,teleport,remove] +.TP +\fB\-\-collision\fR.stoptime TIME +Let vehicle stop for TIME before +performing collision.action (except for +action 'none') +.TP +\fB\-\-collision\fR.check\-junctions +Enables collisions checks on junctions +.TP +\fB\-\-collision\fR.mingap\-factor FLOAT +Sets the fraction of minGap that must be +maintained to avoid collision +detection. If a negative value is +given, the carFollowModel parameter is +used +.TP +\fB\-\-max\-num\-vehicles\fR INT +Delay vehicle insertion to stay within +the given maximum number +.TP +\fB\-\-max\-num\-teleports\fR INT +Abort the simulation if the given +maximum number of teleports is exceeded +.TP +\fB\-\-scale\fR FLOAT +Scale demand by the given factor (by +discarding or duplicating vehicles) +.TP +\fB\-\-time\-to\-teleport\fR TIME +Specify how long a vehicle may wait +until being teleported, defaults to +300, non\-positive values disable +teleporting +.TP +\fB\-\-time\-to\-teleport\fR.highways TIME +The waiting time after which vehicles on +a fast road (speed > 69m/s) are +teleported if they are on a +non\-continuing lane +.TP +\fB\-\-waiting\-time\-memory\fR TIME +Length of time interval, over which +accumulated waiting time is taken into +account (default is 100s.) +.TP +\fB\-\-max\-depart\-delay\fR TIME +How long vehicles wait for departure +before being skipped, defaults to \fB\-1\fR +which means vehicles are never skipped +.TP +\fB\-\-sloppy\-insert\fR +Whether insertion on an edge shall not +be repeated in same step once failed +.TP +\fB\-\-eager\-insert\fR +Whether each vehicle is checked +separately for insertion on an edge +.TP +\fB\-\-random\-depart\-offset\fR TIME +Each vehicle receives a random offset to +its depart value drawn uniformly from +[0, TIME] +.TP +\fB\-\-lanechange\fR.duration TIME +Duration of a lane change maneuver +(default 0) +.TP +\fB\-\-lanechange\fR.overtake\-right +Whether overtaking on the right on +motorways is permitted +.TP +\fB\-\-tls\fR.all\-off +Switches off all traffic lights. +.TP +\fB\-\-tls\fR.actuated.show\-detectors +Sets default visibility for actuation +detectors +.TP +\fB\-\-tls\fR.delay_based.detector\-range FLOAT +Sets default range for detecting +delayed vehicles +.TP +\fB\-\-time\-to\-impatience\fR TIME +Specify how long a vehicle may wait +until impatience grows from 0 to 1, +defaults to 300, non\-positive values +disable impatience growth +.TP +\fB\-\-default\fR.action\-step\-length FLOAT +Length of the default interval length +between action points for the +car\-following and lane\-change models +(in seconds). If not specified, the +simulation step\-length is used per +default. Vehicle\- or VType\-specific +settings override the default. Must be +a multiple of the simulation +step\-length. +.TP +\fB\-\-default\fR.carfollowmodel STR +Select default car following model +(Krauss, IDM, ...) +.TP +\fB\-\-default\fR.speeddev FLOAT +Select default speed deviation. A +negative value implies vClass specific +defaults (0.1 for the default passenger +class +.TP +\fB\-\-default\fR.emergencydecel STR +Select default emergencyDecel value +among ('decel', 'default', FLOAT) which +sets the value either to the same as +the deceleration value, a vClass\-class +specific default or the given FLOAT in +m/s^2 +.TP +\fB\-\-overhead\-wire\-solver\fR +Use Kirchhoff's laws for solving +overhead wire circuit +.TP +\fB\-\-emergencydecel\fR.warning\-threshold FLOAT +Sets the fraction of emergency +decel capability that must be used to +trigger a warning. +.TP +\fB\-\-parking\fR.maneuver +Whether parking simulation includes +manoeuvering time and associated lane +blocking +.TP +\fB\-\-pedestrian\fR.model STR +Select among pedestrian models +['nonInteracting', 'striping', +\&'remote'] +.TP +\fB\-\-pedestrian\fR.striping.stripe\-width FLOAT +Width of parallel stripes for +segmenting a sidewalk (meters) for use +with model 'striping' +.TP +\fB\-\-pedestrian\fR.striping.dawdling FLOAT +Factor for random slow\-downs [0,1] for +use with model 'striping' +.TP +\fB\-\-pedestrian\fR.striping.jamtime TIME +Time in seconds after which pedestrians +start squeezing through a jam when +using model 'striping' (non\-positive +values disable squeezing) +.TP +\fB\-\-pedestrian\fR.striping.jamtime.crossing TIME +Time in seconds after which +pedestrians start squeezing through a +jam while on a pedestrian crossing when +using model 'striping' (non\-positive +values disable squeezing) +.TP +\fB\-\-pedestrian\fR.striping.reserve\-oncoming FLOAT +Fraction of stripes to reserve +for oncoming pedestrians +.TP +\fB\-\-pedestrian\fR.striping.reserve\-oncoming.junctions FLOAT +Fraction of stripes +to reserve for oncoming pedestrians on +crossings and walkingareas +.TP +\fB\-\-pedestrian\fR.remote.address STR +The address (host:port) of the external +simulation +.TP +\fB\-\-ride\fR.stop\-tolerance FLOAT +Tolerance to apply when matching +pedestrian and vehicle positions on +boarding at individual stops +.SS "Routing Options:" +.TP +\fB\-\-routing\-algorithm\fR STR +Select among routing algorithms +['dijkstra', 'astar', 'CH', +\&'CHWrapper'] +.TP +\fB\-\-weights\fR.random\-factor FLOAT +Edge weights for routing are dynamically +disturbed by a random factor drawn +uniformly from [1,FLOAT) +.TP +\fB\-\-weights\fR.minor\-penalty FLOAT +Apply the given time penalty when +computing minimum routing costs for +minor\-link internal lanes +.TP +\fB\-\-weights\fR.priority\-factor FLOAT +Consider edge priorities in addition to +travel times, weighted by factor +.TP +\fB\-\-astar\fR.all\-distances FILE +Initialize lookup table for astar from +the given file (generated by marouter +\fB\-\-all\-pairs\-output\fR) +.TP +\fB\-\-astar\fR.landmark\-distances FILE +Initialize lookup table for astar +ALT\-variant from the given file +.TP +\fB\-\-persontrip\fR.walkfactor FLOAT +Use FLOAT as a factor on pedestrian +maximum speed during intermodal routing +.TP +\fB\-\-persontrip\fR.transfer.car\-walk STR[] +Where are mode changes from car to +walking allowed (possible values: +\&'parkingAreas', 'ptStops', +\&'allJunctions', 'taxi' and +combinations) +.TP +\fB\-\-device\fR.rerouting.probability FLOAT +The probability for a vehicle to have a +\&'rerouting' device +.TP +\fB\-\-device\fR.rerouting.explicit STR[] +Assign a 'rerouting' device to named +vehicles +.TP +\fB\-\-device\fR.rerouting.deterministic +The 'rerouting' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.rerouting.period TIME +The period with which the vehicle shall +be rerouted +.TP +\fB\-\-device\fR.rerouting.pre\-period TIME +The rerouting period before depart +.TP +\fB\-\-device\fR.rerouting.adaptation\-weight FLOAT +The weight of prior edge weights +for exponential moving average +.TP +\fB\-\-device\fR.rerouting.adaptation\-steps INT +The number of steps for moving +average weight of prior edge weights +.TP +\fB\-\-device\fR.rerouting.adaptation\-interval TIME +The interval for updating the +edge weights +.TP +\fB\-\-device\fR.rerouting.with\-taz +Use zones (districts) as routing startand endpoints +.TP +\fB\-\-device\fR.rerouting.init\-with\-loaded\-weights +Use weight files given with +option \fB\-\-weight\-files\fR for initializing +edge weights +.TP +\fB\-\-device\fR.rerouting.threads INT +The number of parallel execution threads +used for rerouting +.TP +\fB\-\-device\fR.rerouting.synchronize +Let rerouting happen at the same time +for all vehicles +.TP +\fB\-\-device\fR.rerouting.railsignal +Allow rerouting triggered by rail +signals. +.TP +\fB\-\-device\fR.rerouting.bike\-speeds +Compute separate average speeds for +bicycles +.TP +\fB\-\-device\fR.rerouting.output FILE +Save adapting weights to FILE +.TP +\fB\-\-person\-device\fR.rerouting.probability FLOAT +The probability for a person to +have a 'rerouting' device +.TP +\fB\-\-person\-device\fR.rerouting.explicit STR[] +Assign a 'rerouting' device to +named persons +.TP +\fB\-\-person\-device\fR.rerouting.deterministic +The 'rerouting' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-person\-device\fR.rerouting.period TIME +The period with which the person shall +be rerouted +.SS "Report Options:" +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Switches to verbose output +.TP +\fB\-\-print\-options\fR +Prints option values before processing +.TP +\-?, \fB\-\-help\fR +Prints this screen or selected topics +.TP +\fB\-V\fR, \fB\-\-version\fR +Prints the current version +.TP +\fB\-X\fR, \fB\-\-xml\-validation\fR STR +Set schema validation scheme of XML +inputs ("never", "auto" or "always") +.TP +\fB\-\-xml\-validation\fR.net STR +Set schema validation scheme of SUMO +network inputs ("never", "auto" or +"always") +.TP +\fB\-W\fR, \fB\-\-no\-warnings\fR +Disables output of warnings +.TP +\fB\-\-aggregate\-warnings\fR INT +Aggregate warnings of the same type +whenever more than INT occur +.TP +\fB\-l\fR, \fB\-\-log\fR FILE +Writes all messages to FILE (implies +verbose) +.TP +\fB\-\-message\-log\fR FILE +Writes all non\-error messages to FILE +(implies verbose) +.TP +\fB\-\-error\-log\fR FILE +Writes all warnings and errors to FILE +.TP +\fB\-\-duration\-log\fR.disable +Disable performance reports for +individual simulation steps +.TP +\fB\-t\fR, \fB\-\-duration\-log\fR.statistics +Enable statistics on vehicle trips +.TP +\fB\-\-no\-step\-log\fR +Disable console output of current +simulation step +.TP +\fB\-\-step\-log\fR.period INT +Number of simulation steps between +step\-log outputs +.SS "Emissions Options:" +.TP +\fB\-\-phemlight\-path\fR FILE +Determines where to load PHEMlight +definitions from. +.TP +\fB\-\-device\fR.emissions.probability FLOAT +The probability for a vehicle to have a +\&'emissions' device +.TP +\fB\-\-device\fR.emissions.explicit STR[] +Assign a 'emissions' device to named +vehicles +.TP +\fB\-\-device\fR.emissions.deterministic +The 'emissions' devices are set +deterministic using a fraction of 1000 +.SS "Communication Options:" +.TP +\fB\-\-device\fR.btreceiver.probability FLOAT +The probability for a vehicle to have +a 'btreceiver' device +.TP +\fB\-\-device\fR.btreceiver.explicit STR[] +Assign a 'btreceiver' device to named +vehicles +.TP +\fB\-\-device\fR.btreceiver.deterministic +The 'btreceiver' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.btreceiver.range FLOAT +The range of the bt receiver +.TP +\fB\-\-device\fR.btreceiver.all\-recognitions +Whether all recognition point shall be +written +.TP +\fB\-\-device\fR.btreceiver.offtime FLOAT +The offtime used for calculating +detection probability (in seconds) +.TP +\fB\-\-device\fR.btsender.probability FLOAT +The probability for a vehicle to have a +\&'btsender' device +.TP +\fB\-\-device\fR.btsender.explicit STR[] +Assign a 'btsender' device to named +vehicles +.TP +\fB\-\-device\fR.btsender.deterministic +The 'btsender' devices are set +deterministic using a fraction of 1000 +.SS "Battery Options:" +.TP +\fB\-\-device\fR.battery.probability FLOAT +The probability for a vehicle to have a +\&'battery' device +.TP +\fB\-\-device\fR.battery.explicit STR[] +Assign a 'battery' device to named +vehicles +.TP +\fB\-\-device\fR.battery.deterministic +The 'battery' devices are set +deterministic using a fraction of 1000 +.SS "Example Device Options:" +.TP +\fB\-\-device\fR.example.probability FLOAT +The probability for a vehicle to have a +\&'example' device +.TP +\fB\-\-device\fR.example.explicit STR[] +Assign a 'example' device to named +vehicles +.TP +\fB\-\-device\fR.example.deterministic +The 'example' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.example.parameter FLOAT +An exemplary parameter which can be used +by all instances of the example device +.SS "SSM Device Options:" +.TP +\fB\-\-device\fR.ssm.probability FLOAT +The probability for a vehicle to have a +\&'ssm' device +.TP +\fB\-\-device\fR.ssm.explicit STR[] +Assign a 'ssm' device to named vehicles +.TP +\fB\-\-device\fR.ssm.deterministic +The 'ssm' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.ssm.measures STR +Specifies which measures will be logged +(as a space separated sequence of IDs +in ('TTC', 'DRAC', 'PET')). +.TP +\fB\-\-device\fR.ssm.thresholds STR +Specifies thresholds corresponding to +the specified measures (see +documentation and watch the order!). +Only events exceeding the thresholds +will be logged. +.TP +\fB\-\-device\fR.ssm.trajectories +Specifies whether trajectories will be +logged (if false, only the extremal +values and times are reported, this is +the default). +.TP +\fB\-\-device\fR.ssm.range FLOAT +Specifies the detection range in meters +(default is 50.00m.). For vehicles +below this distance from the equipped +vehicle, SSM values are traced. +.TP +\fB\-\-device\fR.ssm.extratime FLOAT +Specifies the time in seconds to be +logged after a conflict is over +(default is 5.00secs.). Required >0 if +PET is to be calculated for crossing +conflicts. +.TP +\fB\-\-device\fR.ssm.file STR +Give a global default filename for the +SSM output. +.TP +\fB\-\-device\fR.ssm.geo +Whether to use coordinates of the +original reference system in output +(default is false). +.SS "ToC Device Options:" +.TP +\fB\-\-device\fR.toc.probability FLOAT +The probability for a vehicle to have a +\&'toc' device +.TP +\fB\-\-device\fR.toc.explicit STR[] +Assign a 'toc' device to named vehicles +.TP +\fB\-\-device\fR.toc.deterministic +The 'toc' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.toc.manualType STR +Vehicle type for manual driving regime. +.TP +\fB\-\-device\fR.toc.automatedType STR +Vehicle type for automated driving +regime. +.TP +\fB\-\-device\fR.toc.responseTime FLOAT +Average response time needed by a driver +to take back control. +.TP +\fB\-\-device\fR.toc.recoveryRate FLOAT +Recovery rate for the driver's awareness +after a ToC. +.TP +\fB\-\-device\fR.toc.lcAbstinence FLOAT +Attention level below which a driver +restrains from performing lane changes +(value in [0,1]). +.TP +\fB\-\-device\fR.toc.initialAwareness FLOAT +Average awareness a driver has initially +after a ToC (value in [0,1]). +.TP +\fB\-\-device\fR.toc.mrmDecel FLOAT +Deceleration rate applied during a +\&'minimum risk maneuver'. +.TP +\fB\-\-device\fR.toc.dynamicToCThreshold FLOAT +Time, which the vehicle requires to +have ahead to continue in automated +mode. The default value of 0 indicates +no dynamic triggering of ToCs. +.TP +\fB\-\-device\fR.toc.dynamicMRMProbability FLOAT +Probability that a dynamically +triggered TOR is not answered in time. +.TP +\fB\-\-device\fR.toc.mrmKeepRight +If true, the vehicle tries to change to +the right during an MRM. +.TP +\fB\-\-device\fR.toc.mrmSafeSpot STR +If set, the vehicle tries to reach the +given named stopping place during an +MRM. +.TP +\fB\-\-device\fR.toc.mrmSafeSpotDuration FLOAT +Duration the vehicle stays at the +safe spot after an MRM. +.TP +\fB\-\-device\fR.toc.maxPreparationAccel FLOAT +Maximal acceleration that may be +applied during the ToC preparation +phase. +.TP +\fB\-\-device\fR.toc.ogNewTimeHeadway FLOAT +Timegap for ToC preparation phase. +.TP +\fB\-\-device\fR.toc.ogNewSpaceHeadway FLOAT +Additional spacing for ToC preparation +phase. +.TP +\fB\-\-device\fR.toc.ogMaxDecel FLOAT +Maximal deceleration applied for +establishing increased gap in ToC +preparation phase. +.TP +\fB\-\-device\fR.toc.ogChangeRate FLOAT +Rate of adaptation towards the increased +headway during ToC preparation. +.TP +\fB\-\-device\fR.toc.useColorScheme +Whether a coloring scheme shall by +applied to indicate the different ToC +stages. +.TP +\fB\-\-device\fR.toc.file STR +Switches on output by specifying an +output filename. +.SS "Driver State Device Options:" +.TP +\fB\-\-device\fR.driverstate.probability FLOAT +The probability for a vehicle to have +a 'driverstate' device +.TP +\fB\-\-device\fR.driverstate.explicit STR[] +Assign a 'driverstate' device to named +vehicles +.TP +\fB\-\-device\fR.driverstate.deterministic +The 'driverstate' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.driverstate.initialAwareness FLOAT +Initial value assigned to the +driver's awareness. +.TP +\fB\-\-device\fR.driverstate.errorTimeScaleCoefficient FLOAT +Time scale for the +error process. +.TP +\fB\-\-device\fR.driverstate.errorNoiseIntensityCoefficient FLOAT +Noise intensity +driving the error process. +.TP +\fB\-\-device\fR.driverstate.speedDifferenceErrorCoefficient FLOAT +General scaling +coefficient for applying the error to +the perceived speed difference (error +also scales with distance). +.TP +\fB\-\-device\fR.driverstate.headwayErrorCoefficient FLOAT +General scaling +coefficient for applying the error to +the perceived distance (error also +scales with distance). +.TP +\fB\-\-device\fR.driverstate.speedDifferenceChangePerceptionThreshold FLOAT +Base +threshold for recognizing changes in +the speed difference (threshold also +scales with distance). +.TP +\fB\-\-device\fR.driverstate.headwayChangePerceptionThreshold FLOAT +Base threshold +for recognizing changes in the headway +(threshold also scales with distance). +.TP +\fB\-\-device\fR.driverstate.minAwareness FLOAT +Minimal admissible value for the +driver's awareness. +.TP +\fB\-\-device\fR.driverstate.maximalReactionTime FLOAT +Maximal reaction time +(~action step length) induced by +decreased awareness level (reached for +awareness=minAwareness). +.SS "Bluelight Device Options:" +.TP +\fB\-\-device\fR.bluelight.probability FLOAT +The probability for a vehicle to have a +\&'bluelight' device +.TP +\fB\-\-device\fR.bluelight.explicit STR[] +Assign a 'bluelight' device to named +vehicles +.TP +\fB\-\-device\fR.bluelight.deterministic +The 'bluelight' devices are set +deterministic using a fraction of 1000 +.TP +\fB\-\-device\fR.bluelight.parameter FLOAT +An exemplary parameter which can be used +by all instances of the example device +.SS "FCD Device Options:" +.TP +\fB\-\-device\fR.fcd.probability FLOAT +The probability for a vehicle to have a +\&'fcd' device +.TP +\fB\-\-device\fR.fcd.explicit STR[] +Assign a 'fcd' device to named vehicles +.TP +\fB\-\-device\fR.fcd.deterministic +The 'fcd' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.fcd.period STR +Recording period for FCD\-data +.TP +\fB\-\-device\fR.fcd.radius FLOAT +Record objects in a radius around +equipped vehicles +.TP +\fB\-\-person\-device\fR.fcd.probability FLOAT +The probability for a person to have a +\&'fcd' device +.TP +\fB\-\-person\-device\fR.fcd.explicit STR[] +Assign a 'fcd' device to named persons +.TP +\fB\-\-person\-device\fR.fcd.deterministic +The 'fcd' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-person\-device\fR.fcd.period STR +Recording period for FCD\-data +.SS "ElecHybrid Device Options:" +.TP +\fB\-\-device\fR.elechybrid.probability FLOAT +The probability for a vehicle to have +a 'elechybrid' device +.TP +\fB\-\-device\fR.elechybrid.explicit STR[] +Assign a 'elechybrid' device to named +vehicles +.TP +\fB\-\-device\fR.elechybrid.deterministic +The 'elechybrid' devices are set +deterministic using a fraction of 1000 +.SS "Taxi Device Options:" +.TP +\fB\-\-device\fR.taxi.probability FLOAT +The probability for a vehicle to have a +\&'taxi' device +.TP +\fB\-\-device\fR.taxi.explicit STR[] +Assign a 'taxi' device to named vehicles +.TP +\fB\-\-device\fR.taxi.deterministic +The 'taxi' devices are set deterministic +using a fraction of 1000 +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm STR +The dispatch algorithm +[greedy|greedyClosest|greedyShared] +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm.output STR +Write information from the +dispatch algorithm to FILE +.TP +\fB\-\-device\fR.taxi.dispatch\-algorithm.params STR +Load dispatch algorithm +parameters in format +KEY1:VALUE1[,KEY2:VALUE] +.TP +\fB\-\-device\fR.taxi.dispatch\-period TIME +The period between successive calls to +the dispatcher +.SS "Tripinfo Device Options:" +.TP +\fB\-\-device\fR.tripinfo.probability FLOAT +The probability for a vehicle to have a +\&'tripinfo' device +.TP +\fB\-\-device\fR.tripinfo.explicit STR[] +Assign a 'tripinfo' device to named +vehicles +.TP +\fB\-\-device\fR.tripinfo.deterministic +The 'tripinfo' devices are set +deterministic using a fraction of 1000 +.SS "TraCI Server Options:" +.TP +\fB\-\-remote\-port\fR INT +Enables TraCI Server if set +.TP +\fB\-\-num\-clients\fR INT +Expected number of connecting clients +.SS "Mesoscopic Options:" +.TP +\fB\-\-mesosim\fR +Enables mesoscopic simulation +.TP +\fB\-\-meso\-edgelength\fR FLOAT +Length of an edge segment in mesoscopic +simulation +.TP +\fB\-\-meso\-tauff\fR TIME +Factor for calculating the net free\-free +headway time +.TP +\fB\-\-meso\-taufj\fR TIME +Factor for calculating the net free\-jam +headway time +.TP +\fB\-\-meso\-taujf\fR TIME +Factor for calculating the jam\-free +headway time +.TP +\fB\-\-meso\-taujj\fR TIME +Factor for calculating the jam\-jam +headway time +.TP +\fB\-\-meso\-jam\-threshold\fR 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) +.TP +\fB\-\-meso\-multi\-queue\fR +Enable multiple queues at edge ends +.TP +\fB\-\-meso\-junction\-control\fR +Enable mesoscopic traffic light and +priority junction handling +.TP +\fB\-\-meso\-junction\-control\fR.limited +Enable mesoscopic traffic light and +priority junction handling for +saturated links. This prevents faulty +traffic lights from hindering flow in +low\-traffic situations +.TP +\fB\-\-meso\-tls\-penalty\fR FLOAT +Apply scaled time penalties when driving +across tls controlled junctions based +on green split instead of checking +actual phases +.TP +\fB\-\-meso\-minor\-penalty\fR TIME +Apply fixed time penalty when driving +across a minor link. When using +\fB\-\-meso\-junction\-control\fR.limited, the +penalty is not applied whenever limited +control is active. +.TP +\fB\-\-meso\-overtaking\fR +Enable mesoscopic overtaking +.TP +\fB\-\-meso\-recheck\fR TIME +Time interval for rechecking insertion +into the next segment after failure +.SS "Random Number Options:" +.TP +\fB\-\-random\fR +Initialises the random number generator +with the current system time +.TP +\fB\-\-seed\fR INT +Initialises the random number generator +with the given value +.TP +\fB\-\-thread\-rngs\fR INT +Number of pre\-allocated random number +generators to ensure repeatable +multi\-threaded simulations (should be +at least the number of threads for +repeatable simulations). +.SS "GUI Only Options:" +.TP +\fB\-g\fR, \fB\-\-gui\-settings\-file\fR FILE +Load visualisation settings from FILE +.TP +\fB\-Q\fR, \fB\-\-quit\-on\-end\fR +Quits the GUI when the simulation stops +.TP +\fB\-G\fR, \fB\-\-game\fR +Start the GUI in gaming mode +.TP +\fB\-\-game\fR.mode STR +Select the game type ('tls', 'drt') +.TP +\fB\-S\fR, \fB\-\-start\fR +Start the simulation after loading +.TP +\fB\-B\fR, \fB\-\-breakpoints\fR STR[] +Use TIME[] as times when the simulation +should halt +.TP +\fB\-\-edgedata\-files\fR FILE +Load edge/lane weights for visualization +from FILE +.TP +\fB\-D\fR, \fB\-\-demo\fR +Restart the simulation after ending +(demo mode) +.TP +\fB\-T\fR, \fB\-\-disable\-textures\fR +Do not load background pictures +.TP +\fB\-\-registry\-viewport\fR +Load current viewport from registry +.TP +\fB\-\-window\-size\fR STR[] +Create initial window with the given x,y +size +.TP +\fB\-\-window\-pos\fR STR[] +Create initial window at the given x,y +position +.TP +\fB\-\-tracker\-interval\fR FLOAT +The aggregation period for value tracker +windows +.TP +\fB\-\-gui\-testing\fR +Enable ovelay for screen recognition +.TP +\fB\-\-gui\-testing\-debug\fR +Enable output messages during +GUI\-Testing +.TP +\fB\-\-gui\-testing\fR.setting\-output FILE +Save gui settings in the given +settingsoutput file +.SH EXAMPLES +.IP +sumo\-gui \-b 0 \-e 1000 \-n net.xml \-r routes.xml +.IP +start a simulation from time 0 to 1000 with given net and routes +.IP +sumo\-gui \-c munich_config.cfg +.IP +start with a configuration file +.IP +sumo\-gui \-\-help +.IP +print help +.SH "REPORTING BUGS" +Report bugs at . +.br +Get in contact via . +.IP +.br +Build features: Linux\-4.15.0\-96\-generic x86_64 GNU 7.5.0 Release Proj GUI SWIG +.br +Copyright (C) 2001\-2020 German Aerospace Center (DLR) and others; https://sumo.dlr.de +.PP +.br +Eclipse SUMO GUI Version 1.6.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 +which accompanies this distribution, and is available at +http://www.eclipse.org/legal/epl\-v20.html +.br +SPDX\-License\-Identifier: EPL\-2.0 diff -Nru sumo-1.5.0+dfsg1/docs/man/TraCITestClient.1 sumo-1.6.0+dfsg1/docs/man/TraCITestClient.1 --- sumo-1.5.0+dfsg1/docs/man/TraCITestClient.1 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/man/TraCITestClient.1 2020-04-27 22:06:19.000000000 +0000 @@ -0,0 +1,9 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6. +.TH USAGE: "1" "April 2020" "Usage: TraCITestClient -def -p [-h ] [-o ]" "User Commands" +.SH NAME +Usage: \- TraCITestClient for the traffic simulation SUMO +.SH SYNOPSIS +.B TraCITestClient +\fI\,-def -p \/\fR[\fI\,-h \/\fR] [\fI\,-o \/\fR] +.SH DESCRIPTION + diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.color.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.color.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.color.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.color.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,62 @@ + + +Python: module sumolib.color + + + + + +
     
    + 
    sumolib.color
    index
    /home/delphi/gcc/sumo/tools/sumolib/color.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    RGBAColor +
    +

    + + + + + +
     
    +class RGBAColor
        Methods defined here:
    +
    __init__(self, r, g, b, a=None)
    + +
    toXML(self)
    + +

    + + + + + +
     
    +Functions
           
    decodeXML(c)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.additional.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.additional.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.additional.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.additional.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,33 @@ + + +Python: module sumolib.files.additional + + + + + +
     
    + 
    sumolib.files.additional
    index
    /home/delphi/gcc/sumo/tools/sumolib/files/additional.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Functions
           
    write(name, elements)
    +
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,41 @@ + + +Python: package sumolib.files + + + + + +
     
    + 
    sumolib.files
    index
    /home/delphi/gcc/sumo/tools/sumolib/files/__init__.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    additional
    +
    selection
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.selection.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.selection.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.files.selection.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.files.selection.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,35 @@ + + +Python: module sumolib.files.selection + + + + + +
     
    + 
    sumolib.files.selection
    index
    /home/delphi/gcc/sumo/tools/sumolib/files/selection.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Functions
           
    read(file, lanes2edges=True)
    +
    write(fdo, entries)
    +
    writeTyped(fdo, typeName, entries)
    +
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.geomhelper.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.geomhelper.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.geomhelper.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.geomhelper.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,74 @@ + + +Python: module sumolib.geomhelper + + + + + +
     
    + 
    sumolib.geomhelper
    index
    /home/delphi/gcc/sumo/tools/sumolib/geomhelper.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2013-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    math
    +

    + + + + + +
     
    +Functions
           
    add(a, b)
    +
    angle2D(p1, p2)
    +
    distance(p1, p2)
    +
    distancePointToLine(point, line_start, line_end, perpendicular=False)
    Return the minimum distance between point and the line (line_start, line_end)
    +
    distancePointToPolygon(point, polygon, perpendicular=False)
    Return the minimum distance between point and polygon
    +
    dotProduct(a, b)
    +
    fromNaviDegree(degrees)
    +
    isWithin(pos, shape)
    +
    length(a)
    +
    lineOffsetWithMinimumDistanceToPoint(point, line_start, line_end, perpendicular=False)
    Return the offset from line (line_start, line_end) where the distance to
    +point is minimal
    +
    minAngleDegreeDiff(d1, d2)
    +
    move2side(shape, amount)
    +
    mul(a, x)
    +
    narrow(fromPos, pos, toPos, amount)
    detect narrow turns which cannot be shifted regularly
    +
    naviDegree(rad)
    +
    norm(a)
    +
    normalizeAngle(a, lower, upper, circle)
    +
    orthoIntersection(a, b)
    +
    polyLength(polygon)
    +
    polygonOffsetAndDistanceToPoint(point, polygon, perpendicular=False)
    Return the offset and the distance from the polygon start where the distance to the point is minimal
    +
    polygonOffsetWithMinimumDistanceToPoint(point, polygon, perpendicular=False)
    Return the offset from the polygon start where the distance to the point is minimal
    +
    positionAtOffset(p1, p2, offset)
    +
    positionAtShapeOffset(shape, offset)
    +
    sideOffset(fromPos, toPos, amount)
    +
    sub(a, b)
    +

    + + + + + +
     
    +Data
           INVALID_DISTANCE = -1
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,239 @@ + + +Python: package sumolib + + + + + +
     
    + 
    sumolib
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    color
    +files (package)
    +geomhelper
    +miscutils
    +
    net (package)
    +options
    +output (package)
    +route
    +
    scenario (package)
    +sensors (package)
    +shapes (package)
    +version
    +
    visualization (package)
    +xml
    +

    + + + + + +
     
    +Classes
           
    +
    TeeFile +
    xml.sax.handler.ContentHandler +
    +
    +
    ConfigurationReader +
    +
    +
    +

    + + + + + + + +
     
    +class ConfigurationReader(xml.sax.handler.ContentHandler)
       Reads a configuration template, storing the options in an OptionParser
     
     Methods defined here:
    +
    __init__(self, optParse, groups, configoptions)
    + +
    endElement(self, name)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + + + +
     
    +class TeeFile
       A helper class which allows simultaneous writes to several files
     
     Methods defined here:
    +
    __init__(self, *outputfiles)
    + +
    flush(self)
    flushes all file contents to disc
    + +
    write(self, txt)
    Writes the text to all files
    + +

    + + + + + +
     
    +Functions
           
    call(executable, args)
    +
    checkBinary(name, bindir=None)
    Checks for the given binary in the places, defined by the environment
    +variables SUMO_HOME and <NAME>_BINARY.
    +
    exeExists(binary)
    +
    pullOptions(executable, optParse, groups=None, configoptions=None)
    +
    saveConfiguration(executable, configoptions, filename)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.miscutils.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.miscutils.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.miscutils.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.miscutils.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,158 @@ + + +Python: module sumolib.miscutils + + + + + +
     
    + 
    sumolib.miscutils
    index
    /home/delphi/gcc/sumo/tools/sumolib/miscutils.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    colorsys
    +math
    +
    os
    +random
    +
    socket
    +sys
    +
    time
    +

    + + + + + +
     
    +Classes
           
    +
    Colorgen +
    Statistics +
    working_dir +
    +

    + + + + + +
     
    +class Colorgen
        Methods defined here:
    +
    __call__(self)
    return constant or randomized rgb-color string
    + +
    __init__(self, hsv, cycleLength=10.67)
    + +
    byteTuple(self)
    return color as a tuple of bytes each in [0,255]
    + +
    floatTuple(self)
    return color as a tuple of floats each in [0,1]
    + +
    get_value(self, opt, index)
    + +
    +Data and other attributes defined here:
    +
    DISTINCT = [(0.17, 1.0, 0.5), (0.0, 0.9, 1.0), (0.35, 0.67, 0.71), (0.14, 0.9, 1.0), (0.56, 1.0, 0.78), (0.07, 0.8, 0.96), (0.79, 0.83, 0.71), (0.5, 0.71, 0.94), (0.84, 0.79, 0.94), (0.2, 0.76, 0.96), (0.0, 0.24, 0.98), (0.5, 1.0, 0.5), (0.77, 0.25, 1.0), (0.09, 0.76, 0.67), (0.15, 0.22, 1.0), (0.0, 1.0, 0.5), (0.38, 0.33, 1.0), (0.67, 1.0, 0.5)]
    + +

    + + + + + +
     
    +class Statistics
        Methods defined here:
    +
    __init__(self, label=None, abs=False, histogram=False, printMin=True, scale=1)
    + +
    __str__(self)
    + +
    add(self, v, label=None)
    + +
    average_absolute_deviation_from_mean(self)
    + +
    avg(self)
    return the mean value
    + +
    avg_abs(self)
    return the mean of absolute values
    + +
    clear(self)
    + +
    count(self)
    + +
    histogram(self)
    + +
    mean(self)
    return the median value
    + +
    meanAndStdDev(self, limit=None)
    return the mean and the standard deviation optionally limited to the last limit values
    + +
    mean_abs(self)
    return the median of absolute values
    + +
    median(self)
    + +
    median_abs(self)
    + +
    quartiles(self)
    + +
    rank(self, fraction)
    + +
    relStdDev(self, limit=None)
    return the relative standard deviation optionally limited to the last limit values
    + +
    update(self, other)
    + +

    + + + + + + + +
     
    +class working_dir
       # temporarily change working directory using 'with' statement
     
     Methods defined here:
    +
    __enter__(self)
    + +
    __exit__(self, type, value, traceback)
    + +
    __init__(self, dir)
    + +

    + + + + + +
     
    +Functions
           
    benchmark(func)
    +
    euclidean(a, b)
    # euclidean distance between two coordinates in the plane
    +
    geh(m, c)
    Error function for hourly traffic flow measures after Geoffrey E. Havers
    +
    getFreeSocketPort(numTries=10)
    +
    getSocketStream(port, mode='rb')
    +
    humanReadableTime(seconds)
    +
    parseTime(t)
    +
    round(value)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    +uMax = uMax
    +uMin = uMin
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.connection.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.connection.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.connection.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.connection.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,89 @@ + + +Python: module sumolib.net.connection + + + + + +
     
    + 
    sumolib.net.connection
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/connection.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    Connection +
    +

    + + + + + +
     
    +class Connection
        Methods defined here:
    +
    __init__(self, fromEdge, toEdge, fromLane, toLane, direction, tls, tllink, state, viaLaneID=None)
    + +
    __str__(self)
    + +
    getDirection(self)
    + +
    getFrom(self)
    + +
    getFromLane(self)
    + +
    getJunction(self)
    + +
    getJunctionIndex(self)
    + +
    getParam(self, key, default=None)
    + +
    getParams(self)
    + +
    getState(self)
    + +
    getTLLinkIndex(self)
    + +
    getTLSID(self)
    + +
    getTo(self)
    + +
    getToLane(self)
    + +
    getViaLaneID(self)
    + +
    setParam(self, key, value)
    + +
    +Data and other attributes defined here:
    +
    LINKDIR_LEFT = 'l'
    + +
    LINKDIR_PARTLEFT = 'L'
    + +
    LINKDIR_PARTRIGHT = 'R'
    + +
    LINKDIR_RIGHT = 'r'
    + +
    LINKDIR_STRAIGHT = 's'
    + +
    LINKDIR_TURN = 't'
    + +

    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.edge.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.edge.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.edge.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.edge.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,123 @@ + + +Python: module sumolib.net.edge + + + + + +
     
    + 
    sumolib.net.edge
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/edge.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    Edge +
    +

    + + + + + + + +
     
    +class Edge
       Edges from a sumo network
     
     Methods defined here:
    +
    __init__(self, id, fromN, toN, prio, function, name)
    + +
    __repr__(self)
    + +
    addLane(self, lane)
    + +
    addOutgoing(self, conn)
    + +
    allows(self, vClass)
    true if this edge has a lane which allows the given vehicle class
    + +
    getAllowedOutgoing(self, vClass)
    + +
    getBidi(self)
    + +
    getBoundingBox(self, includeJunctions=True)
    + +
    getClosestLanePosDist(self, point, perpendicular=False)
    + +
    getConnections(self, toEdge)
    Returns all connections to the given target edge
    + +
    getCrossingEdges(self)
    + +
    getFromNode(self)
    + +
    getFunction(self)
    + +
    getID(self)
    + +
    getIncoming(self)
    + +
    getLane(self, idx)
    + +
    getLaneNumber(self)
    + +
    getLanes(self)
    + +
    getLength(self)
    + +
    getName(self)
    + +
    getOutgoing(self)
    + +
    getParam(self, key, default=None)
    + +
    getParams(self)
    + +
    getPriority(self)
    + +
    getRawShape(self)
    Return the shape that was used in netconvert for building this edge (2D).
    + +
    getRawShape3D(self)
    Return the shape that was used in netconvert for building this edge (3D).
    + +
    getShape(self, includeJunctions=False)
    Return the 2D shape that is the average of all lane shapes (segment-wise)
    + +
    getShape3D(self, includeJunctions=False)
    + +
    getSpeed(self)
    + +
    getTLS(self)
    + +
    getToNode(self)
    + +
    isSpecial(self)
    Check if the edge has a special function.

    +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)
    +If connections is given, only those connections are considered
    + +
    rebuildShape(self)
    + +
    setParam(self, key, value)
    + +
    setRawShape(self, shape)
    + +
    setTLS(self, tls)
    + +

    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,380 @@ + + +Python: package sumolib.net + + + + + +
     
    + 
    sumolib.net
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/__init__.py
    +

    This file contains a content handler for parsing sumo network xml files.
    +It uses other classes from this module to represent the road network.

    +

    + + + + + +
     
    +Package Contents
           
    connection
    +edge
    +
    generator (package)
    +lane
    +
    node
    +roundabout
    +

    + + + + + +
     
    +Classes
           
    +
    Net +
    Phase +
    TLS +
    TLSProgram +
    xml.sax.handler.ContentHandler +
    +
    +
    NetReader +
    +
    +
    +

    + + + + + + + +
     
    +class Net
       The whole sumo network.
     
     Methods defined here:
    +
    __init__(self)
    + +
    addConnection(self, fromEdge, toEdge, fromlane, tolane, direction, tls, tllink, state, viaLaneID=None)
    + +
    addEdge(self, id, fromID, toID, prio, function, name)
    + +
    addLane(self, edge, speed, length, width, allow=None, disallow=None)
    + +
    addNode(self, id, type=None, coord=None, incLanes=None, intLanes=None)
    + +
    addRoundabout(self, nodes, edges=None)
    + +
    addTLS(self, tlid, inLane, outLane, linkNo)
    + +
    addTLSProgram(self, tlid, programID, offset, type, removeOthers)
    + +
    convertLonLat2XY(self, lon, lat, rawUTM=False)
    + +
    convertXY2LonLat(self, x, y, rawUTM=False)
    + +
    forbids(self, possProhibitor, possProhibited)
    + +
    getBBoxDiameter(self)
    # the diagonal of the bounding box of all nodes
    + +
    getBBoxXY(self)
    Get the bounding box (bottom left and top right coordinates) for a net;
    +Coordinates are in X and Y (not Lat and Lon)

    +:return [(bottom_left_X, bottom_left_Y), (top_right_X, top_right_Y)]
    + +
    getBoundary(self)
    return xmin,ymin,xmax,ymax network coordinates
    + +
    getDownstreamEdges(self, edge, distance, stopOnTLS, stopOnTurnaround)
    return a list of lists of the form
    +[[firstEdge, pos, [edge_0, edge_1, ..., edge_k], aborted], ...]
    +where
    +  firstEdge: is the downstream edge furthest away from the intersection,
    +  [edge_0, ..., edge_k]: is the list of edges from the intersection downstream to firstEdge
    +  pos: is the position on firstEdge with distance to the end of the input edge
    +  aborted: a flag indicating whether the downstream
    +      search stopped at a TLS or a node without incoming edges before reaching the distance threshold
    + +
    getEdge(self, id)
    + +
    getEdges(self, withInternal=True)
    + +
    getEdgesByOrigID(self, origID)
    + +
    getGeoProj(self)
    + +
    getLane(self, laneID)
    + +
    getLocationOffset(self)
    offset to be added after converting from geo-coordinates to UTM
    + +
    getNeighboringEdges(self, x, y, r=0.1, includeJunctions=True, allowFallback=True)
    # Please be aware that the resulting list of edges is NOT sorted
    + +
    getNeighboringLanes(self, x, y, r=0.1, includeJunctions=True, allowFallback=True)
    + +
    getNode(self, id)
    + +
    getNodes(self)
    + +
    getRoundabouts(self)
    + +
    getShortestPath(self, fromEdge, toEdge, maxCost=inf, vClass=None, reversalPenalty=0)
    Finds the shortest path from fromEdge to toEdge respecting vClass, using Dijkstra's algorithm.
    +It returns a pair of a tuple of edges and the cost. If no path is found the first element is None.
    +The cost for the returned path is equal to the sum of all edge lengths in the path,
    +including the internal connectors, if they are present in the network.
    +The path itself does not include internal edges except for the case
    +when the start or end edge are internal edges.
    +The search may be limited using the given threshold.
    + +
    getTLS(self, tlid)
    + +
    getTLSSecure(self, tlid)
    + +
    getTrafficLights(self)
    + +
    hasEdge(self, id)
    + +
    hasNode(self, id)
    + +
    move(self, dx, dy, dz=0)
    + +
    setAdditionalNodeInfo(self, node, type, coord, incLanes, intLanes=None)
    + +
    setFoes(self, junctionID, index, foes, prohibits)
    + +
    setLocation(self, netOffset, convBoundary, origBoundary, projParameter)
    + +

    + + + + + + + +
     
    +class NetReader(xml.sax.handler.ContentHandler)
       Reads a network, storing the edge geometries, lane numbers and max. speeds
     
     Methods defined here:
    +
    __init__(self, **others)
    + +
    endDocument(self)
    + +
    endElement(self, name)
    + +
    getNet(self)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +class Phase
        Methods defined here:
    +
    __init__(self, duration, state, minDur=-1, maxDur=-1, next=None, name='')
    + +
    __repr__(self)
    + +

    + + + + + + + +
     
    +class TLS
       Traffic Light Signal for a sumo network
     
     Methods defined here:
    +
    __init__(self, id)
    + +
    addConnection(self, inLane, outLane, linkNo)
    + +
    addProgram(self, program)
    + +
    getConnections(self)
    + +
    getEdges(self)
    + +
    getID(self)
    + +
    getLinks(self)
    + +
    getPrograms(self)
    + +
    removePrograms(self)
    + +
    toXML(self)
    + +

    + + + + + +
     
    +class TLSProgram
        Methods defined here:
    +
    __init__(self, id, offset, type)
    + +
    addPhase(self, state, duration, minDur=-1, maxDur=-1, next=None, name='')
    + +
    getParam(self, key, default=None)
    + +
    getParams(self)
    + +
    getPhases(self)
    + +
    getType(self)
    + +
    setParam(self, key, value)
    + +
    toXML(self, tlsID)
    + +

    + + + + + +
     
    +Functions
           
    convertShape(shapeString)
    Convert xml shape string into float tuples.

    +This method converts the 2d or 3d shape string from SUMO's xml file
    +into a list containing 3d float-tuples. Non existant z coordinates default
    +to zero. If shapeString is empty, an empty list will be returned.
    +
    readNet(filename, **others)
    load a .net.xml file
    +The following named options are supported:

    +    'net' : initialize data structurs with an existing net object (default Net())
    +    'withPrograms' : import all traffic light programs (default False)
    +    'withLatestPrograms' : import only the last program for each traffic light.
    +                           This is the program that would be active in sumo by default.
    +                           (default False)
    +    'withConnections' : import all connections (default True)
    +    'withFoes' : import right-of-way information (default True)
    +    'withInternal' : import internal edges and lanes (default False)
    +    'withPedestrianConnections' : import connections between sidewalks, crossings (default False)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.lane.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.lane.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.lane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.lane.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,151 @@ + + +Python: module sumolib.net.lane + + + + + +
     
    + 
    sumolib.net.lane
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/lane.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    sumolib
    +

    + + + + + +
     
    +Classes
           
    +
    Lane +
    +

    + + + + + + + +
     
    +class Lane
       Lanes from a sumo network
     
     Methods defined here:
    +
    __init__(self, edge, speed, length, width, allow, disallow)
    + +
    addOutgoing(self, conn)
    + +
    allows(self, vClass)
    true if this lane allows the given vehicle class
    + +
    getBoundingBox(self, includeJunctions=True)
    + +
    getClosestLanePosAndDist(self, point, perpendicular=False)
    + +
    getConnection(self, toLane)
    Returns the connection to the given target lane or None
    + +
    getEdge(self)
    + +
    getID(self)
    + +
    getIncoming(self, onlyDirect=False)
    Returns all incoming lanes for this lane, i.e. lanes, which have a connection to this lane.
    +If onlyDirect is True, then only incoming internal lanes are returned for a normal lane if they exist
    + +
    getIndex(self)
    + +
    getLength(self)
    + +
    getNeigh(self)
    + +
    getOutgoing(self)
    + +
    getParam(self, key, default=None)
    + +
    getParams(self)
    + +
    getShape(self, includeJunctions=False)
    Returns the shape of the lane in 2d.

    +This function returns the shape of the lane, as defined in the net.xml
    +file. The returned shape is a list containing numerical
    +2-tuples representing the x,y coordinates of the shape points.

    +For includeJunctions=True the returned list will contain
    +additionally the coords (x,y) of the fromNode of the
    +corresponding edge as first element and the coords (x,y)
    +of the toNode as last element.

    +For internal lanes, includeJunctions is ignored and the unaltered
    +shape of the lane is returned.
    + +
    getShape3D(self, includeJunctions=False)
    Returns the shape of the lane in 3d.

    +This function returns the shape of the lane, as defined in the net.xml
    +file. The returned shape is a list containing numerical
    +3-tuples representing the x,y,z coordinates of the shape points
    +where z defaults to zero.

    +For includeJunction=True the returned list will contain
    +additionally the coords (x,y,z) of the fromNode of the
    +corresponding edge as first element and the coords (x,y,z)
    +of the toNode as last element.

    +For internal lanes, includeJunctions is ignored and the unaltered
    +shape of the lane is returned.
    + +
    getSpeed(self)
    + +
    getWidth(self)
    + +
    setNeigh(self, neigh)
    + +
    setParam(self, key, value)
    + +
    setShape(self, shape)
    Set the shape of the lane

    +shape must be a list containing x,y,z coords as numbers
    +to represent the shape of the lane
    + +

    + + + + + +
     
    +Functions
           
    addJunctionPos(shape, fromPos, toPos)
    Extends shape with the given positions in case they differ from the
    +existing endpoints. assumes that shape and positions have the same dimensionality
    +
    get_allowed(allow, disallow)
    Normalize the given string attributes as a list of all allowed vClasses.
    +
    reduce(...)
    reduce(function, sequence[, initial]) -> value

    +Apply a function of two arguments cumulatively to the items of a sequence,
    +from left to right, so as to reduce the sequence to a single value.
    +For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    +((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    +of the sequence in the calculation, and serves as a default when the
    +sequence is empty.
    +

    + + + + + +
     
    +Data
           SUMO_VEHICLE_CLASSES = ('public_emergency', 'public_authority', 'public_army', 'public_transport', 'transport', 'lightrail', 'cityrail', 'rail_slow', 'rail_fast', 'private', 'emergency', 'authority', 'army', 'vip', 'passenger', 'hov', 'taxi', 'bus', 'coach', 'delivery', ...)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.node.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.node.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.node.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.node.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,104 @@ + + +Python: module sumolib.net.node + + + + + +
     
    + 
    sumolib.net.node
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/node.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2011-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    Node +
    +

    + + + + + + + +
     
    +class Node
       Nodes from a sumo network
     
     Methods defined here:
    +
    __init__(self, id, type, coord, incLanes, intLanes=None)
    + +
    addIncoming(self, edge)
    + +
    addOutgoing(self, edge)
    + +
    areFoes(self, link1, link2)
    + +
    forbids(self, possProhibitor, possProhibited)
    + +
    getConnections(self, source=None, target=None)
    + +
    getCoord(self)
    + +
    getCoord3D(self)
    + +
    getID(self)
    + +
    getIncoming(self)
    + +
    getInternal(self)
    + +
    getLinkIndex(self, conn)
    + +
    getNeighboringNodes(self, outgoingNodes=True, incomingNodes=True)
    + +
    getOutgoing(self)
    + +
    getParam(self, key, default=None)
    + +
    getParams(self)
    + +
    getShape(self)
    Returns the shape of the node in 2d.

    +This function returns the shape of the node, as defined in the net.xml
    +file. The returned shape is a list containing numerical
    +2-tuples representing the x,y coordinates of the shape points.

    +If no shape is defined in the xml, an empty list will be returned.
    + +
    getShape3D(self)
    Returns the shape of the node in 3d.

    +This function returns the shape of the node, as defined in the net.xml
    +file. The returned shape is a list containing numerical
    +3-tuples representing the x,y,z coordinates of the shape points.

    +If no shape is defined in the xml, an empty list will be returned.
    + +
    getType(self)
    + +
    setFoes(self, index, foes, prohibits)
    + +
    setParam(self, key, value)
    + +
    setShape(self, shape)
    Set the shape of the node.

    +Shape must be a list containing x,y,z coords as numbers
    +to represent the shape of the node.
    + +

    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.roundabout.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.roundabout.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.net.roundabout.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.net.roundabout.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,49 @@ + + +Python: module sumolib.net.roundabout + + + + + +
     
    + 
    sumolib.net.roundabout
    index
    /home/delphi/gcc/sumo/tools/sumolib/net/roundabout.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    Roundabout +
    +

    + + + + + +
     
    +class Roundabout
        Methods defined here:
    +
    __init__(self, nodes, edges=None)
    + +
    getEdges(self)
    + +
    getNodes(self)
    + +

    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.options.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.options.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.options.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.options.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,416 @@ + + +Python: module sumolib.options + + + + + +
     
    + 
    sumolib.options
    index
    /home/delphi/gcc/sumo/tools/sumolib/options.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    argparse
    +xml.sax.handler
    +
    re
    +subprocess
    +
    sys
    +

    + + + + + +
     
    +Classes
           
    +
    __builtin__.tuple(__builtin__.object) +
    +
    +
    Option +
    +
    +
    argparse.ArgumentParser(argparse._AttributeHolder, argparse._ActionsContainer) +
    +
    +
    ArgumentParser +
    +
    +
    xml.sax.handler.ContentHandler +
    +
    +
    OptionReader +
    +
    +
    +

    + + + + + + + +
     
    +class ArgumentParser(argparse.ArgumentParser)
       Drop-in replacement for argparse.ArgumentParser that adds support for
    +sumo-style config files.
    +Inspired by https://github.com/bw2/ConfigArgParse
     
     
    Method resolution order:
    +
    ArgumentParser
    +
    argparse.ArgumentParser
    +
    argparse._AttributeHolder
    +
    argparse._ActionsContainer
    +
    __builtin__.object
    +
    +
    +Methods defined here:
    +
    __init__(self, *args, **kwargs)
    + +
    parse_args(self, args=None, namespace=None)
    + +
    parse_known_args(self, args=None, namespace=None)
    + +
    write_config_file(self, namespace, exit=True)
    + +
    +Methods inherited from argparse.ArgumentParser:
    +
    add_subparsers(self, **kwargs)
    # ==================================
    +# Optional/Positional adding methods
    +# ==================================
    + +
    convert_arg_line_to_args(self, arg_line)
    + +
    error(self, message)
    error(message: string)

    +Prints a usage message incorporating the message to stderr and
    +exits.

    +If you override this in a subclass, it should not return -- it
    +should either exit or raise an exception.
    + +
    exit(self, status=0, message=None)
    # ===============
    +# Exiting methods
    +# ===============
    + +
    format_help(self)
    + +
    format_usage(self)
    # =======================
    +# Help-formatting methods
    +# =======================
    + +
    format_version(self)
    + +
    print_help(self, file=None)
    + +
    print_usage(self, file=None)
    # =====================
    +# Help-printing methods
    +# =====================
    + +
    print_version(self, file=None)
    + +
    +Methods inherited from argparse._AttributeHolder:
    +
    __repr__(self)
    + +
    +Data descriptors inherited from argparse._AttributeHolder:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    +Methods inherited from argparse._ActionsContainer:
    +
    add_argument(self, *args, **kwargs)
    add_argument(dest, ..., name=value, ...)
    +add_argument(option_string, option_string, ..., name=value, ...)
    + +
    add_argument_group(self, *args, **kwargs)
    + +
    add_mutually_exclusive_group(self, **kwargs)
    + +
    get_default(self, dest)
    + +
    register(self, registry_name, value, object)
    # ====================
    +# Registration methods
    +# ====================
    + +
    set_defaults(self, **kwargs)
    # ==================================
    +# Namespace default accessor methods
    +# ==================================
    + +

    + + + + + + + +
     
    +class Option(__builtin__.tuple)
       Option(name, value, type, help)
     
     
    Method resolution order:
    +
    Option
    +
    __builtin__.tuple
    +
    __builtin__.object
    +
    +
    +Methods defined here:
    +
    __getnewargs__(self)
    Return self as a plain tuple.  Used by copy and pickle.
    + +
    __getstate__(self)
    Exclude the OrderedDict from pickling
    + +
    __repr__(self)
    Return a nicely formatted representation string
    + +
    _asdict(self)
    Return a new OrderedDict which maps field names to their values
    + +
    _replace(_self, **kwds)
    Return a new Option object replacing specified fields with new values
    + +
    +Class methods defined here:
    +
    _make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
    Make a new Option object from a sequence or iterable
    + +
    +Static methods defined here:
    +
    __new__(_cls, name, value, type, help)
    Create new instance of Option(name, value, type, help)
    + +
    +Data descriptors defined here:
    +
    __dict__
    +
    Return a new OrderedDict which maps field names to their values
    +
    +
    help
    +
    Alias for field number 3
    +
    +
    name
    +
    Alias for field number 0
    +
    +
    type
    +
    Alias for field number 2
    +
    +
    value
    +
    Alias for field number 1
    +
    +
    +Data and other attributes defined here:
    +
    _fields = ('name', 'value', 'type', 'help')
    + +
    +Methods inherited from __builtin__.tuple:
    +
    __add__(...)
    x.__add__(y) <==> x+y
    + +
    __contains__(...)
    x.__contains__(y) <==> y in x
    + +
    __eq__(...)
    x.__eq__(y) <==> x==y
    + +
    __ge__(...)
    x.__ge__(y) <==> x>=y
    + +
    __getattribute__(...)
    x.__getattribute__('name') <==> x.name
    + +
    __getitem__(...)
    x.__getitem__(y) <==> x[y]
    + +
    __getslice__(...)
    x.__getslice__(i, j) <==> x[i:j]

    +Use of negative indices is not supported.
    + +
    __gt__(...)
    x.__gt__(y) <==> x>y
    + +
    __hash__(...)
    x.__hash__() <==> hash(x)
    + +
    __iter__(...)
    x.__iter__() <==> iter(x)
    + +
    __le__(...)
    x.__le__(y) <==> x<=y
    + +
    __len__(...)
    x.__len__() <==> len(x)
    + +
    __lt__(...)
    x.__lt__(y) <==> x<y
    + +
    __mul__(...)
    x.__mul__(n) <==> x*n
    + +
    __ne__(...)
    x.__ne__(y) <==> x!=y
    + +
    __rmul__(...)
    x.__rmul__(n) <==> n*x
    + +
    count(...)
    T.count(value) -> integer -- return number of occurrences of value
    + +
    index(...)
    T.index(value, [start, [stop]]) -> integer -- return first index of value.
    +Raises ValueError if the value is not present.
    + +

    + + + + + + + +
     
    +class OptionReader(xml.sax.handler.ContentHandler)
       Reads an option file
     
     Methods defined here:
    +
    __init__(self)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElement(self, name)
    Signals the end of an element in non-namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElement event.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    getOptions()
    +
    get_long_option_names(application)
    +
    readOptions(filename)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.fcdfilter.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.fcdfilter.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.fcdfilter.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.fcdfilter.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,69 @@ + + +Python: module sumolib.output.convert.fcdfilter + + + + + +
     
    + 
    sumolib.output.convert.fcdfilter
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    Filter +
    +

    + + + + + +
     
    +class Filter
        Methods defined here:
    +
    __init__(self, opts, begin, end, bbox, outfile)
    + +
    checkTime(self, t)
    + +
    close(self)
    + +
    done(self, t)
    + +
    write(self, v)
    + +

    + + + + + +
     
    +Functions
           
    fcdfilter(inpFCD, outSTRM, further)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.gpsdat.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.gpsdat.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.gpsdat.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.gpsdat.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,42 @@ + + +Python: module sumolib.output.convert.gpsdat + + + + + +
     
    + 
    sumolib.output.convert.gpsdat
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/gpsdat.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +csv data files used by dlr-fcd processing chain

    +

    + + + + + +
     
    +Modules
           
    datetime
    +
    sumolib
    +

    + + + + + +
     
    +Functions
           
    fcd2gpsdat(inpFCD, outSTRM, further)
    +

    + + + + + +
     
    +Data
           TAXI_STATUS_FREE_FLOW = '70'
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.gpx.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.gpx.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.gpx.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.gpx.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,31 @@ + + +Python: module sumolib.output.convert.gpx + + + + + +
     
    + 
    sumolib.output.convert.gpx
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/gpx.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +GPX format (http://en.wikipedia.org/wiki/GPS_eXchange_Format)

    +

    + + + + + +
     
    +Functions
           
    fcd2gpx(inpFCD, outSTRM, ignored)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,49 @@ + + +Python: package sumolib.output.convert + + + + + +
     
    + 
    sumolib.output.convert
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    fcdfilter
    +gpsdat
    +gpx
    +
    keplerjson
    +kml
    +ns2
    +
    omnet
    +phem
    +poi
    +
    shawn
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.kml.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.kml.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.kml.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.kml.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,31 @@ + + +Python: module sumolib.output.convert.kml + + + + + +
     
    + 
    sumolib.output.convert.kml
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/kml.py
    +

    This module includes functions for converting SUMO's FCD output into Google's
    +KML format (https://developers.google.com/kml/documentation/kmlreference)

    +

    + + + + + +
     
    +Functions
           
    fcd2kml(inpFCD, outSTRM, ignored)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.ns2.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.ns2.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.ns2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.ns2.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,42 @@ + + +Python: module sumolib.output.convert.ns2 + + + + + +
     
    + 
    sumolib.output.convert.ns2
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/ns2.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +data files read by ns2.

    +

    + + + + + +
     
    +Modules
           
    sumolib
    +

    + + + + + +
     
    +Functions
           
    fcd2ns2mobility(inpFCD, outSTRM, further)
    +
    writeNS2activity(outSTRM, vehInfo)
    +
    writeNS2config(outSTRM, vehInfo, ns2activityfile, ns2mobilityfile, begin, end, area)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.omnet.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.omnet.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.omnet.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.omnet.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,41 @@ + + +Python: module sumolib.output.convert.omnet + + + + + +
     
    + 
    sumolib.output.convert.omnet
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/omnet.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +data files read by OMNET.

    +

    + + + + + +
     
    +Modules
           
    datetime
    +
    sumolib
    +

    + + + + + +
     
    +Functions
           
    fcd2omnet(inpFCD, outSTRM, further)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.phem.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.phem.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.phem.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.phem.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,64 @@ + + +Python: module sumolib.output.convert.phem + + + + + +
     
    + 
    sumolib.output.convert.phem
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/phem.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +data files read by PHEM.

    +

    + + + + + +
     
    +Modules
           
    math
    +
    sumolib
    +

    + + + + + +
     
    +Functions
           
    fcd2dri(inpFCD, outSTRM, ignored)
    Reformats the contents of the given fcd-output file into a .dri file, readable
    +by PHEM. The fcd-output "fcd" must be a valid file name of an fcd-output.

    +The following may be a matter of changes:
    +- the engine torque is not given
    +
    fcd2fzp(inpFCD, outSTRM, further)
    Reformats the contents of the given fcd-output file into a .fzp file, readable
    +by PHEM. The fcd-output "fcd" must be a valid file name of an fcd-output.

    +The "sIDm" parameter must be a map from SUMO-edge ids to their numerical
    +representation as generated by toSTR(inpNET, outSTRM).
    +Returns two maps, the first from vehicle ids to a numerical representation,
    +the second from vehicle type ids to a numerical representation.
    +
    net2str(net, outSTRM)
    Writes the network object given as "inpNET" as a .str file readable by PHEM.
    +Returns a map from the SUMO-road id to the generated numerical id used by PHEM.

    +The following may be a matter of changes:
    +- currently, only the positions of the start and the end nodes are written,
    +  the geometry of the edge as defined in the SUMO-network is not exported.
    +  A map between the edge id and a segment to a numerical id would be necessary
    +
    vehicleTypes2flt(outSTRM, vtIDm)
    Currently, rather a stub than an implementation. Writes the vehicle ids stored
    +in the given "vtIDm" map formatted as a .flt file readable by PHEM.

    +The following may be a matter of changes:
    +- A default map is assigned to all vehicle types with the same probability
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.poi.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.poi.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.poi.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.poi.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,32 @@ + + +Python: module sumolib.output.convert.poi + + + + + +
     
    + 
    sumolib.output.convert.poi
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/poi.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +pois (useful for showing synthetic GPS disturtbances)

    +

    + + + + + +
     
    +Functions
           
    fcd2poi(inpFCD, outSTRM, ignored)
    +

    + + + + + +
     
    +Data
           LAYER = 100
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.shawn.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.shawn.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.convert.shawn.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.convert.shawn.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,41 @@ + + +Python: module sumolib.output.convert.shawn + + + + + +
     
    + 
    sumolib.output.convert.shawn
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/convert/shawn.py
    +

    This module includes functions for converting SUMO's fcd-output into
    +data files read by Shawn.

    +

    + + + + + +
     
    +Modules
           
    datetime
    +
    sumolib
    +

    + + + + + +
     
    +Functions
           
    fcd2shawn(inpFCD, outSTRM, further)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.dump.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.dump.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.dump.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.dump.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,211 @@ + + +Python: module sumolib.output.dump + + + + + +
     
    + 
    sumolib.output.dump
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/dump.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    collections
    +
    xml.sax.handler
    +

    + + + + + +
     
    +Classes
           
    +
    xml.sax.handler.ContentHandler +
    +
    +
    DumpReader +
    +
    +
    +

    + + + + + +
     
    +class DumpReader(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self, attrsToCollect, edgesToCollect=None)
    + +
    get(self, what)
    + +
    getIntervalStarts(self)
    + +
    join(self, what, how)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElement(self, name)
    Signals the end of an element in non-namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElement event.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    readDump(file, attrsToCollect, edgesToCollect=None)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,364 @@ + + +Python: package sumolib.output + + + + + +
     
    + 
    sumolib.output
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    convert (package)
    +
    dump
    +
    inductionloop
    +

    + + + + + +
     
    +Classes
           
    +
    xml.sax.handler.ContentHandler +
    +
    +
    AbstractHandler__asList +
    AbstractHandler__byID +
    +
    +
    +

    + + + + + +
     
    +class AbstractHandler__asList(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self, element_name, attributes)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElement(self, name)
    Signals the end of an element in non-namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElement event.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +class AbstractHandler__byID(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self, element_name, idAttr, attributes)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElement(self, name)
    Signals the end of an element in non-namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElement event.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    iskeyword = __contains__(...)
    x.__contains__(y) <==> y in x.
    +
    parse_sax(xmlfile, handler)
    +
    parse_sax__asList(xmlfile, element_name, attrnames)
    +
    parse_sax__byID(xmlfile, element_name, idAttr, attrnames)
    +
    prune(fv, minV, maxV)
    +
    reduce(...)
    reduce(function, sequence[, initial]) -> value

    +Apply a function of two arguments cumulatively to the items of a sequence,
    +from left to right, so as to reduce the sequence to a single value.
    +For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    +((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    +of the sequence in the calculation, and serves as a default when the
    +sequence is empty.
    +
    toList(mapList, attr)
    +

    + + + + + +
     
    +Data
           DEFAULT_ATTR_CONVERSIONS = {'angle': <type 'float'>, 'contPos': <type 'float'>, 'endOffset': <type 'float'>, 'endPos': <type 'float'>, 'freq': <type 'float'>, 'fromLane': <type 'int'>, 'index': <type 'int'>, 'lat': <type 'float'>, 'length': <type 'float'>, 'linkIndex': <type 'int'>, ...}
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.inductionloop.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.inductionloop.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.output.inductionloop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.output.inductionloop.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,208 @@ + + +Python: module sumolib.output.inductionloop + + + + + +
     
    + 
    sumolib.output.inductionloop
    index
    /home/delphi/gcc/sumo/tools/sumolib/output/inductionloop.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    xml.sax.handler
    +

    + + + + + +
     
    +Classes
           
    +
    xml.sax.handler.ContentHandler +
    +
    +
    InductLoopReader +
    +
    +
    +

    + + + + + +
     
    +class InductLoopReader(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self, toCollect)
    + +
    get(self, what)
    + +
    join(self, what, how)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElement(self, name)
    Signals the end of an element in non-namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElement event.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    readInductLoop(file, toCollect)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.route.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.route.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.route.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.route.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,51 @@ + + +Python: module sumolib.route + + + + + +
     
    + 
    sumolib.route
    index
    /home/delphi/gcc/sumo/tools/sumolib/route.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2009-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    os
    +
    sys
    +

    + + + + + +
     
    +Functions
           
    mapTrace(trace, net, delta, verbose=False, airDistFactor=2, fillGaps=False, gapPenalty=-1, debug=False)
    matching a list of 2D positions to consecutive edges in a network.
    +The positions are assumed to be dense (i.e. covering each edge of the route) and in the correct order.
    +

    + + + + + +
     
    +Data
           SUMO_HOME = '/home/delphi/gcc/sumo'
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.sensors.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.sensors.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.sensors.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.sensors.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,40 @@ + + +Python: package sumolib.sensors + + + + + +
     
    + 
    sumolib.sensors
    index
    /home/delphi/gcc/sumo/tools/sumolib/sensors/__init__.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    inductive_loop
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.sensors.inductive_loop.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.sensors.inductive_loop.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.sensors.inductive_loop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.sensors.inductive_loop.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,205 @@ + + +Python: module sumolib.sensors.inductive_loop + + + + + +
     
    + 
    sumolib.sensors.inductive_loop
    index
    /home/delphi/gcc/sumo/tools/sumolib/sensors/inductive_loop.py
    +

    Library for reading and storing Inductive Loop detector representations and
    + measurements.

    +

    + + + + + +
     
    +Modules
           
    xml.sax.handler
    +

    + + + + + +
     
    +Classes
           
    +
    InductiveLoop +
    xml.sax.handler.ContentHandler +
    +
    +
    InductiveLoopReader +
    +
    +
    +

    + + + + + +
     
    +class InductiveLoop
        Methods defined here:
    +
    __init__(self, id, lane, pos, frequency=60, file='NUL', friendlyPos=True)
    + +
    toXML(self)
    + +

    + + + + + +
     
    +class InductiveLoopReader(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self)
    + +
    endElement(self, name)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    read(filename)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,41 @@ + + +Python: package sumolib.shapes + + + + + +
     
    + 
    sumolib.shapes
    index
    /home/delphi/gcc/sumo/tools/sumolib/shapes/__init__.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    poi
    +
    polygon
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.poi.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.poi.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.poi.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.poi.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,215 @@ + + +Python: module sumolib.shapes.poi + + + + + +
     
    + 
    sumolib.shapes.poi
    index
    /home/delphi/gcc/sumo/tools/sumolib/shapes/poi.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    sumolib.color
    +
    xml.sax.handler
    +

    + + + + + +
     
    +Classes
           
    +
    PoI +
    xml.sax.handler.ContentHandler +
    +
    +
    PoIReader +
    +
    +
    +

    + + + + + +
     
    +class PoI
        Methods defined here:
    +
    __init__(self, id, type, layer, color, x, y, lane=None, pos=None, lonLat=False)
    interpret x,y as lon,lat if lonLat is True
    + +
    toXML(self)
    + +

    + + + + + +
     
    +class PoIReader(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self)
    + +
    endElement(self, name)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    read(filename)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.polygon.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.polygon.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.shapes.polygon.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.shapes.polygon.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,226 @@ + + +Python: module sumolib.shapes.polygon + + + + + +
     
    + 
    sumolib.shapes.polygon
    index
    /home/delphi/gcc/sumo/tools/sumolib/shapes/polygon.py
    +

    # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    sumolib.color
    +
    xml.sax.handler
    +

    + + + + + +
     
    +Classes
           
    +
    Polygon +
    xml.sax.handler.ContentHandler +
    +
    +
    PolygonReader +
    +
    +
    +

    + + + + + +
     
    +class Polygon
        Methods defined here:
    +
    __init__(self, id, type=None, color=None, layer=None, fill=None, shape=None)
    + +
    __lt__(self, other)
    + +
    __repr__(self)
    + +
    getBoundingBox(self)
    + +
    getShapeString(self)
    + +
    toXML(self)
    + +

    + + + + + +
     
    +class PolygonReader(xml.sax.handler.ContentHandler)
        Methods defined here:
    +
    __init__(self, includeTaz=False)
    + +
    endElement(self, name)
    + +
    getPolygons(self)
    + +
    startElement(self, name, attrs)
    + +
    +Methods inherited from xml.sax.handler.ContentHandler:
    +
    characters(self, content)
    Receive notification of character data.

    +The Parser will call this method to report each chunk of
    +character data. SAX parsers may return all contiguous
    +character data in a single chunk, or they may split it into
    +several chunks; however, all of the characters in any single
    +event must come from the same external entity so that the
    +Locator provides useful information.
    + +
    endDocument(self)
    Receive notification of the end of a document.

    +The SAX parser will invoke this method only once, and it will
    +be the last method invoked during the parse. The parser shall
    +not invoke this method until it has either abandoned parsing
    +(because of an unrecoverable error) or reached the end of
    +input.
    + +
    endElementNS(self, name, qname)
    Signals the end of an element in namespace mode.

    +The name parameter contains the name of the element type, just
    +as with the startElementNS event.
    + +
    endPrefixMapping(self, prefix)
    End the scope of a prefix-URI mapping.

    +See startPrefixMapping for details. This event will always
    +occur after the corresponding endElement event, but the order
    +of endPrefixMapping events is not otherwise guaranteed.
    + +
    ignorableWhitespace(self, whitespace)
    Receive notification of ignorable whitespace in element content.

    +Validating Parsers must use this method to report each chunk
    +of ignorable whitespace (see the W3C XML 1.0 recommendation,
    +section 2.10): non-validating parsers may also use this method
    +if they are capable of parsing and using content models.

    +SAX parsers may return all contiguous whitespace in a single
    +chunk, or they may split it into several chunks; however, all
    +of the characters in any single event must come from the same
    +external entity, so that the Locator provides useful
    +information.
    + +
    processingInstruction(self, target, data)
    Receive notification of a processing instruction.

    +The Parser will invoke this method once for each processing
    +instruction found: note that processing instructions may occur
    +before or after the main document element.

    +A SAX parser should never report an XML declaration (XML 1.0,
    +section 2.8) or a text declaration (XML 1.0, section 4.3.1)
    +using this method.
    + +
    setDocumentLocator(self, locator)
    Called by the parser to give the application a locator for
    +locating the origin of document events.

    +SAX parsers are strongly encouraged (though not absolutely
    +required) to supply a locator: if it does so, it must supply
    +the locator to the application by invoking this method before
    +invoking any of the other methods in the DocumentHandler
    +interface.

    +The locator allows the application to determine the end
    +position of any document-related event, even if the parser is
    +not reporting an error. Typically, the application will use
    +this information for reporting its own errors (such as
    +character content that does not match an application's
    +business rules). The information returned by the locator is
    +probably not sufficient for use with a search engine.

    +Note that the locator will return correct information only
    +during the invocation of the events in this interface. The
    +application should not attempt to use it at any other time.
    + +
    skippedEntity(self, name)
    Receive notification of a skipped entity.

    +The Parser will invoke this method once for each entity
    +skipped. Non-validating processors may skip entities if they
    +have not seen the declarations (because, for example, the
    +entity was declared in an external DTD subset). All processors
    +may skip external entities, depending on the values of the
    +http://xml.org/sax/features/external-general-entities and the
    +http://xml.org/sax/features/external-parameter-entities
    +properties.
    + +
    startDocument(self)
    Receive notification of the beginning of a document.

    +The SAX parser will invoke this method only once, before any
    +other methods in this interface or in DTDHandler (except for
    +setDocumentLocator).
    + +
    startElementNS(self, name, qname, attrs)
    Signals the start of an element in namespace mode.

    +The name parameter contains the name of the element type as a
    +(uri, localname) tuple, the qname parameter the raw XML 1.0
    +name used in the source document, and the attrs parameter
    +holds an instance of the Attributes class containing the
    +attributes of the element.

    +The uri part of the name tuple is None for elements which have
    +no namespace.
    + +
    startPrefixMapping(self, prefix, uri)
    Begin the scope of a prefix-URI Namespace mapping.

    +The information from this event is not necessary for normal
    +Namespace processing: the SAX XML reader will automatically
    +replace prefixes for element and attribute names when the
    +http://xml.org/sax/features/namespaces feature is true (the
    +default).

    +There are cases, however, when applications need to use
    +prefixes in character data or in attribute values, where they
    +cannot safely be expanded automatically; the
    +start/endPrefixMapping event supplies the information to the
    +application to expand prefixes in those contexts itself, if
    +necessary.

    +Note that start/endPrefixMapping events are not guaranteed to
    +be properly nested relative to each-other: all
    +startPrefixMapping events will occur before the corresponding
    +startElement event, and all endPrefixMapping events will occur
    +after the corresponding endElement event, but their order is
    +not guaranteed.
    + +

    + + + + + +
     
    +Functions
           
    getBoundingBox(shape)
    +
    read(filename, includeTaz=False)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.version.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.version.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.version.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.version.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,46 @@ + + +Python: module sumolib.version + + + + + +
     
    + 
    sumolib.version
    index
    /home/delphi/gcc/sumo/tools/sumolib/version.py
    +

    This script rebuilds "../../src/version.h", the file which
    + lets the applications know the version of their build.
    +It does this by parsing the SVN revision either from .svn/entries or .svn/wc.db (depending on svn
    +version of the working copy).
    +If the version file is newer than the svn file or the revision cannot be
    +determined any exisitng vershion.h is kept

    +

    + + + + + +
     
    +Modules
           
    subprocess
    +

    + + + + + +
     
    +Functions
           
    gitDescribe(commit='HEAD', gitDir='/home/delphi/gcc/sumo/tools/sumolib/../../.git', padZero=True)
    +

    + + + + + +
     
    +Data
           GITDIR = '/home/delphi/gcc/sumo/tools/sumolib/../../.git'
    +UNKNOWN_REVISION = 'UNKNOWN'
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/sumolib.xml.html sumo-1.6.0+dfsg1/docs/pydoc/sumolib.xml.html --- sumo-1.5.0+dfsg1/docs/pydoc/sumolib.xml.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/sumolib.xml.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,106 @@ + + +Python: module sumolib.xml + + + + + +
     
    + 
    sumolib.xml
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    xml.etree.cElementTree
    +datetime
    +gzip
    +
    io
    +os
    +re
    +
    sys
    +sumolib.version
    +xml
    +

    + + + + + +
     
    +Functions
           
    average(elements, attrname)
    +
    compound_object(element_name, attrnames, warn=False)
    return a class which delegates bracket access to an internal dict.
    +Missing attributes are delegated to the child dict for convenience.
    +@note: Care must be taken when child nodes and attributes have the same names
    +
    create_document(root_element_name, attrs=None, schema=None)
    +
    iskeyword = __contains__(...)
    x.__contains__(y) <==> y in x.
    +
    parse(xmlfile, element_names, element_attrs={}, attr_conversions={}, heterogeneous=False, warn=False)
    Parses the given element_names from xmlfile and yield compound objects for
    +their xml subtrees (no extra objects are returned if element_names appear in
    +the subtree) The compound objects provide all element attributes of
    +the root of the subtree as attributes unless attr_names are supplied. In this
    +case attr_names maps element names to a list of attributes which are
    +supplied. If attr_conversions is not empty it must map attribute names to
    +callables which will be called upon the attribute value before storing under
    +the attribute name.
    +The compound objects gives dictionary style access to list of compound
    +objects o for any children with the given element name
    +o['child_element_name'] = [osub0, osub1, ...]
    +As a shorthand, attribute style access to the list of child elements is
    +provided unless an attribute with the same name as the child elements
    +exists (i.e. o.child_element_name = [osub0, osub1, ...])
    +@Note: All elements with the same name must have the same type regardless of
    +the subtree in which they occur (heterogeneous cases may be handled by
    +setting heterogeneous=True (with reduced parsing speed)
    +@Note: Attribute names may be modified to avoid name clashes
    +with python keywords. (set warn=True to receive renaming warnings)
    +@Note: The element_names may be either a single string or a list of strings.
    +@Example: parse('plain.edg.xml', ['edge'])
    +
    parse_fast(xmlfile, element_name, attrnames, warn=False, optional=False, encoding='utf8')
    Parses the given attrnames from all elements with element_name
    +@Note: The element must be on its own line and the attributes must appear in
    +the given order.
    +@Example: parse_fast('plain.edg.xml', 'edge', ['id', 'speed'])
    +
    parse_fast_nested(xmlfile, element_name, attrnames, element_name2, attrnames2, warn=False, optional=False, encoding='utf8')
    Parses the given attrnames from all elements with element_name
    +And attrnames2 from element_name2 where element_name2 is a child element of element_name
    +@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']):
    +
    quoteattr(val)
    +
    reduce(...)
    reduce(function, sequence[, initial]) -> value

    +Apply a function of two arguments cumulatively to the items of a sequence,
    +from left to right, so as to reduce the sequence to a single value.
    +For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    +((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    +of the sequence in the calculation, and serves as a default when the
    +sequence is empty.
    +
    str_possibly_unicode(val)
    +
    sum(elements, attrname)
    +
    writeHeader(outf, script=None, root=None, schemaPath=None)
    +

    + + + + + +
     
    +Data
           DEFAULT_ATTR_CONVERSIONS = {'angle': <type 'float'>, 'contPos': <type 'float'>, 'endOffset': <type 'float'>, 'endPos': <type 'float'>, 'freq': <type 'float'>, 'fromLane': <type 'int'>, 'index': <type 'int'>, 'lat': <type 'float'>, 'length': <type 'float'>, 'linkIndex': <type 'int'>, ...}
    +absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._calibrator.html sumo-1.6.0+dfsg1/docs/pydoc/traci._calibrator.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._calibrator.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._calibrator.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,161 @@ + + +Python: module traci._calibrator + + + + + +
     
    + 
    traci._calibrator
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    CalibratorDomain +
    +
    +
    +

    + + + + + +
     
    +class CalibratorDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getBegin(self, calibratorID)
    getBegin(string) -> double
    +Returns the begin time of the current calibration interval
    + +
    getEdgeID(self, calibratorID)
    getEdgeID(string) -> string
    +Returns the edge of this calibrator
    + +
    getEnd(self, calibratorID)
    getEnd(string) -> double
    +Returns the end time of the current calibration interval
    + +
    getInserted(self, calibratorID)
    getInserted(string) -> double
    +Returns the number of inserted vehicles in the current calibration interval
    + +
    getLaneID(self, calibratorID)
    getLaneID(string) -> string
    +Returns the lane of this calibrator (if it applies to a single lane)
    + +
    getPassed(self, calibratorID)
    getPassed(string) -> double
    +Returns the number of passed vehicles in the current calibration interval
    + +
    getRemoved(self, calibratorID)
    getRemoved(string) -> double
    +Returns the number of removed vehicles in the current calibration interval
    + +
    getRouteID(self, calibratorID)
    getRouteID(string) -> string
    +Returns the route id for the current calibration interval
    + +
    getRouteProbeID(self, calibratorID)
    getRouteProbeID(string) -> string
    +Returns the routeProbe id for this calibrator
    + +
    getSpeed(self, calibratorID)
    getSpeed(string) -> double
    +Returns the target speed of the current calibration interval
    + +
    getTypeID(self, calibratorID)
    getTypeID(string) -> string
    +Returns the type id for the current calibration interval
    + +
    getVTypes(self, calibratorID)
    getVTypes(string) -> list(string)

    +Returns a list of all types to which the calibrator applies (in a type filter is active)
    + +
    getVehsPerHour(self, calibratorID)
    getVehsPerHour(string) -> double
    +Returns the number of vehicles per hour in the current calibration interval
    + +
    setFlow(self, calibratorID, begin, end, vehsPerHour, speed, typeID, routeID, departLane='first', departSpeed='max')
    setFlow(string, double, double, double, double, string, string, string, string) -> None
    +Update or add a calibrator interval
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.connection.html sumo-1.6.0+dfsg1/docs/pydoc/traci.connection.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.connection.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.connection.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,144 @@ + + +Python: module traci.connection + + + + + +
     
    + 
    traci.connection
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    abc
    +socket
    +
    struct
    +sys
    +
    traci.constants
    +warnings
    +

    + + + + + +
     
    +Classes
           
    +
    __builtin__.object +
    +
    +
    StepListener +
    +
    +
    Connection +
    +

    + + + + + + + +
     
    +class Connection
       Contains the socket, the composed message string
    +together with a list of TraCI commands which are inside.
     
     Methods defined here:
    +
    __init__(self, host, port, process)
    + +
    addStepListener(self, listener)
    addStepListener(traci.StepListener) -> int

    +Append the step listener (its step function is called at the end of every call to traci.simulationStep())
    +Returns the ID assigned to the listener if it was added successfully, None otherwise.
    + +
    close(self, wait=True)
    + +
    getVersion(self)
    + +
    load(self, args)
    Load a simulation from the given arguments.
    + +
    removeStepListener(self, listenerID)
    removeStepListener(traci.StepListener) -> bool

    +Remove the step listener from traci's step listener container.
    +Returns True if the listener was removed successfully, False if it wasn't registered.
    + +
    setOrder(self, order)
    + +
    simulationStep(self, step=0.0)
    Make a simulation step and simulate up to the given second in sim time.
    +If the given value is 0 or absent, exactly one step is performed.
    +Values smaller than or equal to the current sim time result in no action.
    + +

    + + + + + +
     
    +class StepListener(__builtin__.object)
        Methods defined here:
    +
    cleanUp(self)
    cleanUp() -> None

    +This method is called at removal of the stepListener, allowing to schedule some final actions
    + +
    getID(self)
    + +
    setID(self, ID)
    + +
    step(self, t=0)
    step(int) -> bool

    +After adding a StepListener 'listener' with traci.addStepListener(listener),
    +TraCI will call listener.step(t) after each call to traci.simulationStep(t)
    +The return value indicates whether the stepListener wants to stay active.
    + +
    +Data descriptors defined here:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    +Data and other attributes defined here:
    +
    __abstractmethods__ = frozenset(['step'])
    + +
    __metaclass__ = <class 'abc.ABCMeta'>
    Metaclass for defining Abstract Base Classes (ABCs).

    +Use this metaclass to create an ABC.  An ABC can be subclassed
    +directly, and then acts as a mix-in class.  You can also register
    +unrelated concrete classes (even built-in classes) and unrelated
    +ABCs as 'virtual subclasses' -- these and their descendants will
    +be considered subclasses of the registering ABC by the built-in
    +issubclass() function, but the registering ABC won't show up in
    +their MRO (Method Resolution Order) nor will method
    +implementations defined by the registering ABC be callable (not
    +even via super()).
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.constants.html sumo-1.6.0+dfsg1/docs/pydoc/traci.constants.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.constants.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.constants.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,499 @@ + + +Python: module traci.constants + + + + + +
     
    + 
    traci.constants
    index
    /home/delphi/gcc/sumo/tools/traci/constants.py
    +

    This script contains TraCI constant definitions from <SUMO_HOME>/src/libsumo/TraCIConstants.h.

    +

    + + + + + +
     
    +Data
           ADD = 128
    +ADD_FULL = 133
    +APPEND_STAGE = 196
    +ARRIVALFLAG_LANE_CURRENT = -2
    +ARRIVALFLAG_POS_MAX = -3
    +ARRIVALFLAG_POS_RANDOM = -2
    +ARRIVALFLAG_SPEED_CURRENT = -2
    +AUTOMATIC_CONTEXT_SUBSCRIPTION = 3
    +AUTOMATIC_VARIABLES_SUBSCRIPTION = 2
    +CMD_ADD_SUBSCRIPTION_FILTER = 126
    +CMD_CHANGELANE = 19
    +CMD_CHANGESUBLANE = 21
    +CMD_CHANGETARGET = 49
    +CMD_CLEAR_PENDING_VEHICLES = 148
    +CMD_CLOSE = 127
    +CMD_GETVERSION = 0
    +CMD_GET_BUSSTOP_VARIABLE = 175
    +CMD_GET_CALIBRATOR_VARIABLE = 39
    +CMD_GET_CHARGINGSTATION_VARIABLE = 37
    +CMD_GET_EDGE_VARIABLE = 170
    +CMD_GET_GUI_VARIABLE = 172
    +CMD_GET_INDUCTIONLOOP_VARIABLE = 160
    +CMD_GET_JUNCTION_VARIABLE = 169
    +CMD_GET_LANEAREA_VARIABLE = 173
    +CMD_GET_LANE_VARIABLE = 163
    +CMD_GET_MEANDATA_VARIABLE = 42
    +CMD_GET_MULTIENTRYEXIT_VARIABLE = 161
    +CMD_GET_OVERHEADWIRE_VARIABLE = 43
    +CMD_GET_PARKINGAREA_VARIABLE = 36
    +CMD_GET_PERSON_VARIABLE = 174
    +CMD_GET_POI_VARIABLE = 167
    +CMD_GET_POLYGON_VARIABLE = 168
    +CMD_GET_REROUTER_VARIABLE = 40
    +CMD_GET_ROUTEPROBE_VARIABLE = 38
    +CMD_GET_ROUTE_VARIABLE = 166
    +CMD_GET_SIM_VARIABLE = 171
    +CMD_GET_TL_VARIABLE = 162
    +CMD_GET_VARIABLESPEEDSIGN_VARIABLE = 41
    +CMD_GET_VEHICLETYPE_VARIABLE = 165
    +CMD_GET_VEHICLE_VARIABLE = 164
    +CMD_LOAD = 1
    +CMD_MESSAGE = 101
    +CMD_OPENGAP = 22
    +CMD_REROUTE_EFFORT = 145
    +CMD_REROUTE_TO_PARKING = 194
    +CMD_REROUTE_TRAVELTIME = 144
    +CMD_RESUME = 25
    +CMD_SAVE_SIMSTATE = 149
    +CMD_SETORDER = 3
    +CMD_SET_BUSSTOP_VARIABLE = 207
    +CMD_SET_CALIBRATOR_VARIABLE = 71
    +CMD_SET_CHARGINGSTATION_VARIABLE = 69
    +CMD_SET_EDGE_VARIABLE = 202
    +CMD_SET_FLOW = 24
    +CMD_SET_GUI_VARIABLE = 204
    +CMD_SET_JUNCTION_VARIABLE = 201
    +CMD_SET_LANE_VARIABLE = 195
    +CMD_SET_OVERHEADWIRE_VARIABLE = 75
    +CMD_SET_PARKINGAREA_VARIABLE = 68
    +CMD_SET_PERSON_VARIABLE = 206
    +CMD_SET_POI_VARIABLE = 199
    +CMD_SET_POLYGON_VARIABLE = 200
    +CMD_SET_REROUTER_VARIABLE = 72
    +CMD_SET_ROUTEPROBE_VARIABLE = 70
    +CMD_SET_ROUTE_VARIABLE = 198
    +CMD_SET_SIM_VARIABLE = 203
    +CMD_SET_TL_VARIABLE = 194
    +CMD_SET_VARIABLESPEEDSIGN_VARIABLE = 73
    +CMD_SET_VEHICLETYPE_VARIABLE = 197
    +CMD_SET_VEHICLE_VARIABLE = 196
    +CMD_SIMSTEP = 2
    +CMD_SLOWDOWN = 20
    +CMD_STOP = 18
    +CMD_SUBSCRIBE_BUSSTOP_CONTEXT = 143
    +CMD_SUBSCRIBE_BUSSTOP_VARIABLE = 223
    +CMD_SUBSCRIBE_CALIBRATOR_CONTEXT = 7
    +CMD_SUBSCRIBE_CALIBRATOR_VARIABLE = 87
    +CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 5
    +CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 85
    +CMD_SUBSCRIBE_EDGE_CONTEXT = 138
    +CMD_SUBSCRIBE_EDGE_VARIABLE = 218
    +CMD_SUBSCRIBE_GUI_CONTEXT = 140
    +CMD_SUBSCRIBE_GUI_VARIABLE = 220
    +CMD_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = 128
    +CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 208
    +CMD_SUBSCRIBE_JUNCTION_CONTEXT = 137
    +CMD_SUBSCRIBE_JUNCTION_VARIABLE = 217
    +CMD_SUBSCRIBE_LANEAREA_CONTEXT = 141
    +CMD_SUBSCRIBE_LANEAREA_VARIABLE = 221
    +CMD_SUBSCRIBE_LANE_CONTEXT = 131
    +CMD_SUBSCRIBE_LANE_VARIABLE = 211
    +CMD_SUBSCRIBE_MEANDATA_CONTEXT = 10
    +CMD_SUBSCRIBE_MEANDATA_VARIABLE = 90
    +CMD_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT = 129
    +CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE = 209
    +CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 11
    +CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 91
    +CMD_SUBSCRIBE_PARKINGAREA_CONTEXT = 4
    +CMD_SUBSCRIBE_PARKINGAREA_VARIABLE = 84
    +CMD_SUBSCRIBE_PERSON_CONTEXT = 142
    +CMD_SUBSCRIBE_PERSON_VARIABLE = 222
    +CMD_SUBSCRIBE_POI_CONTEXT = 135
    +CMD_SUBSCRIBE_POI_VARIABLE = 215
    +CMD_SUBSCRIBE_POLYGON_CONTEXT = 136
    +CMD_SUBSCRIBE_POLYGON_VARIABLE = 216
    +CMD_SUBSCRIBE_REROUTER_CONTEXT = 8
    +CMD_SUBSCRIBE_REROUTER_VARIABLE = 88
    +CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT = 6
    +CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE = 86
    +CMD_SUBSCRIBE_ROUTE_CONTEXT = 134
    +CMD_SUBSCRIBE_ROUTE_VARIABLE = 214
    +CMD_SUBSCRIBE_SIM_CONTEXT = 139
    +CMD_SUBSCRIBE_SIM_VARIABLE = 219
    +CMD_SUBSCRIBE_TL_CONTEXT = 130
    +CMD_SUBSCRIBE_TL_VARIABLE = 210
    +CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 9
    +CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 89
    +CMD_SUBSCRIBE_VEHICLETYPE_CONTEXT = 133
    +CMD_SUBSCRIBE_VEHICLETYPE_VARIABLE = 213
    +CMD_SUBSCRIBE_VEHICLE_CONTEXT = 132
    +CMD_SUBSCRIBE_VEHICLE_VARIABLE = 212
    +COPY = 136
    +DEPARTFLAG_CONTAINER_TRIGGERED = -2
    +DEPARTFLAG_LANE_ALLOWED_FREE = -4
    +DEPARTFLAG_LANE_BEST_FREE = -5
    +DEPARTFLAG_LANE_FIRST_ALLOWED = -6
    +DEPARTFLAG_LANE_FREE = -3
    +DEPARTFLAG_LANE_RANDOM = -2
    +DEPARTFLAG_NOW = -3
    +DEPARTFLAG_POS_BASE = -4
    +DEPARTFLAG_POS_FREE = -3
    +DEPARTFLAG_POS_LAST = -5
    +DEPARTFLAG_POS_RANDOM = -2
    +DEPARTFLAG_POS_RANDOM_FREE = -6
    +DEPARTFLAG_SPEED_MAX = -3
    +DEPARTFLAG_SPEED_RANDOM = -2
    +DEPARTFLAG_TRIGGERED = -1
    +DISTANCE_REQUEST = 131
    +FILTER_TYPE_DOWNSTREAM_DIST = 3
    +FILTER_TYPE_FIELD_OF_VISION = 10
    +FILTER_TYPE_LANES = 1
    +FILTER_TYPE_LATERAL_DIST = 11
    +FILTER_TYPE_LEAD_FOLLOW = 5
    +FILTER_TYPE_NONE = 0
    +FILTER_TYPE_NOOPPOSITE = 2
    +FILTER_TYPE_TURN = 7
    +FILTER_TYPE_UPSTREAM_DIST = 4
    +FILTER_TYPE_VCLASS = 8
    +FILTER_TYPE_VTYPE = 9
    +FIND_INTERMODAL_ROUTE = 135
    +FIND_ROUTE = 134
    +GENERIC_ATTRIBUTE = 3
    +ID_COUNT = 1
    +INVALID_DOUBLE_VALUE = -1073741824.0
    +INVALID_INT_VALUE = -1073741824
    +JAM_LENGTH_METERS = 25
    +JAM_LENGTH_VEHICLE = 24
    +LANE_ALLOWED = 52
    +LANE_DISALLOWED = 53
    +LANE_EDGE_ID = 49
    +LANE_LINKS = 51
    +LANE_LINK_NUMBER = 48
    +LAST_STEP_LENGTH = 21
    +LAST_STEP_MEAN_SPEED = 17
    +LAST_STEP_OCCUPANCY = 19
    +LAST_STEP_PERSON_ID_LIST = 26
    +LAST_STEP_TIME_SINCE_DETECTION = 22
    +LAST_STEP_VEHICLE_DATA = 23
    +LAST_STEP_VEHICLE_HALTING_NUMBER = 20
    +LAST_STEP_VEHICLE_ID_LIST = 18
    +LAST_STEP_VEHICLE_NUMBER = 16
    +LCA_AMBACKBLOCKER = 67108864
    +LCA_AMBACKBLOCKER_STANDING = 134217728
    +LCA_AMBLOCKINGFOLLOWER = 131072
    +LCA_AMBLOCKINGFOLLOWER_DONTBRAKE = 2097152
    +LCA_AMBLOCKINGLEADER = 65536
    +LCA_BLOCKED = 268459520
    +LCA_BLOCKED_BY_FOLLOWER = 5120
    +LCA_BLOCKED_BY_LEADER = 2560
    +LCA_BLOCKED_BY_LEFT_FOLLOWER = 1024
    +LCA_BLOCKED_BY_LEFT_LEADER = 512
    +LCA_BLOCKED_BY_RIGHT_FOLLOWER = 4096
    +LCA_BLOCKED_BY_RIGHT_LEADER = 2048
    +LCA_BLOCKED_LEFT = 1536
    +LCA_BLOCKED_RIGHT = 6144
    +LCA_CHANGE_REASONS = 33016
    +LCA_CHANGE_TO_HELP = 8388608
    +LCA_COOPERATIVE = 16
    +LCA_INSUFFICIENT_SPACE = 16384
    +LCA_INSUFFICIENT_SPEED = 268435456
    +LCA_KEEPRIGHT = 64
    +LCA_LEFT = 2
    +LCA_MLEFT = 524288
    +LCA_MRIGHT = 262144
    +LCA_NONE = 0
    +LCA_OVERLAPPING = 8192
    +LCA_RIGHT = 4
    +LCA_SPEEDGAIN = 32
    +LCA_STAY = 1
    +LCA_STRATEGIC = 8
    +LCA_SUBLANE = 32768
    +LCA_TRACI = 128
    +LCA_UNKNOWN = 1073741824
    +LCA_URGENT = 256
    +LCA_WANTS_LANECHANGE = 6
    +LCA_WANTS_LANECHANGE_OR_STAY = 7
    +MAX_ORDER = 1073741824
    +MOVE_TO_XY = 180
    +POSITION_2D = 1
    +POSITION_3D = 3
    +POSITION_CONVERSION = 130
    +POSITION_LON_LAT = 0
    +POSITION_LON_LAT_ALT = 2
    +POSITION_ROADMAP = 4
    +REMOVE = 129
    +REMOVE_ARRIVED = 2
    +REMOVE_PARKING = 1
    +REMOVE_STAGE = 197
    +REMOVE_TELEPORT = 0
    +REMOVE_TELEPORT_ARRIVED = 4
    +REMOVE_VAPORIZED = 3
    +REPLACE_STAGE = 205
    +REQUEST_AIRDIST = 0
    +REQUEST_DRIVINGDIST = 1
    +RESPONSE_GET_BUSSTOP_VARIABLE = 191
    +RESPONSE_GET_CALIBRATOR_VARIABLE = 55
    +RESPONSE_GET_CHARGINGSTATION_VARIABLE = 53
    +RESPONSE_GET_EDGE_VARIABLE = 186
    +RESPONSE_GET_GUI_VARIABLE = 188
    +RESPONSE_GET_INDUCTIONLOOP_VARIABLE = 176
    +RESPONSE_GET_JUNCTION_VARIABLE = 185
    +RESPONSE_GET_LANEAREA_VARIABLE = 189
    +RESPONSE_GET_LANE_VARIABLE = 179
    +RESPONSE_GET_MEANDATA_VARIABLE = 58
    +RESPONSE_GET_MULTIENTRYEXIT_VARIABLE = 177
    +RESPONSE_GET_OVERHEADWIRE_VARIABLE = 59
    +RESPONSE_GET_PARKINGAREA_VARIABLE = 52
    +RESPONSE_GET_PERSON_VARIABLE = 190
    +RESPONSE_GET_POI_VARIABLE = 183
    +RESPONSE_GET_POLYGON_VARIABLE = 184
    +RESPONSE_GET_REROUTER_VARIABLE = 56
    +RESPONSE_GET_ROUTEPROBE_VARIABLE = 54
    +RESPONSE_GET_ROUTE_VARIABLE = 182
    +RESPONSE_GET_SIM_VARIABLE = 187
    +RESPONSE_GET_TL_VARIABLE = 178
    +RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE = 57
    +RESPONSE_GET_VEHICLETYPE_VARIABLE = 181
    +RESPONSE_GET_VEHICLE_VARIABLE = 180
    +RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT = 159
    +RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE = 239
    +RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT = 23
    +RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE = 103
    +RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 21
    +RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 101
    +RESPONSE_SUBSCRIBE_EDGE_CONTEXT = 154
    +RESPONSE_SUBSCRIBE_EDGE_VARIABLE = 234
    +RESPONSE_SUBSCRIBE_GUI_CONTEXT = 156
    +RESPONSE_SUBSCRIBE_GUI_VARIABLE = 236
    +RESPONSE_SUBSCRIBE_INDUCTIONLOOP_CONTEXT = 144
    +RESPONSE_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 224
    +RESPONSE_SUBSCRIBE_JUNCTION_CONTEXT = 153
    +RESPONSE_SUBSCRIBE_JUNCTION_VARIABLE = 233
    +RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT = 157
    +RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE = 237
    +RESPONSE_SUBSCRIBE_LANE_CONTEXT = 147
    +RESPONSE_SUBSCRIBE_LANE_VARIABLE = 227
    +RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT = 26
    +RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE = 106
    +RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_CONTEXT = 145
    +RESPONSE_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE = 225
    +RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 27
    +RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 107
    +RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT = 20
    +RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE = 100
    +RESPONSE_SUBSCRIBE_PERSON_CONTEXT = 158
    +RESPONSE_SUBSCRIBE_PERSON_VARIABLE = 238
    +RESPONSE_SUBSCRIBE_POI_CONTEXT = 151
    +RESPONSE_SUBSCRIBE_POI_VARIABLE = 231
    +RESPONSE_SUBSCRIBE_POLYGON_CONTEXT = 152
    +RESPONSE_SUBSCRIBE_POLYGON_VARIABLE = 232
    +RESPONSE_SUBSCRIBE_REROUTER_CONTEXT = 24
    +RESPONSE_SUBSCRIBE_REROUTER_VARIABLE = 104
    +RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT = 22
    +RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE = 102
    +RESPONSE_SUBSCRIBE_ROUTE_CONTEXT = 150
    +RESPONSE_SUBSCRIBE_ROUTE_VARIABLE = 230
    +RESPONSE_SUBSCRIBE_SIM_CONTEXT = 155
    +RESPONSE_SUBSCRIBE_SIM_VARIABLE = 235
    +RESPONSE_SUBSCRIBE_TL_CONTEXT = 146
    +RESPONSE_SUBSCRIBE_TL_VARIABLE = 226
    +RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 25
    +RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 105
    +RESPONSE_SUBSCRIBE_VEHICLETYPE_CONTEXT = 149
    +RESPONSE_SUBSCRIBE_VEHICLETYPE_VARIABLE = 229
    +RESPONSE_SUBSCRIBE_VEHICLE_CONTEXT = 148
    +RESPONSE_SUBSCRIBE_VEHICLE_VARIABLE = 228
    +ROUTING_MODE_AGGREGATED = 1
    +ROUTING_MODE_COMBINED = 3
    +ROUTING_MODE_DEFAULT = 0
    +ROUTING_MODE_EFFORT = 2
    +RTYPE_ERR = 255
    +RTYPE_NOTIMPLEMENTED = 1
    +RTYPE_OK = 0
    +STAGE_ACCESS = 4
    +STAGE_DRIVING = 3
    +STAGE_TRANSHIP = 6
    +STAGE_TRIP = 5
    +STAGE_WAITING = 1
    +STAGE_WAITING_FOR_DEPART = 0
    +STAGE_WALKING = 2
    +STOP_BUS_STOP = 8
    +STOP_CHARGING_STATION = 32
    +STOP_CONTAINER_STOP = 16
    +STOP_CONTAINER_TRIGGERED = 4
    +STOP_DEFAULT = 0
    +STOP_PARKING = 1
    +STOP_PARKING_AREA = 64
    +STOP_TRIGGERED = 2
    +TL_COMPLETE_DEFINITION_RYG = 43
    +TL_COMPLETE_PROGRAM_RYG = 44
    +TL_CONTROLLED_JUNCTIONS = 42
    +TL_CONTROLLED_LANES = 38
    +TL_CONTROLLED_LINKS = 39
    +TL_CURRENT_PHASE = 40
    +TL_CURRENT_PROGRAM = 41
    +TL_EXTERNAL_STATE = 46
    +TL_NEXT_SWITCH = 45
    +TL_PHASE_DURATION = 36
    +TL_PHASE_INDEX = 34
    +TL_PROGRAM = 35
    +TL_RED_YELLOW_GREEN_STATE = 32
    +TRACI_ID_LIST = 0
    +TRACI_VERSION = 20
    +TYPE_BYTE = 8
    +TYPE_COLOR = 17
    +TYPE_COMPOUND = 15
    +TYPE_DOUBLE = 11
    +TYPE_DOUBLELIST = 16
    +TYPE_INTEGER = 9
    +TYPE_POLYGON = 6
    +TYPE_STRING = 12
    +TYPE_STRINGLIST = 14
    +TYPE_UBYTE = 7
    +VAR_ACCEL = 70
    +VAR_ACCELERATION = 114
    +VAR_ACCUMULATED_WAITING_TIME = 135
    +VAR_ACTIONSTEPLENGTH = 125
    +VAR_ADD_DYNAMICS = 92
    +VAR_ALLOWED_SPEED = 183
    +VAR_ANGLE = 67
    +VAR_APPARENT_DECEL = 124
    +VAR_ARRIVED_VEHICLES_IDS = 122
    +VAR_ARRIVED_VEHICLES_NUMBER = 121
    +VAR_BEGIN = 28
    +VAR_BEST_LANES = 178
    +VAR_BUS_STOP_ID_LIST = 159
    +VAR_BUS_STOP_WAITING = 103
    +VAR_BUS_STOP_WAITING_IDS = 239
    +VAR_CO2EMISSION = 96
    +VAR_COEMISSION = 97
    +VAR_COLLIDING_VEHICLES_IDS = 129
    +VAR_COLLIDING_VEHICLES_NUMBER = 128
    +VAR_COLOR = 69
    +VAR_CURRENT_TRAVELTIME = 90
    +VAR_DECEL = 71
    +VAR_DELTA_T = 123
    +VAR_DEPARTED_VEHICLES_IDS = 116
    +VAR_DEPARTED_VEHICLES_NUMBER = 115
    +VAR_DISTANCE = 132
    +VAR_EDGES = 84
    +VAR_EDGE_EFFORT = 89
    +VAR_EDGE_TRAVELTIME = 88
    +VAR_ELECTRICITYCONSUMPTION = 113
    +VAR_EMERGENCYSTOPPING_VEHICLES_IDS = 138
    +VAR_EMERGENCYSTOPPING_VEHICLES_NUMBER = 137
    +VAR_EMERGENCY_DECEL = 123
    +VAR_EMISSIONCLASS = 74
    +VAR_END = 29
    +VAR_FILL = 85
    +VAR_FOES = 55
    +VAR_FOLLOW_SPEED = 28
    +VAR_FUELCONSUMPTION = 101
    +VAR_HAS_VIEW = 167
    +VAR_HCEMISSION = 98
    +VAR_HEIGHT = 188
    +VAR_HIGHLIGHT = 108
    +VAR_IMAGEFILE = 147
    +VAR_IMPERFECTION = 93
    +VAR_INSERTED = 21
    +VAR_LANECHANGE_MODE = 182
    +VAR_LANEPOSITION = 86
    +VAR_LANEPOSITION_LAT = 184
    +VAR_LANE_ID = 81
    +VAR_LANE_INDEX = 82
    +VAR_LASTACTIONTIME = 127
    +VAR_LATALIGNMENT = 185
    +VAR_LEADER = 104
    +VAR_LENGTH = 68
    +VAR_LINE = 189
    +VAR_LOADED_VEHICLES_IDS = 114
    +VAR_LOADED_VEHICLES_NUMBER = 113
    +VAR_MAXSPEED = 65
    +VAR_MAXSPEED_LAT = 186
    +VAR_MINGAP = 76
    +VAR_MINGAP_LAT = 187
    +VAR_MIN_EXPECTED_VEHICLES = 125
    +VAR_MOVE_TO = 92
    +VAR_NAME = 27
    +VAR_NEIGHBORS = 191
    +VAR_NET_BOUNDING_BOX = 124
    +VAR_NEXT_EDGE = 193
    +VAR_NEXT_STOPS = 115
    +VAR_NEXT_TLS = 112
    +VAR_NOISEEMISSION = 102
    +VAR_NOXEMISSION = 100
    +VAR_PARAMETER = 126
    +VAR_PARKING_ENDING_VEHICLES_IDS = 111
    +VAR_PARKING_ENDING_VEHICLES_NUMBER = 110
    +VAR_PARKING_MANEUVERING_VEHICLES_IDS = 59
    +VAR_PARKING_MANEUVERING_VEHICLES_NUMBER = 58
    +VAR_PARKING_STARTING_VEHICLES_IDS = 109
    +VAR_PARKING_STARTING_VEHICLES_NUMBER = 108
    +VAR_PASSED = 20
    +VAR_PERSON_CAPACITY = 56
    +VAR_PERSON_NUMBER = 103
    +VAR_PMXEMISSION = 99
    +VAR_POSITION = 66
    +VAR_POSITION3D = 57
    +VAR_REMOVED = 22
    +VAR_ROAD_ID = 80
    +VAR_ROUTE = 87
    +VAR_ROUTE_ID = 83
    +VAR_ROUTE_INDEX = 105
    +VAR_ROUTE_PROBE = 23
    +VAR_ROUTE_VALID = 146
    +VAR_ROUTING_MODE = 137
    +VAR_SCREENSHOT = 165
    +VAR_SECURE_GAP = 30
    +VAR_SHAPE = 78
    +VAR_SHAPECLASS = 75
    +VAR_SIGNALS = 91
    +VAR_SLOPE = 54
    +VAR_SPEED = 64
    +VAR_SPEEDSETMODE = 179
    +VAR_SPEED_DEVIATION = 95
    +VAR_SPEED_FACTOR = 94
    +VAR_SPEED_LAT = 50
    +VAR_SPEED_WITHOUT_TRACI = 177
    +VAR_STAGE = 192
    +VAR_STAGES_REMAINING = 194
    +VAR_STOPSTATE = 181
    +VAR_STOP_DELAY = 31
    +VAR_STOP_ENDING_VEHICLES_IDS = 107
    +VAR_STOP_ENDING_VEHICLES_NUMBER = 106
    +VAR_STOP_SPEED = 29
    +VAR_STOP_STARTING_VEHICLES_IDS = 105
    +VAR_STOP_STARTING_VEHICLES_NUMBER = 104
    +VAR_TAU = 72
    +VAR_TELEPORT_ENDING_VEHICLES_IDS = 120
    +VAR_TELEPORT_ENDING_VEHICLES_NUMBER = 119
    +VAR_TELEPORT_STARTING_VEHICLES_IDS = 118
    +VAR_TELEPORT_STARTING_VEHICLES_NUMBER = 117
    +VAR_TIME = 102
    +VAR_TIME_STEP = 112
    +VAR_TRACK_VEHICLE = 166
    +VAR_TYPE = 79
    +VAR_UPDATE_BESTLANES = 106
    +VAR_VEHICLE = 195
    +VAR_VEHICLECLASS = 73
    +VAR_VEHSPERHOUR = 19
    +VAR_VIA = 190
    +VAR_VIEW_BOUNDARY = 163
    +VAR_VIEW_OFFSET = 161
    +VAR_VIEW_SCHEMA = 162
    +VAR_VIEW_ZOOM = 160
    +VAR_VTYPES = 30
    +VAR_WAITING_TIME = 122
    +VAR_WIDTH = 77
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.domain.html sumo-1.6.0+dfsg1/docs/pydoc/traci.domain.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.domain.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.domain.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,137 @@ + + +Python: module traci.domain + + + + + +
     
    + 
    traci.domain
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    copy
    +
    struct
    +
    traci.constants
    +
    warnings
    +

    + + + + + +
     
    +Classes
           
    +
    Domain +
    SubscriptionResults +
    +

    + + + + + +
     
    +class Domain
        Methods defined here:
    +
    __init__(self, name, cmdGetID, cmdSetID, subscribeID, subscribeResponseID, contextID, contextResponseID, retValFunc, deprecatedFor=None)
    + +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +class SubscriptionResults
        Methods defined here:
    +
    __init__(self, valueFunc)
    + +
    __repr__(self)
    + +
    add(self, refID, varID, data)
    + +
    addContext(self, refID, domain, objID, varID=None, data=None)
    + +
    get(self, refID=None)
    + +
    getContext(self, refID=None)
    + +
    reset(self)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._edge.html sumo-1.6.0+dfsg1/docs/pydoc/traci._edge.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._edge.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._edge.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,223 @@ + + +Python: module traci._edge + + + + + +
     
    + 
    traci._edge
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    EdgeDomain +
    +
    +
    +

    + + + + + +
     
    +class EdgeDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    adaptTraveltime(self, edgeID, time, begin=None, end=None)
    adaptTraveltime(string, double, double, double) -> None

    +Adapt the travel time value (in s) used for (re-)routing for the given edge.

    +When setting begin time and end time (in seconds), the changes only
    +apply to that time range. Otherwise they apply all the time
    + +
    getAdaptedTraveltime(self, edgeID, time)
    getAdaptedTraveltime(string, double) -> double

    +Returns the travel time value (in s) used for (re-)routing
    +which is valid on the edge at the given time.
    + +
    getCO2Emission(self, edgeID)
    getCO2Emission(string) -> double

    +Returns the CO2 emission in mg for the last time step on the given edge.
    + +
    getCOEmission(self, edgeID)
    getCOEmission(string) -> double

    +Returns the CO emission in mg for the last time step on the given edge.
    + +
    getEffort(self, edgeID, time)
    getEffort(string, double) -> double

    +Returns the effort value used for (re-)routing
    +which is valid on the edge at the given time.
    + +
    getElectricityConsumption(self, edgeID)
    getElectricityConsumption(string) -> double

    +Returns the electricity consumption in ml for the last time step.
    + +
    getFuelConsumption(self, edgeID)
    getFuelConsumption(string) -> double

    +Returns the fuel consumption in ml for the last time step on the given edge.
    + +
    getHCEmission(self, edgeID)
    getHCEmission(string) -> double

    +Returns the HC emission in mg for the last time step on the given edge.
    + +
    getLaneNumber(self, edgeID)
    getLaneNumber(string) -> int

    +Returns the number of lanes of this edge
    + +
    getLastStepHaltingNumber(self, edgeID)
    getLastStepHaltingNumber(string) -> integer

    +Returns the total number of halting vehicles for the last time step on the given edge.
    +A speed of less than 0.1 m/s is considered a halt.
    + +
    getLastStepLength(self, edgeID)
    getLastStepLength(string) -> double

    +Returns the mean vehicle length in m for the last time step on the given edge.
    + +
    getLastStepMeanSpeed(self, edgeID)
    getLastStepMeanSpeed(string) -> double

    +Returns the average speed in m/s for the last time step on the given edge.
    + +
    getLastStepOccupancy(self, edgeID)
    getLastStepOccupancy(string) -> double

    +Returns the net occupancy (excluding inter-vehicle gaps) in % for the last time step on the given edge.
    + +
    getLastStepPersonIDs(self, edgeID)
    getLastStepPersonIDs(string) -> list(string)

    +Returns the ids of the persons on the given edge during the last time step.
    + +
    getLastStepVehicleIDs(self, edgeID)
    getLastStepVehicleIDs(string) -> list(string)

    +Returns the ids of the vehicles for the last time step on the given edge.
    + +
    getLastStepVehicleNumber(self, edgeID)
    getLastStepVehicleNumber(string) -> integer

    +Returns the total number of vehicles for the last time step on the given edge.
    + +
    getNOxEmission(self, edgeID)
    getNOxEmission(string) -> double

    +Returns the NOx emission in mg for the last time step on the given edge.
    + +
    getNoiseEmission(self, edgeID)
    getNoiseEmission(string) -> double

    +Returns the noise emission in db for the last time step on the given edge.
    + +
    getPMxEmission(self, edgeID)
    getPMxEmission(string) -> double

    +Returns the particular matter emission in mg for the last time step on the given edge.
    + +
    getStreetName(self, edgeID)
    getStreetName(string) -> string

    +Returns the street name of this edge
    + +
    getTraveltime(self, edgeID)
    getTraveltime(string) -> double

    +Returns the estimated travel time in s for the last time step on the given edge.
    + +
    getWaitingTime(self, edgeID)
    getWaitingTime() -> double
    +Returns the sum of the waiting time of all vehicles currently on
    +that edge (see traci.vehicle.getWaitingTime).
    + +
    setEffort(self, edgeID, effort, begin=None, end=None)
    setEffort(string, double, double, double) -> None

    +Adapt the effort value used for (re-)routing for the given edge.

    +When setting begin time and end time (in seconds), the changes only
    +apply to that time range. Otherwise they apply all the time.
    + +
    setMaxSpeed(self, edgeID, speed)
    setMaxSpeed(string, double) -> None

    +Set a new maximum speed (in m/s) for all lanes of the edge.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.exceptions.html sumo-1.6.0+dfsg1/docs/pydoc/traci.exceptions.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.exceptions.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.exceptions.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,174 @@ + + +Python: module traci.exceptions + + + + + +
     
    + 
    traci.exceptions
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Classes
           
    +
    exceptions.Exception(exceptions.BaseException) +
    +
    +
    FatalTraCIError +
    TraCIException +
    +
    +
    +

    + + + + + + + +
     
    +class FatalTraCIError(exceptions.Exception)
       Exception class for all TraCI errors which do not allow for continuation
     
     
    Method resolution order:
    +
    FatalTraCIError
    +
    exceptions.Exception
    +
    exceptions.BaseException
    +
    __builtin__.object
    +
    +
    +Methods defined here:
    +
    __init__(self, desc)
    + +
    +Data descriptors defined here:
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    +Data and other attributes inherited from exceptions.Exception:
    +
    __new__ = <built-in method __new__ of type object>
    T.__new__(S, ...) -> a new object with type S, a subtype of T
    + +
    +Methods inherited from exceptions.BaseException:
    +
    __delattr__(...)
    x.__delattr__('name') <==> del x.name
    + +
    __getattribute__(...)
    x.__getattribute__('name') <==> x.name
    + +
    __getitem__(...)
    x.__getitem__(y) <==> x[y]
    + +
    __getslice__(...)
    x.__getslice__(i, j) <==> x[i:j]

    +Use of negative indices is not supported.
    + +
    __reduce__(...)
    + +
    __repr__(...)
    x.__repr__() <==> repr(x)
    + +
    __setattr__(...)
    x.__setattr__('name', value) <==> x.name = value
    + +
    __setstate__(...)
    + +
    __str__(...)
    x.__str__() <==> str(x)
    + +
    __unicode__(...)
    + +
    +Data descriptors inherited from exceptions.BaseException:
    +
    __dict__
    +
    +
    args
    +
    +
    message
    +
    +

    + + + + + + + +
     
    +class TraCIException(exceptions.Exception)
       Exception class for all TraCI errors which keep the connection intact
     
     
    Method resolution order:
    +
    TraCIException
    +
    exceptions.Exception
    +
    exceptions.BaseException
    +
    __builtin__.object
    +
    +
    +Methods defined here:
    +
    __init__(self, desc, command=None, errorType=None)
    + +
    getCommand(self)
    + +
    getType(self)
    + +
    +Data descriptors defined here:
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +
    +Data and other attributes inherited from exceptions.Exception:
    +
    __new__ = <built-in method __new__ of type object>
    T.__new__(S, ...) -> a new object with type S, a subtype of T
    + +
    +Methods inherited from exceptions.BaseException:
    +
    __delattr__(...)
    x.__delattr__('name') <==> del x.name
    + +
    __getattribute__(...)
    x.__getattribute__('name') <==> x.name
    + +
    __getitem__(...)
    x.__getitem__(y) <==> x[y]
    + +
    __getslice__(...)
    x.__getslice__(i, j) <==> x[i:j]

    +Use of negative indices is not supported.
    + +
    __reduce__(...)
    + +
    __repr__(...)
    x.__repr__() <==> repr(x)
    + +
    __setattr__(...)
    x.__setattr__('name', value) <==> x.name = value
    + +
    __setstate__(...)
    + +
    __str__(...)
    x.__str__() <==> str(x)
    + +
    __unicode__(...)
    + +
    +Data descriptors inherited from exceptions.BaseException:
    +
    __dict__
    +
    +
    args
    +
    +
    message
    +
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._gui.html sumo-1.6.0+dfsg1/docs/pydoc/traci._gui.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._gui.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._gui.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,175 @@ + + +Python: module traci._gui + + + + + +
     
    + 
    traci._gui
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    GuiDomain +
    +
    +
    +

    + + + + + +
     
    +class GuiDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getBoundary(self, viewID='View #0')
    getBoundary(string): -> ((double, double), (double, double))

    +Returns the coordinates of the lower left and the upper right corner of the currently visible view.
    + +
    getOffset(self, viewID='View #0')
    getOffset(string): -> (double, double)

    +Returns the x and y offset of the center of the current view.
    + +
    getSchema(self, viewID='View #0')
    getSchema(string): -> string

    +Returns the name of the current coloring scheme.
    + +
    getTrackedVehicle(self, viewID='View #0')
    getTrackedVehicle(string): -> string

    +Returns the id of the currently tracked vehicle
    + +
    getZoom(self, viewID='View #0')
    getZoom(string): -> double

    +Returns the current zoom factor.
    + +
    hasView(self, viewID='View #0')
    hasView(string): -> bool

    +Check whether the given view exists.
    + +
    screenshot(self, viewID, filename, width=-1, height=-1)
    screenshot(string, string, int, int) -> None

    +Save a screenshot for the given view to the given filename.
    +The fileformat is guessed from the extension, the available
    +formats differ from platform to platform but should at least
    +include ps, svg and pdf, on linux probably gif, png and jpg as well.
    +Width and height of the image can be given as optional parameters.
    + +
    setBoundary(self, viewID, xmin, ymin, xmax, ymax)
    setBoundary(string, double, double, double, double) -> None
    +Sets the boundary of the visible network. If the window has a different
    +aspect ratio than the given boundary, the view is expanded along one
    +axis to meet the window aspect ratio and contain the given boundary.
    + +
    setOffset(self, viewID, x, y)
    setOffset(string, double, double) -> None

    +Set the current offset for the given view.
    + +
    setSchema(self, viewID, schemeName)
    setSchema(string, string) -> None

    +Set the current coloring scheme for the given view.
    + +
    setZoom(self, viewID, zoom)
    setZoom(string, double) -> None

    +Set the current zoom factor for the given view.
    + +
    trackVehicle(self, viewID, vehID)
    trackVehicle(string, string) -> None

    +Start visually tracking the given vehicle on the given view.
    + +
    +Data and other attributes defined here:
    +
    DEFAULT_VIEW = 'View #0'
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.html sumo-1.6.0+dfsg1/docs/pydoc/traci.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,82 @@ + + +Python: package traci + + + + + +
     
    + 
    traci
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Package Contents
           
    _calibrator
    +_edge
    +_gui
    +_inductionloop
    +_junction
    +_lane
    +_lanearea
    +
    _multientryexit
    +_person
    +_poi
    +_polygon
    +_route
    +_simulation
    +_trafficlight
    +
    _vehicle
    +_vehicletype
    +check_constants
    +connection
    +constants
    +domain
    +exceptions
    +
    main
    +rebuildConstants
    +storage
    +traciToHex
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +calibrator = <traci._calibrator.CalibratorDomain instance>
    +edge = <traci._edge.EdgeDomain instance>
    +gui = <traci._gui.GuiDomain instance>
    +inductionloop = <traci._inductionloop.InductionLoopDomain instance>
    +junction = <traci._junction.JunctionDomain instance>
    +lane = <traci._lane.LaneDomain instance>
    +lanearea = <traci._lanearea.LaneAreaDomain instance>
    +multientryexit = <traci._multientryexit.MultiEntryExitDomain instance>
    +person = <traci._person.PersonDomain instance>
    +poi = <traci._poi.PoiDomain instance>
    +polygon = <traci._polygon.PolygonDomain instance>
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    +route = <traci._route.RouteDomain instance>
    +simulation = <traci._simulation.SimulationDomain instance>
    +trafficlight = <traci._trafficlight.TrafficLightDomain instance>
    +vehicle = <traci._vehicle.VehicleDomain instance>
    +vehicletype = <traci._vehicletype.VehicleTypeDomain instance>
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._inductionloop.html sumo-1.6.0+dfsg1/docs/pydoc/traci._inductionloop.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._inductionloop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._inductionloop.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,161 @@ + + +Python: module traci._inductionloop + + + + + +
     
    + 
    traci._inductionloop
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    InductionLoopDomain +
    +
    +
    +

    + + + + + +
     
    +class InductionLoopDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getLaneID(self, loopID)
    getLaneID(string) -> string

    +Returns the id of the lane the loop is on.
    + +
    getLastStepMeanLength(self, loopID)
    getLastStepMeanLength(string) -> double

    +Returns the mean length in m of vehicles which were on the detector in the last step.
    + +
    getLastStepMeanSpeed(self, loopID)
    getLastStepMeanSpeed(string) -> double

    +Returns the mean speed in m/s of vehicles that were on the named induction loop within the last simulation step.
    + +
    getLastStepOccupancy(self, loopID)
    getLastStepOccupancy(string) -> double

    +Returns the percentage of time the detector was occupied by a vehicle.
    + +
    getLastStepVehicleIDs(self, loopID)
    getLastStepVehicleIDs(string) -> list(string)

    +Returns the list of ids of vehicles that were on the named induction loop in the last simulation step.
    + +
    getLastStepVehicleNumber(self, loopID)
    getLastStepVehicleNumber(string) -> integer

    +Returns the number of vehicles that were on the named induction loop within the last simulation step.
    + +
    getPosition(self, loopID)
    getPosition(string) -> double

    +Returns the position measured from the beginning of the lane in meters.
    + +
    getTimeSinceDetection(self, loopID)
    getTimeSinceDetection(string) -> double

    +Returns the time in s since last detection.
    + +
    getVehicleData(self, loopID)
    getVehicleData(string) -> [(veh_id, veh_length, entry_time, exit_time, vType), ...]

    +Returns a complex structure containing several information about vehicles which passed the detector.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Functions
           
    readVehicleData(result)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._junction.html sumo-1.6.0+dfsg1/docs/pydoc/traci._junction.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._junction.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._junction.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,125 @@ + + +Python: module traci._junction + + + + + +
     
    + 
    traci._junction
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    JunctionDomain +
    +
    +
    +

    + + + + + +
     
    +class JunctionDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getPosition(self, junctionID)
    getPosition(string) -> (double, double)

    +Returns the coordinates of the center of the junction.
    + +
    getShape(self, junctionID)
    getShape(string) -> list((double, double))

    +List of 2D positions (cartesian) describing the geometry.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._lanearea.html sumo-1.6.0+dfsg1/docs/pydoc/traci._lanearea.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._lanearea.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._lanearea.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,157 @@ + + +Python: module traci._lanearea + + + + + +
     
    + 
    traci._lanearea
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    LaneAreaDomain +
    +
    +
    +

    + + + + + +
     
    +class LaneAreaDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self, name='lanearea', deprecatedFor=None)
    + +
    getJamLengthMeters(self, detID)
    getJamLengthMeters(string) -> double

    +Returns the jam length in meters within the last simulation step.
    + +
    getJamLengthVehicle(self, detID)
    getJamLengthVehicle(string) -> integer

    +Returns the jam length in vehicles within the last simulation step.
    + +
    getLaneID(self, detID)
    getLaneID(string) -> string

    +Returns the id of the lane the detector is on.
    + +
    getLastStepHaltingNumber(self, detID)
    getLastStepHaltingNumber(string) -> integer

    +Returns the number of vehicles which were halting during the last time step.
    + +
    getLastStepMeanSpeed(self, detID)
    getLastStepMeanSpeed(string) -> double

    +Returns the current mean speed in m/s of vehicles that were on the named e2.
    + +
    getLastStepOccupancy(self, detID)
    getLastStepMeanSpeed(string) -> double

    +Returns the percentage of space the detector was occupied by a vehicle [%]
    + +
    getLastStepVehicleIDs(self, detID)
    getLastStepVehicleIDs(string) -> list(string)

    +Returns the list of ids of vehicles that were on the named detector in the last simulation step.
    + +
    getLastStepVehicleNumber(self, detID)
    getLastStepVehicleNumber(string) -> integer

    +Returns the number of vehicles that were on the named detector within the last simulation step.
    + +
    getLength(self, detID)
    getLength(string) -> double

    +Returns the length of the detector
    + +
    getPosition(self, detID)
    getPosition(string) -> double

    +Returns the starting position of the detector measured from the beginning of the lane in meters.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._lane.html sumo-1.6.0+dfsg1/docs/pydoc/traci._lane.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._lane.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._lane.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,243 @@ + + +Python: module traci._lane + + + + + +
     
    + 
    traci._lane
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    LaneDomain +
    +
    +
    +

    + + + + + +
     
    +class LaneDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getAllowed(self, laneID)
    getAllowed(string) -> list(string)

    +Returns a list of allowed vehicle classes. An empty list means all vehicles are allowed.
    + +
    getCO2Emission(self, laneID)
    getCO2Emission(string) -> double

    +Returns the CO2 emission in mg for the last time step on the given lane.
    + +
    getCOEmission(self, laneID)
    getCOEmission(string) -> double

    +Returns the CO emission in mg for the last time step on the given lane.
    + +
    getDisallowed(self, laneID)
    getDisallowed(string) -> list(string)

    +Returns a list of disallowed vehicle classes.
    + +
    getEdgeID(self, laneID)
    getEdgeID(string) -> string

    +Returns the id of the edge the lane belongs to.
    + +
    getElectricityConsumption(self, laneID)
    getElectricityConsumption(string) -> double

    +Returns the electricity consumption in ml for the last time step.
    + +
    getFoes(self, laneID, toLaneID)
    getFoes(string, string) -> list(string)
    +Returns the ids of incoming lanes that have right of way over the connection from laneID to toLaneID
    + +
    getFuelConsumption(self, laneID)
    getFuelConsumption(string) -> double

    +Returns the fuel consumption in ml for the last time step on the given lane.
    + +
    getHCEmission(self, laneID)
    getHCEmission(string) -> double

    +Returns the HC emission in mg for the last time step on the given lane.
    + +
    getInternalFoes(self, laneID)
    getFoes(string) -> list(string)
    +Returns the ids of internal lanes that are in conflict with the given internal lane id
    + +
    getLastStepHaltingNumber(self, laneID)
    getLastStepHaltingNumber(string) -> integer

    +Returns the total number of halting vehicles for the last time step on the given lane.
    +A speed of less than 0.1 m/s is considered a halt.
    + +
    getLastStepLength(self, laneID)
    getLastStepLength(string) -> double

    +Returns the mean vehicle length in m for the last time step on the given lane.
    + +
    getLastStepMeanSpeed(self, laneID)
    getLastStepMeanSpeed(string) -> double

    +Returns the average speed in m/s for the last time step on the given lane.
    + +
    getLastStepOccupancy(self, laneID)
    getLastStepOccupancy(string) -> double

    +Returns the occupancy in % for the last time step on the given lane.
    + +
    getLastStepVehicleIDs(self, laneID)
    getLastStepVehicleIDs(string) -> list(string)

    +Returns the ids of the vehicles for the last time step on the given lane.
    + +
    getLastStepVehicleNumber(self, laneID)
    getLastStepVehicleNumber(string) -> integer

    +Returns the total number of vehicles for the last time step on the given lane.
    + +
    getLength(self, laneID)
    getLength(string) -> double

    +Returns the length in m.
    + +
    getLinkNumber(self, laneID)
    getLinkNumber(string) -> integer

    +Returns the number of connections to successive lanes.
    + +
    getLinks(self, laneID, extended=True)
    getLinks(string) -> list((string, bool, bool, bool))
    +A list containing id of successor lane together with priority, open and foe
    +for each link.
    +if extended=True, each result tuple contains
    +(string approachedLane, bool hasPrio, bool isOpen, bool hasFoe,
    +string approachedInternal, string state, string direction, float length)
    + +
    getMaxSpeed(self, laneID)
    getMaxSpeed(string) -> double

    +Returns the maximum allowed speed on the lane in m/s.
    + +
    getNOxEmission(self, laneID)
    getNOxEmission(string) -> double

    +Returns the NOx emission in mg for the last time step on the given lane.
    + +
    getNoiseEmission(self, laneID)
    getNoiseEmission(string) -> double

    +Returns the noise emission in db for the last time step on the given lane.
    + +
    getPMxEmission(self, laneID)
    getPMxEmission(string) -> double

    +Returns the particular matter emission in mg for the last time step on the given lane.
    + +
    getShape(self, laneID)
    getShape(string) -> list((double, double))

    +List of 2D positions (cartesian) describing the geometry.
    + +
    getTraveltime(self, laneID)
    getTraveltime(string) -> double

    +Returns the estimated travel time in s for the last time step on the given lane.
    + +
    getWaitingTime(self, laneID)
    getWaitingTime() -> double

    +.
    + +
    getWidth(self, laneID)
    getWidth(string) -> double

    +Returns the width of the lane in m.
    + +
    setAllowed(self, laneID, allowedClasses)
    setAllowed(string, list) -> None

    +Sets a list of allowed vehicle classes. Setting an empty list means all vehicles are allowed.
    + +
    setDisallowed(self, laneID, disallowedClasses)
    setDisallowed(string, list) -> None

    +Sets a list of disallowed vehicle classes.
    + +
    setLength(self, laneID, length)
    setLength(string, double) -> None

    +Sets the length of the lane in m.
    + +
    setMaxSpeed(self, laneID, speed)
    setMaxSpeed(string, double) -> None

    +Sets a new maximum allowed speed on the lane in m/s.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.main.html sumo-1.6.0+dfsg1/docs/pydoc/traci.main.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.main.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.main.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,122 @@ + + +Python: module traci.main + + + + + +
     
    + 
    traci.main
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci._calibrator
    +traci._edge
    +traci._gui
    +traci._inductionloop
    +traci._junction
    +traci._lane
    +
    traci._lanearea
    +traci._multientryexit
    +traci._person
    +traci._poi
    +traci._polygon
    +traci._route
    +
    traci._simulation
    +traci._trafficlight
    +traci._vehicle
    +traci._vehicletype
    +os
    +socket
    +
    subprocess
    +sumolib
    +sys
    +time
    +warnings
    +

    + + + + + +
     
    +Functions
           
    addStepListener(listener)
    addStepListener(traci.StepListener) -> int

    +Append the step listener (its step function is called at the end of every call to traci.simulationStep())
    +to the current connection.
    +Returns the ID assigned to the listener if it was added successfully, None otherwise.
    +
    close(wait=True)
    +
    connect(port=8813, numRetries=10, host='localhost', proc=None, waitBetweenRetries=1)
    Establish a connection to a TraCI-Server and return the
    +connection object. The connection is not saved in the pool and not
    +accessible via traci.switch. It should be safe to use different
    +connections established by this method in different threads.
    +
    getConnection(label='default')
    +
    getLabel()
    +
    getVersion()
    +
    hasGUI()
    +
    init(port=8813, numRetries=10, host='localhost', label='default', proc=None)
    Establish a connection to a TraCI-Server and store it under the given
    +label. This method is not thread-safe. It accesses the connection
    +pool concurrently.
    +
    isLibsumo()
    +
    load(args)
    load([optionOrParam, ...])
    +Let sumo load a simulation using the given command line like options
    +Example:
    +  load(['-c', 'run.sumocfg'])
    +  load(['-n', 'net.net.xml', '-r', 'routes.rou.xml'])
    +
    removeStepListener(listenerID)
    removeStepListener(traci.StepListener) -> bool

    +Remove the step listener from the current connection's step listener container.
    +Returns True if the listener was removed successfully, False if it wasn't registered.
    +
    setConnectHook(hookFunc)
    +
    setOrder(order)
    +
    simulationStep(step=0)
    Make a simulation step and simulate up to the given second in sim time.
    +If the given value is 0 or absent, exactly one step is performed.
    +Values smaller than or equal to the current sim time result in no action.
    +
    start(cmd, port=None, numRetries=10, label='default', verbose=False)
    Start a sumo server using cmd, establish a connection to it and
    +store it under the given label. This method is not thread-safe.
    +
    switch(label)
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +calibrator = <traci._calibrator.CalibratorDomain instance>
    +edge = <traci._edge.EdgeDomain instance>
    +gui = <traci._gui.GuiDomain instance>
    +inductionloop = <traci._inductionloop.InductionLoopDomain instance>
    +junction = <traci._junction.JunctionDomain instance>
    +lane = <traci._lane.LaneDomain instance>
    +lanearea = <traci._lanearea.LaneAreaDomain instance>
    +multientryexit = <traci._multientryexit.MultiEntryExitDomain instance>
    +person = <traci._person.PersonDomain instance>
    +poi = <traci._poi.PoiDomain instance>
    +polygon = <traci._polygon.PolygonDomain instance>
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    +route = <traci._route.RouteDomain instance>
    +simulation = <traci._simulation.SimulationDomain instance>
    +trafficlight = <traci._trafficlight.TrafficLightDomain instance>
    +vehicle = <traci._vehicle.VehicleDomain instance>
    +vehicletype = <traci._vehicletype.VehicleTypeDomain instance>
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._multientryexit.html sumo-1.6.0+dfsg1/docs/pydoc/traci._multientryexit.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._multientryexit.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._multientryexit.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,136 @@ + + +Python: module traci._multientryexit + + + + + +
     
    + 
    traci._multientryexit
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    MultiEntryExitDomain +
    +
    +
    +

    + + + + + +
     
    +class MultiEntryExitDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    getLastStepHaltingNumber(self, detID)
    getLastStepHaltingNumber(string) -> integer

    +Returns the number of vehicles which were halting during the last time step.
    + +
    getLastStepMeanSpeed(self, detID)
    getLastStepMeanSpeed(string) -> double

    +Returns the mean speed in m/s of vehicles that have been within the named multi-entry/multi-exit detector
    +within the last simulation step.
    + +
    getLastStepVehicleIDs(self, detID)
    getLastStepVehicleIDs(string) -> list(string)

    +Returns the list of ids of vehicles that have been within the named multi-entry/multi-exit detector in the
    +last simulation step.
    + +
    getLastStepVehicleNumber(self, detID)
    getLastStepVehicleNumber(string) -> integer

    +Returns the number of vehicles that have been within the named multi-entry/multi-exit detector within the
    +last simulation step.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._person.html sumo-1.6.0+dfsg1/docs/pydoc/traci._person.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._person.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._person.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,282 @@ + + +Python: module traci._person + + + + + +
     
    + 
    traci._person
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci._simulation
    +
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    PersonDomain +
    +
    +
    +

    + + + + + +
     
    +class PersonDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    add(self, personID, edgeID, pos, depart=-3, typeID='DEFAULT_PEDTYPE')
    add(string, string, double, double, string)
    +Inserts a new person to the simulation at the given edge, position and
    +time (in s). This function should be followed by appending Stages or the person
    +will immediately vanish on departure.
    + +
    appendDrivingStage(self, personID, toEdge, lines, stopID='')
    appendDrivingStage(string, string, string, string)
    +Appends a driving stage to the plan of the given person
    +The lines parameter should be a space-separated list of line ids
    + +
    appendStage(self, personID, stage)
    appendStage(string, stage)
    +Appends a stage object to the plan of the given person
    +Such an object is obtainable using getStage
    + +
    appendWaitingStage(self, personID, duration, description='waiting', stopID='')
    appendWaitingStage(string, float, string, string)
    +Appends a waiting stage with duration in s to the plan of the given person
    + +
    appendWalkingStage(self, personID, edges, arrivalPos, duration=-1, speed=-1, stopID='')
    appendWalkingStage(string, stringList, double, double, double, string)
    +Appends a walking stage to the plan of the given person
    +The walking speed can either be specified, computed from the duration parameter (in s) or taken from the
    +type of the person
    + +
    getAngle(self, personID)
    getAngle(string) -> double

    +Returns the angle in degrees of the named person within the last step.
    + +
    getColor(self, personID)
    getColor(string) -> (integer, integer, integer, integer)

    +Returns the person's rgba color.
    + +
    getEdges(self, personID, nextStageIndex=0)
    getEdges(string, int) -> list(string)

    +Returns a list of all edges in the nth next stage.
    +For waiting stages this is a single edge
    +For walking stages this is the complete route
    +For driving stages this is [origin, destination]

    +nextStageIndex 0 retrieves value for the current stage.
    +nextStageIndex must be lower then value of getRemainingStages(personID)
    + +
    getLanePosition(self, personID)
    getLanePosition(string) -> double

    +The position of the person along the lane measured in m.
    + +
    getLength(self, personID)
    getLength(string) -> double

    +Returns the length in m of the given person.
    + +
    getMinGap(self, personID)
    getMinGap(string) -> double

    +Returns the offset (gap to front person if halting) of this person.
    + +
    getNextEdge(self, personID)
    getNextEdge() -> string
    +If the person is walking, returns the next edge on the persons route
    +(including crossing and walkingareas). If there is no further edge or the
    +person is in another stage, returns the empty string.
    + +
    getPosition(self, personID)
    getPosition(string) -> (double, double)

    +Returns the position of the named person within the last step [m,m].
    + +
    getPosition3D(self, personID)
    getPosition(string) -> (double, double, double)

    +Returns the position of the named person within the last step [m,m,m].
    + +
    getRemainingStages(self, personID)
    getStage(string) -> int
    +Returns the number of remaining stages (at least 1)
    + +
    getRoadID(self, personID)
    getRoadID(string) -> string

    +Returns the id of the edge the named person was at within the last step.
    + +
    getSlope(self, personID)
    getSlope(string) -> double

    +Returns the slope at the current position of the person in degrees
    + +
    getSpeed(self, personID)
    getSpeed(string) -> double

    +Returns the speed in m/s of the named person within the last step.
    + +
    getStage(self, personID, nextStageIndex=0)
    getStage(string, int) -> int
    +Returns the type of the nth next stage
    +  0 for not-yet-departed
    +  1 for waiting
    +  2 for walking
    +  3 for driving
    +  4 for access to busStop or trainStop
    +  5 for personTrip
    +nextStageIndex 0 retrieves value for the current stage.
    +nextStageIndex must be lower then value of getRemainingStages(personID)
    + +
    getTypeID(self, personID)
    getTypeID(string) -> string

    +Returns the id of the type of the named person.
    + +
    getVehicle(self, personID)
    getVehicle(string) -> string
    +Returns the id of the current vehicle if the person is in stage driving
    +and has entered a vehicle.
    +Return the empty string otherwise
    + +
    getWaitingTime(self, personID)
    getWaitingTime() -> double
    +The waiting time of a person is defined as the time (in seconds) spent with a
    +speed below 0.1m/s since the last time it was faster than 0.1m/s.
    +(basically, the waiting time of a person is reset to 0 every time it moves).
    + +
    getWidth(self, personID)
    getWidth(string) -> double

    +Returns the width in m of this person.
    + +
    moveToXY(self, personID, edgeID, x, y, angle=-1073741824.0, keepRoute=1)
    Place person at the given x,y coordinates and force it's angle to
    +the given value (for drawing).
    +If the angle is set to INVALID_DOUBLE_VALUE, the vehicle assumes the
    +natural angle of the edge on which it is driving.
    +If keepRoute is set to 1, the closest position
    +within the existing route is taken. If keepRoute is set to 0, the vehicle may move to
    +any edge in the network but it's route then only consists of that edge.
    +If keepRoute is set to 2 the person has all the freedom of keepRoute=0
    +but in addition to that may even move outside the road network.
    +edgeID is an optional placement hint to resolve ambiguities
    + +
    removeStage(self, personID, nextStageIndex)
    removeStage(string, int)
    +Removes the nth next stage
    +nextStageIndex must be lower then value of getRemainingStages(personID)
    +nextStageIndex 0 immediately aborts the current stage and proceeds to the next stage
    + +
    removeStages(self, personID)
    remove(string)
    +Removes all stages of the person. If no new phases are appended,
    +the person will be removed from the simulation in the next simulationStep().
    + +
    replaceStage(self, personID, stageIndex, stage)
    replaceStage(string, int, stage)
    +Replaces the nth subsequent stage with the given stage object
    +Such an object is obtainable using getStage
    + +
    rerouteTraveltime(self, personID)
    rerouteTraveltime(string) -> None Reroutes a pedestrian (walking person).
    + +
    setColor(self, personID, color)
    setColor(string, (integer, integer, integer, integer))

    +Sets the color for the vehicle with the given ID, i.e. (255,0,0) for the color red.
    +The fourth component (alpha) is optional.
    + +
    setHeight(self, personID, height)
    setHeight(string, double) -> None

    +Sets the height in m for this person.
    + +
    setLength(self, personID, length)
    setLength(string, double) -> None

    +Sets the length in m for the given person.
    + +
    setMinGap(self, personID, minGap)
    setMinGap(string, double) -> None

    +Sets the offset (gap to front person if halting) for this vehicle.
    + +
    setSpeed(self, personID, speed)
    setSpeed(string, double) -> None

    +Sets the maximum speed in m/s for the named person for subsequent step.
    + +
    setType(self, personID, typeID)
    setType(string, string) -> None

    +Sets the id of the type for the named person.
    + +
    setWidth(self, personID, width)
    setWidth(string, double) -> None

    +Sets the width in m for this person.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._poi.html sumo-1.6.0+dfsg1/docs/pydoc/traci._poi.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._poi.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._poi.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,186 @@ + + +Python: module traci._poi + + + + + +
     
    + 
    traci._poi
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    PoiDomain +
    +
    +
    +

    + + + + + +
     
    +class PoiDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    add(self, poiID, x, y, color, poiType='', layer=0, imgFile='', width=1, height=1, angle=0)
    + +
    getAngle(self, poiID)
    getAngle(string) -> double

    +Returns the angle of the given poi.
    + +
    getColor(self, poiID)
    getColor(string) -> (integer, integer, integer, integer)

    +Returns the rgba color of the given poi.
    + +
    getHeight(self, poiID)
    getHeight(string) -> double

    +Returns the height of the given poi.
    + +
    getImageFile(self, poiID)
    getImageFile(string) -> string

    +Returns the image file of the given poi.
    + +
    getPosition(self, poiID)
    getPosition(string) -> (double, double)

    +Returns the position coordinates of the given poi.
    + +
    getType(self, poiID)
    getType(string) -> string

    +Returns the (abstract) type of the poi.
    + +
    getWidth(self, poiID)
    getWidth(string) -> double

    +Returns the width of the given poi.
    + +
    highlight(self, poiID, color=(255, 0, 0, 255), size=-1, alphaMax=-1, duration=-1, type=0)
    highlight(string, color, float, ubyte) -> void
    +Adds a circle of the given color highlighting the poi.
    +If a positive size [in m] is given the size of the highlight is chosen accordingly,
    +otherwise the image size of the poi is used as reference.
    +If alphaMax and duration are positive, the circle fades in and out within the given duration,
    +otherwise it is permanently added on top of the poi.
    + +
    remove(self, poiID, layer=0)
    + +
    setAngle(self, poiID, angle)
    setAngle(string, double) -> None

    +Sets the angle of the poi.
    + +
    setColor(self, poiID, color)
    setColor(string, (integer, integer, integer, integer)) -> None

    +Sets the rgba color of the poi, i.e. (255,0,0) for the color red.
    +The fourth component (alpha) is optional.
    + +
    setHeight(self, poiID, height)
    setHeight(string, double) -> None

    +Sets the height of the poi.
    + +
    setImageFile(self, poiID, imageFile)
    setImageFile(string, string) -> None

    +Sets the image file of the poi.
    + +
    setPosition(self, poiID, x, y)
    setPosition(string, (double, double)) -> None

    +Sets the position coordinates of the poi.
    + +
    setType(self, poiID, poiType)
    setType(string, string) -> None

    +Sets the (abstract) type of the poi.
    + +
    setWidth(self, poiID, width)
    setWidth(string, double) -> None

    +Sets the width of the poi.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._polygon.html sumo-1.6.0+dfsg1/docs/pydoc/traci._polygon.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._polygon.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._polygon.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,173 @@ + + +Python: module traci._polygon + + + + + +
     
    + 
    traci._polygon
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    PolygonDomain +
    +
    +
    +

    + + + + + +
     
    +class PolygonDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    add(self, polygonID, shape, color, fill=False, polygonType='', layer=0, lineWidth=1)
    + +
    addDynamics(self, polygonID, trackedObjectID='', timeSpan=(), alphaSpan=(), looped=False, rotate=True)
    addDynamics(string, string, list(float), list(float), bool) -> void
    +polygonID - ID of the polygon, upon which the specified dynamics shall act
    +trackedObjectID - ID of a SUMO traffic object, which shall be tracked by the polygon
    +timeSpan - list of time points for timing the animation keyframes (must start with element zero)
    +           If it has length zero, no animation is taken into account.
    +alphaSpan - list of alpha values to be attained at keyframes intermediate values are
    +            obtained by linear interpolation. Must have length equal to timeSpan, or zero
    +            if no alpha animation is desired.
    +looped - Whether the animation should restart when the last keyframe is reached. In that case
    +         the animation jumps to the first keyframe as soon as the last is reached.
    +         If looped==false, the controlled polygon is removed as soon as the timeSpan elapses.
    +rotate - Whether, the polygon should be rotated with the tracked object (only applies when such is given)
    +         The center of rotation is the object's position.
    + +
    getColor(self, polygonID)
    getColor(string) -> (integer, integer, integer, integer)

    +Returns the rgba color of this polygon.
    + +
    getFilled(self, polygonID)
    getFilled(string) -> bool
    +Returns whether the polygon is filled
    + +
    getLineWidth(self, polygonID)
    getLineWidth(string) -> double
    +Returns drawing width of unfilled polygon
    + +
    getShape(self, polygonID)
    getShape(string) -> list((double, double))

    +Returns the shape (list of 2D-positions) of this polygon.
    + +
    getType(self, polygonID)
    getType(string) -> string

    +Returns the (abstract) type of the polygon.
    + +
    remove(self, polygonID, layer=0)
    + +
    setColor(self, polygonID, color)
    setColor(string, (integer, integer, integer, integer)) -> None

    +Sets the rgba color of this polygon, i.e. (255,0,0) for the color red.
    +The fourth component (alpha) is optional.
    + +
    setFilled(self, polygonID, filled)
    setFilled(string, bool) -> None
    +Sets the filled status of the polygon
    + +
    setLineWidth(self, polygonID, lineWidth)
    setFilled(string, double) -> None
    +Sets the line width for drawing unfilled polygon
    + +
    setShape(self, polygonID, shape)
    setShape(string, list((double, double))) -> None

    +Sets the shape (list of 2D-positions) of this polygon.
    + +
    setType(self, polygonID, polygonType)
    setType(string, string) -> None

    +Sets the (abstract) type of the polygon.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._route.html sumo-1.6.0+dfsg1/docs/pydoc/traci._route.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._route.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._route.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,125 @@ + + +Python: module traci._route + + + + + +
     
    + 
    traci._route
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    RouteDomain +
    +
    +
    +

    + + + + + +
     
    +class RouteDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    add(self, routeID, edges)
    add(string, list(string)) -> None

    +Adds a new route with the given id consisting of the given list of edge IDs.
    + +
    getEdges(self, routeID)
    getEdges(string) -> list(string)

    +Returns a list of all edges in the route.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._simulation.html sumo-1.6.0+dfsg1/docs/pydoc/traci._simulation.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._simulation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._simulation.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,312 @@ + + +Python: module traci._simulation + + + + + +
     
    + 
    traci._simulation
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +
    warnings
    +

    + + + + + +
     
    +Classes
           
    +
    __builtin__.object +
    +
    +
    Stage +
    +
    +
    traci.domain.Domain +
    +
    +
    SimulationDomain +
    +
    +
    +

    + + + + + +
     
    +class SimulationDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    clearPending(self, routeID='')
    + +
    convert2D(self, edgeID, pos, laneIndex=0, toGeo=False)
    + +
    convert3D(self, edgeID, pos, laneIndex=0, toGeo=False)
    + +
    convertGeo(self, x, y, fromGeo=False)
    + +
    convertRoad(self, x, y, isGeo=False, vClass='ignoring')
    + +
    findIntermodalRoute(self, fromEdge, toEdge, modes='', depart=-1.0, routingMode=0, speed=-1.0, walkFactor=-1.0, departPos=0.0, arrivalPos=-1073741824.0, departPosLat=0.0, pType='', vType='', destStop='')
    + +
    findRoute(self, fromEdge, toEdge, vType='', depart=-1.0, routingMode=0)
    + +
    getArrivedIDList(self)
    getArrivedIDList() -> list(string)

    +Returns a list of ids of vehicles which arrived (have reached their destination and are removed from the road
    +network) in this time step.
    + +
    getArrivedNumber(self)
    getArrivedNumber() -> integer

    +Returns the number of vehicles which arrived (have reached their destination and are removed from the road
    +network) in this time step.
    + +
    getBusStopIDList(self)
    + +
    getBusStopWaiting(self, stopID)
    getBusStopWaiting() -> integer
    +Get the total number of waiting persons at the named bus stop.
    + +
    getBusStopWaitingIDList(self, stopID)
    getBusStopWaiting() -> integer
    +Get the IDs of waiting persons at the named bus stop.
    + +
    getCollidingVehiclesIDList(self)
    getCollidingVehiclesIDList() -> list(string)
    +Return Ids of vehicles involved in a collision (typically 2 per
    +collision).
    + +
    getCollidingVehiclesNumber(self)
    getCollidingVehiclesNumber() -> integer
    +Return number of vehicles involved in a collision (typically 2 per
    +collision).
    + +
    getCurrentTime(self)
    getCurrentTime() -> integer

    +Returns the current simulation time in ms.
    + +
    getDeltaT(self)
    getDeltaT() -> double
    +Returns the length of one simulation step in seconds
    + +
    getDepartedIDList(self)
    getDepartedIDList() -> list(string)

    +Returns a list of ids of vehicles which departed (were inserted into the road network) in this time step.
    + +
    getDepartedNumber(self)
    getDepartedNumber() -> integer

    +Returns the number of vehicles which departed (were inserted into the road network) in this time step.
    + +
    getDistance2D(self, x1, y1, x2, y2, isGeo=False, isDriving=False)
    getDistance2D(double, double, double, double, boolean, boolean) -> double

    +Returns the distance between the two coordinate pairs (x1,y1) and (x2,y2)

    +If isGeo=True, coordinates are interpreted as longitude and latitude rather
    +than cartesian coordinates in meters.

    +If isDriving=True, the coordinates are mapped onto the road network and the
    +length of the shortest route in the network is returned. Otherwise, the
    +straight-line distance is returned.
    + +
    getDistanceRoad(self, edgeID1, pos1, edgeID2, pos2, isDriving=False)
    getDistanceRoad(string, double, string, double, boolean) -> double

    +Reads two positions on the road network and an indicator whether the air or the driving distance shall be
    +computed. Returns the according distance.
    + +
    getEmergencyStoppingVehiclesIDList(self)
    getEmergencyStoppingVehiclesIDList() -> list(string)
    +Return Ids of vehicles that peformed an emergency stop in the last step
    + +
    getEmergencyStoppingVehiclesNumber(self)
    getEmergencyStoppingVehiclesNumber() -> integer
    +Return number of vehicles that performed an emergency stop in the last step
    + +
    getEndingTeleportIDList(self)
    getEndingTeleportIDList() -> list(string)

    +Returns a list of ids of vehicles which ended to be teleported in this time step.
    + +
    getEndingTeleportNumber(self)
    getEndingTeleportNumber() -> integer

    +Returns the number of vehicles which ended to be teleported in this time step.
    + +
    getLoadedIDList(self)
    getLoadedIDList() -> list(string)

    +Returns a list of ids of vehicles which were loaded in this time step.
    + +
    getLoadedNumber(self)
    getLoadedNumber() -> integer

    +Returns the number of vehicles which were loaded in this time step.
    + +
    getMinExpectedNumber(self)
    getMinExpectedNumber() -> integer

    +Returns the number of vehicles which are in the net plus the
    +ones still waiting to start. This number may be smaller than
    +the actual number of vehicles still to come because of delayed
    +route file parsing. If the number is 0 however, it is
    +guaranteed that all route files have been parsed completely
    +and all vehicles have left the network.
    + +
    getNetBoundary(self)
    getNetBoundary() -> ((double, double), (double, double))

    +The boundary box of the simulation network.
    + +
    getParkingEndingVehiclesIDList(self)
    getParkingEndingVehiclesIDList() -> list(string)

    +.
    + +
    getParkingEndingVehiclesNumber(self)
    getParkingEndingVehiclesNumber() -> integer

    +.
    + +
    getParkingStartingVehiclesIDList(self)
    getParkingStartingVehiclesIDList() -> list(string)

    +.
    + +
    getParkingStartingVehiclesNumber(self)
    getParkingStartingVehiclesNumber() -> integer

    +.
    + +
    getStartingTeleportIDList(self)
    getStartingTeleportIDList() -> list(string)

    +Returns a list of ids of vehicles which started to teleport in this time step.
    + +
    getStartingTeleportNumber(self)
    getStartingTeleportNumber() -> integer

    +Returns the number of vehicles which started to teleport in this time step.
    + +
    getStopEndingVehiclesIDList(self)
    getStopEndingVehiclesIDList() -> list(string)

    +.
    + +
    getStopEndingVehiclesNumber(self)
    getStopEndingVehiclesNumber() -> integer

    +.
    + +
    getStopStartingVehiclesIDList(self)
    getStopStartingVehiclesIDList() -> list(string)

    +.
    + +
    getStopStartingVehiclesNumber(self)
    getStopStartingVehiclesNumber() -> integer

    +.
    + +
    getSubscriptionResults(self)
    getSubscriptionResults() -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getTime(self)
    getTime() -> double

    +Returns the current simulation time in s.
    + +
    saveState(self, fileName)
    + +
    step(self, time=0.0)
    step(double) -> None
    +Make a simulation step and simulate up to the given sim time (in seconds).
    +If the given value is 0 or absent, exactly one step is performed.
    +Values smaller than or equal to the current sim time result in no action.
    + +
    subscribe(self, varIDs=(116,), begin=0, end=2147483647)
    subscribe(list(integer), double, double) -> None

    +Subscribe to one or more simulation values for the given interval.
    + +
    writeMessage(self, msg)
    + +
    +Static methods defined here:
    +
    walkingStage(edges, arrivalPos, destStop='', description='')
    + +
    +Data and other attributes defined here:
    +
    Stage = <class 'traci._simulation.Stage'>
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +class Stage(__builtin__.object)
        Methods defined here:
    +
    __attr_repr__(self, attrname, default='')
    + +
    __init__(self, type, vType, line, destStop, edges, travelTime, cost, length, intended, depart, departPos, arrivalPos, description)
    + +
    __repr__(self)
    + +
    +Data descriptors defined here:
    +
    __dict__
    +
    dictionary for instance variables (if defined)
    +
    +
    __weakref__
    +
    list of weak references to the object (if defined)
    +
    +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci.storage.html sumo-1.6.0+dfsg1/docs/pydoc/traci.storage.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci.storage.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci.storage.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,91 @@ + + +Python: module traci.storage + + + + + +
     
    + 
    traci.storage
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    Storage +
    +

    + + + + + +
     
    +class Storage
        Methods defined here:
    +
    __init__(self, content)
    + +
    printDebug(self)
    + +
    read(self, format)
    + +
    readCompound(self, expectedSize=None)
    + +
    readDouble(self)
    + +
    readInt(self)
    + +
    readLength(self)
    + +
    readShape(self)
    + +
    readString(self)
    + +
    readStringList(self)
    + +
    readTypedDouble(self)
    + +
    readTypedInt(self)
    + +
    readTypedString(self)
    + +
    readTypedStringList(self)
    + +
    ready(self)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    +print_function = _Feature((2, 6, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 65536)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._trafficlight.html sumo-1.6.0+dfsg1/docs/pydoc/traci._trafficlight.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._trafficlight.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._trafficlight.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,247 @@ + + +Python: module traci._trafficlight + + + + + +
     
    + 
    traci._trafficlight
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    Logic +
    Phase +
    traci.domain.Domain +
    +
    +
    TrafficLightDomain +
    +
    +
    +

    + + + + + +
     
    +class Logic
        Methods defined here:
    +
    __init__(self, programID, type, currentPhaseIndex, phases=None, subParameter=None)
    + +
    __repr__(self)
    + +
    getParameter(self, key, default=None)
    + +
    getParameters(self)
    + +
    getPhases(self)
    + +
    getSubID(self)
    + +
    getType(self)
    + +

    + + + + + +
     
    +class Phase
        Methods defined here:
    +
    __init__(self, duration, state, minDur=-1, maxDur=-1, next=(), name='')
    + +
    __repr__(self)
    + +

    + + + + + +
     
    +class TrafficLightDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self, name='trafficlight', deprecatedFor=None)
    + +
    getAllProgramLogics(self, tlsID)
    getAllProgramLogics(string) -> list(Logic)

    +Returns a list of Logic objects.
    +Each Logic encodes a traffic light program for the given tlsID.
    + +
    getCompleteRedYellowGreenDefinition = getAllProgramLogics(self, tlsID)
    + +
    getControlledLanes(self, tlsID)
    getControlledLanes(string) -> c

    +Returns the list of lanes which are controlled by the named traffic light.
    + +
    getControlledLinks(self, tlsID)
    getControlledLinks(string) -> list(list(list(string)))

    +Returns the links controlled by the traffic light, sorted by the signal index and described by giving
    +the incoming, outgoing, and via lane.
    + +
    getNextSwitch(self, tlsID)
    getNextSwitch(string) -> double

    +Returns the absolute simulation time at which the traffic light is
    +schedule to switch to the next phase (in seconds).
    + +
    getPhase(self, tlsID)
    getPhase(string) -> integer

    +Returns the index of the current phase within the list of all phases of
    +the current program.
    + +
    getPhaseDuration(self, tlsID)
    getPhaseDuration(string) -> double

    +Returns the total duration of the current phase (in seconds). This value
    +is not affected by the elapsed or remaining duration of the current phase.
    + +
    getPhaseName(self, tlsID)
    getPhase(string) -> string
    +Returns the name of the current phase.
    + +
    getProgram(self, tlsID)
    getProgram(string) -> string

    +Returns the id of the current program.
    + +
    getRedYellowGreenState(self, tlsID)
    getRedYellowGreenState(string) -> string

    +Returns the named tl's state as a tuple of light definitions from
    +rugGyYoO, for red, yed-yellow, green, yellow, off, where lower case letters mean that the stream
    +has to decelerate.
    + +
    getServedPersonCount(self, tlsID, index)
    getPhase(string, int) -> int
    +Returns the number of persons that would be served in the given phase
    + +
    setCompleteRedYellowGreenDefinition = setProgramLogic(self, tlsID, tls)
    + +
    setLinkState(self, tlsID, tlsLinkIndex, state)
    setLinkState(string, string, int, string) -> None
    +Sets the state for the given tls and link index. The state must be one
    +of rRgGyYoOu for red, red-yellow, green, yellow, off, where lower case letters mean that the stream has
    +to decelerate.
    +The link index is shown in the GUI when setting the appropriate junction
    +visualization option.
    + +
    setPhase(self, tlsID, index)
    setPhase(string, integer) -> None

    +Switches to the phase with the given index in the list of all phases for
    +the current program.
    + +
    setPhaseDuration(self, tlsID, phaseDuration)
    setPhaseDuration(string, double) -> None

    +Set the remaining phase duration of the current phase in seconds.
    +This value has no effect on subsquent repetitions of this phase.
    + +
    setPhaseName(self, tlsID, name)
    setPhase(string, string) -> None

    +Sets the name of the current phase within the current program
    + +
    setProgram(self, tlsID, programID)
    setProgram(string, string) -> None

    +Switches to the program with the given programID. The program must have
    +been loaded earlier. The special value 'off' can always be used to
    +switch off the traffic light.
    + +
    setProgramLogic(self, tlsID, tls)
    setProgramLogic(string, Logic) -> None

    +Sets a new program for the given tlsID from a Logic object.
    +See getCompleteRedYellowGreenDefinition.
    + +
    setRedYellowGreenState(self, tlsID, state)
    setRedYellowGreenState(string, string) -> None

    +Sets the named tl's state as a tuple of light definitions from
    +rugGyYuoO, for red, red-yellow, green, yellow, off, where lower case letters mean that the stream has
    +to decelerate.
    + +
    +Data and other attributes defined here:
    +
    Logic = <class traci._trafficlight.Logic>
    + +
    Phase = <class traci._trafficlight.Phase>
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._vehicle.html sumo-1.6.0+dfsg1/docs/pydoc/traci._vehicle.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._vehicle.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._vehicle.html 2020-04-27 22:06:15.000000000 +0000 @@ -0,0 +1,885 @@ + + +Python: module traci._vehicle + + + + + +
     
    + 
    traci._vehicle
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    struct
    +
    traci.constants
    +
    warnings
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    VehicleDomain +
    +
    +
    +

    + + + + + +
     
    +class VehicleDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    add(self, vehID, routeID, typeID='DEFAULT_VEHTYPE', depart=None, departLane='first', departPos='base', departSpeed='0', arrivalLane='current', arrivalPos='max', arrivalSpeed='current', fromTaz='', toTaz='', line='', personCapacity=0, personNumber=0)
    Add a new vehicle (new style with all possible parameters)
    + +
    addFull = add(self, vehID, routeID, typeID='DEFAULT_VEHTYPE', depart=None, departLane='first', departPos='base', departSpeed='0', arrivalLane='current', arrivalPos='max', arrivalSpeed='current', fromTaz='', toTaz='', line='', personCapacity=0, personNumber=0)
    + +
    addLegacy(self, vehID, routeID, depart=-3, pos=0, speed=0, lane=-6, typeID='DEFAULT_VEHTYPE')
    Add a new vehicle (old style)
    + +
    addSubscriptionFilterCFManeuver(self, downstreamDist=None, upstreamDist=None)
    addSubscriptionFilterCFManeuver() -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to leader and follower of the ego.
    +downstreamDist and upstreamDist specify the range of the search for leader and follower along the road net.
    + +
    addSubscriptionFilterDownstreamDistance(self, dist)
    addSubscriptionFilterDownstreamDist(float) -> None

    +Sets the downstream distance along the network for vehicles to be returned by the last modified
    +vehicle context subscription (call it just after subscribing).
    + +
    addSubscriptionFilterFieldOfVision(self, openingAngle)
    addSubscriptionFilterFieldOfVision(float) -> None

    +Restricts vehicles returned by the last modified vehicle context subscription
    +to vehicles within field of vision with given opening angle
    + +
    addSubscriptionFilterLCManeuver(self, direction=None, noOpposite=False, downstreamDist=None, upstreamDist=None)
    addSubscriptionFilterLCManeuver(int) -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to neighbor and ego-lane leader
    +and follower of the ego.
    +direction - lane change direction (in {-1=right, 1=left})
    +noOpposite specifies whether vehicles on opposite direction lanes shall be returned
    +downstreamDist and upstreamDist specify the range of the search for leader and follower along the road net.
    +Combine with: distance filters; vClass/vType filter.
    + +
    addSubscriptionFilterLanes(self, lanes, noOpposite=False, downstreamDist=None, upstreamDist=None)
    addSubscriptionFilterLanes(list(integer), bool, double, double) -> None

    +Adds a lane-filter to the last modified vehicle context subscription (call it just after subscribing).
    +lanes is a list of relative lane indices (-1 -> right neighboring lane of the ego, 0 -> ego lane, etc.)
    +noOpposite specifies whether vehicles on opposite direction lanes shall be returned
    +downstreamDist and upstreamDist specify the range of the search for surrounding vehicles along the road net.
    + +
    addSubscriptionFilterLateralDistance(self, lateralDist, downstreamDist=None, upstreamDist=None)
    addSubscriptionFilterLateralDist(double, double, double) -> None

    +Adds a lateral distance filter to the last modified vehicle context subscription
    +(call it just after subscribing).
    +downstreamDist and upstreamDist specify the longitudinal range of the search
    +for surrounding vehicles along the ego vehicle's route.
    + +
    addSubscriptionFilterLeadFollow(self, lanes)
    addSubscriptionFilterLCManeuver() -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to neighbor and ego-lane leader
    +and follower of the ego.
    +Combine with: lanes-filter to restrict to one direction; distance filters; vClass/vType filter.
    + +
    addSubscriptionFilterNoOpposite(self)
    addSubscriptionFilterNoOpposite() -> None

    +Omits vehicles on other edges than the ego's for the last modified vehicle context subscription
    +(call it just after subscribing).
    + +
    addSubscriptionFilterTurn(self, downstreamDist=None, upstreamDist=None)
    addSubscriptionFilterTurn() -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to foes on an upcoming junction
    + +
    addSubscriptionFilterUpstreamDistance(self, dist)
    addSubscriptionFilterUpstreamDist(float) -> None

    +Sets the upstream distance along the network for vehicles to be returned by the last modified
    +vehicle context subscription (call it just after subscribing).
    + +
    addSubscriptionFilterVClass(self, vClasses)
    addSubscriptionFilterVClass(list(String)) -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to vehicles of the given classes
    + +
    addSubscriptionFilterVType(self, vTypes)
    addSubscriptionFilterVType(list(String)) -> None

    +Restricts vehicles returned by the last modified vehicle context subscription to vehicles of the given types
    + +
    changeLane(self, vehID, laneIndex, duration)
    changeLane(string, int, double) -> None

    +Forces a lane change to the lane with the given index; if successful,
    +the lane will be chosen for the given amount of time (in s).
    + +
    changeLaneRelative(self, vehID, indexOffset, duration)
    changeLaneRelative(string, int, double) -> None

    +Forces a relative lane change; if successful,
    +the lane will be chosen for the given amount of time (in s).
    +The indexOffset specifies the target lane relative to the vehicles current lane
    + +
    changeSublane(self, vehID, latDist)
    changeLane(string, double) -> None
    +Forces a lateral change by the given amount (negative values indicate changing to the right, positive
    +to the left). This will override any other lane change motivations but conform to
    +safety-constraints as configured by laneChangeMode.
    + +
    changeTarget(self, vehID, edgeID)
    changeTarget(string, string) -> None

    +The vehicle's destination edge is set to the given edge id. The route is rebuilt.
    + +
    couldChangeLane(self, vehID, direction, state=None)
    couldChangeLane(string, int) -> bool
    +Return whether the vehicle could change lanes in the specified direction
    + +
    deactivateGapControl(self, vehID)
    deactivateGapControl(string) -> None

    +Deactivate the vehicle's gap control
    + +
    getAccel(self, vehID)
    getAccel(string) -> double

    +Returns the maximum acceleration possibility in m/s^2 of this vehicle.
    + +
    getAcceleration(self, vehID)
    getAcceleration(string) -> double

    +Returns the acceleration in m/s^2 of the named vehicle within the last step.
    + +
    getAccumulatedWaitingTime(self, vehID)
    getAccumulatedWaitingTime() -> double
    +The accumulated waiting time of a vehicle collects the vehicle's waiting time
    +over a certain time interval (interval length is set per option '--waiting-time-memory')
    + +
    getActionStepLength(self, vehID)
    getActionStepLength(string) -> double

    +Returns the action step length for this vehicle.
    + +
    getAdaptedTraveltime(self, vehID, time, edgeID)
    getAdaptedTraveltime(string, double, string) -> double

    +.
    + +
    getAllowedSpeed(self, vehID)
    getAllowedSpeed(string) -> double

    +Returns the maximum allowed speed on the current lane regarding speed factor in m/s for this vehicle.
    + +
    getAngle(self, vehID)
    getAngle(string) -> double

    +Returns the angle in degrees of the named vehicle within the last step.
    + +
    getApparentDecel(self, vehID)
    getApparentDecel(string) -> double

    +Returns the apparent deceleration in m/s^2 of this vehicle.
    + +
    getBestLanes(self, vehID)
    getBestLanes(string) ->

    +Information about the wish to use subsequent edges' lanes.
    + +
    getCO2Emission(self, vehID)
    getCO2Emission(string) -> double

    +Returns the CO2 emission in mg/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getCOEmission(self, vehID)
    getCOEmission(string) -> double

    +Returns the CO emission in mg/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getColor(self, vehID)
    getColor(string) -> (integer, integer, integer, integer)

    +Returns the vehicle's rgba color.
    + +
    getDecel(self, vehID)
    getDecel(string) -> double

    +Returns the preferred maximal deceleration possibility in m/s^2 of this vehicle.
    + +
    getDistance(self, vehID)
    getDistance(string) -> double

    +Returns the distance to the starting point like an odometer
    + +
    getDrivingDistance(self, vehID, edgeID, pos, laneIndex=0)
    getDrivingDistance(string, string, double, integer) -> double

    +Return the distance to the given edge and position along the vehicles route.
    + +
    getDrivingDistance2D(self, vehID, x, y)
    getDrivingDistance2D(string, double, double) -> integer

    +Return the distance to the given network position along the vehicles route.
    + +
    getEffort(self, vehID, time, edgeID)
    getEffort(string, double, string) -> double

    +.
    + +
    getElectricityConsumption(self, vehID)
    getElectricityConsumption(string) -> double

    +Returns the electricity consumption in Wh/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getEmergencyDecel(self, vehID)
    getEmergencyDecel(string) -> double

    +Returns the maximal physically possible deceleration in m/s^2 of this vehicle.
    + +
    getEmissionClass(self, vehID)
    getEmissionClass(string) -> string

    +Returns the emission class of this vehicle.
    + +
    getFollowSpeed(self, vehID, speed, gap, leaderSpeed, leaderMaxDecel, leaderID='')
    getFollowSpeed(string, double, double, double, double, string) -> double
    +Return the follow speed computed by the carFollowModel of vehID
    + +
    getFuelConsumption(self, vehID)
    getFuelConsumption(string) -> double

    +Returns the fuel consumption in ml/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getHCEmission(self, vehID)
    getHCEmission(string) -> double

    +Returns the HC emission in mg/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getHeight(self, vehID)
    getHeight(string) -> double

    +Returns the height in m of this vehicle.
    + +
    getImperfection(self, vehID)
    getImperfection(string) -> double

    +.
    + +
    getLaneChangeMode(self, vehID)
    getLaneChangeMode(string) -> integer

    +Gets the vehicle's lane change mode as a bitset.
    + +
    getLaneChangeState(self, vehID, direction)
    getLaneChangeState(string, int) -> (int, int)
    +Return the lane change state for the vehicle
    + +
    getLaneChangeStatePretty(self, vehID, direction)
    getLaneChangeState(string, int) -> ([string, ...], [string, ...])
    +Return the lane change state for the vehicle as a list of string constants
    + +
    getLaneID(self, vehID)
    getLaneID(string) -> string

    +Returns the id of the lane the named vehicle was at within the last step.
    + +
    getLaneIndex(self, vehID)
    getLaneIndex(string) -> integer

    +Returns the index of the lane the named vehicle was at within the last step.
    + +
    getLanePosition(self, vehID)
    getLanePosition(string) -> double

    +The position of the vehicle along the lane measured in m.
    + +
    getLastActionTime(self, vehID)
    getLastActionTime(string) -> double

    +Returns the time of last action point for this vehicle.
    + +
    getLateralAlignment(self, vehID)
    getLateralAlignment(string) -> string

    +Returns The preferred lateral alignment of the vehicle
    + +
    getLateralLanePosition(self, vehID)
    getLateralLanePosition(string) -> double

    +Returns The lateral position of the vehicle on its current lane measured in m.
    + +
    getLateralSpeed(self, vehID)
    getLateralSpeed(string) -> double

    +Returns the lateral speed in m/s of the named vehicle within the last step.
    + +
    getLeader(self, vehID, dist=0.0)
    getLeader(string, double) -> (string, double)

    +Return the leading vehicle id together with the distance. The distance
    +is measured from the front + minGap to the back of the leader, so it does not include the
    +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.
    + +
    getLeftFollowers(self, vehID, blockingOnly=False)
    bool -> list(pair(string, double))
    +Convenience method, see getNeighbors()
    + +
    getLeftLeaders(self, vehID, blockingOnly=False)
    bool -> list(pair(string, double))
    +Convenience method, see getNeighbors()
    + +
    getLength(self, vehID)
    getLength(string) -> double

    +Returns the length in m of the given vehicle.
    + +
    getLine(self, vehID)
    getLine(string) -> string

    +Returns the line information of this vehicle.
    + +
    getMaxSpeed(self, vehID)
    getMaxSpeed(string) -> double

    +Returns the maximum speed in m/s of this vehicle.
    + +
    getMaxSpeedLat(self, vehID)
    getMaxSpeedLat(string) -> double

    +Returns the maximum lateral speed in m/s of this vehicle.
    + +
    getMinGap(self, vehID)
    getMinGap(string) -> double

    +Returns the offset (gap to front vehicle if halting) of this vehicle.
    + +
    getMinGapLat(self, vehID)
    getMinGapLat(string) -> double

    +Returns The desired lateral gap of this vehicle at 50km/h in m
    + +
    getNOxEmission(self, vehID)
    getNOxEmission(string) -> double

    +Returns the NOx emission in mg/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getNeighbors(self, vehID, mode)
    byte -> list(pair(string, double))

    +The parameter mode is a bitset (UBYTE), specifying the following:
    +bit 1: query lateral direction (left:0, right:1)
    +bit 2: query longitudinal direction (followers:0, leaders:1)
    +bit 3: blocking (return all:0, return only blockers:1)

    +The returned list contains pairs (ID, dist) for all lane change relevant neighboring leaders, resp. followers,
    +along with their longitudinal distance to the ego vehicle (egoFront - egoMinGap to leaderBack, resp.
    +followerFront - followerMinGap to egoBack. The value can be negative for overlapping neighs).
    +For the non-sublane case, the lists will contain at most one entry.

    +Note: The exact set of blockers in case blocking==1 is not determined for the sublane model,
    +but either all neighboring vehicles are returned (in case LCA_BLOCKED) or
    +none is returned (in case !LCA_BLOCKED).
    + +
    getNextStops(self, vehID)
    getNextStop(string) -> [(string, double, string, int, int, int)], ...

    +Return list of upcoming stops [(lane, endPos, stoppingPlaceID, stopFlags, duration, until), ...]
    +where integer stopFlag is defined as:
    +       1 * stopped +
    +       2 * parking +
    +       4 * personTriggered +
    +       8 * containerTriggered +
    +      16 * isBusStop +
    +      32 * isContainerStop +
    +      64 * chargingStation +
    +     128 * parkingarea
    +with each of these flags defined as 0 or 1.
    + +
    getNextTLS(self, vehID)
    getNextTLS(string) ->

    +Return list of upcoming traffic lights [(tlsID, tlsIndex, distance, state), ...]
    + +
    getNoiseEmission(self, vehID)
    getNoiseEmission(string) -> double

    +Returns the noise emission in db for the last time step.
    + +
    getPMxEmission(self, vehID)
    getPMxEmission(string) -> double

    +Returns the particular matter emission in mg/s for the last time step.
    +Multiply by the step length to get the value for one step.
    + +
    getPersonCapacity(self, vehID)
    getPersonCapacity(string) -> int

    +Returns the person capacity of the vehicle
    + +
    getPersonIDList(self, vehID)
    getPersonIDList(string) -> integer
    +Returns the list of persons which includes those defined using attribute 'personNumber'
    +as well as <person>-objects which are riding in this vehicle.
    + +
    getPersonNumber(self, vehID)
    getPersonNumber(string) -> integer
    +Returns the total number of persons which includes those defined
    +using attribute 'personNumber' as well as <person>-objects which are riding in
    +this vehicle.
    + +
    getPosition(self, vehID)
    getPosition(string) -> (double, double)

    +Returns the position of the named vehicle within the last step [m,m].
    + +
    getPosition3D(self, vehID)
    getPosition3D(string) -> (double, double, double)

    +Returns the position of the named vehicle within the last step [m,m,m].
    + +
    getRightFollowers(self, vehID, blockingOnly=False)
    bool -> list(pair(string, double))
    +Convenience method, see getNeighbors()
    + +
    getRightLeaders(self, vehID, blockingOnly=False)
    bool -> list(pair(string, double))
    +Convenience method, see getNeighbors()
    + +
    getRoadID(self, vehID)
    getRoadID(string) -> string

    +Returns the id of the edge the named vehicle was at within the last step.
    + +
    getRoute(self, vehID)
    getRoute(string) -> list(string)

    +Returns the ids of the edges the vehicle's route is made of.
    + +
    getRouteID(self, vehID)
    getRouteID(string) -> string

    +Returns the id of the route of the named vehicle.
    + +
    getRouteIndex(self, vehID)
    getRouteIndex(string) -> int

    +Returns the index of the current edge within the vehicles route or -1 if the
    +vehicle has not yet departed
    + +
    getRoutingMode(self, vehID)
    returns the current routing mode:
    +tc.ROUTING_MODE_DEFAULT    : use weight storages and fall-back to edge speeds (default)
    +tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
    + +
    getSecureGap(self, vehID, speed, leaderSpeed, leaderMaxDecel, leaderID='')
    getSecureGap(string, double, double, double, string) -> double
    +Return the secure gap computed by the carFollowModel of vehID
    + +
    getShapeClass(self, vehID)
    getShapeClass(string) -> string

    +Returns the shape class of this vehicle.
    + +
    getSignals(self, vehID)
    getSignals(string) -> integer

    +Returns an integer encoding the state of a vehicle's signals.
    + +
    getSlope(self, vehID)
    getSlope -> double
    +The slope at the current position of the vehicle in degrees
    + +
    getSpeed(self, vehID)
    getSpeed(string) -> double

    +Returns the (longitudinal) speed in m/s of the named vehicle within the last step.
    + +
    getSpeedDeviation(self, vehID)
    getSpeedDeviation(string) -> double

    +Returns the standard deviation for the speed factor of the vehicle type.
    + +
    getSpeedFactor(self, vehID)
    getSpeedFactor(string) -> double

    +Returns the chosen speed factor for this vehicle.
    + +
    getSpeedMode(self, vehID)
    getSpeedMode -> int
    +The speed mode of a vehicle
    + +
    getSpeedWithoutTraCI(self, vehID)
    getSpeedWithoutTraCI(string) -> double
    +Returns the speed that the vehicle would drive if not speed-influencing
    +command such as setSpeed or slowDown was given.
    + +
    getStopDelay(self, vehID)
    getStopDelay(string) -> double
    +Returns the expected delay at the next stop (if that stop defines the
    +until-attribute) in seconds. Returns -1 if the next stop is not applicable
    + +
    getStopSpeed(self, vehID, speed, gap)
    getStopSpeed(string, double, double) -> double
    +Return the speed for stopping at gap computed by the carFollowModel of vehID
    + +
    getStopState(self, vehID)
    getStopState(string) -> integer

    +Returns information in regard to stopping:
    +The returned integer is defined as 1 * stopped + 2 * parking
    ++ 4 * personTriggered + 8 * containerTriggered + 16 * isBusStop
    ++ 32 * isContainerStop
    +with each of these flags defined as 0 or 1
    + +
    getTau(self, vehID)
    getTau(string) -> double

    +Returns the driver's reaction time in s for this vehicle.
    + +
    getTypeID(self, vehID)
    getTypeID(string) -> string

    +Returns the id of the type of the named vehicle.
    + +
    getVehicleClass(self, vehID)
    getVehicleClass(string) -> string

    +Returns the vehicle class of this vehicle.
    + +
    getVia(self, vehID)
    getVia(string) -> list(string)

    +Returns the ids of via edges for this vehicle
    + +
    getWaitingTime(self, vehID)
    getWaitingTime() -> double
    +The waiting time of a vehicle is defined as the time (in seconds) spent with a
    +speed below 0.1m/s since the last time it was faster than 0.1m/s.
    +(basically, the waiting time of a vehicle is reset to 0 every time it moves).
    +A vehicle that is stopping intentionally with a <stop> does not accumulate waiting time.
    + +
    getWidth(self, vehID)
    getWidth(string) -> double

    +Returns the width in m of this vehicle.
    + +
    highlight(self, vehID, color=(255, 0, 0, 255), size=-1, alphaMax=-1, duration=-1, type=0)
    highlight(string, color, float, ubyte) -> void
    +Adds a circle of the given color tracking the vehicle.
    +If a positive size [in m] is given the size of the highlight is chosen accordingly,
    +otherwise the length of the vehicle is used as reference.
    +If alphaMax and duration are positive, the circle fades in and out within the given duration,
    +otherwise it permanently follows the vehicle.
    + +
    isAtBusStop(self, vehID)
    isAtBusStop(string) -> bool
    +Return whether the vehicle is stopped at a bus stop
    + +
    isAtContainerStop(self, vehID)
    isAtContainerStop(string) -> bool
    +Return whether the vehicle is stopped at a container stop
    + +
    isRouteValid(self, vehID)
    isRouteValid(string) -> bool
    +Returns whether the current vehicle route is connected for the vehicle
    +class of the given vehicle.
    + +
    isStopped(self, vehID)
    isStopped(string) -> bool
    +Return whether the vehicle is stopped
    + +
    isStoppedParking(self, vehID)
    isStoppedParking(string) -> bool
    +Return whether the vehicle is parking (implies stopped)
    + +
    isStoppedTriggered(self, vehID)
    isStoppedTriggered(string) -> bool
    +Return whether the vehicle is stopped and waiting for a person or container
    + +
    moveTo(self, vehID, laneID, pos)
    + +
    moveToXY(self, vehID, edgeID, lane, x, y, angle=-1073741824.0, keepRoute=1)
    Place vehicle at the given x,y coordinates and force it's angle to
    +the given value (for drawing).
    +If the angle is set to INVALID_DOUBLE_VALUE, the vehicle assumes the
    +natural angle of the edge on which it is driving.
    +If keepRoute is set to 1, the closest position
    +within the existing route is taken. If keepRoute is set to 0, the vehicle may move to
    +any edge in the network but it's route then only consists of that edge.
    +If keepRoute is set to 2 the vehicle has all the freedom of keepRoute=0
    +but in addition to that may even move outside the road network.
    +edgeID and lane are optional placement hints to resolve ambiguities
    + +
    openGap(self, vehID, newTimeHeadway, newSpaceHeadway, duration, changeRate, maxDecel=-1, referenceVehID=None)
    openGap(string, double, double, double, double, double, string) -> None

    +Changes the vehicle's desired time headway (cf-parameter tau) smoothly to the given new value
    +using the given change rate. Similarly, the given space headway is applied gradually
    +to achieve a minimal spatial gap.
    +The vehicle is commanded to keep the increased headway for
    +the given duration once its target value is attained. The maximal value for the
    +deceleration can be given to prevent harsh braking due to the change of tau. If maxDecel=-1,
    +the limit determined by the CF model is used.
    +A vehicle ID for a reference vehicle can optionally be given, otherwise, the gap is created with
    +respect to the current leader on the ego vehicle's current lane.
    +Note that this does only affect the following behavior regarding the current leader and does
    +not influence the gap acceptance during lane change, etc.
    + +
    remove(self, vehID, reason=3)
    Remove vehicle with the given ID for the give reason.
    +Reasons are defined in module constants and start with REMOVE_
    + +
    requestToC(self, vehID, leadTime)
    requestToC(string, double) -> None

    +Interface for triggering a transition of control for a vehicle equipped with a ToC device.
    + +
    rerouteEffort(self, vehID)
    + +
    rerouteParkingArea(self, vehID, parkingAreaID)
    rerouteParkingArea(string, string)

    +Changes the next parking area in parkingAreaID, updates the vehicle route,
    +and preserve consistency in case of passengers/containers on board.
    + +
    rerouteTraveltime(self, vehID, currentTravelTimes=True)
    rerouteTraveltime(string, bool) -> None Reroutes a vehicle. If
    +currentTravelTimes is True (default) then the current traveltime of the
    +edges is loaded and used for rerouting. If currentTravelTimes is False
    +custom travel times are used. The various functions and options for
    +customizing travel times are described at https://sumo.dlr.de/wiki/Simulation/Routing

    +When rerouteTraveltime has been called once with option
    +currentTravelTimes=True, all edge weights are set to the current travel
    +times at the time of that call (even for subsequent simulation steps).
    + +
    resume(self, vehID)
    resume(string) -> None

    +Resumes the vehicle from the current stop (throws an error if the vehicle is not stopped).
    + +
    setAccel(self, vehID, accel)
    setAccel(string, double) -> None

    +Sets the maximum acceleration in m/s^2 for this vehicle.
    + +
    setActionStepLength(self, vehID, actionStepLength, resetActionOffset=True)
    setActionStepLength(string, double, bool) -> None

    +Sets the action step length for this vehicle. If resetActionOffset == True (default), the
    +next action point is scheduled immediately. if If resetActionOffset == False, the interval
    +between the last and the next action point is updated to match the given value, or if the latter
    +is smaller than the time since the last action point, the next action follows immediately.
    + +
    setAdaptedTraveltime(self, vehID, edgeID, time=None, begTime=None, endTime=None)
    setAdaptedTraveltime(string, string, double, double, double) -> None
    +Inserts the information about the travel time of edge "edgeID" valid
    +from begin time to end time into the vehicle's internal edge weights
    +container.
    +If the time is not specified, any previously set values for that edge
    +are removed.
    +If begTime or endTime are not specified the value is set for the whole
    +simulation duration.
    + +
    setApparentDecel(self, vehID, decel)
    setApparentDecel(string, double) -> None

    +Sets the apparent deceleration in m/s^2 for this vehicle.
    + +
    setBusStop(self, vehID, stopID, duration=-1073741824.0, until=-1073741824.0, flags=0)
    setBusStop(string, string, double, double, integer) -> None

    +Adds or modifies a bus stop with the given parameters. The duration and the until attribute are
    +in seconds.
    + +
    setChargingStationStop(self, vehID, stopID, duration=-1073741824.0, until=-1073741824.0, flags=0)
    setChargingStationStop(string, string, double, double, integer) -> None

    +Adds or modifies a stop at a chargingStation with the given parameters. The duration and the until attribute are
    +in seconds.
    + +
    setColor(self, vehID, color)
    setColor(string, (integer, integer, integer, integer))

    +Sets the color for the vehicle with the given ID, i.e. (255,0,0) for the color red.
    +The fourth component (alpha) is optional.
    + +
    setContainerStop(self, vehID, stopID, duration=-1073741824.0, until=-1073741824.0, flags=0)
    setContainerStop(string, string, double, double, integer) -> None

    +Adds or modifies a container stop with the given parameters. The duration and the until attribute are
    +in seconds.
    + +
    setDecel(self, vehID, decel)
    setDecel(string, double) -> None

    +Sets the preferred maximal deceleration in m/s^2 for this vehicle.
    + +
    setEffort(self, vehID, edgeID, effort=None, begTime=None, endTime=None)
    setEffort(string, string, double, double, double) -> None
    +Inserts the information about the effort of edge "edgeID" valid from
    +begin time to end time into the vehicle's internal edge weights
    +container.
    +If the time is not specified, any previously set values for that edge
    +are removed.
    +If begTime or endTime are not specified the value is set for the whole
    +simulation duration.
    + +
    setEmergencyDecel(self, vehID, decel)
    setEmergencyDecel(string, double) -> None

    +Sets the maximal physically possible deceleration in m/s^2 for this vehicle.
    + +
    setEmissionClass(self, vehID, clazz)
    setEmissionClass(string, string) -> None

    +Sets the emission class for this vehicle.
    + +
    setHeight(self, vehID, height)
    setHeight(string, double) -> None

    +Sets the height in m for this vehicle.
    + +
    setImperfection(self, vehID, imperfection)
    setImperfection(string, double) -> None

    +Sets the driver imperfection sigma.
    + +
    setLaneChangeMode(self, vehID, lcm)
    setLaneChangeMode(string, integer) -> None

    +Sets the vehicle's lane change mode as a bitset.
    + +
    setLateralAlignment(self, vehID, align)
    setLateralAlignment(string, string) -> None

    +Sets the preferred lateral alignment for this vehicle.
    + +
    setLength(self, vehID, length)
    setLength(string, double) -> None

    +Sets the length in m for the given vehicle.
    + +
    setLine(self, vehID, line)
    setHeight(string, string) -> None

    +Sets the line information for this vehicle.
    + +
    setMaxSpeed(self, vehID, speed)
    setMaxSpeed(string, double) -> None

    +Sets the maximum speed in m/s for this vehicle.
    + +
    setMaxSpeedLat(self, vehID, speed)
    setMaxSpeedLat(string, double) -> None

    +Sets the maximum lateral speed in m/s for this vehicle.
    + +
    setMinGap(self, vehID, minGap)
    setMinGap(string, double) -> None

    +Sets the offset (gap to front vehicle if halting) for this vehicle.
    + +
    setMinGapLat(self, vehID, minGapLat)
    setMinGapLat(string, double) -> None

    +Sets the minimum lateral gap of the vehicle at 50km/h in m
    + +
    setParkingAreaStop(self, vehID, stopID, duration=-1073741824.0, until=-1073741824.0, flags=1)
    setParkingAreaStop(string, string, double, double, integer) -> None

    +Adds or modifies a stop at a parkingArea with the given parameters. The duration and the until attribute are
    +in seconds.
    + +
    setRoute(self, vehID, edgeList)
    setRoute(string, list) ->  None

    +changes the vehicle route to given edges list.
    +The first edge in the list has to be the one that the vehicle is at at the moment.

    +example usage:
    +setRoute('1', ['1', '2', '4', '6', '7'])

    +this changes route for vehicle id 1 to edges 1-2-4-6-7
    + +
    setRouteID(self, vehID, routeID)
    setRouteID(string, string) -> None

    +Changes the vehicles route to the route with the given id.
    + +
    setRoutingMode(self, vehID, routingMode)
    sets the current routing mode:
    +tc.ROUTING_MODE_DEFAULT    : use weight storages and fall-back to edge speeds (default)
    +tc.ROUTING_MODE_AGGREGATED : use global smoothed travel times from device.rerouting
    + +
    setShapeClass(self, vehID, clazz)
    setShapeClass(string, string) -> None

    +Sets the shape class for this vehicle.
    + +
    setSignals(self, vehID, signals)
    setSignals(string, integer) -> None

    +Sets an integer encoding the state of the vehicle's signals.
    + +
    setSpeed(self, vehID, speed)
    setSpeed(string, double) -> None

    +Sets the speed in m/s for the named vehicle within the last step.
    +Calling with speed=-1 hands the vehicle control back to SUMO.
    + +
    setSpeedFactor(self, vehID, factor)
    setSpeedFactor(string, double) -> None

    +.
    + +
    setSpeedMode(self, vehID, sm)
    setSpeedMode(string, integer) -> None

    +Sets the vehicle's speed mode as a bitset.
    + +
    setStop(self, vehID, edgeID, pos=1.0, laneIndex=0, duration=-1073741824.0, flags=0, startPos=-1073741824.0, until=-1073741824.0)
    setStop(string, string, double, integer, double, integer, double, double) -> None

    +Adds or modifies a stop with the given parameters. The duration and the until attribute are
    +in seconds.
    + +
    setTau(self, vehID, tau)
    setTau(string, double) -> None

    +Sets the driver's tau-parameter (reaction time or anticipation time depending on the car-following model) in s
    +for this vehicle.
    + +
    setType(self, vehID, typeID)
    setType(string, string) -> None

    +Sets the id of the type for the named vehicle.
    + +
    setVehicleClass(self, vehID, clazz)
    setVehicleClass(string, string) -> None

    +Sets the vehicle class for this vehicle.
    + +
    setVia(self, vehID, edgeList)
    setVia(string, list) ->  None

    +changes the via edges to the given edges list (to be used during
    +subsequent rerouting calls).

    +Note: a single edgeId as argument is allowed as shorthand for a list of length 1
    + +
    setWidth(self, vehID, width)
    setWidth(string, double) -> None

    +Sets the width in m for this vehicle.
    + +
    slowDown(self, vehID, speed, duration)
    slowDown(string, double, double) -> None

    +Changes the speed smoothly to the given value over the given amount
    +of time in seconds (can also be used to increase speed).
    + +
    subscribe(self, objectID, varIDs=(80, 86), begin=0, end=2147483647)
    subscribe(string, list(integer), int, int) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=(80, 86), begin=0, end=2147483647)
    subscribe(string, int, double, list(integer), int, int) -> None

    +Subscribe to one or more object values of the given domain around the
    +given objectID in a given radius
    + +
    subscribeLeader(self, vehID, dist=0.0, begin=0, end=2147483647)
    subscribeLeader(string, double) -> None

    +Subscribe for the leading vehicle id together with the distance.
    +The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap.
    + +
    updateBestLanes(self, vehID)
    updateBestLanes(string) -> None
    +Triggers an update of the vehicle's bestLanes (structure determining the lane preferences used by LC models)
    +It may be called after modifying the vClass for instance.
    + +
    wantsAndCouldChangeLane(self, vehID, direction, state=None)
    wantsAndCouldChangeLane(string, int) -> bool
    +Return whether the vehicle wants to and could change lanes in the specified direction
    + +
    +Data and other attributes defined here:
    +
    DEPART_CONTAINER_TRIGGERED = -2
    + +
    DEPART_LANE_ALLOWED_FREE = -4
    + +
    DEPART_LANE_BEST_FREE = -5
    + +
    DEPART_LANE_FIRST_ALLOWED = -6
    + +
    DEPART_LANE_FREE = -3
    + +
    DEPART_LANE_RANDOM = -2
    + +
    DEPART_NOW = -3
    + +
    DEPART_SPEED_MAX = -3
    + +
    DEPART_SPEED_RANDOM = -2
    + +
    DEPART_TRIGGERED = -1
    + +
    LAST_TRAVEL_TIME_UPDATE = -1
    + +
    STOP_BUS_STOP = 8
    + +
    STOP_CHARGING_STATION = 32
    + +
    STOP_CONTAINER_STOP = 16
    + +
    STOP_CONTAINER_TRIGGERED = 4
    + +
    STOP_DEFAULT = 0
    + +
    STOP_PARKING = 1
    + +
    STOP_PARKING_AREA = 64
    + +
    STOP_TRIGGERED = 2
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/pydoc/traci._vehicletype.html sumo-1.6.0+dfsg1/docs/pydoc/traci._vehicletype.html --- sumo-1.5.0+dfsg1/docs/pydoc/traci._vehicletype.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/pydoc/traci._vehicletype.html 2020-04-27 22:06:16.000000000 +0000 @@ -0,0 +1,300 @@ + + +Python: module traci._vehicletype + + + + + +
     
    + 
    traci._vehicletype
    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-2020 German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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

    +

    + + + + + +
     
    +Modules
           
    traci.exceptions
    +
    struct
    +
    traci.constants
    +

    + + + + + +
     
    +Classes
           
    +
    traci.domain.Domain +
    +
    +
    VehicleTypeDomain +
    +
    +
    +

    + + + + + +
     
    +class VehicleTypeDomain(traci.domain.Domain)
        Methods defined here:
    +
    __init__(self)
    + +
    copy(self, origTypeID, newTypeID)
    copy(string, string) -> None

    +Duplicates the vType with ID origTypeID. The newly created vType is assigned the ID newTypeID
    + +
    getAccel(self, typeID)
    getAccel(string) -> double

    +Returns the maximum acceleration in m/s^2 of vehicles of this type.
    + +
    getActionStepLength(self, typeID)
    getActionStepLength(string) -> double

    +Returns the action step length for vehicles of this type.
    + +
    getApparentDecel(self, typeID)
    getApparentDecel(string) -> double

    +Returns the apparent deceleration in m/s^2 of vehicles of this type.
    + +
    getColor(self, typeID)
    getColor(string) -> (integer, integer, integer, integer)

    +Returns the color of this type.
    + +
    getDecel(self, typeID)
    getDecel(string) -> double

    +Returns the maximal comfortable deceleration in m/s^2 of vehicles of this type.
    + +
    getEmergencyDecel(self, typeID)
    getEmergencyDecel(string) -> double

    +Returns the maximal physically possible deceleration in m/s^2 of vehicles of this type.
    + +
    getEmissionClass(self, typeID)
    getEmissionClass(string) -> string

    +Returns the emission class of vehicles of this type.
    + +
    getHeight(self, typeID)
    getHeight(string) -> double

    +Returns the height in m of vehicles of this type.
    + +
    getImperfection(self, typeID)
    getImperfection(string) -> double

    +.
    + +
    getLateralAlignment(self, vehID)
    getLateralAlignment(string) -> string

    +Returns The preferred lateral alignment of the type
    + +
    getLength(self, typeID)
    getLength(string) -> double

    +Returns the length in m of the vehicles of this type.
    + +
    getMaxSpeed(self, typeID)
    getMaxSpeed(string) -> double

    +Returns the maximum speed in m/s of vehicles of this type.
    + +
    getMaxSpeedLat(self, vehID)
    getMaxSpeedLat(string) -> double

    +Returns the maximum lateral speed in m/s of this type.
    + +
    getMinGap(self, typeID)
    getMinGap(string) -> double

    +Returns the offset (gap to front vehicle if halting) of vehicles of this type.
    + +
    getMinGapLat(self, vehID)
    getMinGapLat(string) -> double

    +Returns The desired lateral gap of this type at 50km/h in m
    + +
    getPersonCapacity(self, typeID)
    getPersonCapacity(string) -> int

    +Returns the person capacity of this type
    + +
    getShapeClass(self, typeID)
    getShapeClass(string) -> string

    +Returns the shape class of vehicles of this type.
    + +
    getSpeedDeviation(self, typeID)
    getSpeedDeviation(string) -> double

    +Returns the maximum speed deviation of vehicles of this type.
    + +
    getSpeedFactor(self, typeID)
    getSpeedFactor(string) -> double

    +.
    + +
    getTau(self, typeID)
    getTau(string) -> double

    +Returns the driver's reaction time in s for vehicles of this type.
    + +
    getVehicleClass(self, typeID)
    getVehicleClass(string) -> string

    +Returns the class of vehicles of this type.
    + +
    getWidth(self, typeID)
    getWidth(string) -> double

    +Returns the width in m of vehicles of this type.
    + +
    setAccel(self, typeID, accel)
    setAccel(string, double) -> None

    +Sets the maximum acceleration in m/s^2 of vehicles of this type.
    + +
    setActionStepLength(self, typeID, actionStepLength, resetActionOffset=True)
    setActionStepLength(string, double, bool) -> None

    +Sets the action step length for vehicles of this type. If resetActionOffset == True (default), the
    +next action point is scheduled immediately for all vehicles of the type.
    +If resetActionOffset == False, the interval between the last and the next action point is
    +updated to match the given value for all vehicles of the type, or if the latter is smaller
    +than the time since the last action point, the next action follows immediately.
    + +
    setApparentDecel(self, typeID, decel)
    setDecel(string, double) -> None

    +Sets the apparent deceleration in m/s^2 of vehicles of this type.
    + +
    setColor(self, typeID, color)
    setColor(string, (integer, integer, integer, integer)) -> None

    +Sets the color of this type.
    + +
    setDecel(self, typeID, decel)
    setDecel(string, double) -> None

    +Sets the maximal comfortable deceleration in m/s^2 of vehicles of this type.
    + +
    setEmergencyDecel(self, typeID, decel)
    setDecel(string, double) -> None

    +Sets the maximal physically possible deceleration in m/s^2 of vehicles of this type.
    + +
    setEmissionClass(self, typeID, clazz)
    setEmissionClass(string, string) -> None

    +Sets the emission class of vehicles of this type.
    + +
    setHeight(self, typeID, height)
    setHeight(string, double) -> None

    +Sets the height in m of vehicles of this type.
    + +
    setImperfection(self, typeID, imperfection)
    setImperfection(string, double) -> None

    +.
    + +
    setLateralAlignment(self, typeID, latAlignment)
    setLateralAlignment(string, string) -> None

    +Sets the preferred lateral alignment of this type.
    + +
    setLength(self, typeID, length)
    setLength(string, double) -> None

    +Sets the length in m of the vehicles of this type.
    + +
    setMaxSpeed(self, typeID, speed)
    setMaxSpeed(string, double) -> None

    +Sets the maximum speed in m/s of vehicles of this type.
    + +
    setMaxSpeedLat(self, typeID, speed)
    setMaxSpeedLat(string, double) -> None

    +Sets the maximum lateral speed of this type.
    + +
    setMinGap(self, typeID, minGap)
    setMinGap(string, double) -> None

    +Sets the offset (gap to front vehicle if halting) of vehicles of this type.
    + +
    setMinGapLat(self, typeID, minGapLat)
    setMinGapLat(string, double) -> None

    +Sets the minimum lateral gap at 50km/h of this type.
    + +
    setShapeClass(self, typeID, clazz)
    setShapeClass(string, string) -> None

    +Sets the shape class of vehicles of this type.
    + +
    setSpeedDeviation(self, typeID, deviation)
    setSpeedDeviation(string, double) -> None

    +Sets the maximum speed deviation of vehicles of this type.
    + +
    setSpeedFactor(self, typeID, factor)
    setSpeedFactor(string, double) -> None

    +.
    + +
    setTau(self, typeID, tau)
    setTau(string, double) -> None

    +Sets the driver's tau-parameter (reaction time or anticipation time depending on the car-following model) in s
    +for vehicles of this type.
    + +
    setVehicleClass(self, typeID, clazz)
    setVehicleClass(string, string) -> None

    +Sets the class of vehicles of this type.
    + +
    setWidth(self, typeID, width)
    setWidth(string, double) -> None

    +Sets the width in m of vehicles of this type.
    + +
    +Methods inherited from traci.domain.Domain:
    +
    getAllContextSubscriptionResults(self)
    + +
    getAllSubscriptionResults(self)
    getAllSubscriptionResults() -> dict(string: dict(integer: <value_type>))

    +Returns the subscription results for the last time step and all objects of the domain.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    getContextSubscriptionResults(self, objectID)
    + +
    getIDCount(self)
    getIDCount() -> integer

    +Returns the number of currently loaded objects.
    + +
    getIDList(self)
    getIDList() -> list(string)

    +Returns a list of all objects in the network.
    + +
    getParameter(self, objID, param)
    getParameter(string, string) -> string

    +Returns the value of the given parameter for the given objID
    + +
    getSubscriptionResults(self, objectID)
    getSubscriptionResults(string) -> dict(integer: <value_type>)

    +Returns the subscription results for the last time step and the given object.
    +If the object id is unknown or the subscription did for any reason return no data,
    +'None' is returned.
    +It is not possible to retrieve older subscription results than the ones
    +from the last time step.
    + +
    setParameter(self, objID, param, value)
    setParameter(string, string, string) -> None

    +Sets the value of the given parameter to value for the given objID
    + +
    subscribe(self, objectID, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribe(string, list(integer), double, double) -> None

    +Subscribe to one or more object values for the given interval.
    + +
    subscribeContext(self, objectID, domain, dist, varIDs=None, begin=-1073741824.0, end=-1073741824.0)
    subscribeContext(string, int, double, list(integer), double, double) -> None

    +Subscribe to objects of the given domain (specified as domain=traci.constants.CMD_GET_<DOMAIN>_VARIABLE),
    +which are closer than dist to the object specified by objectID.
    + +
    unsubscribe(self, objectID)
    unsubscribe(string) -> None

    +Unsubscribe from receiving object values.
    + +
    unsubscribeContext(self, objectID, domain, dist)
    + +

    + + + + + +
     
    +Data
           absolute_import = _Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)
    + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/404.html sumo-1.6.0+dfsg1/docs/userdoc/404.html --- sumo-1.5.0+dfsg1/docs/userdoc/404.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/404.html 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,206 @@ + + + + + + + + + + + + + + + + + + + SUMO Documentation + + + + + + + + + + + + + + + + + +

    + +
    +
    + +
    +
    +

    404

    +

    Page not found

    +
    +
    + + +
    + + + +
    + +
    + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/ACTIVITYGEN.html sumo-1.6.0+dfsg1/docs/userdoc/ACTIVITYGEN.html --- sumo-1.5.0+dfsg1/docs/userdoc/ACTIVITYGEN.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/ACTIVITYGEN.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + + + + + + ACTIVITYGEN - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + ACTIVITYGEN
    + + + +

    From 30.000 feet#

    +

    ACTIVITYGEN reads the definition of a +population matching an also given network. It computes and mobility +wishes for this population.

    + + +

    Usage Description#

    +

    A step by step description for using +ACTIVITYGEN can be found here

    +

    Options#

    +

    You may use a XML schema definition file for setting up a ACTIVITYGEN +configuration: +activitygenConfiguration.xsd.

    +

    Configuration#

    +

    All applications of the SUMO-suite handle configuration options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Configuration Files.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -c <FILE>
    --configuration-file <FILE>
    Loads the named config on startup
    -C <FILE>
    --save-configuration <FILE>
    Saves current configuration into FILE
    --save-template <FILE>Saves a configuration template (empty) into FILE
    --save-schema <FILE>Saves the configuration schema into FILE
    --save-commented <BOOL>Adds comments to saved template, configuration, or schema; default: false
    +

    Input#

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    -n <FILE>
    --net-file <FILE>
    Use FILE as SUMO-network to create trips for
    -s <FILE>
    --stat-file <FILE>
    Loads the SUMO-statistics FILE
    +

    Output#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --write-license <BOOL>Include license info into every output file; default: false
    --output-prefix <STRING>Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.
    --precision <INT>Defines the number of digits after the comma for floating point output; default: 2
    --precision.geo <INT>Defines the number of digits after the comma for lon,lat output; default: 6
    -H <BOOL>
    --human-readable-time <BOOL>
    Write time values as hour:minute:second or day:hour:minute:second rathern than seconds; default: false
    -o <FILE>
    --output-file <FILE>
    Write generated trips to FILE
    +

    Time#

    + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -b <INT>
    --begin <INT>
    Sets the time of beginning of the simulation during the first day (in seconds); default: 0
    -e <INT>
    --end <INT>
    Sets the time of ending of the simulation during the last day (in seconds); default: 0
    --duration-d <INT>Sets the duration of the simulation in days; default: 1
    +

    Report#

    +

    All applications of the SUMO-suite handle most of the reporting +options the same way. These options are discussed at Basics/Using the +Command Line Applications#Reporting Options.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -v <BOOL>
    --verbose <BOOL>
    Switches to verbose output; default: false
    --print-options <BOOL>Prints option values before processing; default: false
    -? <BOOL>
    --help <BOOL>
    Prints this screen or selected topics; default: false
    -V <BOOL>
    --version <BOOL>
    Prints the current version; default: false
    -X <STRING>
    --xml-validation <STRING>
    Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto
    --xml-validation.net <STRING>Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never
    -W <BOOL>
    --no-warnings <BOOL>
    Disables output of warnings; default: false
    --aggregate-warnings <INT>Aggregate warnings of the same type whenever more than INT occur; default: -1
    -l <FILE>
    --log <FILE>
    Writes all messages to FILE (implies verbose)
    --message-log <FILE>Writes all non-error messages to FILE (implies verbose)
    --error-log <FILE>Writes all warnings and errors to FILE
    --debug <BOOL>Detailed messages about every single step; default: false
    +

    Random Number#

    +

    All applications of the SUMO-suite handle randomisation options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Random Number Options.

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    --random <BOOL>Initialises the random number generator with the current system time; default: false
    --seed <INT>Initialises the random number generator with the given value; default: 23423
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 09 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Basics/Basic_Computer_Skills.html sumo-1.6.0+dfsg1/docs/userdoc/Basics/Basic_Computer_Skills.html --- sumo-1.5.0+dfsg1/docs/userdoc/Basics/Basic_Computer_Skills.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Basics/Basic_Computer_Skills.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + Basics/Computer Skills - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Basics/Computer Skills
    + + + +

    Introduction#

    +

    To work with SUMO a few basic computer skills are needed (since +Linux-users are probably familiar with these, all explanations refer to +MS-Windows):

    +

    Using a Text Editor#

    +

    SUMO requires configuration files and data files for proper execution. +These files can be created and edited with a text editor.

    +

    On Windows you can open a basic text editor in the following way:

    +
    Start->All Programs->Accessories->NotePad
    +
    + +

    (Start->Alle Programme->Zubehör->Editor on a German installation of +windows)

    +

    Notepad is a very basic text editor. You can increase your comfort and +productivity by switching to an editor with more features. Consider +Notepad++ or +vim and also see this comparison of text editors

    +
    +

    Note

    +

    The files used with SUMO have by convention names ending with +.xml and variants of .sumocfg. Doing a double-click in Windows +Explorer will probably not open up your favourite text editor. Either +open the file from within your text editor or +learn how to +change file associations.

    +
    +

    Working with Files and Folders#

    +

    To work with the various files needed by SUMO you must be able to find +them on your file system. For starters learn about using Windows +Explorer here or +here.

    +

    Running Programs from the Command Line#

    +

    SUMO consists of many separate programs for different simulation-related +tasks (a reference to all the seperate programs can be found in +SUMO_User_Documentation#Appendices). +Only the program sumo-gui.exe SUMO-GUI has a +graphical user interface (GUI). All other programs must be called from +the command line.

    +

    At first you have to open the command line. On Windows, you have to +start "cmd.exe" (Start->Execute->cmd.exe). A black window should +appear. This is your command line. Since version 0.12.3 you can also +double-click the file start-command-line.bat (see also +below) to open a command line with +useful environment variables set (it can be found in the same folder as +all other sumo executables). When using Linux, you have to start a +terminal (like xterm).

    +

    The command line lets you start programs by typing the program's name +followed by program options. Since this can be automated it is +potentially more comfortable for repetitive tasks than using a GUI. +Commands look like this

    +
    netconvert --node-files=hello.nod.xml --edge-files=hello.edg.xml --output-file=hello.net.xml
    +
    + +

    Here netconvert is the name of the program and the rest of the command +sets options for this program.

    +

    The sections below should be sufficient to get you started using SUMO. +For further information about the command line see Basics/Using the +Command Line +Applications. +Also look here.

    +

    SUMO 0.12.3 and later#

    +

    In your SUMO release (all SUMO files and folders you downloaded) there +is a directory bin. This directory contains a batch file named +start-command-line.bat. This batch file starts a command-line and +makes sure that you can execute SUMO-programs.

    +
      +
    1. execute start-command-line.bat by double-clicking
    2. +
    3. navigate to the directory containing your configuration and network + files using the command cd (change + directory)
    4. +
    5. enter a command such as
    6. +
    +
    netconvert --node-files=hello.nod.xml --edge-files=hello.edg.xml --output-file=hello.net.xml
    +
    + +

    and press enter

    +

    SUMO 0.12.2 and earlier#

    +

    To use the command line perform the following steps

    +
      +
    1. Start->Run
    2. +
    3. type cmd and press enter.
    4. +
    5. navigate to the directory containing your configuration and network + files using the command cd (change + directory)
    6. +
    7. enter a command such as
    8. +
    +
    netconvert --node-files=hello.nod.xml --edge-files=hello.edg.xml --output-file=hello.net.xml
    +
    + +

    and press enter

    +

    If you receive an error like command not found your computer does not +know where to find netconvert.exe

    +

    If the files of your SUMO release are located at C:\sumo-0.12.2 You +can type out the full path to netconvert.exe like this:

    +
    C:\sumo-0.12.2\bin\netconvert --node-files=hello.nod.xml --edge-files=hello.edg.xml --output-file=hello.net.xml
    +
    + +

    and press enter.

    +

    Once this gets to cumbersome you can configure your PATH variable +instead as explained below.

    +

    SUMO_HOME#

    +

    Many tools require the environment variable +SUMO_HOME to be set to the base directory of the sumo installation. +This is the directory containing the folders bin and tools. Setting +environment variables is explained below.

    +
    +

    Note

    +

    this variable is also used to find xsd schema files for input validation. If the variable is not set, schema files are downloaded from the internet and this may file if the server sumo.dlr.de is not reachable.

    +
    +

    Configuring Path Settings#

    +

    To run programs from the command line comfortably you must configure +your PATH variable and the SUMO_HOME variable.

    +

    Windows#

    +
    +

    Note

    +

    If you have installed SUMO via the windows .msi installer file this is done automatically.

    +
    +
      +
    1. Right-click My Computer, and then click Properties.
    2. +
    3. Click the Advanced tab.
    4. +
    5. Click Environment variables.
    6. +
    7. Under user variables select PATH and click Edit. If no such variable + exists you must create it with the New-Button
    8. +
    9. Append ;C:\Program Files\sumo-1.6.0\bin to the end of the PATH value + (don't delete the existing values!)
    10. +
    11. Under user variables select SUMO_HOME and click Edit. If no such + variable exists you must create it with the New-Button
    12. +
    13. Set C:\Program Files\sumo-1.6.0 as the value of the SUMO_HOME variable
    14. +
    +
    +

    Note

    +

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

    +
    +
    +

    Caution

    +

    You must close and reopen any existing command-line window for the new variable setting to become effective.

    +
    +

    Linux#

    +

    Temporary Solution#

    +

    To set an environment variable temporarily, you can use the following +command in your terminal:

    +
    export SUMO_HOME="/your/path/to/sumo/"
    +
    + +

    This sets the environment variable to be used by any program or script +you start in your current shell session. This does not affect any other +shell session and only works until you end the session.

    +
    +

    Note

    +

    Replace /your/path/to/sumo/ with your sumo directory.

    +
    +

    Permanent Solution#

    +

    To set an environment variable permanently, follow these steps:

    +
      +
    1. Open a file explorer of your choice and go to /home/YOUR_NAME/.
    2. +
    3. Open the file named .bashrc with a text editor of your choice. + (You may have to enable showing hidden files in your file explorer)
    4. +
    5. Place this code export SUMO_HOME="/your/path/to/sumo/" somewhere + in the file and save. (Don't delete any existing content!)
    6. +
    7. Reboot your computer. (Alternatively, log out of your account and + log in again.)
    8. +
    +

    The environment variable will now be used by any program you start from +the command line with your current user account.

    +
    +

    Note

    +

    Replace YOUR_NAME with your username; Replace /your/path/to/sumo/ with your sumo directory.

    +
    +

    Using a pre-packaged version of SUMO#

    +

    When using the sumo version that comes with your package manager (i.e. +apt) the SUMO_HOME variable must be set to the base path of the tools +folder. On Ubuntu this is

    +
    /usr/share/sumo
    +
    + +

    Tips for using the Command-Line#

    +

    Copy and Paste#

    +

    The standard hotkeys for copy and paste do not work in the command-line. +You can access an edit menu for copy/paste by right-clicking the +command-line window. For increased convenience you can also right-click +the title-bar of the command-line window and select properties. Then +check the box quick-edit under the options-tab. You can now select +text with the left mouse button and copy it using right-click. Another +right-click is used to paste the copied text.

    +

    Repeating previous commands#

    +

    Hitting the up- and down-arrow buttons allows you to move through +the history of previously entered commands. You can edit these commands +or simply hit enter to execute them again.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Basics/Notation.html sumo-1.6.0+dfsg1/docs/userdoc/Basics/Notation.html --- sumo-1.5.0+dfsg1/docs/userdoc/Basics/Notation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Basics/Notation.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + Basics/Notation - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Basics/Notation
    + + + +

    This documentation uses coloring to differ between +different type of information. Below, these annotations and colors are +described.

    +

    Command Line#

    +

    If you encounter something like this:

    +
    netconvert --visum=MyVisumNet.inp --output-file=MySUMONet.net.xml
    +
    + +

    you should know that this is a call on the command line. There may be +also a '\' at the end of a line. This indicates that you have to +continue typing without pressing return (ignoring both the '\' and the +following newline). The following example means exactly the same as the +one above:

    +
    netconvert --visum=MyVisumNet.inp \
    +  --output-file=MySUMONet.net.xml
    +
    + +

    Application Options#

    +

    Command line option names are normally coloured this way. Their values <LIKE THIS> .

    +

    XML Examples#

    +

    XML-elements and attributes are shown like this. Their values, if variable, +<LIKE THIS>.

    +

    Complete examples of XML-Files are shown like the following:

    +
    <myType>
    +   <myElem myAttr1="0" myAttr2="0.0"/>
    +   <myElem myAttr1="1" myAttr2="-500.0"/>
    +</myType>
    +
    +

    Referenced Data Types#

    +
      +
    • <BOOL>: a boolean value, use "t" or "true" and "f" or "false" for + encoding
    • +
    • <INT>: an integer value, may be negative
    • +
    • <UINT>: an unsigned integer value, must be >=0
    • +
    • <FLOAT>: a floating point number
    • +
    • <TIME>: time, given in seconds; fractions are allowed, e.g. "12.1"
    • +
    • <STRING>: any string, but use ASCII-characters only
    • +
    • +

      <ID>: a string which must not contain the following characters: + '#'

      +
      +

      Caution

      +

      The list of not allowed characters is incomplete

      +
      +
    • +
    +
      +
    • <FILE> or <FILENAME>: the (relative or absolute) path to a file; + see also #Referenced File Types
    • +
    • <PATH>: a (a relative or absolute) path (usually to a folder)
    • +
    • <COLOR>: a quadruple of floats separated by ',' + (<FLOAT>,<FLOAT>,<FLOAT>,<FLOAT>), which describe the red, + green, blue, and alpha component ranging from 0.0 to 1.0 (the alpha + component is optional), alternatively the list may contain integers + in the 0-255 range. Please note that the separator must be a comma + and there are no spaces allowed. The color may also be defined using + a single string with a HTML color code or one of + the basic colors ("red", "green", "blue", "yellow", "cyan", + "magenta", "black", "white", "grey")
    • +
    • <2D-POSITION>: two floats separated by ',' + (<FLOAT>,<FLOAT>), which describe the x- and the y-offset, + respectively. z is 0 implicitly
    • +
    • <3D-POSITION>: three floats separated by ',' + (<FLOAT>,<FLOAT>,<FLOAT>), which describe the x- , y- and the + z-offset, respectively
    • +
    • <POSITION-VECTOR>: A list of 2D- or 3D-Positions separate by ' '. + I.e. (<2D-POSITION> <2D-POSITION>,<3D-POSITION>)
    • +
    • <2D-BOUNDING_BOX>: four floats separated by ',' + (<FLOAT>,<FLOAT>,<FLOAT>,<FLOAT>), which describe x-minimum, + y-minimum, x-maximum, and y-maximum
    • +
    • <PROJ_DEFINITION>: a string containing the projection definition + as used by proj.4; please note that you have to embed the definition + string in quotes
    • +
    +

    Referenced File Types#

    + +

    Further Schemes#

    +

    Brackets '[' and ']' indicate that the enclosed information is +optional. Brackets '<' and '>' indicate a variable - insert your own +value in here.

    +

    <SUMO_HOME> is the path you have saved your SUMO-package into.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Basics/Using_the_Command_Line_Applications.html sumo-1.6.0+dfsg1/docs/userdoc/Basics/Using_the_Command_Line_Applications.html --- sumo-1.5.0+dfsg1/docs/userdoc/Basics/Using_the_Command_Line_Applications.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Basics/Using_the_Command_Line_Applications.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,582 @@ + + + + + + + + + + + + + + + + + + + Basics/Using the Command Line Applications - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Basics/Using the Command Line Applications
    + + + +

    Most of the applications from the SUMO package are command line tools. +Currently, only SUMO-GUI is not. If you do not +know what a "command line" is, we refer you to the page about basic computer skills.

    +

    The following presents some peculiarities of the SUMO-suite +applications.

    +

    Using SUMO Applications from the Command Line#

    +

    SUMO applications are plain executables. You just start them by typing +their name from the command line; for example +NETGENERATE is called by

    +
    netgenerate.exe
    +
    + +

    under Windows and by

    +
    netgenerate
    +
    + +

    under Linux.

    +

    This simply starts the application +(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:

    +
    SUMO netgenerate Version 1.6.0
    + Build features: Linux-4.1.39-56-default Proj GDAL GUI
    + Copyright (C) 2001-2017 DLR and contributors; http://sumo.dlr.de
    + License EPLv2: Eclipse Public License Version 2 <https://eclipse.org/legal/epl-v20.html>
    + Use --help to get the list of options.
    +
    + +

    Options#

    +

    Each application has a set of options which define which files shall be +processed or generated, or which define the application's behaviour. +Normally, an application needs at least two parameter - an input file +and an output file - but almost always more parameter are used for a +fine-grained control. Each application's options are described within +the application's description. In the following, it is described how +options are set.

    +

    Setting Options on the Command Line#

    +

    There are two kinds of options: boolean options which do not require an +argument and are set to true if the option is present (but accept usual +boolean values like "true" and "false" as argument) and options which +require an argument. Setting an option with an argument on the command +line consists of two parts - the option name and the option's value. For +example, if one wants the simulation to load a certain road network, +"mynet.net.xml", the following must be written:

    +
    --net mynet.net.xml
    +
    + +

    The '--' in front indicates that the option's long name is following +("net") in this case. After a whitespace the option's value must be +given. It is also possible to use a '=' instead of the whitespace:

    +
    --net=mynet.net.xml
    +
    + +

    Some often used options can be abbreviated. The abbreviation for the +--net-option is -n. The following has the same effect as the two examples +above:

    +
    -n mynet.net.xml
    +
    + +

    Please note that an abbreviation is indicated using a single '-'.

    +
    +

    Note

    +

    Not all abbreviations have the same meaning across the applications from the SUMO-suite.

    +
    +

    Option Value Types#

    +

    The SUMO applications know what kind of a value they expect to be set. +For example, NETGENERATE allows you to set the +default number of lanes, which of course must be an integer value. In +the case, a string or something else is given, this is recognized and +the application answers with an error message on startup. Please note +that the decimal point in a float is encoded using a dot (".").

    +

    A special case of value types are lists, for example the list of +additional files to load into a simulation. When giving more than a +single file, the files must be divided using ','. This also counts for +lists of other value types, as integers or floating point numbers.

    +

    Configuration Files#

    +

    Because the list of options may get very long, configuration files were +introduced. You can set up a configuration file which contains all the +parameter you want to start the application with. Moreover, you have to +start the application with only this configuration file given.

    +

    A configuration file is an XML-file that has a root element named +configuration. The options are written as +element names, with the wanted value being stored in the attribute +value (or v); +the option --net-file *test.net.xml* given on the command line would become +<net-file value="test.net.xml"/> within the +configuration file. For the boolean options the value should be either +"true", "on", "yes", "1", or "x" for the activation and "false", "off", +"no", or "0" for deactivating the option (case does not matter here).

    +

    For the example above, the configuration file (let's save it under +"test.sumocfg", see below) would look like:

    +
    <configuration>
    +    <input>
    +        <net-file value="test.net.xml"/>
    +        <route-files value="test.rou.xml"/>
    +        <additional-files value="test.add.xml"/>
    +    </input>
    +</configuration>
    +
    +

    The section input given above has only +documentation purposes and no functional meaning.

    +

    A less verbose but equivalent version would look like:

    +
    <configuration>
    +    <n v="test.net.xml"/>
    +    <r v="test.rou.xml"/>
    +    <a v="test.add.xml"/>
    +</configuration>
    +
    +

    The according SUMO execution call - working with both +configuration versions - would be:

    +
    sumo.exe -c test.sumocfg
    +
    + +

    This means that instead of the parameters, we only give the name of the +configuration file using the option --configuration-file <FILE> or -c <FILE>. If you want to give no further +options on the command line it is possible to leave out the "-c" as +well:

    +
    sumo.exe test.sumocfg
    +
    + +

    Naming Conventions for Configuration Files#

    +

    Depending on the targetted application, the configuration files have +different extensions. It is highly recommended to follow this +convention. For using simulation configurations with +SUMO-GUI this is even required - +SUMO-GUI can only read simulation configurations +named "*.sumocfg".

    +

    All conventions for configuration extensions can be found on the page on +used file extensions.

    +

    Configuration Files vs. Command Line Parameter#

    +

    In addition to a configuration file, further command line parameter can +also be given on the command line. If a parameter is set within the +named configuration file as well as given on the command line, the value +given on the command line is used (overwrites the one within the +configuration file). If you want to disable a boolean option which was +enabled in the configuration file, you need to give the "false" value on +the command line explicitly, like --verbose false

    +

    Generating Configuration Files, Templates and Schemata#

    +

    The applications of the SUMO package allow you to generate configuration +file templates. It is possible to save an empty configuration - a +configuration template. This can be done by using the --save-template <FILE>. In this case, +the configuration will only contain the parameters filled with their +default values.

    +

    Also it is possible to save a configuration file which contains the +currently set values. An application can be forced to do this using the +option --save-configuration <FILE>.

    +

    Last but not least one can generate an XML schema (using the +option --save-schema <FILE>) to validate configuration files against. For the SUMO +application this schema should be equivalent to the one found at +https://sumo.dlr.de/xsd/sumoConfiguration.xsd (respectively for the +other executables). Please note that the schema is more strict than the +SUMO options parser since it only validates the verbose version given +above.

    +

    In either case, if further information on the parameters is wanted, one +can also pass the option --save-commented. Then, some further comments on each parameter +are generated.

    +

    Environment variables in Configuration Files#

    +

    It is possible to refer to environment variables in configuration files. The syntax to refer to an environment variable is ${VARNAME}. For example, your configuration file may reference a variable called NETFILENAME, containing the name of a network file, with the following configuration settings.

    +
    <configuration >
    +    <input>
    +        <net-file value="${NETFILENAME}.net.xml"/>
    +    </input>
    +</configuration>
    +
    +

    Common Options#

    +

    The applications from the SUMO suite share several options. They are +given in the following.

    +

    Reporting Options#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -v <BOOL>
    --verbose <BOOL>
    Switches to verbose output; default: false
    --print-options <BOOL>Prints option values before processing; default: false
    -? <BOOL>
    --help <BOOL>
    Prints this screen; default: false
    -V <BOOL>
    --version <BOOL>
    Prints the current version; default: false
    -X <STRING>
    --xml-validation <STRING>
    Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto
    --xml-validation.net <STRING>Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never
    -W <BOOL>
    --no-warnings <BOOL>
    Disables output of warnings; default: false
    -l <FILE>
    --log <FILE>
    Writes all messages to FILE (implies verbose)
    --message-log <FILE>Writes all non-error messages to FILE (implies verbose)
    --error-log <FILE>Writes all warnings and errors to FILE
    +

    The logging options --log and --message-log also enable the verbose output but only into +the given file (unless --verbose was given as well). Errors get always printed to +the console (in addition to a possible log-file).

    +

    The XML validation options enable XML +schema processing in +the XML parser. This performs a basic validation of the input and is +highly recommended especially for beginners because it easily finds +spelling mistakes in the input which otherwise might be silently +ignored. Validation is only performed if the XML-schema is declared within the input file.

    +

    Random Number Options#

    +

    These options configure how the seed of the random number generator is +determined. The same seed leads to the same sequence of generated random +numbers.

    +

    By default the seed is a hard-coded fixed value. So, as long as all +configuration settings are kept the same, the outputs of repeated +simulation runs will be the same. To change this, use one of the +following options.

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    --seed <INT>Set a particular seed for the random number generator. By using different values you can have different but still reproducible simulation runs.
    --randomMake SUMO choose a seed. If available the seed will be based on output of /dev/urandom otherwise the seed will be derived from current system time. This option has precedence over option --seed <INT>.
    +

    Attention: The precedence of --random over --seed <INT> means that it is impossible +to set --random in a configuration file and overwrite it by --seed <INT> in the command +line. There might be a solution in future.

    +

    Generating and Reading Files#

    +

    Almost every file the tools from the SUMO package read or generate are +written in XML. You should get familiar with +XML before starting to work with +SUMO. SUMO allows you to import files from different sources, but +"native" SUMO files - road network descriptions, route and/or demand +descriptions, infrastructure descriptions, etc. - are SUMO-specific, not +following any standard. XML files can be read and written using a simple +text editor and we usually do this. Nonetheless, several other tools +exist and may be reused.

    +

    For some of the file types used by SUMO, a xsd (XML Schema Definition) +exists. Please consult the page on file extensions for a list of described +file formats.

    +

    Hints on using XML#

    +
      +
    • The default viewer for XML files on Windows is the Internet + Explorer. It may be used for validating your XML files. The syntax + of an XML file should be valid if the Internet Explorer can + completely load it.
    • +
    • Eclipse allows to write XML documents + following a given xsd (XML Schema Definition).
    • +
    +

    Writing files#

    +

    Several options expect a file name (<FILE>) to write into as parameter. When +being given at the command line, the given path is assumed to be +relative to the current working directory. When being given in a +configuration file, the file path is assumed to be relative to the +configuration file's path. Absolute paths are of course also allowed.

    +

    Usually, existing files with the same name are overwritten without a +warning. The directory must exist, where the output file shall be +written.

    +

    Besides writing to a file, further special notations allow to:

    +
      +
    • write into the null-device (no output at all): use "NUL" or + "/dev/null" for file name (both notations work platform independent)
    • +
    • write into a socket: use "<HOST>:<PORT>" for file name
    • +
    • write to stdout (print on command line): use "stdout" or "-" for + file name
    • +
    • write to stderr: use "stderr" for file name
    • +
    • The special string 'TIME' within a filename will be replaced with + the application start time
    • +
    +

    At the moment it is not possible to read input from sockets or from +stdin.

    +

    As a simple way of modifying output file names, the option --output-prefix <STRING> is provided. +The given string will be prepended to all files written by an +application.

    +
    +

    Note

    +

    Multiple date sources (i.e. detector definitions) are permitted to write to the same output file.

    +
    +

    Using Python tools from the Command Line#

    +

    Many tools that are distributed by SUMO (in the +<SUMO_HOME>/tools folder are written in the python +programming language. To use them, python 2.7 must be installed on your computer.

    +

    Then you need to make sure that the environment variable SUMO_HOME is set. The +easiest way is to open the command-line window using +start-command-line.bat.

    +

    Furthermore you need to make sure that your computer knows where to find +the python tools. The easiest (but somewhat cumbersome) method is to run +the tool using its full path:

    +
    C:\Users\yourname>D:\path_to_sumo\tools\randomTrips.py  ... arguments ...
    +
    + +

    Alternatively, you can add the directory in which the tool lies to your +PATH-Variable.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models/ACC.html sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models/ACC.html --- sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models/ACC.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models/ACC.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + + + Car-Following-Models/ACC - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Car-Following-Models/ACC
    + + + +

    Overview#

    +

    The integrated ACC car-following model is based on the work of Milanés & +Shladover [1] and Xiao, Wang & van Arem [2], wherein the developed +control law in the ACC control algorithm is explicitly divided into +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.

    +

    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 +vehicles in the range covered by the sensors or preceding vehicles exist +in a spacing larger of 120 m.

    +

    Gap control mode#

    +

    The gap control mode aims to maintain a constant time gap between the +ACC-equipped vehicle and its predecessor and is activated when the gap +and speed deviations (with respect to the preceding vehicle) are +concurrently smaller than 0.2 m and 0.1 m/s, respectively.

    +

    Gap-closing control mode#

    +

    The gap-closing controller enables the smooth transition from speed +control mode to gap control mode and is triggered when the spacing to +the preceding vehicle is smaller than 100 m. If the spacing is between +100 m and 120 m, the ACC-equipped vehicle retains the previous control +strategy to provide hysteresis in the control loop and perform a smooth +transfer between the two strategies.

    +

    Collision avoidance control mode#

    +

    The collision avoidance mode prevents rear-end collisions when safety +critical conditions prevail.This mode is activated when the spacing to +the preceding vehicle is smaller than 100 m and the gap deviation is +negative.

    +

    Notes#

    +
      +
    • The implemented model can be found in <SUMO_HOME>/src/microsim/cfmodels/MSCFModel_ACC.cpp.
    • +
    • Literature on the developed ACC driving model and its implementation + can be found + here.
    • +
    • This part of SUMO was developed and extended within the project + TransAID.
    • +
    • The model is primarily intended for use in specific traffic + situations.
    • +
    +

    References#

    +
      +
    1. Milanés, V., & Shladover, S. E. (2014). Modeling cooperative and + autonomous adaptive cruise control dynamic responses using + experimental data. Transportation Research Part C: Emerging + Technologies, 48, pp. 285–300. + https://doi.org/10.1016/j.trc.2014.09.001
    2. +
    3. Xiao, L., Wang, M., & van Arem, B. (2017). Realistic Car-Following + Models for Microscopic Simulation of Adaptive and Cooperative + Adaptive Cruise Control Vehicles. Transportation Research Record: + Journal of the Transportation Research Board, 2623, pp. 1–9. + https://doi.org/10.3141/2623-01
    4. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models/CACC.html sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models/CACC.html --- sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models/CACC.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models/CACC.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + Car-Following-Models/CACC - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Car-Following-Models/CACC
    + + + +

    Overview#

    +

    The integrated CACC car-following model is based on the work of Milanés +& Shladover [1], Xiao, Wang & van Arem [2] and Xiao, Wang, Schakel & +van Arem [3], wherein the developed control law in the ACC control +algorithm is explicitly divided into 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.

    +

    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 +vehicles in the range covered by the sensors or when the time-gap is +larger than 2 s.

    +

    Gap control mode#

    +

    The gap control mode aims to maintain a constant time gap between the +CACC-equipped vehicle and its predecessor and is activated when the gap +and speed deviations (with respect to the preceding vehicle) are +concurrently smaller than 0.2 m and 0.1 m/s, respectively.

    +

    Gap-closing control mode#

    +

    The gap-closing controller enables the smooth transition from speed +control mode to gap control mode and is triggered when the time-gap is +less than 1.5 s. If the time-gap is between 1.5 s and 2 s, the +CACC-equipped vehicle retains the previous control strategy to provide +hysteresis in the control loop and perform a smooth transfer between the +two strategies.

    +

    Collision avoidance control mode#

    +

    The collision avoidance mode prevents rear-end collisions when safety +critical conditions prevail. This mode is activated when the time-gap is +less than 1.5 s and the gap deviation is negative.

    +

    Notes#

    + +

    References#

    +
      +
    1. Milanés, V., & Shladover, S. E. (2014). Modeling cooperative and + autonomous adaptive cruise control dynamic responses using + experimental data. Transportation Research Part C: Emerging + Technologies, 48, pp. 285–300. + https://doi.org/10.1016/j.trc.2014.09.001
    2. +
    3. Xiao, L., Wang, M., & van Arem, B. (2017). Realistic Car-Following + Models for Microscopic Simulation of Adaptive and Cooperative + Adaptive Cruise Control Vehicles. Transportation Research Record: + Journal of the Transportation Research Board, 2623, pp. 1–9. + https://doi.org/10.3141/2623-01
    4. +
    5. Xiao, L., Wang, M., Schakel, W., & van Arem, B. (2018). Unravelling + effects of cooperative adaptive cruise control deactivation on + traffic flow characteristics at merging bottlenecks. Transportation + Research Part C: Emerging Technologies, 96, 380–397. + https://doi.org/10.1016/j.trc.2018.10.008
    6. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models.html sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models.html --- sumo-1.5.0+dfsg1/docs/userdoc/Car-Following-Models.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Car-Following-Models.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Car-Following-Models - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Car-Following-Models
    + + + +

    Car-Following Models#

    +

    This overview page collects information regarding car-following models +in SUMO. It is still a stub and needs be expanded.

    + + +

    Model Parameters#

    +

    Most car-following models have their own set of parameters. +Because some models have a common ancestry they share some parameters. +These are described below.

    +

    actionStepLength#

    +

    This parameter is used to decouple the simulation step length (option --step-length) +from the frequency of driver decision making. It can be set either in +the <vType>-definition as attribute actionStepLength or by setting a default +value for all vTypes using option --default.action-step-length <FLOAT>.

    +

    By default, the action step length is equal to the simulation step +length which works well for the default step length of 1s. When +performing sub-second simulation by setting a lower step-length value, +it may be useful to maintain a higher action step length in order to +model reaction times and also in order to reduce computational demand +and thus speed up the simulation.

    +

    tau#

    +

    This parameter is intended to model a drivers desired time headway (in +seconds). It is used by all models. Drivers attempt to maintain a +minimum time gap of tau between the rear bumper of their leader and +their own front-bumper + minGap to assure the possibility to brake in +time when their leader starts braking and they need tau seconds reaction +time to start breaking as well. The real reaction time is fundamentally +limited by the simulation step size (SUMO option --step-length <FLOAT>), +resp. the action step length (option --default.action-step-length <FLOAT>, parameter ). For that reason a +value of tau below this step-size may lead to collisions if the leader +suddenly starts braking hard. If tau is larger than step-size the +situation is safe but drivers will still react during each simulation +step unless a custom action-step-length is used (e.g. by setting option --default.action-step-length).

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 25 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/ChangeLog.html sumo-1.6.0+dfsg1/docs/userdoc/ChangeLog.html --- sumo-1.5.0+dfsg1/docs/userdoc/ChangeLog.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/ChangeLog.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,2624 @@ + + + + + + + + + + + + + + + + + + + ChangeLog - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + ChangeLog
    + + + +

    Version 1.6.0 (28.04.2020)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed negative depart delay. Vehicles with a sub-step-length depart time now depart in the subsequent step. Issue #964
      • +
      • Fixed sublane model bug that reduced flow on intersections and caused emergency braking. Issue #6649
      • +
      • Fixed sublane model bug that was causing cyclical switching between keep-right and sublane-alignment choices. Issue #6084
      • +
      • Fixed sublane model bug that was causing invalid lane alignment in multimodal networks. Issue #6691
      • +
      • Fixed crash when depart-triggered vehicles were discarded. Issue #6690
      • +
      • Removed invalid warning for public transport users. Issue #6698
      • +
      • Fixed invalid right-of-way at traffic light junctions with right-turn-on-red rules. Issue #6068
      • +
      • Fixed bug that caused junction collisions to go unnoticed. Issue #6779
      • +
      • Stopping duration no longer exceeds the planned duration/until time by one simulation step. Issue #6755
      • +
      • ACC model no longer uses double minGap when queued. Issue #6728
      • +
      • Fixed extremely low speed of W99 model when approaching intersections and stops. Issue #6823
      • +
      • Fixed crash after rerouting. Issue #6835
      • +
      • Fixed bugs where stops on cyclical routes where ignored after loading simulation state. Issue #6811
      • +
      • Fixed invalid 'density' and 'occupancy' values (too high) in edgeData output. Issue #5723
      • +
      • Fixed crash when running with multiple threads. Issue #6806
      • +
      • Option --ignore-route-errors can now be used to ignore the error 'will not be able to depart using the given velocity (slow lane ahead)'. Issue #6853
      • +
      • Fixed crash when using option --no-internal-links and defining a stop on an internal lane. Issue #6855
      • +
      • Fixed invalid vehicle angles when using option --lanechange.duration in a left-hand network. Issue #6856
      • +
      • Ride arrival stop is now considered when a vehicle stops multiple times on the arrival edge. Issue #2811
      • +
      • Fixed unsafe insertion speed for IDM-vehicles. Issue #6904
      • +
      • Fixed bug that was causing cooperative speed adjustments to fail. Issue #5124
      • +
      • Fixed invalid emission-edgeData when restricting the output time interval. Issue #6944
      • +
      • Railway fixes:
          +
        • Train reversal problems. Issue #6692, #6782, #6797, #6851, #6860, #6906, #6908
        • +
        • Train routing now considers space requirement for train reversal. Issue #6697, #6743, #6799
        • +
        • Train routing is no longer effected by occupied edges that are beyond rail signal control. Issue #6741
        • +
        • Invalid train speed after insertion on short edge. Issue #6801
        • +
        • CarFollowModel 'rail' now correctly uses minGap. Issue #6796
        • +
        • Invalid stop position after splitting train. Issue #6788
        • +
        • Rail signal allows entering occupied block for joining trains. Issue #6794
        • +
        • Joining trains with different minGap values. Issue #6795
        • +
        • carFollowModel 'Rail' no longer ignores attributes 'accel', 'decel' and 'emergencyDecel', 'apparentDecel' and 'collisionMinGapFactor'. Issue #6834
        • +
        • Fixed invalid warning "Invalid approach information after rerouting". Issue #6914
        • +
        • Fixed invalid warning "Circular block" at dead-end sidings. Issue #6926
        • +
        +
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Calibrator attribute vTypes is now working. Issue #6702
      • +
      +
    • +
    • NETCONVERT
        +
      • Fixed precision when filtering network with a given boundary. Issue #6206
      • +
      • Fixed missing connections when importing OpenDRIVE. Issue #6712
      • +
      • OpenDRIVE networks where a single edges is connected to more than two junctions are now supported. Issue #6828
      • +
      • Fixed invalid link state at railway switch that would cause uncessary deceleration. Issue #6833
      • +
      • Fixed invalid link direction in rail networks with unusual geometry. Issue #6924
      • +
      • OpenDRIVE import now correctly handles signalReference and signal laneValidity elements. Issue #2517, #2366
      • +
      • Fixed errors when loading custom lane shapes. Issue #6892, #6893, #6894, #6895
      • +
      • Fixed bug that could cause an invalid intermodal network to be written. Issue #6901
      • +
      +
    • +
    • SUMO-GUI
        +
      • Fixed layout of meso edge parameter dialog at high occupancy (regression in 1.5.0)
      • +
      • Fixed crash when simulation ends while tracking person attributes. Issue #6784
      • +
      • Fixed missing stop annotations in 'show-route' mode. Issue #6814
      • +
      • Fixed crash when scaling railway track width. Issue #6859
      • +
      +
    • +
    • NETEDIT
        +
      • Fixed empty route id when creating route from non-consecutive edges with custom id. Issue #6722
      • +
      • Fixed invalid displayed connection attribute. Issue #6760
      • +
      • Fixed crash when moving a selection of junctions and edges. Issue #4918
      • +
      +
    • +
    • DUAROUTER
        +
      • Attribute group of <ride> and <personTrip> is no longer lost. Issue #6555
      • +
      • Train routing now considers space requirement for train reversal. Issue #6697
      • +
      +
    • +
    • OD2TRIPS
        +
      • Option --departpos is now working for pedestrians and personTrips. Issue #6720
      • +
      +
    • +
    • TraCI
        +
      • Fixed crash when calling vehicle.moveTo for an off-road vehicle with tripinfo-output. Issue #6717
      • +
      • Fixed crash when trying add subscription filter for context subscrition of persons around an ego vehicle. Issue #6735
      • +
      • Fixed crash and invalid results when using 'vehicle.addSubscriptionFilterLateralDistance'. Issue #6770, #6941
      • +
      • Fixed crash when adding vehicle with depart="triggered". Issue #6793
      • +
      • Fixed invalid routing results when calling 'traci.simulation.findIntermodalRoute(..., routingMode=ROUTING_MODE_AGGREGATED)'. Issue #6827
      • +
      +
    • +
    • Tools
        +
      • sort_routes.py can now handle trips, triggered vehicles and human-readable times.
      • +
      • routeSampler.py: fixed bias in departure time for the generated vehicles. Issue #6786
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Taxi device now supports ride sharing. Issue #6544
      • +
      • Added option --extrapolate-departpos. When this option is set, vehicles with a departure time that lies between simulation steps have their depart position shifted forward to better reflect their position at the actual insertion time. This can greatly reduce depart delay and incrase and insertion flow in high-flow situations. Issue #4277
      • +
      • Traffic lights of type 'actuated' and 'delay_based' now support the use of custom detectors. Issue #5125, Issue #6773
      • +
      • The new route attribute period is now applied repeatedly when rerouting the vehicle and the new route contains stops with attribute until to shift those times forward (e.g. on cyclical rerouters for public transport vehicles). Issue #6550
      • +
      • The new route attribute repeat can now be used to define repeating routes. When the route contains stop definitions with the until-attribute, the new route attribute period must be used to shift the repeated stop times. Issue #6554
      • +
      • Added option --fcd-output.params KEY1,KEY2,... to extend fcd-output with additional vehicle generic parameters. Issue #6685
      • +
      • Tripinfo-output attribute vaporized now includes specific description for premature vehicle removal (collision, traci, calibrator, ...). Issue #6718
      • +
      • Tripinfo-output now includes timeloss for person rides. Issue #6891
      • +
      • Added option --statistic-output to write various statistics in XML format. Issue #3751
      • +
      • vType attribute 'lcSigma' now always affect lateral position (previously, only sublane model and continuous lanechange modle were affected).
      • +
      • Option --save-state.times now accepts human-readable time. Issue #6810
      • +
      • Added new 'device.toc' parameters 'mrmSafeSpot' and 'mrmSafeSpotDuration' to control the behavior during minimum-risk maneuvers. Issue #6157
      • +
      • Added option --vehroute-output.stop-edges to record the edges that were driven ahead of stop as part of the vehroute output. Issue #6815
      • +
      • Added option --weights.priority-factor FLOAT to factor the priority of edges into the routing decision with a configurable weight (edges with higher priority are preferred increasingly when setting this to a higher value). An application for this is railway routing. Issue #6812
      • +
      • Added option --device.rerouting.bike-speed to compute aggregated speeds for bicycles separately. Issue #6829
      • +
      • Automatic train rerouting by rail signal logic can now be disabled by setting option --device.rerouting.railsignal false as well as by vehicle and vType parameters (key="device.rerouting.railsignal"). Issue #6781
      • +
      • Trains can now be joined in reverse order (rear part id is kept). Issue #6803
      • +
      • Element <busStop> now supports attribute 'parkingLength'. This can be used define the available space for stopping vehicles with parking="true" independent of the length of the busStop along the lane. Issue #3936
      • +
      • edgeData output now includes the new attribute 'laneDensity' which reports the density in vehs per km per lane. Issue #6840
      • +
      • edgeData and laneData definitions now support the new attribute 'writeAttributes' which can be used to reduce the list of output attributes to the given list of attribute names. Issue #6847
      • +
      • Public transport import from OSM now supports route definitions with abbreviated style. Issue #6862
      • +
      • Added option --save-state.rng. When this option is set, saved simulation state will include the state of all random number generators and this state will be restored upon loading. This RNG state takes up about 500kb. Issue #1418
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Added new 'Data Mode' to edit files with edge and turn-related data (<edgeData>, <edgeRelation>). Issue #6461
      • +
      • Traffic light phase editing function 'Insert Phase' now takes successive green states into account when synthesizing transition phases. Issue #6732
      • +
      +
    • +
    • SUMO-GUI
        +
      • Missing data values (color by edgeData) can now be distinguished from negative data values. Issue #6660
      • +
      • <edgeRelation>-data files can now be visualized. Issue #6659
      • +
      • Traffic lights of type 'delay_based' can now dynamically toggle detector visualization.
      • +
      • Train reversals are now indicated when ''Show Route'' is active. Issue #6744
      • +
      • Vehicles can now be colored by 'by stop delay'. This computes the estimated departure delay at the next <stop> with an 'until' attribute. Issue #6821
      • +
      • Travelled distance (odometer) is now listed in the vehicle parameter dialog.
      • +
      • Junction name is now listed in the junction parameter dialog and can optionally by drawn in the view. Issue #6635
      • +
      • Lanes that explicitly allow rail and passenger traffic are now highlighted with a distinct color in the default color scheme. Issue #6844
      • +
      • When loading a network with internal lanes and setting the option --no-internal-links, the internal lanes are still shown. This helps to understand track topology in rail networks. Issue #6852
      • +
      • Visualization of a vehicles route can now be configured with the menu option 'Draw looped routes' which can be disabled to reduce clutter in looped public transport routes. Issue #6917
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Edge attribute spreadType now supports value roadCenter which aligns edges with common geometry so that the geometry reflects the middle of the road regardless of differences in lane numbers (causing natural alignment for turning lanes). Issue #1758
      • +
      • Added option --default.spreadtype to set the default spread type for edges. Issue #6662
      • +
      • Connections now support attribute ''length'' to customize the length of internal lanes. Issue #6733
      • +
      • Added option --default.connection-length to overwrite the length of internal lanes with a specific value. Issue #6733
      • +
      • Added option --railway.topology.direction-priority to assign edge priority values based on the preferred track usage direction (determined heuristically from uni-directional track).
      • +
      • Added node attribute 'name' to hold an optional string label. Issue #6635
      • +
      • Direction-specific speeds are now imported from OSM (maxspeed:forward, maxspeed:backward). Issue #6883
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • When loading weights from edgeData files, arbitrary attributes can now be used with option --weight-attribute. Issue #6817
      • +
      • Added option --weights.priority-factor FLOAT to factor the priority of edges into the routing decision with a configurable weight (edges with higher priority are preferred increasingly when setting this to a higher value). Issue #6812
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Meso simulation now supports TraCI
      • +
      • Parking vehicles are now picked up by context subscriptions. Issue #6785
      • +
      • Added functions 'getFollowSpeed', 'getSecureGap', 'getStopSpeed' for accessing carFollowModel functions to the vehicle domain. Issue #3361
      • +
      • Added function 'traci.vehicle.getStopDelay' to retrieve the estimated delay at the next (public transport) stop. Issue #6826
      • +
      +
    • +
    • Tools
        +
      • added osmWebWizard option to import a simplified network that is only for cars. Issue #6595
      • +
      • matsim_importPlans.py now supports alternative input dialects and sorts its output.
      • +
      • added new tool net2kml.py to convert sumo networks to KML
      • +
      • Function sumolib.net.getShortestPath can now penalize train reversals using the optional argument 'reversalPenalty'
      • +
      • tls_csvSignalGroups.py now supports defining controlled pedestrian crossings. Issue #6861
      • +
      • routeSampler.py improvements
          +
        • supports loading multiple data intervals. Data aggregation can be customized using options --begin, --end, --interval
        • +
        • supports loading multiple files (routes, edgedata, turns). The corresponding options were renamed accordingly (--route-files, --edgedata-files, --turn-files)
        • +
        • supports optimization by linear programming using option --optimize INT|full (requires scipy). The interger argument can be used to configure the maximum deviation from the input route distribution.
        • +
        • supports output of mismatch between measured counts and sampled counts for visualization in SUMO-GUI via edgeData and edgeRelation files using option --mismatch-output
        • +
        • supports direct optimization of route input (without resampling) by setting option --optimize-input
        • +
        • supports multi-edge counting data using <edgeRelation from="A" to="D" via="B C" count="INT"/>. Issue #6729
        • +
        • supports non-consecutive edgeRelations with maximum gap by using the new option --turn-max-gap . Issue #6726
        • +
        • supports loading origin-destination relations with the new option --od-files. Issue #6888
        • +
        • supports writing results with routeIDs, routeDistribution and flows instead of vehicles. Issue #6730
        • +
        +
      • +
      +
    • +
    +

    Other#

    +
      +
    • Network version is now 1.6 (Issue #1758)
    • +
    • The turn-file format used by JTRROUTER is now deprecated. Instead the new edgeRelation-file format should be used. To convert old files into the new format, the tool turnFile2EdgeRelations.py can be used. The tools jtcrouter.py and routeSampler.py will only accept the new file format as input.
    • +
    • NETCONVERT
        +
      • Signal references from OpenDRIVE networks are now exported as a mapping from sumo-tls-link-index to OpenDRIVE-signal-id instead of sumo-edge to OpenDRIVE-signal-name. Issue #6863
      • +
      +
    • +
    • NETEDIT
        +
      • supermode hotkeys changed
          +
        • F2: Network mode
        • +
        • F3: Demand mode
        • +
        • F4: Data mode
        • +
        +
      • +
      • Default color for edge-geometry points changed to avoid confusion with rail signals when coloring junctions by type. Issue #6749
      • +
      +
    • +
    +

    Version 1.5.0 (11.02.2020)#

    +

    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)
      • +
      • Fixed bug that was causing pedestrian jamming. Issue #6457
      • +
      • Fixed bug that was causing unsafe situations between bicycles and turning cars. Issue #6437, #6438
      • +
      • Fixed unsafe insertion speed when using 'stopOffset'. Issue #6411
      • +
      • Extra device output (emissions etc.) is now included in tripinfo-output when using option --tripinfo-output.write-unfinished. Issue #6422
      • +
      • Time spent parking is now included in tripinfo-output 'stopTime'. Issue #6423
      • +
      • Fixed lateral jump when driving across lanes with different width in a left-hand network and using sublane simulation. Issue #6573
      • +
      • Fixed bug where rerouting failed for no reason. Issue #6572
      • +
      • Fixed invalid error when loading a network where edge-IDs have non-ascii characters. Issue #6597
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed visualisation of containers. Issue #6426
      • +
      • Text setting options 'constant size' and 'background' are now working for 'link junction index' and 'link tls index'. Issue #6376
      • +
      • Traffic light parameter 'running duration' is now correct when switching phases via TraCI. Issue #6520
      • +
      • Fixed bug where Locator-Dialog 'Center' button remained disabled after successfully locating objects via substring filtering. Issue #6593
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Creating new traffic light plans where a plan already exists no longer results in invalid plans at joined traffic lights or traffic lights with signal groups. Instead a copy of the existing plan is created. Accordingly the button caption now varies between 'Create' and 'Copy'. Issue #6536, #6537
      • +
      • Fixed invalid position of Vehicle with negative departPos. Issue #6473
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Fixed invalid simulation state when vehicles are teleporting. Issue #6408
      • +
      • Meso calibrator is now shown in GUI. Issue #2345
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed bug where loaded connection was not created. Issue #6470
      • +
      • Fixed bug where turning restrictions from OSM were violated. Issue #6482
      • +
      • Option --flip-y-axis is now working. In can be used to turn a right-hand network into a left-hand network and vice versa. Issue #3838
      • +
      • Fixed bug where option --tls.guess-signals failed to detect signals on incoming edges. Issue #6493, Issue #6584
      • +
      • Fixed invalid right-of-way rules in left-hand network. Issue #6496
      • +
      • Connection attribute 'pass' now overrides conflicts between straight and turning connections from the same edge. Issue #6497
      • +
      • Fixed invalid permissions for internal lanes when the incoming lane has more restrictions than the outgoing lane. Issue #5557
      • +
      • Fixed bug that was causing missing green phases for some connections at joined traffic lights. Issue #6582
      • +
      • Fixed node shape computation for difficult geometries. Issue #6585
      • +
      • The status of option --tls.ignore-internal-junction-jam is no longer lost when loading a '.net.xml' file. Issue #6559
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Context subscriptions can now be removed individually from the python client (before every unsubscribeContext removed all)
      • +
      • Fixed invalid changing to the opposite side when using changeLaneRelative(vehID, -1) on lane 0. Issue #6576
      • +
      • Fixed premature changing from the opposide side when a duration was set for changeLaneRelative. Issue #6577
      • +
      • Fixed invalid result when calling traci.lanearea.getLastStepMeanSpeed in subsecond simulation. Issue #6605
      • +
      • Fixed invalid stage depart values when calling traci.simulation.findIntermodalRoute. Issue #6600
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added new model for electric hybrid vehicles and overhead lines and power substations.
      • +
      • Railway simulation now supports splitting and joining trains, also known as portion working. Issue #6398
      • +
      • Added option --device.fcd.radius which allows fcd output for persons and vehicles that are within the given range around equipped vehicles. Issue #6410
      • +
      • Added new 'taxi' device to allow simulation of demand-responsive transport. Issue #6418
      • +
      • Added option --step-log.period INT to set the number of simulation steps between outputs. The new default is 100 which brings a major execution speedup when running sumo on windows with step-log (where command-line output is slow). Issue #6377
      • +
      • Added option --fcd-output.acceleration to inlcude acceleration values in fcd-output. When sublane simulation is enabled, attribute 'accelerationLat' is added as well. Issue #6448
      • +
      • Added option --lanechange-output.xy to inlcude acceleration coordinaet values in lanechange-output. Issue #6588
      • +
      • Aggregated tripinfo output now includes average speed. Issue #6480
      • +
      • Trips, flows, personTrips and walks with attributes fromJunction, toJunction and viaJunctions are now supported when setting option --junction-taz. Issue #6474
      • +
      • Calibrators can now be used to update vehicle types by defining flows with the 'type' attribute and without the 'vehsPerHour' attribute. Issue #6219
      • +
      • When definining automated switching between traffic light programs, the new attribute 'period' can now be used to define repeating switch times. Issue #6540
      • +
      • Cooperative lane changing at roundabouts can now be configured independently from other cooperation by setting the new vType attribute 'lcCooperativeRoundabout'. Issue #6565
      • +
      • Cooperative speed adjustment can now be configured independently from other cooperation by setting the new vType attribute 'lcCooperativeSpeed'. Issue #6534
      • +
      • Vehicles can now foresee speed reductions on their lane and change before being slowed down (configurable by new vType attribute 'lcSpeedGainLookahead'. Issue #6547
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Dead-end links in the middle of a road are now colored in magenta to highlight connectivity problems. Issue #6391
      • +
      • Vehicles that stop (with a <stop>) in the middle of the road now activate emergency blinkers. Issue #6608
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Stacked vehicles (overlapping due to similar departPos) are now indicated by a number. Issue #6485
      • +
      • Stacked vechicles can now be "unstacked" by setting the option 'spread vehicles'. This spreads them alonger the lane sorted by depart time. Issue #5602
      • +
      • Flows are now distinguished from individual vehicles with a text caption. Issue #6486
      • +
      • Junctions with missing connections are now highlighted in magenta. Issue #6391
      • +
      • Geometry points are now clearly distinguished from junctions by color and size. Issue #6514
      • +
      • Traffic light mode now allows grouping and ungrouping signals. Issue #2958
      • +
      • Traffic light mode 'Clean States' function now also compactifies state and removes all unused indices. Issue #3828
      • +
      • The background grid size can now be increased and decreased with hotkeys CTRL+PAGE_UP, CTRL+PAGE_DOWN. Issue #6542
      • +
      • Demand objects (vehicles, routes, ...) can now be located by ID. Issue #5110
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Improved connection building heuristic. Issue #6295, #6467, #6468
      • +
      • Improved heuristic for option --junctions.join. Issue #872, Issue #5398
      • +
      • Improved heuristic for option --tls.guess. Issue #6512
      • +
      • Added options --numerical-ids.edge-start INT, --numerical-ids.node-start INT to relabel network elements with numbers starting at the given value. Issue #6372
      • +
      • Added option --no-turnarounds.except-turnlane which causes turnlanes to be built only if there is an exclusive (left) turn lane. Issue #6444
      • +
      • Added option --tls.group-signals which assigns the same signal index to connections that share the same sequence signal states. Added option --tls.ungroup-signals which reverts grouping and assigns a distinct signal index to every connection. Issue #2958
      • +
      • Symbolic speed limits in OSM are now supported for all countries. Issue #6566
      • +
      • Added option --fringe.guess to heuristically mark nodes on the outer network boundary. Issue #6624
      • +
      • Added option --no-turnarounds.fringe to prevent building of turnaround-connections at the network fringe. Issue #6621
      • +
      • Added option --ptstop-output.no-bidi to skip automatic generation of a bidi-stop on a bidirectional rail edge. Issue #6598
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • Fringe nodes are now automatically marked in grid networks when setting --grid.attach-length > 0. Issue #6622
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • The maximum map-matching distance is now configurable using option --mapmatch.distance. Also, mapmatching with large distance is now computationally efficient. Issue #6476
      • +
      • Trip, flows, personTrips and walks with attributes fromJunction,toJunction and viaJunctions are now supported when setting option --junction-taz. Issue #6474
      • +
      • Trips can now be written with attributes fromJunction and toJunction and viaJunctions by setting option --write-trips.junctions. Issue #6474
      • +
      • When using trip attributes fromXY, fromLonLat, etc. the given positions can now be mapped to junctions instead of edges by setting option --mapmatch.junctions. Issue #6475
      • +
      +
    • +
    +
      +
    • JTRROUTER
        +
      • Added option --sources-are-sinks (shortcut -S). When this option is set, all flows will terminate upon reaching the from-edge of another flow. Issue #6601
      • +
      • Added option --discount-sources (shortcut -D). When this option is set, the flow departing at an edge will be reduced by the amount of traffic that has reached this edge from upstream flows. When combined with option --sources-are-sinks, upstream flows will terminate at a downstream edge when the source flow number has been reached. This can be used to build a scenario from flow counts at arbitrary locations. Issue #6601
      • +
      +
    • +
    +
      +
    • TraCI / Libsumo
        +
      • Added context subscription filter that filters in a given range around the vehicles route 'addSubscriptionFilterLateralDistance'. Issue #6287
      • +
      • Libsumo now supports context subscription filters
      • +
      +
    • +
    +
      +
    • Tools
        +
      • duaIterate.py now supports intermodal scenarios. Issue #6403
      • +
      • Added duaIterate.py option --measure-vtypes to improve accuracy of measured travel times when different vehicle types can use different lanes.
      • +
      • Added tileGet.py to retrieve image tiles from public servers. Issue #6279
      • +
      • Added randomTrips.py option --personrides LINE to generated person rides with the give line id.
      • +
      • Added randomTrips.py option --junction-taz to generated trips, flows, personTrips and walks between junctions. Issue #6474
      • +
      • Added the ability to download Satellite image backgrounds (using tileGet.py) in osmWebWizard. Issue #6481
      • +
      • Added new tool jtcrouter.py to build a traffic demand scenario based on turn-count data (this uses JTRROUTER in the background). Issue #6229
      • +
      • Added new tool routeSampler.py to build a traffic demand scenario based on turn-count and edge-count data. This tool samples from a given set of routes to meet the detected counts. Issue #6616
      • +
      • Added new tool turnCount2EdgeCount.py which converts turn-count data into edge-count data. Issue #6619
      • +
      +
    • +
    +

    Other#

    +
      +
    • Build
        +
      • removed autotools build
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • the settings file no longer accepts the element breakpoints-file (command line option is still there)
      • +
      • renamed attributes in the settings (breakpoint.value to breakpoint.time and decal.filename to decal.file)
      • +
      • Default settings values 'show link junction index' and 'show link tls index' changed because their interpretation varies after #6376. Old GUI-setting files must be updated to achieve the default look.
      • +
      +
    • +
    + +
      +
    • TraCI
        +
      • traci.lane.getLinks (python) now returns the extended descriptions by default, the older behavior should not be used anymore (but is still available using a second parameter)
      • +
      +
    • +
    +

    Version 1.4.0 (10.12.2019)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed crash when setting a negative value for option --device.rerouting.pre-period Issue #6012
      • +
      • Avoiding unnecessary rerouting while trips and flows are delayed from insertion. Issue #6013
      • +
      • Lanechange reason is now written in lanechange-output when using the simple continuous lanechange model. Issue #6014
      • +
      • Fixed invalid mode change from car during intermodal routing. Issue #6070
      • +
      • Fixed invalid cooperative speed adjustment in sublane model. Issues #6266, #6267
      • +
      • Fixed crash related to parkingAreaReroute. Issue #6283
      • +
      • Fixed startup delay in railway simulation when begin time is set to a high value. Issue #6321
      • +
      • Fixed invalid state file names when using human-readable times. Issue #6365
      • +
      • Fixed invalid energy usage (battery parameters ignored) in emission-ouput, full-output, tripinfo-output and edgeData-emissions. Issue #6364, #6359
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed crash when defining walks between disconnected locations. Issue #5369
      • +
      • Fixed crash transforming trips to flows. Issue #6050
      • +
      • Now blocked shapes can be moved again. Issue #6053
      • +
      • Fixed invalid snap to grid when trying to move junction. Issue #6067
      • +
      • Coloring edges by generic parameter is now working. Issue #6062
      • +
      • "Open in SUMO-GUI" option now works correctly when there are spaces in the path. Issue #6227
      • +
      • Fixed bug where multiple junctions could mistakenly be created in the same place. Issue #6228
      • +
      • Fixed invalid lane shapes while moving edge geometry in a lefthand network. Issue #6234
      • +
      • Fixed invalid edge shape when using 'replace junction' ahead of junction with custom shape. Issue #5777
      • +
      • Connection mode function 'select dead starts' now correctly selects lanes without predecessor (regression in 1.0.0). Issue #6278
      • +
      • Fixed slowdown clicking over edges with high concentration of routes. Issue #6276
      • +
      • Fixed crash when clicking in message window with invalid crossing. Issue #6368
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed bugs in classification of roundabouts. Issue #6032
      • +
      • Preventing invalid double tracks when using typemap osmNetconvertRailUsage.typ.xml. Issue #6056
      • +
      • Disabling invalid handling of railway track count in OSM input. Issue #6057
      • +
      • Missing track numbers in bidirectional railway edges. Issue #6058
      • +
      • Corrected handling of user-specified edge length when adding bidirectional railway edges. Issue #6280
      • +
      • Fixed invalid junction and connection shapes in plain-xml-output when using option --proj.plain-geo Issue #6066
      • +
      • Fixed invalid geometry when using option --geometry.max-segment-length Issue #6074
      • +
      • Fixed invalid network when using option --geometry.split Issue #6075
      • +
      • Fixed invalid handling of custom crossing shape when network coordinates are shifted. Issue #4621
      • +
      • Fixed invalid error message when loading .tll-file with tlLogid-programID other than '0'. Issue #6160
      • +
      • Fixed missing bidirectional edges due to invalid geometry-manipulations. Issue #6370, #6366
      • +
      • Avoiding superfluous nodes when using options --geometry.remove and --ptline-output
      • +
      +
    • +
    +
      +
    • MESO
        +
      • device.emissions now collects data. Issue #6086
      • +
      • Fixed crash when using device.btsender or device.btreceiver. Issue #6087
      • +
      • Fixed crash when loading network with internal lanes that have neighbor ('neigh') data. Issue #6205
      • +
      • Fixed crash when saving state while using calibrators. Issue #6369
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Sublane-borders are no longer drawn for railways and sidewalks (where the sublane model does not apply).
      • +
      • Fixed crash when using vehicle popup-menu after the vehicle has left the simulation. Issue #6107
      • +
      • Fixed crash after removing view with active vehicle visualization once the vehicle leaves the simulation. Issue #6112
      • +
      • "Open in Netedit" option now works correctly when there are spaces in the path. Issue #6227
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed invalid mode change from car during intermodal routing. Issue #6070
      • +
      • Fixed invalid car routes during intermodal routing. Issue #6077
      • +
      • Fixed crash when loading network imported from VISUM. Issue #6358
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraaS functions Trafficlight.getControlledJunctions, Edge.setEffort, Edge.getEffort, Edge.adaptTraveltime", Edge.getAdaptedTraveltime are now working. Issue #6019
      • +
      • Vehicles being controlled by moveToXY are no longer ignored by cross-traffic while on an intersection. Issue #6140
      • +
      • Traffic light programs of type 'actuated' and 'delay_based' can now be created. Issue #4324
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • All Applications
        +
      • Environment variables can now be referenced in configuration files using a shell-like syntax: <net-file value="${NETFILENAME}.net.xml"/>. Issue #1901
      • +
      • The new option --aggregate-warnings can be used to group warnings of the same type and give only their count after the first N warnings occured.
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • Simulation of parking vehicles now optionally takes into account maneuvering times. Issue #5956
      • +
      • Vehicle stop elements now support attribute 'speed'. This can be used to force a vehicle to drive with a fixed speed on a particular stretch of lane. Issue #1020
      • +
      • When defining a person ride, setting attribute lines="ANY" can now be used to take any vehicle that stops at the destination busStop or destination edge. Issue #6039
      • +
      • when defining vehicle stops, the new attribute 'extension' can be used to limit delays when too many people are boarding or when expected persons do not show up. Issue #6072 #3635
      • +
      • Improved smoothness of acceleration / deceleration for carFollowModel 'IDM' when speed limits change and there is no leader vehicle. Issue #6080
      • +
      • Persons can now start their plan in a driving vehicle by setting depart="triggered". Issue #4042
      • +
      • Traffic light type 'actuated' now supports skipping phases by defining a list of alternative successor phases in phase attribute 'next'. Issue #5042
      • +
      • stopinfo-output now includes optional stop attributes 'tripId' and 'line'. Issue #6320
      • +
      • Vehicles now support the new symbolic departPos value 'stop' which lets the start at the first stop along their route. Issue #6322
      • +
      • Permissions of internal lanes (connections) are now taken into account independent of the lanes before and after the intersection. Issue #6210
      • +
      • Option --duration-log.statistics can now be set with shortcut -t. Issue #6378
      • +
      • added new vType parameter lcLaneDiscipline to control whether vehicles will stay between lanes to drive faster (sublane model only)
      • +
      • added new vTypeParameter lcSigma to control lateral imperfection (sublane model and simple continuous lanechange model)
      • +
      • Option --lanechange-duration can now be used together with opposite-direction-driving. Issue #6270
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Vehicles that reach maximum impatience can now pass junctions from an unprioritized road regardless of foe traffic. The old behavior can be restored by disabling impatience growth via --time-to-impatience 0. Issue #5830
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Railway network input with sharp angles along an edge is now corrected by default. (The previous behavior can be enabled with option --geometry.min-angle.fix.railways false). Issue #6921
      • +
      • Pedestrian paths are no longer checked for minimum turning angles (greatly reducing superfluous warnings). Issue #6022
      • +
      • The option --opposites.guess.fix-length is no longer required when using networks with default lengths (no user-set values). The resulting networks will automatically adapt their edge lengths when changing geometry. Issue #6028
      • +
      • When importing public transport lines (--ptline-output), edge permissions are now adapted to allow the respective public transport vehicle. Issue #3437
      • +
      • When importing public transport lines from OSM, stops that are not part of the road network are now mapped to the nearest line edge (previously, these stops were discarded). Issue #6114
      • +
      • Permissions can now be set for individual connections independent of incoming and outgoing lanes. Issue #6217
      • +
      • Regional road names (A9, I-95) are now exported as edge params. They are also exported as Regional Name ID in dlr-navteq-output. Issue #6256
      • +
      • Added option --offset.z to apply a constant z-offset to a simulation network. Issue #6274
      • +
      • Added option --tls.ignore-internal-junction-jam to force building traffic light right-of-way rules without mutual response flags. Issue #6269
      • +
      • Now VISUM networks in English, French and Italian can be imported (only German networks were supported previously). Issue #1767
      • +
      • Improved handling of VISUM connector-edges. By default, no extra edges are generated anymore and instead the regular network edges are assigned to the TAZ. Issue #6356
      • +
      • Now TAZ imported from VISUM can be written to a separate file using option --taz-output. Issue #6349
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Now additionals and routes can optionally be loaded using option "Open in SUMO-GUI"). Issue #6049
      • +
      • Added shortcuts (Shift F1,F2,F3) for edge templates. Issue #6033
      • +
      • VTypes can be edited in multiple selected vehicles. Issue #6051
      • +
      • Improved support of GNEStops. Issue #5367
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added 'select reachable' function to the lane context-menu to select all lanes that can be reached by a given vehicle class from the origin lane. After such an operation, the coloring scheme 'by reachability' can be used to render an isochrone travel time map. Issue #3650
      • +
      • The currently loaded options can now be saved to a configuration via the file menu. Issue #5707
      • +
      • The object locator dialog now allows filtering the object list by matching all ids/names that include a given text string.
      • +
      • Added option for rendering the (relative) route index for each edge when drawing a vehicles route. Issue #6199
      • +
      • Traffic light parameter dialog now includes more values describing the current phase (phase, phase name, duration, minDur, maxDur, running duration)
      • +
      • Shift-left-clicking on a vehicle now starts tracking
      • +
      • The speedFactor for the currently tracked vehicle can now be set via a new slider
      • +
      • The probabilities for routeProbReroute can now be toggled between 100% and 0% by shift-clicking on the rerouter symbol or on the new route-direction arrows.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Added function 'traci.trafficlight.getServedPersonCount' to return the number of pedestrians that would be served by all the crossings for a given phase index. Issue #6088
      • +
      • Can now access vehicle device parameters 'device.ssm.minTTC', 'device.ssm.maxDRAC', 'device.ssm.minPET'. Issue #4983
      • +
      • Added function 'traci.simulation.writeMessage' to append a custom message to the log file (and sumo-gui message window). Issue #6249
      • +
      • Added context subscription filter for viewing angle 'traci.vehicle.addSubscriptionFilterFieldOfVision'. Issue #6273
      • +
      +
    • +
    +
      +
    • Tools
        +
      • When importing public transport traffic with osmWebWizard, vehicles from incomplete lines now start and end their routes at the network border instead of starting at the first stop. Issue #6025
      • +
      • Added new tool analyzePersonPlans.py to count the different types of plans in a route file. Issue #6083
      • +
      • Added new tool matsim_importPlans.py to import intermodal traffic plans from MATSim
      • +
      • Added new tool generateContinuousRerouters.py to easily create a simulation where vehicles circulate according to configured turning ratios without ever arriving. #6310
      • +
      +
    • +
    +

    Other#

    +
      +
    • SUMO-GUI, NETEDIT
        +
      • The hotkey for 'Edit Visualization' was changed to 'F9' to avoid conflicts when pasting clipboard.
      • +
      • Zooming now centers on the mouse-position by default instead of on the screen center. As before, the behavior can be toggled using the icon in the view menu bar and persists across application restarts. Issue #5992
      • +
      +
    • +
    • NETCONVERT
        +
      • By default repeated warnings of the same type are aggregated (only their number is given beyond the initial 5). To see all warnings, the option --aggregate-warnings -1 can be used. Issue #6335
      • +
      • The default number of lanes when importing 'highway.secondary' from OSM was changed from 2 to 1. Issue #5690
      • +
      +
    • +
    • Documentation
        +
      • moved from MediaWiki to MkDocs
      • +
      • Added 'Hello World' tutorial that shows how to create a simulation by only using NETEDIT and SUMO-GUI (no command line or text editor necessary).
      • +
      • Added new example simulation in 'docs/examples/sumo/model_railroad'. The speed of the train as well as the railroad switches can be controlled while the simulation is running. Merry Christmas!
      • +
      +
    • +
    +

    Version 1.3.1 (27.08.2019)#

    +

    Bugfixes#

    +
      +
    • NETEDIT
        +
      • Fixed crash when defining vehicle stops. Issue #5963 (regression in 1.3.0)
      • +
      • Fixed crashing and invalid errors when editing vehicle type attributes. Issue #5957 (regression in 1.3.0)
      • +
      • Fixed crash after defining flow on unusable edges. Issue #5958
      • +
      • Fixed crash after loading flow with invalid route. Issue #5967
      • +
      • Fixed bug where new vehicles could not be created if trips with a specific id already existed. Issue #5969
      • +
      • Fixed invalid application focus after activating checkboxes Issue #5966 (regression in 1.2.0)
      • +
      • Attribute trainType for carFollowModel Rail can now be set. Issue #5959
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • Fixed crash when loading rail signals with long gaps in between. Issue #5983
      • +
      • Fixed invalid restrictions on vType parameters. Issue #5991 (regression in 1.3.0)
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed high running time when using edge-removal options with long edge lists. Issue #5954
      • +
      • Fixed creation of invalid network after defining invalid splits. Issue #5980
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed crash on empty vType in input
      • +
      +
    • +
    +
      +
    • TraCI / libsumo
        +
      • Function vehicle.changeLaneRelative is now working with a negative lane offset. Issue #5990
      • +
      • several functions were adopted to have the same interface in libsumo and the python client, see Issue #5523
      • +
      +
    • +
    +
      +
    • Tools
        +
      • flowrouter.py can now route vehicles on networks with isolated edges and pedestrian structures. Issue #5951
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • NETEDIT
        +
      • Added menu option for recomputing routes of trips and flows in demand mode (F5) Issue #5978
      • +
      +
    • +
    +
      +
    • TraCI / libsumo
        +
      • You can now trigger the usage of libsumo instead of TraCI in Python by setting the environment variable LIBSUMO_AS_TRACI to any value.
      • +
      +
    • +
    + +

    Other#

    +
      +
    • Miscellaneous
        +
      • Updated SUMOLibraries structure. To build on windows, the libraries must be updated as well.
      • +
      • removed doxygen docu from the distribution
      • +
      +
    • +
    +

    Version 1.3.0 (20.08.2019)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed invalid default parameters for the electrical vehicle model that were causing too high energy consumption. Issue #5505
      • +
      • Fixed deadlock on controlled intersection with pedestrian crossing. Issue #5487 (regression in 1.1.0)
      • +
      • Fixed invalid emergency braking in jammed scenario. Issue #5632
      • +
      • Fixed inappropriate lane choice when approaching a multi-lane roundabout in dense traffic. Issue #2576, Issue #2634
      • +
      • Rail signals ahead of uncontrolled switches now properly take the vehicle route into account (this was causing invalid red states previously). Issue #5137
      • +
      • Options --tripinfo-output.write-unfinished, --vehroute-output.write-unfinished now also apply to persons. Issue #3939
      • +
      • Fixed bug that could corrupt pedestrian routes when walking across very short lanes. Issue #5661
      • +
      • Fixed bug that could cause sumo to freeze when using opposite-direction driving.
      • +
      • Fixed crash when using option --device.rerouting.pre-period 0 with a --scale lower than 1. Issue #5704
      • +
      • Fixed emergency braking after lane changing when using carFollowMode="Wiedemann". Issue #5711
      • +
      • Fixed exaggerated braking to avoid overtaking on the right. Issue #5713
      • +
      • Fixed invalid junction rules when using sublane simulation on lefthand-networks Issue #5738
      • +
      • Fixed invalid edgeData and tripinfo output in the mesoscopic model when vehicles are completely jammed. Issue #5722
      • +
      • Fixed crash when using SSM-Device with opposite-direction-driving Issue #5231, #5839
      • +
      • FullOutput now returns all speeds as m/s. Issue #5787
      • +
      • Fixed invalid error when using calibrators with a fixed departLane. Issue #5794
      • +
      • Fixed invalid jamming at occupied parkingAreas close to the start of a lane. Issue #5864
      • +
      • Fixed detector placement at actuated traffic light (avoiding warnings of the form minDur X is too short for detector for a detector gap of Y) Issue #5119
      • +
      • Access edges to stops from lanes which do not allow pedestrians are now ignored. Issue #5890
      • +
      • Fixed crash on using ToC device with an unknown vehicle type. Issue #5761
      • +
      • Route length in tripinfo output is now correct also when rerouting happens. Issue #5755
      • +
      • When combining <closingReroute> and <destProbReroute>, all vehicles that cannot reach their target due to the closing are rerouted. Issue #5904
      • +
      • Fixed bug where vehicles could enter a fully occupied parkingArea. Issue #5905
      • +
      • Fixed bug where vehicles would fail to exit from a parkingArea. Issue #5907
      • +
      • Fixed unusable person plan when loading a personTrip with a non-zero departPos. Issue #5927
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed crash when rendering short vehicles as simple shapes with guiShape truck/trailer and truck/semitrailer. Issue #5510 (regression in 1.2.0)
      • +
      • Pedestrian crossings and walkingareas are no longer listed in the edge locator dialog by default (they can still be enabled by checking Show internal structures. Issue #5613
      • +
      • Fixed invalid image position and size when rendering vehicles as raster images. Issue #5688 (regression in 1.2.0)
      • +
      • Fixed invalid vehicle coloring in mesoscopic mode. (regression in 0.32.0).
      • +
      • Fixed invalid vehicle angle when using the sublane model in lefthand-networks. Issue #5737
      • +
      • Fixed 3D-View rotation when holding middle-mouse button.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed handling of custom shapes in lefthand networks (for connections, crossings, walkingareas). Issue #5507
      • +
      • Fixed missing connections when importing OpenDRIVE networks with short laneSections in connecting roads. Issue #5504
      • +
      • Fixed invalid link direction at intermodal intersection and at intersections with sharp angles. Issue #5511, Issue #5512
      • +
      • Fixed invalid large traffic light clusters when using options --tls.guess --tls.join. Issue #5524
      • +
      • Fixed invalid custom edge lengths when using option --geometry.remove Issue #5612
      • +
      • Zipper junctions with multiple incoming edges are now supported. Issue #5657
      • +
      • Fixed error when guessing ramps which are close to each other. Issue #5681
      • +
      • Option --tls.guess now works correctly at junctions with 2 incoming edges. Issue #5684
      • +
      • Fixed invalid junction shape at geometry-like nodes where only the lane-width changes. Issue #5749
      • +
      • Fixed invalid lane geometry when defining <split> for lefthand network. Issue #5856
      • +
      • VISSIM networks can now also have multiple lanes connected to one. Issue #5560
      • +
      • Option --junctions.scurve-stretch is now working for junctions with non-default radius. Issue #5881
      • +
      • Fixed exaggerated lane widths when importing briefly-orthogonal border lanes from OpenDRIVE. Issue #5888
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Crossing tls indices are now properly reset when deleting traffic light. Issue #5549
      • +
      • Controlled pedestrian crossings at a rail_crossing nodes are no longer lost when saving the network with netedit. Issue #5559 (regression in 1.0.0)
      • +
      • Snap-to-grid is now working in networks with elevation data. Issue #5878
      • +
      • Fixed bug where neigh-edges could get lost upon loading and saving a network. Issue #5916
      • +
      • Demand mode issues Issue #5576
          +
        • Creating routes from non-consecutive edges is now working
        • +
        • Flow attribute route is now correctly saved
        • +
        • Fixed bug where some demand attributes could not be edited
        • +
        +
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Fixed invalid departPos in tripinfo-output when loading saved state. Issue #5819
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Option --write-trips is now working for persons. Issue #5563
      • +
      +
    • +
    +
      +
    • JTRROUTER
        +
      • Vehicle types with PHEMlight emission class can now be handled. Issue #5669
      • +
      +
    • +
    +
      +
    • TraCI / Libsumo
        +
      • TraCI does not execute another step when close() is called. Please recheck your scripts, they might finish one step earlier than before.
      • +
      • Fixed TraaS method Simulation.convertRoad. Issue #5478
      • +
      • Fixed bug where vehicle is frozen after removing stop at stopping place via TraCI. Issue #5561
      • +
      • Fixed invalid distance to far-away TLS returned by vehicle.getNextTLS Issue #5568
      • +
      • Fixed crash due to invalid person list at busStop. Issue #5620
      • +
      • Persons are no longer listed before their departure in traci.person.getIDList() Issue #5674 (regression in 1.1.0)
      • +
      • Fixed crash when using parallel rerouting with TraCI. Issue #5553
      • +
      • Function traci.vehicle.setStop now correctly updates an existing stop when setting a new until-value. Issue #5712
      • +
      • TraaS function SumoTraciConection.close() now cleanly disconnects from the SUMO server. Issue #4962
      • +
      • Fixed several issues with position conversions when the edge has a length different from the geometrical distance. Issue #5780
      • +
      • Libsumo now supports getAllSubscriptionResults
      • +
      • Function traci.vehicle.moveTo can now move vehicles onto internal lanes. Issue #5932
      • +
      • Traffic lights for junction types rail_signal and rail_crossing can now be switched off with trafficlight.setProgram("off") and remote-controlled with trafficlight.setRedYellowGreenState. Issue #5946
      • +
      +
    • +
    +
      +
    • General
        +
      • The build version number is updated correctly after all git updates. Issue #3963
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added junction model parameter jmDriveAfterYellowTime to configure driving at yellow behavior. Issue #5474
      • +
      • calibrators now accept attribute vTypes to restrict their application (insertion/removal) to selected vehicle types. Issue #3082
      • +
      • Vehicle <stops>s now support the optional attributes tripId and line to track the current state when serving a cyclical public transport route. Issue #5280, Issue #5514
      • +
      • Added vehicle class rail_fast to model High-Speed-Rail Issue #5525
      • +
      • Netstate-output now includes attribute speedLat when using a model for lateral dynamics. Issue #5636
      • +
      • Pedestrians now switch to jam resolving behavior earlier when jammed on a pedestrian crossing. The time threshold can be configured with the new option --pedestrian.striping.jamtime.crossing <TIME> (default 10s) Issue #5662
      • +
      • Extended ToC Model by various functionalities (4 new parameters: dynamicToCThreshold, dynamicMRMProbability, mrmKeepRight, maxPreparationAccel). Issue #5484
      • +
      • Detectors for actuated traffic lights can now be placed on upstream lane to achieve the desired distance to the stop line. Issue #5628
      • +
      • Added lane-change model parameter lcOvertakeRight to model violation of rules against overtaking on the right side. Issue #5633
      • +
      • Lanechange-output now includes the speeds of surrounding vehicles at the time of lane-change. Issue #5744
      • +
      • Added new departSpeed values desired (departure with speedLimit * speedFactor) and speedLimit (departure with speedLimit). Issue #2024
      • +
      • Added new carFollowModel W99 which is a 10-Parameter version of the Wiedemann model. Issue #5765
      • +
      • Saved states now include lane ids and only the lanes with traffic on them. This reduces state file size and also permits loading state files with a modified network. Issue #5872
      • +
      • Initial "pseudo routes" (consisting of start and end edge only) are only written optionally. Issue #5639
      • +
      • Traffic lights with type delay_based now use a default detection range of 100m (instead of using the whole lane length). This greatly improves efficiency by avoiding interference from far-away upstream junctions. The default range can be set using the new option --tls.delay_based.detector-range <FLOAT>. Issue #5897
      • +
      • Added battery model parameter "recuperationEfficencyByDecel" to vary the recuperation efficiency based on the deceleration level. Thanks to Sagaama Insaf for the contribution. Issue #5675
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Now importing High-Speed-Rail tracks from OSM Issue #5525
      • +
      • Now importing attribute railway:bidirectional from OSM Issue #5531
      • +
      • Now importing track number (track_ref) parameter from OSM Issue #5533
      • +
      • Railway usage information (main, branch, industrial, ...) can now be imported from OSM by loading the new typemap osmNetconvertRailUsage.typ.xml. Issue #5529
      • +
      • Vehicle class rail_electric is now correctly assigned depending on railway electrification. Issue #5528
      • +
      • Now distinguishing more junction types in verbose summary. Issue #5541
      • +
      • Added experimental multi-language support for VISUM import using the new option --visum.language-file and language mapping files in <SUMO_HOME>/data/lang. Issue #1767
      • +
      • Added option --junctions.right-before-left.speed-threshold <FLOAT> to influence the heuristic for guessing junction type (priority/right-before-left) from edge speeds. Issue #5799
      • +
      • Added option --join-lanes <BOOL> to allow merging of adjacent non-vehicle lanes (sidewalk, green verge). Issue #5880
      • +
      • Added option --geometry.remove.width-tolerance <FLOAT> to allow removal of geometry-like nodes when lane widths of merged edges differ no more than the given threshold. Issue #5883
      • +
      • Option --junctions.scurve-stretch is no longer applied for non-vehicular connections. Issue #5887
      • +
      • Added options for generating bicycle lanes: --bikelanes.guess --bikelanes.guess.max-speed --bikelanes.guess.min-speed --bikelanes.guess.from-permissions --bikelanes.guess.exclude --default.bikelane-width These options work the same as the corresponding sidewalk options and can also be used with NETGENERATE. Issue #5924
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Inverting selection now takes selection locks into account. Issue #5615
      • +
      • When setting tltype to actuated, suitable values for minDur and maxDur will be added to the phases. Issue #5637
      • +
      • Added support for Vehicles, Flows and Trips. Issue #5585 Issue #5086 Issue #5050
      • +
      • Partial support of GNEPersons Issue #5369
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added new visualization presets selection (coloring everything according to selection status) and rail (analyze rail networks by showing allowed driving directions for all tracks and highlighting rail signals when zoomed out). Issue #5660
      • +
      • Added context menu option to show/hide detectors for actuated traffic lights Issue #5627
      • +
      • Added visualization option for drawing an edge color legend. Issue #5682
      • +
      • Vehicles and persons can now be removed via right-click menu (remove). Issue #5649
      • +
      • All Vehicle and person parameters that change during the simulation are now updated in any open parameter window. (previously string parameters were always static). Issue #4210
      • +
      • The parkingAreas parameter dialog now includes the number of alternative parkingAreas due to loaded parkingAreaReroute definitions.
      • +
      • The Recalibrate Rainbow functionality now generates a distinct color for every permission code when coloring by permissions. Issue #5852
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Importing railway entities from OSM is now supported and a new typemap was added for this. Issue #5572
      • +
      • Shapefile import now supports typemaps and also image files in type maps. Issue #5891
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Added function simulation.getBusStopWaitingIDList to retrieve + waiting persons. Issue #5493
      • +
      • Added function getPersonCapacity to vehicle and vehicletype + domains. Issue #5519
      • +
      • Added function addDynamics to polygon domain. Issue #5396
      • +
      • Added function highlight to poi and vehicle domain. Issue #5396
      • +
      • TraaS function Vehicle.setStop now supports the arguments + startPos and until in line with the other clients. Issue #5710
      • +
      • Added subscription filtering to C++ client. Issue #5772
      • +
      • Added function person.appendStage which allows adding a stage object directly to a person plan. #5498
      • +
      • Added function person.replaceStage which allows replacing an upcoming stage with a stage object. #5797
      • +
      • Added function vehicle.getLateralSpeed to the python and C++ client. #5010
      • +
      • StepListeners in the python client can now be added to a single connection (also allows using them with Flow). Issue #5863
      • +
      • The python client now tries again to start sumo and connect with a different port if the port chosen was in use. Issue #5802
      • +
      • Function vehicle.moveTo can now be used to move the vehicle to any lane on its route including those that were already passed.
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Added new toolbox <SUMO_HOME>/tools/contributed/saga (SUMO Activity Generation) to create intermodal scenarios from OSM data. This includes building a virtual populatin and generating mobility plans for a while day.
      • +
      • Public transport import from + OSM (also used by + osmWebWizard now + filters out lines that only run at night. If the option --night is set, + only night-service lines are exported. Issue #5548
      • +
      • Improving UTF8 support for xml2csv.py and csv2xml.py. Issue #5538, Issue #5588
      • +
      • Added a new tool + generateTurnRatios.py + for generating turning ratios according to a given route file. Issue #1666
      • +
      • The option cost modifier in + duaIterate.py is + removed, since it is used for specific projects. Ticket #5594 is open + to check the respective content for publication and to extend + the cost modifier function.
      • +
      • Added randomTrips.py + options --angle-factor <FLOAT> and --angle <FLOAT> to modify trip probabilities by direction of + travel. Issue #5642
      • +
      • checkStyle.py now also checks Java files and can be used for single files. Issue #5653, Issue #5652
      • +
      • extractTest.py can now download tests directly from sumo.dlr.de. Issue #1092
      • +
      +
    • +
    • General
        +
      • All applications can now read and write gzipped files (except for configurations). Issue #5448
      • +
      • The Windows build now automatically installs the needed DLLs in the bin dir (if SUMOLibraries are present). Issue #4887
      • +
      +
    • +
    +

    Other#

    +
      +
    • TraCI
        +
      • Function person.getStage now returns a TraCIStage object instead of an integer denoting the stage type. #5495
      • +
      • Functions person.appendWalkingStage, + person.appendWaitingStage now send duration value as a double + in line with all other time values. #5708
      • +
      • Fixed inconsistency in client data model for routing results + (TraCIStage). In the python client, the stage member which + describes the stage type is now called type instead of + stageType in line with the other clients. #5502
      • +
      • Function vehicle.getNextStops now includes the current stop if + the vehicle is stopped. This case can be distinguished by the + first bit ('reached').
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Network version is now 1.3
      • +
      • In the previous version, setting options --tls.guess --tls.join activated a heuristic + that could create joint controllers for clusters of uncontrolled + nodes (which would not be guessed as controled individually). + Now this heuristic must be activated explicitly using option --tls.guess.joining.
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Changed button in allow/disallow-dialog from allow only + non-road vehicles to allow only road vehicles vClasses. Issue #5526
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • Option --rand.min-angle <FLOAT> now expects and argument in degrees instead of radians. Issue #5521
      • +
      +
    • +
    +

    Version 1.2.0 (16.04.2019)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed too high insertion speeds for the ACC car following model leading to emergency braking events. Issue #4861
      • +
      • Fixed emergency deceleration after insertion when using IDM model. Issue #5040
      • +
      • Reduced emergency braking for the Wiedemann carFollowModel. Issue #3946
      • +
      • Vehicles approaching an occupied parkingArea where other vehicles wish to exit, now cooperate with the exiting vehicle instead of rerouting to another parkingArea. Issue #5128
      • +
      • Fixed error when loading a <flow> from saved simulation state. Issue #5131
      • +
      • Fixed crash when loading a <flow> from saved simulation state and vehroute-output is active Issue #5132
      • +
      • ParkingAreaReroute now takes subsequent stops into account when computing a new route. Issue #3659
      • +
      • ParkingAreaReroute now adapts subsequent person stages if the person returns to the same vehicle later. Issue #5164
      • +
      • Fixed a program crash potentially occurring when different car-following models were used in the same situation. Issue #5185
      • +
      • Fixed invalid route when adding trip with cyclical stops on the same edge. Issue #5206
      • +
      • Fixed invalid route and crashing when re-routing trip with cyclical stops. Issue #5205
      • +
      • Fixed freeze when setting <vType>-attribute lcOpposite="0" to disable opposite direction driving. Issue #5238
      • +
      • Person plans that start with a <stop busStop="..."/> and continue with a <personTrip> are now working. Issue #5298
      • +
      • Fixed invalid public transport routing when a <personTrip> is not the first item in the plan. Issue #5329
      • +
      • Simulation now termines if triggered vehicles are not inserted due to --max-depart-delay Issue #5420
      • +
      • Intersection behavior
          +
        • Fixed routing bug where the cost of some left-turns was underestimated. Issue #4968
        • +
        • Fixed deadlock on intersection related to symmetrical left turns on multi-modal intersections. Issue #5004
        • +
        • Fixed invalid right-of-way behavior on multi-modal intersections Issue #5014
        • +
        • Fixed bug where vehicles would sometimes drive onto the intersection despite downstream jamming.
        • +
        • Fixed bugs where actuated traffic light would switch too early or too late. Issue #5161, Issue #5187 Issue #5119
        • +
        • Fixed deadlock at multi-lane roundabout Issue #5055
        • +
        • Fixed emergency deceleration when approaching a zipper node Issue #5080
        • +
        • Fixed collisions between vehicles and persons on walkingareas. Issue #3138, Issue #5423
        • +
        +
      • +
      • Railway simulation
          +
        • Update of averaged edge speeds within device.rerouting is now working correctly for bidirectional tracks. Issue #5060
        • +
        • Fixed behavior at railSignal when using endOffset for signal placement. Issue #5068
        • +
        • Fixed invalid behavior at railSignal when using bidirectional tracks (deadlocks / collisions). Issue #5069, Issue #5073, Issue #5062
        • +
        • Fixed detection of railway collisions. Issue #3686, Issue #5312
        • +
        • Railway insertion on bidirectional tracks now checks for presence of oncoming vehicles. Issue #5074
        • +
        +
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed crash when using the 3D-View. Issue #4944
      • +
      • Pedestrian crossing traffic-light indices can be drawn again (regression in 1.1.0). Issue #4960
      • +
      • Loading breakpoints from a gui settings file using the settings dialog is now working. Issue #5015
      • +
      • Fix visual glitch when drawing rail carriages with exaggerated length. Issue #3907
      • +
      • Fixed invalid pos value in lane popup for lanes with a strong slope. Issue #5272
      • +
      • Stopped vehicles no longer have active brake signals.
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • split junction is now working reliably in intermodal networks. Issue #4999
      • +
      • Fixed crash when copying edge template with lane-specific attributes. Issue #5005
      • +
      • Fixed index of created lanes when adding restricted lanes with context menu. This is partly a regression fix and partly an improvement over the earlier behavior. Issue #5006
      • +
      • Inspection contour now works correctly for spread bidirectional rail edges. Issue #5064
      • +
      • Now showing correct edge length when using endOffset. Issue #5066
      • +
      • Defining e1Detector with negative position (counting backwards from the lane end) is now working Issue #4924
      • +
      • Setting connection attribute uncontrolled now takes effect. Issue #2599
      • +
      • Fixed crossing geometries after editing left-hand network. Issue #5265
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Custom node and crossing shapes are now correctly shifted when using options --offset.x, offset.y. Issue #4621
      • +
      • Fixed invalid right of way rules at traffic light intersection with uncontrolled connections. Issue #5047, Issue #5048
      • +
      • Connection attribute uncontrolled is no longer lost when saving as plain-xml. Issue #2956
      • +
      • Normal right-of-way rules are never used for unsignalized railway switches where all edges have the same priority value. (all links will have linkstate M). Issue #5061
      • +
      • Fixed bug where connections were not imported from OpenDRIVE networks if junction internal edges have lane sections with different lane numbers. Issue #4812
      • +
      • Fixed bugs where superfluous traffic light phase were generated. Issue #5175, Issue #5174
      • +
      • Fixed bug where generated traffic light phases had unnecessary red lights. Issue #5177
      • +
      • Fixed missing connection at roundabout when importing dlr-navteq networks. Issue #5169
      • +
      • Fixed bugs in connection to option --tls.guess-signals Issue #5179, Issue #5117
      • +
      • Nodes that were joined due to a <join> declaration are no longer joined with further nodes when option junctions.join is set.
      • +
      • Fixed invalid street names in dlr-navteq output. Issue #5204
      • +
      • Fixed invalid edge geometry when importing VISSIM networks Issue #5218
      • +
      • Fixed bug where joined traffic lights could get lost when importing a .net.xml file with option --tls.discard-simple. Issue #5229
      • +
      • Fixed bug where traffic lights could get lost when importing a .net.xml file containing joined traffic lights with option --tls.join. Issue #5229
      • +
      • Fixed low-radius connection shapes for left turns at large intersections Issue #5254
      • +
      • Joining junctions now preserves the prior connection topology. Issue #874, Issue #1126
      • +
      • Loading patch files with <crossing> elements is now working. Issue #5317
      • +
      • Fixed invalid turnaround-lane in multimodal networks Issue #5193
      • +
      • Patching attributes of existing connections is now working. Issue #2174
      • +
      • The default edge priorities for link-roads imported from OSM (e.g. on- and offRamps) have been changed to avoid invalid right-of-way rules at intersections. Issue #5382
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed routing bug where the cost of some left-turns was underestimated. Issue #4968
      • +
      • vType attribute speedDev="0" is no longer lost in the output. Issue #5167
      • +
      • Person plans that start with a <stop busStop="..."/> and continue with a <personTrip> are now working. Issue #5298
      • +
      • Fixed invalid public transport routing when a <personTrip> is not the first item in the plan. Issue #5329
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • Fixed duplicate vehicle ids in generated output. Issue #5381
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed crash when calling moveToXY for a vehicle that is driving on the opposite direction lane. Issue #5029
      • +
      • Fixed getParameter and added setParameter calls to TraaS client library. Issue #5099
      • +
      • Fixed vehicle.setStop in TraaS client library. Issue #5105
      • +
      • Fixed crash when calling simulation.getDistance to compute the driving distance between unconnected parts of the network Issue #5114
      • +
      • Fixed invalid driving distance result when calling simulation.getDistanceRoad and one of the edges is an internal edges after an internal junction. Issue #5114
      • +
      • TraaS functions Trafficlight.setPhaseDuraton, Trafficlight.getPhaseDuration, Trafficlight.getNextSwitch, Trafficlight.setCompleteRedYellowGreenDefinition, Vehicle.setAdaptedTraveltime, Vehicle.getAdaptedTraveltime, Lanearea.getLastStepHaltingNumber and Lanearea.getLastStepVehicleIDs are now working (regression due to protocol change in 1.0.0).
      • +
      • Fixed C++ client function vehicle.getStopState (regression due to protocol change in 1.0.0)
      • +
      • Fixed estimation of speed and acceleration after using moveToXY. Issue #5250
      • +
      • traci.vehicle.getLaneChangeState now returns correct information while controlling the vehicle with moveToXY in sublane simulation. Issue #5255
      • +
      • Fixed invalid vehicle position after mapping with vehicle.moveToXY onto a lane with strong slope. Issue #5272
      • +
      • Fixed invalid lane change when moving to a new edge with different lane number after calling traci.vehicle.changeLane. Issue #5309
      • +
      +
    • +
    +
      +
    • Tools
        +
      • restored python3 support for osmWebWizard.py (regression in 1.1.0) Issue #5007
      • +
      • Fixed error when using sumolib functions net.getNeighboringEdges and net.getNeighboringLanes with the same net object. Issue #5246
      • +
      • netdiff.py now handles <param> and <crossing>-elements.Issue #5156, Issue #5317
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • added new input element <personFlow> Issue #1515
      • +
      • lanechange-output now includes maneuverDistance when using the sublane model. Issue #4940
      • +
      • Traffic light phases now support the optional attribute name. This attribute can be set and retrieved via TraCI and makes it easier to establish the correspondence between phase indexing in SUMO and phase descriptions used by other traffic engineering methods Issue #4788
      • +
      • Time losses due to passing intersections from a non-priority road are now anticipated when routing even when no vehicle has driven there previously. The anticipated loss can be configured using the new option --weights.minor-penalty <FLOAT> (new default 1.5, previous behavior when set to 0). Issue #2202.
      • +
      • Vehicles approaching a stop with parking=true now signal their intention by activating the blinker. When exiting from such a stop in dense traffic they signal their intention by activating the blinker. Issue #5126
      • +
      • Vehicles approaching a signalized junction now either stop at the given stop position (stopOffset) at red or they drive on to cross the junction if they already passed the stop position. Issue #5162
      • +
      • Person rides now allow the special value ANY for the lines attribute. When this is set, persons may enter any vehicle that will stop at the destination busStop of the ride.
      • +
      • Option --weights.random-factor <FLOAT> now also applies when routing persons. Issue #1353
      • +
      • Added output of harmonic mean speed to induction loops, which approximates the space mean speed. Issue #4919
      • +
      • Added controlability of reaction time (actionStepLength) to DriverState Model. Issue #5355
      • +
      • <edgeData>-output now supports attribute detectPersons="walk" which can be used to record pedestrian traffic instead of vehicular traffic. Issue #5252
      • +
      • Railway simulation improvements:
          +
        • When a railSignal is placed on a short edge at the incoming network fringe, the signal will regulate train insertion for all trains longer than the insertion edge. Issue #5135
        • +
        • Trains can now reverse on bidirectional edges without the definition of a <stop>. Issue #5213
        • +
        • RailSignal logic no longer requires all railway switch nodes to be of type railSignal. Instead they can be guarded by other railSignal nodes along the incoming tracks. Issue #5091
        • +
        • Added new output option --railsignal-block-output <FILE> to support analysis of the generated signal block structure. Issue #5109
        • +
        +
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Major improvement in rendering speed
      • +
      • Can now load edge-data (edgeData-output, MAROUTER-output, randomTrips-weights) for visualization (time-varying edge colors). Issue #4916
      • +
      • The current phase index can now optionally be shown for traffic-light controlled junctions. If a name was set for the current phase it is shown as well. Issue #4927
      • +
      • The current lane-changing state is now included in the vehicle parameter dialog. Issue #5038
      • +
      • Reloading is now disabled while running as TraCI-server. Issue #5052
      • +
      • When show-detectors is set for actuated traffic lights, the detector outline will switch to green for detectors that are used to control the active phase. Issue #5168
      • +
      • Added option --tls.actuated.show-detectors <BOOL> to set the default for actuated detector visibility.
      • +
      • Vehicles with guiShape truck/trailer and truck/semitrailer now bend when cornering. Issue #3100
      • +
      • Added vehicle route visualisation Show Future Route to the vehicle context menu. This only shows the remaining portion of the route.
      • +
      • Persons riding in a vehicle now have distinct seat position. Issue #1628
      • +
      • Persons waiting at a busStop can now wait in multiple rows according the specified stop length and personCapacity.
      • +
      • Added person drawing style circles
      • +
      • Added openGL gui settings option FPS to enable a frames-per-second display. Issue #5253
      • +
      • Can now locate objects by their name (streetname or generic parameter key="name"). Issue #5270
      • +
      • Railway simulation improvements:
          +
        • Improved visibility of railSignal-state when zoomed out and junction-exaggeration is active. Issue #5058
        • +
        • railSignal state indicator is now drawn with an offset to indicate the applicable track direction. Issue #5070
        • +
        • Junction shapes are now longer drawn for railway switches at default GUI settings. Issue #1655
        • +
        • Drawing bidirectional railways in spread style is now supported. Edge IDs are also drawn at an offset to improve readability.
        • +
        • The visual length of railway carriages and locomotive can now be configured. Issue #1233
        • +
        +
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Improved junction joining heuristic to prevent superfluous joins. Issue #4987
      • +
      • OpenDrive road objects can now be imported Issue #4646
      • +
      • Road objects can now be embedded when generating OpenDRIVE output.
      • +
      • Attribute endOffset can now be used to move the signal position for bidirectional rail edges. Issue #5063
      • +
      • Minimum phase duration for actuated traffic lights now takes road speed into account to improve traffic light efficiency. Issue #5127
      • +
      • all <node>-attributes are now also supported within a <join> element to affect the joined node. Issue #1982
      • +
      • Various improvements to the generation of traffic light plans. Issue #5191, Issue #5192, Issue #5194, Issue #5196
      • +
      • If a custom ID was assigned to a traffic light (different from the junction ID), it will no longer be joined with other traffic lights when option --tls.join is set. Issue #5198
      • +
      • Lane widths are now imported from VISSIM networks. Issue #5216
      • +
      • Changed option default for --opendrive.advance-stopline to 0 to improve generated geometries in most cases.
      • +
      • Roundabouts can now be disabled and removed by setting the node type to right_before_left Issue #2225
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Major improvement in rendering speed
      • +
      • Junction context menu function split junctions now restores original node ids Issue #4992
      • +
      • The new function split junctions and reconnect now recreates edges heuristically. Issue #4998
      • +
      • can now edit tls phase attributes next and name. Issue #4788
      • +
      • can now load additionals and shapes using -a "file.xml" or --additionals "file.xml". Issue #5049
      • +
      • Connection attributes dir and state can now be inspected and used as selection filter. Issue #3858
      • +
      • Can now locate objects by their name (streetname or generic parameter key="name"). Issue #5270
      • +
      • Roundabouts can now be removed by setting the node type to right_before_left Issue #2225
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • added new input element <personFlow> Issue #1515
      • +
      • Added option --write-trips <BOOL> to output trips instead of routes. This is useful for validating trip input that shall be routed during simulation. Issue #4971
      • +
      • Added option --write-trips.geo <BOOL> to write trips with attributes fromLonLat, toLonLat instead of from and to
      • +
      • Reading trips with attributes fromLonLat, toLonLat, fromXY, toXY, viaLonLat, viaXY is now supported. Issue #2182
      • +
      • Time losses due to passing intersections from a non-priority road are now anticipated. The anticipated loss can be configured using the new option --weights.minor-penalty <FLOAT> (new default 1.5, previous behavior when set to 0). Issue #2202.
      • +
      • Added option --weights.random-factor <FLOAT> to randomize routing results with bounded deviation from optimality. Issue #1353
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Added multi-client support to TraaS (setOrder) Issue #4957
      • +
      • traci.vehicle.getNextTLS now returns upcoming traffic lights for the whole route of the vehicle (before, only traffic lights until the first required lane change were returned). Issue #4974
      • +
      • Added functions trafficlight.getPhaseName and trafficlight.getPhaseName to all clients. Issue #4788
      • +
      • Extended the function traci.vehicle.openGap() to include an optional parameter specifying a reference vehicle. Issue #5151
      • +
      • Added function traci.vehicle.getNeighbors() and convenience wrappers (getLeftFollowers(), etc) to retrieve neighboring, lanechange relevant vehicles. Issue #5170
      • +
      • Added function person.getSlope to all clients. Issue #5171
      • +
      • Function vehicle.changeLaneRelative(vehID, 0) can now be used to a pin a vehicle to the current lane. Issue #5178
      • +
      +
    • +
    + +
      +
    • All Applications
        +
      • The option --help now supports filtering by topic (e.g. --help input. Issue #5303)
      • +
      +
    • +
    +

    Other#

    + +
      +
    • NETCONVERT
        +
      • Turn-arounds are no longer built at geometry-like nodes by + default (when there is a node but no intersection so there would + only be straight connections and turn-arounds). The old behavior + can be restored by setting option --no-turnarounds.geometry false. Issue #5121
      • +
      • The default priorities for different railway edge types imported + from OSM haven been changed so that all types use a different + priority value.
      • +
      • The assigned edge speed for unrestricted motorways was lowered + to 142km/h (from 300km/h) to better reflect real world speed + distributions (together with the default speed factor + distribution). Also, the default motorway speed was lowered from + 160km/h to 142km/h for the same reason. Issue #5434
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI Version is now 20
      • +
      • Function trafficlight.setCompleteRedYellowGreeenDefinition now + expectes the 5th component next to be a list of integers when + defining phases. Function + ''trafficlight.getCompleteRedYellowGreeenDefinition now + returns a list of integers as the 5th component (next) when + defining phases. Custom clients must be patched to handle this.
      • +
      • Function trafficlight.setCompleteRedYellowGreeenDefinition now + accepts name as an optional 6th component when defining + phases. Function + ''trafficlight.getCompleteRedYellowGreeenDefinition now + returns name as the 6th component when defining phases. Custom + clients must be patched to handle this.
      • +
      • TraaS function Simulation.findRoute now returns SumoStage + object (containing all data returned by the TraCI API) instead + of SumoStringList with just the edge IDs
      • +
      • TraaS function Simulation.findRoute now returns + LinkedList<SumoStage> (containing all data returned by the TraCI + API) instead of LinkedList<SumoStringList>
      • +
      +
    • +
    + +

    Version 1.1.0 (18.12.2018)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed Bug where vehicles would stop moving after changing to the opposite direction lane. Issue #4610
      • +
      • Fixed parkingAreaReroute to a destination which is too close for stopping. Issue #4612
      • +
      • Fixed crash when using multiple vehicles with device.bluelight. Issue #4629
      • +
      • Fixed crash when using carFollowModel ACC on multi-lane roads. (regression in 1.0.1)
      • +
      • Fixed crash when loading signal plan with invalid characters. Issue #4673
      • +
      • Fixed invalid halting count in E3 detector output Issue #4756
      • +
      • Fixed crashes related to vehicles that lane-change multiple times on the E3-detector entry edge. Issue #4803, Issue #4845
      • +
      • Fixed bugs that were causing unnecessarily strong deceleration. Issue #2310, Issue #4806, Issue #4809, Issue #4851, Issue #4855, Issue #4462, Issue #4900, Issue #4928, Issue #4930
      • +
      • Fixed deadlock caused by long vehicles being unable to re-enter traffic after parking in a short parkingArea. Issue #4832
      • +
      • Fixed invalid error when defining a stop on an edge and its consecutive internal edge. Issue #4837
      • +
      • Fixed bug where vehicles from minor roads would drive onto the intersection to aggressively. Issue #4854
      • +
      • Fixed bug where pedestrians would ignore prioritized vehicles when walking onto a crossing. Issue #4865
      • +
      • Fixed invalid upper bound on density in edgeData-output for multi-lane edges. Issue #4904
      • +
      • Fixed bug where trains would fail to reverse on bidirectional rail edges. Issue #4921
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Closing and re-opening an edge or lane no longer causes invalid lane choice. Issue #4514
      • +
      • Errors due to invalid <param> values are now shown in the message window. Issue #4753
      • +
      • Fixed invalid vehicle shapes when drawing trains as simple shapes in mesoscopic mode. Issue #4773
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed bug that was causing invalid road geometry when using high-resolution input data at dense junction clusters. Issue #4648
      • +
      • Fixed bug when building networks for opposite-direction overtaking that was causing collisions in the simulation. Issue #4628
      • +
      • Fixed invalid right-of-way rules in left-hand networks. Issue #4256
      • +
      • Duplicate edge ids in shapefile import are no longer silently ignored. Instead, a warning is issued and ids are made unique with a numerical suffix.
      • +
      • Fixed crash when loading height data from multiple geotif files. Issue #4786
      • +
      • Option --tls.guess no longer builds traffic lights at almost every intersection. The default lane-speed-sum threshold (Option --tls.guess.threshold) was changed from 150km/h to 250km/h. Issue #1688
      • +
      • Options --check-lane-foes.all, --check-lane-foes.roundabout are no longer lost when re-importing a .net.xml file. Issue #4813
      • +
      • Fixed unnecessary right-of-way restrictions in some cases where incoming edges target distinct lanes on the target edge. Issue #4815
      • +
      • Fixed bug where custom walkingarea shapes where sometimes ignored. Issue #4847
      • +
      • Fixed bugs that could cause loss of elevation information. Issue #4877, Issue #4878
      • +
      • Fixed permissions on internal lanes after internal junctions. Issue #4912
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Loading joined traffic light programs via menu is now working. Issue #4622
      • +
      • Menu option Load Foreign can now be used to import OSM files directly. Issue #4634
      • +
      • Fixed bug where right-of-way mode would show invalid properties. Issue #4637
      • +
      • TLS locator now lists traffic lights even if their id differs from the junction id. Issue #4661
      • +
      • Fixed crash when clicking buttons that should be disabled. Issue #4662
      • +
      • Fixed creation of unyielding connections via shift-click. Issue #4785 (regression in 1.0.1)
      • +
      • Fixed modifying elevation in Move-mode (regression in 1.0.0). Issue #4841
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed bug that was causing exaggerated output for traci.vehicle.getDrivingDistance when vehicles were driving on a looped route. Issue #4642
      • +
      • traci.vehicle.getLaneChangeState now returns correct information while controlling the vehicle with moveToXY. Issue #4545
      • +
      • Fixed retrieval of shape data with more than 255 points (polygon.getShape, lane.getShape, junction.getShape Issue #4707
      • +
      • Fixed bug when setting polygon shape with the C++ client.
      • +
      • Vehicle.isStopped is now working in TraaS. Issue #4883
      • +
      • Fixed adding vehicles after a simulation time of 24.8 days (python client). Issue #4920
      • +
      • Fixed bug where lateral collisions from unsafe calls to vehicle.changeSublane are prevented despite disabling safeguards via setLaneChangeMode. Issue #4864
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • The eagerness for opposite-direction overtaking can now be + configured with the new vType attribute lcOpposite (range + [0,inf[). Issue #4608
      • +
      • <personinfo> elements now include attribute type. Issue #4695
      • +
      • The ToC Device now provides an option + for generating output. Issue #4750
      • +
      • Added warning messages for vehicles that perform emergency + braking. The warning threshold can be configured with the new + option --emergencydecel.warning-threshold <FLOAT>. The given threshold is compared against the severity of + the event (braking with emergencyDecel corresponds to 1 and + braking with decel corresponds to 0). By default the threshold + is set to 1. Issue #4792
      • +
      • Trains can now reverse + direction + anywhere on a bidirectional track.
      • +
      • TAZ can now be used as via destinations by using + <TAZID>-sink as edge id. Issue #4882
      • +
      • ParkingAreas now support the attribute onRoad. If set to + true, vehicles will park on the road lane, thereby reducing + road capacity. Issue #4895
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added <poly> attribute lineWidth to determine the drawing width of + unfilled polygons. Issue #4715
      • +
      • TAZ now support attribute color for rendering the associated + shape. This color can also be used in the new edge coloring mode + color by TAZ. Issue #3979
      • +
      • Can now color streets according to custom lane or edge + parameters. Issue #4276
      • +
      • The numerical value for coloring edges/lanes, vehicles and + persons (e.g. speed limit, acceleration, waitingTime) can now + optionally be shown. When this option is set, the value will + also be printed in the object tool tip. Likewise, the numerical + value for coloring vehicles (e.g. acceleration) can optionally + be shown. Issue #4840
      • +
      • Breakpoints can now be set via option --breakpoints <TIME>,<TIME>.... Issue #1957
      • +
      • Added visualization option to apply size exaggeration only to + selected objects. Issue #3422
      • +
      • The text background color for IDs and object descriptions can + now be configured. Issue #4894
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • New editing mode for TAZ (Traffic Analysis Zones). Issue #3425
      • +
      • Overlapping objects can now be inspected via consecutive clicks + on the same location. Issue #2385
      • +
      • Shift-click can now be used to inspect, select and delete lanes.
      • +
      • LaneAreaDetectors (E2) that span multiple consecutive lanes can + now be created within NETEDIT. Issue #2909
      • +
      • POIs can now be created from geo-coordinates in the clipboard + (e.g. from online map sites) with a single click. Issue #4496
      • +
      • Selection colors can now be customized. Issue #4736
      • +
      • Can now color streets according to custom lane or edge + parameters. Issue #4276
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • Added options --perturb-x, --perturb-y, --perturb-z to add random perturbations to all node + coordinates. Perturbations can be specified as mean or capped + normal distribution normc(a,b,c,d). Issue #4776
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Added option --tls.layout <STRING> for selecting between layouts that group opposite + directions ('opposites') and layouts that have one phase per + incoming edge ('incoming'). Issue #4033
      • +
      • Added option --tls.guess.threshold <FLOAT> to control the heuristic for guessing traffic + lights. A traffic light is guessed if the sum of speeds of all + incoming lanes exceeds the threshold value. Issue #4681
      • +
      • Added new node attribute rightOfWay to configure the algorithm for + computing right-of-way rules (allowed values are default, + edgePriority). Also added new option --default.right-of-way to set this value for + all nodes in a network. Issue #4843
      • +
      • Importing internal lane shapes from OpenDRIVE is now supported + using option --opendrive.internal-shapes. Issue #4331
      • +
      +
    • +
    +
      +
    • Tools
        +
      • netcheck.py checks + lane-based reachability and handles pedestrian infrastructure. Issue #4619
      • +
      • route2poly.py + can now be used to generate intersection flow diagrams. Issue #4657
      • +
      • tripinfoDiff.py now + supports comparing <personinfo>s by setting option --persons.
      • +
      +
    • +
    + +

    Other#

    +
      +
    • Simulation
        +
      • Simulation now runs about 17% faster compared to the previous + release due to improvements in data structures and less + (redundant) collision checking Issue #4917.
      • +
      • The default speedDeviation of vehicle classes + private,vip,hov,custom1 and custom2 was changed from 0 to + 0.1. The default speed deviation for vehicle class taxi was + changed from 0 to 0.05.
      • +
      +
    • +
    • Documentation +
    • +
    • Miscellaneous
        +
      • Network version is now 1.1
      • +
      • TraCI Version is now 19
      • +
      +
    • +
    +
      +
    • sumolib now uses an object with members + state, duration, minDur, maxDur, next instead of tuple (state, + duration) to represent traffic light phases.
    • +
    +

    Version 1.0.1 (18.09.2018)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed deadlock on parallel routing (regression in 1.0.0). Issue #4518
      • +
      • default emergency deceleration did not depend on the vClass but + was always 9
      • +
      • Fixed bugs related to opposite-direction overtaking that were + causing collisions and other invalid behavior. Issue #4550, Issue #3718, Issue #4564, Issue #4570, Issue #4588, Issue #4589, Issue #4591, Issue #4592
      • +
      • Fixed crash when using sublane model with varying lane widths. Issue #4547
      • +
      • Fixed hard braking after lane-changing when using carFollowModel + IDM Issue #4517
      • +
      • Fixed exaggerated gap between standing vehicles when using + carFollowModel IDM. Issue #4527
      • +
      • Fixed crash when using device.ssm. Issue #4556
      • +
      • Fixed invalid cooperative lane-changing attempts. Issue #4566
      • +
      • Fixed invald speed adaptation for lane changing. Issue #4563
      • +
      • Public transport routing now properly uses stops that are + defined as child elements of a vehicle. Issue #4575
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed freeze when activating 'Show lane direction' for lanes + with width=0. Issue #4533
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed freeze when activating 'Show lane direction' for lanes + with width=0. Issue #4533
      • +
      • Custom endpoints are now honored when reversing an edge or + adding a reverse direction edge via context menu. Issue #4501
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Networks for opposite direction driving now allow overtaking + past junctions on straight connections that are slightly curved. Issue #4585
      • +
      +
    • +
    +
      +
    • OD2Trips
        +
      • Flows with non-positive probability are no longer written. Issue #4600
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Fixed deadlock in public transport simulation. Issue #4560
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed bug when calling TraaS method + Simulation.getDistanceRoad. Issue #4603
      • +
      • Closing and re-opening a lane no longer causes invalid lane + choice. Issue #4514
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • The collision-detection threshold configured via option --collision.mingap-factor can now + be customized separately for each vType using attribute + collisionMinGapFactor. Issue #4529
      • +
      • Increased running speed of simulations with device.rerouting + using few vehicles in a large network. Issue #4598
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Added option reset custom shape to the right-click menu of + junction- and lane-selections Issue #4481, Issue #4490
      • +
      • When editing junction shapes, vertices can now be removed by + shift-click. Issue #4494
      • +
      +
    • +
    + + +

    Other#

    +
      +
    • Simulation
        +
      • Collision for vehicles controlled by carFollowModel IDM are + only registered when less then half of the minGap distance + remains between vehicles. This is done to compensate for the + fact that the model does not guarantee the minGap distance (most + of the time at least ~90% of the minGap are kept). The + threshold can be customized via global option and vType + attributes.
      • +
      +
    • +
    +

    Version 1.0.0 (04.09.2018)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • All car-following models now respect the vType-attribute + emergencyDecel as an absolute bound on deceleration. Issue #3556
      • +
      • Fixed some issues when using continous lane + change. Issue #3767, Issue #3769, Issue #3770, Issue #3771, Issue #4364
      • +
      • Fixed back-and-forth changing when using continous lane + change. Issue #4010
      • +
      • Fixed loading of teleporting vehicles from simulation state in + .sbx format. Issue #3787
      • +
      • Fixed invalid vehicle counts by E2-detector related to + lane-changing. Issue #3791
      • +
      • Fixed invalid vehicle counts by E3-detector related to re-using + vehicle pointers Issue #3108, Issue #4079
      • +
      • Fixed bug that was causing invalid slowdown while passing an + intersection. Issue #3861
      • +
      • Fixed bug that was causing pedestrians on looped routes to block + themselves. Issue #3888
      • +
      • Vehicle speedFactor is now included in saved state. Issue #3881
      • +
      • Fixed invalid collision events when lanes are to narrow for the + vehicles. Issue #3056
      • +
      • Fixed collision between pedestrians and vehicles. Issue #3964
      • +
      • Fixed bug where option --random-depart-offset would trigger invalid warnings regarding + unsorted route file. Issue #4076
      • +
      • Fixed invalid stopping position after collision when using + option --collision.stoptime Issue #4106
      • +
      • Fixed right-of-way rules for vehicles standing next to each + other on the same lane and driving towards different edges. Issue #4071
      • +
      • Fixed crash within intersection between vehicles coming from the + same lane. Issue #4100
      • +
      • Fixed invalid departDelay for triggered vehicles. Issue #4199
      • +
      • Fixed hang-up when scheduling a stop on internal edges after + internal junctions Issue #4254
      • +
      • ParkingAreaReroute no longer triggers if the destination is not + among the set of alternatives. Issue #4243
      • +
      • Fixed (near) infinite loop when specifying invalid speed + distribution. Issue #4282
      • +
      • Fixed invalid car-following behavior at changing lane widths + when using the sublane model. Issue #4223
      • +
      • Fixed crash when simulating invalid pedestrian routes with + option --ignore-route-errors. Issue #4306
      • +
      • Option --carfollow.model is now working.
      • +
      • Car-follow models IDM and IDMM no longer fail to reach an + exact stop position. Issue #658
      • +
      • Strategic look-ahead is now working as expected in networks with + many short edges. Issue #4349
      • +
      • Switching a traffic light to the "off" definition now sets the + correct right-of-way rules. Issue #1484
      • +
      • Fixed invalid deceleration at yellow traffic light. Issue #4450
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • width of railway edges is now taken into account when drawing + (interpreted as gauge). Issue #3748
      • +
      • window-size and position now remain unchanged when reloading the + simulation. Issue #3641
      • +
      • Random vehicle and person coloring is now more random on + windows. Issue #3740
      • +
      • Vehicles that were not inserted (i.e. due to option --scale or --max-depart-delay) no + longer count as arrived in the simulation parameter dialog. + Instead the are counted under the new item discarded vehicles. Issue #3724
      • +
      • Fixed crashing due to concurrent access to vehicle numbers. Issue #3804
      • +
      • Fixed issues related to drawing smooth corners at curving roads. Issue #3840
      • +
      • Fixed vehicle positions when using the sublane model in lefthand + networks. Issue #3923
      • +
      • Fixed crashing and visualization problems when using the + 3D-view. Issue #4037, Issue #4039
      • +
      • Fixed glitch where persons would appear to jump around while + riding in a vehicle across an intersection. Issue #3673
      • +
      • Tracking of riding persons now centers on the person rather than + the front its vehicle. Issue #4209
      • +
      • ChargingStation are visible again (regression in 0.32.0) Issue #4183
      • +
      • Fixed invalid vehicle blinkers in lefthand simulation. Issue #4258
      • +
      • Traffic lights now remain accessible (right-click, tooltip) + after calling traci.trafficlight.setRedYellowGreenStaate. Issue #4426
      • +
      • Fixed invalid vehicle angle on lane with zero-length geometry.
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Fixed deadlock at roundabouts when running with option --meso-junction-control.limited or --meso-junction-control false. Issue #4074
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Splitting edges, deleting individual edges and lanes or adding + lanes via the duplicate menu option no longer resets + connections and traffic light plans. Issue #3742
      • +
      • The viewing area and zoom loaded via option --gui-settings-file is no longer + ignored
      • +
      • Fixed bug where connections on large junctions did not register + clicks or were not drawn. Issue #3726
      • +
      • Fixed crash when removing inspected object via undo. Issue #3781
      • +
      • Fixed various bugs that led to re-computation of signal plans + when modifying connections or tls indices. Issue #3742, Issue #3832
      • +
      • Fixed bug that could lead to the creation of invalid networks + when adding and removing connections. Issue #3824, Issue #3813
      • +
      • Custom connection shape is now longer lost after + delete+undo. Issue #3822
      • +
      • Moving geometry no longer removes z-data. Issue #3723
      • +
      • Splitting edges no longer introduces unnecessary custom + endpoints. Issue #3895
      • +
      • Fixed inverted interpretation of lanePosLat for POIs compared + to SUMO-GUI. Issue #4002
      • +
      • Fixed crash when deleting one of multiple signal programs for + the same junction. Issue #4132
      • +
      • Added support for BusStops Acces. Issue #4018
      • +
      • Crossings no longer become invalid when splitting an edge. Issue #4295
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Option --ramp.guess no longer builds ramps at traffic light controlled + nodes. Issue #3848
      • +
      • Fixed bug that was causing invalid link states at intermodal + junctions. Issue #2944 Issue #3851
      • +
      • Fixed bugs that were causing invalid link directions. Issue #3852 Issue #3853
      • +
      • Fixed invalid junction logic in lefthand networks. Issue #3854
      • +
      • Generated signal plans will no longer have a protected left-turn + phase if there is no dedicated left-turn lane. Issue #4087
      • +
      • Various fixes in regard to classifying nodes as type + rail_crossing and joining clusters of rail crossing nodes.
      • +
      • Option --dismiss-vclasses is now working when loading a .net.xml file. Issue #4230
      • +
      • Fixed invalid junction shapes when using option --junction.corner-detail. Issue #4292
      • +
      • Fixed invalid intermodal junction logic that could cause + collisions and deadlocks. Issue #4198, Issue #4252
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed crash on intermodal routing. Issue #3883
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Fixed bug when importing OSM data with objects that are marked + as deleted. Issue #3786
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed bug where persons would "jump" when replacing the current + walking stage with a new one. Issue #3744
      • +
      • Fixed crash when trying to access empty subscription result list + using the C++ client.
      • +
      • Vehicle emergencyDecel is now at least as high as decel + after calling traci.vehicle.setDecel. Issue #3755
      • +
      • Fixed python client bug in traci.polygon.setShape. Issue #3762
      • +
      • Adding a route with an empty list of edges now results in an + error. Issue #3845
      • +
      • Vehicles that drive outside the road network under the control + of moveToXY now properly updated their speed and brake lights. Issue #3837
      • +
      • Function vehicle.getLaneChangeMode now returns correct values + for the original lane change state when the state is affected by + vehicle.setLaneChangeMode. Issue #3810
      • +
      • Car-following related vehicle type parameters (e.g. accel) + that are changed via traci are now correctly saved when saving + simulation state. Issue #3522
      • +
      • Functions simulation.findRoute and + simulation.findIntermodalRoute no longer crash sumo when + trying to route from a forbidden edge. Issue #4121
      • +
      • Fixed invalid results when calling + simulation.findIntermodalRoute Issue #4145, Issue #4147, Issue #4148
      • +
      • Multi-Lane E2-Detectors now return the correct length. Issue #4356
      • +
      • Fixed bug where vehicle.couldChangeLane returned True + immediately after a lane change even though the requested target + lane did not exist. Issue #4381
      • +
      • Fixed collisions when combining vehicle.slowDown with + ballistic update. Issue #4418
      • +
      • Fixed python client bug in traci.lane.getLinks which returned + always true for isOpen, hasFoe and hasPrio.
      • +
      • traci.person.setColor was fixed (was a noop before)
      • +
      +
    • +
    + +

    Enhancements#

    +
      +
    • +

      All applications

      +
        +
      • +

        All time values in options and xml inputs can now be specified + in the format h:m:s and d:h:m:s (where the values for days, + hours and minutes are all positive integers and seconds may also + be a positive floating point number).

        +
        +

        Note

        +

        This does not apply to the python tools.

        +
        +
      • +
      +
        +
      • Added option --human-readable-time (short -H) that causes all time values to be written + in h:m:s (or d:h:m:s) format.
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • Tripinfo-output now includes the attribute stopTime which + records the time spent with intentional stopping. Issue #3693
      • +
      • A pedestrian crossings can now have different signal states for + both directions. Issue #3820
      • +
      • FCD-output can now be switched on selectively for a subset of + vehicles and the reporting period can be configured. Issue #1910
      • +
      • FCD-output can now be restricted to a subset of network edges + loaded from a file with option --fcd-output.filter-edges.input-file <FILE>. The file format is that of an + edge selection as saved by NETEDIT.
      • +
      • Intended departure times (attribute depart) and intended + vehicle id (attribute intended) are now added to + vehroute-output of public transport rides. Issue #3948
      • +
      • Stopping place names are now added as XML-comments in + vehroute-output of public transport rides. Issue #3952
      • +
      • Lane-Change-Model parameter lcTurnAlignmentDistance added for + the control of dynamic alignment in simulations using the + sublane model, see Lane-Changing + Models, Issue #4025
      • +
      • Implemented SSM + Device, which allows + output of saftey related quantities. Issue #2669, Issue #4119
      • +
      • 'Smoothed' emergency braking Issue #4116
      • +
      • Added an initial version of a driver state + device for modelling imperfect + driving.
      • +
      • Added an initial version of a transition of control + model.
      • +
      • Option --ignore-route-errors now also allows insertion of vehicles with unsafe + headways. Issue #4118
      • +
      • Added a new car-following model "ACC" based on [Milanés et al. + "Cooperative Adaptive Cruise Control in Real Traffic + Situations." IEEE Trans. Intelligent Transportation Systems 15.1 + (2014): 296-305.]
      • +
      • Statistic + output + now also includes total delay by vehicles which could not be + inserted by the end of the simulation if options --duration-log.statistics and --tripinfo-output.write-unfinished are set. Issue #4174
      • +
      • The default lane-changing model LC2013 now supports parameter + lcAssertive. Issue #4194
      • +
      • Vehroute-output now + includes the reason for rerouting. Issue #4204
      • +
      • Added optional attribute visible to <parkingAreaReroute (default false). This + controls whether occupancy is known before reaching the + parkingArea edge and can be used to model incomplete knowledge + in parking reroute choice. Issue #4244
      • +
      • Rerouters now support the attribute vTypes which restricts + their effect to vehicles from the given list of vehicle type + IDs. Issue #4031
      • +
      • Vehicles are forming a coridor for emergency vehicles Issue #1967
      • +
      • Added option --default.speeddev <FLOAT> to control the default speed deviation of all + vehicle types that do not define it. Issue #4421
      • +
      • Added lane/edge-attribute stopOffset for defining vClass + specific stopping positions in front of traffic lights. Issue #3754
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added control for scaling traffic demand dynamically. Issue #1951
      • +
      • Added option to disable drawing of bicycle lane markings on + intersections.
      • +
      • All laneChangeModel-related vType-parameters and all + junction-model related vType-parameters are now shown in the + vType-Parameter dialog.
      • +
      • The simulation view can now be rotated via the new gui-settings + attribute angle in the <viewport> or via the viewport dialog. Issue #3841
      • +
      • When drawing junction shapes with exaggerated size and setting + option show lane-to-lane connections, the connecting lines are + now scaled up at traffic light junctions. Issue #3796
      • +
      • The simulation state can now be saved via the Simulation Menu. Issue #2513
      • +
      • Object tracking can now be aborted via double-click.
      • +
      • Person plans can now be inspected via the right-click menu. Issue #3886
      • +
      • Object name rendering size can now be toggled between constant + pixel size (all visible when zoomed out) and constant network + size (invisible when zoomed out). Issue #3931
      • +
      • The Delay value is now invariant with regard to the simulation + step length and always denotes delay per simulated second. Issue #4176
      • +
      • Added GUI Shape for different types of emergency vehicles + (ambulance, police and firebrigade) Issue #1967
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Simulation of persons and public transport is now supported. Issue #3816
      • +
      +
    • +
    +
      +
    • +

      NETEDIT

      +
        +
      • Added Prohibition-mode for checking right-of-way at junctions + (hotkey 'w'). Thanks to Mirko Barthauer for the contribution. Issue #3850
      • +
      • Added virtual attribute to identify bidirectional rail edge + pairs. Issue #3720
      • +
      • Added option to modify the visualisation of bidirectional rail + edge + pairs + (spread superposed) Issue #3720
      • +
      • Added button add states to traffic light-mode to complement + the functionality of cleanup states. Issue #3846
      • +
      • Netedit now flags connection targets with incompatible + permissions as conflict and only creates them with + <ctrl>+<click>. Issue #3823
      • +
      • Traffic light indices are now drawn for pedestrian crossings + when enabled via gui settings. Issue #3814
      • +
      • Now ParkingAreas and ParkingSpaces can be created in netedit. Issue #3104
      • +
      • When adding a new phase to a traffic light, the new phase will + now have a plausible successor state depending on the selected + previous phase (rather the being a copy). Issue #4041
      • +
      • Added function 'split' to junction context menu. This can be + used to disaggregated joined junctions. Issue #4046
      • +
      • +

        When joining traffic lights (by editing junction attribute + 'tl'), link indices of the target traffic light are now + preserved if signal groups are used (multiple connections with + the same linkIndex value). Issue #4094

        +
        +

        Caution

        +

        The the signal states for the edited junction must be checked by the user

        +
        +
      • +
      +
        +
      • Width, height and diagonal size of a rectangle selection are now + shown in the status bar. This can be used to measure distances.
      • +
      • Now Generic Parameters can be loaded, saved and edited. Issue #3485
      • +
      • Re-organized options in the options-dialog (F10). Issue #4420
      • +
      • Option help is now shown in the status bar of the options + dialog. Issue #2900
      • +
      • Custom edge geometry endpoints can now be manipulated in Move + mode. Issue #3716
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Geo-referenced networks (i.e. from OSM) can now be merged by loading them together (-s net1.net.xml,net2.net.xml). Issue #4085
      • +
      • Element <crossing> now supports attribute linkIndex2 to specify a custom signal index for the reverse direction. Issue #3820
      • +
      • When defining double connections, the right-of-way rules now take the road topology into account to differentiate between on-ramp and off-ramp situations. Issue #3834
      • +
      • Importing VISUM networks up to format version 10 is now support. Issue #3898
      • +
      • Improved heuristics for options --junctions.join. Issue #876
      • +
      • Improved computation of intermodal junctions imported from OSM. Issue #4003
      • +
      • Improved computation of junction shapes.
      • +
      • Added option --proj.rotate <FLOAT> for rotating the network.
      • +
      • Added option --prefix <STRING> which can be used to add a prefix to the written junction and edge IDs.
      • +
      • Added options --tls.scramble.time --tls.crossing-clearance.time --tls.crossing-min.time to control the timing of pedestrian crossing phases. Issue #4078
      • +
      • Added option --tls.minor-left.max-speed <FLOAT> to ensure that left turns through oncoming traffic are not build for high-speed roads. Issue #4091
      • +
      • Sidewalk information is now imported from OSM for road types that have a positive sidewalkWidth attribute (e.g. by using typemap osmNetconvertPedestrians.typ.xml). Issue #4096
      • +
      • Added option --osm.stop-output.footway-access-factor <FLOAT> for increasing the length of stop access edges above the airline distance. Issue #4143.
      • +
      • Added option --junctions.limit-turn-speed <FLOAT> which sets an upper bound on speed while passing an intersection based on the turning radius. To account for imperfect road geometry, the option --junctions.limit-turn-speed.min-angle can be used to avoid speed limits for small turns. Warnings are issued when the difference between road speed and connection speed rises above a configurable threshold (--junctions.limit-turn-speed.warn.straight, --junctions.limit-turn-speed.warn.turn). These warnings often indicate exaggerated road speeds on urban roads as well as faulty geometry. Issue #1141
      • +
      • Geo-reference information is now imported from OpenDRIVE input. Issue #4414
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • Simplified node and edge names
          +
        • The alphanumerical junction naming scheme now supports + arbitrary grid sizes (using ids like XY23)
        • +
        • The alphanumerical junction naming scheme also extends to + spider networks
        • +
        • The alphanumerical junction naming scheme is active by + default (the option for enabling the old scheme was renamed + from grid.alphanumerical-ids to --alphanumerical-ids).
        • +
        • When using alphanumerical junction ids, the intermediate + string to is omitted from edge names because the edge ID + already allows unambiguous determination of its junctions + without it
        • +
        +
      • +
      • Added option --rand.random-lanenumber to randomize lane numbers in random networks + between 1 and default.lanenumber
      • +
      • Added option --rand.random-priority to edge priorities in random networks between 1 + and default.priority
      • +
      • Added option --rand.grid to place generated junctions on a regular grid
      • +
      • Added option --prefix <STRING> which can be used to add a prefix to the generated + junction and edge IDs.
      • +
      • Corridor networks can now be generated by using options such as -g --grid.x-number 3 --grid.y-number 1 --grid.attach-length 100
      • +
      • Added options --turn-lanes <INT> and --turn-lanes.length <FLOAT> to add left-turn lanes to generated + networks. Issue #3892
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Intended departure times (attribute depart) and intended + vehicle id (attribute intended) are now added to + vehroute-output of public transport rides. Issue #3948
      • +
      • Stopping place names are now added as XML-comments in + route-output of public transport rides. Issue #3952
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Option --osm.use-name now also applies to POIs. Issue #4246
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Libsumo can now be used in place of the + TraCI client libraries to increase execution speed of + TraCI-Simulations by directly linking against + SUMO for all + SWIG-supported languages. + Graphical simulation with libsumo is not yet supported.
      • +
      • function vehicle.add now supports using the empty string ("") + as a route id to insert the vehicle on an arbitrary valid edge. + This makes it easier to remote-control vehicles using moveToXY + without defining an initial route. Issue #3722
      • +
      • added functions simulation.getCollidingVehiclesNumber and + simulation.getCollidingVehiclesIDList to track collisions. Issue #3099
      • +
      • added functions simulation.getEmergencyStoppingVehiclesNumber + and simulation.getEmergencyStoppingVehiclesIDList to track + emergency stops. Issue #4312
      • +
      • added function edge.getLaneNumber to retrieve the number of + lanes of an edge. Issue #3630
      • +
      • added function vehicle.getAcceleration to retrieve the + acceleration in the previous step. Issue #4112
      • +
      • TraCI now allows to update a vehicle's best lanes + (vehicle.updateBestLanes). Issue #4146
      • +
      • added function gui.hasView to determine whether graphical + capabilities exist. Issue #4014
      • +
      • added function lane.getFoes to to determine right-of-way and + conflict relationships between incoming + lanes.
      • +
      • function simulation.getMinExpectedNumber() now includes + persons that are still active in the simulation. Issue #3707
      • +
      • added function traci.getLabel to the python client to help + working with multiple connections.
      • +
      • When adding a vehicle with a disconnected 2-edge route, it will + be treated like a <trip> and rerouted automatically. Issue #4307
      • +
      • added functions vehicle.getRoutingMode and + vehicle.setRoutingMode. When setting routing mode to + traci.constants.ROUTING_MODE_AGGREGATED, smoothed travel + times are + used instead of current travel times. Issue #3383
      • +
      +
    • +
    +
      +
    • Tools
        +
      • added script + plot_trajectories.py + which allows plotting various combinations of time, distance, + speed and acceleration for all trajectories in a given --fcd-output file.
      • +
      • added script + averageRuns.py for + running a scenario multiple times with different random seeds + and computing trip statistics
      • +
      • webWizard now correctly builds regions with left-hand traffic Issue #3928
      • +
      • Additional options for + generateTLSE3Detectors.py + that make it suitable for generating various kind of junction + related output. Issue #1622
      • +
      • createVehTypeDistributions.py + now also allows to generate vehicle parameter distributions. Issue #4171
      • +
      • Added function simpla.createGap() Issue #4172
      • +
      • sumolib now supports lane.getWidth(). Issue #3842
      • +
      +
    • +
    +

    Other#

    +
      +
    • Miscellaneous
        +
      • The space character ' ' is no longer allowed in xml option + values when separating file names. Instead the comma ',' must be + used. Files with space in their path are now supported. Issue #3817
      • +
      +
    • +
    + +
      +
    • Simulation
        +
      • <vTypeProbe> is now deprecated in favour of FCD-output filtering
      • +
      • <vaporizer> is now deprecated in favour of calibrators.
      • +
      • The default arrival position for person walks is now the middle + of the destination edge. This reduces the assymetry from + arriving in forward or backward direction. Issue #3843
      • +
      • tripinfo-output attribute waitSteps which counts the number of + simulation steps in which the vehicle was below a threshold + speed of 0.1m/s was replaced by attribute waitingTime which + measures the same time in seconds. This gives results which are + independent of the --step-length simulation parameter. Issue #3749
      • +
      • The default value for option --device.rerouting.pre-period was changed from 1 to 60 to + speed up simulation. Issue #3865
      • +
      • The default speed deviation has been changed to 0.1. When + defining a new <vType> with attribute vClass, this also influences + the default speed deviation:
          +
        • truck, trailer, coach, delivery: 0.05
        • +
        • tram, rail, rail_electric, rail_urban, + emergency: 0
        • +
        • everything else 0.1
        • +
        +
      • +
      +
    • +
    +
    +

    Note

    +

    The previous behavior can be restored by setting option --default.speeddev 0

    +
    +
      +
    • SUMO-GUI
        +
      • Default color for persons is now 'blue' to better distinguish + them from vehicles.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • There is no longer an offset of 0.1m between lanes. This means + the total visual width of an edge is now the sum of all lane + widths. This also fixes an inconsistency between visualization + and simulation as the vehicles always ignored this offset + anyway. Road markings are now drawn on top of the lanes rather + than between them. This causes small visual gaps in old networks + (fixable by calling netconvert -s old.net.xml -o new.net.xml). Issue #3972
      • +
      • The default value for option --default.junctions.radius was increased from 1.5 to 4 in + order to improve realism of turning angles.
      • +
      • The default value for option --default.junctions.corner-detail was increased from 0 to 5 to + improve the visual realism of larger intersections.
      • +
      • Option --ramps.guess is now enabled by default
      • +
      • Vehicle speed while turning at intersections is now limited via + the new option default --limit-turn-speed 5.5. To obtain the old behavior, this value + can be set to -1.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI Version is now 18
      • +
      • Embeded python is now deprecated in favour of + Libsumo.
      • +
      • TraCI now consistently represents time in seconds as a double + precision floating point. This affects all client + implementations. For convenience the affected python calls are + listed below. Modifying your scripts should be necessary only + for the methods printed in bold:
          +
        • traci.simulationStep
        • +
        • traci.edge.getTravelTime
        • +
        • traci.edge.getEffort
        • +
        • traci.edge.adaptTravelTime
        • +
        • traci.edge.setEffort
        • +
        • traci.person.add
        • +
        • traci.vehicle.getAdaptedTravelTime
        • +
        • traci.vehicle.getEffort
        • +
        • traci.vehicle.adaptTravelTime
        • +
        • traci.vehicle.setEffort
        • +
        • traci.vehicle.slowDown
        • +
        • traci.vehicle.changeLane
        • +
        • traci.vehicle.setStop
        • +
        • traci.simulation.getCurrentTime still returns ms as int but + has been deprecated in favor of traci.simulation.getTime
        • +
        • traci.simulation.findRoute
        • +
        • traci.simulation.findIntermodalRoute
        • +
        • traci.simulation.getDeltaT
        • +
        • traci.trafficlight.getNextSwitch
        • +
        • traci.trafficlight.getPhaseDuration
        • +
        • traci.trafficlight.getCompleteRedYellowGreenDefinition
        • +
        • traci.trafficlight.setPhaseDuration
        • +
        • traci.trafficlight.setCompleteRedYellowGreenDefinition
        • +
        +
      • +
      • The TraCI boundary type has been replaced by a position list of + 2 positions
      • +
      • The TraCI float type has been removed
      • +
      • All protocol functions returning single bytes now return + integers (lane.getLinkNumber, polygon.getFilled, + vehicle.isRouteValid, vehicle.getStopState)
      • +
      • In the C++ client the function vehicle.getEdges was renamed to + getRoute to be consistent with other clients
      • +
      • The order of error checks in the TraCI server changed so that + unknown object errors show up before unknown variable / command + errors
      • +
      • The python client
          +
        • the function vehicle.add was replaced by the function + addFull. The old "add" is still present and can be + reactivated by monkey patching the module + (traci.vehicle.add=traci.vehicle.addLegacy)
        • +
        • constants which were previously available in the single + domains have moved to traci.constants
        • +
        • now returns tuples instead of lists for all getIDList and + several other calls
        • +
        • the function getSubscriptionResults now requires the ID of + the subscribed object as argument. To retrieve all results + in a map, the function getAllSubscriptionResults can be + used
        • +
        +
      • +
      +
    • +
    +

    Older Versions#

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 27 April 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contact.html sumo-1.6.0+dfsg1/docs/userdoc/Contact.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contact.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contact.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Contact - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contact
    + + + +

    If you have any questions about SUMO, please post them into one of our +mailing lists. You may need to create an Eclipse +account first.

    +

    Please do not try to add the lists to your social networks!

    +

    There are three lists available:

    + +
    +

    Note

    +

    There is also a forum available to access the sumo-user mailing list. Please be aware that every message to the forum also goes to all sumo-user subscribers and vice versa. You need to register for the forum, but you only need a valid email, not an Eclipse account.

    +
    +
      +
    • sumo-announce
      + Subscribe to the list if you want to get information about new + releases or documents. + Post to the list if you have to announce something by yourself. + Frequency: few mails per year + Archive: Eclipse Archive, Mail Archive, SF Archive
    • +
    +
      +
    • sumo-dev
      + This list is for topics related to sumo development. If you want to + contribute code or ask a question in regard to extending SUMO, this + is the right place. + Frequency: few mails per month + Archive: Eclipse Archive, Mail Archive, SF Archive
    • +
    +

    To unsubscribe, please visit the same link(s) as given above for +subscription. You will find a field there that allows you to +unsubscribe. An easy way to subscribe (or unsubscribe) is to write an +email to +mailto:sumo-user-join@eclipse.org +(or +mailto:sumo-user-leave@eclipse.org +for unsubscribing). Make sure to use the right sender address (subject +and body can be empty). This works of course for the devel and the +announce list as well.

    +

    If you have found a bug within one of the applications, please let us +know by using the project's bug tracking service.

    +

    If you want to receive regular updates on commits, you can subscribe to +this feed or set +up an IFTTT link +or use https://hubnotify.com/ to send you an email.

    +

    Occasional development updates are posted on our Facebook page and you can +follow us on Twitter and on Instagram.

    +

    Our institute's address:

    +

    German Aerospace Center (DLR)
    +Institute of Transportation Systems
    +Rutherfordstr. 2
    +12489 Berlin
    +Germany
    +http://www.dlr.de/ts/
    +mailto:sumo@dlr.de

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 30 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/Cadyts.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/Cadyts.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/Cadyts.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/Cadyts.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + Contributed/Cadyts - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/Cadyts
    + + + +

    Introduction#

    +

    Cadyts is a tool to overcome the gap between the real traffic flows, +which you should have, in form of induction loop data and the simulated +traffic flows produced by SUMO. It adapts the flows by using the script +cadytsIterate.py. For further information please consult the Cadyts home page.

    +

    Usage#

    +

    The Cadyts tool has to be started via cadytsIterate.py, which is a +command line application. It has the following parameters:

    +

    -r route alternatives file from sumo (comma separated list) (in Cadyts: +-choicesetfile)

    +

    -d adapt to the traffic flows on the edges defined in a given file (in +Cadyts: -measfile)

    +

    -c classpath for the calibrator, default= +os.path.join(os.path.dirname(sys.argv[0]), "..", +"contributed","calibration","cadytsSumoController.jar")

    +

    -s last step of the calibration, default=100

    +

    -S scaled demand, optional, default=2 (in Cadyts: -demandscale); If -M +is defined, this parameter will be used in the calibration.

    +

    -F define the number of iterations for stablizing the results in the +DTA-calibration, default= 85 (in Cadyts: - freezeit)

    +

    -V define variance of the measured traffic flows for the +DTA-calibration, default=1, (in Cadyts: varscale)

    +

    -P number of preparatory iterations, default = 5 (in Cadyts: PREPITS)

    +

    -W prefix of flow evaluation files; only for the calibration with use +of detector data, optional (in Cadyts: -flowfile)

    +

    -Y fit the traffic counts as accurate as possible, default = False, (in +Cadyts: -bruteforce)

    +

    -Z minimal traffic count standard deviation"), default = 25 (in Cadyts: +-mincountstddev)

    +

    -O override depart times according to updated link travel times, +default= False (in Cadyts: -overridett)

    +

    -M prefix of OD matrix files in VISUM format (in Cadyts: - fmaprefix)

    +

    -N postfix attached to clone ids, default='-CLONE' (in Cadyts: +-clonepostfix)

    +

    -E No summary information is written by the simulation, default=False

    +

    -T No tripinfos are written by the simulation, default=False

    +

    In additions, the simulation-related parameters in the duaIterate.py can +also be defined and applied in cadytsIterate.py, such as a network file, +the begin time and the end time of a simulation/routing, main weights +aggregation period (default=900, in Cadyts: -binsize).

    +

    The script cadytsIterate.py expects at least three parameters: The +<NETFILE> (-n), the <ROUTEALTERATIVESFILE> (-r), the <REALFLOWSFILE> +(-d).

    +

    Example for using the cadytsIterate.py:

    +
        cadytsIterate.py -n <NETFILE> -r <ROUTEALTERATIVESFILE> -d <REALFLOWSFILE>
    +    -a <INT> (sets main weights aggregation period) -c <CADTYS-MODEL-PATH>
    +    -b <INT> (sets simulation begin) -e <INT> (sets simulation end)
    +
    + +

    The <REALFLOWS>-file has to be a XML-file in form of:

    +
        <measurements>
    +        <singlelink link="1to21" start="25200" end="32400" value="750" stddev="8" type="COUNT_VEH"/>
    +        <singlelink link="1to22" start="25200" end="32400" value="250" stddev="8" type="COUNT_VEH"/>
    +    </measurements>
    +
    + +

    The < ROUTEALTERATIVESFILE> has to be a XML-file in form of:

    +
        <route-alternatives>
    +        <vehicle id="830" depart="25208.00" departlane="free" departspeed="max" fromtaz="1" totaz="2">
    +            <routeDistribution last="1">
    +                <route cost="154.29" probability="0.57623629" edges="91to1 1to21 out" exitTimes="25240.19 25337.05 25362.30"/>
    +                <route cost="153.69" probability="0.42376371" edges="91to1 1to22 out" exitTimes="25240.19 25336.44 25361.69"/>
    +            </routeDistribution>
    +        </vehicle>
    +    </route-alternatives>
    +
    + +

    An easy way to get a route-alternatives file is to use the duaIterate.py +or the duarouter application.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/iTranSIM.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/iTranSIM.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/iTranSIM.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/iTranSIM.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + Contributed/iTranSIM - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/iTranSIM
    + + + +

    Summary#

    +

    iTranSIM - Simulation-based Vehicle Location

    +

    By: Tino Morenz
    +Supervisor: Dr. René Meier

    +

    Public transport provides affordable, 'eco'-friendly transport in urban +environments. With the advancements in computer technologies real-time +passenger information (RTPI) are now available for passengers, helping +them to plan their trips so they spend as little time as needed +travelling.

    +

    To provide real time passenger information it is necessary to have +information on vehicle positions, so that travel times can be calculated +and presented to the passenger. The iTranSIM system aims to provide +vehicle locations not based on physical measurements but solely based on +statistical data. Instead of locating the real vehicle e.g. using GPS, a +virtual vehicle is tracked in an online simulation of Dublin City. The +online simulation can be supplied with real traffic data such as vehicle +counts from induction loops to create a realistic model of the traffic.

    +

    To demonstrate the feasibility of this approach the iTranSIM system was +designed and a proof-of-concept was implemented based on the iTransIT +framework. This framework was developed by the Distributed Systems Group +(DSG) at Trinity College Dublin and provides means of integrating +different components of an intelligent transportation system (ITS) so +that data can be exchanged between the systems. To simulate the traffic +the microscopic traffic simulator SUMO (Simulation of Urban Mobility) is +used. SUMO is an open source project, maintained by researchers at the +Centre for Applied Informatics at the University of Cologne and the +Institute of Transport Research at the German Aerospace Centre.

    +

    The accuracy of vehicle location based on simulation could not be +evaluated yet because a vital part of the necessary infrastructure is +not yet available: the vehicle count data from real induction loops. +Thus all experiments described in this thesis are based on empirical +traffic data, however as soon as live data becomes available the +accuracy of the proposed method can be analysed without any changes to +the proposed system. Possible means of performing such an evaluation are +also included in this dissertation.

    +

    Complete Thesis#

    +

    "iTranSIM - Simulation-based Vehicle Location" +by Tino Morenz

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SmallMaps.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SmallMaps.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SmallMaps.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SmallMaps.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + Contributed/SmallMaps - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/SmallMaps
    + + + +

    The functionality of this tool was superseded by netconvert +improvements. SUMO 0.17.1 was the last release this tool was part of.

    +

    Meta-Information#

    +
      +
    • Purpose: Prunes networks to a given boundary
    • +
    • Location: The kdeproject-file and the sources can be found in + <SUMO_DIST>/tools/contributed/smallmaps
    • +
    • Language: C++ + Qt
    • +
    • Author: Andreas Florides
    • +
    +

    Original Message#

    +
    Von: Florides Andreas [xxx]
    +Gesendet: Freitag, 8. Dezember 2006 15:43
    +An: Krajzewicz, Daniel
    +Betreff: Frida map pruning
    +
    +Hello Daniel,
    +I have added a simple GUI to the script that makes the pruning to the 
    +Frida maps and I believe that is more usable now.
    +You can find attached the sources and a compiled file for Linux that 
    +you can try out. A lot of information are still hard-coded in the 
    +source code which means that the program is not totally generic but
    +maybe is useful for a lot of people that are looking for small maps 
    +that can "play"with in SUMO.
    +The readme file contains some general information.
    +
    +Regards
    +Andreas Florides
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPlayer.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPlayer.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPlayer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPlayer.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPlayer - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/SUMOPlayer
    + + + +
    +

    Note

    +

    SUMOPlayer was removed in release 0.24.0. You should be able to use traceExporter.py for the same task.

    +
    +

    Meta-Information#

    +
      +
    • Location: The build-file and the sources can be found in <SUMO_DIST>/tools/contributed/sumoplayer
    • +
    • Language: Java >=1.5
    • +
    • Author: Michael Willigens
    • +
    +

    From README#

    +
    # This is file gives a brief overview on SUMPlayer usage.
    +# SUMOPlayer can be used to play SUMO network-dump files
    +# in realtime (if possible) to latitude/longitude coordinates.
    +# It can be customized in any way by implemting
    +# de.psi.telco.sumoplayer.SUMOLocationListener
    +# SEE:
    +# public interface SUMOLocationListener {
    +#   public void LocationUpdated(String vehicleId, int timestep, double lon, double lat, double speed);
    +# }
    +# You can call SUMOPlayer with your own implementation by using the
    +# -l "<classname>" parameter.
    +# If not used, SUMOPlayer uses STDOUT CVS style like:
    +# <vehicle_id>|<timestep>|<lon>|<lat>|<speed>
    +
    +# Eclipse integration is easily possible by:
    +# new-project -> from existing ant buildfile (build.xml)
    +
    +# see possible ant tasks:
    +$> ant -projecthelp
    +
    +# compile
    +$> ant sumoplayer.jar
    +
    +# run sumoPlayer with:
    +$> ant sumplayer.run
    +# ... or even better integrated in your project by jarfile:
    +$> java -jar sumoplayer.jar
    +# possible parameters:
    +# ANT param                         # description
    +# JAR param
    +
    + -Dnetfile=<sumo_network_xml_file>  # the used sumo network file
    + -n                                 # needed for geo coordinate lookups
    +
    + -Dndump=<sumo_ndump_xml_file>      # sumo network-dump simulation file
    + -d
    +
    + -Dequipped=<propability>           # a floating value between 0 and 1
    + -e                                 # defining the number of tracked
    +                                    # vehicles. 0.01 is 1%
    +
    + -Djitter=<value_in_meters>         # a random GPS jitter in meters
    + -j
    +
    + -Dlistener=<full_java_classname>   # the used java implementation of
    + -l                                 # SUMOLocationListener
    +                                    # default:
    +                                    # de.psi.telco.sumoplayer.SUMOPipedLocationListener
    +                                    #    (stdout CSV style data)
    +
    +
    +
    +# JAVA DOC
    +$> ant javadoc                      # creates JAVA DOCS in /build/javadoc
    +
    +

    Additional Information#

    +

    You can run the player as following:

    +
    sumo ... --no-step-log --netstate-dump - | java -jar SUMOPlayer.jar -d - -c <propability> -n <used_network_file> ...
    +
    + +

    ("-" redirects the dump to stdout)

    +

    The basic functionality is as following

    +
      +
    • the player reads the network file for projection information
    • +
    • the player reads projected lanes
    • +
    • the player tries to put each output into one second
    • +
    • the player chooses vehicles randomly
    • +
    • the player writes the longitude and latitude of every vehicle into a + file or prints them
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Turn_Flows.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Demand/Turn Flows - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/Demand/Turn Flows
    + + + +

    Trip generation with turnflows allows to model traffic flows in a +precise way, for simple, possibly loop-free networks with few internal +traffic generation. The general idea is to generate trips and routes for +individual vehicles based on road traffic counts. These traffic counts +can be performed at junctions. Ideally, the traffic counts should be +performed simultaneously at all relevant junctions. However, some edge +flows can be derived from other edge flows considering flow preservation +lows at nodes.

    +

    Basically two types of flows are needed in order to reconstruct the +routes in a predefined study area:

    +
      +
    • The generating flows FG[a] on all edges + a that enter the study area. [1]
    • +
    • The turn flows FT[a1,a2] for all flows between + links a1 and a2 at nodes with more + than one exiting edge.
    • +
    +

    The choice of traffic flows that need to be counted is illustrated by an +example network:

    +

    fig_demand_turnsflows_png.png

    +

    Neglecting all traffic generated within the study area, the following +flows need to be counted:

    +
      +
    • The generating flows FG[3], FG[12] are + entering the network.
    • +
    • The turn flows F[8,9], F[8,2] at node 6 and F[12,4], F[12,7] at node 3. All other nodes have only one exiting edge.
    • +
    +

    Once the necessary flows are counted for all considered transport modes +and time intervals, the trips and routes of all vehicles can be +generated with a special router, called JTRouter.

    +

    With SUMOPY the route generation with SUMOPY works as follows: First +import flows and turnflows from a CSV file by selecting the menu item

    +

    Demand>Turnflows>Import turnflows

    +

    The import turnflows dialog will pop up, as shown below.

    +

    fig_sumopy_gui_turnflowwizard.png

    +

    This dialog is similar to the OD-flow wizard explained in Sec. Zone +to zone demand flows and allows +to import traffic counts, and associate them with a time interval and a +transport mode.

    +

    The Turnflow File to be imported contains the traffic counts of both +flow types, generating flows and turnflows. The turnflow file has the +following format:

    +
    <ID1>, <count 1>, <ID11>, <count 11>,  <ID12>, <count 12>, ...
    +<ID2>, <count 2>, <ID21>, <count 21>,  <ID22>, <count 22>, ...
    +...
    +
    + +

    This notation has the following meaning:

    +

    <IDa> means the SUMO edge ID of edge a, where edge +a is the edge entering a node.

    +

    <IDab> means the SUMO edge ID of edge ab, where edge +ab is the edge outgoing from the node which edge +a enters.

    +

    <count a> means the number of vehicles leaving edge a, in +case the edge is generating flows, otherwise this count is zero.

    +

    <count ab> means the number of vehicles from edge a +turning into edge b.

    +

    All counts in this file refer to the mode and time interval specified in +the dialog box.

    +

    The turnflow file for the example network shown +above, could look like +this:

    +
    3, 1000
    +12, 800, 4, 200, 7, 600
    +8, 0, 9, 800, 2, 400
    +
    + +

    In this case, the generating flows FG[3]=1000, F[12]=800 and the turn flows FT[8,9] = 800, FT[8,2] = 400 and FT[12,4] = 200, FT[12,7] = 500 for a +specific mode and time interval.

    +

    Hint: In order to quickly compile the turnflow file, open a text +editor and the SUMOPy window next to each other. In the SUMOPy network +editor, deselect lanes, connections and crossings by clicking on the +button next to the zoom buttons below the network canvas. Then select +the info tool (if not already active) and click on the edges you +consider for the turnflow file. The respective edge will be highlighted +and you can see all edge attributes in the object browser, as shown +below:

    +

    fig_sumopy_gui_edgeid.png

    +

    From there, copy the SUMO edge ID and paste it into your turnflow text +file.

    +

    Optionally define destination zones: Within the turnflow demand model +destination zones define edges where vehicle routes end. This may be +necessary in order to prevent vehicles of making a loop on the network +outside the study area and re-entering the study area. Destination zones +for turnflows are created in the same way as Traffic assignment Zones in +section Zone +to zone demand flows.

    +

    Generate directly route from flows and turn-flows information by +selecting menu item

    +

    Demand>Turnflows>Turnflows to routes

    +

    This process is using SUMO’s JTROUTER and will generate both trips and +routes. The scenario is now ready to be simulated by selecting

    +

    Simulation>Sumo>export routes and simulate...

    +

    Proceed as described in Sec. #Simulating the +scenario.

    +

    A test file for turnflows is located in

    +

    SUMOHOME/tools/contributed/sumopy/testscenario/demo_dem_tf_car.csv

    +
      +
    1. In addition, traffic flows can also be generated on edges within the + study area, but in practice it is difficult to measure those flows + because one would need to spot and count only departing vehicles + along the roads of the study area. However, for some particular + edges with many departing vehicles this may be necessary to do.
    2. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Demand/Zone_To_Zone.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Demand/Zone To Zone - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/Demand/Zone To Zone
    + + + +

    We first explain the general concept of Zone to zone demand generation +before we describe how to procede with SUMOPy.

    +
      +
    1. Zone definition: Definition of Zones, in SUMO also called “Traffic + Assignment Zones” (TAZ). A TAZ defines the area where participants + depart (zone of origin) or arrive (zone of destination). A TAZ does + typically contain several network edges.
    2. +
    3. Zone-to-Zone flow definition: Definition the number of trips + between each zone of origin and a zone of destination (= OD-flow). + This structure is widely known as the Origin-to Destination matrix + OD Matrix. OD-flows are defined.
        +
      • for different time intervals of the day.
      • +
      • for different transport mode.
      • +
      +
    4. +
    5. Trip generation: Each OD-flow is disaggregated into a discrete + number of individual trips, departing at different edges (and edge + positions) within the zone of origin, and at different time + instances within the specified time interval; and arriving at + different edges (and edge positions) within the zone of destination.
    6. +
    7. Routing: A route is computed for each individual trip, connecting + the edge within the zone of origin, with the edge within the zone of + destination.
    8. +
    +

    These steps can be performed with SUMOPy as follows....

    +

    From the SUMOPy network manipulation tools, select the Add zone tool.

    +

    After giving the zone a name [1] a polygon can be drawn on the network +with a series of <Button-Left> - clicks. Complete the zone with a final +<Double-Button-Left> - click. A <Double-Button-Right> - click will +aboard the current zone drawing. Currently, zones must be convex, +otherwise edge detection problems occur.

    +

    Only edges which are located entirely inside a zone are considered part +of a zone. Only edges inside a zone are considered for departure or +arrival of vehicles in the respective zone. After creating the zones you +can identify all edges in each zone by selecting the menu item

    +

    Landuse>Zones>Identify zone edges

    +

    It is possible to see all zone edges and and change zone names by using +the information tool and by clicking on the green zone border. Zones are +accessible under scenario.demand.zones. Zones can also be deleted with +the Delete tool of the network editor.

    +

    Zone-to-Zone flows can be added by selecting the menu item

    +

    Demand>Zone-to-zone demand>Add zone-to-zone flows

    +

    An “Add OD flow wizard” will pop up as shown in Fig. +below.

    +

    fig_sumopy_gui_odwizard.png

    +

    With this wizard, specify the time interval (in entire seconds) and the +transport mode. On the menu of the wizard select Edit>Add OD-flow to +table. Then a new row will appear in the table. Enter the zones of +origin and destination and the respective number of trips between them.

    +

    Instead of entering the OD flows manually, the wizard offers also the +possible to import OD-flows from a CSV file. Select from the wizard +menu:

    +

    File>Import CSV ...

    +

    and choose a CSV file from the file-dialog window. The CSV file must +have the following format:

    +
    <zone name origin 1>, <zone name destination 1>,<trip number 1>
    +<zone name origin 2>, <zone name destination 2>,<trip number 2>
    +...
    +
    + +

    Once the OD flows are all entered, press Save flows. The scale factor +can be used to multiply all entered trips with a constant (default is 1) +wwhile saving. The demand flows are now saved to SUMOPy and can be +browsed and modified under

    +

    scenario.demand.odintervals

    +

    Generate trips from OD flows by selecting menu item

    +

    Demand>Zone-to-zone demand>Generate trips from flows

    +

    The generated trips can be browsed and modified under

    +

    scenario.demand.trips

    +

    Perform a shortest path routing for each trip by selecting

    +

    Demand>Trips and router>Trips to routes with shortest path

    +

    The generated route can be browsed under

    +

    scenario.demand.trips.routes

    +

    With this method, SUMO’s duarouter is used to perform the routing. Note +that each trip is now linked to a route (see ID route column in trips). +If there is no route then the edge in the zone of origin is probably not +connected to the edge in the zone of destination [2]. The router does +not route pedestrians, but this is not necessary as their exact route +will be determined during simulation.

    +

    The scenario is now ready to be simulated by selecting

    +

    Simulation>Sumo>export routes and simulate...

    +

    Proceed as described in Sec. [1].

    +

    A test file for OD demand is located in

    +

    SUMOHOME/tools/contributed/sumopy/testscenario/demo_dem_od_bikes.csv

    +
      +
    1. zone names can added/modified later via browser
    2. +
    3. there can be several reasons for this, usually the destination edge + is in access-restricted areas, or there are one-way roads, impeding + access. Actually this should not happen too often, as the + disaggregation algorithm should verify accessibility
    4. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Demand_Modelling.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/GUI/Demand Modelling - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/GUI/Demand Modelling
    + + + +

    In the framework of SUMO, demand generation means essentially the +generation of traffic participants (persons and/or different types of +vehicles ) and the generation of a route for each traffic participant. +It is recommended to start with demand generation only after the network +has been edited. In any case it is good practice to save a scenario with +the network only (without demand info).

    +

    All available vehicle types[1] can be browsed and modified under:

    +

    scenario.demand.vtypes

    +

    Note that each vehicle type belongs to a vehicle class, also called +modes.

    +

    The different demand generation methods, as described below, will +generate trips and routes, which can be browsed in

    +

    scenario.demand.trips and scenario.demand.trips.routes

    +

    The currently implemented demand generation methods are:

    + +

    The different demand generation methods can be used in combination: For +example trips generated with method Zone to zone demand flows can be +simulated together with the demand generated with the Virtual +Population method.

    +
      +
    1. Of course in a traffic scenario we have usually more than one + participant of each type
    2. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/GUI/Getting_Started.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/GUI/Getting Started - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Contributed/SUMOPy/GUI/Getting Started
    + + + +

    Running SUMOPy#

    +

    Start the script sumopy_gui.py by double-clicking on it in your +browser. If this fails, use a command-line application, change directory +to

    +
    SUMOHOME/tools/contributed/sumopy
    +
    + +

    and run sumopy with

    +
    python sumopy_gui.py
    +
    + +

    If all required packages are installed correctly, you should see the +main window as shown here, +but initially with an empty network. The object browser shows initially +the main object of SUMOPy: the scenario, which contains all other +information.

    +

    fig_sumopy_gui_main.png

    +

    Opening/creating a scenario#

    +

    There is a test scenario in the SUMOPy distribution which is located in

    +
    SUMOHOME/tools/contributed/sumopy/testscenario
    +
    + +

    The quickest way to obtain results from a simulation is to import +already existing xml-files. In case the following SUMO network, poly +and route files

    +
    demo.net.xml demo.poly.xml demo.rou.xml
    +
    + +

    are located in directory

    +
    SUMOHOME/tools/contributed/sumopy/testscenario
    +
    + +

    then a new scenario can be created by importing these files into SUMOPy +at ones: from the main menu, choose Scenario>Create from xml... and +insert the scenario Shortname, and Workdir in the form as shown +here.

    +

    fig_sumopy_gui_newscenario.png

    +

    The options Name and Description are free text fields. After +pressing the Run button, network, buildings and routes will be +imported. In case the trip file demo.trip.xml exists, it will also be +imported.

    +

    In the same way it is possible to crate an empty scenario under menu +Scenario>New....

    +

    Browsing the scenario#

    +

    The object browser allows to navigate through all information of a +scenario. To a certain extend, it is possible to modify data. The most +important information are:

    +
      +
    • The network with edges, nodes, traffic light systems etc.
    • +
    • The landuse, containing also the building information from the + .poly| file as well as background maps (see later how to import + them).
    • +
    • The demand holds information on available vehicles types, trips and + routes.
    • +
    + +

    The network can be examined with the network editor. The initial editing +tool allows to click on the different network elements and retrieve the +respective information in the object browser.

    +

    With the zoom-buttons (+,-) located below the network editor, different +zoom levels can be obtained The 1:1 button zooms the network to fit +approximately the boundaries of the window. Next to the zoom button is a +button which pops up a menu when pressed. From this menu, the network +elements to be drawn can be selected or un-selected.

    +

    The following mouse-key combination allow to navigate the network:

    + + + + + + + + + + + + + + + + + +
    ActionKey-Mouse
    Zoom in/OutHold down <CTRL> + <Wheel>
    PanningHold down <CTRL> + <SHIFT> + <Button-Left>
    +

    Simulating the scenario#

    +

    From the main menu select:

    +

    Simulation>Sumo>export routes and simulate...

    +

    With this process, the current trips and routes in demand.trips will +be automatically exported to a SUMO .rou file. Choose the desired +simulation settings from the SUMO pop-up dialog, as shown in Fig. +here.

    +

    fig_sumopy_gui_sumo.png

    +

    The simulation parameters are self-explaining, just hover with the mouse +over the parameter name. The default parameters are typically suitable +to run a first simulation. Select one of the output options in order to +obtain specific simulation results. Regarding outputs, the Output +Sampling Time for the different outputs may be of interest. If you +observe in the simulations that vehicles get blocked at junctions for no +obvious reason, then it is possible to resolve conflicts by setting the +Teleport to a positive time (i.e. 10s).

    +

    After pressing the run button, the SUMO-GUI interface pops up, ready +for simulation, as shown Fig. +here.

    +

    fig_sumopy_gui_sumogui.png

    +

    Adjust delay time and press the Start button. At the end of the +simulation, confirm OK and close the SUMO-GUI window. Simulation results +are now imported into SUMOPy and are ready to be examined, visualized +and exported in various formats.

    +

    Viewing results#

    +

    The results can be viewed in table format and graphically, see +here.

    +

    fig_sumopy_gui_resultviewer.png

    +

    In the object browse, the results per trip and the results per edge can +be viewed. Both, trip and edge oriented result-table can be exported in +CSV format, see the Simulation>Results menu.

    +

    Results are not saved when saving the scenario. Instead the results +must be saved separately using

    +

    Simulation>Results>Save as ...

    +

    At any time, results can be reopened with the scenario with which they +have been produced, using:

    +

    Simulation>Results>Open ...

    +

    In case the Matplotlib package is installed you can generate plots in +various formats, choosing menu Simulation>Results>Plot with +matplotlib. The pop-up dialog helps to configure the graphical details +of the matplotlib plot. From the matplotlib figure window, the graphical +results can be exported in different file formats (PNG, PDF, JPEG, +etc.), an example PNG file is shown +below.

    +

    fig_demo_noise.png

    +

    Launching SUMOPy#

    +

    As explained above, networks can be created from SUMO XML files, or a +binary file can be loaded. Both operations can be performed from the +command line.

    +

    Loading a binary scenario at start#

    +

    A previously saved, binary scenario with filename scenario.obj| can be +loaded into SUMOPy at start using the commandline

    +
    python sumopy-gui.py workdir/scenario.obj|
    +
    + +

    Importing SUMO XML files at start#

    +

    An initial import of existing SUMO XML files with rootname scenario| and +located in directory workdir| can be accomplished with

    +
    python sumopy-gui.py scenario workdir|
    +
    + +

    Importing and Editing networks#

    +

    if needed, the network should be modified before moving on to demand modeling (see Sec.[secdemand]).

    +

    Importing nets and buldings#

    +

    Networks can be import from a SUMO net.xml file with

    +

    network>import>from sumo net.xml ...

    +

    Networks can be converted and imported from a previously downloaded OSM +file, calling a wizard with:

    +

    network>import>from osm.xml ...

    +

    Different types of buildings, parks, car parking, leisure areas, etc (in +SUMOPy called called “facilities”) are a property of the landuse object +and can be extracted and imported from an OSM file with menu item

    +

    landuse>facilities>import from osm...

    +

    Sometimes special characters in the XML file are offending the python +XML parser, leading to errors during import. If this occurs, simply +“clean” the respective OSM file with

    +

    landuse>facilities>clean osm file...

    +

    prior to importing it.

    +

    Editing with SUMO’s Netedit#

    +

    The recommended way to edit the network is via netedit|, which is +provided with SUMO from version 0.25. SUMO’s netedit| can be called by +choosing the menu

    +

    Network>Edit with netedit

    +

    netedit| will be fired up with the network ready to be edited. The use +of netedit| is documented here: http://sumo.dlr.de/docs/NETEDIT.html. After +editing, the network must be saved within netedit| be pressing -s +or with File>save|. Then netedit| can be closed and the modified +network will be reimported into SUMOPy.

    +

    Editing with SUMO’s Netedit on background maps#

    +

    There is a possibility to edit the network with netedit| on background +maps. Currently these are Google Satellite maps. Before editing with +background maps, the maps must be downloaded for the given network area. +This is accomplished by a wizard which can be called selecting the menu +item[1].

    +

    landuse>maps>download...

    +

    The wizard helps to download the squared tiles which cover the network +area. The resolution can be defined by setting the tile width (and +height) in meters. The tile size in pixel is maximum 1280 (using the +Google Map server). The resolution is then tile size/tile width in pixel +per meter.

    +

    it is highly recommended to press the Apply| Button prior to downloading +the maps. This will calculate the number of tiles which are going to be +downloaded. This is important to know, because Google maps prevent IPs +from downloading too many maps of an area. Therefore do not exceed about +300 tiles! Note further that, dependent on the performance of your +computer, netedit| may run into problems to handle too large map areas.

    +

    After the maps are downloaded, netedit| can be called with

    +

    Network>Edit with netedit on map

    +

    in order to edit the SUMO network on a map.

    +

    Editing with SUMOPy Networkeditor#

    +

    The SUMOPy internal net-editor provides currently some limited +capability to edit the network

    +
      +
    • The geometry of edges and buildings can be manipulated: Activate the + Move| tool to move or the Stretch| to change vertexes.
    • +
    • With the menu Network>Clean nodes all edges entering a node are + “cut back” to a certain radius. This measure may facilitate the + verification of connections between lanes at junctions.
    • +
    + + +
      +
    1. In SUMOPy Maps are managed by the landuse object
    2. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 06 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Linux.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Installation/Linux - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/Installation/Linux
    + + + +

    Python 2.7 comes with most Linux operating systems. Python 3.x is not +yet supported. All required additional packages are available in +repositories:

    +
    python-numpy
    +python-wxgtk2.8
    +python-opengl
    +python-imaging
    +python-matplotlib
    +python-mpltoolkits.basemap
    +
    + +

    However, often Python 3.x is installed along the older version and may +be the default Python interpreter. So make sure you run the sumopy +scripts with Python 2.7

    +

    Another issue may that a newer version of python-wxgtk2.8 has been +included in the repositories of more recent Linux distributions, as for +example Ubuntu-16.04. In this case, do the following safe operation to +install python-wxgtk2.8:

    +
    echo "deb http://archive.ubuntu.com/ubuntu wily main universe"| sudo tee /etc/apt/sources.list.d/wily-copies.list
    +
    +sudo apt install python-wxgtk2.8
    +
    +sudo rm /etc/apt/sources.list.d/wily-copies.list
    +
    +sudo apt update
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Installation/Windows.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Installation/Windows - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/Installation/Windows
    + + + +

    For Windows, as required packages the following are recommended:

    +
    python-2.7.12.msi (32-bit or x86 preferred)
    +numpy-1.10.0-win32-superpack-python2.7.exe
    +wxPython2.8-win32-unicode-2.8.12.1-py27.exe
    +PyOpenGL-3.0.2.win32.exe
    +
    + +

    Optionally, install these:

    +
    matplotlib-1.4.3-cp27-none-win32.whl
    +basemap-1.0.8-cp27-none-win32.whl
    +PIL-1.1.7.win32-py2.7.exe
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Simulation/Sublanes.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Simulation/Sublanes - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMOPy/Simulation/Sublanes
    + + + +

    Sublanes is a new feature in SUMO since 2015. The simulation with +Sublanes render traffic flows on roads more realistic. With sublanes, +several vehicles can share side-by-side the same lane given there is +enough room. For example a car can pass a bicycle on the same lane if +the total lane width is larger than the bike width plus car width.

    +

    For sublane simulation with SUMOPy, simply browse to

    +
    scenario.demand.vtypes
    +
    + +

    and set the lanechange model model to SL2015. Note that SUMOPy applies +the same lanechange model to all vehicle types. Then run the simulation +with

    +
    Simulation>Sumo>export routes and simulate...
    +
    + +

    Note that on the SUMO dialog, the sublane width is now positive (1m by +default). This value (which can be changed) determines how many sublanes +can stay within one lane. For example a 3m wide lane can have 3 sublane +of 1m but only 2 sublane of width 1.5m.

    +

    The lanechange behavior with sublanes can be tweaked for each vehicle +type with the sublane parameters in scenario.demand.vtypes.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy/Tutorials/Open_and_Simulate.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy/Tutorials/Open and Simulate - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/SUMOPy/Tutorials/Open and Simulate
    + + + +

    Things to know first#

    +

    What is a scenario in SUMOPy?#

    +

    A scenario in SUMOPy is an object (a Python object of course) that +contains all data of a traffic scenario (network, trips, routes, +population, plans, buildings, maps, etc.) and basic methods to +manipulate the scenario (routing, creating new trips, etc). One of the +most important methods is the SUMO microsimulation of the scenario. +However, before a simulation can be run, all necessary data needs to be +created beforehand.

    +

    Opening a traffic scenario#

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMOPy.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMOPy.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMOPy - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Contributed/SUMOPy
    + + + +

    This document describes the capabilities and basic usage of the software +SUMOPy. SUMOPy is intended to expand the user-base of the traffic +micro-simulator SUMO by providing a user-friendly, yet flexible +simulation suite. The original publication related to SUMOPy can be +found at the University of Bologna +and in the proceedings of the SUMO2013.

    +

    A further scope of SUMOPy is to manage the huge amount of data necessary +to run complex multi-modal simulations. This includes different demand +generation methods such as support for OD matrices, trurnflows and a +syntetic (or virtual population. Also different services such as +Personal Rapid Transit (PRT) or self-driving taxis are supported.

    +

    Essentially, SUMOPy consists of a GUI interface, network editor as well +as a simple to use scripting language which facilitates the use of SUMO.

    +

    Introduction#

    +

    SUMO rapidly developed into a flexible and powerful open-source +micro-simulator for multi-modal urban traffic networks . The features +and the number of tools provided are constantly increasing, making +simulations ever more realistic. However, the different functionalities +consist at the present state of a large number of binaries and scripts +that act upon a large number of files, containing information on the +network, the vehicles, districts, trips routes, configurations, and many +other parameters. Scripts (mostly written in Python), binaries and data +files exist in a dispersed manner. In practice, a master script is +necessary to hold all processes and data together in order run a +simulation of a specific scenario in a controlled way. This approach is +extremely flexible, but it can become very time consuming and error +prone to find the various tools, combine their input and output and +generate the various configuration files. Furthermore, it reduces the +user-base of SUMO to those familiar with scripting and command line +interfaces. Instead, SUMO has the potential to become a +multi-disciplinary simulation platform if it becomes more accessible to +disciplines and competences.Scripts (mostly written in Python), binaries +and data files exist in a dispersed manner.

    +

    This problem has been recognized and different graphical user interfaces +have been developed. The traffic modeller (also named traffic +generator) is a tool written in Java which helps to manage files, to +configure simulations and to evaluate and visualize results.

    +

    SUMOPy is written entirely in the object-oriented script language +Python, it uses wxWindows with PyOPENGL as GUI interface and +NumPy for fast numerical array-type calculations. It is similar to the +traffic generator in that it simplifies the use of SUMO through a GUI. +But SUMOPy is more than just a GUI, it is a suite that allows to +access SUMO tools and binaries in a simple unified fashion. The +distinguishing features are:

    +
      +
    • SUMOPy has Python instances that can make direct use of tools + already available as Python code.
    • +
    • SUMOPy has a Python command line interface that allows direct and + interactive manipulation of SUMOPy instances.
    • +
    • SUMOPy provides a library that greatly simplifies the scripting.
    • +
    +

    Installation#

    +

    SUMOPy is a directory with python scripts. It is sufficient to unzip the +latest version and copy it in a directory of your choice. Since +SUMO-0.28, SUMOPy is inside the SUMO distribution and located in +SUMOHOME/tools/contributed.

    +

    However, SUMOPy makes extensive use of Python packages which need to be +installed before. The required packages to be installed are:

    +
      +
    1. Python 2.7
    2. +
    3. numpy-1.10 or newer
    4. +
    5. wxPython2.8 or wxPython2.9 (wxPython3.x is currently not properly + working with PyOpenGL-3.0.x)
    6. +
    7. PyOpenGL-3.0.x
    8. +
    +

    The following packages are optional:

    +
      +
    1. matplotlib-1.4 or newer, for high quality graphical output in + different file formats.
    2. +
    3. basemap or pyproj for geographic coordinate projection
    4. +
    5. PIL-1.1.7 or newer and basemap-1.0 (or pyproj) for downloading + backround maps from mapservers.
    6. +
    +

    The exact choice of package-versions and installation methods depend on +the operating system. Below we give short recommendations regarding the +choice of packages for different operating systems. In general, the +32-bit version is preferred as there are more pre-compiled packages +available, but this may change over time.

    + +

    The graphical user interface#

    +

    The graphical user interface of SUMOPY cane be launched by running the +script sumopy_gui.py, which is located in SUMOPy's main directory. The +following documents describe the basic functioning of the GUI.

    + +

    Simulation processes#

    +

    This section addresses the different simulation methods.

    + +

    Tutorials#

    +

    Opening and simulating a scenario

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed/SUMO_Traffic_Modeler.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + Contributed/SUMO Traffic Modeler - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Contributed/SUMO Traffic Modeler
    + + + +
    +

    Caution

    +

    This tool is obsolete and no longer supported

    +
    +

    SUMO Traffic Modeler by Leontios Papaleontiou is a graphical application +for setting up an activity-based demand. It is not longer developed by +the original author, and as it has some interesting features, we +included it into the release.

    +

    The tool is stored in a runnable .jar-file, you may simply double-click +on it on Windows to start it - it requires Java 6 to be installed. SUMO Traffic Modeler is located in <SUMO_HOME>\bin.

    +

    There is not much documentation on it. What worked for me was:

    +
      +
    • on the command line
        +
      • having a given road network, reimport it using + NETCONVERT and save plain XML + definitions using the --plain-output option. Make sure the prefix of the plain + files is the same as the network's name.
      • +
      +
    • +
    • start the SUMO Traffic Modeler by double-clicking on it
    • +
    • generate a project
        +
      • choose File->New Project...
      • +
      • navigate to the folder the network/plain network definitions are + located in for both, the project's name and for the network + description
      • +
      • the network should appear
      • +
      +
    • +
    • set-up demand
        +
      • click on "Traffic Layers" in the tree located on the right side + of the window
      • +
      • add some demand definitions ("Flow", "Area Flow", "Hotspot")
      • +
      • you may alter the demands using the dialog on the right, bottom + side of the window
      • +
      +
    • +
    • export the demand/simulation
        +
      • choose Simulation->Export...
      • +
      • fill the dialog with some meaningful values
      • +
      +
    • +
    +

    What you will obtain after those steps is a simulation configuration +file. The files referenced within this configuration are not yet build. +Even though SUMO Traffic Modeler has +a menu for setting up the paths to NETCONVERT +and DUAROUTER, both application are not executed +automatically. Instead, you have to convert the trips generated by SUMO Traffic Modeler into routes by +yourself on the command line. You may reuse the network you have used to +set up SUMO Traffic Modeler, but you +probably have to build it using the given edges/nodes files if you have +pruned it during the work with SUMO Traffic Modeler.

    +

    If you convert the trips generated by SUMO Traffic Modeler into routes using +DUAROUTER, you may get the error "No connection +between '...' and '...' found.". To ignore it, call +DUAROUTER with --ignore-errors.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Contributed.html sumo-1.6.0+dfsg1/docs/userdoc/Contributed.html --- sumo-1.5.0+dfsg1/docs/userdoc/Contributed.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Contributed.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,338 @@ + + + + + + + + + + + + + + + + + + + Contributed - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Contributed
    + + + +

    Some people extended SUMO or built tools to make it more usable. Not all +of these extensions have found its way to what we would call "SUMO +core".

    +

    Within SUMO#

    +

    The following extensions became a core part of the SUMO package.

    +
      +
    • TraCI

      online interaction with the simulation

      +
    • +
    +

    Included in the Distribution#

    +

    The following contributions are included in the package, but are less +supported.

    +
      +
    • Contributed/Cadyts

      a tool by Gunnar Flötteröd which adapts the simulate flows to the + real flows in a known net

      +
    • +
    +
      +
    • SUMOPy

      a tool by Joerg Schweizer supporting the whole SUMO toolchain with a + GUI especially for demand modelling

      +
    • +
    +
      +
    • LiSuM

      a middleware that couples LISA+ and SUMO to simulate real-world + traffic light controllers.

      +
    • +
    +
      +
    • SAGA

      a scriptable and user-defined activity-based mobility scenario generator for SUMO.

      +
    • +
    + +

    External#

    +

    The following extensions are managed and supported by other parties.

    +

    Demand Generators#

    + +

    Scenario and Network Editors#

    +
      +
    • eWorld

      an application that allows to convert and enrich roads networks

      +
    • +
    +
      +
    • Sumo2Unreal

      an importer for SUMO's .net.xml road network files into the Unreal + Engine 4 environment.

      +
    • +
    +

    Connections to Network Simulators#

    +
      +
    • Veins

      connects SUMO to OMNeT++

      +
    • +
    +
      +
    • TraNS

      connects SUMO to ns-2

      +
    • +
    +
      +
    • MOVE

      connects SUMO to ns-2

      +
    • +
    +
      +
    • VSimRTI

      connects SUMO to OMNeT++ and JiST/SWANS

      +
    • +
    +

    Other#

    +
      +
    • FLOW

      a framework for applying reinforcement learning and custom + controllers to SUMO, developed

      +
    • +
    +

    Purgatory#

    +

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

    +
      +
    • Contributed/iTranSIM

      extension by online-calibration using induction loop data by Tino + Morenz

      +
    • +
    + + +
    +

    Note

    +

    SUMOPlayer was removed in release 0.24.0. You should be able to use traceExporter.py for the same task.

    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 19 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/css/base.css sumo-1.6.0+dfsg1/docs/userdoc/css/base.css --- sumo-1.5.0+dfsg1/docs/userdoc/css/base.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/css/base.css 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,340 @@ +body { + padding-top: 50px; +} + +/* Replacement for `body { background-attachment: fixed; }`, which has + performance issues when scrolling on large displays. See #1394. */ +body::before { + content: ' '; + position: fixed; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: #f8f8f8; + background: url(../images/mkdocs-grid.png) repeat-x; + will-change: transform; + z-index: -1; +} + +body > .container { + min-height: 400px; +} + +ul.nav .main { + font-weight: bold; +} + +.source-links { + float: right; +} + +.col-md-9 img { + max-width: 100%; + display: inline-block; + padding: 4px; + line-height: 1.428571429; + background-color: #fff; + /* border: 1px solid #ddd; */ + border-radius: 4px; + /* margin: 20px auto 30px auto; */ +} + +/* + * The code below adds some padding to the top of the current anchor target so + * that, when navigating to it, the header isn't hidden by the navbar at the + * top. + */ +:target::before { + content: ""; + display: block; + margin-top: -75px; + height: 75px; + pointer-events: none; +} + +h1 { + color: #444; + font-weight: 400; + font-size: 42px; +} + +h2, h3, h4, h5, h6 { + color: #444; + font-weight: 300; +} + +hr { + border-top: 1px solid #aaa; +} + +pre, .rst-content tt { + max-width: 100%; + background: #fff; + color: #333; + overflow-x: auto; +} + +code.code-large, .rst-content tt.code-large { + font-size: 90%; +} + +code { + padding: 2px 5px; + background: #fff; + border: solid 1px #e1e4e5; + color: #333; + white-space: pre-wrap; + word-wrap: break-word; +} + +pre code { + display: block; + background: transparent; + border: none; + white-space: pre; + word-wrap: normal; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-size: 12px; +} + +kbd { + padding: 2px 4px; + font-size: 90%; + color: #fff; + background-color: #333; + border-radius: 3px; + -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); + box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); +} + +a code { + color: #2FA4E7; +} + +a:hover code, a:focus code { + color: #157AB5; +} + +footer { + margin-top: 30px; + margin-bottom: 10px; + text-align: center; + font-weight: 200; +} + +.modal-dialog { + margin-top: 50px; +} + +/* + * Side navigation + * + * Scrollspy and affixed enhanced navigation to highlight sections and secondary + * sections of docs content. + */ + +.bs-sidebar.affix { /* csslint allow: adjoining-classes */ + /* csslint ignore:start */ + position: -webkit-sticky; + position: sticky; + /* csslint ignore:end */ + top: 80px; +} + +.bs-sidebar.card { /* csslint allow: adjoining-classes */ + padding: 0; + max-height: 90%; + overflow-y: auto; +} + +/* Toggle (vertically flip) sidebar collapse icon */ +.bs-sidebar .navbar-toggler span { + -moz-transform: scale(1, -1); + -webkit-transform: scale(1, -1); + -o-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} + +.bs-sidebar .navbar-toggler.collapsed span { /* csslint allow: adjoining-classes */ + -moz-transform: scale(1, 1); + -webkit-transform: scale(1, 1); + -o-transform: scale(1, 1); + -ms-transform: scale(1, 1); + transform: scale(1, 1); +} + +/* First level of nav */ +.bs-sidenav { + padding-top: 10px; + padding-bottom: 10px; + border-radius: 5px; + width: 100%; +} + +/* All levels of nav */ +.bs-sidebar .nav > li > a { + display: block; + padding: 3px 15px; + z-index: 1; +} +.bs-sidebar .nav > li > a:hover, +.bs-sidebar .nav > li > a:focus { + text-decoration: none; + border-right: 2px solid; +} +.bs-sidebar .nav > li > a.active, +.bs-sidebar .nav > li > a.active:hover, +.bs-sidebar .nav > li > a.active:focus { + font-weight: bold; + background-color: transparent; + border-right: 2px solid; +} + +/* Nav: second level (shown on .active) */ +.bs-sidebar .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + margin-bottom: 8px; +} +.bs-sidebar .nav .nav > li > a { + padding-top: 3px; + padding-bottom: 3px; + padding-left: 30px; + font-size: 90%; +} + +.headerlink { + font-family: FontAwesome; + font-size: 14px; + display: none; + padding-left: .5em; +} + +h1:hover .headerlink, h2:hover .headerlink, h3:hover .headerlink, h4:hover .headerlink, h5:hover .headerlink, h6:hover .headerlink{ + display:inline-block; +} + + + +.admonition { + padding: 15px; + margin-bottom: 10px; + border: 1px solid transparent; + border-radius: 4px; + text-align: left; +} + +.admonition.caution { /* csslint allow: adjoining-classes */ + color: #000000; + background-color: #ffcc44; + border: 1px dashed #ff8800; + padding: .5em; +} + +.admonition.convention { /* csslint allow: adjoining-classes */ + color: #000000; + background-color: #ccffcc; + border: 1px dashed #88ff88; + padding: .5em; +} + +.admonition.missing { /* csslint allow: adjoining-classes */ + color: #000000; + background-color: #ffc0a0; + border: 1px dashed #440000; + padding: .5em; +} + +.admonition.note { /* csslint allow: adjoining-classes */ + color: #000000; + background-color: #ffffdd; + border: 1px dashed #ffcc44; + padding: .5em; +} + +.admonition.note2 { /* csslint allow: adjoining-classes */ + color: #3a87ad; + background-color: #d9edf7; + border-color: #bce8f1; +} + +.admonition.conference { /* csslint allow: adjoining-classes */ + color: #000000; + background-color: rgb(171,221,139); + border-color: #338033; +} + +.admonition.convention { + color: #000000; + background-color: #ccffcc; + padding: .5em; + border: 1px dashed #88ff88; +} + +.admonition.incomplete { + color: #000000; + background-color: #ffc0a0; + padding: .5em; + border: 1px dashed #440000; +} + +.admonition.danger { /* csslint allow: adjoining-classes */ + color: #b94a48; + background-color: #f2dede; + border-color: #eed3d7; +} + +.admonition-title { + font-weight: bold; + text-align: left; +} + + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + -webkit-border-radius: 0 6px 6px 6px; + -moz-border-radius: 0 6px 6px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #ccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #fff; +} + +.dropdown-submenu.pull-left { /* csslint allow: adjoining-classes */ + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { /* csslint allow: adjoining-classes */ + left: -100%; + margin-left: 10px; + -webkit-border-radius: 6px 0 6px 6px; + -moz-border-radius: 6px 0 6px 6px; + border-radius: 6px 0 6px 6px; +} \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/css/bootstrap-custom.min.css sumo-1.6.0+dfsg1/docs/userdoc/css/bootstrap-custom.min.css --- sumo-1.5.0+dfsg1/docs/userdoc/css/bootstrap-custom.min.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/css/bootstrap-custom.min.css 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1 @@ +/*! normalize.css v2.1.3 | MIT License | git.io/normalize */article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a{background:transparent}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{margin:.67em 0;font-size:2em}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{height:0;-moz-box-sizing:content-box;box-sizing:content-box}mark{color:#000;background:#ff0}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:0}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid #c0c0c0}legend{padding:0;border:0}button,input,select,textarea{margin:0;font-family:inherit;font-size:100%}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{padding:0;box-sizing:border-box}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:2cm .5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}*,*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:62.5%;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.428571429;color:#555;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#2fa4e7;text-decoration:none}a:hover,a:focus{color:#157ab5;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}img{vertical-align:middle}.img-responsive{display:block;height:auto;max-width:100%}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;height:auto;max-width:100%;padding:4px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-weight:500;line-height:1.1;color:#317eac}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{margin-top:20px;margin-bottom:10px}h1 small,h2 small,h3 small,h1 .small,h2 .small,h3 .small{font-size:65%}h4,h5,h6{margin-top:10px;margin-bottom:10px}h4 small,h5 small,h6 small,h4 .small,h5 .small,h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:200;line-height:1.4}@media(min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}.text-muted{color:#999}.text-primary{color:#2fa4e7}.text-primary:hover{color:#178acc}.text-warning{color:#c09853}.text-warning:hover{color:#a47e3c}.text-danger{color:#b94a48}.text-danger:hover{color:#953b39}.text-success{color:#468847}.text-success:hover{color:#356635}.text-info{color:#3a87ad}.text-info:hover{color:#2d6987}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}.list-inline>li:first-child{padding-left:0}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.428571429}dt{font-weight:bold}dd{margin-left:0}@media(min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}.dl-horizontal dd:before,.dl-horizontal dd:after{display:table;content:" "}.dl-horizontal dd:after{clear:both}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{font-size:17.5px;font-weight:300;line-height:1.25}blockquote p:last-child{margin-bottom:0}blockquote small,blockquote .small{display:block;line-height:1.428571429;color:#999}blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small,blockquote.pull-right .small{text-align:right}blockquote.pull-right small:before,blockquote.pull-right .small:before{content:''}blockquote.pull-right small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.428571429}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;white-space:nowrap;background-color:#f9f2f4;border-radius:4px}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.428571429;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}.container:before,.container:after{display:table;content:" "}.container:after{clear:both}@media(min-width:768px){.container{width:750px}}@media(min-width:992px){.container{width:970px}}@media(min-width:1200px){.container{width:1170px}}.row{margin-right:-15px;margin-left:-15px}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.row:before,.row:after{display:table;content:" "}.row:after{clear:both}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666666666666%}.col-xs-10{width:83.33333333333334%}.col-xs-9{width:75%}.col-xs-8{width:66.66666666666666%}.col-xs-7{width:58.333333333333336%}.col-xs-6{width:50%}.col-xs-5{width:41.66666666666667%}.col-xs-4{width:33.33333333333333%}.col-xs-3{width:25%}.col-xs-2{width:16.666666666666664%}.col-xs-1{width:8.333333333333332%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666666666666%}.col-xs-pull-10{right:83.33333333333334%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666666666666%}.col-xs-pull-7{right:58.333333333333336%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666666666667%}.col-xs-pull-4{right:33.33333333333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.666666666666664%}.col-xs-pull-1{right:8.333333333333332%}.col-xs-pull-0{right:0}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666666666666%}.col-xs-push-10{left:83.33333333333334%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666666666666%}.col-xs-push-7{left:58.333333333333336%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666666666667%}.col-xs-push-4{left:33.33333333333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.666666666666664%}.col-xs-push-1{left:8.333333333333332%}.col-xs-push-0{left:0}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666666666666%}.col-xs-offset-10{margin-left:83.33333333333334%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666666666666%}.col-xs-offset-7{margin-left:58.333333333333336%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666666666667%}.col-xs-offset-4{margin-left:33.33333333333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.666666666666664%}.col-xs-offset-1{margin-left:8.333333333333332%}.col-xs-offset-0{margin-left:0}@media(min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666666666666%}.col-sm-10{width:83.33333333333334%}.col-sm-9{width:75%}.col-sm-8{width:66.66666666666666%}.col-sm-7{width:58.333333333333336%}.col-sm-6{width:50%}.col-sm-5{width:41.66666666666667%}.col-sm-4{width:33.33333333333333%}.col-sm-3{width:25%}.col-sm-2{width:16.666666666666664%}.col-sm-1{width:8.333333333333332%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666666666666%}.col-sm-pull-10{right:83.33333333333334%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666666666666%}.col-sm-pull-7{right:58.333333333333336%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666666666667%}.col-sm-pull-4{right:33.33333333333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.666666666666664%}.col-sm-pull-1{right:8.333333333333332%}.col-sm-pull-0{right:0}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666666666666%}.col-sm-push-10{left:83.33333333333334%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666666666666%}.col-sm-push-7{left:58.333333333333336%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666666666667%}.col-sm-push-4{left:33.33333333333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.666666666666664%}.col-sm-push-1{left:8.333333333333332%}.col-sm-push-0{left:0}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666666666666%}.col-sm-offset-10{margin-left:83.33333333333334%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666666666666%}.col-sm-offset-7{margin-left:58.333333333333336%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666666666667%}.col-sm-offset-4{margin-left:33.33333333333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.666666666666664%}.col-sm-offset-1{margin-left:8.333333333333332%}.col-sm-offset-0{margin-left:0}}@media(min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666666666666%}.col-md-10{width:83.33333333333334%}.col-md-9{width:75%}.col-md-8{width:66.66666666666666%}.col-md-7{width:58.333333333333336%}.col-md-6{width:50%}.col-md-5{width:41.66666666666667%}.col-md-4{width:33.33333333333333%}.col-md-3{width:25%}.col-md-2{width:16.666666666666664%}.col-md-1{width:8.333333333333332%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666666666666%}.col-md-pull-10{right:83.33333333333334%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666666666666%}.col-md-pull-7{right:58.333333333333336%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666666666667%}.col-md-pull-4{right:33.33333333333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.666666666666664%}.col-md-pull-1{right:8.333333333333332%}.col-md-pull-0{right:0}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666666666666%}.col-md-push-10{left:83.33333333333334%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666666666666%}.col-md-push-7{left:58.333333333333336%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666666666667%}.col-md-push-4{left:33.33333333333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.666666666666664%}.col-md-push-1{left:8.333333333333332%}.col-md-push-0{left:0}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666666666666%}.col-md-offset-10{margin-left:83.33333333333334%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666666666666%}.col-md-offset-7{margin-left:58.333333333333336%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666666666667%}.col-md-offset-4{margin-left:33.33333333333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.666666666666664%}.col-md-offset-1{margin-left:8.333333333333332%}.col-md-offset-0{margin-left:0}}@media(min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666666666666%}.col-lg-10{width:83.33333333333334%}.col-lg-9{width:75%}.col-lg-8{width:66.66666666666666%}.col-lg-7{width:58.333333333333336%}.col-lg-6{width:50%}.col-lg-5{width:41.66666666666667%}.col-lg-4{width:33.33333333333333%}.col-lg-3{width:25%}.col-lg-2{width:16.666666666666664%}.col-lg-1{width:8.333333333333332%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666666666666%}.col-lg-pull-10{right:83.33333333333334%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666666666666%}.col-lg-pull-7{right:58.333333333333336%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666666666667%}.col-lg-pull-4{right:33.33333333333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.666666666666664%}.col-lg-pull-1{right:8.333333333333332%}.col-lg-pull-0{right:0}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666666666666%}.col-lg-push-10{left:83.33333333333334%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666666666666%}.col-lg-push-7{left:58.333333333333336%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666666666667%}.col-lg-push-4{left:33.33333333333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.666666666666664%}.col-lg-push-1{left:8.333333333333332%}.col-lg-push-0{left:0}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666666666666%}.col-lg-offset-10{margin-left:83.33333333333334%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666666666666%}.col-lg-offset-7{margin-left:58.333333333333336%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666666666667%}.col-lg-offset-4{margin-left:33.33333333333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.666666666666664%}.col-lg-offset-1{margin-left:8.333333333333332%}.col-lg-offset-0{margin-left:0}}table{max-width:100%;background-color:transparent}th{text-align:left}.table{width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.428571429;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*="col-"]{position:static;display:table-column;float:none}table td[class*="col-"],table th[class*="col-"]{display:table-cell;float:none}.table>thead>tr>.active,.table>tbody>tr>.active,.table>tfoot>tr>.active,.table>thead>.active>td,.table>tbody>.active>td,.table>tfoot>.active>td,.table>thead>.active>th,.table>tbody>.active>th,.table>tfoot>.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>.active:hover,.table-hover>tbody>.active:hover>td,.table-hover>tbody>.active:hover>th{background-color:#e8e8e8}.table>thead>tr>.success,.table>tbody>tr>.success,.table>tfoot>tr>.success,.table>thead>.success>td,.table>tbody>.success>td,.table>tfoot>.success>td,.table>thead>.success>th,.table>tbody>.success>th,.table>tfoot>.success>th{background-color:#dff0d8}.table-hover>tbody>tr>.success:hover,.table-hover>tbody>.success:hover>td,.table-hover>tbody>.success:hover>th{background-color:#d0e9c6}.table>thead>tr>.danger,.table>tbody>tr>.danger,.table>tfoot>tr>.danger,.table>thead>.danger>td,.table>tbody>.danger>td,.table>tfoot>.danger>td,.table>thead>.danger>th,.table>tbody>.danger>th,.table>tfoot>.danger>th{background-color:#f2dede}.table-hover>tbody>tr>.danger:hover,.table-hover>tbody>.danger:hover>td,.table-hover>tbody>.danger:hover>th{background-color:#ebcccc}.table>thead>tr>.warning,.table>tbody>tr>.warning,.table>tfoot>tr>.warning,.table>thead>.warning>td,.table>tbody>.warning>td,.table>tfoot>.warning>td,.table>thead>.warning>th,.table>tbody>.warning>th,.table>tfoot>.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>.warning:hover,.table-hover>tbody>.warning:hover>td,.table-hover>tbody>.warning:hover>th{background-color:#faf2cc}@media(max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:scroll;overflow-y:hidden;border:1px solid #ddd;-ms-overflow-style:-ms-autohiding-scrollbar;-webkit-overflow-scrolling:touch}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#555;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}select[multiple],select[size]{height:auto}select optgroup{font-family:inherit;font-size:inherit;font-style:inherit}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}input[type="number"]::-webkit-outer-spin-button,input[type="number"]::-webkit-inner-spin-button{height:auto}output{display:block;padding-top:9px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle}.form-control{display:block;width:100%;height:38px;padding:8px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(102,175,233,0.6)}.form-control:-moz-placeholder{color:#999}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee}textarea.form-control{height:auto}.form-group{margin-bottom:15px}.radio,.checkbox{display:block;min-height:20px;padding-left:20px;margin-top:10px;margin-bottom:10px;vertical-align:middle}.radio label,.checkbox label{display:inline;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{float:left;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:normal;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],.radio[disabled],.radio-inline[disabled],.checkbox[disabled],.checkbox-inline[disabled],fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"],fieldset[disabled] .radio,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm{height:auto}.input-lg{height:54px;padding:14px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:54px;line-height:54px}textarea.input-lg{height:auto}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#c09853}.has-warning .form-control{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.has-warning .input-group-addon{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#b94a48}.has-error .form-control{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.has-error .input-group-addon{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#468847}.has-success .form-control{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.has-success .input-group-addon{color:#468847;background-color:#dff0d8;border-color:#468847}.form-control-static{margin-bottom:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#959595}@media(min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block}.form-inline select.form-control{width:auto}.form-inline .radio,.form-inline .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:none;margin-left:0}}.form-horizontal .control-label,.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:9px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:29px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-group:before,.form-horizontal .form-group:after{display:table;content:" "}.form-horizontal .form-group:after{clear:both}.form-horizontal .form-control-static{padding-top:9px}@media(min-width:768px){.form-horizontal .control-label{text-align:right}}.btn{display:inline-block;padding:8px 12px;margin-bottom:0;font-size:14px;font-weight:normal;line-height:1.428571429;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;background-image:none;border:1px solid transparent;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none}.btn:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#555;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}.btn-default{color:#555;background-color:#fff;border-color:rgba(0,0,0,0.1)}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{color:#555;background-color:#ebebeb;border-color:rgba(0,0,0,0.1)}.btn-default:active,.btn-default.active,.open .dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:rgba(0,0,0,0.1)}.btn-default .badge{color:#fff;background-color:#fff}.btn-primary{color:#fff;background-color:#2fa4e7;border-color:#2fa4e7}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{color:#fff;background-color:#1990d5;border-color:#1684c2}.btn-primary:active,.btn-primary.active,.open .dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#2fa4e7;border-color:#2fa4e7}.btn-primary .badge{color:#2fa4e7;background-color:#fff}.btn-warning{color:#fff;background-color:#dd5600;border-color:#dd5600}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{color:#fff;background-color:#b44600;border-color:#a03e00}.btn-warning:active,.btn-warning.active,.open .dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#dd5600;border-color:#dd5600}.btn-warning .badge{color:#dd5600;background-color:#fff}.btn-danger{color:#fff;background-color:#c71c22;border-color:#c71c22}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{color:#fff;background-color:#a3171c;border-color:#911419}.btn-danger:active,.btn-danger.active,.open .dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#c71c22;border-color:#c71c22}.btn-danger .badge{color:#c71c22;background-color:#fff}.btn-success{color:#fff;background-color:#73a839;border-color:#73a839}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{color:#fff;background-color:#5e8a2f;border-color:#547a29}.btn-success:active,.btn-success.active,.open .dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#73a839;border-color:#73a839}.btn-success .badge{color:#73a839;background-color:#fff}.btn-info{color:#fff;background-color:#033c73;border-color:#033c73}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{color:#fff;background-color:#02274b;border-color:#011d37}.btn-info:active,.btn-info.active,.open .dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#033c73;border-color:#033c73}.btn-info .badge{color:#033c73;background-color:#fff}.btn-link{font-weight:normal;color:#2fa4e7;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#157ab5;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#999;text-decoration:none}.btn-lg{padding:14px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;transition:height .35s ease}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';-webkit-font-smoothing:antialiased;font-style:normal;font-weight:normal;line-height:1;-moz-osx-font-smoothing:grayscale}.glyphicon:empty{width:1em}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.428571429;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#fff;text-decoration:none;background-color:#2fa4e7}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#2fa4e7;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#999}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.428571429;color:#999}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media(min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar:before,.btn-toolbar:after{display:table;content:" "}.btn-toolbar:after{clear:both}.btn-toolbar .btn-group{float:left}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group,.btn-toolbar>.btn-group+.btn-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-group-lg>.btn{padding:14px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after{display:table;content:" "}.btn-group-vertical>.btn-group:after{clear:both}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-bottom-left-radius:4px;border-top-left-radius:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child>.btn:last-child,.btn-group-vertical>.btn-group:first-child>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;border-collapse:separate;table-layout:fixed}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}[data-toggle="buttons"]>.btn>input[type="radio"],[data-toggle="buttons"]>.btn>input[type="checkbox"]{display:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-right:0;padding-left:0}.input-group .form-control{width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:54px;padding:14px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:54px;line-height:54px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:8px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:14px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;white-space:nowrap}.input-group-btn:first-child>.btn{margin-right:-1px}.input-group-btn:last-child>.btn{margin-left:-1px}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-4px}.input-group-btn>.btn:hover,.input-group-btn>.btn:active{z-index:2}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav:before,.nav:after{display:table;content:" "}.nav:after{clear:both}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#999;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#2fa4e7}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.428571429;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#2fa4e7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media(min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media(min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}.navbar:before,.navbar:after{display:table;content:" "}.navbar:after{clear:both}@media(min-width:768px){.navbar{border-radius:4px}}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}.navbar-header:before,.navbar-header:after{display:table;content:" "}.navbar-header:after{clear:both}@media(min-width:768px){.navbar-header{float:left}}.navbar-collapse{max-height:340px;padding-right:15px;padding-left:15px;overflow-x:visible;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse:before,.navbar-collapse:after{display:table;content:" "}.navbar-collapse:after{clear:both}.navbar-collapse.in{overflow-y:auto}@media(min-width:768px){.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.container>.navbar-header,.container>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media(min-width:768px){.container>.navbar-header,.container>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media(min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media(min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media(min-width:768px){.navbar>.container .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media(min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media(max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media(min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media(min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:6px;margin-right:-15px;margin-bottom:6px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}@media(min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block}.navbar-form select.form-control{width:auto}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;padding-left:0;margin-top:0;margin-bottom:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{float:none;margin-left:0}}@media(max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media(min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-nav.pull-right>li>.dropdown-menu,.navbar-nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar-btn{margin-top:6px;margin-bottom:6px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media(min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#2fa4e7;border-color:#1995dc}.navbar-default .navbar-brand{color:#fff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#fff;background-color:none}.navbar-default .navbar-text{color:#ddd}.navbar-default .navbar-nav>li>a{color:#fff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#fff;background-color:#178acc}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fff;background-color:#178acc}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ddd;background-color:transparent}.navbar-default .navbar-toggle{border-color:#178acc}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#178acc}.navbar-default .navbar-toggle .icon-bar{background-color:#fff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#1995dc}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#fff;background-color:#178acc}@media(max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:#178acc}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#178acc}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ddd;background-color:transparent}}.navbar-default .navbar-link{color:#fff}.navbar-default .navbar-link:hover{color:#fff}.navbar-inverse{background-color:#033c73;border-color:#022f5a}.navbar-inverse .navbar-brand{color:#fff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:none}.navbar-inverse .navbar-text{color:#fff}.navbar-inverse .navbar-nav>li>a{color:#fff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:#022f5a}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#022f5a}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#022f5a}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#022f5a}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#022a50}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#022f5a}@media(max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#022f5a}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#022f5a}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#fff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:#022f5a}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#022f5a}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-inverse .navbar-link{color:#fff}.navbar-inverse .navbar-link:hover{color:#fff}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#999}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:8px 12px;margin-left:-1px;line-height:1.428571429;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{background-color:#eee}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#999;cursor:default;background-color:#f5f5f5;border-color:#f5f5f5}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#999;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:14px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager:before,.pager:after{display:table;content:" "}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#999;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}.label[href]:hover,.label[href]:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#999}.label-default[href]:hover,.label-default[href]:focus{background-color:#808080}.label-primary{background-color:#2fa4e7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#178acc}.label-success{background-color:#73a839}.label-success[href]:hover,.label-success[href]:focus{background-color:#59822c}.label-info{background-color:#033c73}.label-info[href]:hover,.label-info[href]:focus{background-color:#022241}.label-warning{background-color:#dd5600}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#aa4200}.label-danger{background-color:#c71c22}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#9a161a}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#999;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#2fa4e7;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;font-size:21px;font-weight:200;line-height:2.1428571435;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{line-height:1;color:inherit}.jumbotron p{line-height:1.4}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.428571429;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{display:block;height:auto;max-width:100%;margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#2fa4e7}.thumbnail .caption{padding:9px;color:#555}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable{padding-right:35px}.alert-dismissable .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#356635}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#2d6987}.alert-warning{color:#c09853;background-color:#fcf8e3;border-color:#fbeed5}.alert-warning hr{border-top-color:#f8e5be}.alert-warning .alert-link{color:#a47e3c}.alert-danger{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger hr{border-top-color:#e6c1c7}.alert-danger .alert-link{color:#953b39}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#2fa4e7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#73a839}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#033c73}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#dd5600}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#c71c22}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{text-decoration:none;background-color:#f5f5f5}a.list-group-item.active,a.list-group-item.active:hover,a.list-group-item.active:focus{z-index:2;color:#fff;background-color:#2fa4e7;border-color:#2fa4e7}a.list-group-item.active .list-group-item-heading,a.list-group-item.active:hover .list-group-item-heading,a.list-group-item.active:focus .list-group-item-heading{color:inherit}a.list-group-item.active .list-group-item-text,a.list-group-item.active:hover .list-group-item-text,a.list-group-item.active:focus .list-group-item-text{color:#e6f4fc}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel-body:before,.panel-body:after{display:table;content:" "}.panel-body:after{clear:both}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0}.panel>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.list-group .list-group-item:last-child{border-bottom:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child th,.panel>.table>tbody:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:last-child>th,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:last-child>td,.panel>.table-responsive>.table-bordered>thead>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-group .panel{margin-bottom:0;overflow:hidden;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse .panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#555;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-default>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#ddd}.panel-primary>.panel-heading{color:#fff;background-color:#2fa4e7;border-color:#ddd}.panel-primary>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-primary>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-success{border-color:#ddd}.panel-success>.panel-heading{color:#468847;background-color:#73a839;border-color:#ddd}.panel-success>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-success>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-warning{border-color:#ddd}.panel-warning>.panel-heading{color:#c09853;background-color:#dd5600;border-color:#ddd}.panel-warning>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-warning>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-danger{border-color:#ddd}.panel-danger>.panel-heading{color:#b94a48;background-color:#c71c22;border-color:#ddd}.panel-danger>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-danger>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.panel-info{border-color:#ddd}.panel-info>.panel-heading{color:#3a87ad;background-color:#033c73;border-color:#ddd}.panel-info>.panel-heading+.panel-collapse .panel-body{border-top-color:#ddd}.panel-info>.panel-footer+.panel-collapse .panel-body{border-bottom-color:#ddd}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;display:none;overflow:auto;overflow-y:scroll}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);transform:translate(0,0)}.modal-dialog{position:relative;z-index:1050;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);background-clip:padding-box}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1030;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{min-height:16.428571429px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.428571429}.modal-body{position:relative;padding:20px}.modal-footer{padding:19px 20px 20px;margin-top:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer:before,.modal-footer:after{display:table;content:" "}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}@media screen and (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}}.tooltip{position:absolute;z-index:1030;display:block;font-size:12px;line-height:1.4;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:rgba(0,0,0,0.9);border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:rgba(0,0,0,0.9);border-width:5px 5px 0}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-top-color:rgba(0,0,0,0.9);border-width:5px 5px 0}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-top-color:rgba(0,0,0,0.9);border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:rgba(0,0,0,0.9);border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:rgba(0,0,0,0.9);border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:rgba(0,0,0,0.9);border-width:0 5px 5px}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-bottom-color:rgba(0,0,0,0.9);border-width:0 5px 5px}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-bottom-color:rgba(0,0,0,0.9);border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0;content:" "}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0;content:" "}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0;content:" "}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0;content:" "}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;height:auto;max-width:100%;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);opacity:.5;filter:alpha(opacity=50)}.carousel-control.left{background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.5) 0),color-stop(rgba(0,0,0,0.0001) 100%));background-image:linear-gradient(to right,rgba(0,0,0,0.5) 0,rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000',endColorstr='#00000000',GradientType=1)}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,color-stop(rgba(0,0,0,0.0001) 0),color-stop(rgba(0,0,0,0.5) 100%));background-image:linear-gradient(to right,rgba(0,0,0,0.0001) 0,rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000',endColorstr='#80000000',GradientType=1)}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;outline:0;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;margin-left:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicons-chevron-left,.carousel-control .glyphicons-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;margin-left:-15px;font-size:30px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,tr.visible-xs,th.visible-xs,td.visible-xs{display:none!important}@media(max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-xs.visible-sm{display:block!important}table.visible-xs.visible-sm{display:table}tr.visible-xs.visible-sm{display:table-row!important}th.visible-xs.visible-sm,td.visible-xs.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-xs.visible-md{display:block!important}table.visible-xs.visible-md{display:table}tr.visible-xs.visible-md{display:table-row!important}th.visible-xs.visible-md,td.visible-xs.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-xs.visible-lg{display:block!important}table.visible-xs.visible-lg{display:table}tr.visible-xs.visible-lg{display:table-row!important}th.visible-xs.visible-lg,td.visible-xs.visible-lg{display:table-cell!important}}.visible-sm,tr.visible-sm,th.visible-sm,td.visible-sm{display:none!important}@media(max-width:767px){.visible-sm.visible-xs{display:block!important}table.visible-sm.visible-xs{display:table}tr.visible-sm.visible-xs{display:table-row!important}th.visible-sm.visible-xs,td.visible-sm.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-sm.visible-md{display:block!important}table.visible-sm.visible-md{display:table}tr.visible-sm.visible-md{display:table-row!important}th.visible-sm.visible-md,td.visible-sm.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-sm.visible-lg{display:block!important}table.visible-sm.visible-lg{display:table}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md,tr.visible-md,th.visible-md,td.visible-md{display:none!important}@media(max-width:767px){.visible-md.visible-xs{display:block!important}table.visible-md.visible-xs{display:table}tr.visible-md.visible-xs{display:table-row!important}th.visible-md.visible-xs,td.visible-md.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-md.visible-sm{display:block!important}table.visible-md.visible-sm{display:table}tr.visible-md.visible-sm{display:table-row!important}th.visible-md.visible-sm,td.visible-md.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-md.visible-lg{display:block!important}table.visible-md.visible-lg{display:table}tr.visible-md.visible-lg{display:table-row!important}th.visible-md.visible-lg,td.visible-md.visible-lg{display:table-cell!important}}.visible-lg,tr.visible-lg,th.visible-lg,td.visible-lg{display:none!important}@media(max-width:767px){.visible-lg.visible-xs{display:block!important}table.visible-lg.visible-xs{display:table}tr.visible-lg.visible-xs{display:table-row!important}th.visible-lg.visible-xs,td.visible-lg.visible-xs{display:table-cell!important}}@media(min-width:768px) and (max-width:991px){.visible-lg.visible-sm{display:block!important}table.visible-lg.visible-sm{display:table}tr.visible-lg.visible-sm{display:table-row!important}th.visible-lg.visible-sm,td.visible-lg.visible-sm{display:table-cell!important}}@media(min-width:992px) and (max-width:1199px){.visible-lg.visible-md{display:block!important}table.visible-lg.visible-md{display:table}tr.visible-lg.visible-md{display:table-row!important}th.visible-lg.visible-md,td.visible-lg.visible-md{display:table-cell!important}}@media(min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}.hidden-xs{display:block!important}table.hidden-xs{display:table}tr.hidden-xs{display:table-row!important}th.hidden-xs,td.hidden-xs{display:table-cell!important}@media(max-width:767px){.hidden-xs,tr.hidden-xs,th.hidden-xs,td.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-xs.hidden-sm,tr.hidden-xs.hidden-sm,th.hidden-xs.hidden-sm,td.hidden-xs.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-xs.hidden-md,tr.hidden-xs.hidden-md,th.hidden-xs.hidden-md,td.hidden-xs.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-xs.hidden-lg,tr.hidden-xs.hidden-lg,th.hidden-xs.hidden-lg,td.hidden-xs.hidden-lg{display:none!important}}.hidden-sm{display:block!important}table.hidden-sm{display:table}tr.hidden-sm{display:table-row!important}th.hidden-sm,td.hidden-sm{display:table-cell!important}@media(max-width:767px){.hidden-sm.hidden-xs,tr.hidden-sm.hidden-xs,th.hidden-sm.hidden-xs,td.hidden-sm.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-sm,tr.hidden-sm,th.hidden-sm,td.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-sm.hidden-md,tr.hidden-sm.hidden-md,th.hidden-sm.hidden-md,td.hidden-sm.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-sm.hidden-lg,tr.hidden-sm.hidden-lg,th.hidden-sm.hidden-lg,td.hidden-sm.hidden-lg{display:none!important}}.hidden-md{display:block!important}table.hidden-md{display:table}tr.hidden-md{display:table-row!important}th.hidden-md,td.hidden-md{display:table-cell!important}@media(max-width:767px){.hidden-md.hidden-xs,tr.hidden-md.hidden-xs,th.hidden-md.hidden-xs,td.hidden-md.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-md.hidden-sm,tr.hidden-md.hidden-sm,th.hidden-md.hidden-sm,td.hidden-md.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-md,tr.hidden-md,th.hidden-md,td.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-md.hidden-lg,tr.hidden-md.hidden-lg,th.hidden-md.hidden-lg,td.hidden-md.hidden-lg{display:none!important}}.hidden-lg{display:block!important}table.hidden-lg{display:table}tr.hidden-lg{display:table-row!important}th.hidden-lg,td.hidden-lg{display:table-cell!important}@media(max-width:767px){.hidden-lg.hidden-xs,tr.hidden-lg.hidden-xs,th.hidden-lg.hidden-xs,td.hidden-lg.hidden-xs{display:none!important}}@media(min-width:768px) and (max-width:991px){.hidden-lg.hidden-sm,tr.hidden-lg.hidden-sm,th.hidden-lg.hidden-sm,td.hidden-lg.hidden-sm{display:none!important}}@media(min-width:992px) and (max-width:1199px){.hidden-lg.hidden-md,tr.hidden-lg.hidden-md,th.hidden-lg.hidden-md,td.hidden-lg.hidden-md{display:none!important}}@media(min-width:1200px){.hidden-lg,tr.hidden-lg,th.hidden-lg,td.hidden-lg{display:none!important}}.visible-print,tr.visible-print,th.visible-print,td.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}.hidden-print,tr.hidden-print,th.hidden-print,td.hidden-print{display:none!important}}.navbar{background-image:-webkit-linear-gradient(#54b4eb,#2fa4e7 60%,#1d9ce5);background-image:linear-gradient(#54b4eb,#2fa4e7 60%,#1d9ce5);background-repeat:no-repeat;border-bottom:1px solid #178acc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff54b4eb',endColorstr='#ff1d9ce5',GradientType=0);filter:none;-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar .navbar-nav>li>a,.navbar-brand{text-shadow:0 1px 0 rgba(0,0,0,0.1)}.navbar-inverse{background-image:-webkit-linear-gradient(#04519b,#044687 60%,#033769);background-image:linear-gradient(#04519b,#044687 60%,#033769);background-repeat:no-repeat;border-bottom:1px solid #022241;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff04519b',endColorstr='#ff033769',GradientType=0);filter:none}.btn{text-shadow:0 1px 0 rgba(0,0,0,0.1)}.btn .caret{border-top-color:#fff}.btn-default{background-image:-webkit-linear-gradient(#fff,#fff 60%,#f5f5f5);background-image:linear-gradient(#fff,#fff 60%,#f5f5f5);background-repeat:no-repeat;border-bottom:1px solid #e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff5f5f5',GradientType=0);filter:none}.btn-default:hover{color:#555}.btn-default .caret{border-top-color:#555}.btn-default{background-image:-webkit-linear-gradient(#fff,#fff 60%,#f5f5f5);background-image:linear-gradient(#fff,#fff 60%,#f5f5f5);background-repeat:no-repeat;border-bottom:1px solid #e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff5f5f5',GradientType=0);filter:none}.btn-primary{background-image:-webkit-linear-gradient(#54b4eb,#2fa4e7 60%,#1d9ce5);background-image:linear-gradient(#54b4eb,#2fa4e7 60%,#1d9ce5);background-repeat:no-repeat;border-bottom:1px solid #178acc;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff54b4eb',endColorstr='#ff1d9ce5',GradientType=0);filter:none}.btn-success{background-image:-webkit-linear-gradient(#88c149,#73a839 60%,#699934);background-image:linear-gradient(#88c149,#73a839 60%,#699934);background-repeat:no-repeat;border-bottom:1px solid #59822c;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff88c149',endColorstr='#ff699934',GradientType=0);filter:none}.btn-info{background-image:-webkit-linear-gradient(#04519b,#033c73 60%,#02325f);background-image:linear-gradient(#04519b,#033c73 60%,#02325f);background-repeat:no-repeat;border-bottom:1px solid #022241;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff04519b',endColorstr='#ff02325f',GradientType=0);filter:none}.btn-warning{background-image:-webkit-linear-gradient(#ff6707,#dd5600 60%,#c94e00);background-image:linear-gradient(#ff6707,#dd5600 60%,#c94e00);background-repeat:no-repeat;border-bottom:1px solid #aa4200;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff6707',endColorstr='#ffc94e00',GradientType=0);filter:none}.btn-danger{background-image:-webkit-linear-gradient(#e12b31,#c71c22 60%,#b5191f);background-image:linear-gradient(#e12b31,#c71c22 60%,#b5191f);background-repeat:no-repeat;border-bottom:1px solid #9a161a;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe12b31',endColorstr='#ffb5191f',GradientType=0);filter:none}.pagination .active>a,.pagination .active>a:hover{border-color:#ddd}.panel-primary .panel-heading,.panel-success .panel-heading,.panel-warning .panel-heading,.panel-danger .panel-heading,.panel-info .panel-heading,.panel-primary .panel-title,.panel-success .panel-title,.panel-warning .panel-title,.panel-danger .panel-title,.panel-info .panel-title{color:#fff}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.clearfix:before,.clearfix:after{display:table;content:" "}.clearfix:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed} \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/css/bootstrap.min.css sumo-1.6.0+dfsg1/docs/userdoc/css/bootstrap.min.css --- sumo-1.5.0+dfsg1/docs/userdoc/css/bootstrap.min.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/css/bootstrap.min.css 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,12 @@ +/*! + * Bootswatch v4.1.3 + * Homepage: https://bootswatch.com + * Copyright 2012-2018 Thomas Park + * Licensed under MIT + * Based on Bootstrap +*//*! + * Bootstrap v4.1.3 (https://getbootstrap.com/) + * Copyright 2011-2018 The Bootstrap Authors + * Copyright 2011-2018 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */:root{--blue:#033C73;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#C71C22;--orange:#fd7e14;--yellow:#DD5600;--green:#73A839;--teal:#20c997;--cyan:#2FA4E7;--white:#fff;--gray:#868e96;--gray-dark:#343a40;--primary:#2FA4E7;--secondary:#e9ecef;--success:#73A839;--info:#033C73;--warning:#DD5600;--danger:#C71C22;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-family-monospace:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}@-ms-viewport{width:device-width}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0 !important}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:0.5rem}p{margin-top:0;margin-bottom:1rem}abbr[title],abbr[data-original-title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}ol,ul,dl{margin-top:0;margin-bottom:1rem}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#2FA4E7;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#157ab5;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):hover,a:not([href]):not([tabindex]):focus{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}pre,code,kbd,samp{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:0.75rem;padding-bottom:0.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:0.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}input,button,select,optgroup,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type="button"],[type="reset"],[type="submit"]{-webkit-appearance:button}button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner{padding:0;border-style:none}input[type="radio"],input[type="checkbox"]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="date"],input[type="time"],input[type="datetime-local"],input[type="month"]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{outline-offset:-2px;-webkit-appearance:none}[type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none !important}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{margin-bottom:0.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:#2FA4E7}h1,.h1{font-size:2.5rem}h2,.h2{font-size:2rem}h3,.h3{font-size:1.75rem}h4,.h4{font-size:1.5rem}h5,.h5{font-size:1.25rem}h6,.h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,0.1)}small,.small{font-size:80%;font-weight:400}mark,.mark{padding:0.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:0.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#868e96}.blockquote-footer::before{content:"\2014 \00A0"}.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:0.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:0.25rem;max-width:100%;height:auto}.figure{display:inline-block}.figure-img{margin-bottom:0.5rem;line-height:1}.figure-caption{font-size:90%;color:#868e96}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:0.2rem 0.4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:0.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width: 576px){.container{max-width:540px}}@media (min-width: 768px){.container{max-width:720px}}@media (min-width: 992px){.container{max-width:960px}}@media (min-width: 1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*="col-"]{padding-right:0;padding-left:0}.col-1,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-10,.col-11,.col-12,.col,.col-auto,.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm,.col-sm-auto,.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12,.col-md,.col-md-auto,.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg,.col-lg-auto,.col-xl-1,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-1{margin-left:8.3333333333%}.offset-2{margin-left:16.6666666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.3333333333%}.offset-5{margin-left:41.6666666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.3333333333%}.offset-8{margin-left:66.6666666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.3333333333%}.offset-11{margin-left:91.6666666667%}@media (min-width: 576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-sm-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-sm-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-sm-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-sm-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-sm-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-sm-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-sm-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-sm-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-sm-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-sm-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-sm-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-sm-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-sm-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-sm-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-sm-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-sm-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-sm-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-sm-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-sm-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-sm-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-sm-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-sm-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.3333333333%}.offset-sm-2{margin-left:16.6666666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.3333333333%}.offset-sm-5{margin-left:41.6666666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.3333333333%}.offset-sm-8{margin-left:66.6666666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.3333333333%}.offset-sm-11{margin-left:91.6666666667%}}@media (min-width: 768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-md-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-md-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-md-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-md-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-md-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-md-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-md-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-md-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-md-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-md-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-md-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-md-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-md-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-md-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-md-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-md-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-md-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-md-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-md-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-md-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-md-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-md-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.3333333333%}.offset-md-2{margin-left:16.6666666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.3333333333%}.offset-md-5{margin-left:41.6666666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.3333333333%}.offset-md-8{margin-left:66.6666666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.3333333333%}.offset-md-11{margin-left:91.6666666667%}}@media (min-width: 992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-lg-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-lg-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-lg-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-lg-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-lg-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-lg-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-lg-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-lg-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-lg-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-lg-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-lg-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-lg-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-lg-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-lg-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-lg-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-lg-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-lg-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-lg-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-lg-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-lg-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-lg-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-lg-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.3333333333%}.offset-lg-2{margin-left:16.6666666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.3333333333%}.offset-lg-5{margin-left:41.6666666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.3333333333%}.offset-lg-8{margin-left:66.6666666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.3333333333%}.offset-lg-11{margin-left:91.6666666667%}}@media (min-width: 1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-webkit-box-flex:0;-ms-flex:0 0 8.3333333333%;flex:0 0 8.3333333333%;max-width:8.3333333333%}.col-xl-2{-webkit-box-flex:0;-ms-flex:0 0 16.6666666667%;flex:0 0 16.6666666667%;max-width:16.6666666667%}.col-xl-3{-webkit-box-flex:0;-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-webkit-box-flex:0;-ms-flex:0 0 33.3333333333%;flex:0 0 33.3333333333%;max-width:33.3333333333%}.col-xl-5{-webkit-box-flex:0;-ms-flex:0 0 41.6666666667%;flex:0 0 41.6666666667%;max-width:41.6666666667%}.col-xl-6{-webkit-box-flex:0;-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-webkit-box-flex:0;-ms-flex:0 0 58.3333333333%;flex:0 0 58.3333333333%;max-width:58.3333333333%}.col-xl-8{-webkit-box-flex:0;-ms-flex:0 0 66.6666666667%;flex:0 0 66.6666666667%;max-width:66.6666666667%}.col-xl-9{-webkit-box-flex:0;-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-webkit-box-flex:0;-ms-flex:0 0 83.3333333333%;flex:0 0 83.3333333333%;max-width:83.3333333333%}.col-xl-11{-webkit-box-flex:0;-ms-flex:0 0 91.6666666667%;flex:0 0 91.6666666667%;max-width:91.6666666667%}.col-xl-12{-webkit-box-flex:0;-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-webkit-box-ordinal-group:0;-ms-flex-order:-1;order:-1}.order-xl-last{-webkit-box-ordinal-group:14;-ms-flex-order:13;order:13}.order-xl-0{-webkit-box-ordinal-group:1;-ms-flex-order:0;order:0}.order-xl-1{-webkit-box-ordinal-group:2;-ms-flex-order:1;order:1}.order-xl-2{-webkit-box-ordinal-group:3;-ms-flex-order:2;order:2}.order-xl-3{-webkit-box-ordinal-group:4;-ms-flex-order:3;order:3}.order-xl-4{-webkit-box-ordinal-group:5;-ms-flex-order:4;order:4}.order-xl-5{-webkit-box-ordinal-group:6;-ms-flex-order:5;order:5}.order-xl-6{-webkit-box-ordinal-group:7;-ms-flex-order:6;order:6}.order-xl-7{-webkit-box-ordinal-group:8;-ms-flex-order:7;order:7}.order-xl-8{-webkit-box-ordinal-group:9;-ms-flex-order:8;order:8}.order-xl-9{-webkit-box-ordinal-group:10;-ms-flex-order:9;order:9}.order-xl-10{-webkit-box-ordinal-group:11;-ms-flex-order:10;order:10}.order-xl-11{-webkit-box-ordinal-group:12;-ms-flex-order:11;order:11}.order-xl-12{-webkit-box-ordinal-group:13;-ms-flex-order:12;order:12}.offset-xl-0{margin-left:0}.offset-xl-1{margin-left:8.3333333333%}.offset-xl-2{margin-left:16.6666666667%}.offset-xl-3{margin-left:25%}.offset-xl-4{margin-left:33.3333333333%}.offset-xl-5{margin-left:41.6666666667%}.offset-xl-6{margin-left:50%}.offset-xl-7{margin-left:58.3333333333%}.offset-xl-8{margin-left:66.6666666667%}.offset-xl-9{margin-left:75%}.offset-xl-10{margin-left:83.3333333333%}.offset-xl-11{margin-left:91.6666666667%}}.table{width:100%;margin-bottom:1rem;background-color:transparent}.table th,.table td{padding:0.75rem;vertical-align:top;border-top:1px solid #dee2e6}.table thead th{vertical-align:bottom;border-bottom:2px solid #dee2e6}.table tbody+tbody{border-top:2px solid #dee2e6}.table .table{background-color:#fff}.table-sm th,.table-sm td{padding:0.3rem}.table-bordered{border:1px solid #dee2e6}.table-bordered th,.table-bordered td{border:1px solid #dee2e6}.table-bordered thead th,.table-bordered thead td{border-bottom-width:2px}.table-borderless th,.table-borderless td,.table-borderless thead th,.table-borderless tbody+tbody{border:0}.table-striped tbody tr:nth-of-type(odd){background-color:rgba(0,0,0,0.05)}.table-hover tbody tr:hover{background-color:rgba(0,0,0,0.075)}.table-primary,.table-primary>th,.table-primary>td{background-color:#c5e6f8}.table-hover .table-primary:hover{background-color:#aedcf5}.table-hover .table-primary:hover>td,.table-hover .table-primary:hover>th{background-color:#aedcf5}.table-secondary,.table-secondary>th,.table-secondary>td{background-color:#f9fafb}.table-hover .table-secondary:hover{background-color:#eaedf1}.table-hover .table-secondary:hover>td,.table-hover .table-secondary:hover>th{background-color:#eaedf1}.table-success,.table-success>th,.table-success>td{background-color:#d8e7c8}.table-hover .table-success:hover{background-color:#cbdfb6}.table-hover .table-success:hover>td,.table-hover .table-success:hover>th{background-color:#cbdfb6}.table-info,.table-info>th,.table-info>td{background-color:#b8c8d8}.table-hover .table-info:hover{background-color:#a8bbcf}.table-hover .table-info:hover>td,.table-hover .table-info:hover>th{background-color:#a8bbcf}.table-warning,.table-warning>th,.table-warning>td{background-color:#f5d0b8}.table-hover .table-warning:hover{background-color:#f2c1a2}.table-hover .table-warning:hover>td,.table-hover .table-warning:hover>th{background-color:#f2c1a2}.table-danger,.table-danger>th,.table-danger>td{background-color:#efbfc1}.table-hover .table-danger:hover{background-color:#eaabad}.table-hover .table-danger:hover>td,.table-hover .table-danger:hover>th{background-color:#eaabad}.table-light,.table-light>th,.table-light>td{background-color:#fdfdfe}.table-hover .table-light:hover{background-color:#ececf6}.table-hover .table-light:hover>td,.table-hover .table-light:hover>th{background-color:#ececf6}.table-dark,.table-dark>th,.table-dark>td{background-color:#c6c8ca}.table-hover .table-dark:hover{background-color:#b9bbbe}.table-hover .table-dark:hover>td,.table-hover .table-dark:hover>th{background-color:#b9bbbe}.table-active,.table-active>th,.table-active>td{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover{background-color:rgba(0,0,0,0.075)}.table-hover .table-active:hover>td,.table-hover .table-active:hover>th{background-color:rgba(0,0,0,0.075)}.table .thead-dark th{color:#fff;background-color:#212529;border-color:#32383e}.table .thead-light th{color:#495057;background-color:#e9ecef;border-color:#dee2e6}.table-dark{color:#fff;background-color:#212529}.table-dark th,.table-dark td,.table-dark thead th{border-color:#32383e}.table-dark.table-bordered{border:0}.table-dark.table-striped tbody tr:nth-of-type(odd){background-color:rgba(255,255,255,0.05)}.table-dark.table-hover tbody tr:hover{background-color:rgba(255,255,255,0.075)}@media (max-width: 575.98px){.table-responsive-sm{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-sm>.table-bordered{border:0}}@media (max-width: 767.98px){.table-responsive-md{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-md>.table-bordered{border:0}}@media (max-width: 991.98px){.table-responsive-lg{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-lg>.table-bordered{border:0}}@media (max-width: 1199.98px){.table-responsive-xl{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive-xl>.table-bordered{border:0}}.table-responsive{display:block;width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar}.table-responsive>.table-bordered{border:0}.form-control{display:block;width:100%;height:calc(2.25rem + 2px);padding:0.375rem 0.75rem;font-size:1rem;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:0.25rem;-webkit-transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media screen and (prefers-reduced-motion: reduce){.form-control{-webkit-transition:none;transition:none}}.form-control::-ms-expand{background-color:transparent;border:0}.form-control:focus{color:#495057;background-color:#fff;border-color:#a1d6f4;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25)}.form-control::-webkit-input-placeholder{color:#868e96;opacity:1}.form-control:-ms-input-placeholder{color:#868e96;opacity:1}.form-control::-ms-input-placeholder{color:#868e96;opacity:1}.form-control::placeholder{color:#868e96;opacity:1}.form-control:disabled,.form-control[readonly]{background-color:#e9ecef;opacity:1}select.form-control:focus::-ms-value{color:#495057;background-color:#fff}.form-control-file,.form-control-range{display:block;width:100%}.col-form-label{padding-top:calc(0.375rem + 1px);padding-bottom:calc(0.375rem + 1px);margin-bottom:0;font-size:inherit;line-height:1.5}.col-form-label-lg{padding-top:calc(0.5rem + 1px);padding-bottom:calc(0.5rem + 1px);font-size:1.25rem;line-height:1.5}.col-form-label-sm{padding-top:calc(0.25rem + 1px);padding-bottom:calc(0.25rem + 1px);font-size:0.875rem;line-height:1.5}.form-control-plaintext{display:block;width:100%;padding-top:0.375rem;padding-bottom:0.375rem;margin-bottom:0;line-height:1.5;color:#495057;background-color:transparent;border:solid transparent;border-width:1px 0}.form-control-plaintext.form-control-sm,.form-control-plaintext.form-control-lg{padding-right:0;padding-left:0}.form-control-sm{height:calc(1.8125rem + 2px);padding:0.25rem 0.5rem;font-size:0.875rem;line-height:1.5;border-radius:0.2rem}.form-control-lg{height:calc(2.875rem + 2px);padding:0.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:0.3rem}select.form-control[size],select.form-control[multiple]{height:auto}textarea.form-control{height:auto}.form-group{margin-bottom:1rem}.form-text{display:block;margin-top:0.25rem}.form-row{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-5px;margin-left:-5px}.form-row>.col,.form-row>[class*="col-"]{padding-right:5px;padding-left:5px}.form-check{position:relative;display:block;padding-left:1.25rem}.form-check-input{position:absolute;margin-top:0.3rem;margin-left:-1.25rem}.form-check-input:disabled ~ .form-check-label{color:#868e96}.form-check-label{margin-bottom:0}.form-check-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding-left:0;margin-right:0.75rem}.form-check-inline .form-check-input{position:static;margin-top:0;margin-right:0.3125rem;margin-left:0}.valid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#73A839}.valid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.875rem;line-height:1.5;color:#fff;background-color:rgba(115,168,57,0.9);border-radius:0.25rem}.was-validated .form-control:valid,.form-control.is-valid,.was-validated .custom-select:valid,.custom-select.is-valid{border-color:#73A839}.was-validated .form-control:valid:focus,.form-control.is-valid:focus,.was-validated .custom-select:valid:focus,.custom-select.is-valid:focus{border-color:#73A839;-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.25);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.25)}.was-validated .form-control:valid ~ .valid-feedback,.was-validated .form-control:valid ~ .valid-tooltip,.form-control.is-valid ~ .valid-feedback,.form-control.is-valid ~ .valid-tooltip,.was-validated .custom-select:valid ~ .valid-feedback,.was-validated .custom-select:valid ~ .valid-tooltip,.custom-select.is-valid ~ .valid-feedback,.custom-select.is-valid ~ .valid-tooltip{display:block}.was-validated .form-control-file:valid ~ .valid-feedback,.was-validated .form-control-file:valid ~ .valid-tooltip,.form-control-file.is-valid ~ .valid-feedback,.form-control-file.is-valid ~ .valid-tooltip{display:block}.was-validated .form-check-input:valid ~ .form-check-label,.form-check-input.is-valid ~ .form-check-label{color:#73A839}.was-validated .form-check-input:valid ~ .valid-feedback,.was-validated .form-check-input:valid ~ .valid-tooltip,.form-check-input.is-valid ~ .valid-feedback,.form-check-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-control-input:valid ~ .custom-control-label,.custom-control-input.is-valid ~ .custom-control-label{color:#73A839}.was-validated .custom-control-input:valid ~ .custom-control-label::before,.custom-control-input.is-valid ~ .custom-control-label::before{background-color:#b2d789}.was-validated .custom-control-input:valid ~ .valid-feedback,.was-validated .custom-control-input:valid ~ .valid-tooltip,.custom-control-input.is-valid ~ .valid-feedback,.custom-control-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-control-input:valid:checked ~ .custom-control-label::before,.custom-control-input.is-valid:checked ~ .custom-control-label::before{background-color:#8dc450}.was-validated .custom-control-input:valid:focus ~ .custom-control-label::before,.custom-control-input.is-valid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(115,168,57,0.25);box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(115,168,57,0.25)}.was-validated .custom-file-input:valid ~ .custom-file-label,.custom-file-input.is-valid ~ .custom-file-label{border-color:#73A839}.was-validated .custom-file-input:valid ~ .custom-file-label::after,.custom-file-input.is-valid ~ .custom-file-label::after{border-color:inherit}.was-validated .custom-file-input:valid ~ .valid-feedback,.was-validated .custom-file-input:valid ~ .valid-tooltip,.custom-file-input.is-valid ~ .valid-feedback,.custom-file-input.is-valid ~ .valid-tooltip{display:block}.was-validated .custom-file-input:valid:focus ~ .custom-file-label,.custom-file-input.is-valid:focus ~ .custom-file-label{-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.25);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.25)}.invalid-feedback{display:none;width:100%;margin-top:0.25rem;font-size:80%;color:#C71C22}.invalid-tooltip{position:absolute;top:100%;z-index:5;display:none;max-width:100%;padding:0.25rem 0.5rem;margin-top:.1rem;font-size:0.875rem;line-height:1.5;color:#fff;background-color:rgba(199,28,34,0.9);border-radius:0.25rem}.was-validated .form-control:invalid,.form-control.is-invalid,.was-validated .custom-select:invalid,.custom-select.is-invalid{border-color:#C71C22}.was-validated .form-control:invalid:focus,.form-control.is-invalid:focus,.was-validated .custom-select:invalid:focus,.custom-select.is-invalid:focus{border-color:#C71C22;-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.25);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.25)}.was-validated .form-control:invalid ~ .invalid-feedback,.was-validated .form-control:invalid ~ .invalid-tooltip,.form-control.is-invalid ~ .invalid-feedback,.form-control.is-invalid ~ .invalid-tooltip,.was-validated .custom-select:invalid ~ .invalid-feedback,.was-validated .custom-select:invalid ~ .invalid-tooltip,.custom-select.is-invalid ~ .invalid-feedback,.custom-select.is-invalid ~ .invalid-tooltip{display:block}.was-validated .form-control-file:invalid ~ .invalid-feedback,.was-validated .form-control-file:invalid ~ .invalid-tooltip,.form-control-file.is-invalid ~ .invalid-feedback,.form-control-file.is-invalid ~ .invalid-tooltip{display:block}.was-validated .form-check-input:invalid ~ .form-check-label,.form-check-input.is-invalid ~ .form-check-label{color:#C71C22}.was-validated .form-check-input:invalid ~ .invalid-feedback,.was-validated .form-check-input:invalid ~ .invalid-tooltip,.form-check-input.is-invalid ~ .invalid-feedback,.form-check-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-control-input:invalid ~ .custom-control-label,.custom-control-input.is-invalid ~ .custom-control-label{color:#C71C22}.was-validated .custom-control-input:invalid ~ .custom-control-label::before,.custom-control-input.is-invalid ~ .custom-control-label::before{background-color:#ec777b}.was-validated .custom-control-input:invalid ~ .invalid-feedback,.was-validated .custom-control-input:invalid ~ .invalid-tooltip,.custom-control-input.is-invalid ~ .invalid-feedback,.custom-control-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-control-input:invalid:checked ~ .custom-control-label::before,.custom-control-input.is-invalid:checked ~ .custom-control-label::before{background-color:#e2343a}.was-validated .custom-control-input:invalid:focus ~ .custom-control-label::before,.custom-control-input.is-invalid:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(199,28,34,0.25);box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(199,28,34,0.25)}.was-validated .custom-file-input:invalid ~ .custom-file-label,.custom-file-input.is-invalid ~ .custom-file-label{border-color:#C71C22}.was-validated .custom-file-input:invalid ~ .custom-file-label::after,.custom-file-input.is-invalid ~ .custom-file-label::after{border-color:inherit}.was-validated .custom-file-input:invalid ~ .invalid-feedback,.was-validated .custom-file-input:invalid ~ .invalid-tooltip,.custom-file-input.is-invalid ~ .invalid-feedback,.custom-file-input.is-invalid ~ .invalid-tooltip{display:block}.was-validated .custom-file-input:invalid:focus ~ .custom-file-label,.custom-file-input.is-invalid:focus ~ .custom-file-label{-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.25);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.25)}.form-inline{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.form-inline .form-check{width:100%}@media (min-width: 576px){.form-inline label{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-bottom:0}.form-inline .form-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:0;-ms-flex:0 0 auto;flex:0 0 auto;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-bottom:0}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-plaintext{display:inline-block}.form-inline .input-group,.form-inline .custom-select{width:auto}.form-inline .form-check{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:auto;padding-left:0}.form-inline .form-check-input{position:relative;margin-top:0;margin-right:0.25rem;margin-left:0}.form-inline .custom-control{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.form-inline .custom-control-label{margin-bottom:0}}.btn{display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:0.375rem 0.75rem;font-size:1rem;line-height:1.5;border-radius:0.25rem;-webkit-transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media screen and (prefers-reduced-motion: reduce){.btn{-webkit-transition:none;transition:none}}.btn:hover,.btn:focus{text-decoration:none}.btn:focus,.btn.focus{outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25)}.btn.disabled,.btn:disabled{opacity:0.65}.btn:not(:disabled):not(.disabled){cursor:pointer}a.btn.disabled,fieldset:disabled a.btn{pointer-events:none}.btn-primary{color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.btn-primary:hover{color:#fff;background-color:#1992d7;border-color:#178acc}.btn-primary:focus,.btn-primary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5)}.btn-primary.disabled,.btn-primary:disabled{color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.btn-primary:not(:disabled):not(.disabled):active,.btn-primary:not(:disabled):not(.disabled).active,.show>.btn-primary.dropdown-toggle{color:#fff;background-color:#178acc;border-color:#1682c0}.btn-primary:not(:disabled):not(.disabled):active:focus,.btn-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5)}.btn-secondary{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-secondary:hover{color:#212529;background-color:#d3d9df;border-color:#cbd3da}.btn-secondary:focus,.btn-secondary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5);box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5)}.btn-secondary.disabled,.btn-secondary:disabled{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-secondary:not(:disabled):not(.disabled):active,.btn-secondary:not(:disabled):not(.disabled).active,.show>.btn-secondary.dropdown-toggle{color:#212529;background-color:#cbd3da;border-color:#c4ccd4}.btn-secondary:not(:disabled):not(.disabled):active:focus,.btn-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5);box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5)}.btn-success{color:#fff;background-color:#73A839;border-color:#73A839}.btn-success:hover{color:#fff;background-color:#5f8b2f;border-color:#59822c}.btn-success:focus,.btn-success.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5)}.btn-success.disabled,.btn-success:disabled{color:#fff;background-color:#73A839;border-color:#73A839}.btn-success:not(:disabled):not(.disabled):active,.btn-success:not(:disabled):not(.disabled).active,.show>.btn-success.dropdown-toggle{color:#fff;background-color:#59822c;border-color:#527829}.btn-success:not(:disabled):not(.disabled):active:focus,.btn-success:not(:disabled):not(.disabled).active:focus,.show>.btn-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5)}.btn-info{color:#fff;background-color:#033C73;border-color:#033C73}.btn-info:hover{color:#fff;background-color:#02294e;border-color:#022241}.btn-info:focus,.btn-info.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5);box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5)}.btn-info.disabled,.btn-info:disabled{color:#fff;background-color:#033C73;border-color:#033C73}.btn-info:not(:disabled):not(.disabled):active,.btn-info:not(:disabled):not(.disabled).active,.show>.btn-info.dropdown-toggle{color:#fff;background-color:#022241;border-color:#011c35}.btn-info:not(:disabled):not(.disabled):active:focus,.btn-info:not(:disabled):not(.disabled).active:focus,.show>.btn-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5);box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5)}.btn-warning{color:#fff;background-color:#DD5600;border-color:#DD5600}.btn-warning:hover{color:#fff;background-color:#b74700;border-color:#aa4200}.btn-warning:focus,.btn-warning.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5);box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5)}.btn-warning.disabled,.btn-warning:disabled{color:#fff;background-color:#DD5600;border-color:#DD5600}.btn-warning:not(:disabled):not(.disabled):active,.btn-warning:not(:disabled):not(.disabled).active,.show>.btn-warning.dropdown-toggle{color:#fff;background-color:#aa4200;border-color:#9d3d00}.btn-warning:not(:disabled):not(.disabled):active:focus,.btn-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5);box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5)}.btn-danger{color:#fff;background-color:#C71C22;border-color:#C71C22}.btn-danger:hover{color:#fff;background-color:#a5171c;border-color:#9a161a}.btn-danger:focus,.btn-danger.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5)}.btn-danger.disabled,.btn-danger:disabled{color:#fff;background-color:#C71C22;border-color:#C71C22}.btn-danger:not(:disabled):not(.disabled):active,.btn-danger:not(:disabled):not(.disabled).active,.show>.btn-danger.dropdown-toggle{color:#fff;background-color:#9a161a;border-color:#8f1418}.btn-danger:not(:disabled):not(.disabled):active:focus,.btn-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5)}.btn-light{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:hover{color:#212529;background-color:#e2e6ea;border-color:#dae0e5}.btn-light:focus,.btn-light.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5);box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5)}.btn-light.disabled,.btn-light:disabled{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-light:not(:disabled):not(.disabled):active,.btn-light:not(:disabled):not(.disabled).active,.show>.btn-light.dropdown-toggle{color:#212529;background-color:#dae0e5;border-color:#d3d9df}.btn-light:not(:disabled):not(.disabled):active:focus,.btn-light:not(:disabled):not(.disabled).active:focus,.show>.btn-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5);box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5)}.btn-dark{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:hover{color:#fff;background-color:#23272b;border-color:#1d2124}.btn-dark:focus,.btn-dark.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5);box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5)}.btn-dark.disabled,.btn-dark:disabled{color:#fff;background-color:#343a40;border-color:#343a40}.btn-dark:not(:disabled):not(.disabled):active,.btn-dark:not(:disabled):not(.disabled).active,.show>.btn-dark.dropdown-toggle{color:#fff;background-color:#1d2124;border-color:#171a1d}.btn-dark:not(:disabled):not(.disabled):active:focus,.btn-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5);box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5)}.btn-outline-primary{color:#2FA4E7;background-color:transparent;background-image:none;border-color:#2FA4E7}.btn-outline-primary:hover{color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.btn-outline-primary:focus,.btn-outline-primary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5)}.btn-outline-primary.disabled,.btn-outline-primary:disabled{color:#2FA4E7;background-color:transparent}.btn-outline-primary:not(:disabled):not(.disabled):active,.btn-outline-primary:not(:disabled):not(.disabled).active,.show>.btn-outline-primary.dropdown-toggle{color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.btn-outline-primary:not(:disabled):not(.disabled):active:focus,.btn-outline-primary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-primary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.5)}.btn-outline-secondary{color:#e9ecef;background-color:transparent;background-image:none;border-color:#e9ecef}.btn-outline-secondary:hover{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-outline-secondary:focus,.btn-outline-secondary.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5);box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5)}.btn-outline-secondary.disabled,.btn-outline-secondary:disabled{color:#e9ecef;background-color:transparent}.btn-outline-secondary:not(:disabled):not(.disabled):active,.btn-outline-secondary:not(:disabled):not(.disabled).active,.show>.btn-outline-secondary.dropdown-toggle{color:#212529;background-color:#e9ecef;border-color:#e9ecef}.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-secondary.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5);box-shadow:0 0 0 0.2rem rgba(233,236,239,0.5)}.btn-outline-success{color:#73A839;background-color:transparent;background-image:none;border-color:#73A839}.btn-outline-success:hover{color:#fff;background-color:#73A839;border-color:#73A839}.btn-outline-success:focus,.btn-outline-success.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5)}.btn-outline-success.disabled,.btn-outline-success:disabled{color:#73A839;background-color:transparent}.btn-outline-success:not(:disabled):not(.disabled):active,.btn-outline-success:not(:disabled):not(.disabled).active,.show>.btn-outline-success.dropdown-toggle{color:#fff;background-color:#73A839;border-color:#73A839}.btn-outline-success:not(:disabled):not(.disabled):active:focus,.btn-outline-success:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-success.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5);box-shadow:0 0 0 0.2rem rgba(115,168,57,0.5)}.btn-outline-info{color:#033C73;background-color:transparent;background-image:none;border-color:#033C73}.btn-outline-info:hover{color:#fff;background-color:#033C73;border-color:#033C73}.btn-outline-info:focus,.btn-outline-info.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5);box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5)}.btn-outline-info.disabled,.btn-outline-info:disabled{color:#033C73;background-color:transparent}.btn-outline-info:not(:disabled):not(.disabled):active,.btn-outline-info:not(:disabled):not(.disabled).active,.show>.btn-outline-info.dropdown-toggle{color:#fff;background-color:#033C73;border-color:#033C73}.btn-outline-info:not(:disabled):not(.disabled):active:focus,.btn-outline-info:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-info.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5);box-shadow:0 0 0 0.2rem rgba(3,60,115,0.5)}.btn-outline-warning{color:#DD5600;background-color:transparent;background-image:none;border-color:#DD5600}.btn-outline-warning:hover{color:#fff;background-color:#DD5600;border-color:#DD5600}.btn-outline-warning:focus,.btn-outline-warning.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5);box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5)}.btn-outline-warning.disabled,.btn-outline-warning:disabled{color:#DD5600;background-color:transparent}.btn-outline-warning:not(:disabled):not(.disabled):active,.btn-outline-warning:not(:disabled):not(.disabled).active,.show>.btn-outline-warning.dropdown-toggle{color:#fff;background-color:#DD5600;border-color:#DD5600}.btn-outline-warning:not(:disabled):not(.disabled):active:focus,.btn-outline-warning:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-warning.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5);box-shadow:0 0 0 0.2rem rgba(221,86,0,0.5)}.btn-outline-danger{color:#C71C22;background-color:transparent;background-image:none;border-color:#C71C22}.btn-outline-danger:hover{color:#fff;background-color:#C71C22;border-color:#C71C22}.btn-outline-danger:focus,.btn-outline-danger.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5)}.btn-outline-danger.disabled,.btn-outline-danger:disabled{color:#C71C22;background-color:transparent}.btn-outline-danger:not(:disabled):not(.disabled):active,.btn-outline-danger:not(:disabled):not(.disabled).active,.show>.btn-outline-danger.dropdown-toggle{color:#fff;background-color:#C71C22;border-color:#C71C22}.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-danger.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5);box-shadow:0 0 0 0.2rem rgba(199,28,34,0.5)}.btn-outline-light{color:#f8f9fa;background-color:transparent;background-image:none;border-color:#f8f9fa}.btn-outline-light:hover{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:focus,.btn-outline-light.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5);box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5)}.btn-outline-light.disabled,.btn-outline-light:disabled{color:#f8f9fa;background-color:transparent}.btn-outline-light:not(:disabled):not(.disabled):active,.btn-outline-light:not(:disabled):not(.disabled).active,.show>.btn-outline-light.dropdown-toggle{color:#212529;background-color:#f8f9fa;border-color:#f8f9fa}.btn-outline-light:not(:disabled):not(.disabled):active:focus,.btn-outline-light:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-light.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5);box-shadow:0 0 0 0.2rem rgba(248,249,250,0.5)}.btn-outline-dark{color:#343a40;background-color:transparent;background-image:none;border-color:#343a40}.btn-outline-dark:hover{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:focus,.btn-outline-dark.focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5);box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5)}.btn-outline-dark.disabled,.btn-outline-dark:disabled{color:#343a40;background-color:transparent}.btn-outline-dark:not(:disabled):not(.disabled):active,.btn-outline-dark:not(:disabled):not(.disabled).active,.show>.btn-outline-dark.dropdown-toggle{color:#fff;background-color:#343a40;border-color:#343a40}.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.show>.btn-outline-dark.dropdown-toggle:focus{-webkit-box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5);box-shadow:0 0 0 0.2rem rgba(52,58,64,0.5)}.btn-link{font-weight:400;color:#2FA4E7;background-color:transparent}.btn-link:hover{color:#157ab5;text-decoration:underline;background-color:transparent;border-color:transparent}.btn-link:focus,.btn-link.focus{text-decoration:underline;border-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link:disabled,.btn-link.disabled{color:#868e96;pointer-events:none}.btn-lg,.btn-group-lg>.btn{padding:0.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:0.3rem}.btn-sm,.btn-group-sm>.btn{padding:0.25rem 0.5rem;font-size:0.875rem;line-height:1.5;border-radius:0.2rem}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:0.5rem}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{-webkit-transition:opacity 0.15s linear;transition:opacity 0.15s linear}@media screen and (prefers-reduced-motion: reduce){.fade{-webkit-transition:none;transition:none}}.fade:not(.show){opacity:0}.collapse:not(.show){display:none}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;transition:height 0.35s ease}@media screen and (prefers-reduced-motion: reduce){.collapsing{-webkit-transition:none;transition:none}}.dropup,.dropright,.dropdown,.dropleft{position:relative}.dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid;border-right:0.3em solid transparent;border-bottom:0;border-left:0.3em solid transparent}.dropdown-toggle:empty::after{margin-left:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:0.5rem 0;margin:0.125rem 0 0;font-size:1rem;color:#495057;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,0.15);border-radius:0.25rem}.dropdown-menu-right{right:0;left:auto}.dropup .dropdown-menu{top:auto;bottom:100%;margin-top:0;margin-bottom:0.125rem}.dropup .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0;border-right:0.3em solid transparent;border-bottom:0.3em solid;border-left:0.3em solid transparent}.dropup .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-menu{top:0;right:auto;left:100%;margin-top:0;margin-left:0.125rem}.dropright .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0;border-bottom:0.3em solid transparent;border-left:0.3em solid}.dropright .dropdown-toggle:empty::after{margin-left:0}.dropright .dropdown-toggle::after{vertical-align:0}.dropleft .dropdown-menu{top:0;right:100%;left:auto;margin-top:0;margin-right:0.125rem}.dropleft .dropdown-toggle::after{display:inline-block;width:0;height:0;margin-left:0.255em;vertical-align:0.255em;content:""}.dropleft .dropdown-toggle::after{display:none}.dropleft .dropdown-toggle::before{display:inline-block;width:0;height:0;margin-right:0.255em;vertical-align:0.255em;content:"";border-top:0.3em solid transparent;border-right:0.3em solid;border-bottom:0.3em solid transparent}.dropleft .dropdown-toggle:empty::after{margin-left:0}.dropleft .dropdown-toggle::before{vertical-align:0}.dropdown-menu[x-placement^="top"],.dropdown-menu[x-placement^="right"],.dropdown-menu[x-placement^="bottom"],.dropdown-menu[x-placement^="left"]{right:auto;bottom:auto}.dropdown-divider{height:0;margin:0.5rem 0;overflow:hidden;border-top:1px solid #e9ecef}.dropdown-item{display:block;width:100%;padding:0.25rem 1.5rem;clear:both;font-weight:400;color:#495057;text-align:inherit;white-space:nowrap;background-color:transparent;border:0}.dropdown-item:hover,.dropdown-item:focus{color:#fff;text-decoration:none;background-color:#2FA4E7}.dropdown-item.active,.dropdown-item:active{color:#fff;text-decoration:none;background-color:#2FA4E7}.dropdown-item.disabled,.dropdown-item:disabled{color:#868e96;background-color:transparent}.dropdown-menu.show{display:block}.dropdown-header{display:block;padding:0.5rem 1.5rem;margin-bottom:0;font-size:0.875rem;color:#868e96;white-space:nowrap}.dropdown-item-text{display:block;padding:0.25rem 1.5rem;color:#495057}.btn-group,.btn-group-vertical{position:relative;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover{z-index:1}.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn.active{z-index:1}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group,.btn-group-vertical .btn+.btn,.btn-group-vertical .btn+.btn-group,.btn-group-vertical .btn-group+.btn,.btn-group-vertical .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.btn-toolbar .input-group{width:auto}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:not(:last-child):not(.dropdown-toggle),.btn-group>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:not(:first-child),.btn-group>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.dropdown-toggle-split{padding-right:0.5625rem;padding-left:0.5625rem}.dropdown-toggle-split::after,.dropup .dropdown-toggle-split::after,.dropright .dropdown-toggle-split::after{margin-left:0}.dropleft .dropdown-toggle-split::before{margin-right:0}.btn-sm+.dropdown-toggle-split,.btn-group-sm>.btn+.dropdown-toggle-split{padding-right:0.375rem;padding-left:0.375rem}.btn-lg+.dropdown-toggle-split,.btn-group-lg>.btn+.dropdown-toggle-split{padding-right:0.75rem;padding-left:0.75rem}.btn-group-vertical{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.btn-group-vertical .btn,.btn-group-vertical .btn-group{width:100%}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:last-child):not(.dropdown-toggle),.btn-group-vertical>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:not(:first-child),.btn-group-vertical>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-top-right-radius:0}.btn-group-toggle>.btn,.btn-group-toggle>.btn-group>.btn{margin-bottom:0}.btn-group-toggle>.btn input[type="radio"],.btn-group-toggle>.btn input[type="checkbox"],.btn-group-toggle>.btn-group>.btn input[type="radio"],.btn-group-toggle>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;width:100%}.input-group>.form-control,.input-group>.custom-select,.input-group>.custom-file{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;width:1%;margin-bottom:0}.input-group>.form-control+.form-control,.input-group>.form-control+.custom-select,.input-group>.form-control+.custom-file,.input-group>.custom-select+.form-control,.input-group>.custom-select+.custom-select,.input-group>.custom-select+.custom-file,.input-group>.custom-file+.form-control,.input-group>.custom-file+.custom-select,.input-group>.custom-file+.custom-file{margin-left:-1px}.input-group>.form-control:focus,.input-group>.custom-select:focus,.input-group>.custom-file .custom-file-input:focus ~ .custom-file-label{z-index:3}.input-group>.custom-file .custom-file-input:focus{z-index:4}.input-group>.form-control:not(:last-child),.input-group>.custom-select:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.form-control:not(:first-child),.input-group>.custom-select:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.input-group>.custom-file{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.input-group>.custom-file:not(:last-child) .custom-file-label,.input-group>.custom-file:not(:last-child) .custom-file-label::after{border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.custom-file:not(:first-child) .custom-file-label{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-prepend,.input-group-append{display:-webkit-box;display:-ms-flexbox;display:flex}.input-group-prepend .btn,.input-group-append .btn{position:relative;z-index:2}.input-group-prepend .btn+.btn,.input-group-prepend .btn+.input-group-text,.input-group-prepend .input-group-text+.input-group-text,.input-group-prepend .input-group-text+.btn,.input-group-append .btn+.btn,.input-group-append .btn+.input-group-text,.input-group-append .input-group-text+.input-group-text,.input-group-append .input-group-text+.btn{margin-left:-1px}.input-group-prepend{margin-right:-1px}.input-group-append{margin-left:-1px}.input-group-text{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;padding:0.375rem 0.75rem;margin-bottom:0;font-size:1rem;font-weight:400;line-height:1.5;color:#495057;text-align:center;white-space:nowrap;background-color:#e9ecef;border:1px solid #ced4da;border-radius:0.25rem}.input-group-text input[type="radio"],.input-group-text input[type="checkbox"]{margin-top:0}.input-group-lg>.form-control,.input-group-lg>.input-group-prepend>.input-group-text,.input-group-lg>.input-group-append>.input-group-text,.input-group-lg>.input-group-prepend>.btn,.input-group-lg>.input-group-append>.btn{height:calc(2.875rem + 2px);padding:0.5rem 1rem;font-size:1.25rem;line-height:1.5;border-radius:0.3rem}.input-group-sm>.form-control,.input-group-sm>.input-group-prepend>.input-group-text,.input-group-sm>.input-group-append>.input-group-text,.input-group-sm>.input-group-prepend>.btn,.input-group-sm>.input-group-append>.btn{height:calc(1.8125rem + 2px);padding:0.25rem 0.5rem;font-size:0.875rem;line-height:1.5;border-radius:0.2rem}.input-group>.input-group-prepend>.btn,.input-group>.input-group-prepend>.input-group-text,.input-group>.input-group-append:not(:last-child)>.btn,.input-group>.input-group-append:not(:last-child)>.input-group-text,.input-group>.input-group-append:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group>.input-group-append:last-child>.input-group-text:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.input-group>.input-group-append>.btn,.input-group>.input-group-append>.input-group-text,.input-group>.input-group-prepend:not(:first-child)>.btn,.input-group>.input-group-prepend:not(:first-child)>.input-group-text,.input-group>.input-group-prepend:first-child>.btn:not(:first-child),.input-group>.input-group-prepend:first-child>.input-group-text:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.custom-control{position:relative;display:block;min-height:1.5rem;padding-left:1.5rem}.custom-control-inline{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;margin-right:1rem}.custom-control-input{position:absolute;z-index:-1;opacity:0}.custom-control-input:checked ~ .custom-control-label::before{color:#fff;background-color:#2FA4E7}.custom-control-input:focus ~ .custom-control-label::before{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25)}.custom-control-input:active ~ .custom-control-label::before{color:#fff;background-color:#cfeaf9}.custom-control-input:disabled ~ .custom-control-label{color:#868e96}.custom-control-input:disabled ~ .custom-control-label::before{background-color:#e9ecef}.custom-control-label{position:relative;margin-bottom:0}.custom-control-label::before{position:absolute;top:0.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;pointer-events:none;content:"";-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#dee2e6}.custom-control-label::after{position:absolute;top:0.25rem;left:-1.5rem;display:block;width:1rem;height:1rem;content:"";background-repeat:no-repeat;background-position:center center;background-size:50% 50%}.custom-checkbox .custom-control-label::before{border-radius:0.25rem}.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before{background-color:#2FA4E7}.custom-checkbox .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before{background-color:#2FA4E7}.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E")}.custom-checkbox .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(47,164,231,0.5)}.custom-checkbox .custom-control-input:disabled:indeterminate ~ .custom-control-label::before{background-color:rgba(47,164,231,0.5)}.custom-radio .custom-control-label::before{border-radius:50%}.custom-radio .custom-control-input:checked ~ .custom-control-label::before{background-color:#2FA4E7}.custom-radio .custom-control-input:checked ~ .custom-control-label::after{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E")}.custom-radio .custom-control-input:disabled:checked ~ .custom-control-label::before{background-color:rgba(47,164,231,0.5)}.custom-select{display:inline-block;width:100%;height:calc(2.25rem + 2px);padding:0.375rem 1.75rem 0.375rem 0.75rem;line-height:1.5;color:#495057;vertical-align:middle;background:#fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23343a40' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;background-size:8px 10px;border:1px solid #ced4da;border-radius:0.25rem;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-select:focus{border-color:#a1d6f4;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(161,214,244,0.5);box-shadow:0 0 0 0.2rem rgba(161,214,244,0.5)}.custom-select:focus::-ms-value{color:#495057;background-color:#fff}.custom-select[multiple],.custom-select[size]:not([size="1"]){height:auto;padding-right:0.75rem;background-image:none}.custom-select:disabled{color:#868e96;background-color:#e9ecef}.custom-select::-ms-expand{opacity:0}.custom-select-sm{height:calc(1.8125rem + 2px);padding-top:0.375rem;padding-bottom:0.375rem;font-size:75%}.custom-select-lg{height:calc(2.875rem + 2px);padding-top:0.375rem;padding-bottom:0.375rem;font-size:125%}.custom-file{position:relative;display:inline-block;width:100%;height:calc(2.25rem + 2px);margin-bottom:0}.custom-file-input{position:relative;z-index:2;width:100%;height:calc(2.25rem + 2px);margin:0;opacity:0}.custom-file-input:focus ~ .custom-file-label{border-color:#a1d6f4;-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25)}.custom-file-input:focus ~ .custom-file-label::after{border-color:#a1d6f4}.custom-file-input:disabled ~ .custom-file-label{background-color:#e9ecef}.custom-file-input:lang(en) ~ .custom-file-label::after{content:"Browse"}.custom-file-label{position:absolute;top:0;right:0;left:0;z-index:1;height:calc(2.25rem + 2px);padding:0.375rem 0.75rem;line-height:1.5;color:#495057;background-color:#fff;border:1px solid #ced4da;border-radius:0.25rem}.custom-file-label::after{position:absolute;top:0;right:0;bottom:0;z-index:3;display:block;height:2.25rem;padding:0.375rem 0.75rem;line-height:1.5;color:#495057;content:"Browse";background-color:#e9ecef;border-left:1px solid #ced4da;border-radius:0 0.25rem 0.25rem 0}.custom-range{width:100%;padding-left:0;background-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none}.custom-range:focus{outline:none}.custom-range:focus::-webkit-slider-thumb{-webkit-box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25)}.custom-range:focus::-moz-range-thumb{box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25)}.custom-range:focus::-ms-thumb{box-shadow:0 0 0 1px #fff,0 0 0 0.2rem rgba(47,164,231,0.25)}.custom-range::-moz-focus-outer{border:0}.custom-range::-webkit-slider-thumb{width:1rem;height:1rem;margin-top:-0.25rem;background-color:#2FA4E7;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-webkit-appearance:none;appearance:none}@media screen and (prefers-reduced-motion: reduce){.custom-range::-webkit-slider-thumb{-webkit-transition:none;transition:none}}.custom-range::-webkit-slider-thumb:active{background-color:#cfeaf9}.custom-range::-webkit-slider-runnable-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-moz-range-thumb{width:1rem;height:1rem;background-color:#2FA4E7;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;-moz-appearance:none;appearance:none}@media screen and (prefers-reduced-motion: reduce){.custom-range::-moz-range-thumb{-webkit-transition:none;transition:none}}.custom-range::-moz-range-thumb:active{background-color:#cfeaf9}.custom-range::-moz-range-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:#dee2e6;border-color:transparent;border-radius:1rem}.custom-range::-ms-thumb{width:1rem;height:1rem;margin-top:0;margin-right:0.2rem;margin-left:0.2rem;background-color:#2FA4E7;border:0;border-radius:1rem;-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;appearance:none}@media screen and (prefers-reduced-motion: reduce){.custom-range::-ms-thumb{-webkit-transition:none;transition:none}}.custom-range::-ms-thumb:active{background-color:#cfeaf9}.custom-range::-ms-track{width:100%;height:0.5rem;color:transparent;cursor:pointer;background-color:transparent;border-color:transparent;border-width:0.5rem}.custom-range::-ms-fill-lower{background-color:#dee2e6;border-radius:1rem}.custom-range::-ms-fill-upper{margin-right:15px;background-color:#dee2e6;border-radius:1rem}.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;transition:background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, -webkit-box-shadow 0.15s ease-in-out}@media screen and (prefers-reduced-motion: reduce){.custom-control-label::before,.custom-file-label,.custom-select{-webkit-transition:none;transition:none}}.nav{display:-webkit-box;display:-ms-flexbox;-ms-flex-wrap:wrap;flex-wrap:wrap;padding-left:0;margin-bottom:0;list-style:none}.nav-link{display:block;padding:0.5rem 1rem}.nav-link:hover,.nav-link:focus{text-decoration:none}.nav-link.disabled{color:#868e96}.nav-tabs{border-bottom:1px solid #dee2e6}.nav-tabs .nav-item{margin-bottom:-1px}.nav-tabs .nav-link{border:1px solid transparent;border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.nav-tabs .nav-link:hover,.nav-tabs .nav-link:focus{border-color:#e9ecef #e9ecef #dee2e6}.nav-tabs .nav-link.disabled{color:#868e96;background-color:transparent;border-color:transparent}.nav-tabs .nav-link.active,.nav-tabs .nav-item.show .nav-link{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.nav-pills .nav-link{border-radius:0.25rem}.nav-pills .nav-link.active,.nav-pills .show>.nav-link{color:#fff;background-color:#2FA4E7}.nav-fill .nav-item{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center}.nav-justified .nav-item{-ms-flex-preferred-size:0;flex-basis:0;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;text-align:center}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.navbar{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:0.5rem 1rem}.navbar>.container,.navbar>.container-fluid{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.navbar-brand{display:inline-block;padding-top:0.3125rem;padding-bottom:0.3125rem;margin-right:1rem;font-size:1.25rem;line-height:inherit;white-space:nowrap}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-nav{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0;list-style:none}.navbar-nav .nav-link{padding-right:0;padding-left:0}.navbar-nav .dropdown-menu{position:static;float:none}.navbar-text{display:inline-block;padding-top:0.5rem;padding-bottom:0.5rem}.navbar-collapse{-ms-flex-preferred-size:100%;flex-basis:100%;-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.navbar-toggler{padding:0.25rem 0.75rem;font-size:1.25rem;line-height:1;background-color:transparent;border:1px solid transparent;border-radius:0.25rem}.navbar-toggler:hover,.navbar-toggler:focus{text-decoration:none}.navbar-toggler:not(:disabled):not(.disabled){cursor:pointer}.navbar-toggler-icon{display:inline-block;width:1.5em;height:1.5em;vertical-align:middle;content:"";background:no-repeat center center;background-size:100% 100%}@media (max-width: 575.98px){.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 576px){.navbar-expand-sm{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-sm .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-sm .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-sm .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-sm>.container,.navbar-expand-sm>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-sm .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-sm .navbar-toggler{display:none}}@media (max-width: 767.98px){.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 768px){.navbar-expand-md{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-md .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-md .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-md .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-md>.container,.navbar-expand-md>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-md .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-md .navbar-toggler{display:none}}@media (max-width: 991.98px){.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 992px){.navbar-expand-lg{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-lg .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-lg .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-lg .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-lg>.container,.navbar-expand-lg>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-lg .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-lg .navbar-toggler{display:none}}@media (max-width: 1199.98px){.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{padding-right:0;padding-left:0}}@media (min-width: 1200px){.navbar-expand-xl{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand-xl .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand-xl .navbar-nav .dropdown-menu{position:absolute}.navbar-expand-xl .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand-xl>.container,.navbar-expand-xl>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand-xl .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand-xl .navbar-toggler{display:none}}.navbar-expand{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.navbar-expand>.container,.navbar-expand>.container-fluid{padding-right:0;padding-left:0}.navbar-expand .navbar-nav{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.navbar-expand .navbar-nav .dropdown-menu{position:absolute}.navbar-expand .navbar-nav .nav-link{padding-right:0.5rem;padding-left:0.5rem}.navbar-expand>.container,.navbar-expand>.container-fluid{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.navbar-expand .navbar-collapse{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important;-ms-flex-preferred-size:auto;flex-basis:auto}.navbar-expand .navbar-toggler{display:none}.navbar-light .navbar-brand{color:rgba(0,0,0,0.9)}.navbar-light .navbar-brand:hover,.navbar-light .navbar-brand:focus{color:rgba(0,0,0,0.9)}.navbar-light .navbar-nav .nav-link{color:rgba(0,0,0,0.5)}.navbar-light .navbar-nav .nav-link:hover,.navbar-light .navbar-nav .nav-link:focus{color:rgba(0,0,0,0.7)}.navbar-light .navbar-nav .nav-link.disabled{color:rgba(0,0,0,0.3)}.navbar-light .navbar-nav .show>.nav-link,.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .nav-link.active{color:rgba(0,0,0,0.9)}.navbar-light .navbar-toggler{color:rgba(0,0,0,0.5);border-color:rgba(0,0,0,0.1)}.navbar-light .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-light .navbar-text{color:rgba(0,0,0,0.5)}.navbar-light .navbar-text a{color:rgba(0,0,0,0.9)}.navbar-light .navbar-text a:hover,.navbar-light .navbar-text a:focus{color:rgba(0,0,0,0.9)}.navbar-dark .navbar-brand{color:#fff}.navbar-dark .navbar-brand:hover,.navbar-dark .navbar-brand:focus{color:#fff}.navbar-dark .navbar-nav .nav-link{color:rgba(255,255,255,0.8)}.navbar-dark .navbar-nav .nav-link:hover,.navbar-dark .navbar-nav .nav-link:focus{color:#fff}.navbar-dark .navbar-nav .nav-link.disabled{color:rgba(255,255,255,0.25)}.navbar-dark .navbar-nav .show>.nav-link,.navbar-dark .navbar-nav .active>.nav-link,.navbar-dark .navbar-nav .nav-link.show,.navbar-dark .navbar-nav .nav-link.active{color:#fff}.navbar-dark .navbar-toggler{color:rgba(255,255,255,0.8);border-color:rgba(255,255,255,0.1)}.navbar-dark .navbar-toggler-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E")}.navbar-dark .navbar-text{color:rgba(255,255,255,0.8)}.navbar-dark .navbar-text a{color:#fff}.navbar-dark .navbar-text a:hover,.navbar-dark .navbar-text a:focus{color:#fff}.card{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;min-width:0;word-wrap:break-word;background-color:#fff;background-clip:border-box;border:1px solid rgba(0,0,0,0.125);border-radius:0.25rem}.card>hr{margin-right:0;margin-left:0}.card>.list-group:first-child .list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.card>.list-group:last-child .list-group-item:last-child{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.card-body{-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1.25rem}.card-title{margin-bottom:0.75rem}.card-subtitle{margin-top:-0.375rem;margin-bottom:0}.card-text:last-child{margin-bottom:0}.card-link:hover{text-decoration:none}.card-link+.card-link{margin-left:1.25rem}.card-header{padding:0.75rem 1.25rem;margin-bottom:0;background-color:rgba(0,0,0,0.03);border-bottom:1px solid rgba(0,0,0,0.125)}.card-header:first-child{border-radius:calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0}.card-header+.list-group .list-group-item:first-child{border-top:0}.card-footer{padding:0.75rem 1.25rem;background-color:rgba(0,0,0,0.03);border-top:1px solid rgba(0,0,0,0.125)}.card-footer:last-child{border-radius:0 0 calc(0.25rem - 1px) calc(0.25rem - 1px)}.card-header-tabs{margin-right:-0.625rem;margin-bottom:-0.75rem;margin-left:-0.625rem;border-bottom:0}.card-header-pills{margin-right:-0.625rem;margin-left:-0.625rem}.card-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;padding:1.25rem}.card-img{width:100%;border-radius:calc(0.25rem - 1px)}.card-img-top{width:100%;border-top-left-radius:calc(0.25rem - 1px);border-top-right-radius:calc(0.25rem - 1px)}.card-img-bottom{width:100%;border-bottom-right-radius:calc(0.25rem - 1px);border-bottom-left-radius:calc(0.25rem - 1px)}.card-deck{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-deck .card{margin-bottom:15px}@media (min-width: 576px){.card-deck{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap;margin-right:-15px;margin-left:-15px}.card-deck .card{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;margin-right:15px;margin-bottom:0;margin-left:15px}}.card-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.card-group>.card{margin-bottom:15px}@media (min-width: 576px){.card-group{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-flow:row wrap;flex-flow:row wrap}.card-group>.card{-webkit-box-flex:1;-ms-flex:1 0 0%;flex:1 0 0%;margin-bottom:0}.card-group>.card+.card{margin-left:0;border-left:0}.card-group>.card:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.card-group>.card:first-child .card-img-top,.card-group>.card:first-child .card-header{border-top-right-radius:0}.card-group>.card:first-child .card-img-bottom,.card-group>.card:first-child .card-footer{border-bottom-right-radius:0}.card-group>.card:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.card-group>.card:last-child .card-img-top,.card-group>.card:last-child .card-header{border-top-left-radius:0}.card-group>.card:last-child .card-img-bottom,.card-group>.card:last-child .card-footer{border-bottom-left-radius:0}.card-group>.card:only-child{border-radius:0.25rem}.card-group>.card:only-child .card-img-top,.card-group>.card:only-child .card-header{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.card-group>.card:only-child .card-img-bottom,.card-group>.card:only-child .card-footer{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.card-group>.card:not(:first-child):not(:last-child):not(:only-child){border-radius:0}.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-top,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-img-bottom,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-header,.card-group>.card:not(:first-child):not(:last-child):not(:only-child) .card-footer{border-radius:0}}.card-columns .card{margin-bottom:0.75rem}@media (min-width: 576px){.card-columns{-webkit-column-count:3;column-count:3;-webkit-column-gap:1.25rem;column-gap:1.25rem;orphans:1;widows:1}.card-columns .card{display:inline-block;width:100%}}.accordion .card:not(:first-of-type):not(:last-of-type){border-bottom:0;border-radius:0}.accordion .card:not(:first-of-type) .card-header:first-child{border-radius:0}.accordion .card:first-of-type{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.accordion .card:last-of-type{border-top-left-radius:0;border-top-right-radius:0}.breadcrumb{display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0.75rem 1rem;margin-bottom:1rem;list-style:none;background-color:#e9ecef;border-radius:0.25rem}.breadcrumb-item+.breadcrumb-item{padding-left:0.5rem}.breadcrumb-item+.breadcrumb-item::before{display:inline-block;padding-right:0.5rem;color:#868e96;content:"/"}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:underline}.breadcrumb-item+.breadcrumb-item:hover::before{text-decoration:none}.breadcrumb-item.active{color:#868e96}.pagination{display:-webkit-box;display:-ms-flexbox;display:flex;padding-left:0;list-style:none;border-radius:0.25rem}.page-link{position:relative;display:block;padding:0.5rem 0.75rem;margin-left:-1px;line-height:1.25;color:#2FA4E7;background-color:#fff;border:1px solid #dee2e6}.page-link:hover{z-index:2;color:#157ab5;text-decoration:none;background-color:#e9ecef;border-color:#dee2e6}.page-link:focus{z-index:2;outline:0;-webkit-box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25);box-shadow:0 0 0 0.2rem rgba(47,164,231,0.25)}.page-link:not(:disabled):not(.disabled){cursor:pointer}.page-item:first-child .page-link{margin-left:0;border-top-left-radius:0.25rem;border-bottom-left-radius:0.25rem}.page-item:last-child .page-link{border-top-right-radius:0.25rem;border-bottom-right-radius:0.25rem}.page-item.active .page-link{z-index:1;color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.page-item.disabled .page-link{color:#868e96;pointer-events:none;cursor:auto;background-color:#fff;border-color:#dee2e6}.pagination-lg .page-link{padding:0.75rem 1.5rem;font-size:1.25rem;line-height:1.5}.pagination-lg .page-item:first-child .page-link{border-top-left-radius:0.3rem;border-bottom-left-radius:0.3rem}.pagination-lg .page-item:last-child .page-link{border-top-right-radius:0.3rem;border-bottom-right-radius:0.3rem}.pagination-sm .page-link{padding:0.25rem 0.5rem;font-size:0.875rem;line-height:1.5}.pagination-sm .page-item:first-child .page-link{border-top-left-radius:0.2rem;border-bottom-left-radius:0.2rem}.pagination-sm .page-item:last-child .page-link{border-top-right-radius:0.2rem;border-bottom-right-radius:0.2rem}.badge{display:inline-block;padding:0.25em 0.4em;font-size:75%;font-weight:700;line-height:1;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:0.25rem}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.badge-pill{padding-right:0.6em;padding-left:0.6em;border-radius:10rem}.badge-primary{color:#fff;background-color:#2FA4E7}.badge-primary[href]:hover,.badge-primary[href]:focus{color:#fff;text-decoration:none;background-color:#178acc}.badge-secondary{color:#212529;background-color:#e9ecef}.badge-secondary[href]:hover,.badge-secondary[href]:focus{color:#212529;text-decoration:none;background-color:#cbd3da}.badge-success{color:#fff;background-color:#73A839}.badge-success[href]:hover,.badge-success[href]:focus{color:#fff;text-decoration:none;background-color:#59822c}.badge-info{color:#fff;background-color:#033C73}.badge-info[href]:hover,.badge-info[href]:focus{color:#fff;text-decoration:none;background-color:#022241}.badge-warning{color:#fff;background-color:#DD5600}.badge-warning[href]:hover,.badge-warning[href]:focus{color:#fff;text-decoration:none;background-color:#aa4200}.badge-danger{color:#fff;background-color:#C71C22}.badge-danger[href]:hover,.badge-danger[href]:focus{color:#fff;text-decoration:none;background-color:#9a161a}.badge-light{color:#212529;background-color:#f8f9fa}.badge-light[href]:hover,.badge-light[href]:focus{color:#212529;text-decoration:none;background-color:#dae0e5}.badge-dark{color:#fff;background-color:#343a40}.badge-dark[href]:hover,.badge-dark[href]:focus{color:#fff;text-decoration:none;background-color:#1d2124}.jumbotron{padding:2rem 1rem;margin-bottom:2rem;background-color:#e9ecef;border-radius:0.3rem}@media (min-width: 576px){.jumbotron{padding:4rem 2rem}}.jumbotron-fluid{padding-right:0;padding-left:0;border-radius:0}.alert{position:relative;padding:0.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem}.alert-heading{color:inherit}.alert-link{font-weight:700}.alert-dismissible{padding-right:4rem}.alert-dismissible .close{position:absolute;top:0;right:0;padding:0.75rem 1.25rem;color:inherit}.alert-primary{color:#185578;background-color:#d5edfa;border-color:#c5e6f8}.alert-primary hr{border-top-color:#aedcf5}.alert-primary .alert-link{color:#10374e}.alert-secondary{color:#797b7c;background-color:#fbfbfc;border-color:#f9fafb}.alert-secondary hr{border-top-color:#eaedf1}.alert-secondary .alert-link{color:#606162}.alert-success{color:#3c571e;background-color:#e3eed7;border-color:#d8e7c8}.alert-success hr{border-top-color:#cbdfb6}.alert-success .alert-link{color:#223111}.alert-info{color:#021f3c;background-color:#cdd8e3;border-color:#b8c8d8}.alert-info hr{border-top-color:#a8bbcf}.alert-info .alert-link{color:#00060b}.alert-warning{color:#732d00;background-color:#f8ddcc;border-color:#f5d0b8}.alert-warning hr{border-top-color:#f2c1a2}.alert-warning .alert-link{color:#401900}.alert-danger{color:#670f12;background-color:#f4d2d3;border-color:#efbfc1}.alert-danger hr{border-top-color:#eaabad}.alert-danger .alert-link{color:#3a090a}.alert-light{color:#818182;background-color:#fefefe;border-color:#fdfdfe}.alert-light hr{border-top-color:#ececf6}.alert-light .alert-link{color:#686868}.alert-dark{color:#1b1e21;background-color:#d6d8d9;border-color:#c6c8ca}.alert-dark hr{border-top-color:#b9bbbe}.alert-dark .alert-link{color:#040505}@-webkit-keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:1rem 0}to{background-position:0 0}}.progress{display:-webkit-box;display:-ms-flexbox;display:flex;height:1rem;overflow:hidden;font-size:0.75rem;background-color:#e9ecef;border-radius:0.25rem}.progress-bar{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;color:#fff;text-align:center;white-space:nowrap;background-color:#2FA4E7;-webkit-transition:width 0.6s ease;transition:width 0.6s ease}@media screen and (prefers-reduced-motion: reduce){.progress-bar{-webkit-transition:none;transition:none}}.progress-bar-striped{background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-size:1rem 1rem}.progress-bar-animated{-webkit-animation:progress-bar-stripes 1s linear infinite;animation:progress-bar-stripes 1s linear infinite}.media{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.media-body{-webkit-box-flex:1;-ms-flex:1;flex:1}.list-group{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;padding-left:0;margin-bottom:0}.list-group-item-action{width:100%;color:#495057;text-align:inherit}.list-group-item-action:hover,.list-group-item-action:focus{color:#495057;text-decoration:none;background-color:#f8f9fa}.list-group-item-action:active{color:#495057;background-color:#e9ecef}.list-group-item{position:relative;display:block;padding:0.75rem 1.25rem;margin-bottom:-1px;background-color:#fff;border:1px solid rgba(0,0,0,0.125)}.list-group-item:first-child{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem}.list-group-item:hover,.list-group-item:focus{z-index:1;text-decoration:none}.list-group-item.disabled,.list-group-item:disabled{color:#868e96;background-color:#fff}.list-group-item.active{z-index:2;color:#fff;background-color:#2FA4E7;border-color:#2FA4E7}.list-group-flush .list-group-item{border-right:0;border-left:0;border-radius:0}.list-group-flush:first-child .list-group-item:first-child{border-top:0}.list-group-flush:last-child .list-group-item:last-child{border-bottom:0}.list-group-item-primary{color:#185578;background-color:#c5e6f8}.list-group-item-primary.list-group-item-action:hover,.list-group-item-primary.list-group-item-action:focus{color:#185578;background-color:#aedcf5}.list-group-item-primary.list-group-item-action.active{color:#fff;background-color:#185578;border-color:#185578}.list-group-item-secondary{color:#797b7c;background-color:#f9fafb}.list-group-item-secondary.list-group-item-action:hover,.list-group-item-secondary.list-group-item-action:focus{color:#797b7c;background-color:#eaedf1}.list-group-item-secondary.list-group-item-action.active{color:#fff;background-color:#797b7c;border-color:#797b7c}.list-group-item-success{color:#3c571e;background-color:#d8e7c8}.list-group-item-success.list-group-item-action:hover,.list-group-item-success.list-group-item-action:focus{color:#3c571e;background-color:#cbdfb6}.list-group-item-success.list-group-item-action.active{color:#fff;background-color:#3c571e;border-color:#3c571e}.list-group-item-info{color:#021f3c;background-color:#b8c8d8}.list-group-item-info.list-group-item-action:hover,.list-group-item-info.list-group-item-action:focus{color:#021f3c;background-color:#a8bbcf}.list-group-item-info.list-group-item-action.active{color:#fff;background-color:#021f3c;border-color:#021f3c}.list-group-item-warning{color:#732d00;background-color:#f5d0b8}.list-group-item-warning.list-group-item-action:hover,.list-group-item-warning.list-group-item-action:focus{color:#732d00;background-color:#f2c1a2}.list-group-item-warning.list-group-item-action.active{color:#fff;background-color:#732d00;border-color:#732d00}.list-group-item-danger{color:#670f12;background-color:#efbfc1}.list-group-item-danger.list-group-item-action:hover,.list-group-item-danger.list-group-item-action:focus{color:#670f12;background-color:#eaabad}.list-group-item-danger.list-group-item-action.active{color:#fff;background-color:#670f12;border-color:#670f12}.list-group-item-light{color:#818182;background-color:#fdfdfe}.list-group-item-light.list-group-item-action:hover,.list-group-item-light.list-group-item-action:focus{color:#818182;background-color:#ececf6}.list-group-item-light.list-group-item-action.active{color:#fff;background-color:#818182;border-color:#818182}.list-group-item-dark{color:#1b1e21;background-color:#c6c8ca}.list-group-item-dark.list-group-item-action:hover,.list-group-item-dark.list-group-item-action:focus{color:#1b1e21;background-color:#b9bbbe}.list-group-item-dark.list-group-item-action.active{color:#fff;background-color:#1b1e21;border-color:#1b1e21}.close{float:right;font-size:1.5rem;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.5}.close:not(:disabled):not(.disabled){cursor:pointer}.close:not(:disabled):not(.disabled):hover,.close:not(:disabled):not(.disabled):focus{color:#000;text-decoration:none;opacity:.75}button.close{padding:0;background-color:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;outline:0}.modal-dialog{position:relative;width:auto;margin:0.5rem;pointer-events:none}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform 0.3s ease-out;transition:-webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out;transition:transform 0.3s ease-out, -webkit-transform 0.3s ease-out;-webkit-transform:translate(0, -25%);transform:translate(0, -25%)}@media screen and (prefers-reduced-motion: reduce){.modal.fade .modal-dialog{-webkit-transition:none;transition:none}}.modal.show .modal-dialog{-webkit-transform:translate(0, 0);transform:translate(0, 0)}.modal-dialog-centered{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;min-height:calc(100% - (0.5rem * 2))}.modal-dialog-centered::before{display:block;height:calc(100vh - (0.5rem * 2));content:""}.modal-content{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;width:100%;pointer-events:auto;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:0.3rem;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop.show{opacity:0.5}.modal-header{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;padding:1rem;border-bottom:1px solid #e9ecef;border-top-left-radius:0.3rem;border-top-right-radius:0.3rem}.modal-header .close{padding:1rem;margin:-1rem -1rem -1rem auto}.modal-title{margin-bottom:0;line-height:1.5}.modal-body{position:relative;-webkit-box-flex:1;-ms-flex:1 1 auto;flex:1 1 auto;padding:1rem}.modal-footer{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;padding:1rem;border-top:1px solid #e9ecef}.modal-footer>:not(:first-child){margin-left:.25rem}.modal-footer>:not(:last-child){margin-right:.25rem}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width: 576px){.modal-dialog{max-width:500px;margin:1.75rem auto}.modal-dialog-centered{min-height:calc(100% - (1.75rem * 2))}.modal-dialog-centered::before{height:calc(100vh - (1.75rem * 2))}.modal-sm{max-width:300px}}@media (min-width: 992px){.modal-lg{max-width:800px}}.tooltip{position:absolute;z-index:1070;display:block;margin:0;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.875rem;word-wrap:break-word;opacity:0}.tooltip.show{opacity:0.9}.tooltip .arrow{position:absolute;display:block;width:0.8rem;height:0.4rem}.tooltip .arrow::before{position:absolute;content:"";border-color:transparent;border-style:solid}.bs-tooltip-top,.bs-tooltip-auto[x-placement^="top"]{padding:0.4rem 0}.bs-tooltip-top .arrow,.bs-tooltip-auto[x-placement^="top"] .arrow{bottom:0}.bs-tooltip-top .arrow::before,.bs-tooltip-auto[x-placement^="top"] .arrow::before{top:0;border-width:0.4rem 0.4rem 0;border-top-color:#000}.bs-tooltip-right,.bs-tooltip-auto[x-placement^="right"]{padding:0 0.4rem}.bs-tooltip-right .arrow,.bs-tooltip-auto[x-placement^="right"] .arrow{left:0;width:0.4rem;height:0.8rem}.bs-tooltip-right .arrow::before,.bs-tooltip-auto[x-placement^="right"] .arrow::before{right:0;border-width:0.4rem 0.4rem 0.4rem 0;border-right-color:#000}.bs-tooltip-bottom,.bs-tooltip-auto[x-placement^="bottom"]{padding:0.4rem 0}.bs-tooltip-bottom .arrow,.bs-tooltip-auto[x-placement^="bottom"] .arrow{top:0}.bs-tooltip-bottom .arrow::before,.bs-tooltip-auto[x-placement^="bottom"] .arrow::before{bottom:0;border-width:0 0.4rem 0.4rem;border-bottom-color:#000}.bs-tooltip-left,.bs-tooltip-auto[x-placement^="left"]{padding:0 0.4rem}.bs-tooltip-left .arrow,.bs-tooltip-auto[x-placement^="left"] .arrow{right:0;width:0.4rem;height:0.8rem}.bs-tooltip-left .arrow::before,.bs-tooltip-auto[x-placement^="left"] .arrow::before{left:0;border-width:0.4rem 0 0.4rem 0.4rem;border-left-color:#000}.tooltip-inner{max-width:200px;padding:0.25rem 0.5rem;color:#fff;text-align:center;background-color:#000;border-radius:0.25rem}.popover{position:absolute;top:0;left:0;z-index:1060;display:block;max-width:276px;font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-style:normal;font-weight:400;line-height:1.5;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;white-space:normal;line-break:auto;font-size:0.875rem;word-wrap:break-word;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,0.2);border-radius:0.3rem}.popover .arrow{position:absolute;display:block;width:1rem;height:0.5rem;margin:0 0.3rem}.popover .arrow::before,.popover .arrow::after{position:absolute;display:block;content:"";border-color:transparent;border-style:solid}.bs-popover-top,.bs-popover-auto[x-placement^="top"]{margin-bottom:0.5rem}.bs-popover-top .arrow,.bs-popover-auto[x-placement^="top"] .arrow{bottom:calc((0.5rem + 1px) * -1)}.bs-popover-top .arrow::before,.bs-popover-auto[x-placement^="top"] .arrow::before,.bs-popover-top .arrow::after,.bs-popover-auto[x-placement^="top"] .arrow::after{border-width:0.5rem 0.5rem 0}.bs-popover-top .arrow::before,.bs-popover-auto[x-placement^="top"] .arrow::before{bottom:0;border-top-color:rgba(0,0,0,0.25)}.bs-popover-top .arrow::after,.bs-popover-auto[x-placement^="top"] .arrow::after{bottom:1px;border-top-color:#fff}.bs-popover-right,.bs-popover-auto[x-placement^="right"]{margin-left:0.5rem}.bs-popover-right .arrow,.bs-popover-auto[x-placement^="right"] .arrow{left:calc((0.5rem + 1px) * -1);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-right .arrow::before,.bs-popover-auto[x-placement^="right"] .arrow::before,.bs-popover-right .arrow::after,.bs-popover-auto[x-placement^="right"] .arrow::after{border-width:0.5rem 0.5rem 0.5rem 0}.bs-popover-right .arrow::before,.bs-popover-auto[x-placement^="right"] .arrow::before{left:0;border-right-color:rgba(0,0,0,0.25)}.bs-popover-right .arrow::after,.bs-popover-auto[x-placement^="right"] .arrow::after{left:1px;border-right-color:#fff}.bs-popover-bottom,.bs-popover-auto[x-placement^="bottom"]{margin-top:0.5rem}.bs-popover-bottom .arrow,.bs-popover-auto[x-placement^="bottom"] .arrow{top:calc((0.5rem + 1px) * -1)}.bs-popover-bottom .arrow::before,.bs-popover-auto[x-placement^="bottom"] .arrow::before,.bs-popover-bottom .arrow::after,.bs-popover-auto[x-placement^="bottom"] .arrow::after{border-width:0 0.5rem 0.5rem 0.5rem}.bs-popover-bottom .arrow::before,.bs-popover-auto[x-placement^="bottom"] .arrow::before{top:0;border-bottom-color:rgba(0,0,0,0.25)}.bs-popover-bottom .arrow::after,.bs-popover-auto[x-placement^="bottom"] .arrow::after{top:1px;border-bottom-color:#fff}.bs-popover-bottom .popover-header::before,.bs-popover-auto[x-placement^="bottom"] .popover-header::before{position:absolute;top:0;left:50%;display:block;width:1rem;margin-left:-0.5rem;content:"";border-bottom:1px solid #f7f7f7}.bs-popover-left,.bs-popover-auto[x-placement^="left"]{margin-right:0.5rem}.bs-popover-left .arrow,.bs-popover-auto[x-placement^="left"] .arrow{right:calc((0.5rem + 1px) * -1);width:0.5rem;height:1rem;margin:0.3rem 0}.bs-popover-left .arrow::before,.bs-popover-auto[x-placement^="left"] .arrow::before,.bs-popover-left .arrow::after,.bs-popover-auto[x-placement^="left"] .arrow::after{border-width:0.5rem 0 0.5rem 0.5rem}.bs-popover-left .arrow::before,.bs-popover-auto[x-placement^="left"] .arrow::before{right:0;border-left-color:rgba(0,0,0,0.25)}.bs-popover-left .arrow::after,.bs-popover-auto[x-placement^="left"] .arrow::after{right:1px;border-left-color:#fff}.popover-header{padding:0.5rem 0.75rem;margin-bottom:0;font-size:1rem;color:#2FA4E7;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-top-left-radius:calc(0.3rem - 1px);border-top-right-radius:calc(0.3rem - 1px)}.popover-header:empty{display:none}.popover-body{padding:0.5rem 0.75rem;color:#495057}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-item{position:relative;display:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;width:100%;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-item.active,.carousel-item-next,.carousel-item-prev{display:block;-webkit-transition:-webkit-transform 0.6s ease;transition:-webkit-transform 0.6s ease;transition:transform 0.6s ease;transition:transform 0.6s ease, -webkit-transform 0.6s ease}@media screen and (prefers-reduced-motion: reduce){.carousel-item.active,.carousel-item-next,.carousel-item-prev{-webkit-transition:none;transition:none}}.carousel-item-next,.carousel-item-prev{position:absolute;top:0}.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translateX(0);transform:translateX(0)}@supports (-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d){.carousel-item-next.carousel-item-left,.carousel-item-prev.carousel-item-right{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}.carousel-item-next,.active.carousel-item-right{-webkit-transform:translateX(100%);transform:translateX(100%)}@supports (-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d){.carousel-item-next,.active.carousel-item-right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0)}}.carousel-item-prev,.active.carousel-item-left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}@supports (-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d){.carousel-item-prev,.active.carousel-item-left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0)}}.carousel-fade .carousel-item{opacity:0;-webkit-transition-duration:.6s;transition-duration:.6s;-webkit-transition-property:opacity;transition-property:opacity}.carousel-fade .carousel-item.active,.carousel-fade .carousel-item-next.carousel-item-left,.carousel-fade .carousel-item-prev.carousel-item-right{opacity:1}.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-right{opacity:0}.carousel-fade .carousel-item-next,.carousel-fade .carousel-item-prev,.carousel-fade .carousel-item.active,.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-prev{-webkit-transform:translateX(0);transform:translateX(0)}@supports (-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d){.carousel-fade .carousel-item-next,.carousel-fade .carousel-item-prev,.carousel-fade .carousel-item.active,.carousel-fade .active.carousel-item-left,.carousel-fade .active.carousel-item-prev{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0)}}.carousel-control-prev,.carousel-control-next{position:absolute;top:0;bottom:0;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:15%;color:#fff;text-align:center;opacity:0.5}.carousel-control-prev:hover,.carousel-control-prev:focus,.carousel-control-next:hover,.carousel-control-next:focus{color:#fff;text-decoration:none;outline:0;opacity:.9}.carousel-control-prev{left:0}.carousel-control-next{right:0}.carousel-control-prev-icon,.carousel-control-next-icon{display:inline-block;width:20px;height:20px;background:transparent no-repeat center center;background-size:100% 100%}.carousel-control-prev-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M5.25 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E")}.carousel-control-next-icon{background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M2.75 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E")}.carousel-indicators{position:absolute;right:0;bottom:10px;left:0;z-index:15;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;padding-left:0;margin-right:15%;margin-left:15%;list-style:none}.carousel-indicators li{position:relative;-webkit-box-flex:0;-ms-flex:0 1 auto;flex:0 1 auto;width:30px;height:3px;margin-right:3px;margin-left:3px;text-indent:-999px;cursor:pointer;background-color:rgba(255,255,255,0.5)}.carousel-indicators li::before{position:absolute;top:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators li::after{position:absolute;bottom:-10px;left:0;display:inline-block;width:100%;height:10px;content:""}.carousel-indicators .active{background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center}.align-baseline{vertical-align:baseline !important}.align-top{vertical-align:top !important}.align-middle{vertical-align:middle !important}.align-bottom{vertical-align:bottom !important}.align-text-bottom{vertical-align:text-bottom !important}.align-text-top{vertical-align:text-top !important}.bg-primary{background-color:#2FA4E7 !important}a.bg-primary:hover,a.bg-primary:focus,button.bg-primary:hover,button.bg-primary:focus{background-color:#178acc !important}.bg-secondary{background-color:#e9ecef !important}a.bg-secondary:hover,a.bg-secondary:focus,button.bg-secondary:hover,button.bg-secondary:focus{background-color:#cbd3da !important}.bg-success{background-color:#73A839 !important}a.bg-success:hover,a.bg-success:focus,button.bg-success:hover,button.bg-success:focus{background-color:#59822c !important}.bg-info{background-color:#033C73 !important}a.bg-info:hover,a.bg-info:focus,button.bg-info:hover,button.bg-info:focus{background-color:#022241 !important}.bg-warning{background-color:#DD5600 !important}a.bg-warning:hover,a.bg-warning:focus,button.bg-warning:hover,button.bg-warning:focus{background-color:#aa4200 !important}.bg-danger{background-color:#C71C22 !important}a.bg-danger:hover,a.bg-danger:focus,button.bg-danger:hover,button.bg-danger:focus{background-color:#9a161a !important}.bg-light{background-color:#f8f9fa !important}a.bg-light:hover,a.bg-light:focus,button.bg-light:hover,button.bg-light:focus{background-color:#dae0e5 !important}.bg-dark{background-color:#343a40 !important}a.bg-dark:hover,a.bg-dark:focus,button.bg-dark:hover,button.bg-dark:focus{background-color:#1d2124 !important}.bg-white{background-color:#fff !important}.bg-transparent{background-color:transparent !important}.border{border:1px solid #dee2e6 !important}.border-top{border-top:1px solid #dee2e6 !important}.border-right{border-right:1px solid #dee2e6 !important}.border-bottom{border-bottom:1px solid #dee2e6 !important}.border-left{border-left:1px solid #dee2e6 !important}.border-0{border:0 !important}.border-top-0{border-top:0 !important}.border-right-0{border-right:0 !important}.border-bottom-0{border-bottom:0 !important}.border-left-0{border-left:0 !important}.border-primary{border-color:#2FA4E7 !important}.border-secondary{border-color:#e9ecef !important}.border-success{border-color:#73A839 !important}.border-info{border-color:#033C73 !important}.border-warning{border-color:#DD5600 !important}.border-danger{border-color:#C71C22 !important}.border-light{border-color:#f8f9fa !important}.border-dark{border-color:#343a40 !important}.border-white{border-color:#fff !important}.rounded{border-radius:0.25rem !important}.rounded-top{border-top-left-radius:0.25rem !important;border-top-right-radius:0.25rem !important}.rounded-right{border-top-right-radius:0.25rem !important;border-bottom-right-radius:0.25rem !important}.rounded-bottom{border-bottom-right-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-left{border-top-left-radius:0.25rem !important;border-bottom-left-radius:0.25rem !important}.rounded-circle{border-radius:50% !important}.rounded-0{border-radius:0 !important}.clearfix::after{display:block;clear:both;content:""}.d-none{display:none !important}.d-inline{display:inline !important}.d-inline-block{display:inline-block !important}.d-block{display:block !important}.d-table{display:table !important}.d-table-row{display:table-row !important}.d-table-cell{display:table-cell !important}.d-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}@media (min-width: 576px){.d-sm-none{display:none !important}.d-sm-inline{display:inline !important}.d-sm-inline-block{display:inline-block !important}.d-sm-block{display:block !important}.d-sm-table{display:table !important}.d-sm-table-row{display:table-row !important}.d-sm-table-cell{display:table-cell !important}.d-sm-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-sm-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 768px){.d-md-none{display:none !important}.d-md-inline{display:inline !important}.d-md-inline-block{display:inline-block !important}.d-md-block{display:block !important}.d-md-table{display:table !important}.d-md-table-row{display:table-row !important}.d-md-table-cell{display:table-cell !important}.d-md-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-md-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 992px){.d-lg-none{display:none !important}.d-lg-inline{display:inline !important}.d-lg-inline-block{display:inline-block !important}.d-lg-block{display:block !important}.d-lg-table{display:table !important}.d-lg-table-row{display:table-row !important}.d-lg-table-cell{display:table-cell !important}.d-lg-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-lg-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media (min-width: 1200px){.d-xl-none{display:none !important}.d-xl-inline{display:inline !important}.d-xl-inline-block{display:inline-block !important}.d-xl-block{display:block !important}.d-xl-table{display:table !important}.d-xl-table-row{display:table-row !important}.d-xl-table-cell{display:table-cell !important}.d-xl-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-xl-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}@media print{.d-print-none{display:none !important}.d-print-inline{display:inline !important}.d-print-inline-block{display:inline-block !important}.d-print-block{display:block !important}.d-print-table{display:table !important}.d-print-table-row{display:table-row !important}.d-print-table-cell{display:table-cell !important}.d-print-flex{display:-webkit-box !important;display:-ms-flexbox !important;display:flex !important}.d-print-inline-flex{display:-webkit-inline-box !important;display:-ms-inline-flexbox !important;display:inline-flex !important}}.embed-responsive{position:relative;display:block;width:100%;padding:0;overflow:hidden}.embed-responsive::before{display:block;content:""}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive-21by9::before{padding-top:42.8571428571%}.embed-responsive-16by9::before{padding-top:56.25%}.embed-responsive-4by3::before{padding-top:75%}.embed-responsive-1by1::before{padding-top:100%}.flex-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}@media (min-width: 576px){.flex-sm-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-sm-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-sm-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-sm-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-sm-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-sm-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-sm-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-sm-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-sm-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-sm-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-sm-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-sm-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-sm-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-sm-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-sm-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-sm-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-sm-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-sm-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-sm-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-sm-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-sm-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-sm-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-sm-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-sm-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-sm-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-sm-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-sm-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-sm-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-sm-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-sm-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-sm-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-sm-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-sm-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 768px){.flex-md-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-md-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-md-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-md-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-md-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-md-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-md-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-md-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-md-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-md-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-md-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-md-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-md-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-md-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-md-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-md-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-md-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-md-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-md-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-md-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-md-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-md-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-md-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-md-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-md-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-md-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-md-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-md-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-md-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-md-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-md-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-md-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-md-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 992px){.flex-lg-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-lg-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-lg-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-lg-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-lg-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-lg-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-lg-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-lg-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-lg-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-lg-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-lg-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-lg-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-lg-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-lg-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-lg-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-lg-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-lg-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-lg-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-lg-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-lg-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-lg-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-lg-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-lg-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-lg-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-lg-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-lg-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-lg-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-lg-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-lg-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-lg-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-lg-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-lg-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-lg-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}@media (min-width: 1200px){.flex-xl-row{-webkit-box-orient:horizontal !important;-webkit-box-direction:normal !important;-ms-flex-direction:row !important;flex-direction:row !important}.flex-xl-column{-webkit-box-orient:vertical !important;-webkit-box-direction:normal !important;-ms-flex-direction:column !important;flex-direction:column !important}.flex-xl-row-reverse{-webkit-box-orient:horizontal !important;-webkit-box-direction:reverse !important;-ms-flex-direction:row-reverse !important;flex-direction:row-reverse !important}.flex-xl-column-reverse{-webkit-box-orient:vertical !important;-webkit-box-direction:reverse !important;-ms-flex-direction:column-reverse !important;flex-direction:column-reverse !important}.flex-xl-wrap{-ms-flex-wrap:wrap !important;flex-wrap:wrap !important}.flex-xl-nowrap{-ms-flex-wrap:nowrap !important;flex-wrap:nowrap !important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse !important;flex-wrap:wrap-reverse !important}.flex-xl-fill{-webkit-box-flex:1 !important;-ms-flex:1 1 auto !important;flex:1 1 auto !important}.flex-xl-grow-0{-webkit-box-flex:0 !important;-ms-flex-positive:0 !important;flex-grow:0 !important}.flex-xl-grow-1{-webkit-box-flex:1 !important;-ms-flex-positive:1 !important;flex-grow:1 !important}.flex-xl-shrink-0{-ms-flex-negative:0 !important;flex-shrink:0 !important}.flex-xl-shrink-1{-ms-flex-negative:1 !important;flex-shrink:1 !important}.justify-content-xl-start{-webkit-box-pack:start !important;-ms-flex-pack:start !important;justify-content:flex-start !important}.justify-content-xl-end{-webkit-box-pack:end !important;-ms-flex-pack:end !important;justify-content:flex-end !important}.justify-content-xl-center{-webkit-box-pack:center !important;-ms-flex-pack:center !important;justify-content:center !important}.justify-content-xl-between{-webkit-box-pack:justify !important;-ms-flex-pack:justify !important;justify-content:space-between !important}.justify-content-xl-around{-ms-flex-pack:distribute !important;justify-content:space-around !important}.align-items-xl-start{-webkit-box-align:start !important;-ms-flex-align:start !important;align-items:flex-start !important}.align-items-xl-end{-webkit-box-align:end !important;-ms-flex-align:end !important;align-items:flex-end !important}.align-items-xl-center{-webkit-box-align:center !important;-ms-flex-align:center !important;align-items:center !important}.align-items-xl-baseline{-webkit-box-align:baseline !important;-ms-flex-align:baseline !important;align-items:baseline !important}.align-items-xl-stretch{-webkit-box-align:stretch !important;-ms-flex-align:stretch !important;align-items:stretch !important}.align-content-xl-start{-ms-flex-line-pack:start !important;align-content:flex-start !important}.align-content-xl-end{-ms-flex-line-pack:end !important;align-content:flex-end !important}.align-content-xl-center{-ms-flex-line-pack:center !important;align-content:center !important}.align-content-xl-between{-ms-flex-line-pack:justify !important;align-content:space-between !important}.align-content-xl-around{-ms-flex-line-pack:distribute !important;align-content:space-around !important}.align-content-xl-stretch{-ms-flex-line-pack:stretch !important;align-content:stretch !important}.align-self-xl-auto{-ms-flex-item-align:auto !important;align-self:auto !important}.align-self-xl-start{-ms-flex-item-align:start !important;align-self:flex-start !important}.align-self-xl-end{-ms-flex-item-align:end !important;align-self:flex-end !important}.align-self-xl-center{-ms-flex-item-align:center !important;align-self:center !important}.align-self-xl-baseline{-ms-flex-item-align:baseline !important;align-self:baseline !important}.align-self-xl-stretch{-ms-flex-item-align:stretch !important;align-self:stretch !important}}.float-left{float:left !important}.float-right{float:right !important}.float-none{float:none !important}@media (min-width: 576px){.float-sm-left{float:left !important}.float-sm-right{float:right !important}.float-sm-none{float:none !important}}@media (min-width: 768px){.float-md-left{float:left !important}.float-md-right{float:right !important}.float-md-none{float:none !important}}@media (min-width: 992px){.float-lg-left{float:left !important}.float-lg-right{float:right !important}.float-lg-none{float:none !important}}@media (min-width: 1200px){.float-xl-left{float:left !important}.float-xl-right{float:right !important}.float-xl-none{float:none !important}}.position-static{position:static !important}.position-relative{position:relative !important}.position-absolute{position:absolute !important}.position-fixed{position:fixed !important}.position-sticky{position:-webkit-sticky !important;position:sticky !important}.fixed-top{position:fixed;top:0;right:0;left:0;z-index:1030}.fixed-bottom{position:fixed;right:0;bottom:0;left:0;z-index:1030}@supports (position: -webkit-sticky) or (position: sticky){.sticky-top{position:-webkit-sticky;position:sticky;top:0;z-index:1020}}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal}.shadow-sm{-webkit-box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;box-shadow:0 0.125rem 0.25rem rgba(0,0,0,0.075) !important}.shadow{-webkit-box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important;box-shadow:0 0.5rem 1rem rgba(0,0,0,0.15) !important}.shadow-lg{-webkit-box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important;box-shadow:0 1rem 3rem rgba(0,0,0,0.175) !important}.shadow-none{-webkit-box-shadow:none !important;box-shadow:none !important}.w-25{width:25% !important}.w-50{width:50% !important}.w-75{width:75% !important}.w-100{width:100% !important}.w-auto{width:auto !important}.h-25{height:25% !important}.h-50{height:50% !important}.h-75{height:75% !important}.h-100{height:100% !important}.h-auto{height:auto !important}.mw-100{max-width:100% !important}.mh-100{max-height:100% !important}.m-0{margin:0 !important}.mt-0,.my-0{margin-top:0 !important}.mr-0,.mx-0{margin-right:0 !important}.mb-0,.my-0{margin-bottom:0 !important}.ml-0,.mx-0{margin-left:0 !important}.m-1{margin:0.25rem !important}.mt-1,.my-1{margin-top:0.25rem !important}.mr-1,.mx-1{margin-right:0.25rem !important}.mb-1,.my-1{margin-bottom:0.25rem !important}.ml-1,.mx-1{margin-left:0.25rem !important}.m-2{margin:0.5rem !important}.mt-2,.my-2{margin-top:0.5rem !important}.mr-2,.mx-2{margin-right:0.5rem !important}.mb-2,.my-2{margin-bottom:0.5rem !important}.ml-2,.mx-2{margin-left:0.5rem !important}.m-3{margin:1rem !important}.mt-3,.my-3{margin-top:1rem !important}.mr-3,.mx-3{margin-right:1rem !important}.mb-3,.my-3{margin-bottom:1rem !important}.ml-3,.mx-3{margin-left:1rem !important}.m-4{margin:1.5rem !important}.mt-4,.my-4{margin-top:1.5rem !important}.mr-4,.mx-4{margin-right:1.5rem !important}.mb-4,.my-4{margin-bottom:1.5rem !important}.ml-4,.mx-4{margin-left:1.5rem !important}.m-5{margin:3rem !important}.mt-5,.my-5{margin-top:3rem !important}.mr-5,.mx-5{margin-right:3rem !important}.mb-5,.my-5{margin-bottom:3rem !important}.ml-5,.mx-5{margin-left:3rem !important}.p-0{padding:0 !important}.pt-0,.py-0{padding-top:0 !important}.pr-0,.px-0{padding-right:0 !important}.pb-0,.py-0{padding-bottom:0 !important}.pl-0,.px-0{padding-left:0 !important}.p-1{padding:0.25rem !important}.pt-1,.py-1{padding-top:0.25rem !important}.pr-1,.px-1{padding-right:0.25rem !important}.pb-1,.py-1{padding-bottom:0.25rem !important}.pl-1,.px-1{padding-left:0.25rem !important}.p-2{padding:0.5rem !important}.pt-2,.py-2{padding-top:0.5rem !important}.pr-2,.px-2{padding-right:0.5rem !important}.pb-2,.py-2{padding-bottom:0.5rem !important}.pl-2,.px-2{padding-left:0.5rem !important}.p-3{padding:1rem !important}.pt-3,.py-3{padding-top:1rem !important}.pr-3,.px-3{padding-right:1rem !important}.pb-3,.py-3{padding-bottom:1rem !important}.pl-3,.px-3{padding-left:1rem !important}.p-4{padding:1.5rem !important}.pt-4,.py-4{padding-top:1.5rem !important}.pr-4,.px-4{padding-right:1.5rem !important}.pb-4,.py-4{padding-bottom:1.5rem !important}.pl-4,.px-4{padding-left:1.5rem !important}.p-5{padding:3rem !important}.pt-5,.py-5{padding-top:3rem !important}.pr-5,.px-5{padding-right:3rem !important}.pb-5,.py-5{padding-bottom:3rem !important}.pl-5,.px-5{padding-left:3rem !important}.m-auto{margin:auto !important}.mt-auto,.my-auto{margin-top:auto !important}.mr-auto,.mx-auto{margin-right:auto !important}.mb-auto,.my-auto{margin-bottom:auto !important}.ml-auto,.mx-auto{margin-left:auto !important}@media (min-width: 576px){.m-sm-0{margin:0 !important}.mt-sm-0,.my-sm-0{margin-top:0 !important}.mr-sm-0,.mx-sm-0{margin-right:0 !important}.mb-sm-0,.my-sm-0{margin-bottom:0 !important}.ml-sm-0,.mx-sm-0{margin-left:0 !important}.m-sm-1{margin:0.25rem !important}.mt-sm-1,.my-sm-1{margin-top:0.25rem !important}.mr-sm-1,.mx-sm-1{margin-right:0.25rem !important}.mb-sm-1,.my-sm-1{margin-bottom:0.25rem !important}.ml-sm-1,.mx-sm-1{margin-left:0.25rem !important}.m-sm-2{margin:0.5rem !important}.mt-sm-2,.my-sm-2{margin-top:0.5rem !important}.mr-sm-2,.mx-sm-2{margin-right:0.5rem !important}.mb-sm-2,.my-sm-2{margin-bottom:0.5rem !important}.ml-sm-2,.mx-sm-2{margin-left:0.5rem !important}.m-sm-3{margin:1rem !important}.mt-sm-3,.my-sm-3{margin-top:1rem !important}.mr-sm-3,.mx-sm-3{margin-right:1rem !important}.mb-sm-3,.my-sm-3{margin-bottom:1rem !important}.ml-sm-3,.mx-sm-3{margin-left:1rem !important}.m-sm-4{margin:1.5rem !important}.mt-sm-4,.my-sm-4{margin-top:1.5rem !important}.mr-sm-4,.mx-sm-4{margin-right:1.5rem !important}.mb-sm-4,.my-sm-4{margin-bottom:1.5rem !important}.ml-sm-4,.mx-sm-4{margin-left:1.5rem !important}.m-sm-5{margin:3rem !important}.mt-sm-5,.my-sm-5{margin-top:3rem !important}.mr-sm-5,.mx-sm-5{margin-right:3rem !important}.mb-sm-5,.my-sm-5{margin-bottom:3rem !important}.ml-sm-5,.mx-sm-5{margin-left:3rem !important}.p-sm-0{padding:0 !important}.pt-sm-0,.py-sm-0{padding-top:0 !important}.pr-sm-0,.px-sm-0{padding-right:0 !important}.pb-sm-0,.py-sm-0{padding-bottom:0 !important}.pl-sm-0,.px-sm-0{padding-left:0 !important}.p-sm-1{padding:0.25rem !important}.pt-sm-1,.py-sm-1{padding-top:0.25rem !important}.pr-sm-1,.px-sm-1{padding-right:0.25rem !important}.pb-sm-1,.py-sm-1{padding-bottom:0.25rem !important}.pl-sm-1,.px-sm-1{padding-left:0.25rem !important}.p-sm-2{padding:0.5rem !important}.pt-sm-2,.py-sm-2{padding-top:0.5rem !important}.pr-sm-2,.px-sm-2{padding-right:0.5rem !important}.pb-sm-2,.py-sm-2{padding-bottom:0.5rem !important}.pl-sm-2,.px-sm-2{padding-left:0.5rem !important}.p-sm-3{padding:1rem !important}.pt-sm-3,.py-sm-3{padding-top:1rem !important}.pr-sm-3,.px-sm-3{padding-right:1rem !important}.pb-sm-3,.py-sm-3{padding-bottom:1rem !important}.pl-sm-3,.px-sm-3{padding-left:1rem !important}.p-sm-4{padding:1.5rem !important}.pt-sm-4,.py-sm-4{padding-top:1.5rem !important}.pr-sm-4,.px-sm-4{padding-right:1.5rem !important}.pb-sm-4,.py-sm-4{padding-bottom:1.5rem !important}.pl-sm-4,.px-sm-4{padding-left:1.5rem !important}.p-sm-5{padding:3rem !important}.pt-sm-5,.py-sm-5{padding-top:3rem !important}.pr-sm-5,.px-sm-5{padding-right:3rem !important}.pb-sm-5,.py-sm-5{padding-bottom:3rem !important}.pl-sm-5,.px-sm-5{padding-left:3rem !important}.m-sm-auto{margin:auto !important}.mt-sm-auto,.my-sm-auto{margin-top:auto !important}.mr-sm-auto,.mx-sm-auto{margin-right:auto !important}.mb-sm-auto,.my-sm-auto{margin-bottom:auto !important}.ml-sm-auto,.mx-sm-auto{margin-left:auto !important}}@media (min-width: 768px){.m-md-0{margin:0 !important}.mt-md-0,.my-md-0{margin-top:0 !important}.mr-md-0,.mx-md-0{margin-right:0 !important}.mb-md-0,.my-md-0{margin-bottom:0 !important}.ml-md-0,.mx-md-0{margin-left:0 !important}.m-md-1{margin:0.25rem !important}.mt-md-1,.my-md-1{margin-top:0.25rem !important}.mr-md-1,.mx-md-1{margin-right:0.25rem !important}.mb-md-1,.my-md-1{margin-bottom:0.25rem !important}.ml-md-1,.mx-md-1{margin-left:0.25rem !important}.m-md-2{margin:0.5rem !important}.mt-md-2,.my-md-2{margin-top:0.5rem !important}.mr-md-2,.mx-md-2{margin-right:0.5rem !important}.mb-md-2,.my-md-2{margin-bottom:0.5rem !important}.ml-md-2,.mx-md-2{margin-left:0.5rem !important}.m-md-3{margin:1rem !important}.mt-md-3,.my-md-3{margin-top:1rem !important}.mr-md-3,.mx-md-3{margin-right:1rem !important}.mb-md-3,.my-md-3{margin-bottom:1rem !important}.ml-md-3,.mx-md-3{margin-left:1rem !important}.m-md-4{margin:1.5rem !important}.mt-md-4,.my-md-4{margin-top:1.5rem !important}.mr-md-4,.mx-md-4{margin-right:1.5rem !important}.mb-md-4,.my-md-4{margin-bottom:1.5rem !important}.ml-md-4,.mx-md-4{margin-left:1.5rem !important}.m-md-5{margin:3rem !important}.mt-md-5,.my-md-5{margin-top:3rem !important}.mr-md-5,.mx-md-5{margin-right:3rem !important}.mb-md-5,.my-md-5{margin-bottom:3rem !important}.ml-md-5,.mx-md-5{margin-left:3rem !important}.p-md-0{padding:0 !important}.pt-md-0,.py-md-0{padding-top:0 !important}.pr-md-0,.px-md-0{padding-right:0 !important}.pb-md-0,.py-md-0{padding-bottom:0 !important}.pl-md-0,.px-md-0{padding-left:0 !important}.p-md-1{padding:0.25rem !important}.pt-md-1,.py-md-1{padding-top:0.25rem !important}.pr-md-1,.px-md-1{padding-right:0.25rem !important}.pb-md-1,.py-md-1{padding-bottom:0.25rem !important}.pl-md-1,.px-md-1{padding-left:0.25rem !important}.p-md-2{padding:0.5rem !important}.pt-md-2,.py-md-2{padding-top:0.5rem !important}.pr-md-2,.px-md-2{padding-right:0.5rem !important}.pb-md-2,.py-md-2{padding-bottom:0.5rem !important}.pl-md-2,.px-md-2{padding-left:0.5rem !important}.p-md-3{padding:1rem !important}.pt-md-3,.py-md-3{padding-top:1rem !important}.pr-md-3,.px-md-3{padding-right:1rem !important}.pb-md-3,.py-md-3{padding-bottom:1rem !important}.pl-md-3,.px-md-3{padding-left:1rem !important}.p-md-4{padding:1.5rem !important}.pt-md-4,.py-md-4{padding-top:1.5rem !important}.pr-md-4,.px-md-4{padding-right:1.5rem !important}.pb-md-4,.py-md-4{padding-bottom:1.5rem !important}.pl-md-4,.px-md-4{padding-left:1.5rem !important}.p-md-5{padding:3rem !important}.pt-md-5,.py-md-5{padding-top:3rem !important}.pr-md-5,.px-md-5{padding-right:3rem !important}.pb-md-5,.py-md-5{padding-bottom:3rem !important}.pl-md-5,.px-md-5{padding-left:3rem !important}.m-md-auto{margin:auto !important}.mt-md-auto,.my-md-auto{margin-top:auto !important}.mr-md-auto,.mx-md-auto{margin-right:auto !important}.mb-md-auto,.my-md-auto{margin-bottom:auto !important}.ml-md-auto,.mx-md-auto{margin-left:auto !important}}@media (min-width: 992px){.m-lg-0{margin:0 !important}.mt-lg-0,.my-lg-0{margin-top:0 !important}.mr-lg-0,.mx-lg-0{margin-right:0 !important}.mb-lg-0,.my-lg-0{margin-bottom:0 !important}.ml-lg-0,.mx-lg-0{margin-left:0 !important}.m-lg-1{margin:0.25rem !important}.mt-lg-1,.my-lg-1{margin-top:0.25rem !important}.mr-lg-1,.mx-lg-1{margin-right:0.25rem !important}.mb-lg-1,.my-lg-1{margin-bottom:0.25rem !important}.ml-lg-1,.mx-lg-1{margin-left:0.25rem !important}.m-lg-2{margin:0.5rem !important}.mt-lg-2,.my-lg-2{margin-top:0.5rem !important}.mr-lg-2,.mx-lg-2{margin-right:0.5rem !important}.mb-lg-2,.my-lg-2{margin-bottom:0.5rem !important}.ml-lg-2,.mx-lg-2{margin-left:0.5rem !important}.m-lg-3{margin:1rem !important}.mt-lg-3,.my-lg-3{margin-top:1rem !important}.mr-lg-3,.mx-lg-3{margin-right:1rem !important}.mb-lg-3,.my-lg-3{margin-bottom:1rem !important}.ml-lg-3,.mx-lg-3{margin-left:1rem !important}.m-lg-4{margin:1.5rem !important}.mt-lg-4,.my-lg-4{margin-top:1.5rem !important}.mr-lg-4,.mx-lg-4{margin-right:1.5rem !important}.mb-lg-4,.my-lg-4{margin-bottom:1.5rem !important}.ml-lg-4,.mx-lg-4{margin-left:1.5rem !important}.m-lg-5{margin:3rem !important}.mt-lg-5,.my-lg-5{margin-top:3rem !important}.mr-lg-5,.mx-lg-5{margin-right:3rem !important}.mb-lg-5,.my-lg-5{margin-bottom:3rem !important}.ml-lg-5,.mx-lg-5{margin-left:3rem !important}.p-lg-0{padding:0 !important}.pt-lg-0,.py-lg-0{padding-top:0 !important}.pr-lg-0,.px-lg-0{padding-right:0 !important}.pb-lg-0,.py-lg-0{padding-bottom:0 !important}.pl-lg-0,.px-lg-0{padding-left:0 !important}.p-lg-1{padding:0.25rem !important}.pt-lg-1,.py-lg-1{padding-top:0.25rem !important}.pr-lg-1,.px-lg-1{padding-right:0.25rem !important}.pb-lg-1,.py-lg-1{padding-bottom:0.25rem !important}.pl-lg-1,.px-lg-1{padding-left:0.25rem !important}.p-lg-2{padding:0.5rem !important}.pt-lg-2,.py-lg-2{padding-top:0.5rem !important}.pr-lg-2,.px-lg-2{padding-right:0.5rem !important}.pb-lg-2,.py-lg-2{padding-bottom:0.5rem !important}.pl-lg-2,.px-lg-2{padding-left:0.5rem !important}.p-lg-3{padding:1rem !important}.pt-lg-3,.py-lg-3{padding-top:1rem !important}.pr-lg-3,.px-lg-3{padding-right:1rem !important}.pb-lg-3,.py-lg-3{padding-bottom:1rem !important}.pl-lg-3,.px-lg-3{padding-left:1rem !important}.p-lg-4{padding:1.5rem !important}.pt-lg-4,.py-lg-4{padding-top:1.5rem !important}.pr-lg-4,.px-lg-4{padding-right:1.5rem !important}.pb-lg-4,.py-lg-4{padding-bottom:1.5rem !important}.pl-lg-4,.px-lg-4{padding-left:1.5rem !important}.p-lg-5{padding:3rem !important}.pt-lg-5,.py-lg-5{padding-top:3rem !important}.pr-lg-5,.px-lg-5{padding-right:3rem !important}.pb-lg-5,.py-lg-5{padding-bottom:3rem !important}.pl-lg-5,.px-lg-5{padding-left:3rem !important}.m-lg-auto{margin:auto !important}.mt-lg-auto,.my-lg-auto{margin-top:auto !important}.mr-lg-auto,.mx-lg-auto{margin-right:auto !important}.mb-lg-auto,.my-lg-auto{margin-bottom:auto !important}.ml-lg-auto,.mx-lg-auto{margin-left:auto !important}}@media (min-width: 1200px){.m-xl-0{margin:0 !important}.mt-xl-0,.my-xl-0{margin-top:0 !important}.mr-xl-0,.mx-xl-0{margin-right:0 !important}.mb-xl-0,.my-xl-0{margin-bottom:0 !important}.ml-xl-0,.mx-xl-0{margin-left:0 !important}.m-xl-1{margin:0.25rem !important}.mt-xl-1,.my-xl-1{margin-top:0.25rem !important}.mr-xl-1,.mx-xl-1{margin-right:0.25rem !important}.mb-xl-1,.my-xl-1{margin-bottom:0.25rem !important}.ml-xl-1,.mx-xl-1{margin-left:0.25rem !important}.m-xl-2{margin:0.5rem !important}.mt-xl-2,.my-xl-2{margin-top:0.5rem !important}.mr-xl-2,.mx-xl-2{margin-right:0.5rem !important}.mb-xl-2,.my-xl-2{margin-bottom:0.5rem !important}.ml-xl-2,.mx-xl-2{margin-left:0.5rem !important}.m-xl-3{margin:1rem !important}.mt-xl-3,.my-xl-3{margin-top:1rem !important}.mr-xl-3,.mx-xl-3{margin-right:1rem !important}.mb-xl-3,.my-xl-3{margin-bottom:1rem !important}.ml-xl-3,.mx-xl-3{margin-left:1rem !important}.m-xl-4{margin:1.5rem !important}.mt-xl-4,.my-xl-4{margin-top:1.5rem !important}.mr-xl-4,.mx-xl-4{margin-right:1.5rem !important}.mb-xl-4,.my-xl-4{margin-bottom:1.5rem !important}.ml-xl-4,.mx-xl-4{margin-left:1.5rem !important}.m-xl-5{margin:3rem !important}.mt-xl-5,.my-xl-5{margin-top:3rem !important}.mr-xl-5,.mx-xl-5{margin-right:3rem !important}.mb-xl-5,.my-xl-5{margin-bottom:3rem !important}.ml-xl-5,.mx-xl-5{margin-left:3rem !important}.p-xl-0{padding:0 !important}.pt-xl-0,.py-xl-0{padding-top:0 !important}.pr-xl-0,.px-xl-0{padding-right:0 !important}.pb-xl-0,.py-xl-0{padding-bottom:0 !important}.pl-xl-0,.px-xl-0{padding-left:0 !important}.p-xl-1{padding:0.25rem !important}.pt-xl-1,.py-xl-1{padding-top:0.25rem !important}.pr-xl-1,.px-xl-1{padding-right:0.25rem !important}.pb-xl-1,.py-xl-1{padding-bottom:0.25rem !important}.pl-xl-1,.px-xl-1{padding-left:0.25rem !important}.p-xl-2{padding:0.5rem !important}.pt-xl-2,.py-xl-2{padding-top:0.5rem !important}.pr-xl-2,.px-xl-2{padding-right:0.5rem !important}.pb-xl-2,.py-xl-2{padding-bottom:0.5rem !important}.pl-xl-2,.px-xl-2{padding-left:0.5rem !important}.p-xl-3{padding:1rem !important}.pt-xl-3,.py-xl-3{padding-top:1rem !important}.pr-xl-3,.px-xl-3{padding-right:1rem !important}.pb-xl-3,.py-xl-3{padding-bottom:1rem !important}.pl-xl-3,.px-xl-3{padding-left:1rem !important}.p-xl-4{padding:1.5rem !important}.pt-xl-4,.py-xl-4{padding-top:1.5rem !important}.pr-xl-4,.px-xl-4{padding-right:1.5rem !important}.pb-xl-4,.py-xl-4{padding-bottom:1.5rem !important}.pl-xl-4,.px-xl-4{padding-left:1.5rem !important}.p-xl-5{padding:3rem !important}.pt-xl-5,.py-xl-5{padding-top:3rem !important}.pr-xl-5,.px-xl-5{padding-right:3rem !important}.pb-xl-5,.py-xl-5{padding-bottom:3rem !important}.pl-xl-5,.px-xl-5{padding-left:3rem !important}.m-xl-auto{margin:auto !important}.mt-xl-auto,.my-xl-auto{margin-top:auto !important}.mr-xl-auto,.mx-xl-auto{margin-right:auto !important}.mb-xl-auto,.my-xl-auto{margin-bottom:auto !important}.ml-xl-auto,.mx-xl-auto{margin-left:auto !important}}.text-monospace{font-family:SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace}.text-justify{text-align:justify !important}.text-nowrap{white-space:nowrap !important}.text-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-left{text-align:left !important}.text-right{text-align:right !important}.text-center{text-align:center !important}@media (min-width: 576px){.text-sm-left{text-align:left !important}.text-sm-right{text-align:right !important}.text-sm-center{text-align:center !important}}@media (min-width: 768px){.text-md-left{text-align:left !important}.text-md-right{text-align:right !important}.text-md-center{text-align:center !important}}@media (min-width: 992px){.text-lg-left{text-align:left !important}.text-lg-right{text-align:right !important}.text-lg-center{text-align:center !important}}@media (min-width: 1200px){.text-xl-left{text-align:left !important}.text-xl-right{text-align:right !important}.text-xl-center{text-align:center !important}}.text-lowercase{text-transform:lowercase !important}.text-uppercase{text-transform:uppercase !important}.text-capitalize{text-transform:capitalize !important}.font-weight-light{font-weight:300 !important}.font-weight-normal{font-weight:400 !important}.font-weight-bold{font-weight:700 !important}.font-italic{font-style:italic !important}.text-white{color:#fff !important}.text-primary{color:#2FA4E7 !important}a.text-primary:hover,a.text-primary:focus{color:#178acc !important}.text-secondary{color:#e9ecef !important}a.text-secondary:hover,a.text-secondary:focus{color:#cbd3da !important}.text-success{color:#73A839 !important}a.text-success:hover,a.text-success:focus{color:#59822c !important}.text-info{color:#033C73 !important}a.text-info:hover,a.text-info:focus{color:#022241 !important}.text-warning{color:#DD5600 !important}a.text-warning:hover,a.text-warning:focus{color:#aa4200 !important}.text-danger{color:#C71C22 !important}a.text-danger:hover,a.text-danger:focus{color:#9a161a !important}.text-light{color:#f8f9fa !important}a.text-light:hover,a.text-light:focus{color:#dae0e5 !important}.text-dark{color:#343a40 !important}a.text-dark:hover,a.text-dark:focus{color:#1d2124 !important}.text-body{color:#495057 !important}.text-muted{color:#868e96 !important}.text-black-50{color:rgba(0,0,0,0.5) !important}.text-white-50{color:rgba(255,255,255,0.5) !important}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.visible{visibility:visible !important}.invisible{visibility:hidden !important}@media print{*,*::before,*::after{text-shadow:none !important;-webkit-box-shadow:none !important;box-shadow:none !important}a:not(.btn){text-decoration:underline}abbr[title]::after{content:" (" attr(title) ")"}pre{white-space:pre-wrap !important}pre,blockquote{border:1px solid #adb5bd;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}@page{size:a3}body{min-width:992px !important}.container{min-width:992px !important}.navbar{display:none}.badge{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #dee2e6 !important}.table-dark{color:inherit}.table-dark th,.table-dark td,.table-dark thead th,.table-dark tbody+tbody{border-color:#dee2e6}.table .thead-dark th{color:inherit;border-color:#dee2e6}}.bg-primary{background-image:-webkit-gradient(linear, left top, left bottom, from(#54b4eb), color-stop(60%, #2FA4E7), to(#1d9ce5));background-image:linear-gradient(#54b4eb, #2FA4E7 60%, #1d9ce5);background-repeat:no-repeat}.bg-dark{background-image:-webkit-gradient(linear, left top, left bottom, from(#04519b), color-stop(60%, #033C73), to(#02325f));background-image:linear-gradient(#04519b, #033C73 60%, #02325f);background-repeat:no-repeat}.bg-light{background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(60%, #e9ecef), to(#e3e7eb));background-image:linear-gradient(white, #e9ecef 60%, #e3e7eb);background-repeat:no-repeat}.navbar-brand,.nav-link{text-shadow:0 1px 0 rgba(0,0,0,0.05)}.btn{text-shadow:0 1px 0 rgba(0,0,0,0.05)}.btn-primary{background-image:-webkit-gradient(linear, left top, left bottom, from(#54b4eb), color-stop(60%, #2FA4E7), to(#1d9ce5));background-image:linear-gradient(#54b4eb, #2FA4E7 60%, #1d9ce5);background-repeat:no-repeat}.btn-secondary{background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(60%, #e9ecef), to(#dde2e6));background-image:linear-gradient(white, #e9ecef 60%, #dde2e6);background-repeat:no-repeat;color:#495057}.btn-success{background-image:-webkit-gradient(linear, left top, left bottom, from(#88c149), color-stop(60%, #73A839), to(#699934));background-image:linear-gradient(#88c149, #73A839 60%, #699934);background-repeat:no-repeat}.btn-info{background-image:-webkit-gradient(linear, left top, left bottom, from(#04519b), color-stop(60%, #033C73), to(#02325f));background-image:linear-gradient(#04519b, #033C73 60%, #02325f);background-repeat:no-repeat}.btn-warning{background-image:-webkit-gradient(linear, left top, left bottom, from(#ff6707), color-stop(60%, #DD5600), to(#c94e00));background-image:linear-gradient(#ff6707, #DD5600 60%, #c94e00);background-repeat:no-repeat}.btn-danger{background-image:-webkit-gradient(linear, left top, left bottom, from(#e12b31), color-stop(60%, #C71C22), to(#b5191f));background-image:linear-gradient(#e12b31, #C71C22 60%, #b5191f);background-repeat:no-repeat}.btn-light{background-image:-webkit-gradient(linear, left top, left bottom, from(white), color-stop(60%, #f8f9fa), to(#eceff2));background-image:linear-gradient(white, #f8f9fa 60%, #eceff2);background-repeat:no-repeat}.btn-dark{background-image:-webkit-gradient(linear, left top, left bottom, from(#464e57), color-stop(60%, #343a40), to(#2b3035));background-image:linear-gradient(#464e57, #343a40 60%, #2b3035);background-repeat:no-repeat}.bg-primary h1,.bg-primary h2,.bg-primary h3,.bg-primary h4,.bg-primary h5,.bg-primary h6,.bg-success h1,.bg-success h2,.bg-success h3,.bg-success h4,.bg-success h5,.bg-success h6,.bg-info h1,.bg-info h2,.bg-info h3,.bg-info h4,.bg-info h5,.bg-info h6,.bg-warning h1,.bg-warning h2,.bg-warning h3,.bg-warning h4,.bg-warning h5,.bg-warning h6,.bg-danger h1,.bg-danger h2,.bg-danger h3,.bg-danger h4,.bg-danger h5,.bg-danger h6,.bg-dark h1,.bg-dark h2,.bg-dark h3,.bg-dark h4,.bg-dark h5,.bg-dark h6{color:#fff}.dropdown-menu .dropdown-header{color:#868e96} diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/css/font-awesome.min.css sumo-1.6.0+dfsg1/docs/userdoc/css/font-awesome.min.css --- sumo-1.5.0+dfsg1/docs/userdoc/css/font-awesome.min.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/css/font-awesome.min.css 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Data/Networks.html sumo-1.6.0+dfsg1/docs/userdoc/Data/Networks.html --- sumo-1.5.0+dfsg1/docs/userdoc/Data/Networks.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Data/Networks.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + Data/Networks - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Data/Networks
    + + + +

    You should read the main page on NETCONVERT +before reading this.

    +

    OpenStreetMap-project#

    + +

    Comments: A great source of networks and man-made infrastucture. +However, infrastructure data and definitions are still changing +which complicates import.

    +

    See also: +Data/Scenarios/TAPASCologne - a complete scenario based on OSM and TAPAS

    +

    Frida-project#

    +
      +
    • URL: http://frida.intevation.org/
    • +
    • Area: city of Osnabrück
    • +
    • Demand data: not available
    • +
    • Extraction: netconvert --shapefile strassen -o frida2.net.xml +--shapefile.street-id strShapeID -t frida.typ.xml +--shapefile.type-id strTypID -v --proj "+proj=utm +ellps=bessel ++units=m"
    • +
    +

    Comments: Not really applicable because the streets lack +information about the number of lanes and the direction. Especially +the second makes the converted network quite useless. Trying to use +the option --shapefile.all-bidi solves the problem for +inner-city roads but makes highway on/offramps bidirectional, too. +The projection might be wrong as well, give --proj.utm a try.

    +

    See also:

    +

    Networks/Import/ArcView - +(notes on) importing ArcView networks (shapefiles)

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Data/Scenarios/TAPASCologne.html sumo-1.6.0+dfsg1/docs/userdoc/Data/Scenarios/TAPASCologne.html --- sumo-1.5.0+dfsg1/docs/userdoc/Data/Scenarios/TAPASCologne.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Data/Scenarios/TAPASCologne.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,488 @@ + + + + + + + + + + + + + + + + + + + Data/Scenarios/TAPASCologne - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Data/Scenarios/TAPASCologne
    + + + +

    "TAPAS Cologne" Scenario#

    +

    Availability#

    +

    88x31.png The data is available under the +Creative Commons +licence. You must tell where the data is from, it is not allowed +to use it for commercial purposes, as soon as you use it we want to +be informed about it (use the +sumo-user.

    +

    The data can be downloaded from our scenario +repository. +There also vehicle traces available from the KolnTrace project at CITI +Lab.

    +

    About#

    +

    Brief Description#

    +

    The "TAPAS Cologne" simulation scenario describes the traffic within the +city of Cologne (Germany) for a whole day. The original demand data +stems from TAPAS, a system which computes mobility wishes for an area +population generated based on information about travelling habits of +Germans and on information about the infrastructure of the area they +live in. More information about the system can be found within this +publication on +TAPAS. The +original data was using a closed-source road network and was mapped onto +one stemming from the OpenStreetMap +project.

    +

    As is, TAPASCologne is only hardly usable. Work must be put into +improving the network quality, as well as into verification of the +process how routes were mapped on the OSM network and on the routes +themselves. We hope to gain participants responsible for the works that +must be done. A list of possible work packages on +TAPASCologne is available.

    +

    Contents#

    +

    The TAPASCologne scenario package includes:

    +
      +
    • Road networks imported from OSM
    • +
    • POIs and Polygons imported from OSM
    • +
    • The mapped trips for time between 6:00 and 8:00 (am)
    • +
    • The mapped trips for time between 00:00 and 24:00 (in a separate + file)
    • +
    • The SUMO-configuration file
    • +
    +

    As OSM data contains information about streets, railways, ways for +pedestrians only, etc. Release 0.0.3 only includes the network for road +vehicles (road). Other network selections can be created with the script +build.py in the release.

    +
      +
    • "passenger_*" which contains only roads passenger vehicles are + allowed to use
    • +
    • "roadvehicles_*" which contains roads for road vehicles (those + used by pedestrians, trains, and bicycles were removed)
    • +
    • "all_*" which contains all roads
    • +
    +

    The idea behind this is to have a fast road network ("passenger_*") +for DUA computation and for scenarios which only consider passenger +traffic retrieved by TAPAS. Then, in a second step, which is not yet +started, additional traffic such as public transport or delivery +vehicles may be added and used in combination with "roadvehicles_*" +networks. "all_*" networks are meant to be used by people who want it +all......

    +

    Each of the road networks is again available in two versions - one with +internal lanes (default since version 0.10.1) and one without. Again, +choosing the proper network is a matter of personal interest.

    +

    The supplied routes are given for the "passenger_*"-network. Though +not tested, yet, we assume that they can not be used directly with other +networks from the package. Still, computing correct routes should be +possible by starting DUAROUTER with the +appropriate network and --repair option.

    +

    The following images show the scenario area with polygons and points of +interest. Because we assume that the networks differ in size, for each +network type (passenger, roadvehicles, all), a shape file is included.

    +

    +

    +

    Change Log#

    +

    Version 0.0.1 to version 0.0.2

    + +

    Quality#

    +

    In the current version, we even have not tested the data, completely. +The assumptions made on the quality are shown below. We decided not to +use a numeric ranking, because we do not have real world numbers for +most of the issues. The rank tries to distinguish between "good" (arrow +upwards, green) and "bad" (arrow downwards, red) influences on the +overall simulation quality.

    +
      +
    • Image:level16px_00.gif Network Topology and Edge Parameter (from OSM)
        +
      • Image:level16px_+3.gif Completeness
          +
        • Seems to be quite complete (including even minor roads) when + compared to other (commercial or administral) road networks; + still, there is no information about "black spots";
        • +
        • todo: build density plot comparing commercial and this + network (legal?)
        • +
        +
      • +
      • Image:level16px_-3.gif Junction topology
          +
        • Lots of complex junctions which should be simplified + (automatic joining failed)
        • +
        +
      • +
      • Image:level16px_-3.gif Lane Number Information
          +
        • The information about lane numbers is stored via types, + mainly. For several roads, an explicite lane number is + given. It can be safely assumed that many turning-lanes are + missing.
        • +
        • todo: evaluate how much information is given explicitely
        • +
        • todo: compare to images, write down lane number per + street
        • +
        +
      • +
      • Image:level16px_-2.gif Maximum Speed Information
          +
        • Again, mostly available via types, as for lane numbers; is + assumed to be mismatching on some places
        • +
        • Where can one get better information from?
        • +
        +
      • +
      +
    • +
    • Image:level16px_-2.gif Traffic Management Artifacts
        +
      • Image:level16px_-2.gif Traffic Light Positions
          +
        • Given for some junctions (nodes); Still, there seem to be no + information whether a node not marked as controlled is + really uncontrolled
        • +
        • todo: Try to find further controlled junctions or + improve guessing
        • +
        +
      • +
      • Image:level16px_-3.gif Traffic Light Programs
          +
        • Ungiven
        • +
        • todo: Ask about the default cycle time (if there is one) + in Cologne; apply at least this one to the generated tls + logics
        • +
        +
      • +
      • Image:level16px_-1.gif Other Traffic Management Artifacts
          +
        • completely ungiven
        • +
        +
      • +
      • Image:level16px_-1.gif Closures, Roads At Work
          +
        • completely ungiven
        • +
        +
      • +
      +
    • +
    • Image:level16px_-2.gif Public Transport
        +
      • completely ungiven
      • +
      +
    • +
    • Image:level16px_-1.gif Demand Data
        +
      • Image:level16px_+5.gif Activity-Based single Person Trips
          +
        • Image:level16px_+5.gif No Time Aggregation
        • +
        • Image:level16px_+5.gif No Start/End Position Aggregation
        • +
        +
      • +
      • Image:level16px_-2.gif unverified
      • +
      • Image:level16px_-1.gif starts partially at highways
      • +
      • Image:level16px_-2.gif ad-hoc, errorneous mapping to OSM
      • +
      • Image:level16px_-2.gif shortest path routing, no DUE as of release 0.0.3
      • +
      +
    • +
    +

    The below images show the structure of demand data over 24 hour period. +This shows normal behavior of mobility. Peak hours like ~8-9am , +~4-6pm during which the number of trips are usually high. More +information of the city of cologne can be found in the link +[1]. +The total number of trips (made by cars) over 24h is very close to the +number of registered cars*3 (3 trips per registered car). There are +around ~420415*3 (~1.2 million) trips which matchs the number in the +plots.

    +

    +
    +

    Caution

    +

    Due to the above problems with the simulation network, the configuration file included with the scenario uses the option --scale 0.3. This reduces the demand to 30% of the realistic value to avoid network-wide traffic jams.

    +
    +

    Summary: The TAPAS Cologne scenario is assumed to be one of the +largest - if not THE largest - freely available traffic simulation data +set. Regarding the scenario size, both the road network and the traffic +demand are given in a good quality. Nonetheless, many important +information is missing or wrong and much further effort is needed to +make the scenario realistic and complete.

    +

    Next Steps#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    TaskDescriptionPriorityAssigned To
    Synchronize Traffic Lightsvery high-
    Check Right-of-way Rulesvery high-
    Check Lane Numbers, esp. within Junctionshigh-
    Check whether all traffic lights are givenhigh-
    Compute Assignmenthigh-
    Add Public Transportlow-
    Help on Visualisation of POIs/Polygonslow-
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Data/Scenarios.html sumo-1.6.0+dfsg1/docs/userdoc/Data/Scenarios.html --- sumo-1.5.0+dfsg1/docs/userdoc/Data/Scenarios.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Data/Scenarios.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,302 @@ + + + + + + + + + + + + + + + + + + + Data/Scenarios - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Data/Scenarios
    + + + +

    We need your Help!#

    +

    Building a scenario is a lot of work. If you have built a sumo scenario +you can share (under a sufficiently open license), please +Contact us.

    +

    Bologna#

    +

    A small-scale scenario based on the city of Bologna. The large +roundabout can be found at 44.494554,11.314393. These scenarios were +developed as part of the iTETRIS project. A +publication on these scenarios was presented +at SUMO +Conference 2014: L. +Bieker, D. Krajzewicz, A. Morra, C. Michelacci and F. Cartolano, +"Traffic simulation for all: a real world traffic scenario from the city +of Bologna", SUMO2014, p 19-26 +Download: scenario Bologna *.zip +files

    +

    Luxembourg SUMO Traffic (LuST)#

    +
      +
    • Main Page
    • +
    • Releases
    • +
    • Documentation
    • +
    • Publication: Lara CODECA, Raphael FRANK, Thomas ENGEL. December 2015. Luxembourg SUMO Traffic (LuST) Scenario: 24 Hours of Mobility +for Vehicular Networking Research in Proceedings of the 7th IEEE +Vehicular Networking Conference (VNC15).
    • +
    +

    Monaco SUMO Traffic (MoST)#

    +
      +
    • Main Page
    • +
    • Releasese
    • +
    • Publication: L. Codeca, J. Härri, "Towards Multimodal Mobility +Simulation of C-ITS: The Monaco SUMO Traffic Scenario" VNC 2017, +IEEE Vehicular Networking Conference November 27-29, 2017, Torino, +Italy.
    • +
    +

    TAPASCologne#

    +

    ssnap_TapasCologne_0.1.gif The "TAPAS Cologne" simulation scenario +describes the traffic within the city of Cologne, Germany for a whole +day. The original demand data stems from TAPAS, a system which computes +mobility wishes for an area population generated based on information +about travelling habits of Germans and on information about the +infrastructure of the area they live in.

    +

    More information about the system can be found within this publication +on TAPAS. +The original data was using a closed-source road network and was mapped +onto one stemming from the OpenStreetMap +project.

    +

    There is further information about +TAPASCologne.

    +

    Further real-world scenarios#

    + +
    +

    Caution

    +

    The scenario is known to have lots of collisions due to unsafe traffic lights and some invalid junction definitions. Furthermore it is quite jammed

    +
    +

    Synthetic scenarios#

    +

    Synthetic - or abstract - scenarios only resemble typical layouts of +real-world junctions and arterials without mapping a very specific one. +Some synthetic scenarios of the COLOMBO R&D +project are examples of the German guideline +RiLSA. They are described in D1.1 "Scenario Specifications and Required +Modifications to Simulation +Tools"(chapter +4).

    +

    Download: 4 RiLSA *.zip +files

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Data/Traffic_Data.html sumo-1.6.0+dfsg1/docs/userdoc/Data/Traffic_Data.html --- sumo-1.5.0+dfsg1/docs/userdoc/Data/Traffic_Data.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Data/Traffic_Data.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + Data/Traffic Data - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Data/Traffic Data
    + + + +

    Traffic Data#

    +

    FSP - Data from the Freeway Service Patrol Evaluation Project#

    +

    This description is not yet completed

    +

    The data includes:

    +
      +
    • Traffic measures at induction loops
        +
      • per-vehicle speed and lengths
      • +
      +
    • +
    +

    Data Descriptions#

    +

    per-vehicle speed and lengths#

    +

    The data is given as a tar file named +fsp_speed_and_lengths.tar +(~40MB). Within this tar-file you will find a folder which contains +compressed (gzip) data files. Each data file represents a day for one +direction (north/south). The following days are given:

    +
      +
    • 16.02.93
    • +
    • 17.02.93
    • +
    • 18.02.93
    • +
    • 19.02.93
    • +
    • 22.02.93
    • +
    • 24.02.93
    • +
    +

    The files are tab-delimited with the following fields:

    +
      +
    • Detector position (in meters)
    • +
    • Detector lane
    • +
    • Time (in ?)
    • +
    • vehicle speed (probably in m/s)
    • +
    • vehicle length (in m)
    • +
    +

    References#

    +

    Project and data descriptions:

    +
      +
    • Petty K.F.; Noeimi H.; Sanwal K.; Rydzewski D.; Skabardonis A.; + Varaiya P.; Al-Deek H.; "The freeway service patrol evaluation + project: database support programs, and accessibility"; In: + Transportation Research Part C: Emerging Technologies, Volume 4, + Number 2, April 1996 , pp. 71-85(15), Elsevier
    • +
    +

    Usage examples:

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html sumo-1.6.0+dfsg1/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html --- sumo-1.5.0+dfsg1/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,2381 @@ + + + + + + + + + + + + + + + + + + + Definition of Vehicles, Vehicle Types, and Routes - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Definition of Vehicles, Vehicle Types, and Routes
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Filename extension.rou.xml
    Type of contentVehicles, Vehicle Types, and Routes
    Open format?Yes
    SUMO specific?Yes
    XML Schemaroutes_file.xsd
    +

    There are various applications +that can be used to define vehicular demand for SUMO. Of course it is +also possible to define the demand file manually or to edit generated +files with a text editor. Before starting, it is important to know that +a vehicle in SUMO consists of three parts:

    +
      +
    • a vehicle type which describes the vehicle's physical properties,
    • +
    • a route the vehicle shall take,
    • +
    • and the vehicle itself.
    • +
    +

    Both routes and vehicle types can be shared by several vehicles. It is +not mandatory to define a vehicle type. If not given, a default type is +used. The driver of a vehicle does not have to be modelled explicitly. +For the simulation of persons which walk around or ride in vehicles, additional definitions are necessary.

    +

    Vehicles and Routes#

    +

    Initially, we will define a vehicle with a route owned by him only:

    +
    <routes>
    +    <vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
    +
    +    <vehicle id="0" type="type1" depart="0" color="1,0,0">
    +      <route edges="beg middle end rend"/>
    +    </vehicle>
    +
    +</routes>
    +
    + +

    By giving such a route definition to SUMO (or +SUMO-GUI), SUMO will build a +red (color=1,0,0) vehicle of type "type1" named "0" which starts at time +0. The vehicle will drive along the streets "beg", "middle", "end", and +as soon as it has approached the edge "rend" it will be removed from the +simulation.

    +

    This vehicle has its own internal route which is not shared with other +vehicles. It is also possible to define two vehicles using the same +route. In this case the route must be "externalized" - defined before +being referenced by the vehicles. Also, the route must be named by +giving it an id. The vehicles using the route refer it using the +"route"-attribute. The complete change looks like this:

    +
    <routes>
    +    <vType id="type1" accel="0.8" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
    +
    +    <route id="route0" color="1,1,0" edges="beg middle end rend"/>
    +
    +    <vehicle id="0" type="type1" route="route0" depart="0" color="1,0,0"/>
    +    <vehicle id="1" type="type1" route="route0" depart="0" color="0,1,0"/>
    +
    +</routes>
    +
    + +

    A vehicle may be defined using the following attributes:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    idid (string)The name of the vehicle
    typeidThe id of the vehicle type to use for this vehicle.
    routeidThe id of the route the vehicle shall drive along
    colorcolorThis vehicle's color
    departfloat (s) or one of triggered, containerTriggeredThe time step at which the vehicle shall enter the network; see #depart. Alternatively the vehicle departs once a person enters or a container is loaded
    departLaneint/string (≥0, "random", "free", "allowed", "best", "first")The lane on which the vehicle shall be inserted; see #departLane. default: "first"
    departPosfloat(m)/string ("random", "free", "random_free", "base", "last", "stop")The position at which the vehicle shall enter the net; see #departPos. default: "base"
    departSpeedfloat(m/s)/string (≥0, "random", "max", "desired", "speedLimit")The speed with which the vehicle shall enter the network; see #departSpeed. default: 0
    arrivalLaneint/string (≥0,"current")The lane at which the vehicle shall leave the network; see #arrivalLane. default: "current"
    arrivalPosfloat(m)/string (≥0(1), "random", "max")The position at which the vehicle shall leave the network; see #arrivalPos. default: "max"
    arrivalSpeedfloat(m/s)/string (≥0,"current")The speed with which the vehicle shall leave the network; see #arrivalSpeed. default: "current"
    linestringA string specifying the id of a public transport line which can be used when specifying person rides
    personNumberint (in [0,personCapacity])The number of occupied seats when the vehicle is inserted. default: 0
    containerNumberint (in [0,containerCapacity])The number of occupied container places when the vehicle is inserted. default: 0
    rerouteboolWhether the vehicle should be equipped with a rerouting device (setting this to false does not take precedence over other assignment options)
    viaid listList of intermediate edges that shall be passed on rerouting

    Note: when via is not set, any <stop>-elements that belong to this route will automatically be used as intermediate edges. Otherwise via takes precedence.
    departPosLatfloat(m)/string ("random", "free", "random_free", "left", "right", "center")The lateral position on the departure lane at which the vehicle shall enter the net; see Simulation/SublaneModel. default: "center"
    arrivalPosLatfloat(m)/string ("left", "right", "center")The lateral position on the arrival lane at which the vehicle shall arrive; see Simulation/SublaneModel. by default the vehicle does not care about lateral arrival position
    +
    +

    Caution

    +

    Any vehicle types or routes referenced by the attributes type or route must be defined before they are used. Loading order is described here.

    +
    +

    Repeated vehicles (Flows)#

    +

    It is possible to define repeated vehicle emissions ("flow"s), which +have the same parameters as the vehicle except for the departure time. +The id of the created vehicles is "flowId.runningNumber" and they are +distributed either equally or randomly in the given interval. The +following additional parameters are known:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    beginfloat(s)first vehicle departure time
    endfloat(s)end of departure interval (if undefined, defaults to 24 hours)
    vehsPerHourfloat(#/h)number of vehicles per hour, equally spaced (not together with period or probability)
    periodfloat(s)insert equally spaced vehicles at that period (not together with vehsPerHour or probability)
    probabilityfloat([0,1])probability for emitting a vehicle each second (not together with vehsPerHour or period), see also Simulation/Randomness
    numberint(#)total number of vehicles, equally spaced
    +
    <flow id="type1" color="1,1,0"  begin="0" end= "7200" period="900" type="BUS">
    +    <route edges="beg middle end rend"/>
    +    <stop busStop="station1" duration="30"/>
    +</flow>
    +
    + +

    Routes#

    +

    One may notice, that the route itself also got a +color definition, so the attributes of a route +are:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    idid (string)The name of the route
    edgesid listThe edges the vehicle shall drive along, given as their ids, separated using spaces
    colorcolorThis route's color
    repeatintThe number of times that the edges of this route shall be repeated (default 0)
    periodtime (s)When defining a repeating route with stops and those stops use the until attribute, the times will be shifted forward by 'period' on each repeat
    +

    There are a few important things to consider when building your own +routes:

    +
      +
    • Routes have to be connected. At the moment the simulation raises an + error if the next edge of the current route is not a successor of + the current edge or if the vehicle is not allowed to drive on any of + the lanes. If you want the old behavior where a vehicle simply + stopped at the end of the current edge and was possibly "teleported" + to the next edge after a waiting time, use the Option --ignore-route-errors.
    • +
    • Routes have to contain at least one edge.
    • +
    • The route file has to be sorted by starting times. In fact this is + only relevant, when you define a lot of routes or have large gaps + between departure times. The simulation parameter --route-steps, which defaults + to 200, defines the size of the time interval with which the + simulation loads its routes. That means by default at startup, only + routes with departure times <200 are loaded, if all the vehicles + have departed, the routes up to departure time 400 are loaded etc. + pp. This works only if the route file is sorted. This behavior may + be disabled by specifying --route-steps 0. It is possible to load + unsorted route files as an additional file which will load the whole + file at once.
    • +
    +

    The first two conditions can be checked using <SUMO_HOME>/tools/route/routecheck.py, the third can be "fixed" +using <SUMO_HOME>/tools/route/sort_routes.py.

    +
    +

    Caution

    +

    sumo may enter an infinite loop when given an unsorted route file with person definitions.

    +
    +

    Incomplete Routes (trips and flows)#

    +

    Demand information for the simulation may also take the form of origin +and destination edges instead of a complete list of edges. In this case +the simulation performs fastest-path routing based on the traffic +conditions found in the network at the time of departure/flow begin. +Optionally, a list of intermediate edges can be specified with the via +attribute. The input format is exactly the same as that for the +DUAROUTER application and can be found here.

    +
    <routes>
    +  <trip id="t" depart="0" from="beg" to="end"/>
    +  <flow id="f" begin="0" end="100" number="23" from="beg" to="end"/>
    +  <flow id="f2" begin="0" end="100" number="23" from="beg" to="end" via="e1 e23 e7"/>
    +</routes>
    +
    + +

    For more details on how to handle routing errors and influence the +routing in this case see +Demand/Automatic_Routing.

    +

    For supported attributes for flows and trips see here.

    +

    Traffic assignement zones (TAZ)#

    +

    It is also possible to let vehicles depart and arrive at traffic assignment zones (TAZ). +This allows the departure and arrival edges to be selected from a +predefined list of edges. Those edges are used which minimize the travel +time from origin TAZ to destination TAZ. When loading trips into +DUAROUTER the loaded travel times are used (with +empty-network travel times as default). When loading trips into +SUMO, the current travel times in the network are +used as determined by the rerouting +device.

    +
    <routes>
    +  <trip id="t" depart="0" fromTaz="taz1" toTaz="taz2"/>
    +</routes>
    +
    + +
    <additional>
    +  <taz id="<TAZ_ID>" edges="<EDGE_ID> <EDGE_ID> ..."/>
    +  ...
    +</additional>
    +
    + +
    +

    Note

    +

    When used in DUAROUTER or SUMO, edge weights within TAZ are ignored.

    +
    +

    When loading <taz> in SUMO-GUI the optional attribute shape +can be used to draw an arbitrary polygon border for visualizing the +traffic assignment zone.

    +
    +

    Caution

    +

    When using TAZ with SUMO and DUAROUTER, their edges will be selected to minimize travel time. This is different from TAZ usage in OD2TRIPS where edges are selected according to a probability distribution.

    +
    +

    Routing between Junctions#

    +

    Trips and flows may use the attributes fromJunction, toJunction, and viaJunctions to describe origin, destination and intermediate locations. This is a special form of TAZ-routing and it must be enabled by either setting the SUMO option --junction-taz or by loading TAZ-definitions that use the respective junction IDs. When using option --junction-taz, all edges outgoing from a junction may be used at the origin and all edges incoming to a junction may be used to reach the intermediate and final junctions.

    +

    A Vehicle's depart and arrival parameter#

    +

    Using the depart... and +arrival...-attributes, it is possible to +control how a vehicle is inserted into the network and how it leaves it.

    +

    depart#

    +

    Determines the time at which the vehicle enters the network (for <flow> the +value of begin is used instead). If there is not enough space in the +network, the actual depart time may be later.

    +
      +
    • When using option --max-depart-delay <TIME> the vehicle is discarded if unable to depart + after the given delay
    • +
    • A random offset to the specified depart time is added for each + vehicle when using option --random-depart-offset <TIME>
    • +
    • When using the special value triggered, the vehicle will depart as + soon as a person enters it.
    • +
    +

    departLane#

    +

    Determines on which lane the vehicle is tried to be inserted;

    +
      +
    • ≥0: the index of the lane, starting with + rightmost=0
    • +
    • "random": a random lane is chosen; + please note that a vehicle insertion is not retried if it could not + be inserted
    • +
    • "free": the most free (least occupied) + lane is chosen
    • +
    • "allowed": the "free" lane (see above) + of those lane of the depart edge which allow vehicles of the class + the vehicle belongs to
    • +
    • "best": the "free" lane of those who + allow the vehicle the longest ride without the need to lane change
    • +
    • "first": the rightmost lane the vehicle + may use
    • +
    +

    BTW, I like "best" at most - dkrajzew

    +

    departPos#

    +

    Determines the position on the chosen departure lane at which the +vehicle is tried to be inserted;

    +
      +
    • ≥0: the position on the lane, starting at the lane's begin; must be +smaller than the starting lane's length
    • +
    • "random": a random position is chosen; it is not retried to insert the +vehicle if the first try fails
    • +
    • "free": a free position (if existing) is used
    • +
    • "random_free": at first, ten random positions are tried, if all fail, "free" is applied
    • +
    • "base": the vehicle is tried to be inserted at the position which lets its +back be at the beginning of the lane (vehicle's front +position=vehicle length)
    • +
    • "last": the vehicle is inserted with the given speed as close as possible
    • +
    • "stop": if the vehicle has a stop defined, it will depart at the endPos of the stop. If no stop is defined, the behavior defaults to "base" +behind the last vehicle on the lane. If the lane is empty it is +inserted at the end of the lane instead. When departSpeed="max" is set, vehicle speed will not be adapted.
    • +
    +

    departSpeed#

    +

    Determines the speed of the vehicle at insertion, where maxSpeed = MIN(speedLimit * speedFactor, vTypeMaxSpeed);

    +
      +
    • ≥0: The vehicle is tried to be inserted +using the given speed. If that speed is unsafe, departure is +delayed.
    • +
    • "random": A random speed between 0 and +maxSpeed is used, +the speed may be adapted to ensure a safe distance to the leader +vehicle.
    • +
    • "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.
    • +
    +

    arrivalLane#

    +

    Determines the speed at which the vehicle should end its route;

    +
      +
    • "current": the vehicle will not change +it's lane when nearing arrival. It will use whatever lane is more +convenient to reach its arrival position. (default behavior)
    • +
    • ≥0: the vehicle changes lanes to end +it's route on the specified lane
    • +
    +

    arrivalPos#

    +

    Determines the position along the destination edge where the vehicle is +conisdered to have arrived;

    +
      +
    • "max": the vehicle will drive up to the + end of its final lane. (default behavior)
    • +
    • <FLOAT>: the position on the lane, starting at + the lane's begin; Negative values count from the end of the lane
    • +
    • "random": a random position is chosen at + departure; If vehicle is rerouted a new random position is selected.
    • +
    +

    arrivalSpeed#

    +

    Determines the speed at which the vehicle should end its route;

    +
      +
    • "current": the vehicle will not modify + it's speed when nearing arrival. It will drive as fast as (safely) + possible. (default behavior)
    • +
    • ≥0: the vehicle approaches it's arrival + position to end with the specified speed
    • +
    +

    Vehicle Types#

    +

    A vehicle is defined using the vType-element as shown below:

    +
    <routes>
    +    <vType id="type1" accel="2.6" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
    +</routes>
    +
    + +

    Having defined this, one can build vehicles of type "type1". The values +used above are the ones most of the examples use. They resemble a +standard vehicle as used within the Stefan Krauß' thesis.

    +
    <routes>
    +    <vType id="type1" accel="2.6" decel="4.5" sigma="0.5" length="5" maxSpeed="70"/>
    +    <vehicle id="veh1" type="type1" depart="0">
    +        <route edges="edge1 edge2 edge3"/>
    +    </vehicle>
    +</routes>
    +
    + +

    This definition is the initial one which includes both, the definition +of the vehicle's "purely physical" parameters, such as its length, its +color, or its maximum velocity, and also the used car-following model's +parameters. Please note that even though the car-following parameters +are describing values such as max. acceleration, or max. deceleration, +they mostly do not correspond to what one would assume. The maximum +acceleration for example is not the car's maximum acceleration +possibility but rather the maximum acceleration a driver choses - even +if you have a Jaguar, you probably are not trying to go to 100km/h in 5s +when driving through a city.

    +

    The default car following model is based on the work of Krauß but other +models can be selected as well. Model selection and parameterization is +done by setting further vType-attribures as shown below. The models and their +parameters are described in the following.

    +
    <routes>
    +    <vType id="type1" length="5" maxSpeed="70" carFollowModel="Krauss" accel="2.6" decel="4.5" sigma="0.5"/>
    +</routes>
    +
    + +

    Available vType Attributes#

    +

    These values have the following meanings:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDefaultDescription
    idid (string)-The name of the vehicle type
    accelfloat2.6The acceleration ability of vehicles of this type (in m/s^2)
    decelfloat4.5The deceleration ability of vehicles of this type (in m/s^2)
    apparentDecelfloat==decelThe 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.
    emergencyDecelfloat==decelThe maximal physically possible deceleration for the vehicle (in m/s^2).
    sigmafloat0.5Car-following model parameter, see below
    taufloat1.0Car-following model parameter, see below
    lengthfloat5.0The vehicle's netto-length (length) (in m)
    minGapfloat2.5Empty space after leader [m]
    maxSpeedfloat55.55 (200 km/h) for vehicles, 1.39 (5 km/h) for pedestriansThe vehicle's maximum velocity (in m/s)
    speedFactorfloat1.0The vehicles expected multiplicator for lane speed limits
    speedDevfloat0.1The deviation of the speedFactor; see below for details (some vClasses use a different default)
    colorRGB-color"1,1,0" (yellow)This vehicle type's color
    vClassclass (enum)"passenger"An abstract vehicle class (see below). By default vehicles represent regular passenger cars.
    emissionClassemission class (enum)"PC_G_EU4"An emission class (see below). By default a gasoline passenger car conforming to emission standard EURO 4 is used.
    guiShapeshape (enum)"unknown"a vehicle shape for drawing. By default a standard passenger car body is drawn.
    widthfloat1.8The vehicle's width [m] (used only for visualization with the default model, affects sublane model)
    heightfloat1.5The vehicle's height [m]
    collisionMinGapFactorfloatdepends on carFollowModel (1.0 for most models)The minimum fraction of minGap that must be maintained to the leader vehicle to avoid a collision event
    imgFilefilename (string)""Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)
    osgFilefilename (string)""Object file for rendering with OpenSceneGraph (any of the file types supported by the available OSG-plugins)
    laneChangeModellane changing model name (string)'LC2013'The model used for changing lanes
    carFollowModelcar following model name (string)'Krauss'The model used for car following
    personCapacityint4The number of persons (excluding an autonomous driver) the vehicle can transport.
    containerCapacityint0The number of containers the vehicle can transport.
    boardingDurationfloat0.5The time required by a person to board the vehicle.
    loadingDurationfloat90.0The time required to load a container onto the vehicle.
    latAlignmentstringcenterThe preferred lateral alignment when using the sublane-model. One of (left, right, center, compact, nice, arbitrary).
    minGapLatfloat0.6The desired minimum lateral gap when using the sublane-model
    maxSpeedLatfloat1.0The maximum lateral speed when using the sublane-model
    actionStepLengthfloatglobal 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.
    +

    Besides values which describe the vehicle's car-following properties, +one can find definitions of the assigned vehicles' shapes, emissions, +and assignment to abstract vehicle classes. These concepts will be +described in the following. Also, you may find further descriptions of +implemented car-following models in the subsection #Car-Following Models.

    +

    Speed Distributions#

    +

    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)

    +
    +

    Vehicle class specific defaults#

    +

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

    +
      +
    • passenger (default vClass): 0.1
    • +
    • pedestrian: 0.1
    • +
    • bicycle: 0.1
    • +
    • truck, trailer, coach, delivery, taxi: 0.05
    • +
    • tram, rail_urban, rail, rail_electric, rail_fast: 0
    • +
    • emergency: 0
    • +
    • everything else: 0.1
    • +
    +

    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. Seeting 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".

    +

    Additional remarks on speed distributions#

    +
    +

    Note

    +

    When used for pedestrians, the speedFactor attribute is applied directly to the maximum speed of the vType since speed limits are not applicable to pedestrians

    +
    +
    +

    Note

    +

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

    +
    +

    Vehicle Length#

    +

    Due to the work on car following models, we decided to use two values +for vehicle length. The length-attribute +describes the length of the vehicle itself. Additionally, the +minGap-attribute describes the offset to the +leading vehicle when standing in a jam.

    +

    This is illustrated in the following image:

    +

    length_vs_minGap.svg

    +

    Within the simulation, each vehicle needs - when ignoring the safe gap - +length+minGap. +But only length of the road should be marked +as being occupied.

    +

    Abstract Vehicle Class#

    +

    A SUMO vehicle may be assigned to an "abstract vehicle class", defined +by using the attribute vClass. These classes +are used in lane definitions and allow/disallow the usage of lanes for +certain vehicle types. One may think of having a road with three lanes, +where the rightmost may only be used by "taxis" or "buses". The default +vehicle class is passenger (denoting normal passenger cars).

    +
    +

    Caution

    +

    Routing or insertion may fail due to a mismatch between a vehicles vClass and the road permissions. This can be diagnosed in SUMO-GUI buy highlighting edges according to their permissions.

    +
    +

    The following vehicle classes exist:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    vClassbitmask bitcomment
    ignoring- (all bits set to 0)may drive on all lanes regardless of set permissions.
    private0
    emergency1
    authority2
    army3
    vip4
    pedestrian5lanes which only allow this class are considered to be 'sidewalks' in NETCONVERT
    passenger6This is the default vehicle class and denotes regular passenger traffic
    hov7High-occupancy vehicle
    taxi8
    bus9urban line traffic
    coach10overland transport
    delivery11Allowed on service roads that are not meant for public traffic
    truck12
    trailer13truck with trailer
    motorcycle14
    moped15motorized 2-wheeler which may not drive on motorways
    bicycle16
    evehicle17future mobility concepts such as electric vehicles which may get special access rights
    tram18
    rail_urban19heavier than 'tram' but distinct from 'rail'. Encompasses Light Rail and S-Bahn
    rail20heavy rail
    rail_electric21heavy rail vehicle that may only drive on electrified tracks
    rail_fast22High-speed-rail
    ship23basic class for navigating waterways
    custom124reserved for user-defined semantics
    custom225reserved for user-defined semantics
    +

    These values are a "best guess" of somehow meaningful values, surely +worth to be discussed. Though, in parts, they represent classes found in +imported formats. They are "abstract" in the means that they are just +names only, one could build a .5m long bus.

    +
    +

    Note

    +

    vClass values are mainly used for determining access restrictions for lanes and edges. Since version 0.21.0 they will also affect the defaults of some other vType parameters. These defaults are documented at Vehicle_Type_Parameter_Defaults.

    +
    +

    The following vehicle deprecated classes exist for maintaining backward +compatibility:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    deprecated vClassreplacement
    public_emergencydeprecated. use 'emergency'
    public_authoritydeprecated, use 'authority'
    public_armydeprecated, use 'army'
    public_transportdeprecated, use 'bus'
    transportdeprecated, use 'truck'
    lightraildeprecated, use 'tram'
    cityraildeprecated, use 'rail_urban'
    rail_slowdeprecated, use 'rail'
    +

    Vehicle Emission Classes#

    +

    The emission class represents a certain emission class. It is defined +using the emissionClass attribute. Possible +values are given in Models/Emissions and +its subsections.

    +

    Visualization#

    +

    For a nicer visualization of the traffic, the appearance of a vehicle +type's vehicles may be changed by assigning them a certain shape using +the guiShape attribute. These shapes are +used when setting the drawing mode for vehicles to simple shapes. +The following shapes are known:

    +
      +
    • "pedestrian"
    • +
    • "bicycle"
    • +
    • "motorcycle"
    • +
    • "passenger"
    • +
    • "passenger/sedan"
    • +
    • "passenger/hatchback"
    • +
    • "passenger/wagon"
    • +
    • "passenger/van"
    • +
    • "delivery"
    • +
    • "truck"
    • +
    • "truck/semitrailer"
    • +
    • "truck/trailer"
    • +
    • "bus"
    • +
    • "bus/city"
    • +
    • "bus/flexible" (8.25)
    • +
    • "bus/overland" (8.25)
    • +
    • "rail" (24.5)
    • +
    • "rail/light" (16.85)
    • +
    • "rail/city" (5.71)
    • +
    • "rail/slow" (9.44)
    • +
    • "rail/fast" (24.775)
    • +
    • "rail/cargo" (13.86)
    • +
    • "evehicle"
    • +
    • "ship"
    • +
    +

    Some of these classes are drawn as a sequence of carriages. The length +of a single carriage is indicated in parentheses after the type. For +these types, the length of the vehicleType is used as the overall length +of the train (all carriages combined). For example, a vehicle with shape +rail/cargo and length 70m will have 5 +carriages. The number of carriages will always be a whole number and no +carriage will be shorter than the length given in brackets but may be +longer to meet the length requirements of the whole vehicle. When +drawing vehicles with raster images, the image will be repeated for each +carriage.

    +

    In addition, one can determine the width of the vehicle using the +attribute width. When using shapes, one +should consider that different vehicle classes (passenger vehicles or +buses) have different lengths. Passenger vehicles with more than 10m +length look quite odd, buses with 2m length, too.

    +
    +

    Caution

    +

    Not all of these named shapes are implemented.

    +
    +

    Further parameters can be used to achieve visualization of individual rail carriages

    +
    <vType id="rail">
    +    <param key="carriageLength" value="20"/>
    +    <param key="carriageGap" value="1"/>
    +    <param key="locomotiveLength" value="25"/>   
    +</vType>
    +
    + +

    Car-Following Models#

    +

    The car-following models currently implemented in SUMO are given in the +following table.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Element Name (deprecated)Attribute Value (when declaring as attribute)Description
    carFollowing-KraussKraussThe Krauß-model with some modifications which is the default model used in SUMO
    carFollowing-KraussOrig1KraussOrig1The original Krauß-model
    carFollowing-PWagner2009PWagner2009A model by Peter Wagner, using Todosiev's action points
    carFollowing-BKernerBKernerA model by Boris Kerner

    Caution: currently under work
    carFollowing-IDMIDMThe Intelligent Driver Model by Martin Treiber

    Caution: Default parameters result in very conservative lane changing gap acceptance
    carFollowing-IDMMIDMMVariant of IDMM

    Caution: lacking documentation
    carFollowing-KraussPSKraussPSthe default Krauss model with consideration of road slope
    carFollowing-KraussABKraussABthe default Krauss model with bounded acceleration (only relevant when using PHEM classes)
    carFollowing-SmartSKSmartSKVariant of the default Krauss model

    Caution: lacking documentation
    carFollowing-WiedemannWiedemannCar following model by Wiedemann (2-Parameters)
    carFollowing-W99W99Car following model by Wiedemann, 10-Parameter version
    carFollowing-Daniel1Daniel1Car following model by Daniel Krajzewicz

    Caution: lacking documentation
    carFollowing-ACCACCCar following model by Milanés V. and Shladover S.E.
    carFollowing-CACCCACCCar following model by Milanés V. and Shladover S.E.
    carFollowing-RailRailModel for various train types
    +

    Car-Following Model Parameters#

    +

    Mostly, each model uses its own set of parameters. The following table +lists which parameter are used by which model(s). Details on car-following models and their parameters can be found here.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDefaultRangeDescriptionModels
    minGapvClass-specific>= 0Minimum Gap when standing (m)all models
    accelvClass-specific>= 0The acceleration ability of vehicles of this type (in m/s^2)Krauss, SKOrig, PW2009, Kerner, IDM, ACC, CACC
    decelvClass-specific>= 0The deceleration ability of vehicles of this type (in m/s^2)Krauss, SKOrig, PW2009, Kerner, IDM, ACC, CACC
    emergencyDecelvClass-specific>= decelThe maximum deceleration ability of vehicles of this type in case of emergency (in m/s^2)Krauss, SKOrig, PW2009, Kerner, IDM, ACC, CACC
    sigma0.5[0,1]The driver imperfection (0 denotes perfect drivingKrauss, SKOrig, PW2009, Kerner, IDM, ACC, CACC
    tau1>= 0The driver's desired (minimum) time headway. Exact interpretation varies by model. For the default model Krauss this is based on the net space between leader back and follower front). For limitations, see Car-Following-Models#tau).all Models
    kKerner
    phiKerner
    delta4acceleration exponentIDM
    stepping0.25>= 0the internal step length (in s) when computing follow speedIDM
    adaptFactor1.8>= 0the factor for taking into account past level of serviceIDMM
    adaptTime600>= 0the time interval (in s) for relaxing past level of serviceIDMM
    securitydesire for securityWiedemann
    estimationaccuracy of situation estimationWiedemann
    speedControlGainThe control gain determining the rate of speed deviation (Speed control mode)ACC
    gapClosingControlGainSpeedThe control gain determining the rate of speed deviation (Gap closing control mode)ACC
    gapClosingControlGainSpaceThe control gain determining the rate of positioning deviation (Gap closing control mode)ACC
    gapControlGainSpeedThe control gain determining the rate of speed deviation (Gap control mode)ACC
    gapControlGainSpaceThe control gain determining the rate of positioning deviation (Gap control mode)ACC
    collisionAvoidanceGainSpeedThe control gain determining the rate of speed deviation (Collision avoidance mode)ACC
    collisionAvoidanceGainSpaceThe control gain determining the rate of positioning deviation (Collision avoidance mode)ACC
    speedControlGainCACCThe control gain determining the rate of speed deviation (Speed control mode)CACC
    gapClosingControlGainGapThe control gain determining the rate of positioning deviation (Gap closing control mode)CACC
    gapClosingControlGainGapDotThe control gain determining the rate of the positioning deviation derivative (Gap closing control mode)CACC
    gapControlGainGapThe control gain determining the rate of positioning deviation (Gap control mode)CACC
    gapControlGainGapDotThe control gain determining the rate of the positioning deviation derivative (Gap control mode)CACC
    collisionAvoidanceGainGapThe control gain determining the rate of positioning deviation (Collision avoidance mode)CACC
    collisionAvoidanceGainGapDotThe control gain determining the rate of the positioning deviation derivative (Collision avoidance mode)CACC
    CC1Spacing Time - sW99
    CC2Following Variation - mW99
    CC3Threshold for Entering "Following" - sW99
    CC4Negative "Following" Threshold - m/sW99
    CC5Positive "Following" Threshold - m/sW99
    CC6Speed Dependency of Oscillation - 10^-4 rad/sW99
    CC7Oscillation Acceleration - m/s^2W99
    CC8Standstill Acceleration - m/s^2W99
    CC9Acceleration at 80km/h - m/s^2W99
    trainTypestring id for pre-defined train typeRail
    +

    To select a car following model the following syntax should be used:

    +
    <vType id="idmAlternative" length="5" minGap="2" carFollowModel="IDM" tau="1.0" .../>
    +
    + +

    Default Krauss Model Description#

    +

    The default model is a modification of the model defined by Stefan Krauß +in Microscopic Modeling of Traffic Flow: Investigation of Collision Free Vehicle Dynamics. The +implemented model follows the same idea as that of Krauß, namely: Let +vehicles drive as fast as possibly while maintaining perfect safety +(always being able to avoid a collision if the leader starts braking +within leader and follower maximum acceleration bounds). The implemented +model as in <SUMO_HOME>/src/microsim/cfmodels/MSCFModel_Krauss.cpp has the following differences:

    +
      +
    • Different deceleration capabilities among the vehicles are handled + without violating safety (the original model allowed for collisions + in this case)
    • +
    • The formula for safe velocity was adapted to maintain safety when + using the Euler-position update rule. This was done by + discretizing some of the continuous terms. The original model was + defined for the Ballistic-position updated rule and would produce + collisions when using Euler. See also + Simulation/Basic_Definition#Defining_the_Integration_Method.
    • +
    +

    Lane-Changing Models#

    +

    The lane-changing models currently implemented in SUMO are given in the +following table.

    + + + + + + + + + + + + + + + + + + + + + +
    Attribute ValueDescription
    LC2013The default car following model, developed by Jakob Erdmann based on DK2008 (see SUMO’s Lane-Changing Model). This is the default model.
    SL2015Lane-changing model for sublane-simulation (used by default when setting option --lateral-resolution <FLOAT>). This model can only be used with the sublane-extension.

    Caution: This model may technically be used without activating sublane-simulation but this usage has not been fully tested and may not work as expected.
    DK2008The original lane-changing model of sumo until version 0.18.0, developed by Daniel Krajzewicz (see Traffic Simulation with SUMO – Simulation of Urban Mobility).
    +

    Mostly, each model uses its own set of parameters. The following table +lists which parameter are used by which model(s).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeDescriptionModels
    lcStrategicThe eagerness for performing strategic lane changing. Higher values result in earlier lane-changing. default: 1.0, range [0-inf[LC2013, SL2015
    lcCooperativeThe willingness for performing cooperative lane changing. Lower values result in reduced cooperation. default: 1.0, range [0-1]LC2013, SL2015
    lcSpeedGainThe eagerness for performing lane changing to gain speed. Higher values result in more lane-changing. default: 1.0, range [0-inf[LC2013, SL2015
    lcKeepRightThe eagerness for following the obligation to keep right. Higher values result in earlier lane-changing. default: 1.0, range [0-inf[LC2013, SL2015
    lcOvertakeRightThe probability for violating rules gainst overtaking on the right default: 0, range [0-1[LC2013
    lcOppositeThe eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing. default: 1.0, range [0-inf[LC2013
    lcLookaheadLeftFactor 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
    lcSpeedGainRightFactor 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
    lcSpeedGainLookaheadLookahead time in seconds for anticipating slow down. default: 0, range ]0-inf[LC2013, SL2015
    lcCooperativeRoundaboutFactor that increases willingness to move to the inside lane in a multi-lane roundabout. default: lcCooperative, range ]0-1[LC2013, SL2015
    lcCooperativeSpeedFactor for cooperative speed adjustments. default: lcCooperative, range ]0-1[LC2013, SL2015
    lcSublaneThe 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
    lcPushyWillingness to encroach laterally on other drivers. ''default: 0, range 0 to 1SL2015
    lcPushyGapMinimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy). ''default: minGapLat, range 0 to minGapLatSL2015
    lcAssertiveWillingness to accept lower front and rear gaps on the target lane. The required gap is divided by this value. ''default: 1, range: positive realsLC2013,SL2015
    lcImpatiencedynamic 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
    lcTimeToImpatienceTime to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.. default: infinity (disables impatience growth)SL2015
    lcAccelLatmaximum lateral acceleration per second. default: 1.0SL2015
    lcTurnAlignmentDistanceDistance 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
    lcMaxSpeedLatStandingUpper bound on lateral speed when standing. default: maxSpeedLat (i.e., disabled)LC2013, SL2015
    lcMaxSpeedLatFactorUpper bound on lateral speed while moving computed as lcMaxSpeedLatStanding + lcMaxSpeedLatFactor * getSpeed(). default: 1.0LC2013, SL2015
    lcLaneDisciplineReluctance to perform speedGain-changes that would place the vehicle across a lane boundary. default: 0.0SL2015
    lcSigmaLateral positioning-imperfection. default: 0.0LC2013, SL2015
    +

    The parameters are set within the <vType>:

    +
    <vType id="myType" lcStrategic="0.5" lcCooperative="0.0"/>
    +
    + +

    Junction Model Parameters#

    +

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

    +
    +

    Note

    +

    These parameters are not available in version 0.30.0 and older

    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeValue TypeDefaultDescription
    jmCrossingGapfloat >= 0 (m)10Minimum distance to pedestrians that are walking towards the conflict point with the ego vehicle. If the pedestrians are further away the vehicle may drive across the pedestrian crossing.
    jmIgnoreKeepClearTimefloat (s)-1The accumulated waiting time (see Option --waiting-time-memory) after which a vehicle will drive onto an intersection even though this might cause jamming. For negative values, the vehicle will always try to keep the junction clear.
    jmDriveAfterRedTimefloat (s)-1This value causes vehicles to violate a red light if the duration of the red phase is lower than the given threshold. When set to 0, vehicles will always drive at yellow but will try to brake at red. If this behavior causes a vehicle to drive so fast that stopping is not possible any more it will not attempt to stop. This value also applies to the default pedestrian model.
    jmDriveAfterYellowTimefloat (s)-1This value causes vehicles to violate a yellow light if the duration of the yellow phase is lower than the given threshold. Vehicles that are too fast to brake always drive at yellow..
    jmDriveRedSpeedfloat (m/s)maxSpeedThis value causes vehicles affected by jmDriveAfterRedTime to slow down when violating a red light. The given speed will not be exceeded when entering the intersection.
    jmIgnoreFoeProbfloat0This value causes vehicles to ignore foe vehicles that have right-of-way with the given probability. The check is performed anew every simulation step. (range [0,1]).
    jmIgnoreFoeSpeedfloat (m/s)0This value is used in conjunction with jmIgnoreFoeProb. Only vehicles with a speed below or equal to the given value may be ignored.
    jmSigmaMinorfloat, scaling factor (like sigma)sigmaThis value configures driving imperfection (dawdling) while passing a minor link (ahead of the intersection after having comitted to drive and while still on the intersection).
    jmTimegapMinorfloat s1This value defines the minimum time gap when passing ahead of a prioritized vehicle.
    impatiencefloat or 'off'0.0Willingess of drivers to impede vehicles with higher priority. See below for semantics.
    +

    The parameters are set within the <vType>:

    +
    <vType id="ambulance" jmDriveAfterRedTime="300" jmDriveAfterRedSpeed="5.56"/>
    +
    + +

    Impatience#

    +

    The impatience of a driver is value between 0 and 1 that grows whenever +the driver has to stop unintentionally (i.e. due to a jam or waiting at +an intersection). The impatience value is computed as

    +
    MAX(0, MIN(1.0, baseImpatience + waitingTime / timeToMaxImpatience))
    +
    + +

    Where baseImpatience is configured by setting the vType-attribute +impatience and timeToMaxImpatience is set using the option --time-to-impatience (default +300s). Setting this option to 0 disables impatience growth. The value of baseImpatience may be negative to slow the growth of +the dynamically computed impatience. It may also be defined with the +value off to prevent drivers from becoming impatient.

    +

    The impatience value is used to represent a drivers willingness to +impede vehicles with higher priority. At a value of 1 or above, the +driver will use any gap that is safe in the sense of +collision-avoidance even if it means that another vehicle has to brake +as hard as it can. At a value of 0, the driver will only perform +maneuvers that do not force other vehicles to slow down. Intermediate +values interpolate smoothly between these extremes.

    +

    Default Vehicle Type#

    +

    If the type attribute of a vehicle is not +defined it defaults to "DEFAULT_VEHTYPE". +By defining a vehicle type with this id (<vType id="DEFAULT_VEHTYPE" ..../>) the default parameters for +vehicles without an explicititly defined type can be changed. The change +of the default vehicle type needs to occur before any reference to the +type was made, so basically before any vehicle or vehicle type was +defined. So it should always be at the top of the very first route file.

    +

    Route and vehicle type distributions#

    +

    Instead of defining routes and vTypes explicitly for a vehicle +SUMO can choose them at runtime from a given +distribution. In order to use this feature just define distributions as +following:

    +

    Vehicle Type Distributions#

    +
    <routes>
    +    <vTypeDistribution id="typedist1">
    +        <vType id="type1" accel="0.8" length="5" maxSpeed="70" probability="0.9"/>
    +        <vType id="type2" accel="1.8" length="15" maxSpeed="50" probability="0.1"/>
    +    </vTypeDistribution>
    +</routes>
    +
    + +
    +

    Note

    +

    The python tool createVehTypeDistributions.py can be used to generate large distributions that vary multiple vType parameters independently of each other.

    +
    +

    Using existing types#

    +
    <routes>
    +    <vType id="type1" accel="0.8" length="5" maxSpeed="70" probability="0.9"/>
    +    <vType id="type2" accel="1.8" length="15" maxSpeed="50" probability="0.1"/>
    +    <vTypeDistribution id="typedist1" vTypes="type1 type2"/>
    +</routes>
    +
    + +

    Route Distributions#

    +
    <routes>
    +    <routeDistribution id="routedist1">
    +        <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>
    +</routes>
    +
    + +

    A distribution has only an id as (mandatory) attribute and needs a +probability attribute for each of its child elements. The sum of the +probability values needs not to be 1, they are scaled accordingly. Note, +that probability defaults to 1.00 when not specified. At the moment +the id for the children is mandatory, this is likely to change in future +versions.

    +

    A distribution can be used just as using individual types and routes:

    +
    <routes>
    +    <vehicle id="0" type="typedist1" route="routedist1" depart="0" color="1,0,0"/>
    +</routes>
    +
    + +
    +

    Caution

    +

    When using DUAROUTER with input files containing distributions, the output files will contain a fixed route and type for each vehicle and the distributions will be gone. This is to ensure that the each vehicles route will fit its sampled vClass when using the input files with SUMO

    +
    +

    Stops#

    +

    Vehicles may be forced to stop for a defined time span or wait for +persons by using the stop element either as part of a route or a vehicle +definition as following:

    +
    <routes>
    +    <route id="route0" edges="beg middle end rend">
    +        <stop lane="middle_0" endPos="50" duration="20"/>
    +    </route>
    +    <vehicle id="v0" route="route0" depart="0">
    +        <stop lane="end_0" endPos="10" until="50"/>
    +    </vehicle>
    +</routes>
    +
    + +

    The resulting vehicle will stop twice, once at lane middle_0 because of +the stop defined in its route and the second time because of the stop +defined in the vehicle itself. The first stop will last 20 seconds the +second one until simulation second 50. For a detailed list of attributes +to stops see below. For a description on how to use them to simulate +public transport see Simulation/Public Transport.

    +

    Stops can be childs of vehicles, routes, persons or containers.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AttributeTypeRangeDefaultRemark
    busStopstringvalid busStop ids-if given, containerStop, chargingStation, edge, lane, startPos and endPos are not allowed
    containerStopstringvalid containerStop ids-if given, busStop, chargingStation, edge, lane, startPos and endPos are not allowed
    chargingStationstringvalid chargingStation ids-if given, busStop, containerStop, edge, lane, startPos and endPos are not allowed
    lanestringlane id-the lane id takes the form <edge_id>_<lane_index>. the edge has to be part of the corresponding route
    endPosfloat(m)-lane.length < x < lane.length (negative values count backwards from the end of the lane)lane.length
    startPosfloat(m)-lane.length < x < lane.length (negative values count backwards from the end of the lane)endPos-0.2mthere must be a difference of more than 0.1m between startPos and endPos
    friendlyPosbooltrue,falsefalsewhether invalid stop positions should be corrected automatically
    durationfloat(s)≥0-minimum duration for stopping
    untilfloat(s)≥0-the time step at which the route continues
    extensionfloat(s)≥0-the maximum time by which to extend the stop duration due to boarding persons and when waiting for expected persons / triggered stopping
    indexint, "end", "fit"0≤index≤number of stops in the route"end"where to insert the stop in the vehicle's list of stops
    triggeredbooltrue,falsefalsewhether a person may end the stop
    expectedstringlist of person IDslist of persons that must board the vehicle before it may continue (only takes effect for triggered stops)
    expectedContainersstringlist of container IDslist of containers that must be loaded onto the vehicle before it may continue (only takes effect for triggered stops)
    parkingbooltrue,falsevalue of triggeredwhether the vehicle stops on the road or beside
    actTypestringarbitrary'waiting'activity displayed for stopped person in GUI and output files (only applies to person simulation)
    tripIdstringarbitraryparameter to be applied to the vehicle to track the trip id within a cyclical public transport route
    linestringarbitrarynew line attribute to be set on the vehicle when reaching this stop (for cyclical public transport route)
    speedfloatpositive-speed to be kept while driving between startPos and endPos
    +
      +
    • If "duration" and "until" are given, the vehicle will stop for at least "duration" seconds.
    • +
    • If "duration" is 0 the vehicle will decelerate to reach velocity 0 and then start to accelerate again.
    • +
    • If "until" is given and "duration" is not and the vehicle arrives at the stop at or after the time step defined by "until" it will decelerate to speed 0 and then accelerate again.
    • +
    • If persons board the vehicle, the stop is extended by the "boardingDuration" of the vehicle or until the "personCapacity" is reached. (or "loadingDuration" and "containerCapacity" for containers).
    • +
    • If until is defined in the context of a repeated vehicle insertion (flow) it will be incremented by the difference of vehicle creation time and "begin" of the flow.
    • +
    • If neither "duration" nor "until" are given, "triggered" defaults to true. If "triggered" is set to false explicitly the vehicle will stop forever.
    • +
    • if "duration" or "until" are given along with "triggered", then the vehicle will stop until the given duration/until is reached and a person has boarded
    • +
    • If "parking" is set to true. The vehicle stops besides the road without blocking other vehicles.
    • +
    +
    +

    Caution

    +

    If triggered is true then parking will also be set to true by default. If you then set parking to false you may create deadlocks which prevent the simulation from terminating

    +
    +
    +

    Note

    +

    Bus stops must have a length of at least 10

    +
    +

    startPos and endPos#

    +
      +
    • by default vehicles will try to stop and the given endPos
    • +
    • if the vehicle comes to a halt earlier (i.e. due to a jam) then the stop counts as reached if the vehicle front is between startPos and endPos
    • +
    • if the vehicle picks up a person or container, it can do so as long as the person is between startPos and endPos
    • +
    • if the stop uses attribute 'speed', than that speed will be maintained between startPos and endPos
    • +
    +

    Colors#

    +

    A color is defined as red,green,blue or red,green,blue,alpha either +in a vehicle, route or vType.

    +
    <route id="r0" color="0,255,255"/>
    +<type id="t0" color="0,0,255"/>
    +<vehicle id="v0" color="255,0,0,0"/>
    +
    + +

    In the default visualization settings the vehicle color will be used if +define, otherwise the type and finally the route color. These settings can be changed.

    +

    By default color components should be given as integers in the range of +(0,255) but other definitions are also supported:

    +
    color="0.5, 0.5, 1.0"
    +color="#FF0000"
    +color="red"
    +
    + +

    The transparency value (alpha) only takes effect when also using the vType +attribute imgFile.

    +

    Devices#

    +

    Vehicle devices are used to model and configure different aspects such +as output (device.fcd) or behavior (device.rerouting).

    +

    The following device names are supported and can be used for the +placeholder <DEVICENAME> below

    + +

    Automatic assignment#

    +

    Some devices are assigned automatically. Every <trip> that is loaded into the +simulation is automatically equipped with a rerouting device to +perform the initial route computation.

    +

    Other devices such as fcd are assigned automatically when the option --fcd-output +is set.

    +

    Assignment by global options#

    +

    Devices can be configured globally for all vehicles in the simulation by +setting the option --device.<DEVICENAME>.probability (i.e.) --device.fcd.probability 0.25 This will equip +about a quarter of the vehicles with an fcd device (each vehicle +determines this randomly with 25% probability) To make the assignment +exact the additional option --device.<DEVICENAME>.deterministic can be set Another option is to pass the +list of vehicle ids that shall be equipped using the option --device.<DEVICENAME>.explicit <ID1,ID2,...IDk>.

    +
    +

    Note

    +

    These options take precedence over automatic assignment by output-option.

    +
    +

    Assignment by generic parameters#

    +

    Another option for assigning devices for vehicle types or individual +vehicles is by using generic parameters. This is done by +defining them for the vehicle or the vehicle type in the following way:

    +
    <routes>
    +    <vehicle id="v0" route="route0" depart="0">
    +        <param key="has.<DEVICENAME>.device" value="true"/>
    +    </vehicle>
    +
    +    <vType id="t1">
    +        <param key="has.<DEVICENAME>.device" value="true"/>
    +    </vType>
    +
    +    <vehicle id="v1" route="route0" depart="0" type="t1"/>
    +</routes>
    +
    + +
    +

    Note

    +

    The <param> of a vehicle has precedence over the <param> of the vehicle's type. Both have precedence over the assignment by options.

    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 16 April 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Activity-based_Demand_Generation.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Activity-based_Demand_Generation.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Activity-based_Demand_Generation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Activity-based_Demand_Generation.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,1052 @@ + + + + + + + + + + + + + + + + + + + Demand/Activity-based Demand Generation - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Activity-based Demand Generation
    + + + +

    ACTIVITYGEN generates demand from a +description of the population in the net. To do so, it uses a simple +activity-based traffic model. It supports the activities work, school, +and free time and the conveyances walking, bike, car, and bus. Cars may +have their start or stop location outside the map.

    +

    Typical Command Line#

    +
    activitygen --net-file <NET> --stat-file <STATISTICS> --output-file <TRIPS> --random
    +
    + +

    <NET> is a map in form of a SUMO net file, <STATISTICS> contains the +description of the population (described below), and <TRIPS> is the +generated SUMO routes file (the demand).

    +

    You can give ActivityGen a first try with the following example.

    +

    Example#

    +

    activitygen-example-net.png While activitygen has been developed +mainly to generate traffic demand for larger networks, this example +features the small network shown in the image on the right. Download the +files <SUMO_HOME>/tests/activitygen/demand_generation/activitygen-example.net.xml and <SUMO_HOME>/tests/activitygen/demand_generation/activitygen-example.stat.xml to follow this example.

    +

    To run this example, use the following commands:

    +
    activitygen --net-file activitygen-example.net.xml \
    +            --stat-file activitygen-example.stat.xml \
    +            --output-file activitygen-example.trips.rou.xml \
    +            --random
    +
    +duarouter --net-file activitygen-example.net.xml \
    +          --route-files activitygen-example.trips.rou.xml \
    +          --output-file activitygen-example.rou.xml \
    +          --ignore-errors
    +
    +sumo --net-file activitygen-example.net.xml \
    +     --route-files activitygen-example.rou.xml
    +
    + +

    The first command generates the net file from the node and edge +description. The second command generates the routes file (the demand) +from a description of the population in the stat file. The generated +routes files does not contain the complete route information though, +instead it contains start edge and end edge (and optionally some vias, +so-called trips) only. This allows you to choose the router you want for +linking departure and destination edges.

    +

    When you run DUAROUTER as shown above, all +vehicles will pick the fastest route under the assumption of being alone +in the network. This may lead to unrealistic jamming and should be +remedied with a traffic assignment +method.

    +

    Finally, you can run a traffic simulation with the SUMO main executable. +You may also give the trip file directly to SUMO as well but this will +slow down the simulation considerably because all the routing is now +done ad hoc based on the current network status. The benefit from this +approach is better route choice since vehicles take the network state at +the time of their departure into account during routing (see +Demand/Automatic_Routing)

    +
    sumo --net-file activitygen-example.net.xml \
    +     --route-files activitygen-example.trips.rou.xml
    +
    + +

    The Statistics File#

    +

    General information#

    +

    First of all we need general information over the city.

    +
        <city>
    +        <general
    +            inhabitants="1000"
    +            households="500"
    +            childrenAgeLimit="18"
    +            retirementAgeLimit="65"
    +            carRate="0.58"
    +            unemploymentRate="0.05"
    +            footDistanceLimit="350"
    +            incomingTraffic="200"
    +            outgoingTraffic="50"
    +        />
    +    </city>
    +
    + +

    The meanings of all these attributes are described in the following +table:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    inhabitantsIntegerTotal number of inhabitants
    householdsIntegerTotal number of households (must be between 0.5 and 1 times the number of adults of the city)
    childrenAgeLimitIntegerAge under which people are children. This is the first year of adulthood
    retirementAgeLimitIntegerAge under which people can have children home and work
    carRateFloat[0;1]Probability for an adult to own a car
    unemploymentRateFloat[0;1]Probability for an adult in age of work to be unemployed
    footDistanceLimitFloatMaximum distance one would go by foot instead of another transportation mean.
    incomingTrafficIntegerNumber of people coming everyday into the city for they work
    outgoingTrafficInteger[0,inhabitants]Number of inhabitants working outside the city
    +

    Parameters#

    +

    These entries are different from the general information element in what +they describe. They depend much more of the special context or state of +the city (events, behaviour of the population...). They can also be +useful for optimization: the mean speed can be observed afterwards; all +values can be changed in order to meet validation criteria on the +traffic.

    +
        <city>
    +        <general ... />
    +        <parameters
    +            carPreference="0.50"
    +            meanTimePerKmInCity="360"
    +            freeTimeActivityRate="0.15"
    +            uniformRandomTraffic="0.20"
    +            departureVariation="120"
    +        />
    +    </city>
    +
    + +

    The meanings of all these attributes are described in the following +table:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    carPreferenceFloat[0;1]Probability that an adult prefers to take his car instead of a public transportation mean (when both available); default: 0.
    meanTimePerKmInCityInteger(sec)Estimation of the time needed to drive one kilometer (bird's eye) on the map; default: 360s.
    freeTimeActivityRateFloat[0;1]Probability that a given household, a given day, has a free time activity using a car; default: 0.15.
    uniformRandomTrafficFloat[0;0.999]Proportion of the random traffic demand in the whole traffic demand; default: 0.
    departureVariationFloat(sec)Variance of the normal distribution introduced for slight variations in departure time (human natural variation in relation to schedules); default: 0.
    +

    Population's Age Brackets#

    +

    In order to distribute the population among households and in the city +coherently, we need a precise age distribution of this population.

    +
        <city>
    +        <general ... />
    +        <parameters ... />
    +
    +        <population>
    +            <bracket beginAge="0" endAge"4" peopleNbr="1745" />
    +             ...
    +            <bracket beginAge="66" endAge"90" peopleNbr="978" />
    +        </population>
    +
    +    </city>
    +
    + +

    Follows the description of all bracket attributes.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    beginAgeIntegerBeginning age of the interval (incl.). If this is not the first bracket, this age is greater or equal to the previous bracket's ending age
    endAgeIntegerEnd age of the interval (excl.). This age is greater to the current bracket's Beginning age
    peopleNbrIntegerNumber of people in the interval age of the bracket ([beginAge,endAge)). This is an relative value, it will be normalized with the number of inhabitants of the city
    +

    Work Hours#

    +

    We need to specify the opening and closing hours of all city's work +positions.

    +
        <city>
    +        <general ... />
    +        <parameters ... />
    +        <population> <bracket ... /> ... </population>
    +
    +        <workHours>
    +            <opening hour="30600" proportion="0.30" />
    +             ...
    +            <closing hour="43200" proportion="0.20" />
    +             ...
    +        </workHours>
    +
    +    </city>
    +
    + +

    Here are descriptions of all attributes of opening and closing elements:

    + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    hourInteger(sec)Possible beginning or ending time of work.
    proportionFloatProportion of work positions having this time as a beginning (resp. end) hour. It's a relative value: the probability of occurrence is computed by normalizing all opening (resp. closing) proportion values by one.
    +

    Population and Work Position Distribution#

    +

    Now, we have to specify the density of people and work in each street of +the city. (by street I meant edges which are even more precise)

    +
        <city>
    +        <general ... />
    +        <parameters ... />
    +        <population> <bracket ... /> ... </population>
    +        <workHours> <opening ... /> ... <closing ... /> ... </workHours>
    +
    +        <streets>
    +            <street edge="abc123" population="2.5" workPosition="10.0" />
    +             ...
    +        </streets>
    +
    +    </city>
    +
    + +

    Here are the corresponding attribute descriptions:

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    edgeStringEdge's id
    populationFloatNumber of people per meter street. Relative value (normalized with the total number of inhabitants)
    workPositionFloatNumber of work positions per meter street. Relative value (normalized with the total number of city's work demand)
    +

    City Gates#

    +

    In order to generate incoming and outgoing traffic, we need to specify +gates to the city. Every gate will generate the same number of incoming +(resp. outgoing) cars (the total number divided by the number of gates).

    +
        <city>
    +        <general ... />
    +        <parameters ... />
    +        <population> <bracket ... /> ... </population>
    +        <workHours> <opening ... /> ... <closing ... /> ... </workHours>
    +        <streets> <street ... /> ... </streets>
    +
    +        <cityGates>
    +            <entrance edge="abc123" pos="243.67" incoming="1.5" outgoing="2.2"/>
    +            <entrance edge="abc234" pos="0.00" incoming="1.0" outgoing="0.5"/>
    +             ...
    +        </cityGates>
    +
    +    </city>
    +
    + +

    The corresponding attribute descriptions:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    edgeStringEdge's id
    posFloat (m)Exact position in the street (edge), in meters, from the beginning of the given edge (the maximum value is the length of the edge)
    incomingFloatProportion of the incoming vehicles, coming through this gate (relatively to the incoming values of the other gates)
    outgoingFloatProportion of the outgoing vehicles, leaving the city through this gate (relatively to the outgoing values of the other gates)
    +

    Schools#

    +

    Children don't go to work but to school. The particularity of schools is +that they are exactly positioned and receive many pupils every day.

    +
    <city>
    +    <general ... />
    +    <parameters ... />
    +    <population> <bracket ... /> ... </population>
    +    <workHours> <opening ... /> ... <closing ... /> ... </workHours>
    +    <streets> <street ... /> ... </streets>
    +    <cityGates> <entrance ... /> ... </cityGates>
    +
    +    <schools>
    +        <school edge="123abc" pos="23.0" beginAge="12" endAge="18" capacity="400" opening="32400" closing="64800" />
    +        ...
    +    </schools>
    +
    +</city>
    +
    + +

    The corresponding attribute descriptions:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    edgeStringEdge's id
    posFloat (m)Exact position in the street (edge), in meters, from the beginning of the given edge (the maximum value is the length of the edge)
    beginAgeIntegerAge of the youngest pupils of the school (lower bound, included in the bracket of acceptance)
    endAgeIntegerAge of children not accepted in the school any more (higher bound, excluded from the bracket of acceptance)
    capacityIntegerMaximum number of pupils accepted
    openingInteger (sec)Time of class beginning (school time)
    closingInteger (sec)Time of class ending (home time)
    +

    Bus Lines#

    +

    People have a public bus line system to their disposition. This public +transportation system is described by stations, different bus lines +having their corresponding station for both directions and schedules.

    +
        <city>
    +        <general ... />
    +        <parameters ... />
    +        <population> <bracket ... /> ... </population>
    +        <workHours> <opening ... /> ... <closing ... /> ... </workHours>
    +        <streets> <street ... /> ... </streets>
    +        <cityGates> <entrance ... /> ... </cityGates>
    +        <schools> <school ... /> ... </schools>
    +
    +        <busStations>
    +            <busStation id="1" edge="abc123" pos="456" />
    +            <busStation id="2" edge="123cba" pos="324" />
    +             ...
    +        </busStations>
    +
    +        <busLines>
    +            <busLine id="601" maxTripDuration="3000">
    +                <stations>
    +                    <station refId="1" />
    +                     ...
    +                </stations>
    +                <revStations>
    +                    <station refId="2" />
    +                     ...
    +                </revStations>
    +                <frequencies>
    +                    <frequency begin="10000" end="25000" rate="1500" />
    +                     ...
    +                </frequencies>
    +            </busLine>
    +        </busLines>
    +
    +    </city>
    +
    + +

    The corresponding attribute descriptions of all elements:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    idStringBus line's id
    maxTripDurationInteger (sec)Maximum time needed for a bus to do the end-to-end trip.
    refIdIntegerReference to the id of the chosen station (refers to a busStation object's id)
    beginInteger (sec)Time of the beginning of a new frequency
    endInteger (sec)End time of the frequency
    rateInteger (sec)Time between two buses, this is the inverse of the mathematical frequency. This bus rate is performed between the beginning and end values described above
    +

    Final Aspect#

    +

    Here is a complete example of a stat file:

    +
        <city>
    +        <general inhabitants="1000" households="500" childrenAgeLimit="19" retirementAgeLimit="66" carRate="0.58" unemploymentRate="0.05"
    +                     footDistanceLimit="250" incomingTraffic="200" outgoingTraffic="50" />
    +        <parameters carPreference="0.50" meanTimePerKmInCity="6" freeTimeActivityRate="0.15" uniformRandomTraffic="0.20" departureVariation="300" />
    +
    +        <population>
    +            <bracket beginAge="0" endAge="30" peopleNbr="30" />
    +            <bracket beginAge="30" endAge="60" peopleNbr="40" />
    +            <bracket beginAge="60" endAge="90" peopleNbr="30" />
    +        </population>
    +
    +        <workHours>
    +            <opening hour="30600" proportion="0.30" />
    +            <opening hour="32400" proportion="0.70" />
    +            <closing hour="43200" proportion="0.20" />
    +            <closing hour="63000" proportion="0.20" />
    +            <closing hour="64800" proportion="0.60" />
    +        </workHours>
    +
    +        <streets>
    +            <street edge="e01t11" population="10" workPosition="100" />
    +            <street edge="e11t12" population="10" workPosition="100" />
    +            <street edge="e12t13" population="10" workPosition="100" />
    +            <street edge="e13t14" population="10" workPosition="100" />
    +            <street edge="e11t21" population="10" workPosition="100" />
    +            <street edge="e12t22" population="10" workPosition="100" />
    +            <street edge="e13t23" population="10" workPosition="100" />
    +            <street edge="e14t24" population="10" workPosition="100" />
    +            <street edge="e21t22" population="10" workPosition="100" />
    +            <street edge="e22t23" population="10" workPosition="100" />
    +            <street edge="e23t24" population="10" workPosition="100" />
    +            <street edge="e21t31" population="10" workPosition="100" />
    +            <street edge="e22t32" population="100" workPosition="10" />
    +            <street edge="e23t33" population="100" workPosition="10" />
    +            <street edge="e24t34" population="100" workPosition="10" />
    +            <street edge="e31t32" population="100" workPosition="10" />
    +            <street edge="e32t33" population="100" workPosition="10" />
    +            <street edge="e33t34" population="100" workPosition="10" />
    +            <street edge="e31t41" population="100" workPosition="10" />
    +            <street edge="e32t42" population="100" workPosition="10" />
    +            <street edge="e33t43" population="100" workPosition="10" />
    +            <street edge="e34t44" population="100" workPosition="10" />
    +            <street edge="e41t42" population="100" workPosition="10" />
    +            <street edge="e42t43" population="100" workPosition="10" />
    +            <street edge="e43t44" population="100" workPosition="10" />
    +            <street edge="e44t51" population="100" workPosition="10" />
    +        </streets>
    +
    +        <cityGates>
    +            <entrance edge="e01t11" pos="1" incoming="0.5" outgoing="0.5" />
    +            <entrance edge="e44t51" pos="280" incoming="0.5" outgoing="0.5" />
    +        </cityGates>
    +
    +        <schools>
    +            <school edge="e11t12" pos="20" beginAge="0" endAge="6" capacity="200" opening="32400" closing="64800" />
    +            <school edge="e33t34" pos="100" beginAge="3" endAge="12" capacity="150" opening="30600" closing="64800" />
    +            <school edge="e41t42" pos="50" beginAge="10" endAge="20" capacity="300" opening="32400" closing="61200" />
    +        </schools>
    +
    +        <busStations>
    +            <busStation id="1" edge="e11t12" pos="10" />
    +            <busStation id="2" edge="e12t13" pos="10" />
    +            <busStation id="3" edge="e13t14" pos="10" />
    +            <busStation id="4" edge="e14t24" pos="10" />
    +            <busStation id="5" edge="e24t23" pos="10" />
    +            <busStation id="6" edge="e23t33" pos="10" />
    +            <busStation id="7" edge="e33t32" pos="10" />
    +            <busStation id="8" edge="e32t31" pos="10" />
    +            <busStation id="9" edge="e31t21" pos="10" />
    +            <busStation id="10" edge="e21t11" pos="10" />
    +
    +            <busStation id="101" edge="e12t11" pos="10" />
    +            <busStation id="102" edge="e13t12" pos="10" />
    +            <busStation id="103" edge="e14t13" pos="10" />
    +            <busStation id="104" edge="e24t14" pos="10" />
    +            <busStation id="105" edge="e23t24" pos="10" />
    +            <busStation id="106" edge="e33t23" pos="10" />
    +            <busStation id="107" edge="e32t33" pos="10" />
    +            <busStation id="108" edge="e31t32" pos="10" />
    +            <busStation id="109" edge="e21t31" pos="10" />
    +            <busStation id="110" edge="e11t21" pos="10" />
    +
    +            <busStation id="11" edge="e12t22" pos="10" />
    +            <busStation id="12" edge="e22t32" pos="10" />
    +            <busStation id="13" edge="e32t42" pos="10" />
    +            <busStation id="14" edge="e42t41" pos="10" />
    +            <busStation id="15" edge="e41t31" pos="10" />
    +
    +            <busStation id="111" edge="e22t12" pos="10" />
    +            <busStation id="112" edge="e32t22" pos="10" />
    +            <busStation id="113" edge="e42t32" pos="10" />
    +            <busStation id="114" edge="e41t42" pos="10" />
    +            <busStation id="115" edge="e31t41" pos="10" />
    +        </busStations>
    +
    +        <busLines>
    +            <busLine id="101" maxTripDuration="10">
    +                <stations>
    +                    <station refId="1" />
    +                    <station refId="3" />
    +                    <station refId="4" />
    +                    <station refId="5" />
    +                    <station refId="6" />
    +                    <station refId="7" />
    +                    <station refId="8" />
    +                    <station refId="9" />
    +                </stations>
    +                <revStations>
    +                    <station refId="109" />
    +                    <station refId="108" />
    +                    <station refId="107" />
    +                    <station refId="106" />
    +                    <station refId="105" />
    +                    <station refId="104" />
    +                    <station refId="103" />
    +                    <station refId="102" />
    +                </revStations>
    +                <frequencies>
    +                    <frequency begin="21600" end="36000" rate="300" />
    +                    <frequency begin="36000" end="57600" rate="1800" />
    +                    <frequency begin="57600" end="68400" rate="300" />
    +                    <frequency begin="68400" end="86399" rate="1800" />
    +                </frequencies>
    +            </busLine>
    +
    +            <busLine id="102" maxTripDuration="7">
    +                <stations>
    +                    <station refId="15" />
    +                    <station refId="9" />
    +                    <station refId="10" />
    +                    <station refId="1" />
    +                    <station refId="11" />
    +                    <station refId="12" />
    +                    <station refId="13" />
    +                    <station refId="14" />
    +                </stations>
    +                <revStations>
    +                    <station refId="114" />
    +                    <station refId="113" />
    +                    <station refId="112" />
    +                    <station refId="111" />
    +                    <station refId="101" />
    +                    <station refId="110" />
    +                    <station refId="109" />
    +                    <station refId="115" />
    +                </revStations>
    +                <frequencies>
    +                    <frequency begin="28800" end="32400" rate="600" />
    +                    <frequency begin="57600" end="64800" rate="600" />
    +                </frequencies>
    +            </busLine>
    +        </busLines>
    +
    +    </city>
    +
    + +

    Activities#

    +

    ActivityGen takes into account two groups of activities, which are +considered as most traffic-relevant: Work And School and Free +Time. The activities within each group follow the same statistical +rules.

    +

    Work and School Activities#

    +

    This aggregate of activities contains the following activities:

    +
      +
    1. Going to work for adults (not retired), and
    2. +
    3. Going to school for children.
    4. +
    +

    That implies trips from home to work and the return trip for the +drivers.

    +

    Free Time Activities#

    +

    This aggregate of activities contains the following activities:

    +
      +
    1. Going out during the day (for retired or unemployed people)
    2. +
    3. Going out in the evening (for all people who finished their work + activity not too late)
    4. +
    5. Going out late in the evening or in the night (for not retired + adults having no children)
    6. +
    +

    This activity is supposed to cover all car uses for:

    +
      +
    • Going out see friends
    • +
    • Doing sport
    • +
    • Visiting family
    • +
    • Party
    • +
    +

    Activity locations are randomized for this purpose.

    +

    Traffic which is not covered by Activitygen#

    +
      +
    • Through traffic from outside the city to outside the city
    • +
    • Business traffic (delivery service, logistics, ...)
    • +
    • Tourist traffic
    • +
    • Special event traffic
    • +
    +

    To some extend this can be mitigated by adding uniformRandomTraffic.

    +

    Transportation Means#

    +

    The population is distributed according to the statistics into +households located in streets. People are likely to use different means +of transportation in relation to their location, the availability of the +different means and their destination. Three kind of Means are used in +ActivityGen:

    +
      +
    • Feet or bike
    • +
    • Buses
    • +
    • Cars
    • +
    +

    +

    All of them have their own possibilities and availability +characteristics:

    +

    Feet or Bike#

    +

    Trips by foot are available only for very short distances. But in this +case, the person is very likely to go by foot. The bike isn't really +used (buses and cars are preferred), it is supposed to serve in cases +where none of the three means (Feet, buses and cars) are not available

    +

    Buses#

    +

    Bus stations are located in the city corresponding to the real bus line +network given in input (statistical data over the city). Someone enough +close to a bus station and whose destination is enough close to another +bus station is eligible for the public transportation means.

    +

    Cars#

    +

    Householders having one or more cars can drive (not children) or be +accompanied (escorted) by another adult who needs a car too. Children +can only be accompanied (to school for example). Some households have no +car, in this case they have to live enough close to a bus station. In +the case of having a destination far from any bus station, they can go +by foot or ride a bike. But this case doesn't generated any motorized +vehicle traffic.

    +

    Generated Vehicles#

    +
      +
    • carInX:Y is commuter traffic
    • +
    • randUniX is random traffic (X is a running index)
    • +
    • blXbY is bus line X bus number Y
    • +
    • hXcY is a car number Y from household X
    • +
    • hXcY:Z is repeated use of the same car (e.g. when simulating +multiple days) with Z as a running index over all cars
    • +
    +

    Limitations#

    +

    SUMO has a detailed model for individual multi-modal transport +itineraries. Since 0.26.0 multi-modal +routing with public and individual transport modes is supported as well. +However, ACTIVITYGEN does not make use of +these facilities. In ACTIVITYGEN

    +
      +
    • Buses are generated according to the bus schedule. People using +buses do not show up in the simulation.
    • +
    • According to some distance criteria between locations and bus +stations, fewer care trips are generated since people are assumed to +take the bus. Public transport travel times are not considered.-
    • +
    +

    Model Documentation#

    +

    ActivityGen was developed as a tool for the evaluation of trust +scenarios in VANETs. The work was part of the project Fidens: Trust +between Cooperative Systems featuring +trusted probabilistic knowledge processing in vehicular networks. For +further documentation on the internals of the model, refer to the source +code in <SUMO_HOME>/src/activitygen or ask the original +authors.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Automatic_Routing.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Automatic_Routing.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Automatic_Routing.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Automatic_Routing.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,423 @@ + + + + + + + + + + + + + + + + + + + Demand/Automatic Routing - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Automatic Routing
    + + + +

    Introduction#

    +

    Routing dynamically in the running simulation may be adequate in the +following situations:

    +
      +
    • there is not enough time / computing power to wait for the dynamic + user equilibrium
    • +
    • changes to the net occur while the simulation is running
    • +
    • vehicles need to adapt their route while running
    • +
    +

    In this case SUMO may be used directly for routing +with either routes or trip files (or a mix) as input.

    +

    This routing approach works by giving some or all vehicles the +capability to re-compute their route periodically. This routing takes +into account the current and recent state of traffic in the network and +thus adapts to jams and other changes in the network.

    +

    The options listed below allow configuring which of the vehicles shall +be equipped, how often rerouting decisions shall be made and how the +estimation of travel times is computed from current and recent +knowledge.

    +

    Options#

    +

    The options related to this routing are:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptiondefaultDescription
    --device.rerouting.probability <FLOAT>0The probability for a vehicle to have a routing device
    --device.rerouting.explicit <STRING>Assign a device to named vehicles
    --device.rerouting.deterministicfalseThe devices are set deterministic using a fraction of 1000 (with the defined probability)
    --device.rerouting.period <STRING>0The period with which the vehicle shall be rerouted
    --device.rerouting.pre-period <STRING>60The rerouting period before insertion/depart
    --device.rerouting.adaptation-interval <INT>1The interval for updating the edge weights.
    --device.rerouting.adaptation-weight <FLOAT>0.0 (disabled)The weight of prior edge weights for exponential averaging from [0, 1].
    --device.rerouting.adaptation-steps <INT>180The number of adaptation steps for averaging (enable for values > 0).
    --device.rerouting.with-tazfalseUse traffic assignment zones (TAZ/districts) as routing end points
    --device.rerouting.init-with-loaded-weightsfalseUse option --weight-files for initializing the edge weights at simulation start
    +

    Edge weights#

    +

    If the routing is enabled for any vehicles, the average travel times in +the net are collected for all edges. If a vehicle needs to be routed +(either because it gets inserted or because a repeated route choice was +enabled via the ".period" option) it chooses the fastest route to its +destination edge (or district) according to the present edge weights +(travel speeds and hence travel times). The update of the edge weights +does not simply overwrite the old value but is computed as a weighted +average as described below. Since updating the weights of all edges in +each simulation step means a major slowdown for the simulation this +interval may be altered using the ".adaptation-interval" option.

    +
    +

    Note

    +

    these weights are also used when using TraCI functions vehicle.rerouteTraveltime and vehicle.changeTarget if the routing mode was set to ROUTING_MODE_AGGREGATED using vehicle.setRoutingMode. Likewise, the function simulation.findRoute can be switched to using these weights by setting the argument routingMode=ROUTING_MODE_AGGREGATED.

    +
    +

    Adapting by exponential average#

    +

    By setting the option --device.rerouting.adaptation-weight <FLOAT> the travel speed of each edge is computed as

    +
    FLOAT * priorValue + (1 - FLOAT) * currentMeanSpeed
    +
    + +

    This averaging takes place with the period set by --device.rerouting.adaptation-interval.

    +

    Adapting by moving average#

    +

    By setting the option --device.rerouting.adaptation-steps <INT> the travel speed of each edge is computed as the +average of the INT latest meanSpeed values. This averaging takes place +with the period set by --device.rerouting.adaptation-interval.

    +
    +

    Note

    +

    speed values in a time interval going back as far as the multiple of adaptation-interval and adaptation-steps take part in the averaging.

    +
    +

    Investigating edge weights#

    +

    To understand the evolution of edge weights during the simulation it can +be helpful to look at the values in detail:

    + +

    Incomplete trips and flows#

    +

    All vehicles which are created using a trip as input (or a flow with +"from" and "to" attributes) get automatically routed at insertion +without the need to instantiate the device for them explicitly. Whenever +an error occurs on routing because no route can be found which includes +all mandatory edges ("from", "to", and all stop edges in the correct +order) and is connected (also respecting the vehicle class permissions) +this is a fatal error and stops th simulation. This can be switched off +by using --ignore-route-errors which will leave the route untouched in the error case. If the +vehicle did not have a route yet (because it was defined using a trip) +and cannot find one and --ignore-route-errors is used, it will not be inserted.

    +

    Alternatively to using attributes "from" and "to" it is also possible to +use "fromTaz" and "toTaz", if a district file is +loaded.

    +

    Alternative Declaration via Parameters#

    +

    Another way for defining the set of vehicles that are equipped with a +rerouting device is via generic +parameters.

    +

    TraCI#

    +

    The device can be accessed using the TraCI function +vehicle.getParameter and vehicle.setParameter:

    +

    getParameter

    +
      +
    • device.rerouting.period (returns individual rerouting period in + seconds)
    • +
    • device.rerouting.edge:EDGE_ID (returns assumed travel time for + rerouting where EDGE_ID is the id of a network edge)
    • +
    • has.rerouting.device (returns "true" or "false" depending on whether + the device is equipped)
    • +
    +

    setParameter

    +
      +
    • device.rerouting.period (double literal, set rerouting period in + seconds)
    • +
    • device.rerouting.edge:EDGE_ID (double literal, set assumed travel + time for rerouting for all vehicles (where EDGE_ID is the id if a + network edge). This value is overwritten at the next update interval + (--device.rerouting.adaptation-interval).
    • +
    • has.rerouting.device ("true"): can be used to dynamically enable + automatic rerouting
    • +
    +

    Randomness#

    +

    When setting the option --weights.random-factor <FLOAT>, edge weights for routing are dynamically +distorted by a random factor drawn uniformly from [1,<FLOAT>]. This +randomization is performed every time an edge weight is used so the same +vehicle could select a different route when rerouted on different time +steps. The route generated this way may be longer than the fastest route +by the given factor (in the worst case). This randomness is a good way +to achieve a reasonable route distribution in grid networks an in other +cases where many similar route alternatives are available.

    +

    Parallelization#

    +

    Routing in the simulation can be parallelized. This is particular +helpful when periodic rerouting is active as it may consume large +amounts of processing time. To perform routing in parallel, set the +option --device.rerouting.threads <INT> to the number of parallel threads desired.

    +

    It may also help to set the option --device.rerouting.synchronize which ensures that all vehicles are +rerouted at the same time (by default the rerouting period is aligned +with vehicle insertion time).

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Dynamic_User_Assignment.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Dynamic_User_Assignment.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Dynamic_User_Assignment.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Dynamic_User_Assignment.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + Demand/Dynamic User Assignment - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Dynamic User Assignment
    + + + +

    Introduction#

    +

    For a given set of vehicles with of origin-destination relations +(trips), the simulation must determine routes through the network (list +of edges) that are used to reach the destination from the origin edge. +The simplest method to find these routes is by computing shortest or +fastest routes through the network using a routing algorithm such as +Djikstra or A*. These algorithms require assumptions regarding the +travel time for each network edge which is commonly not known before +running the simulation due to the fact that travel times depend on the +number of vehicles in the network.

    +
    +

    Caution

    +

    A frequent problem with naive user assignment is that all vehicles take the fastest path under the assumption that they are alone in the network and are then jammed at bottlenecks due to the sheer amount of traffic.

    +
    +

    The problem of determining suitable routes that take into account travel +times in a traffic-loaded network is called user assignment. SUMO +provides different tools to solve this problem and they are described +below.

    +

    Iterative Assignment (Dynamic User Equilibrium)#

    +

    The tool <SUMO_HOME>/tools/assign/duaIterate.py can be used to compute the +(approximate) dynamic user equilibrium.

    +
    +

    Caution

    +

    This script will require copious amounts of disk space

    +
    +
    python duaIterate.py -n <network-file> -t <trip-file> -l <nr-of-iterations>
    +
    + +

    duaIterate.py supports many of the same options as +SUMO. Any options not listed when calling +duaIterate.py --help can be passed to SUMO by adding sumo--long-option-name arg +after the regular options (i.e. sumo--step-length 0.5).

    +

    This script tries to calculate a user equilibrium, that is, it tries to +find a route for each vehicle (each trip from the trip-file above) such +that each vehicle cannot reduce its travel cost (usually the travel +time) by using a different route. It does so iteratively (hence the +name) by

    +
      +
    1. calling DUAROUTER to route the vehicles in a + network with the last known edge costs (starting with empty-network + travel times)
    2. +
    3. calling SUMO to simulate "real" travel times + result from the calculated routes. The result edge costs are used in + the net routing step.
    4. +
    +

    The number of iterations may be set to a fixed number of determined +dynamically depending on the used options. In order to ensure +convergence there are different methods employed to calculate the route +choice probability from the route cost (so the vehicle does not always +choose the "cheapest" route). In general, new routes will be added by +the router to the route set of each vehicle in each iteration (at least +if none of the present routes is the "cheapest") and may be chosen +according to the route choice mechanisms described below.

    +

    Between successive calls of DUAROUTER, the .rou.alt.xml format is used +to record not only the current best route but also previously computed +alternative routes. These routes are collected within a route +distribution and used when deciding the actual route to drive in the +next simulation step. This isn't always the one with the currently +lowest cost but is rather sampled from the distribution of alternative +routes by a configurable algorithm described below.

    +

    Route-Choice algorithm#

    +

    The two methods which are implemented are called +Gawron and +Logit in the following. +The input for each of the methods is a weight or cost function (w) on +the edges of the net, coming from the simulation or default costs (in +the first step or for edges which have not been traveled yet), and a set +of routes where each route has an old cost and an +old probability (from the last iteration) and needs a new cost + and a new probability .

    +

    Gawron (default)#

    +

    The Gawron algorithm computes probabilities for chosing from a set of +alterantive routes for each driver. The following values are considered +to compute these probabilities:

    +
      +
    • the travel time along the used route in the previous simulation step
    • +
    • the sum of edge travel times for a set of alternative routes
    • +
    • the previous probability of chosing a route
    • +
    +

    Logit#

    +

    The Logit mechanism applies a fixed formula to each route to calculate +the new probability. It ignores old costs and old probabilities and +takes the route cost directly as the sum of the edge costs from the last +simulation.

    +

    +

    The probabilities are calculated from an exponential function with +parameter scaled by the sum over all route values:

    +

    +

    Termination#

    +

    The option --max-convergence-deviation may be used to detect convergence and abort iterations +automatically. Otherwise, a fixed number of iterations is used. Once the +script finishes any of the resulting .rou.xml files may be used for +simulation but the last one(s) should be the best.

    +

    Usage Examples#

    +

    Loading vehicle types from an additional file#

    +

    By default, vehicle types are taken from the input trip file and are +then propagated through DUAROUTER iterations +(always as part of the written route file).

    +

    In order to use vehicle type definitions from an additional-file, further options must +be set

    +
    duaIterate.py -n ... -t ... -l ... 
    +  --additional-file <FILE_WITH_VTYPES> 
    +  duarouter--aditional-file <FILE_WITH_VTYPES> 
    +  duarouter--vtype-output dummy.xml
    +
    + +

    Options preceeded by the string duarouter-- are passed directly to +duarouter and the option vtype-output dummy.xml must be used to +prevent duplicate definition of vehicle types in the generated output +files.

    +

    oneShot-assignment#

    +

    An alternative to the iterative user assignment above is incremental +assignment. This happens automatically when using <trip> input directly in +SUMO instead of <vehicle>s with pre-defined routes. In this +case each vehicle will compute a fastest-path computation at the time of +departure which prevents all vehicles from driving blindly into the same +jam and works pretty well empirically (for larger scenarios).

    +

    The routes for this incremental assignment are computed using the +Automatic Routing / Routing +Device mechanism. Since this +device allows for various configuration options, the script +Tools/Assign#one-shot.py may be +used to automatically try different parameter settings.

    +

    MAROUTER#

    +

    The MAROUTER application computes a classic +macroscopic assignment. It employs mathematical functions (resistive +functions) that approximate travel time increases when increasing flow. +This allows to compute an iterative assignment without the need for +time-consuming microscopic simulation.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 13 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_Vissim_Demand_Definitions.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + Demand/Further Ways to import Vissim Demand Definitions - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Demand/Further Ways to import Vissim Demand Definitions
    + + + +

    Besides using OD-matrices which can be +imported using +OD2TRIPS as VISUM does, Vissim also allows to +define vehicle flows as a combination of in-flows and route decisions. +The following tool allows to import these. The file needs to be in +German. For tips on conversion, see Networks/Import/Vissim#Converting +VISSIM networks to +German

    +

    vissim_parseRoutes.py#

    +

    Parses routes stored in the given Vissim file (first parameter) as +(in-)flows and route decisions. The read information is saved twice; the +read flows are saved as <OUTPUT_PREFIX>.flows.xml, and the read routes +are saved as <OUTPUT_PREFIX>.rou.xml. Edges of the route may be +renamed by setting them within "edgemap" variable (within the script). +To filter out (short) VISSIM connectors, which may not have been +converted to edges in the network import but are included in the VISSIM +route definitions, you may also (ab)use this facility to delete the edge +from all relevant routes, e.g. edgemap["10000"] = ""

    +
    vissim_parseRoutes.py <VISSIM_NETWORK> <OUTPUT_PREFIX>
    +
    + +

    The script is located in <SUMO_HOME>/tools/import/vissim. It is written in Python.

    +

    vissim_parseBusStops.py#

    +

    Parses bus stops and bus routes stored in the given Vissim file (first +parameter). The read bus lines are saved as +<OUTPUT_PREFIX>_busses.rou.xml. The read routes are saved as +<OUTPUT_PREFIX>_stops.add.xml. (Starting?) edges of the route may be +renamed by setting them within "edgemap" variable (see below).

    +
    vissim_parseBusStops.py <VISSIM_NETWORK> <OUTPUT_PREFIX>
    +
    + +

    The script is located in <SUMO_HOME>/tools/import/vissim. It is written in Python.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Further_Ways_to_import_VISUM_Demand_Definitions.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,344 @@ + + + + + + + + + + + + + + + + + + + Demand/Further Ways to import VISUM Demand Definitions - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Demand/Further Ways to import VISUM Demand Definitions
    + + + +

    VISUM stores its demand in OD-matrices which can be +imported using +OD2TRIPS. Though, it may be interesting for using +the computed assignments without performing a dynamic user +assignment. The SUMO package +contains some scripts which allow to process other VISUM data and are +discussed in the following.

    +

    Importing Turn Percentages#

    +

    VISUM can save the defined/computed turning percentages at junctions. +The format differs from turning probabilities +format used by +JTRROUTER. The script +visum_convertTurnPercentages.py converts VISUM turning +percentages into JTRROUTERs turning +definitions. The tool +requires the SUMO-network converted from VISUM, the turning +probabilities from VISUM, and the name of the file into which the +converted turning probabilities shall be written:

    +
    visum_convertTurnPercentages.py <SUMO_NET> <VISUM_TURNINGS> <OUTPUT>
    +
    + +

    The script is located in <SUMO_HOME>/tools/import/visum. It is written in Python.

    +

    Usability#

    +

    It seems as using turning ratios for large areas would not make any +sense. The resulting routes are very unrealistic as they contain many +loops.

    +

    See Also#

    + +

    Importing Routes#

    +

    VISUM can save the routes it computes during the assignment. The format +differs from Definition of Vehicles, Vehicle Types, and +Routes +used by SUMO and SUMO-GUI. The +script visum_convertRoutes.py converts VISUM routes into +SUMO routes. The tool requires the SUMO-network +converted from VISUM, the routes exported from VISUM, and the name of +the file into which the converted turning probabilities shall be +written. Additional options are shown in the following table:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --net-file <FILE>
    -n <FILE>
    Read the SUMO-network to map the routes onto from <FILE>; mandatory
    --visum-routes <FILE>
    -r <FILE>
    Read VISUM-routes to map from <FILE>; mandatory
    --output <FILE>
    -o <FILE>
    Write generated routes to <FILE>; mandatory
    --begin <INT>
    -b <INT>
    Define the begin of the interval the vehicles are emitted within [s]; default: 0s
    --end <INT>
    -e <INT>
    Define the end of the interval the vehicles are emitted within [s]; default: 3600s
    --prefix <STRING>
    -p <STRING>
    Add <STRING> as prefix to the IDs of generated vehicles; optional, default: no prefix
    --type <STRING>
    -t <STRING>
    Set the vehicle type to <STRING>; optional, default: no type
    --uniform
    -u
    Vehicle departure times will be spread across the interval uniformly; optional, default: false
    --timeline <STRING>
    -l <STRING>
    Applies a daily time line. The time line must be given as a list of 24 floats, each describing the percentage of emissions from the original number for each hour of a day; optional, default: no timeline
    +

    Example call:

    +
    visum_convertRoutes.py -n <SUMO_NET> -r <VISUM_ROUTES> -o <OUTPUT> --uniform
    +
    + +

    The script is located in <SUMO_HOME>/tools/import/visum. It is written +in Python.

    +

    Usability#

    +

    The routes can be directly used within SUMO / +SUMO-GUI.

    +

    See Also#

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Importing_O/D_Matrices.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Importing_O/D_Matrices.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Importing_O/D_Matrices.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Importing_O/D_Matrices.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,745 @@ + + + + + + + + + + + + + + + + + + + Demand/Importing O/D Matrices - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Importing O/D Matrices
    + + + +

    OD2TRIPS computes trip tables from O/D +(origin/destination) matrices. OD2TRIPS assumes +the matrix / the matrices to be coded as amounts of vehicles that drive +from one district or traffic assignment zone (TAZ) to another within a +certain time period. Because the generated trips must start and end at +edges, OD2TRIPS requires a mapping of TAZ to +edges. During conversion of VISUM networks with +NETCONVERT districts stored in the VISUM input +file are parsed and stored within the generated SUMO network file. If +you do not use VISUM as input, you must build a TAZ file by your own. +The format is given in +#Describing_the_TAZ below. You have +to pass the file containing the TAZ definitions to +OD2TRIPS using the --net-file <FILE> (--net <FILE> or -n <FILE> for short) option. TAZ +can be created by drawing polygons in NETEDIT and +processing them with the tool +Tools/District#edgesInDistricts.py.

    +

    All supported OD-formats are described in +#Describing_the_Matrix_Cells +below. You may either give a list of matrices to +OD2TRIPS using the --od-matrix-files <FILE>[,<FILE>]* (-d <FILE>[,<FILE>]* for short) option followed +by the list of files separated using a ','.

    +

    OD2TRIPS reads all matrices and generates trip +definitions. The generated trip definitions are numbered starting at +zero. You can also add a prefix to the generated trip definition names +using (--prefix <STRING>). As usual, they are written to the output file named using the +--output-file <FILE> (-o <FILE> for short). You can specify a vehicle type to be added to the trip +definitions using --vtype <STRING>. Please remark that vehicles will have no type unless +not given in the O/D-matrices or defined using this option. The command +line option overrides type names given in the O/D-matrices. The type +itself will not be generated. Vehicles will be generated for the time +period between --begin <TIME> (-b <TIME>) and --end <TIME> (-e <TIME>), having 0 and 86400 as default values, +respectively. The meaning is the simulation step in seconds, as usual.

    +

    Because each O/D-matrix cell describes the amount of vehicles to be +inserted into the network within a certain time period, +OD2TRIPS has to compute the vehicle's explicit +departure times. Normally, this is done by using a random time within +the time interval a O/D-matrix cell describes. It still is possible to +insert a cell's vehicles with an uniform time between their insertion. +Use the option --spread.uniform to enable this.

    +

    You can scale the amounts stored in the O/D-matrices using the --scale <FLOAT> option +which assumes a float as parameter. All read flows will be multiplied +with this value, the default is 1. When importing O/D-matrices that +cover a whole day, you maybe want to apply a curve which resembles the +spread of the trip begins found in reality. Please read the subchapter +#Splitting_large_Matrices on +this.

    +

    Describing the TAZ#

    +

    A traffic assignment zone (or traffic analysis zone), short TAZ is +described by its id (an arbitrary name) and lists of source and +destination edges.

    +

    Simple Definition#

    +

    If you do not want to distinguish between source and sink edges and give +all edges the same probability you can use the following abbreviated +form:

    +
    <tazs>
    +    <taz id="<TAZ_ID>" edges="<EDGE_ID> <EDGE_ID> ..."/>
    +
    +    ... further traffic assignment zones (districts) ...
    +
    +</tazs>
    +
    + +

    Differentiated Probabilities#

    +

    To destinguish the set of source and sink edges (or their probabilities +respectively) use the following definition:

    +
    <tazs>
    +    <taz id="<TAZ_ID>">
    +      <tazSource id="<EDGE_ID>" weight="<PROBABILITY_TO_USE>"/>
    +      ... further source edges ...
    +
    +      <tazSink id="<EDGE_ID>" weight="<PROBABILITY_TO_USE>"/>
    +      ... further destination edges ...
    +    </taz>
    +
    +    ... further traffic assignment zones (districts) ...
    +
    +</tazs>
    +
    + +

    A TAZ should have at least one source and one destination edge, each +described by its id and use probability called weight herein. These +edges are used to insert and remove vehicles into/from the network +respectively. The probability sums of each the source and the +destination lists are normalized after loading.

    +

    Creating TAZ files#

    +
      +
    • TAZ definitions can be created direclty in + NETEDIT
    • +
    • TAZ definitions can be created by drawing polygons in + NETEDIT, then using the tool + edgesInDistricts.py + for converting polygons to TAZ.
    • +
    +

    Further Usage for TAZ#

    +
      +
    • TAZ can be used with route input for + DUAROUTER
    • +
    • TAZ can be used with trips and flows for + SUMO.
    • +
    • TAZ edges appear in the simulation as special edges with the IDs + tazID-source and tazID-sink. This can be used when specifying + vehicle routes via TraCI.
    • +
    +

    Optional Attributes#

    + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    shapePosition listThe boundary shape for visualizing the TAZ
    colorcolorColor for drawing the shape and for coloring edges (color by TAZ)
    +

    Describing the Matrix Cells#

    +

    To understand how an O/D-matrix is stored, we should remind the meanings +of the values stored herein. Each matrix describes a certain time +period. The indices within the matrix are names of the +origin/destination districts (normally they are equivalent, both lists +are the same). The values stored within the matrix are amounts of +vehicles driving from the according origin district to the according +destination district within the described time period.

    +

    The formats used by PTV are described in the VISUM-documentation more +detailed. All start with a line where the type of the O/D-matrix is +given, appended to a '$'. The first following character tells in which +format the table is stored. Then, further characters follow which +describe which values are supplied additionally within the matrix. For +further information we ask you to consult the documentation supported by +PTV. Herein, only the supported variants are described.

    +

    The vehicle type information is used by OD2TRIPS +by passing it to the generated vehicles. The type definition itself will +not be generated, but the vehicle will have set the attribute type="<TYPE>". The time informations are +assumed to be in the form <HOURS>.<MINUTES>. Please note that the end is +exclusive; for example, if

    +
    0.00 1.00
    +
    + +

    is given, the generated vehicles' depart times will be second 0 to +second 3599.

    +

    The V format (VISUM/VISSIM)#

    +

    The V-format stores the O/D matrix by giving the number of districts +(TAZ) first and then naming them. After this, for each of the named +districts, a list of vehicle amounts that leave this district is given, +sorted by the destination district names as given in the district name +list. An example may look like this:

    +
    $VMR
    +* vehicle type
    +4
    +* From-Time  To-Time
    +7.00 8.00
    +* Factor
    +1.00
    +*
    +* some
    +* additional
    +* comments
    +* District number
    +3
    +* names:
    +         1          2          3
    +*
    +* District 1 Sum = 6
    +         1          2          3
    +* District 2 Sum = 15
    +         4          5          6
    +* District 2 Sum = 24
    +         7          8          9 
    +
    + +

    The 'M' in the type name indicates that a vehicle type is used, the "R" +that the values shall be rounded randomly. The second information is not +processed by OD2TRIPS what means that you can parse both V-, VR-, VMR, +and VM-matrices. Please remark that both the names list and the lists +containing the amounts are written in a way that no more than 10 fields +are stored in the same line. Each of the entries they contain seem to be +left-aligned to a boundary of 11 characters (possibly 10 for the name +and one space character). Both constraints are not mandatory for the +importer used in OD2TRIPS.

    +

    The O-format (VISUM/VISSIM)#

    +

    The O-format instead simply lists each origin and each destination +together with the amount in one line (please remark that we currently +ignore the string after the ';' that occurs after the type identifier +"$OR" in the first line):

    +
    $OR;D2
    +* From-Time  To-Time
    +7.00 8.00
    +* Factor
    +1.00
    +* some
    +* additional
    +* comments
    +         1          1       1.00
    +         1          2       2.00
    +         1          3       3.00
    +         2          1       4.00
    +         2          2       5.00
    +         2          3       6.00
    +         3          1       7.00
    +         3          2       8.00
    +         3          3       9.00
    +
    + +
      +
    • The first line is a format specifier that must be included verbatim.
    • +
    • The lines starting with '*' are comments and can be omitted
    • +
    • The second non-comment line determines the time range given as + HOUR.MINUTE HOUR.MINUTE
    • +
    • The third line is a global scaling factor for the number of vehicles + for each cell
    • +
    • All other lines describe matrix cells in the form FROM TO + NUMVEHICLES
    • +
    +

    The Amitran format#

    +

    The Amitran format defines the demand per OD pair in time slices for +every vehicle type as follows:

    +
    <demand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/amitran/od.xsd">
    +   <actorConfig id="0">
    +       <timeSlice duration="86400000" startTime="0">
    +           <odPair amount="100" destination="2" origin="1"/>
    +       </timeSlice>
    +   </actorConfig>
    +</demand>
    +
    + +

    For details on the types and units see the schema at +https://sumo.dlr.de/xsd/amitran/od.xsd

    +
    +

    Note

    +

    The "id" value of "actorConfig" is used as the vehicle type. The Amitran schema limits this to integer values whereas SUMO allows alphanumerical type ids. To overcome this limitation, set option --xml-validation never when running OD2TRIPS or remove the schema definition and begin your Amitran file with <demand>.

    +
    +

    Splitting large Matrices#

    +

    OD2TRIPS allows splitting matrices which define a +long time period into smaller parts which contain definite percentages +of the whole. There are two ways of defining the amounts the matrix +shall be split into. In both cases, the probabilities are automatically +normed.

    +

    Free Range Definitions#

    +

    The first possibility is to use the option --timeline directly. In this +case, it should be followed by a list of times and probabilities, +separated by ','. Each time and probability field is made up of two +values, an integer time being the simulation time in seconds and a +floating point number describing the probability. These two values are +separated using a ':'. At least two values must be supplied making the +definition of a timeline in this case being decribeable by the following +BNF-formula:

    +
     <TIME>:<AMOUNT>[,<TIME>:<AMOUNT>]+
    +
    + +

    In this case, the matrix will be split into (fields-1) parts and each +part will have the amount described by the integral within the field. +(This means the amount specified after the last time entry will be +discarded.)

    +

    Daily Time Lines#

    +

    The second case is rather common in transportation science. It allows to +split the matrix into 24 subparts - this means the number of fields is +fixed to 24 - allowing to spread an O/D-matrix over a day describing it +by hours. To use this, give additionally the option +--timeline.day-in-hours to OD2TRIPS. It the +assumes the values from the --timeline - option being a list of 24 +floats, divided by ',', each describing the probability of inserting a +vehicle within the according hour.

    +

    Some common daily time lines from Germany may be retrieved from: +Schmidt, Gerhard; Thomas, Bernd: Hochrechnungsfaktoren für manuelle und +automatische Kurzzeitzählungen im Innerortsbereich. Hrsg.: +Bundesministerium für Verkehr, Abteilung Straßenbau: Forschung +Straßenbau und Straßenverkehrstechnik. Heft 732, Bonn-Bad Godesberg, +1996

    +

    Applicability of generic Time Lines

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameDescriptionReference
    TGw2_PKW.txtpassenger vehicles, Tuesday-Thursday, cities in West Germany, type#2 = ~streets at inner city borderS.95
    TGw3_PKW.txtpassenger vehicles, Tuesday-Thursday, cities in West Germany, type#3 = ~streets at city borderS.95
    TGs1_PKW.txtpassenger vehicles, Saturday/Sunday, cities in West Germany, group#1 = ~inner city streets, large amount of trips to/back work, freeways with no connection to recreation areasS.100 - 103
    TGw_LKW.txttransport vehicles, Monday-Thursday, cities in West GermanyS.98
    TGs_LKW.txttransport vehicles, Sunday, type: ~long distance roads, strong heavy duty vehicle numbersS.102, 105
    +

    So, in dependence to the week day and the type of traffic, one could +assume using the following time-lines:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    vehicle typeMondayTuesday-ThursdayFridaySaturdaySunday
    HDVTGw_LKW.txtTGw_LKW.txtXXTGs_LKW.txt
    passenger, far-distanceXTGw3_PKW.txtXTGs1_PKW.txtTGs1_PKW.txt
    passenger, near-distanceXTGw2_PKW.txtXTGs1_PKW.txtTGs1_PKW.txt
    +

    One may note, that no time lines are given for passenger trips on +Mondays.

    +

    The time lines as such are given below, they can be directly copied into +the command line

    +

    Generic Time Lines

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameTime Line
    TGw_LKW0.3,0.4,0.4,0.6,0.8,2.0,4.8,7.5,9.0,8.7,9.0,9.0,7.5,8.4,7.8,6.9,5.4,4.0,2.7,1.8,1.2,0.9,0.6,0.3
    TGw3_PKW0.9,0.5,0.2,0.2,0.5,1.3,7.0,9.3,6.7,4.2,4.0,3.8,4.1,4.6,5.0,6.7,9.6,9.2,7.1,4.8,3.5,2.7,2.2,1.9
    TGw2_PKW0.8,0.5,0.4,0.3,0.4,1.2,4.5,7.4,6.6,5.2,5.0,5.0,5.2,5.3,5.6,6.7,8.4,8.6,7.4,5.0,3.9,3.0,2.1,1.6
    TGs(1)_PKW3.3,2.8,2.0,1.5,1.2,1.3,1.2,1.5,2.5,3.7,4.8,5.5,6.0,6.7,7.0,7.1,6.9,7.4,7.0,6.0,4.7,4.1,3.5,2.3
    TGs_LKW1.3,1.1,0.6,0.8,0.9,1.5,2.6,3.1,3.5,3.8,4.5,4.9,5.0,5.3,5.6,5.7,5.9,6.0,5.7,5.3,4.8,4.6,10.0,7.6
    +

    Remarks:

    +
      +
    • All time lines describe the hourly percentage of the complete + traffic
    • +
    • values are normalized to 100% (so they don't need to add up to any + specific value)
    • +
    • It is not possible to derive time-lines for all week days
    • +
    +

    The time lines describe how the traffic (100%) spreads over the whole +day. In order to have proper demands for week-end days, one can scale +down the week day traffic. The same reference as above gives the +following scaling factors at page 31.

    +

    Daily time-line scale factors

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    areaSat1992Sun1992Sat1993Sun1993
    NRW highways76,1%72,7%72,8%69,4%
    NRW other streets82,6%74%78,3%71,6%
    Bavaria75%67,2%73,9%64,7%
    +

    One may note that this information is 15 years old. Additionally, no +information about the type of vehicles is given.

    +

    A 24h time line a given O/D-matrix shall be split by may be given to +OD2TRIPS using the following options: +--timeline.day-in-hours --timeline <TIME_LINE> where <TIME_LINE> +is a list of 24 percentages as given above. The amount of traffic +defined within the O/D-matrix may be scaled via --scale <SCALE>. +Example call to OD2TRIPS:

    +
    od2trips -n <NET> -d <MATRIX> -o <OUTPUT> --scale <SKALIERUNG> \
    +   --timeline.day-in-hours --timeline <TIME_LINE>
    +
    + +

    Generated traffic modes#

    +

    By default OD2TRIPS generates vehicular traffic. +Different types of traffic (passanger cars, trucks,...) can be created by using the option +--vtype and --prefix (the latter is needed so that different types use distinct vehicle ids).

    +

    By setting one of the options --pedestrians or --persontrips, other modes can be generated.

    +

    Combining trips from multiple calls#

    +

    Sometimes it is necessary to call OD2TRIPS +multiple times to generated all the traffic for a given scenario:

    +
      +
    • to model different vehicle types which differ in their demand levels
    • +
    • to model time-varying demand that is heterogeneous between the + OD-pairs (and therefore cannot be modelled by applying a time-line)
    • +
    +

    In this case the option --prefix <STRING> must be used with a distinct value for each +call to OD2TRIPS in order to make avoid duplicate +trip ids.

    +

    Dealing with broken Data#

    +

    OD2TRIPS behaves here as following:

    +

    incomplete districts

    +
      +
    • missing origin OR destination district: error
    • +
    • missing origin AND destination district: warning
    • +
    +

    incomplete connections

    +
      +
    • missing connection to an origin OR a destination district: error
    • +
    • missing connection to an origin AND a destination district: error
    • +
    +
    +Seventh Framework Programme +AMITRAN project +This part of SUMO was developed, reworked, or extended within the project +"AMITRAN", co-funded by the European Commission within the Seventh Framework Programme.
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 08 January 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Introduction_to_demand_modelling_in_SUMO.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + Demand/Introduction to demand modelling in SUMO - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Demand/Introduction to demand modelling in SUMO
    + + + +

    After having generated a network, one could take a look at it using +SUMO-GUI, but no cars would be driving around. +One still needs some kind of description about the vehicles. This is +called the traffic demand. From now on we will use the following +nomenclature: A trip is a vehicle movement from one place to another +defined by the starting edge (street), the destination edge, and the +departure time. A route is an expanded trip, that means, that a +route definition contains not only the first and the last edge, but all +edges the vehicle will pass. SUMO and +SUMO-GUI need routes as input for vehicle +movements. There are several ways to generate routes for SUMO. The +choice depends on your available input data:

    + +
      +
    • +

      Using flow definitions

      +

      This is mostly the same approach as using trip definitions, but one +may join vehicles having the same departure and arrival edge using +this method

      +
    • +
    +
      +
    • +

      Using Randomization

      +

      This is a quick way to get some traffic if you do not have access to +any measurements but the results are highly unrealistic. See +Tools/Trip#randomTrips.py

      +
    • +
    + +
      +
    • +

      Using flow definitions and turning ratios

      +

      One may also leave out the destination edges for flows and use +turning ratios at junctions instead. See +JTRROUTER.

      +
    • +
    +
      +
    • +

      Using detector data (observation points)

      +

      Induction loops and similar devices are commonly used by authorities +to measure traffic. Using DFROUTER you may +uses this data to generate demand. See +Demand/Routes_from_Observation_Points.

      +
    • +
    + + + +

    By now, the SUMO-package contains four applications for generating +routes. DUAROUTER is responsible for importing +routes or their definitions from other simulation packages and for +computing routes using the shortest-path algorithm by Dijkstra. +Additionally, in combination with the simulation, the +DUAROUTER can compute the dynamic user +assignment formulated by C. Gawron. JTRROUTER +may be used if you want to model traffic statistically, using flows and +turning percentages at junctions. OD2TRIPS helps +you to convert OD-matrices (origin/destination-matrices) into trips. The +DFROUTER computes routes from given observation +point measures.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Random_Routes.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Random_Routes.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Random_Routes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Random_Routes.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + Demand/Random Routes - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Demand/Random Routes
    + + + +

    DUAROUTER and JTRROUTER +used to generate random routes for a given road network with the option +--random-per-second <FLOAT> (or -R <FLOAT> for short). Due to a number of bugs in this feature and because +those routes are highly unrealistic, this behavior was replaced with a +python random trip generation +script which can also produce a route set employing the +DUAROUTER.

    +

    See Also#

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Routes_from_Observation_Points.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Routes_from_Observation_Points.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Routes_from_Observation_Points.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Routes_from_Observation_Points.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,486 @@ + + + + + + + + + + + + + + + + + + + Demand/Routes from Observation Points - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Routes from Observation Points
    + + + +

    Introduction#

    +

    Traffic counts are a common form of traffic data. This data may be available from automated counting devices such as induction loops or radar detectors or it may be obtained from manual counts. The counts apply to a specifc time range and the data may cover multiple time slices. It is also possible to distinguish counts for differet types of vehicles.

    +

    SUMO provides several tools to generate traffic demand from such counting data. The generated traffic demand typically describes vehicles and their routes through the network along with their departure time. Sometimes vehicles that use the same route are grouped into <flow>-definitions.

    +

    The generated traffic should obviously match the counting data but this requirement alone does not define a unique solution. The provided SUMO tools differ in their algorithm to resolve the ambiguity and arrive at a specific set of routes and vehicles. The tools can also be distinguished by the type of counting data they consume:

    + +

    DFROUTER#

    +

    Since version 0.9.5, the SUMO-package contains a routing module named +DFROUTER. The idea behind this router is that +nowadays, most highways are well equipped with induction loops, +measuring each of the highways' entering and leaving flows. Given this +information one may assume that the flows on the highway are completely +known. DFROUTER uses directly the information +collected from induction loops to rebuild the vehicle amounts and +routes. This is done in several steps, being mainly:

    +
      +
    1. Computing (and optionally saving) the detector types in the means + that each induction is set to be a source detector, a sink detector + or an in-between detector
    2. +
    3. Computing (and optionally saving) the routes between the detectors
    4. +
    5. Computing the flow amounts between the detectors
    6. +
    7. Saving the flow amounts and further control structures
    8. +
    +
    +

    Caution

    +

    The DFROUTER application has known deficiencies when used on highly meshed networks as found in cities. Alternatives are the flowrouter tool or dynamic calibration.

    +
    +

    Computing Detector Types#

    +

    The idea behind the DFROUTER assumes that a +network is completely covered by detectors, meaning that all off- and +on-ramps have an induction loop placed on them. Such an information +whether an induction loop is a pure source or sink or whether it is +placed between such is but not given initially. It must be computed. To +do this, the DFROUTER needs the underlying +network as well as a list of detector definitions where each describes +the position of an induction loop. The network, being a previously built +SUMO-network, is supplied to the DFROUTER as +usual using the --net-file <SUMO_NET_FILE> (-n) option, the list of induction loops using --detector-files <DETECTOR_FILE>[,<DETECTOR_FILE>]+ (-d for +short). A detector file should look as follows:

    +
    <detectors>
    +    <detectorDefinition id="<DETECTOR_ID>" lane="<LANE_ID>" pos="<POS>"/>
    +... further detectors ...
    +</detectors>
    +
    + +

    This means that each detector is initially described using its id, a +lane it is placed on, and a position on the lane. To be exact:

    +
      +
    • id: A string holding the id of the detector
    • +
    • lane: The id of the lane the detector lies on. Must be a lane within + the network.
    • +
    • pos: The position on the lane the detector shall be laid on in + meters. The position must be a value between -1*lane's length and + the lane's length. In the case of a negative value, the position + will be computed backward from the lane's end (the position the + vehicles drive towards).
    • +
    +

    Given a network and the list of detectors, +DFROUTER assigns types to detectors and saves the +so extended list into a file if the option --detectors-output <DETECTOR_OUTPUT_FILE> is given. This list looks +like the input described above except that an aditional attribute is +given for each detector, "type", which may have one of the following +values: "source", "sink", "between", and "discarded". You can also +generate a list of points of interests (POIs) which can be read by +SUMO-GUI where each POI represents a detector and +is colored by the detector type: green for source detectors, red for +sink detectors, blue for in-between detectors, and black for discarded +detectors. To force DFROUTER to do this, use --detectors-poi-output <POI_FILENAME>.

    +

    When wished, if for example other parameters chage, the extended +<DETECTOR_OUTPUT_FILE> can be fed back again into +DFROUTER instead of the previous <DETECTOR_FILE>. +In this case the detector types do not have to be computed again. To +force DFROUTER to recompute the types, use --revalidate-detectors.

    +

    Computing Routes#

    +

    Now that we do know where vehicles enter and where they leave the +network, we may compute routes for each of the pairs. The +DFROUTER is told to build and save routes using --routes-output <ROUTE_OUTPUT_FILE> +where <ROUTE_OUTPUT_FILE> is the name of the file the computed routes +shall be written to. The generated file only contains routes, no vehicle +type definitions and no vehicles.

    +

    Normally, only routes starting at source detectors and ending at sink +detectors are computed. Using the option --routes-for-all you can force +DFROUTER to also build routes that start at +in-between detectors. The option --all-end-follower will make the routes not end at the +edge the source detector is placed on, but on all edges that follow this +edge. --keep-unfinished-routes will also keep those routes where a sink detector could not be +found for what may be the case if the network is not completely covered +with induction loops.

    +

    Computing Flows#

    +

    The next step is to use the computed routes and flow amounts from the +real-world detectors to compute flows across the modelled network. The +flows are given to DFROUTER using --measure-files <STRING> (or -f <DETECTOR_FLOWS>[,<DETECTOR_FLOWS>]+. They are assumed to be stored +in CSV-format using ';' as dividing character. The file should look as +follows:

    +
    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 <DETECTOR_FILE>
    • +
    • 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
    • +
    +

    These are not quite the values to be found in induction loop output. We +had to constrain the <DETECTOR_FLOWS> files this way because DFROUTER is +meant to read very many of such definitions and to do this as fast as +possible.

    +

    Because in some cases one reads detector flow definitions starting at a +certain time but wants the simulation to begin at another, it is +possible to add a time offset using --time-offset <INT> which is the number of seconds to +subtracted from the read times.

    +

    Algorithm Properties#

    +

    DFROUTER works best when all possible source and +sink edges are supplied with detector values and these values are evenly +spaced in time. The algorithm works under the assumption that the sum of +source flows matches the sum of sink flows for every measurement +interval (thus somewhat ignoring travel time). Some properties of +Vehicle generation:

    +
      +
    • The number of generated vehicles for each measurement interval is +determined by source detectors alone.
        +
      • Excess flow at sink detectors is ignored
      • +
      • If sink detectors measure less flow, it will nevertheless arrive + there in proportion to the measured flow
      • +
      • If sink detectors measure no flow at all, all vehicles will + drive to one (arbitrary) sink
      • +
      +
    • +
    +

    The number of will be determined by

    +

    Generating Vehicles#

    +

    If flow definitions were supplied, we can let the DFROUTER save the +computed vehicles together with their routes. Vehicles will be generated +at the source detectors which are placed at certain positions of the +networks' lanes. DFROUTER generates vehicle with the option --emitters-output <EMITTER_OUTPUT_FILE>. This file +will contain vehicle (emitter) declarations for each of the source +detectors. If no value is given, vehicles will not be written. +Accompanying, there will be routeDistributions each with the same name as a detector. +These reflect the distribution of routes at the detector with the same +ID.

    +

    By default vehicles are inserted with even spacing over each measurement +interval. This can be changed by adding the option --randomize-flows.

    +

    The generated file contains individual vehicles which are assigned +routes from the routes-output file.

    +
    +

    Note

    +

    The emitters output also contains a <routeDistribution> for each source detector but this distribution is not used by the vehicles. It is generated for information purposes and shows the route distribution aggregated over the whole simulation time (this distribution assumes that source flows data matches sink flow data).

    +
    +

    Further Outputs#

    +

    Variable Speed Signs#

    +

    As some approaches use a speed limit to avoid open-end boundary +problems, the DFROUTER can generate a list of speed triggers (see +"Variable Speed Signs (VSS)") placed on the positions of sink detectors. +The name to save the declaration of these speed triggers into is given +using the option --variable-speed-sign-output <VSS_OUTPUT_FILE>. The according variable speed sign definitions will be +written into files named "vss_<DETECTOR_ID>.def.xml" where +<DETECTOR_ID> is the name of the according sink detector.

    +

    Rerouters#

    +

    In order not to end vehicle routes on off-ramps, it is possible to place +rerouters (see "Rerouter") at the positions of the sink detectors, too. +Giving the option --end-reroute-output <REROUTER_OUTPUT_FILE> will generate a list of rerouter declarations. Please +remark that in this case, no rerouter definitions are written, because +the DFROUTER has no further information about possible routes beyond the +area covered by the detectors.

    +

    Validation Detectors#

    +

    It's quite nice to have the possibility to check whether the simulation +does what one wants. To validate whether the same flows are found within +the simulation as within the reality, the option --validation-output <SUMO_DETECTORS_OUTPUT> may be helpful. It +generates a list of detector definitions (see "inductive loop +detectors") +placed at the positions of sink and in-between detectors. Their output +will be saved into files named "validation_det_<DETECTOR_ID>.xml" and +should be easily comparable to the detector flows previously fed to the +router. The option --validation-output.add-sources will let DFROUTER also build inductive loop +detectors for source detectors which are place 1m behind the real-life +detector's position.

    +

    How to include the files#

    +

    The DFROUTER is unique among the SUMO-routing +applications in that it outputs routes and vehicles separately. You +need to make sure that the list of input files is in the correct order +for resolving references. +Furthermore, DFROUTER currently returns unsorted +vehicles in its emitters-output. Assuming that +DFROUTER was called with the options

    +
    dfrouter --net-file net.net.xml --routes-output routes.rou.xml --emitters-output vehicles.xml ...
    +
    + +

    SUMO must be called in the following way:

    +
    sumo --net-file net.net.xml --additional-files routes.rou.xml,emitters.rou.xml
    +
    + +

    If you run the tool +Tools/Routes#sort_routes.py +to sort the emitters, either of the following will work:

    +
    sumo --net-file net.net.xml --route-files routes.rou.xml,sorted_emitters.rou.xml
    +sumo --net-file net.net.xml --route-files sorted_emitters.rou.xml --additional-files routes.rou.xml
    +
    + +

    flowrouter.py#

    +

    The flowrouter tool improves on DFROUTER by dealing better with missing data and finding a set of routes that maximize the total flow (within the limits given by the count data). It provides several options to restrict the set of generated routes and thus allows for calibrating the generated traffic.

    +

    jtcrouter.py#

    +

    The jtcrouter.py tool (available since version 1.5.0) can build a traffic demand from turn-count data. It does so by transforming the counts into flows and turn-ratios and then passing these files to JTRROUTER.

    +

    routeSampler.py#

    +

    The routeSampler.py tool (available since version 1.5.0) builds traffic demand from turn-count data as well as edge-count data. It uses a route file as input and then repeatedly selects from this set of routes to fulfill the given count data.

    +

    A suitable route file for a given network can be generated with randomTrips.py. Such a route file covers the network with shortest-path routes. Routes that deviate from the shortest path can also be generated with the help of DUAROUTER option --weights.random-factor.

    +

    By changing the route file used as input, the generated traffic can be calibrated.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 14 April 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Routing_by_Turn_Probabilities.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + Demand/Routing by Turn Probabilities - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Routing by Turn Probabilities
    + + + +

    The JTRROUTER is a routing applications which +uses flows and turning percentages at junctions as input. The following +parameter must be supplied:

    +
      +
    • the network to route the vehicles through,
    • +
    • the description of the turning ratios for the junctions (defaults + may be used for this, too), and
    • +
    • the descriptions of the flows.
    • +
    +

    A call may look like this:

    +
    jtrrouter --flow-files=<FLOW_DEFS> --turn-ratio-files=<TURN_DEFINITIONS> --net-file=<SUMO_NET> \
    +  --output-file=MySUMORoutes.rou.xml --begin <UINT> --end <UINT>
    +
    + +
    +

    Note

    +

    When turn-counts instead of turn-ratios are available, other tools may be used.

    +
    +

    Turn Definitions#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Turn and Sink Definitions
    Filename extension.turns.xml
    Type of contentturn and sink definitions
    Open format?Yes
    SUMO specific?Yes
    XML Schemaedgerelations_file.xsd
    +

    To describe the turn definitions, one has to write an XML file. Within +this file, for each interval and each edge the list of percentages to +use a certain follower edge has to be given. An example:

    +
    <edgeRelations>
    +   <interval begin="0" end="3600">
    +      <edgeRelation from="myEdge0" to="myEdge1" probability="0.2"/>
    +      <edgeRelation from="myEdge0" to="myEdge1" probability="0.7"/>
    +      <edgeRelation from="myEdge0" to="myEdge1" probability="0.1"/>
    +
    +      ... any other edges ...
    +
    +   </interval>
    +
    +   ... some further intervals ...
    +
    +</edgeRelations>
    +
    + +
    +

    Note

    +

    If you provide turn definitions that overlap (for example in multiple files), the latter turn definition will override the former.

    +
    +

    The snippet defines that vehicles coming at the end of edge +"myEdge0" within the time interval between +0s and 3600s will choose the edge "myEdge1" +with a probability of 20%, "myEdge2" with a +probability of 70% and "myEdge3" with a +probability of 10%. Another possibility to save time on preparing the +description is to use default values. The parameter --turn-defaults (-T) <TURN_DEFAULTS> can be used to +describe the default ratios that will be used for all junctions for all +time steps. <TURN_DEFAULTS> is a list of doubles, separated by a ','. To +achieve the same behaviour as in the example above, use --turn-defaults 20,70,10. The values +will be applied to an edge's following edges beginning at the right edge +(20%) and ending at the leftmost edge (10%). As the number of possible +followers changes for different edges, the values are resampled for +edges which number of following edges differs from the number of given +turning probability defaults. Given --turn-defaults 20,70,10 a vehicle using an edge that has +two followers would use the follower to the right with 55% probability, +the one to the left with 45%.

    +

    Automatic generation of turn definitions#

    +

    For automatic, yet artificial, turn definitions generation based on the +network structure, see generateTurnDefs.py.

    +

    You can also generate turn definitions from an existing route file. see genrateTurnRatios.py.

    +

    Sinks Definitions#

    +

    A vehicle leaves the network as soon as it comes to a sink edge. As not +all networks have sink edges defined, one can support a list of edges to +be declared as sinks using --sinks <EDGE_ID>[,<EDGE_ID>]*. You may also add your sink definitions to a +turn-file (XML only):

    +
    <turns>
    +   ... some further turning definitions as above ...
    +
    +   <sink edges="<EDGE_ID>[ <EDGE_ID>]*"/>
    +   ... further sink definitions ...
    +
    +</turns>
    +
    + +

    If you do not define sinks, the option --accept-all-destinations <BOOL> may be used to declare all edge +as possible sinks.

    +

    Flow Definitions#

    +

    The definitions of the +flow +is the same as for the DUAROUTER with just a +single difference: as it is not known where the vehicle will leave the +network as the route it uses is randomly computed, the route must be +specified using attribute from and attribute to must be omitted:

    +
    <flow id="0" from="A" begin="0" end="3600" probability="0.5"/>
    +
    + +

    Random Flows#

    +

    The tool randomTrips.py can be +used to generated jtrrouter input by setting options --flows <INT> --jtrrouter.

    +

    Overlapping Flows#

    +

    By default JTRRouter will route flows through the network and split them at intersections until each part of the flow has reached a sink edge. When such a flow reaches the source edge of another flow, the total traffic is added. +The following options can change this behavior:

    +
      +
    • --sources-are-sinks (shortcut -S). When this option is set, all flows will terminate upon reaching the from-edge of another flow. Issue #6601
    • +
    • --discount-sources (shortcut -D). When this option is set, the flow departing at an edge will be reduced by the amount of traffic that has reached this edge from upstream flows. When combined with option --sources-are-sinks, upstream flows will terminate at a downstream edge when the source flow number has been reached.
    • +
    +

    Additional Options#

    +

    As theoretically a route may get infinitely long when a vehicle is +forced to take always the same direction, it is possible to limit the +route's size using option --max-edges-factor <FLOAT>. This factor, multiplied with the number of +the used network's edges is the maximum number of edges a route may +have. With the default of 2.0, a route may contain twice as many edges +as the network has. Any route longer than this size will be marked as +invalid. We assume that for each network this number has to be chosen +again.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 17 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html sumo-1.6.0+dfsg1/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html --- sumo-1.5.0+dfsg1/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Demand/Shortest_or_Optimal_Path_Routing.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,594 @@ + + + + + + + + + + + + + + + + + + + Demand/Shortest or Optimal Path Routing - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Demand/Shortest or Optimal Path Routing
    + + + +

    Introduction#

    +

    DUAROUTER can be used to import demand data +given by source and destination edges (so called trips and ''flows +''). Furthermore, it can be used to repair an existing route-file i.e. +if a given route has an unconnected edge list. To achieve dynamic user +assignment, DUAROUTER and +SUMO must be called iteratively. This is described in +Demand/Dynamic User +Assignment. Beginning with +version 0.29.0, DUAROUTER also supports +IntermodalRouting.

    +
    +

    Note

    +

    The trip and flow elements described below may also be loaded directly into SUMO. This takes up-to date traffic states within the network into account when computing routes but slows down the simulation.

    +
    +

    Trip Definitions#

    +

    Trip definitions that can be laid into the network may be supplied to +the router using an XML-file. The syntax of a single trip definition is: +<trip id="<ID>" depart="" from="<ORIGIN_EDGE_ID>" to="<DESTINATION_EDGE_ID>" [type="<VEHICLE_TYPE>"] [color="<COLOR>"]/>.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    idid (string)The name of vehicles that will be generated using this trip definition (a running number if not given)
    departintThe departure time of the (first) vehicle which is generated using this trip definition
    fromedge idThe name of the edge the route starts at; the edge must be a part of the used network
    toedge idThe name of the edge the route ends at; the edge must be a part of the used network
    viaedge idsList of intermediate edge ids which shall be part of the route; the edges must be a part of the used network
    fromTazdistrict idThe name of the district the route starts at. TAZ edges are selected so that travel time is minimized.
    toTazdistrict idThe name of the district the route ends at. TAZ edges are selected so that travel time is minimized.
    colorcolorThis generated vehicle's color
    departLaneint/string (≥0,"random","free","departlane")The lane on which the vehicle shall be inserted
    departPosfloat(m)/string ("random","free","random_free","base")The position at which the vehicle shall enter the net; "free" means the point closest to the start of the departlane where it is possible to insert the vehicle. "random_free" tries forcefully to find a free random position and if that fails, places the vehicle at the next "free" position. "base" sets the vehicle's depart position to the vehicle's length + eps (eps=.1m), this means the vehicle is completely at the begin of the depart lane.
    departSpeedfloat(m/s)/string (≥0,"random","max")The speed with which the vehicle shall enter the network.
    arrivalLaneint/string (≥0,"current")The lane at which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    arrivalPosfloat(m)/string (≥0(1),"random","max")The position at which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    arrivalSpeedfloat(m/s)/string (≥0,"current")The speed with which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    fromJunctionjunction idThe junction from which to depart note
    toJunctionjunction idThe junction at which to arrve note
    viaJunctionsjunction idsThe junctions to pass along the way note
    fromXYfloat, floatThe network position from which to depart note
    toXYfloat, floatThe network position from which to depart note
    viaXYfloat, float [float,float]The network positions to pass along the way note
    fromLonLatfloat, floatThe network position from which to depart in geo-coordinates note
    toLonLatfloat, floatThe network position from which to depart in geo-coordinates note
    viaLonLatfloat, float [float,float]The network position to pass along the way in geo-coordinates note
    +

    Routing between Junctions#

    +

    Trips and flows may use the attributes fromJunction, toJunction, and viaJunctions to describe origin, destination and intermediate locations. This is a special form of TAZ-routing and it must be enabled by either setting the DUAROUTER option --junction-taz or by loading TAZ-definitions that use the respective junction IDs. When using option --junction-taz, all edges outgoing from a junction may be used at the origin and all edges incoming to a junction may be used to reach the intermediate and final junctions.

    +

    Mapmatching#

    +

    Since version 1.2 DUAROUTER supports mapping positions to roads using attributes that end with 'XY' or 'LonLat'. The latter only works in networks that are geo-referenced. The maximum distance for map-matching can be configured using option --mapmatch.distance (since version 1.5)

    +
    +

    Caution

    +

    SUMO does not yet support these mapping attributes.

    +
    +

    By setting the option --mapmatch.junctions, positions are mapped to junctions instead of edges. The routes are then computed between junctions.

    +

    Vehicle Types#

    +

    If any trips use the type attribute, the +referenced vType element must be put into +the trip.xml file or into an additionally loaded rou.xml-file or +into an additional-file.

    +
    +

    Note

    +

    By default, DUAROUTER will write vType definitions into the output route file ahead of the first vehicle using that type. By using the option --vtype-output these definitions can be put into another file.

    +
    +

    Flow Definitions#

    +

    Flow amounts share most of the parameter with trip definitions. The +syntax is: <flow id="<ID>" from="<ORIGIN_EDGE_ID>" to="<DESTINATION_EDGE_ID>" begin="<INTERVAL_BEGIN>" end="<INTERVAL_END>" number="<VEHICLES_TO_INSERT>" [type="<VEHICLE_TYPE>"] [color="<COLOR>"]/>. Notice the following differences: the +vehicle does not take a certain departure time as not only one vehicle +is described by this parameter, but a set of, given within the attribute +"number". The departure times are spread uniformly within the time +interval described by <INTERVAL_BEGIN> and <INTERVAL_END>. All these +three attributes must be integer values. Flow definitions can also be +embedded into an interval tag. In this case one can (but does not have +to) leave the tags begin and +end out. So the following two snipples mean +the same:

    +
    <flows>
    +    <flow id="0" from="edge0" to="edge1" begin="0" end="3600" number="100"/>
    +</flows>
    +
    + +

    and

    +
    <flows>
    +    <interval begin="0" end="3600">
    +        <flow id="0" from="edge0" to="edge1" number="100"/>
    +    </interval>
    +</flows>
    +
    + +

    Let's review flow parameter:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Attribute NameValue TypeDescription
    idid (string)The name of vehicles that will be generated using this trip definition; vehicles and routes will be named "<id>_<RUNNING>" where <RUNNING> is a number starting at 0 and increased for each vehicle.
    fromedge idThe name of the edge the routes start at; the edge must be a part of the used network
    to(1)edge idThe name of an the edge the routes end at; the edge must be a part of the used network
    viaedge idsList of intermediate edge ids which shall be part of the route; the edges must be a part of the used network
    typetype idThe type id of the vehicles to generate
    beginintThe begin time for the described interval
    endintThe end time for the interval; must be greater than <begin>; vehicles will be inserted between <begin> and <end>-1
    numberintThe number of vehicles that shall be inserted during this interval
    colorcolorDefines the color of the vehicles and their routes
    departLaneint/string (≥0,"random","free","departlane")The lane on which the vehicle shall be inserted
    departPosfloat(m)/string ("random","free","random_free","base")The position at which the vehicle shall enter the net; "free" means the point closest to the start of the departlane where it is possible to insert the vehicle. "random_free" tries forcefully to find a free random position and if that fails, places the vehicle at the next "free" position. "base" sets the vehicle's depart position to the vehicle's length + eps (eps=.1m), this means the vehicle is completely at the begin of the depart lane.
    departSpeedfloat(m/s)/string (≥0,"random","max")The speed with which the vehicle shall enter the network.
    arrivalLaneint/string (≥0,"current")The lane at which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    arrivalPosfloat(m)/string (≥0(1),"random","max")The position at which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    arrivalSpeedfloat(m/s)/string (≥0,"current")The speed with which the vehicle shall leave the network

    Note: see Definition of Vehicles, Vehicle Types, and Routes#Vehicles and Routes
    +

    (1) JTRROUTER does not need this +parameter, DUAROUTER requires it

    +

    Custom edge weights#

    +

    The option --weight-files <FILE> can be used to affect the weights used during routing. The +input format conforms to the output format of the edge based traffic +measures. +By default this uses the traveltime attribute of edges. The option --weight-attribute <STRING> +can be used to use other attributes for routing. Weight files that only +contain some of the network edges are permitted. If undefined, the +traveltime of an edge defaults to the free-flow traveltime. Also, only +the weight-attribute must be defined:

    +
    <meandata>
    +    <interval begin="0" end="3600" id="whatever">
    +        <edge id="edgeID1" traveltime="23"/>
    +        <edge id="edgeID2" traveltime="1000"/>
    +    </interval>
    +</meandata>
    +
    + +

    Usage Examples#

    +
    duarouter --trip-files trips.xml --net-file road.net.xml --output-file result.rou.xml
    +
    + +

    the file ''trips.xml '' given below must contain edges contained in the +network file ''road.net.xml ''.

    +
    <trips>
    +    <trip id="1625993_25" depart="25" from="-15229224#3" to="4474184"/>
    +    <trip id="1542480_35" depart="35" from="-46771582"   to="-24038909#1"/>
    +    <trip id="1544282_35" depart="35" from="20554351#2"  to="-4876083#5"/>
    +    <trip id="1565407_35" depart="35" from="-25771472#1" to="-25160470#0"/>
    +    <trip id="1620115_45" depart="45" from="11279351#3"  to="5198584#1"/>
    +    <trip id="1647560_45" depart="45" from="54048879#0"  to="-52105434#0"/>
    +    <trip id="3761248_45" depart="45" from="-31928311"   to="23792451#7"/>
    +</trips>
    +
    + +

    Trips may contain source and destination +districts +as well as edges. If the districts shall be used for routing this has to +be specified using the option "--with-taz". Furthermore (if the net does +not contain the districts) a districts file needs to be provided:

    +
    duarouter --trip-files=<TRIP_DEFS> --net-file=<SUMO_NET> \
    +  --output-file=MySUMORoutes.rou.xml --taz-files=<DISTRICTS> --with-taz
    +
    + +
    +

    Caution

    +

    The edge weights are ignored when using TAZ this way. Instead TAZ edges are selected so that the travel time is minimzed.

    +
    +

    As we have to read in the flow definitions completely into the memory - +something we do not have to do necessarily with trips, an extra +parameter (-f or --flows) is used to make them known by the router:

    +
    duarouter --flows=<FLOW_DEFS> --net=<SUMO_NET> \
    +  --output-file=MySUMORoutes.rou.xml -b <UINT> -e <UINT>
    +
    + +

    Remind that one can not insert flow descriptions into a trip definitions +file. The opposite (some trip definitions within a flow descriptions +file) is possible. You also can give both files at the input file, for +example:

    +
    duarouter --flows=<FLOW_DEFS> --trip-files=<TRIP_DEFS> --net=<SUMO_NET> \
    +  --output-file=MySUMORoutes.rou.xml -b <UINT> -e <UINT>
    +
    + +

    Dealing with Errors During Routing#

    +

    When running DUAROUTER you may encounter errors +of the type

    +
    Error: No connection between 'edge1' and 'edge2' found
    +
    + +

    This is caused be an unconnected network. If your network has vehicle +class restrictions it may be that the connectivity is only lacking for +particular vehicle classes which is less obvious from the GUI. You can +ignore these routes using the option --ignore-errors. However, if a large proportion of +your routes cause this error you should definitely investigate your +network file for problems. The tool +Tools/Net#netcheck.py can be used +to pin down the connectivity gaps in your network.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 14 January 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/CodeStyle.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/CodeStyle.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/CodeStyle.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/CodeStyle.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + Developer/CodeStyle - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/CodeStyle
    + + + +

    C++ Code#

    +

    We try to have the code compatible to a wide range of C++11 compatible +compilers and test every commit / pull request against gcc and clang on +MacOS and Linux, and Visual +Studio 2013 - 2017 on +Windows. For the +C++ code we use AStyle to keep +indentation and other whitespace usage consistent throughout the +project. In order to make your code appear same as the original SUMO +code use the following call to AStyle (or execute +tools/build/checkStyle.py --fix <FILE_NAME> before committing):

    +
    astyle --style=java --unpad-paren --pad-header --pad-oper --add-brackets --indent-switches --align-pointer=type -n <FILE_NAME>
    +
    + +

    Still, there are several other things you should keep in mind (The +Google C++ Style +Guide is a good read +as well):

    +

    Templates#

    +

    Use the following templates for your files:

    + +

    Whitespace#

    +
      +
    • Never use tab stop. Always use 4 spaces for indentation. In + Visual Studio tab stop can be disabled in Tools/Options/Text + Editor/All languages/Tabs.
    • +
    +

    Class Names#

    +
      +
    • All class names must start with capital letter
    • +
    • The first capital letters of a class should be used to indicate + their module (NBEdge -> Net Build module, + MSChargingStation -> Micro Simulation module
    • +
    • If a class name is composed of multiple words, every word must start + with capital letter (Micro simulation charging station -> + MSChargingStation)
    • +
    • please do not arbitrarily introduce new namespaces
    • +
    +

    Variable Names#

    +
      +
    • Variables used within methods should be named using "camel-caps", + f.e. "currentCarVelocity"
    • +
    • Member variables should additionally have the prefix "my", f.e. + "myMaximumVehicleVelocity"
    • +
    • try not to abbreviate variable names (myMaximumVehicleVelocity + instead of myMVV)
    • +
    • give names to variables which describe its purpose within the + context
    • +
    • do not reuse variables for different purposes
    • +
    +

    Enums#

    +
      +
    • All enum names must start with capital letter, and If their name is + composed of multiple words, every word must start with capital + letter
    • +
    • Every definition must be written using capital letters (SumoXMLTag { + SUMO_TAG_EDGE, SUMO_TAG_LANE, ... } )
    • +
    +

    Encoding#

    +

    Only use the plain ASCII +characters in cpp and h files. (0x20 - 0x7E). If you need to convey +extended character information use TeX or HTML notation instead.

    +

    #include-statements#

    +
      +
    • do not use backslashes (\)! use slashes (/) only
    • +
    • do not use absolute paths!; something like #include + "/home/daniel/mylibs/include_me.h" will never work somewhere else! + Use relative paths and tell the compiler where the other libraries + may be found. If you have problems on this, please tell us, we'll + write some further documentation!
    • +
    • in general we mention the standard library includes first (like + #include <vector>), then the includes of libraries used by SUMO + (FOX / Xerces) and later our own headers
    • +
    • brackets ("<" and ">") are preferred for files not residing in the + same directory, while quotation marks are usually used for files in + the same directory.
    • +
    +

    "using namespace ..."-statements#

    +
      +
    • Avoid them whenever possible and especially do not use "using + namespace ..."-statements within the .h-files! It's possible that + an included library tries to use a different impementation - who + knows? Using a "using namespace ..."-statement within your .h-file + may yield in an unexpected behaviour.
    • +
    +

    Throw-declarations#

    + +

    Object Handling#

    +
      +
    • If the structure you are implementing has an id, then derive the + object from Named (<SUMO_HOME>/src/utils/common/Named.h). This class supports + the std::string getID()-method.
    • +
    • If you want to store something in a map pointing from string ids to + object instances, then use NamedObjectCont + (<SUMO_HOME>/src/utils/common/NamedObjectCont.h).
    • +
    +

    Integer Types#

    +
      +
    • Use simple int whenever possible. There are probably lots of places + in the sumo code which rely on the fact that this has at least 32 + bits, so you may too.
    • +
    • Try to avoid unsigned ints whenever possible. It is sometimes not + possible when calling Xerces-C and GL functions or using + std::string::npos but try to limit it to those cases.
    • +
    • If you need at least 64 bit, use long long int.
    • +
    +

    Conditionals#

    +
      +
    • Do not use redundant condition checks. Example: if + (myCondition) instead of if (myCondition == true)
    • +
    +

    Loops#

    +
      +
    • Use the C++ 11 range loop syntax whenever possible. Example: + for (element& it : myContainer) instead of for + (container::iterator it = myContainer.begin(); it != + myContainer.end(); it++). Still try to name the element type + explicitly instead of using "auto" at least when iterating over + lists / vectors.
    • +
    +

    Python Code#

    +

    We try to adhere to the PEP 8 Style +Guide and use +autopep8 and +flake8 to check this. If you have +both modules installed, you can run tools/build/checkStyle.py +<FILENAME> to check this and also +fix some of the errors. We run both tools without any special options +except for the line length which we limit to 120.

    +

    Please remember to make your file executable if (and only if) the file +should be executable (i.e. is not a module to be imported by others). +Windows users please follow this +recipe. +Executable files should also contain a so called shebang in the first +line:

    +
    !#/usr/bin/env python
    +
    + +

    If your script needs Python 3 then state python3 there.

    +

    Python3 compatibility#

    +

    Our main development still focuses on Python 2.7 but we strive for +Python 3 compatibility. When writing or editing scripts, keep the +following in mind:

    +
      +
    • use print as a function (from __future__ import print_function)
    • +
    • use items instead of iteritems, which will return a list under + Python 2.7 and an iterator in Python 3(for item in dict.items())
    • +
    • use values instead of itervalues, which will return a list under + Python 2.7 and an iterator in Python 3(for val in dict.values())
    • +
    • use // instead of / for integer division because / will do a + floating point division under Python 3 (4/3 = 1.3333333)
    • +
    • the floating point division with / can be included in Python 2 by (from __future__ import division)
    • +
    • while iterating over unsorted lists or iterators Python 2 and Python + 3 do not work in the same order. Therefore add a explicit sorted + before iteration when you write e.g. a xml file (for item in sorted(list))
    • +
    • use argparse library instead for optparse due to optparse wont be + updated for Python 3 anymore. The use of most functions stayed the + same, only some names differ. For further information please check + https://docs.python.org/3/library/argparse.html
    • +
    • if you want to use different code for Python 2 and Python 3, which + can be necessary since not all libraries exist for both versions, + you can use a simple if else statement with the PY3 boolean defined + by(PY3 = sys.version_info > (3,))
    • +
    • use byte type in Python 3 wherever you use binary data and string + type wherever you used unicode strings before. This can be made by + if else statements using the PY3 boolean. See a list for the + different methods possible on bytes and strings at + https://docs.python.org/3/howto/pyporting.html#text-versus-binary-data
    • +
    +

    For further information about possible error sources and difficulties +resulting in Python 3 compatibility see also +http://python3porting.com/ and +https://docs.python.org/3/howto/pyporting.html

    +

    Template#

    +

    Use the following template for your files:

    + +

    Line endings and keyword replacement#

    +

    We enforce special line endings for the following file types (overriding +core.autocrlf settings of git) using <SUMO_HOME>/.gitattributes:

    +
      +
    • LF for
        +
      • source files (".h", ".cpp", ".py", ...),
      • +
      • Test files (".xml", ".prog", ".complex", ".dfrouter", + ".duarouter", ".jtrrouter", ".netconvert", ".sumo", ".meso", + ...)
      • +
      +
    • +
    • CRLF for Windows only files (".bat", ".props", ".vcxproj", + ".filters", ...)
    • +
    +

    Git has no equivalent to the svn:keywords property. We use a custom +script to handle the $Id$ keyword like before but it has to be enabled +manually by adding the following lines to your global .gitconfig +(usually in your home directory)

    +
      [filter "keywords"]
    +      clean  = .git_filters/keywords.py clean
    +      smudge = .git_filters/keywords.py %f
    +
    + +

    The filter is enabled for Python and C++ source files.

    +

    For the current settings you can always look at <SUMO_HOME>/.gitattributes.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/CppFileTemplate.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/CppFileTemplate.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/CppFileTemplate.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/CppFileTemplate.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + Developer/CppFileTemplate - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Developer/CppFileTemplate
    + + + +
    /****************************************************************************/
    +// Eclipse SUMO, Simulation of Urban MObility; see <https://eclipse.org/sumo>
    +// Copyright (C) <YEAR OF CREATION>-<CURRENT YEAR> German Aerospace Center (DLR) and others.
    +// This program and the accompanying materials are 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    <FILENAME>
    +/// @author  <AUTHOR'S NAME, ONE SEPARATE LINE FOR EACH AUTHOR>
    +/// @author  <AUTHOR'S NAME 2>
    +/// @author  <AUTHOR'S NAME 3>
    +/// @date    <FILE CREATION DATE>
    +///
    +// <A BRIEF DESCRIPTION OF THE FILE'S CONTENTS>
    +/****************************************************************************/
    +#include <config.h>
    +
    +#include <StandardLibrary>     // Standard libraries
    +#include <SUMOLibrary>         // SUMO libraries
    +
    +#include "myHeaderFile1"       // Header files from the same directory
    +#include "myHeaderFile2"
    +
    +
    +// ===========================================================================
    +// static member definitions
    +// ===========================================================================
    +<parameterType> OwnClass::myStaticMember = value;    // Define here values of static members
    +
    +
    +// ===========================================================================
    +// member method definitions
    +// ===========================================================================
    +OwnClass::OwnClass(<parameterType> parameter1, <parameterType> parameter2,... <parameterType> parametern) :
    +    parentClass(),             // Call to parent class (if inherit)
    +    myParameter1(parameter1),  // values of members should be initialized with this method
    +    myParameter2(parameter1),  // keep the order coherent with the order of the members in the header file
    +    ...
    +    myParametern(parametern) {
    +    // Code of constructor
    +}
    +
    +
    +void
    +OwnClass::function() const {
    +    // code
    +}
    +
    +
    +<parameterType>
    +OwnClass::getParameter1() const {
    +    return myParameter1;
    +}
    +
    + +
    // ---------------------------------------------------------------------------
    +// Class::InnerClass - methods <LEAVE OUT IF METHODS ARE OF ONE CLASS ONLY>
    +// ---------------------------------------------------------------------------
    +OwnClass::InnerClass::InnerClass() :
    +    myPrivateParameter(0) {
    +    // code of constructor
    +}
    +
    +
    +OwnClass::InnerClass::~InnerClass() {}
    +
    +
    +/****************************************************************************/
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Debugging.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Debugging.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Debugging.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Debugging.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + Developer/Debugging - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Debugging
    + + + +

    Besides using a debugger (e.g. gdb) with +the debug build (see below), the SUMO source code offers debugging +macros at several locations, which are usually deactivated (e.g., +commented out). Activating the macros can yield a detailed program +output, that can be configured by given parameters.

    +

    Debug Build#

    +

    To create debugging symbols during the build, see the build instructions +for your operating system (Linux / +Windows / +MacOS). The corresponding binaries +receive the suffix D (e.g. sumoD instead of sumo). The debug +configuration defines a preprocessor macro _DEBUG that may be used to +encapsulate debug specific code. For simple text debugging, local macros +should be used that can be switched on and off more flexibly, see below.

    +

    Local Debug Macros#

    +

    The recommended style for inserting reusable debugging code in SUMO is +encapsulation by preprocessor directives. This is done by placing a +#define DEBUG_THIS_CODE at the beginning of a source (preferably just +below any other #include or #define macros). The debugging code +(e.g. some output to std::cout) should then be surrounded by

    +
    #ifdef DEBUG_THIS_CODE
    +    ...
    +#endif
    +
    + +

    Thus, it can be switched on and off by (un)commenting the #define +DEBUG_THIS_CODE line.

    +

    Sometimes it is useful to combine this with a condition for more +specific debugging output. For instance, if only output for the vehicle +with ID 'my_new_ferrari' is needed while looping through all vehicles, +you should insert a corresponding debug condition

    +
    #define DEBUG_COND (veh.getID() == "my_new_ferrari")
    +
    + +

    (at the same location as the #define DEBUG_THIS_CODE) and encapsulate +the debug code further as

    +
    #ifdef DEBUG_THIS_CODE
    +    if DEBUG_COND {
    +        ...
    +    }
    +#endif
    +
    + +

    Note that this presupposes that veh is a reference to the current +vehicle, which is being looped over. It is worth mentioning that you can +also define debug conditions with arguments to become a bit more +flexible. For example:

    +
    #define DEBUG_COND(x) (x != 0 && x->getID() == "my_new_ferrari")
    +    ...
    +#ifdef DEBUG_THIS_CODE
    +    if DEBUG_COND(veh_pointer) {
    +        ...
    +    }
    +#endif
    +
    + +

    Debugging macros already exist at several locations (see some of these +before implementing your own):

    +
      +
    • src/microsim/MSLane.cpp
    • +
    • src/microsim/MSLink.cpp
    • +
    • src/microsim/MSVehicle.cpp
    • +
    • src/microsim/lcmodel/MSLCM_LC2013.cpp
    • +
    • src/guisim/GUIVehicle.cpp
    • +
    • src/guisim/GUILane.cpp
    • +
    +

    Selection based vehicle debugging#

    +

    The header utils/common/StdDefs.h provides the String +gDebugSelectedVehicle, which always holds the id of the last vehicle, +which was selected in the GUI, and can be used in the debugging +conditions to obtain a dynamic debugging selection (provided the +corresponding macro is activated).

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Docker.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Docker.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Docker.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Docker.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,280 @@ + + + + + + + + + + + + + + + + + + + Developer/Docker - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Docker
    + + + +

    Dockerised SUMO#

    +

    Building and installing SUMO from source is not an easy task for +beginner users. Docker is a popular tool to solve this issue. Searching +"SUMO" at Docker Hub will give several results +from attempts to Dockerise SUMO. We list a few of these attempts +beginning with standalone SUMO to SUMO with other packages.

    +

    SUMO, SUMO GUI, and TraCI#

    +

    The solution given at +docker-sumo contains only +standard SUMO and tools. It demonstrates how to Dockerise SUMO version +0.30.0 on top of Ubuntu 16.04. As well as sumo and TraCI, +docker-sumo also shows the +user how to access the graphical interface of a Dockerised SUMO, i.e. +sumo-gui, which is unique compared to other attempts at Dockerising +SUMO.

    +

    Docker-sumo-demo1.gif +sumo-gui in action from docker-sumo

    +

    SUMO and TraCI4J#

    +

    The sumo-docker +project demonstrates how to Dockerise SUMO version 0.25.0 on top of +Apache Mavern 3 with TraCI4J.

    +

    SUMO and JuPedSim#

    +

    The +hybrid_sumo_jps +project aims on providing an easy to use docker image for running a +hybrid simulation that couples SUMO with +JuPedSim. SUMO is a mighty simulator for all +kinds of transport problems that focuses mainly on motorized traffic. +While SUMO also provides a pedestrian model for simulating pedestrians +on sidewalks, crossings or the like, it lacks of the capability to model +pedestrians in true 2d space (e.g. in buildings, on squares, at train +stations). Instead of reinventing the wheel we decided to team up with +JuPedSim and develop a hybrid coupling approach that combines the power +of both frameworks. The coupling is realized using google's rotocol +buffers over +gRPC, a library for *remote procedure +calls*. Currently this coupling approach is provided as a Docker image. +Moreover, also the Docker image is not intended to replace the common +SUMO installation (e.g. hybrid_sumo_jps does not provided a graphical +interface, i.e. no sumo-gui), you may also use the hybrid_sumo_jps +image to run ordinary SUMO scenarios.

    +

    Details on how to run hybrid_sumo_jps can be found at the +corresponding hybrid_sumo_jps's Docker +Hub page.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Documentation_Build.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Documentation_Build.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Documentation_Build.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Documentation_Build.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + Developer/Documentation Build - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Documentation Build
    + + + +

    You can read the SUMO Documentation online at: https://sumo.dlr.de/docs/

    +

    The Documentation is continuously updated and always refers to the latest development version.

    +

    In summary, the documentation works as follows:

    +
      +
    • The documentation is being "developed" or "written" as Markdown files, located in the SUMO GitHub repository
    • +
    • The static HTML sites are being generated using MkDocs and certain MkDocs-plugins
    • +
    +

    Requirements#

    +

    Building the documentation requires the python3-version of mkdocs along with several plugins. These can be installed with pip in the following manner:

    +
     pip3 install mkdocs mkdocs-macros-plugin mkdocs-git-revision-date-plugin pymdown-extensions mdx_truly_sane_lists mdx_gh_links plantuml_markdown
    + ```
    +You also need to install the plantuml package
    +
    + +

    sudo apt install plantuml +```

    +

    Documentation Parts#

    +

    Source Files#

    +

    Markdown files#

    +

    Each "Page" or "Article" corresponds to a Markdown file. This files are located in the repository under /docs/web/docs/ where its location corresponds to the hierarchy in the documentation (there are directories that contain content-related pages). The Path observed in the URI corresponds to the Path in the Git Documentation directory.

    +

    Images#

    +

    Images and other Media files that are included in the pages are located in the repository under /docs/web/docs/images/.

    + +

    All MkDocs related files, necessary to build the static HTML pages, are located in the repository under /docs/web/. +The necessary files are as follows:

    +
      +
    • The configuration file: called "mkdocs.yml", it contains some building instructions for MkDocs including the Macros and some site options.
    • +
    • The Theme: all HTML, CSS and JS files located in the theme directory.
    • +
    +

    Static HTML pages#

    +

    The HTML pages are being build using the Markdown files. The final pages are available to read at the online Documentation. Altough the Documentation Source files are included in the repository, the final Static HTML pages are not. In order to get a local copy of this pages, follow the static HTML site generation instructions.

    +

    Static HTML site generation#

    +

    The static HTML site generation is explained here: https://github.com/eclipse/sumo/blob/master/docs/web/README.md

    +

    It can be triggered (from within the DLR network) via https://sumo.dlr.de/generate-documentation.php (or for a complete rebuild, via https://sumo.dlr.de/generate-documentation.php?type=complete).

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 14 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/ExploringTheStructure.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/ExploringTheStructure.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/ExploringTheStructure.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/ExploringTheStructure.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,261 @@ + + + + + + + + + + + + + + + + + + + Developer/Exploring the structure - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Exploring the structure
    + + + +

    Introduction#

    +

    Each night a documentation of the C++ source code is generated with the tool Doxygen. +The result is acessible via inline code documentation + (doxygen).

    +

    Looking for a class by name#

    +

    Select either from the menu "Data Structures" the item Data Structure Index or from the tree view on the left "Data Structures" -> "Data Structure Index". You can navigate with the alphabet to the section of all classes starting with that letter. +Select e.g. first M and then the class MSCFModel. +Image:DevDoxygenIndex.jpg

    +

    Information about a class#

    +

    For a selected class the following information is shown

    +

    Inheritance and collaboration diagramm#

    +

    For a select class you will see first the inheritance and collaboration diagramm. +In these diagrams you can navigate to other classes by clicking on the box with the class name. +Image:DevDoxygenClassDiagrams.png

    +

    Data Structures#

    +

    List of member functions#

    +

    For each function you see a description, the parameters, return values, the references to other variables and functions, from where it is references and the caller graph.

    +

    You can navigate to the references items and explore the structure of one or more classes interactively in the browser +DevDoxygenFunctionInfo

    +

    List of variables#

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 28 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/GUI_Testing.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/GUI_Testing.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/GUI_Testing.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/GUI_Testing.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + Developer/GUI Testing - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/GUI Testing
    + + + +

    SUMO's netedit tests use +PyAutoGUI.

    +

    Setup#

    +
      +
    • Python (at least 2.7) should be installed
    • +
    • Install using your package manager (Linux, MacOS) or pip
        +
      • openSUSE 15.0: sudo zypper in python2-PyAutoGUI python2-pyperclip scrot (there are python3 versions too)
      • +
      • Windows / ubuntu: follow the + docs
      • +
      +
    • +
    • Running on Linux without visual display will need Xvfb and fluxbox too´
        +
      • openSUSE: sudo zypper in xorg-x11-server fluxbox
      • +
      • ubuntu: sudo apt in xvfb fluxbox
      • +
      +
    • +
    +

    Startup#

    +
      +
    • run $SUMO_HOME/tests/runNeteditTests.sh (Linux) or + %SUMO_HOME%\tests\runNeteditTests.bat (Windows)
    • +
    +

    Setting up a test#

    +

    All tests are written in Python hiding the PyAutoGUI functions behind a +layer of test functions in tests/netedit/neteditTestFunctions.py. All of +them reside in the relevant test directory in a test.py script that +starts always with the same header:

    +
    import os
    +import sys
    +
    +testRoot = os.path.join(os.environ.get('SUMO_HOME', '.'), 'tests')
    +neteditTestRoot = os.path.join(os.environ.get('TEXTTEST_HOME', testRoot), 'netedit')
    +sys.path.append(neteditTestRoot)
    +import neteditTestFunctions as netedit
    +
    +# Open netedit
    +neteditProcess, match = netedit.setupAndStart(neteditTestRoot, ['--new'])
    +
    + +

    This code will find the directory with the netedit tests using the +TEXTTEST_HOME variable and SUMO_HOME as a fallback. This enables the +start of the tests even outside of TextTest by simply running the +test.py script. You should not use relative directories here because +this makes copying and moving tests harder.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 11 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/HFileTemplate.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/HFileTemplate.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/HFileTemplate.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/HFileTemplate.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + Developer/HFileTemplate - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Developer/HFileTemplate
    + + + +
    /****************************************************************************/
    +// Eclipse SUMO, Simulation of Urban MObility; see <https://eclipse.org/sumo>
    +// Copyright (C) <YEAR OF CREATION>-<CURRENT YEAR> German Aerospace Center (DLR) and others.
    +// This program and the accompanying materials are 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    <FILENAME>
    +/// @author  <AUTHOR'S NAME, ONE SEPARATE LINE FOR EACH AUTHOR>
    +/// @author  <AUTHOR'S NAME 2>
    +/// @author  <AUTHOR'S NAME 3>
    +/// @date    <FILE CREATION DATE>
    +///
    +// <A BRIEF DESCRIPTION OF THE FILE'S CONTENTS>
    +/****************************************************************************/
    +#pragma once
    +#include <config.h> // you can leave this one out if you don't need any defines from config.h, especially in libsumo / utils
    +
    +#include <somewhere/otherClass1.h>
    +#include "myOtherClass2.h"
    +
    +
    +// ===========================================================================
    +// class declarations
    +// ===========================================================================
    +class myOwnClass1; // always prefer a declaration over an include
    +class myOwnClass2;
    +
    +
    +// ===========================================================================
    +// class definitions
    +// ===========================================================================
    +
    +/**
    + * @class OwnClass (Can be preceded by GNE, MS, NB, etc. depending on the project)
    + * brief description of the class
    + */
    +class OwnClass : public ParentClass  {
    +
    +public:
    +     /**
    +      * @class InnerClass
    +      * brief description of the inner class
    +      */
    +     class InnerClass {
    +
    +     public:
    +         /// @brief Constructor
    +         InnerClass();
    +
    +         /// @brief Destructor
    +         ~InnerClass();
    +
    +     private:
    +         /// @brief description of parameter
    +         <parameterType> myPrivateParameter;
    +     };
    +
    +    /** @brief Constructor
    +     * @param[in] parameter1 each parameter must be documented
    +     * @param[in] parameter2 each parameter must be documented
    +       ...
    +     */
    +    OwnClass(<parameterType> parameter1, <parameterType> parameter2,... <parameterType> parametern);
    +
    +    /// @brief Destructor (don't need documentation)
    +    ~OwnClass();
    +
    +    /// @brief Returns parameter1 (Simple functions should be documented with one line)
    +    <parameterType> getParameter1() const;
    +
    +    /** @brief some functions can throw exceptions but don't use throw declarations
    +     * @param[in] parameter1 description of the parameter
    +     * @throw <exceptionName> description of the situation that provoque an exception
    +     * @return description of the returned value
    +     */
    +    bool setParameter1(<type> parameter1) const;
    +
    +    /// @brief if the class is abstract, should have pure virtual functions (virtual .... = 0;)
    +    //  @note: Extra information about a function should be written using @note
    +    virtual void pureVirtualFunction() = 0;
    +
    +protected:
    +    /// @brief description of the parameter
    +    <parameterType> myProtectedParameter1;
    +
    +private:
    +    /// @brief every private parameter must start with "my"
    +    <parameterType> myPrivateParameter2;
    +
    +    /// @brief C++ Standard Library classes must be preceded by std::
    +    std::vector<std::string> myPrivateParameter3;
    +};
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Car-Following_Model.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Car-Following_Model.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Car-Following_Model.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Car-Following_Model.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + Developer/How To/Car-Following Model - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/How To/Car-Following Model
    + + + +

    This short document describes how a new car-following model can be added +to SUMO. We'll do this by implementing a test model named "smartSK". +When implementing your own model, you should also grep (look for) +occurences of the name we use, here.

    +

    The car-following model's class#

    +

    The best thing is to start with an already existing model. Models are +located in <SUMO_HOME>/src/microsim/cfmodels and new added models should reside +here, too. Copy both MSCFModel_KraussOrig1.h and +MSCFModel_KraussOrig1.cpp and rename them. The name should be +"MSCFModel_<YOUR_MODELS_NAME>", in our case "MSCFModel_SmartSK"

    +
    +

    Convention

    +

    Car-following model implementations are located in <SUMO_HOME>/src/microsim/cfmodels.

    +
    +
    +

    Convention

    +

    A car-following class' name should start with "MSCFModel_".

    +
    +

    Now, open both files and rename all occurences of MSCFModel_KraussOrig1 +into your class' name.

    +

    Add the files to the <SUMO_HOME>/src/microsim/cfmodels/CMakeLists.txt.

    +

    Loading into simulation#

    +

    We now add the XML-elements which allow us to define and parse the +model's parameter. Extend the list of known elements +"SUMOXMLDefinitions::tags" located in <SUMO_HOME>/src/utils/xml/SUMOXMLDefinitions.cpp. +In SUMOXMLDefinitions.h:

    +
    SUMO_TAG_CF_SMART_SK,
    +
    + +

    In SUMOXMLDefinitions.cpp:

    +
    { "carFollowing-SmartSK",     SUMO_TAG_CF_SMART_SK },
    +
    + +

    Furthermore you need to add an entry to +SUMOXMLDefinitions::carFollowModelValues[] also in +SUMOXMLDefinitions.cpp:

    +
    { "SmartSK",     SUMO_TAG_CF_SMART_SK },
    +
    + +

    Car-following models are instantiated in MSVehicleType::build(...) +located in <SUMO_HOME>/src/microsim/MSVehicleType.cpp. You'll find a switch, here +where you have to put the call to your model's constructor into.

    +
    case SUMO_TAG_CF_SMART_SK:
    +  model = new MSCFModel_SmartSK(vtype,
    +                                from.get(SUMO_ATTR_ACCEL, SUMOVTypeParameter::getDefaultAccel(from.vehicleClass)),
    +                                from.get(SUMO_ATTR_DECEL, SUMOVTypeParameter::getDefaultDecel(from.vehicleClass)),
    +                                from.get(SUMO_ATTR_SIGMA, SUMOVTypeParameter::getDefaultImperfection(from.vehicleClass)),
    +                                from.get(SUMO_ATTR_TAU, 1.),
    +                                from.get(SUMO_ATTR_TMP1, 1.),
    +                                from.get(SUMO_ATTR_TMP1, 1.),
    +                                from.get(SUMO_ATTR_TMP1, 1.),
    +                                from.get(SUMO_ATTR_TMP1, 1.),
    +                                from.get(SUMO_ATTR_TMP1, 1.));
    +
    + +

    You may note that the constructor is read with values from "from". The +first parameter, starting with SUMO_ATTR_ denotes the XML-attribute +which names the parameter. These attributes, if new, have to be added to <SUMO_HOME>. In SUMOXMLDefinitions.h:

    +
    SUMO_ATTR_TMP1,
    +SUMO_ATTR_TMP2,
    +SUMO_ATTR_TMP3,
    +SUMO_ATTR_TMP4,
    +SUMO_ATTR_TMP5,
    +
    + +

    In SUMOXMLDefinitions.cpp:

    +
    { "tmp1",           SUMO_ATTR_TMP1 },
    +{ "tmp2",           SUMO_ATTR_TMP2 },
    +{ "tmp3",           SUMO_ATTR_TMP3 },
    +{ "tmp4",           SUMO_ATTR_TMP4 },
    +{ "tmp5",           SUMO_ATTR_TMP5 },
    +
    + +

    The second parameter denotes the default value. There are two different +mechanisms to define default values. Either they are vehicle class +independent (they are the same for passenger cars and for trucks for +instance) then you can simply state the number here or you want a +different default for the different vehicle classes then insert the +relevant code into <SUMO_HOME>/src/utils/vehicle/SUMOVTypeParameter.cpp. You can only +have floating point values as model parameters at the moment.

    +

    You also have to define which parameter must be read in <SUMO_HOME>/src/utils/vehicle/SUMOVehicleParserHelper.cpp, method getAllowedCFModelAttrs():

    +
    std::set<SumoXMLAttr> smartSKParams;
    +smartSKParams.insert(SUMO_ATTR_ACCEL);
    +smartSKParams.insert(SUMO_ATTR_DECEL);
    +smartSKParams.insert(SUMO_ATTR_SIGMA);
    +smartSKParams.insert(SUMO_ATTR_TAU);
    +smartSKParams.insert(SUMO_ATTR_TMP1);
    +smartSKParams.insert(SUMO_ATTR_TMP2);
    +smartSKParams.insert(SUMO_ATTR_TMP3);
    +smartSKParams.insert(SUMO_ATTR_TMP4);
    +smartSKParams.insert(SUMO_ATTR_TMP5);
    +allowedCFModelAttrs[SUMO_TAG_CF_SMART_SK] = smartSKParams;
    +
    + +

    Note, that we have to adapt the constructor to retrieve the additional +parameter (tmp1-tmp5). We have also to adapt the copy constructor +located in our class in MSCFModel_SmartSK::duplicate(...).

    +

    For further interaction, you also have to adapt the "id" of the model in +the model's .h class:

    +
    virtual int getModelID() const {
    + return SUMO_TAG_CF_SMART_SK;
    +}
    +
    + +

    XML Validation#

    +

    Sumo performs xml validation. If you add new +XML elements or attributes you either need to adapt the XML schema files +in <SUMO_HOME>/data/xsd or add the option

    +
    --xml-validation never
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 12 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Device.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Device.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Device.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Device.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + Developer/How To/Device - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/How To/Device
    + + + +

    This Page describes how to implement a new device.

    +

    What is a device good for?#

    +

    A device is a container for data and functionality which resides in +individual vehicles. Devices are notified about all vehicle movements +and may interact with the vehicle or with other devices. An important +aspect of devices is, that it is possible to equip only a fraction of +the simulated vehicles. Usually devices support some kind of output. The +following is a list of available devices and their functionality

    +

    MSDevice_Tripinfo#

    +

    Records start and arrival of a vehicle as well as aggregate measures +about a completed trip such as average speed and waiting time. This +device is also used for expressing aggregate results from other devices +such as emissions (MSDevice_HBEFA). This +devices is activated using the option --tripinfo-output <FILE> and is then active for all +vehicles.

    +

    MSDevice_Vehroutes#

    +

    Records the edges traveled by a vehicle and optionally the times at +which each edge was left. It can also record dynamic route changes. This +device is also used for expressing aggregate results from other devices +such as emissions (MSDevice_HBEFA). This +devices is activated using the option --vehroute-output <FILE> and is then active for all +vehicles.

    +

    MSDevice_Routing#

    +

    Triggers periodic rerouting of equipped vehicles. This devices is +activated using the options --vehroute-output.* and is then active for selected vehicles. +It is possible to equip specific vehicles or a fraction of the vehicle +fleet.

    +

    MSDevice_Person#

    +

    This device is automatically created if a person rides in a vehicle. It +is used when managing boarding and alighting

    +

    MSDevice_HBEFA#

    +

    Computes emissions of a vehicle as described in +Definition_of_Vehicles,_Vehicle_Types,_and_Routes#Vehicle_Emission_Classes. +This devices is activated using the options --device.hbefa.* and is then active for +selected vehicles. It is possible to equip specific vehicles or a +fraction of the vehicle fleet.

    +

    MSDevice_Battery#

    +

    This device is used for modelling energy use and battery capacity of +electric vehicles.

    +

    MSDevice_SSM#

    +

    This device logs surrogate safety measures for equipped vehicles, see +Simulation/Output/SSM_Device.

    +

    MSDevice_Example#

    +

    This device serves as an implementation example for custom devices.

    +

    Steps for implementing a new device#

    +

    Copy Example Device#

    +

    The suggested way for creating a new device is to create a new class by +copying the files src/microsim/devices/MSDevice_Example.{h,cpp}.

    +

    In ordert to compile the new class it must be added to +src/microsim/devices/Makefile.am (on Linux) or added to project +z_libmicrosim_devices (on Windows).

    +

    In order to be available for use, the device must also be added in +src/microsim/devices/MSDevice.cpp to the functions insertOptions and +buildVehicleDevices.

    +

    Assign Device to Vehicles#

    +

    Devices are assigned by global options for equipping all or a fraction +of the vehicle fleet. Alternatively, they can be defined by setting <vehicle> or +<vType>-generic +parameters. +The new assignment options are generated automatically by calling the +function MSDevice::insertDefaultAssignmentsOptions. The test whether a +specific vehicle should be equipped with the device is done by calling +MSDevice::equippedByDefaultAssignmentOptions. The usage of these +methods is demonstrated in MSDevice_Example.

    +

    Adding your own functionality#

    +

    Devices work by updating their state periodically (i.e. +MSDevice_Routing) or everytime the vehicle moves (i.e. +MSDevice_Battery). Many devices perform some kind of output either +periodically (MSDevice_Routing) in response to computed events +(MSDevice_BTreceiver) or at the time the vehicle leaves the +simulation (MSDevice_Vehroutes). Before the vehicle is removed the +method generateOutput is called for each device.

    +

    Testing your code#

    +
    +

    Note

    +

    It is important to test new code and suggestions for how to do so can be found in tests/sumo/extended/device_example/.

    +
    +

    Show your work#

    +

    If you have implemented a new device and you think it may be useful to +other users of SUMO, please contribute to our community and tell us +about your work. We would be happy to help you in getting your device +into the main development tree.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Extend_Vehicles.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Extend_Vehicles.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Extend_Vehicles.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Extend_Vehicles.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,306 @@ + + + + + + + + + + + + + + + + + + + Developer/How To/Extend Vehicles - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/How To/Extend Vehicles
    + + + +

    This brief document describes how the vehicle class can be extended. We +will do this based on extending the vehicle by the capacity to transport +persons.

    +

    Basics#

    +

    The main vehicle parameter are stored in +src/utils/vehicle/SUMOVehicleParameter. At first, we extend the class +(.h) by two further parameter:

    +
    /// @brief The vehicle's capacity (persons)
    +unsigned int personCapacity;
    +
    +/// @brief The number of persons in the vehicle
    +unsigned int personNumber;
    +
    + +

    We also assign default values for those in the constructor (.cpp):

    +
    ... personCapacity(0), personNumber(0), ...
    +
    + +

    Our vehicles now have the attribute, and we can use it within the +simulation as well as within the routing modules.

    +

    I/O#

    +

    The vehicle parser stores whether an information is given or not, for +writing it back if necessary. We have to define constants (bitset) which +describe whether the value was given (.h):

    +
    const int VEHPARS_PERSON_CAPACITY_SET = 2 << 14;
    +const int VEHPARS_PERSONS_NUMBER_SET = 2 << 15;
    +
    + +

    Writing a Vehicle#

    +

    We extend the vehicle writing method stored in void +SUMOVehicleParameter::writeAs(...) const by the new attributes:

    +
    if (wasSet(VEHPARS_PERSON_CAPACITY_SET)) {
    + dev.writeAttr(SUMO_ATTR_PERSON_CAPACITY, personCapacity);
    +}
    +if (wasSet(VEHPARS_PERSON_NUMBER_SET)) {
    + dev.writeAttr(SUMO_ATTR_PERSON_NUMBER, personNumber);
    +}
    +
    + +

    You may have noticed that we use the enumeration for two XML-attributes, +here: "SUMO_ATTR_PERSON_CAPACITY" and "SUMO_ATTR_PERSON_NUMBER". +They have to be defined in src/utils/xml/SUMOXMLDefinitions. In +SUMOXMLDefinitions.h we have to extend SumoXMLAttr:

    +
    SUMO_ATTR_PERSON_CAPACITY,
    +SUMO_ATTR_PERSON_NUMBER,
    +
    + +

    In SUMOXMLDefinitions.cpp we have to extend SumoXMLAttr, too:

    +
    { "personCapacity", SUMO_ATTR_PERSON_CAPACITY },
    +{ "personNumber",   SUMO_ATTR_PERSON_NUMBER },
    +
    + +

    The given strings will be later used as XML-attributes.

    +

    Loading#

    +

    We then extend the vehicle parsing method. It is located in +src/utils/xml/SUMOVehicleParserHelper. We have to add the parsing of the +new attributes in void +SUMOVehicleParserHelper::parseCommonAttributes(...)

    +
    // parse person number
    +if (attrs.hasAttribute(SUMO_ATTR_PERSON_NUMBER)) {
    + ret->setParameter |= VEHPARS_PERSON_NUMBER_SET;
    + ret->personNumber = attrs.getIntReporting(SUMO_ATTR_PERSON_NUMBER, 0, ok);
    +}
    +// parse person capacity
    +if (attrs.hasAttribute(SUMO_ATTR_PERSON_CAPACITY)) {
    + ret->setParameter |= VEHPARS_PERSON_CAPACITY_SET;
    + ret->personCapacity = attrs.getIntReporting(SUMO_ATTR_PERSON_CAPACITY, 0, ok);
    +}
    +
    + +

    Usage#

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Net_Importer.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Net_Importer.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/How_To/Net_Importer.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/How_To/Net_Importer.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,417 @@ + + + + + + + + + + + + + + + + + + + Developer/How To/Net Importer - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/How To/Net Importer
    + + + +

    In the following, advices on implementing a new network importer are +given-

    +

    Implementing an own network import module is very easy. The following +steps are necessary:

    +
      +
    • write methods which read and parse the information from the original + file
    • +
    • insert parsed values into the netbuilding containers
    • +
    • make the network importer know and use your code
    • +
    • submit your code
    • +
    +

    Yes, that's all. Still, the three steps are described more detailed in +the following sections.

    +

    Building a Reader#

    +

    Initial Considerations#

    +

    There are some conventions on network importers we try to follow. They +are not mandatory, but they are assumed to assure the code's +extendibility and to force a higher quality of the code.

    +

    When starting to write your own importer, you should consider to base it +on an existing one. NIImporter_OpenStreetMap.*, NIXML...Handler.* are +examples of reading network descriptions form XML files. +NIImporter_VISUM.* and NIImporter_DlrNavteq.* read plain text files, +formatted in different ways. All these modules are located in +<SUMO_HOME>/src/netimport and of course, your import should be placed here, too.

    +
    +

    Convention

    +

    network importer code is located in <SUMO_HOME>/src/netimport/

    +
    +
    +

    Convention

    +

    network importer should be named NIImporter_<FORMAT_NAME>

    +
    +

    Calling the Reader#

    +

    Before adding a call to the init-function of your network importer, you +have to add according options; otherwise the first call will end with an +error due to accessing an unknown option. The options have to be added +to void NIFrame::fillOptions().

    +

    Then, you can make the importing facility know your parser by including +the .h-file of your parser to NILoader.cpp and add a call to his +loadNetwork-method within void NILoader::load(OptionsCont &oc).

    +

    Import Order#

    +

    In most cases, edges, nodes, traffic lights, connections between edges, +and other road network attributes are given explicitly and separated. +The information must be imported in the correct order. The following +order is right:

    +
      +
    • nodes
    • +
    • edges (need references to origin and to destination nodes)
    • +
    • connections between edges (need usually references to edges)
    • +
    • traffic lights (need references to nodes)
    • +
    +

    Some more outrageous programmers may try to optimise the order a bit if +the original data is aligned different. This may be possible in some +cases.

    +

    In the case nodes, edges, and other information are parsed from several +files, the import order must be considered. Of course, it is also +possible to store data in temporary containers. Still, this should be +avoided as it increases memory consumption, and yes, memory consumption +is one of the major problems for the network building process. In the +case temporary containers are used, they must of course be cleared +before returning from importing.

    +
    +

    Convention

    +

    try to avoid static containers

    +
    +
    +

    Convention

    +

    clean static containers if used

    +
    +

    Starting to Parse#

    +

    All importers have a static method named "loadNetwork" which starts the +parsing. This method is responsible for starting the import if the +according options are set and to assure the read values are stored for +further processing within the according netbuilding containers. For this +purpose, it is necessary to have the options and the netbuilding +structure be given to the importer, making the call have the following +fingerprint:

    +
    static void loadNetwork(const OptionsCont &oc, NBNetBuilder &nb);
    +
    + +

    At first, this method asks whether the option which makes +NETCONVERT read a file of the according format +is set and whether the set value is right. By now, this means only that +a check whether the given file(s) really exist(s) is made, not whether +it is well formatted or valid in any means. The method +FileHelpers::exists(<FILE>) returns whether a given file is existing.

    +
    +

    Convention

    +

    all importer have a static member which checks whether the according option is set with a valid value

    +
    +

    After the file has been checked for being existent, a parser is built +and started.

    +

    You may have noticed, that some of the import parsers allow to give more +than one file, divided by ','. This is of a great help sometimes, still +it is not mandatory. It is up to you to decide whether your importer +should be able to handle several files or not.

    +

    Error Handling#

    +

    Different formats have different sources for being errornous. In some +cases, heuristics may have to be applied during the parsing. In all +cases something is strange - and it is not strange each time a network +from the given format is imported - a warning should be generated. This +is done by calling the macro

    +
    WRITE_WARNING(<TEXT>);
    +
    + +

    If the odd behaviour completely disallows further processing of the +imported file, or in the case a read value is not in the right format (a +string is read, though a floating point number was awaited, for +example), a ProcessError should be thrown. The exception must have an +information about the error, for example:

    +
    throw ProcessError("Number of lanes is <0");
    +
    + +

    Yes, the decision whether a strange value is an error or a warning is +sometimes difficult.

    +
    +

    Convention

    +

    throw a ProcessError in the case of errors

    +
    +
    +

    Convention

    +

    warn on strange behaviour

    +
    +
    +

    Convention

    +

    both, a warning and an error exception must have an explanation about the reason supplied

    +
    +

    Adding read Values to the netbuilding Containers#

    +

    After the definition of a node, an edge, or anything else has been +parsed, the according structure must be built and inserted into the +according netbuilding container.

    + + + + + + + + + + + + + + + + + + + + + +
    ClassRoad element
    NBNodeA node (intersection, junction)
    NBEdgeAn edge (road, street)
    +

    The following table shows which definitions are stored into which +containers:

    +

    In most cases, these methods return whether the addition was successful. +If it was not, there probably is already an object with the same name. +Normally, the imported networks we have dealt with so far did not +contain duplicates - with the exception of edges which may +bidirectional. In the case the object could not been added, you have to +delete it explicitly. In the case your format is known to contain +duplicates, you should ask whether a duplicate was already built and +only if not, build the instance.

    +
    +

    Convention

    +

    try to avoid building and deleting of duplicates

    +
    +

    Tests#

    +

    Submitting the Code#

    +

    In the case you do not have a write access to the repository, we would +be very happy if you could issue a pull request or send a patch against +a recent version to the sumo-dev mailing list.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/HowToRelease.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/HowToRelease.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/HowToRelease.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/HowToRelease.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,416 @@ + + + + + + + + + + + + + + + + + + + Developer/HowToRelease - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/HowToRelease
    + + + +

    Packages#

    +

    for an overview of created packages and contents see +Downloads.

    +

    Release steps#

    +

    Below, a list of steps that should be done in order to publish a new +release is given. All necessary commits which have no ticket of their +own may refer to #563.

    +

    Merge phase#

    +

    Major changes to the SUMO trunk should end about two weeks before the +release date. This refers especially to merges of project branches into +the trunk. It is also a good idea to inform the developers of dependent +software (Veins, VSimRTI, flow etc.) at this stage. +- send out mail to sumo-dev informing about the upcoming release so that 'contributed'-authors can check their stuff for compatibility

    +

    Freeze phase (Release day - 7)#

    +
      +
    • check the sources
        +
      • compile, try to remove warnings and commit the patches
      • +
      • run checkStyle and commit + changed files
      • +
      • check the calendar to update copyright statements
      • +
      • check whether the TraCI version needs to be incremented + and rebuild TraCI constants in python + (tools/traci/rebuildConstants.py)
      • +
      • check whether the network version needs to be incremented and + update the value in NWFrame::MAJOR_VERSION. Netconvert tests + need to be updated afterwards.
      • +
      • update author information
      • +
      +
    • +
    • check the regular tests
        +
      • put special attention to the tests which serve as examples, see + tests/examples.txt!
      • +
      • Win64 and gcc4_64 should have no failing tests, the other + platforms are less important
      • +
      • If there are failing tests, which are not flagged as known bugs, + save them after careful checking or open a ticket and assign a + known bug.
      • +
      • recheck/rebuild the test networks (if necessary due to + netconvert changes)
      • +
      • check the tests again
      • +
      +
    • +
    • check the documentation
        +
      • update the ChangeLog
      • +
      • generate options documentation from configuration templates + using tools/build/configTemplateToWiki.py
      • +
      • recheck/rebuild the configuration schemata (if options were + added) using tools/xml/rebuildSchemata.py (use the internal + build to include all options)
      • +
      +
    • +
    • check the internal tests (same procedure as above), especially the + (to be) published scenarios
    • +
    • GitHub
        +
      • add new milestone + if necessary
      • +
      • check all remaining tickets and assign them to later milestones + or to persons.
      • +
      +
    • +
    • scenarios (optional)
        +
      • prepare scenarios for release if the previous version does not + run with the current release or significant changes were made to + the scenarios
      • +
      +
    • +
    • update submodules by running git submodule update --remote and committing + the changes if necessary
    • +
    +

    The trunk is now frozen. All commits which do not refer to an open +ticket for the upcoming release need to be made to a separate branch. +The freeze phase should not last longer than one week. The goal is to +fix all scenarios and have all failing tests fixed, which are not +assigned to a later milestone.

    +

    Release day - 1#

    +

    All scenarios should be fixed by now.

    +
      +
    • patch the version information
        +
      • in src/config.h.cmake, also disable the HAVE_VERSION_H macro
      • +
      • in CMakeLists.txt and build/wix/sumo.wxs
      • +
      • commit the changes
      • +
      +
    • +
    • recheck whether submodules changed by doing git submodule update --remote +and committing the changes after careful inspection
    • +
    • check the documentation
        +
      • update the ChangeLog again and include + version and release date
      • +
      • modify the version number (Version) and the release date (ReleaseDate) + in mkdocs.yml in the extra: section at the end + to update the download links.
      • +
      +
    • +
    • create a new Eclipse release at https://projects.eclipse.org/projects/technology.sumo (after login there should be a "Create Release" button)
        +
      • add an IP Log to the release
      • +
      • send an email to the PMC at technology-pmc@eclipse.org asking for review (include links to the release and the IP log)
      • +
      +
    • +
    +

    Release day#

    +

    The nightly build should have generated all releasable packages. If not, +delay the release. (The complete documentation, tests and source +distribution build can be achieved via "make dist".) The +following things need to be there:

    +
      +
    • the platform independent part of the distribution;
        +
      • source and all inclusive distributions (.tar.gz, .zip) ("make dist")
      • +
      +
    • +
    • the binary part of the distribution +
    • +
    +

    If everything is fine:

    +
      +
    • make a new folder in S:\Sumo\Releases
    • +
    • make new sumo.dlr.de-release
        +
      • copy the folder from S:\Sumo\Releases to the releases dir scp -r /media/S/Releases/x.y.z delphi@ts-sim-front-ba.intra.dlr.de:docs/releases
      • +
      +
    • +
    • make new sourceforge-release
        +
      • make a new release within the sumo package (named "version + x.y.z")
      • +
      • add files to the release
      • +
      • change default download attributes
      • +
      • update files at the opensuse build + service
      • +
      +
    • +
    • update the ubuntu ppa (see +https://askubuntu.com/questions/642632/how-to-bump-the-version-of-a-package-available-in-another-users-ppa)
        +
      • download the source release and rename it to sumo_1.6.0+dfsg1.orig.tar.gz
      • +
      • unzip the source release
      • +
      • move 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.6.0+dfsg1_source.changes one level up
      • +
      +
    • +
    • scenarios (optional) +
    • +
    • inform the users about the new release +
    • +
    • add a new version tag
    • +
    +
    > git tag -a v0_13_7 -m "tagging release 0.13.7, refs #563"
    +> git push --tags
    +
    + +
      +
    • close the milestone + (retargeting open tickets needs to be done manually for now)
    • +
    +

    After-release cleanup#

    +

    The trunk is now open for changes again.

    +
      +
    • reenable HAVE_VERSION_H in src/config.h.cmake
    • +
    • rename version to "git" in configure.ac and CMakeLists.txt
    • +
    • insert a new empty "Git master" section at the top of the ChangeLog
    • +
    • commit changes
    • +
    • drink your favorite beverage
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Drawing_in_sumo-gui.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Drawing in sumo-gui - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Implementation Notes/Drawing in sumo-gui
    + + + +

    Basic#

    +

    Each network object has a type defined in GUIGlObjectTypes.h (i.e. +GLO_EDGE, GLO_JUNCTION, GL_VEHICLE, ...). Objects are maintained in +three places:

    +
      +
    • SUMORTree: a structure for finding objects based on their location + (used for efficient drawing)
    • +
    • GUIGlObjectStorage: a structure for retrieving objects based on + their numerical id and for locking objects to prevent concurrent + access
    • +
    • +

      type specific containers (GUIEdges for example are maintained in + MSEdge::dictionary)

      +
      +

      Note

      +

      This also applies to NETEDIT

      +
      +
    • +
    +

    Layers#

    +

    As all objects are drawn in the order they are stored within the rtree, +no z-ordering is done before. Due to this, the objects must be draw in +"layers". This is realised by using glTranslated. Each object type is +also an integer value (enum type) which is used as the layer in which to +draw objects of this type. Since GLO_VEHICLE has the integer value of +256 it is drawn on top of GLO_LANE which has the lower value 2. Some +objects consists of multiple layers themselves (i.e. Busstops). In this +case increments of 0.1 are used which should not interfere with objects +of different types.

    +

    As a general rule each drawing routine should use glPushMatrix at the +beginning, set the layer with glTranslated(0,0,getType()) and use +glPopMatrix when finished. Top level captions (junction names, edge +names, ...) are drawn at the layer GLO_MAX. A list of all predefined +layers is present in +<SUMO_HOME>/src/utils/gui/globjects/GUIGlObjectTypes.h.

    +

    The layer information stored in Polygons and +POIs is used in the same way as the +GUIGlObjectType (glTranslate(0,0,getLayer()). This makes it possible to +place polygons anywhere in the drawing stack, allowing the visual +emulation of tunnels and other road-obscuring features.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Error_Handling.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,396 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Error Handling - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Implementation Notes/Error Handling
    + + + +

    +

    Please note that this page describes what is +currently in work.

    +

    +

    Failure types (not academic)#

    +

    One can distinguish the following types of problems:

    +
      +
    • Startup input data is not correct (a mandatory value is not set or + is not numeric when it should be etc.)
    • +
    • Dynamic input data is not correct
    • +
    • Some things within our design or our implementation are not correct + (we try to get an integer from a string option etc., NULL-pointer + exceptions, trying to access deleted classes etc.)
    • +
    • System failures (out of memory etc.)
    • +
    +

    The distinction between startup input data and dynamic input data is +not as easy as one might think. Basically startup refers to everything +referenced directly on the command line or via a configuration file +while dynamic refers to interactive input via different interfaces such +as GUI or socket connections. The problem is that some data given at +startup is processed with quite a delay by the simulation (notably +routes) and probably cannot even be checked (e.g. for being well formed +XML) at startup due to performance problems. This kind of data will be +considered dynamic.

    +

    Thus the term startup input data refers to every data (file) which is +processed before the application starts doing something useful (whatever +that means).

    +

    Command line applications#

    +

    Philosophy for command line applications#

    +

    We assume that all the input data should be valid. We will not try to +solve any bugs made by the user. We just inform him what went wrong and +let him patch the problem. For startup data this means we finish the +application with an error message if erroneous data is encountered. As +the input data may be broken on several places, the application should +try to parse all data, first, reporting all encountered errors, and quit +then. For dynamic data this means, if we have no possibility to give +direct feedback (for instance on one way socket connections) we ignore +the data (with something like a log message), otherwise we try to give +feedback.

    +

    Programming bugs should be catched in a way that allows to retrack +them. The user shall not be confronted with any segfaults-popups or +things like that. Rather, an error message about an improper behaviour +shall be printed (currently: "Quitting (on unknown error).") and the +application should quit correctly.

    +

    System errors should be catched and printed to the user. The +application should then quit correctly.

    +

    Implementation in command line applications#

    +

    Incorrect startup data#

    +

    As said in #Philosophy for command line +applications we +just report the problem and quit then (with an information that we could +not accomplish what was to do).

    +

    For this, the main function of each of our command line applications has +a try/catch-block and all of the processing done by this application is +done within this block. What is always catched is the ProcessError - +exception, defined in src/utils/common/UtilExceptions. This class +contains a message which is reported as soon as the try/catch-block +located in the main function is reached. As in earlier versions of SUMO, +a ProcessError could be called with no message (in this case the message +is set to "Process Error"), we only print the message if the catched +ProcessError has really one set.

    +
    int
    +main(int argc, char **argv)
    +{
    +    // initialise return code
    +    int ret = 0;
    +    ... make uncritical initialisation ...
    +    try {
    +       ... do some critical stuff ...
    +    } catch (ProcessError &e) {
    +        if(string(e.what())!=string("Process Error") && string(e.what())!=string("")) {
    +            MsgHandler::getErrorInstance()->inform(e.what());
    +        }
    +        MsgHandler::getErrorInstance()->inform("Quitting (on error).", false);
    +        // set return code to "failure"
    +        ret = 1;
    +#ifndef _DEBUG
    +    } catch (...) {
    +        MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false);
    +        // set return code to "failure"
    +        ret = 1;
    +#endif
    +    }
    +    ... clean up ...
    +    // return the return code
    +    return ret;
    +}
    +
    + +

    The second catch-block will be described later.

    +

    So basically the only thing we have to do is to generate a +ProcessError as soon as something is not as we would have expect it +and give it a proper message. Still, this is only half of the truth. +Because we do not want the application to quit immediately when an error +occurs, but print all errors and quit then, we have to insert a further +error handling layer. In the current implementation, handler which parse +the input data are reporting the errors to the error instance of the +MsgHandler. As soon as reading a file ends, it is checked whether an +error occured. In this case, a ProcessError is thrown. If the handler is +not parsing the data himself, but using other structures, these +structures may throw an InvalidArgument which then has to be catched +and reported to the error instance of the MsgHandler.

    +

    Be aware that some things already allocated have to be deleted before +throwing a ProcessError.

    +

    Implementation bugs#

    +

    The second catch block within the above snipplet is currently meant to +catch everything else. In fact, these may be both system failures and +programming faults. So, we only catch this in the release-version so +that an end-user will be informed about an error (though with no verbose +error message). In the case we are debugging the code, the +exception/fault is not catched - our debugger should stay at the +position the exception was generated.

    +

    System failures#

    +

    Are currently catched by the later catch-block. Probably, the easiest +method to handle those would be to give a list of possible failures and +try to handle them in catch-blocks as it is done with ProcessErrors.

    +

    GUI applications#

    +

    Philosophy for gui applications#

    +

    Now hat is lethal for a command line application (false input parameter) +is not for a gui application which shall report about the error but +shall still allow the user to patch his inputs and to try to reload the +settings.

    +

    Open issues#

    +

    SUMO#

    +
      +
    • Network errors
        +
      • There is no check for link consistency; to be exact, it is + possible that some combinations of junction/incoming <-> cedge + <-> succedge do not match but still are loaded with no errors
      • +
      • There is no check for unused values
      • +
      +
    • +
    • WAUT errors
        +
      • How comes that a tls-switch - output is build though errors + occured? (see + tests/sumo/errors/wauts/cross3ltl_error_unknown_wautid)
      • +
      • The programs are checked in a lazy way, the error is reported + too late (see + tests/sumo/errors/wauts/cross3ltl_error_unknown_to_prog)
      • +
      • Undescribed behaviour for + cross3ltl_error_missing_junctiondef, + cross3ltl_error_missing_reftime
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Options_Sub_System.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,374 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Options Sub System - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Implementation Notes/Options Sub System
    + + + +

    Introduction#

    +

    All major SUMO applications use the same classes for parsing command +line options and configuration files. These classes encapsulate parsing +options from the command line and XML-configuration files and validating +whether they are of a correct type. The options sub system also supports +writing configuration-templates, saving current (parsed/loaded) settings +to files, and printing the help screen.

    +

    Initialising Options#

    +

    First Steps#

    +

    Each application has exactly one instance of the OptionsCont +(options container) - class. A reference to this class may be ontained +using

    +
    static OptionsCont &OptionsCont::getOptions();
    +
    + +

    Before an application starts registering its options, it must let +OptionsCont know itself. It is needed due to the fact that OptionsCont +is responsible for printing a basic information about the application +and because it also generates the help screen which includes the +application's name, possibly example calls, etc. Due to this, the first +touch of the options sub system for each application looks similar to +the following which is borrowed from netconvert_main.cpp:

    +
       OptionsCont &oc = OptionsCont::getOptions();
    +   // give some application descriptions
    +   oc.setApplicationDescription("Road network importer / builder for the road traffic simulation SUMO.");
    +#ifdef WIN32
    +   oc.setApplicationName("netconvert.exe", "SUMO netconvert Version " + (string)VERSION_STRING);
    +#else
    +   oc.setApplicationName("sumo-netconvert", "SUMO netconvert Version " + (string)VERSION_STRING);
    +#endif
    +
    + +

    The ifdef-block is used to differ between the supported OSes +(Windows/Linux) where the SUMO-applications are named slightly +different.

    +

    Please note that the description set by setApplicationDescription is a +brief description and should fit into one line (be not longer than 80 +characters).

    +

    Registering Options#

    +

    Before the command line options are parsed, their names, allowed types +and their default values (if existing) must be inserted into this +container. This mostly done within a dedicated method or function.

    +

    To insert an application option into the container, use one of the +following polymorphs:

    +
    void doRegister(const std::string &name1, Option *v);
    +
    + +

    or

    +
    void doRegister(const std::string &name1, char abbr, Option *v);
    +
    + +

    The parameter "name1" is the name (or one of the possible names, better +to say) of the inserted option. The character "abbr" within the second +call is the possible one-char abbreviation of the name.

    +
    Caution: The behaviour after adding the same abbreviation for two different options is not defined.
    +
    + +

    The third parameter is an option that shall be assigned to the name(s). +Remark that the OptionsCont takes the responsibility for this option +- it will be deleted when the OptionsCont is deleted. The option +itself must be an instance of one of the following classes, which all +are derived from the class Option:

    +
      +
    • Option_Integer
    • +
    • Option_Bool
    • +
    • Option_Float
    • +
    • Option_String
    • +
    • Option_FileName
    • +
    • Option_IntVector
    • +
    • Option_StringVector
    • +
    +

    The names of the classes reflect the types which are awaited as +parameter for the option. Do also remark, that later access for reading +should be done in dependence to the type - it means that you should not +try to get a string from an Option_Float. This results in an +exception.

    +
    +

    Caution

    +

    All subclasses of Option are stored within the files ''<SUMO_HOME>/src/utils/options/Option.h and ''<SUMO_HOME>/src/utils/options/Option.cpp. This is surely not wished as when following the coding styleguide, each class should be stored in a separate pair of files. Also, one could imagine to use templates, here.

    +
    +

    Every one of the option's subclasses has two constructors: one +that is parametrised with the appropriate type and a parameter-less one. +The parametrised constructor is used to supply default values for +options, in the other case, no value is known to the system at first. An +example: settings the "verbose"-switch as following, lets the +application run quiet as default:

    +
    oc.doRegister("verbose", 'v', new Option_Bool(false));
    +
    + +

    Adding Synonymes#

    +

    One can also add synonymes for options. If you want to implement the +option "name-of-vehicle-that-shall-halt", but you wish to have a +shorter name, too, use the following to make the same option accessible +using both "name-of-vehicle-that-shall-halt" and "v2h":

    +
    oc.doRegister("name-of-vehicle-that-shall-halt", new Option_String());
    +oc.addSynonyme("name-of-vehicle-that-shall-halt", "v2h");
    +
    + +

    Retrieving Options#

    +

    If no default value was supplied for an option, you should ask the +OptionsCont whether it has been set. Access to values of unset +options causes exceptions. This may sound hard, but as it's only the +developer who accesses the options container in fact, it's the best way +to assure security of the code. One can determine whether an option is +set using

    +
    bool OptionsCont::isSet(const std::string &name) const;
    +
    + +

    If one has to know whether an option still stores the default value or +a value was supplied by the user, he/she may call

    +
    bool OptionsCont::isDefault(const std::string &name) const;
    +
    + +

    Dependent on the type of an option, one can retrieve its value using +the following methods from OptionsCont:

    +
    int OptionsCont::getInt(const std::string &name) const;
    +long OptionsCont::getLong(const std::string &name) const;
    +std::string OptionsCont::getString(const std::string &name) const;
    +float OptionsCont::getFloat(const std::string &name) const;
    +const IntVector &OptionsCont::getIntVector(const std::string &name) const;
    +const StringVector &OptionsCont::getStringVector(const std::string &name) const;
    +
    + +

    Using an inproper method yields an exception.

    +

    You may have noticed, that there is one method to retrieve a certain +value less than types available. The type Option_FileName returns a +string-vector, too. The only difference is their type which allows a different +processing of the values to set when parsing.

    +

    Please note, that it is good style to use the long (longest in fact) +name for retrieving an option's value and that the same name (synonyme) +should be used at all places. This makes it easier to locate this +option's usage.

    +

    Implementation#

    +

    All classes needed to store and process options can be found within +<SUMO_HOME>/src/utils/options/

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 15 October 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Simulation_Loop.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Simulation Loop - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Implementation Notes/Simulation Loop
    + + + +

    Basic#

    +

    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.

    +

    uml diagram

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 03 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Sumo_Modules.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,569 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Sumo Modules - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Implementation Notes/Sumo Modules
    + + + +

    Module Purposes#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    modulesubmodulesubmodulepurpose
    foreignsome imported modules (see Libraries Licenses)
    mersennesystem-independant random number generator
    fontstashdraws text in openGL
    rtreertree implementation
    tcpipportable socket implementation
    guiSUMO-GUI-specific windows and threads
    guinetloadderived from netload, these classes build guisim-classes instead of microsim-classes
    guisimclasses derived from microsim, extended by visualization and interaction methods
    iconsapplication icons (MS Windows)
    microsimimplementation of the micro simulation
    actionsoutput coupled to tls (rework! move to output?)
    deviceson-board devices (c2c, gsm)
    loggingvalue-passing classes (rework! move to utils?)
    outputgeneration of microsim-output
    traffic_lightsdifferent traffic light algorithms and program switching
    triggerclasses changing the state of microsim-structures (rework)
    netbuildbuilding/preparation of SUMO-networks
    netgengenerate abstract networks
    netloadloads SUMO-networks for simulation, builds microsim classes
    od2tripsImport and conversion of O/D-matrices to trip definitions
    polyconvertImport and conversion of named, colored, geometrical objects
    routerBase classes for routing applications
    routing_dfimplementation of df-routing based on router-classes
    routing_duaimplementation of dua-routing based on router-classes
    routing_jtrimplementation of jtr-routing based on router-classes
    utilssets of utility classes
    commonsome helpers with different purposes used by all applications
    distributiondifferent distribution representations
    foxtoolsextensions of the plain fox-toolkit
    geomgeometrical primitives in 2D (line, point, polygon)
    guisets of classes used by the gui
    divDifferent helper classes
    drawerDraw network structures, give them colors
    eventsEvents passed between gui-threads
    globjectsbase class for objects that may be visualized and "touched" within the gui
    imagesIcons and images used within the gui together with an allocating subsystem
    trackertime-line visualization
    windowsBase for windows
    importiohelper for reading text files
    iodevicesoutput devices
    optionsthe options subsystem used by all applications
    shapesnamed and colored geometry classes
    xmlxml-helper (basically a layer between the xerces-sax layer and sumo-applications)
    +

    Doxygen-Coverage#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    moduledoxygenthrowparamremarks
    microsim/outputyesyesyese2ol is completely broken and undocumented
    netgenyesyesyes
    od2tripsyesyesyes
    utils/gui/divyesyesyes
    utils/importioyesyesyes
    utils/iodevicesyesyesyes
    utils/optionsyesyesno
    utils/xmlyesyesno
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes/Vehicle_Models.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes/Vehicle Models - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Implementation Notes/Vehicle Models
    + + + +
    +

    Caution

    +

    Please note that this is a working document... No user documentation!

    +
    +

    Implementing new Car-Following Models#

    +

    A car-following model in SUMO is an implementation of the abstract class +MSCFModel (microsim/cfmodels/MSCFModel.h).

    +

    The following steps must be taken to add a new model:

    +
      +
    1. define a new model name in utils/common/SUMOXMLDefinitions.h and + .cpp
    2. +
    3. define model parameters in + utild/xml/SUMOVehicleParserHelper::getAllowedCFModelAttrs() (define + new attributes in SUMOXMLDefinitions if necessary)
    4. +
    5. add a new class to microsim/cfmodels (i.e. by copying one of the + existing classes there)
    6. +
    7. add this class to the build files (i.e. + microsim/cfmodels/Makefile.am when building on Linux)
    8. +
    9. add code that selects the new class based on the new name in + microsim/MSVehicleType::build()
    10. +
    +

    If your model needs persistent state you need to derive a class to hold +it from MSCFModel::VehicleVariables. See +microsim/cfmodels/MSCFModel_IDM as an example.

    +

    Defining Vehicle Types#

    +

    Before starting to hack, we should decide how vehicle type shall be +represented. Some facts and needs (unsorted):

    +
      +
    • ok Both the simulation and the routing + modules must be able to parse vehicle type definitions
    • +
    • It would be nice to allow a validation against XML Schemata
    • +
    • At least two sub-types must be able to be defined: car-following + model and lane-changing model (maybe the lane-changing model even + splits into a navigational and a tactical part)
    • +
    • ok Parameter should have default values
    • +
    • ok a default vehicle type must exist
    • +
    • Models differ in parameter sets
    • +
    +

    Possible Descriptions#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Index

    Sample

    pros/cons

    A

    <vtype cfModel="xxx" xxxParam1="..." xxxParam2="..." ...

      +
    • (-) hard to verify - parameter change in dependence to the value of "cfModel"
    • +

    B

    <vtype-XXX xxxParam1="..." xxxParam2="..." ...

      +
    • (-) large number of different elements needed
    • +

    C

    <cfmodel id="#id" model="xxx" param1="..." param2="..." .../><vtype cfModelId="#id" .../>

      +
    • (+) straight forward; many combinations possible
    • +
    • (+) is similar to how every vehicle references its vtype
    • +
    • (-) hard to verify - parameter change in dependence to the value of "cfModel"
    • +

    D

    <vtype cfModel="xxx" param1="..." param2="..." ...>

      +
    • (--) parameter sets differ between models
    • +
    • (-) hard to verify - parameter change in dependence to the value of "cfModel"
    • +

    E

    <vtype ...><cfmodel model="xxx" param1="..." param2="..." .../>

      +
    • (+) straight forward
    • +
    • (-) hard to verify - parameter change in dependence to the value of "cfModel"
    • +
    • 1 vote (Mayer)
    • +

    F

    <vtype ...><cfmodel-XXX model="xxx" param1="..." param2="..." .../>

      +
    • (+) straight forward
    • +
    • (-) large number of different elements needed
    • +
    • 2 votes (Behrisch, Krajzewicz)
    • +
    + +

    (currently) Chosen Description#

    +

    After some talks, the following description of vehicle types was chosen:

    +
    <vtype id="..." ...>
    +    <carFollowing-Krauss ...
    +    <laneChanging-DK2002 ...
    +</vtype>
    +
    +

    vtype will contain parameters which can +neither be counted to the lane-changing nor the car-following model, +such as the vehicle type's color, the width of the vehicle etc. which +are (currently) used for visualisation only. Also, the vehicle's length +and other parameter which are not only used by one of the models are +stored herein.

    +

    The embedded carFollowing-Krauss-Element in +this example describes the car-following model (Krauss in this case), +the laneChanging-DK2002 the lane-changing +model (Daniel Krajzewicz's from 2002 :-) ), each with their own +parameter.

    +

    The known vtype-definition is wanted to be +kept. In this case, the Krauss-model stays chosen per default.

    +
    +

    Note

    +

    Probably, it will not be possible to validate this against a schema.

    +
    +

    Car-following Model Interface#

    +

    Currently, it is assumed that the following methods should be +re-implemented for each model; the "generic" column should identify +those which may be same across models:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    methodgeneric?description
    ffeVno
    ffeSno
    maxNextSpeednointernal SUMO-tweak
    brakeGapmaybeshould depend on maximum deceleration (a rather common value) and physics, only
    approachingBrakeGapmaybealmost same as brakeGap, only not incorporating the driver's reaction time
    interactionGapno
    hasSafeGapno
    safeEmitGapno
    dawdleno
    decelAbilityrather no
    +

    Loading and Parsing Vehicle Types#

    +

    As already implemented for vehicles, a new intermediate structure +<SUMO_HOME>/src/utils/common/SUMOVTypeParameter which contains vehicle type +descriptions was added. When reading XML-definitions, both routers and +the simulation use the additionally implemented helper methods located +in <SUMO_HOME>/src/utils/xml/SUMOVehicleParserHelper for filling this structure.

    +

    SUMOVTypeParameter has member variables for those vehicle type +parameters which are assumed to be neither part of the car-following +model nor part of the lane-change model: id, length, maxSpeed, +defaultProbability, speedFactor, speedDev, emissionClass, +color, vehicleClass, width, offset, shape. These values are +initialised with defaults. When reading values, SUMOVehicleParserHelper +stores the information about which value was set from the XML +description in SUMOVTypeParameter::setParameter. This allows to save +(pass) only set values when writing the definitions back to a file - +routers need this.

    +

    Parameters of the car-following model are saved into a map, +SUMOVTypeParameter::cfParameter, the model's name to +SUMOVTypeParameter::cfModel. Note that lane-changing model parameter +handling is not implemented. The map contains only those parameter of +the model which were given in the read XML file; no defaults are +inserted at this time. In order to allow processing of old +vtype-definitions, parameter stored directly within the vtype-element +for the Krauss car-following model are stored within this map, too.

    +

    The routers consume the SUMOVTypeParameter class directly - making +ROVehicleType unnecessary. The simulation uses the new method +MSVehicleType::build for building the described MSVehicleType/MSCFModel +combination. Missing defaults are set within this method for obtaining +complete vehicle type/model descriptions.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Implementation_Notes.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Implementation_Notes.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + Developer/Implementation Notes - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Developer/Implementation Notes
    + + + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Main.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Main.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Main.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Main.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,328 @@ + + + + + + + + + + + + + + + + + + + Developer - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer
    + + + +

    Developer Documentation#

    + +

    Build instructions#

    + +

    How Tos#

    + +

    Methods, Algorithms, and Subsystems#

    + +

    Current Development#

    + +

    Continuous integration, code analysis and other external references#

    + +

    Text Snippets#

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 28 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Managing_Publications.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Managing_Publications.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Managing_Publications.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Managing_Publications.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + Developer/Managing Publications - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Managing Publications
    + + + +

    Publications are stored in an extended +bibtex-file +generated using JabRef.

    +

    Organising#

    +

    JabRef allows not only to enter your +references, but also to group them. We use the following way to organise +the references:

    +
      +
    • sumo: All that cite SUMO; in fact, there are some other +references in the bibtex-file, for example in case of reports on +projects where SUMO was used, but the paper itself does not mention +SUMO or papers on theory.
    • +
    • projects: a classification by the project
        +
      • iTETRIS: reports on work done in iTETRIS
      • +
      • ... further projects ...
      • +
      +
    • +
    • topic:
        +
      • V2X: vehicular communication papers
      • +
      • TLS: traffic lights paper
      • +
      • ... further topics ...
      • +
      +
    • +
    • organisation: a classification by organisation
        +
      • DLR/TS/VM: the traffic management group at the Institute of + Transportation Systems at the German Aerospace Center
      • +
      • ... further organisations ...
      • +
      +
    • +
    +

    When adding a new entry, please complete its description, first. Then, +right-click on the entry in the list and assign it to the groups it +belongs to - at least organisation and topics.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Network_Building_Process.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Network_Building_Process.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Network_Building_Process.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Network_Building_Process.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,794 @@ + + + + + + + + + + + + + + + + + + + Developer/Network Building Process - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Network Building Process
    + + + +

    NETCONVERT, +NETGENERATE, and NETEDIT +share the same process of building networks which is started as soon as +data are read (in NETCONVERT) or after an +internal description is generated (in +NETGENERATE).

    +

    The process requires that at least nodes and edges are given, optionally +also connections between edges and/or lanes and other optional +information. Hints about how the network shall be built - whether +turnarounds or highway on/off-ramps shall be added, traffic lights or +roundabouts shall be guessed, etc. are retrieved from the options.

    +

    Below, you may find a list of all steps performed while building the +network. Optional steps are in italics.

    +
      +
    1. Modifying the sets of nodes and edges
        +
      1. Joining junction clusters
      2. +
      3. Removing self-loops
      4. +
      5. Removing isolated roads
      6. +
      7. Removing unwished edges
      8. +
      9. Removing empty nodes and geometry nodes
      10. +
      11. Joining similar edges
      12. +
      13. Splitting geometry edges
      14. +
      15. Guessing and setting on-/off-ramps
      16. +
      +
    2. +
    3. Moving network to origin
    4. +
    5. TLS position computation
        +
      1. Assigning nodes to traffic lights
      2. +
      3. Joining traffic light nodes
      4. +
      +
    6. +
    7. Computing connections between lanes
        +
      1. Computing turning directions
      2. +
      3. Sorting nodes' edges
      4. +
      5. Computing Approached Edges
      6. +
      7. Computing Approaching Lanes
      8. +
      9. Dividing of Lanes on Approached Lanes
      10. +
      11. Appending Turnarounds
      12. +
      13. Rechecking of lane endings
      14. +
      +
    8. +
    9. Geometry computation
        +
      1. Computing node shapes
      2. +
      3. Computing edge shapes
      4. +
      +
    10. +
    11. Computing right-of-way and traffic light programs
        +
      1. Computing tls logics
      2. +
      3. Computing node logics
      4. +
      5. Computing traffic light logics
      6. +
      +
    12. +
    13. Finishing inner edges
    14. +
    +

    These computation steps are perfomed within void +NBNetBuilder::compute(OptionsCont &oc). These steps are described more +detailed in the following.

    +

    Steps#

    +
      +
    • pre-condition: All input is read
    • +
    • pre-condition: Nodes have: id, cartesian coordinates, type +(optional, may change)
    • +
    • pre-condition: Edges have: valid from/to-nodes, lane number, max. +speed limits, allowed vehicle classes, geometry (may change), +typeID, lane spread information, name (optional), priority +information (optional)
    • +
    +

    #1: Modifying the sets of nodes and edges#

    +

    Purpose: Remove unwished edges/nodes from the internal +representation; add geometry nodes if wished +post-condition: all unwished elements (nodes, edges) are removed, +geometry nodes are inserted/removed if wished, attributes as above

    +

    The following sub-steps are done:

    +
      +
    • +

      joinJunctions ('Joining junction clusters'): build node clusters

      +

      Purpose: Join network graph nodes which form a single +intersection. +post-condition: junction joined, attributes as above +affects: removes and adds nodes, removes edges, remapps +connections (tbd) +state: tbd

      +
    • +
    +
      +
    • +

      removeSelfLoops ('Removing self-loops'): remove all edges + where the from-node is the same as the to-node

      +

      post-condition: Each edge is a uni-directional connection between +two different nodes (ok) +state: green for me, though I am not sure why lists of edges are +built which are then given to remapping methods; wouldn't it be +enough to check within the remapping method whether a connection +exists?

      +
    • +
    +
      +
    • +

      joinSimilarEdges ('Joining similar edges'): "join" edges which + connect the same nodes

      +

      post-condition: No two edges with same geometry connecting same +nodes exist +state: yellow, as there are two comments in the code, one about a +bug, a second one about a missing check for vclasses; should be +revisited (why it's here, what would happen if not) +comment: ? Earlier, only one road could connect same +intersections; not now. Why, explain, how does it work? +comment: This method uses two magic numbers to determine whether +edges are "similar": +distanceThreshold = 7.; // don't merge edges further apart +lengthThreshold = 0.10; // don't merge edges with higher relative +length-difference

      +
    • +
    +
      +
    • +

      removeIsolatedRoads ('Finding isolated roads'): remove edges + which are isolated (not part of the network)

      +

      post-condition: ? not defined somewhere +state: yellow; the method is pretty large, and there is no removal +of edges within the tls control; how does it work? +comment: Should be revisited

      +
    • +
    +
      +
    • +

      removeUnwishedEdges ('Removing unwished edges'): Removes edges + not in myEdges2Keep

      +

      post-condition: not wanted edges are no longer in the internal +containers (ok) +state: yellow; the complete keep/remove/keep-postload - stuff +should be revisited

      +
    • +
    +
      +
    • +

      removeUnwishedNodes ('Removing empty nodes and geometry nodes' + or 'Removing empty nodes'): Removes useless nodes

      +

      post-condition: empty nodes, nodes with no incoming/outgoing +edges, are removed (ok) +post-condition: nodes which only affect the geometry of an edge +are removed if wished (ok) +state: yellow; should be done in two steps for a cleaner code; +additionally, we had the bug that empty acosta nodes where still in +the network; is this solved?

      +
    • +
    +
      +
    • +

      splitGeometry ('Splitting geometry edges'): Splits edges at + geometry positions

      +

      post-condition: If wished, edges have a line-geometry only +state: yellow; the naming of built nodes is not proper

      +
    • +
    +
      +
    • +

      Guessing on-/off-ramps (Guessing and setting on-/off-ramps)

      +

      Purpose: Add missing on-/off-ramps +state: tbd

      +
    • +
    +

    As a result, the internal representation of the read/generated network +contains the sets of nodes/edges the user wanted.

    +

    #2: Moving network to origin#

    +

    Purpose: Let network coordinates start at 0,0 +state: green

    +

    #3: TLS position computation#

    +

    Purpose: Let nodes know whether they are controlled by traffic +lights

    +
      +
    • +

      guessTLs ('Assigning nodes to traffic lights')

      +

      post-condition: empty nodes, nodes with no incoming/outgoing +edges, are removed (ok) +state: tbd

      +
    • +
    +
      +
    • +

      joinTLS ('Joining traffic light nodes')

      +

      post-condition: empty nodes, nodes with no incoming/outgoing +edges, are removed (ok) +state: tbd

      +
    • +
    +

    #4: Connections Computation#

    +

    Purpose: Determine and/or assign connections over intersections +between lanes

    +

    Computing turning directions#

    +
      +
    • code: NBTurningDirectionsComputer::computeTurnDirections(...);
    • +
    • post-condition: The edge knows its turnaround direction, if +existing.
    • +
    • reason: Turnarounds are treated differently in the following +steps than other directions of driving.
    • +
    • how
    • +
    +

    For each combination of an incoming and an outgoing edge, which may be +connected, we compute the angle between them. If this angle is >160°, +we assume that this may be a turnaround. We add 360° to this angle if +both edges connect same both nodes in different direction. We store the +edge pairs with angle into a list sorted decreasing by the angle. After +all combinations are computed, we go through the list and set those as +turnarounds which we see at first, marking both the incoming and the +outgoing edge as already seen what avoids to use them twice. We warn if +an edge occures twice with an angle >360° - multiple edges connecting +two same nodes.

    +
      +
    • +

      state: yellow

      +

      the check for being connected should be omitted, here, see +inline-documentation +as usual, you may find pathological intersections

      +
    • +
    +

    Sorting nodes' edges#

    +
      +
    • code: NBNodesEdgesSorter::sortNodesEdges(...);
    • +
    • post-condition: each node's edges (incoming, outgoing, and all) +are sorted clockwise, starting at 12 o'clock. Incoming edges with +same angle as the according outgoing are before the outgoing one in +the list of all edges.
    • +
    • reason: this order is assumed to be given in following +computation steps
    • +
    • how
    • +
    +

    We sort a node's edge vectors (incoming, outgoing, all), first. Then, we +go through the vector of all edges and exchange an incoming and an +outgoing edge if both have the same angle, and the incoming is after the +outgoing (determined using "isTurningDirection").

    +
      +
    • +

      state: yellow

      +

      unvalidated for left-hand networks +the method uses the method "NBEdge::isTurningDirectionAt(...)" +which is not a plain usage of the turnaround computation +performed earlier

      +
    • +
    +

    Computing node types#

    +
      +
    • code: NBNodeTypeComputer::computeNodeTypes(...);
    • +
    • post-condition: Each node has one of the following types: +NODETYPE_PRIORITY_JUNCTION, NODETYPE_RIGHT_BEFORE_LEFT, +NODETYPE_TRAFFIC_LIGHT, NODETYPE_NOJUNCTION(?).
    • +
    • reason: We need this to compute the right-of-way rules.
    • +
    • how
    • +
    +

    We investigate each node by itself. We check some special cases, first:

    +
      +
    • if the type is already set (myType != NODETYPE_UNKNOWN) -> skip
    • +
    • if we have only one incoming edge -> set to + NODETYPE_PRIORITY_JUNCTION
    • +
    • if it is a simple continuation -> set to + NODETYPE_PRIORITY_JUNCTION
    • +
    +

    At first, we assume the intersection is a NODETYPE_RIGHT_BEFORE_LEFT +intersection. We then go through all incoming edge combinations which +are not opposite. As soon as we encounter one where the speed limit +between both edges differs by more than 10km/h (approx.), we set the +type to NODETYPE_PRIORITY_JUNCTION. This is also the case if one of +the edges has a speed limit of more than 49km/h (we use this value to +avoid floating point issues).

    +
      +
    • +

      state: yellow

      +

      investigate whether NODETYPE_NOJUNCTION can be set earlier (by +the user) +the used method "getOppositeIncoming" should be revalidated

      +
    • +
    +

    Computing priorities#

    +
      +
    • code: NBEdgePriorityComputer::computeEdgePriorities(...);
    • +
    • post-condition: Each edge has a priority at the node it starts +and ends at. The priorities at the start and the end node may +differ. An edge has either the priority 1 (higher prioritized) or 0 +(lower prioritized or all equal).
    • +
    • reason: We need this to compute the right-of-way rules.
    • +
    • how
    • +
    +

    All priorities are initialised to 0.

    +
      +
    • state: orange
    • +
    +

    #5: Geometry computation#

    +

    #6: Computing right-of-way and traffic light programs#

    +

    #7: Finishing inner edges (optional)#

    +

    OLD#

    +

    Steps #9-#10: Computing certain signalling/right-of-ways#

    +

    Steps #11-#17: Computing and setting lane-to-lane connections#

    +

    Steps #18-#19: Computing geometries#

    +

    I am currently concerned with the edge shapes, because even a eworld or +a TrafficModeler export stops here in debug mode. It is in +NBEdge::computeEdgeShape. (Actually, as far as I understand this method, +it is about the lane shapes of this edge.) In this algorithm, the +following three cases must be distinguished:

    + + + + + + + + + + + + + + + + + + + + + +
    <File:laneShapeIntersectsWithNodeShape.png>The edge shape intersects with the node shape. Then, the shape is trimmed to the intersection point. This looks quite reasonable.
    <File:laneShapeOutsideOfNodeShape.png>The edge shape is outside the node shape. The the present algorithm extrapolates the last line of the edge shape and enlarges the edge to the new intersection point. This looks reasonable to me as well.
    <File:laneShapeInsideOfNodeShape.png>The edge shape is completely within the node shape. What should happen here? (The red dots show, what netconvert does at present.)
    +

    So I am wondering, what the right behaviour of netconvert would be in +the third case.

    +

    Steps #20-#22: Computing right-of-way rules#

    +

    Steps #23: Applying additional offset#

    +

    Table#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Actionaffects
    nodesedgesconnections
    Adapting the inputxxx
    'Building node clusters'xxx
    'Removing self-loops'xx
    'Joining similar edges'
    'Finding isolated roads'
    'Removing unwished edges'
    'Removing empty nodes and geometry nodes' or 'Removing empty nodes'
    'Splitting geometry edges'
    'Guessing and setting on-/off-ramps'
    Moving network to origin
    TLS position computation
    Assigning nodes to traffic lights
    Joining traffic light nodes
    Computing connections between lanes
    Computing turning directions
    Sorting nodes' edges
    Computing Approached Edges
    Computing Approaching Lanes
    Dividing of Lanes on Approached Lanes
    Appending Turnarounds (optional)
    Rechecking of lane endings
    Geometry computation
    Computing node shapes
    Computing edge shapes
    Computing right-of-way and traffic light programs
    Computing tls logics
    Computing node logics
    Computing traffic light logics
    Finishing inner edges (optional)
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Nightly_Build.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Nightly_Build.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Nightly_Build.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Nightly_Build.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,382 @@ + + + + + + + + + + + + + + + + + + + Developer/Nightly Build - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Nightly Build
    + + + +

    There are two main scripts responsible for the nightly build process +which are <SUMO_HOME>/tools/build/dailyUpdateMakeGCC.sh (for the linux part) and <SUMO_HOME>/tools/build/dailyBuildMSVC.py for Windows. Essentially they both +perform the following steps:

    +
      +
    1. git pull
    2. +
    3. do a clean build (release and debug version)
    4. +
    5. run unittests (currently linux only)
    6. +
    7. build and upload packages
    8. +
    9. build and upload documentation (linux only)
    10. +
    11. run the acceptance tests (texttest)
    12. +
    13. upload test results
    14. +
    +

    All the results can be found in the daily dir on the sumo web +space, also see +Downloads#Nightly_Snapshots. +Coverage information based on running the nightly tests is generated as +well. The status can be found at the sumo web +space.

    +

    There is also a local copy in the Sumo/daily directory (including +the most recent game scenarios) the DLR internal tsall NAS. The windows +script uses the sumo-all package from the local dir to build the binary +distributable zip and the game zip.

    +

    One final step is to trigger the nightly build on the opensuse build +service. This is achieved via uploading a new spec file via a cronjob, +which triggers an automatic download of the sources and a rebuild. All +errors and test result e-mails are directed to the sumo-tests list at +dlr.de, except for the build service errors which go to a private +account since the build is currently in a private project.

    +

    Continuous integration#

    +

    There are continuous integration builds on +Travis and on +AppVeyor. +Both are configured such that they cancel a running build when a +new commit occurs, so we do not have build results for all commits +(but we avoid a large backlog this way).

    +

    To get build logs click on the marker beside the commit +message (red cross, yellow circle or green tick) and choose details +for the build in question.

    +

    The AppVeyor build also provides the binaries as download (currently +for about six months after the commit). To download choose details +using the marker (as above) for the commit from +https://github.com/eclipse/sumo/commits/master and then choose the +Visual Studio version in question (when in doubt use the latest version) +and click on artifacts where a bin.zip should be available.

    +

    Platforms and tests#

    +
      +
    • "sumo" refers to the vanilla Eclipse SUMO version without optional libraries
    • +
    • "extra" means the variant with GDAL, OSG and FFMPEG + running mesoscopic and python3 tests
    • +
    • the clang build has debugging code enabled via the configure option + "--enable-debug"
    • +
    • all start times are local Berlin time
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    variantplatform / compilerstart timeestimated duration
    sumoWin32 msvc1201:001h
    sumoWin64 msvc12(after 32bit)4h
    extraWin64 msvc1207:002h
    sumoubuntu64 gcc00:003h
    extraubuntu64 gcc07:001h
    sumoubuntu64 clang03:004h
    extraubuntu64 clang08:001.5h
    sumoMacOS clang00:001h
    +

    Scenario tests#

    +
      +
    • "scenario" refers to the internal tests available at +source:trunk/tests and includes the default and the daily tests
        +
      • "weekly" are the weekly test suites of the internal tests + available at source:trunk/tests
      • +
      • all scenario tests run with the "extra" variant of sumo
      • +
      +
    • +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    variantplatformstart timeestimated duration
    scenario64 bit gcc02:005h ?
    scenario weekly64 bit gcc02:00 (only sa)72h ?
    scenario64 bit clang02:00 (only mo-fr)8h ?
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 20 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/PythonFileTemplate.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/PythonFileTemplate.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/PythonFileTemplate.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/PythonFileTemplate.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + Developer/PythonFileTemplate - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Developer/PythonFileTemplate
    + + + +
    #!/usr/bin/env python # Leave this one out for non executable python files
    +# -*- coding: utf-8 -*- # optional encoding line, use if non-ASCII characters are in the code
    +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
    +# Copyright (C) <YEAR OF CREATION>-<CURRENT YEAR> German Aerospace Center (DLR) and others.
    +# This program and the accompanying materials are 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    <FILENAME>
    +# @author  <AUTHOR'S NAME, ONE SEPARATE LINE FOR EACH AUTHOR>
    +# @author  <AUTHOR'S NAME 2>
    +# @date    <FILE CREATION DATE>
    +
    +"""
    +<A BRIEF DESCRIPTION OF THE FILE'S CONTENTS>
    +
    +<more documentation including examples>
    +"""
    +
    +from __future__ import print_function
    +from __future__ import absolute_import
    +
    +import os  # imports one per line
    +import sys
    +import ...
    +
    +# use the following when you depend on sumolib or traci
    +sys.path.append(os.path.join(os.environ["SUMO_HOME"], 'tools'))
    +import sumolib  # noqa
    +# the noqa is needed to tell the style checker that it is OK to have an import which is not at the top of the file
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 18 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Tests.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Tests.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Tests.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Tests.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,514 @@ + + + + + + + + + + + + + + + + + + + Developer/Tests - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/Tests
    + + + +

    Introduction#

    +

    We use TextTest to test whether the software +still behaves as expected. TextTest compares an application's file +output, including the output to stdout and stderr with predefined +outputs from files.

    +

    There are some advantages and disadvantages of this approach. On the one +hand, you can guarantee that the application is doing what is wanted by +comparing all outputs with files you think are right. But this is also +the problem with this approach: you do not have the assurance that the +files you are comparing the current outputs to are right - you have to +prepare them once and update/verify them again every time the expected +results change.

    +

    At the moment all our [Developer/Nightly_Build tests run each night] +with the results on this summary webpage.

    +

    Setup#

    +

    We use TextTest as our testing environment which +is Python based and currently available for Python 2 only. To install +it, you can open a terminal / Windows console and type:

    +
    pip install texttest
    +
    + +

    on all platforms, but it will not pull in the dependencies, so you need +to follow the TextTest installation +instructions +and the additional info here.

    +

    Windows Setup#

    +

    You will need the following software (at least for a setup with GUI)

    + +

    Visual guide:

    +

    +Python path shouldn't include whitespaces

    +

    +Python requieres a full installation

    +

    +PyGTK must be installed in the same folder of Python

    +

    +TkDiff path shouldn't include whitespaces

    +

    +Check that python works typing "Python" in CMD.

    +

    Type "quit()" to exit + +Type pip install texttest to install TextTest automatically from Python repository

    +

    +Every value of environment variable "PATH" must be separated with ";"

    +

    +If Installation was successfully, this window will appear after execution of "runAllTests.bat"

    +

    Linux setup#

    +

    This is much easier because at least with recent distributions there is +probably everything included. With openSUSE 10.2 you need python-gtk and +python-cairo as well as tkdiff before installing TextTest. If you don't +need the GUI you can probably even skip these.

    +

    MacOS setup#

    +
      +
    1. Follow the steps + here
    2. +
    3. If you have multiple python versions (2.x/3.x) installed (see + here), make sure that + your pip points to version 2.x
    4. +
    5. Install TextTest via pip: + pip install texttest
    6. +
    +

    Customize configuration#

    +

    Common options added to the personal config file +$HOME/.texttest/config are the used diff-viewer, editor, and the flag +to collapse the static test suites on program start. E.g.:

    +
       diff_program:meld
    +   view_program:geany
    +   static_collapse_suites:1
    +
    + +

    Running the Tests#

    +

    Within the <SUMO_HOME>/tests - folder you can find batch-files which start +TextTest with our test suites. "runAllTests.bat" +starts TextTest for testing all applications located in the folder, +"runNetconvertTests.bat" will only show tests for NETCONVERT, +"runDuarouterTests.bat" only those for DUAROUTER etc.

    +

    Adding a Test to an existing Application#

    +

    The easiest method is probably to copy an existing test using the +TextTest GUI context menu functions (copy/paste). Then you can modify +the copied input files, run the test once and save the expected results. +Note, that input files may be picked up along the folder hierarchy so +you may have to copy additional files to your test folder manually if +these inherited input files must be changed as well.

    +

    Adding an Application Test Suite#

    +

    To add a test suite for a new application, you have to perform the +following steps. For the examples below we'll use "polyconvert" as the +example application.

    +
      +
    • go to <SUMO_HOME>/tests
    • +
    • copy one of the run...Tests.bat-files and rename it properly + (runPolyconvertTests.bat in our case); change the name of the + application within it. In our case the resulting file will look as + this:
    • +
    +
    call %~dp0\testEnv.bat %1
    +start %TEXTTESTPY% -a polyconvert
    +
    + +
      +
    • add the application to the list of applications that are tested each +night by
        +
      • adding it to runTests.sh; in our case, the following line + was added:
      • +
      +
    • +
    +
    export POLYCONVERT_BINARY="$SUMO_BINDIR/polyconvert"
    +
    + +
      +
    • adding it to testEnv.bat; in our case, the following line was added:
    • +
    +
    set POLYCONVERT_BINARY=%~dp0\..\bin\polyconvert%1.exe
    +
    + +
      +
    • build a test folder for the application, named as the application + itself (without the ".exe" extension), in our case the folder is + named polyconvert
    • +
    • go the folder
    • +
    • build a configuration file; its name is "config", the extension is + the application's to test name, so in our case it's + config.polyconvert. Please consult + TextTest documentation about the content, + nonetheless, here are some notes
        +
      • do not forget the import of the main config file (config_all)
      • +
      • name the binary correct
      • +
      • name the file name properly in output
      • +
      • In all files that are collated, Version should be ignored - + the tests should be working along all versions
      • +
      +
    • +
    +

    The initial file looks as following:

    +
    import_config_file:../config_all
    +binary:$POLYCONVERT_BINARY
    +copy_test_path:input_net.net.xml
    +[collate_file]
    +config:config.cfg
    +log:log.txt
    +[run_dependent_text]
    +output:polyconvert.exe{REPLACE polyconvert}
    +net:Version
    +
    + +
      +
    • build a top-level testsuite file; its name is "testsuite", the +extension is the application's to test name, so in our case it's +testsuite.polyconvert
        +
      • I suppose, it is a good idea to start with tests of meta-output; + Simply copy them from another application and patch the file + names...
      • +
      +
    • +
    +

    Example of use#

    +

    The main function of existing test is to verify that a modification of a +function does not affect the final output, comparing the output of our +modification in SUMO with a with an previously tested output control +file. Note that SUMO must be compiled in release mode for testing. +To show an example of use, the MSDevice_Battery.cpp file will be +modified to include an error in the output file battery.xml. Once +modified the line, run executable runSumoTests.bat and find the test +sumo/extended/electric/braunschweig, and then right click to run the +test

    +

    +Manual error

    +

    +Running test

    +

    After execution can be observed that the battery.sumo file is marked +in red. That means that the execution of our SUMO modification generated +a different battery output than expected. If the file marked in red was +errors.sumo, it means that our modification of SUMO has caused a +runtime error, and finally if the file marked in red is output.sumo, +it means that SUMO generated some warning during execution. +Double-clicking on the red box battery.sumo opens ''TkDiffv +automatically, and displays the differences of our battery output with +respect to the original battery output control file.

    +

    +Error in battery.sumo

    +

    +Detail of the error comparing both battery.sumo

    +

    At this point, we undone the modification in MSDevice_battery.cpp +which caused the error, and compile. Once compiled, we will again right +click over the failed text and press rerun. A new dialog will be +opened, and then click over Accept, and test will be repeated. After +the new test run no error is displayed.

    +

    +Undo error

    +

    +Repeating test

    +

    After clicking on the check box next to the green message Succeeded +can be observed that all output shown in green, and at the bottom appear +a message indicating that the test has been succeeded.

    +

    +Test succeeded

    +

    +Details of the test succeeded

    +

    Organization of Tests#

    +

    Our TextTest tests can be grouped into the categories described below

    +

    Application Tests#

    +

    These tests are for the executable files in the bin folder such as +NETCONVERT, DUAROUTER +and SUMO. They work by running their application once +with a predefined set of input files and compare against expected output +files. The tests for sumo run once with the GUI version and once without +GUI..

    +

    Tool Tests#

    +

    These tests are for the python tools in the tools folder such as +randomTrips.py and +flowRouter.py. Instead of +defining a new application for each tool (as is the standard for +TextTest) they all call the tests/toolrunner.py script and select the +actual python tool to test via options. Be aware that the script to use +is always listed last in the options file (this is due to TextTest +trying to reorder options cleverly).

    +

    Complex Tests#

    +

    These tests go beyond calling an application once. Each tests defines a +runner.py script which performs arbitrary application calls. This is +used to call netconvert multiple times to perform back-and-forth format +conversions or to test tutorials where first the network is generated +and afterwards simulation is performed. They are also used for testing +the traci python client (runner.py is a traci script in this case).

    +

    Interactive GUI Tests#

    +

    These tests are currently only active for NETEDIT +and are described in more detail on the page +Developer/GUI_Testing.

    +

    Extra Tests#

    +

    These tests run one or multiple of the test suites above with additional +options or a different python interpreter and are usually not run using +a batch file but the runExtraTests.py. To enable python3 tests you need +to have an executable named python3 in your PATH (which is usually there +on Linux). On Windows you will need to add it by copying the existing +python.exe in your python3 installation to python3.exe (in the same +directory) and adding that directory to the end of your PATH (if it is +not already there).

    +

    Running tests outside TextTest#

    +

    Different methods to extract TextTest tests (offline and online) are explained here.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 28 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Unit_Tests.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Unit_Tests.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Unit_Tests.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Unit_Tests.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Developer/Unit Tests - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Developer/Unit Tests
    + + + +

    Introduction#

    +

    The Unit Tests for SUMO are carried out with the help of the Framework +Google Test. With Google Test +new Unit Tests can be simple added or existing tests extended. All +available tests are executed daily and it is checked whether these tests +run through successfully. This installation guide is for the version +1.4.0 to 1.6.0 of Google Test.

    +

    Windows Setup#

    +

    Please clone the +SUMOLibraries and set the +environment variable SUMO_LIBRARIES to the checkout directory. Google +Test should be found and set up automatically then.

    +

    Linux setup#

    +

    Ubuntu and the CMake build#

    +

    For newer Ubuntu and GTest versions follow this +recipe, +which boils down to:

    +
    sudo apt install libgtest-dev build-essential cmake
    +cd /usr/src/googletest
    +sudo cmake .
    +sudo cmake --build . --target install
    +
    + +

    At least the cmake build from sumo will now pick up Google Test +correctly.

    +

    Legacy#

    +

    After downloading you have to executed the following commands in the +Google Test directory:

    +
    ./configure
    +make
    +sudo make install
    +
    + +

    Now all libraries are installed in the system directory /usr/local or +/usr/bin. Before the Unit Tests can be executed, you must build SUMO +with an additional input parameter:

    +
    ./configure --with-gtest=DIR (DIR=installation directory of GoogleTest)
    +
    + +

    If new Unit Test files are added under unittest/src, the Makefiles +must be updated in order to run all tests.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/Used_Tools.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/Used_Tools.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/Used_Tools.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/Used_Tools.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + Developer/Used Tools - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Developer/Used Tools
    + + + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Developer/XML_Validation.html sumo-1.6.0+dfsg1/docs/userdoc/Developer/XML_Validation.html --- sumo-1.5.0+dfsg1/docs/userdoc/Developer/XML_Validation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Developer/XML_Validation.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,307 @@ + + + + + + + + + + + + + + + + + + + Developer/XML Validation - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Developer/XML Validation
    + + + +

    Status Quo (2018-10-12)#

    +
      +
    • The current build scripts for windows and linux execute +schemaCheck.py +as part of the regular tool tests with results visible on the daily +build page (see for instance the schema +check tests on the very end of the 64bit linux tool tests +page).
    • +
    • This script uses +lxml (if +available) or +Sax2Count (on +windows only). The latter comes together with the binary xerces +windows distribution.
    • +
    • Only files which have a schema declaration in the root element and +are of the following type (and fit the following naming scheme) are +checked:
        +
      • netconvert inputs
          +
        • edges "*.edg.xml"
        • +
        • nodes "*.nod.xml"
        • +
        • connections "*.con.xml"
        • +
        • types "*.typ.xml"
        • +
        +
      • +
      • sumo nets "*.net.xml", "net.netgen", "net.netconvert"
      • +
      • route files "*.rou.xml", "routes.duarouter", "alts.duarouter", + "routes.jtrrouter" including vehroutes output
      • +
      • additional files "*.add.xml"
      • +
      • configuration files "*.????cfg"
      • +
      • sumo rawdump (netstate), detector (e1 and e2) and edgedata (net, + emissions and noise) outputs
      • +
      +
    • +
    • There is the possibility to generate the XML schema for the +configurations (command line option --save-schema <FILE>)
    • +
    • XML validation can be configured for all binary executables using --xml-validation
    • +
    +

    portable testing application (only kept for reference)#

    +

    28.10.2009: I made a small search on possible tools for validating XML +files which are using Python. It seems as two are majorly used:

    + +

    further candidates:

    + +

    A short comparison:

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    lxmlXSVxmlprocminixsv
    Execution Typelibraryapplicationlibrarylibrary
    Dependencieslibxml 2.6.21 or later, libxslt 1.1.15??genxmlif
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/DFROUTER.html sumo-1.6.0+dfsg1/docs/userdoc/DFROUTER.html --- sumo-1.5.0+dfsg1/docs/userdoc/DFROUTER.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/DFROUTER.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,673 @@ + + + + + + + + + + + + + + + + + + + DFROUTER - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + DFROUTER
    + + + +

    From 30.000 feet#

    +

    DFROUTER uses induction loop values to compute vehicle routes that +may be used by SUMO.

    +
      +
    • Purpose: Building vehicle routes from induction loop counts
    • +
    • System: portable (Linux/Windows is tested); runs on command line
    • +
    • +

      Input (mandatory):

      +

      A) a road network as generated via NETCONVERT or NETGENERATE, see Building Networks

      +

      B) induction loop definitions

      +

      C) induction loop measures

      +
    • +
    + +

    Usage Description#

    +

    A high level description can be found at +Demand/Routes_from_Observation_Points. +The complete list of options is given in the following.

    +

    Options#

    +

    You may use a XML schema definition file for setting up a DFROUTER +configuration: +dfrouterConfiguration.xsd.

    +

    Configuration#

    +

    All applications of the SUMO-suite handle configuration options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Configuration Files.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -c <FILE>
    --configuration-file <FILE>
    Loads the named config on startup
    -C <FILE>
    --save-configuration <FILE>
    Saves current configuration into FILE
    --save-template <FILE>Saves a configuration template (empty) into FILE
    --save-schema <FILE>Saves the configuration schema into FILE
    --save-commented <BOOL>Adds comments to saved template, configuration, or schema; default: false
    +

    Input#

    + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -n <FILE>
    --net-file <FILE>
    Loads the SUMO-network FILE
    -d <FILE>
    --detector-files <FILE>
    Loads detector descriptions from FILE
    -f <FILE>
    --measure-files <FILE>
    Loads detector flows from FILE(s)
    +

    Output#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --write-license <BOOL>Include license info into every output file; default: false
    --output-prefix <STRING>Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.
    --precision <INT>Defines the number of digits after the comma for floating point output; default: 2
    --precision.geo <INT>Defines the number of digits after the comma for lon,lat output; default: 6
    -H <BOOL>
    --human-readable-time <BOOL>
    Write time values as hour:minute:second or day:hour:minute:second rathern than seconds; default: false
    -o <FILE>
    --routes-output <FILE>
    Saves computed routes to FILE
    --routes-for-all <BOOL>Forces DFROUTER to compute routes for in-between detectors; default: false
    --detector-output <FILE>Saves typed detectors to FILE
    --detectors-poi-output <FILE>Saves detector positions as pois to FILE
    --emitters-output <FILE>Saves emitter definitions for source detectors to FILE
    --vtype <BOOL>Add vehicle types to the emitters file (PKW, LKW); default: false
    --vtype-output <FILE>Write generated vehicle types into separate FILE instead of including them into the emitters-output
    --emitters-poi-output <FILE>Saves emitter positions as pois to FILE
    --variable-speed-sign-output <FILE>Saves variable seed sign definitions for sink detectors to FILE
    --end-reroute-output <FILE>Saves rerouter definitions for sink detectors to FILE
    --validation-output <FILE>
    --validation-output.add-sources <BOOL>; default: false
    +

    Processing#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --guess-empty-flows <BOOL>Derive missing flow values from upstream or downstream (not working!); default: false
    -h <BOOL>
    --highway-mode <BOOL>
    Switches to highway-mode; default: false
    --ignore-invalid-detectors <BOOL>Only warn about unparseable detectors; default: false
    --revalidate-detectors <BOOL>Recomputes detector types even if given; default: false
    --revalidate-routes <BOOL>Recomputes routes even if given; default: false
    --keep-unfinished-routes <BOOL>Keeps routes even if they have exhausted max-search-depth; default: false
    --keep-longer-routes <BOOL>Keeps routes even if a shorter one exists; default: false
    --max-search-depth <INT>Number of edges to follow a route without passing a detector; default: 30
    --emissions-only <BOOL>Writes only emission times; default: false
    --disallowed-edgesDo not route on these edges
    --keep-turnarounds <BOOL>Allow turnarounds as route continuations; default: false
    --min-route-length <FLOAT>Minimum distance in meters between start and end node of every route; default: -1
    --randomize-flows <BOOL>generate random departure times for emitted vehicles; default: false
    --time-factor <TIME>Multiply flow times with TIME to get seconds; default: 60
    --time-offset <TIME>Subtracts TIME seconds from (scaled) flow times; default: 0
    --time-step <TIME>Expected distance between two successive data sets; default: 60
    --calibrator-output <BOOL>Write calibrators to FILE; default: false
    --include-unused-routes <BOOL>; default: false
    --revalidate-flows <BOOL>; default: false
    --remove-empty-detectors <BOOL>Removes empty detectors from the list; default: false
    --strict-sources <BOOL>; default: false
    --respect-concurrent-inflows <BOOL>Try to determine further inflows to an inbetween detector when computing split probabilities; default: false
    --scale <FLOAT>Scale factor for flows; default: 1
    +

    Defaults#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --departlane <STRING>Assigns a default depart lane
    --departpos <STRING>Assigns a default depart position
    --departspeed <STRING>Assigns a default depart speed
    --arrivallane <STRING>Assigns a default arrival lane
    --arrivalpos <STRING>Assigns a default arrival position
    --arrivalspeed <STRING>Assigns a default arrival speed
    --speeddev <FLOAT>The default speed deviation of vehicles; default: 0.1
    +

    Time#

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    -b <TIME>
    --begin <TIME>
    Defines the begin time; Previous defs will be discarded; default: 0
    -e <TIME>
    --end <TIME>
    Defines the end time; Later defs will be discarded; Defaults to one day; default: 86400
    +

    Report#

    +

    All applications of the SUMO-suite handle most of the reporting +options the same way. These options are discussed at Basics/Using the +Command Line Applications#Reporting +Options.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -v <BOOL>
    --verbose <BOOL>
    Switches to verbose output; default: false
    --print-options <BOOL>Prints option values before processing; default: false
    -? <BOOL>
    --help <BOOL>
    Prints this screen or selected topics; default: false
    -V <BOOL>
    --version <BOOL>
    Prints the current version; default: false
    -X <STRING>
    --xml-validation <STRING>
    Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto
    --xml-validation.net <STRING>Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never
    -W <BOOL>
    --no-warnings <BOOL>
    Disables output of warnings; default: false
    --aggregate-warnings <INT>Aggregate warnings of the same type whenever more than INT occur; default: -1
    -l <FILE>
    --log <FILE>
    Writes all messages to FILE (implies verbose)
    --message-log <FILE>Writes all non-error messages to FILE (implies verbose)
    --error-log <FILE>Writes all warnings and errors to FILE
    --report-empty-detectors <BOOL>Lists detectors with no flow (enable -v); default: false
    --print-absolute-flows <BOOL>Prints aggregated detector flows; default: false
    --no-step-log <BOOL>Disable console output of route parsing step; default: false
    +

    Random Number#

    +

    All applications of the SUMO-suite handle randomisation options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Random Number +Options.

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    --random <BOOL>Initialises the random number generator with the current system time; default: false
    --seed <INT>Initialises the random number generator with the given value; default: 23423
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 09 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/DiplomStudArb.html sumo-1.6.0+dfsg1/docs/userdoc/DiplomStudArb.html --- sumo-1.5.0+dfsg1/docs/userdoc/DiplomStudArb.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/DiplomStudArb.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,467 @@ + + + + + + + + + + + + + + + + + + + DiplomStudArb - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + DiplomStudArb
    + + + +

    In the following, you may find ideas for student work - Bachelor, +Master, or Diploma theses. Please note that being a German institution, +we can only offer assistance for work done on German Universities / +Schools. That's why the work topics are listed in German.

    +

    Allgemeines#

    +

    Die meisten der folgenden Themen lassen sich sowohl im Rahmen einer +Master- oder Diplomarbeit als auch in reduziertem Umfang in einer +Studien- oder Bachelorarbeit behandeln. Alle stehen mehr oder weniger +direkt im Zusammenhang mit SUMO.

    +

    Alle Themen sind ausdrücklich nur als Vorschläge gedacht. Falls jemand +nach Kennenlernen der Software und der Anwendungsgebiete eigene +Vorschläge zur Verbesserung und Erweiterung hat, die er/sie selbst +umsetzen möchte, sind diese sehr gern gesehen.

    +

    Themen mit Bezug zur Verkehrsforschung#

    +

    Voraussetzung: Kenntnisse in C++ oder Python

    +

    Schadstoffemission#

    +

    Implementierung und Vergleich von Emissionsmodellen#

    +

    Es existiert eine Vielzahl unterschiedlicher Modelle für den Ausstoß von +Schadstoffen, die sich in ihrer Granularität sowie der Menge +abgebildeter Fahrzeugarten unterscheiden. Das Ziel dieser Arbeit ist die +Umsetzung eines Teils dieser Modelle in SUMO und der Vergleich dieser. +Die Arbeit würde auf bereits vorhandenen Ergebnissen aufbauen.

    +

    Elektromobilität - Simulation der Auswirkung von Verkehrsmanagementstrategien#

    +
    Gegenwärtig hält eine neue Entwicklung mit all ihren Chancen und Herausforderungen Einzug in den Verkehrsraum – die Elektromobilität. Sie hat den Vorteil 
    +nur geringe Lärm- und Schadstoff-emissionen zu verursachen. Doch die Elektromobilität wird die bisherigen Probleme im Verkehrsmanagement nicht automatisch lösen 
    +Ganz im Gegenteil – im Zuge der Elektrifizierung des Verkehrs kommen neue Herausforderungen auf das Verkehrsmanagement zu 
    +Die begrenzte Reichweite und langen Ladevorgänge der bisherigen Elektrofahrzeuge bedingen eine neuartige Lade- und Verkehrsinfrastruktur 
    +Hinzu kommen unklare Rahmenbedingungen wie Kaufbereitschaft und Marktpreise. Die Konsequenzen für das Verkehrsmanagement sind daher kaum absehbar.
    +
    + +

    Wir möchten zusammen mit einem Studenten/einer Studentin +Verkehrsmanagementstrategien unter Beachtung verschiedener Markt- und +Nutzungsszenarien simulieren. Damit sollen Änderungen im +Verkehrsmanagement virtuell erprobt und deren Auswirkungen bspw. auf +deren Beitrag zum Klimaschutz untersucht werden. Mögliche +Aufgabengebiete umfassen dabei: Recherche und Aufbereitung von Markt- +und Nutzungsszenarien, Ableitung von Verkehrsmanagementstrategien / +Recherche bisheriger Anstze, Emissionsprofil für verschiedenen +Fahrzeugtypen (PHEV, REEV, BEV, FCEV etc.) implementieren, Simulation +verschiedener Steuerungs- und Beeinflussungsmaßnahmen, Auswertung der +Ergebnisse / Ziehen von Schlussfolgerungen.

    +

    Lichtsignalanlagen#

    +

    Methoden für eine Schätzung einer "grünen Welle" in komplexen Straßennetzen#

    +

    Basierend auf der Auswertung bereits existierender Ansätze ist ein +Verfahren auszuwählen und zu implementieren, welches für ein gegebenes +Straßennetz und eine gegebene Nachfrage möglichst optimale, also z.B. +die Wartezeiten vor den Lichtsignalanlagen minimierende, Programme der +Lichtsignalanlagen erzeugt.

    +

    Vergleich verschiedener Ansätze zur Steuerung von Lichtsignalanlagen#

    +

    Ziel der Arbeit ist es, das modellbasierte Steuerverfahren OPAC mit +einer Festzeitsteuerung und einer regelbasierten Steuerung zu +vergleichen. Dazu ist zunächst zu untersuchen, mit welchem Aufwand sich +die Steuerverfahren in der Simulation umsetzen lassen. Anschließend +sollen möglichst alle Steuerverfahren in konkreten Simulationsszenarien +umgesetzt und auf Basis der von SUMO generierten Ausgabedateien +verglichen werden.

    +

    Routenwahl und Nachfragemodellierung#

    +

    Auswertung von one-shot-Ansätzen zur Verkehrsumlegung#

    +

    Die Verteilung von Routen innerhalb eines belasteten Straßennetzes +gehört zu den Standardschritten bei der Erstellung eines +Verkehrssimulationsszenarios. Normalerweise benutzte Methoden sind dabei +iterativ und benötigen daher viel Rechenzeit. Innerhalb dieser Arbeit +soll ein bereits entwickelter one-shot - Ansatz, der ohne Iterationen +auskommt im Vergleich zu herkömmlichen Verfahren evaluiert werden.

    +

    Alternative Algorithmen für Kürzeste-Wege-Suche#

    +

    Innerhalb dieser Arbeit sollen Alternativen zu dem in SUMO benutzten +Kürzeste-Wege-Algorithmus von Dijkstra implementiert und verglichen +werden.

    +

    Ad-hoc - Nachfragegenerierung#

    +

    Während mit OpenStreetMap reale Straßennetze frei zur Verfügung stehen, +gibt es kaum Quellen für die von der Simulation benötigte +Verkehrsnachfrage. Innerhalb dieser Arbeit sollen Heuristiken zur +Bestimmung einer Nachfrage für ein gegebenes Straßennetz entwickelt, +implementiert und ausgewertet werden.

    +

    Nachfragegenerierung aus Induktionsschleifendaten#

    +

    Die nahezu vollständige Abdeckung aller Zu- und Abfahrten an Autobahnen +erlaubt die Modellierung einer Nachfrage für ein so beschriebenes +Autobahnnetz. Innerhalb dieser Arbeit soll ein bereits entwickeltes +Werkzeug auf ein solides theoretisches Fundament gestellt werden. Zudem +sollen die vorhandenen, realen Daten dazu benutzt werden, die +Möglichkeiten und Probleme bei der Benutzung dieses Werkzeugs auf zu +decken.

    +

    Anpassung einer Verkehrsnachfrage an Schleifendaten#

    +

    Es soll ein Werkezeug erstellt und beschrieben werden, das eine für ein +Straßennetz gegebene Nachfrage an die innerhalb dieses Netzes erhobenen +Daten anpassen können soll. Vorarbeiten hierzu liegen vor.

    +

    Evaluierung des Routings nach Abbiegehäufigkeiten#

    +

    Der existierende JTRROUTER erstellt mittels einens einfachen +Wahrscheinlichkeitsmodells Routen aus Abbiegehäufigkeiten an Kreuzungen. +Dieses Modell sollte evaluiert und verfeinert werden.

    +

    Kurzfristige Verkehrsprognose#

    +

    Vorhersage von Ganglinien#

    +

    Es sollen eigene Ideen entwickelt werden, wie Vorhersagen zur +Fahrzeugzahl und -geschwindigkeit in einem Straßennetz aufgrund +historischer Daten und dem Einsatz maschineller Lernverfahren gemacht +werden können.

    +

    Themen mit Bezug zu Softwareentwicklung#

    +

    Schwerpunkt Algorithmik / theoretischer Informatik#

    +

    Voraussetzungen: keine Angst vor Beweisen, Grundkenntnisse der +Graphentheorie (z.B. aus einer Vorlesung zu Graphen und +Algorithmen)

    +

    Analyse und Implementation eines Netzwerkflussalgorithmus zur Routenfindung#

    +

    Im Rahmen der Arbeit sollte ein schon weitgehend entwickelter +Algorithmus zur Routenfindung effizient implementiert, seine Laufzeit +theoretisch und praktisch untersucht und seine Lösungen verbessert +werden. Ziel der Arbeit ist einen Routenfindungsalgorithmus zu +erstellen, der in der Praxis schnell und trotzdem theoretisch fundiert +vorgegebene Verkehrszählungen annähert.

    +

    Schnelle Flüsse#

    +

    Es gibt in der kombinatorischen Optimierung das Konzept der Quickest +flows zur Abbildung der zeitlichen Komponente bei Netzwerkflüssen. Es +soll evaluiert werden, inwieweit diese zur Routenfindung eingesetzt +werden können.

    +

    Matching von Straßennetzen#

    +

    Oft liegen für eine Region mehrere Beschreibungen in unterschiedlichen +Formaten und unterschiedlicher Qualität vor. Ziel dieser Arbeit ist die +Auswertung verschiedener Ansätze, die eine Projektion von Straßennetzen +unterschiedlicher Genauigkeit aufeinander realisieren sowie die +Implementierung eines diese Funktion realisierenden Verfahrens.

    +

    Schwerpunkt Software Engineering#

    +

    Voraussetzung: Kenntnisse in C++

    +

    Checkstyle für C++#

    +

    Während es für Java und Python bereits recht ausgereifte Tools zur +statischen Überprüfung des Quellcodes gibt, gibt es für C++ nur wenig +(bezahlbares). Es soll überprüft werden inwieweit bestehende Tools für +Java sich auch bei C++ anwenden lassen.

    +

    Fixed point vs. Floating point#

    +

    Gibt es bei modernen Prozessorarchitekturen noch einen deutlichen +Performanceunterschied zwischen Fest- und Fließkommaberechnungen? +Rechtfertigt dieser einen unter Umständen deutlich erhöhten +Implementationsaufwand? Und ändern sich die Antworten auf diese Fragen +für (stark) nebenläufige Programme?

    +

    Multi-core Parallelisierung#

    +

    Bislang nutzen die Anwendungen des Softwarepaketes SUMO keine +Parallelisierung. Ziel dieser Arbeit ist die Implementierung einer +Parallelisierung für eine multi-core Architektur und die Messung des so +erhaltenen Geschwindigkeitsgewinns.

    +

    Schwerpunkt XML#

    +

    Voraussetzung: Erfahrung mit der Parsierung / Erzeugung von XML

    +

    Effizienter Import und Export von XML mittels schemabasierter Kompression#

    +

    SUMO erzeugt und importiert zum Teil riesige XML-Dateien, welche die +Simulation durch ihre schiere Größe ausbremsen. Effiziente Kompression +mittels so genanntem binärem XML (z.B. XSBC) soll als Lösungsansatz +evaluiert und implementiert werden.

    +

    Modulares XML#

    +

    Die Wiederverwendung von Konfigurationen wird durch die begrenzte +Modularisierbarkeit von "reinem" XML eingeschränkt. Daher sollen in +dieser Arbeit verschiedene (standardisierte) Modularisierungsansätze, +wie z.B. XInclude, untersucht und implementiert werden.

    +

    Sonstiges#

    +

    OpenSource Marketing und Community building#

    +

    Welche Eigenschaften muss ein Softwareprojekt haben, damit es die +Anwender nutzen und zur Verbesserung beitragen? Spielt die Codequalität +eine Rolle, liegt es vor allem an der Dokumentation? Diesen Fragen +sollen studiert und Verbesserungsvorschläge gerne auch direkt +ausprobiert werden.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Downloads.html sumo-1.6.0+dfsg1/docs/userdoc/Downloads.html --- sumo-1.5.0+dfsg1/docs/userdoc/Downloads.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Downloads.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,536 @@ + + + + + + + + + + + + + + + + + + + Downloads - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Downloads
    + + + +

    Here, you will find SUMO both as sources and as compiled binaries.

    +
    +

    Note

    +

    Windows users probably want to use this installer, Linux users might want to look at the available repositories or use the source.

    +
    +

    Please contact us if you have any problems. If you +want to report a bug, please open a GitHub +issue. For further +information about the changes between releases see the +ChangeLog.

    +
    +

    Note

    +

    If you have problems running SUMO because of missing files/commands/dlls please consult FAQ#Basic_Usage

    +
    +

    Note on Licensing#

    +

    SUMO is licensed under the +EPL-2.0 using only open +source libraries.

    +

    The standard build only contains code and windows binaries with Eclipse +approved licenses (especially no GPL and LGPL code). If you need +features like shapefile import or the OpenSceneGraph 3D GUI download the +"extra" build.

    +

    Packages#

    +

    SUMO is available as different packages. The contents of each package is +listed in the table below.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    binbuildsrc (source code)user docsdeveloper docs (doxygen)dataexamplestutorialsteststools (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
    rpm(✔)
    +

    Repositories#

    +

    In addition to the open build service, there are a debian and an ubuntu +launchpad project as well as an archlinux package:

    + +

    To add sumo to your ubuntu (11.04 and later) you will need to do:

    +
    sudo add-apt-repository ppa:sumo/stable
    +sudo apt-get update
    +sudo apt-get install sumo sumo-tools sumo-doc
    +
    + +

    This is still an experimental feature, feedback is welcome.

    +

    SUMO - Latest Release (Version 1.6.0)#

    +

    Release date: 28.04.2020

    +

    MS Windows binaries#

    +

    Contains the binaries (32 or 64 bit), all dlls needed, the examples, +tools, and documentation in HTML format.

    + + +

    Linux binaries#

    +

    They are created by the open build +service If the repositories do +not contain the libraries (like proj and gdal) they are either part of +the distribution or you will need them from another repository (you may +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_nightly).

    + +

    There are more Linux RPM +repositories but +in a less well maintained state (CentOS and Scientific missing gdal +support for instance) because the opensuse build service does not +provide the necessary packages any longer. Ubuntu and Debian users +please see above for repository information.

    +

    macOS binaries#

    +

    "Bottles" are available for installing with +Homebrew. They are built for the two most recent +major macOS versions (currently High Sierra and Mojave) and are built +from source with minimal requirements (fox, proj, xerces-c). If you need +optional libraries, you can specify these on the brew command line and +brew will compile sumo from source. For details, see the Formula's +README.

    +

    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:

    + + +

    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 +(and to give us pre-release feedback) we encourage +you to use the latest version from our code repository.

    +

    Nightly Snapshots#

    +
    + +

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

    + + +

    The Linux repositories specified above contain a nightly build as well.

    +

    The corresponding documentation is +also visible live including Doxygen +docs. Additional artifacts such as +tests results and code coverage +analysis are generated every +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).

    +
    +

    Nightly Snapshots alternative download server#

    +

    All nightly builds are also available at the following alternative +locations

    + +

    Direct repository access#

    +

    You can get 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 +nightly test statistics.

    +

    SUMO - Alternative download and older releases#

    +

    All releases can also be obtained via the sourceforge download +portal

    +

    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 +to develop with Visual Studio. If you just want to run SUMO, use the +binary downloads above which already contain the runtime dependencies.

    +open($_SERVER['DOCUMENT_ROOT']. "/daily/" . $fname); +$freshnessIs = str_replace("\"","",str_replace("#define VERSION_STRING ","",$zip->getFromName('sumo-git/include/version.h'))); +echo $freshnessIs; +$zip->close(); +} +?> + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 11 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Driver_State.html sumo-1.6.0+dfsg1/docs/userdoc/Driver_State.html --- sumo-1.5.0+dfsg1/docs/userdoc/Driver_State.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Driver_State.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,381 @@ + + + + + + + + + + + + + + + + + + + Driver State - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Driver State
    + + + +

    Overview#

    +

    The driver state provides a generic mechanism to induce imperfection +into car-following and lane change models. Although errors may enter the +driving process at many stages [see Figure 1], SUMO only applies +errors at the perception stage, see +below for details.

    +

    +

    Figure 1: Errors in the driving process.

    +

    Practically, errors are added to the input quantities of the +car-following model's input parameters of spacing and speed difference +(for an integration in contributed car-following +models, the +implementation in the standard +model +can be adopted (see MSCFModel_Krauss::stopSpeed() and +MSCFModel_Krauss::followSpeed()).

    +

    Equipping a Vehicle with a Driver State#

    +

    To apply the imperfect driving functionality for a vehicle it is +equipped with a Driver State Device, see the description of +equipment +procedures +(and use =driverstate). The minimal definition required +to equip one vehicle with a Driver State has the following form:

    +
    <routes>
    +    ...
    +    <vehicle id="v0" route="route0" depart="0">
    +        <param key="has.driverstate.device" value="true"/>
    +    </vehicle>
    +    ....
    +</routes>
    +
    +

    In this case all parameters (see below) of the driver state +are set to their default values. The following table gives the full list +of possible parameters for the Driver State Device. Each of these +parameters must be specified as a child element of the form +<param key=<PARAMETER NAME> value=<PARAMETER VALUE> of the +appropriate demand definition element (e.g. <vehicle ... />, <vType +... />, or <flow ... />). See Modeling of Perception +Errors for details of the +error dynamics.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ParameterTypeDefaultDescription
    initialAwarenessfloat1.0The initial awareness assigned to the driver state.
    errorTimeScaleCoefficientfloat100.0Time scale constant that controls the time scale of the underlying error process.
    errorNoiseIntensityCoefficientfloat0.2Noise intensity constant that controls the noise intensity of the underlying error process.
    speedDifferenceErrorCoefficientfloat0.15Scaling coefficient for the error applied to the speed difference input of the car-following model.
    headwayErrorCoefficientfloat0.75Scaling coefficient for the error applied to the distance input of the car-following model.
    speedDifferenceChangePerceptionThresholdfloat0.1Constant controlling the threshold for the perception of changes in the speed difference
    headwayChangePerceptionThresholdfloat0.1Constant controlling the threshold for the perception of changes in the distance input.
    minAwarenessfloat0.1The minimal value for the driver awareness (a technical parameter to avoid a blow up of the term 1/minAwareness).
    maximalReactionTimefloat (s)original action step lengthThe value for the driver's actionStepLength atained at minimal awareness. The actionStepLength scales linearly between this and the original value with the awareness between minAwareness and 1.0.
    +

    Modeling of Perception Errors#

    +

    An underlying +Ornstein-Uhlenbeck +process drives the errors which are applied to the inputs of the +car-following model perception. The characteristic time scale and +driving noise intensity of the process are determined by the driver +state awareness, which is meant to function as an interface between the +traffic situation and the driver state dynamics. We have

    +
      +
    • errorTimeScale = errorTimeScaleCoefficient*awareness(t)
    • +
    • errorNoiseIntensity = + errorNoiseIntensityCoefficient*(1.-awareness(t))
    • +
    +

    [Figure: Ornstein-Uhlenbeck]

    +

    The error's state error(t) at time t is scaled and added to input +parameters of the car-following model as follows

    +
      +
    • perceivedSpeedDifference = trueSpeedDifference + + speedDifferenceError(t), where speedDifferenceError(t) = + speedDifferenceErrorCoefficient*headway(t)*error(t)
    • +
    • perceivedHeadway = trueHeadway + headwayError(t), where + headwayError(t) = headwayErrorCoefficient*headway(t)*error(t)
    • +
    +

    Note that the state error(t) of the error process is not directly +scaled with the awareness, which only controls the errors indirectly by +affecting the processes parameters. Further, the scale of the perception +error is assumed to grow linearly with the distance to the perceived +object.

    +

    [Figure: Schematic representation]

    +

    Finally, the driver state induces an update of the input to the +car-following model only if the perceived values have changed to a +sufficient degree. The conditions for updating the car-following input +are:

    +
      +
    • headway: |perceivedHeadway - expectedHeadway| > + headwayChangePerceptionThreshold*trueGap*(1.0-awareness)
    • +
    • speed difference: |perceivedSpeedDifference - + expectedSpeedDifference| > + speedDifferenceChangePerceptionThreshold*trueGap*(1.0-awareness)
    • +
    +

    Here, the expected quantities are

    +
      +
    • expectedHeadway = lastRecognizedHeadway - + expectedSpeedDifference*elapsedTimeSinceLastRecognition
    • +
    • expectedSpeedDifference = lastRecognizedSpeedDifference
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 16 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/DUAROUTER.html sumo-1.6.0+dfsg1/docs/userdoc/DUAROUTER.html --- sumo-1.5.0+dfsg1/docs/userdoc/DUAROUTER.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/DUAROUTER.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,775 @@ + + + + + + + + + + + + + + + + + + + DUAROUTER - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + DUAROUTER
    + + + +

    From 30.000 feet#

    +

    DUAROUTER imports different demand definitions, computes vehicle +routes that may be used by SUMO using shortest path +computation; When called iteratively DUAROUTER performs dynamic +user assignment (DUA). This +is facilitated by the tool +duaiterate.py which converges +to an equilibrium state (DUE).

    +
      +
    • +

      Purpose:

      +

      A) Building vehicle routes from demand definitions

      +

      B) Computing routes during a user assignment

      +

      C) Repairing connectivity problems in existing route files

      +
    • +
    +
      +
    • System: portable (Linux/Windows is tested); runs on command line
    • +
    + + +

    Usage Description#

    +

    Outputs#

    +

    The primary output of DUAROUTER is a .rou.xml file which has its name +specified by the option -o). Additionally a .rou.alt.xml with the same +name prefix as the .rou.xml file will be generated. This route +alternative file holds a routeDistribution for every +vehicle. +Such a routeDistribution is used during dynamic user assignment +(DUA) but can also be loaded +directly into SUMO.

    +

    Options#

    +

    You may use a XML schema definition file for setting up a DUAROUTER +configuration: +duarouterConfiguration.xsd.

    +

    Configuration#

    +

    All applications of the SUMO-suite handle configuration options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Configuration +Files.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -c <FILE>
    --configuration-file <FILE>
    Loads the named config on startup
    -C <FILE>
    --save-configuration <FILE>
    Saves current configuration into FILE
    --save-template <FILE>Saves a configuration template (empty) into FILE
    --save-schema <FILE>Saves the configuration schema into FILE
    --save-commented <BOOL>Adds comments to saved template, configuration, or schema; default: false
    +

    Input#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -n <FILE>
    --net-file <FILE>
    Use FILE as SUMO-network to route on
    -d <FILE>
    --additional-files <FILE>
    Read additional network data (districts, bus stops) from FILE(s)
    -t <FILE>
    --route-files <FILE>
    Read sumo routes, alternatives, flows, and trips from FILE(s)
    --phemlight-path <FILE>Determines where to load PHEMlight definitions from.; default: ./PHEMlight/
    --junction-taz <BOOL>Initialize a TAZ for every junction to use attributes toJunction and fromJunction; default: false
    -w <FILE>
    --weight-files <FILE>
    Read network weights from FILE(s)
    --lane-weight-files <FILE>Read lane-based network weights from FILE(s)
    -x <STRING>
    --weight-attribute <STRING>
    Name of the xml attribute which gives the edge weight; default: traveltime
    +

    Output#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --write-license <BOOL>Include license info into every output file; default: false
    --output-prefix <STRING>Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time.
    --precision <INT>Defines the number of digits after the comma for floating point output; default: 2
    --precision.geo <INT>Defines the number of digits after the comma for lon,lat output; default: 6
    -H <BOOL>
    --human-readable-time <BOOL>
    Write time values as hour:minute:second or day:hour:minute:second rathern than seconds; default: false
    -o <FILE>
    --output-file <FILE>
    Write generated routes to FILE
    --vtype-output <FILE>Write used vehicle types into separate FILE
    --keep-vtype-distributions <BOOL>Keep vTypeDistribution ids when writing vehicles and their types; default: false
    --alternatives-output <FILE>Write generated route alternatives to FILE
    --intermodal-network-output <FILE>Write edge splits and connectivity to FILE
    --intermodal-weight-output <FILE>Write intermodal edges with lengths and travel times to FILE
    --write-trips <BOOL>Write trips instead of vehicles (for validating trip input); default: false
    --write-trips.geo <BOOL>Write trips with geo-coordinates; default: false
    --write-trips.junctions <BOOL>Write trips with fromJunction and toJunction; default: false
    --exit-times <BOOL>Write exit times (weights) for each edge; default: false
    +

    Processing#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --unsorted-input <BOOL>Assume input is unsorted; default: false
    -s <TIME>
    --route-steps <TIME>
    Load routes for the next number of seconds ahead; default: 200
    --no-internal-links <BOOL>Disable (junction) internal links; default: false
    --randomize-flows <BOOL>generate random departure times for flow input; default: false
    --max-alternatives <INT>Prune the number of alternatives to INT; default: 5
    --remove-loops <BOOL>Remove loops within the route; Remove turnarounds at start and end of the route; default: false
    --repair <BOOL>Tries to correct a false route; default: false
    --repair.from <BOOL>Tries to correct an invalid starting edge by using the first usable edge instead; default: false
    --repair.to <BOOL>Tries to correct an invalid destination edge by using the last usable edge instead; default: false
    --weights.interpolate <BOOL>Interpolate edge weights at interval boundaries; default: false
    --weights.minor-penalty <FLOAT>Apply the given time penalty when computing routing costs for minor-link internal lanes; default: 1.5
    --with-taz <BOOL>Use origin and destination zones (districts) for in- and output; default: false
    --mapmatch.distance <FLOAT>Maximum distance when mapping input coordinates (fromXY etc.) to the road network; default: 100
    --mapmatch.junctions <BOOL>Match postions to junctions instead of edges; default: false
    --bulk-routing <BOOL>Aggregate routing queries with the same origin; default: false
    --routing-threads <INT>The number of parallel execution threads used for routing; default: 0
    --restriction-paramsComma separated list of param keys to compare for additional restrictions
    --weights.expand <BOOL>Expand weights behind the simulation's end; default: false
    --weights.random-factor <FLOAT>Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT); default: 1
    --routing-algorithm <STRING>Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; default: dijkstra
    --weight-period <TIME>Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy; default: 3600
    --weights.priority-factor <FLOAT>Consider edge priorities in addition to travel times, weighted by factor; default: 0
    --astar.all-distances <FILE>Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output)
    --astar.landmark-distances <FILE>Initialize lookup table for astar ALT-variant from the given file
    --astar.save-landmark-distances <FILE>Save lookup table for astar ALT-variant to the given file
    --gawron.beta <FLOAT>Use FLOAT as Gawron's beta; default: 0.3
    --gawron.a <FLOAT>Use FLOAT as Gawron's a; default: 0.05
    --keep-all-routes <BOOL>Save routes with near zero probability; default: false
    --skip-new-routes <BOOL>Only reuse routes from input, do not calculate new ones; default: false
    --ptline-routing <BOOL>Route all public transport input; default: false
    --logit <BOOL>Use c-logit model (deprecated in favor of --route-choice-method logit); default: false
    --route-choice-method <STRING>Choose a route choice method: gawron, logit, or lohse; default: gawron
    --logit.beta <FLOAT>Use FLOAT as logit's beta; default: -1
    --logit.gamma <FLOAT>Use FLOAT as logit's gamma; default: 1
    --logit.theta <FLOAT>Use FLOAT as logit's theta (negative values mean auto-estimation); default: -1
    --persontrip.walkfactor <FLOAT>Use FLOAT as a factor on pedestrian maximum speed during intermodal routing; default: 0.75
    --persontrip.transfer.car-walkWhere are mode changes from car to walking allowed (possible values: 'parkingAreas', 'ptStops', 'allJunctions', 'taxi' and combinations); default: parkingAreas
    +

    Defaults#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    --departlane <STRING>Assigns a default depart lane
    --departpos <STRING>Assigns a default depart position
    --departspeed <STRING>Assigns a default depart speed
    --arrivallane <STRING>Assigns a default arrival lane
    --arrivalpos <STRING>Assigns a default arrival position
    --arrivalspeed <STRING>Assigns a default arrival speed
    --defaults-override <BOOL>Defaults will override given values; default: false
    +

    Time#

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    -b <TIME>
    --begin <TIME>
    Defines the begin time; Previous trips will be discarded; default: 0
    -e <TIME>
    --end <TIME>
    Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent; default: 9223372036854774
    +

    Report#

    +

    All applications of the SUMO-suite handle most of the reporting +options the same way. These options are discussed at Basics/Using the +Command Line Applications#Reporting +Options.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    OptionDescription
    -v <BOOL>
    --verbose <BOOL>
    Switches to verbose output; default: false
    --print-options <BOOL>Prints option values before processing; default: false
    -? <BOOL>
    --help <BOOL>
    Prints this screen or selected topics; default: false
    -V <BOOL>
    --version <BOOL>
    Prints the current version; default: false
    -X <STRING>
    --xml-validation <STRING>
    Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto
    --xml-validation.net <STRING>Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never
    -W <BOOL>
    --no-warnings <BOOL>
    Disables output of warnings; default: false
    --aggregate-warnings <INT>Aggregate warnings of the same type whenever more than INT occur; default: -1
    -l <FILE>
    --log <FILE>
    Writes all messages to FILE (implies verbose)
    --message-log <FILE>Writes all non-error messages to FILE (implies verbose)
    --error-log <FILE>Writes all warnings and errors to FILE
    --ignore-errors <BOOL>Continue if a route could not be build; default: false
    --stats-period <INT>Defines how often statistics shall be printed; default: -1
    --no-step-log <BOOL>Disable console output of route parsing step; default: false
    +

    Random Number#

    +

    All applications of the SUMO-suite handle randomisation options the +same way. These options are discussed at Basics/Using the Command Line +Applications#Random Number +Options.

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    --random <BOOL>Initialises the random number generator with the current system time; default: false
    --seed <INT>Initialises the random number generator with the given value; default: 23423
    +

    Further Documentation#

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 27 April 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Eclipse_Migration.html sumo-1.6.0+dfsg1/docs/userdoc/Eclipse_Migration.html --- sumo-1.5.0+dfsg1/docs/userdoc/Eclipse_Migration.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Eclipse_Migration.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + Eclipse Migration - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Eclipse Migration
    + + + +

    The SUMO project will move to the Eclipse +foundation. This +leads to a number of changes which are listed below (with a rough +timeline)

    +
      +
    • Using C++11. done, +2017/7
    • +
    • Re-license the code under the +EPL done, +2017/10
    • +
    • Moving the repository (complete history) to GitHub done 2017/10.
        +
      • switching source-forge repository to read-only done + 2017/10/27
      • +
      • switching Trac to read-only done 2017/10/27
      • +
      • enabling new GitHub repository + done 2017/11/01
      • +
      • enabling new GitHub issue + tracker (temporary) + done 2017/11/01
      • +
      • disabling the planetsumo + repository done 2017/11/01
      • +
      +
    • +
    • +

      Creating the Eclipse repository +(history cut off) on GitHub scheduled for 2017/12.

      +
      +

      Note

      +

      We want to maintain the full repository history but can not do so under the EPL. Therefore we will maintain two repositories that mirror commits going forward. Official issue tracker will be at the eclipse repo.

      +
      + +
    • +
    + +

    Things that stay the same:

    + +
    +

    Note

    +

    This page will be continuously updated with the state of the migration.

    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Editing_Articles.html sumo-1.6.0+dfsg1/docs/userdoc/Editing_Articles.html --- sumo-1.5.0+dfsg1/docs/userdoc/Editing_Articles.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Editing_Articles.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,656 @@ + + + + + + + + + + + + + + + + + + + Help on editing Articles - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Help on editing Articles
    + + + +

    This documentation is written using Markdown syntax. Every page or "article" is a Markdown (.md) file located here in the official SUMO GitHub repository. +The static html pages are then generated using Mkdocs.

    +

    Feel free to contribute and improve the SUMO Documentation. All changes need to be via Pull requests. You can click on the "Edit on GitHub" button in the top right corner of every page, or just simply press the e key on your keyboard.

    +
    +

    Note

    +

    Although HTML can be written within Markdown, please avoid using it and keep everything in native Markdown as much as possible.

    +
    +



    +

    Creating an article#

    +

    To creat a new article (or page) just create a Markdown (.md) file in the documentation directory.

    +
    +

    Note

    +

    Please capitalize the very first letter of the name and use _ (underscores) instead of leaving a (space) between words in the filename.

    +
    +

    The very first 3 lines of each page should be:

    +
    ---
    +title: Name of the Article
    +---
    +
    + +

    If you want to create an fresh new article, please consider first seeing the source code of any existing article, to learn and get some basic notions.

    +



    +

    Sections and subsections#

    +

    Sections and subsections in a document are marked by using the # character.

    +

    # is equivalent to a <h1> section, ## to an <h2> and so on.

    +
    +

    Note

    +

    On the toc (table of content) sidebar you see on each page, only #, ## and ### sections are listed. Despite that, all other levels generate an internal link and therefore can be referenced and linked from another page.

    +
    +

    Example#

    +
    #### This is a sub section, equivalent to <h4>
    +
    + +

    will display:

    +

    This is a sub section, equivalent to <h4>#

    +



    +

    Styling text#

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    ElementCodeWill show as
    Bold**test**test
    Italic*test*test
    Bold + Italic***test***test
    Strikethrough~~test~~test
    +

    Markdown is compatible with the <sub> and <sup> html-Tags.

    +
      +
    • η<sub>recup</sub>=e<sup>x</sup> ηrecup=ex
    • +
    +

    Example#

    +
    Lorem *ipsum* dolor sit amet, *consetetur sadipscing elitr*, sed diam **nonumy** eirmod **tempor invidunt ut labore** et ~~dolore~~ magna ***aliquyam erat, sed diam*** voluptua.
    +
    + +

    will display:

    +

    Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.

    +



    +

    Escape character#

    +

    Use the escape character in order to display literal characters which would have special meaning in Markdown. The escape character is \ (backslash). When writing text inside the `` marks (inline code) or in a code block, no escape character are required.

    +

    Here are some expressions that need an escape character:

    +
      +
    • @ : if not, it would be taken as a GitHub username
    • +
    • # : if not, it would be taken as a Header or a GitHub issue
    • +
    • | : when using it inside a table
    • +
    • >
    • +
    • {
    • +
    • }
    • +
    • *
    • +
    +

    Example#

    +
    `<TEST1>` using code. No escape character is required here.
    +<TEST2> not using the escape character. Here the element disappears.
    +<TEST3\> using the escape character
    +
    + +

    will display:

    +

    <TEST1> using code. No escape character is required here.
    + not using the escape character. Here the element disappears.
    +<TEST3> using the escape character

    +



    +

    Images#

    +

    All images must be saved in the images directory. +To insert an image, just use the usual Markdown sytax:

    +
    ![<alt>](images/Wikicommons_rail_fast.jpg "<title>")
    +
    + +

    replace <alt> with the alternate text and <title> with the title to show on Mouseover.

    +
    +

    Note

    +

    The <alt> and <title> attributes are not necessary required, as you can see in the example.

    +
    +

    Example#

    +
    ![](images/Wikicommons_rail_fast.jpg)
    +
    + +

    will display:

    +

    +



    +

    Tables#

    +

    See this Online Tables generator to get help creating a Table in Markdown, or to convert an existing spreadsheet (e.g. Microsoft Excel) into Markdown.

    +

    A table has a Header (the first row), which is separated by hyphens - from the rest of the Table. +To separate columns, just use a pipe |.

    +

    Example#

    +
    |   |   |   |   |   |
    +|---|---|---|---|---|
    +|   |   |   |   |   |
    +|   |   |   |   |   |
    +|   |   |   |   |   |
    +
    + +

    will display:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +

    Note

    +

    It is important to leave an empty line (line break) immediately before and immediately after a table.

    +
    +



    +

    Math#

    +

    In order to insert Mathematical expressions (symbols or equations), you should write them in LaTeX format. Math elements are being displayed as images, using a html <img> element. +Just replace <HERE> with your math expression in the following html element:

    +

    <img src="http://latex.codecogs.com/gif.latex?<HERE>" border="0" style="margin:0;"/>

    +

    Example#

    +
    <img src="http://latex.codecogs.com/gif.latex?R" border="0" style="margin:0;"/>
    +
    + +

    will display:

    +

    +
    + +
    <img src="http://latex.codecogs.com/gif.latex?F(x)=\int^a_b\frac{1}{3}x^3" border="0" style="margin:0;"/>
    +
    + +

    will display:

    +

    +



    +

    Macros / Variables#

    +

    In order to make writing this Documentation easier, we implemented some Macros. Macros replace some special text with other content.

    +

    Example#

    +

    {{SUMO}} +{{DT_FILE}} +{{DT_STR}} +{{Version}}

    +

    will display:

    +

    <SUMO_HOME> +<FILE> +<STRING> +1.6.0

    +
    +

    Note

    +

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

    +
    +
    +

    Caution

    +

    Macros do not work inside inline code or code blocks.

    +
    +



    +

    Links#

    +

    When linking to a page within this Documentation, please consider the absolute path to the Markdown file. +Do not forget to add the .md extension to every internal link.

    +

    Links to external pages will display an arrow at the end (e.g. DLR).

    + +

    Using the {{Source}} Macro, linking to files in the official SUMO repository on GitHub is as easy as:

    + +
    +

    Note

    +

    The {{Source}} macro is equivalent to https://github.com/eclipse/sumo/blob/master/ including the / at the end. Please analyze the following example:

    +
    + + +

    Internal links are used to refer a special section of an article. You can obtain the internal link to a section by hovering the cursor next to the section title (an # character will appear).

    +

    Linking to a section within the same page is as easy as this: Read about Math [Read about Math](#math)

    +
    +

    Caution

    +

    All texts in internal links are in lower case.

    +
    +

    To reference a section on another page, do not forget to put the absolute path and the .md extension, like this: Read about SUMO input [Read about SUMO input](SUMO.md#input)

    +

    Some characters are being ignored (deleted) or replaced when generating an internal link:

    +
      +
    • . is ignored
    • +
    • : is ignored
    • +
    • ? is ignored
    • +
    • ' is ignored
    • +
    • " is ignored
    • +
    • / is ignored
    • +
    • ( is converted to _
    • +
    • ) is converted to _
    • +
    • (space) is converted to _
    • +
    • > is converted to 62
    • +
    +

    Here are some practical examples:

    + + + + + + + + + + + + + + + + + + + + + +
    Section titleActual link
    tools fail with a SyntaxError or ImportError or some TypeError concerning ">>"#tools_fail_with_a_syntaxerror_or_importerror_or_some_typeerror_concerning_6262
    Why do I get errors about missing files / file not found even though the file exists?#why_do_i_get_errors_about_missing_files_file_not_found_even_though_the_file_exists
    Version 1.3.1 (27.08.2019)#version_131_27082019
    +
    +

    Note

    +

    No permalink ends with a _ character.

    +
    +

    Example#

    +
    Go to [SUMO-GUI](SUMO-GUI.md), [NETCONVERT options](NETCONVERT.md#options) or [Notation](Basics/Notation.md)
    +
    +<https://www.dlr.de> or [DLR](https://www.dlr.de)
    +
    + +
      +
    • [Read the gitignore file]({{Source}}.gitignore)
    • +
    • [{{SUMO}}/src/sumo_main.cpp]({{Source}}src/sumo_main.cpp)
    • +
    +

    will display:

    +

    Go to SUMO-GUI, NETCONVERT options or Notation

    +

    https://www.dlr.de or DLR

    + +



    +

    GitHub issues, commits and users#

    +

    In order to use the # and @ characters freely, please use the escape character.

    + + + + + + + + + + + + + + + + + + + + + + + + + +
    ElementCodeWill show as
    GitHub issue#5697#5697
    GitHub user@namdre@namdre
    GitHub commit3aa106d1bf3221031cca75cfe259913d9d3e88ae (the complete Commit Hash)3aa106d
    +

    Example#

    +
    The issue #5697 was reported by @angelobanse. @behrisch commited 3aa106d1bf3221031cca75cfe259913d9d3e88ae to close that issue.
    +
    + +

    will display:

    +

    The issue #5697 was reported by @angelobanse. @behrisch commited 3aa106d to close that issue.

    +



    +

    Notes#

    +

    The NOTE and CAUTION elements are useful for highlighting important information. +You can also use a custom note type.

    +

    Inside a Note element you can use Markdown syntax to insert links, stylize text and even insert images.

    +
    +

    Caution

    +

    Unfortunately, you cannot insert a note in a Table.

    +
    +

    Example#

    +
    !!! note
    +    When citing SUMO in general please use our current reference 
    +    publication: ["Microscopic Traffic Simulation using SUMO"](https://elib.dlr.de/124092/); 
    +    Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, 
    +    Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner. 
    +    IEEE Intelligent Transportation Systems Conference (ITSC) 2018.
    +
    +!!! caution
    +    The list of not allowed characters is incomplete
    +
    +!!! incomplete "Missing:"
    +    This is just a test
    +
    + +

    {{Outdated}}

    +

    will display:

    +
    +

    Note

    +

    When citing SUMO in general please use our current reference publication: "Microscopic Traffic Simulation using SUMO"; Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner. IEEE Intelligent Transportation Systems Conference (ITSC) 2018.

    +
    +
    +

    Caution

    +

    The list of not allowed characters is incomplete

    +
    +
    +

    Missing:

    +

    This is just a test

    +
    +
    This information is outdated.
    + +



    +

    See also#

    + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 25 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/extra.css sumo-1.6.0+dfsg1/docs/userdoc/extra.css --- sumo-1.5.0+dfsg1/docs/userdoc/extra.css 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/extra.css 2020-04-27 22:07:52.000000000 +0000 @@ -0,0 +1,217 @@ +.navbar { + background-image: -webkit-linear-gradient(#589037,#338033 60%,#217831); + background-image: linear-gradient(#589037,#338033 60%,#217831); + background-repeat: no-repeat; + border-bottom: 1px solid #1b6618; + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff589037',endColorstr='#ff217831',GradientType=0); + filter: none; + -webkit-box-shadow: 0 0 .2rem rgba(0,0,0,.1),0 .2rem .4rem rgba(0,0,0,.2); + box-shadow: 0 0 .2rem rgba(0,0,0,.1),0 .2rem .4rem rgba(0,0,0,.2); + padding: 2px; + } + + .navbar-nav .active a, .navbar-default .navbar-nav .active a:hover, .navbar-default .navbar-nav .active a:focus { + color: #fff; + background-color: #1b6618; +} + +.navbar-toggler { + font-size: 1rem !important; +} + +.dropdown-menu { + background-color: rgb(171,221,139); +} + +.bs-sidenav { + padding-top: 0; + padding-bottom: 0; +} + +body { + font-size: 0.95em; + line-height: 1.4; +} + +.container { + max-width: 1400px; +} + +a.nav-link { + font-size: small; +} + +.dropdown-item { + font-size: small; +} + +.nav-link:after { + display: none !important; +} + +a.no-arrow-link:after { + display: none !important; +} + +.toc-scroll { + overflow-y: auto; + max-height: 80vh; +} + +.admonition p { + margin-bottom: 0; +} + +code { + background-color: #f8f9fa; + border: 1px solid #eaecf0; + border-radius: 2px; + padding: 1px 4px; + font-family: monospace,monospace; +} + +.hljs { + background: #eff0f1; + border-radius: 3px; + border: 1px solid #ddd !important; + padding: 12px 8px; +} + +h1, h2 { + border-bottom: 1px solid #919699; + padding-bottom: 1px; + font-weight: normal; + margin-bottom: 0.4em; +} + +h1 { + font-size: 1.8em; +} + +h2 { + font-size: 1.5em; + margin-top: 1em; +} + +h3 { + font-size: 1.2em; + font-weight: bold; + margin-top: 0.3em; +} + +h4 { + font-size: 0.95em; + font-weight: bold; + margin-top: 0.3em; +} + +h5 { + font-size: 0.94em; + font-weight: bold; + margin-top: 0.3em; +} + +hTitles { + font-size: 1.8em; + font-weight: bold; + color: #338033; + margin-bottom: 0.5rem; + font-family: inherit; + line-height: 1.2; + margin-top: 10px; +} + +.sumoLogo { +pointer-events:none; +border:10px; +border-color: #aaaaaa; +border-radius:50%; +margin-bottom: 10px; +border-radius: 50%; +-webkit-border-radius: 50%; +-moz-border-radius: 50%; +box-shadow: 0 0 8px rgba(0, 0, 0, .4); +-webkit-box-shadow: 0 0 8px rgba(0, 0, 0, .4); +-moz-box-shadow: 0 0 8px rgba(0, 0, 0, .4); +} + +ul { + list-style-position: outside; + } + +table { + border: 1px solid #dee2e6; +} + +td { + border: 1px solid #dee2e6; +} + +thead th { + vertical-align: center; + text-align: center; + background:#ddffdd; +} + +.table th, .table td { + padding: 0.3rem; +} + +a { + color: #0645ad; +} + +@media (max-width: 768px) { + .col-md-3 { + max-width: 800px; + } + } + +.gsc-above-wrapper-area-container { + border: none !important; +} + +.gsc-above-wrapper-area-container td { + border: none !important; +} + +.gsc-search-box { + border: none !important; +} + +.gsc-search-box td { + border: none !important; +} + +a[href ^= "http"]:after { + content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=); +} + +#goToTop { + display: none; + position: fixed; + bottom: 20px; + right: 20px; + z-index: 99; + font-size: 18px; + border: none; + outline: none; + background-color: rgba(85,85,85,0.5); + color: white; + cursor: pointer; + padding: 15px; + border-radius: 8px; + } + + #goToTop:hover { + background-color: #555; + } + + .modal-header { + background-color: #ddffdd; + } + + .modal-title { + font-weight: bold; + color: #338033; + } diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/FAQ.html sumo-1.6.0+dfsg1/docs/userdoc/FAQ.html --- sumo-1.5.0+dfsg1/docs/userdoc/FAQ.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/FAQ.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,1449 @@ + + + + + + + + + + + + + + + + + + + FAQ - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + FAQ
    + + + +

    General#

    +

    What is SUMO?#

    +

    SUMO is a traffic simulation package. It is meant to be used to + simulate networks of a city's size, but you can of course use it for + smaller networks and larger, too, if your computer power is large + enough.

    +

    What does "SUMO" mean?#

    +

    "SUMO" is an acronym for "Simulation of Urban MObility".

    +

    What kind of a traffic simulation is SUMO?#

    +

    SUMO is mainly a microscopic, space-continuous road traffic + simulation. It supports multi-modal and inter-modal ground based + traffic. SUMO models individual vehicles and their interactions + using models for car-following, lane-changing and intersection + behavior. It also uses pedestrian models to simulate the movement + of persons and their interactions with vehicles.

    +

    To allow for the efficient simulation of very large scenarios, it is + also possible to run SUMO as a mesoscopic simulation.

    +

    SUMO also supports macroscopic traffic assignment using the + MAROUTER application.

    +

    What is the best way to read the documentation and find out about specific topics#

    +

    The main page for getting an overview over the various topics is the + outline + SUMO_User_Documentation. If + you do not find the topic of interest listed there use the site search. + Alterantively, use a general purpose search engine as this will also include the mailing list archives.

    +

    How can I contribute to SUMO?#

    + +

    How do code contributions work?#

    +

    We need to make sure that you have the necessary rights on the code + and that you agree that your contribution is put under the Eclipse + Public License v2. The easiest way to do achieve this is

    +
      +
    • Create a GitHub account
    • +
    • Configure the git client on your computer to use the email address + that you used when registering for your acount:
    • +
    +
    git config --global user.email "email@example.com"
    +
    + +
      +
    • Create an Eclipse account if you do not + already have one. Make sure to use the same email address as for + GitHub
    • +
    • Fill out a simple online form, called the Eclipse Contributor + Agreement (ECA, this is mandatory)
    • +
    • Fork the sumo + repository on GitHub
    • +
    • Clone the forked repository to your computer
    • +
    +
    git clone https://github.com/yourgithubid/sumo.git
    +
    + +
      +
    • Modify the files in the created sumo clone directory
    • +
    • From within this directory Commit your changes with
    • +
    +
    git add src
    +git commit -m "your change message" -s
    +
    + +
    +

    Caution

    +

    the option -s must be used so the contribution can be accepted in accordance with Eclipse rules

    +
    +
      +
    • Push your changes to your fork on GitHub with
    • +
    +
    git push
    +
    + + +

    How do I contribute to the documentation?#

    +

    The documentation is part of the code repository so the same rules as in the previous question apply. +If you just want to have a simple typo fixed you can always drop us a line at sumo@dlr.de or at sumo-dev@eclipse.org.

    +

    How do I cite SUMO#

    +

    Cite using "Microscopic Traffic Simulation using SUMO"; Pablo Alvarez Lopez, Michael + Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, + Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and + Evamarie Wießner. IEEE Intelligent Transportation Systems Conference + (ITSC), 2018.

    +

    How do I unsubscribe from the mailing list?#

    +

    Go to https://www.eclipse.org/mailman/listinfo/sumo-user. At the +bottom of the page you will find a form that allows you to enter your +email address to unsubscribe it from the list.

    +

    General Problem Solving#

    +

    An application crashed. What should I do?#

    +

    The applications in the SUMO suite may crash when running out of memory. +Monitor the memory usage of your applicatons to check whether that may +be your problem. 32bit-applications may only use 2GB of RAM. Use the +64bit version and ensure sufficient memory on your machine in order to +work with larger files. If this does not fix the crash, please report +this as a bug as explained below.

    +

    Why does SUMO not behave as documented in this wiki?#

    +

    This wiki documents the behavior of the latest development version. This is usually quite +close the the latest release (differences are +explicitly listed in the ChangeLog. If you are +using an older version of SUMO, you need to refert to the documentation that is packaged with that version. Note that we do +not back-port bugfixes to older version of SUMO. If possible you should +always use the latest version of SUMO.

    +

    There is an error message but I don't know what I did wrong#

    +

    Activate XML-Validation on your input + files. If that does not solve your problem feel free to ask on the + mailing list but please remember to copy / screenshot the error + message itself and attach it to your question. Attaching (zipped!) + input files for reproducing the error message is also a good idea + (see question above).

    +

    How do I report erroneous behavior of a SUMO application?#

    +

    If you suspect a bug in one of the applications you should report + your findings by sending the following items to the mailing list:

    +
      +
    • a description of the SUMO-version and the operating system you are + using
    • +
    • a screenshot or error output showing the unexpected behavior (this + may allow us to diagnose the problem at a single glance)
    • +
    • the complete input files for reproducing the error (i.e. a .sumocfg + and all files referenced therein) in a zip-archive. Please remove + unnecessary inputs (i.e. only 2 vehicles instead of 2000) and try to + find the minimum input example which still shows the problem.
    • +
    • a description at which time step (for simulations) and on which + edge/junction the problem occurs
    • +
    +
    +

    Note

    +

    If you are using an older version of SUMO, please also report whether the problem shows up with the latest release.

    +
    +
    +

    Note

    +

    If your attachments are rejected by the mailing list due to their size (max 100Kb), upload them to a file hosting service and send the link. Alternatively, send them directly, rather than via the list.

    +
    +

    SUMO does not do what I want and I don't know how to solve the issue#

    +

    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?#

    +
      +
    • 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)
      • +
      +
    • +
    • 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.
    • +
    • 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
      • +
      • do a web search (past questions and answers from the mailing + list can be found by google)
      • +
      +
    • +
    • 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.
    • +
    • Be polite
    • +
    • Good Example questions:
        +
      • How can I get data X out of SUMO?
      • +
      • How can I influence aspect Y of a simulation?
      • +
      • My simulation does Z though I do not expect it to. How do I fix that?
      • +
      +
    • +
    +

    I asked a question on the mailing list and did not get an answer within X days. Why?#

    +

    Community support is provided on a best effort basis. Questions are + mostly answered by the developers when they find time between their + projects. Thus, response times can vary between hours and weeks + (especially during holidays). Sometimes, when there is a high volume + of questions on the mailing list, your question may have been lost. + Feel free to repost your question if you did not get an answer + within a week. Response times also vary with the difficulty of the + question (because the person answering it needs to find a bigger + time slice to tackle the problem). Also, follow the advice given + above when phrasing your questions to increase the chance for quick + answers.

    +

    I want to do a project with SUMO can you help me with the implementation?#

    +

    Unfortunately, we do not have the resources to do other peoples + projects for free. + Contact + us for paid consultancy. + We try to help out with bugs and give pointers to the relevant + documentation but this free support is limited to what we can do in + our spare time.

    +

    TraCI#

    +

    My TraCI-program is not working as intended. Can you help me debug it?#

    +

    Unfortunately, we do not have the resources to debug other peoples + code. If you suspect a bug in TraCI itself, the general rules of bug-reporting + apply. Feel free to post your code to the mailing list as there may + be other programmers present who could help. Be aware that someone + who wants to reproduce your problem needs all your input files to do + so.

    +

    My TraCI-program is not working as intended. How do I debug it?#

    +

    When using TraCI there are two processes that can raise errors: SUMO and +the TraCI script being run. Here are some guidelines for figuring out +what is happening:

    +
      +
    • The SUMO error connection reset by peer indicates a problem in the +script. The python strack trace should point to the problem (in the +simplest case, the script ends without calling traci.close())
    • +
    • The error TraCIFatalError connection closed by SUMO indicates +a problem with SUMO
    • +
    • The error TraCIException indicates a minor problem with the +script. (e.g. asking for a vehicle that does not exist). This type +of error can be safely handled by the script with try/except
    • +
    • It is a good idea to run SUMO with the option --log <FILE> to +figure out what went wrong in a simulation run or why the simulation +aborted.
    • +
    • If SUMO crashes (just stops instead of quiting with an error +message) here is how to debug it:
        +
      • in the options to traci.start() add ['--save-configuration', + 'debug.sumocfg']
      • +
      • run your script (sumo will not start and the script will try to + connect repeatedly)
      • +
      • run the debug version of sumo with the saved configuration in a + debugger while the script is still trying to connect
      • +
      +
    • +
    +
    gdb --args sumoD -c debug.sumocfg
    +
    + +

    Error: tcpip::Storage::readIsSafe: want to read 8 bytes from Storage, but only 4 remaining#

    +

    The TraCI protocal changed in version 1.0.0. Please make sure that TraCI +client version and SUMO version match.

    +

    Features#

    +

    Does SUMO support traffic within the junctions?#

    +

    Yes, SUMO supports inner-junction traffic since version 0.9.5.

    +

    Is it possible to connect SUMO to an external application (f.e. ns-2)?#

    +

    There are several approaches to do this, see + TraCI and Topics/V2X

    +

    Can SUMO simulate lefthand traffic?#

    +

    Yes. It is supported since version 0.24.0. To create a new network for + lefthand traffic, the option --lefthand must be set.

    +

    To convert an existing network to lefthand driving, there are two options. Abstract networks (no geo-reference, coordinates do not matter much) can be processed with netconvert:

    +
        netconvert -s righthand.net.xml --flip-y-axis -o lefthand.net.xml
    +
    + +

    To convert an existing network and preserve coordinates, the network must first be disaggregated into nodes and edges and then re-assembled:

    +
        netconvert -s righthand.net.xml --plain-output-prefix righthand
    +    netconvert -e righthand.edg.xml -n righthand.nod.xml --lefthand -o lefthand.net.xml
    +
    + +

    Can SUMO generate movement traces?#

    +

    Yes. This is accomplished by using the + traceExporter tool to convert SUMO + outputs into the appropriate format. Also see + Topics/V2X

    +

    Can SUMO simulate heterogeneous traffic / lane-free traffic ?#

    +

    Yes (since version 0.27.0). The + Sublane-Model is activated by + setting the option --lateral-resolution <FLOAT>.

    +

    Can SUMO simulate driving in reverse?#

    +

    No. While it is possible to move a vehicle backwards using + TraCI, other vehicles will not react in a + sensible manner to this.

    +

    Can SUMO simulate driving through the oncoming lane?#

    +

    Yes. (since version 0.27.0). The opposite-direction-driving feature is activated by using a network with additional information.

    +

    Can SUMO be run in parallel (on multiple cores or computers)?#

    +

    The simulation itself runs on a single core. However, routing + in SUMO or DUAROUTER can + be parallelized by setting the option --device.rerouting.threads <INT> and --routing-threads <INT> respectively. + When these optionsare are used, multiple cores on the machine are used.

    +

    There is no support for multi-node parallelization.

    +

    When running SUMO-GUI, an additional thread is used for visualization.

    +

    The python TraCI library allows controlling multiple simulations + from a single script either by calling traci.connect and storing + the returned connection object or by calling + traci.start(label=...) and retrieving the connection object with + traci.getConnection(label).

    +

    The work to make the core (microscopic) simulation run in parallel is ongoing (Issue #4767). + Some parts of the simulation can already be run in parallel when setting option --threads but this does not lead to meaningful speedup yet.

    +

    Building / Installation#

    +

    How do I access the code repository?#

    +

    Since 2018-04-10 SUMO moved to the organizational Eclipse account at GitHub. You have the choice to +access the repository using git or subversion. There are plenty of +clients for all platforms. If you use the command line client, you +can checkout sumo using the following command (for git):

    +
    git clone --recursive https://github.com/eclipse/sumo
    +
    + +

    If you want to see the full project history in your git checkout please +change to the created directory and call

    +
    git fetch origin refs/replace/*:refs/replace/*
    +
    + +

    For later updates go inside the sumo directory, which has been created, +and simply type git pull.

    +

    Is there further documentation on Git and Subversion?#

    +

    There are the Git book and the + Subversion book and the GitHub help is also worth reading.

    +

    How to get an older version of SUMO?#

    +

    see + Downloads#SUMO_-_older_releases. + On Linux, older versions must be built from source.

    +

    How to check out revision 5499 (or any other outdated sumo)?#

    +

    You can use the subversion option "-r <REVISION_NUMBER>" + together with the checkout on the command line. If you are using git + you can find the correct hash using the git log. You have to consult + your client's documentation if you use a graphical interface. Please + be aware of the fact that we can only give very limited support for + older versions.

    +

    Which platforms are supported?#

    +

    We compile regularly under Windows 7 and Windows Server 2012 R2 + using Visual Studio 2013 (32bit and 64bit) and have daily builds on + Linux (openSUSE Leap 42.1 (64bit) and openSUSE 13.1 (32bit)). + Furthermore there are nightly builds on the open build service. + SUMO can be installed on macOS via Homebrew (or built from source). + We would be happy to hear about successful builds on other + platforms. We already heard about successful builds on Solaris and + Cygwin.

    +

    Can I run multiple versions of SUMO alongside each other?#

    +

    Different versions of SUMO generally do not interfere with each + other. When setting environment variables such as SUMO_HOME or + PATH, care must be taken to reference the desired directory. On + linux, the package manager will generally only offer a single + version. All other versions must be built from source.

    +

    Letters and words are represented as squares in SUMO-GUI and Netedit#

    +

    Make sure that your computer supports 3D Acceleration and graphical + drivers are correctly installed and configured.

    +

    Troubleshooting#

    +

    See Installing/Linux Build or + Installing/Windows Build.

    +

    Uninstalling#

    +

    In most cases you can simply delete the sumo folder. If you + installed sumo via a package manager on linux, uninstall it via the + package manager as well.

    +

    Basic Usage#

    +

    What measures are used/represented?#

    +

    All time values are given in seconds. All length values are given in + meters. This means that speed should be given in m/s, etc. + Currently, the default simulation time step is one second long (to + be exact: in each simulation step one second real time is + simulated).

    +

    What does the following error mean?#

    +

    Warning: No types defined, using defaults... Error: An exception + occurred! Type:RuntimeException, Message:The primary document + entity could not be opened. Id=<PATH> Error: (At line/column 1/0). + Error: Quitting (conversion failed). + Answer: Simply that the file you try to use (<PATH>) does not exist. + This is xerces' way to say "file not found".

    +

    How do I work around a file not found / command not found error?#

    +

    To run the command-line programs your operating system must be able + to find them. + If you are using Windows please consult Basics/Basic Computer Skills#running_programs_from_the_command_line + If you are using Linux run export PATH=$PATH:/path/to/sumo/bin + (replace /path/to/sumo/bin with the path to the bin directory of + your sumo installation)

    +

    How do I work around missing dll errors on windows?#

    +

    Install MSVC2013 Redistributable + (Old versions of SUMO may also require the MSVC2010 Redistributable)

    +

    What is the meaning of the different exit codes (linux command line)#

    +

    0 is success, 1 is a recognized error and anything above is an + unorderly termination (crash). If you see exit codes other than 0 or + 1 please tell us about it

    +

    What's the deal with schema resolution warnings / xsd errors?#

    +

    Since version 0.20.0 sumo performs + XML-validation on input files with + schema information. This helps to detect common mistakes during + manual preparation of XML input files. Files generated by sumo + applications such as DUAROUTER always add + schema information. The schema files which are needed for checking + are retrieved from the local sumo installation if the environment variable SUMO_HOME is set. + Otherwise the files will be retrieved from + sumo.dlr.de which is slower. Validation + can be disabled by using the option --xml-validation never or by deleting the schema + information at the top of the XML input file(s).

    +

    What causes ''Error: unable to resolve host/address 'sumo.dlr.de' ''?#

    +

    This is related to XML-validation (see + above). When the the environment variable SUMO_HOME + is not set, applications will try to retrieve the xsd schema files + online. If there is no internet connection. The above error results. + The solution is to either

    +
      +
    • disable validation or
    • +
    • declare SUMO_HOME or
    • +
    • ensure internet connectivity
    • +
    +

    Why can my input-XML files not be read even though they look OK to me?#

    +

    Errors such as

    +
    Error: attribute name expected at
    +At line/column 10/46
    +
    + +

    can be caused by non-printing characters in the XML-file. Open your + XML-file in a document editor and activate the option for showing + line-breaks and other non-printing characters to find them.

    +

    Why do I get errors about missing files / file not found even though the file exists?#

    +

    SUMO versions before 1.0.0 use the space character to separate file paths. This means it + will not be able to load files with a path such as C:\Program + Files\foo.xml even when adding quotation marks. Since 1.0.0 the ',' (comma) is used so these paths should work. + Additionally, SUMO may fail to load files if the name contains characters outside + the basic ASCII set.

    +

    Windows 10 is blocking the execution of sumo-gui and netedit. How come?#

    +

    Executable files downloaded from the internet may trigger the windows 10 security warning. You can work around this by clicking on the 'More Info' Text and then selecting 'Run Anyway' in the subsequent dialog.

    +

    NETCONVERT#

    +

    I made changes to the .net.xml-file but it did not work as expected. Why?#

    +

    As a general rule, you should never modify the .net.xml file + directly nor try to generate one with a custom process. There are + lots of subtle interdependencies between network elements which are + hard to get right with manual modifications. Even if your .net.xml + can be loaded by SUMO it could fail in ways that + are less obvious:

    +
      +
    • By having right-of-way rules that work somewhat differently than + expected (this part of the .net.xml file is particularly complex)
    • +
    • By losing properties when later being edited with + NETEDIT
    • +
    • By failing to work with updated versions of SUMO
    • +
    +

    If you need to modify a network there are several possibilities:

    +
      +
    1. Edit the network with NETEDIT
    2. +
    3. Modify the original input files and then rebuild the net with + NETCONVERT.
    4. +
    5. Patch the network with NETCONVERT. You can + load a .net.xml file together with + small XML-files + to patch individual edges, nodes and connections. Additional + possibilities are described + here. + For changing traffic light plans or timings see + Simulation/Traffic_Lights. + If you cannot figure out how to accomplish the desired changes this + way, contact us!.
    6. +
    7. Use NETCONVERT-option --plain-output-prefix to convert the + network into it's plain XML representation. + Then modify these files and rebuild the network
    8. +
    +

    If you need to build a network from custom input data it is recommended +to generate +plain-xml-files +(nodes, edges, connections) with a custom process and build your network +with NETCONVERT from these files. These input +files allow for many customization of geometrical and structural network +properties. If you cannot get them to represent the network you need, +ask for help on the mailing list. Alternatively you could also add another import module to NETCONVERT (which we would be +happy to integrate if possible).

    +
    +

    Caution

    +

    In contrast, generating a network directly has been a dead-end for more than one project. You have been warned.

    +
    +

    My network looks ugly, All the junction shapes are wrong. How come?#

    +

    This currently happens up to version 0.23.0 if you import networks + with left-handed traffic. See + #Can_SUMO_simulate_lefthand_traffic?.

    +

    Some junctions in my network look ugly. What can I do?#

    +

    See Joining Junctions. If + that doesn't help, check for invalid edge geometry. A sharp turn in + front of an intersection (even if the segment is only centimeters + long) may mess up the shape computation. Read the + NETCONVERT warnings about sharp angles and + consider using NETCONVERT option --geometry.min-radius.fix. + If that still doesn't help you may specify the shape of the junction + manually using the shape-attribute.

    +

    Can I import the free network of Osnabrück "Frida"?#

    +

    Yes and no. You can import it using NETCONVERT, a description is + available at + Networks/Import/ArcView. + This may be a good gis-network but lacks some needed information in + order to be usable for simulations (see discussion at the link + above).

    +

    Are there any other free networks available I can use?#

    +

    See Networks/Import/OpenStreetMap

    +

    The application hangs after a while (few memory consumption, most of the system time) (Windows)#

    +

    You are probably running a program compiled in the debug-mode. This + yields in at least the triple of normal memory usage and your system + may not be able to solve. Try to use the normal version, build in + Release-mode (or buy more RAM :-) ).

    +

    Many errors of the form Edge's 'x' from- and to-node are at the same position#

    +

    You are probably trying to import a network with geo-coordinates + without specifying a geo-projection. Add option --proj.utm.

    +

    Many errors of the form Error: Type 'x' used by edge 'y' was not defined#

    +

    You are probably trying to re-import an OSM-network written to plain + XML data. Add --ignore-errors.edge-type or provide a type file.

    +

    Error: SUMO was compiled without GDAL support#

    +

    The default windows release is currently provided without GDAL support +due to EPL2 Licensing issues. If you need to import shapefiles, either +use the Linux version or download the nightly-extra version

    +

    NETEDIT#

    +

    How can I obtain NETEDIT?#

    +

    NETEDIT is available as part of the regular + distribution since version 0.25.0.

    +

    Traffic Demand Generation#

    +

    How do I generate random routes?#

    +

    First of all you should know that random routes are probably quite + unrealistic. + If you wish to use them anyway, use the script + <SUMO_HOME>/tools/trip/randomTrips.py to generate random trips as explained + here + Tools/Trip#randomTrips.py.

    +

    You can also call the script without options to get additional help. + See Demand/Shortest or Optimal Path Routing#Usage_Examples + for more information on turning trips into routes.

    +

    How do I maintain a constant number of vehicles in the net?#

    +

    There are different methods for accomplishing this. In either case + the simulation itself should be constraint using options --begin, --end.

    +
      +
    • You can use rerouters in the + simulation. Rerouters, assign a new route for vehicles driving + across them and thus prevent them from leaving the network. For an + example with a simple circle see <SUMO_HOME>/tests/sumo/cf_model/drive_in_circles
        +
      • The tool generateContinuousRerouters.py can be used to generate + rerouters for continuous operation with configurable turning ratios.
      • +
      • If the networks is not circular to begin with (i.e a single + road) you can make the network circular in a non-geometrical way + by adding a return edge that and declaring it's length to be very + short (minimum 0.1m). The return edge should have a sensible geometry (i.e. a detour loop) but the length can be made very short so that it does not affect vehicle routes.
      • +
      +
    • +
    • You can generate long trips going around the network with lots of + detours. This can be accomplished using + randomTrips.py by setting + the options below. If the network contains disconnected parts, not + all random trips will be viable. In this case, simply generate more + trips and delete superfluous vehicles from the output route file.
        +
      • --begin <your desired begin time>
      • +
      • --end <begin + time in which vehicles shall be inserted to then network>
      • +
      • --period <(end - begin) / number of vehicles desired>
      • +
      • --intermediate <INT> set to a large value to ensure that vehicles remain in the simulation long enough
      • +
      • -r <output route file>
      • +
      +
    • +
    + +
      +
    • You can use the option --max-num-vehicles to set the desired number. Vehicle + insertions are delayed whenever this number would be exceeded. To + avoid a large number of delayed vehicles it is recommended to also + use the option --max-depart-delay. When using this approach you must ensure that there + is a sufficient number of vehicles that are ready for insertion at + all times. Note, that the number of distinct vehicle IDs over the + whole simulation is much larger the specified value because some + vehicles leave the simulation and new vehicles with distinct IDs are + inserted to replace them.
    • +
    +
    +

    Caution

    +

    Up to version 0.24.0, option --max-num-vehicles terminates the simulation when exceeding the specified number

    +
    +

    A vehicle cannot reach its target or takes a circuitous route. Why?#

    +

    Unexpected routes are often caused by invalid lane-to-lane + connections or + vClass-restrictions. + Even if there are some lanes on every edge that permit the vehicle, + they may not be connected. If the vehicle has the default type, it + will ignore access restrictions and travel on all lanes. The + netcheck tool can be used to + visualize connectivity from a starting edge and to discover missing + connections. It may be necessary to delete some detour edges from the network to discover + the relevant connectivity boundaries.

    +

    To investigate connectivity SUMO-GUI can be + made to show lane-to-lane connections when customizing the + visualization options for junctions. To investigate lane-permission + issues, the menu option Edit->Select lanes which allow... can be + used for visualizing selected permissions.

    +

    How do I generate SUMO routes from GPS traces?#

    +

    The answer largely depends on the quality of your input data mainly + on the frequency / distance of your location updates and how precise + the locations fit your street network. In the best case there is a + location update on each edge of the route in the street network and + you can simply read off the route by mapping the location to the + street. This mapping can be done using the python sumolib coming + with sumo, see + Tools/Sumolib#locate_nearby_edges_based_on_the_geo-coordinate.

    +

    This will fail when there is an edge in the route which did not get + hit by a data point or if you have a mismatch (for instance matching + an edge which goes in the "wrong" direction). In the former case you + can easily repair the route using DUAROUTER + with --repair. Another small script which helps here is + Tools/Routes#tracemapper.py. + You can also use the map matching plugin from + Contributed/SUMOPy here.

    +

    For more complex cases (i.e. large temporal gaps or spatial errors) + the problem is known as Map Matching. Open source + tools exist to facilitate this + (MatchGPX2OSM + graphhopper).

    +

    To exactly reproduce high-resolution trajectories, it is possible to + map exact vehicle locations (including lateral positioning) and also + to move vehicles beyond the road space by using the TraCI moveToXY function.

    +

    Simulation#

    +

    How to simulate an accident#

    +

    SUMO automatically detects vehicle collisions. Since the default +model aims to be accident free, some effort must be taken to create accidents.

    +

    Often, the effects of an accident are required instead of the accident +itself. Without using TraCI the following approaches +may be useful:

    +
      +
    1. Let a vehicle halt on the lane for some time (see Definition of Vehicles, Vehicle Types, and Routes#Stops). +This works quite nice for simulating accidents.
    2. +
    3. Put a variable speed sign of the lane where the accident is meant to +be and let it reduce the speed (see Simulation/Variable Speed Signs). This method will +reduce the throughput on the lane, but further dynamics will rather not +fit to what one would expect from an accident situation.
    4. +
    5. You may of course combine both approaches. Within a project we +simulated traffic incidents by letting vehicles stop on one lane and +reducing the speed on the other lanes.
    6. +
    7. Alternatively, you may close one or more of the lanes on an edge
    8. +
    9. If you close the whole edge, rerouting may be triggered as well
    10. +
    11. By setting the option --collision.stoptime, traffic jams may be created after a +registered +collision.
    12. +
    +

    I have changed my network and now SUMO does not load it.#

    +

    Actually, SUMO-networks are not meant to be edited by hand. You have + to describe everything within your input properly and let NETCONVERT + build your network. Editing networks by hand is very complicated and + error-prone.

    +

    How do I change the duration of cycles and phases?#

    +

    use NETEDIT

    +

    I can not see a vehicle moving in my simulation#

    +

    There may be several reasons why you do not see the cars.

    + +

    Different departure times with different time step size#

    +

    Vehicles are entering the network earlier with decreasing time step + lengths. + The reason for this behaviour is that a vehicle is emitted at the + end of a time step. For one second time steps, this means that a + vehicle which has the depart time of 0 will be inserted into the + network at the end of the time step between 0 and 1, this means + almost on second 1 (0.99...). If time steps of 0.1 seconds are used, + the same vehicle is inserted into the network at the end of the time + step between 0 and 0.1, this means almost on 0.1 (0.099...).

    +

    How to save a simulation state and proceed later and/or differently#

    +

    See Simulation/SaveAndLoad

    +

    How can I make the simulation run faster?#

    +
      +
    • make sure there are no unwanted jams + The more vehicles there are in the simulion, the slower it gets.
    • +
    • if your network is very large, build it with option + --no-internal-links (simplified intersection model)
    • +
    • If you are using trips or periodic rerouting, enable parallel routing
    • +
    • use the default step-lenght of 1s (using --step-length 0.1 slows down the simulation + by a factor of 10)
    • +
    • if your simulation is very larger. consider using the mesoscopic simulation model
    • +
    • see below for further tips on slow-down
    • +
    +

    The simulation gets slow with many vehicles waiting for insertion#

    +

    SUMO keeps checking continuously for possible vehicle insertions. If + the network is jammed the number of necessary checks grows quickly. + The option --max-depart-delay <TIME> may be used to discard vehicles which could not be + inserted within <TIME> seconds.

    +

    The simulation runs slow on the command line#

    +

    when running on the windows operating system, the command-line + output which is refreshed every simulation step slows the simulation + down significantly. Use option --no-step-log to avoid this.

    +

    The simulation has lots of jams/deadlocks. What can I do?#

    +

    Deadlocks in a scenario can have many causes:

    +
      +
    1. invalid network +
    2. +
    3. invalid traffic lights (see Improving generated traffic lights)
    4. +
    5. invalid demand (too many vehicles overall, too many vehicles + starting on the same edge).
    6. +
    7. invalid routing +
    8. +
    9. invalid insertion (vehicles being inserted on the wrong lane close + to the end of an edge where they need to change to another turn + lane). This can be fixed by setting the vehicle attribute departLane="best"
    10. +
    +

    If the network was imported from OpenStreetMap, it is highly recommended +to use the recommended import options. +The best course of action typically is to observe the simulation using +SUMO-GUI and figure out where the first jam +develops.

    +

    Why do the vehicles perform unexpected lane-changing maneuvers?#

    +

    This may be caused by invalid lane-to-lane connections. Check the + connections in SUMO-GUI by activating + Junctions->show lane to lane connections in the gui settings dialog.

    +

    How do I get high flows/vehicle densities?#

    +

    The following parameters will allow flows in the range of 2500 +vehicles/hour/lane

    +
      +
    • <vType speedDev="0.1" .../> (needed to allow vehicles to catch up with their leader which is + impossible if all drive at the same speed)
    • +
    • <vehicle departSpeed="max" departPos="last" departLane="best" ../>
    • +
    +
    +

    Caution

    +

    When using departLane values best, free or random_free high flows on multi-lane roads require insertion edges that are somewhat longer than the braking distance of the fastest vehicles. This is because the lane selection checks vehicles on the insertion edge to determine a suitable insertion lane and short edges give insufficient information.

    +
    +

    To increase flows even further the following settings can be used +(potentially sacrificing some realism)

    +
      +
    • <vType sigma="0" minGap="1" length="3" .../>
    • +
    • --step-length 0.5
    • +
    • <vType tau="0.5" .../> (should not be lower than step-length)
    • +
    +

    How do I insert vehicles with a fixed density?#

    +

    To start a simulation with 65 evenly-spaced vehicles on a specific lane +of a 1km highway, do the following:

    +
      +
    • create an edge that is 1km long
    • +
    • compute the space for each vehicle: 1000m / 65 = 15.385m
    • +
    • subtract the minimum space requirement (5m vehicle length + 2.5m + minimumg gap by default)
    • +
    • this gives you 7.885m as remaining space between vehicles.
    • +
    • at a default value of tau=1 (desired time headway excluding minGap) + this means vehicles will be in a stationary state at 7.885m/s
    • +
    • you can use insertion method 'last' which places vehicles at their + desired headway for a given speed (repeat for every lane):
    • +
    +
    <flow id="lane0" from="startEdge" to="destEdge" begin="0" end="1" number="65" departPos="last" departSpeed="7.885" departLane="0"/>
    +
    + +

    To let vehicles enter the simulation continuously with a specific +density:

    +
      +
    • compute the time period between successive vehicles using the + equilibrium speed from above: 15.385m / 7.885m/s = 1.951s
    • +
    • uese the equilibrium speed as departSpeed
    • +
    +
    <flow id="lane0" from="startEdge" to="destEdge" begin="0" end="3600" period="1.951" departPos="base" departSpeed="7.885" departLane="0"/>
    +
    + +

    How do I force a lane change?#

    +

    There are several options to force a vehicle onto a lane:

    + +
    +

    Note

    +

    A further method is planned but not yet implemented: #1020

    +
    +

    Are there any limits in regard to the size of a simulation scenario?#

    +
      +
    • There are no hard limits on the number of streets, intersections or + vehicles in SUMO. Make sure that you have enough RAM when trying to + build or run scenarios beyond city-size. It may be necessary to use + the 64bit version of SUMO to make use of available RAM.
    • +
    • The maximum length of a simulation scenario is 285 million years (or + 278 thousand years at millisecond time resolution). If you need to + simulate longer time periods you must save and reload the simulation state
    • +
    +

    Visualisation#

    +

    SUMO-GUI breaks#

    +

    Sometimes SUMO-GUI terminates with no reason. + In most cases, an update of the opengl-driver solves this problem.

    +

    Display flickers in the area of the mouse pointer (Windows)#

    +

    Newer Windows-Versions seem to cache the area under the mouse to + apply the mouse shadow afterwards. To avoid this, go to your + Systemmenu, then Mouse->Pointers and disable the mouse shadows. + That's the only solution so far. (Origin: Till Oliver Knoll, via QT + Interest List)

    +

    SUMO-GUI windows and buttons appear but no net/cars are visible / Vehicles are not visible or flicker / Roads are drawn on top of vehicles#

    +

    This problem may occur when using outdated/wrong openGL drivers. + Please try to update the drivers for you graphics hardware.

    +

    Building videos from SUMO-GUI#

    +

    There are several ways to build videos from your SUMO simulation. You +can use screen capturing tools like VLC Player +[1]. The disadvantage of this approach is +the requirement of a (very) fast CPU to capture the video in real time, +it depends on the chosen resolution and screen size of the simulation.

    +

    The second approach needs a SUMO-GUI version which has support for +ffmpeg compiled in (for the windows downloads this is the extra +version). When in doubt open the about dialog (press F2) and read the +line mentioning the compiled features (like Proj) whether it includes +FFmpeg. If so, you can use the screenshot button to start video +recording. Just enter a filename ending with ".h264" or ".hevc" +depending on the encoder you want. Please be aware that this will slow +down your simulation sometimes to the point of halting.

    +

    Another approach is the use of single images for every simulation +timestep. This can be done with an additional traci command for building +screenshots. A small python snippet shows the usage of this TraCI +command to get a new image for each new timestep.

    +
        for i in range(duration):
    +        traci.simulationStep()
    +        traci.gui.screenshot("View #0", "images/"+str(i)+".png")
    +
    + +

    Next you have to glue the images together. This job can be done +graphically with virtualdub [2] or via +commandline with ffmpeg [3]. An example command +for ffmpeg is shown below.

    +
        ffmpeg -r 10 -i images/%d.png -b:v 1500k -vcodec wmv2 sumo.wmv
    +
    + +

    The parameters -r set the value for the fps and -b:v the bitrate for the +video.

    +

    Incomplete output#

    +

    When using the GUI or TraCI the output files seem sometimes incomplete +because the files are only flushed when everything is closed. For the +GUI you can either use the close item from the menu or close the whole +GUI. In TraCI it is always a good idea to wait for the sumo process to +be finished using some kind of +process.wait() +mechanism

    + +

    Drivers of DisplayLink devices are +incompatibles with Fox Library. If SUMO or netEdit presents graphics +problem like this +during the execution, DisplayLink drivers must be uninstalled.

    +

    Upgrading#

    +

    How do I upgrade SUMO?#

    +

    The easiest way is to download the latest sumo release to a + directory of your choices and start using it from there. You may + have to update the environment variables PATH and SUMO_HOME to + ensure that the correct version of the application is called from + the command line (see + Basics/Basic_Computer_Skills#Configuring_Path_Settings).

    +

    SUMO warns about deprecated networks or fails to load them#

    +

    In major versions (whenever the 1st or 2nd digit of the version + number changes) there may be changes to the network format. In this + case we provide scripts in <SUMO_HOME>/tools/net which can be used to + upgrade your networks automatically. The current version of + NETCONVERT can also be used to upgrade most + network files to the current version. Simply call netconvert -s old.net.xml -o new.net.xml

    +

    Python tools#

    +

    How do I run the python tools?#

    +

    See here

    +

    tools fail with a SyntaxError or ImportError or some TypeError concerning ">>"#

    +

    Many python tools require python version 2.7. We aim to have Python + 3 compatibility for sumolib and + traci however.

    +

    tools fail with an ImportError#

    +

    Make sure to set the environment variable SUMO_HOME to point at the + base directory of your SUMO installation (the directory that + contains tools and bin).

    +

    how do I import traci or sumolib in my own python script?#

    +

    In order to import these libraries the folder <SUMO_HOME>/tools must be in your +python search path. +This can be accomplished by modifying the python variable sys.path +as explained here and +here. Alternatively you can hard-code the +path to your SUMO-installation into your script:

    +
     import sys
    + sys.path.append('/your/path/to/sumo/tools')
    + import traci
    + import sumolib
    +
    + +

    the python scripts do not accept command line arguments (windows only)#

    +

    This is a known issue +with some python installations. The usual workaround if you are not +allowed to do edit the registry, is to call the python interpreter +explicitly, e.g. instead of

    +
    script.py <argument>
    +
    + +

    you do

    +
    python script.py <argument>
    +
    + +

    osmWebWizard.py fails to generate Scenario on Windows 10#

    +

    This can happen with an outdated version of python 2.7. Updating to +2.715 (64bit) has been reported as fixing this problem.

    +

    (Communication) Network Simulators#

    +

    How do I use .tcl files with NS2?#

    +

    Questions regarding NS2 should be put to the NS2 mailing list.

    +

    How do I combine SUMO with a network simulator?#

    +

    Check out veins.

    +

    Outdated (Questions for very old versions of SUMO)#

    +

    Vehicles do not drive on the last edge of their route#

    +

    Up to (and including) version 0.13.1 a vehicle finished its route + (per default) on position 0 of the last edge. You can change this by + setting the attribute departPos in the vehicle definition (see + Definition_of_Vehicles,_Vehicle_Types,_and_Routes). + Negative values count backwards from the end of the edge, thus + setting departPos="-1" will make the vehicle drive (almost) to + the end of the last edge. The new default in more recent versions is + the end of the edge, which should disable this behavior.

    +

    Vehicle jumps backward#

    +

    When I try to evaluate my vehicle dump, sometimes vehicle seem to + jump backward (their position is smaller than in the previous step)

    +

    To avoid jams due to an inappropriate lane changing behavior, + vehicles may swap their lanes. In this case each vehicle obtains the + position and speed of the other vehicle. As the position of the + vehicles may differ a bit, one of the vehicles may seem to jump + backwards.

    +

    This should not happen from Version0.8 on.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 28 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/favicon.ico and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/favicon.ico differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/FontAwesome.otf and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/FontAwesome.otf differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.eot and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.eot differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.svg sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.svg --- sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.svg 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.ttf and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.ttf differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.woff and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.woff differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.woff2 and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/fontawesome-webfont.woff2 differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.eot and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.eot differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.svg sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.svg --- sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.svg 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.ttf and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.ttf differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.woff and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.woff differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.woff2 and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/fonts/glyphicons-halflings-regular.woff2 differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Fun.html sumo-1.6.0+dfsg1/docs/userdoc/Fun.html --- sumo-1.5.0+dfsg1/docs/userdoc/Fun.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Fun.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + Fun - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Fun
    + + + +

    SUMO Song (German)#

    +

    Aber bitte mit SUMO; slighly censored and unfortunately with no +youtube pendant.

    +
     C                                                   F      C
    +Sie trafen sich täglich um viertel nach Acht, oh ho ho, oh yeah.
    +
    +                                            F      C
    +In ... Zimmer es wurde laut gedacht, oh ho ho, oh yeah.
    +
    +     F                          C
    +Die Füße auf dem Tisch, den Kaffee schwarz und heiß
    +
    +     F                          G
    +Das Hämmern im Kopf: ..., was'n das für'n Scheiß
    +
    +     C                               F              F F# G
    +Wir simulieren viel besser, viel schneller und soooo
    +
    +              C
    +Und zwar mit SUMO - aber bitte mit SUMO.
    +
    +
    +
    + C                                                 F      C
    +Die Entwicklung begann vor einem Jahrzehnt, oh ho ho, oh yeah.
    +
    +                                                           F      C
    +Es war ... Traum, wonach er sich immer gesehnt, oh ho ho, oh yeah.
    +
    + F                 C
    +Fußgänger, Ampeln, Autos und Straßen
    +
    +     F                  G
    +Das war seine Welt über alle Maßen
    +
    +     C                                   F               F F# G
    +Mit C++ ging's dann ans Werk - manchmal sogar auf dem Klo
    +
    +              C
    +Immer wieder SUUUMO - aber bitte mit SUMO
    +
    +
    +
    +C                                             F      C
    +Es wurde entwickelt tagaus und tagein, oh ho ho, oh yeah.
    +
    +                                                       F      C
    +Kompiliert und debugged, ja, das musste so sein, oh ho ho, oh yeah.
    +
    +    F                      C
    +Da waren die Bugs und die feature requests
    +
    +     F                           G
    +Die ... fertig machten, ja, das war kein Fest
    +
    +    C                F                F F# G
    +Es wurde gehackt, gefixed und getestet
    +
    +                      C
    +Version 0.11 war die Beste - aber bitte mit SUMO
    +
    +
    +
    + C                                              F      C
    +... war glücklich, denn er hatte zu tun, oh ho ho, oh yeah
    +
    +                                                F      C
    +Immerzu hacken, nie Zeit, um auszuruh'n, oh ho ho, oh yeah
    +
    +     F                               C
    +Bei SUMO gibt's kein Diabetis, kein Meckern und Hau'n
    +
    +      F                          G
    +Viel besser als Schokolade, Zigaretten und Frau'n
    +
    +      C                            F               F F# G
    +... grinste breit, er jubelte und war sehr frooh-ho
    +
    +              C
    +Es war wegen SUMO - aber bitte mit SUMO
    +
    +
    + C                                              F      C
    +Das Ende vom Lied hat wohl jeder erahnt, oh ho ho, oh yeah
    +
    +                                        F      C
    +Der Tod hat ... und co abgesahnt, oh ho ho, oh yeah
    +
    + F                    C
    +Übrig blieb SUMO als einzige Simulation von allen
    +
    + F                 G
    +Sie lebe hoch dem ... sei Dank
    +
    +    C                         F           F F# G
    +Wäre .. nicht gewesen, wäre ... nun krank
    +
    +                     C
    +Dann aber bitte mit SUMO - aber bitte mit SUMO.
    +
    +
    +Noch ein Schnippsel Code - aber bitte mit SUMO
    +Zum Emissionsmodell dazu - aber bitte mit SUMO
    +Oder doch Intermodalität - aber bitte mit SUMO
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Geo-Coordinates.html sumo-1.6.0+dfsg1/docs/userdoc/Geo-Coordinates.html --- sumo-1.5.0+dfsg1/docs/userdoc/Geo-Coordinates.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Geo-Coordinates.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + Geo-Coordinates - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Geo-Coordinates
    + + + +

    Geo-Referenced Networks#

    +

    SUMO networks are always encoded in Cartesian coordinates (meters) and +may contain geo-referencing information to allow conversion to lon,lat. +By default the Cartesian coordinates use the UTM-projection with the +origin shifted to so that the lower left corner of the network is at +0,0.

    +
    +

    Note

    +

    the projection information is encoded in the <location>-element at the top of the .net.xml file.

    +
    +
      +
    • When importing a network from + OSM, geo-referencing is + automatically included in the generated .net.xml file
    • +
    • When importing a network from + plain-xml + files, coordinates may be given in lon,lat and importing using a + projection option such as --proj.utm
    • +
    • When importing a network from Shapefile, the availability of + geo-referencing depends on the format of the source data.
    • +
    +

    Checking Geo-Coordinates#

    +

    In SUMO-GUI when right-clicking anywhere in a +geo-referenced network, the option copy cursor geo-position to +clipboard is available. The resulting lat,lon coordinates are +suitable for pasting into any map engine such as [maps.google.com] or +[maps.bing.com]. Also, the network coordinates as well as the +geo-coordinates at the cursor position are shown in the bottom +right-corner of the window.

    +

    Performing coordinate-transformations#

    +
      +
    • using + TraCI, + coordinates can be transformed between network-coordinates (m,m) and + geo-coordinates (lon,lat) and vice versa
    • +
    • using sumolib + , coordinates can be transformed between network-coordinates (m,m) + and geo-coordinates (lon,lat) and vice versa
    • +
    +

    Obtaining output with geo-coordinates#

    +
      +
    • A network can be exported as plain-xml in geo-coordinates using + the netconvert command
    • +
    +
    netconvert --sumo-net-file myNet.net.xml --plain-output-prefix plain --proj.plain-geo
    +
    + +
      +
    • FCD-output can be obtained + in geo-coordinates by adding the option --fcd-output.geo
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/GitStuff.html sumo-1.6.0+dfsg1/docs/userdoc/GitStuff.html --- sumo-1.5.0+dfsg1/docs/userdoc/GitStuff.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/GitStuff.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + GitStuff - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + GitStuff
    + + + +

    Miscellaneous Git Topics#

    +

    Resolve LF status error#

    +

    Occasionally, when adding files with different line endings to the +repository, a working copy may enter a state with changes that can not +be reverted (by stash or checkout).

    +
    warning: CRLF will be replaced by LF in build/wix/sumo.wxs.
    +The file will have its original line endings in your working directory.
    +
    + +

    Solution +(stackoverflow):

    +
    git rm --cached -r .
    +git reset --hard
    +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/GSOC2012_Application.html sumo-1.6.0+dfsg1/docs/userdoc/GSOC2012_Application.html --- sumo-1.5.0+dfsg1/docs/userdoc/GSOC2012_Application.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/GSOC2012_Application.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + GSOC2012 Application - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + GSOC2012 Application
    + + + +

    This is the Application for the SUMO project by the Core Developement +team of the DLR.

    +

    Describe your organization.#

    +

    SUMO is a highly portable, microscopic road traffic simulation package +designed to handle large road networks. It is mainly developed by +employees of the Institute of Transportation Systems at the German +Aerospace Center. SUMO is open source, licensed under the GNU GPL.

    +

    Using SUMO you can simulate how a given traffic demand which consists of +single vehicles moves through a given road network. The Application +suite consists of tool for preparing the road network, computing route +choices and managing various simulation outputs. Thus, a large set of +traffic management topics can be adressed (see our one-page +overview).

    +

    Designed to be easy to use, yet powerful and flexible, GnuCash allows +you to track bank accounts, stocks, income and expenses. As quick and +intuitive to use as a checkbook register, it is based on professional +accounting principles to ensure balanced books and accurate reports.

    +

    Why is your organization applying to participate in Google Summer of Code 2012? What do you hope to gain by participating?#

    +

    The aim of the SUMO project lies in strengthening the microscop-traffic +simulation community. Instead of multiple short-lived projects with low +comparability we wish to establish a standard simulation package for +everyone to use and improve. While the first goal has been met and SUMO +is now widely used, the second goal remains open. There have been only a +few contributions to the code base. In participating in the Google +Summer of Code, we hope to engage new developers to the benefit of all +our users.

    +

    Did your organization participate in past Google Summer of Codes? If so, please summarize your involvement and the successes and challenges of your participation.#

    +

    No.

    +

    What license(s) does your project use?#

    +

    GNU GPLv3

    +

    What is the URL for your Ideas page?#

    +

    GSOC2012_ProjectIdeas

    +

    What is the main development mailing list for your organization?#

    +

    The main development mailing list is +[sumo-devel@lists.sourceforge.net] For details see our contact +page

    +

    What is the main IRC channel for your organization?#

    +

    We do not have an IRC channel

    +

    Does your organization have an application template you would like to see students use? If so, please provide it now.#

    +
    Contact
    +-------
    +Student name:
    +Location (Home town, country):
    +Email:
    +Phone number:
    +
    +Background/Programming Information
    +-----------------------------------
    +What programming experience do you have so far (languages, operating systems, compilers)?
    +Have you worked on an open source project(s) before, and which one(s)?
    +What is your connection the the traffic simulation community
    +Have you ever built SUMO from source?
    +
    +

    Who will be your backup organization administrator?#

    +

    Daniel Krajzewicz

    +

    What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible.#

    +

    Our mentors are members of the core development team. They have in-depth +knowledge of the code base and our processes. As experienced developers +they all have mentoring experiences. Since the core team is small our +mentors are self-selected.

    +

    What is your plan for dealing with disappearing students?#

    +

    We are confident that careful initial selection and close communication +will prevent students from disappearing.

    +

    What is your plan for dealing with disappearing mentors?#

    +

    Our mentors have been given clearance from their employer to mentor +during their work hours, thus we expect no disappearances. In case of +sickness or other emergencies we have backup mentors.

    +

    What steps will you take to encourage students to interact with your project's community before, during and after the program?#

    +

    We assume that our students already have some connections to the the +traffic simulation community. Before the program we will encourage +interested parties to discuss and refine project ideas via our mailing +list, blog and personal communication. During the program we will seek +to build a relationship based on our common interests which continues +after the program.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/GSOC2012_ProjectIdeas.html sumo-1.6.0+dfsg1/docs/userdoc/GSOC2012_ProjectIdeas.html --- sumo-1.5.0+dfsg1/docs/userdoc/GSOC2012_ProjectIdeas.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/GSOC2012_ProjectIdeas.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,266 @@ + + + + + + + + + + + + + + + + + + + GSOC2012 ProjectIdeas - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + GSOC2012 ProjectIdeas
    + + + +

    Project Ideas for Google Summer of Code 2012#

    +
    +

    Note

    +

    Prerequisites for all projects: C++ coding on Linux or Windows

    +
    +

    Implement left-hand traffic#

    +

    SUMO uses right-hand traffic and therefore presents obstacles when +simulating traffic in many parts of the world.

    +

    Implement GUI-frontends for some of the command-line-only applications#

    +

    The use of command-line applications presents a steep learning curve to +many users. Even a generic tool for setting options may be of great +help.

    +

    Enhance Capabilities of the Simulation Viewer#

    +

    The SUMO-GUI application depends on configuration +files. Since editing configuration files is difficult for many users, +SUMO-GUI should provide for a mechanism to load +the required files via menus.

    +

    Implement a movement model for pedestrians#

    +

    Right now, SUMO can account for pedestrians when simulating inter-modal +traffic. However, the model is quite coarse. The time for crossing roads +is not modelled. Also, there is no flow model for crowded side walks.

    +

    Open for your Ideas#

    +

    If you are planning to work with SUMO in your bachelor or masters +thesis, what extra feature do you need to get started?

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/GSoC2015.html sumo-1.6.0+dfsg1/docs/userdoc/GSoC2015.html --- sumo-1.5.0+dfsg1/docs/userdoc/GSoC2015.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/GSoC2015.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,322 @@ + + + + + + + + + + + + + + + + + + + GSoC2015 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + GSoC2015
    + + + +

    Here is the list of steps for the application. +This page should answer all the questions on the list which need more +than yes/no or a list of names

    +

    Describe your organization.#

    +

    ...

    +

    Why do we apply#

    +
      +
    • outreach
    • +
    • gain more developers
    • +
    +

    Ideas list#

    +

    At a minimum, all the ideas on your Ideas List should include the +expected outcome of the project, a potential mentor, the skills and/or +languages required to complete the project, and a general "difficulty" +level.

    +

    Implementing macroscopic assignment models#

    +
      +
    • Goal: Have more than just iterative assignment (At least Lohse etc.)
    • +
    • Mentor: @behrisch
    • +
    • Skills: C++, some math
    • +
    • Difficulty: medium
    • +
    +

    VISSIM importer#

    +
      +
    • Convert at least basic VISSIM networks from recent versions into the + SUMO format
    • +
    • Mentor: @behrisch
    • +
    • Skills: C++, XML
    • +
    • Difficulty: medium
    • +
    +

    Application Launcher#

    +
      +
    • Currently, the command line must be used frequently when preparing a + simulation. To make life easier for many users, a launcher + application for setting options and selecting input files via + dialogs should be created. A wizard-type interface should be added + to streamline common tasks.
    • +
    • Mentor: @namdre
    • +
    • Skills: python
    • +
    • Difficulty: medium (easy, if experience with GUI frameworks exists)
    • +
    +

    Intersection analysis#

    +

    Smartphone app (android, of course!) that can, from the position of the +phone, compute the corresponding intersection geometry by using +openstreetmap data, supported eventually by measurements from the phone +itself (distances e.g.). It then writes these data to a SUMO simulation +file, and has eventually the ability to collect additional traffic data. +Can be done e.g. as a simple counting app, via the video-camera, the +microphone, the magnetic field sensor,... (not all of these make sense, +of course, other sensors might be more suitable)

    +

    In addition to that, it runs a truly fast queueing model on the phone +itself to determine the optimal cycle time, green splits, delays, and +the like. This, too, can be supported by measurements from the +intersection, i.e. the saturation flows for the various connections.

    +
      +
    • Mentor: @behrisch, Peter Wagner
    • +
    • Skills: Android development
    • +
    • Difficulty: medium (easy, if only a frontend to sumo is built)
    • +
    +

    Left-hand traffic#

    +

    Currently, SUMO only simulates right-hand traffic and therefore cannot +simulate some parts of the world.

    +
      +
    • Mentor: @namdre
    • +
    • Skills: C++
    • +
    • Difficulty: medium (need to be able to read and comprehend quite a + bit of existing code)
    • +
    +

    Mentor selection criteria#

    +

    Plan for dealing with disappearing students#

    +

    Plan for dealing with disappearing mentors#

    +

    Steps for encouraging interaction with the community (pre, during and post)#

    +

    How to encouraging students to stick with the project#

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/311_sumo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/311_sumo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/311_vissim.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/311_vissim.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/3sims.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/3sims.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/88x31.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/88x31.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Activitygen-example-net.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Activitygen-example-net.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/AddSpecialLane.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/AddSpecialLane.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/AMITRAN-small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/AMITRAN-small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/apple-touch-icon.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/apple-touch-icon.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/AutobahnEditGeometryPoints.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/AutobahnEditGeometryPoints.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/AutobahnEditViewSettings.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/AutobahnEditViewSettings.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Average_24h.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Average_24h.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Background_example.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Background_example.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Berlin.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Berlin.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CC-BY-SA-small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CC-BY-SA-small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CC-CC0-small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CC-CC0-small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Center.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Center.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ChangePersonPlans.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ChangePersonPlans.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ChargingStationCharging.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ChargingStationCharging.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ChargingStation.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ChargingStation.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CircleNet.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CircleNet.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Classes.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Classes.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeClonningSUMO.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeClonningSUMO.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeConfiguration6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeConfiguration6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakeEnviromentVariables.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakeEnviromentVariables.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CMakePython1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CMakePython1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/COLOMBO-small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/COLOMBO-small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Colorwheel.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Colorwheel.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Con1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Con1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ConflArea_sumo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ConflArea_sumo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ConflArea_vissim.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ConflArea_vissim.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Contdisc.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Contdisc.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Controlunits_on.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Controlunits_on.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CreateEdge7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CreateEdge7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Cross3l_edge2edge_conns.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Cross3l_edge2edge_conns.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Cross3l_lane2lane_conns.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Cross3l_lane2lane_conns.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Cross3l_prohibitions.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Cross3l_prohibitions.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Cross3l_unconstrained.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Cross3l_unconstrained.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Current_step_example.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Current_step_example.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CustomShape1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CustomShape1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CustomShape2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CustomShape2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CustomShape3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CustomShape3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/CustomShape4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/CustomShape4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Decals_gui.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Decals_gui.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Delay.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Delay.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Delete_from_registry.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Delete_from_registry.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Dependencies.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Dependencies.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/DevDoxygenClassDiagrams.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/DevDoxygenClassDiagrams.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/DevDoxygenFunctionInfo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/DevDoxygenFunctionInfo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/DevDoxygenIndex.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/DevDoxygenIndex.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/DisplayLinkError.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/DisplayLinkError.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Dlr_small.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Dlr_small.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Docker-sumo-demo1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Docker-sumo-demo1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/DriverErrors.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/DriverErrors.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/EditEdgeAttr.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/EditEdgeAttr.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/EditVClassRestrictions.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/EditVClassRestrictions.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Eichstaett.net.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Eichstaett.net.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Eichstaett.osm.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Eichstaett.osm.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Eighth.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Eighth.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Ev.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Ev.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fifth.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fifth.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/fig_demand_turnsflows.png sumo-1.6.0+dfsg1/docs/userdoc/images/fig_demand_turnsflows.png --- sumo-1.5.0+dfsg1/docs/userdoc/images/fig_demand_turnsflows.png 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/fig_demand_turnsflows.png 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,7 @@ + + +404 Not Found + +

    Not Found

    +

    The requested URL /TYPE HTML PUBLIC was not found on this server.

    + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_demand_turnsflows_png.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_demand_turnsflows_png.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_demo_noise.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_demo_noise.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_edgeid.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_edgeid.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_main.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_main.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_newscenario.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_newscenario.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_odwizard.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_odwizard.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_resultviewer.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_resultviewer.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/fig_sumopy_gui_sumogui sumo-1.6.0+dfsg1/docs/userdoc/images/fig_sumopy_gui_sumogui --- sumo-1.5.0+dfsg1/docs/userdoc/images/fig_sumopy_gui_sumogui 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/fig_sumopy_gui_sumogui 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,7 @@ + + +404 Not Found + +

    Not Found

    +

    The requested URL /TYPE HTML PUBLIC was not found on this server.

    + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_sumogui.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_sumogui.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_sumo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_sumo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_turnflowwizard.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fig_sumopy_gui_turnflowwizard.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/First.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/First.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Flow_complete_small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Flow_complete_small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Flowws.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Flowws.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Fourth.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Fourth.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/FP7-small.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/FP7-small.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Frida_bidi_highway_ramp.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Frida_bidi_highway_ramp.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Frida_uni_highway_ramp.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Frida_uni_highway_ramp.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEAdditionalSet.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEAdditionalSet.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEBusStop.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEBusStop.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECalibratorDialog.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECalibratorDialog.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECalibrator.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECalibrator.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEChargingStation.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEChargingStation.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnection.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnection.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections4b.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections4b.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEConnections7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEConnections7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEContainerStop.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEContainerStop.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECrossingFrame1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECrossingFrame1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECrossingFrame2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECrossingFrame2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECrossingFrame3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECrossingFrame3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNECrossingFrame4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNECrossingFrame4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEDeleteFrame6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEDeleteFrame6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEE1Instant.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEE1Instant.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEE1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEE1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEE2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEE2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEE3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEE3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEEdge.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEEdge.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEEntry.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEEntry.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEExit.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEExit.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEFrame.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEFrame.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEHelpParameters.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEHelpParameters.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEHelpReferences.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEHelpReferences.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEJunction.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEJunction.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNELane.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNELane.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNELoadAdditionals.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNELoadAdditionals.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNELock.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNELock.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEMove.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEMove.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNENotMove.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNENotMove.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEParameterlist.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEParameterlist.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEReferences.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEReferences.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERerouterDialog1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERerouterDialog1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERerouterDialog2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERerouterDialog2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERerouterDialog3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERerouterDialog3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERerouterDialog4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERerouterDialog4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERerouter.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERerouter.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNERouteProbe.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNERouteProbe.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNETLS.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNETLS.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEVaporizer.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEVaporizer.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEVariableSpeedSignalDialog.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEVariableSpeedSignalDialog.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/GNEVariableSpeedSignal.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/GNEVariableSpeedSignal.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Guisim_empty.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Guisim_empty.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/HelloWorld_1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/HelloWorld_1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/HelloWorld_2.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/HelloWorld_2.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/HelloWorld_3.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/HelloWorld_3.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/HelloWorld_4.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/HelloWorld_4.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/HelloWorld_5.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/HelloWorld_5.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image001.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image001.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image002.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image002.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image003.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image003.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image004.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image004.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image005.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image005.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image006.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image006.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image007.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image007.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image008.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image008.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Image009.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Image009.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/image-facebook.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/image-facebook.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Incoming_rail.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Incoming_rail.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Induction_loop_closeup.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Induction_loop_closeup.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Induction_loop_closeup.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Induction_loop_closeup.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,231 @@ + + +D:\projects\sumo\rbuild\sumo\tests\sumo\output\examples\cross3ltl_inductloops\cil.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Tue Sep 13 10:57:07 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Induction_loops.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Induction_loops.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Induction_loops.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Induction_loops.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,935 @@ + + +D:\projects\sumo\rbuild\sumo\tests\sumo\output\examples\cross3ltl_inductloops\so.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Tue Sep 13 11:02:41 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/InspectMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/InspectMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/InspectMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/InspectMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/InspectMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/InspectMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/InspectMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/InspectMode4.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Instantaneous_loop_closeup.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Instantaneous_loop_closeup.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Instantaneous_loop_closeup.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Instantaneous_loop_closeup.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,238 @@ + + +D:\projects\sumo\rbuild\sumo\tests\sumo\output\examples\cross3ltl_instant_inductloops\closeup.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Tue Sep 13 12:36:55 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Instantaneous_loops.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Instantaneous_loops.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Instantaneous_loops.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Instantaneous_loops.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,937 @@ + + +D:\projects\sumo\rbuild\sumo\tests\sumo\output\examples\cross3ltl_instant_inductloops\instant.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Tue Sep 13 12:36:34 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/JunctionJoin_after.svg sumo-1.6.0+dfsg1/docs/userdoc/images/JunctionJoin_after.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/JunctionJoin_after.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/JunctionJoin_after.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,523 @@ + + +D:\junctionJoin_after.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Wed Nov 09 12:36:35 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/JunctionJoin_before.svg sumo-1.6.0+dfsg1/docs/userdoc/images/JunctionJoin_before.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/JunctionJoin_before.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/JunctionJoin_before.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,596 @@ + + +D:\junctionJoin_before.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Wed Nov 09 12:36:23 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/lanepedestrian.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/lanepedestrian.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LaneShapeInsideOfNodeShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LaneShapeInsideOfNodeShape.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LaneShapeIntersectsWithNodeShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LaneShapeIntersectsWithNodeShape.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LaneShapeOutsideOfNodeShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LaneShapeOutsideOfNodeShape.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Length_vs_minGap.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Length_vs_minGap.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Length_vs_minGap.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Length_vs_minGap.svg 2020-04-27 22:07:54.000000000 +0000 @@ -0,0 +1,647 @@ + + + + + + image/svg+xml + + D:\t1.svg + + + + + D:\t1.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Mon Sep 26 12:23:32 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + length + minGap + } + } + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Level16px_00.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Level16px_00.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Level16px_-1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Level16px_-1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Level16px_-2.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Level16px_-2.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/level16px_+3.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/level16px_+3.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Level16px_-3.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Level16px_-3.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/level16px_+5.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/level16px_+5.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LISASumo.ControlUnitsOptionsWindow.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LISASumo.ControlUnitsOptionsWindow.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LisaSumoIcon.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LisaSumoIcon.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LISASumo.MainWindow.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LISASumo.MainWindow.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Locate.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Locate.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/LoggingLevels.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/LoggingLevels.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Logo_cmu.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Logo_cmu.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Logo_ucla.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Logo_ucla.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Menue.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Menue.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/mergeAB.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/mergeAB.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/mergeA.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/mergeA.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/mergeB.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/mergeB.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/mkdocs-grid.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/mkdocs-grid.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeAdditional.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeAdditional.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeCreateEdge.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeCreateEdge.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeInspect.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeInspect.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Model-names.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Model-names.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePersonPlan.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePersonPlan.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePerson.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePerson.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon1GeneralView.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon1GeneralView.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon2SelectingColor.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon2SelectingColor.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon3CreatingPolygon.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon3CreatingPolygon.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon4ClosingShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon4ClosingShape.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon5MovingVertex.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon5MovingVertex.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon6BlockedShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon6BlockedShape.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon7SimplifingShape.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon7SimplifingShape.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModePolygon8POIs.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModePolygon8POIs.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeSelect8.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeSelect8.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ModeStop.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ModeStop.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NameEdges.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NameEdges.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Nefz.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Nefz.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditChainSelected.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditChainSelected.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditChilds.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditChilds.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditDemandMode.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditDemandMode.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditEndpoint1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditEndpoint1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditEndpoint2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditEndpoint2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditNetworkMode.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditNetworkMode.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditPositions.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditPositions.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditReversedirection1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditReversedirection1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditReversedirection2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditReversedirection2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditRouteMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditRouteMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditRouteMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditRouteMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditRouteMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditRouteMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditRouteMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditRouteMode4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netedit_select_highway.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netedit_select_highway.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditShowParameters.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditShowParameters.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditSplit1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditSplit1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditSplit2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditSplit2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditStopMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditStopMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditStopMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditStopMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditStopMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditStopMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditStopMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditStopMode4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditStopMode5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditStopMode5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditStraighten1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditStraighten1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NetEditStraighten2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NetEditStraighten2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Neteditsupermodes.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Neteditsupermodes.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleMode6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleMode6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NeteditVehicleTypeMode5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_grid1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_grid1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_grid2.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_grid2.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_grid3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_grid3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_random1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_random1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_spider1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_spider1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Netgen_spider2.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Netgen_spider2.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NewView3D.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NewView3D.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/NewView.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/NewView.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Nox_effects_bars.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Nox_effects_bars.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/OnOffRamp.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/OnOffRamp.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Open_net.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Open_net.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Open_sim.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Open_sim.gif differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/OpenStreetMapOverview.svg sumo-1.6.0+dfsg1/docs/userdoc/images/OpenStreetMapOverview.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/OpenStreetMapOverview.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/OpenStreetMapOverview.svg 2020-04-27 22:07:56.000000000 +0000 @@ -0,0 +1,564 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + <<file>> + eichstaett.net.xml + + + + + + + <<file>> + eichstaett.osm.xml + + + + + + + + + + + + + + + + + + + Extract map from + OpenStreetMap + + + + + + + + + + + + + + + + + + + Run + netconvert + + + + + + + <<file>> + eichstaett.typ.xml + + + + + + + <<file>> + eichstaett.con.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Configure the OSM + highway types + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Open_viewport_editor.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Open_viewport_editor.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Open_viewsettings_editor.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Open_viewsettings_editor.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Outgoing_rail.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Outgoing_rail.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/overheadWire_gui_labeled.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/overheadWire_gui_labeled.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/overheadWire_withElecHybrid_gui_labeled.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/overheadWire_withElecHybrid_gui_labeled.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/P_7_6_CO2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/P_7_6_CO2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Paradigm.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Paradigm.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Per_second_dep.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Per_second_dep.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonFrame7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonFrame7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonPlanCreator1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonPlanCreator1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonPlanCreator2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonPlanCreator2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/PersonType.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/PersonType.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Play.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Play.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_net_dump2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_net_dump2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_net_dump.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_net_dump.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_net_selection.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_net_selection.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_net_speeds.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_net_speeds.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_net_trafficLights.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_net_trafficLights.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Plot_trajectories.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Plot_trajectories.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Prio1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Prio1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Prio2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Prio2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Program_own1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Program_own1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Program_own2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Program_own2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/release-note.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/release-note.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Reload.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Reload.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RestrictedLane1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RestrictedLane1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RestrictedLane2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RestrictedLane2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RestrictedLane3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RestrictedLane3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RestrictedLane4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RestrictedLane4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RestrictedLane5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RestrictedLane5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Results1.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Results1.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Results2.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Results2.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Results3.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Results3.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Results4.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Results4.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/RoundAbout7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/RoundAbout7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Route2poly_intersectionFlow.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Route2poly_intersectionFlow.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Route.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Route.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Running1.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Running1.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Save.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Save.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Save_to_registry.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Save_to_registry.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ScreenshotCross.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ScreenshotCross.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/ScreenshotPedCross.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/ScreenshotPedCross.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Scr_ernst-ruska.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Scr_ernst-ruska.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Scr_eworld.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Scr_eworld.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Scr_koeln_fastlane.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Scr_koeln_fastlane.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Second.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Second.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/SelectRerouter1.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/SelectRerouter1.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Seventh.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Seventh.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/SimulationParameters.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/SimulationParameters.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Sixth.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Sixth.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Ssnap_TapasCologne_0.1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Ssnap_TapasCologne_0.1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/StartAttempt1.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/StartAttempt1.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Step.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Step.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Stop.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Stop.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Summary_running_all.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Summary_running_all.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Summary_running_mo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Summary_running_mo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Summary_running.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Summary_running.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/sumo-logo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/sumo-logo.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/sumo-logo.svg sumo-1.6.0+dfsg1/docs/userdoc/images/sumo-logo.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/sumo-logo.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/sumo-logo.svg 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Sumolympic_run1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Sumolympic_run1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Sumolympics_TLSediting.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Sumolympics_TLSediting.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/SUMO_net.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/SUMO_net.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/SwichDebugRelease.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/SwichDebugRelease.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes2.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes2.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes3.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tapas_0_0_2_shapes3.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TAZMode6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TAZMode6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestError8.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestError8.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall1.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall1.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall2.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall2.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall3.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall3.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall4.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall4.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall5.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall5.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall6.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall6.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall7.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall7.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TestInstall8.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TestInstall8.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Third.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Third.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TimelineToC.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TimelineToC.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tl_2008_36061_edges.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tl_2008_36061_edges.gif differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/images/Tls2csv_example_net.svg sumo-1.6.0+dfsg1/docs/userdoc/images/Tls2csv_example_net.svg --- sumo-1.5.0+dfsg1/docs/userdoc/images/Tls2csv_example_net.svg 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/images/Tls2csv_example_net.svg 2020-04-27 22:07:58.000000000 +0000 @@ -0,0 +1,1656 @@ + + +D:\tls2csv_example_net.svg + +Creator: GL2PS 1.3.6, (C) 1999-2011 C. Geuzaine +For: sumo-gui; http://sumo.sf.net +CreationDate: Mon Oct 24 14:42:10 2011 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol1.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol1.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol1_with_il.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol1_with_il.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol1_with_mobinet.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol1_with_mobinet.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol1_with_polys.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol1_with_polys.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol3.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol3.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol3_with_il.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol3_with_il.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol3_with_mobinet.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol3_with_mobinet.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tol3_with_polys.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tol3_with_polys.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Torino_small.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Torino_small.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TraciColose_sequence.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TraciColose_sequence.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TraciConnect_sequence.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TraciConnect_sequence.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Traci_tutorial_tls.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Traci_tutorial_tls.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Trafficmodeller.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Trafficmodeller.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Trans.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Trans.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tripinfo_distribution_duration.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tripinfo_distribution_duration.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Tum-logo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Tum-logo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TurningRelation_SUMO.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TurningRelation_SUMO.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/TurningRelation_VISSIM.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/TurningRelation_VISSIM.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Twoloops.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Twoloops.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Uibk-small.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Uibk-small.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Uni_erlangen.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Uni_erlangen.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Vehicle_angle.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Vehicle_angle.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Vehicle.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Vehicle.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Viewport_editor.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Viewport_editor.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/VirtualController.PNG and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/VirtualController.PNG differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Vissim_net.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Vissim_net.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/VSInstall.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/VSInstall.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Vtk_example.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Vtk_example.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_bicycle.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_bicycle.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_bus_city.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_bus_city.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_bus_flexible.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_bus_flexible.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_delivery.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_delivery.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_emergency.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_emergency.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_lightrail.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_lightrail.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_moped.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_moped.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_motorcycle.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_motorcycle.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_overland.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_overland.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_hatchback.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_hatchback.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_passenger.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_passenger.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_sedan.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_sedan.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_van.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_van.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_wagon.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_passenger_wagon.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_pedestrian.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_pedestrian.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_rail_cargo.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_rail_cargo.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_rail_city.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_rail_city.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_rail_fast.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_rail_fast.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_rail_slow.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_rail_slow.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_transport.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_transport.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_transport_semitrailer.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_transport_semitrailer.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wikicommons_transport_trailer.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wikicommons_transport_trailer.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wroclaw_university_small.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wroclaw_university_small.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wz01.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wz01.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wz02.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wz02.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wz03.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wz03.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Wz04.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Wz04.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Zaik_small.gif and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Zaik_small.gif differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/images/Zoomstyle.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/images/Zoomstyle.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/img/favicon.ico and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/img/favicon.ico differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/userdoc/img/grid.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/userdoc/img/grid.png differ diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/index.html sumo-1.6.0+dfsg1/docs/userdoc/index.html --- sumo-1.5.0+dfsg1/docs/userdoc/index.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/index.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + + +

    Simulation of Urban MObility


    +
    +

    Important notice

    +

    Due to the Coronavirus crisis and the measures imposed, the SUMO User Conference 2020 has been rescheduled. New date: 26-28 October 2020.

    +
    +
    +

    SUMO User Conference 2020

    +

    The SUMO User Conference 2020 takes place October, 26-28, 2020 in Berlin.

    +
    +

    +

    "Simulation of Urban MObility" (Eclipse SUMO) is an open source, highly portable, microscopic and continuous road traffic simulation package designed to handle large road networks. SUMO is licensed under the Eclipse Public License V2. "Eclipse SUMO" is a trademark of the Eclipse Foundation. If you use SUMO, please support its development by telling us about your Publications.

    +

    The content of this Documentation is freely editable according to the wiki style. That means, whenever You find a solution to a problem mentioned on the mailing lists, feel free to add an article to this Documentation or an entry to the frequently asked questions. Write access is restricted. In order to edit this Documentation, click on the "Edit on GitHub" button on the upper right corner and submit a Pull Request. +Here is a short help on editing articles.

    +

    This Documentation is continuously updated and always refers to the latest development version. Documentation for a specific release version of SUMO is included in the download of that version.

    +

    Documentation#

    + +

    Downloads#

    +

    Release 1.6.0, 28.04.2020

    + +

    SUMO-Game

    + +

    References#

    + +

    Developer#

    + +

    Extensions#

    +

    Open Source Software

    +
      +
    • TraCI

      online interaction with the simulation

      +
    • +
    +
      +
    • Cadyts

      a tool by Gunnar Flötteröd which adapts the simulated flows to the real flows in a known net

      +
    • +
    +
      +
    • SUMOPy

      a tool by Joerg Schweizer supporting the whole SUMO toolchain with a GUI especially for demand modelling

      +
    • +
    +
      +
    • LiSuM

      couples LISA+ and SUMO to simulate real-world traffic light controllers.

      +
    • +
    +
      +
    • Veins

      connects SUMO to OMNeT++

      +
    • +
    +
      +
    • FLOW

      a framework for applying reinforcement learning and custom controllers to SUMO, developed at the University of California, Berkeley. + [1]

      +
    • +
    +
      +
    • VSimRTI

      C2X environment connecting SUMO to different network and application simulators

      +
    • +
    + +
      +
    • iTetris

      connects SUMO to ns3, available here.

      +
    • +
    +
      +
    • ocit2SUMO Generate traffic light signal plans from OCIT® data.
    • +
    +

    Commercial Extensions

    +
      +
    • Webots

      coupling with a robot simulator

      +
    • +
    +
      +
    • iTranSIM

      extension by online-calibration using induction loop data by Tino Morenz

      +
    • +
    +
      +
    • eWorld

      an application that allows to convert and enrich roads networks

      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 16 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/Linux_Build.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/Linux_Build.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/Linux_Build.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/Linux_Build.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,443 @@ + + + + + + + + + + + + + + + + + + + Installing/Linux Build - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Installing/Linux Build
    + + + +

    This document describes how to install SUMO on Linux from sources. If +you don't want to extend SUMO, but merely use it, you might want +to download one of our pre-built binary +packages instead.

    +

    To be able to run SUMO on Linux, just follow these steps:

    +
      +
    1. Install all of the required tools and libraries
    2. +
    3. Get the source code
    4. +
    5. Build the SUMO binaries
    6. +
    +

    For ubuntu this boils down to

    +
     sudo apt-get install cmake python g++ libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig
    + git clone --recursive https://github.com/eclipse/sumo
    + export SUMO_HOME="$PWD/sumo"
    + mkdir sumo/build/cmake-build && cd sumo/build/cmake-build
    + cmake ../..
    + make -j$(nproc)
    +
    + +

    Each of these steps is described in more detail and with possible +alternatives below.

    +

    Installing required tools and libraries#

    +
      +
    • For the build infrastructure you will need cmake together with a moderately + recent g++ (4.8 will do) or clang++ (or any other C++11 enabled compiler).
    • +
    • The library Xerces-C is always needed. To use + SUMO-GUI you also need Fox Toolkit in version + 1.6.x. It is highly recommended to also install Proj to have support + for geo-conversion and referencing. Another common requirement is + network import from shapefile (arcgis). This requires the GDAL + libray. 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. There are some 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) and + python-devel and swig (for running TraCI pythons scripts without a socket + connection)
    • +
    +

    Getting the source code#

    +

    For the correct setting of SUMO_HOME you have to remember the correct +path, where you build your SUMO, the SUMO build path. This path is shown +with pwd at the end of getting the source code. If you want to develop +actively on sumo we strongly recommend to use the git repository. Please +build the tarball version if you need for some reason a specific version +of sumo.

    + +

    The following commands should be issued:

    +
    git clone --recursive https://github.com/eclipse/sumo
    +cd sumo
    +git fetch origin refs/replace/*:refs/replace/*
    +pwd
    +
    + +

    The additional fetch of the replacements is necessary to get a full +local project history.

    +

    release version or nightly tarball#

    +

    Download +sumo-src-1.6.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
    +
    + +

    Definition of SUMO_HOME#

    +

    Before compiling is advisable (essential if you want to use Clang) to +define the environment variable SUMO_HOME. SUMO_HOME must be set to +the SUMO build path from the previous step. Assuming that you placed +SUMO in the folder "/home/<user>/sumo-<version>", if you want to +define only for the current session, type in the console

    +
    export SUMO_HOME="/home/<user>/sumo-<version>"
    +
    + +

    If you want to define for all sessions (i.e. for every time that you run +your Linux distribution), go to your HOME folder, and find one of the +next three files (depending of your Linux distribution): +.bash_profile, .bash_login or .profile (Note that these +files can be hidden). Then edit the file, add the line from above at the +end and restart your session.

    +

    You can check that SUMO_HOME was successfully set if you type

    +
    echo $SUMO_HOME
    +
    + +

    and console shows "/home/<user>/sumo-<version>"

    + +

    To build with cmake version 3 or higher is required.

    +

    Create a build folder for cmake (in the sumo root folder)

    +
    mkdir build/cmake-build
    +cd build/cmake-build
    +
    + +

    to build sumo with the full set of available options just like GDAL and +OpenSceneGraph support (if the libraries are installed) just run:

    +
    cmake ../..
    +
    + +

    to build the debug version just use

    +
    cmake -D CMAKE_BUILD_TYPE=Debug ../..
    +
    + +
    +

    Note

    +

    On some platforms the required cmake executable is called cmake3.

    +
    +

    after this is finished, run

    +
    make -j $(nproc)
    +
    + +

    The nproc command gives you the number of logical cores on your +computer, so that make will start parallel build jobs which makes the +build a lot faster. If nproc is not available on your system, insert a +fixed number here or leave the option out. You may also try

    +
    make -j $(grep -c ^processor /proc/cpuinfo)
    +
    + +

    Other useful cmake options:

    +
      +
    • -D PROFILING=ON enable profiling instrumentation for gprof (gcc + build only)
    • +
    • -D COVERAGE=ON enable coverage instrumentation for lcov (gcc build + only)
    • +
    • -D CHECK_OPTIONAL_LIBS=OFF disable all optional libraries (only + include EPL compatible licensed code)
    • +
    • -D PROJ_LIBRARY= disable PROJ
    • +
    • -D FOX_CONFIG= disable FOX toolkit (GUI and multithreading)
    • +
    +

    Building with clang#

    +

    If you want to use a different compiler (just for the fun of it or +because it has additional features) you can enable it at configure time. +Our current clang configuration for additional static code checking +enables the following CXXFLAGS:

    +
    -stdlib=libstdc++ -fsanitize=undefined,address,integer,unsigned-integer-overflow -fno-omit-frame-pointer -fsanitize-blacklist=$SUMO_HOME/build/clang_sanitize_blacklist.txt
    +
    + +

    You may of course leave out all the sanitizer-checks you don't want but +the stdlib option has to be set. The blacklist filters out a known bug +in the cstdlib. For details see the clang documentation.

    +

    The current CMake configuration already contains this for the debug +build, so for building with CMake and clang just change to your build +dir and use

    +
    CXX=clang++ cmake -DCMAKE_BUILD_TYPE=Debug ../..
    +
    + +

    Installing the SUMO binaries#

    +

    This (optional) step will copy the SUMO binaries to another path, so +that you can delete all source and intermediate files afterwards. If you +do not want (or need) to do that, you can simply skip this step and run +SUMO from the bin subfolder (bin/sumo-gui and bin/sumo).

    +

    If you want to install the SUMO binaries, run

    +
    make install
    +
    + +

    or

    +
    sudo make install
    +
    + +

    You have to adjust your SUMO_HOME variable to the install dir (usually +/usr/local/share/sumo)

    +
    export SUMO_HOME=/usr/local/share/sumo
    +
    + +

    Troubleshooting#

    +

    Problems with the socket subsystem#

    +

    Problem:

    +
    recv ./foreign/tcpip/libtcpip.a(socket.o) (symbol belongs to implicit dependency /usr/lib/libsocket.so.1)
    +
    + +

    Solution: +http://lists.danga.com/pipermail/memcached/2005-September/001611.html

    +

    ld cannot find an existing library (Fedora-23)#

    +

    Problem:

    +
    /usr/bin/ld: cannot find -lfreetype
    +ls -lah /usr/lib64/libfreetype*
    + lrwxrwxrwx. 1 root root   21 Jul 28 15:54 /usr/lib64/libfreetype.so.6 -> libfreetype.so.6.12.0
    + lrwxr-xr-x. 1 root root 689K Jul 28 15:54 /usr/lib64/libfreetype.so.6.12.0
    +
    + +

    Solution: Install the dev package; for fedora:

    +
    sudo yum install freetype-devel
    +
    + +

    For details see +stackoverflow +discussion.

    +

    Additional notes for Cygwin users#

    +

    At the moment GUI building is still troublesome. It depends whether you +want to use the X-Server or native Windows GUI. We tried native Windows +GUI only and had to change the installed libFOX-1.4.la such that it +contains

    +
    dependency_libs=' -lgdi32 -lglaux -ldl -lcomctl32 -lwsock32 -lwinspool -lmpr
    +-lpthread -lpng /usr/lib/libtiff.la /usr/lib/libjpeg.la -lz -lbz2 -lopengl32 -lglu32'
    +
    + +

    Your mileage may vary.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/Linux_Build_Libraries.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/Linux_Build_Libraries.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/Linux_Build_Libraries.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/Linux_Build_Libraries.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,416 @@ + + + + + + + + + + + + + + + + + + + Installing/Linux Build Libraries - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Installing/Linux Build Libraries
    + + + +

    This document contains instructions for two basic ways of installing +tools and libraries.

    +
      +
    • Either install them manually for the current user (no root + privileges required)
    • +
    • Or let your distribution install them system-wide (root privileges + required)
    • +
    +

    You can follow either way.

    +

    Manual installation#

    +

    This document describes how to build and install (higher level) +libraries SUMO depends on from scratch under Linux. There is no need for +package management (RPM or such) or root access. All you need is a +working GCC (version 3.3 and up should suffice) and probably some basic +libraries Fox depends on.

    +

    It has been tested successfully on several SuSE Linux installations and +with a recent cygwin. Everything that needs +extra work on cygwin is described in the cygwin +section.

    +
      +
    • First check whether your Linux distribution comes with a Xerces-C + package and install it together with the header files (for SuSE + users this is the -devel package). Version 3.1 is known to work with + the current repository version. You should also check whether Proj, + GDAL and Fox already come with your distribution and (if so) install + them together with the header files (devel packages). Every package + installed this way you will not need to build by yourself.
    • +
    • Second download the sources of Proj, GDAL, Fox (if you want a GUI), + and Xerces-C (if it does not come with your distribution).
    • +
    • If you are building a fresh repository checkout and don't need + precise geocoordinates you can leave out Proj and GDAL.
    • +
    +

    The tools#

    +

    We use the GNU autotools for generating configure and Makefiles for +Unix-like environments. Documentation can be found in the

    + +

    The Libraries#

    +
      +
    • Build and install the libraries (if you don't have root access + choose a different target for the libs and includes such as $HOME). + For GDAL, Fox and Proj this is more or less straightforward:
    • +
    +
    tar xzf fox-1.6.36.tar.gz
    +cd fox-1.6.36
    +./configure --prefix=$HOME && make install
    +cd ..
    +tar xzf gdal-1.5.1.tar.gz
    +cd gdal-1.5.1
    +./configure --prefix=$HOME && make install
    +cd ..
    +tar xzf proj-4.6.0.tar.gz
    +cd proj-4.6.0
    +./configure --prefix=$HOME && make install
    +
    + +
      +
    • Note: The "make install" for GDAL may fail due to the Python + bindings which it wants to install into some only-root-writable + directory. You can safely ignore this.
    • +
    • It is strongly recommended to use a user writable installation + directory and do "make install" instead of trying to specify + directories inside the directory trees of GDAL, Proj and Fox when + building SUMO later on.
    • +
    • Note: It seems like some distributions of Fox are built with + disabled openGl-support. If you get unresolved references to methods + such as "glColor...", "glVertex3f...", etc. during compilation of + SUMO-GUI you have to enable openGL-support + before compiling the FOX-library using "./configure + --with-opengl=yes --prefix=$HOME && make install"; Still, this is + the default normally.
    • +
    + + +
      +
    • In contrast to the other libraries, it is very likely that Xerces-C + also comes with your Linux distribution (at least it does with a + recent SuSE). If so, please first try to install it from there and + do not forget to install the developer package as well.
    • +
    • The Xerces + build is + somewhat more involved:
    • +
    +
    tar xzf xerces-c-current.tar.gz
    +export XERCESCROOT=${HOME}/xerces-c-src_3_0_1
    +cd $XERCESCROOT/src/xercesc
    +autoconf
    +./runConfigure -plinux -cgcc -xg++ -minmem -nsocket -tnative -rpthread -P$HOME
    +make
    +make install
    +
    + +

    Concluding Remarks#

    +

    After installing all of the required libraries and tools in this +fashion, note that, when building SUMO, the following parameters will be +required for the "./configure" run:

    +
    ./configure --with-fox-config=$HOME/bin/fox-config --with-proj-gdal=$HOME --with-xerces=$HOME
    +
    + +

    Distribution-specific instructions#

    +

    If you want to build and optionally install SUMO on Ubuntu systems, you +may want to follow the instructions below.

    +

    Ubuntu 12.04 (tested with SUMO 0.22.0)#

    +
    sudo apt-get install autoconf
    +sudo apt-get install proj  libtool libgdal1-dev libxerces-c2-dev libfox-1.6-0 libfox-1.6-dev
    +cd /usr/lib; sudo ln -s libgdal1.7.0.so libgdal.so cd /usr/local/src/sumo-0.22.0
    +tar xzf sumo-src-0.22.0.tar.gz
    +sudo mv -v sumo-0.22.0 /usr/local/src
    +cd /usr/local/src/sumo-0.22.0
    +./configure --with-fox-includes=/usr/include/fox-1.6 --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr --with-gdal-libraries=/usr --with-proj-gdal
    +make
    +cd bin
    +sudo mv activitygen emissionsDrivingCycle netconvert polyconvert TraCITestClient dfrouter emissionsMap netgenerate  sumo duarouter jtrrouter od2trips sumo-gui /usr/local/bin
    +
    + +

    Ubuntu 14.04 "Trusty Tahr" (tested with SUMO 0.22.0)#

    +
    sudo apt-get install autoconf
    +sudo apt-get install libproj-dev proj-bin proj-data  libtool libgdal1-dev libxerces-c3-dev libfox-1.6-0 libfox-1.6-dev
    +cd /usr/lib;
    +
    + +

    create this link ...if it complains that it exists, even better

    +
    sudo ln -s libgdal1.7.0.so libgdal.so
    +sudo ln -s libproj.so.0.7.0 proj-lib.so
    +
    + +
    cd sumo-0.22.0
    +tar xzf sumo-src-0.22.0.tar.gz
    +open file "configure" and  change: am__api_version='1.13' to am__api_version='1.14'
    +cd ..
    +sudo mv -v sumo-0.22.0 /usr/local/src
    +cd /usr/local/src/sumo-0.22.0
    +sudo aclocal
    +sudo automake --add-missing
    +sudo ./configure --with-fox-includes=/usr/include/fox-1.6 --with-gdal-includes=/usr/include/gdal --with-proj-libraries=/usr/lib --with-gdal-libraries=/usr --with-proj-gdal
    +sudo make
    +cd bin
    +sudo mv activitygen emissionsDrivingCycle netconvert polyconvert TraCITestClient dfrouter emissionsMap netgenerate  sumo duarouter jtrrouter od2trips sumo-gui /usr/local/bin
    +cd /usr/local/share
    +sudo mkdir sumo-0.22.0
    +sudo mv /usr/local/src/sumo-0.22.0/tools /usr/local/share/sumo-0.22.0/
    +sudo mv  /usr/local/src/sumo-0.22.0/data /usr/local/share/sumo-0.22.0/
    +
    + +

    if exist...

    +
    sudo mv  /usr/local/src/sumo-0.22.0/doc /usr/local/share/sumo-0.22.0/
    +
    + +

    Ubuntu 18.04 (tested with SUMO 0.32.0)#

    +

    The required libraries are libxerces-c-dev, libgdal-dev, libproj-dev and +libfox-1.6-dev.

    +

    Cygwin#

    +

    Cygwin comes with a quite old xerces-c (version 2.5). After installing +it you need to make a symbolic link in /usr/lib such that the linker +finds the correct library:

    +
    cd /usr/lib; ln -s /usr/lib/libxerces-c25.dll.a /usr/lib/libxerces-c.dll.a
    +
    + +

    Now everything (but the GUI) should build fine.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 21 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/MacOS_Build.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/MacOS_Build.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/MacOS_Build.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/MacOS_Build.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + Installing/MacOS Build - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Installing/MacOS Build
    + + + +

    Using Homebrew#

    +

    If you come from a previous macports installation you need to uninstall +sumo and fox toolkit first:

    +
    sudo port uninstall sumo
    +sudo port uninstall fox
    +
    + +

    If you did not already install homebrew, do so by +invoking

    +
    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    +
    + +

    make sure your homebrew db is up-to-date

    +
    brew update
    +
    + +

    Install SUMO stable via the SUMO Brew Formula:

    +
    brew tap dlr-ts/sumo
    +brew install sumo
    +
    + +

    Set the SUMO_HOME environment variable. To do so, open .bash_profile in TextEdit:

    +
    touch ~/.bash_profile; open ~/.bash_profile
    +
    + +

    Just insert the following new line at the end: export SUMO_HOME=/your/path/to/sumo, where /your/path/to/sumo is the path stated in the caveats section of the brew install sumo command.

    +

    Restart the Terminal and test the newly added variable:

    +
    echo $SUMO_HOME
    +
    + +

    After the installation you need to log out/in in order to let X11 start +automatically, when calling a gui-based application like "sumo-gui". +(Alternatively, you may start X11 manually by pressing cmd-space and +entering "XQuartz").

    +

    Using Macports (legacy)#

    +
    +

    Note

    +

    This uses a packaged version of sumo which is convenient but may lag behind the latest official release of SUMO.

    +
    +

    You should start by installing +Macports. Afterwards start a +terminal session and run

    +
    sudo port install sumo
    +
    + +

    While this will install a SUMO version you maybe do not want to use, it +will pull in all dependencies you need.

    +

    If you want to build from a repository checkout you should additionally +do

    +
    sudo port install automake autoconf
    +
    + +

    After obtaining the required libraries +you can follow the build steps of building under Linux, you +might want to add another --prefix=/opt/sumo to the configure line.

    +

    If you wish to use clang rather than gcc for compilation do:

    +
    ./configure CXX=clang++ CXXFLAGS="-stdlib=libstdc++"
    +
    + +

    Thanks to all MacOS builders for sharing their insights.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 23 January 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/MacOS_Build_w_Homebrew.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/MacOS_Build_w_Homebrew.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/MacOS_Build_w_Homebrew.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/MacOS_Build_w_Homebrew.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,217 @@ + + + + + + + + + + + + + + + + + + + MacOS Build w Homebrew - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + MacOS Build w Homebrew
    + + + +
      +
    1. REDIRECT + Installing/MacOS_Build#Using_Homebrew
    2. +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_Build.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_Build.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_Build.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_Build.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,439 @@ + + + + + + + + + + + + + + + + + + + Installing/Windows Build - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Installing/Windows Build
    + + + +

    This document describes how to build SUMO under MS-Windows using only +freely available (this does not mean "open source") tools. +Instructions on how to build SUMO on Windows using an Open Source +toolchain are included in our building on +Linux pages. Please note that you +may also download pre-built Windows binaries.

    + +
      +
    • Download Visual C++ Community Edition
        +
      • Start the installer and select:
          +
        • Python Development (including native tools)
        • +
        • C++ for desktop
        • +
        +
      • +
      +
    • +
    +

    + + +
      +
    • Install notepad++
    • +
    • Install TortoiseGit
    • +
    • Install Git command line tools (this is mandatory if you install TortoiseGit)
    • +
    • If you decide to use the Python which comes with Visual Studio +
    • +
    • If not use pip install pyautogui, matplotlib, rtree, pyproj, lxml
    • +
    • (after 30 days) Setup a Microsoft account (if you do not already have one) and register your Visual Studio
    • +
    +

    Short overview#

    +
      +
    • Download Visual C++ Community + Edition. SUMO is only + compatible with Visual Studio 2013 or higher. If you are using + Windows 8 or later be sure to download Visual Studio for Windows + Desktop. Please install all the available Service Packs for Visual + Studio as well. Note that with Visual Studio Community 2017 SUMO + only can be compiled in Release Mode.
    • +
    • +

      Download Python for Windows and + install it. Our most preferred version is Python 2.7.x for the 32 + bit platform, but you may try Python 3 and / or 64bit as well. + Please be aware that the test environment needs Python 2.7 32bit

      +
      +

      Note

      +

      If you have Visual Studio 2017 you may skip the following steps and jump to Installing/Windows_Build#Doing_everything_inside_Visual_Studio

      +
      +
    • +
    +
      +
    • Download and install CMake
    • +
    • Download and install Git
    • +
    • Clone the sumo repository using git clone https://github.com/eclipse/sumo or download and extract a source + package, see Downloads
        +
      • set SUMO_HOME to the cloned directory
      • +
      +
    • +
    • Install the #Libraries using git clone https://github.com/DLR-TS/SUMOLibraries and set the + SUMO_LIBRARIES environment variable
    • +
    • Run the CMake-GUI and set the source path and define a build + directory, for more details see + Installing/Windows_CMake
    • +
    • Press Configure, select the Visual Studio 2017 Win64 Generator, then + press Generate and Open Project
    • +
    • Compile SUMO in the opened Visual Studio
    • +
    +

    Doing everything inside Visual Studio 2017 (or later)#

    +

    Visual Studio 2017 already brings git and CMake support, so you can

    +
      +
    • Team->Manage Connections and then choose Clone under Local Git +repositories (see here for an Introduction to Git usage with Visual +Studio +including updating and comitting) +
    • +
    • Visual Studio will try to generate the solutions using CMake +automatically
        +
      • will fail at first try if SUMOLibraries is not cloned yet or is in an unusual location (it does not find Xerces)
      • +
      • Select CMake->Generate to try again (it is Project->"Generate Cache" in VS 2019)
          +
        • If it still fails, edit CMakeCache.txt from the CMake menu and set the path (e.g. SUMO_LIBRARIES:PATH=C:/Users/testus/source/repos/SUMOLibraries) and retry
        • +
        +
      • +
      +
    • +
    • Select CMake->"Build All" (Build->"BuildAll" in VS 2019)
    • +
    +

    Libraries#

    +

    We provide a central location for getting all dependent libraries at +https://github.com/DLR-TS/SUMOLibraries. The easiest way is to clone +this repository and define an environment variable SUMO_LIBRARIES +pointing to the resulting directory. They are built with Visual Studio +2017, but may be used with earlier and later versions as well. You may +need to install the Visual C++ 2017 Runtime Distributable for running +SUMO then (tested with Visual Studio 2013).

    +
    +

    Caution

    +

    When cloning SUMOLibraries you must initialized all submodules with git submoudle update --init

    +
    +

    For details on building your +own and also on how to use different versions and additional libraries +see Installing/Windows_Libraries. +Make sure that the subdirectories fox-1.6.54/lib, proj_gdal-1911/bin +and xerces-c-3.2.0/bin are in PATH. Note: for 32 bits compilations +folders are 32bits/fox-1.6.54/lib, 32bits/proj_gdal-1911/bin and +32bits/xerces-c-3.2.0/bin. You can add both to the path but always add the +64 bit version first.

    +

    Tests#

    +
      +
    • If you plan to extend SUMO yourself, or just want to know whether + everything compiled OK, it is strongly recommended to have a look at + Developer/Tests. This tool makes it + easier to check whether some existing functionality was broken by + the extensions.
    • +
    +

    Troubleshooting#

    +
      +
    • Note on installation paths: MSVC seems to have difficulties with + include and library paths containing spaces (for instance + C:\Program Files). Thus try to avoid installing SUMO or any of the + libraries in such paths.
    • +
    + +

    You probably have installed a library to a path containing white spaces +in its name. In such a case, the according environment variable should +be embedded in quotes (").

    +

    Example: set FOX="D:\my libs\fox-1.6.36".

    +

    Failure on pre-build event (missing version.h or *typemap.h)#

    +

    If Visual Studio reports a failed pre-build event you can safely ignore +this, unless you are building from the source code +repository. In +this case you should probably install Python. Even if python is +installed the file associations may be broken which causes the +generation of src/version.h via tools/build/version.py to fail. Either +repair your file associations or undefine HAVE_VERSION_H in +src/windows_config.h.

    +

    If you did install Python correctly, double check that it passes +command line +arguments. +For a quick fix, you can also execute the following commands manually:

    +
    tools\build\version.py
    +tools\build\typemap.py
    +
    + +

    Execution cannot proceed because MSVCR120.dll/MSVCR140.dll was not found#

    +

    Install Microsoft Visual C++ Redistributable Packages for Visual +Studio 2012 +(for MSVCR120.dll) or Microsoft Visual C++ Redistributable Packages for +Visual Studio 2015 (for +MSVCR140.dll). You can check if all dependences are correct using +Dependencies

    +

    +

    In debug mode, execution cannot proceed because MSVCR120D.dll/MSVCR140D.dll was not found#

    +

    Your version of Visual Studio doesn't support Debugging, only can be +compiled in release mode.

    +

    Available configurations#

    +

    The release build is used for the distribution of sumo. The Debug build +allows all debugging features. Keep in mind that +Texttest usually picks up the release +build.

    +
      +
    • Release: All optimizations, assertions disabled, no debugging + symbols, links against external release libs
    • +
    • Debug: No optimizations, assertions enabled, debugging symbols + included, links against external debug libs
    • +
    +

    Left clicking over Solution/Properties/Configuration Manager allow to +change between configurations:

    +

    +

    To switch to a different platform (e.g. 32bit instead of 64 bit) please +run cmake again with a different generator.

    +

    Naming Conventions: 64bit executables have the same name as their 32bit +counterpart. The Debug build additionally carries the suffix 'D'.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 12 December 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_CMake.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_CMake.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_CMake.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_CMake.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + Installing/Windows CMake - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Installing/Windows CMake
    + + + +

    Prerequisites#

    + +

    +Lib folders placed in PATH

    +

    Method 1: CMake GUI#

    +
      +
    • start cmake gui
    • +
    • select source path (e.g. D:\projects\sumo)
    • +
    • select build path (e.g. D:\projects\sumo\cmake-build)
        +
      • can be identical to source path but it is advised to separate
      • +
      • Build dir will be created if necessary
      • +
      +
    • +
    • Start configuration pressing "Configure" button
        +
      • select compiler (default should do)
      • +
      +
    • +
    • Create the Visual Studio solution pressing "Generate" button
    • +
    • Open D:\projects\sumo\cmake-build\SUMO.sln (from the explorer +or by clicking on open project)
    • +
    • Build the configurations you want
        +
      • Binaries appear in D:\projects\sumo\bin
      • +
      +
    • +
    +

    Visual guide:

    +

    +Cloning SUMO

    +

    +Selecting Solution (Visual Studio, Eclipse, etc.)

    +

    +Libraries successfully configured

    +

    +Generated solution

    +

    Method 2: CMake command line#

    +
      +
    • go to source path (e.g. cd D:\projects\sumo)
    • +
    • create build path (e.g. mkdir cmake-build && cd cmake-build)
    • +
    • run cmake with the correct Visual Studio version (e.g. cmake .. -G +"Visual Studio 12 2013 Win64")
        +
      • for a list of possible generators run cmake --help
      • +
      +
    • +
    • Open the solution D:\projects\sumo\cmake-build\SUMO.sln
        +
      • or build from the command line using cmake --build . --config + Release
      • +
      +
    • +
    +

    Additional options and fine tuning#

    +
      +
    • For a different target platform (e.g. 32bit) start cmake again, do +not use Visual Studio to add a different platform
    • +
    • To enable Libsumo add SWIG dir and exe for +building Python and Java bindings
        +
      • Make sure Python and a JDK are installed
      • +
      • Python will only work with the release build (unless you compile + a debug version of Python yourself)
      • +
      +
    • +
    • To disable certain features delete all values referring to the +feature (e.g. to disable GDAL remove GDAL_INCLUDE_DIR and +GDAL_LIBRARY in the CMake GUI or in CMakeCache.txt) and run the +generator again
    • +
    +

    Troubleshooting#

    +
      +
    • Python cannot be found
        +
      • Make sure that there isn't two different Python version + installed
      • +
      • Python libraries can be specified manually (e.g. + <PythonFolder>\libs\python<version>.lib)
      • +
      +
    • +
    +

    +Python library field

    +

    +Two different python version at the same time

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_Libraries.html sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_Libraries.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing/Windows_Libraries.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing/Windows_Libraries.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + Installing/Windows Libraries - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Installing/Windows Libraries
    + + + +
    +

    Note

    +

    Most of the time it is not necessary to build the libraries yourself. You can just use the versions available at https://github.com/DLR-TS/SUMOLibraries as described in the Windows build instructions.

    +
    +

    Individual packages#

    +

    Xerces-C#

    +

    SUMO uses Xerces-C 3.1.x or 3.2.x by default but if you are still stuck +with Xerces 2.8 changes should be limited to <SUMO_HOME>/src/windows_config.h, <SUMO_HOME>/build/msvc10/Win32.props and / or <SUMO_HOME>/build/msvc10/x64.props. Please be +aware that Xerces-C 3.1.4 can cause problems when using unicode +characters in your networks (especially importing chinese street names +from OpenStreetMap).

    +
      +
    • Apache does not provide binary distributions any longer, but you can + try our own build of Xerces-C 3.2.0 with an additional patch fixing + unicode problems in a 32 bit + version + or its 64bit + version + for the 64bit build.
    • +
    • Create a environment variable XERCES pointing to your xerces-c + directory, e.g.
    • +
    +
    set XERCES=D:\libs\xerces-c-3.2.0-win32
    +
    + +
      +
    • Copy dll-files %XERCES%\bin\xerces-c_3_2.dll and + %XERCES%\bin\xerces-c_3_2D.dll to some directory which is in your + PATH (last resort: into Windows' system32 directory).
    • +
    • For the 64bit build the name of the variable is XERCES_64
    • +
    +

    Fox#

    +
      +
    • If you do not need a GUI, you can skip this section.
    • +
    • Usually you do not need to build Fox yourself you can download the +readily compiled +binaries.
    • +
    • If you insist, please download fresh +sources and do not use +the incomplete package.
    • +
    • Up to (and including) SUMO 0.10.3 (precisely up to svn revision +7025) SUMO used Fox 1.4, now it uses Fox 1.6. The building +instructions are the same just replace 1.6 by 1.4 (and FOX16 by +FOX14) wherever you need it.
    • +
    • Go to the Fox directory and open the VC project e.g. +D:\libs\fox-1.6.36\windows\vcpp\win32.dsw.
        +
      • If you are using the Visual Studio 10.0 Express version, it + cannot convert the project directly, you will need an + intermediate Visual Studio 8.0 conversion
      • +
      +
    • +
    • Confirm the conversion to VC 10.0 and build the foxdll project as +"release and debug" (if you think you might wish to use the Visual +Studio debugger) version. If you want to build for the 64bit +platform you need to add a new configuration to the foxdll project +using the +Configuration Manager.
    • +
    • You might get approximately 240 warnings and one error, which can +probably be ignored as long as you can find the resulting DLLs in +the lib dir.
    • +
    • Errors on not finding windows.h mean the SDK was not installed +properly.
    • +
    • Create an environment variable FOX16 pointing to your Fox directory, +e.g.
    • +
    +
    set FOX16=D:\libs\fox-1.6.36.
    +
    + +
      +
    • Copy dll-files %FOX16%\libs\fox-1.6.36\lib\FOXDLL-1.6.dll and + %FOX16%\lib\FOXDLLD-1.6.dll to some directory which is in your + PATH (last resort: into Windows' system32 directory).
    • +
    +

    PNG support in Fox#

    +
      +
    • Warning: This is a little advanced, we were successful with libpng +1.5.2 and 1.6.20 together with zlib 1.2.5 and 1.2.8
    • +
    • download zlib sources and libpng sources from +[1] or from +[2] and +[3]
    • +
    • unzip all zips
    • +
    • there is no need to build zlib
    • +
    • build pnglib by first adapting the path in +<libpng>\projects\vstudio\zlib.props (if necessary) and then use +the vstudio.sln from the same dir to build the libpng project
    • +
    • you will get a png lib and a dll in +<libpng>\projects\vstudio\Debug\
    • +
    • if you want to be really sure, you can build the pngtest project as +well and check the output
    • +
    • you can build / add futher configurations / platforms if needed
    • +
    • Open the Fox project solution and edit properties of foxdll
        +
      • in the C++/General section add the <libpng> dir to the include + path
      • +
      • in the C++/Preprocessor section add the HAVE_PNG_H define
      • +
      • in the Linker/Input section add the .lib file to the input
      • +
      +
    • +
    • recompile fox and put the resulting dll together with libpng dll in +your path
    • +
    +

    JPEG support in Fox#

    +
      +
    • Warning: This is a little advanced, we were successful with jpeg 8d, +and 9b the jpeg 8c which can be found at the fox-toolkit site was +broken
    • +
    • download libjpeg sources from [4] and unzip it
    • +
    • download +win32.mak and +place it in the jpeg dir
    • +
    • open a visual studio command prompt, cd to the jpeg dir and execute
    • +
    +
    nmake /f makefile.vc setup-v10
    +nmake /f makefile.vc
    +
    + +
      +
    • you will get a libjpeg lib (and no dll!) in the jpeg dir
    • +
    • if you need different configurations / platforms you can also open +the solution file jpeg.sln and build jpeg from the GUI
    • +
    + + +
      +
    • Open the Fox project solution and edit properties of foxdll
        +
      • in the C++/General section add the jpeg dir to the include path
      • +
      • in the C++/Preprocessor section add the HAVE_JPEG_H define
      • +
      • in the Linker/Input section add the .lib file to the input
      • +
      +
    • +
    • recompile foxdll (see above) and put the resulting dll (which has +jpeg support linked statically inside) in your path
    • +
    +

    PROJ and GDAL#

    +

    If you do not need transformation of geocoordinates you can disable PROJ +and GDAL in +build/msvc10/Win32.props +and / or +build/msvc10/x64.props +(remove the UserMacros lines referencing the relevant *.lib files and +remove the Preprocessor definitions HAVE_PROJ and/or HAVE_GDAL) and +skip this section. Otherwise you have the choice between downloading the +binary packages by Tamas Szekeres (preferred choice), the FWTools +distribution (a little outdated) or compiling for yourself (for the +adventurous). Building from source should only be necessary if you want +a 64bit build or if you want to ship a copy of the SUMO executable(s) +without the need to ship the FWTools as well.

    +

    Tamas Szekeres binary packages at http://www.gisinternals.com/release.php#

    +
      +
    • Choose the latest stable release and then the binaries + zip + and the libs + zip + (links valid for MSVC10 as of 31/8/2015)
    • +
    • unzip the zips in a directory of your choice (lets say + D:\libs\proj_gdal) and set PROJ_GDAL=D:\libs\proj_gdal.
    • +
    • Add %PROJ_GDAL%\bin to your PATH (or copy the contents to some + directory in your PATH).
    • +
    +

    FWTools (very outdated)#

    +
      +
    • Just execute the binary and select a target directory.
    • +
    • Create a environment variable PROJ_GDAL pointing to that directory, + e.g.
    • +
    +
    set PROJ_GDAL=D:\libs\FWTools1.1.3.
    +
    + +
      +
    • Add %PROJ_GDAL%\bin to your PATH (or copy the contents to some + directory in your PATH).
    • +
    +

    Building from source#

    +

    If you want to build PROJ and GDAL yourself for some reason, please +follow the relevant build instructions for +PROJ and for +GDAL. You then +should install in a common directory and let the PROJ_GDAL variable +point to it as above. You should also copy proj.dll and gdal*.dll to a +directory in your PATH.

    +

    If you do or download a 64bit build, the name of the environment +variable needs to be PROJ_GDAL_64.

    +

    FFMPEG#

    +

    This is only needed, if you want to save videos directly from the +sumo-gui.

    +
      +
    • You just need to install the binary ffmpeg + distributions in the Shared and + the Dev flavor. Also be sure to download all the platforms (32 + and/or 64 bit) you need.
    • +
    • Unzip the Dev version and create a environment variable FFMPEG + pointing to the directory, e.g.
    • +
    +
    set FFMPEG=D:\libs\ffmpeg-2.8.3-win32-dev.
    +
    + +
      +
    • Unzip the Share version and copy the dll-files from the bin + directory to some directory which is in your PATH (last resort: into + Windows' system32 directory).
    • +
    • For the 64bit build the name of the variable is FFMPEG_64, e.g.
    • +
    +
    set FFMPEG_64=D:\libs\ffmpeg-2.8.3-win64-dev.
    +
    + +
      +
    • Probably due to a bug in Visual Studio 2010 the resulting sumo-gui + works only if debugging symbols are generated (which is the default + for the Debug and the Fastbuild but not for the Release)! If your + executable does not start or complains about missing symbols, double + check whether it is enabled in the linker settings (currently it is + for the 64 bit internal release).
    • +
    +

    OpenSceneGraph#

    +

    This is only relevant for the 3D GUI. You will need to build at least +OSG 3.4.0 because earlier versions do not work with Visual Studio 2012. +Unfortunately there are no binaries readily available. If you want to +use models which are not in <SUMO>/data/3D, you can add directories +containing them to the OSG_FILE_PATH environment variable. the build +will look for libraries and includes in the directories below $OSG and +$OSG_64.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Installing.html sumo-1.6.0+dfsg1/docs/userdoc/Installing.html --- sumo-1.5.0+dfsg1/docs/userdoc/Installing.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Installing.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + Installing - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Installing
    + + + +

    Windows#

    +

    There are four different binary packages for Windows depending on the +platform (32 vs. 64 bit) you have and what you want to do with SUMO. If +you want to install it locally and have administrator rights on your +machine you should download and execute one of the installers +(preferably 64 bit). If you need a "portable" version or do not have +admin rights, use the correct zip, extract it into a desired folder +using 7Zip, +Winzip, or a similar tool. Every +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 +SUMO-GUI and take a look at the examples located +in docs/examples. All other applications +(DUAROUTER, DFROUTER, +etc.) have to be run from the command line. To facilitate this there is +also a start-commandline.bat which sets up the whole environment for +you. If you feel unsure about the command line, please read +Basics/Basic_Computer_Skills#Running_Programs_from_the_Command_Line.

    +

    If you want a bleeding edge nightly build or need tests or source files, +you can download them from the Download page.

    +

    For building SUMO from source see building SUMO under Windows.

    +

    Linux#

    +

    If you run debian or ubuntu, SUMO is part of the regular distribution +and can be installed like this:

    +
    sudo apt-get install sumo sumo-tools sumo-doc
    +
    + +

    If you need a more up-to-date ubuntu version, it may be found in a +separate ppa, which is added like this:

    +
    sudo add-apt-repository ppa:sumo/stable
    +sudo apt-get update
    +
    + +

    and then again

    +
    sudo apt-get install sumo sumo-tools sumo-doc
    +
    + +

    Precompiled binaries for different distributions like openSUSE and +Fedora can be found at these repositories for binary Linux versions. +These repositories contain nightly builds as well. In the case your +system is not listed here or you need to modify the sources, you have to build SUMO from sources.

    +

    macOS#

    +

    A guide for Homebrew-based (encouraged) as well as Macports-based +(legacy) installation is given +here.

    +

    via Docker#

    +

    Building and installing SUMO from source is not an easy task for +beginner users. Docker is a popular tool to solve this issue. Searching +"SUMO" at Docker Hub will give several results +from existing attempts at Dockerising SUMO.

    +

    The solution given at +docker-sumo demonstrates how +to Dockerise SUMO version 0.30.0 on top of Ubuntu 16.04. As well as +sumo and traci, the use of sumo-gui is also demonstrated by +docker-sumo so that the +users have access to the graphical interface of a Dockerised SUMO.

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/IntermodalRouting.html sumo-1.6.0+dfsg1/docs/userdoc/IntermodalRouting.html --- sumo-1.5.0+dfsg1/docs/userdoc/IntermodalRouting.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/IntermodalRouting.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + IntermodalRouting - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + IntermodalRouting
    + + + +

    Basic Concepts#

    +

    Every person may have multiple modes of transport to chose from. +Currently those are walking (which is assumed to be always possible), +riding by public transport and going by car. Intermodal routing uses +person trips to define a +trip of a person including mode changes.

    +

    Defining intermodal demand#

    +

    To define intermodal demand use the +<personTrip>-element:

    +
    <routes>
    +  <person id="p0" depart="0">
    +    <personTrip from="beg" to="end"/>
    +  </person>
    +</routes>
    +
    + +

    The tool randomTrips.py may be +used with the option --persontrips to generate random intermodal demand.

    +

    Defining available cars#

    +

    To allow usage of a car, either the attribute modes="car" or the vType of the +available car must be specified for the personTrip:

    +
    <routes>
    +  <vType id="typ0" vClass="passenger"/>
    +  <person id="p0" depart="0">
    +      <personTrip from="beg" to="end" vTypes="typ0"/>
    +  </person>
    +</routes>
    +
    + +

    Defining public transport#

    +

    In order to be included by in the public transport routing, flows (also vehicles or trips) must be defined +with a public transport schedule.

    +

    An example for a bus line and a person that may uses this line are given below:

    +
    <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    +    <flow id="bus" from = "beg" to ="end" line="bus" begin="0" end="1000" period="300">
    +                <stop busStop="busStopA" until="10"/>
    +                <stop busStop="busStopB" until="110"/>
    +                <stop busStop="busStopC" until="210"/>
    +    </flow>
    +    <person id="p0" depart="0">
    +        <personTrip from="beg" to="end" modes="public"/>
    +    </person>
    +</routes>
    +
    + +
    +

    Note

    +

    A vehicle/flow/trip must define the line attribute to be considered as public transport. Every vehicle with a line attribute is considered public transport and may be used for routing regardless of its capacity.

    +
    +

    Intermodal Cost Function#

    +

    Generally, intermodal routing may consider multiple criteria such as +travel time, costs, reliability and convenience. Currently, +DUAROUTER only takes the following travel time +into account:

    +
      +
    • Individual vehicle transport uses the standard vehicle routing + costs. This can be influenced by loading custom weights via option --weight-files
    • +
    • Walking uses the maximum walking speed of the person and multiplies + this with a factor, configurable via option --persontrip.walkfactor <FLOAT> (default 0.9). The + factor is used to account for delays due to intersections and + pedestrian interactions
    • +
    • Public transport uses the time to the next train departure (waiting time) and the difference of the until-times between successive stops
    • +
    • Accessing a stop from another part of the network takes + time in direct proportion to the straight-line distance with a + configurable factor (NETCONVERT option --railway.access-factor <FLOAT>). The distance can be customized in the access definition.
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 14 February 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/js/base.js sumo-1.6.0+dfsg1/docs/userdoc/js/base.js --- sumo-1.5.0+dfsg1/docs/userdoc/js/base.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/js/base.js 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,212 @@ +function getSearchTerm() +{ + var sPageURL = window.location.search.substring(1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) + { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == 'q') + { + return sParameterName[1]; + } + } +} + +$(document).ready(function() { + + var search_term = getSearchTerm(), + $search_modal = $('#mkdocs_search_modal'), + $keyboard_modal = $('#mkdocs_keyboard_modal'); + + if(search_term){ + $search_modal.modal(); + } + + // make sure search input gets autofocus everytime modal opens. + $search_modal.on('shown.bs.modal', function () { + $search_modal.find('#gsc-i-id1').focus(); + }); + + // Close search modal when result is selected + // The links get added later so listen to parent + $('#mkdocs-search-results').click(function(e) { + if ($(e.target).is('a')) { + $search_modal.modal('hide'); + } + }); + + // Populate keyboard modal with proper Keys + $keyboard_modal.find('.help.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.help]; + $keyboard_modal.find('.search.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.search]; + $keyboard_modal.find('.edit.shortcut kbd')[0].innerHTML = keyCodes[shortcuts.edit]; + + // Keyboard navigation + document.addEventListener("keydown", function(e) { + if ($(e.target).is(':input')) return true; + var key = e.which || e.keyCode || window.event && window.event.keyCode; + var page; + switch (key) { + case shortcuts.search: + e.preventDefault(); + $keyboard_modal.modal('hide'); + $search_modal.modal('show'); + $search_modal.find('#gsc-i-id1').focus(); + break; + case shortcuts.edit: + page = $('.navbar a[rel="edit"]:first').prop('href'); + break; + case shortcuts.help: + $search_modal.modal('hide'); + $keyboard_modal.modal('show'); + break; + default: break; + } + if (page) { + $keyboard_modal.modal('hide'); + window.location.href = page; + } + }); + + $('table').addClass('table table-striped table-hover'); + + // Improve the scrollspy behaviour when users click on a TOC item. + $(".bs-sidenav a").on("click", function() { + var clicked = this; + setTimeout(function() { + var active = $('.nav li.active a'); + active = active[active.length - 1]; + if (clicked !== active) { + $(active).parent().removeClass("active"); + $(clicked).parent().addClass("active"); + } + }, 50); + }); + +}); + + +$('body').scrollspy({ + target: '.bs-sidebar', + offset: 100 +}); + +/* Prevent disabled links from causing a page reload */ +$("li.disabled a").click(function() { + event.preventDefault(); +}); + +// See https://www.cambiaresearch.com/articles/15/javascript-char-codes-key-codes +// We only list common keys below. Obscure keys are omited and their use is discouraged. +var keyCodes = { + 8: 'backspace', + 9: 'tab', + 13: 'enter', + 16: 'shift', + 17: 'ctrl', + 18: 'alt', + 19: 'pause/break', + 20: 'caps lock', + 27: 'escape', + 32: 'spacebar', + 33: 'page up', + 34: 'page down', + 35: 'end', + 36: 'home', + 37: '←', + 38: '↑', + 39: '→', + 40: '↓', + 45: 'insert', + 46: 'delete', + 48: '0', + 49: '1', + 50: '2', + 51: '3', + 52: '4', + 53: '5', + 54: '6', + 55: '7', + 56: '8', + 57: '9', + 65: 'a', + 66: 'b', + 67: 'c', + 68: 'd', + 69: 'e', + 70: 'f', + 71: 'g', + 72: 'h', + 73: 'i', + 74: 'j', + 75: 'k', + 76: 'l', + 77: 'm', + 78: 'n', + 79: 'o', + 80: 'p', + 81: 'q', + 82: 'r', + 83: 's', + 84: 't', + 85: 'u', + 86: 'v', + 87: 'w', + 88: 'x', + 89: 'y', + 90: 'z', + 91: 'Left Windows Key / Left ⌘', + 92: 'Right Windows Key', + 93: 'Windows Menu / Right ⌘', + 96: 'numpad 0', + 97: 'numpad 1', + 98: 'numpad 2', + 99: 'numpad 3', + 100: 'numpad 4', + 101: 'numpad 5', + 102: 'numpad 6', + 103: 'numpad 7', + 104: 'numpad 8', + 105: 'numpad 9', + 106: 'multiply', + 107: 'add', + 109: 'subtract', + 110: 'decimal point', + 111: 'divide', + 112: 'f1', + 113: 'f2', + 114: 'f3', + 115: 'f4', + 116: 'f5', + 117: 'f6', + 118: 'f7', + 119: 'f8', + 120: 'f9', + 121: 'f10', + 122: 'f11', + 123: 'f12', + 124: 'f13', + 125: 'f14', + 126: 'f15', + 127: 'f16', + 128: 'f17', + 129: 'f18', + 130: 'f19', + 131: 'f20', + 132: 'f21', + 133: 'f22', + 134: 'f23', + 135: 'f24', + 144: 'num lock', + 145: 'scroll lock', + 186: ';', + 187: '=', + 188: ',', + 189: '‐', + 190: '.', + 191: '?', + 192: '`', + 219: '[', + 220: '\', + 221: ']', + 222: ''', +}; diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/js/bootstrap-3.0.3.min.js sumo-1.6.0+dfsg1/docs/userdoc/js/bootstrap-3.0.3.min.js --- sumo-1.5.0+dfsg1/docs/userdoc/js/bootstrap-3.0.3.min.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/js/bootstrap-3.0.3.min.js 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,7 @@ +/*! + * Bootstrap v3.0.3 (http://getbootstrap.com) + * Copyright 2013 Twitter, Inc. + * Licensed under http://www.apache.org/licenses/LICENSE-2.0 + */ + +if("undefined"==typeof jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]'),b=!0;if(a.length){var c=this.$element.find("input");"radio"===c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?b=!1:a.find(".active").removeClass("active")),b&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}b&&this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid.bs.carousel",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid.bs.carousel")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid.bs.carousel")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(jQuery); \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/js/bootstrap.min.js sumo-1.6.0+dfsg1/docs/userdoc/js/bootstrap.min.js --- sumo-1.5.0+dfsg1/docs/userdoc/js/bootstrap.min.js 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/js/bootstrap.min.js 2020-04-27 22:07:59.000000000 +0000 @@ -0,0 +1,7 @@ +/*! + * Bootstrap v4.1.3 (https://getbootstrap.com/) + * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery"),require("popper.js")):"function"==typeof define&&define.amd?define(["exports","jquery","popper.js"],e):e(t.bootstrap={},t.jQuery,t.Popper)}(this,function(t,e,h){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)P(this._element).one(Q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=ndocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
    ',trigger:"hover focus",title:"",delay:0,html:!(Ie={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"}),selector:!(Se={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"}),placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},we="out",Ne={HIDE:"hide"+Ee,HIDDEN:"hidden"+Ee,SHOW:(De="show")+Ee,SHOWN:"shown"+Ee,INSERTED:"inserted"+Ee,CLICK:"click"+Ee,FOCUSIN:"focusin"+Ee,FOCUSOUT:"focusout"+Ee,MOUSEENTER:"mouseenter"+Ee,MOUSELEAVE:"mouseleave"+Ee},Oe="fade",ke="show",Pe=".tooltip-inner",je=".arrow",He="hover",Le="focus",Re="click",xe="manual",We=function(){function i(t,e){if("undefined"==typeof h)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=pe(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(pe(this.getTipElement()).hasClass(ke))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),pe.removeData(this.element,this.constructor.DATA_KEY),pe(this.element).off(this.constructor.EVENT_KEY),pe(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&pe(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===pe(this.element).css("display"))throw new Error("Please use show on visible elements");var t=pe.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){pe(this.element).trigger(t);var n=pe.contains(this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!n)return;var i=this.getTipElement(),r=Fn.getUID(this.constructor.NAME);i.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&pe(i).addClass(Oe);var o="function"==typeof this.config.placement?this.config.placement.call(this,i,this.element):this.config.placement,s=this._getAttachment(o);this.addAttachmentClass(s);var a=!1===this.config.container?document.body:pe(document).find(this.config.container);pe(i).data(this.constructor.DATA_KEY,this),pe.contains(this.element.ownerDocument.documentElement,this.tip)||pe(i).appendTo(a),pe(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new h(this.element,i,{placement:s,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:je},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),pe(i).addClass(ke),"ontouchstart"in document.documentElement&&pe(document.body).children().on("mouseover",null,pe.noop);var l=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,pe(e.element).trigger(e.constructor.Event.SHOWN),t===we&&e._leave(null,e)};if(pe(this.tip).hasClass(Oe)){var c=Fn.getTransitionDurationFromElement(this.tip);pe(this.tip).one(Fn.TRANSITION_END,l).emulateTransitionEnd(c)}else l()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=pe.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==De&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),pe(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(pe(this.element).trigger(i),!i.isDefaultPrevented()){if(pe(n).removeClass(ke),"ontouchstart"in document.documentElement&&pe(document.body).children().off("mouseover",null,pe.noop),this._activeTrigger[Re]=!1,this._activeTrigger[Le]=!1,this._activeTrigger[He]=!1,pe(this.tip).hasClass(Oe)){var o=Fn.getTransitionDurationFromElement(n);pe(n).one(Fn.TRANSITION_END,r).emulateTransitionEnd(o)}else r();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){pe(this.getTipElement()).addClass(Te+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||pe(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(pe(t.querySelectorAll(Pe)),this.getTitle()),pe(t).removeClass(Oe+" "+ke)},t.setElementContent=function(t,e){var n=this.config.html;"object"==typeof e&&(e.nodeType||e.jquery)?n?pe(e).parent().is(t)||t.empty().append(e):t.text(pe(e).text()):t[n?"html":"text"](e)},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getAttachment=function(t){return Ie[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)pe(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==xe){var e=t===He?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===He?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;pe(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}pe(i.element).closest(".modal").on("hide.bs.modal",function(){return i.hide()})}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||pe(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Le:He]=!0),pe(e.getTipElement()).hasClass(ke)||e._hoverState===De?e._hoverState=De:(clearTimeout(e._timeout),e._hoverState=De,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===De&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||pe(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),pe(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Le:He]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=we,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===we&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){return"number"==typeof(t=l({},this.constructor.Default,pe(this.element).data(),"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),Fn.typeCheckConfig(ve,t,this.constructor.DefaultType),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=pe(this.getTipElement()),e=t.attr("class").match(be);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(pe(t).removeClass(Oe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=pe(this).data(ye),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),pe(this).data(ye,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.1.3"}},{key:"Default",get:function(){return Ae}},{key:"NAME",get:function(){return ve}},{key:"DATA_KEY",get:function(){return ye}},{key:"Event",get:function(){return Ne}},{key:"EVENT_KEY",get:function(){return Ee}},{key:"DefaultType",get:function(){return Se}}]),i}(),pe.fn[ve]=We._jQueryInterface,pe.fn[ve].Constructor=We,pe.fn[ve].noConflict=function(){return pe.fn[ve]=Ce,We._jQueryInterface},We),Jn=(qe="popover",Ke="."+(Fe="bs.popover"),Me=(Ue=e).fn[qe],Qe="bs-popover",Be=new RegExp("(^|\\s)"+Qe+"\\S+","g"),Ve=l({},zn.Default,{placement:"right",trigger:"click",content:"",template:''}),Ye=l({},zn.DefaultType,{content:"(string|element|function)"}),ze="fade",Ze=".popover-header",Ge=".popover-body",$e={HIDE:"hide"+Ke,HIDDEN:"hidden"+Ke,SHOW:(Je="show")+Ke,SHOWN:"shown"+Ke,INSERTED:"inserted"+Ke,CLICK:"click"+Ke,FOCUSIN:"focusin"+Ke,FOCUSOUT:"focusout"+Ke,MOUSEENTER:"mouseenter"+Ke,MOUSELEAVE:"mouseleave"+Ke},Xe=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var r=i.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){Ue(this.getTipElement()).addClass(Qe+"-"+t)},r.getTipElement=function(){return this.tip=this.tip||Ue(this.config.template)[0],this.tip},r.setContent=function(){var t=Ue(this.getTipElement());this.setElementContent(t.find(Ze),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(Ge),e),t.removeClass(ze+" "+Je)},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=Ue(this.getTipElement()),e=t.attr("class").match(Be);null!==e&&0=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||t)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="
    ",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="
    a",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="
    t
    ",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="
    ",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t +}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/\s*$/g,At={option:[1,""],legend:[1,"
    ","
    "],area:[1,"",""],param:[1,"",""],thead:[1,"","
    "],tr:[2,"","
    "],col:[2,"","
    "],td:[3,"","
    "],_default:x.support.htmlSerialize?[0,"",""]:[1,"X
    ","
    "]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?""!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle); +u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x(" + +

    ITSC 2015#

    + +

    Im- and Export#

    + +

    Calibration/Validation#

    + + + + + +

    Misc#

    + +

    Further Sources for Examples#

    +

    Using Examples from the Test Suite#

    +

    SUMO comes with a large set of tests, just browse them at <SUMO_HOME>/tests. They are set up to be running by using a testing environment, but it is also possible to extract them and execute using SUMO and/or the other tools of the package. In order to do so you can either download the complete sumo package or use the online test extraction. In the online tool you enter the path to the test you like (e.g. <SUMO_HOME>/tests/sumo/extended/rerouter/use_routing_device into the form and get a zip containing all the files.

    +

    If you have downloaded and unzipped the all inclusive package, you do not need the online form. Just go into the folder and execute the "extractTest.py" script. For example, you may get the same example of using rerouters as following:

    +
    cd <SUMO_HOME>/tests
    +../tools/extractTest.py -o /tmp/test sumo/extended/rerouter/use_routing_device
    +
    + +

    will extract you an example for rerouting vehicles into /tmp/test.

    +

    Unfinished Tutorials#

    +

    The following tutorials are not yet completed

    + +

    Outdated Tutorials#

    +

    The following tutorials are kept for completeness but are superseded by other tutorials/documentation

    + + + + + + + + + + +
    + +
    This page was last edited on: 26 March 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + +
    KeyAction
    ?Open this help
    Search
    eEdit on GiHub
    + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Vehicle_Type_Parameter_Defaults.html sumo-1.6.0+dfsg1/docs/userdoc/Vehicle_Type_Parameter_Defaults.html --- sumo-1.5.0+dfsg1/docs/userdoc/Vehicle_Type_Parameter_Defaults.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Vehicle_Type_Parameter_Defaults.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,628 @@ + + + + + + + + + + + + + + + + + + + Vehicle Type Parameter Defaults - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Vehicle Type Parameter Defaults
    + + + +

    This page describes the vehicle parameter defaults depending on the +vehicle class. If no values are given the values for passenger are used. +It uses as default always the values in the first line for each vehicle +class. The other values are just as an information (to be used with own +vehicle types).

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    vClass (SVC)exampleshape (SVS)length
    width
    height
    minGapamax(**)accel
    b(**) decelbeemergency decelvmax maxSpeedseatsemissionClass (HBEFA3)
    pedestrianpedestrian0.215m(1)
    0.478m(1)
    1.719m(1)
    0.25m1.5m/s2(23)2m/s2(23)5m/s25.4km/h(23)-zero
    two-wheeled vehicle
    bicyclebicycle1.6m(17)
    0.65m(17)
    1.7m(*)
    0.5m1.2m/s2(19)3m/s2(19)7m/s220km/h(19)1zero
    mopedmoped2.1m(17)
    0.8m(17)
    1.7m(*)
    2.5m1.1m/s2(25)7m/s2(26)10m/s245km/h(24)2zero
    motorcyclemotorcycle2.2m(28)
    0.9m(28)
    1.5m(28)
    2.5m6m/s2(19)10m/s2(27)10m/s2200km/h(28)2LDV_G_EU6
    passenger car
    passengerpassenger4.3m(29)
    1.8m(29)
    1.5m(29)
    2.5m2.9m/s2(29)7.5m/s2(27)9m/s2180km/h(29)5LDV_G_EU4
    passenger/sedansee abovesee abovesee abovesee abovesee abovesee above5LDV_G_EU4
    passenger/hatchbacksee abovesee abovesee abovesee abovesee abovesee above5LDV_G_EU4
    passenger/wagonsee abovesee abovesee abovesee abovesee abovesee above5LDV_G_EU4
    passenger/van4.7m(16)
    1.9m(16)
    1.73m(16)
    see abovesee abovesee abovesee abovesee above6
    LDV_G_EU4
    emergencydelivery6.5m(37)
    2.16m(37)
    2.86m(37)
    see abovesee abovesee abovesee abovesee above3LDV
    deliverydelivery6.5m(37)
    2.16m(37)
    2.86m(37)
    see abovesee abovesee abovesee abovesee above3LDV
    truck
    trucktruck7.1m(30)
    2.4m(30)
    2.4m(30)
    2.5m1.3m/s2(31)4m/s2
    (27)
    7m/s2130km/h(35)3HDV
    trailertruck/semitrailer16.5m(14)
    max. 2.55m(13)
    max. 4m(13)
    2.5m1.1m/s2(31)see abovesee abovesee above3HDV
    truck/trailermax. 18.75m(13)
    max. 2.55m(13)
    max. 4m(13)
    2.5m1m/s2(31)see abovesee abovesee above3HDV
    bus
    busbus12m(3)
    2.5m(3)
    3.4m(3)
    2.5m1.2m/s2(18)4m/s2(27)7m/s285km/h(3)~85Bus
    bus/flexible17.9m(3)
    2.5m(3)
    3.0m(3)
    2.5m1.2m/s2(18)see abovesee abovesee above~150Bus
    coachbus/coach14m(10)
    2.6m(10)
    4.m(10)
    2.5m2.0m/s2(*)see abovesee above100km/h(32)70(9)Coach
    rail
    tramrail/railcar~22m(7)
    ~2.4m(7)
    ~3.2m(7)
    2.5m1.0m/s2(18)3.0m/s2(27)7m/s280km/h(36)~120(7, *)zero
    rail_urbanrail/railcar36.5m(*2/*4)(4)
    3.0m(4)
    3.6m(4)
    2.5m1.0m/s2(4)3.0m/s2(27)7m/s2100km/h(4)~300(*2/*4)zero
    railrail67.5m(*2)(11)
    2.84m(11)
    3.75m(11)
    2.5m0.25m/s2(34)1.3m/s2(33)5m/s2160km/h(11)~434(*2)(11)HDV_D_EU0
    rail/cargo750m (~18.9m + x*~16m)(5, 6, 8)
    ~4.4m(6)
    ~3.0m(6)
    2.5m0.25m/s2(34)1.3m/s2(33)5m/s2120km/h(5)1HDV_D_EU0
    rail_electricrail~25m(*8)(12)
    2.95m(12)
    3.89m(12)
    2.5m0.5m/s2(33)1.3m/s2(33)5m/s2330km/h(12)425(12)zero
    electric vehicle
    evehicleevehiclesee passengersee passengersee passengersee passengersee passengersee passengersee passengerzero
    ships
    shipship17m
    4m
    4m
    2.50.1m/s20.1m/s21m/s24.12 (8 Knots)HDV_D_EU0
    + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 16 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/XMLValidation.html sumo-1.6.0+dfsg1/docs/userdoc/XMLValidation.html --- sumo-1.5.0+dfsg1/docs/userdoc/XMLValidation.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/XMLValidation.html 2020-04-27 22:08:00.000000000 +0000 @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + XMLValidation - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + XMLValidation
    + + + +

    Validation of XML inputs#

    +

    All SUMO applications support +XML validation for their inputs. To enable this, the following options +can be used:

    + + + + + + + + + + + + + + + + + +
    OptionDescription
    -X <STRING>
    --xml-validation <STRING>
    Set schema validation scheme of XML inputs ("never", "auto" or "always"); default: auto
    --xml-validation.net <STRING>Set schema validation scheme of SUMO network inputs ("never", "auto" or "always"); default: never
    +

    Validation is performed by activating XML schema +processing in the XML +parser. This catches many common input errors such as spelling mistakes +and attributes which should have been placed within another element.

    +

    Another prerequisite for validation is a schema deceleration within the +root element of the input file such as

    +
    <routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/routes_file.xsd">
    +
    + +

    When setting the validation options to always it is an error to omit +this declaration.

    +

    Schema validation may slowdown XML parsing considerably and is therefore +disabled for the network input by default (because networks should not +be edited by hand and therefore be valid anyway).

    +
    +

    Note

    +

    If you have large auto-generated inputs you may consider disabling schema validation altogether. See also this FAQ

    +
    +

    Adding a schema declaration#

    +

    Files that are written by one of the SUMO applications automatically +receive the appropriate schema declaration. When writing an input file +from scratch the schema declaration must be added manually to the root +element as follows:

    +
        <ROOT_ELEMENT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    +         xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/SCHEMA_FILE">
    +
    + +

    where ROOT_ELEMENT and SCHEMA_FILE should be set according to the +following table:

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Application OptionROOT_ELEMENTSCHEMA_FILE
    --route-files, --trip-files, --flow-filesroutesroutes_file.xsd
    --additional-filesaddadditional_file.xsd
    --node-filesnodesnodes_file.xsd
    --edge-filesedgesedges_file.xsd
    --connection-filesconnectionsconnections_file.xsd
    --tllogic-filestlLogicstllogic_file.xsd
    --type-filestypestypes_file.xsd
    --weight-filesmeandatameandata_file.xsd
    +
    +

    Note

    +

    The value of ROOT_ELEMENT is a matter of convention and may take an arbitrary value.

    +
    +

    Schema Files#

    +

    The schema files can be found in the <SUMO_HOME>/data/xsd directory of your SUMO +installation. If the environment variable SUMO_HOME is +set, +these files will be used when validation inputs.

    +

    Otherwise, the files are loaded from +http://sumo.dlr.de/xsd/SCHEMA_FILE which may slow down the +application (or fail if there is no internet connection).

    +

    SUMO File Types#

    +

    A complete listing of file extensions used by SUMO +Applications is +given at File_Extensions.

    +

    Disabling Schema Validation#

    +

    To disable schema validation any of the following actions is sufficient

    +
      +
    • set the option --xml-validation never
    • +
    • Remove the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/....xsd" +attribute from the top of the XML input file.
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.0_to_Version_0.10.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.10.0 to Version 0.10.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.10.0 to Version 0.10.1
    + + + +
      +
    • GUISIM
        +
      • debugged right-click on an empty cell
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • removed bug in collision detection
      • +
      • added warning about old route format
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.1_to_Version_0.10.2.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.10.1 to Version 0.10.2 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.10.1 to Version 0.10.2
    + + + +
      +
    • All
        +
      • If configuration is written using --write-config, the + application stops after this step
      • +
      • The devices now also allow "NUL" or "/dev/NULL" as + output file name. In this case, the output is redirected to + NUL (MS Windows) or /dev/null (Linux)
      • +
      +
    • +
    + + + + +
      +
    • Tools
        +
      • Rebuilt traceExporter; added tests
      • +
      +
    • +
    + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.2_to_Version_0.10.3.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.10.2 to Version 0.10.3 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.10.2 to Version 0.10.3
    + + + +
      +
    • All
        +
      • A daily build for windows is available at: + http://sumo.sf.net/daily/sumo-msvc8-bin.zip
      • +
      • Made tests tolerant for floating point inprecision
      • +
      • First Unit Tests added by Matthias Heppner (thanks!!)
      • +
      • Xerces 3 may now be used optionally
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • further work on simulation of inner-junction traffic in dense + scenarios
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • prunning on a bounding box was revalidated; tests were added
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • made reading of detector positions more fault-tolerant
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • tests revalidated
      • +
      • Tutorial on interaction with traffic lights added by Lena + Kalleske (thanks!!)
      • +
      • added the possibility to retrieve a complete tls definition via + TraCI
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.10.3_to_Version_0.11.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.10.3 to Version 0.11.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.10.3 to Version 0.11.0
    + + + +
      +
    • All
        +
      • moved to xerces 3.0
      • +
      • moved to FOX1.6
      • +
      • changes in network format (use <SUMO_HOME>/tools/net/0103to0110.py to + convert from old to new representation)
          +
        • traffic light descriptions (18.05.2009)
        • +
        • descriptions of giving lanes free / prohibiting lanes for + certain vehicle classes (10.06.2009)
        • +
        • moved character sections to attributes (22.-24.07.2009), see + SUMO Road Networks
        • +
        +
      • +
      • configuration xml format changed from <section><key>value</key></section> to <section key="value"/> (use <SUMO_HOME>/tools/10to11.py to convert from old to new + representation)
      • +
      • The data-folder was removed; instead the examples got a part of + the tests and are generated using these.
      • +
      +
    • +
    + + +
      +
    • NETGEN
        +
      • random networks may now contain bidirectional edges; the + probability to have an edge being bidirectional is controlled by + the --rand-bidi-probability <FLOAT> with default=1 (all edges are bidirectional)
      • +
      • The default junction type (option --default-junction-type) may now be only one of + "priority", "right_before_left", or "traffic_light". Building + agentbased and actuated traffic lights from within NETGEN will + no longer be supported.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Nodes which have same or almost same positions are no longer + joined per default.
      • +
      • Type descriptions allow a certain edge type to be discarded from + being imported using the discard="x" attribute.
      • +
      • NETCONVERT can guess roundabouts; force using --guess-roundabouts
      • +
      • corrected usage of the spread_type attribute in edges; was: defect 111 correct usage of the spread_type attribute
      • +
      • patching problems with RoboCup Rescue League import
      • +
      +
    • +
    + +
      +
    • DUAROUTER
        +
      • The default departure/arrival behaviour can be controlled on the + command line, now. The following options were introduced for + this purpose: --departlane, --departpos, --departspeed, --arrivallane, --arrivalpos, --arrivalspeed. See also + Specification
      • +
      +
    • +
    +
      +
    • JTRROUTER
        +
      • The default departure/arrival behaviour can be controlled on the + command line, now. The following options were introduced for + this purpose: --departlane, --departpos, --departspeed, --arrivallane, --arrivalpos, --arrivalspeed. See also + Specification
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.0_to_Version_0.11.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,297 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.11.0 to Version 0.11.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.11.0 to Version 0.11.1
    + + + +
      +
    • All
        +
      • configuration xml format changed again to <section><key value="val"/></section> (use <SUMO_HOME>/tools/10to11.py to convert from old to new + representation)
      • +
      • Bugs in Dijkstra implementation fixed (affecting at least + duarouter, routing with traci and automatic rerouting) + (01.10.2009)
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • debugged problems when loading TLS definitions with T=0
      • +
      • implemented a variable car-following model API; many thanks to Tobias Mayer + and Christoph Sommer for the collaboration who did most of the work.
      • +
      • debugged occurence of negative vehicle speeds during emit
      • +
      • reworked the mean data output (handling multiple lanes + correctly)
      • +
      +
    • +
    + +
      +
    • NETCONVERT
        +
      • making projection mandatory for OSM and DLR-Navteq networks + (03.09.2009)
      • +
      • removed option --rotation-to-apply - was not properly working anyway (02.09.2009)
      • +
      • removed support for "old" TIGER networks - assuming the current + ones are given as shape files; --tiger <FILE> is now mapped onto --shapefile <FILE> (02.09.2009)
      • +
      • removed support for "split" Elmar networks (option --elmar <FILE>) (02.09.2009)
      • +
      • renamed --elmar2 <FILE> to --dlr-navteq <FILE> (02.09.2009)
      • +
      • renamed --arcview <FILE> to --shapefile <FILE> (02.09.2009)
          +
        • please note, that all subsequent options have been adapted + (but the old names still work as aliases)
        • +
        +
      • +
      • added the possibility to define changes of lane numbers along an edge + in XML-descriptions (03.09.2009)
      • +
      • replaced --use-projection by --proj.utm and --proj.dhdn which determine the correct parameters for + the two widely used projections from the input data
      • +
      • for developers: using same loading procedure for all imported + networks, see Developer/How To/Net Importer
      • +
      +
    • +
    + +
      +
    • DFROUTER
        +
      • debugged problems with induction loop measure with time>end + time
      • +
      • debugged problems with spaces in induction loop measures
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.11.1_to_Version_0.12.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.11.1 to Version 0.12.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.11.1 to Version 0.12.0
    + + + +

    Release date: 27.05.2010

    +
      +
    • Simulation
        +
      • solved regarding red light late blocks vehicles
      • +
      • corrected the documentation on using an abstract vehicle class; + the attribute which defines it is named vclass not class.
      • +
      • introducing flows as replacement for vehicles with repno and + period
      • +
      • introducing stops in routes
      • +
      • corrected unmotivated deceleration in front of intersections + reported by Björn Hendriks (thanks!)
      • +
      • added option --sloppy-emit for not trying to emit on full edges (speeds up + the simulation a lot)
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • moved to representation of time in milliseconds
      • +
      • Induction Loop occupancy is now given in % as defined
      • +
      +
    • +
    + + +
      +
    • NETCONVERT
        +
      • removed the --tls-poi-output; instead, poi_atTLS.py can be used
      • +
      • OpenStreetMap import
          +
        • removal of edges and nodes which have the attribute action='delete'
        • +
        • recognition and removal of duplicate edges (all values but + ids are same) added
        • +
        • opposite direction edge is built if oneway==-1
        • +
        +
      • +
      • edge and node attributes can be overridden
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.0_to_Version_0.12.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,253 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.12.0 to Version 0.12.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.12.0 to Version 0.12.1
    + + + +

    Release Date: 7.10.2010

    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.1_to_Version_0.12.2.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.12.1 to Version 0.12.2 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.12.1 to Version 0.12.2
    + + + +

    Release Date: 7.12.2010

    +
      +
    • all
        +
      • added options to save the xml schema for the configuration file
      • +
      • added "--version" option
      • +
      +
    • +
    • Simulation
        +
      • arrivalpos, arrivallane and arrivalspeed parameters for vehicles
      • +
      • correcting lots of person handling bugs
      • +
      • refactoring vehicle route output and tripinfo into devices
      • +
      • clean up of inheritance structure of MSVehicle
      • +
      +
    • +
    • GUI
        +
      • drawing arrows instead of using bitmaps
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.2_to_Version_0.12.3.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,248 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.12.2 to Version 0.12.3 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.12.2 to Version 0.12.3
    + + + +

    Release Date: 10.02.2011

    +
      +
    • all
        +
      • License update to GPL v3+
      • +
      • verbose "--version" option concerning license
      • +
      • fixing a lot of compiler warnings
      • +
      +
    • +
    • dfrouter
        +
      • generate plain vehicles instead of emitters
      • +
      +
    • +
    • duarouter
        +
      • c-Logit Model implementation
      • +
      +
    • +
    • Simulation +
    • +
    • TraCI
        +
      • please note that the encoding of a vehicle's angle has changed
      • +
      +
    • +
    • SUMO-GUI
        +
      • corrected vehicle's angle (was + ticket#430)
      • +
      • Clipboard works under Linux
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.12.3_to_Version_0.13.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,357 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.12.3 to Version 0.13.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    + +
    + + + Z/Changes from Version 0.12.3 to Version 0.13.0
    + + + +

    Release Date: 13.07.2011

    +

    We are using the change of the minor release number as an opportunity to +clean up some things. The network format, option names, and XML +element/attribute names were changed.

    +

    Network Format#

    +

    For the network, we try to rework it the way it happened the last +times, too:

    +

    Networks generated by SUMO 0.12.x can still be loaded and you may find a +script <SUMO_HOME>/tools/net/0123to0130.py which converts a network into the new +format. All things marked as deprecated in version 0.12.x are now not +functioning anymore. This means, you can not load networks generated by +versions before 0.12.0. Networks generated by the current version can +not be loaded into old SUMO versions.

    +
      +
    • Tags
        +
      • removed <lanes> and <logic> elements
      • +
      • replaced <succ> and <succlane> elements by <connection>. Dummy connections (SUMO_NO_DESTINATION) are no longer written.
      • +
      • replaced <row-logic> and <logicitem> elements by <request> (within <junction> elements)
      • +
      • renamed element tl-logic to tlLogic
      • +
      • renamed element district to taz
      • +
      • renamed element dsource to tazSource
      • +
      • renamed element dsink to tazSink
      • +
      +
    • +
    • Attributes
        +
      • renamed attribute min_dur to minDur
      • +
      • renamed attribute max_dur to maxDur
      • +
      • renamed attribute maxspeed to speed
      • +
      • renamed attribute linkno to linkIndex
      • +
      • removed attribute <depart>
      • +
      • added attribute <index> to lanes
      • +
      • added optional attribute <name> to edges
      • +
      • added optional attribute spreadType to edges
      • +
      • added optional attribute shape to edges
      • +
      +
    • +
    • Values
        +
      • junctions with traffic light now have type traffic_light (as in plain-xml)
      • +
      • renamed junction type DEAD_END to dead_end
      • +
      • edge attribute function will no longer be written in the default case (=normal)
      • +
      • edge attribute type will only be written if set
      • +
      • junction attribute shape will only be written if set
      • +
      +
    • +
    +

    Further Input Format Changes#

    +
      +
    • DFROUTER
        +
      • renamed element detector_definition to detectorDefinition
      • +
      +
    • +
    • ROUTES
        +
      • attribute length in element + vType was used to declare the length + from one vehicles front bumper to the next vehicles front + bumper. NOW it declares the actual physical length of the + vehicle. Attribute minGap is used to + declare the distance between front bumper of a vehicle and the + back bumper of its leader in a traffic jam.
      • +
      +
    • +
    • NETCONVERT
        +
      • added optional attribute name to + plain edge input. This is used for visualisation (Street name)
      • +
      • added optional attribute endOffset + to plain edge input. This can be used to shorten the usable + edge/lane length when stopping (i.e. in case of pedestrian + crossings)
      • +
      • added optional attribute width to + plain edge input. This will be used for visualisation in future + patches
      • +
      • plain edge input now supports lane specific speeds
      • +
      • plain edge input now supports edge-specific vehicle class + restrictions (allow, + disallow)
      • +
      • replaced element forceLength by + element split with altered + functionality
      • +
      +
    • +
    +

    Option Names#

    +

    Many options have been renamed to increase consistency and to hopefully +make them easiert to understand and remember. All changes apply to +options given via the command line as well as options declared via +configuration files. The old options still work although some are now +marked as deprecated.

    +

    Call <APPLICATION> --save-template <filename> --save-commented +to get a list of supported options including synonymes.

    +

    Application-Specific Changes#

    +
      +
    • Simulation
        +
      • removed emitters, now only normal route files are allowed
      • +
      • renamed --emissions-output to --summary
      • +
      • renamed --sloppy-emit to --sloppy-insert
      • +
      +
    • +
    • NETCONVERT
        +
      • now fully supports import of SUMO networks
      • +
      +
    • +
    • TraCI +
    • +
    +
    int length = readByte()
    +if length==0:
    +length = readInt()
    +
    + + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.0_to_Version_0.13.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.13.0 to Version 0.13.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.13.0 to Version 0.13.1
    + + + +

    Release Date: 01.11.2011

    +

    Bugfixes#

    +
      +
    • switched-off traffic lights are now put into the correct state
    • +
    • vehicles with gui shape can now be used as router input
    • +
    • updated tutorial networks
    • +
    • fixed bug in duarouter which prevented use of multiple inline routes
    • +
    • object-chooser no longer centers on unwanted objects
    • +
    +

    Enhancements#

    +
      +
    • TraCI
        +
      • Added the possibility to retrieve an induction loop's position + (offset/lane) as suggested by Xiao-Feng Xie; thanks!
      • +
      • Added the possibility to remove a vehicle via TraCI
      • +
      • Added the description about how to add a vehicle via TraCI
      • +
      • Retrieve the number of still expected vehicles
      • +
      +
    • +
    • NETCONVERT
        +
      • added more control over joining junctions. You can declare nodes + to be joined as well as exclude nodes from joining (see + Networks/PlainXML#Joining_Nodes)
      • +
      • added option --osm.discard-tls (do not use tls definitions when importing OSM)
      • +
      • added option --junctions.join-exclude <STRING>[,<STRING>]* (junctions in this list are not joined)
      • +
      • added option --no-left-connections (do not build connections to left)
      • +
      • added optional attributes 'toLane' and 'fromLane' to + connection-file element 'reset' (see + Networks/PlainXML#Connection_Descriptions)
      • +
      • added importer for openDRIVE files, see + Networks/Import/OpenDRIVE; + many thanks go to Marius Dupuis from + VIRES for allowing to use the example + files for tests
      • +
      • added importer for matSIM files, see + Networks/Import/MATsim + (actually already in 0.13.0)
      • +
      • added new plain xml input/output format plain.tll.xml which + holds information about traffic lights.
      • +
      • added option --geometry.max-segment-length <FLOAT> to restrict segment length by inserting additional + geometry points
      • +
      • debugged brakedown on VISUM import
      • +
      • ignore connections for explicitly removed edges (instead of + throwing an error)
      • +
      +
    • +
    • Simulation +
    • +
    • JTRROUTER
        +
      • added Karol Stosiek's patch for reading more than one turn-definitions file; changes --turn-ratio-file <FILE> to --turn-ratio-files <FILE>[,<FILE>]*
      • +
      +
    • +
    • SUMO-GUI
        +
      • can now switch traffic lights back on
      • +
      +
    • +
    • Tutorials
        +
      • moved tutorials from <SUMO_HOME>/docs to <SUMO_HOME>/tests/complex for assuring their + compliance with the current version; they should though appear + in the release under <SUMO_HOME>/docs
      • +
      • added a tutorial on car-following parameter calibration
      • +
      +
    • +
    • Tools
        +
      • added script tools/net/netdiff.py <net1.net.xml> <net2.net.xml> <diff_prefix> which creates the plain-xml + differences of two sumo networks. The set of difference files + can be loaded together with <net1.net.xml> to recreate <net2.net.xml>. This allows for advanced scenario + management.
      • +
      • added tools for dealing with turn-ratios
      • +
      +
    • +
    • Documentation
        +
      • restructured wiki-pages
      • +
      • new static HTML docs generated from the wiki
      • +
      +
    • +
    +

    Other#

    +
      +
    • updated gl2ps to version 1.3.6
    • +
    • removed MSMsgInductLoop; the functionality was almost the same as +for a plain MSInductLoop just that an additional string wasgiven; +the functionality can be easily obtained by using proper ids and +mapping them to "messages"
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.13.1_to_Version_0.14.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.13.1 to Version 0.14.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.13.1 to Version 0.14.0
    + + + +

    Version 0.14.0 (11.1.2012)#

    + +

    Bugfixes#

    +
      +
    • Simulation
        +
      • removed invalid collision warnings
      • +
      • removed various gui glitches when drawing vehicles
      • +
      • fixed free speed calculation
      • +
      +
    • +
    • GUISIM
        +
      • tracking a vehicle no longer messes up start/stop controls
      • +
      +
    • +
    • Netconvert
        +
      • fixed minor bugs related to updating edge attributes with + additional edg.xml files
      • +
      • builds without PROJ will no longer produce a bugged binary + (failing with "no option with the name proj.inverse exists")
      • +
      +
    • +
    • Duarouter
        +
      • use identical units for parsed data and calculated defaults
      • +
      +
    • +
    • Tools
        +
      • netdiff now correctly handles repeating identical traffic light + phases
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • NETCONVERT
        +
      • changed the way junctions are joined when using --join.junctions; see + Networks/Building Networks from own XML-descriptions#Joining Nodes
      • +
      • all output is now written using UTF-8 encoding instead of + Latin-1. This should allow the usage of international street + names (note that street ids may use only ascii)
      • +
      • added option --proj.plain-geo which writes plain-xml files using geo-coordinates
      • +
      • location information is now embedded in nod.xml files. This + makes conversion between net.xml and plain xml lossless.
      • +
      • Importing large OSM Networks is much faster due to algorithmic + improvements
      • +
      • added options --keep-edges.by-type and --remove-edges.by-type for restricting a network
      • +
      +
    • +
    • GUISIM
        +
      • sumo-gui now parses command line options
      • +
      +
    • +
    • general options
        +
      • boolean options may be disabled from the command line + (--help=false)
      • +
      • a single parameter (not starting with "-") is treated as a + configuration file
      • +
      +
    • +
    • Tools
        +
      • added eco routing capabilities to duaIterate.py
      • +
      +
    • +
    +

    Reduced memory consumption of all applications. Also increased speed for +some applications. For benchmark values see +#634

    +

    Other#

    +
      +
    • Simulation
        +
      • default arrival position is now lane end instead of start
      • +
      +
    • +
    • NETCONVERT
        +
      • renamed XML-element reset to delete to better reflect + its purpose
      • +
      +
    • +
    • GUISIM
        +
      • Changed close-simulation hotkey from Ctrl-C to Ctrl-W to better + conform to interface standards
      • +
      +
    • +
    • Tools
        +
      • python module sumolib.output now has a method parse which + supports all output files
      • +
      +
    • +
    • first incarnation of a windows installer
    • +
    • TraCI
        +
      • emission related outputs are now in mg and ml
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.14.0_to_Version_0.15.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,329 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.14.0 to Version 0.15.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.14.0 to Version 0.15.0
    + + + +

    Version 0.15.0 (14.03.2012)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Real time factor in simulation summary is now correct (was off + by factor 1000)
      • +
      • Option --route-steps now reads the given number of seconds ahead (input + argument was interpreted as milliseconds, inadvertently)
      • +
      • specifying invalid departPos no longer causes an infinite loop
      • +
      • The minimum gap is now outside of the vehicle. This means, a + vehicle starts at its position, the minimum breaking distance is + in front of the position. This effects the retrieval of a + vehicle's position via TraCI, and also the measures collected by + detectors - now, the collected vehicle lengths do not contain + the minimum distance anymore. see blog entry
      • +
      • consolidating right-of-way rules (again). Networks must be + rebuild
      • +
      • fixed crash when using TraCI to set new TLS-programs with less + phases (ticket #652)
      • +
      +
    • +
    • NETCONVERT
        +
      • looped ways are now correctly imported from OSM (before, these + were pruned from the network)
      • +
      • fixed bug related to --proj.plain-geo (would sometimes crash or produce invalid + output)
      • +
      • fixed bug in geometry computation when dealing with + 3D-coordinates
      • +
      • fixed bug when joining junctions (did not join as much as + requested)
      • +
      • OSM import no longer discards edges with multiple types as long + as at least one type is known (this caused missing bridges etc.)
      • +
      • debugged import of VISUM-turn descriptions ("ABBIEGER")
      • +
      • fixed calculation of intersecting lines
      • +
      +
    • +
    • GUI
        +
      • corrected the link numbering
      • +
      • no longer crashes when reload is pressed during running + simulation
      • +
      +
    • +
    • DUAROUTER
        +
      • Option --max-alternatives is no longer ignored
      • +
      • clogit probabilities are calculated correctly
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Meandata output can now print default travel times / emissions + on empty edges (excludeEmpty="defaults")
      • +
      +
    • +
    • DUAROUTER
        +
      • added Option --routing-algorithm. It supports the values dijkstra (default) and + astar (new). The newly added astar algorithm uses the + euclidean distance heuristic. It routes 30% faster on the road + network of Cologne and 40% faster on the road network of Berlin.
      • +
      • In verbose mode, some performance measures of the routing + algorithm are given
      • +
      • better defaults for emission based routing
      • +
      +
    • +
    • GUISIM
        +
      • object choser can now filter by selection
      • +
      +
    • +
    • NETCONVERT
        +
      • added Options --speed.offset and --speed.factor. These modify all edge speeds by first + multiplying with factor and then adding offset.
      • +
      • added output Option --junctions.join-output FILE. This writes a protocol of joined junctions + to FILE. Loading FILE as additional nod.xml reproduces these + joins.
      • +
      +
    • +
    • All
        +
      • Logging options are handled consistently
      • +
      • step logging enabled by default, can be disabled for all + relevant applications (sumo, duarouter, jtrrouter, od2trips)
      • +
      +
    • +
    +

    Other#

    +
      +
    • Simulation
        +
      • traffic light offset is now interpreted as delay. An offset of x + delays all phases by x seconds. The old behaviour was to let all + phases start x seconds earlier.
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.15.0_to_Version_0.16.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,478 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.15.0 to Version 0.16.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.15.0 to Version 0.16.0
    + + + +

    Version 0.16.0 (04.12.2012)#

    +

    Bugfixes#

    +
      +
    • Building
        +
      • Fixed building under gcc4.7; thanks to Karsten Roscher
      • +
      +
    • +
    • Simulation
        +
      • Fixed the bug which prevented vehicles to be inserted in the + middle of a street using departPos="free" (ticket732, + thanks to Björn Hendriks for reporting it)
      • +
      • Fixed several bugs that were causing collisions
      • +
      • Fixed bug in the default car-following model wich lead to + larger-that-necessary following distances. The maximum possible + flow is now greatly increased.
      • +
      • Fixed bug where simulation would not terminate if vehicles with + fixed depart speeds could not be inserted
      • +
      • Fixed bug that lead to unnecessarily low departure speeds under + some conditions
      • +
      • Fixed bug which sometimes caused vehicles to use the wrong lanes
      • +
      +
    • +
    • SUMO-GUI
        +
      • Fixed loading of breakpoints, reported by Anderson Rocha, + thanks!
      • +
      +
    • +
    • NETCONVERT
        +
      • reading tls offset from VISUM files corrected
      • +
      • OSM-ids are now read as long longs (long long int under + Linux)
      • +
      • added the option --tls.discard-loaded <BOOL> which avoids loading traffic lights from other + formats than XML (in XML, one can simply replace the type + "traffic_light" by "priority"); removed option --osm.discard-tls <BOOL> which did the + same for OSM-networks only
      • +
      • SUMO-networks with tls offset now load correctly
      • +
      • connections for highway ramps no longer cross incorrectly
      • +
      • OpenDRIVE-export: corrected lane offsets (geometry) and lane + linkage (topology)
      • +
      • connections which can not be set when being loaded are kept and + retried after network changes, such as ramps building, or nodes + joining
      • +
      • now correctly setting edge priorities when importing dlr-navteq + networks
      • +
      • junctions with incoming edges of differing priority can no + longer have type 'right_before_left'
      • +
      • OSM-imported railways are now correctly imported as one-way + which avoids lots of bogus rail edges
      • +
      • OSM-imported railways no longer yield to regular roads
      • +
      • OSM-imported railways now have proper default speeds
      • +
      • changing attributes from or to of an existing edge no longer + crashes
      • +
      • improved heuristic for detecting roundabouts. Now recognizes + roundabouts with divided attachment edges.
      • +
      • fixed bug where import would fail due to tag elements with + empty v-attribute
      • +
      • fixed bug where the special connection attribute pass was lost + when writing plain xml or importing sumo networks (this + attribute affects the junctionLogic in built networks and + declares that a connection never yields).
      • +
      • fixed bug that caused right-of-way computations to fail + (resulting in collision) at turnaround lanes
      • +
      • fixed bug that caused connections to be considered foes even if + they did not conflict. The resulting network inconsistency + manifested in collisions.
      • +
      +
    • +
    • NETGEN +
    • +
    • TraCI +
    • +
    • TOOLS
        +
      • method parse_fast in sumolib.output no longer fails when using + attributes which are also python keywords.
      • +
      • fixed flowrouter.py to use the new (0.13) network format and + write the new route format
      • +
      +
    • +
    • Documentation
        +
      • Patched CSS issues in IE
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • building
        +
      • added configure option --enable-profiling to be used with gprof
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • added the option --routing-algorithm <STRING> to configure simulation routing + (devices,triggers,traci). Allowed values are dijkstra, + (default) and astar
      • +
      • Rerouting via 'device.rerouting' is now much faster
      • +
      • variable speed signs now accept negative speed values. this + causes them to reset the edge back to its default speed
      • +
      • if any vehicles are vaporized + during simulation the attribute vaporized="NUMBER_OF_VAPORIZED_VEHICLES> + is added to the meanData output for the respective edge.
      • +
      • added the option --maxDist.routesize <INT> to limit the size of routeDistributions + (useful to conserve memory for long-running simulations)
      • +
      • added several new output types by Mario Krumnow: emission output, full output, vtk output, fcd output, and queue output. Thanks!
      • +
      • added the option --fcd-output.geo. If this option is given the output from --fcd-output <FILE> will + contain geo coordinates instead of cartesian coordinates.
      • +
      • compact specification of routeDistribution (using attribute + routes) now recognizes attribute probabilities
      • +
      • added the option --vehroute-output.write-unfinished. If this option is given, vehicle routes for + all vehicles on the road will be written at the end of the + simulation.
      • +
      • added the option --device.rerouting.init-with-loaded-weights. If this option is given, weights supplied + with the existing option --weight-files <FILE> are used for initialiing the rerouting + devices.
      • +
      • Rerouter definition + destProbReroute now recognizes the special values + keepDestination and terminateRoute which causes a reroute to + the original destination or terminate the route respectively.
      • +
      • It is now possible to combine the + rerouter definitions + closingReroute and destProbReroute. In this case only + vehicles which are affected by the closingReroute sample a + new destination from the destProbReroute.
      • +
      • The verbose simulation summary now includes the number of + teleports
      • +
      • The vType attributes speedFactor and speedDev are now + officially supported and allow for a convenient way of + specifying vehicle speed distributions. Among other things these + can be used to model speeding vehicles which exceed given edge + speeds. More Details
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • The deprecated "environment-related" commands were removed and + the documentation was finally corrected; position conversion + and distance computation + are still available via the Simulation Value Retrieval API. + Please note that the footprint has changed so that it matches + the other API calls.
      • +
      • API version was increased to 5
      • +
      • Added object context subscriptions
      • +
      • Added method remove to the vehicle module
      • +
      • Added python interface to convert cartesian to geo coordinates + and vice versa
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • the gui can be started with multiple views by supplying a list + of files to option --gui-settings-file
      • +
      • street coloring by selection now colors all lanes for selected + edges (useful when loading selections from a file)
      • +
      • Visualizing rerouters with many trigger edges and many closed + edges no longer causes the GUI to slow down.
      • +
      • The lane-parameters dialog now list the street name as well as + the vehicle class permissions
      • +
      • Rail edges are now rendered with rails and crossties making them + stand out from normal roads.
      • +
      • Persons are now visualized during all steps of their plan and + allow accessing step information.
      • +
      • vehicles with guiShape="rail" are now visualized with multiple + carriages when the visualization option Show As is set to + simple-shapes. The overall length of the train and the number + of carriages is determined from the vehicle length
      • +
      • Vehicles can now be renderd with bitmaps using the new vType + attribute imgFile. This should be a grayscale image with alpha + channel to allow full recoloring functionality.
      • +
      • Persons can now be rendered with bitmaps when specifing a vType + with attribute imgFile just like vehicles (persons bitmaps + will not be rotated, however).
      • +
      • POIs can now be rendered with bitmaps using the new attributes + imgFile, width and height
      • +
      • the default vehicle coloring respects now colors assigned to the + vehicle, type or route (in that order) before assigning the + default color
      • +
      • the default color can be changed for coloring by vehicle / type + / route
      • +
      • The vehicle parameter dialog now includes the vehicle specific + speed factor if speed distributions are used.
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • the speed column in flow input files is now optional
      • +
      +
    • +
    +
      +
    • TOOLS
        +
      • added options for generating random trips which help to increase + the quality of generated trips. see + Tools/Trip#randomTrips.py
      • +
      • improved the method parse in sumolib.output. It now supports + memory-efficient parsing of nested xml elements into convenient + python objects based on pulldom traversal
      • +
      • added several utility classes in sumolib.miscutils
      • +
      • added option --big to script route/sort_routes.py which allows + handling very large files at the price of increased hdd-reading
      • +
      • added script assign/duaIterate_analysis.py for plotting + statistics of a duaIterate run
      • +
      • added script route/route2poly.py for visualizing routes with + polygons in the sumo-gui
      • +
      +
    • +
    +
      +
    • Documentation
        +
      • Added schema definition for JTRROUTER's + turns and sink definition files
      • +
      +
    • +
    +

    Other#

    +
      +
    • general
        +
      • reworked some of the XML parsing code, watch out for new parsing + errors or ignored attributes
      • +
      • added --xml-validation to all executables which enables Xerces-C schema + validation for input files having a schema defined
      • +
      +
    • +
    • NETCONVERT
        +
      • replaced the option --plain.keep-edge-shape with the inverted option --plain.extend-edge-shape. The new default + is to keep given edge shapes and only extend them if this option + is set. Extending edge shapes inadvertently can lead to invalid + connections and priorities.
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.16.0_to_Version_0.17.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,394 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.16.0 to Version 0.17.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.16.0 to Version 0.17.0
    + + + +

    Version 0.17.0 (03.05.2013)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • tripinfos now contain the correct arrivalPos and routeLength + values + (#814)
      • +
      • fixed collision bug for simulations that were running with + option --no-internal-links
      • +
      • fixed bug that caused vehicles to sometimes use the wrong lane + and occasonaly lead to collisions + (#586, + #836)
      • +
      • fixed bug in the default car-following model which lead to + collisions when using vehicle types with different deceleration + values
      • +
      • fixed crash when specifying an invalid car-following model in + the input files
      • +
      • fixed invalid vehicle insertions under special conditions
      • +
      • increased junction throughput (fixed bugs related to + right-of-way timing computation)
      • +
      • fixed bug where vehicles drove faster than allowed at arrival + and when changing from fast to slow lanes
      • +
      • simulation routing with taz now works in the presence of vClass + restrictions.
      • +
      • fixed bug where vehicles sometimes did not follow the + arrivalLane attribute.
      • +
      • fixed bug where entryExitDetectors issued invalid warnings about + vehicles leaving without entering
      • +
      • fixed bug where inductionLoops and instantInductionLoops + sometimes failed to detect vehicles
      • +
      +
    • +
    • SUMO-GUI
        +
      • fixed occasional crash when additional vehicle visualizations + are active
      • +
      • fixed bug where the simulation control buttons (start,step) + sometimes remained gray when tracking a vehicle
      • +
      +
    • +
    • NETCONVERT
        +
      • fixed bug that caused right-of-way computations to fail + (resulting in collision) at left-turning connections
      • +
      • fixed bug where networks imported from + OpenStreetMap had + incorrect lane numbers when forward and backward directions + differed in lane count.
      • +
      • fixed bug where some sets of junctions where erroneously + classified as roundabouts when using option --roundabouts.guess resulting in + invalid junction logics and causing collisions during simulation
      • +
      • fixed bug where inconsistent (unloadable) networks where created + using option --ramps.guess
      • +
      • deleted nodes are no longer included in the final network + boundary
      • +
      +
    • +
    • POLYCONVERT
        +
      • Removed dependency on key/value ordering when importing from + OSM. Instead, now elements which match multiple typemap entries + are exported multiple times.
      • +
      • fixed projection errors when importing polygons for very large + networks.
      • +
      +
    • +
    • ROUTER
        +
      • Fixed bug where output files contained wrong values for the + emissionClass attribute (i.e routers did not properly copy the + the value from input to output files). This sometimes caused + duaIterate.py to fail.
      • +
      • major refactoring, now handling route, trip and flow inputs with + one handler (can be mixed in one file)
      • +
      • persons and stops in route input files no longer disappear
      • +
      • flow handling is similar to simulation (ids generated with "." + separator)
      • +
      +
    • +
    • TraCI
        +
      • Fixed handling of the parameter to the simulationStep command + (CMD_SIMSTEP2). Formerly a single simulation step was performed + if the given target time was lower than the current simulation + step. Now the simulationStep command is ignored in this case. + The propper use case for this command is to run the simulation + up to the given target time. Some scripts (including tutorial + scripts) wrongly passed the step duration as argument and only + worked because of this bug. To make these scripts work it is + sufficient to omit the parameter altogether.
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • added support for traffic-actuated traffic lights (see + Simulation/Traffic_Lights#Loading_new_TLS-Programs, + Networks/PlainXML#Node_Descriptions)
      • +
      • added support for microscopic calibrators. These trigger-type + objects can be used to increase or reduce traffic volume and to + regulate speeds at selected edges. Using calibrators it becomes + possible to calibrate a simulation according to known traffic + measurements (i.e. from real-life induction loops) without using + TraCI. For usage examples see the test suite at + tests/sumo/extended/calibrator.
      • +
      • renamed XML root elements of the netstate (raw dump) and the + mean data outputs.
      • +
      • added a car following model which respects slope (kraussPS), + your network needs z-coordinates then
      • +
      +
    • +
    • SUMO-GUI
        +
      • added optional POI attributes 'lon' and 'lat' for specifying + position in geo-referenced networks.
      • +
      • added options for showing polygon names and changing their line + width
      • +
      • gui-setting files now support the element <breakpoints-file value="mybreakpoints.txt"/> for loading + breakpoints at the start of the simulation
      • +
      • new color representation as four unsigned bytes including an + alpha channel (transparency) all in the range of 0-255
      • +
      • human readable color representations for red, green, blue, cyan, + magenta, yellow, black, white, and grey
      • +
      • junction coloring
      • +
      +
    • +
    • NETCONVERT
        +
      • added support for traffic-actuated traffic lights (see + Networks/PlainXML#Node_Descriptions)
      • +
      • in plain connection files the element delete now also works + when the connection doesn't exist yet (i.e. when building a + network from plain nodes and edges and the connection file only + contains delete elements).
      • +
      • now importing most turning restrictions from + OpenStreetMap
      • +
      • when importing SUMO networks without internal link the output + network will be built without internal links by default.
      • +
      • now warning about networks with large absolute coordinates since + these will cause visual errors in guisim
      • +
      • added option --tls.discard-simple which discards traffic lights at geometry-like + junctions (no intersecting streams) loaded from formats other + than plain-XML. This is particularly usefull when importing + networks from OpenStreetMap which contain many pedestrian + actuated traffic-lights.
      • +
      +
    • +
    • Tools
        +
      • added tool for creating smaller scenarios from a big scenario + Tools/Routes#cutRoutes.py
      • +
      • replaced the old trace exporter by a new + Tools/TraceExporter tool
      • +
      • experimental Python 3 support for TraCI python API and + duaIterate.py
      • +
      +
    • +
    • Tutorials +
    • +
    • Documentation
        +
      • added and improved several XML schemata (thanks to Matthew + Fullerton)
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.0_to_Version_0.17.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.17.0 to Version 0.17.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.17.0 to Version 0.17.1
    + + + +

    Version 0.17.1 (08.05.2013)#

    +

    Bugfixes#

    +
      +
    • SUMO-GUI
        +
      • fixed crash when opening the viewport-dialog
      • +
      +
    • +
    • NETCONVERT
        +
      • fixed wrong permissions when writing output in the dlr-navteq format
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.17.1_to_Version_0.18.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,428 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.17.1 to Version 0.18.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.17.1 to Version 0.18.0
    + + + +

    Version 0.18.0 (28.08.2013)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • fixed crash/hangup if a step-length below the minimum of 0.001 + is given
      • +
      • fixed bug that caused visual collisions (vehicles on different + lanes occupying the same space while on a junction)
      • +
      • fixed bug where vehicles were inserted with unsafe speeds on + minor roads causing collisions
      • +
      • removed arrival attribute from vehicle routes output for non + arrived vehicles
      • +
      • now saving all routes if a vehicle is rerouted multiple times
      • +
      • fixed crash when using calibrators
      • +
      +
    • +
    • TraCI
        +
      • the return values for link direction and link state are now + working for lane variable: link (0x33)
      • +
      • routes are now preloaded before the first simulation step such + that getMinExpectedNumber gives good results from the very start
      • +
      • Fixed documentation bug that stated geodetic positions have the + format LAT,LON whereas they actually use LON,LAT. TraCI behavior + remains unchanged.
      • +
      • Fixed rerouting for not departed vehicles (change target, change + route and change route id)
      • +
      +
    • +
    • NETCONVERT
        +
      • street-names will no longer be missing from the output when + importing a net.xml or edg.xml file which has them
      • +
      • using option --ramps.no-split <BOOL> no longer creates networks with faulty + connections.
      • +
      • fixed bug that caused invalid connections to be generated where + roads split or merge
      • +
      • fixed invalid traffig light logics and occasional crashes when + importing a .net.xml file along with split elements
      • +
      • when importing sumo networks, dangerous connections (multiple + connections from the same edge to the same lane) are no longer + silently discarded
      • +
      • fixed bug that caused invalid node geometries when using --junctions.join together with ramp building options --ramps.*.
      • +
      +
    • +
    • DUAROUTER
        +
      • option --ignore-errors <BOOL> now works correctly when a vehicle is not allowed to + drive on its depart edge
      • +
      +
    • +
    • SUMO-GUI
        +
      • vehicles with guiShape="pedestrian" now have the same size in + all levels of detail
      • +
      • traffic lights and lane-to-lane connections are now drawn for + railways
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • improved simulation speed
      • +
      • added option --link-output <FILE> for recording the approach of vehicles at + junctions. This option addresses the need of developers when + investigating junction control.
      • +
      • added new abstract vehicle classes "custom1" and "custom2" for + user defined purposes.
      • +
      • drivers on a minor road now grow impatient while waiting for a + gap in the traffic. After a while they will drive even if it + means that another car has to slow down to accommodate them (as + before, they will only drive if it is safe to do so).
      • +
      • added vType attribute impatience which affects the + willingness of drivers to cut into traffic even if it forces + other drives to brake.
      • +
      • added support for stop-signs at minor roads
      • +
      • added support for the intersection type allway_stop. This corresponds to an intersection type found in north america
      • +
      • added option --fcd-output.signals <BOOL> for including a vehicles signal state in the + output (brake lights etc.)
      • +
      • implemented "expected" attribute for stops, which expects IDs of + people that have to enter the vehicle to allow the vehicle to + leave the stop. Should be used with "triggered='true'" (would + not work otherwise). Thanks to Shubham Jain for pointing out the + wrong description of the possibilities in + [1].
      • +
      • added options for saving and loading simulation states. + Simulation states can be saved at predetermined times and then loaded to initialize a new + simulation (this also requires loading the network and routes of the + original simulation). When the filename for saving ends with .sbx + the file will be saved in a binary format instead of xml.
      • +
      +
    • +
    +
      +
    • +
        +
      • --save-state.times <TIME> [,<TIME>...]
      • +
      • --save-state.files <FILE> [,<FILE>]*
      • +
      • --save-state.prefix <FILE>
      • +
      • --load-state <FILE>
      • +
      • --load-state.offset <TIME>
      • +
      • option --sloppy-insert <BOOL> is marked deprecated because the behavior is now the + default, use --eager-insert <BOOL> to get the old behavior
      • +
      • vehicle route output for persons now includes complete plans
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • it is now possible to toggle the simulation time display between + 'seconds' and 'hour-minute-seconds' by clicking on the + 'Time'-button next to the time display. The state of this + setting persists across GUI sessions.
      • +
      • it is now possible to toggle between alternate delay values by + clicking on the 'Delay'-button next to the delay dial. Clicking + causes the current delay value to be saved as the alternative + value. The alternative delay value persists across GUI sessions.
      • +
      • parking vehicles are now being drawn (at the side of the road)
      • +
      • the vehicle parameter table now contains information about the + status of stopped vehicles
      • +
      • vehicles can now be colored by their selection state
      • +
      • added option for selecting a vehicles foes at the next junction + to the vehicle popup menu (useful when coloring by selecting)
      • +
      • brake lights will no longer be triggered when the route ends + unless the vehicle actually has to slow down.
      • +
      • now providing separate options for customizing the visualization + of persons
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • when using the option --no-internal-links the edge lengths are now increased to + compensate for the missing internal links. Thus, route lengths + will correspond better to physical distances and roundabouts are + less prone to congestions.
      • +
      • added option --keep-edges.in-geo-boundary which works similar to option --keep-edges.in-boundary but uses geodetic + coordinates instead of cartesian.
      • +
      • added new node type priority_stop. This works similar to type + priority but minor links now require a stop
      • +
      • added new node type allway_stop. This corresponds to an intersection type found in north America
      • +
      • added option --ignore-errors.edge-type for ignoring unknown edge types during loading. + This happens frequently when dealing with plain xml files based + on OSM data.
      • +
      • now parsing the OSM-Attribute "tracks" to determine whether a + railway element is unidirectional or bidirectional.
      • +
      • added option --osm.railway.oneway-default <BOOL> for setting the default behavior when importing + railways without "tracks" attribute. The appropriate value + depends on the mapping style of the regional OSM comunity.
      • +
      • added option --geometry.max-angle <FLOAT> which warns about sharp turns on an edge. This is + enabled by default for turns above 99 Degrees.
      • +
      • added option --geometry.min-radius <FLOAT> which warns about sharp turns at the start and end + of an edge. This is enabled by default for radii below 9 meters
      • +
      • added option --geometry.min-radius.fix <BOOL> which prunes geometry to avoid sharp turns at the + start and end of an edge. This is disabled by default.
      • +
      • added option --check-lane-foes.all <BOOL> (default=false) for lifting junction restrictions + for vehicles which exit on different lanes of the same edge + without crossing paths. This improves junction throughput in + many cases but is a more aggressive interpretation of german + traffic laws.
      • +
      • added option --check-lane-foes.roundabout <BOOL> (default=true) for lifting some junction + restrictions at roundabouts. This conforms to the typical layout + of roundabouts where restrictions on lane-changing allow such + movements.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • added optional flags for cmd stop (0x12) to set the parking and + triggered status
      • +
      • added command stop state (id 0xb5) for retrieving the + stopped,parking and triggered status
      • +
      • added command resume (0x19) for resuming from the current stop
      • +
      • reduced verbosity on connection close (no more good byes)
      • +
      +
    • +
    +

    Other#

    +
      +
    • Simulation
        +
      • The elements <vehicle>, <flow> and <vType> now + support child elements of the form <param key="myKey" + value="myValue/>. These can be used when implementing custom + functionality (see + Developer/How_To/Device).
      • +
      • code for messaging functionality removed (was disabled by + default anyway)
      • +
      +
    • +
    • Contributed/SmallMaps tools was +removed because it was outdated
    • +
    • switched all references in code and documentation to sumo-sim.org
    • +
    • TraCI version is now 6
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.18.0_to_Version_0.19.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,474 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.18.0 to Version 0.19.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.18.0 to Version 0.19.0
    + + + +

    Version 0.19.0 (27.11.2013)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed broken xml in vtk-output
      • +
      • Fixed crash when using calibrators with discontinuous intervals
      • +
      • instantInductionLoops no longer miscount vehicles which change + lanes on the detector edge.
      • +
      • instantInductionLoops now write events in the correct order
      • +
      • instantInductionLoops now propperly register vehicles staying on + the detector
      • +
      • fixed invalid speeds when running with step-length < 1 (see #1024)
      • +
      • the departSpeed value of a vehicle can now be as high as + laneSpeed * speedFactor
      • +
      • fixed error in a car-following related formula which was causing + collisions (see #1026)
      • +
      • queue-output now correctly measures the length from the start of + the queue to the rear of the last standing vehicle and no longer + includes one additional minGap
      • +
      • when using speedDev and + departSpeed, the distribution will + be adapted so that a vehicle can use the specified speed.
      • +
      • The attribute emitted of the + summary output was + renamed to inserted
      • +
      • fixed bug which caused vehicles to brake without good reason + (see #1052)
      • +
      • flow on a highway will no longer come to standstill just to let + vehicles from an on-ramp merge.
      • +
      • vehicles now manage to change to the necessary lanes much more + often and thus avoid having to stop and block upstream traffic.
      • +
      • vehicles now use all lanes of a multi-lane roundabout instead of + only the outer lane.
      • +
      • fixed tripinfo output for teleporting vehicles + (#990)
      • +
      • fixed handling of stops before starting position + (#1056)
      • +
      • fixed state loading with vehicle type distributions + (#1080)
      • +
      • fixed memory leak of route distributions together with route + probes + (#1077)
      • +
      • fixed reference counts for routes in state save
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Right-click now always resolves to the correct object again. The + problem was introduced in 0.18.0 and was triggered by drawing + railways
      • +
      • The object locator no longer jumps to an arbitrary location if + the requested object is not found
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI now returns the "netto" occupancy (without minGap) as + other outputs do (was #932)
      • +
      • Traffic light program changes via TraCI now takes effect + immediately instead of one step later. (Thanks to Christoph + Sommer for reporting and fixing this problem)
      • +
      • TraCI respects now the begin time option of a simulation + (#1049)
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • fixed crash when repairing routes with intermediate dead-end + edges
      • +
      • fixed generation of route distributions with 0 probability for + trips where the starting and ending edge were connected
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • fixed bug where roundabouts sometimes had incorrect right-of-way + rules
      • +
      • option --keep-edges.in-geo-boundary now works when giving a .net.xml file as input
      • +
      • OSM import no longer fails for non-standard input data (i.e. + empty key attribute or non-numerical value for tracks + attribute)
      • +
      • option --junctions.join no longer causes edges with a length above --junctions.join-dist <FLOAT> to be + removed.
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • handling end times correctly + (#428)
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Increased Simulation performance when handling lots of traffic + lights (rewrote code which was updating traffic lights more + often than necessary)
      • +
      • added vType-attribute + laneChangeModel for customizing the + lane changing behavior. Allowed values are DK2008 (the model + used until version 0.18.0), JE2013 and LC2013 (the new + default model).
      • +
      • Vehicles moving across junctions now consider the exact crossing + points at which their paths intersect with other vehicles when + deciding on their speed. This leads to smoother traffic flow + across junctions.
      • +
      • Vehicles may now change lanes while driving across junctions if + the edge they were coming from has priority (only on networks + with merged internal lanes, see NETCONVERT changes). This + improves simulation performance, particualarly on multi-lane + roundabouts.
      • +
      • Teleport warnings now always include a reason. For a vehicle + that is teleported because its waitingTime exceeds + time-to-teleport the reason can be:
          +
        • wrong lane when the vehicle was stuck on a lane which + did not allow it to continue its route,
        • +
        • yield when the vehicle was stuck on an unprioritized + road and did not find a gap in traffic or
        • +
        • jam when the vehicle could not continue because there + was no space on the next lane
        • +
        +
      • +
      • conflicts between speed deviation and departure speed are + handled more gracefully (#1035)
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • now drawing blinkers to visualize a vehicles desire to change + lanes (this is only noticable if a vehicle cannot change lanes + immediately).
      • +
      • added vehicle coloring modes by offset from best lane and by + acceleration
      • +
      • when drawing a vehicles route, the lanes which the vehicle + intends to use are highlighted where this is known (previously + the rightmost lane was always used).
      • +
      • Added hotkeys Ctrl-A, Ctrl-S, Ctrl-D for running, stopping and + stepping the simulation
      • +
      • Added a menu for opening the object locator dialogs. Using the + menu hotkeys allows searching for simulation objects without + using the mouse.
      • +
      • The vehicle parameter dialog now also contains informations + related to the vehicle type.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • lane change requests now have a higher priority by default and + will thus succeed much more frequently.
      • +
      • added the possibility to get the number/IDs of vehicles that + begin or end to park or stop, see + TraCI/Simulation_Value_Retrieval + (was #353)
      • +
      • added new command lane change mode (0xb6) to control + conflict resolution between TraCI-lane-changing request and + lane-changing decisions by the laneChangeModel. It also allows + to override safety constrainst and to trigger cooperative speed + adjustments to better fulfill change requests.
      • +
      • The python API throws now a TraCIException on recoverable errors + (such as an unknown vehicle id) and brings the system in a + consistent state + (#1043)
      • +
      • added possibility to remove waiting cars inspired by Bob Holcomb (#942)
      • +
      • improved execution speed of context subscriptions
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • added option for reversing the direction of edges
      • +
      • lanes can now be selected based on their index
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • when specifying connections it is now possible to refer to edges + which got split (#492)
      • +
      • added new projection option to convert Gauss-Krueger to UTM
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • major refactoring of input parsing, it is now possible to mix + trips, flows and vehicles in one file
      • +
      • stops are respected on routing (#988)
      • +
      +
    • +
    +

    Other#

    +
      +
    • NETCONVERT
        +
      • reworked type-related warnings when importing OSM data to + increase readability
      • +
      • modified naming conventions for internal lanes: previously every + internal lane had its own internal edge. The id of this internal + edge was ":<junction_id><link_index>" and the id of the + internal lane was ":<junction_id><link_index>0". + Now Internal lanes with the same start and end edge have a common + internal edge (except for lanes following an internal junction). + The id of this internal edge is + ":<junction_id><link_index_of_first_lane>" and the id of the + internal lanes is ":<junction_id><link_index><lane_index>". + The following relation still holds between link indices of + internal lanes and their ids: <interal_edge_id> + + <internal_lane_id> == <link_index>. The change was done to allow + lane changing on internal lanes. As a side effect of merging + internal lanes into a single edge, lane lengths may differ + compared to the previous release. This is because the simulation + length of a lane is always the average of the geometrical length + of all lanes of an edge.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • The documentation for vehicle value + retrieval/modification + now includes information on setting/retrieving vehicle-type + related values for individual vehicles (i.e. length, maxSpeed).
      • +
      • removed obsolete vehicle add command
      • +
      • TraCI version is now 7
      • +
      +
    • +
    +
      +
    • reworked checks for gdal and fox in configure
    • +
    • documentation now contains links to the wiki pages it was generated from
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.19.0_to_Version_0.20.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.19.0 to Version 0.20.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.19.0 to Version 0.20.0
    + + + +

    Version 0.20.0 (11.03.2014)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed bug in the computation of safe velocities. Sometimes the + velocity was too high (causing collisions) but most times it was + too low (degrading traffic flow).
      • +
      • Vehicles now move to the right lane after passing instead of + staying on the passing lane. (see #1139)
      • +
      • Fixed simulation crash related to lane-changing.
      • +
      • Fixed bug where vehicles would no longer stop on the correct + lane if they already stopped on the wrong lane.
      • +
      • Fixed bug which would cause collisions due to unsafe lane + changes
      • +
      • Fixed crash when terminating the simulation while vehicles were + performing continuous lane changing maneuvers (using option --lanechange.duration)
      • +
      • Fast vehicles can now be correctly inserted closely in front of + slow vehicles #1176.
      • +
      • Rerouting fixed for vehicles which are on internal lanes when + the rerouting is requested #1128.
      • +
      +
    • +
    • SUMO-GUI
        +
      • Fixed crash when using the object locator #923 on some versions of + Ubuntu].
      • +
      • Fixed bug where brake lights were shown even though the vehicle + was not braking
      • +
      • Fixed bug where train carriages where sometimes drawn onto the + wrong lane
      • +
      • The vehicle option 'select foes' now works correctly for foe + vehicles on internal lanes
      • +
      • Fixed rare graphical glitch when drawing concave junction shapes
      • +
      • Fixed drawing of segmented vehicles (trains) which are longer + than their departPos
      • +
      +
    • +
    • NETCONVERT
        +
      • Fixed bug which gave some links the wrong priority thus causing + collisions (see #1096)
      • +
      • Fixed crash when specifying connections from/to edges which are + removed during network building
      • +
      • OSM import no longer fails when encountering empty strings in + places where numerical values are expected.
      • +
      • Fixed bug where permissions involving the vClasses custom1 + and custom2 were not written correctly.
      • +
      • Fixed bug where connections from a lane were sometimes indexed + in the wrong order.
      • +
      • Disconnected nodes can no longer be joined into a cluster when + using the option --junctions.join.
      • +
      • Fixed (crash #1177) when using option --ramps.guess
      • +
      • option --ramps.guess no longer creates ramps if one of the involved + connections is a turnaround
      • +
      • traffic lights which get new programs are no longer renamed (see #1157)
      • +
      +
    • +
    • DFRouter
        +
      • Fixed crash/infinite loop when using option --guess-empty-flows. Use of this option + is not (yet) recommended (see #1198)
      • +
      +
    • +
    • JTRRouter
        +
      • Fixed handling of empty flows (no vehicles) together with a + specified start time (see #1109)
      • +
      +
    • +
    • TraCI
        +
      • instantInductionLoops are no longer included when calling + calling traci.inductionloop.getIDList()
      • +
      +
    • +
    • Tools
        +
      • Fixed bug which prevented traceExporter.py from running
      • +
      • Fixed bug which caused all speed values in NS2 output to be 0
      • +
      • Fixed bug which prevented traceExporter.py option --penetration <FLOAT> from taking + effect
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • The summary of teleporting vehicles now lists all teleports + according to their reason
      • +
      • Vehicles now perform an emergency braking maneuver to prevent + driving across a red light. If this happens in a simulation it + usually indicates that the length of the yellow-phase is to + short in relation to the road speed and the braking + capabilities. To enable driving across red lights, additional + TraCI flags were added (see below).
      • +
      • Improved intersection model which results in less conflicts + between vehicles with intersecting trajectories while on + internal lanes.
      • +
      • Added a first version of the + PHEMlight emission + model (contribution of TU Graz)
      • +
      • Rerouting now keeps existing stops and adds new stops which are + part of the new route even in cyclic routes
      • +
      +
    • +
    • SUMO-GUI
        +
      • Reworked drawing of trains to have more realistic carriage lengths. + Also some busses are drawn with flexible segments now.
      • +
      • The vehicle parameter dialog now lists the maximum speed of the + vehicle's type and the the time headway to the vehicle's current + leader
      • +
      • added vehicle coloring mode by time headway
      • +
      • Traffic light colors now distinguish between green major (code + G) and green minor (code g) by coloring the minor + state with a darker color.
      • +
      • The lane color scheme by vClass now gives fine-grained control + over coloring by using the permission bitmask + to select the color.
      • +
      • Added menu option Edit->Select lanes which allow...->vClass. + Together with the street-coloring option by selection this + allows an easy overview of the road network permitted for a + given vClass.
      • +
      • Added junction visualization option to disable drawing of + junction shapes.
      • +
      • The vehicle coloring mode by max speed now factors in the + speed limit on the current lane and the speedFactor of the + vehicle. The same color thresholds as in coloring by speed are + now used.
      • +
      +
    • +
    • NETCONVERT
        +
      • added option --osm.elevation <BOOL> which imports elevation data from OSM input + (default false).
      • +
      • Conflicts between connections originating from the same edge are + now recognized. This can be used to model interaction between + right turning vehicles and straight moving non-vehicular traffic + on a lane further right.
      • +
      • improved the heuristic for determining junction clusters to be + joined when using option --junctions.join. This results in fewer invalid joins. + Candidate clusters for manual intervention are indicated.
      • +
      +
    • +
    • TraCI
        +
      • added method traci.simulation.convert3D() which + converts a road position to either x,y,z or lon,lat,alt
      • +
      • added additonal bits to the traci command Change Vehicle State/speed mode to + configure the behavior at intersections. This can be used to + make vehicles ignore right-of-way rules and also to force them + to drive across a red light.
      • +
      • added optional argument 'flags' to traci.vehicle.setStop() in + accordance with the Vehicle modification API specification
      • +
      • the API to Areal Lane Detectors was added; + thanks to Mario Krumnow and Robbin Blokpoel
      • +
      • it is now possible to retrieve the leading vehicle within a + specified range Vehicle API specification
      • +
      • a vehicle may be added using a full specification (which is + available via XML input)
      • +
      +
    • +
    • Tools
        +
      • added tool xml2csv.py which + converts all of the XML-output files written by SUMO to a + flat-file (CSV) format which can by opened with most + spread-sheet software
      • +
      • added tool csv2xml.py for the + opposite conversion, requiring an XML schema and also for + conversion to Google's protocol buffers + xml2protobuf.py
      • +
      • osm/osmGet.py now supports retrieving very large areas by + bounding box using the option --tiles <INT>. (previously this option was only + supported together with option --oldapi which has severe size limitations)
      • +
      • added option --gpx-output <FILE> to + traceExporter.py which allows + exporting vehicle trajactories as GPX files
      • +
      • added option --poi-output <FILE> to + traceExporter.py which allows + exporting vehicle trajectories as + POIs
      • +
      • added option --vclass to + randomTrips.py which + ensures that generated trips only depart and arrive at edges + permitted for vclass
      • +
      • randomTrips.py now + recognizes the network fringe even if the network contains + turn-around connections (An edge belongs to the fringe if it + contains only incoming or outgoing connections excepting + turnarounds). This is important when using the option --fringe-factor <FLOAT> for + generating plausible through-traffic in small networks.
      • +
      • added two tools for visualising emission behaviour
      • +
      • added some visualisation tools
      • +
      +
    • +
    +

    Other#

    +
      +
    • TraCI
        +
      • TraCI version is now 8
      • +
      • fixed documentation of of command slow down: It changes speed + smoothly over the given number of milliseconds (in contrast to + command speed which changes using maximum + acceleration/deceleration).
      • +
      +
    • +
    • All Applications
        +
      • Added option --xml-validation <STRING> with possible values never, always and auto + defaulting to auto. This causes all input files to be + validated against their respective schema, provided the + schema-URL is declared in the toplevel XML-Tag (always + requires the schema-URL to be present).
      • +
      • Added option --xml-validation.net <STRING> to all applications which read + .net.xml-files which works like + option --xml-validation <STRING> but applies only to sumo networks (default never since + network validation is computationally expensive).
      • +
      • Most of the input and output files have an XML schema now, see + https://github.com/eclipse/sumo/blob/master/data/xsd
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.20.0_to_Version_0.21.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,512 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.20.0 to Version 0.21.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.20.0 to Version 0.21.0
    + + + +

    Version 0.21.0 (11.06.2014)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed infinite loop when tls-phases were shorter than the + step-size
      • +
      • Fixed bug where vehicles would block the intersection when + stopping at the very end of a lane due to a red light
      • +
      • Fixed lane-changing bug which could cause differing results + between different compilers due to uninitialized memory.
      • +
      • The vehicle class ignoring now properly ignores edge permissions and is + allowed to drive anywhere.
      • +
      • Time values are now checked on input whether they are in the + correct range (less than 2147483 seconds)
      • +
      • Teleport over an edge which has a stop now removes the stop from + the list of pending stops
      • +
      • the IDM and the IDMM car following model now stop closer to the + halting line (in front of intersections), furthermore the moving + average in the IDMM was repaired
      • +
      • Bluetooth device handles subsecond simulation correctly
      • +
      • Fixed check for slow lanes ahead of the depart position to allow + for higher insertion speeds
      • +
      • Repaired rerouting of vehicles which are on an internal lane
      • +
      • Several fixes with teleporting over, on and onto induction loops + and range detectors.
      • +
      • Fix to the computation of the expected time at which vehicles + leave an intersection. This results in a minor increase in + junction throughput.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • The time shown in the gui now matches the time found in + simulation outputs for the shown vehicle positions. Previously, + the gui showed the time + 1 step.
      • +
      • Fixed crash when drawing persons
      • +
      • Patched building under MacOS, thanks to Alex Voronov
      • +
      • lane coloring by netto occupancy no longer shows brutto + occupancy (see lane coloring).
      • +
      • drawing of simple vehicle shapes now always uses a distinct + color for drawing details.
      • +
      • Fixed crash when closing the breakpoint editor
      • +
      • Fixed crash when loading viewsettings and changing them + immediately.
      • +
      +
    • +
    • NETCONVERT
        +
      • when loading traffic light programs from tllogic-files, the + node attribute controlledInner is now propperly preserved
      • +
      • guessed traffic light programs no longer contain duplicate + consecutive phases
      • +
      • Fixed bug where option ramps.guess would sometimes fail to add necessary + lanes.
      • +
      • Extremely short internal lanes are no longer split. Instead a + warning is issued since these cases usually indicate an invalid + junction geometry.
      • +
      +
    • +
    • DFROUTER
        +
      • removed option --all-end-follower as it's not longer needed and buggy
      • +
      +
    • +
    • DUAROUTER
        +
      • when using tazs (districts) they are now correctly attached to + the network with an edge with travel time 0 (before it was 1)
      • +
      +
    • +
    • TraCI
        +
      • subscriptions for VAR_LOADED_VEHICLES_IDS now work
      • +
      • when setting lane change mode to prevent all changes due to a + certain change-motivation, motivations with lower priority are + now correctly considered.
      • +
      • adding a vehicle with a negative depart position gives an error + message (applies only to ADD not to ADD_FULL)
      • +
      • adding a vehicle with a depart time in the past gives an error + instead of silently dropping the vehicle
      • +
      • vaporizing parked vehicles is now possible #1166
      • +
      • forcing a lane change for a stopped vehicle now correctly + removes the current stop from the list of pending stops
      • +
      +
    • +
    • Tools
        +
      • Fixed bug where sortRoutes.py would produce invalid XML (thanks + to Pieter Loof for the patch)
      • +
      • Fixed bug in traceExporter.py when generating files for NS2 + which caused non-sequential IDs to be written.
      • +
      +
    • +
    • General
        +
      • Fixed several divisions by zero and integer over- and underflows + reported by the clang sanitizer
      • +
      • Trying to open existing files which do not have reading + permissions now gives a correct error message
      • +
      • All tools now give error messages when an output socket is not + any longer available on closing
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • +

      Simulation

      +
        +
      • Added improved capabilities for pedestrian simulation
          +
        • Added option --pedestrian.model <STRING> with available values nonInteracting and + striping. The most important features of the + striping model (which is the new default are:
        • +
        • Pedestrian cross streets and interact with traffic (blocking + vehicles, blocked by vehicles, reacting to traffic lights)
        • +
        • Pedestrians interact with each other (jam)
        • +
        • Pedestrians select their route dynamically to avoid red + lights when multiple paths across an intersection are + available.
        • +
        • Added options --pedestrian.striping.stripe-width <FLOAT> and --pedestrian.striping.dawdling <FLOAT> to configure the 'striping'-model
        • +
        +
      • +
      +
        +
      • Added option --lanechange.overtake-right <BOOL> to switch between german overtaking laws (default) + where overtaking on the right on highways is prohibited and + american overtaking laws
      • +
      • Vehicles which are already on a junction but have to wait for + another vehicles (also on the junction) now always drive up to + point where their path crosses with the blocking vehicle.
      • +
      • Added option --random-depart-offset <TIME> to randomize departure times for all vehicles by + applying a positive (uniform) random offset.
      • +
      • flow elements now support attribute probability for specifying flows with + randomly distributed departures (following a binomial + distribution). Each second a vehicle is inserted with the given + probability (which is scaled according to the given --step-length).
      • +
      • Vehicles with a vType which has a specified vClass will now get appropriate + default values for some of their parameters (i.e. busses will be + longer than 5m by default). Refer to + Vehicle_Type_Parameter_Defaults + for details.
      • +
      • the option --scale <FLOAT> can now also handle values > 1 and inserts more + vehicles in this case
      • +
      • added HBEFA3 + emission model
      • +
      • added outputs conforming to the + Amitran standards
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • the option --no-warnings <BOOL> now also applies to the GUI message window
      • +
      • Added person coloring scheme by selection and by angle
      • +
      • All person modes now give a waitingTime
      • +
      • Person parameter dialog now inclues attributes 'edge', + 'position', 'angle' and 'waitingTime'
      • +
      • Pedestrian crossings are now indicated by the typical + zebra-pattern (light color indicates that pedestrians have + priority, dark color means that vehicles have priority)
      • +
      • Showing permission code in lane parameter dialog, updated style + color by permissions
      • +
      • Uncontrolled links (not part of a junction logic) are now shown + with index -1
      • +
      • Now showing edge type in lane parameter dialog
      • +
      • Customizable drawing of ids for edges of type crossings and + walkingarea
      • +
      • Added lane coloring scheme by angle
      • +
      • Lanes are now drawn with smooth shapes regardless of geometry + (fixed white gaps at corners)
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Added element <crossing> for '.con.xml' files. This can be used to specify pedestrian crossings
      • +
      • Added attribute sidewalkWidth to <type> elements in .typ.xml files. If this is given, edges + of this type will get an extra lane with allow="pedestrian" and the specified width.
      • +
      • Added options --sidewalks.guess <BOOL>, --sidewalks.guess.min-speed <FLOAT> and --sidewalks.guess.max-speed <FLOAT> to trigger guessing of sidewalks
      • +
      • Added option --crossings.guess <BOOL> to trigger guessing of pedestrian crossings
      • +
      • Added options --tls.guess-signals <BOOL> and --tls.guess-signals.dist <FLOAT> to interpret special traffic light nodes + which surround an intersection as the signal positions for that + intersection. This heuristic is useful for correctly importing a + typical representation of traffic lights in OSM data.
      • +
      • Added attribute shape to <node> elements in .nod.xml files. + This allows to specify a custom shape for that node.
      • +
      • can write networks in the Amitran format
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • <trip> and <flow> elements now support attribute via for specifying intermediate + edges to use during routing.
      • +
      • vType and route definitions can now be given in additional-files just like for + SUMO
      • +
      • Pedestrian walks with attributes from and to are now routed and + written with attribute edges.
      • +
      • the maximum (the average) speed factor are taken into account + when calculating the minimum (the default) travel times
      • +
      • References to an unknown vType are now an error (which can be ignored + with --ignore-errors). Previously, an unknown vType was silently copied to the + output and treated like the default type during routing.
      • +
      +
    • +
    + +
      +
    • OD2TRIPS
        +
      • reads now OD matrices in Amitran format
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Added randomTrips.py + option --pedestrians <BOOL> to generate pedestrian walks
      • +
      • Added randomTrips.py + option --max-distance <FLOAT> to limit the straight-line distance of generated trips
      • +
      • Added randomTrips.py + option -a, --additional-files <FILE>[,<FILE>]* which is passed to DUAROUTER
      • +
      • Added randomTrips.py + option -i, --intermediate <INT> for generating trips with intermediate waypoints
      • +
      • Added randomTrips.py + option --maxtries <INT> to control the number of attemps for finding a trip + which meet the given distance constraints
      • +
      • convert almost arbitrary XML outputs (with a given schema) to + CSV and protobuf, see Tools/Xml
      • +
      +
    • +
    +

    Other#

    +
      +
    • Simulation
        +
      • Removed obsoleted --incremental-dua-step and --incremental-dua-base option (use --scale instead)
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Renamed randomTrips.py + option for setting the id prefix of generated trips from -t, --trip-id-prefix to --prefix
      • +
      • Renamed randomTrips.py + option for setting trip attributes from -a, --trip-parameters to -t, --trip-attributes
      • +
      +
    • +
    + +
      +
    • Miscellaneous
        +
      • Some + vClass definitions + where added and others renamed. Old definitions will continue to + work but some will cause deprecation warnings.
      • +
      • Referenze typemap files for + importing edges and polygon data from OSM networks as well as + from other formats can now be found at <SUMO_HOME>/data
      • +
      • SUMO builds now with clang as well
      • +
      • The shortcut -p for the option --print-options was removed because of possible + name clashes
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.21.0_to_Version_0.22.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,497 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.21.0 to Version 0.22.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.21.0 to Version 0.22.0
    + + + +

    Version 0.22.0 (11.11.2014)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Vehicles with departspeed="max" now properly adapt their speed to vehicles ahead + at insertion. This results in higher flows.
      • +
      • Teleporting vehicles will only be inserted if they fit fully + onto the destination lane.
      • +
      • Fixed some inconsistencies in E3-Detector output (see E3 Further_Notes).
      • +
      • Flows using attribute probability now correctly terminate when attribute end is given.
      • +
      • Fixed several bugs for traffic lights of type actuated.
      • +
      • Pedestrians using the model striping now always respect attribute arrivalPos
      • +
      • Fixed crash when computing pedestrians positions on short + walkingAreas.
      • +
      • Fixed crash when using car following model <carFollowing-IDM/>
      • +
      • Fixed bug that was causing collisions at intersections.
      • +
      • Fixed bug that was causing collisions due to unsafe + lane-changing decisions.
      • +
      • Fixed bug that was causing collisions due to unsafe insertion.
      • +
      • Fixed bug that was causing collisions due to unsafe re-insertion + after teleporting.
      • +
      • Fixed bug that was causing silent collisions between vehicles + on different edges. Previously this type of collision was not + reported but visible in the gui.
      • +
      • Fixed bug that sometimes lead to inferior lane-change decisions + in networks with vehicle class restrictions.
      • +
      • Fixed bugs that sometimes prevented vehicles from being inserted + at the earliest opportunity.
      • +
      • Fixed bug that prevented vehicles from being inserted when their departSpeed was close to their maximumSpeed and using car following model <carFollowing-IDM/>.
      • +
      • Fixed bug that was causing unnecessary lane changes leading to + oscillations.
      • +
      • Fixed bug that was degrading the cooperation between vehicles + during lane changing.
      • +
      • Flows now always insert at least 1 vehicle for any positive + repetition period (if the simulation time reaches the begin-time).
      • +
      • Fixed position caching which caused wrong positions and angles + after lane changes #143
      • +
      • Fixed bluetooth reentry see #1455
      • +
      • Fixed the usage of different random number generators for route + file parsing and vehicle movement
      • +
      • Fixed rerouting close to junctions
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Single-stepping the simulation with hotkey (Ctrl-D) is now + working as smoothly as intended.
      • +
      • Changing simulation delay via mousewheel now works when the + pointer is on top of the dial.
      • +
      • Vehicle coloring by acceleration, by time gap and by offset + from best lane now correctly visualize negative values
      • +
      • Persons which are waiting or riding in a a vehicle now face the + correct direction.
      • +
      • Fixed crash related to parking vehicles.
      • +
      • Corrected angle of parking vehicles.
      • +
      • Fixed bug where train carriages were drawn incorrectly.
      • +
      • The drawing size of laneAreaDetectors can now be scaled + properly.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Street-sign-output now references the correct xsd file.
      • +
      • warnings are emitted if no proj support is available and + projection is needed
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed crash when using options --repair and --ignore-errors.
      • +
      • Fixed crash when using option --remove-loops.
      • +
      • When using option --remove-loops the non-looping parts of the route are now + kept unchanged as intended.
      • +
      • Progress indicator is now only shown if the --end option is used.
      • +
      • Fixed crash when loading <flow> with attribute probability.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed crash when retrieving vehicle variable best lanes (id + 0xb2) while the vehicle is on an internal lane.
      • +
      • The command induction loop value (last step vehicle data Command_0x17)) + now returns the value -1 for the leaveTime of a vehicle + which has not yet left the detector (instead of returning the + current time step as before).
      • +
      • Fixing connection retries in the python client
      • +
      +
    • +
    +
      +
    • Misc
        +
      • Fixed includes to speed up compilation
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Whenever rerouting vehicles, a new route is only recorded when + it differs from the previous route.
      • +
      • tripinfo-output now includes attribute timeLoss which holds the time + loss compared to the maximum driving speed.
      • +
      • Added option --tripinfo-output.write-unfinished <BOOL>. When this is set, tripinfo output will + additionally be written for all vehicles that did not arrive at + the end of the simulation.
      • +
      • Vehicles with the attribute departLane="free" now consider the free space on all + candidate lanes instead of the number of vehicles. This results + in higher flow.
      • +
      • Added a new departLane-value named departLane="first" where vehicles are inserted + on the rightmost lane they are allowed to use; this is the new + default insertion lane
      • +
      • Now supports parallel routing by using the option --device.rerouting.threads <INT>
      • +
      • Added new routing algorithms 'astar' and 'CH' which are faster + than the default 'dijkstra' algorithm.
      • +
      • flow elements with attributes from and to can now be loaded directly in the + simulation and will automatically be routed according to the + current traveltimes at begin.
      • +
      • Invalid stops now generate better error messages, see #1458
      • +
      • Added option --vehroute-output.intended-depart <BOOL>. This allows to generate vehicle route files which + reproduce the original behavior when using one shot routing. #1429
      • +
      • Added option --weights.random-factor <FLOAT> to disturb edge weights when routing in the + simulation. This allows modelling imperfect information, helps + to avoid biases when multiple routes have the same length (i.e. + in grid networks) and may be used to prevent jams on a single + shortest path.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Now appending .xml suffix when saving viewport, view settings + or decals
      • +
      • Added lane coloring by loaded weights. This colors by whatever + attribute was set with option --weight-attribute <STRING>. The weight value is also shown + in the parameter dialog.
      • +
      • Added lane coloring by priority. This uses the edge priorities + used during network creation. The priority value is also shown + in the parameter dialog.
      • +
      • Added junction coloring by type.
      • +
      • Added visualization options for drawing vehicles, persons, POIs, + polygons and additional gui objects with constant size when + zooming out.
      • +
      • The dialog for changing visualization settings is now resizable + and will remember its size across application runs. All settings + are now scrollable to allow work on smaller screens.
      • +
      • The attributes which can be used to customize lane colors can + now also be used to scale their width. This is done in the view + customization dialog unter 'Streets' -> 'Scale width'. See + [1].
      • +
      • Vehicle coloring by time since lane change now indicates the + direction of the change by its color
      • +
      • Added new link state 'u' to encode red-yellow phase (shown as + orange). Vehicles behave as if 'r' (red) was set. This linkstate + may be used to indicates upcoming green phase according to + RiLSA.
      • +
      • Lane coloring by speed now uses more colors (the same as vehicle + coloring by speed).
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Roundabouts can now be specified via plain-xml input. + They are also written to the .edg.xml-file when using option --plain-output-prefix.
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Now supports parallel routing by using the option --routing-threads <INT>
      • +
      • Added new routing algorithms 'astar' and 'CH' which are faster + than the default 'dijkstra' algorithm.
      • +
      +
    • +
    +
      +
    • JTRROUTER
        +
      • Routes which loop back on themselves are no longer genereated by + default (can be enabled using option --allow-loops).
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • added method vehicle.setSpeedMode() to the python API + (Command 0x3b).
      • +
      • added method areal.getLastVehicleIDs() to the python API + (Command_0x12).
      • +
      • added argument extended to method lane.getLinks() in the + python API (default False). If it is set to True, the method + returns all the information defined for + (Command_0x33) + instead of a subset.
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Added randomTrips.py + option --weights-output-prefix <STRING> to generate weight files which can be used to visualize + the edge probabilities for being source/destination/via in + SUMO-GUI.
      • +
      • Added randomTrips.py + option --weights-prefix <STRING> which allows loading edge probabilities for being + source/destination/via. The file format is the same as for + option --weights-output-prefix <STRING> with missing edges defaulting to probability 0 and + missing files defaulting to normal randomization.
      • +
      • Added dua-iterate.py + option --zip to zip old iteration outputs using 7-zip
      • +
      • Added script server.py + for "three-click" scenario generation (thanks to Jakob + Stigloher)
      • +
      +
    • +
    +
      +
    • MAROUTER
        +
      • Added new router which reads trips and writes routes by computing a macroscopic user assignment.
      • +
      +
    • +
    +

    Other#

    +
      +
    • Web presence moved to sumo.dlr.de (wiki at sumo.dlr.de/wiki, trac at + sumo.dlr.de/trac)
    • +
    + +
      +
    • DUAROUTER
        +
      • Now issuing warnings about repaired routes.
      • +
      +
    • +
    + +
      +
    • Misc
        +
      • The version string for each application now includes the flag + 'D' for the debug-build and flag 'I' for the internal build
      • +
      • The traceExporter.py script moved from <SUMO_HOME>/tools/bin to <SUMO_HOME>/tools
      • +
      • unittest compilation is automatically enabled when gtest is + found (Linux only)
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.22.0_to_Version_0.23.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,588 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.22.0 to Version 0.23.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.22.0 to Version 0.23.0
    + + + +

    Version 0.23.0 (31.03.2015)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • fixed bugs that caused multiple pedestrians to enter the same + spot when using the striping model. #1506
      • +
      • fixed crash when vehicles with vClass="ignoring" attempt to drive across + sidewalks and walkingareas.
      • +
      • fixed invalid departDelay in --tripinfo-output when using flows with attribute probablity. #1482
      • +
      • fixed rerouter interval ends which are now exclusive like all + other intervals
      • +
      • fixed bug that caused invalid exit times when vehicles were + teleported while on an intersection. #1520
      • +
      • fixed invalid estimation of the time and speed when reaching an + intersection which could cause collisions. #1531 #1533
      • +
      • explicitly setting option --weight-attribute traveltime now properly fills the + edge-weight container (i.e. for visualization). #1541
      • +
      • fixed invalid routeLength in --tripinfo-output when vehicles did not finish their route. #1539
      • +
      • fixed invalid routeLength in --tripinfo-output when using networks with internal lanes. #443
      • +
      • fixed bugs that were causing collisions. #1549, #1551, #1553, #1575, #1591
      • +
      • fixed bug that was causing vehicles to brake prematurely when + turning left on a prioritized road. #1566
      • +
      • fixed crash when pedestrians were using the same edge twice in a + row. #1555
      • +
      • fixed crash when pedestrians were given a disconnected route. #1578. + Now disconnected routes are an error which is recoverable (by + teleporting) using option --ignore-route-errors
      • +
      • pedestrians with a disconnected trip now properly reach their + destination (if the option --ignore-route-errors is given). #1581
      • +
      • corrected reading the PHEMLIGHT_PATH environment variable
      • +
      • simulation now properly terminates when loading a <trip> with a from-edge + that is shorter than the vehicle. #1559
      • +
      • vehicles no longer collide (visually) within an intersection + when using the + endOffset attribute. #970
      • +
      • fixed crash when attempting to load an additional tls program + with unused phase states. #1641
      • +
      • fixed crash when specifying duplicate person ids. #1650
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • when adding sidewalks via + type-map and a sidewalk + already exists, the edge now remains unchanged.
      • +
      • fixed bug where some generated pedestrian crossings at + T-intersections had a permanent red light. #1363
      • +
      • fixed bug where right-turning vehicles had the green light + during the left-turn phase when pedestrian crossings where + present.
      • +
      • the width of adjacent sidewalks is now taken into account when + computing the width of a walkingarea.
      • +
      • fixed bug where an invalid network was generated when declaring + a pedestrian crossing at a dead-end node. #1366
      • +
      • fixed bug in computation of walkingarea shape. #1257
      • +
      • fixed bug in connection computation when some connections were + explicitly deleted (also applied to some OSM turn-restrictions). #1457
      • +
      • changing offset or algorithm type with .tll.xml file for TLS + loaded from a .net.xml file without changing the phases now + works. #1207
      • +
      • when loading <split> elements along with a .net.xml file, existing + connections are preserved whenever possible. #1353
      • +
      • Fixed 3D-geometry of internal lanes at elevated junctions. #1526
      • +
      • Fixed invalid connections when generating ramps. #1529
      • +
      • Fixed invalid geometry when generating ramps. #1535
      • +
      • fixed bug where user defined connections were ignored at + intersections with one incoming and one outgoing edge. #1552
      • +
      • fixed crash when loading a sumo net with pedestrian crossings + and removing edges via options. #1557
      • +
      • fixed errors when building pedestrian crossings. #1582
      • +
      • fixed invalid connections at edges with sidewalks. #1586
      • +
      • fixed positioning of internal junctions at turnarounds when + using the + endOffset attribute. #1589
      • +
      • when importing from OSM, compound types now honor the setting discard="true" of the individual component types.
      • +
      • fixed junction shape when using lanes with custom width. #1604
      • +
      • user-defined node shapes are now correctly imported from + .net.xml files. #1450
      • +
      • lane-specific settings are no longer lost when applying an + .edg.xml patch file to an existing network definition. #1609
      • +
      • fixed some of the bugs that were causing inappropriate node + shapes.
      • +
      • several fixes to the placement of internal junctions (waiting + positions on the intersection for selected connections)
          +
        • removed some internal junctions that were not necessary
        • +
        • repositioned internal junctions so that the waiting vehicles + do not overlap with foe vehicles #1611
        • +
        • moved internal junctions at TLS-controlled nodes further + towards the junction center (previously they respected foe + vehicles which would never get the green light at the same + time)
        • +
        +
      • +
      • fixed invalid junction logic (right-of-way rules) when incoming + edges had uncommon angles. #1632 #1462
      • +
      • generate tls logic now matches the underlying edge priorities. + The streams that would have priority if the node type was + "priority" now always have a common green phase. #1642
      • +
      • the attribute controlledInner is now correctly exported to plain-xml output + when importing a .net.xml where edges within a joined TLS are + controlled. #1264
      • +
      • fixed bug that was causing the wrong flow to receive the right + of way at priority junctions. #1689
      • +
      +
    • +
    • MESO
        +
      • fixed crash when updating vehicle routes while running with --meso-junction-control. + see #1502
      • +
      • fixed angle and position of vehicle ids in the GUI
      • +
      • fixed crashes when using various outputs. #1505
      • +
      • fixed bug leading to exaggerated emissions. #1504
      • +
      • vehicles are now drawn correctly on curving lanes. #758
      • +
      • vehicle size exaggeration now working. #1406
      • +
      +
    • +
    • SUMO-GUI
        +
      • Fixed crash when using a vehicle parameter window while the + vehicle disappears. #1534
      • +
      • Coloring by loaded edge weight now correctly reflects changes + over time.
      • +
      • Edges/Lanes set to transparent (alpha = 0) are no longer drawn + when zoomed out.
      • +
      • The view-settings dialog can no longer become hidden when + switching between displays with a different resolution. #1512
      • +
      • Traffic-light show phase dialog no longer crashes when loading + very long phases. #1451
      • +
      • fixed visualization of closed edges in rerouters
      • +
      • Lane coloring by inclination now correctly shows the + direction. #1526
      • +
      • The checkbox Streets->'show rails' in the gui-settings dialog + can now be used to toggle the visualization style of railways.
      • +
      • The edge width exaggeration factor is now properly saved to and + loaded from a + gui-settings-file.
      • +
      • fixed gui glitch when zooming with transparent lanes in view.
      • +
      • now drawing vehicles on transparent lanes.
      • +
      • Selecting the Center action from a popup-menu immediately + centers the view on that object (instead of delaying until the + next window update). #1593
      • +
      • when an error occurs during the initial route loading, reloading + the simulation will now work after the user corrects the error + in the input files. #1508
      • +
      +
    • +
    • DUAROUTER
        +
      • no longer building invalid routes when the connectivity among + edges differs between vClasses. #303
      • +
      • fixed bug that caused unreasonable detours in pedestrian routes + (also affected routing in the simulation). #1556
      • +
      +
    • +
    • all routers
        +
      • Unknown vehicle type in <flow> element can now be ignored with option --ignore-errors.
      • +
      +
    • +
    • Tools
        +
      • cutRoutes.py now sorts + unmodified departure times correctly.
      • +
      • server.py no longer + creates disconnected routes. Also, trains will no longer be + generated on inappropriate edges.
      • +
      • sort_routes.py now + sorts correctly when using option --big. #1603
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Pedestrians now have appropriate default values for length, minGap and width. + These values can be changed by using a vType.
      • +
      • Improved realism of pedestrian dynamics on walkingareas when + using model striping. Pedestrians at arbitrary angles now properly avoid each other.
      • +
      • Added option --pedestrian.striping.jamtime <TIME> to control behavior of jammed pedestrians. By + default, pedestrians will now start squeezing through the jam + after being stopped for that time. As a consequence, pedestrian + scenarios now always terminate.
      • +
      • Added option --output-prefix <FILE> to automatically add a prefix to all output files. + The special string TIME is replaced with the current time.
      • +
      • Rerouters can now set permitted vehicle classes on closed lanes, + see #1518
      • +
      • A warning is now issued when a loaded network contains unsafe + connections. #447
      • +
      • A new car-following class based on the original Krauß was added + that that takes into account the maximum acceleration ability + computed by PHEMlight
      • +
      • Pedestrian routing now also works on networks without pedestrian infrastructure (walkingareas). #1564
      • +
      • Added option --netstate-dump.precision <INT> to control the precision (number of digits after + the dot) of vehicle positions and speeds when using option --netstate-dump.
      • +
      • Added vehicle class ship.
      • +
      • option --ignore-route-errors now also handles errors which prevent the vehicle from + being inserted into the network. #1661
      • +
      • Added option --device.rerouting.output <FILE> to export the travel times which are used for + dynamic rerouting during every adaptation interval. #1663
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Can now color and scale lanes by average speed and by by + average relative speed (relative to the speed limit).
      • +
      • Added option for drawing the path across the current walkingarea + to the person popup menu.
      • +
      • Can now color pedestrians randomly.
      • +
      • When drawing persons as triangles, the direction they are facing + is now indicated (it was ambiguous for equilateral triangles).
      • +
      • The lane menu now shows the height under the cursor as well as + the offset (pos).
      • +
      • Can now color lanes by height at segment start and by by + inclination at segment start. This allows investigating the + 3D-geometry in detail.
      • +
      • Added param + show-detectors that allows showing detectors of actuated + traffic lights in the GUI.
      • +
      • When drawing streets with exaggerated width, the edge in one + direction no longer overlaps with the opposite direction. #1540
      • +
      • Now setting window title when loading config or net at + application start.
      • +
      • Added menu for locating persons. #1276
      • +
      • The line information for a vehicle is now shown below the vehicle id + and in the parameter dialog. #1563
      • +
      • The network parameter dialog now includes some statistics on the + number of nodes and edges as well as the total road length. #1367
      • +
      • Added guiShape ship.
      • +
      • Now drawing waterways (lanes with allow="ship") in a distinct style.
      • +
      • Added menu option for loading an additional-file with + shapes.
      • +
      • Improved gui shapes for two-wheeled vehicles.
      • +
      • Markings for bike lanes are now drawn at road intersections + (bike lanes are lanes which only allow vClass bicycle).
      • +
      • Added options for saving the current viewport and simulation + delay along with the current visualisation settings. #1625
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • read heightmaps from GeoTIFFs for instance SRTM data #1495
      • +
      • when adding sidewalks via + typemap or --sidewalks.guess, permissions on + all other lanes are now automatically set to disallow + pedestrians. #1507
      • +
      • sidewalks can now be added for specific edges by adding the + attribute sidewalkWidth="<width_in_m>" to <edge>-elements in .edg.xml-files. This automatically + remaps any existing connections. #1580
      • +
      • when using pedestrian crossings and green verges (lanes which + disallow all vClasses), the crossing now starts at the side of + the ride instead of the green verge. #1583
      • +
      • Added option --sidewalks.guess.from-permissions <BOOL>. This adds sidewalks for edges that allow + pedestrians on any of their lanes regardless of speed. #1588
      • +
      • Can now import waterways from OSM (needs a custom type-map).
      • +
      • The junction size can now be customized using the new <node>-attribute radius #1605
      • +
      • Added option --junctions.corner-detail <INT> which can be used to generate rounded intersection + corners. #1606
      • +
      • user-defined shapes for internal lanes, crossings and + walkingareas are now supported via the new customShape-element in .con.xml files #1607
      • +
      • right-turning road vehicles will now wait within the + intersection when yielding to straight-going bicycles. #1255
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • can now generate networks with unregulated intersections. #1558
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • added option --output.plain-geo <BOOL> for writing POIs and polygons with + geo-coordinates. #1608
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • can now visualize railways the same way as SUMO-GUI. #1542
      • +
      • can now disable drawing of junction shapes via gui-settings.
      • +
      • can now load all types of shapes from the menu.
      • +
      • can now undo/redo bulk selection/deselection of objects. #1614
      • +
      • added option for auto-selecting an edges nodes.
      • +
      • can now modify the nodes of an edge via the attribute dialog. #1662
      • +
      • the attribute panel is now updated on undo/redo/recompute. #696
      • +
      • when creating a reverse edge with spread type center, the new + edge is shifted sideways and given new endpoints.
      • +
      • can now move the view in 'Create Edge'-mode by holding <CTRL>
      • +
      +
    • +
    +
      +
    • Tools
        +
      • sort_routes.py now + supports sorting persons and also copies additional elements + (such as vType to the output).
      • +
      • cutRoutes.py can now + handle nested stops in a vehicle definition.
      • +
      • added routeStats.py for + computing statistics on route length.
      • +
      • added traceExporter.py option --orig-ids <BOOL> + for keeping the original vehicle IDs instead of a running index. + For some output formats such as NS2 this only works if the + vehicle IDs are numeric to begin with.
      • +
      • route2trips.py now + preserves vType elements.
      • +
      • server.py now starts + with 'real world' gui settings and initial delay of 20. Also, + the trip generation settings have been tweaked for realism (i.e. + shorter pedestrian trips, longer train troutes)
      • +
      +
    • +
    + +

    Other#

    +
      +
    • Documentation
        +
      • Added overview on Randomness in the Simulation
      • +
      • Added overview on Vehicle speeds
      • +
      • The feature for passing arbitrary sumo options to + duaIterate.py is + now mentioned when calling --help.
      • +
      • The attribute endOffset which can be used to move the stop line when + defining networks + is now documented. It has been available since version 0.13.0.
      • +
      • Documented recommended options when importing OSM networks
      • +
      • Documented TraCI retrieval of waiting time for vehicles, + persons, edges and lanes
      • +
      +
    • +
    • TraCI
        +
      • consolidated the message IDs for ArealDetectors
      • +
      • TraCI version is now 9
      • +
      +
    • +
    • Miscellaneous
        +
      • NETCONVERT option --map-output was removed since it was neither working nor + deemed useful enough to repair it.
      • +
      • added warning about invalid geo-coordinates in netconvert and + polyconvert input
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.23.0_to_Version_0.24.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,557 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.23.0 to Version 0.24.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.23.0 to Version 0.24.0
    + + + +

    Version 0.24.0 (02.09.2015)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed default arrivalPos when loading <trip> or <flow> elements using + attributes from, to directly into SUMO. #1739
      • +
      • Fixed crash when specifying consecutive walks for the same + person. #1781
      • +
      • Fixed bug that caused pedestrians to get too close to each + other. #1769
      • +
      • Fixed crash and other bugs when using option --lanechange.duration. #1152, #1795, #1796, #1797
      • +
      • Fixed bug that sometimes caused the rear end of vehicles to be + placed on the wrong lane after lane-changing. #1804
      • +
      • Rerouters where closed edges are disabled for specific vehicle + classes now cause these vehicles to wait until the closing ends + if the destination edge is closed.
      • +
      • Vehicles with a <stop> in their route are now being overtaken if there + is sufficient space. This was causing problems when modelling + parked vehicles on a multi-lane road.
      • +
      • Fixed bug that resulted in invalid routes when routing at + simulation time (at intersections where a required connection + originates from a prohibited lane). #1861
      • +
      +
    • +
    • SUMO-GUI
        +
      • Fixed centering of names on objects (a large mismatch was + visible for persons).
      • +
      • Polygons are no longer drawn when setting their + size-exaggeration to 0.
      • +
      +
    • +
    • DUAROUTER
        +
      • Custom car following model specification is now preserved in the + route output. #1832
      • +
      • Fixed bug when using option --remove-loops where the start/destination edge + changed needlessly.
      • +
      • Vehicles may now depart/arrive at any TAZ regardless of their + vehicle class.
      • +
      +
    • +
    • NETCONVERT
        +
      • When adding crossings to a .net.xml without internal links, + the output network will be built with internal links. #1729
      • +
      • Fixed bug where duplicate crossings between the same pair of + walkingareas where sometimes build when using option --crossings.guess. #1736
      • +
      • Fixed bugs where loading a .net.xml file and removing edges + would lead to an invalid network. #1742, #1749, #1753
      • +
      • Permissions are no longer lost when guessing ramps. #1777
      • +
      • Defining pedestrian crossings at a node with type="traffic_light_unregulated" now works. #1813
      • +
      • Fixed invalid TLS-plans when loading a .net.xml file with + TLS-controlled pedestrian crossings.
      • +
      • Connections between lanes with incompatible vehicle classes are + no longer generated. #1630
      • +
      • Fixed generation of connections at intersections with dedicated + bicycle lanes (symptoms were invalid connections and missing + connections).
      • +
      • Modifying lane permissions in a network with crossings, so that + crossings are no longer valid, is now working (invalid crossings + are removed with a warning).
      • +
      • Fixed bug that caused invalid lane lengths when building with + option --no-internal-links (near intersections with sharp angles).
      • +
      • Fixed some invalid clusters when using option --junctions.join.
      • +
      +
    • +
    • TraCI
        +
      • Fixed python API for function move to VTD (0xb4). #1720
      • +
      • Fixed subscriptions for <laneAreaDetector>
      • +
      • Vehicle command move to (0x5c) can now be used to forcefully + insert vehicles which have not yet entered the network. #1809
      • +
      • Parking vehicles now return a reasonable position (and other + values which do not depend on being on a lane). #1809
      • +
      • Fixed screenshots for Linux. #1341
      • +
      • The close command returns now a little later to have more data + written to files (still not completely flushed though, see #1816)
      • +
      +
    • +
    • NETEDIT
        +
      • Fixed bug where unselected objects were wrongly selected after + undoing deletion.
      • +
      • No longer creating invalid network when loading and saving a + network with split crossings.
      • +
      +
    • +
    • Tools
        +
      • randomTrips.py no longer + attempts to find a fringe based on edge-direction when using + option --pedestrians. #1737
      • +
      +
    • +
    • All Applications
        +
      • Fixed invalid paths when using option --output-prefix <STRING> and loading a + configuration file in a subdirectory. #1793
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Simulation of electric vehicles is now supported with a new model for + energy consumption and battery charging.
      • +
      • Maximum time that may be simulated increased from 24 days to 290 + million years. #1728
      • +
      • <walk>-definitions now support + and departPos="random" and arrivalPos="random".
      • +
      • --fcd-output now includes z-data if the network has elevation. #1751
      • +
      • <vTypeProbe> output now + includes z-data if the network has elevation.
      • +
      • Device assignment by <param> + can now be used to override device assignment by option --device.<DEVICENAME>.probability.
      • +
      • Added new vType-attribute carFollowModel which can be used instead of a child + element when declearing the car following model. #663
      • +
      • Vehicles which do not have a route and cannot find one on + insertion get discarded when --ignore-route-errors is given. #1825
      • +
      • --vehroute-output now includes the route length. #1790
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • The view can now be moved and zoomed via keyboard shortcuts. #298
      • +
      • Lanes which disallow passenger cars (i.e. paths and service + roads) now have a distinct shade of grey. The color can be + customized in the gui-settings dialog.
      • +
      • Vehicles now activate their blinker during continuous lane + change manoeuvres.
      • +
      • The types of POIs and Polygons can now be displayed via View + Settings. #1803
      • +
      • The personNumber,containerNumber,personCapacity,containerCapacity information for a vehicle is now shown in the parameter + dialog. #1617
      • +
      • The GUI asks at simulation end whether all files and windows + should be closed
      • +
      +
    • +
    • NETCONVERT
        +
      • added option --remove-edges.input-file <FILE> which works as an analogue to --keep-edges.input-file. Giving either + option a selection file (where edge ids are prefixed with + edge: as argument is now supported.
      • +
      • added option --ramps.unset <STRING> which works as an analogue to --ramps.set and prevents edges + from being treated as on- or off-ramps. #1763
      • +
      • Now importing signalized pedestrian crossings from + OSM (<tag k="crossing" v="traffic_signals"/>).
      • +
      • added new option --default.junctions.keep-clear <BOOL> and new attributes <node keepClear="..."/> <connection keepClear="..."/> for allowing drivers to drive onto an intersection despite the risk of blocking it for cross-traffic. #1290
      • +
      • pedestrian crossings may be removed using the new attribute discard.
      • +
      • when splitting an edge, the new node is not removed by option --geometry.remove + even when speed and lane count remain unchanged. #1842
      • +
      • Connections from and to sidewalks are only generated when also + building pedestrian crossings since they are superfluous + otherwise. When using pedestrian model nonInteracting these + connections are not used (pedestrians jump across + intersections between any two sidewalks) and when using model + striping, crossings are mandatory.
      • +
      • Bicycle lanes are now imported from OSM (when using the appropriate typemap). #1289
      • +
      • Bus lanes are now imported from OSM. #1682
      • +
      • Improved control over edge types (typemaps) when importing from + OSM. All defaults + can now be overridden in a transparent manner and it's easier to + add additional modes of traffic than ever before (see documentation).
      • +
      • Option --lefthand now works for generating networks with left-hand + traffic. Thansk to Andrea Fuksova for suggesting the + double-mirroring technique.
      • +
      • Edge types can now be used to define vClass-specific speed limits. #1800
      • +
      • Additional attributes are now supported to specify the node that + is generated when splitting an edge. #1843
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • option --ignore-errors now also applies if no input trips/routes are loaded.
      • +
      • Added option --bulk-routing <BOOL> to improve routing speed when many (similar) + vehicles depart at the same time from the same location. The + time aggregation can be controlled using option --route-steps <TIME> The bulkstar + routing algorithm is now obsolete and no longer supported. #1792
      • +
      • Added options --repair.from <BOOL>, --repair.to <BOOL> which attempts to repair invalid source or + destination edges in the route input.
      • +
      +
    • +
    • TraCI +
    • +
    +
      +
    • POLYCONVERT
        +
      • When importing OSM data, POIs are now raised above the layer of + polygons and roads by default to make them always visible. #1771
      • +
      • Added option --poi-layer-offset <FLOAT> to control the layer of pois relative to polygons + (especially in cases where they have the same type).
      • +
      • --offset <FLOAT> options are now respeced even when used together with a network.
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • The view can now be moved and zoomed via keyboard shortcuts.
      • +
      • Added menu option for replacing junctions by geometry points. #1754
      • +
      • Geometry points of parallel edges can now be moved + simultaneously when both edges are selected.
      • +
      • option --gui-settings-file is now supported.
      • +
      +
    • +
    +
      +
    • OD2TRIPS
        +
      • can now choose only differing sources and sinks #1837
      • +
      +
    • +
    + + +
      +
    • Tools
        +
      • made edgesInDistricts.py aware of vClasses (and use the sumolib + for parsing)
      • +
      • added randomTrips.py + option --binomial <INT> for achieving binomially distributed arrival rates.
      • +
      • added randomTrips.py + option --validate <BOOL> for generating trips with validated connectivity. #1783
      • +
      • randomTrips.py now + supports attributes for <person> and <walk> definitions when using option --trip-attributes.
      • +
      • netcheck.py now supports + discovering reverse connectivity by using option --destination
      • +
      • netcheck.py now supports + edge permissions by using option --vclass
      • +
      • netcheck.py now supports + writing an edge selecting for every (weakly) connected component + when using option --selection-output
      • +
      • netcheck.py now outputs + additional statistics in regard to the disconnected components. + Thanks to Gregory Albiston for the patch.
      • +
      • added new tool + districts2poly.py + for visualizing districts.
      • +
      • added new tool + route2sel.py for + creating an edge selection from a route file.
      • +
      • added new tool + edgeDataDiff.py for + comparing two traffic scenarios via their edgeData output.
      • +
      • tls_csv2SUMO.py now supports multiple + definitions in a single input file. Thanks to Thomas Lockhart + for the patch.
      • +
      • OSM-scenario-generator script + server.py now supports additional + modes of traffic.
      • +
      • traceExporter.py now supports filtering to a bounding box. #1774
      • +
      +
    • +
    +

    Other#

    +
      +
    • Scenarios +
    • +
    • Documentation +
    • +
    • TraCI
        +
      • TraCI version is now 10
      • +
      • The named constant traci.vehicle.DEPART_MAX is now named + traci.vehicle.DEPART_SPEED_MAX. This corresponds to <vehicle departSpeed="max" .../>.
      • +
      +
    • +
    • Tools
        +
      • GDAL 2.0 is now supported. Thanks to Thomas Lockhart for the + patch.
      • +
      • osmBuild.py and server.py no + longer use option --geometry.remove-isolated to avoid removing rivers and railways.
      • +
      +
    • +
    • Misc
        +
      • The scripts randomTrips.py and route2trips.py moved from + <SUMO_HOME>/tools/trip to <SUMO_HOME>/tools
      • +
      • The OSM typemaps + now disallow vClass tram and ship where appropriate
      • +
      • The tool sumoplayer has been removed because it became + obsolete with the introduction of --fcd-output and traceExporter.py. #1651
      • +
      • The Win64 binaries no longer have a 64 suffix.
      • +
      • Error reporting on opening files got a little more verbose.
      • +
      • Whitespace in filenames is handled a little bit better
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 10 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.24.0_to_Version_0.25.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,658 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.24.0 to Version 0.25.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.24.0 to Version 0.25.0
    + + + +

    Version 0.25.0 (07.12.2015)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed crashing and deadlocks when performing routing in the simulation based on + districts. #1938
      • +
      • Fixed bug that was hindering lane-changes due to invalid + cooperative speed adaptations. #1971
      • +
      • Fixed bug that was causing erratic lane changes when using + subsecond simulation. #1440
      • +
      • Fixed bug that was causing erratic lane changes in front of + intersections. #1856
      • +
      • Fixed right-of-way in regard to vehicles that were driving + across the same intersection twice. #2023
      • +
      • Vehicles waiting to enter a roundabout no longer yield to other + vehicles outside the roundabout. #1847
      • +
      • Pedestrians no longer walk past their specified arrival + position. #1780
      • +
      • Fixed asymmetrical pedestrian behavior when walking to a + busStop. Now they always walk to the middle of the busstop + rather than to its endPos. #1562
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixing crash when selecting Show all routes from the vehicle + menu.
      • +
      • When loading a gui-settings-file from the View Settings + dialog, the delay value is now correctly applied.
      • +
      • Fix bug that caused giant circles to appear when exaggerating + the width of lanes with short geometry segments.
      • +
      • Vehicle names are now drawn for vehicles that occupy multiple + edges. #1960
      • +
      • Fixed drawing of link indices, link rules, lane markings and bus + stops for left-hand networks.
      • +
      • Fixed error when reloading a network with <param>-elements. #1979
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed missing connections in multi-modal networks. #1865
      • +
      • Fixed bug that caused invalid pedestrian crossings to be + generated after importing a .net.xml file. #1907
      • +
      • Fixed bug that caused pedestrian crossings to change their + priority when importing a .net.xml file. #1905
      • +
      • Fixed geometry bug when building pedestrian crossings and + walkingareas for left-hand networks.
      • +
      • Fixed invalid network after deleting edges at a joined traffic + light with controlled pedestrian crossing. #1902
      • +
      • Motorway ramps are no longer guessed if the lane permissions + indicate that the edge is not a motorway. #1894
      • +
      • Motorway ramps are no longer guessed at roundabouts. #1890
      • +
      • Fixed some cases when roads where invalidly guessed to be + roundabouts. #1933
      • +
      • When importing a .net.xml file the resulting network is no + longer modified due to automatic joining of edges that connect + the same nodes. #1930
      • +
      • When importing a .net.xml file with pedestrian crossings and + setting option --no-internal-links, the crossings and walkingareas are removed from + the resulting network. #1730
      • +
      • Several fixes in regard to OpenDrive networks:
          +
        • Fixed missing <laneLink> elements when exporting networks as + OpenDrive. #1973
        • +
        • Now successfully importing OpenDrive networks with + dead-end edges. #1692
        • +
        • Fixed imprecise geometry when importing + OpenDrive networks.
        • +
        • Fixed imprecise geometry when exporting networks as + OpenDrive. #2031
        • +
        • Fixed invalid geometry of lanes within intersections when + exporting networks as + OpenDrive.
        • +
        +
      • +
      • Fixed crash when specifying inconsistent tllogic input. #2010
      • +
      • When patching an existing network with .nod.xml file, existing + traffic light programs are now preserved unless changes are + specified explicitly.
      • +
      • No longer patching loaded traffic light programs for new + crossings if they already have the correct state size.
      • +
      • When importing a .net.xml which was built for left-hand + traffic, the resulting network will also be built for left-hand + traffic. #1880
      • +
      • When importing a .net.xml, generated networks will retain the + same value of --junctions.corner-detail) as the input network. #1897
      • +
      • Fixed invalid geo-referencing in left-hand networks. #2020
      • +
      • Traffic lights that control multiple intersections no longer + create unsafe right-of-way rules. The edges that lie within the + traffic light are now controlled according to the appropriate + right of way (This does not necessarily model physical traffic + signals but reflects the behavior of drivers). #812
          +
        • Old signal plans for these joined traffic lights no longer + work for new networks since more link states need to be + defined. The option --tls.uncontrolled-within <BOOL> was added to build networks that are + compatible with old-style signal plans. Note, that this may + create unsafe intersections, causing collisions.
        • +
        +
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • When renaming an edge, the lane IDs are now updated as well. #1867
      • +
      • Fractional widths can now be set when inspecting edges.
      • +
      • Modifying traffic light plans which control multiple nodes is + now working. #2009
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed invalid error when compiled without the FOX library. #1956
      • +
      +
    • +
    +
      +
    • OD2TRIPS
        +
      • Option --begin is now working. #1889
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • Loading of edge-scaling schemes from a gui-settings-file is + now working.
      • +
      • The front of each vehicle queue is now drawn at the start of its + segment.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed bug that prevented the C++ TraCI library from functioning. #2007
      • +
      • Vehicle command set speed can now be used in conjunction with move to VTD. #1984
      • +
      • When using Vehicle command move to VTD, + the speed is set according to the covered distance where this is + deemed plausible (the value of set speed overrides this).
      • +
      +
    • +
    +
      +
    • Tools
        +
      • osmWebWizard.py no longer fails + when encountering path names with space-charactes in them.
      • +
      • osmWebWizard.py no longer nests + output directories when generating multiple scenarios.
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Vehicle types + now have vClass="passenger" by default. Earlier, the default was ignoring which would let + the vehicles drive along footpaths and railways.
      • +
      • Zipper merging is + now supported (see Netconvert enhancement below). #1292
      • +
      • Added person statistics to verbose output. #1898
      • +
      • Now warning about jammed pedestrians.
      • +
      • Now warning about pedestrians "collisions".
      • +
      • Now warning about traffic lights where one link never gets a green light.
      • +
      • It is now possible to modify the offset of an existing tls program + without loading a completely new tlLogic-definition. #1940
      • +
      • Added option --duration-log.statistics <BOOL> which causes average vehicle trip data to be + printed in verbose mode + (average route length, travel time and time loss, ...) for quick + evaluation of a scenario. #1911
      • +
      • The option --max-num-vehicles <INT> can now be used to maintain a constant number of + vehicles in the network. Vehicle insertions are delayed whenever + this number would be exceeded. Previously this option would + terminate the simulation when the number was exceeded. To avoid + a large number of delayed vehicles it is recommended to use the + option --max-depart-delay <TIME>. #1958
      • +
      • Traffic detectors which are generated for actuated traffic lights now support additional parameters + to allow writing output files the same way as regular detectors. #1839
      • +
      • Angles in simulation output and TraCI results now conform to + Navigational Standards with 0 pointing towards the North and + 90 pointing due East. #1372
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • NETEDIT is now open. Have fun.
      • +
      • Int and float options can now be set in the + Processing->Options dialog.
      • +
      • Added many lane- and junction-coloring modes already known from + SUMO-GUI. #1756
      • +
      • Pedestrian crossings are now supported when editing traffic + light plans.
      • +
      • Attributes of pedestrian crossings can now be modified.
      • +
      • Added context-menu option for removing intermediate geometry + points from selected edges. #1913
      • +
      • Vehicle class permissions can now be edited via check-boxes + instead of typing all class names. #1909
      • +
      • Individual lanes and selections of lanes can now be deleted when + unchecking Select edges. #1895
      • +
      • A lane (or a selections of lanes) can now be duplicated by + selecting Duplicate lane from the context menu. #1896
      • +
      • Selection Mode now allows additional operators when matching against a + non-numerical attribute. #1923
      • +
      • Added new option Copy edge name to clipboard to the lane + popup-menu.
      • +
      • Junction attribute keepClear is now supported.
      • +
      • Custom junction shapes can now be drawn by selecting Set custom + shape from the junction popup-menu. This will create a + modifiable shape outline. The popup-menu of this outline allows saving, discarding and simplifying the shape.
      • +
      • Added reload menu option. #2029
      • +
      • When editing traffic light plans, states can now be set for multiple links and multiple phases at the same time.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Persons can now be tracked by selecting Start Tracking from + the context menu. #1779
      • +
      • The current route of pedestrians can now be shown by selecting + Show Current Route from the context menu. #1906
      • +
      • Error messages can now by clicked for jumping to the referenced + simulation object (i.e. a teleporting vehicle). #900
      • +
      • Added person statistics to network parameter dialog. #1898
      • +
      • Added new menu option Edit->Open in Netedit for opening the + current network (at the current location) in + NETEDIT.
      • +
      • Added new option Copy edge name to clipboard to the lane + popup-menu.
      • +
      • Added new options Close edge and Close lane to the lane + popup-menu. This will force vehicles (with an assigned vClass) + to wait until the corresponding lanes have been reopened (also + via popup-menu).
      • +
      • Added new option Add rerouter to the lane popup-menu. This + will make vehicles recompute their route when entering that + edge.
      • +
      • The size and color of link indices can now be customized (old + gui settings files + may have to be updated).
      • +
      • Average trip data (for completed vehicle trips) is now available + in the network parameter dialogue when running with option --duration-log.statistics.
      • +
      • Added new junction visualization option draw + crossings/walkingareas. #1899
      • +
      • Vehicles can now be colored by depart delay (the differences + between desired and actual depart time). Depart delay was also + added to the vehicle parameter dialog. #1970
      • +
      • Junction shapes are no longer drawn when their color is set to + fully transparent.
      • +
      • The network version is now shown the the network parameter + dialog.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Zipper merging is + now supported via the new node type zipper. #1292
      • +
      • Right-turn-on-red + is now supported via the new node type traffic_light_right_on_red. #1287
      • +
      • Importing .inpx VISSIM networks is now supported. + Thanks to the AIT for their + contribution.
      • +
      • The positioning and presence of internal junctions + can now be customized with the new connection attribute contPos. #2016
      • +
      • The maximum number of connections per junction was raised from + 64 to 256.
      • +
      • Added options --geometry.remove.keep-edges.explicit <STRING> and --geometry.remove.keep-edges.input-file <FILE> to exclude edges from being modified when + using option --geometry.remove. #1929
      • +
      • When specifying multiple connections from the same edge to the same target lane, + safe right-of-way rules are now established among the + conflicting connections. #1859
      • +
      • Added options --tls.cycle.time <TIME> to ensure that heuristically generated traffic + light plans have a fixed cycle length. The new default is 90 + (s) which will have no effect on most 4-arm intersections but + will cause different timings for controlled 3-arm intersections + and other types. #1942
      • +
      • Added options --edges.join <BOOL> to select whether edges that connect the same + nodes (and have similar geometry) shall be joined into an edge + with multiple lanes. The new default is false (before, this + heuristic was always active). #1930
      • +
      • Street names are now imported form + OpenDrive.
      • +
      • Now including sumo edge-ids in OpenDrive export + if option --output.original-names is given (as <userData sumoId="sumo_edge_id"/>).
      • +
      • Now using more lane types in OpenDrive export.
      • +
      • Added option --default.junctions.radius <FLOAT> for setting the default radius of + nodes. #1987
      • +
      • Added option --tls.left-green.time <TIME> to configure the default duration for the + dedicated left-turn phase. A value of 0 disables building this + phase. #1949
      • +
      • Added option --sidewalks.guess.exclude <STRING> to prevent guessing a sidewalk for the given list + of edges.
      • +
      • Added option --junctions.internal-link-detail <INT> for setting the number of geometry points for + lanes within intersections (Before, this was hard-coded as 5). #1988
      • +
      • Added option --crossings.guess.speed-threshold <FLOAT>. This allows setting the speed threshold above + which crossings will not be generated at uncontrolled nodes + (before this was hard-coded to 13.89m/s). #1819
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Added option --fill <BOOL> to control whether polygons are filled by default + or not. #1858
      • +
      • Added option --shapefile.fill <STRING> to override the fill state when importing + shapefiles. Allowed values are [auto|true|false].
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • It is now possible to select individual vehicles, to examine + their parameters, track them and show their route just like for + SUMO-GUI. #1932
      • +
      • Vehicles can now be located as in + SUMO-GUI. #1487
      • +
      +
    • +
    +
      +
    • Tools
        +
      • traceExporter.py now supports + exporting traces of persons when using the new option --persons <BOOL>.
      • +
      • Added option --ignore-gaps <BOOL> for + traceExporter.py. When this is + set vehicles will not be destroyed until the end of the fcd-file + even when disappearing for a few simulation steps..
      • +
      • The osmWebWizard.py + import script is now more robust in finding a suitable output + directory and recovering from errors.
      • +
      • Added new tool + tlsCoordinator.py + which coordinates traffic lights in a network for a given + traffic demand in order to create green waves for many vehicles.
      • +
      • Connection objects from networks parsed via + Sumolib can now return + getTLLinkIndex as well as getJunctionIndex. #2048
      • +
      +
    • +
    + +

    Other#

    + + +
      +
    • NETCONVERT
        +
      • Network version is now 0.25. New features that justify the + version change are:
          +
        • New linkstate Z and junction type zipper for zipper + merging.
        • +
        • New junction type traffic_light_right_on_red. To + accommodate this type of junction, linkstate 's' (stop) is + now allowed in traffic light plans.
        • +
        • Multiple connections to the same lane do not result in a + warning any more. (The conflict is resolved using zipper + merging or priority right of way)
        • +
        • New network attributes lefthand, junctionCornerDetail + and junctionLinkDetail
        • +
        • Note, that the network version should have been updated in + 0.23.0 due to the introduction of ships but this was + forgotten.
        • +
        +
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • The visualization options Show internal edge name and Show + crossing and walkingarea name were moved from the Streets-tab + to the Junctions-tab.
      • +
      +
    • +
    +
      +
    • Tools
        +
      • extractRouteEdges.py was removed as the functionality is now + fulfilled by + route2sel.py.
      • +
      • server.py was renamed to + osmWebWizard.py and now resides + directly within the tools folder.
      • +
      +
    • +
    +
      +
    • Misc
        +
      • start-commandline-bat now adds python (python 2.7 in it's + default install location) and <SUMO_HOME>/tools to the path.
      • +
      • Simplified runner script of + Tutorials/TraCI4Traffic_Lights
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 08 January 2020 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.25.0_to_Version_0.26.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,650 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.25.0 to Version 0.26.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.25.0 to Version 0.26.0
    + + + +

    Version 0.26.0 (19.04.2016)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed crash when rerouting a large number of vehicles in + parallel. #2169, #2180
      • +
      • Fixes related to zipper nodes.
          +
        • Fixed deadlock #2075
        • +
        • Fixed collision #2165
        • +
        • Fixed undesired non-determinism.
        • +
        +
      • +
      • Fixed collision of a vehicle with itself when departing at an + edge that forms a tight circle. #2087
      • +
      • Fixed bug that was causing wrong vehicle counts in summary + output and was preventing + the simulation from terminating automatically when continuing + from a loaded state. #1494
      • +
      • Fixed route errors and crashing when continuing from a loaded + state and using routing + devices. #2102
      • +
      • Fixed bug that was causing false positives when calling + traci.inductionloop.getLastStepVehicleIds and + traci.inductionloop.getLastStepVehicleNumber. #2104
      • +
      • Induction loop + detectors + now count vehicles which occupy the detector position during + insertion.
      • +
      • Fixed collisions when using using continuous lane-changing.
      • +
      • Fixed bug that was causing erratic emission behavior for stopped + vehicles when using the PHEMlight emission + model. #2109
      • +
      • Fixed unsafe traffic light plans when building networks without + exclusive left-green phase. #2113
      • +
      • When using the striping + model, + pedestrians now avoid moving with near-zero speed. #2143
      • +
      • Fixed pedestrian collisions. #2145
      • +
      • Intersections with more than 64 connections can now be loaded.
      • +
      • When approaching a + double-connection + vehicles now prefer the lane with the prioritized connection. #2160
      • +
      • Fixed collision at + double-connection. #2170
      • +
      • The default vehicle class is now passenger when using the default vehicle + type DEFAULT_VEHTYPE. #2181
      • +
      • Fixed stuck vehicles when teleporting past an closed edge with a + rerouter. #2194
      • +
      • Fixed invalid route lengths in + tripinfo-output. #2201
      • +
      • Rerouters rerouters that + combine closingReroute and destProbReroute now only apply to vehicles that are affected by + the closed edges. #2208
      • +
      • Rerouting devices can now + be specified with generic + parameters. #2209
      • +
      • Fixed invalid waiting position of pedestrians after walking. #2220
      • +
      • Fixed detector data for teleporting vehicles. #1452
      • +
      • Fixed meandata for circular networks. #1032
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed bug that was causing slightly exaggerated exit times to be + shown when activating Show Link Items from the vehicle context + menu. #2022
      • +
      • Fixed flickering brake lights due to small random decelerations. #2177
      • +
      • Areal + detectors + can now be hidden by setting their size exaggeration to 0.
      • +
      • Fixed invalid occupancy value for lane area + detectors + (was exaggerated by a factor of 100). #2217
      • +
      • Fixed crashing related to showing and tracking parameters of + arrived vehicles. #2226, #2227
      • +
      • Fixed glitch when drawing rail carriages on edges with + customized length. #2192
      • +
      • Fixed coordinate update without mouse movement. #2076
      • +
      • Fixed time display switch in initial view. #2069
      • +
      • Vehicle shape and size are now correctly updated when set via + TraCI. #2791
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Fixed bug that broke --meso-multi-queue behavior (regression in 0.25.0). #2150
      • +
      • vClass-specific speed limits are now used. #2205
      • +
      • tripinfo-output now contains valid timeLoss values. #2204
      • +
      • Fixed invalid travel time computation during simulation routing + (was averaging segments instead of vehicles).
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • Fixed crash. #2187
      • +
      • Coloring vehicles by selection is now working. #2149
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed bug that made it impossible to modify numerical attributes + (lane numbers, phase duration etc.) on some computers. #1966
      • +
      • Fixed error when modifying signal plans for joined traffic + lights. #2185
      • +
      • Fixed invalid edge length attribute when inspecting networks + without internal links. #2210
      • +
      • Fixed bug where junctions with uncommon shapes could not be + selected.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed bug that was causing unsafe internal + junctions + to be built. #2086, #2097
      • +
      • Fixed bug that was causing z-information to become corrupted. + Thanks to Mirco Sturari for the patch.
      • +
      • Fixed bug where pedestrians never got the green light when + loading a .net.xml file and adding pedestrian crossings.
      • +
      • Fixed bug where pedestrian walkingarea edges were missing. + (This could cause invalid routes to be generated). #2060
      • +
      • Multiple connections from the same edge to the same target lane + can now be set in post-processing (i.e. after removal of + geometry-like nodes). #2066
      • +
      • Option --tls.guess-signals now respects option --tls.unset. #2093
      • +
      • Fixed invalid traffic light plans for networks with pedestrian + crossings. #2095
      • +
      • Loading custom traffic light + plans + now correctly affects the building of internal + junctions. #2098
      • +
      • Several fixes in regard to OpenDrive networks:
          +
        • Added missing contactPoint attribute when writing + OpenDrive networks.
        • +
        • Fixed geometry of lanes within intersections when writing + OpenDrive networks.
        • +
        • Fixed geometry of lanes when importing imprecise + OpenDrive networks #2085.
        • +
        +
      • +
      • Option --street-sign-output now writes xsd-conforming + output.
      • +
      • Fixed bugs that were causing invalid TLS plans to be generated + for joined traffic lights. #2106, #2107
      • +
      • Fixed crash when importing OSM networks related to self-looping + edges. #2135
      • +
      • Fixed bug that was causing invalid junction shapes and extremely + large network boundaries. #2141
      • +
      • Fixed crashing (on Windows) and invalid traffic lights (Linux) + when loading a .net.xml file and adding splits. #2147
      • +
      • Fixed invalid connections at edges with vClass-exclusive lanes. #2157, #2158
      • +
      • Fixed invalid traffic light plans for node type traffic_light_right_on_red. #2162
      • +
      • Fixed unsafe junction logic when using custom tls plans with + node type traffic_light_right_on_red. #2163
      • +
      • Connections from lanes that are added during ramp guessing can + now be specified. #2175
      • +
      • User-defined connections are no longer discarded at guessed + ramps. #2196
      • +
      • Fixed error when guessing overlapping off-ramps. #2213
      • +
      • Fixed error when computing edge shapes with unusual input + geometries. #2218
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Multiple fixes to the C++ TraCI + library
          +
        • commands gui.setScheme, gui.getScheme, + inductionloop.getVehicleData
        • +
        • various set-commands were not consuming all result bytes + and thus corrupted the message stream. Thanks to Alexander + Weidinger for the patch. #2007
        • +
        +
      • +
      • Fixes to TraaS functions Simulation_getDistance2D and + Simulation_getDistanceRoad. #2127
      • +
      • Fixed crash when using vehicle command move to VTD. #2129
      • +
      • vehicle command move to VTD can now position vehicles on + internal lanes. #2130
      • +
      • Commands that return the road distance no longer return an + exaggerated value in networks without internal links (distances + across intersections were counted twice).
      • +
      • vehicle command distance now takes the depart position into + account (was using 0 before). #2203
      • +
      +
    • +
    + +

    Enhancements#

    + +
      +
    • SUMO-GUI
        +
      • Adjusted zooming distance when centering on simulation objects + to make objects easier to find. #2146
      • +
      • Added option --waiting-time-memory <TIME> for tracking accumulated waiting time of vehicles. + The accumulated waiting time (seconds of waiting time within the + configured interval, default 100s) can be inspected in the + vehicle's parameter window and the vehicles can be colored + according to this value. #999
      • +
      • Lanes can now be colored by routing device assumed speed. This + is an exponential moving average of mean travel speeds used for + dynamic rerouting. #2189
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Added option --meso-tls-penalty <FLOAT> as an alternative way to model the delay effects + of traffic lights. When this option is set to a positive value, + the expected delay time for each controlled link (based on red + duration and cycle duration) is added to the travel time, + multiplied with the <FLOAT> argument. By calibrating the parameter, the + quality of TLS coordination can be modeled. #2199
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • Coloring vehicles by depart delay is now working. Added + depart delay to the vehicle parameter dialog.
      • +
      • Added event time, entry time and block time to the vehicle + parameter dialog. These values record when a vehicle leaves, + entered and was blocked on an edge segment.
      • +
      +
    • +
    + +
      +
    • POLYCONVERT
        +
      • Added default typemaps similar to netconvert. #1853
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Added person trips and + IntermodalRouting
      • +
      • When a flow has a stop definition with attribute until, the time is + shifted for each successive vehicle in the flow. #1514
      • +
      +
    • +
    +
      +
    • MAROUTER
        +
      • Added bulk routing and better OD cell handling for speed + improvements. #2167
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • The python + client is now + thread safe when using multiple connections in parallel. Each + opened connection returns an independent TraCI instance. #2091
      • +
      • Added support for vehicle commands to the C++ TraCI + library Thanks to Alexander + Weidinger for the patch. #2008
      • +
      • Added new TraaS + commands + Edge.getLastStepPersonIDs, Person.getNextEdge, + Vehicle.getRouteIndex, Vehicle.getStopState, Vehicle.isStopped + and some more stop-related vehicle commands.
      • +
      • The angle argument of vehicle command move to + VTD + now overrides the vehicle angle for drawing and + fcd-output. #2131
      • +
      • Added new simulation command save state + 0x95 + for saving the current simulation state. #2191
      • +
      +
    • +
    +
      +
    • Tools
        +
      • tls_csv2SUMO.py now + handles controlled edges within a joined traffic light + definition automatically.
      • +
      • Added option --ignore-connections to + netcheck.py. This can be + used to compute all components in the node graph without + considering lane-to-lane connections.
      • +
      • Added option --symmetrical to + generateBidiDistricts.py + (previously undocumented tool). This can improve + opposite-finding in conjunction with option --radius.
      • +
      • Added option --geo to + route2poly.py. This can + be used to visualize routes from one network within another + network.
      • +
      +
    • +
    +

    Other#

    +
      +
    • Miscellaneous
        +
      • Visual Studio project files have been updated MSVC12. While it + is still possible to build SUMO with MSVC10, this support may be + dropped in the future in favor of C++11.
      • +
      +
    • +
    +
      +
    • Simulation
        +
      • When saving simulation + state as XML, lane + elements now contain their id for easier inspection.
      • +
      • The + departPos + values maxSpeedGap, pwagSimple and pwagGeneric were removed since they never worked as intended.
      • +
      • Option lanechange.allow-swap is now deprecated.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Vehicle type parameters were moved to a separate dialog box + (Show Type Parameter). #2133
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI version is now 11.
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.26.0_to_Version_0.27.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,529 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.26.0 to Version 0.27.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.26.0 to Version 0.27.0
    + + + +

    Version 0.27.0 (12.07.2016)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Attribute via is now used when routing trips and flows within the + simulation. #1272
      • +
      • Vehicles stopping at a <stop> now reach the exact location when using + sub-second step-lengths. #1224
      • +
      • Vehicles are no longer considered stopped at a <stop> while still + driving with high speed. #1846
      • +
      • Scheduled + stops + no longer count towards waitSteps and timeLoss in + tripinfo-output. #2311
      • +
      • Fixed bug where vehicles would not depart from a triggered stop #2339
      • +
      • Fixed deadlock when vehicles with triggered stops could not load + passengers or containers due to capacity constraints.
      • +
      • Fixed invalid edge travel times used for dynamic routing in case + flow differs among the lanes. #2362
      • +
      • Fixed invalid edge travel times used for dynamic routing due to + invalid averaging #2351
      • +
      • Fixed invalid time stamps for leave times and an off by one for + instant induction loops #1841
      • +
      +
    • +
    +
      +
    • MESO
        +
      • The jam-front back-propagation speed now reaches realistic + values (it was illogically low before). Note that default value + of option --meso-taujj changes as well as it's semantics. #2244
      • +
      • Fixed bug where the simulation would not terminate when using + calibrators. #2346
      • +
      • The options --meso-tauff and --meso-taufj now define net time gaps (default values were + changed accordingly). The gross time gaps are computed based on + vehicle lengths and edge speed to allow for more realistic flow + in networks with widely varying speed limits. This also affects + the threshold that defines jamming when using default options + (thresholds based on allowed speeds). #2364
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed connection-guessing heuristic. #1992, #1219, #1633, #2398
      • +
      • Option --remove-edges.by-vclass is now working when loading a .net.xml file. #2280
      • +
      • Fixed bugs when importing cycleways from OSM. #2324
      • +
      • Option --output.original-names now records original edge ids even if input edges were + joined. #2369
      • +
      • Fixed invalid road types when exporting OpenDRIVE networks. #2487
      • +
      • Fixed invalid lane permissions due to invalid removal of + geometry-like nodes. #2488
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed crash when loading a large number of background images.
      • +
      • Fixed persons showing up too early in the locator. #1673
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed crash when trying to set an empty string as edge length or + edge width. #2322
      • +
      • Fixed crash when deleting the last lane of an edge.
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Trips and flows that use attribute via to loop over the destination + edge more than once are now working. #2271
      • +
      +
    • +
    +
      +
    • MAROUTER
        +
      • The output is now correctly sorted when using trips as input. #2361
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Polyconvert output files can now be imported again by + Polyconvert (i.e. for further transformations). #1715
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed route.add, gui.screenshot and gui.trackVehicle and + various lane commands for the C++ TraCI API + client
      • +
      • Fixed crash when trying to set invalid routes. #2285
      • +
      • Fixed invalid values when retrieving edge mean speed and edge + travel time in case flow differs among the lanes. #2362
      • +
      • Fixed retrieval of exit times for vehicles that spend multiple + steps on an inductionloop when retrieving last step vehicle + data (0x17). #2326
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added model for + sublane-simulation. This is + activated by setting the option --lateral-resolution <FLOAT>. When using this option, + vehicles may move laterally within their lanes. This is + influenced by the new vType-attributes latAlignment, + maxSpeedLat, + minGapLat. + Lane changing is performed according to the new lane changing + model + SL2005.
      • +
      • Lane-changing models can now be configured with additional vType + parameters. There exists one parameter for each of the + lane-changing + motivations + strategic,cooperative,speedGain and keepRight which can be + used to increase or reduce that type of lane changing. #1136
      • +
      • Added capabilities for overtaking through the + opposite-direction + lane.
      • +
      • Added new option --collision.action <STRING> for configuring the action to take on vehicle + collision. Allowed actions are none,warn,teleport and + remove. The default is teleport which moves the rear vehicle + involved in a collision onto a subsequent lane (as before).
      • +
      • Added new option --collision.check-junctions <BOOL> to enable geometrical collision checking on + junctions. By default this option is set to false and + collisions between non-consecutive lanes are ignored as before. + This option may slow down the simulation. #984
      • +
      • ChargingStations can now be used to declare vehicle + stops. #2248
      • +
      • the vehicle route + output now includes + optional vehicle parameters as param entries
      • +
      • Added new option --device.rerouting.adaptation-steps <INT> to switch the default algorithm for averaging + edge travel times from exponential averaging to a moving average + over the given number of steps. #2374
      • +
      • Added new option --tls.all-off <BOOL> for switching off all traffic lights (the + traffic lights can still be switched on via GUI or TraCI). #2442
      • +
      • Added new output for tracking lane change + events. This is + enabled using the new option --lanechange-output <FILE>. #2461
      • +
      +
    • +
    +
      +
    • MESO
        +
      • The option --meso-jam-threshold <FLOAT> now gives additional freedom when configuring a + speed dependent jam-threshold. When an value below 0 is given + the absolute value is taking as a factor for the minimum + unjammed speed. Thus, negative values closer to 0 result in less + jamming. The default value remains at -1 and results in the + original behaviour (values above 0 set the occupancy fraction + threshold independent of edge speed as before).
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • The number of running vehicles and persons is now shown in the + status bar. This display also acts as a button for opening the + network parameter dialog. #1943
      • +
      • Charging + stations are now + shown in a different color when active.
      • +
      • Persons are now more visible when selecting Draw with constant + size when zoomed out.
      • +
      • Added the averaged speeds that are used for simulation + routing to the lane + parameter dialog.
      • +
      • Added new option --demo <BOOL> which automatically reloads and starts the + simulation every time it ends. #1645
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • Can now color edges by the averaged speeds that are used for + simulation routing.
      • +
      • Can now color edge segments (mesoscopic vehicle queues) + individually by various traffic measures. #2243
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Added option default.lanewidth <FLOAT> for setting the default width of lanes (also + applies to NETGENERATE).
      • +
      • Added option numerical-ids <BOOL> for forcing all node and edge IDs to be integers + (also applies to NETGENERATE). #1742
      • +
      • Added Option speed.minimum to avoid negative speeds when using Option --speed.offset. #2363
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Many additional network structures such as busStops, detectors + and variable speed signs can now be defined and manipulated. #1916
      • +
      +
    • +
    +
      +
    • NETGENERATE
        +
      • Added option grid.alphanumerical-ids <BOOL> for using a chess-like intersection naming scheme + (A1, B3, etc).
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Added vehicle + command next TLS to + retrieve upcoming traffic lights along a vehicles route. #1760
      • +
      • The vehicle + command + move to XY (formerly move to VTD) now supports an additional + flag which selects whether the original route shall be kept or + the route may change and whether the vehicle may leave the road + network. #2033, #2258
      • +
      • The vehicle + command + move to XY now allows moving vehicles that are still in the + insertion buffer.
      • +
      • Added functions vehicle.add, vehicle.remove and + vehicle.moveToXY to the C++ TraCI API + client
      • +
      • Added object variable subscriptions and context subscriptions to + the C++ TraCI-library (subscribe, getSubscriptionResults, + subscribeContext, getContextSubscriptionResults). Thanks to + Erik Newton for the patch.
      • +
      • Added person value retrieval functions to the C++ TraCI API + client. Thanks to Caner Ipek + for the patch.
      • +
      • Added vehicle + command get + speedmode 0xb3 to retrieve the speed + mode + of vehicles. #2455
      • +
      • Added vehicle + command get slope + 0x36 to retrieve the slope at its current position #2071
      • +
      • Added vehicle, + lane and + edge command get + electricity consumption 0x71 to retrieve the electricity + consumption if the emission model supports it. #2211
      • +
      • Multiple subscriptions for the same object are now merged. #2318
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Added new tool + createVehTypeDistributions.py + to simplify definition of heterogeneous vehicle fleets by + sampling numerical attributes from configurable distributions. + Thanks to Mirko Barthauer for the contribution.
      • +
      • parsing xml files with + sumolib.output.parse() is now much + faster. #1879
      • +
      +
    • +
    +

    Other#

    + +
      +
    • NETCONVERT
        +
      • Network version is now 0.27.0
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI version is now 12.
      • +
      • The vehicle command + move to VTD is now referred to as move to XY in client code. #2032
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.0_to_Version_0.27.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.27.0 to Version 0.27.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.27.0 to Version 0.27.1
    + + + +

    Version 0.27.1 (27.07.2016)#

    +

    Bugfixes#

    +
      +
    • NETCONVERT
        +
      • Original IDs are no longer lost when splitting edges. #2497
      • +
      • Elevation data is now correctly imported from OpenDRIVE + networks. #2239
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed crash when increasing the number of lanes by setting + numLanes. #2505
      • +
      • Fixed slow loading of large networks.
      • +
      • Custom colors for selected junctions and edges are now working. #2386
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed crash when using option --ignore-error with invalid via-edges. #2494
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added new option save-state.period <TIME> to save simulation state periodically. #2441
      • +
      • Added new option save-state.suffix <STRING> to determine the suffix of saved state files. + The default is .sbx which saves in a binary format. + Alternatively, .xml may be used which makes the state files + human-readable.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Networks exported to OpenDRIVE now use parametric curves to + represent smooth geometry in place of straight-line segments. #2041
      • +
      • Networks exported to OpenDRIVE now contain elevation data. #2240
      • +
      • Parametric curves as specified in OpenDRIVE version 1.4 can now + be imported. #2478
      • +
      • Revised default OpenDRIVE typemap. Now imports additional lane + types such as tram and rail. #2492
      • +
      • Added new option osm.layer-elevation <FLOAT> to import implicit elevation data from + OSM-layering + information.
      • +
      • Networks imported from OpenDRIVE now contain edge type + information based on the OpenDRIVE lane types. #2509
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added Visualization options for drawing intersections with + exaggerated size and disable edge drawing based on custom + widths. #2140
      • +
      • Added Visualization option for indicating the driving direction + of lanes. #2180
      • +
      • Added Visualization option for drawing sublane + boundaries
      • +
      • Lanes can now be colored according to the number of vehicles + that are delayed from entering the network. #2489
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Added Visualization options for drawing intersections with + exaggerated size and disable edge drawing based on custom + widths. #2140
      • +
      • Added Visualization option for indicating the driving direction + of lanes. #2180
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.27.1_to_Version_0.28.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,489 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.27.1 to Version 0.28.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.27.1 to Version 0.28.0
    + + + +

    Version 0.28.0 (01.11.2016)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed bug that was causing insufficient overtaking on a + single-lane road when using sublane simulation (most noticeable + with small step-lenghts). #2518
      • +
      • Fixed invalid count of insertion-backlog for flows. #2535
      • +
      • Added check for possibility to stop at scheduled stops during + insertion. #2543
      • +
      • Fixed invalid timeLoss values in + tripinfo-output (last + step was counted twice for some vehicles).
      • +
      • Fixed bug that would prevent a vehicle from reaching the end of + it's route after rerouting while being teleported. #2554
      • +
      • Fixed erroneous detector output for a special situation. #2556
      • +
      • Fixed computation of energy loss for subsecond simulation. #2559
      • +
      • Fixed crash when using + closing-rerouters + that prevent vehicles from departing after being loaded (related + to #2561).
      • +
      • Fixed invalid permissions when using multiple + closing-rerouters + that modify permissions of the same edge #2560.
      • +
      • Fixed crash when using the sublane model with varying lane + widths. #2585
      • +
      • The option --ignore-errors now properly ignores vClass-related errors. #2148
      • +
      • Vehicles are now properly angled during lane-changing in + sublane-simulation. #2525
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Tripinfo-output now has appropriate timeLoss values. #2570
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed invalid lane permissions when setting lane-specific + attributes without specifying lane-specific permissions. #2515
      • +
      • Fixed invalid elevation values at junctions when importing + OpenDRIVE networks.
      • +
      • Fixed crash when importing OpenDRIVE networks.
      • +
      • Fixed invalid internal-lane geometries when exporting OpenDRIVE + networks. #2562
      • +
      • Fixed various specification conformity issues when exporting + OpenDRIVE networks.
      • +
      • Option --street-sign-output now only generates signs at real intersections.
      • +
      • Fixed error when loading a .net.xml file and patching lane + numbers with an .edg.xml file. #2459
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • The visulization option show lane borders is now working.
      • +
      • Fixed crash when user loads an empty E3 detector #2249
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Geometry nodes are no longer drawn when set to full transparency + (alpha = 0).
      • +
      • Geometry nodes are now colored for selected edges.
      • +
      • All textures are now loaded instead of a white square or a + netedit crash. #2594 #2476 #2597
      • +
      +
    • +
    + +
      +
    • TraCI
        +
      • Vehicles added via method add() of the python client now have + the correct departDelay value. #2540
      • +
      • Vehicle type value retrieval via the C++ API is now working.
      • +
      • Setting and retrieving edge travel times and efforts via the + C++ API is now working.
      • +
      • It is now possible to specify routes that contain + TAZ-edges. #2586
      • +
      +
    • +
    +

    Enhancements#

    + +
      +
    • NETEDIT
        +
      • Added new option --new <BOOL> for starting with an empty network.
      • +
      • Added new option --window-size <INT>,<INT> for specifying the initial window size. #2514
      • +
      • Junction attribute tltype is now supported.
      • +
      • Joined TLS can now be defined by setting the junction attribute + tl following the same rules as in .nod.xml files. #2389
      • +
      • Added support for restricted lanes (Sidewalks, buslanes and + bikelanes). #1568
      • +
      • Now junction visualization can be toggled between bubbles and + their real shape when in Move-mode.
      • +
      • Connections can now be shown in inspect mode (by activating a + check-box) and their attributes can be edited. They can also be + selected in select-mode and deleted in delete mode. When + inspecting edges or lanes, controls for accessing their + connections are now available. #2067
      • +
      • Now delete mode has a frame with information and options for + deleting. #2432
      • +
      • Intervals of Rerouters can be edited using a dialog #2480
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added new option --window-size <INT>,<INT> for specifying the initial window size. #2514
      • +
      • Added new visualization setting for drawing right-of-way rules + (colored bars).
      • +
      • Background images (decals) now + support the new Boolean attribute screenRelative. When set to + true, position and size are relative to the drawing window + instead of being relative to the network. #2438
      • +
      +
    • +
    + +
      +
    • DFROUTER
        +
      • Vehicle types are now included in the + emitters-output + by default. The new option --vtype-output <FILE> allows redirection the vTypes into a + separate file.
      • +
      • If the average measured speeds are systematically above the + speed limit of the respective roads, the written vTypes use + attribute + speedFactor + to reflect systematic speeding.
      • +
      • Added new option --speeddev <FLOAT> to set a speed deviation + for the generate vTypes
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Added new convenience function traci.start that automatically + selects a port, starts sumo on that port and connects. #2236
      • +
      • Added new get/set command height (0xbc) to retrieve and modify + vehicle height (applicable to vehicles and vehicle types). #2573
      • +
      • When adapting edge travel times and efforts, the (optional) + parameters begin and end are now supported by the python client and the + C++ client. #2584
      • +
      +
    • +
    +
      +
    • Tools
        +
      • The tool + route_departOffset.py + (previously undocumented) now supports additional options for + departure time modification based on departure edge and for + shifting departures within one time interval to another + interval. #2568
      • +
      • randomTrips.py supports the new alias --edge-permission for former option --vclass.
      • +
      +
    • +
    +

    Other#

    + +
      +
    • TraCI
        +
      • TraCI version is now 13
      • +
      +
    • +
    +
      +
    • Miscellaneous
        +
      • The full 24h-dataset for the + TAPASCologne scenario + is now available
      • +
      • The deprecated option --lanechange.allow-swap is no longer supported. #2116
      • +
      • The laneChangeModel="JE2013" has been removed due to strong similarity with LC2013. + Using the model is deprecated and now defaults to LC2013
      • +
      • SUMOPy has been added to the + SUMO repository and to the relase. Many thanks to Joerg + Schweizer.
      • +
      • The libraries for the Windows build and release were updated to + Fox 1.6.52 and Xerces-C 3.1.4 (with an additional fix for + XERCESC-2052)
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.28.0_to_Version_0.29.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,602 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.28.0 to Version 0.29.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.28.0 to Version 0.29.0
    + + + +

    Version 0.29.0 (16.02.2017)#

    +

    Bugfixes#

    + +
      +
    • NETCONVERT
        +
      • Fixed errors when exporting elevation data to OpenDRIVE. #2641
      • +
      • Fixed format conformity issues when exporting OpenDRIVE + networks. #2673, #2674, #2682
      • +
      • Networks exported in the DlrNavteq format are now written + with --numerical-ids by default.
      • +
      • Fixed crash when importing OpenDrive and using edge-removal options. #2685
      • +
      • Improved connection guessing at roads with a lane reduction.
      • +
      • Fixed crash when specifying a + <split>-element + for a roundabout-edge. #2737
      • +
      • The option --geometry.max-segment-length is now working when importing OSM data. #2779
      • +
      • Improved heuristic for option osm.layer-elevation to reduce unrealistic up-and-down + geometries.
      • +
      • Fixed steep grades near intersections in networks with + 3D-geometry. #2782
      • +
      • Geometry fixes for output in DlrNavteq format. #2785, #2786
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Fixed crash when doing undo/redo connection changes at a newly + created junction. #2662
      • +
      • Fixed slow operation when switching between move-mode and other + modes in a large network.
      • +
      • Fixed slow operation when move junctions in large networks. #2699
      • +
      • Selecting objects by matching against attributes now works on + windows. #2675
      • +
      • Fixed crash when setting custom geometry endpoinds. #2693
      • +
      • Fixed shortcuts #2694
      • +
      • Fixed crash when using option --numerical-ids.
      • +
      • Fixed visualization errors when using --offset.disable-normalizaton false
      • +
      • When adding sidewalks to selected lanes, pedestrians are now + automatically forbidden on the other lanes. #2708
      • +
      • Fixed an inconsistency with the definition of SUMO Time in + Inspector mode. #2625
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed bug that was causing interface lag when right-clicking in + networks with detailed geometry.
      • +
      • Configuring the visualisation of generated induction loops for + actuated traffic lights + is now working. #2639
      • +
      • Fixed crash when coloring lanes by occupancy. #2850
      • +
      +
    • +
    +
      +
    • MESO
        +
      • when using option --meso-tls-penalty the maximum flow at controlled intersections + is now scaled according to fraction of available green time. #2753
      • +
      • Fixed various issues related to inconsistent handling of net and + gross time gaps. This was causing exaggerated speeds. The option + --meso-taujf <TIME> now corresponds to the net time-gap (as do --meso-taufj, --meso-tauff). It's default + value has been reduced from 2.0 to 1.73 correspondingly + (reproducing the old behavior at 100km/h).
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • Fixed invalid coloring of the gap between lanes. #1428
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • The default vehicle class is now passenger (as in the + simulation). Note, that non-passenger classes such as trains now + need an explicit type definition to be able to use rail edges. #2829
      • +
      • The last vehicle from a flow is no longer missing if the flow + duration is not a multiple of the period parameter. #2864
      • +
      • Various fixes to intermodal routing functionality. #2852, #2857
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed crash when trying to reroute vehicles before their + departure.
      • +
      • Fixed inefficiency when calling vehicle.rerouteTravelTime() + multiple times per simulation step (edge weights are now updated + at most once per step).
      • +
      • Various fixes to vehicle.moveToXY mapping behavior.
      • +
      • unsubscribing now works in the python client. #2704
      • +
      • The C++ client now properly closes the simulation when calling + close()
      • +
      • Subscriptions to 2D-Positions are now working in the C++ client
      • +
      • Deleting vehicles that have not yet departed is now working. #2803
      • +
      • Brake lights and blinkers + can now be set for the current simulation step. #2804
      • +
      • Vehicle function move to XY now works for edges with custom + length. #2809
      • +
      • Vehicle function move to XY now actually uses the 'edgeID' and + 'lane index' parameters to resolve ambiguities. It uses the + 'origID' parameter if set and the lane id otherwise.
      • +
      • Function edge.adaptTravelTime(begin=... end=...) is now + working as expected with times in seconds. #2808
      • +
      +
    • +
    +
      +
    • Tools
        +
      • netdiff.py now correctly + handles changes to spreadType and other optional attributes. #2722
      • +
      • sumolib.net now returns consistent + values for edge.getShape(): the center-line of all lanes. + Previously, the raw edge shape used in netconvert was returned.
      • +
      • randomTrips.py now works + correctly when giving the options --via, --validate at the same time. #2821
      • +
      +
    • +
    + +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added definition of parking areas and functionality for + rerouting in search of a free parking space. + Many thanks to Mirco Sturari for this contribution.
      • +
      • Added new output option --stop-output <FILE> for generating output on vehicle stops (for public transport, logistics, etc.)
      • +
      • Vehicles that are inserted with departPos="last" now depart at the end of the + lane when there are no leader vehicles. This reduces the overall + variance in depart positions. #2571
      • +
      • The --step-log-output now includes statistics on time spend in TraCI functions. #2698
      • +
      • When a vClass is specified for a vehicle type, + this information is used to assign a default emissionClass from + the HBEFA3 model + (Before all vehicles had class + "HBEFA2/P_7_7" by + default, even bicycles). The default class for passenger + vehicles is now "HBEFA3/PC_G_EU4".
      • +
      • Output files of the + MultiEntryExitDetector + now include timeLoss information. #2703
      • +
      • Output files of the + LaneAreaDetector + now include timeLoss information. #2703
      • +
      • Added option --load-state.remove-vehicles ID1[,ID2]* for removing vehicles from a loaded state. #2774
      • +
      • Pedestrians now use the speedDev attribute of their type to + vary their walking speed. #2792
      • +
      • tripinfo-output + now includes the attribute speedFactor which may have been + chosen randomly when loading the vehicle.
      • +
      • Output precision is automatically increased whenever simulating + with step-lengths below 10ms. #2816
      • +
      • E1 detectors now support the attribute vTypes for collecting + type specific measurements. The attribute splitByType is no + longer supported.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added new option --window-pos <INT>,<INT> for specifying the initial window placement.
      • +
      • Added new button to the object locator dialog that allows + toggling selection status. #2687
      • +
      • Parking vehicles are now listed in the vehicle locator dialog. + This can be disabled using a new menu option. Teleporting + vehicles can optionally be listed as well #2750
      • +
      • Vehicles can now be colored by time loss (accumulated over the + whole route). The time loss is also shown in the vehicle + parameter dialog.
      • +
      +
    • +
    +
      +
    • MESO
        +
      • Added new option --meso-minor-penalty <TIME> for applying a time penalty when passing a + minor link. This may be used to model slow down on approach or + even intersection delays when running without --meso-junction-control. #2640
      • +
      • When using the option --meso-tls-penalty <FLOAT> to model mesoscopic traffic lights, the + maximum capacity of edges is now reduced according to the + proportion of green-time and cycle time at controlled + intersection. #2753
      • +
      +
    • +
    +
      +
    • MESO-GUI
        +
      • The number of queues for the current segment is now shown in the + edge parameter dialog
      • +
      • The latest headway for the current segment is now shown in the + edge parameter dialog
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Pedestrian rail crossings are now working. #2654
      • +
      • Added new option --geometry.check-overlap <FLOAT> for finding edges with overlapping lanes. This + is typically a sign of faulty inputs. The accompanying option --geometry.check-overlap.vertical-threshold <FLOAT> + filters out edges that are separated vertically by at least the + given value (default 4.0). #2648
      • +
      • The options --keep-edges.explicit, --keep-edges.input-file now allow for white-listing in combination with + other removal options (edges are kept if listed explicitly or if + any other keep-condition is met). #2680
      • +
      • Added new option --osm.oneway-spread-right <BOOL> for setting the default + spreadType + to right for one-way edges (i.e. motorways).
      • +
      • The + <split>-element + now supports the new attributes idBefore, idAfter to determine + the ids of the newly created edges. #2731
      • +
      • Added new option --reserved-ids <FILE> for loading a selecting of node and edge ids + that shall be avoided in the output network.
      • +
      • When importing networks from + DlrNavteq format, the + new option --construction-date YYYY-MM-DD can now be used to interpret the readiness of roads + under construction.
      • +
      • Networks exported to + DlrNavteq format now + contain additional information: bridge/tunnel information, form + of way, ZIP code, prohibited_manoeuvres, connected_lanes
      • +
      • Warnings are now issued when steep grades are present in the + road network. The warning threshold can be configured using the + new option geometry.max-grade <FLOAT>.
      • +
      • <laneOffset> data is now imported from OpenDrive networks
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Added new option --window-pos <INT>,<INT> for specifying the initial window placement.
      • +
      • new hotkeys implemented. #2694
      • +
      • New icons for edit modes. #2612
      • +
      • Added new button to the object locator dialog that allows + toggling selection status. #2687
      • +
      +
    • +
    +
      +
    • OD2TRIPS
        +
      • Added new option --flow-output.probability <BOOL> for generating probabilistic flows instead of + evenly spaced flows. Thanks to Dominik Buse for the patch.
      • +
      +
    • +
    + +
      +
    • TraCI
        +
      • Added functions person.getStage, person.getRemainingStages, + person.getVehicle and person.getEdges to the API, the python + client and the C++ client. #1595
      • +
      • Added functions person.add, person.appendWalkingStage, + person.appendDrivingStage, person.appendWaitingStage, + person.removeStage'', person.removeStages, person.setColor, + person.setLength, person.setHeight, person.setWidth, + person.setMinGap, person.setType and person.setSpeed to the + API, the python client and the C++ client. #2688
      • +
      • The python client now supports vehicle.getPosition3D.
      • +
      • Added the functions vehicle.getLine and vehicle.setLine to + the python client and the C++ client (to be used for public transport) #2719
      • +
      • Added the functions vehicle.getVia and vehicle.setVia to the + python client and the C++ client (affects subsequent rerouting + calls) #2729
      • +
      • Added the functions polygon.getFilled and polygon.setFilled + to the python client
      • +
      +
    • +
    +
      +
    • Tools
        +
      • route_departOffset.py + now supports additional options for departure time modification + based on arrival edge. #2568
      • +
      • sumolib.net now supports the new + function edge.getRawShape() to retrieve the shape used by + netconvert. #2742
      • +
      +
    • +
    +
      +
    • Miscellaneous
        +
      • All applications now support the option --precision <INT> to specify the output + precision as number of decimal places for floating point output. + For lon/lat values this is configured separately using option --precision.geo <INT>.
      • +
      +
    • +
    +

    Other#

    + +
      +
    • Simulation
        +
      • A warning is now issued when trying to define a vehicle with + vClass=pedestrian as this vClass should only be used for + persons. #2830
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI version is now 14
      • +
      +
    • +
    +
      +
    • Binary format
        +
      • SBX has now version number 2 #2651
      • +
      +
    • +
    +
      +
    • Miscellaneous +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.29.0_to_Version_0.30.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,526 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.29.0 to Version 0.30.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.29.0 to Version 0.30.0
    + + + +

    Version 0.30.0 (02.05.2017)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Random pedestrian decelerations (configured via option --pedestrian.striping.dawdling) are now + working. #2851
      • +
      • Loading state-files with vehicles that stop at a <busStop> is now + working. #2914
      • +
      • Fixed collisions when using the sublane model. #2295, #2924, #2154, #3005
      • +
      • Various fixes to lateral distance keeping in the sublane model.
      • +
      • Vehicles now longer drive beyond the road borders when using the + sublane model. #2988
      • +
      • Fixed crash when loading saved stated with an arriving vehicle. #2938
      • +
      • Option --load-state.offset now properly applies to vehicles departing in the future + that are part of the loaded state (i.e. due to having been + loaded from an additional file before saving). This was a + regression in version 0.29.0. #2949
      • +
      • Simulation behaviour is no longer affected by randomly equipping + vehicles with devices that only generate outputs. #2977
      • +
      • vType-attribute laneChangeModel is no longer ignored (was silently replaced + with "default", since version 0.28.0)
      • +
      • Fixed deadlock when setting vehicle attributes arrivalSpeed + and arrivalPos both to 0. #2995
      • +
      • Fixed issue where a lane-change was blocked for invalid reasons + causing deadlock. #2996
      • +
      • When using departLane="best", the look-ahead distance is now limited to 3000m for + determining suitable insertion lanes. #2998
      • +
      • loading state now writes tls states correctly #1229
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Various fixes to junction-shape computation. #2551, #2874, #1443
      • +
      • Ramp-guessing (option --ramps.guess) no longer identifies sharply turning + roads as motorway ramps.
      • +
      • Fixed invalid right-of-way rules at junctions with type + traffic_light_right_on_red when importing a net.xml file + or editing with NETEDIT. #2976
      • +
      • Networks built with option --junctions.scurve-stretch now retain their shape when imported + again. #2877
      • +
      • Networks imported from VISUM + no longer round node positions to meters. #3001
      • +
      • Loading .tll files from a network that includes node types rail_crossing or rail_signal + is now working. #2999
      • +
      • Fixed crash when applying a <split> to an edge within a roundabout. #2737
      • +
      • Fixed infinite loop when importing some OpenDRIVE networks. #2918
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • vClass-specific speed limits + are no longer lost when saving a network. #2508
      • +
      • The lane shapes induced by option --rectangular-lane-cut are no longer lost when + editing a network
      • +
      • Deleting whole edges is working again (regression in 0.29.0). #2883
      • +
      • Deleting edges and afterwards adding edges no longer creates + node type "unregulated" (without right-of-way rules). #2882
      • +
      • Fixed visual glitches when opening left-hand networks. #2890
      • +
      • Fixed various crashes. #2902, #3010, #3026, #2969
      • +
      • Fixed coloring of green-verge lanes. #2961
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed mapping failures when calling moveToXY.
      • +
      • Vehicles that are moving outside the road network due to + moveToXY calls now return the correct position and angle.
      • +
      • Function vehicle.getSpeedWithoutTraCI now correctly returns + the current speed if the vehicle is not being influenced.
      • +
      • Fixed crash when adding and erasing persons in the same step. #3014
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Restored Python3.0 compatibility for sumolib and traci + (regression in 0.29.0)
      • +
      • carFollowing child-elements of vType element are now included in + route2trips.py output. #2954
      • +
      • Fixed OSM Web Wizard problems with spaces in SUMO_HOME path. #2939
      • +
      • cutRoutes.py now writes + two independent routes instead of one containing edges not + contained in the reduced network. #3011
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • vClass-specific speed limits + can now be loaded from an additional-file. #2870
      • +
      • Refactored implementation of E2 detectors. + These may now be defined to span over a sequence of lanes, + XML-attribute cont is deprecated. #1491, #1877, #2773, #2871
      • +
      • Added traffic light type "delay_based" + which implements an alternative algorithm to type "actuated".
      • +
      • Added option --time-to-impatience <TIME> which defines the waiting time until driver + impatience grows from 0 to 1. Formerly this was tied to the + value of --time-to-teleport. #2490
      • +
      • lanechange-output now + includes the lateral gap to the closest neighbor. #2930
      • +
      • attribute speedFactor + can use normal distributions with optional cutoff to define the + distribution of vehicle speeds #2925
      • +
      • Traffic light related outputs have now + consistent camelCase XML tags.
      • +
      • Added option collision.stoptime <TIME> which lets vehicles stop for a time after + experiencing a collision before the action set via --collision.action takes place. #1102
      • +
      • Electric vehicles are now + initialized with a maximum capacity of 35kWh and and a half full + battery by default (before, the default was 0 which always made + it necessary to define this).
      • +
      • --vehroute-output now includes additional vehicle attributes such as departLane + and departSpeed to facilitate scenario replaying.
      • +
      • Increased maximum possible insertion flow when using + departLane values free,allowed or best on multi-lane + edges. #3000
      • +
      • Improvements to lateral-gap keeping when using the sublane model:
          +
        • Vehicles now attempt to equalize left and right gaps if + there is insuffient lateral space #2932
        • +
        • The semantics of attribute minGapLat where changed to define the + desired gap at 50km/h and do not grow beyond that speed + (before that threshold was at 100km/h)
        • +
        • Vehicles now ignore follower vehicles behind the midpoint of + their own length in regard to lateral gap keeping.
        • +
        +
      • +
      • Added option --max-num-teleports <INT> which can abort the simulation after a number of + teleports is exceeded. #3003
      • +
      • Added option --chargingstations-output <FILE> which generates output for + chargingStations. #2357
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Added parameters + minGapLat,maxSpeedLat,latAlignment,boardingDuration,loadingDuration,car + follow model to the vType-parameter window.
      • +
      • Added parameter acceleration to the vehicle-parameter window.
      • +
      • Added option Show type parameter dialog to the person context + menu. #2973
      • +
      • When running the simulation with option --duration-log.statistics, the average travel + speed of completed trips is shown in the network parameter + dialog.
      • +
      • For long-running simulations the time displays can now show + elapsed days. #2889
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Networks imported from + DlrNavteq-format now + process prohibited_manoeuvres and connected_lanes input + files. #738
      • +
      • Edge types are now imported from a .net.xml file. #2508
      • +
      • Added option --opendrive.curve-resolution <FLOAT> for setting the level of detail when importing + road geometries from parmeterized curves. #2686
      • +
      • Node shape computation (especially stop line position) can now + be influenced by setting edge geometries that do not extend to + the node position.
          +
        • To deal with ambiguous stop line information in OpenDrive + networks, the new option --opendrive.advance-stopline <FLOAT> may now now be used to affect the + heuristic that computes stop line positioning based on the + border between roads and connecting roads.
        • +
        +
      • +
      • Bus stops can now be imported from OpenStreetMap using the new + option --ptstop-output <FILE>. #2933
      • +
      • Lanes within a network that have no incoming connection and + edges that have no outgong connections are now reported. #2997
      • +
      • Specific lanes can now be deleted via loaded .edg.xml files + (to ensure that connections are kept as intended). #3009
      • +
      +
    • +
    + +
      +
    • TraCI
        +
      • It is now possible to reload the simulation with new options by + sending the load command.
      • +
      • Added vehicle.setMaxSpeed and vehicle.getMaxSpeed to the C++ + client. Thanks to Raphael Riebl for the patch.
      • +
      • Added vehicle.changeTarget to the C++ client.
      • +
      • To allow vehicles to run a red light, speedmode 7 can now be + used instead of 14. This is much safer as it avoids rear-end + collisions.
      • +
      • Vehicles can now stop at a named ParkingArea or ChargingStation. + The methods traci.vehicle.setParkingAreaStop, + traci.vehicle.setChargingStationStop were added to the python + client to simplify this. #2963
      • +
      • vehicle function moveToXY now supports the special angle value + traci.constants.INVALID_DOUBLE_VALUE. If this is set, the + angle will not be factored into the scoring of candidate lanes + and the vehicle will assume the angle of the best found lane. + For vehicles outside the road network, the angle will be + computed from the old and new position. #2262
      • +
      • Vehicles now support retrieval of battery device parameters and retrieval of riding persons and containers as well as retrieval of laneChangeModel parameters + using the vehicle.getParameter function.
      • +
      • Vehicles now support setting of battery device parameters and laneChangeModel parameters + using the vehicle.setParameter function.
      • +
      • Added sublane-model related vehicle functions + getLateralLanePosition, getMaxSpeedLat, getMinGapLat, + getLateralAlignment, setMaxSpeedLat, setMinGapLat, + setLateralAlignment, changeSublane. #2216, #2001
      • +
      • Added sublane-model related vehicletype + functions getMaxSpeedLat, getMinGapLat, getLateralAlignment, + setMaxSpeedLat, setMinGapLat, setLateralAlignment. #2216
      • +
      • Function edge.getLastStepPersonIDs now includes persons riding + in a vehicle which are on that edge. #2865
      • +
      • The TraCI python client now supports + StepListeners.
      • +
      • The lane-changing choices of the laneChange model can now be + retrieved (with and without TraCI influence) using command change lane information 0x13.
      • +
      +
    • +
    +
      +
    • Miscellaneous
        +
      • Improved routing efficiency of + SUMO, DUAROUTER and + MAROUTER when using option --routing-algorithm astar.
      • +
      +
    • +
    +
      +
    • Tools
        +
      • randomTrips.py now + supports the option --flows <INT> to generate a number of random flows + instead of individual vehicles.
      • +
      • routeStats.py now + supports generating statistics on departure time by setting the + option --attribute depart.
      • +
      • tls_csv2SUMO.py can now + take arbitrary strings as index and has improved signal group + handling, thanks to Harald Schaefer
      • +
      • more tools (including osmWebWizard) are python3 compatible
      • +
      +
    • +
    +

    Other#

    + +
      +
    • TraCI
        +
      • TraCI version is now 15
      • +
      • some TraCI constants have been renamed
          +
        • CMD_SIMSTEP2 to CMD_SIMSTEP
        • +
        • *AREAL_DETECTOR* to *LANEAREA*
        • +
        • *MULTI_ENTRY_EXIT_DETECTOR* TO *MULTIENTRYEXIT*
        • +
        +
      • +
      +
    • +
    +
      +
    • Miscellaneous
        +
      • The compile-option --disable-internal-lanes was removed. Simulation without internal + lanes is still possible using either the netconvert option --no-internal-links or + the simulation option --no-internal-links
      • +
      • The compile-option --enable-memcheck and the corresponding nvwa package were + removed. Checking for memory leaks should be done using the + clang build or valgrind.
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.30.0_to_Version_0.31.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,674 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.30.0 to Version 0.31.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.30.0 to Version 0.31.0
    + + + +

    Version 0.31.0 (14.09.2017)#

    +

    Bugfixes#

    +
      +
    • +

      Simulation

      +
        +
      • Sublane-model
          +
        • Lane changing to clear the overtaking lane (motivation + keepRight) + is now working properly. #3106
        • +
        • Fixed error that prevented violating right-of-way rules in + the sublane-model. #3140
        • +
        • Fixed bug that was preventing speed adaptations for + strategic changing. #3183
        • +
        • Fixed error that prevented changing for speed gain #3107, #3186
        • +
        • Insertion with departPosLat="random" departPos="last" is now working. #3191
        • +
        • Fixed bug that could cause deadlocks on an intersection #3189
        • +
        • Fixed collisions #3195, #3213, #3050, #2837
        • +
        • Fixed invalid angles when lane-changing at low speeds or low + step-length. #3220
        • +
        • Fixed oscillation. #3333
        • +
        • Fixed too-late changing for speed gain when approaching a + slow leader. #3375
        • +
        • Fixed bug that was causing sublane-changing despite speed + loss. #3372
        • +
        +
      • +
      +
        +
      • Lane-changing
          +
        • Fixed behavior problems in regard to the rule that prohibits + overtaking on the right under some circumstances (by default + this is prohibited in free-flowing motoroway traffic). + Vehicles now avoid overtaking whenever braking is possible + and they overtake on the left instead if there is a third + lane. #1214, #2547, #3115, #3379
        • +
        • Fixed time loss due to late overtaking in some situations. #2126
        • +
        • Fixed invalid overtaking to the left. #3337
        • +
        +
      • +
      +
        +
      • Persons
          +
        • Attribute arrivalPos is no longer ignored for person <ride> + elements. #2811
        • +
        • Fixed crash when pedestrian routes contain disallowed edges #3248 #3381
        • +
        • Fixed collision at prioritized crossings because pedestrians + ignored some vehicles #3393
        • +
        +
      • +
      • Calibrators now respect the option --ignore-route-errors. #3089
      • +
      • departLane="allowed" no longer selects an invalid departLane on multimodal edge. #3065
      • +
      • Acquired waiting time of vehicles is now properly loaded from a + simulation state. #2314
      • +
      • Fixed output of meso calibrator (regression in 0.30.0). #3132
      • +
      • Modified meanTimeLoss output of lane area (e2) + detector. + Semantics is now average time loss *per vehicle* #3110
      • +
      • Fixed invalid stop state and invalid position of vehicles that + cannot resume from parking due to blocking traffic. #3153
      • +
      • Fixed erroneous calculation of occupancy in meandata output for + vehicles being only partially on the corresponding lane. #153
      • +
      • Fixed collision detection of junctions (some collisions were not + registered). #3171
      • +
      • Options --collision.stoptime is now working when collisions are detected on a + junction (using Option --collision.check-junctions). #3172
      • +
      • FCD-output now contains z-data if the network includes elevation + information. #3191
      • +
      • Fixed crash when loading invalid <busStop> definition with <access> element. #3214
      • +
      • Fixed invalid errors on loading stops on looped routes. #3231
      • +
      • Fixed crash on invalid <e2Detector> definition. #3233
      • +
      • Fixed crash on saving and loading simulation state in + conjunction with vehroute-output. #3237, #3238
      • +
      • Fixed too high density values in meandata output. #3265
      • +
      • Fixed invalid routeLength in tripinfo-output. #3355
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed visual glitch when drawing vehicles with multiple + carriages as raster images. #3049
      • +
      • Fixed crash when reloading a simulation after editing the + network. #3059
      • +
      • Fixed crash when using invalid routes in calibrator. #3060
      • +
      • The number of nodes listed in the network parameter dialog no + longer includes internal nodes. #3118
      • +
      • Fixed crash when multiple vehicles start and end parking on the + same edge #3152
      • +
      • All parking vehicles and empty parking spaces of a <parkingArea> are now + accessible via right-click. #3169
      • +
      • Fixed rendering position of <busStop>, <containerStop>, <chargingStation>, <parkingArea> on curved roads. #3200
      • +
      • Fixed drawing position of vehicles with lateral offset and of + passengers if a vehicle is on a very short lane (also affects + fcd-output). #3249
      • +
      • Corrected drawing of sublane borders in case the lane width is + not a multiple of the lateral-resolution.
      • +
      • Fixed wrong occupancy values in Parameter Window for short + lanes.
      • +
      • Pre-configured screenshots + are now taken at the correct time regardless of simulation + speed. #1340
      • +
      • Fixed visual glitches when drawing waiting pedestrians, parking + vehicles and parkingAreas in left-hand networks. #3382
      • +
      • The list of additional simulation objects no longer includes + POIs and polygons (they have their own locator lists). #3384
      • +
      +
    • +
    +
      +
    • Netconvert
        +
      • --ptstop-output now exports stop lanes with the appropriate vClass. #3075
      • +
      • --ptstop-output now exports stop lanes in the correct road direction #3101, #3212
      • +
      • Fixed invalid geo-reference when loading lefthand .net.xml + files #3198
      • +
      • Fixed bug that was causing an error when patching a .net.xml + file with a .tll.xml file along with other + connection-affecting patches. #2868
      • +
      • Fixed insufficient precision of internal lane elevation in + OpenDrive output.
      • +
      • Fixed overly long yellow duration in generated tls plans. #3239
      • +
      • Fixed invalid lengths of internal turning lanes. As a side + effect lane-changing is not possible any more while on these + lanes. The old behavior can be enabled by setting option --junctions.join-turns <BOOL>. #2082.
      • +
      • Variable phase durations are no longer lost when importing from + .net.xml or .tll.xml files.
      • +
      • Information about edges without connections is no longer lost + when exporting with option --plain-output-prefix. #3332
      • +
      • Fixed invalid edge shape after importing a .net.xml file with + custom node shape. #3385
      • +
      • Fixes related to importing OpenDRIVE networks
          +
        • Fixed error when loading <roadMark><type>-data. #3163
        • +
        • Fixed crash when loading OpenDRIVE networks with attribute + pRange. #3164
        • +
        • Fixed invalid traffic lights. #3203
        • +
        • Fixed invalid connections when importing OpenDRIVE networks
        • +
        • Fixed invalid internal-lane speed when importing OpenDRIVE + networks or setting lane-specific speeds. #3240
        • +
        +
      • +
      +
    • +
    +
      +
    • Netedit
        +
      • Fixed rendering slowdown (regression in 0.30.0) #3167
      • +
      • Fixed error when loading pois with attributes lane and pos + (regression in 0.30.0) #3199
      • +
      • Fixed crash when trying to filter selection of additionals by ID + (regression in 0.30.0). #3068
      • +
      • The z-Coordinate of junctions is now properly displayed again in + inspect mode (regression in 0.30.00). #3134
      • +
      • The z-Coordinate of junctions is no longer reset to 0 when + moving them with move mode. #3134
      • +
      • busStop and chargingStation elements with negative startPos or + endPos can now be loaded.
      • +
      • Undo now restores the selection status of deleted additionals. #3073
      • +
      • Loading color schemes is now working (only schemes saved by + Netedit are valid). #2936
      • +
      • Fixed invalid geo-reference when editing lefthand networks #3198
      • +
      • The cycle time is now always shown for selected traffic lights + in tls-mode. #3206
      • +
      • Output precision set in the Options dialog now take effect. #3219
      • +
      • When selecting edges (or lanes) that allow a specific vehicle + class, edges (and lanes) with allow="all" are now matched. #3168
      • +
      • Fixed crash when <ctrl>-clicking on invalid lanes in + connection-mode.
      • +
      • Fixed invalid edge shape after setting a custom node shape. #3276
      • +
      • Function replace by geometry node now preserves connections, + crossings and custom geometry endpoinds. If the function is + disabled, the reason is shown in the menu. #3287
      • +
      • Joining junctions now always preserves edge endpoints. #3257
      • +
      • Fixed invalid network after deleting traffic light and a + junction with pedestrian crossings. #3346
      • +
      • Fixed crash when joining tls. #3365
      • +
      • The junction visualization option Show lane to lane + connections now takes effect.
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed bugs that were causing intermodal routing failures. #3119, #3226
      • +
      • Fixed invalid speedFactor output when specifying both speedFactor and speedDev in the input + files. #3121
      • +
      • Fixed (almost) infinite loop when specifying <flow> without end. #3225
      • +
      • Fixed handling of departPos and arrivalPos for persons. #3246
      • +
      +
    • +
    +
      +
    • MAROUTER
        +
      • Fixed crash due to error in matrix parsing. #3366
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • After sending command traci.load() the simulation now keeps + running until sending traci.close() instead of terminating + when there are no more vehicles or the end time is reached. #3048
      • +
      • Vehicle state change retrieval (simulation.getDepartedIDList, + simulation.getArrivedNumber, ...) are now working after sending + command traci.load(). #3051
      • +
      • Vehicle commands getDistance and getDrivingDistance now + return correct values when the current vehicle edge or the + target edge are junction-internal edges. #2321
      • +
      • Fixed invalid lane occupancy values when calling moveToXY. #3185
      • +
      • traci.load() is now working if the previous simulation had + errors. #3204
      • +
      • Invalid edge ids in traci.vehicle.setRoute() no longer cause + crashing. #3205
      • +
      • Fixed moveToXY mapping failures. #3263
      • +
      • Person context subscriptions are now working. #3304
      • +
      • Fixed invalid behavior after canceling stop. #3348
      • +
      • Fixed freeze when calling gui.screenshot #3362
      • +
      +
    • +
    +
      +
    • Tools
        +
      • netdiff.py now correctly + handles junctions that had their radius or z attributes + changed to the (unwritten) default value.
      • +
      • randomTrips.py now + correctly handles --trip-attributes that contain a space in the value (i.e. + modes). #3117
      • +
      • Fixed bug that was causing insufficient flow when using + flowrouter.py. #3285
      • +
      • Fixed flowrouter.py + crash. #3356
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Behavior at intersections can now be configured with new + junction model + parameters. #3148
      • +
      • Emergency vehicles (vClass="emergency") may always overtake on the right.
      • +
      • The default car following model can now be specified on the + command line with --carfollow.model. #3142
      • +
      • Routing with --routing-algorithm astar is now working efficiently when using traffic assignment zones. #3144
      • +
      • Lanechange-output now + includes the type of the changing and the longitudinal gaps on + the target lane. #3156
      • +
      • Stops on internal lanes may now be defined.
      • +
      • Aggregate trip information generated via option --duration-log.statistics now includes + vehicles that were still running at simulation end if the option + --tripinfo-output.write-unfinished is also set. #3209
      • +
      • Vehicles now react to pedestrians on the same lane. #3242
      • +
      • Pedestrians now react to vehicles that are blocking their path. #3138
      • +
      • Collisions between vehicles and pedestrians are now detected + when setting the option --collision.check-junctions.
      • +
      • Pedestrian <walk>s may now be defined using attribute route. #3302
      • +
      • Summary-output now includes mean vehicle speed (absolute and + relative) as well as the number of halting vehicles. #3312
      • +
      • Pedestrian statistics are now included in the aggregated traffic measures. #3306
      • +
      • Tripinfo-output now includes additional attributes for persons + and containers stages (depart, waitingTime, duration, vehicle, + arrivalPos, actType). #3305
      • +
      • Added new lanechangeModel parameter lcAccelLat to model + lateral acceleration in the sublane model. #3371
      • +
      +
    • +
    +
      +
    • +

      SUMO-GUI

      +
        +
      • All <param> values of simulation objects (i.e. TLS) can now be + inspected. #3098
      • +
      • +

        Calibrators can now be defined for specific lanes not just for + the whole edge. #2434

        +
        +

        Caution

        +

        To obtain the old behavior, calibrators must use the attribute edge. When using the attribute lane the new behavior is activated.

        +
        +
      • +
      +
        +
      • When using the Sublane model, the lateral offset + of left and right vehicle side as well as the rightmost and + leftmost sublane are listed in the vehicle parameter dialog.
      • +
      • Added button for calibrating lane/edge colors to the current + value range. #2464
      • +
      • POIs + which are defined using attributes lane and pos now accept + the optional attribute posLat for specifying lateral offset + relative to the lane. #3339. These attributes are automatically added + as generic parameters + retrievable via TraCI.
      • +
      • Added option --tracker-interval <FLOAT> to configure the aggregation interval of value + tracker windows. Previously this was fixed at 1s. Now it + defaults to the --step-length value.
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • <split>-definitions + now support the attribute id to specify the id of the newly + created node. Two-way roads can be split with the same node by + using the same id in two split definitions. #3192
      • +
      • Variable lane widths are now taken into account when importing + OpenDrive networks. The new option --opendrive.min-width <FLOAT> is used to determine which + parts of a lane are not usable by the vehicles (default 1.8m). #3196
      • +
      • Added option --tls.red.time <TIME> for building a red phase at traffic lights that do + not have a conflicting stream (i.e. roads with a a pedestrian + crossing in a network that is not meant for pedestrian + simulation). The new default value is 5 seconds. #1748
      • +
      • Added option --tls.allred.time <TIME> for building all-red phases after every yellow + phase. #573
      • +
      • Added option --walkingareas to allow generation of walkingareas in + networks without pedestrian crossings. #3253
      • +
      • Added option --opposites.guess.fix-lengths <BOOL> to ensure that opposite lane information can be + set for curved roads. (see + Simulation/OppositeDirectionDriving#Limitations).
      • +
      • Custom lane shapes can now be defined. #2250
      • +
      • Added options --tls.min-dur <TIME> and --tls.max-dur <TIME> for defining the time range of non-static + traffic lights. #3329
      • +
      • The option --proj.scale now accepts arbitrary floats and can be used to + scale the output network. #3351
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • POIs and Polygons can + now be defined with a new editing mode. #1667
      • +
      • Minimum and maximum phase duration for actuated traffic lights + can now be defined. #831
      • +
      • Added button for calibrating lane/edge colors to the current + value range. #2464
      • +
      +
    • +
    + +
      +
    • DUAROUTER
        +
      • Routing with --routing-algorithm astar is now working efficiently when using traffic + assignment zones. #3144
      • +
      • Stops on internal lanes are now supported. #3174
      • +
      • Pedestrian <walk>s may now be defined using attribute route. #3302
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • Added option --randomize-flows for randomizing the departure times of generated + vehicles.
      • +
      +
    • +
    +
      +
    • OD2TRIPS +
    • +
    + +

    Other#

    +
      +
    • SUMO now uses C++11
    • +
    • specifying the car following model as nested element in a vType is +now deprecated
    • +
    • trips without ids are deprecated
    • +
    • router options are now more consistent with simulation options
        +
      • use -a for additional files
      • +
      • use -r or --route-files for all kinds of route input (trips, + flows, routes, alternatives)
      • +
      • the old options --flows, --trips, -- alternatives are deprecated
      • +
      • The network argument for + routeStats.py is now + optional and set with option -n.
      • +
      +
    • +
    • The option proj.shift which used to be an alias for --proj.scale is no longer supported. +These option were used to set a scaling factor by negative powers of +ten but now --proj.scale sets the scaling factor directly (the previous value +5 now corresponds to 1e-5)
    • +
    • default detector-gap for actuated traffic +lights is +now 2.0s. #3340
    • +
    • default minGapLat value (used by the sublane +model is now 0.6m (down from +1.0m) to better match observations.
    • +
    • Documentation +
    • +
    • TraCI
        +
      • TraCI version is now 16
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.31.0_to_Version_0.32.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,590 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.31.0 to Version 0.32.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + + +
    +
    + + + Z/Changes from Version 0.31.0 to Version 0.32.0
    + + + +

    Version 0.32.0 (19.12.2017)#

    +

    Bugfixes#

    +
      +
    • Simulation
        +
      • Fixed collisions in the sublane model #3446, #3595, #3613
      • +
      • Fixed bug that was causing invalid behavior in the sublane model + when used with option --step-method.ballistic. #3486
      • +
      • Fixed bug that was causing deadlocks after undercutting minimum + gap. #3486
      • +
      • Fixed bug that was causing deadlocks at intersections. #3615
      • +
      • Option --ignore-route-errors now also applies to invalid (i.e. misordered) stop + definitions. #3441
      • +
      • PHEMlight handles large acceleration values better #3390 and has + updated emission values for new Diesel cars
      • +
      • <stop> definitions using attribute until that are used within a <flow> now + shift the until times according to the offset between + departure and flow begin. #1514
      • +
      • <chargingStation> attribute chargeDelay now accepts floating point values.
      • +
      • <chargingStation> attribute chargeDelay now works with subsecond simulation.
      • +
      • Vehicles passing a minor link with impatience 0 no longer force + braking for prioritized vehicles. #3494
      • +
      • Fixed bug that was causing collisions between vehicles and + pedestrians #3527
      • +
      • Fixed slow simulation when combining cars and ships in one + simulation. #3528
      • +
      • Fixed collisions on junctions between vehicles coming from the + same lane. #1006, #3536
      • +
      • Fixed failure to change lanes for speed gain in the sublane + model. #3582
      • +
      • Fixed collision of a vehicle with itself. #3584
      • +
      • Several fixes in regard to intermodal routing. #3613, #3622, #3560, #3561, #3562
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Fixed crash when simulating pedestrians. #3484
      • +
      • Coloring by selection is now working for pedestrian crossings. #3396
      • +
      • Options --window-size and --window-pos are now working when set in a configuration file. #3406
      • +
      • Vehicle blinkers that signal left or right turns now remain + switched on while the vehicle is still on the intersection + (requires networks to be rebuilt). #3478
      • +
      • Fixed invalid lane-change blinkers for near-zero lateral + movements in the sublane model. #3612
      • +
      • Fixed invalid vehicle angle when using the sublane model. #3609
      • +
      • Networks created with simple projection can now be shown. #3467
      • +
      • Fixed invalid duration factor in network parameters for + sub-second simulation. #3600
      • +
      +
    • +
    +
      +
    • POLYCONVERT
        +
      • Fixed handling of XML special characters when exporting + arbitrary text via option --all-attributes. #3447
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • Fixed crash when importing Vissim networks.
      • +
      • Fixed bug that was causing invalid signal plans when loading a + .net.xml file and removing edges from an intersection with + pedestrian crossings (the link indices for crossings were + re-assigned but the signal plan was left unmodified creating a + mismatch).
      • +
      • No longer writing pedestrian crossings with length 0 (minimum + length is 0.1m).
      • +
      • Parameters (i.e. those for actuated traffic lights) are no + longer lost when importing .net.xml files or plain-xml + files. #3343
      • +
      • Fixed bug that was causing invalid networks to be generated when + additional lanes were placed to the right of a sidewalk. #3503
      • +
      • Fixed bug that was causing invalid networks to be generated when + nodes without connections were part of a joined traffic light #3715
      • +
      • Defining pedestrian crossings for Pedestrian Scramble is + now supported. #3518
      • +
      • Custom traffic light plans for pedestrian crossings are no + longer modified. #3534
      • +
      • Fixed invalid traffic light plans at pedestrian crossings for + node type traffic_light_right_on_red. #3535
      • +
      • Fixed invalid right of way rules at node type + traffic_light_right_on_red that could cause deadlock. #3538
      • +
      • Networks with intersections that are very close to each other + can now be re-imported. #3585
      • +
      • Edges that do not have connections are now correctly represented + in plain-xml output. #3589
      • +
      • Fixed invalid geometry in opendrive-output for lefthand + networks. #3678
      • +
      • Fixed invalid road markings in opendrive-output.
      • +
      +
    • +
    +
      +
    • +

      NETEDIT

      +
        +
      • +

        Fixed bug that was causing pedestrian crossings to remain + uncontrolled at traffic light controlled intersections. #3472

        +
        +

        Caution

        +

        Regression in 0.31.0. As a workaround, networks that were saved with netedit 0.31.0 can be repaired by calling netconvert -s bugged.net.xml -o fixed.net.xml or simply reopened and saved with a fresh nightly build of NETEDIT.

        +
        +
      • +
      +
        +
      • Options --window-size and --window-pos are now working when set in a configuration file. #3406
      • +
      • Fixed crash when setting linkIndex. #3642
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Fixed invalid public transport routing if the last vehicle + departs before the person enters the simulation. #3493
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • Fixed bug in traci.trafficlights.setLinkState.
      • +
      • Fixed bug in traci.vehicle.getDrivingDistance related to + internal edges. #3553
      • +
      • Fixed bug in traci.vehicle.getDistance related to looped + routes. #3648
      • +
      • Fixed bug in traci.simulation.getDistance2D and + traci.simulation.getDistanceRoad related to internal edges. #3554
      • +
      • Command load no longer fails when there are too many arguments + or long file paths. #3599
      • +
      • Fixed bug in traci.vehicle.changeLane when using the sublane + model. #3634
      • +
      +
    • +
    +
      +
    • Tools
        +
      • Fixed bug that would trigger an infinite loop in + flowrouter.py.
      • +
      • ptlines2flows.py + fixes:
          +
        • missing stops no longer result in crashing
        • +
        • fixed invalid until times when multiple lines use the same + stop
        • +
        +
      • +
      • emissionsDrivingCycle now uses the slope values from the correct + time step when forward calculation of acceleration is enabled
      • +
      • generateTurnDefs.py + now writes interval information. Thanks to Srishti Dhamija for + the patch. #3712
      • +
      +
    • +
    +

    Enhancements#

    +
      +
    • Simulation
        +
      • Added option --collision.mingap-factor to control whether collisions are registered when + the vehicle minGap is violated. With the default value of 1.0 + minGap must always be maintained. When setting this to 0 only + physical collisions are registered. #1102
      • +
      • Added new junction model parameters #3148:
          +
        • jmIgnoreFoeProb, jmIgnoreFoeSpeed can be used to configure + right-of-way violations.
        • +
        • jmSigmaMinor allows configuring driving imperfection + (dawdling) while passing a minor link.
        • +
        • jmTimegapMinor configures the minimum time gap when + passing a minor link ahead of a prioritized vehicle.
        • +
        • jmDriveAfterRedTime and jmDriveRedSpeed allow + configuring red-light violations depending on the duration + of the red phase.
        • +
        +
      • +
      • Added new + laneChangeModel-attribute + lcLookaheadLeft to configure the asymmetry between strategic + lookahead when changing to the left or to the right. #3490
      • +
      • Added new + laneChangeModel-attribute + lcSpeedGainRight to configure the asymmetry between + thrhesholds when changing for speed gain to the left or to the + right. #3497
      • +
      • Electric vehicles can now be used + for emission-model (electricity) output by setting emissionClass="Energy/unknown"
      • +
      • Tripinfo-output for pedestrians now includes routeLength, + duration and timeLoss. #3305
      • +
      • duration-log.statistics-output + now informs about person rides. #3620
      • +
      • Vehicles that end their route with a stop on a parkingArea + (arrivalPos is within the parkingArea bounds) will be assigned a + new destination after rerouting to another parkingArea + (previously they would drive to the original parkingArea edge + after finishing their stop). #3647
      • +
      • Rerouters now support the attribute timeThreshold which makes their + activation dependent on on a minimum amount of accumulated + waiting time. #3669
      • +
      • Simulation step length has been decoupled from the action step + length, which is the vehicle's interval of taking decisions. + This can be configured globally via the option + '--default.action-step-length', or per vehicle via the parameter + 'actionStepLength'.
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • Transparency is now working for all objects.
      • +
      • Junction parameters can now be inspected.
      • +
      • Upcoming stops are now shown in the vehicle parameter window and + also in the network when selecting show current route. #3679
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • When using option --numerical-ids together with option --output.original-names, the original IDs of + all renamed nodes and edges are written to <param> elements with key + origId. #3246
      • +
      • connections now support the attribute speed to set a custom + (maximum) speed on intersections. #3460
      • +
      • connections now support the attribute shape to set a custom + shape. #2906
      • +
      • crossings now support the attribute shape to set a custom + shape. #2906
      • +
      • The new element <walkingArea> + can now be used in con.xml files to define custom walking area + shapes. #2906
      • +
      • Added options --osm.stop-output.length.bus, --osm.stop-output.length.train, --osm.stop-output.length.tram to set appropriate default stop lengths for + different modes of traffic (in conjunction with option --ptstop-output).
      • +
      • Added options --osm.all-attributes <BOOL> which can be used to import additional edge + parameters such as bridge, tunnel and postcode.
      • +
      • Parallel lanes of connecting roads are now written as a single + road in opendrive-output. #2700
      • +
      +
    • +
    +
      +
    • NETEDIT
        +
      • Additional objects (i.e. detectors) as well as POIs and Polygons + can now be located based on their ID. #3069
      • +
      • Connection and Crossing shapes can now be edited visually. #3464
      • +
      • Object types such as edges or polygons can now be locked against + selection modification. #3471
      • +
      • The traffic light index of controlled connections can now be + edited in Inspect Mode. #2627
      • +
      • Added button to traffic light mode for cleaning up unused states + from a traffic light plan.
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • Vehicles and flows which are considered public transport (have + the line attribute) are now only routed if an additional option --ptline-routing + is given. #2824
      • +
      • route alternative output (.rou.alt.xml) now contains costs for + pedestrian stages. #3491
      • +
      +
    • +
    + +
      +
    • TraCI
        +
      • return value of trafficlights.getControlledLinks is now a list + of lists (of links) for the C++ client as well
      • +
      • +

        python client now supports the whole API for + vehicle.setAdaptedTraveltime and vehicle.setEffort + (resetting custom values or setting with default time range) by + using default arguments.

        +
        +

        Note

        +

        The order of parameters had to be changed to allow this. Old code will still work but trigger a warning.

        +
        +
      • +
      +
    • +
    +

    Other#

    + +
      +
    • Simulation
        +
      • chargingstations-output now writes times as seconds rather + than milliseconds.
      • +
      • Default value of option --pedestrian.striping.stripe-width changed to 0.64 (previously 0.65). + This allows vehicles with default width to pass a pedestrian on + a road with default width.
      • +
      • preliminary version of libsumo is + available for experimental building of your own apps using SUMO + as a "library" (calling its functions directly without TraCI)
      • +
      +
    • +
    +
      +
    • SUMO-GUI
        +
      • default font changed to Roboto
      • +
      • Removed OpenGL visualisation option Antialias
      • +
      • E3-Entry and -Exit detectors are now drawn in darker color to better distinguish them from traffic lights. #3378
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • The element <customShape> is no longer supported. Instead <connection> and <crossing> support the + shape attribute. To set a custom shape for walkingAreas, the + new element <walkingArea> may be used.
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI version is now 17
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 22 November 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.7.0_to_version_pre0.8.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,221 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.7.0 to version pre0.8 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.7.0 to version pre0.8
    + + + +
      +
    • Further applications added: router, od2trips-converter, tagreader
    • +
    • A graphical user interface
    • +
    • Further import possibilities added: ArcView, Visum, Vissim (partly in work), ARTEMIS
    • +
    • A new concept of the microsimulation
    • +
    • Traffic lights simulation
    • +
    • Working lane changing
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.1_to_version_0.8.0.2.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.0.1 to version 0.8.0.2 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.0.1 to version 0.8.0.2
    + + + +

    User-relevant changes:

    +
      +
    • GUI
        +
      • Selections
          +
        • Flag icons added to Popup-Menues
        • +
        • Shift adds (de)selects the whole street, not only a lane
        • +
        • Selection-Editor now saves to *.txt-files
        • +
        +
      • +
      • Centering of objects has been revalidated
      • +
      • Variable Speed Signs
          +
        • Visualisation of vss added
        • +
        • Added the possibility to interact with vss'
        • +
        +
      • +
      • "Reload Simulation" option added
      • +
      • Status-Bar message patched
      • +
      • Rotation removed (was buggy)
      • +
      • Error on closing the gui if parameter tracker are opened patched
      • +
      • Value tracker may now be aggregated and are able to save the tracked values
      • +
      • POlygon visualisation added
      • +
      • Breakpoints added
      • +
      • Setting and Saving of additional net weights added (preliminary, subject to improve)
      • +
      • Coloring by type and by route added
      • +
      +
    • +
    • Simulation
        +
      • Reports why the simulation ended if in verbose mode
      • +
      • emissions-output error due to a division by zero patched
      • +
      • VSS may now control several lanes
      • +
      +
    • +
    • general
        +
      • Options
          +
        • Errors on default value usage patched
        • +
        +
      • +
      +
    • +
    • Documentation
        +
      • trying to separate XML-code (green) from command line options (red)
      • +
      +
    • +
    • Netconvert
        +
      • --map-output <FILE> builds a mapping that shows which edges have been removed while joining
      • +
      • guess-tls - options added
      • +
      • extended the FastLane-import by the -l parameter for the number of lanes
      • +
      • --explicite-junctions <JUNCTION_NAME_LIST> allows to say which junctions shall be explicitely tls-controlled
      • +
      • --explicite-no-junctions <JUNCTION_NAME_LIST> allows to say which junctions shall be explicitely non-tls-controlled
      • +
      • --edges-min-speed <SPEED_MS> allows to remove all edges from the input on which a lower speed than <SPEED_MS> is allowed
      • +
      • --elmar allows to import NavTech-GDF-files parsed using Elmar Brockfelds parser
      • +
      • --tiger allows to import tiger files (preliminary, does not look THAAAAT good for an unknown reason, yet)
      • +
      +
    • +
    • Router
        +
      • Generation of random route after the first depart fixed
      • +
      • Warnings about missing weights are printed only once per edge
      • +
      • Supplementary Weights
      • +
      +
    • +
    • Examples have now a new folder structure
    • +
    +

    Developer-relevant changes:

    +
      +
    • GUI
        +
      • Selected structures are now in a separate class
      • +
      • Additional structures are now displayed using the same "API"
      • +
      +
    • +
    • Simulation
        +
      • removed the MSNet::dictionary
      • +
      • refactored the MSMeanData-output
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0.2_to_version_0.8.2.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.0.2 to version 0.8.2.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.0.2 to version 0.8.2.1
    + + + +

    Please remind that several option names have changed! The most +important: "net-files" (router, simulation) is now "net-file"...

    +

    Check user documentation and man-pages for this.

    +

    User-relevant changes:

    +
      +
    • GUI
        +
      • "Clear Message Window" menu added
      • +
      • the icons now allow loading instantly after the previous loading has failed
      • +
      • Renamed to "guisim"
      • +
      • using gradients instead of pure interpolation
      • +
      • windows-icons patched
      • +
      • added ability to take snapshots
      • +
      • using popups instead of comboboxes for finding structures and switching between coloring schemes in order to save place
      • +
      • speeded up handling of errors
      • +
      • Locators hidden behind a popup
      • +
      • ToolTips do now not hide dialog windows
      • +
      • Configuration errors are now reported to the window
      • +
      • Added the possibility to display a vehicle's route
      • +
      • added the possibility to save timelines
      • +
      +
    • +
    • Simulation
        +
      • building dump-files now reports about failures
      • +
      • Patched some of the lane-changing bugs
      • +
      • time-to-teleport -option added
      • +
      • replace "treshhold" by "treshold"
      • +
      +
    • +
    • Netconvert
        +
      • Plain output of node and edges added (--plain-output)
      • +
      • got rid of the arcview/shapelib-import chaos
      • +
      • --explicite-junctions -> --explicite-tls
      • +
      • --explicite-no-junctions -> --explicite-no-tls
      • +
      • --keep-edges.input-file
      • +
      • --keep-edges - option added
      • +
      • --keep-edges.input-file
      • +
      • Geometry computation bug patched
      • +
      +
    • +
    • Router
        +
      • Bug on processing all time steps patched
      • +
      • Route output reformatted
      • +
      • max-alternatives
      • +
      +
    • +
    • Documentation
        +
      • Man-pages added
      • +
      +
    • +
    +

    Developer-relevant changes:

    +
      +
    • GUI
        +
      • Have reworked the class dependencies completely in order to make derivation more easy
      • +
      +
    • +
    • Simulation
        +
      • output moved to "output"
      • +
      • outputs write to OutputDevices, not ostreams
      • +
      • reworked lanechanging
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.0_to_version_0.8.0.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.0 to version 0.8.0.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.0 to version 0.8.0.1
    + + + +
      +
    • GUI
        +
      • The gui now remembers the last used folder
      • +
      • The gui now remembers his
      • +
      • The instance chooser was reworked and shows now which items are selected
      • +
      • An selected-items dialog with the ability to save the names of the selected items was implemented
      • +
      • New colours for aggregated view (aggregated views are still a prototype)
      • +
      • Fixed a bug at optional texture disabling
      • +
      • Update of trackers and tables on simulation steps added
      • +
      • About-dialog debugged
      • +
      • Message window scrolls if new text is appended
      • +
      +
    • +
    • Router
        +
      • Output holding the number of loaded, build, and discarded routes + added
      • +
      • --move-on-short function implemented
      • +
      • Bug on repeatedly emitted vehicles patched
      • +
      +
    • +
    • Simulation
        +
      • Bug on repeatedly emitted vehicles patched
      • +
      +
    • +
    • Netconvert
        +
      • Made the geometry of junctions pretty again
      • +
      • Too conservative right-of-way rules on importing vissim-networks was reworked
      • +
      +
    • +
    • general implementation issues
        +
      • Replaced most output to cerr by MsgHandler-calls
      • +
      +
    • +
    • Documentation
        +
      • extended the detector-documentation (user)
      • +
      • extended the gui-documentation
      • +
      • extended the description of the build process
      • +
      • added missing pictures
      • +
      • resized some pictures
      • +
      • improved the visibility of XML-format descriptions
      • +
      +
    • +
    +

    ... and some other things ...

    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.1_to_version_0.8.2.2.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,227 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.2.1 to version 0.8.2.2 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.2.1 to version 0.8.2.2
    + + + +

    User-relevant changes:

    +
      +
    • Simulation
        +
      • XML-Trigger bug on using speed triggers removed
      • +
      • emission of vehicles on multi-lane source edges debugged (now all lanes are used)
      • +
      • Debugged the problem of vehicles stopping before the route is over (reported by Jonathan Davies)
      • +
      • setting tls-offsets debugged
      • +
      +
    • +
    • Netconvert
        +
      • Computation of left-movers debugged
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.2.2_to_version_0.8.3.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.2.2 to version 0.8.3 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.2.2 to version 0.8.3
    + + + +

    User-relevant changes

    +
      +
    • Simulation
        +
      • debugged false tls-offset computation
      • +
      +
    • +
    • Windows-package
        +
      • added libraries missing in 0.8.2.2
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.8.x_to_version_0.9.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.8.x to version 0.9.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.8.x to version 0.9.0
    + + + +

    User-relevant changes:

    +
      +
    • GUI
        +
      • Selections
          +
        • Flag icons added to Popup-Menues
        • +
        • Shift adds (de)selects the whole street, not only a lane
        • +
        • Selection-Editor now saves to *.txt-files
        • +
        +
      • +
      • Centering of objects has been revalidated
      • +
      • Variable Speed Signs
          +
        • Visualisation of vss added
        • +
        • Added the possibility to interact with vss'
        • +
        +
      • +
      • "Reload Simulation" option added
      • +
      • Status-Bar message patched
      • +
      • Rotation removed (was buggy)
      • +
      • Error on closing the gui if parameter tracker are opened patched
      • +
      • Value tracker may now be aggregated and are able to save the tracked values
      • +
      • POlygon visualisation added
      • +
      • Breakpoints added
      • +
      • Setting and Saving of additional net weights added (preliminary, subject to improve)
      • +
      • Coloring by type and by route added
      • +
      +
    • +
    • Simulation
        +
      • Reports why the simulation ended if in verbose mode
      • +
      • emissions-output error due to a division by zero patched
      • +
      • VSS may now control several lanes
      • +
      +
    • +
    • general
        +
      • Options
          +
        • Errors on default value usage patched
        • +
        +
      • +
      +
    • +
    • Documentation
        +
      • trying to separate XML-code (green) from command line options (red)
      • +
      +
    • +
    • Netconvert
        +
      • --map-output <FILE> builds a mapping that shows which edges have been removed while joining
      • +
      • guess-tls - options added
      • +
      • extended the FastLane-import by the -l parameter for the number of lanes
      • +
      • --explicite-junctions <JUNCTION_NAME_LIST> allows to say which junctions shall be explicitely tls-controlled
      • +
      • --explicite-no-junctions <JUNCTION_NAME_LIST> allows to say which junctions shall be explicitely non-tls-controlled
      • +
      • --edges-min-speed <SPEED_MS> allows to remove all edges from the input on which a lower speed than <SPEED_MS> is allowed
      • +
      • --elmar allows to import NavTech-GDF-files parsed using Elmar Brockfelds parser
      • +
      • --tiger allows to import tiger files (preliminary, does not look THAAAAT good for an unknown reason, yet)
      • +
      +
    • +
    • Router
        +
      • Generation of random route after the first depart fixed
      • +
      • Warnings about missing weights are printed only once per edge
      • +
      • Supplementary Weights
      • +
      +
    • +
    • Examples have now a new folder structure
    • +
    +

    Developer-relevant changes:

    +
      +
    • GUI
        +
      • Selected structures are now in a separate class
      • +
      • Additional structures are now displayed using the same "API"
      • +
      +
    • +
    • Simulation
        +
      • removed the MSNet::dictionary
      • +
      • refactored the MSMeanData-output
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.0_to_version_0.9.1.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.0 to version 0.9.1 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.0 to version 0.9.1
    + + + +

    User-relevant changes

    +
      +
    • GUI
        +
      • bug on not loading junction geometry patched
      • +
      +
    • +
    • Simulation
        +
      • actuated tls-lights bug patched
      • +
      +
    • +
    +

    Developer-relevant changes

    +
      +
    • GUI
        +
      • unused addTimeout/removeTimeout-APIs removed
      • +
      +
    • +
    • Simulation
        +
      • renamed NLNetHandler to NLHandler
      • +
      • each MSJunction has a reference to the net; net allows retrieval of the tls-logics container (see helpers/NamedObjectCont.h)
      • +
      • removed several memory leaks, mainly occuring after broken loading
      • +
      • bugs in actuated traffic lights logic patched
      • +
      +
    • +
    • Router
        +
      • renamed all ROJP*-classes to ROJTR*
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_Version_0.9.10_to_Version_0.10.0.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from Version 0.9.10 to Version 0.10.0 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from Version 0.9.10 to Version 0.10.0
    + + + +
      +
    • Build
        +
      • removed obsolete configuration option --enable-speedcheck
      • +
      +
    • +
    +
      +
    • All
        +
      • using a reduced, faster XML parser (not validating)
      • +
      • default vehicle length is set to 7.5m (including gap)
      • +
      • route format changed ("edges" attribute)
      • +
      • (junction) internal lanes are the default now
      • +
      • copyright changed (removed obsolete ZAIK reference)
      • +
      +
    • +
    + +
      +
    • Simulation
        +
      • Refactored mean data; instead of having it as an additional item + that has to be touched by vehicles, it is a MSMoveReminder
      • +
      • changed the definition of triggers; the old definition is still + possible, but prints a warning.
          +
        • <trigger objecttype="lane" attr="speed" objectid="<LANE>[;<LANE>]*" ... --> <variableSpeedSign lanes="<LANE>[;<LANE>]*" ...
        • +
        • <trigger objecttype="rerouter" objectid="<EDGE>[;<EDGE>]*" ... --> <rerouter edges="<EDGE>[;<EDGE>]*" ...
        • +
        • <trigger objecttype="emitter" objectid="<LANE>" ... --> <emitter lane="<LANE>" ...
        • +
        • <trigger objecttype="bus_stop" objectid="<LANE>" ... --> <busStop lane="<LANE>" ...
        • +
        +
      • +
      • new "route probe" output added
      • +
      • solved bug 2350888: vehicle on false lane with cyclic routes + (thanks to Daniel Janusz for supplying the example)
      • +
      • solved bug 2082959: bus stops that end at edge end confuse vehicles + (thanks to Gerrit Lammert for supplying the example)
      • +
      • solved bug 2468327: log files together with input errors let sumo crash
      • +
      • solved bug 2227272: Random routes do not work with simple net
      • +
      • distributions for routes and vehicle types
      • +
      • changed format of dump definitions from command line to xml + configuration
      • +
      +
    • +
    +
      +
    • NETCONVERT
        +
      • solved bug 2137657: edges disappear in combination with --keep-edges
      • +
      • changed APIs for setting lane-2-lane connections
      • +
      • work on Vissim-import
      • +
      • Now, the node positions are not added to an edge's geometry if + one exists (if the edge has no explicite geometry, the node + positions are still used). --add-node-positions was added, + so that the old behaviour is still available
      • +
      • Changed features of --plain-outoput: plain-nodes now contain + tls information, addtionally, plain-connections are written
      • +
      • changed computation whether a link is a left-mover
      • +
      • changed traffic lights computation
      • +
      • removed unneeded option --all-logics
      • +
      • removed "FileErrorReporter" usage
      • +
      • too complicated junctions (#links>64) are catched and set to + unregulated
      • +
      • corrected computation of right-of-way rules
      • +
      • solved bug 2392943: netconvert fails when removing edges and guessing ramps
      • +
      • solved bug 2171355: turnarounds even with --no-turnarounds
      • +
      • building turnarounds may be now skipped for tls-controlled edges + (using --no-tls-turnarounds)
      • +
      +
    • +
    +
      +
    • NETGEN
        +
      • removed unneeded option --all-logics
      • +
      +
    • +
    + + +
      +
    • POLYCONVERT
        +
      • refactoring
      • +
      • in-line documentation added
      • +
      • added OSM-import functionality
      • +
      • added shape-file - import functionality (imports points, line + strings, polygons, and their multi-pendants)
          +
        • import is done via --shape-files
        • +
        • the id-field is given via --shape-file.id-name <NAME>
        • +
        • optional projection guess is done via + --arcview.guess-projection
        • +
        +
      • +
      • renamed --visum-file to --visum-files; debugged
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.1_to_version_0.9.2.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.1 to version 0.9.2 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.1 to version 0.9.2
    + + + +

    User-relevant changes

    +
      +
    • GUI
        +
      • version information in gui patched
      • +
      • segfaults on loading broken configs patched
      • +
      • catching opening a second file using recent files added
      • +
      • subwindows are now deleted on (re)loading the simulation
      • +
      • some improvements on visualisation (unfinished (GridBuilder))
      • +
      • viewport changer debugged
      • +
      • problems on loading geometry items patched
      • +
      • list of selected items is now cleared on closing/reloading (was + buggy before)
      • +
      • table editing debugged
      • +
      • rerouters are now correctly named
      • +
      +
    • +
    • Simulation
        +
      • debugging numeric issues in MSVehicle
      • +
      • Emitters reworked
      • +
      +
    • +
    • Netconversion
        +
      • output during netbuilding patched
      • +
      • network geometry reworked (unfinished)
      • +
      • "speed-in-km" is now called "speed-in-kmh"
      • +
      • "type-file" is now called "xml-type-files"
      • +
      • removed two files definition for arcview
      • +
      • allowed further information to be stored in arcview-files
      • +
      +
    • +
    • Documentation
        +
      • User docs, netconversion partly updated
      • +
      • further work on tls-api-description
      • +
      +
    • +
    • All
        +
      • copyright information patched
      • +
      +
    • +
    +

    Developer-relevant changes

    +
      +
    • GUI
        +
      • unused addTimeout/removeTimeout-APIs removed
      • +
      • debugged building of the gui-application with MSVC7
      • +
      +
    • +
    • Simulation
        +
      • (MS|GUI)TriggeredEmitter is now (MS|GUI)Emitter
      • +
      • TLS-API: MSEdgeContinuations added
      • +
      • usage of internal lanes is now optional at building
      • +
      +
    • +
    • All
        +
      • got rid of the old MSVC memory leak checker
      • +
      • several memory leaks removed
      • +
      • made checking the geometry for correctness optional on building + (CHECK_UNIQUE_POINTS_GEOMETRY)
      • +
      • made memory checking optional on building (CHECK_MEMORY_LEAKS)
      • +
      • foreign libraries will now be moved to src/foreign
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.2_to_version_0.9.3.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.2 to version 0.9.3 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.2 to version 0.9.3
    + + + +

    User-relevant changes

    +
      +
    • GUI
        +
      • version information in gui patched
      • +
      • segfaults on loading broken configs patched
      • +
      • catching opening a second file using recent files added
      • +
      • subwindows are now deleted on (re)loading the simulation
      • +
      • some improvements on visualisation (unfinished (GridBuilder))
      • +
      • viewport changer debugged
      • +
      • problems on loading geometry items patched
      • +
      • list of selected items is now cleared on closing/reloading (was +buggy before)
      • +
      • table editing debugged
      • +
      • rerouters are now correctly named
      • +
      +
    • +
    • Simulation
        +
      • debugging numeric issues in MSVehicle
      • +
      • Emitters reworked
      • +
      +
    • +
    • Netconversion
        +
      • output during netbuilding patched
      • +
      • network geometry reworked (unfinished)
      • +
      • "speed-in-km" is now called "speed-in-kmh"
      • +
      • "type-file" is now called "xml-type-files"
      • +
      • removed two files definition for arcview
      • +
      • allowed further information to be stored in arcview-files
      • +
      +
    • +
    • Documentation
        +
      • User docs, netconversion partly updated
      • +
      • further work on tls-api-description
      • +
      +
    • +
    • All
        +
      • copyright information patched
      • +
      +
    • +
    +

    Developer-relevant changes

    +
      +
    • GUI
        +
      • unused addTimeout/removeTimeout-APIs removed
      • +
      • debugged building of the gui-application with MSVC7
      • +
      +
    • +
    • Simulation
        +
      • (MS|GUI)TriggeredEmitter is now (MS|GUI)Emitter
      • +
      • TLS-API: MSEdgeContinuations added
      • +
      • usage of internal lanes is now optional at building
      • +
      +
    • +
    • All
        +
      • got rid of the old MSVC memory leak checker
      • +
      • several memory leaks removed
      • +
      • made checking the geometry for correctness optional on building + (CHECK_UNIQUE_POINTS_GEOMETRY)
      • +
      • made memory checking optional on building (CHECK_MEMORY_LEAKS)
      • +
      • foreign libraries will now be moved to src/foreign
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.3_to_version_0.9.4.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,300 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.3 to version 0.9.4 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.3 to version 0.9.4
    + + + +

    This release is rather a snapshot. Many things have changed and some +will require some further revalidation. There are three major +changes/extensions:

    +

    1. The TLS-subsystem now allows having more than a single logic +for a traffic light. One can describe the switch times and switch +between them on the GUI. The user-description on this may be found under Traffic Lights. There is no developer documentation on this, yet. +If you are parsing the networks by your own, you will see that traffic +lights definitions have changed slightly. Instead of the sgmltag +"logicno" a tag named "subkey" is used by now. Also, "inclanes" has been +removed.

    +

    2. A full support to import networks with positions encoded in +geocoordinates. This makes the usage of two further libraries necessary, +PROJ.4 and GDAL. The new building process is described here. +A description about how to import geocoordinated files (despite of +ArcView-files) can be found here.

    +

    Together with this extension, the import of ArcView-files has been +rechecked and now allows to import networks stored in other schemes than +the one NavTeq uses. The new options are described here.

    +

    Some further comments on importing ArcView-files are available here. By now, they include only some comments on importing an open-source network of Osnabrück. You can take a look at this here and also download it from (dead).

    +

    3. The developer documentation has been split into several parts. +It seems to be unmanageable to write a complete developer documentation. +Due to this, we now offer some additional documentation on certain +topics. Topics that were previously a part of the developer +documentation may be now found within the More Docs section.

    +


    +

    There are also some further changes which do not yet show their +potentials, but are quite promising:

    +

    1. The routing interface has been made abstract. This allows to +use routing algorithms in both the simulation as in the routing +applications and will hopefully yield implementations of some further +routing algorithms - by now Dijkstra and a turning ration algorithm are +available.

    +

    2. Some first steps towards making SUMO be aware of vehicle types +have been done. It is now possible to allow/disallow vehicles by class +to use certain lanes. This is now implemented in the NETCONVERT +application and within DUAROUTER, but not yet in the simulation itself +and due to this not yet documented. But, as you can see, we are working +towards making SUMO multi-modal...

    +

    The complete list of changes:

    +
      +
    • Multimodality
        +
      • made lanes storing vehicle classes (additional XML-definition + for lanes, Router is aware of vehicle classes) (undocumented)
      • +
      +
    • +
    • Routing Interface
        +
      • Router have been made abstract
      • +
      +
    • +
    • GUI
        +
      • the Grid now handles networks with negative positions
      • +
      • debugging the visualization grid (unfinished)
      • +
      • glu is now used to draw polygons in order to allo concave + polygons
      • +
      • pois may now be added and moved (using shift)
      • +
      • Emitter may show their routes
      • +
      • added option to change the exaggeratioln of POIs
      • +
      +
    • +
    • Simulation +
    • +
    • NETCONVERT
        +
      • Improved ArcView-import
      • +
      • Additional option for importing NavTeq-networks (using + ArcView/Elmar/Elmar2): new navteq lane number information may be + now only used if not differing too much from the previous !!!
      • +
      • ramp-guessing improved: no lanes are appended if there are + enough
      • +
      • Vision import added (see Importing VISUM-networks)
      • +
      • Positions of guessed TLS may now be saved as POIs (undocumented, yet)
      • +
      • The edge function can be given (undocumented, yet)
      • +
      +
    • +
    • JTRROUTER +
    • +
    • All
    • +
    • documentation on meta information added (see Available Meta-Information)
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.5_to_version_0.9.6.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,320 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.5 to version 0.9.6 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.5 to version 0.9.6
    + + + +
      +
    • POLYCONVERT: possibility to prune the polygons to import on a + bounding box added
    • +
    • DUA: Simulation may now load only a part of defined vehicles
    • +
    • NETCONVERT:
        +
      • debugged connections for on-ramps which already have the right + number of lanes
      • +
      • debugged problems when using networks built without internal + lanes in conjunction with (!!! use-internal in simulation)
      • +
      • lanes split definition added to lane definitions (!!! + undescribed)
      • +
      • added error messages when false lanes are defined in connections
      • +
      +
    • +
    • SIMULATION:
        +
      • c2c wth rerouting
      • +
      +
    • +
    • GUISIM:
        +
      • debugged memory leak in polygon visualization
      • +
      • removed simple/full geometry options; everything is now drawn + using full geometry
      • +
      • the names of nodes, additional structures, vehicles, edges, pois + may now be shown
      • +
      +
    • +
    • All: help/config subsystem changed
    • +
    • Netz hat sich geändert
    • +
    • added the possibility to load a network only
    • +
    • lane expansions
    • +
    • iodevices reworked partially
    • +
    • "Action" removed* was the same as Command
    • +
    • changed the Event-interface
        +
      • execute now gets the current simulation time
      • +
      • event handlers are non-static
      • +
      +
    • +
    • .icc-files removed
    • +
    • class-documentation added/patched within DFROUTER
    • +
    • made access to positions in Position2DVector c++ compliant
    • +
    • xml-types are now read prior to other formats (other Xml-description + afterwards)
    • +
    • double projection in XML-import debugged
    • +
    • vehicle actors added
    • +
    • shape layers added
    • +
    • extracted drawing of lane geometries
    • +
    • added projection information to the network
    • +
    • edge types may now store the edge function
    • +
    • removed the unneded slow lane changer
    • +
    • VISUM: lane connections for unsplitted lanes implemented, further + refactoring
    • +
    • retrieval of microsim ids is now also done using getID() instead of + id()
    • +
    • complete od2trips rework
    • +
    • all structures now return their id via getID()
    • +
    • rerouter: patched the distribution usage; added possibility o load + predefined routes
    • +
    • unifying threads
    • +
    • beautifying: output consolidation
    • +
    • removal of loops added (undescribed!!!)
    • +
    • got rid of the static RONet instance
    • +
    • got rid of the cell-to-meter conversions
    • +
    • began with the extraction of the car-following-model from MSVehicle
    • +
    • began the work on a network editor
    • +
    • added consective process messages
    • +
    • debugged splitting of matrices
    • +
    • added the possibility to stretch/change the current phase and + consecutive phases
    • +
    • made static comboboxes really static
    • +
    • VISUM: patching problems on loading split lanes and tls
    • +
    • added blinker visualisation and vehicle tracking (unfinished)
    • +
    • rertrieval-methods have the "get" prependix; EmitControl has no + dictionary; MSVehicle is completely scheduled by MSVehicleControl; + new lanechanging algorithm
    • +
    • tls switches added
    • +
    • made the assertion that two consecutive edge geomtry points must not + be same less aggressive
    • +
    • made MSVehicleControl completely responsible for vehicle handling* + MSVehicle has no longer a static dictionary
    • +
    • dump-begin/dump-end renamed to dump-begins/dump-ends
    • +
    • E3 detectors refactored partially
    • +
    • added the possibility to make a polygon being filled or not
    • +
    • cartesian and geocoordinates are shown; changed the APIs for this
    • +
    • error checks for dump-begins/dump-ends added
    • +
    • simulation-wide cartesian to geocoordinates conversion added
    • +
    • ROUTER: faster access to weight time lines added;
    • +
    • removed build number information
    • +
    • API for drawing not filled circles
    • +
    • first try to make junctions tls-aware
    • +
    • changed the way geocoordinates are processed
    • +
    • changed vehicle class naming
    • +
    • patching junction-internal state simulation
    • +
    • added vehicle class support to microsim
    • +
    • added vehicle class support to microsim
    • +
    • removed deprecated c2c functions, added new made by Danilot Boyom
    • +
    • c2c visualisation added (unfinished)
    • +
    • added the possibility to copy an artefact's (gl-object's) name to + clipboard (windows)
    • +
    • removed unneeded id member in MSMoveReminder
    • +
    • added an error handling for adding a tls definition for an unknown + tls
    • +
    • added the option to not emit vehicles from flows using a fix + frequency
    • +
    • tls tracker now support switches between logics
    • +
    • first steps towards car2car-based rerouting
    • +
    • variable vehicle type usage
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.6_to_version_0.9.7.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.6 to version 0.9.7 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.6 to version 0.9.7
    + + + +
      +
    • 23.05.07: GUISIM now contains storages for recent configs AND + networks, usage of "RecentFiles" reworked
    • +
    • 23.05.07: DOCS: generated pdfs are copied to <SUMO_DIST>/docs
    • +
    • 24.05.07: DOCS: removed references to man-pages in docs section
    • +
    • 24.05.07: DOCS: links to FAQ and Publications point to the wiki now
    • +
    • 24.05.07: DUAROUTER/SIM: removed the snipplet embedding prototype + (was not yet used)
    • +
    • 24.05.07: TOOLS: added script to apply Astyle on the complete code
    • +
    • 24.05.07: TOOLS: flowrouter.py and flowFromRoutes.py can deal with + non-integer flows
    • +
    • 24.05.07: TOOLS: flowrouter.py has an option to ignore detector + types
    • +
    • 24.05.07: NETGEN: replaced an occurence of rand() with randSUMO() + and reworked the randomness code a little
    • +
    • 30.05.07: DFROUTER: moved to the new exception-handling concept (see + Developer/Implementation Notes/Error Handling)
    • +
    • 30.05.07: DFROUTER: removed bug "[ 1724214 ] no user information + about missing file description header"
    • +
    • 31.05.07: declaring ";" list divider as deprecated
    • +
    • 06.06.07: large code recheck: moved warning pragmas to + windows-config; patched inclusion of the correct configuration file
    • +
    • 07.06.07: started to rework exception handling (no more + XMLBuildingExceptions, mostly ProcessErrors)
    • +
    • 12.06.07: changed API for xml-handlers (now only supplying the + numerical element ids); made handler functions not pure virtual
    • +
    • 12.06.07: made PROJ and GDAL optional
    • +
    • 20.06.07: new XML header in most output files
    • +
    • 22.06.07: Version info added automatically
    • +
    • 27./29.06.07: reworked computation of lane-to-lane directions and + main direction (see also OpenProblems)
    • +
    • 02.07.07: Added tests for error handling while loading broken + networks (SUMO, JTRROUTER, DUAROUTER, DFROUTER)
    • +
    • somewhere between: reworked application subsystem (removing + OptionsSubSys)
    • +
    • renaming variables to the myVar scheme
    • +
    • 16.07.07: removed -l to be used as a shortcut for --lane-weights + because -l is already used as a shortcut for --log-file (DUAROUTER, + JTRROUTER)
    • +
    • 16.07.07: removed the omit-unbuild-edges - option; there should be + no other functionality than for --dismiss-loading-errors + (NETCONVERT, NETGEN)
    • +
    • 17.07.07: refactored VISUM-net importer; now using 2 classes instead + of 18 (NETCONVERT)
    • +
    • 17.07.07: debugged GUISIM's options handling
    • +
    • 17.07.07: removed support for ARTEMIS (never used since 2003)
    • +
    • OutputDevice supports TCP sockets
    • +
    • skipping MSVC6 / 7 support
    • +
    • DFRouter beautification
    • +
    • JTRRouter uses vehicle classes
    • +
    • possibility to switch traffic lights off
    • +
    • preparing subsecond simulation
    • +
    • Cell/Fastlane support removed
    • +
    • unsupported applications removed
    • +
    • starting detector refactorization
    • +
    • emitting at the end of the step
    • +
    • ITM-RemoteServer renamed to TraCI
    • +
    • Visual Studio 64bit build (without Proj, GDAL and Fox)
    • +
    • Route handling changed (multiref deprecated)
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.7_to_version_0.9.8.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.7 to version 0.9.8 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.7 to version 0.9.8
    + + + +
      +
    • Building
        +
      • MSVC8: extracted properties for build configurations into + separate property files.
      • +
      • many coarse changes in directory/project due to resolving + request 1641440
      • +
      • gui/dialogs, gui/drawerimpl, /utils/gui/events, + /utils/gui/windows, /utils/gui/globjects, /utils/gui/tracker + have now own projects
      • +
      • microsim/traffic_lights - project was named properly
      • +
      • netbuild/nodes, microsim/lanechanging, and all netimport classes + but vissim import were moved one folder up
      • +
      • SUMOFrame was moved to microsim (renamed to MSFrame!)
      • +
      • utils/helpers and utils/router were moved to utils/common
      • +
      +
    • +
    +
      +
    • all
        +
      • added inline-documentation for utils/importio
      • +
      +
    • +
    +
      +
    • simulation
        +
      • debugged tls-coupled e2-output
      • +
      • debugged bug 1886198 Segmentation + Fault; + see comment; thanks to Helcio Bezerra de Mello for the bug + report
      • +
      • further work on detectors
          +
        • values revalidated and described output + has changed
        • +
        • marked "measures" and "style" as deprecated
        • +
        +
      • +
      • while looking for next links to use, the vehicle is now aware of + his best lanes
      • +
      • simplified computation of best lanes
      • +
      • debugged bug 1871859 vehicles do not wait on lane + end; + thanks to Jensen Chou for the bug report
      • +
      • debugged bug 1871964 left-moving vehicles do not fill + junction
      • +
      • patched error handling in emitters; tests added
      • +
      • debugged bug 1873155 vehicles with depart lower than begin are + emitted; + tests added
      • +
      • tests for rerouter added; partially debugged
      • +
      • added inline-documentation for microsim/output
      • +
      • debugging inner-junction simulation
      • +
      • refactoring detectors
          +
        • MSDetector2File into MSDetectorControl
        • +
        • complete e1-refactoring
        • +
        • complete e2-refactoring
        • +
        • complete e3-refactoring
        • +
        • MSMeanData_Net_Cont is now simply a + std::vector\<MSMeanData_Net*>
        • +
        • improved documentation
        • +
        • spell checking
        • +
        +
      • +
      +
    • +
    • removed MSUnit - the usage was bogus, often same functions were + defined twice. Rather confusing. Added + utils/common/PhysicalTypeDefs.h instead, as a new begin.
    • +
    • Removed MSNet's deltaT - was falsly used and duplicate with + utils/common/SUMOTime
    • +
    + + +
      +
    • DFROUTER
        +
      • trying to make it more usable for inner-city scenarios with many + connections
      • +
      +
    • +
    • spell checking
        +
      • renamed 'succeding' to 'succeeding'
      • +
      • guisim now shows internal lanes less wide
      • +
      • false left closure of leftmost lane shown in "real world" scheme + debugged
      • +
      +
    • +
    • removed utils/importio/CSVHelpers (was used once and contained a + two-lines-method (sic!))
    • +
    • working on doxygen documentation (and adding throw-declarations)
        +
      • utils/options
      • +
      • utils/iodevices
      • +
      • utils/importio
      • +
      +
    • +
    • removing unneeded debug-helpers in microsim
    • +
    • debugged problems with repetition of vehicles that have a color + within guisim (application terminated)
    • +
    • patched XMLSubSys documentation (was + bug 1828803)
    • +
    • fixed vehicle decelerations when being on a higher priorised road + (bug + 1830266)
    • +
    • fixed NETCONVERTER bugs occuring when connected nodes are too close + together (bugs + 1639460, + 1639436)
    • +
    • moved color out of MSVehicle (affects loading classes)
    • +
    • router import classes now process input colors as strings
    • +
    • consolidated XML-definitions
        +
      • vehicle type is now called "type" in all cases
      • +
      • removed unneeded elements and attributes
      • +
      +
    • +
    • (almost complete) rework of the microsimulation loop
      +What was done, basically is to change the way vehicles move over +junctions and how other vehicles get informed about vehicles +approaching on incoming lanes. Quite heavy changes, in fact, I hope +of benefit. You may read some further information on this in the +following tracker items: bug 1840935: exchange of vehicles over +lanes disallow fails with two +vehs, +bug 1840938: lane exchange mechanism ignores undefined lane +order, +bug 1840952: drop vehicle exchange in lane +changer, +bug 1840944: replace approaching information in +lanes
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.8_to_version_0.9.9.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.8 to version 0.9.9 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.8 to version 0.9.9
    + + + + +
      +
    • Simulation
        +
      • Hidden state loading/saving completely from the microsim
      • +
      • Vehicle may now end their route at a certain position of the + route's last edge (see + Specification)
      • +
      • The route may be now given as an attribute (route) within the + vehicle definition (see + Specification)
      • +
      • The vehicle now stores most of its definition parameters in + myParameter, not as atomar values
      • +
      • Solved problems with multiple stop on same edge and with stops + on lanes which can not be used for continuing the route; thanks + to Friedemann Wesner and Gerrit Lammert for reporting them
      • +
      • Reworked mean data output. The vehicle movements are now + weighted by the time the vehicle was on an edge/lane. Additional + constraints for output + (--exclude-empty-edges/--exclude-empty-lanes) allow to + dump only information about edges/lanes which were occupied by + vehicles.
      • +
      • debugged bug 1964433 different simulation results for different starting times; + The issue was a false computation of WAUT switching and TLS + offset times when choosing a different simulation begin time + than 0
      • +
      • replaced MSVehicle::getInTransit and MSVehicle::running by + MSVehicle::isOnRoad
      • +
      • removed MSEdge::isSource; was used only once and can be easily + replaced by comparing the result of MSEdge::getPurpose()
      • +
      • debugged bug 1932105 second stop on the same edge confuses vehicles
      • +
      • debugged bug 1941846 repeatable crash with sumo r5378
      • +
      • debugged bug 1912547 linux 64 bit compile error for sumo svn 5143
      • +
      • debugged bug 1913655 command line sumo throws unknown exception
      • +
      • debugged bug 1924989 sumo r5186 crashs by pure virtual function call
      • +
      • begun work on Specification
          +
        • all vehicles are emitted at position=0, with speed=0
        • +
        +
      • +
      • removed usage of NLLoadFilter
      • +
      • added an option to quit the simulation if a number of vehicles + is exceeded (--too-many-vehicles <INT>)
      • +
      • fully integrated Tino Morenz's MSVTypeProbe; moved it from + microsim/trigger to microsim/output; tests added; a vtypeprobe + is now defined within additional files this way: + <vtypeprobe id="test1" type="" freq="10" file="vtypeprobe.xml"/> + ("test1" is the vehicle type to report, leave empty in order to + get information about all vehicles)
      • +
      • replaced usage of "Command" by encapsulating methods in + "WrappingCommand" wherever possible
      • +
      • "debugged" usage of actuated/agentbased tls; should be covered + by tests, in fact
      • +
      • further work on devices-consolidation
      • +
      • implemented a one-shot / multi-shot routing device
      • +
      +
    • +
    + +
      +
    • NETCONVERT
        +
      • debugged bug 1993928 --keep-edges.input-file does not remove empty nodes; + as soon as one edge-removal(keeping) option occures, nodes are + rechecked whether they contain any further edge. If not, the + node is removed.
      • +
      • VISUM-import: debugged failures due to false district node + position computation
      • +
      • Connection building: made storing outgoing edge connections + sane; replaced three strange storages by one
      • +
      • Disabled the support for setting an "edge function" - because + vehicles are emitted the same (parametrised) way on each edge, + we do not need a distinction between source and normal edges; + sink edges were never distinguished.
      • +
      • Refactored the way edge types are stored in NETCONVERT
      • +
      • removed "name" attribute from NBEdge; was not written anyway
      • +
      • work on SUMO-networks reimport + (unfinished)
      • +
      • documentation: debugged bug 1909685 option "omit-corrupt-edges" not recognized + (use --dismiss-loading-errors instead of + --omit-corrupt-edges)
      • +
      • removed usage of NLLoadFilter
      • +
      • thanks to Christoph Sommer, the OSM importer now handles speed + and lanes information; default OS values are now used, too
      • +
      +
    • +
    +
      +
    • DUAROUTER / JTRROUTER
        +
      • Removed option --move-on-short. It got obsolete as vehicles + may start on edges which are shroter than they are, now.
      • +
      +
    • +
    +
      +
    • DUAROUTER
        +
      • debugged bug 1981921 duarouter truncates routes; + Now, --remove-loops only prunes the route if the vehicle + would have to take a turnaround at the begin or end.
      • +
      • reworked handling of broken routes; longer routes are not + replaced; incomplete routes may be corrected using the new + --repair option
      • +
      +
    • +
    +
      +
    • JTRROUTER
        +
      • Removed possibility to specify turning percentages using CSV + files
      • +
      +
    • +
    +
      +
    • DFROUTER
        +
      • Definition of emitters, vss, etc. are now written into the same + folder as the declaration
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • TraCI is now enabled as default
      • +
      +
    • +
    +
      +
    • od2trips
        +
      • due to being used for macroscopic demand definitions, OD2TRIPS + now emits vehicles using departlane="best" and departspeed="max"
      • +
      • removed option to parse list of tables from a vissim file; they + may be given at the command line (--vissim is no longer + supported)
      • +
      • added the possibility to omit writing the vehicle type + (--no-vtype)
      • +
      +
    • +
    +
      +
    • Tools/Main
        +
      • added some tools for output visualization + (mpl_dump_twoAgainst.py, mpl_tripinfos_twoAgainst.py, + mpl_dump_timeline.py) (see + Tools/Visualization)
      • +
      +
    • +
    + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html --- sumo-1.5.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/userdoc/Z/Changes_from_version_0.9.9_to_version_0.9.10.html 2020-04-27 22:08:01.000000000 +0000 @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + Z/Changes from version 0.9.9 to version 0.9.10 - SUMO Documentation + + + + + + + + + + + + + + + + + + + +
    +
    +
    +
    + +
    +
    + + + Z/Changes from version 0.9.9 to version 0.9.10
    + + + + + +
      +
    • Simulation
        +
      • solved "Simulation reports 'Error: The number of edges in the + list mismatches the edge count.'"
      • +
      • solved several issues reported by Gerrit Lammert (thank you): + false ordering of loaded stops, problems with stops near to an + end edge
      • +
      +
    • +
    +
      +
    • Guisim
        +
      • vehicles now again have a default color
      • +
      +
    • +
    +
      +
    • TraCI
        +
      • patched building tracitestclient_main.cpp under Fedora Core 9 + (thanks to Niek Sanders)
      • +
      +
    • +
    +
      +
    • Tools
        +
      • patched dua-iterate.py - --move-on-short does no longer + exist
      • +
      +
    • +
    + + + +
    +
    + + + +
    + +
    + +
    This page was last edited on: 02 September 2019 + +
    +

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

    +

    Follow us on + | Documentation built with MkDocs.

    +
    + + + + + + + + + + diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Car-Following-Models.md sumo-1.6.0+dfsg1/docs/web/docs/Car-Following-Models.md --- sumo-1.5.0+dfsg1/docs/web/docs/Car-Following-Models.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Car-Following-Models.md 2020-04-27 21:47:56.000000000 +0000 @@ -45,6 +45,6 @@ limited by the simulation step size ([SUMO](SUMO.md) option **--step-length** {{DT_FLOAT}}), resp. the action step length (option **--default.action-step-length** {{DT_FLOAT}}, parameter ). For that reason a value of tau below this step-size may lead to collisions if the leader -suddenly starts braking hard. If tau is larger then step-size the +suddenly starts braking hard. If tau is larger than step-size the situation is safe but drivers will still react during each simulation -step unless a custom action-step-length is used (e.g. by setting option **--default.action-step-length**). \ No newline at end of file +step unless a custom action-step-length is used (e.g. by setting option **--default.action-step-length**). diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/ChangeLog.md sumo-1.6.0+dfsg1/docs/web/docs/ChangeLog.md --- sumo-1.5.0+dfsg1/docs/web/docs/ChangeLog.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/ChangeLog.md 2020-04-27 21:47:56.000000000 +0000 @@ -3,6 +3,168 @@ permalink: /ChangeLog/ --- +## Version 1.6.0 (28.04.2020) + +### Bugfixes + +- Simulation + - Fixed negative depart delay. Vehicles with a sub-step-length depart time now depart in the subsequent step. Issue #964 + - Fixed sublane model bug that reduced flow on intersections and caused emergency braking. Issue #6649 + - Fixed sublane model bug that was causing cyclical switching between keep-right and sublane-alignment choices. Issue #6084 + - Fixed sublane model bug that was causing invalid lane alignment in multimodal networks. Issue #6691 + - Fixed crash when depart-triggered vehicles were discarded. Issue #6690 + - Removed invalid warning for public transport users. Issue #6698 + - Fixed invalid right-of-way at traffic light junctions with right-turn-on-red rules. Issue #6068 + - Fixed bug that caused junction collisions to go unnoticed. Issue #6779 + - Stopping duration no longer exceeds the planned duration/until time by one simulation step. Issue #6755 + - ACC model no longer uses double minGap when queued. Issue #6728 + - Fixed extremely low speed of W99 model when approaching intersections and stops. Issue #6823 + - Fixed crash after rerouting. Issue #6835 + - Fixed bugs where stops on cyclical routes where ignored after loading simulation state. Issue #6811 + - Fixed invalid 'density' and 'occupancy' values (too high) in edgeData output. Issue #5723 + - Fixed crash when running with multiple threads. Issue #6806 + - Option **--ignore-route-errors** can now be used to ignore the error 'will not be able to depart using the given velocity (slow lane ahead)'. Issue #6853 + - Fixed crash when using option **--no-internal-links** and defining a stop on an internal lane. Issue #6855 + - Fixed invalid vehicle angles when using option **--lanechange.duration** in a left-hand network. Issue #6856 + - Ride arrival stop is now considered when a vehicle stops multiple times on the arrival edge. Issue #2811 + - Fixed unsafe insertion speed for IDM-vehicles. Issue #6904 + - Fixed bug that was causing cooperative speed adjustments to fail. Issue #5124 + - Fixed invalid emission-edgeData when restricting the output time interval. Issue #6944 + - Railway fixes: + - Train reversal problems. Issue #6692, #6782, #6797, #6851, #6860, #6906, #6908 + - Train routing now considers space requirement for train reversal. Issue #6697, #6743, #6799 + - Train routing is no longer effected by occupied edges that are beyond rail signal control. Issue #6741 + - Invalid train speed after insertion on short edge. Issue #6801 + - CarFollowModel 'rail' now correctly uses minGap. Issue #6796 + - Invalid stop position after splitting train. Issue #6788 + - Rail signal allows entering occupied block for joining trains. Issue #6794 + - Joining trains with different minGap values. Issue #6795 + - carFollowModel 'Rail' no longer ignores attributes 'accel', 'decel' and 'emergencyDecel', 'apparentDecel' and 'collisionMinGapFactor'. Issue #6834 + - Fixed invalid warning "Invalid approach information after rerouting". Issue #6914 + - Fixed invalid warning "Circular block" at dead-end sidings. Issue #6926 + +- MESO + - Calibrator attribute `vTypes` is now working. Issue #6702 +- NETCONVERT + - Fixed precision when filtering network with a given boundary. Issue #6206 + - Fixed missing connections when importing OpenDRIVE. Issue #6712 + - OpenDRIVE networks where a single edges is connected to more than two junctions are now supported. Issue #6828 + - Fixed invalid link state at railway switch that would cause uncessary deceleration. Issue #6833 + - Fixed invalid link direction in rail networks with unusual geometry. Issue #6924 + - OpenDRIVE import now correctly handles `signalReference` and signal `laneValidity` elements. Issue #2517, #2366 + - Fixed errors when loading custom lane shapes. Issue #6892, #6893, #6894, #6895 + - Fixed bug that could cause an invalid intermodal network to be written. Issue #6901 +- SUMO-GUI + - Fixed layout of meso edge parameter dialog at high occupancy (regression in 1.5.0) + - Fixed crash when simulation ends while tracking person attributes. Issue #6784 + - Fixed missing stop annotations in 'show-route' mode. Issue #6814 + - Fixed crash when scaling railway track width. Issue #6859 +- NETEDIT + - Fixed empty route id when creating route from non-consecutive edges with custom id. Issue #6722 + - Fixed invalid displayed connection attribute. Issue #6760 + - Fixed crash when moving a selection of junctions and edges. Issue #4918 +- DUAROUTER + - Attribute `group` of `` and `` is no longer lost. Issue #6555 + - Train routing now considers space requirement for train reversal. Issue #6697 +- OD2TRIPS + - Option **--departpos** is now working for pedestrians and personTrips. Issue #6720 +- TraCI + - Fixed crash when calling vehicle.moveTo for an off-road vehicle with tripinfo-output. Issue #6717 + - Fixed crash when trying add subscription filter for context subscrition of persons around an ego vehicle. Issue #6735 + - Fixed crash and invalid results when using 'vehicle.addSubscriptionFilterLateralDistance'. Issue #6770, #6941 + - Fixed crash when adding vehicle with `depart="triggered"`. Issue #6793 + - Fixed invalid routing results when calling 'traci.simulation.findIntermodalRoute(..., routingMode=ROUTING_MODE_AGGREGATED)'. Issue #6827 +- Tools + - [sort_routes.py](Tools/Routes.md#sort_routespy) can now handle trips, triggered vehicles and human-readable times. + - [routeSampler.py](Tools/Turns.md#routesampler.py): fixed bias in departure time for the generated vehicles. Issue #6786 + +### Enhancements +- Simulation + - Taxi device now supports ride sharing. Issue #6544 + - Added option **--extrapolate-departpos**. When this option is set, vehicles with a departure time that lies between simulation steps have their depart position shifted forward to better reflect their position at the actual insertion time. This can greatly reduce depart delay and incrase and insertion flow in high-flow situations. Issue #4277 + - Traffic lights of type 'actuated' and 'delay_based' now support the use of [custom detectors](Simulation/Traffic_Lights.md#custom_detectors). Issue #5125, Issue #6773 + - The new route attribute `period` is now applied repeatedly when rerouting the vehicle and the new route contains stops with attribute `until` to shift those times forward (e.g. on cyclical rerouters for public transport vehicles). Issue #6550 + - The new route attribute `repeat` can now be used to define repeating routes. When the route contains stop definitions with the `until`-attribute, the new route attribute `period` must be used to shift the repeated stop times. Issue #6554 + - Added option **--fcd-output.params KEY1,KEY2,...** to extend fcd-output with additional vehicle [generic parameters](Simulation/GenericParameters.md). Issue #6685 + - Tripinfo-output attribute vaporized now includes specific description for premature vehicle removal (collision, traci, calibrator, ...). Issue #6718 + - Tripinfo-output now includes timeloss for person rides. Issue #6891 + - Added option **--statistic-output** to write [various statistics](Simulation/Output.md#commandline_output_verbose) in XML format. Issue #3751 + - vType attribute 'lcSigma' now always affect lateral position (previously, only sublane model and continuous lanechange modle were affected). + - Option **--save-state.times** now accepts human-readable time. Issue #6810 + - Added new 'device.toc' parameters ['mrmSafeSpot' and 'mrmSafeSpotDuration'](ToC_Device.md) to control the behavior during minimum-risk maneuvers. Issue #6157 + - Added option **--vehroute-output.stop-edges** to record the edges that were driven ahead of stop as part of the vehroute output. Issue #6815 + - Added option **--weights.priority-factor FLOAT** to factor the priority of edges into the routing decision with a configurable weight (edges with higher priority are preferred increasingly when setting this to a higher value). An application for this is [railway routing](Simulation/Railways.md#routing_on_bidirectional_tracks). Issue #6812 + - Added option **--device.rerouting.bike-speed** to compute aggregated speeds for bicycles separately. Issue #6829 + - Automatic train rerouting by rail signal logic can now be disabled by setting option **--device.rerouting.railsignal false** as well as by vehicle and vType parameters (key="device.rerouting.railsignal"). Issue #6781 + - Trains can now be joined in reverse order (rear part id is kept). Issue #6803 + - Element `` now supports attribute 'parkingLength'. This can be used define the available space for stopping vehicles with `parking="true"` independent of the length of the busStop along the lane. Issue #3936 + - edgeData output now includes the new attribute 'laneDensity' which reports the density in vehs per km per lane. Issue #6840 + - edgeData and laneData definitions now support the new attribute 'writeAttributes' which can be used to reduce the list of output attributes to the given list of attribute names. Issue #6847 + - Public transport import from OSM now supports route definitions with abbreviated style. Issue #6862 + - Added option **--save-state.rng**. When this option is set, saved simulation state will include the state of all random number generators and this state will be restored upon loading. This RNG state takes up about 500kb. Issue #1418 + +- NETEDIT + - Added new 'Data Mode' to edit files with edge and turn-related data (``, ``). Issue #6461 + - Traffic light phase editing function 'Insert Phase' now takes successive green states into account when synthesizing transition phases. Issue #6732 +- SUMO-GUI + - Missing data values (color by edgeData) can now be distinguished from negative data values. Issue #6660 + - ``-data files can now be visualized. Issue #6659 + - Traffic lights of type 'delay_based' can now dynamically toggle detector visualization. + - Train reversals are now indicated when ''Show Route'' is active. Issue #6744 + - Vehicles can now be colored by 'by stop delay'. This computes the estimated departure delay at the next `` with an 'until' attribute. Issue #6821 + - Travelled distance (odometer) is now listed in the vehicle parameter dialog. + - Junction name is now listed in the junction parameter dialog and can optionally by drawn in the view. Issue #6635 + - Lanes that explicitly allow rail and passenger traffic are now highlighted with a distinct color in the default color scheme. Issue #6844 + - When loading a network with internal lanes and setting the option **--no-internal-links**, the internal lanes are still shown. This helps to understand track topology in rail networks. Issue #6852 + - Visualization of a vehicles route can now be configured with the menu option 'Draw looped routes' which can be disabled to reduce clutter in looped public transport routes. Issue #6917 + +- NETCONVERT + - Edge attribute `spreadType` now supports value `roadCenter` which aligns edges with common geometry so that the geometry reflects the middle of the road regardless of differences in lane numbers (causing natural alignment for turning lanes). Issue #1758 + - Added option **--default.spreadtype** to set the default spread type for edges. Issue #6662 + - Connections now support attribute ''length'' to customize the length of internal lanes. Issue #6733 + - Added option **--default.connection-length** to overwrite the length of internal lanes with a specific value. Issue #6733 + - Added option **--railway.topology.direction-priority** to assign edge priority values based on the [preferred track usage direction](Simulation/Railways.md#routing_on_bidirectional_tracks) (determined heuristically from uni-directional track). + - Added node attribute 'name' to hold an optional string label. Issue #6635 + - Direction-specific speeds are now imported from OSM (*maxspeed:forward*, *maxspeed:backward*). Issue #6883 + +- DUAROUTER + - When loading weights from edgeData files, arbitrary attributes can now be used with option **--weight-attribute**. Issue #6817 + - Added option **--weights.priority-factor FLOAT** to factor the priority of edges into the routing decision with a configurable weight (edges with higher priority are preferred increasingly when setting this to a higher value). Issue #6812 + +- TraCI + - [Meso simulation](Simulation/Meso.md) now supports TraCI + - Parking vehicles are now picked up by context subscriptions. Issue #6785 + - Added functions 'getFollowSpeed', 'getSecureGap', 'getStopSpeed' for accessing carFollowModel functions to the vehicle domain. Issue #3361 + - Added function 'traci.vehicle.getStopDelay' to retrieve the estimated delay at the next (public transport) stop. Issue #6826 +- Tools + - added osmWebWizard option to import a simplified network that is only for cars. Issue #6595 + - [matsim_importPlans.py](Tools/Import/MATSim.md#matsim_importplanspy) now supports alternative input dialects and sorts its output. + - added new tool [net2kml.py](Tools/Net.md#net2kmlpy) to convert sumo networks to KML + - Function sumolib.net.getShortestPath can now penalize train reversals using the optional argument 'reversalPenalty' + - [tls_csvSignalGroups.py](Tools/tls.md#tls_csvsignalgroupspy) now supports defining controlled pedestrian crossings. Issue #6861 + - [routeSampler.py](Tools/Turns.md#routesampler.py) improvements + - supports loading multiple data intervals. Data aggregation can be customized using options **--begin**, **--end**, **--interval** + - supports loading multiple files (routes, edgedata, turns). The corresponding options were renamed accordingly (**--route-files, --edgedata-files, --turn-files**) + - supports optimization by linear programming using option **--optimize INT|full** (requires scipy). The interger argument can be used to configure the maximum deviation from the input route distribution. + - supports output of mismatch between measured counts and sampled counts for visualization in SUMO-GUI via `edgeData` and `edgeRelation` files using option **--mismatch-output** + - supports direct optimization of route input (without resampling) by setting option **--optimize-input** + - supports multi-edge counting data using ``. Issue #6729 + - supports non-consecutive edgeRelations with maximum gap by using the new option **--turn-max-gap **. Issue #6726 + - supports loading origin-destination relations with the new option **--od-files**. Issue #6888 + - supports writing results with routeIDs, routeDistribution and flows instead of vehicles. Issue #6730 + +### Other +- Network version is now 1.6 (Issue #1758) +- The turn-file format used by JTRROUTER is now deprecated. Instead the new edgeRelation-file format should be used. To convert old files into the new format, the tool turnFile2EdgeRelations.py can be used. The tools jtcrouter.py and routeSampler.py will only accept the new file format as input. +- NETCONVERT + - Signal references from OpenDRIVE networks are now exported as a mapping from sumo-tls-link-index to OpenDRIVE-signal-id instead of sumo-edge to OpenDRIVE-signal-name. Issue #6863 +- NETEDIT + - supermode hotkeys changed + - F2: Network mode + - F3: Demand mode + - F4: Data mode + - Default color for edge-geometry points changed to avoid confusion with rail signals when coloring junctions by type. Issue #6749 + ## Version 1.5.0 (11.02.2020) ### Bugfixes diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Contact.md sumo-1.6.0+dfsg1/docs/web/docs/Contact.md --- sumo-1.5.0+dfsg1/docs/web/docs/Contact.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Contact.md 2020-04-27 21:47:56.000000000 +0000 @@ -30,7 +30,7 @@ releases or documents. Post to the list if you have to announce something by yourself. Frequency: few mails per year - Archive: [Eclipse Archive](https://dev.eclipse.org/mhonarc/lists/sumo-dev/), [Mail Archive](https://www.mail-archive.com/sumo-dev@eclipse.org/), [SF Archive](https://sourceforge.net/p/sumo/mailman/sumo-announce/) + Archive: [Eclipse Archive](https://dev.eclipse.org/mhonarc/lists/sumo-announce/), [Mail Archive](https://www.mail-archive.com/sumo-announce@eclipse.org/), [SF Archive](https://sourceforge.net/p/sumo/mailman/sumo-announce/) - [sumo-dev](https://dev.eclipse.org/mailman/listinfo/sumo-dev)
    This list is for topics related to sumo development. If you want to @@ -58,8 +58,8 @@ up an [IFTTT link](https://ifttt.com/applets/147561p-rss-feed-to-email) or use to send you an email. -Occasional development updates are posted on our [facebook page](https://www.facebook.com/simulationofurbanmobility/) and you can -[follow us on Twitter](https://twitter.com/EclipseSumo). +Occasional development updates are posted on our [Facebook page](https://www.facebook.com/simulationofurbanmobility/) and you can +[follow us on Twitter](https://twitter.com/EclipseSumo) and on [Instagram](https://instagram.com/eclipse.sumo). Our institute's address: @@ -69,4 +69,4 @@ 12489 Berlin
    Germany

    -[mailto:sumo@dlr.de](mailto:sumo@dlr.de) \ No newline at end of file +[mailto:sumo@dlr.de](mailto:sumo@dlr.de) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md sumo-1.6.0+dfsg1/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md --- sumo-1.5.0+dfsg1/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md 2020-04-27 21:47:56.000000000 +0000 @@ -76,7 +76,7 @@ | color | [color](#colors) | This vehicle's color | | **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") | The position at which the vehicle shall enter the net; see [\#departPos](#departpos). *default: "base"* | +| 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* | | 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"* | @@ -126,7 +126,9 @@ | -------------- | --------------------------- | ----------------------------------------------------------------------------------- | | **id** | id (string) | The name of the route | | **edges** | id list | The edges the vehicle shall drive along, given as their ids, separated using spaces | -| color | [color](#colors) | This route's color | +| color | [color](#colors) | This route's color | +| repeat | int | The number of times that the edges of this route shall be repeated (default 0) | +| period | time (s) | When defining a repeating route with stops and those stops use the `until` attribute, the times will be shifted forward by 'period' on each repeat | There are a few important things to consider when building your own routes: @@ -273,6 +275,7 @@ back be at the beginning of the lane (vehicle's front position=vehicle length) - `"last"`: the vehicle is inserted with the given speed as close as possible +- `"stop"`: if the vehicle has a stop defined, it will depart at the endPos of the stop. If no stop is defined, the behavior defaults to `"base"` behind the last vehicle on the lane. If the lane is empty it is inserted at the end of the lane instead. When departSpeed="max" is set, vehicle speed will not be adapted. @@ -1022,6 +1025,7 @@ - [toc](ToC_Device.md) - [driverstate](Driver_State.md) - [fcd](Simulation/Output/FCDOutput.md) +- [tripinfo](Simulation/Output/TripInfo.md) - [Demand Responsive Transport (Taxis)](Simulation/Taxi.md) - [example](Developer/How_To/Device.md) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Demand/Routes_from_Observation_Points.md sumo-1.6.0+dfsg1/docs/web/docs/Demand/Routes_from_Observation_Points.md --- sumo-1.5.0+dfsg1/docs/web/docs/Demand/Routes_from_Observation_Points.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Demand/Routes_from_Observation_Points.md 2020-04-27 21:47:56.000000000 +0000 @@ -12,7 +12,7 @@ - [DFROUTER](../DFROUTER.md) uses edge based counts - [flowrouter](../Tools/Detector.md#flowrouterpy) uses edge based counts - [jtcrouter](../Tools/Turns.md#jtcrouterpy) uses turn-counts -- [routeSampler](..Tools/Turns.md#routesampler.py) uses turn-counts and edge counts +- [routeSampler](../Tools/Turns.md#routesamplerpy) uses turn-counts and edge counts (and also origin-destination counts) # DFROUTER Since version 0.9.5, the SUMO-package contains a routing module named @@ -259,9 +259,9 @@ The [jtcrouter.py](../Tools/Turns.md#jtcrouterpy) tool (available since version 1.5.0) can build a traffic demand from turn-count data. It does so by transforming the counts into flows and turn-ratios and then passing these files to [JTRROUTER](../JTRROUTER.md). # routeSampler.py -The [routeSampler.py](Tools/Turns.md#routesampler.py) tool (available since version 1.5.0) builds traffic demand from turn-count data as well as edge-count data. It uses a route file as input and then repeatedly selects from this set of routes to fulfill the given count data. +The [routeSampler.py](../Tools/Turns.md#routesamplerpy) tool (available since version 1.5.0) builds traffic demand from turn-count data as well as edge-count data. It uses a route file as input and then repeatedly selects from this set of routes to fulfill the given count data. -A suitable route file for a given network can be generated with [randomTrips.py](Tools/Trip.md#randomtripspy). Such a route file covers the network with shortest-path routes. Routes that deviate from the shortest path can also be generated with the help of [DUAROUTER](../DUAROUTER.md) option **--weights.random-factor**. +A suitable route file for a given network can be generated with [randomTrips.py](../Tools/Trip.md#randomtripspy). Such a route file covers the network with shortest-path routes. Routes that deviate from the shortest path can also be generated with the help of [DUAROUTER](../DUAROUTER.md) option **--weights.random-factor**. By changing the route file used as input, the generated traffic can be calibrated. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Demand/Routing_by_Turn_Probabilities.md sumo-1.6.0+dfsg1/docs/web/docs/Demand/Routing_by_Turn_Probabilities.md --- sumo-1.5.0+dfsg1/docs/web/docs/Demand/Routing_by_Turn_Probabilities.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Demand/Routing_by_Turn_Probabilities.md 2020-04-27 21:47:56.000000000 +0000 @@ -19,6 +19,9 @@   --output-file=MySUMORoutes.rou.xml --begin  --end  ``` +!!! note + When turn-counts instead of turn-ratios are available, [other tools may be used](Routes_from_Observation_Points.md). + ## Turn Definitions | Turn and Sink Definitions | | @@ -27,20 +30,18 @@ | Type of content | turn and sink definitions | | Open format? | Yes | | SUMO specific? | Yes | -| XML Schema | [turns_file.xsd](http://sumo.sf.net/doc/current/docs/xsd/turns_file.xsd) | +| XML Schema | [edgerelations_file.xsd](http://sumo.dlr.de/xsd/edgerelations_file.xsd) | To describe the turn definitions, one has to write an XML file. Within this file, for each interval and each edge the list of percentages to use a certain follower edge has to be given. An example: ``` - + - - - - - + + + ... any other edges ... @@ -48,7 +49,7 @@ ... some further intervals ... - + ``` !!! note @@ -75,8 +76,9 @@ ### Automatic generation of turn definitions For automatic, yet artificial, turn definitions generation based on the -network structure, see -[generateTurnDefs.py](../Tools/Misc.md#generateturndefspy). +network structure, see [generateTurnDefs.py](../Tools/Turns.md#generateturndefspy). + +You can also generate turn definitions from an existing route file. see [genrateTurnRatios.py](../Tools/Turns.md#generateturnratiospy). ## Sinks Definitions @@ -116,6 +118,14 @@ The tool [randomTrips.py](../Tools/Trip.md#randomtripspy) can be used to generated jtrrouter input by setting options **--flows** {{DT_INT}} **--jtrrouter**. +## Overlapping Flows + +By default JTRRouter will route flows through the network and split them at intersections until each part of the flow has reached a sink edge. When such a flow reaches the source edge of another flow, the total traffic is added. +The following options can change this behavior: + +- **--sources-are-sinks** (shortcut **-S**). When this option is set, all flows will terminate upon reaching the from-edge of another flow. Issue #6601 +- **--discount-sources** (shortcut **-D**). When this option is set, the flow departing at an edge will be reduced by the amount of traffic that has reached this edge from upstream flows. When combined with option **--sources-are-sinks**, upstream flows will terminate at a downstream edge when the source flow number has been reached. + ## Additional Options As theoretically a route may get infinitely long when a vehicle is @@ -125,4 +135,4 @@ have. With the default of 2.0, a route may contain twice as many edges as the network has. Any route longer than this size will be marked as invalid. We assume that for each network this number has to be chosen -again. \ No newline at end of file +again. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/CppFileTemplate.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/CppFileTemplate.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/CppFileTemplate.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/CppFileTemplate.md 2020-04-27 21:47:56.000000000 +0000 @@ -7,12 +7,15 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see  // Copyright (C) - German Aerospace Center (DLR) and others. -//  -// This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v2.0 -// which accompanies this distribution, and is available at -//  -// SPDX-License-Identifier: EPL-2.0 +// This program and the accompanying materials are 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     /// @author   @@ -22,16 +25,12 @@ /// //  /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include  #include      // Standard libraries #include          // SUMO libraries -#include "myHeaderFile1"       // Own libraries +#include "myHeaderFile1"       // Header files from the same directory #include "myHeaderFile2" @@ -68,16 +67,16 @@ ```cpp // --------------------------------------------------------------------------- -// Class::Subclass - methods  +// Class::InnerClass - methods  // --------------------------------------------------------------------------- -OwnClass::SubClass::SubClass() : +OwnClass::InnerClass::InnerClass() :     myPrivateParameter(0) {     // code of constructor } -OwnClass::SubClass::~SubClass() {} +OwnClass::InnerClass::~InnerClass() {} /****************************************************************************/ -``` \ No newline at end of file +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/Documentation_Build.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/Documentation_Build.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/Documentation_Build.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/Documentation_Build.md 2020-04-27 21:47:56.000000000 +0000 @@ -15,8 +15,12 @@ # Requirements Building the documentation requires the python3-version of mkdocs along with several plugins. These can be installed with pip in the following manner: ``` - pip3 install mkdocs mkdocs-macros-plugin mkdocs-git-revision-date-plugin pymdown-extensions mdx_truly_sane_lists mdx_gh_links + pip3 install mkdocs mkdocs-macros-plugin mkdocs-git-revision-date-plugin pymdown-extensions mdx_truly_sane_lists mdx_gh_links plantuml_markdown ``` +You also need to install the plantuml package +``` + sudo apt install plantuml +``` # Documentation Parts diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/ExploringTheStructure.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/ExploringTheStructure.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/ExploringTheStructure.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/ExploringTheStructure.md 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,38 @@ +--- +title: Developer/Exploring the structure +permalink: /Developer/Exploring the structure/ +--- + +# Introduction + +Each night a documentation of the C++ source code is generated with the tool [Doxygen](http://www.doxygen.nl/). +The result is acessible via [inline code documentation + (doxygen)](http://sumo.dlr.de/daily/doxygen/). + +# Looking for a class by name + +Select either from the menu "Data Structures" the item Data Structure Index or from the tree view on the left "Data Structures" -> "Data Structure Index". You can navigate with the alphabet to the section of all classes starting with that letter. +Select e.g. first M and then the class MSCFModel. +![Image:DevDoxygenIndex.jpg](../images/DevDoxygenIndex.jpg "Image:DevDoxygenIndex.jpg") + +# Information about a class + +For a selected class the following information is shown + +## Inheritance and collaboration diagramm + +For a select class you will see first the inheritance and collaboration diagramm. +In these diagrams you can navigate to other classes by clicking on the box with the class name. +![Image:DevDoxygenClassDiagrams.png](../images/DevDoxygenClassDiagrams.png "DevDoxygenClassDiagrams.png") + +## Data Structures + +## List of member functions + +For each function you see a description, the parameters, return values, the references to other variables and functions, from where it is references and the caller graph. + +You can navigate to the references items and explore the structure of one or more classes interactively in the browser +![DevDoxygenFunctionInfo](../images/DevDoxygenFunctionInfo.png) + +## List of variables + diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/HFileTemplate.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/HFileTemplate.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/HFileTemplate.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/HFileTemplate.md 2020-04-27 21:47:56.000000000 +0000 @@ -7,12 +7,15 @@ /****************************************************************************/ // Eclipse SUMO, Simulation of Urban MObility; see  // Copyright (C) - German Aerospace Center (DLR) and others. -//  -// This program and the accompanying materials -// are made available under the terms of the Eclipse Public License v2.0 -// which accompanies this distribution, and is available at -//  -// SPDX-License-Identifier: EPL-2.0 +// This program and the accompanying materials are 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     /// @author   @@ -22,48 +25,43 @@ /// //  /****************************************************************************/ -#ifndef  -#define  - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include  // you can leave this one out if you don't need any defines from config.h, especially in libsumo / utils -#include "myOwnClass1.h" -#include "myOwnClass2.h" -``` +#include  +#include "myOtherClass2.h" + -``` // =========================================================================== // class declarations // =========================================================================== class myOwnClass1; // always prefer a declaration over an include class myOwnClass2; + // =========================================================================== // class definitions // =========================================================================== /** - * @class OwnClass (Can be preceded by GNE, MS, NB, etc... depending on the project) + * @class OwnClass (Can be preceded by GNE, MS, NB, etc. depending on the project)  * brief description of the class  */ class OwnClass : public ParentClass  { public:      /** -      * @class SubClass  -      * brief description of the sub-class +      * @class InnerClass +      * brief description of the inner class       */ -     class SubClass { +     class InnerClass {      public:          /// @brief Constructor -         SubClass(); +         InnerClass();          /// @brief Destructor -         ~SubClass(); +         ~InnerClass();      private:          /// @brief description of parameter @@ -95,7 +93,7 @@     virtual void pureVirtualFunction() = 0; protected: -    /// @brief briefly description of the parameter +    /// @brief description of the parameter      myProtectedParameter1; private: @@ -105,6 +103,4 @@     /// @brief C++ Standard Library classes must be preceded by std::     std::vector myPrivateParameter3; }; - -#endif -``` \ No newline at end of file +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/Implementation_Notes/Simulation_Loop.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/Implementation_Notes/Simulation_Loop.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/Implementation_Notes/Simulation_Loop.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/Implementation_Notes/Simulation_Loop.md 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,32 @@ +--- +title: Developer/Implementation Notes/Simulation Loop +permalink: /Developer/Implementation_Notes/Simulation_Loop/ +--- + +# Basic + +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. + +```plantuml +@startuml +participant MSNet_simulationStep as simstep +participant MSEdgeControl +participant ... +participant MSVehicle + +group car-following model +simstep --> MSEdgeControl : planMovements +... -> MSVehicle : planMove +end +group junction model +simstep -> MSEdgeControl : executeMovements +... -> MSVehicle : executeMove +end +group lane-changing model +simstep -> MSEdgeControl : changeLanes +... -> MSVehicle : getLaneChangeModel().wantsChange +end +@enduml +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/Main.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/Main.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/Main.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/Main.md 2020-04-27 21:47:56.000000000 +0000 @@ -18,6 +18,7 @@ PyAutoGUI - [Developer/Debugging](Debugging.md) - information about debugging SUMO +- [Developer/Exploring the structure](ExploringTheStructure.md) - Explore the structure of SUMO with the doxygen documentation - [inline code documentation (doxygen)](http://sumo.dlr.de/daily/doxygen/) - [Developer/Used Tools](Used_Tools.md) - tools used diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/PythonFileTemplate.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/PythonFileTemplate.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/PythonFileTemplate.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/PythonFileTemplate.md 2020-04-27 21:47:56.000000000 +0000 @@ -6,14 +6,17 @@ ```py #!/usr/bin/env python # Leave this one out for non executable python files # -*- coding: utf-8 -*- # optional encoding line, use if non-ASCII characters are in the code -# Eclipse SUMO, Simulation of Urban MObility; see  -# Copyright (C) - German Aerospace Center (DLR) and others. -#  -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License v2.0 -# which accompanies this distribution, and is available at -#  -# SPDX-License-Identifier: EPL-2.0 +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) - German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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     # @author   diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Developer/Tests.md sumo-1.6.0+dfsg1/docs/web/docs/Developer/Tests.md --- sumo-1.5.0+dfsg1/docs/web/docs/Developer/Tests.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Developer/Tests.md 2020-04-27 21:47:56.000000000 +0000 @@ -300,4 +300,7 @@ on Linux). On Windows you will need to add it by copying the existing python.exe in your python3 installation to python3.exe (in the same directory) and adding that directory to the end of your PATH (if it is -not already there). \ No newline at end of file +not already there). + +# Running tests outside TextTest +Different methods to extract TextTest tests (offline and online) are explained [here](../Tutorials.md#using_examples_from_the_test_suite). diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Downloads.md sumo-1.6.0+dfsg1/docs/web/docs/Downloads.md --- sumo-1.5.0+dfsg1/docs/web/docs/Downloads.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Downloads.md 2020-04-27 21:47:56.000000000 +0000 @@ -146,6 +146,8 @@ ### Nightly Snapshots +
    + The code within the repository is [compiled each night](Developer/Nightly_Build.md). The following resulting packages can be obtained: @@ -234,4 +236,11 @@ if(file_exists($file)){ echo round(((filesize($file))/1048576),1) . " MB"; }} -?> \ No newline at end of file +function getNightlyFreshness($fname){ +$zip = new ZipArchive; +$zip->open($_SERVER['DOCUMENT_ROOT']. "/daily/" . $fname); +$freshnessIs = str_replace("\"","",str_replace("#define VERSION_STRING ","",$zip->getFromName('sumo-git/include/version.h'))); +echo $freshnessIs; +$zip->close(); +} +?> diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/DUAROUTER.md sumo-1.6.0+dfsg1/docs/web/docs/DUAROUTER.md --- sumo-1.5.0+dfsg1/docs/web/docs/DUAROUTER.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/DUAROUTER.md 2020-04-27 21:47:56.000000000 +0000 @@ -130,6 +130,7 @@ | **--weights.random-factor** {{DT_FLOAT}} | Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT); *default:* **1** | | **--routing-algorithm** {{DT_STR}} | Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; *default:* **dijkstra** | | **--weight-period** {{DT_TIME}} | Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy; *default:* **3600** | +| **--weights.priority-factor** {{DT_FLOAT}} | Consider edge priorities in addition to travel times, weighted by factor; *default:* **0** | | **--astar.all-distances** {{DT_FILE}} | Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output) | | **--astar.landmark-distances** {{DT_FILE}} | Initialize lookup table for astar ALT-variant from the given file | | **--astar.save-landmark-distances** {{DT_FILE}} | Save lookup table for astar ALT-variant to the given file | diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Editing_Articles.md sumo-1.6.0+dfsg1/docs/web/docs/Editing_Articles.md --- sumo-1.5.0+dfsg1/docs/web/docs/Editing_Articles.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Editing_Articles.md 2020-04-27 21:47:56.000000000 +0000 @@ -5,6 +5,8 @@ This documentation is written using Markdown syntax. Every page or "article" is a Markdown (.md) file located [here]({{Source}}docs/web/docs) in the official SUMO GitHub repository. The static html pages are then generated using [Mkdocs](https://www.mkdocs.org/). +Feel free to contribute and improve the SUMO Documentation. All changes need to be via Pull requests. You can click on the "Edit on GitHub" button in the top right corner of every page, or just simply press the `e` key on your keyboard. + !!! note Although HTML can be written within Markdown, please avoid using it and keep everything in native Markdown as much as possible. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/extra.css sumo-1.6.0+dfsg1/docs/web/docs/extra.css --- sumo-1.5.0+dfsg1/docs/web/docs/extra.css 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/extra.css 2020-04-27 21:47:56.000000000 +0000 @@ -161,10 +161,6 @@ color: #0645ad; } -.col-md-3 { - max-width: 350px; -} - @media (max-width: 768px) { .col-md-3 { max-width: 800px; diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/FAQ.md sumo-1.6.0+dfsg1/docs/web/docs/FAQ.md --- sumo-1.5.0+dfsg1/docs/web/docs/FAQ.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/FAQ.md 2020-04-27 21:47:56.000000000 +0000 @@ -105,6 +105,8 @@ ``` - Send us a [pull request on GitHub](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) +- Delete your fork, once the pull request is accepted or declined. +- (If you wish to keep your fork consider adding a topic branch to your local copy and push it before submitting the pull request.) - More info may be found at @@ -293,10 +295,19 @@ ### Can SUMO simulate lefthand traffic? - Yes. It is supported since version 0.24.0. To build a network for - lefthand traffic, the option **--lefthand** must be set. Note, that this option + Yes. It is supported since version 0.24.0. To create a new network for + lefthand traffic, the option **--lefthand** must be set. - in earlier versions but only works correctly since 0.24.0. + To convert an existing network to lefthand driving, there are two options. Abstract networks (no geo-reference, coordinates do not matter much) can be processed with netconvert: +``` + netconvert -s righthand.net.xml --flip-y-axis -o lefthand.net.xml +``` + + To convert an existing network and preserve coordinates, the network must first be disaggregated into nodes and edges and then re-assembled: +``` + netconvert -s righthand.net.xml --plain-output-prefix righthand + netconvert -e righthand.edg.xml -n righthand.nod.xml --lefthand -o lefthand.net.xml +``` ### Can SUMO generate movement traces? @@ -645,8 +656,8 @@ rerouters for continuous operation with configurable turning ratios. - If the networks is not circular to begin with (i.e a single road) you can make the network circular in a non-geometrical way - by adding a return edge and declaring it's length to be very - short (minimum 0.1m). + by adding a return edge that and declaring it's length to be very + short (minimum 0.1m). The return edge should have a sensible geometry (i.e. a detour loop) but the length can be made very short so that it does not affect vehicle routes. - You can generate long trips going around the network with lots of detours. This can be accomplished using [randomTrips.py](Tools/Trip.md#randomtripspy) by setting @@ -830,9 +841,7 @@ starting on the same edge). 4. invalid routing - only shortest path were used instead of [a user assignment algorithm](Demand/Dynamic_User_Assignment.md) - - to many vehicles start/end their route with a turn-around. This - can be avoided by using [TAZ for bidirectional departure](Tools/District.md#generatebididistrictspy) - or using [DUAROUTER option **--remove-loops**](DUAROUTER.md). + - to many vehicles start/end their route with a [turn-around](Simulation/Turnarounds.md). 5. invalid insertion (vehicles being inserted on the wrong lane close to the end of an edge where they need to change to another turn lane). This can be fixed by setting the vehicle attribute `departLane="best"` Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/web/docs/images/DevDoxygenClassDiagrams.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/web/docs/images/DevDoxygenClassDiagrams.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/web/docs/images/DevDoxygenFunctionInfo.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/web/docs/images/DevDoxygenFunctionInfo.png differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/web/docs/images/DevDoxygenIndex.jpg and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/web/docs/images/DevDoxygenIndex.jpg differ Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/docs/web/docs/images/release-note.png and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/docs/web/docs/images/release-note.png differ diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/index.md sumo-1.6.0+dfsg1/docs/web/docs/index.md --- sumo-1.5.0+dfsg1/docs/web/docs/index.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/index.md 2020-04-27 21:47:56.000000000 +0000 @@ -1,7 +1,10 @@ Simulation of Urban MObility
    +!!! caution "Important notice" + Due to the Coronavirus crisis and the measures imposed, the SUMO User Conference 2020 has been rescheduled. New date: 26-28 October 2020. + !!! conference "SUMO User Conference 2020" - The [SUMO User Conference 2020](http://sumo.dlr.de/2020/) takes place **May, 11-13, 2020** in Berlin. + The [SUMO User Conference 2020](http://sumo.dlr.de/2020/) takes place **October, 26-28, 2020** in Berlin. ![](https://sumo.dlr.de/w/images/thumb/d/de/Eclipse_foundation_logo.jpg/250px-Eclipse_foundation_logo.jpg) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/IntermodalRouting.md sumo-1.6.0+dfsg1/docs/web/docs/IntermodalRouting.md --- sumo-1.5.0+dfsg1/docs/web/docs/IntermodalRouting.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/IntermodalRouting.md 2020-04-27 21:47:56.000000000 +0000 @@ -43,8 +43,10 @@ # Defining public transport -Every vehicle with a line attribute is considered public transport and -will be used for routing regardless of its capacity. +In order to be included by in the public transport routing, flows (also vehicles or trips) must be defined +with a [public transport schedule](Simulation/Public_Transport.md#public_transport_schedules). + +An example for a bus line and a person that may uses this line are given below: ```xml @@ -58,15 +60,8 @@ ``` - -- In order to define a route-able bus schedule all ``-definitions must - use the *until*-attribute. -- Stops that are declared as child elements of a flow must have until - times appropriate for the first vehicle in the flow. The until times - for later vehicles will be shifted forward by the flow period -- Stops that are declared as child element of a stand-alone route - (external to a flow or vehicle) must have until times that are - offsets from the departure time of the respective vehicles. +!!! note + A vehicle/flow/trip must define the `line` attribute to be considered as public transport. Every vehicle with a line attribute is considered public transport and may be used for routing regardless of its capacity. # Intermodal Cost Function diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Libsumo.md sumo-1.6.0+dfsg1/docs/web/docs/Libsumo.md --- sumo-1.5.0+dfsg1/docs/web/docs/Libsumo.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Libsumo.md 2020-04-27 21:47:56.000000000 +0000 @@ -12,7 +12,7 @@ communication overhead due to the protocol and the socket communication. To have a more efficient coupling without the need for socket communication, the TraCI API is provided as a C++ library with the -followin properties: +following properties: - C++ interface based on static functions and a few simple wrapper classes for results which can be linked directly to the client code @@ -33,6 +33,7 @@ - TraCI client may accept any object where Libsumo needs a boolean value - using traci.init or traci.connect is not possible (you always need to use libsumo.start) - with traci every TraCIException will generate a message on stderr, Libsumo does not generate this message +- the stepListener interface is not supported # Building it @@ -64,5 +65,5 @@ ``` In case you have a lot of scripts you can also set the environment -variable LIBSUMO_AS_TRACI to a non empty value which will trigger the +variable `LIBSUMO_AS_TRACI` to a non empty value which will trigger the import as above. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/MAROUTER.md sumo-1.6.0+dfsg1/docs/web/docs/MAROUTER.md --- sumo-1.5.0+dfsg1/docs/web/docs/MAROUTER.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/MAROUTER.md 2020-04-27 21:47:56.000000000 +0000 @@ -122,6 +122,7 @@ | **--max-alternatives** {{DT_INT}} | Prune the number of alternatives to INT; *default:* **5** | | **--weights.interpolate** {{DT_BOOL}} | Interpolate edge weights at interval boundaries; *default:* **false** | | **--weights.expand** {{DT_BOOL}} | Expand weights behind the simulation's end; *default:* **false** | +| **--weights.priority-factor** {{DT_FLOAT}} | Consider edge priorities in addition to travel times, weighted by factor; *default:* **0** | | **--routing-algorithm** {{DT_STR}} | Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; *default:* **dijkstra** | | **--bulk-routing.vtypes** {{DT_BOOL}} | Aggregate routing queries with the same origin for different vehicle types; *default:* **false** | | **--routing-threads** {{DT_INT}} | The number of parallel execution threads used for routing; *default:* **0** | diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/NETCONVERT.md sumo-1.6.0+dfsg1/docs/web/docs/NETCONVERT.md --- sumo-1.5.0+dfsg1/docs/web/docs/NETCONVERT.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/NETCONVERT.md 2020-04-27 21:47:56.000000000 +0000 @@ -261,6 +261,7 @@ |--------|-------------| | **-L** {{DT_INT}}
    **--default.lanenumber** {{DT_INT}} | The default number of lanes in an edge; *default:* **1** | | **--default.lanewidth** {{DT_FLOAT}} | The default width of lanes; *default:* **-1** | +| **--default.spreadtype** {{DT_STR}} | The default method for computing lane shapes from edge shapes; *default:* **right** | | **-S** {{DT_FLOAT}}
    **--default.speed** {{DT_FLOAT}} | The default speed on an edge (in m/s); *default:* **13.89** | | **-P** {{DT_INT}}
    **--default.priority** {{DT_INT}} | The default priority of an edge; *default:* **-1** | | **--default.type** {{DT_STR}} | The default edge type | @@ -270,6 +271,7 @@ | **--default.disallow** {{DT_STR}} | The default for disallowed vehicle classes | | **--default.junctions.keep-clear** {{DT_BOOL}} | Whether junctions should be kept clear by default; *default:* **true** | | **--default.junctions.radius** {{DT_FLOAT}} | The default turning radius of intersections; *default:* **4** | +| **--default.connection-length** {{DT_FLOAT}} | The default length when overriding connection lengths; *default:* **-1** | | **--default.right-of-way** {{DT_STR}} | The default algorithm for computing right of way rules ('default', 'edgePriority'); *default:* **default** | ### Tls Building @@ -412,8 +414,10 @@ | **--railway.signals.discard** {{DT_BOOL}} | Discard all railway signal information loaded from other formats than plain-xml; *default:* **false** | | **--railway.topology.repair** {{DT_BOOL}} | Repair topology of the railway network; *default:* **false** | | **--railway.topology.repair.connect-straight** {{DT_BOOL}} | Allow bidiretional rail use wherever rails with opposite directions meet at a straight angle; *default:* **false** | +| **--railway.topology.repair.stop-turn** {{DT_BOOL}} | Add turn-around connections at all loaded stops.; *default:* **false** | | **--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.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** | @@ -446,6 +450,7 @@ | **--shapefile.use-defaults-on-failure** {{DT_BOOL}} | Uses edge type defaults on problems; *default:* **false** | | **--shapefile.all-bidirectional** {{DT_BOOL}} | Insert edges in both directions; *default:* **false** | | **--shapefile.guess-projection** {{DT_BOOL}} | Guess the proper projection; *default:* **false** | +| **--shapefile.traditional-axis-mapping** {{DT_BOOL}} | Use traditional axis order (lon, lat); *default:* **false** | | **--vissim.join-distance** {{DT_FLOAT}} | Structure join offset; *default:* **5** | | **--vissim.default-speed** {{DT_FLOAT}} | Use FLOAT as default speed; *default:* **50** | | **--vissim.speed-norm** {{DT_FLOAT}} | Factor for edge velocity; *default:* **1** | diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/NETEDIT.md sumo-1.6.0+dfsg1/docs/web/docs/NETEDIT.md --- sumo-1.5.0+dfsg1/docs/web/docs/NETEDIT.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/NETEDIT.md 2020-04-27 21:47:56.000000000 +0000 @@ -461,6 +461,11 @@ circles are drawn instead of detailed junction shapes which can improve visibility. +#### Changing Elevation ##### +When checking the 'Elevation' checkbox, elevation of junctions and existing geometry points can be modified by dragging the with the mouse (with their x,y coordinates remaining unchanged). +At the same time, the numerical elevation value will be displayed for every junction and geometry point. +It is useful to combine this with [elevation or sloope coloring](Networks/Elevation.md#visualizing_elevation_data). + #### Moving Object Selections - When selecting neighboring edges and dragging one of them, the @@ -1317,7 +1322,7 @@ restricted lane* ## Junction - +- *Split Junction*: Undo a prior join (i.e. one that was computed with option **--junctions.join**) - *Set custom shape*: Allows drawing a custom junction shape via a [\#Modifiable Poly](#modifiable_poly) (see below). The junction shape determines where the incoming edges end and the diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/NETGENERATE.md sumo-1.6.0+dfsg1/docs/web/docs/NETGENERATE.md --- sumo-1.5.0+dfsg1/docs/web/docs/NETGENERATE.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/NETGENERATE.md 2020-04-27 21:47:56.000000000 +0000 @@ -160,6 +160,7 @@ |--------|-------------| | **-L** {{DT_INT}}
    **--default.lanenumber** {{DT_INT}} | The default number of lanes in an edge; *default:* **1** | | **--default.lanewidth** {{DT_FLOAT}} | The default width of lanes; *default:* **-1** | +| **--default.spreadtype** {{DT_STR}} | The default method for computing lane shapes from edge shapes; *default:* **right** | | **-S** {{DT_FLOAT}}
    **--default.speed** {{DT_FLOAT}} | The default speed on an edge (in m/s); *default:* **13.89** | | **-P** {{DT_INT}}
    **--default.priority** {{DT_INT}} | The default priority of an edge; *default:* **-1** | | **--default.type** {{DT_STR}} | The default edge type | @@ -169,6 +170,7 @@ | **--default.disallow** {{DT_STR}} | The default for disallowed vehicle classes | | **--default.junctions.keep-clear** {{DT_BOOL}} | Whether junctions should be kept clear by default; *default:* **true** | | **--default.junctions.radius** {{DT_FLOAT}} | The default turning radius of intersections; *default:* **4** | +| **--default.connection-length** {{DT_FLOAT}} | The default length when overriding connection lengths; *default:* **-1** | | **--default.right-of-way** {{DT_STR}} | The default algorithm for computing right of way rules ('default', 'edgePriority'); *default:* **default** | | **-j** {{DT_STR}}
    **--default-junction-type** {{DT_STR}} | [traffic_light|priority|right_before_left|traffic_light_right_on_red|priority_stop|allway_stop|...] Determines junction type (see wiki/Networks/PlainXML#Node_types) | diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Networks/Elevation.md sumo-1.6.0+dfsg1/docs/web/docs/Networks/Elevation.md --- sumo-1.5.0+dfsg1/docs/web/docs/Networks/Elevation.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Networks/Elevation.md 2020-04-27 21:47:56.000000000 +0000 @@ -16,6 +16,7 @@ - from a greyscale height-map using [NETCONVERT](../NETCONVERT.md) option **--heightmap.geotiff**. - from [*edg.xml files*](../Networks/PlainXML.md#edge_descriptions) as part of the shape specification +- by shifting geometry points and junctions along the z-axis in [NETEDIT move mode](../NETEDIT.md#changing_elevation). # Related Topics @@ -42,4 +43,4 @@ - [Electric vehicle model](../Models/Electric.md) - [PHEMLigh emission model](../Models/Emissions/PHEMlight.md) -- [carFollowModel="KraussPS"](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#car-following_models) \ No newline at end of file +- [carFollowModel="KraussPS"](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#car-following_models) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Networks/Import/OpenStreetMap.md sumo-1.6.0+dfsg1/docs/web/docs/Networks/Import/OpenStreetMap.md --- sumo-1.5.0+dfsg1/docs/web/docs/Networks/Import/OpenStreetMap.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Networks/Import/OpenStreetMap.md 2020-04-27 21:47:56.000000000 +0000 @@ -50,24 +50,20 @@ ### Recommended [NETCONVERT](../../NETCONVERT.md) Options ``` - --geometry.remove --ramps.guess \ - --junctions.join --tls.guess-signals --tls.discard-simple --tls.join + --geometry.remove --ramps.guess --junctions.join --tls.guess-signals --tls.discard-simple --tls.join --tls.default-type actuated ``` Rationale: -- \--geometry.remove: Simplifies the network (saving space) without +- \--geometry.remove : Simplifies the network (saving space) without changing topology -- \--roundabouts.guess: This sets the appropriate right-of-way rules - at roundabouts. (Explicit right-of-way rules are not imported from - OSM). If this option is not used and roundabouts are not defined - manually, then traffic jams will likely occur at roundabouts -- \--ramps.guess. Acceleration/Deceleration lanes are often not +- \--ramps.guess : Acceleration/Deceleration lanes are often not included in OSM data. This option identifies likely roads that have these additional lanes and causes them to be added -- \--junctions.join. See [\#Junctions](#junctions) -- \--tls.guess-signals, --tls.discard-simple, --tls.join. See +- \--junctions.join : See [\#Junctions](#junctions) +- \--tls.guess-signals --tls.discard-simple --tls.join : See [\#Traffic_Lights](#traffic_lights) +- \--tls.default-type actuated : Default static traffic lights are defined without knowledge about traffic patterns and may work badly in high traffic ### Countries with left-hand driving @@ -85,15 +81,15 @@ recommended typemaps in the folder {{SUMO}}/data/typemap/. They are explained below. -- **osmNetconvert.typ.xml** default settings. appropriate for rural +- **osmNetconvert.typ.xml** default settings, appropriate for rural and motorway scenarios. This is used in the absence of user-specified types. All other typemaps are intended as *patches* - to this typemap + to this typemap. - **osmNetconvertUrbanDe.typ.xml** Changes default speeds to reflect - typical urban speed limits (50km/h) + typical urban speed limits (50km/h). - **osmNetconvertPedestrians.typ.xml** Adds sidewalks for some edge - types and sets permissions appropriate for pedestrian simulation -- **osmNetconvertBicycle.typ.xml** imports bicycle lanes + types and sets permissions appropriate for pedestrian simulation. +- **osmNetconvertBicycle.typ.xml** Imports bicycle lanes. - **osmNetconvertShips.typ.xml** Imports waterways and ferry routes. This typemap can be combined with any other typemap. - **osmNetconvertRailUsage.typ.xml** Imports additional @@ -102,7 +98,7 @@ in combination with other typemaps. - **osmBidiRailNetconvert.typ.xml**. Changes the default from uni-directional railroads to bi-directional railroads. This may be - usefull in some regions of the world where OSM contributors used + 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}}. @@ -386,8 +382,8 @@ *From George Dita, on 01.07.2009* [JOSM](http://josm.openstreetmap.de/) can be used to edit OSM-data (i.e. for trimming a rectangular map and -deleting unwated features). After you delete the part that does not -interest you have to alter the file using xmlstarlet which actually +deleting unwanted features). After you delete the part that does not +interest you, you have to alter the file using xmlstarlet which actually deletes the nodes. xmlstarlet can be used like this: @@ -421,7 +417,7 @@ When importing road networks, [NETCONVERT](../../NETCONVERT.md) searches for the street type, encoded in OSM as a key/value-pair where the key is either "*highway*", "*railway*" or "*waterway*". Only if such -a key occures in the edge definition, the edge is imported (see also +a key occurs in the edge definition, the edge is imported (see also below). The edge's type name is built from the found key/value pair by building a name as: **.**. Using this type name, the edge's attributes are determined using a predefined map of type names to type @@ -441,11 +437,11 @@ ## Explicite Road Attributes -In the case an edge contains the definition about the number of lanes +In case an edge contains the definition about the number of lanes (key="*lanes*") or the allowed speed (key="*maxspeed*"), this information is used instead of the according type's value. Also, the per-edge information whether the edge is a one-way edge is read -(key="*oneway*"). In the case the edge belongs to a roundabout +(key="*oneway*"). In case the edge belongs to a roundabout (key="*junction*" and value="*roundabout*"), it is also set as being a one-way edge. @@ -544,10 +540,10 @@ The following data is imported: -- Public transport Stops +- Public transport stops - Public transport lines that service these stops -Pulic transport schedules which are needed to make use of the above data +Public transport schedules which are needed to make use of the above data are generated with a user-defined service period based on a simulation of the lines. @@ -581,7 +577,7 @@      return data, query ``` -Caution: If the data volume is too large, the overpass Api abort. +Caution: If the data volume is too large, the overpass API aborts. More information about the query syntax and a GUI for testing the querys can be found on the website . @@ -599,4 +595,4 @@ - - the home site - - the German home site - - information - about database attributes \ No newline at end of file + about database attributes diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Networks/Import/SUMO_Road_Networks.md sumo-1.6.0+dfsg1/docs/web/docs/Networks/Import/SUMO_Road_Networks.md --- sumo-1.5.0+dfsg1/docs/web/docs/Networks/Import/SUMO_Road_Networks.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Networks/Import/SUMO_Road_Networks.md 2020-04-27 21:47:56.000000000 +0000 @@ -8,7 +8,7 @@ network, the shorter options **--sumo-net** {{DT_FILE}} and **--sumo** {{DT_FILE}} are synonymes. An example call: ``` -netconvert --sumo mySUMOnet.net.xml -o mySUMOnet2.net.xml +netconvert --sumo-net-file mySUMOnet.net.xml -o mySUMOnet2.net.xml ``` Note that in this case, both the read network ("mySUMOnet.net.xml") and @@ -32,4 +32,4 @@ ``` netconvert --sumo-net-file your.net.xml --node-files patch.nod.xml -o yourpatched.net.xml -``` \ No newline at end of file +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Networks/PlainXML.md sumo-1.6.0+dfsg1/docs/web/docs/Networks/PlainXML.md --- sumo-1.5.0+dfsg1/docs/web/docs/Networks/PlainXML.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Networks/PlainXML.md 2020-04-27 21:47:56.000000000 +0000 @@ -274,7 +274,7 @@ Sometimes your network may contain nodes which are very close together forming a big cluster. This happens frequently when [Importing Networks from OpenStreetMap](../Networks/Import/OpenStreetMap.md). [NETCONVERT](../NETCONVERT.md) supports the option **--junctions.join** to find such -clusters and join them into a big and well shaped junction. +clusters and join them into a big and well shaped junction. Junctions can also be joined manually with [NETEDIT](../NETEDIT.md#processing_menu_options). It is even possible to [undo joins](../NETEDIT.md#junction) that were computed automatically. ### Reasons for joining node clusters Within an intersection, special rules of traffic do apply. When modelling an intersection by a cluster of nodes, the edges within the cluster are regular roads where these rules cannot be applied. @@ -425,7 +425,7 @@ | priority | int | The priority of the edge. Used for [\#Right-of-way](#right-of-way)-computation | | length | float | The length of the edge in meter | | 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\!). | If the shape is given it should start and end with the positions of the from-node and to-node. Alternatively it can also start and end with the position where the edge leaves or enters the junction shape. This gives some control over the final junction shape. When using the option **--plain.extend-edge-shape** it is sufficient to supply inner geometry points and extend the shape with the starting and ending node positions automatically | -| spreadType | enum ( "right", "center" ) | The description of how to spread the lanes; "center" spreads lanes to both directions of the shape, any other value will be interpreted as "right" | +| spreadType | enum ( "right", "center", "roadCenter") | The description of how to compute lane geometry from edge geometry. See [SpreadType](#spreadtype) | | allow | list of vehicle classes | List of permitted vehicle classes (see [access permissions](#road_access_permissions_allow_disallow)) | | disallow | list of vehicle classes | List of forbidden vehicle classes (see [access permissions](#road_access_permissions_allow_disallow)) | | width | float | lane width for all lanes of this edge in meters (used for visualization) | @@ -473,6 +473,13 @@ !!! caution There are some constraints about the streets' ids. They must not contain any of the following characters: '_' (underline - used for lane ids), '[' and ']' (used for enumerations), ' ' (space - used as list divider), '*' (star, used as wildcard), ':' (used as marker for internal lanes). +## SpreadType +Each edge has a geometry definition (which defaults to the straight-line between from-junction and to-junction position). +The spreadType defines how to compute the lane geometry from the edge geometry: +- **right** (default): The edge geometry is interpreted as the left side of the edge and lanes flare out to the right. This works well if edges in opposite directions have the same (or rather reversed) geometry. +- **center**: The edge geometry is interpreted as the middle of the directional edge and lanes flare out symmetrically to both sides. This is appropriate for one-way edges +- **roadCenter**: The edge geometry is interpreted as the middle of a bi-directional road. This works well when both directional edges have a different lane number. + ## Road access permissions (allow, disallow) [access permissions](../Simulation/VehiclePermissions.md) are an diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/POLYCONVERT.md sumo-1.6.0+dfsg1/docs/web/docs/POLYCONVERT.md --- sumo-1.5.0+dfsg1/docs/web/docs/POLYCONVERT.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/POLYCONVERT.md 2020-04-27 21:47:56.000000000 +0000 @@ -79,6 +79,7 @@ | **--osm.merge-relations** {{DT_FLOAT}} | If FLOAT >= 0, assemble one polygon from all ways of a relation if they all connect with gaps below FLOAT; *default:* **-1** | | **--shapefile-prefixes** {{DT_FILE}} | Reads shapes from shapefiles FILE+ | | **--shapefile.guess-projection** {{DT_BOOL}} | Guesses the shapefile's projection; *default:* **false** | +| **--shapefile.traditional-axis-mapping** {{DT_BOOL}} | Use traditional axis order (lon, lat); *default:* **false** | | **--shapefile.id-column** {{DT_STR}} | Defines in which column the id can be found | | **--shapefile.type-columns** {{DT_STR[]}} | Defines which columns form the type id (comma separated list) | | **--shapefile.use-running-id** {{DT_BOOL}} | A running number will be used as id; *default:* **false** | diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Bicycles.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Bicycles.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Bicycles.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Bicycles.md 2020-04-27 21:47:56.000000000 +0000 @@ -136,4 +136,8 @@ the road) must yield to straight-going vehicles. !!! caution - The trajectories of left-turning bicycles use a wide curve rather than going straight twice. Currently, this can only be remedied by setting [custom shapes for these internal lanes](../Networks/PlainXML.md#custom_shapes_for_internal_lanes_crossings_and_walkingareas). \ No newline at end of file + The trajectories of left-turning bicycles use a wide curve rather than going straight twice. Currently, this can only be remedied by setting [custom shapes for these internal lanes](../Networks/PlainXML.md#custom_shapes_for_internal_lanes_crossings_and_walkingareas). + +# Bicycle routing + +When [routing bicycles in the simulation](../Demand/Automatic_Routing.md) the option **--device.rerouting.bike-speeds** can be used to enable separate tracking of bicycle speeds. This ensure that routing for bicycles which can use a dedicated bicycle lane is not affected by jammed cars. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Calibrator.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Calibrator.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Calibrator.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Calibrator.md 2020-04-27 21:47:56.000000000 +0000 @@ -105,6 +105,9 @@ This type of calibrator will modify the types of all passing vehicles (or all vehicles that match the `vTypes` attribute of the calibrator). The normal behavior is to replace the type of the passing vehicles with the type set in the flow element. +!!! note + When calibrating types, the 'route' attribute can be omitted from the flow defintion + ### Mapping between vTypeDistributions A special behavior is activated if the following conditions are met: - the `type` in the flow element references a `vTypeDistribution` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/GenericParameters.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/GenericParameters.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/GenericParameters.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/GenericParameters.md 2020-04-27 21:47:56.000000000 +0000 @@ -31,6 +31,7 @@ [SUMO-GUI](../SUMO-GUI.md) dialogs or when inspecting XML files) - retaining custom information when [saving and loading simulation state](SaveAndLoad.md) +- tracking the [public transport 'tripId' that may change at stops](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#stops). Parameters are always defined as child elements of the respective object: diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output/FCDOutput.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output/FCDOutput.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output/FCDOutput.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output/FCDOutput.md 2020-04-27 21:47:56.000000000 +0000 @@ -96,6 +96,9 @@ ## Filtering / Restricting Output +!!! caution + The generated output files can become quite large. To write [gzipped](https://en.wikipedia.org/wiki/Gzip) output files, simply name the output file with an `.gz` extension. + ### Restricting the set of vehicles that generate output Output can be restricted to specific vehicle types or vehicle ids by [controlling the set of vehicles that are equipped](../../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#devices) with the **fcd**-device. The following example restricts output to a single vehicle called *ego*: @@ -117,10 +120,13 @@ ## Further Options -- using the option **--fcd-output.geo** will toggle output coordinates to WGS84 (for +- **--fcd-output.geo** will toggle output coordinates to WGS84 (for geo-referenced networks) -- using the option **--fcd-output.signals** will add [signal state +- **--fcd-output.signals** will add [signal state 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.params KEY1,KEY2,...** adds generic parameters](Simulation/GenericParameters.md) to the output ## NOTES diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output/TripInfo.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output/TripInfo.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output/TripInfo.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output/TripInfo.md 2020-04-27 21:47:56.000000000 +0000 @@ -99,6 +99,22 @@ | `NOx_abs` | mg | The complete amount of NOx emitted by the vehicle during the trip | | `fuel_abs` | ml | The complete amount of fuel the vehicle used during the trip | +## Output for vehicles that have not arrived at simulation end +By default, tripinfo-output is only written on vehicle arrival. This means vehicles that have not arrived at simulation end (i.e. due to option **--end**) generate no output. +To change this, the option **--tripinfo-output.write-unfinished** can be used. + +## Output only for selected vehicles or vehicle types +By default all vehicles will generated tripinfo-output. By [assigning a tripinfo device](../../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#devices) to selected vehicles or types, this can be changed. + +Example: +Setting SUMO-option **--device.tripinfo.probability false** will disable the device for all vehicles by default. +The following definition overrides this default end enables the device for busses: +``` + + + +``` + ## Person and Container Output If the simulation contains persons or containers, the following elements @@ -144,4 +160,4 @@ the option **--duration-log.statistics** (see [Commandline Output](../../Simulation/Output.md#commandline_output_verbose)). For further aggregation see -[Tools/Xml\#xml2csv.py](../../Tools/Xml.md#xml2csvpy). \ No newline at end of file +[Tools/Xml\#xml2csv.py](../../Tools/Xml.md#xml2csvpy). diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Output.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Output.md 2020-04-27 21:47:56.000000000 +0000 @@ -102,19 +102,22 @@ calculation of the actual tailback in front of a junction ## values for junctions +There is no dedicated output format for traffic at junctions. Instead junction related traffic can be measured by placing detectors that measure traffic at the intersection. - [Tools/Output\#generateTLSE1Detectors.py](../Tools/Output.md#generatetlse1detectorspy) script for generating induction loop detectors around all - TLS-controlled intersections + TLS-controlled intersections (point-based detected on individual lanes) - [Tools/Output\#generateTLSE2Detectors.py](../Tools/Output.md#generatetlse2detectorspy) script for generating lane-area detectors around all TLS-controlled - intersections + intersections (area-based detection on individual lanes) - [Tools/Output\#generateTLSE3Detectors.py](../Tools/Output.md#generatetlse3detectorspy) script for generating multi-entry-exit detectors around all TLS-controlled intersections or for an arbitrary list of intersections. The detectors can be configured to either aggregate or separate the approaching edges and to include or exclude the - junction interior. + junction interior. (area-based detection on edges) + +Alternatively, the [values for edges or lanes](Output.md#values_for_edges_or_lanes) can be manually aggregated to obtain the flow at at a junction. ## vehicle-based information @@ -218,8 +221,9 @@ - "Real time factor": The quotient of *simulated time* / *computation time*. If one hour is simulated in 360 seconds the real time factor is 10. -- UPS: (updates per second). The number of vehicles that were - simulated on average per second of computation time. +- UPS: (updates per second). The number of vehicle updates that were + performed on average per second of computation time. If a single + vehicle update takes on average one millisecond, this will be 1000. If routing took place in the simulation, Each routing algorithm instance will report diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/ParkingArea.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/ParkingArea.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/ParkingArea.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/ParkingArea.md 2020-04-27 21:47:56.000000000 +0000 @@ -55,7 +55,7 @@ | friendlyPos | bool | *true,false* | *false* | whether invalid stop positions should be corrected automatically (default *false*) | | name | string | simple String | | Arbitrary text to describe the parking area. This is only used for visualization purposes. | | roadsideCapacity | int | non-negative | 0 | The number of parking spaces for road-side parking | -| onRoad | bool | | false | Whether vehicles remain on the road while parking.
    **Note:**
    If set to *true*, only roadSideCapacity is used and no ``-definitions are permitted. | +| onRoad | bool | | false | Whether vehicles remain on the road while parking.
    **Note:**
    If set to *true*, only roadsideCapacity is used and no ``-definitions are permitted. | | width | float | positive | 3.2 | The width of the road-side parking spaces | | length | float | positive | (endPos - startPos) / roadsideCapacity | The length of the road-side parking spaces | | angle | float (degree) | | 0 | The angle of the road-side parking spaces relative to the lane angle, positive means clockwise | @@ -126,4 +126,4 @@ - **parkingArea.capacity**: total number of parking spaces (roadsideCapacity + number of `` elements) - **parkingArea.occupancy**: number of vehicles parking at this - parking area \ No newline at end of file + parking area diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Public_Transport.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Public_Transport.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Public_Transport.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Public_Transport.md 2020-04-27 21:47:56.000000000 +0000 @@ -2,6 +2,10 @@ title: Simulation/Public Transport permalink: /Simulation/Public_Transport/ --- +# Introduction +Most public transport uses fixed routes (busses, trams and trains) and this page describes how to model this type of transport. For demand responsive transport that is more flexible see [Taxi](Taxi.md). + +The descriptions below describe how to model busses but the same rules apply for trams, subways and trains. # Bus Stops @@ -97,10 +101,64 @@             ``` - The vehicle will take the fastest path between *from*-edge and *to*-edge that visits all stops in their correct order. +Even the trip attributes 'from' and 'to' can be ommitted to let the bus start at the first stop and end at the last. Using `departPos="stop"`, the vehicle will be inserted directly at the first stop in it's route: +``` +    +       +        +        +        +    +``` + +# Public Transport Schedules +In most cases, public transport runs according to a fixed schedule. Such a schedule must be defined using the `until` attribute in the stops. Vehicles in the simulation will adhere to the schedule as they cannot leave a stop before the until-time is reached but they may still be delayed due to traffic. When `until` and `duration` are used, duration defines the minimum stopping time which can also cause delayed departures when already arriving late at a stop. + +!!! note + Defining a public transport schedule is necessary for [intermodal routing](../IntermodalRouting.md). + +## Single vehicles and trips +When defining until values for a vehicle and trip, the values denote absolute simulation. Times. Note, that seconds or human-readable times may be used. + +``` + + + + + +``` + +## Flows +When defining a vehicle flow the until-times are absolute times for the first vehicle in the flow. For all later vehicles, the times will be shifted according to later departure times (period * vehicleIndex). + +The example below defines a flow that inserts two vehicles. The first vehicle will stop until 10,110,210 and the second vehicle will stop until 310,410,510: +```xml + + + + + +``` + +## Stops in a stand-alone route +Stops may also be part of a route that is defined by itself (with an id) and referenced by vehicles or flows. In that case the until times will be interpreted as 'times after vehicle departure'. + +The example below defines a flow that inserts two vehicles. The first vehicle will depart at 500 and stop until 510,610,710. The second vehicle will depart at 800 and stop until 810,910,1010: + +```xml + + + + + + + + +``` + # Stopping without defining a bus stop You may also let a vehicle stop at another position than a bus stop. The @@ -110,6 +168,9 @@ "stop"-element of a vehicle see [Definition_of_Vehicles,_Vehicle_Types,_and_Routes\#Stops](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#stops). +# Transport Schedules +To define a schedule where buses + # Passengers [Additional definitions are necessary if the persons using the public @@ -126,4 +187,4 @@ This import uses an intermediate data format to describe public transport lines. The usage of this line data is explained at -[Tutorials/PT_from_OpenStreetMap](../Tutorials/PT_from_OpenStreetMap.md) \ No newline at end of file +[Tutorials/PT_from_OpenStreetMap](../Tutorials/PT_from_OpenStreetMap.md) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Railways.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Railways.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Railways.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Railways.md 2020-04-27 21:47:56.000000000 +0000 @@ -152,6 +152,23 @@ !!! note Negative distance values are not currently supported (pending introduction of another attribute) +# Routing on Bidirectional Tracks +When train tracks can be used in both directions, there is considerable freedom for trains when search a path through the network. To reduce the number of conflicts (when two vehicles want to use the same track in opposite directions), the preferred direction for each track can be defined and factored into the routing decision. + +When routes are computed in the simulation, this is done by setting the option **--device.rerouting.priority-factor FLOAT**. This causes the priority values of edges to be factored into the routing decision with higher values being preferred. +At the default value of 0. Edge priority is ignored when routing. When setting a positive value, the edges with the lowest priority receive a penalty factor to their estimated travel time of 1 + FLOAT whereas the edges with the highest priority receive no penalty. Edges with medium priority will receive a penality of 1 + x * FLOAT where + +``` + x = (edgePriority - minPriority) / (maxPriority - minPriority) +``` + +The priority values can either be assigned by the user or computed heuristically by [NETCONVERT](../NETCONVERT.md) by setting the option **--railway.topology.direction-priority**. This requires that some of the tracks in the network are uni-directional (to unambiguously define the main direction). The assigned priority values are: + +- 4: unidirectional track +- 3: main direction of bidirectional track +- 2: undetermined main direction (straight continuation from different directions of unidirectional track) +- 1: undetermined main direction (no continuation from unidirectional track) +- 0: reverse of main direction of bidirectional track # Modelling Trains diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Routing.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Routing.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Routing.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Routing.md 2020-04-27 21:47:56.000000000 +0000 @@ -92,8 +92,45 @@ Note that the travel time values which are set in this way are used for the full duration of the simulation unless updated again. +# Routing by Traveltime and Edge Priority +Sometimes it is useful to guide route search with additional information while still taking travel times into account. +For this use case the option **--weights.priority-factor FLOAT** can be used with [SUMO](../SUMO.md) and [DUAROUTER](../DUAROUTER.md). + +When this option is set, the priority value of each edge is factored into the routing decision so that low-priority edges receive a penalty (they appear to be slower) whereas high-priority edges receive little or no penalty. For the option value `PriorityFactor`, the penalty is computed thus: +``` + MinEdgePriority : minimum priority value of all edges + MaxEdgePriority : maximum priority value of all edges + EdgePriorityRange = MaxEdgePriority - MinEdgePriority + + relativeInversePrio = 1 - ((edgePriority - MinEdgePriority) / EdgePriorityRange) + effort = traveltime * (1 + relativeInversePrio * PriorityFactor) +``` +As a consequence: + +- the highest priority edge will get no penalty +- the traveltime of the lowest priority edge is multiplied with 1+PriorityFactor, +- edges with in-between priorities will get a scaled penalty + # Routing by *effort* +By default, the objective of the routing algorithms is to minimize the travel time between origin and destination. +The traveltime can either be computed from the speed limits and vehicle maximum speed, it can be estimated at runtime from the simulation state or it can be loaded from a data file. The latter option allows defining travel times for the future. +An example for the relevance of future travel times would be this: +- a vehicle departs for a long trip at a time where there is no jamming +- it is known that parts of the network will be jammed later +- the route of the vehicle computed at departure time can circumvent the jam because the routing algorithm is aware that by the time those edges are reached they will be jammed. + +It may be useful to compute routes which minimize some other criteria (called **effort**) besides travel time (distance, emissions, price, ...). +When these quantities are meant to change over time, the routing algorithm needs two kinds of values for each edge: + +- the **effort** that shall be minimized +- the **travel time** for the edge. + +The travel time is needed to compute at which time a certain edge is reached so that effors which change over time can be used correctly. + +!!! note + When the effort values do not change over time, routing by effort can be achieved by loading weight-files with a modified `traveltime` attribute (the effort value is written into the traveltime attribute) and the option **--weight-attribute** can be omitted. + When setting the options **--weight-file** and **--weight-attribute**, additional routing efforts are read according to the specified attribute. These are only used when calling the TraCI function [reroute by effort](../TraCI/Change_Vehicle_State.md). The assumed efforts @@ -102,7 +139,10 @@ also be set using *traci.edge.setEffort*. !!! caution - The default effort value is -1 which causes detour routes to be preferred when not loading sensible effort values. + The default effort value is 0 which causes detour routes to be preferred when not loading sensible effort values. + +The applications [DUAROUTER](../DUAROUTER.md) and [MAROUTER](../MAROUTER.md) also support the options **--weight-file** and **--weight-attribute** but they can only be used with one of the weight attributes "CO", "CO2", "PMx", "HC", "NOx", "fuel", "electricity", "noise". However, the will still work as expected when the user loads custom effort values for these attributes. + # Routing by *distance* diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Safety.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Safety.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Safety.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Safety.md 2020-04-27 21:47:56.000000000 +0000 @@ -27,7 +27,7 @@ - **teleport**: (the default): the follower vehicle is moved (teleported) to the next edge on its route - **warn**: a warning is issued -- **none**: no action is take +- **none**: no action is taken - **remove**: both vehicles are removed from the simulation Additionally there is the possibility of stopping vehicles for a fixed @@ -45,10 +45,28 @@ commands speedMode and laneChangeMode](../TraCI/Change_Vehicle_State.md). -To create rear-end collisions with some probability one can configure -vehicles with a value of *tau* that is lower than the simulation step -size (default 1s) and use the default Krauss model. +### Collisions during car-following +Rear-end collisiosn during normal driving may be caused by any of the following: +- vehicles with a value of *tau* that is lower than the simulation step +size (default 1s) when using the default Krauss model. +- vehicles with a value of *tau* that is lower than their *actionStepLength* +- vehicles with an *apparentDecel* parameter that is lower than their *decel* parameter (causing other drivers to misjudge their deceleration capabilities) +- [driver imperfection modelled with the + *driverstate*-device](../Driver_State.md) + +### Collisions related to lane-changing +Collisions from lane-changing can be caused by unsafe lateral movements (side collisions) and by changing lanes in a way that creates unsafe following situations (rear-end collisions). + +Side collosions can be caused by +- configuring lateral imperfection with vType parameter *lcSigma* +- allowing lateral enchroachment with vType parameter *lcPushy* (but this parameter itself will not cause collisions, only reduce lateral gaps in some situations, requires the sublane model) +- *lcImpatience* (growing impatience permits lower lateral gaps when using the sublane model) + +Unsafe changing can be caused by configuringlower gap acceptance with parameter +- *lcAssertive* (the acceptable gap is computed by dividing the safe gap by lcAssertive) + +### Collisions at Intersections Collisions at intersections may be caused by any of the following: - Unsafe [junction model @@ -164,9 +182,11 @@ - lcPushy: setting this to values between 0 and 1 causes aggressive lateral encroachment (only when using the [Sublane Model](../Simulation/SublaneModel.md)) +- lcImpatience: Repeated failure to change lanes causes lower lateral gaps to be accepted when using the sublane model - lcAssertive: setting this values above 1 cause acceptance of smaller longitudinal gaps in proportion to driver impatience(only when using the [Sublane Model](../Simulation/SublaneModel.md)) +- lcSigma: models random lateral variations (lane keeping imperfection) ## Junction Model diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/SaveAndLoad.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/SaveAndLoad.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/SaveAndLoad.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/SaveAndLoad.md 2020-04-27 21:47:56.000000000 +0000 @@ -53,11 +53,14 @@ input file that are already present in the simulation state, these vehicles are automatically ignored and loading proceeds without errors. +# Random number generators (RNG) +By default, the state of the [random number generators](Randomness.md) is not saved. Thus, +simulations will behave differently from the original after being reloaded from a state. + +When setting option **--save-state.rng**, the state of all random number generators will be included in the state and restored upon loading. Saving this extra state costs about 500Kb. If this overhead is too high it can be reduced by setting a lower value of **--thread-rngs** (default 64). The value should be no lower than the number of threads used for routing or simulation (**--threads, **--device.rerouting.threads**). + # Know Issues -- The state of the random number generate is not saved. Thus, - simulations will behave differently from the original after being - reloaded from a state. - The internal state of the lanChangeModel is not saved - the internal state of the carFollowModel is not saved (not all models have this). - Persons are not saved diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Taxi.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Taxi.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Taxi.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Taxi.md 2020-04-27 21:47:56.000000000 +0000 @@ -47,6 +47,16 @@ ``` +## Groups of Persons +Multiple persons can travel together as a group using attribute `group` (if the taxi has sufficient capacity): + + + + + + + + # Dispatch The dispatch algorithm assigns taxis to waiting customers. The algorithm is selected using option **--device.taxi.dispatch-algorithm ALGONAME**. The following @@ -60,6 +70,8 @@ travel time) is assigned. If the reservation date is too far in the future, the customer is postponed. +- greedyShared: like 'greed' but tries to pick up another passenger while delivering the first passenger to it's destination. The algorithm supports parameters **absLossThreshold** and **relLossThreshold** to configure acceptable detours. + !!! note User-contributed dispatch algorithms are welcome. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Traffic_Lights.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Traffic_Lights.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Traffic_Lights.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Traffic_Lights.md 2020-04-27 21:47:56.000000000 +0000 @@ -20,6 +20,7 @@ - All traffic lights are generated with a fixed cycle and a default cycle time of 90s. This can be changed with the option **--tls.cycle.time**. +- The green time is split equally between the main phases - All green phases are followed by a yellow phase. The length of the yellow phase is computed from the maximum speed of the incoming roads but may be customized with the option **--tls.yellow.time** @@ -38,6 +39,8 @@ would typically be a left-turning phase). The duration of this phase defaults to 6s and can be customized (or disabled) by setting the option **--tls.left-green.time**. +- The generatedd cycle starts at time 0 by default with a green phase for the first main direction + (sorted by road priority, lane count and speed). This can be influnced for a specified list of traffic light ids using the options **--tls.half-offset TLS1,TLS2,..** and **--tls.quarter-offset TLS3,TLS4,...**. (shifting the start of the first phase by the indicated fraction of the cycle time). - In reality there are often phases where all streams have red to allow clearing an intersection. SUMO does not build these phases by default. To have each green phase preceded by an all-red phase, the @@ -198,7 +201,9 @@ ![traci_tutorial_tls.png](../images/Traci_tutorial_tls.png -"traci_tutorial_tls.png")Example: traffic light with the current state +"traci_tutorial_tls.png") + +Example: traffic light with the current state **"GrGr"**. The leftmost letter "G" encodes the green light for link 0, followed by red for link 1, green for link 2 and red for link 3. The link numbers are enabled via [SUMO-GUI settings](../SUMO-GUI.md) by @@ -261,6 +266,7 @@ This is done to prevent useless phase extensions when the first vehicle on a given lane is not allowed to drive. Sumo will issue a warning a phase or link index does not have usable detectors. + #### Example ``` @@ -288,6 +294,15 @@ detectors](../Simulation/Output/Induction_Loops_Detectors_(E1).md). The examples values are the default values for these parameters. +#### Custom Detectors +To use custom detectors (i.e. for custom placement or output) additional parameters can be defined where KEY is a lane that is incoming to the traffic light and VALUE is a user-defined inductionLoop (that could also lie on another upstream lane). +``` + +``` + +!!! caution + Custom detectors only work when the 'tlLogic' is loaded from an additional file. + #### 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: @@ -350,6 +365,15 @@ intersection." Transportation Research Board 2011 (90th Annual Meeting). 2011.\] for details. +#### Custom Detectors +To use custom detectors (i.e. for custom placement or output) additional parameters can be defined where KEY is a lane that is incoming to the traffic light and VALUE is a user-defined laneAreaDetector. +``` + +``` +!!! caution + Custom detectors only work when the 'tlLogic' is loaded from an additional file. + + ## Interaction between signal plans and right-of-way rules Every traffic light intersection has the right-of-way rules of a diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Turnarounds.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Turnarounds.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/Turnarounds.md 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/Turnarounds.md 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,57 @@ +--- +title: Simulation/Turnarounds +permalink: /Simulation/Turnarounds/ +--- + +# Introduction +Vehicles that wish to perfom a turn-around maneuver can be a source of jams and deadlocks in the simulation. +A typical reason why vehicles need to perform a turn-around is because they have to depart and arrive in a particular direction on their first and last edge and this does not fit their preferred direction of travel. + +In some way, this behavior is unrealistic because in reality, vehicles that depart from home can often select their initial directly of travel freely without the need for a turn-around. In other situations such as parallel parking on a divided road, turn-arounds are often necessary. + +Consequently, there are two avenues for avoiding the negative effects of turn-arounds described below. + +# Avoiding the need for turnarounds + +## Trips between junctions +Instead of defining trips between edges, [trips can be defined between junctions](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#routing_between_junctions). +When this is done, vehicles will always depart on an edge that goes into the +correct direction because on initial routing they are free to pick the edge +that best suites their direction of travel. + +Besides defining trips manually, trips between junctions can also be achieved +with + +- [Random Trips option **--junction-taz**](../Tools/Trip.md#randomtripspy) +- [DUARUTER options **--write-trips.junctions**](../DUAROUTER.md) + +!!! caution + When loading trips with `fromJunction` or `toJunction` attributes with [SUMO](../SUMO.md) or [DUAROUTER](../DUAROUTER.md), the option **--junction-taz** must be set or an equivalent TAZ-file must be loaded. + +## Trips between TAZ +Instead of departing as junctions (which internally use specialised TAZ), the +user may define traffic larger assignment zones (TAZ / districts) as origins and +destinations of travel. This will also cause vehicles to pick a suitable +direction. If the main goal of these zones is to avoid turnarounds, then the +tool [generateBidiDistricts.py](../Tools/District.md#generatebididistrictspy) may +be used. + +## Modifying existing routes +If routes between edges already exist, the [DUAROUTER option **--remove-loops**](../DUAROUTER.md) can be used to shorten the roads in a way that avoids turn-arounds. + +# Controlling where turnarounds may happen +By removing turnaround connections from a network (i.e. with +[NETEDIT](../NETEDIT.md), turnarounds and unsuitable locations can be prevented. + +Often it is easier to control the generation of turnaround connections when +importing the network. For this purpose [NETCONVERT](../NETCONVERT.md) provides a number of options. + +- **--no-turnarounds** : Disables build turnarounds. This may cause vehicles to + take long detoures so they can achieve a turnaround by turning right or left repeatedly. +- **--no-turnarounds.tls** : Disables building turnarounds at tls-controlled junctions" +- **--no-turnarounds.geometry** : Disables building turnarounds at geometry-like junctions. This option is active by default to prevent vehicles from turning around on narrow roads +- **--no-turnarounds.except-deadend** : Disables building turnarounds except at dead end junctions. This option ensures that vehicles can exit from a cul-de-sac +- **--no-turnarounds.except-turnlane** : Disables building turnarounds except at at junctions with a dedicated turning lane. This option offers a good compromise between preventing turnarounds related jams and avoiding long detoures. In the presence of a dedicated turning lane, a vehicle that has to wait for turning around is less disruptive to the rest of the traffic. +- **--no-turnarounds.fringe** : Disables building turnarounds at fringe junctions. The purpose for this option is to prevent turn-arounds at the boundary of the network where edges are cut of (like a cul-de-sac) but in reality they would actually continue beyond the boundaries of the scenario. In these locations turn-arounds typically should not happen. In order to take effect, this option requires that boundary junctions have the attribut `fringe="outer"` set. This can be accomplished by setting the option **--fringe.guess**. + + diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Simulation/VehicleInsertion.md sumo-1.6.0+dfsg1/docs/web/docs/Simulation/VehicleInsertion.md --- sumo-1.5.0+dfsg1/docs/web/docs/Simulation/VehicleInsertion.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Simulation/VehicleInsertion.md 2020-04-27 21:47:56.000000000 +0000 @@ -74,6 +74,10 @@ vehicles* for the whole network. - The parameter Dialog for individual vehicles lists *desired depart* and *depart delay* + +## Effect of simulation step-length +Insertion attemps can only happen in every simulation step. This may cause artifacts in insertion spacing because at the default step-length of 1s is (usually) too short for vehicles to be inserted in successive steps on the same depart location. +By default, the next attempt happens 2 seconds after the first vehicle has departed and this gap may be much larger then mandated by the carFollowModel. To avoid this effect, either the step-lenght can be reduced or the insertion location must be modified. The latter can either be done by specifying a specific departPos or by using `departPos="last"`. ## Forcing Insertion / Avoiding depart delay @@ -103,6 +107,7 @@ - **--eager-insert** {{DT_BOOL}}: tries to insert all vehicles that are insertion-delayed on each edge. By default, insertion on an edge stops after the first failure in each time step +- **--step-length** {{DT_FLOAT}}: the frequency of insertion attempts can be raised and also the number of possible headways (for a fixed departPos) is increased by setting a lower step-length. # Miscellaneous @@ -114,4 +119,4 @@ device.rerouting](../Demand/Automatic_Routing.md) - 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) \ No newline at end of file + (TAZ)](../Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#traffic_assignement_zones_taz) diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/SUMO-GUI.md sumo-1.6.0+dfsg1/docs/web/docs/SUMO-GUI.md --- sumo-1.5.0+dfsg1/docs/web/docs/SUMO-GUI.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/SUMO-GUI.md 2020-04-27 21:47:56.000000000 +0000 @@ -800,8 +800,6 @@ !!! note In the gui-settings dialog, the function 'Recalibrate Rainbow' can be used to adapt the coloring to the data range of the current attribute. -## Version 1.2.0 and later - Edgedata files for visualization can be loaded by setting option **--edgedata-files**. All attributes will be loaded and can be selected in the edge visualization settings They can also be loaded in **SUMO-GUI** from @@ -815,32 +813,7 @@ !!! note edgeData is time based so it will only be shown when the simulation time has advance to the begin time of the respective data interval. Make sure to advance the simulation to time 0 (step once) or to whatever begin time was used for edgeData generation before using *Recalibrate Rainbow*. To see further data frames, advance the simulation by using delay or breakpoints. -When defining a color scheme two data values can be used to diagnose -missing data: - -- **-2**: the attribute does not exist in the loaded data for that - particular edge -- **-1**: the attribute exists but no data is available for that edge - for the current time - -!!! note - It may be useful to hide edges with attribute value -1 and -2 by setting the alpha channel to 0. To Make this work, a distinct color value must be set for *0* to avoid interpolation. - -## Version 1.1.0 and older - -``` -sumo-gui -n net.net.xml --weight-files edgedata.xml -e 86400 --weight-attribute  -``` - -When using edgeData-output could be *arrived* or *departed* to -investigate traffic sources and sinks in the network. - -When using **SUMO-GUI** for visualizing weight files -with values that change over time (files containing multiple intervals) -and no vehicles are being simulated, it is helpful to load the -simulation with option **--end** to avoid premature simulation and to set a -*delay* value or [\#Breakpoints](#breakpoints) because the -simulation will otherwise exit quickly when running without vehicles). +When defining a color scheme, a dedicated color for missing data ('No Data') can always be configured. # Usage Examples diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/SUMO.md sumo-1.6.0+dfsg1/docs/web/docs/SUMO.md --- sumo-1.5.0+dfsg1/docs/web/docs/SUMO.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/SUMO.md 2020-04-27 21:47:56.000000000 +0000 @@ -95,6 +95,7 @@ | **--fcd-output.signals** {{DT_BOOL}} | Add the vehicle signal state to the FCD output (brake lights etc.); *default:* **false** | | **--fcd-output.distance** {{DT_BOOL}} | Add kilometrage to the FCD output (linear referencing); *default:* **false** | | **--fcd-output.acceleration** {{DT_BOOL}} | Add acceleration to the FCD output; *default:* **false** | +| **--fcd-output.params** {{DT_STR[]}} | Add generic parameter values to the FCD output | | **--fcd-output.filter-edges.input-file** {{DT_FILE}} | Restrict fcd output to the edge selection from the given input file | | **--full-output** {{DT_FILE}} | Save a lot of information for each timestep (very redundant) | | **--queue-output** {{DT_FILE}} | Save the vehicle queues at the junctions (experimental) | @@ -114,6 +115,7 @@ | **--vehroute-output.write-unfinished** {{DT_BOOL}} | Write vehroute output for vehicles which have not arrived at simulation end; *default:* **false** | | **--vehroute-output.skip-ptlines** {{DT_BOOL}} | Skip vehroute output for public transport vehicles; *default:* **false** | | **--vehroute-output.incomplete** {{DT_BOOL}} | Include invalid routes and route stubs in vehroute output; *default:* **false** | +| **--vehroute-output.stop-edges** {{DT_BOOL}} | Include information about edges between stops; *default:* **false** | | **--link-output** {{DT_FILE}} | Save links states into FILE | | **--railsignal-block-output** {{DT_FILE}} | Save railsignal-blocks into FILE | | **--bt-output** {{DT_FILE}} | Save bluetooth visibilities into FILE (in conjunction with device.btreceiver and device.btsender) | @@ -124,11 +126,12 @@ | **--stop-output** {{DT_FILE}} | Record stops and loading/unloading of passenger and containers for all vehicles into FILE | | **--movereminder-output** {{DT_FILE}} | Save movereminder states of selected vehicles into FILE | | **--movereminder-output.vehicles** {{DT_STR[]}} | List of vehicle ids which shall save their movereminder states | -| **--save-state.times** {{DT_INT[]}} | Use INT[] as times at which a network state written | +| **--save-state.times** {{DT_STR[]}} | Use TIME[] as times at which a network state written | | **--save-state.period** {{DT_TIME}} | save state repeatedly after TIME period; *default:* **-1** | | **--save-state.prefix** {{DT_FILE}} | Prefix for network states; *default:* **state** | -| **--save-state.suffix** {{DT_STR}} | Suffix for network states (.sbx or .xml); *default:* **.sbx** | +| **--save-state.suffix** {{DT_STR}} | Suffix for network states (.xml.gz or .xml); *default:* **.xml.gz** | | **--save-state.files** {{DT_FILE}} | Files for network states | +| **--save-state.rng** {{DT_BOOL}} | Save random number generator states; *default:* **false** | ### Time @@ -143,6 +146,7 @@ | Option | Description | |--------|-------------| | **--step-method.ballistic** {{DT_BOOL}} | Whether to use ballistic method for the positional update of vehicles (default is a semi-implicit Euler method).; *default:* **false** | +| **--extrapolate-departpos** {{DT_BOOL}} | Whether vehicles that depart between simulation steps should extrapolate the depart position; *default:* **false** | | **--threads** {{DT_INT}} | Defines the number of threads for parallel simulation; *default:* **1** | | **--lateral-resolution** {{DT_FLOAT}} | Defines the resolution in m when handling lateral positioning within a lane (with -1 all vehicles drive at the center of their lane; *default:* **-1** | | **-s** {{DT_TIME}}
    **--route-steps** {{DT_TIME}} | Load routes for the next number of seconds ahead; *default:* **200** | @@ -194,6 +198,7 @@ | **--routing-algorithm** {{DT_STR}} | Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']; *default:* **dijkstra** | | **--weights.random-factor** {{DT_FLOAT}} | Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT); *default:* **1** | | **--weights.minor-penalty** {{DT_FLOAT}} | Apply the given time penalty when computing minimum routing costs for minor-link internal lanes; *default:* **1.5** | +| **--weights.priority-factor** {{DT_FLOAT}} | Consider edge priorities in addition to travel times, weighted by factor; *default:* **0** | | **--astar.all-distances** {{DT_FILE}} | Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output) | | **--astar.landmark-distances** {{DT_FILE}} | Initialize lookup table for astar ALT-variant from the given file | | **--persontrip.walkfactor** {{DT_FLOAT}} | Use FLOAT as a factor on pedestrian maximum speed during intermodal routing; *default:* **0.75** | @@ -210,6 +215,8 @@ | **--device.rerouting.init-with-loaded-weights** {{DT_BOOL}} | Use weight files given with option --weight-files for initializing edge weights; *default:* **false** | | **--device.rerouting.threads** {{DT_INT}} | The number of parallel execution threads used for rerouting; *default:* **0** | | **--device.rerouting.synchronize** {{DT_BOOL}} | Let rerouting happen at the same time for all vehicles; *default:* **false** | +| **--device.rerouting.railsignal** {{DT_BOOL}} | Allow rerouting triggered by rail signals.; *default:* **true** | +| **--device.rerouting.bike-speeds** {{DT_BOOL}} | Compute separate average speeds for bicycles; *default:* **false** | | **--device.rerouting.output** {{DT_FILE}} | Save adapting weights to FILE | | **--person-device.rerouting.probability** {{DT_FLOAT}} | The probability for a person to have a 'rerouting' device; *default:* **-1** | | **--person-device.rerouting.explicit** {{DT_STR[]}} | Assign a 'rerouting' device to named persons | @@ -372,8 +379,8 @@ | **--device.taxi.explicit** {{DT_STR[]}} | Assign a 'taxi' device to named vehicles | | **--device.taxi.deterministic** {{DT_BOOL}} | The 'taxi' devices are set deterministic using a fraction of 1000; *default:* **false** | | **--device.taxi.dispatch-algorithm** {{DT_STR}} | The dispatch algorithm [greedy|greedyClosest|greedyShared]; *default:* **greedy** | -| **--device.taxi.dispatch-algorithm.output** {{DT_STR}} | Write information from the dispatch algorithm to FILE; *default:* **greedy** | -| **--device.taxi.dispatch-algorithm.params** {{DT_STR}} | Load dispatch algorith parameters in format KEY1:VALUE1[,KEY2:VALUE]; *default:* **greedy** | +| **--device.taxi.dispatch-algorithm.output** {{DT_STR}} | Write information from the dispatch algorithm to FILE; *default:* **dispatch.xml** | +| **--device.taxi.dispatch-algorithm.params** {{DT_STR}} | Load dispatch algorithm parameters in format KEY1:VALUE1[,KEY2:VALUE] | | **--device.taxi.dispatch-period** {{DT_TIME}} | The period between successive calls to the dispatcher; *default:* **60** | ### Tripinfo Device diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/SUMO_User_Documentation.md sumo-1.6.0+dfsg1/docs/web/docs/SUMO_User_Documentation.md --- sumo-1.5.0+dfsg1/docs/web/docs/SUMO_User_Documentation.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/SUMO_User_Documentation.md 2020-04-27 21:47:56.000000000 +0000 @@ -18,7 +18,7 @@ [Publications](Publications.md). !!! note - When citing SUMO in general please use our current reference publication: ["Microscopic Traffic Simulation using SUMO"](https://elib.dlr.de/124092/); Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner. IEEE Intelligent Transportation Systems Conference (ITSC), 2018. + When citing SUMO in general please use our current reference publication: ["Microscopic Traffic Simulation using SUMO"](https://elib.dlr.de/127994/); Pablo Alvarez Lopez, Michael Behrisch, Laura Bieker-Walz, Jakob Erdmann, Yun-Pang Flötteröd, Robert Hilbrich, Leonhard Lücken, Johannes Rummel, Peter Wagner, and Evamarie Wießner. IEEE Intelligent Transportation Systems Conference (ITSC), 2018. Any help is appreciated - corrections and contributions to the documentation, submission of code, or other results. @@ -81,7 +81,7 @@ - [Importing O/D Matrices](Demand/Importing_O/D_Matrices.md) - [Other VISUM Demand Importers](Demand/Further_Ways_to_import_VISUM_Demand_Definitions.md) - [Other Vissim Demand Importers](Demand/Further_Ways_to_import_Vissim_Demand_Definitions.md) -- [Routes from Observation Points](Demand/Routes_from_Observation_Points.md) +- [Routes from Counting Data (road counts, turn counts)](Demand/Routes_from_Observation_Points.md) - [Routing by Turn Probabilities](Demand/Routing_by_Turn_Probabilities.md) - [Activity-based Demand Generation](Demand/Activity-based_Demand_Generation.md) - [Random Trips](Tools/Trip.md#randomtripspy) @@ -145,6 +145,7 @@ - [Why Vehicles are teleporting](Simulation/Why_Vehicles_are_teleporting.md) - [Unexpected jamming](FAQ.md#the_simulation_has_lots_of_jamsdeadlocks_what_can_i_do) +- [Too many turn-arounds](Simulation/Turnarounds.md) - [Unexpected lane-changing maneuvers?](FAQ.md#why_do_the_vehicles_perform_unexpected_lane-changing_maneuvers) - [How to get high flows?](FAQ.md#how_do_i_get_high_flowsvehicle_densities) @@ -189,7 +190,7 @@ - [POLYCONVERT](POLYCONVERT.md) - [ACTIVITYGEN](ACTIVITYGEN.md) - [EMISSIONSMAP](Tools/Emissions.md) -- [EMISSIONSDRIVINGCYCLE](Tools/Emissions.md) +- [EMISSIONSDRIVINGCYCLE](Tools/Emissions.md#emissionsdrivingcycle) # Appendices diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/ToC_Device.md sumo-1.6.0+dfsg1/docs/web/docs/ToC_Device.md --- sumo-1.5.0+dfsg1/docs/web/docs/ToC_Device.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/ToC_Device.md 2020-04-27 21:47:56.000000000 +0000 @@ -19,16 +19,16 @@ - automation-\>driver ("downward transition") Presumably, the more complex process is the downward transition, where -the human driver's is supposed to take back control from the vehicle -automation, as the drivers condition right after the take-over event may +the human driver is supposed to take back control from the vehicle +automation, as the driver's condition right after the take-over event may allow only a reduced driving performance. The ToC Device divides the downward transition into two states: - The 'preparing' state, where a take-over request (TOR) has been - issued, but the driver has not taken back back the control of the + issued, but the driver has not taken back the control of the vehicle. - The 'recovering' state, just after the ToC, where the driver shows - decreased driving performance \[see below for details\]. + decreased driving performance (see below for details). Further, the device induces a minimum risk maneuver (MRM) if the driver does not take back the vehicle control within a specified lead time (see @@ -40,7 +40,7 @@ ## Configuration -To equip vehicles with the ToC functionality the generic equipment +To equip vehicles with the ToC functionality, the generic equipment functionality of devices can be employed, see [the description of equipment procedures](Definition_of_Vehicles,_Vehicle_Types,_and_Routes.md#devices) @@ -76,6 +76,8 @@ | dynamicToCThreshold | float | 0.0 | Time, which the vehicle requires to have ahead to continue in automated mode. The default value of 0.0 indicates no dynamic triggering of ToCs. | | dynamicMRMProbability | float | 0.05 | Probability that a dynamically triggered TOR is not answered in time. | | mrmKeepRight | bool | false | If true, the vehicle tries to change to the right during an MRM. | +| mrmSafeSpot | string | "" | If set, the vehicle tries to reach the given named stopping place during an MRM. | +| mrmSafeSpotDuration | float | 60.0 | Duration the vehicle stays at the safe spot after an MRM. | | maxPreparationAccel | float | 0.0 | Maximal acceleration that may be applied during the ToC preparation phase. | | ogNewSpaceHeadway | float | 0.0 | The target additional space headway during the preparatory phase before a ToC (see [openGap()](TraCI/Change_Vehicle_State.md#open_gap_0x16)). | | ogNewTimeHeadway | float | original value | The target time headway during the preparatory phase before a ToC (see [openGap()](TraCI/Change_Vehicle_State.md#open_gap_0x16)). | @@ -100,14 +102,14 @@ If the current driving mode is automated, this will induce a switch to the manual vehicle type after the specified (or default) `responseTime`, -or, if `responseTime > availableLeadTime` an MRM is initiated (and +or, if `responseTime > availableLeadTime`, an MRM is initiated (and interrupted after `responseTime`). During the MRM, the vehicle brakes at the specified (or default) constant rate `mrmDecel`. After `responseTime` has elapsed, the vehicle type is switched and the awareness parameter of the vehicle's [driver state](Driver_State.md) is set to the `initialAwareness`. -Hereafter the awareness grows linearly with rate `recoveryRate` until it -reaches its maximal value (=1.0) after +Hereafter, the awareness grows linearly with rate `recoveryRate` until it +reaches its maximum value (=1.0) after `(1.0-initialAwareness)/recoveryRate` seconds. If the current driving mode is manual, a TOR will induce an immediate @@ -119,15 +121,15 @@ A TOR can be issued without external command if the parameter `dynamicToCThreshold` is supplied with a positive value. It induces a -TOR if the vehicle cannot continue on its current route for longer then +TOR if the vehicle cannot continue on its current route for longer than the given value (in seconds) due to impeded lane changes. The corresponding TOR is currently issued with a lead time of 3/4 of the given dynamic-ToC threshold. ## Reduced Driving Performance -During the recovering phase following a ToC the driver of the automated +During the recovering phase following a ToC, the driver of the automated vehicle is assumed to drive with a decreased performance. This is modeled by temporarily elevated magnitudes of the driver's perception errors, i.e., a decreased driver awareness (see [Driver -State](Driver_State.md)). \ No newline at end of file +State](Driver_State.md)). diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Import/OSM.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Import/OSM.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Import/OSM.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Import/OSM.md 2020-04-27 21:47:56.000000000 +0000 @@ -8,7 +8,7 @@ This script opens a webbrowser and allows selecting a geographic region on a map. It also provides some controls for specifying random traffic demand for different traffic modes. When clicking the 'Generate'-button, -the simulation network for the selected area is build based on [OSM data](../../Networks/Import/OpenStreetMap.md), random demand is +the simulation network for the selected area is built based on [OSM data](../../Networks/Import/OpenStreetMap.md), random demand is generated and [SUMO-GUI](../../SUMO-GUI.md) is started. !!! note @@ -17,7 +17,7 @@ All files that make up the scenario are created in a subfolder of the working directory with the current timestamp (i.e. {{SUMO}}/tools/2016-09-30-10-00-00/). If you edit the network, you can use the -script *build.bat* to rebuilt the random demand. +script *build.bat* to rebuild the random demand. Call: @@ -29,4 +29,4 @@ web-browser. Stop the script when you're done to free up the port again. !!! caution - The script requires the environment variable *SUMO_HOME* to be set [as explained here](../../Basics/Basic_Computer_Skills.md#additional_environment_variables). \ No newline at end of file + The script requires the environment variable *SUMO_HOME* to be set [as explained here](../../Basics/Basic_Computer_Skills.md#additional_environment_variables). diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Misc.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Misc.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Misc.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Misc.md 2020-04-27 21:47:56.000000000 +0000 @@ -159,3 +159,10 @@ python /tools/tileGet.py -n test.net.xml -t 10 sumo-gui -n test.net.xml -g settings.xml ``` + +Retrieving satellite data from Google or MapQuest (Requires obtaining an API-key first): +``` +python /tools/tileGet.py -n test.net.xml -t 10 --url maps.googleapis.com/maps/api/staticmap --key YOURKEY +python /tools/tileGet.py -n test.net.xml -t 10 --url open.mapquestapi.com/staticmap/v4/getmap --key YOURKEY +``` + diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Net.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Net.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Net.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Net.md 2020-04-27 21:47:56.000000000 +0000 @@ -150,3 +150,16 @@ - : Id of an edge as used within - : Id of the edge as to use instead - : The connections file to change + +# net2kml.py + +converts '.net.xml' road geometries to [KML](https://en.wikipedia.org/wiki/Keyhole_Markup_Language) format. + +``` +/tools/net/net2kml.py -n your.net.xml -o output.kml +``` + +By default, normal edge geometries will be exported. This can be changed with options +- **--lanes**: write lane geometries +- **--internal**: write junction-internal edges or lanes + diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Output.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Output.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Output.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Output.md 2020-04-27 21:47:56.000000000 +0000 @@ -47,16 +47,27 @@ Script for generating [E1 detectors (induction loops)](../Simulation/Output/Induction_Loops_Detectors_(E1).md) for each junction in the supplied network file. +Example usage: +``` +python tools\output\generateTLSE1Detectors.py -n .net.net.xml -o detectors.add.xml +``` + Execute the *generateTLSE1Detectors.py*script with *--help* option to -get details about usage and available options. +get details about additional options. ## generateTLSE2Detectors.py Script for generating [E2 detectors (lanearea detectors)](../Simulation/Output/Lanearea_Detectors_(E2).md) for each junction in the supplied network file. +Example usage: +``` +python tools\output\generateTLSE2Detectors.py -n .net.net.xml -o detectors.add.xml +``` + Execute the *generateTLSE2Detectors.py* script with *--help* option to -get details about usage and available options. +get details about additional options. + ## generateTLSE3Detectors.py @@ -67,8 +78,15 @@ instead. When setting option **--interior**, delays within the intersection will be included as well. + +Example usage: +``` +python tools\output\generateTLSE3Detectors.py -n .net.net.xml -o detectors.add.xml +``` + Execute the *generateTLSE3Detectors.py* script with *--help* option to -get details about usage and available options. +get details about additional options. + ## netdumpdiff.py @@ -168,16 +186,16 @@ Output is given as plain text on the command line or in xml format if option **--output** is set. -## attributeStates.py +## attributeStats.py Computes statistics on an arbitrary numerical attribute in a flat xml document. (eg. attribute *timeLoss* for element *tripinfo* in [tripinfo-output](../Simulation/Output/TripInfo.md)) and writes the -results to standard output. +results to standard output. When the attribute contains time data in HH:MM:SS format, the values will automatically be converted to seconds. ``` python tools/output/attributeStats --element tripinfo --attribute timeLoss ``` With option **--hist-output** {{DT_FILE}} a histogram data file (e.g. for plotting with gnuplot) is -generated. \ No newline at end of file +generated. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Sumolib.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Sumolib.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Sumolib.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Sumolib.md 2020-04-27 21:47:56.000000000 +0000 @@ -86,6 +86,14 @@     # do something with the vector of edge ids ``` +## parse all edges in a edge data (meanData) file + +``` +for interval in sumolib.output.parse("edgedata.xml", "interval"): + for edge in interval.edge:     +     # do something with the edge attributes i.e. edge.entered +``` + ## coordinate transformations ``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Trip.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Trip.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Trip.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Trip.md 2020-04-27 21:47:56.000000000 +0000 @@ -188,7 +188,7 @@ [IntermodalRouting](../IntermodalRouting.md) to decided whether they use public transport, a personal car or walking. - walking or public transport: **--trip-attributes "modes=\"public\""** - - walking, public transport or car **--trip-attributes "modes=\"public,car\""** + - walking, public transport or car **--trip-attributes "modes=\"public car\""** !!! caution Quoting of trip attributes on Linux must use the style **--trip-attributes 'modes="public"'** @@ -265,4 +265,4 @@ ``` /tools/route2trips.py input_routes.rou.xml -``` \ No newline at end of file +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools/Turns.md sumo-1.6.0+dfsg1/docs/web/docs/Tools/Turns.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools/Turns.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools/Turns.md 2020-04-27 21:47:56.000000000 +0000 @@ -20,44 +20,74 @@ ## Turn count data format The turn-count data must be provided in the format: ``` - - - - - - - - - ... any other edges ... - - - - ... some further intervals ... - - + + + + + + + + + ``` -!!! note - The attribute 'probability' can replaced with any other attribute name by setting the option **--turn-attribute **. The default value of 'probability' is used for consistency with [JTRROUTER](../JTRROUTER.md) and [generateTurnRatios.py](#generateturnratiospy). - - # routeSampler.py The script generates routes from turn-count data. It requires a route file as input that defines possible routes. Routes are sampled (heuristically) from the input so that the resulting routes fullfill the turn-count data. ``` -/tools/routeSampler.py -r  -t +/tools/routeSampler.py -r  -t ``` The turn-count data format is the same as as described [above](#turn-count-data-format). In addition to loading a turn-count file, routeSampler can also load an [edgeData -file](../Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.md) using option **--edgedata-file**. +file](../Simulation/Output/Lane-_or_Edge-based_Traffic_Measures.md) using option **--edgedata-files**. The attributes for reading the counts from the turn-data file and edgedata-file can be set with options -- **--turn-attribute** (default 'probability') +- **--turn-attribute** (default 'count') - **--edgedata-attribute** (default 'entered') + +## Obtaining initial routes +Routes generated by randomTrips.py (**--route-output**) can be a good input source. The following randomTrips.py options may be helpful: + +- **--fringe-factor**: setting a high value will generated lots of through-traffic which is plausible for small networks +- **--min-distance**: restricting short routes increases the chance that routes passing multiple counting locations are generated +- **--speed-exponent**, **--lanes**: both options can be used to increase routes starting and ending on "important" roads. This combines well with the **--fringe-factor**-option to generate many routes that enter and leave the network on major roads. + +## Generalized route restrictions +By default, the input options --edgedata-files and --turn-files allow restricting counts for single edges and pairs of consecutive edges. + +To define count restrictions for longer consecutive edge sequences the optional 'via' attribute can be used for `` elements: +``` + +``` + +To define count restrictions on non-consecutive edges the option **--turn-max-gap ** can be used. Example: +When setting option **--turn-max-gap 2**, the edgeRelation `` would apply to routes containing "A B", "A X D" or "A X Y D" but not "A X Y Z D". + +## Origin-Destination restrictions +When loading an edgeRelation file with the option **--od-files**, origin-destination counts will be added. +This can be used to combine (edge-based) OD-relations with other couting data. + +## Output Styles +By default, routeSampler will generate individual vehicles with embedded routes. This can be changed with the following options (which can also be combined): + +- **--write-route-ids**: write named routes and let vehicles reference the route via it's id +- **--wroute-route-distribution STR**: put all routes into a route distribution (with appropriate route probabilities) and let a all vehicles reference this distribution (Simulation counts will then vary due to sampling from the distribution) +- **--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 + +## Optimization +By default, routes will be sampled from the input route set until no further routes can be added without exceeding one of the counts. This may still leave some counts below their target values. At this point an ILP-Solver can be used to swap out routes and get closer to the target values or even reach the exact numbers. +By setting option **--optimize **. The number of times that a route is used can be changed by up to **** times. This defines a trade-off between using routes in the same distribution as found in the input and optimizing the counts. +When setting option **--optimze full**. No constraints on the route distribution are set and any route can be used as often as needed to reach the counts. + +## Further Calibration +It is possible to load the resulting output into routeSampler.py for another round of optimization. By setting the option **--optimize-input** the sampling step is skipped and the optimizer is run directly on the input route set. + +By removing specific routes or adding new ones, the user can thus tailor the generating traffic in an iterative manner. # generateTurnRatios.py @@ -109,3 +139,11 @@ ``` /tools/turn-defs/turnCount2EdgeCount.py -t  -o ``` + +# turnFile2EdgeRelations.py + +This script converts the deprecated turn-file format into edgeRelation format + +``` +/tools/turn-defs/turnFile2EdgeRelations.py -t  -o +``` diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tools.md sumo-1.6.0+dfsg1/docs/web/docs/Tools.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tools.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tools.md 2020-04-27 21:47:56.000000000 +0000 @@ -31,6 +31,8 @@ using VISUM data - *[vissim](Tools/Import/VISSIM.md)* - some helpers for using VISSIM data + - *[MATSim](Tools/Import/MATSim.md)* - some helpers for + using MATSim data - *[net](Tools/Net.md)* - tools for working with networks (mainly SUMO-networks) - *projects* - additional tools used by our projects diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Change_Vehicle_State.md sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Change_Vehicle_State.md --- sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Change_Vehicle_State.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Change_Vehicle_State.md 2020-04-27 21:47:56.000000000 +0000 @@ -157,25 +157,28 @@ position that best matches the given x,y network coordinates. The edgeID and laneIndex are compared against the original [OpenDRIVE lane id](../Networks/Import/OpenDRIVE.md#referencing_original_ids) when -possible to resolve ambiguities. The optional keepRoute flag influences -mapping as follows +possible to resolve ambiguities. The optional keepRoute flag is a bitset that influences +mapping as follows: -- keepRoute = **1**: The vehicle is mapped to the closest edge within - it's existing route. If no suitable position is found within 100m - mapping fails with an error. -- keepRoute = **0**: The vehicle is mapped to the closest edge within - the network. If that edge does not belong to the original route, the - current route is replaced by a new route which consists of that edge - only. If no suitable position is found within 100m mapping fails - with an error. When using the [sublane - model](../Simulation/SublaneModel.md) the best lateral position - that is fully within the lane will be used. Otherwise, the vehicle - will drive in the center of the closest lane. -- keepRoute = **2**: The vehicle is mapped to the exact position in +- **bit0** (keepRoute = 1 when only this bit is set) + - **1**: The vehicle is mapped to the closest edge within it's existing route. + If no suitable position is found within 100m mapping fails with an error. + - **0**: The vehicle is mapped to the closest edge within the network. + If that edge does not belong to the original route, the current route is replaced by a new + route which consists of that edge only. + If no suitable position is found within 100m mapping fails with an error. + When using the [sublane model](../Simulation/SublaneModel.md) the best lateral position + that is fully within the lane will be used. Otherwise, the vehicle will drive in the center of the closest lane. +- **bit1** (keepRoute = 2 when only this bit is set) + - **1**: The vehicle is mapped to the exact position in the network (including the exact lateral position). If that position lies outside the road network, the vehicle stops moving on it's own accord until it is placed back into the network with another TraCI - command. + command. (if keeproute = 3, the position must still be within 100m of the vehicle route) + - **0**: The vehicle is always on a road +- **bit2** (keepRoute = 4 when only this bit is set) + - **1**: lane permissions are ignored when mapping + - **0**: The vehicle is mapped only to lanes that allow it's vehicle class The angle value is assumed to be in navigational degrees (between 0 and 360 with 0 at the top, going clockwise). The angle is used when scoring diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Interfacing_TraCI_from_Python.md sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Interfacing_TraCI_from_Python.md --- sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Interfacing_TraCI_from_Python.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Interfacing_TraCI_from_Python.md 2020-04-27 21:47:56.000000000 +0000 @@ -301,15 +301,17 @@ Sometimes SUMO may crash while running a simulation with TraCI. The below steps make it simple to run sumo with traci in a debugger: -1\) add the option *--save-configuration* to your traci script: +1\) Add the option *--save-configuration* to your traci script: ``` traci.start([sumoBinary, '-c', 'run.sumocfg', '--save-configuration', 'debug.sumocfg']) ``` -2\) run your traci script. Instead of starting sumo it will just write +2\) Run your traci script. Instead of starting sumo it will just write the configuration with the chosen port but it will still try to connect -repeatedly 3) run +repeatedly. + +3\) Run ``` gdb --args sumoD -c debug.sumocfg diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Vehicle_Value_Retrieval.md sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Vehicle_Value_Retrieval.md --- sumo-1.5.0+dfsg1/docs/web/docs/TraCI/Vehicle_Value_Retrieval.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/TraCI/Vehicle_Value_Retrieval.md 2020-04-27 21:47:56.000000000 +0000 @@ -519,13 +519,13 @@

    leader (0x68)

    double, see below

    compound (string, double)

    -

    Returns the id of the leading vehicle and its distance, if the string is empty, no leader was found. Only vehicles ahead on the currently list of best lanes are considered (see above). This means, the leader is only valid until the next lane-change maneuver. The returned distance is measured from the ego vehicle front bumper + minGap to the back bumper of the leader vehicle.

    +

    Returns the id of the leading vehicle and its distance, if the string is empty, no leader was found within the given range. Only vehicles ahead on the currently list of best lanes are considered (see above). This means, the leader is only valid until the next lane-change maneuver. The returned distance is measured from the ego vehicle front bumper + minGap to the back bumper of the leader vehicle.

    getLeader

    distance request (0x83)

    +

    compound (see Command 0x83: Distance Request)

    double, see below

    -

    compound (see Command 0x83: Distance Request)

    Returns the distance between the current vehicle position and the specified position (for the given distance type)

    getDrivingDistance getDrivingDistance2D

    @@ -544,6 +544,27 @@

    Returns a list of IDs for neighboring vehicle relevant to lane changing (>1 elements only possible for sublane model)

    getNeighbors, getLeftFollowers, getLeftLeaders, getRightFollowers, getRightLeaders

    + +

    followSpeed (0x1c)

    +

    compound, see below

    +

    double

    +

    Return the follow speed computed by the carFollowModel of vehicle

    +

    getFollowSpeed

    + + +

    secureGap (0x1e)

    +

    compound, see below

    +

    double

    +

    Return the secure gap computed by the carFollowModel of vehicle

    +

    getSecureGap

    + + +

    stopSpeed (0x1e)

    +

    compound, see below

    +

    double

    +

    Return the safe speed for stopping at gap computed by the carFollowModel of vehicle

    +

    getStopSpeed

    + @@ -565,7 +586,7 @@ | byte | double | | :-----------------: | :--------------------------------: | -| value type *double* | maximum look ahead distance (in m) | +| value type *double* | minimum look ahead distance (in m) | ### next TLS (0x70) @@ -621,6 +642,33 @@ The returned string list contains the IDs of all corresponding neighboring vehicles. +### followSpeed (0x1c) + +| byte | int | double | double | double | double | string | +| :-------------------: | :---: | :----: | :----: | :---------: | :------------: | :------: | +| value type *compound* | 5 | speed | gap | leaderSpeed | leaderMaxDecel | leaderID | + +The leaderID is optional. Only a few car follow models such as CACC may require the identity of the leader to return the correct value +The returned value is the safe follow speed in m/s + +### secureGap (0x1e) + +| byte | int | double | double | double | string | +| :-------------------: | :---: | :----: | :---------: | :------------: | :------: | +| value type *compound* | 4 | speed | leaderSpeed | leaderMaxDecel | leaderID | + +The leaderID is optional. Only a few car follow models such as CACC may require the identity of the leader to return the correct value +The returned value is the safe gap for following the given leader in m. + +### stopSpeed (0x1d) + +| byte | int | double | double | +| :-------------------: | :---: | :----: | :----: | +| value type *compound* | 2 | speed | gap | + +The returned value is the safe speed in m/s for stopping after gap when braking +from the given speed. + ## Device and LaneChangeModel Parameter Retrieval 0x7e Vehicles supports retrieval of device parameters using the [generic diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/TraCI.md sumo-1.6.0+dfsg1/docs/web/docs/TraCI.md --- sumo-1.5.0+dfsg1/docs/web/docs/TraCI.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/TraCI.md 2020-04-27 21:47:56.000000000 +0000 @@ -291,19 +291,23 @@ - plain position retrieval 80s - retrieval using subscriptions 28s -## Future Development +## Current and Future Development -Currently TraCI uses a different (single byte) command IDs for every +Historically TraCI used a different (single byte) command ID for every domain (induction loops, vehicle etc.) where the more significant half of the byte denotes the command (get, set, subscribe, ...) and the -lesser significant the domain itself. This limits the number of domains -to 16 which are almost used up. Although it may decrease readability of -the constants in the future five bits will be used for the domain and -only three for the command. Furthermore after the invention of libsumo +lesser significant the domain itself. To allow more than the 16 domains +resulting from this split, the most significant bit (which was unused +until now because there were only 7 commands) is now used for the domain +as well (and only three for the command). This allows for 28 domains +because four general commands (like SIMSTEP) block some available combinations. +Currently there are only four possible domains left. + +Furthermore after the invention of libsumo some parts of the TraCI interface are so generic that it may be not so -hard to invent a wrapper with protocal buffers which could in the long -run replace the need for all the byte fiddling and the different hand -crafted clients. +hard to invent a wrapper with Apache Kafka or Google protocol buffers +which could in the long run replace the need for all the byte fiddling +and the different hand crafted clients. ## Troubleshooting diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tutorials/OSMWebWizard.md sumo-1.6.0+dfsg1/docs/web/docs/Tutorials/OSMWebWizard.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tutorials/OSMWebWizard.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tutorials/OSMWebWizard.md 2020-04-27 21:47:56.000000000 +0000 @@ -52,6 +52,15 @@ area. Once you are satisfied with the area selection, you can proceed to the next step. +# Network Generation +The infrastructure import from OSM into the SUMO simulation are affected by different Wizard options +* by default a road traffic simulation is generated but all types of roads and rails will be imported as well (cycle paths, footpaths, railways etc) +* if the checkbox "left-hand Traffic" is enabled, the network will be built with left hand traffic rules. For most geographic regions where this is required, this feature will be enabled automatically but if it does not work, this option can be used as a remedy. +* if the checkbox "Car-only Network" is enabled, then only roads that permit passenger car traffic will be included. This can be used to reduce the network size and also helps to reduce intersection complexity +* if the checkbox "Import Public Transport" is enabled, then busStops and trainStops will be exported. Also busses, trams and trains will be generated that follow the public transport routes defined in OSM (but they will follow synthetic schedules). +* if the Demand-checkbox "Bicycles" is active, then extra bicycle lanes will be added to roads where OSM contains this informatoin +* if the Demand-checkbox "Pedestrians" is active, then sidewalks and pedestrian crossings will be generated + # Demand Generation The demand is defined by the demand generation panel. You activate this @@ -122,4 +131,4 @@ You may now edit those files and re-run the simulation. To learn more about the SUMO scenario files, please consult the other -[Tutorials](../Tutorials.md) as well. \ No newline at end of file +[Tutorials](../Tutorials.md) as well. diff -Nru sumo-1.5.0+dfsg1/docs/web/docs/Tutorials.md sumo-1.6.0+dfsg1/docs/web/docs/Tutorials.md --- sumo-1.5.0+dfsg1/docs/web/docs/Tutorials.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/docs/Tutorials.md 2020-04-27 21:47:56.000000000 +0000 @@ -40,12 +40,10 @@ * [SUMO 2018](http://sumo.dlr.de/daily/sumo2018_tutorial.zip) * [SUMO 2019](http://sumo.dlr.de/daily/sumo2019_tutorial.zip) + + ## ITSC 2015 -Preparations for doing the tutorial: -* Installation of python2.7 [https://www.python.org/ftp/python/2.7.7/python-2.7.7.msi](https://www.python.org/ftp/python/2.7.7/python-2.7.7.msi) -* Installation of a text editing application with syntax highlighting (i.e. [http://download.tuxfamily.org/notepadplus/archive/6.7.5/npp.6.7.5.Installer.exe](http://download.tuxfamily.org/notepadplus/archive/6.7.5/npp.6.7.5.Installer.exe)) -* Download and unpack [http://sumo.dlr.de/daily/sumo-msvc10Win32-svn.zip](http://sumo.dlr.de/daily/sumo-msvc10Win32-svn.zip) **to a directory that does not contain the space (' ') character**. We're using the latest development version because 0.24.0 does not yet have [NETEDIT](NETEDIT.md). * Download the Tutorial Files at [http://sumo.dlr.de/daily/ITSC2015_tutorial.zip](http://sumo.dlr.de/daily/ITSC2015_tutorial.zip) ## Im- and Export @@ -85,4 +83,4 @@ * [Tutorials/Import from OpenStreetMap](Tutorials/Import_from_OpenStreetMap.md) - Shows how to prepare a map from [OpenStreetMap](https://www.openstreetmap.org/) for traffic simulation * [Tutorials/Quick_Start_old_style](Tutorials/Quick_Start_old_style.md) - Build a scenario by editing the edge and node files in a text editor instead of [NETEDIT](NETEDIT.md) -* [Tutorials/CityMobil](Tutorials/CityMobil.md) - Simulation of a parking lot management using automated buses. This TraCI tutorial was written before the implementation of pedestrians and parkingAreas \ No newline at end of file +* [Tutorials/CityMobil](Tutorials/CityMobil.md) - Simulation of a parking lot management using automated buses. This TraCI tutorial was written before the implementation of pedestrians and parkingAreas diff -Nru sumo-1.5.0+dfsg1/docs/web/mkdocs.yml sumo-1.6.0+dfsg1/docs/web/mkdocs.yml --- sumo-1.5.0+dfsg1/docs/web/mkdocs.yml 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/mkdocs.yml 2020-04-27 21:47:56.000000000 +0000 @@ -56,10 +56,11 @@ - mdx_gh_links: user: eclipse repo: sumo + - plantuml_markdown extra: - Version: 1.5.0 - ReleaseDate: 11.02.2020 + Version: 1.6.0 + ReleaseDate: 28.04.2020 AdditionalFile: '[*additional-file*](/docs/SUMO.html#format_of_additional_files)' AdditionalFiles: '[*additional-files*](/docs/SUMO.html#format_of_additional_files)' diff -Nru sumo-1.5.0+dfsg1/docs/web/NOTICE.md sumo-1.6.0+dfsg1/docs/web/NOTICE.md --- sumo-1.5.0+dfsg1/docs/web/NOTICE.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/NOTICE.md 2020-04-27 21:47:56.000000000 +0000 @@ -3,34 +3,29 @@ This Documentation leverages the following third party content. mkdocs (1.0.4) - * License: BSD 2-Clause "Simplified" License * Project: https://www.mkdocs.org/ * Source: https://github.com/mkdocs/mkdocs mkdocs-macros-plugin (0.2.0) - * Author: Laurent Franceschetti * License: MIT License * Project: https://pypi.org/project/mkdocs-macros-plugin/ * Source: https://github.com/fralau/mkdocs_macros_plugin mdx-gh-links (0.2) - * Author: Waylan Limberg * License: BSD 3-Clause License * Project: https://pypi.org/project/mdx_gh_links/ * Source: https://github.com/Python-Markdown/github-links pymdown-extensions (6.0) - * Author: Isaac Muse * License: MIT License * Project: https://pypi.org/project/pymdown-extensions/ * Source: https://github.com/facelessuser/pymdown-extensions mkdocs-git-revision-date-plugin (0.1.5) - * Author: Terry Zhao * License: MIT License * Project: https://pypi.org/project/mkdocs-git-revision-date-plugin/ @@ -40,4 +35,16 @@ * Author: @radude * License: MIT License * Project: https://pypi.org/project/mdx-truly-sane-lists/ -* Source: https://github.com/radude/mdx_truly_sane_lists \ No newline at end of file +* Source: https://github.com/radude/mdx_truly_sane_lists + +plantuml-markdown (3.2.1) +* Author: Michele Tessaro +* License: BSD 2-Clause License +* Project: https://pypi.org/project/plantuml-markdown/ +* Source: https://github.com/mikitex70/plantuml-markdown + +PlantUML +* Author: Arnaud Roques +* License: Various alternatives possible including EPL and MIT +* Project: https://plantuml.com/ +* Source: https://sourceforge.net/p/plantuml/code/HEAD/tree/trunk/ diff -Nru sumo-1.5.0+dfsg1/docs/web/README.md sumo-1.6.0+dfsg1/docs/web/README.md --- sumo-1.5.0+dfsg1/docs/web/README.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/README.md 2020-04-27 21:47:56.000000000 +0000 @@ -1,4 +1,4 @@ -# SUMO Documentation :book: +# SUMO Documentation The SUMO Documentation is generated using [MkDocs](https://www.mkdocs.org/). @@ -10,18 +10,19 @@ - Python > 3.5 (the *mkdocs-macros-plugin* requires it) ### Installation -First step is to install MkDocs and some MkDocs plugins: -``` -pip install mkdocs mkdocs-macros-plugin==0.2.4 mdx_gh_links pymdown-extensions "mkdocs-git-revision-date-plugin>=0.2" mdx_truly_sane_lists -``` -Next step is to clone this repository (if not already done): +Clone this repository (if not already done): ``` git clone https://github.com/eclipse/sumo.git ``` Navigate to this path (`sumo/docs/web`). +Install MkDocs and some MkDocs plugins as well as plantuml: +``` +pip install -r requirements.txt +``` + To run the built-in development server, use: ``` mkdocs serve diff -Nru sumo-1.5.0+dfsg1/docs/web/requirements.txt sumo-1.6.0+dfsg1/docs/web/requirements.txt --- sumo-1.5.0+dfsg1/docs/web/requirements.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/requirements.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,7 @@ +mkdocs +mkdocs-macros-plugin==0.2.4 +mdx_gh_links +pymdown-extensions +mkdocs-git-revision-date-plugin>=0.2 +mdx_truly_sane_lists +plantuml-markdown \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/docs/web/theme/base.html sumo-1.6.0+dfsg1/docs/web/theme/base.html --- sumo-1.5.0+dfsg1/docs/web/theme/base.html 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/theme/base.html 2020-04-27 21:47:56.000000000 +0000 @@ -161,6 +161,7 @@ More
  • @@ -201,7 +202,7 @@ {%- if config.copyright %}

    {{ config.copyright }}

    {%- endif %} -

    Follow us on +

    Follow us on | Documentation built with MkDocs.

    {%- endblock %} diff -Nru sumo-1.5.0+dfsg1/docs/web/theme/note.html sumo-1.6.0+dfsg1/docs/web/theme/note.html --- sumo-1.5.0+dfsg1/docs/web/theme/note.html 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/docs/web/theme/note.html 2020-04-27 21:47:56.000000000 +0000 @@ -1 +1 @@ - \ No newline at end of file + diff -Nru sumo-1.5.0+dfsg1/include/version.h sumo-1.6.0+dfsg1/include/version.h --- sumo-1.5.0+dfsg1/include/version.h 2020-02-10 23:05:16.000000000 +0000 +++ sumo-1.6.0+dfsg1/include/version.h 2020-04-27 22:08:38.000000000 +0000 @@ -1 +1 @@ -#define VERSION_STRING "v1_5_0+0000-3a3be608d2" +#define VERSION_STRING "v1_6_0+0003-190709904e" diff -Nru sumo-1.5.0+dfsg1/Makefile.cvs sumo-1.6.0+dfsg1/Makefile.cvs --- sumo-1.5.0+dfsg1/Makefile.cvs 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/Makefile.cvs 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -default: all - -all: - autoreconf -i - -clean: - rm -r aclocal.m4 autom4te.cache/ config.* configure depcomp install-sh missing src/config.h.in ltmain.sh INSTALL src/version.h src/netimport/typemap.h; \ - find . \( -name '*.gcda' -o -name '*.gcno' -o -name Makefile.in \) -exec rm '{}' ';' diff -Nru sumo-1.5.0+dfsg1/NOTICE.md sumo-1.6.0+dfsg1/NOTICE.md --- sumo-1.5.0+dfsg1/NOTICE.md 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/NOTICE.md 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,12 @@ This program and the accompanying materials are made available under the terms of the Eclipse Public License v. 2.0 which is available at http://www.eclipse.org/legal/epl-v20.html. - -SPDX-License-Identifier: 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 ## Source Code diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivities.cpp sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivities.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivities.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivities.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ // Main class that manages activities taken in account and generates the // inhabitants' trip list. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGActivities.h" @@ -274,4 +269,5 @@ return true; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivities.h sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivities.h --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivities.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivities.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ // Main class that manages activities taken in account and generates the // inhabitants' trip list. /****************************************************************************/ -#ifndef AGACTIVITIES_H -#define AGACTIVITIES_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,7 +68,3 @@ int nbrDays; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivity.cpp sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivity.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivity.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivity.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ // Parent object for all activities. Derived classes generate trips for each // household. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivity.h sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivity.h --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGActivity.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGActivity.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // Parent object for all activities. Derived classes generate trips for each // household. /****************************************************************************/ -#ifndef AGACTIVITY_H -#define AGACTIVITY_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "AGTrip.h" @@ -123,7 +117,3 @@ double carPreference; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGFreeTime.cpp sumo-1.6.0+dfsg1/src/activitygen/activities/AGFreeTime.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGFreeTime.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGFreeTime.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ // Generates trips related to after-work activities // like visiting the family or party. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -265,4 +260,5 @@ return timeBack.getTime(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGFreeTime.h sumo-1.6.0+dfsg1/src/activitygen/activities/AGFreeTime.h --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGFreeTime.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGFreeTime.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // Generates trips related to after-work activities // like visiting the family or party. /****************************************************************************/ -#ifndef AGFREETIME_H -#define AGFREETIME_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "../city/AGHousehold.h" @@ -122,7 +116,3 @@ static const int TE_NIGHT;// = 500; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGTrip.cpp sumo-1.6.0+dfsg1/src/activitygen/activities/AGTrip.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGTrip.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGTrip.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGTrip.h" @@ -186,4 +181,5 @@ myDay = d; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGTrip.h sumo-1.6.0+dfsg1/src/activitygen/activities/AGTrip.h --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGTrip.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGTrip.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ /// // Class containing all information of a given trip (car, bus) /****************************************************************************/ -#ifndef AGTRIP_H -#define AGTRIP_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -142,7 +136,3 @@ int myDay; std::list myPassBy; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.cpp sumo-1.6.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Generates trips to work and to school /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -386,4 +381,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.h sumo-1.6.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.h --- sumo-1.5.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activities/AGWorkAndSchool.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Generates trips to work and to school /****************************************************************************/ -#ifndef AGWORKANDSCHOOL_H -#define AGWORKANDSCHOOL_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "../city/AGHousehold.h" @@ -138,7 +132,3 @@ std::list tempAccTrip; std::list tempTrip; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/activitygen_main.cpp sumo-1.6.0+dfsg1/src/activitygen/activitygen_main.cpp --- sumo-1.5.0+dfsg1/src/activitygen/activitygen_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/activitygen_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Main object of the ActivityGen application /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -159,5 +154,5 @@ return ret; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityGen.cpp sumo-1.6.0+dfsg1/src/activitygen/AGActivityGen.cpp --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityGen.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityGen.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Main class that handles City, Activities and Trips /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -250,4 +245,5 @@ generateOutputFile(expTrips); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityGen.h sumo-1.6.0+dfsg1/src/activitygen/AGActivityGen.h --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityGen.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityGen.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Main class that handles City, Activities and Trips /****************************************************************************/ -#ifndef AGACTIVITYGEN_H -#define AGACTIVITYGEN_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "city/AGCity.h" @@ -125,8 +119,3 @@ /// @brief invalidated assignment operator AGActivityGen& operator=(const AGActivityGen&); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityGenHandler.cpp sumo-1.6.0+dfsg1/src/activitygen/AGActivityGenHandler.cpp --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityGenHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityGenHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // The handler for parsing the statistics file. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGActivityGenHandler.h" @@ -390,5 +385,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityGenHandler.h sumo-1.6.0+dfsg1/src/activitygen/AGActivityGenHandler.h --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityGenHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityGenHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // The handler for parsing the statistics file. /****************************************************************************/ -#ifndef AGACTIVITYGENHANDLER_H -#define AGACTIVITYGENHANDLER_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -168,9 +162,3 @@ AGActivityGenHandler& operator=(const AGActivityGenHandler& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityTripWriter.cpp sumo-1.6.0+dfsg1/src/activitygen/AGActivityTripWriter.cpp --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityTripWriter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityTripWriter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Class for writing Trip objects in a SUMO-route file. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGActivityTripWriter.h sumo-1.6.0+dfsg1/src/activitygen/AGActivityTripWriter.h --- sumo-1.5.0+dfsg1/src/activitygen/AGActivityTripWriter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGActivityTripWriter.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Class for writing Trip objects in a SUMO-route file. /****************************************************************************/ -#ifndef AGACTIVITYTRIPWRITER_H -#define AGACTIVITYTRIPWRITER_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include // =========================================================================== @@ -58,8 +52,3 @@ AGActivityTripWriter& operator=(const AGActivityTripWriter&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGFrame.cpp sumo-1.6.0+dfsg1/src/activitygen/AGFrame.cpp --- sumo-1.5.0+dfsg1/src/activitygen/AGFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Configuration of the options of ActivityGen /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H diff -Nru sumo-1.5.0+dfsg1/src/activitygen/AGFrame.h sumo-1.6.0+dfsg1/src/activitygen/AGFrame.h --- sumo-1.5.0+dfsg1/src/activitygen/AGFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/AGFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Configuration of the options of ActivityGen /****************************************************************************/ -#ifndef AGFRAME_H -#define AGFRAME_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -54,4 +48,3 @@ }; -#endif /* AGFRAME_H */ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGAdult.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGAdult.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGAdult.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGAdult.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Person in working age: can be linked to a work position. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGAdult.h" @@ -112,4 +107,5 @@ throw std::runtime_error("AGAdult::getWorkPosition: Adult is unemployed."); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGAdult.h sumo-1.6.0+dfsg1/src/activitygen/city/AGAdult.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGAdult.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGAdult.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Person in working age: can be linked to a work position. /****************************************************************************/ -#ifndef AGADULT_H -#define AGADULT_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -122,7 +116,3 @@ */ static AGWorkPosition* randomFreeWorkPosition(std::vector* wps); }; - -#endif /* AGADULT_H */ - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGBus.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGBus.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGBus.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGBus.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A bus driving in the city /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -55,4 +50,5 @@ std::cout << "- Bus:" << " name=" << myName << " depTime=" << myDepartureTime << std::endl; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGBus.h sumo-1.6.0+dfsg1/src/activitygen/city/AGBus.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGBus.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGBus.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,12 +21,7 @@ /// // A bus driving in the city /****************************************************************************/ -#ifndef AGBUS_H -#define AGBUS_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -52,7 +47,3 @@ std::string myName; int myDepartureTime; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGBusLine.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGBusLine.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGBusLine.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGBusLine.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Bus line of the city: contains all the buses of this line /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -168,4 +163,5 @@ std::cout << "\n ----------------------------------------------------------------\n" << std::endl; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGBusLine.h sumo-1.6.0+dfsg1/src/activitygen/city/AGBusLine.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGBusLine.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGBusLine.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Bus line of the city: contains all the buses of this line /****************************************************************************/ -#ifndef AGBUSLINE_H -#define AGBUSLINE_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,7 +68,3 @@ int maxTripTime; int busNbr; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGCar.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGCar.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGCar.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGCar.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Cars owned by people of the city: included in households. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -65,4 +60,5 @@ return idName; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGCar.h sumo-1.6.0+dfsg1/src/activitygen/city/AGCar.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGCar.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGCar.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Cars owned by people of the city: included in households. /****************************************************************************/ -#ifndef AGCAR_H -#define AGCAR_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -56,7 +50,3 @@ AGAdult* currentUser; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGChild.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGChild.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGChild.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGChild.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Person in age to go to school: linked to a school object /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -105,4 +100,5 @@ return mySchool->getOpeningHour(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGChild.h sumo-1.6.0+dfsg1/src/activitygen/city/AGChild.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGChild.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGChild.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Person in age to go to school: linked to a school object /****************************************************************************/ -#ifndef AGCHILD_H -#define AGCHILD_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -66,7 +60,3 @@ private: AGSchool* mySchool; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGCity.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGCity.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGCity.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGCity.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -24,11 +24,6 @@ // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and school /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -427,4 +422,5 @@ return *RandHelper::getRandomFrom(streets); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGCity.h sumo-1.6.0+dfsg1/src/activitygen/city/AGCity.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGCity.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGCity.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // City class that contains all other objects of the city: in particular // streets, households, bus lines, work positions and schools /****************************************************************************/ -#ifndef AGCITY_H -#define AGCITY_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,7 +109,3 @@ /// @brief invalidated assignment operator AGCity& operator=(const AGCity&); }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGDataAndStatistics.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGDataAndStatistics.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGDataAndStatistics.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGDataAndStatistics.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ // Contains various data, statistical values and functions from input used // by various objects /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGDataAndStatistics.h" @@ -213,5 +208,4 @@ } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGDataAndStatistics.h sumo-1.6.0+dfsg1/src/activitygen/city/AGDataAndStatistics.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGDataAndStatistics.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGDataAndStatistics.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // Contains various data, statistical values and functions from input used // by various objects /****************************************************************************/ -#ifndef AGDATAANDSTATISTICS_H -#define AGDATAANDSTATISTICS_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -182,7 +176,3 @@ //function normalizing the map's probabilities: Sum(floats) = 1 void normalizeMapProb(std::map* myMap); }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGHousehold.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGHousehold.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGHousehold.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGHousehold.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -203,4 +198,5 @@ return (myAdults.front().getAge() >= myCity->statData.limitAgeRetirement); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGHousehold.h sumo-1.6.0+dfsg1/src/activitygen/city/AGHousehold.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGHousehold.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGHousehold.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // A household contains the people and cars of the city: roughly represents // families with their address, cars, adults and possibly children /****************************************************************************/ -#ifndef HOUSEHOLD_H -#define HOUSEHOLD_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -126,7 +120,3 @@ std::list myChildren; std::list myCars; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGPerson.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGPerson.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGPerson.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGPerson.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Parent object of every person, contains age and any natural characteristic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGPerson.h" @@ -60,4 +55,5 @@ return (RandHelper::rand(1000) < static_cast(1000.0f * proba)); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGPerson.h sumo-1.6.0+dfsg1/src/activitygen/city/AGPerson.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGPerson.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGPerson.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Parent object of every person, contains age and any natural characteristic /****************************************************************************/ -#ifndef AGPERSON_H -#define AGPERSON_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -77,7 +71,3 @@ */ virtual ~AGPerson(); }; - -#endif /* AGPerson */ - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGPosition.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGPosition.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGPosition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGPosition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // References a street of the city and defines a position in this street /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGPosition.h" @@ -132,4 +127,5 @@ return position2d; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGPosition.h sumo-1.6.0+dfsg1/src/activitygen/city/AGPosition.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGPosition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGPosition.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // References a street of the city and defines a position in this street /****************************************************************************/ -#ifndef AGPOSITION_H -#define AGPOSITION_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -154,7 +148,3 @@ */ Position compute2dPosition() const; }; - -#endif /* AGPOSITION_H */ - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGSchool.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGSchool.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGSchool.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGSchool.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Correspond to given ages and referenced by children. Has a precise location. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -98,4 +93,5 @@ return opening; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGSchool.h sumo-1.6.0+dfsg1/src/activitygen/city/AGSchool.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGSchool.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGSchool.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Correspond to given ages and referenced by children. Has a precise location. /****************************************************************************/ -#ifndef AGSCHOOL_H -#define AGSCHOOL_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,7 +59,3 @@ AGPosition location; int opening, closing; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGStreet.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGStreet.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGStreet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGStreet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGStreet.h" diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGStreet.h sumo-1.6.0+dfsg1/src/activitygen/city/AGStreet.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGStreet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGStreet.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Represents a SUMO edge and contains people and work densities /****************************************************************************/ -#ifndef AGSTREET_H -#define AGSTREET_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -112,7 +106,3 @@ double myPopulation; double myNumWorkplaces; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGTime.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGTime.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGTime.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGTime.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Time manager: able to manipulate the time using Sumo's format (seconds) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGTime.h" @@ -185,4 +180,5 @@ mySeconds += s; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGTime.h sumo-1.6.0+dfsg1/src/activitygen/city/AGTime.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGTime.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGTime.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Time manager: able to manipulate the time using Sumo's format (seconds) /****************************************************************************/ -#ifndef AGTIME_H -#define AGTIME_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -131,7 +125,3 @@ // @brief: used for in/out int mySeconds; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGWorkPosition.cpp sumo-1.6.0+dfsg1/src/activitygen/city/AGWorkPosition.cpp --- sumo-1.5.0+dfsg1/src/activitygen/city/AGWorkPosition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGWorkPosition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "AGWorkPosition.h" @@ -150,4 +145,5 @@ return myOpeningTime; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/activitygen/city/AGWorkPosition.h sumo-1.6.0+dfsg1/src/activitygen/city/AGWorkPosition.h --- sumo-1.5.0+dfsg1/src/activitygen/city/AGWorkPosition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/activitygen/city/AGWorkPosition.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Location and schedules of a work position: linked with one adult /****************************************************************************/ -#ifndef AGWORKPOSITION_H -#define AGWORKPOSITION_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "AGPosition.h" @@ -76,7 +70,3 @@ int myOpeningTime; int myClosingTime; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/CMakeLists.txt sumo-1.6.0+dfsg1/src/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -8,6 +8,9 @@ add_subdirectory(activitygen) add_subdirectory(dfrouter) add_subdirectory(duarouter) +if (FMI) + add_subdirectory(fmi) +endif () add_subdirectory(foreign) add_subdirectory(jtrrouter) add_subdirectory(libsumo) @@ -35,6 +38,7 @@ add_subdirectory(netedit) endif () + add_executable(sumo sumo_main.cpp) set_target_properties(sumo PROPERTIES OUTPUT_NAME sumo${BINARY_SUFFIX}) set_target_properties(sumo PROPERTIES OUTPUT_NAME_DEBUG sumo${BINARY_SUFFIX}D) diff -Nru sumo-1.5.0+dfsg1/src/config.h.cmake sumo-1.6.0+dfsg1/src/config.h.cmake --- sumo-1.5.0+dfsg1/src/config.h.cmake 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/config.h.cmake 2020-04-27 21:47:56.000000000 +0000 @@ -64,7 +64,7 @@ //#define HAVE_VERSION_H #ifndef HAVE_VERSION_H /* Define if auto-generated version.h is unavailable. */ -#define VERSION_STRING "1.5.0" +#define VERSION_STRING "1.6.0" #endif /* defines the epsilon to use on general floating point comparison */ diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/dfrouter_main.cpp sumo-1.6.0+dfsg1/src/dfrouter/dfrouter_main.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/dfrouter_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/dfrouter_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Main for the DFROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -320,6 +315,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetector.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFDetector.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Class representing a detector within the DFROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorFlow.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorFlow.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorFlow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorFlow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Storage for flows within the DFROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -82,8 +77,6 @@ } - - void RODFDetectorFlows::setFlows(const std::string& detector_id, std::vector& flows) { @@ -187,5 +180,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorFlow.h sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorFlow.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorFlow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorFlow.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // missing_desc /****************************************************************************/ -#ifndef RODFDetectorFlow_h -#define RODFDetectorFlow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -99,9 +93,3 @@ RODFDetectorFlows& operator=(const RODFDetectorFlows& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetector.h sumo-1.6.0+dfsg1/src/dfrouter/RODFDetector.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetector.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Class representing a detector within the DFROUTER /****************************************************************************/ -#ifndef RODFDetector_h -#define RODFDetector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -287,9 +281,3 @@ RODFDetectorCon& operator=(const RODFDetectorCon& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorHandler.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorHandler.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A handler for loading detector descriptions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -101,6 +96,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorHandler.h sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorHandler.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetectorHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetectorHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // missing_desc /****************************************************************************/ -#ifndef RODFDetectorHandler_h -#define RODFDetectorHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -85,9 +79,3 @@ RODFDetectorHandler& operator=(const RODFDetectorHandler& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetFlowLoader.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFDetFlowLoader.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetFlowLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetFlowLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,9 +20,6 @@ /// // A loader for detector flows /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -108,13 +105,13 @@ WRITE_WARNING("At least one line does not contain the correct number of columns."); } continue; - } catch (UnknownElement&) {} catch (OutOfBoundsException&) {} catch (NumberFormatException&) {} - throw ProcessError("The detector-flow-file '" + lr.getFileName() + "' is corrupt;\n" - + " The following values must be supplied : 'Detector', 'Time', 'qPKW'\n" - + " The according column names must be given in the first line of the file."); + } catch (ProcessError& e) { + throw ProcessError(toString(e.what()) + " in '" + lr.getFileName() + "', line " + toString(lr.getLineNumber()) + ";\n" + + " The following values must be supplied : 'Detector', 'Time', 'qPKW'\n" + + " The according column names must be given in the first line of the file."); + } } } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFDetFlowLoader.h sumo-1.6.0+dfsg1/src/dfrouter/RODFDetFlowLoader.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFDetFlowLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFDetFlowLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A loader for detector flows /****************************************************************************/ -#ifndef RODFDetFlowLoader_h -#define RODFDetFlowLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -113,9 +107,3 @@ RODFDetFlowLoader& operator=(const RODFDetFlowLoader& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFEdgeBuilder.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFEdgeBuilder.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFEdgeBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFEdgeBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // Interface for building instances of dfrouter-edges /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "RODFEdgeBuilder.h" @@ -46,4 +42,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFEdgeBuilder.h sumo-1.6.0+dfsg1/src/dfrouter/RODFEdgeBuilder.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFEdgeBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFEdgeBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Interface for building instances of dfrouter-edges /****************************************************************************/ -#ifndef RODFEdgeBuilder_h -#define RODFEdgeBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -79,9 +73,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFEdge.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFEdge.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // An edge within the DFROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -55,4 +50,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFEdge.h sumo-1.6.0+dfsg1/src/dfrouter/RODFEdge.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An edge within the DFROUTER /****************************************************************************/ -#ifndef RODFEdge_h -#define RODFEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -79,9 +73,3 @@ RODFEdge& operator=(const RODFEdge& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFFrame.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFFrame.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Sets and checks options for df-routing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -257,6 +252,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFFrame.h sumo-1.6.0+dfsg1/src/dfrouter/RODFFrame.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Sets and checks options for df-routing /****************************************************************************/ -#ifndef RODFFrame_h -#define RODFFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -51,9 +45,3 @@ static bool checkOptions(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFNet.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFNet.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFNet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFNet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,9 +20,6 @@ /// // A DFROUTER-network /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -393,11 +390,9 @@ distance -= (*k)->getLength(); continue; } - // get the detectors - const std::vector& dets = myDetectorsOnEdges.find(*k)->second; // go through the detectors - for (std::vector::const_iterator l = dets.begin(); l != dets.end(); ++l) { - const RODFDetector& m = detcont.getDetector(*l); + for (const std::string& l : myDetectorsOnEdges.find(*k)->second) { + const RODFDetector& m = detcont.getDetector(l); if (m.getType() == BETWEEN_DETECTOR) { RODFRouteDesc nrd; copy(k, routeend, back_inserter(nrd.edges2Pass)); @@ -515,23 +510,21 @@ std::vector mflows; int index = 0; for (SUMOTime t = startTime; t < endTime; t += stepOffset, index++) { + // collect incoming FlowDef inFlow; inFlow.qLKW = 0; inFlow.qPKW = 0; inFlow.vLKW = 0; inFlow.vPKW = 0; - // collect incoming - { - // !! time difference is missing - for (ROEdgeVector::iterator i = previous.begin(); i != previous.end(); ++i) { - const std::vector& flows = static_cast(*i)->getFlows(); - if (flows.size() != 0) { - const FlowDef& srcFD = flows[index]; - inFlow.qLKW += srcFD.qLKW; - inFlow.qPKW += srcFD.qPKW; - inFlow.vLKW += srcFD.vLKW; - inFlow.vPKW += srcFD.vPKW; - } + // !! time difference is missing + for (const ROEdge* const e : previous) { + const std::vector& eflows = static_cast(e)->getFlows(); + if (eflows.size() != 0) { + const FlowDef& srcFD = eflows[index]; + inFlow.qLKW += srcFD.qLKW; + inFlow.qPKW += srcFD.qPKW; + inFlow.vLKW += srcFD.vLKW; + inFlow.vPKW += srcFD.vPKW; } } inFlow.vLKW /= (double) previous.size(); @@ -542,17 +535,15 @@ outFlow.qPKW = 0; outFlow.vLKW = 0; outFlow.vPKW = 0; - { - // !! time difference is missing - for (ROEdgeVector::iterator i = latter.begin(); i != latter.end(); ++i) { - const std::vector& flows = static_cast(*i)->getFlows(); - if (flows.size() != 0) { - const FlowDef& srcFD = flows[index]; - outFlow.qLKW += srcFD.qLKW; - outFlow.qPKW += srcFD.qPKW; - outFlow.vLKW += srcFD.vLKW; - outFlow.vPKW += srcFD.vPKW; - } + // !! time difference is missing + for (const ROEdge* const e : latter) { + const std::vector& eflows = static_cast(e)->getFlows(); + if (eflows.size() != 0) { + const FlowDef& srcFD = eflows[index]; + outFlow.qLKW += srcFD.qLKW; + outFlow.qPKW += srcFD.qPKW; + outFlow.vLKW += srcFD.vLKW; + outFlow.vPKW += srcFD.vPKW; } } outFlow.vLKW /= (double) latter.size(); @@ -1117,6 +1108,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFNet.h sumo-1.6.0+dfsg1/src/dfrouter/RODFNet.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFNet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFNet.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A DFROUTER-network /****************************************************************************/ -#ifndef RODFNet_h -#define RODFNet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -194,9 +188,3 @@ double myAvgSpeedFactorLKW; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteCont.cpp sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteCont.cpp --- sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A container for routes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -141,6 +136,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteCont.h sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteCont.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A container for routes /****************************************************************************/ -#ifndef RODFRouteCont_h -#define RODFRouteCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -184,9 +178,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteDesc.h sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteDesc.h --- sumo-1.5.0+dfsg1/src/dfrouter/RODFRouteDesc.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/dfrouter/RODFRouteDesc.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A route within the DFROUTER /****************************************************************************/ -#ifndef RODFRouteDesc_h -#define RODFRouteDesc_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ double factor; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/duarouter/duarouter_main.cpp sumo-1.6.0+dfsg1/src/duarouter/duarouter_main.cpp --- sumo-1.5.0+dfsg1/src/duarouter/duarouter_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/duarouter/duarouter_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Main for DUAROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -102,9 +97,10 @@ SUMOAbstractRouter* router; const std::string measure = oc.getString("weight-attribute"); const std::string routingAlgorithm = oc.getString("routing-algorithm"); + const double priorityFactor = oc.getFloat("weights.priority-factor"); const SUMOTime begin = string2time(oc.getString("begin")); const SUMOTime end = string2time(oc.getString("end")); - if (measure == "traveltime") { + if (measure == "traveltime" && priorityFactor == 0) { if (routingAlgorithm == "dijkstra") { router = new DijkstraRouter(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), ttFunction, nullptr, false, nullptr, net.hasPermissions(), oc.isSet("restriction-params")); } else if (routingAlgorithm == "astar") { @@ -148,7 +144,13 @@ } } else { DijkstraRouter::Operation op; - if (measure == "CO") { + if (measure == "traveltime") { + if (ROEdge::initPriorityFactor(priorityFactor)) { + op = &ROEdge::getTravelTimeStaticPriorityFactor; + } else { + op = &ROEdge::getTravelTimeStatic; + } + } else if (measure == "CO") { op = &ROEdge::getEmissionEffort; } else if (measure == "CO2") { op = &ROEdge::getEmissionEffort; @@ -165,7 +167,10 @@ } else if (measure == "noise") { op = &ROEdge::getNoiseEffort; } else { - throw ProcessError("Unknown measure (weight attribute '" + measure + "')!"); + op = &ROEdge::getStoredEffort; + } + if (measure != "traveltime" && !net.hasLoadedEffort()) { + WRITE_WARNING("No weight data was loaded for attribute '" + measure + "'."); } router = new DijkstraRouter( ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, ttFunction, false, nullptr, net.hasPermissions(), oc.isSet("restriction-params")); @@ -182,8 +187,13 @@ carWalk |= ROIntermodalRouter::Network::ALL_JUNCTIONS_TAXI; } } + RailwayRouter* railRouter = nullptr; + if (net.hasBidiEdges()) { + railRouter = new RailwayRouter(ROEdge::getAllEdges(), true, ttFunction, nullptr, false, net.hasPermissions(), oc.isSet("restriction-params")); + } RORouterProvider provider(router, new PedestrianRouter(), - new ROIntermodalRouter(RONet::adaptIntermodalRouter, carWalk, routingAlgorithm)); + new ROIntermodalRouter(RONet::adaptIntermodalRouter, carWalk, routingAlgorithm), + railRouter); // process route definitions try { net.openOutput(oc); @@ -274,6 +284,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/duarouter/RODUAEdgeBuilder.cpp sumo-1.6.0+dfsg1/src/duarouter/RODUAEdgeBuilder.cpp --- sumo-1.5.0+dfsg1/src/duarouter/RODUAEdgeBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/duarouter/RODUAEdgeBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Interface for building instances of duarouter-edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "RODUAEdgeBuilder.h" @@ -48,4 +43,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/duarouter/RODUAEdgeBuilder.h sumo-1.6.0+dfsg1/src/duarouter/RODUAEdgeBuilder.h --- sumo-1.5.0+dfsg1/src/duarouter/RODUAEdgeBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/duarouter/RODUAEdgeBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Interface for building instances of duarouter-edges /****************************************************************************/ -#ifndef RODUAEdgeBuilder_h -#define RODUAEdgeBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -81,9 +75,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/duarouter/RODUAFrame.cpp sumo-1.6.0+dfsg1/src/duarouter/RODUAFrame.cpp --- sumo-1.5.0+dfsg1/src/duarouter/RODUAFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/duarouter/RODUAFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for dua-routing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -118,6 +113,9 @@ oc.doRegister("weight-period", new Option_String("3600", "TIME")); oc.addDescription("weight-period", "Processing", "Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy"); + oc.doRegister("weights.priority-factor", new Option_Float(0)); + oc.addDescription("weights.priority-factor", "Processing", "Consider edge priorities in addition to travel times, weighted by factor"); + oc.doRegister("astar.all-distances", new Option_FileName()); oc.addDescription("astar.all-distances", "Processing", "Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output)"); @@ -239,16 +237,21 @@ const int len = (int)filename.length(); if (len > 4 && filename.substr(len - 4) == ".xml") { oc.set("alternatives-output", filename.substr(0, len - 4) + ".alt.xml"); - } else if (len > 4 && filename.substr(len - 4) == ".sbx") { - oc.set("alternatives-output", filename.substr(0, len - 4) + ".alt.sbx"); + } else if (len > 4 && filename.substr(len - 3) == ".gz") { + oc.set("alternatives-output", filename.substr(0, len - 3) + ".alt.gz"); } else { WRITE_WARNING("Cannot derive file name for alternatives output, skipping it."); } } + if (oc.getBool("write-trips.junctions")) { + if (oc.isDefault("write-trips")) { + oc.set("write-trips", "true"); + } else if (!oc.getBool("write-trips")) { + WRITE_WARNING("Option --write-trips.junctions takes no affect when --write-trips is disabled."); + } + } return ok; } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/duarouter/RODUAFrame.h sumo-1.6.0+dfsg1/src/duarouter/RODUAFrame.h --- sumo-1.5.0+dfsg1/src/duarouter/RODUAFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/duarouter/RODUAFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for dua-routing /****************************************************************************/ -#ifndef RODUAFrame_h -#define RODUAFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -70,9 +64,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/fmi/CMakeLists.txt sumo-1.6.0+dfsg1/src/fmi/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/fmi/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/fmi/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,21 @@ +set(sumofmi2_SRCS + main.c + fmi2Functions.c +) + +set(sumofmi2_model_description + modelDescription.xml +) + +set(sumofmi2_lib_name sumo-fmi2.fmu) + +add_library(sumofmi2 SHARED ${sumofmi2_SRCS}) + +add_custom_target(create_fmi2_zip + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${sumofmi2_model_description} . + COMMAND ${CMAKE_COMMAND} -E tar "cfv" "${CMAKE_SOURCE_DIR}/bin/${sumofmi2_lib_name}" --format=zip "${sumofmi2_model_description}" +) +add_dependencies(create_fmi2_zip sumofmi2) + +add_custom_target(fmi) +add_dependencies(fmi create_fmi2_zip) diff -Nru sumo-1.5.0+dfsg1/src/fmi/fmi2Functions.c sumo-1.6.0+dfsg1/src/fmi/fmi2Functions.c --- sumo-1.5.0+dfsg1/src/fmi/fmi2Functions.c 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/fmi/fmi2Functions.c 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,51 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2020-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 fmi2Functions.c +/// @author Robert Hilbrich +/// @date Tue, 03 Mar 2020 +/// +// Implementation of the FMI2 interface functions +/****************************************************************************/ + +#include + +/* *********************************************************************************************** + * CREATION AND DESTRUCTION OF AN FMU + ***********************************************************************************************/ + +/* The function returns a new instance of an FMU. If a null pointer is returned, then instantiation + failed.*/ +fmi2Component +fmi2Instantiate(fmi2String instanceName, fmi2Type fmuType, fmi2String fmuGUID, + fmi2String fmuResourceLocation, const fmi2CallbackFunctions *functions, + fmi2Boolean visible, fmi2Boolean loggingOn) +{ + /* For co-simulation, this function call has to perform all actions of a slave which are necessary + before a simulation run starts */ + if (loggingOn) + functions->logger(functions->componentEnvironment, instanceName, fmi2Error, "error", "Not yet implemented"); + + return NULL; +} + +/* Disposes the given instance, unloads the loaded model, and frees all the allocated memory +and other resources that have been allocated by the functions of the FMU interface. */ +void +fmi2FreeInstance(fmi2Component c) { + if (!c) return; + + /* Frees the model instance */ + // ModelInstance *comp = (ModelInstance *)c; + // c->freeMemory(c->componentEnvironment, +} diff -Nru sumo-1.5.0+dfsg1/src/fmi/main.c sumo-1.6.0+dfsg1/src/fmi/main.c --- sumo-1.5.0+dfsg1/src/fmi/main.c 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/fmi/main.c 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,23 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2020-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 main.c +/// @author Robert Hilbrich +/// @date Tue, 03 Mar 2020 +/// +// Implementation of the FMI2 to sumolib bridge features +/****************************************************************************/ + +#define FMI_VERSION 2 +#include + diff -Nru sumo-1.5.0+dfsg1/src/fmi/modelDescription.xml sumo-1.6.0+dfsg1/src/fmi/modelDescription.xml --- sumo-1.5.0+dfsg1/src/fmi/modelDescription.xml 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/fmi/modelDescription.xml 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,2 @@ + + \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2Functions.h sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2Functions.h --- sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2Functions.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2Functions.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,327 @@ +#ifndef fmi2Functions_h +#define fmi2Functions_h + +/* This header file must be utilized when compiling a FMU. + It defines all functions of the + FMI 2.0.1 Model Exchange and Co-Simulation Interface. + + In order to have unique function names even if several FMUs + are compiled together (e.g. for embedded systems), every "real" function name + is constructed by prepending the function name by "FMI2_FUNCTION_PREFIX". + Therefore, the typical usage is: + + #define FMI2_FUNCTION_PREFIX MyModel_ + #include "fmi2Functions.h" + + As a result, a function that is defined as "fmi2GetDerivatives" in this header file, + is actually getting the name "MyModel_fmi2GetDerivatives". + + This only holds if the FMU is shipped in C source code, or is compiled in a + static link library. For FMUs compiled in a DLL/sharedObject, the "actual" function + names are used and "FMI2_FUNCTION_PREFIX" must not be defined. + + Revisions: + - Sep. 29, 2019: License changed to 2-clause BSD License (without extensions) + - Apr. 9, 2014: All prefixes "fmi" renamed to "fmi2" (decision from April 8) + - Mar. 26, 2014: FMI_Export set to empty value if FMI_Export and FMI_FUNCTION_PREFIX + are not defined (#173) + - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged: + fmiInstantiateModel , fmiInstantiateSlave -> fmiInstantiate + fmiFreeModelInstance, fmiFreeSlaveInstance -> fmiFreeInstance + fmiEnterModelInitializationMode, fmiEnterSlaveInitializationMode -> fmiEnterInitializationMode + fmiExitModelInitializationMode , fmiExitSlaveInitializationMode -> fmiExitInitializationMode + fmiTerminateModel, fmiTerminateSlave -> fmiTerminate + fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation) + Functions renamed: + fmiUpdateDiscreteStates -> fmiNewDiscreteStates + - June 13, 2013: Functions removed: + fmiInitializeModel + fmiEventUpdate + fmiCompletedEventIteration + fmiInitializeSlave + Functions added: + fmiEnterModelInitializationMode + fmiExitModelInitializationMode + fmiEnterEventMode + fmiUpdateDiscreteStates + fmiEnterContinuousTimeMode + fmiEnterSlaveInitializationMode; + fmiExitSlaveInitializationMode; + - Feb. 17, 2013: Portability improvements: + o DllExport changed to FMI_Export + o FUNCTION_PREFIX changed to FMI_FUNCTION_PREFIX + o Allow undefined FMI_FUNCTION_PREFIX (meaning no prefix is used) + Changed function name "fmiTerminate" to "fmiTerminateModel" (due to #113) + Changed function name "fmiGetNominalContinuousState" to + "fmiGetNominalsOfContinuousStates" + Removed fmiGetStateValueReferences. + - Nov. 14, 2011: Adapted to FMI 2.0: + o Split into two files (fmiFunctions.h, fmiTypes.h) in order + that code that dynamically loads an FMU can directly + utilize the header files). + o Added C++ encapsulation of C-part, in order that the header + file can be directly utilized in C++ code. + o fmiCallbackFunctions is passed as pointer to fmiInstantiateXXX + o stepFinished within fmiCallbackFunctions has as first + argument "fmiComponentEnvironment" and not "fmiComponent". + o New functions to get and set the complete FMU state + and to compute partial derivatives. + - Nov. 4, 2010: Adapted to specification text: + o fmiGetModelTypesPlatform renamed to fmiGetTypesPlatform + o fmiInstantiateSlave: Argument GUID replaced by fmuGUID + Argument mimetype replaced by mimeType + o tabs replaced by spaces + - Oct. 16, 2010: Functions for FMI for Co-simulation added + - Jan. 20, 2010: stateValueReferencesChanged added to struct fmiEventInfo (ticket #27) + (by M. Otter, DLR) + Added WIN32 pragma to define the struct layout (ticket #34) + (by J. Mauss, QTronic) + - Jan. 4, 2010: Removed argument intermediateResults from fmiInitialize + Renamed macro fmiGetModelFunctionsVersion to fmiGetVersion + Renamed macro fmiModelFunctionsVersion to fmiVersion + Replaced fmiModel by fmiComponent in decl of fmiInstantiateModel + (by J. Mauss, QTronic) + - Dec. 17, 2009: Changed extension "me" to "fmi" (by Martin Otter, DLR). + - Dez. 14, 2009: Added eventInfo to meInitialize and added + meGetNominalContinuousStates (by Martin Otter, DLR) + - Sept. 9, 2009: Added DllExport (according to Peter Nilsson's suggestion) + (by A. Junghanns, QTronic) + - Sept. 9, 2009: Changes according to FMI-meeting on July 21: + meInquireModelTypesVersion -> meGetModelTypesPlatform + meInquireModelFunctionsVersion -> meGetModelFunctionsVersion + meSetStates -> meSetContinuousStates + meGetStates -> meGetContinuousStates + removal of meInitializeModelClass + removal of meGetTime + change of arguments of meInstantiateModel + change of arguments of meCompletedIntegratorStep + (by Martin Otter, DLR): + - July 19, 2009: Added "me" as prefix to file names (by Martin Otter, DLR). + - March 2, 2009: Changed function definitions according to the last design + meeting with additional improvements (by Martin Otter, DLR). + - Dec. 3 , 2008: First version by Martin Otter (DLR) and Hans Olsson (Dynasim). + + + Copyright (C) 2008-2011 MODELISAR consortium, + 2012-2019 Modelica Association Project "FMI" + All rights reserved. + + This file is licensed by the copyright holders under the 2-Clause BSD License + (https://opensource.org/licenses/BSD-2-Clause): + + ---------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------- +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +#include "fmi2TypesPlatform.h" +#include "fmi2FunctionTypes.h" +#include + + +/* + Export FMI2 API functions on Windows and under GCC. + If custom linking is desired then the FMI2_Export must be + defined before including this file. For instance, + it may be set to __declspec(dllimport). +*/ +#if !defined(FMI2_Export) + #if !defined(FMI2_FUNCTION_PREFIX) + #if defined _WIN32 || defined __CYGWIN__ + /* Note: both gcc & MSVC on Windows support this syntax. */ + #define FMI2_Export __declspec(dllexport) + #else + #if __GNUC__ >= 4 + #define FMI2_Export __attribute__ ((visibility ("default"))) + #else + #define FMI2_Export + #endif + #endif + #else + #define FMI2_Export + #endif +#endif + +/* Macros to construct the real function name + (prepend function name by FMI2_FUNCTION_PREFIX) */ +#if defined(FMI2_FUNCTION_PREFIX) + #define fmi2Paste(a,b) a ## b + #define fmi2PasteB(a,b) fmi2Paste(a,b) + #define fmi2FullName(name) fmi2PasteB(FMI2_FUNCTION_PREFIX, name) +#else + #define fmi2FullName(name) name +#endif + +/*************************************************** +Common Functions +****************************************************/ +#define fmi2GetTypesPlatform fmi2FullName(fmi2GetTypesPlatform) +#define fmi2GetVersion fmi2FullName(fmi2GetVersion) +#define fmi2SetDebugLogging fmi2FullName(fmi2SetDebugLogging) +#define fmi2Instantiate fmi2FullName(fmi2Instantiate) +#define fmi2FreeInstance fmi2FullName(fmi2FreeInstance) +#define fmi2SetupExperiment fmi2FullName(fmi2SetupExperiment) +#define fmi2EnterInitializationMode fmi2FullName(fmi2EnterInitializationMode) +#define fmi2ExitInitializationMode fmi2FullName(fmi2ExitInitializationMode) +#define fmi2Terminate fmi2FullName(fmi2Terminate) +#define fmi2Reset fmi2FullName(fmi2Reset) +#define fmi2GetReal fmi2FullName(fmi2GetReal) +#define fmi2GetInteger fmi2FullName(fmi2GetInteger) +#define fmi2GetBoolean fmi2FullName(fmi2GetBoolean) +#define fmi2GetString fmi2FullName(fmi2GetString) +#define fmi2SetReal fmi2FullName(fmi2SetReal) +#define fmi2SetInteger fmi2FullName(fmi2SetInteger) +#define fmi2SetBoolean fmi2FullName(fmi2SetBoolean) +#define fmi2SetString fmi2FullName(fmi2SetString) +#define fmi2GetFMUstate fmi2FullName(fmi2GetFMUstate) +#define fmi2SetFMUstate fmi2FullName(fmi2SetFMUstate) +#define fmi2FreeFMUstate fmi2FullName(fmi2FreeFMUstate) +#define fmi2SerializedFMUstateSize fmi2FullName(fmi2SerializedFMUstateSize) +#define fmi2SerializeFMUstate fmi2FullName(fmi2SerializeFMUstate) +#define fmi2DeSerializeFMUstate fmi2FullName(fmi2DeSerializeFMUstate) +#define fmi2GetDirectionalDerivative fmi2FullName(fmi2GetDirectionalDerivative) + + +/*************************************************** +Functions for FMI2 for Model Exchange +****************************************************/ +#define fmi2EnterEventMode fmi2FullName(fmi2EnterEventMode) +#define fmi2NewDiscreteStates fmi2FullName(fmi2NewDiscreteStates) +#define fmi2EnterContinuousTimeMode fmi2FullName(fmi2EnterContinuousTimeMode) +#define fmi2CompletedIntegratorStep fmi2FullName(fmi2CompletedIntegratorStep) +#define fmi2SetTime fmi2FullName(fmi2SetTime) +#define fmi2SetContinuousStates fmi2FullName(fmi2SetContinuousStates) +#define fmi2GetDerivatives fmi2FullName(fmi2GetDerivatives) +#define fmi2GetEventIndicators fmi2FullName(fmi2GetEventIndicators) +#define fmi2GetContinuousStates fmi2FullName(fmi2GetContinuousStates) +#define fmi2GetNominalsOfContinuousStates fmi2FullName(fmi2GetNominalsOfContinuousStates) + + +/*************************************************** +Functions for FMI2 for Co-Simulation +****************************************************/ +#define fmi2SetRealInputDerivatives fmi2FullName(fmi2SetRealInputDerivatives) +#define fmi2GetRealOutputDerivatives fmi2FullName(fmi2GetRealOutputDerivatives) +#define fmi2DoStep fmi2FullName(fmi2DoStep) +#define fmi2CancelStep fmi2FullName(fmi2CancelStep) +#define fmi2GetStatus fmi2FullName(fmi2GetStatus) +#define fmi2GetRealStatus fmi2FullName(fmi2GetRealStatus) +#define fmi2GetIntegerStatus fmi2FullName(fmi2GetIntegerStatus) +#define fmi2GetBooleanStatus fmi2FullName(fmi2GetBooleanStatus) +#define fmi2GetStringStatus fmi2FullName(fmi2GetStringStatus) + +/* Version number */ +#define fmi2Version "2.0" + + +/*************************************************** +Common Functions +****************************************************/ + +/* Inquire version numbers of header files */ + FMI2_Export fmi2GetTypesPlatformTYPE fmi2GetTypesPlatform; + FMI2_Export fmi2GetVersionTYPE fmi2GetVersion; + FMI2_Export fmi2SetDebugLoggingTYPE fmi2SetDebugLogging; + +/* Creation and destruction of FMU instances */ + FMI2_Export fmi2InstantiateTYPE fmi2Instantiate; + FMI2_Export fmi2FreeInstanceTYPE fmi2FreeInstance; + +/* Enter and exit initialization mode, terminate and reset */ + FMI2_Export fmi2SetupExperimentTYPE fmi2SetupExperiment; + FMI2_Export fmi2EnterInitializationModeTYPE fmi2EnterInitializationMode; + FMI2_Export fmi2ExitInitializationModeTYPE fmi2ExitInitializationMode; + FMI2_Export fmi2TerminateTYPE fmi2Terminate; + FMI2_Export fmi2ResetTYPE fmi2Reset; + +/* Getting and setting variables values */ + FMI2_Export fmi2GetRealTYPE fmi2GetReal; + FMI2_Export fmi2GetIntegerTYPE fmi2GetInteger; + FMI2_Export fmi2GetBooleanTYPE fmi2GetBoolean; + FMI2_Export fmi2GetStringTYPE fmi2GetString; + + FMI2_Export fmi2SetRealTYPE fmi2SetReal; + FMI2_Export fmi2SetIntegerTYPE fmi2SetInteger; + FMI2_Export fmi2SetBooleanTYPE fmi2SetBoolean; + FMI2_Export fmi2SetStringTYPE fmi2SetString; + +/* Getting and setting the internal FMU state */ + FMI2_Export fmi2GetFMUstateTYPE fmi2GetFMUstate; + FMI2_Export fmi2SetFMUstateTYPE fmi2SetFMUstate; + FMI2_Export fmi2FreeFMUstateTYPE fmi2FreeFMUstate; + FMI2_Export fmi2SerializedFMUstateSizeTYPE fmi2SerializedFMUstateSize; + FMI2_Export fmi2SerializeFMUstateTYPE fmi2SerializeFMUstate; + FMI2_Export fmi2DeSerializeFMUstateTYPE fmi2DeSerializeFMUstate; + +/* Getting partial derivatives */ + FMI2_Export fmi2GetDirectionalDerivativeTYPE fmi2GetDirectionalDerivative; + + +/*************************************************** +Functions for FMI2 for Model Exchange +****************************************************/ + +/* Enter and exit the different modes */ + FMI2_Export fmi2EnterEventModeTYPE fmi2EnterEventMode; + FMI2_Export fmi2NewDiscreteStatesTYPE fmi2NewDiscreteStates; + FMI2_Export fmi2EnterContinuousTimeModeTYPE fmi2EnterContinuousTimeMode; + FMI2_Export fmi2CompletedIntegratorStepTYPE fmi2CompletedIntegratorStep; + +/* Providing independent variables and re-initialization of caching */ + FMI2_Export fmi2SetTimeTYPE fmi2SetTime; + FMI2_Export fmi2SetContinuousStatesTYPE fmi2SetContinuousStates; + +/* Evaluation of the model equations */ + FMI2_Export fmi2GetDerivativesTYPE fmi2GetDerivatives; + FMI2_Export fmi2GetEventIndicatorsTYPE fmi2GetEventIndicators; + FMI2_Export fmi2GetContinuousStatesTYPE fmi2GetContinuousStates; + FMI2_Export fmi2GetNominalsOfContinuousStatesTYPE fmi2GetNominalsOfContinuousStates; + + +/*************************************************** +Functions for FMI2 for Co-Simulation +****************************************************/ + +/* Simulating the slave */ + FMI2_Export fmi2SetRealInputDerivativesTYPE fmi2SetRealInputDerivatives; + FMI2_Export fmi2GetRealOutputDerivativesTYPE fmi2GetRealOutputDerivatives; + + FMI2_Export fmi2DoStepTYPE fmi2DoStep; + FMI2_Export fmi2CancelStepTYPE fmi2CancelStep; + +/* Inquire slave status */ + FMI2_Export fmi2GetStatusTYPE fmi2GetStatus; + FMI2_Export fmi2GetRealStatusTYPE fmi2GetRealStatus; + FMI2_Export fmi2GetIntegerStatusTYPE fmi2GetIntegerStatus; + FMI2_Export fmi2GetBooleanStatusTYPE fmi2GetBooleanStatus; + FMI2_Export fmi2GetStringStatusTYPE fmi2GetStringStatus; + +#ifdef __cplusplus +} /* end of extern "C" { */ +#endif + +#endif /* fmi2Functions_h */ diff -Nru sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2FunctionTypes.h sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2FunctionTypes.h --- sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2FunctionTypes.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2FunctionTypes.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,271 @@ +#ifndef fmi2FunctionTypes_h +#define fmi2FunctionTypes_h + +#include "fmi2TypesPlatform.h" + +/* This header file must be utilized when compiling an FMU or an FMI master. + It declares data and function types for FMI 2.0.1 + + Revisions: + - Sep. 30, 2019: License changed to 2-clause BSD License (without extensions) + - Jul. 5, 2019: Remove const modifier from fields of fmi2CallbackFunctions (#216) + - Sep. 6, 2018: Parameter names added to function prototypes + - Apr. 9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8) + - Apr. 3, 2014: Added #include for size_t definition + - Mar. 27, 2014: Added #include "fmiTypesPlatform.h" (#179) + - Mar. 26, 2014: Introduced function argument "void" for the functions (#171) + fmiGetTypesPlatformTYPE and fmiGetVersionTYPE + - Oct. 11, 2013: Functions of ModelExchange and CoSimulation merged: + fmiInstantiateModelTYPE , fmiInstantiateSlaveTYPE -> fmiInstantiateTYPE + fmiFreeModelInstanceTYPE, fmiFreeSlaveInstanceTYPE -> fmiFreeInstanceTYPE + fmiEnterModelInitializationModeTYPE, fmiEnterSlaveInitializationModeTYPE -> fmiEnterInitializationModeTYPE + fmiExitModelInitializationModeTYPE , fmiExitSlaveInitializationModeTYPE -> fmiExitInitializationModeTYPE + fmiTerminateModelTYPE , fmiTerminateSlaveTYPE -> fmiTerminate + fmiResetSlave -> fmiReset (now also for ModelExchange and not only for CoSimulation) + Functions renamed + fmiUpdateDiscreteStatesTYPE -> fmiNewDiscreteStatesTYPE + Renamed elements of the enumeration fmiEventInfo + upcomingTimeEvent -> nextEventTimeDefined // due to generic naming scheme: varDefined + var + newUpdateDiscreteStatesNeeded -> newDiscreteStatesNeeded; + - June 13, 2013: Changed type fmiEventInfo + Functions removed: + fmiInitializeModelTYPE + fmiEventUpdateTYPE + fmiCompletedEventIterationTYPE + fmiInitializeSlaveTYPE + Functions added: + fmiEnterModelInitializationModeTYPE + fmiExitModelInitializationModeTYPE + fmiEnterEventModeTYPE + fmiUpdateDiscreteStatesTYPE + fmiEnterContinuousTimeModeTYPE + fmiEnterSlaveInitializationModeTYPE; + fmiExitSlaveInitializationModeTYPE; + - Feb. 17, 2013: Added third argument to fmiCompletedIntegratorStepTYPE + Changed function name "fmiTerminateType" to "fmiTerminateModelType" (due to #113) + Changed function name "fmiGetNominalContinuousStateTYPE" to + "fmiGetNominalsOfContinuousStatesTYPE" + Removed fmiGetStateValueReferencesTYPE. + - Nov. 14, 2011: First public Version + + + Copyright (C) 2008-2011 MODELISAR consortium, + 2012-2019 Modelica Association Project "FMI" + All rights reserved. + + This file is licensed by the copyright holders under the 2-Clause BSD License + (https://opensource.org/licenses/BSD-2-Clause): + + ---------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------- +*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/* make sure all compiler use the same alignment policies for structures */ +#if defined _MSC_VER || defined __GNUC__ +#pragma pack(push,8) +#endif + +/* Include stddef.h, in order that size_t etc. is defined */ +#include + + +/* Type definitions */ +typedef enum { + fmi2OK, + fmi2Warning, + fmi2Discard, + fmi2Error, + fmi2Fatal, + fmi2Pending +} fmi2Status; + +typedef enum { + fmi2ModelExchange, + fmi2CoSimulation +} fmi2Type; + +typedef enum { + fmi2DoStepStatus, + fmi2PendingStatus, + fmi2LastSuccessfulTime, + fmi2Terminated +} fmi2StatusKind; + +typedef void (*fmi2CallbackLogger) (fmi2ComponentEnvironment componentEnvironment, + fmi2String instanceName, + fmi2Status status, + fmi2String category, + fmi2String message, + ...); +typedef void* (*fmi2CallbackAllocateMemory)(size_t nobj, size_t size); +typedef void (*fmi2CallbackFreeMemory) (void* obj); +typedef void (*fmi2StepFinished) (fmi2ComponentEnvironment componentEnvironment, + fmi2Status status); + +typedef struct { + fmi2CallbackLogger logger; + fmi2CallbackAllocateMemory allocateMemory; + fmi2CallbackFreeMemory freeMemory; + fmi2StepFinished stepFinished; + fmi2ComponentEnvironment componentEnvironment; +} fmi2CallbackFunctions; + +typedef struct { + fmi2Boolean newDiscreteStatesNeeded; + fmi2Boolean terminateSimulation; + fmi2Boolean nominalsOfContinuousStatesChanged; + fmi2Boolean valuesOfContinuousStatesChanged; + fmi2Boolean nextEventTimeDefined; + fmi2Real nextEventTime; +} fmi2EventInfo; + + +/* reset alignment policy to the one set before reading this file */ +#if defined _MSC_VER || defined __GNUC__ +#pragma pack(pop) +#endif + + +/* Define fmi2 function pointer types to simplify dynamic loading */ + +/*************************************************** +Types for Common Functions +****************************************************/ + +/* Inquire version numbers of header files and setting logging status */ + typedef const char* fmi2GetTypesPlatformTYPE(void); + typedef const char* fmi2GetVersionTYPE(void); + typedef fmi2Status fmi2SetDebugLoggingTYPE(fmi2Component c, + fmi2Boolean loggingOn, + size_t nCategories, + const fmi2String categories[]); + +/* Creation and destruction of FMU instances and setting debug status */ + typedef fmi2Component fmi2InstantiateTYPE(fmi2String instanceName, + fmi2Type fmuType, + fmi2String fmuGUID, + fmi2String fmuResourceLocation, + const fmi2CallbackFunctions* functions, + fmi2Boolean visible, + fmi2Boolean loggingOn); + typedef void fmi2FreeInstanceTYPE(fmi2Component c); + +/* Enter and exit initialization mode, terminate and reset */ + typedef fmi2Status fmi2SetupExperimentTYPE (fmi2Component c, + fmi2Boolean toleranceDefined, + fmi2Real tolerance, + fmi2Real startTime, + fmi2Boolean stopTimeDefined, + fmi2Real stopTime); + typedef fmi2Status fmi2EnterInitializationModeTYPE(fmi2Component c); + typedef fmi2Status fmi2ExitInitializationModeTYPE (fmi2Component c); + typedef fmi2Status fmi2TerminateTYPE (fmi2Component c); + typedef fmi2Status fmi2ResetTYPE (fmi2Component c); + +/* Getting and setting variable values */ + typedef fmi2Status fmi2GetRealTYPE (fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2Real value[]); + typedef fmi2Status fmi2GetIntegerTYPE(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2Integer value[]); + typedef fmi2Status fmi2GetBooleanTYPE(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2Boolean value[]); + typedef fmi2Status fmi2GetStringTYPE (fmi2Component c, const fmi2ValueReference vr[], size_t nvr, fmi2String value[]); + + typedef fmi2Status fmi2SetRealTYPE (fmi2Component c, const fmi2ValueReference vr[], size_t nvr, const fmi2Real value[]); + typedef fmi2Status fmi2SetIntegerTYPE(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, const fmi2Integer value[]); + typedef fmi2Status fmi2SetBooleanTYPE(fmi2Component c, const fmi2ValueReference vr[], size_t nvr, const fmi2Boolean value[]); + typedef fmi2Status fmi2SetStringTYPE (fmi2Component c, const fmi2ValueReference vr[], size_t nvr, const fmi2String value[]); + +/* Getting and setting the internal FMU state */ + typedef fmi2Status fmi2GetFMUstateTYPE (fmi2Component c, fmi2FMUstate* FMUstate); + typedef fmi2Status fmi2SetFMUstateTYPE (fmi2Component c, fmi2FMUstate FMUstate); + typedef fmi2Status fmi2FreeFMUstateTYPE (fmi2Component c, fmi2FMUstate* FMUstate); + typedef fmi2Status fmi2SerializedFMUstateSizeTYPE(fmi2Component c, fmi2FMUstate FMUstate, size_t* size); + typedef fmi2Status fmi2SerializeFMUstateTYPE (fmi2Component c, fmi2FMUstate FMUstate, fmi2Byte[], size_t size); + typedef fmi2Status fmi2DeSerializeFMUstateTYPE (fmi2Component c, const fmi2Byte serializedState[], size_t size, fmi2FMUstate* FMUstate); + +/* Getting partial derivatives */ + typedef fmi2Status fmi2GetDirectionalDerivativeTYPE(fmi2Component c, + const fmi2ValueReference vUnknown_ref[], size_t nUnknown, + const fmi2ValueReference vKnown_ref[], size_t nKnown, + const fmi2Real dvKnown[], + fmi2Real dvUnknown[]); + +/*************************************************** +Types for Functions for FMI2 for Model Exchange +****************************************************/ + +/* Enter and exit the different modes */ + typedef fmi2Status fmi2EnterEventModeTYPE (fmi2Component c); + typedef fmi2Status fmi2NewDiscreteStatesTYPE (fmi2Component c, fmi2EventInfo* fmi2eventInfo); + typedef fmi2Status fmi2EnterContinuousTimeModeTYPE(fmi2Component c); + typedef fmi2Status fmi2CompletedIntegratorStepTYPE(fmi2Component c, + fmi2Boolean noSetFMUStatePriorToCurrentPoint, + fmi2Boolean* enterEventMode, + fmi2Boolean* terminateSimulation); + +/* Providing independent variables and re-initialization of caching */ + typedef fmi2Status fmi2SetTimeTYPE (fmi2Component c, fmi2Real time); + typedef fmi2Status fmi2SetContinuousStatesTYPE(fmi2Component c, const fmi2Real x[], size_t nx); + +/* Evaluation of the model equations */ + typedef fmi2Status fmi2GetDerivativesTYPE (fmi2Component c, fmi2Real derivatives[], size_t nx); + typedef fmi2Status fmi2GetEventIndicatorsTYPE (fmi2Component c, fmi2Real eventIndicators[], size_t ni); + typedef fmi2Status fmi2GetContinuousStatesTYPE (fmi2Component c, fmi2Real x[], size_t nx); + typedef fmi2Status fmi2GetNominalsOfContinuousStatesTYPE(fmi2Component c, fmi2Real x_nominal[], size_t nx); + + +/*************************************************** +Types for Functions for FMI2 for Co-Simulation +****************************************************/ + +/* Simulating the slave */ + typedef fmi2Status fmi2SetRealInputDerivativesTYPE (fmi2Component c, + const fmi2ValueReference vr[], size_t nvr, + const fmi2Integer order[], + const fmi2Real value[]); + typedef fmi2Status fmi2GetRealOutputDerivativesTYPE(fmi2Component c, + const fmi2ValueReference vr[], size_t nvr, + const fmi2Integer order[], + fmi2Real value[]); + typedef fmi2Status fmi2DoStepTYPE (fmi2Component c, + fmi2Real currentCommunicationPoint, + fmi2Real communicationStepSize, + fmi2Boolean noSetFMUStatePriorToCurrentPoint); + typedef fmi2Status fmi2CancelStepTYPE(fmi2Component c); + +/* Inquire slave status */ + typedef fmi2Status fmi2GetStatusTYPE (fmi2Component c, const fmi2StatusKind s, fmi2Status* value); + typedef fmi2Status fmi2GetRealStatusTYPE (fmi2Component c, const fmi2StatusKind s, fmi2Real* value); + typedef fmi2Status fmi2GetIntegerStatusTYPE(fmi2Component c, const fmi2StatusKind s, fmi2Integer* value); + typedef fmi2Status fmi2GetBooleanStatusTYPE(fmi2Component c, const fmi2StatusKind s, fmi2Boolean* value); + typedef fmi2Status fmi2GetStringStatusTYPE (fmi2Component c, const fmi2StatusKind s, fmi2String* value); + + +#ifdef __cplusplus +} /* end of extern "C" { */ +#endif + +#endif /* fmi2FunctionTypes_h */ diff -Nru sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2TypesPlatform.h sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2TypesPlatform.h --- sumo-1.5.0+dfsg1/src/foreign/fmi/fmi2TypesPlatform.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/fmi/fmi2TypesPlatform.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,108 @@ +#ifndef fmi2TypesPlatform_h +#define fmi2TypesPlatform_h + +/* Standard header file to define the argument types of the + functions of the Functional Mock-up Interface 2.0.1 + This header file must be utilized both by the model and + by the simulation engine. + + Revisions: + - Sep. 29, 2019: License changed to 2-clause BSD License (without extensions) + - Apr. 9, 2014: All prefixes "fmi" renamed to "fmi2" (decision from April 8) + - Mar 31, 2014: New datatype fmiChar introduced. + - Feb. 17, 2013: Changed fmiTypesPlatform from "standard32" to "default". + Removed fmiUndefinedValueReference since no longer needed + (because every state is defined in ScalarVariables). + - March 20, 2012: Renamed from fmiPlatformTypes.h to fmiTypesPlatform.h + - Nov. 14, 2011: Use the header file "fmiPlatformTypes.h" for FMI 2.0 + both for "FMI for model exchange" and for "FMI for co-simulation" + New types "fmiComponentEnvironment", "fmiState", and "fmiByte". + The implementation of "fmiBoolean" is change from "char" to "int". + The #define "fmiPlatform" changed to "fmiTypesPlatform" + (in order that #define and function call are consistent) + - Oct. 4, 2010: Renamed header file from "fmiModelTypes.h" to fmiPlatformTypes.h" + for the co-simulation interface + - Jan. 4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic) + - Dec. 21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent" + according to meeting on Dec. 18 (by Martin Otter, DLR) + - Dec. 6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR) + - Sept. 9, 2009: Changes according to FMI-meeting on July 21: + Changed "version" to "platform", "standard" to "standard32", + Added a precise definition of "standard32" as comment + (by Martin Otter, DLR) + - July 19, 2009: Added "me" as prefix to file names, added meTrue/meFalse, + and changed meValueReferenced from int to unsigned int + (by Martin Otter, DLR). + - March 2, 2009: Moved enums and function pointer definitions to + ModelFunctions.h (by Martin Otter, DLR). + - Dec. 3, 2008 : First version by Martin Otter (DLR) and + Hans Olsson (Dynasim). + + + Copyright (C) 2008-2011 MODELISAR consortium, + 2012-2019 Modelica Association Project "FMI" + All rights reserved. + + This file is licensed by the copyright holders under the 2-Clause BSD License + (https://opensource.org/licenses/BSD-2-Clause): + + ---------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) 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 OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + ---------------------------------------------------------------------------- +*/ + +/* Platform (unique identification of this header file) */ +#define fmi2TypesPlatform "default" + +/* Type definitions of variables passed as arguments + Version "default" means: + + fmi2Component : an opaque object pointer + fmi2ComponentEnvironment: an opaque object pointer + fmi2FMUstate : an opaque object pointer + fmi2ValueReference : handle to the value of a variable + fmi2Real : double precision floating-point data type + fmi2Integer : basic signed integer data type + fmi2Boolean : basic signed integer data type + fmi2Char : character data type + fmi2String : a pointer to a vector of fmi2Char characters + ('\0' terminated, UTF8 encoded) + fmi2Byte : smallest addressable unit of the machine, typically one byte. +*/ + typedef void* fmi2Component; /* Pointer to FMU instance */ + typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */ + typedef void* fmi2FMUstate; /* Pointer to internal FMU state */ + typedef unsigned int fmi2ValueReference; + typedef double fmi2Real ; + typedef int fmi2Integer; + typedef int fmi2Boolean; + typedef char fmi2Char; + typedef const fmi2Char* fmi2String; + typedef char fmi2Byte; + +/* Values for fmi2Boolean */ +#define fmi2True 1 +#define fmi2False 0 + + +#endif /* fmi2TypesPlatform_h */ diff -Nru sumo-1.5.0+dfsg1/src/foreign/PHEMlight/cpp/CEP.cpp sumo-1.6.0+dfsg1/src/foreign/PHEMlight/cpp/CEP.cpp --- sumo-1.5.0+dfsg1/src/foreign/PHEMlight/cpp/CEP.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/PHEMlight/cpp/CEP.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -30,7 +30,7 @@ namespace PHEMlightdll { CEP::CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, std::vector& transmissionGearRatios, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1, const std::string& vehicelFuelType, std::vector >& matrixFC, std::vector& headerLinePollutants, std::vector >& matrixPollutants, std::vector >& matrixSpeedRotational, std::vector >& normedDragTable, double idlingFC, std::vector& idlingPollutants) { - transmissionGearRatios.size(); // just to make the compiler happy about the unused parameter + (void)transmissionGearRatios; // just to make the compiler happy about the unused parameter InitializeInstanceFields(); _resistanceF0 = f0; _resistanceF1 = f1; diff -Nru sumo-1.5.0+dfsg1/src/foreign/PHEMlight/cpp/conversion.patch sumo-1.6.0+dfsg1/src/foreign/PHEMlight/cpp/conversion.patch --- sumo-1.5.0+dfsg1/src/foreign/PHEMlight/cpp/conversion.patch 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/PHEMlight/cpp/conversion.patch 2020-04-27 21:47:56.000000000 +0000 @@ -33,7 +33,7 @@ namespace PHEMlightdll { CEP::CEP(bool heavyVehicle, double vehicleMass, double vehicleLoading, double vehicleMassRot, double crossArea, double cWValue, double f0, double f1, double f2, double f3, double f4, double axleRatio, std::vector& transmissionGearRatios, double auxPower, double ratedPower, double engineIdlingSpeed, double engineRatedSpeed, double effictiveWheelDiameter, double pNormV0, double pNormP0, double pNormV1, double pNormP1, const std::string& vehicelFuelType, std::vector >& matrixFC, std::vector& headerLinePollutants, std::vector >& matrixPollutants, std::vector >& matrixSpeedRotational, std::vector >& normedDragTable, double idlingFC, std::vector& idlingPollutants) { -+ transmissionGearRatios.size(); // just to make the compiler happy about the unused parameter ++ (void)transmissionGearRatios; // just to make the compiler happy about the unused parameter InitializeInstanceFields(); _resistanceF0 = f0; _resistanceF1 = f1; diff -Nru sumo-1.5.0+dfsg1/src/foreign/rtree/LayeredRTree.h sumo-1.6.0+dfsg1/src/foreign/rtree/LayeredRTree.h --- sumo-1.5.0+dfsg1/src/foreign/rtree/LayeredRTree.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/rtree/LayeredRTree.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // The search order returns layer 2 first because it must be drawn before layer // 1 for alpha blending to work /****************************************************************************/ -#ifndef LayeredRTree_h -#define LayeredRTree_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -125,9 +119,3 @@ } }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/foreign/rtree/SUMORTree.h sumo-1.6.0+dfsg1/src/foreign/rtree/SUMORTree.h --- sumo-1.5.0+dfsg1/src/foreign/rtree/SUMORTree.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/foreign/rtree/SUMORTree.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A RT-tree for efficient storing of SUMO's GL-objects /****************************************************************************/ -#ifndef SUMORTree_h -#define SUMORTree_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -172,8 +166,10 @@ throw ProcessError("Boundary of GUIGlObject " + o->getMicrosimID() + " has an invalid size"); } else if (myTreeDebug.count(o) == 0) { throw ProcessError("GUIGlObject wasn't inserted"); - } else if (b != myTreeDebug.at(o)) { - throw ProcessError("add boundary of GUIGlObject " + o->getMicrosimID() + " is different of removed boundary (" + toString(b) + " != " + toString(myTreeDebug.at(o)) + ")"); + } else if (toString(b) != toString(myTreeDebug.at(o))) { + // show information in console before throwing exception + std::cout << "Tree: " << toString(myTreeDebug.at(o)) << " original: " << toString(b) << std::endl; + throw ProcessError("add boundary of GUIGlObject " + o->getMicrosimID() + " is different of removed boundary (" + toString(b) + " != " + toString(myTreeDebug.at(o)) + ")"); } else { myTreeDebug.erase(o); WRITE_GLDEBUG("\tRemoved object " + o->getFullName() + " from SUMORTree with boundary " + toString(b)); @@ -195,9 +191,3 @@ */ std::map myTreeDebug; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The application's "About" - dialog /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -41,13 +36,13 @@ GUIDialog_AboutSUMO::GUIDialog_AboutSUMO(FXWindow* parent) : FXDialogBox(parent, "About Eclipse SUMO", GUIDesignDialogBox) { // set dialog icon - setIcon(GUIIconSubSys::getIcon(ICON_SUMO_MINI)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::SUMO_MINI)); // create frame for main info FXHorizontalFrame* mainInfoFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); // SUMO Icon - new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(ICON_SUMO_LOGO), GUIDesignLabelIcon); + new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(GUIIcon::SUMO_LOGO), GUIDesignLabelIcon); // "SUMO " FXVerticalFrame* descriptionFrame = new FXVerticalFrame(mainInfoFrame, GUIDesignLabelAboutInfo); @@ -69,7 +64,7 @@ // centered ok-button FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); - new FXButton(buttonFrame, "OK\t\t", GUIIconSubSys::getIcon(ICON_ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); + new FXButton(buttonFrame, "OK\t\t", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); } @@ -85,6 +80,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.h sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.h --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AboutSUMO.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The application's "About" - dialog /****************************************************************************/ -#ifndef GUIDialog_AboutSUMO_h -#define GUIDialog_AboutSUMO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -54,9 +48,3 @@ /// @brief Font for the widget FXFont* myHeadlineFont; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.cpp sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.cpp --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The application-settings dialog /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,7 +71,7 @@ FXButton* initial = new FXButton(f2, "&OK", nullptr, this, MID_SETTINGS_OK, BUTTON_INITIAL | BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4); new FXButton(f2, "&Cancel", nullptr, this, MID_SETTINGS_CANCEL, BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT | LAYOUT_CENTER_X, 0, 0, 0, 0, 30, 30, 4, 4); initial->setFocus(); - setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); } diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.h sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.h --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_AppSettings.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The application-settings dialog /****************************************************************************/ -#ifndef GUIDialog_AppSettings_h -#define GUIDialog_AppSettings_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -88,9 +82,3 @@ FOX_CONSTRUCTOR(GUIDialog_AppSettings) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.cpp sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.cpp --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Editor for simulation breakpoints /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -70,7 +65,7 @@ // =========================================================================== GUIDialog_Breakpoints::GUIDialog_Breakpoints(GUIMainWindow* parent, std::vector& breakpoints, FXMutex& breakpointLock) : - FXMainWindow(parent->getApp(), "Breakpoints Editor", GUIIconSubSys::getIcon(ICON_APP_BREAKPOINTS), nullptr, GUIDesignChooserDialog), + FXMainWindow(parent->getApp(), "Breakpoints Editor", GUIIconSubSys::getIcon(GUIIcon::APP_BREAKPOINTS), nullptr, GUIDesignChooserDialog), myParent(parent), myBreakpoints(&breakpoints), myBreakpointLock(&breakpointLock) { // build main Frame FXHorizontalFrame* hbox = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame); @@ -89,15 +84,15 @@ FXVerticalFrame* layoutRight = new FXVerticalFrame(hbox, GUIDesignChooserLayoutRight); // create buttons ('&' in the label creates a hot key) // "Load" - new FXButton(layoutRight, "&Load\t\t", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_CHOOSEN_LOAD, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Load\t\t", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_CHOOSEN_LOAD, GUIDesignChooserButtons); // "Save" - new FXButton(layoutRight, "&Save\t\t", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_CHOOSEN_SAVE, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Save\t\t", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_CHOOSEN_SAVE, GUIDesignChooserButtons); new FXHorizontalSeparator(layoutRight, GUIDesignHorizontalSeparator); // "Clear List" - new FXButton(layoutRight, "Clea&r\t\t", GUIIconSubSys::getIcon(ICON_CLEANJUNCTIONS), this, MID_CHOOSEN_CLEAR, GUIDesignChooserButtons); + new FXButton(layoutRight, "Clea&r\t\t", GUIIconSubSys::getIcon(GUIIcon::CLEANJUNCTIONS), this, MID_CHOOSEN_CLEAR, GUIDesignChooserButtons); new FXHorizontalSeparator(layoutRight, GUIDesignHorizontalSeparator); // "Close" - new FXButton(layoutRight, "&Close\t\t", GUIIconSubSys::getIcon(ICON_NO), this, MID_CANCEL, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Close\t\t", GUIIconSubSys::getIcon(GUIIcon::NO), this, MID_CANCEL, GUIDesignChooserButtons); // add this dialog as child of GUIMainWindow parent myParent->addChild(this); } @@ -138,7 +133,7 @@ long GUIDialog_Breakpoints::onCmdLoad(FXObject*, FXSelector, void*) { FXFileDialog opendialog(this, "Load Breakpoints"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("*.txt"); if (gCurrentFolder.length() != 0) { @@ -158,7 +153,7 @@ long GUIDialog_Breakpoints::onCmdSave(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write(this, "Save Breakpoints", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Save Breakpoints", ".txt", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -239,5 +234,6 @@ FXMainWindow::layout(); myTable->setColumnWidth(0, myTable->getWidth() - 1); } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.h sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.h --- sumo-1.5.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/dialogs/GUIDialog_Breakpoints.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Editor for simulation breakpoints /****************************************************************************/ -#ifndef GUIDialog_Breakpoints_h -#define GUIDialog_Breakpoints_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -104,9 +98,3 @@ /// @brief Lock for modifying the list of breakpoints FXMutex* myBreakpointLock; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIApplicationWindow.cpp sumo-1.6.0+dfsg1/src/gui/GUIApplicationWindow.cpp --- sumo-1.5.0+dfsg1/src/gui/GUIApplicationWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIApplicationWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The main window of the SUMO-gui. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -104,19 +99,19 @@ FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ALT_F4_CLOSE, GUIApplicationWindow::onCmdQuit), FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GUIApplicationWindow::onCmdQuit), - FXMAPFUNC(SEL_COMMAND, MID_OPEN_CONFIG, GUIApplicationWindow::onCmdOpenConfiguration), - FXMAPFUNC(SEL_COMMAND, MID_OPEN_NETWORK, GUIApplicationWindow::onCmdOpenNetwork), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_P, GUIApplicationWindow::onCmdOpenShapes), - FXMAPFUNC(SEL_COMMAND, MID_OPEN_EDGEDATA, GUIApplicationWindow::onCmdOpenEdgeData), - FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GUIApplicationWindow::onCmdOpenRecent), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_R_RELOAD, GUIApplicationWindow::onCmdReload), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS, GUIApplicationWindow::onCmdSaveConfig), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_W_CLOSESIMULATION, GUIApplicationWindow::onCmdClose), - FXMAPFUNC(SEL_COMMAND, MID_EDITCHOSEN, GUIApplicationWindow::onCmdEditChosen), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT, GUIApplicationWindow::onCmdEditBreakpoints), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIApplicationWindow::onCmdEditViewScheme), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIApplicationWindow::onCmdEditViewport), - FXMAPFUNC(SEL_COMMAND, MID_NETEDIT, GUIApplicationWindow::onCmdNetedit), + FXMAPFUNC(SEL_COMMAND, MID_OPEN_CONFIG, GUIApplicationWindow::onCmdOpenConfiguration), + FXMAPFUNC(SEL_COMMAND, MID_OPEN_NETWORK, GUIApplicationWindow::onCmdOpenNetwork), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_P, GUIApplicationWindow::onCmdOpenShapes), + FXMAPFUNC(SEL_COMMAND, MID_OPEN_EDGEDATA, GUIApplicationWindow::onCmdOpenEdgeData), + FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GUIApplicationWindow::onCmdOpenRecent), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_R_RELOAD, GUIApplicationWindow::onCmdReload), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS, GUIApplicationWindow::onCmdSaveConfig), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_W_CLOSESIMULATION, GUIApplicationWindow::onCmdClose), + FXMAPFUNC(SEL_COMMAND, MID_EDITCHOSEN, GUIApplicationWindow::onCmdEditChosen), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS, GUIApplicationWindow::onCmdEditBreakpoints), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIApplicationWindow::onCmdEditViewScheme), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIApplicationWindow::onCmdEditViewport), + FXMAPFUNC(SEL_COMMAND, MID_NETEDIT, GUIApplicationWindow::onCmdNetedit), FXMAPFUNC(SEL_COMMAND, MID_APPSETTINGS, GUIApplicationWindow::onCmdAppSettings), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID, GUIApplicationWindow::onCmdGaming), @@ -124,19 +119,19 @@ FXMAPFUNC(SEL_COMMAND, MID_LISTINTERNAL, GUIApplicationWindow::onCmdListInternal), FXMAPFUNC(SEL_COMMAND, MID_LISTPARKING, GUIApplicationWindow::onCmdListParking), FXMAPFUNC(SEL_COMMAND, MID_LISTTELEPORTING, GUIApplicationWindow::onCmdListTeleporting), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_ABOUT, GUIApplicationWindow::onCmdAbout), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F12_ABOUT, GUIApplicationWindow::onCmdAbout), FXMAPFUNC(SEL_COMMAND, MID_NEW_MICROVIEW, GUIApplicationWindow::onCmdNewView), #ifdef HAVE_OSG FXMAPFUNC(SEL_COMMAND, MID_NEW_OSGVIEW, GUIApplicationWindow::onCmdNewOSG), #endif - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIApplicationWindow::onCmdStart), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIApplicationWindow::onCmdStop), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GUIApplicationWindow::onCmdStep), - FXMAPFUNC(SEL_COMMAND, MID_SIMSAVE, GUIApplicationWindow::onCmdSaveState), - FXMAPFUNC(SEL_COMMAND, MID_TIME_TOOGLE, GUIApplicationWindow::onCmdTimeToggle), - FXMAPFUNC(SEL_COMMAND, MID_DELAY_TOOGLE, GUIApplicationWindow::onCmdDelayToggle), - FXMAPFUNC(SEL_COMMAND, MID_DEMAND_SCALE, GUIApplicationWindow::onCmdDemandScale), - FXMAPFUNC(SEL_COMMAND, MID_CLEARMESSAGEWINDOW, GUIApplicationWindow::onCmdClearMsgWindow), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIApplicationWindow::onCmdStart), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIApplicationWindow::onCmdStop), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, GUIApplicationWindow::onCmdStep), + FXMAPFUNC(SEL_COMMAND, MID_SIMSAVE, GUIApplicationWindow::onCmdSaveState), + FXMAPFUNC(SEL_COMMAND, MID_TIME_TOOGLE, GUIApplicationWindow::onCmdTimeToggle), + FXMAPFUNC(SEL_COMMAND, MID_DELAY_TOOGLE, GUIApplicationWindow::onCmdDelayToggle), + FXMAPFUNC(SEL_COMMAND, MID_DEMAND_SCALE, GUIApplicationWindow::onCmdDemandScale), + FXMAPFUNC(SEL_COMMAND, MID_CLEARMESSAGEWINDOW, GUIApplicationWindow::onCmdClearMsgWindow), FXMAPFUNC(SEL_COMMAND, MID_SHOWNETSTATS, GUIApplicationWindow::onCmdShowStats), FXMAPFUNC(SEL_COMMAND, MID_SHOWVEHSTATS, GUIApplicationWindow::onCmdShowStats), @@ -153,20 +148,20 @@ #ifdef HAVE_OSG FXMAPFUNC(SEL_UPDATE, MID_NEW_OSGVIEW, GUIApplicationWindow::onUpdAddView), #endif - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIApplicationWindow::onUpdStart), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIApplicationWindow::onUpdStop), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GUIApplicationWindow::onUpdStep), - FXMAPFUNC(SEL_UPDATE, MID_SIMSAVE, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_EDITCHOSEN, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_B_EDITBREAKPOINT, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_NETEDIT, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_DEMAND_SCALE, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_F_FULSCREENMODE, GUIApplicationWindow::onUpdNeedsSimulation), - FXMAPFUNC(SEL_UPDATE, MID_TRACI_STATUS, GUIApplicationWindow::onUpdTraCIStatus), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION, GUIApplicationWindow::onCmdHelp), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIApplicationWindow::onUpdStart), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIApplicationWindow::onUpdStop), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, GUIApplicationWindow::onUpdStep), + FXMAPFUNC(SEL_UPDATE, MID_SIMSAVE, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_EDITCHOSEN, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_NETEDIT, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_DEMAND_SCALE, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_F_FULSCREENMODE, GUIApplicationWindow::onUpdNeedsSimulation), + FXMAPFUNC(SEL_UPDATE, MID_TRACI_STATUS, GUIApplicationWindow::onUpdTraCIStatus), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION, GUIApplicationWindow::onCmdHelp), // forward requests to the active view FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUIApplicationWindow::onCmdLocate), @@ -212,7 +207,7 @@ myLoadThread(nullptr), myRunThread(nullptr), myAmLoading(false), myAlternateSimDelay(0.), - myRecentNets(a, "nets"), + myRecentFiles(a, "files"), myConfigPattern(configPattern), hadDependentBuild(false), myShowTimeAsHMS(false), @@ -258,10 +253,10 @@ myGeoCoordinate = new FXLabel(myGeoFrame, "N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", nullptr, LAYOUT_CENTER_Y); myCartesianFrame = new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar); myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A\t\tNetwork coordinate", nullptr, LAYOUT_CENTER_Y); - myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(ICON_GREENVEHICLE), this, MID_SHOWVEHSTATS)); - myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(ICON_GREENPERSON), this, MID_SHOWPERSONSTATS)); + myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE), this, MID_SHOWVEHSTATS)); + myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(GUIIcon::GREENPERSON), this, MID_SHOWPERSONSTATS)); myStatButtons.back()->hide(); - myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(ICON_GREENEDGE), this, MID_SHOWVEHSTATS)); + myStatButtons.push_back(new FXButton(myStatusbar, "-", GUIIconSubSys::getIcon(GUIIcon::GREENEDGE), this, MID_SHOWVEHSTATS)); myStatButtons.back()->hide(); } @@ -292,8 +287,8 @@ // start the simulation-thread (it will loop until the application ends deciding by itself whether to perform a step or not) myRunThread->start(); - setIcon(GUIIconSubSys::getIcon(ICON_SUMO)); - setMiniIcon(GUIIconSubSys::getIcon(ICON_SUMO_MINI)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::SUMO)); + setMiniIcon(GUIIconSubSys::getIcon(GUIIcon::SUMO_MINI)); } @@ -380,59 +375,43 @@ new FXMenuTitle(myMenuBar, "&File", nullptr, myFileMenu); new FXMenuCommand(myFileMenu, "&Open Simulation...\tCtrl+O\tOpen a simulation (Configuration file).", - GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_OPEN_CONFIG); + GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_OPEN_CONFIG); new FXMenuCommand(myFileMenu, "Open &Network...\tCtrl+N\tOpen a network.", - GUIIconSubSys::getIcon(ICON_OPEN_NET), this, MID_OPEN_NETWORK); + GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), this, MID_OPEN_NETWORK); new FXMenuCommand(myFileMenu, "Open Shapes \tCtrl+P\tLoad POIs and Polygons for visualization.", - GUIIconSubSys::getIcon(ICON_OPEN_SHAPES), this, MID_HOTKEY_CTRL_P); + GUIIconSubSys::getIcon(GUIIcon::OPEN_SHAPES), this, MID_HOTKEY_CTRL_P); new FXMenuCommand(myFileMenu, "Open EdgeData \tCtrl+U\tLoad edge related data for visualization.", - GUIIconSubSys::getIcon(ICON_OPEN_NET), this, MID_OPEN_EDGEDATA); + GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), this, MID_OPEN_EDGEDATA); new FXMenuCommand(myFileMenu, "&Reload\tCtrl+R\tReloads the simulation / the network.", - GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_HOTKEY_CTRL_R_RELOAD); + GUIIconSubSys::getIcon(GUIIcon::RELOAD), this, MID_HOTKEY_CTRL_R_RELOAD); new FXMenuSeparator(myFileMenu); new FXMenuCommand(myFileMenu, "Save Configuration\tCtrl+Shift+S\tSave current options as a configuration file.", - GUIIconSubSys::getIcon(ICON_SAVE), this, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS); + GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS); new FXMenuCommand(myFileMenu, "Close\tCtrl+W\tClose the simulation.", - GUIIconSubSys::getIcon(ICON_CLOSE), this, MID_HOTKEY_CTRL_W_CLOSESIMULATION); + GUIIconSubSys::getIcon(GUIIcon::CLOSE), this, MID_HOTKEY_CTRL_W_CLOSESIMULATION); // Recent files FXMenuSeparator* sep1 = new FXMenuSeparator(myFileMenu); - sep1->setTarget(&myRecentConfigs); + sep1->setTarget(&myRecentFiles); sep1->setSelector(FXRecentFiles::ID_ANYFILES); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10); - new FXMenuCommand(myFileMenu, "C&lear Recent Configurations", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR); - myRecentConfigs.setTarget(this); - myRecentConfigs.setSelector(MID_RECENTFILE); - FXMenuSeparator* sep2 = new FXMenuSeparator(myFileMenu); - sep2->setTarget(&myRecentNets); - sep2->setSelector(FXRecentFiles::ID_ANYFILES); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9); - new FXMenuCommand(myFileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10); - new FXMenuCommand(myFileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR); - myRecentNets.setTarget(this); - myRecentNets.setSelector(MID_RECENTFILE); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_1); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_2); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_3); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_4); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_5); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_6); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_7); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_8); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_9); + new FXMenuCommand(myFileMenu, "", nullptr, &myRecentFiles, FXRecentFiles::ID_FILE_10); + new FXMenuCommand(myFileMenu, "C&lear Recent Files", nullptr, &myRecentFiles, FXRecentFiles::ID_CLEAR); + myRecentFiles.setTarget(this); + myRecentFiles.setSelector(MID_RECENTFILE); new FXMenuSeparator(myFileMenu); new FXMenuCommand(myFileMenu, "&Quit\tCtrl+Q\tQuit the Application.", @@ -449,14 +428,14 @@ new FXMenuTitle(myMenuBar, "&Edit", nullptr, myEditMenu); new FXMenuCommand(myEditMenu, "Edit Selected...\tCtrl+E\tOpens a dialog for editing the list of selected items.", - GUIIconSubSys::getIcon(ICON_FLAG), this, MID_EDITCHOSEN); + GUIIconSubSys::getIcon(GUIIcon::FLAG), this, MID_EDITCHOSEN); mySelectLanesMenuCascade = new FXMenuCascade(myEditMenu, "Select lanes which allow...\t\tOpens a menu for selecting a vehicle class by which to selected lanes.", - GUIIconSubSys::getIcon(ICON_FLAG), mySelectByPermissions); + GUIIconSubSys::getIcon(GUIIcon::FLAG), mySelectByPermissions); new FXMenuSeparator(myEditMenu); new FXMenuCommand(myEditMenu, "Edit Breakpoints\tCtrl+B\tOpens a dialog for editing breakpoints.", - nullptr, this, MID_HOTKEY_CTRL_B_EDITBREAKPOINT); + nullptr, this, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS); new FXMenuCommand(myEditMenu, "Edit Visualisation\tF9\tOpens a dialog for editing visualization settings.", nullptr, this, MID_HOTKEY_F9_EDIT_VIEWSCHEME); @@ -466,7 +445,7 @@ new FXMenuSeparator(myEditMenu); new FXMenuCommand(myEditMenu, "Open in Netedit\tCtrl+T\tOpens the netedit application with the current network.", - GUIIconSubSys::getIcon(ICON_NETEDIT_MINI), this, MID_NETEDIT); + GUIIconSubSys::getIcon(GUIIcon::NETEDIT_MINI), this, MID_NETEDIT); // build settings menu mySettingsMenu = new FXMenuPane(this); @@ -485,30 +464,30 @@ new FXMenuTitle(myMenuBar, "&Locate", nullptr, myLocatorMenu); new FXMenuCommand(myLocatorMenu, "Locate &Junctions\t\tOpen a Dialog for Locating a Junction.", - GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), this, MID_LOCATEJUNCTION); + GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), this, MID_LOCATEJUNCTION); new FXMenuCommand(myLocatorMenu, "Locate &Edges\t\tOpen a Dialog for Locating an Edge.", - GUIIconSubSys::getIcon(ICON_LOCATEEDGE), this, MID_LOCATEEDGE); + GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), this, MID_LOCATEEDGE); if (!MSGlobals::gUseMesoSim) { // there are no gui-vehicles in mesosim new FXMenuCommand(myLocatorMenu, "Locate &Vehicles\t\tOpen a Dialog for Locating a Vehicle.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), this, MID_LOCATEVEHICLE); + GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), this, MID_LOCATEVEHICLE); } new FXMenuCommand(myLocatorMenu, "Locate &Persons\t\tOpen a Dialog for Locating a Person.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), this, MID_LOCATEPERSON); + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), this, MID_LOCATEPERSON); new FXMenuCommand(myLocatorMenu, "Locate &TLS\t\tOpen a Dialog for Locating a Traffic Light.", - GUIIconSubSys::getIcon(ICON_LOCATETLS), this, MID_LOCATETLS); + GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), this, MID_LOCATETLS); new FXMenuCommand(myLocatorMenu, "Locate &Additional\t\tOpen a Dialog for Locating an Additional Structure.", - GUIIconSubSys::getIcon(ICON_LOCATEADD), this, MID_LOCATEADD); + GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), this, MID_LOCATEADD); new FXMenuCommand(myLocatorMenu, "Locate P&oI\t\tOpen a Dialog for Locating a Point of Intereset.", - GUIIconSubSys::getIcon(ICON_LOCATEPOI), this, MID_LOCATEPOI); + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), this, MID_LOCATEPOI); new FXMenuCommand(myLocatorMenu, "Locate Po&lygon\t\tOpen a Dialog for Locating a Polygon.", - GUIIconSubSys::getIcon(ICON_LOCATEPOLY), this, MID_LOCATEPOLY); + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), this, MID_LOCATEPOLY); new FXMenuSeparator(myLocatorMenu); new FXMenuCheck(myLocatorMenu, "Show Internal Structures\t\tShow internal junctions and streets in locator dialog.", @@ -525,16 +504,16 @@ new FXMenuTitle(myMenuBar, "Simulation", nullptr, myControlMenu); new FXMenuCommand(myControlMenu, "Run\tCtrl+A\tStart running the simulation.", - GUIIconSubSys::getIcon(ICON_START), this, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS); + GUIIconSubSys::getIcon(GUIIcon::START), this, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS); new FXMenuCommand(myControlMenu, "Stop\tCtrl+S\tStop running the simulation.", - GUIIconSubSys::getIcon(ICON_STOP), this, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK); + GUIIconSubSys::getIcon(GUIIcon::STOP), this, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK); new FXMenuCommand(myControlMenu, "Step\tCtrl+D\tPerform one simulation step.", - GUIIconSubSys::getIcon(ICON_STEP), this, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND); + GUIIconSubSys::getIcon(GUIIcon::STEP), this, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS); new FXMenuCommand(myControlMenu, "Save\t\tSave the current simulation state to a file.", - GUIIconSubSys::getIcon(ICON_SAVE), this, MID_SIMSAVE); + GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMSAVE); // build windows menu myWindowsMenu = new FXMenuPane(this); @@ -553,17 +532,19 @@ myToolBar4, FXWindow::ID_TOGGLESHOWN); addToWindowsMenu(myWindowsMenu); new FXMenuSeparator(myWindowsMenu); - new FXMenuCommand(myWindowsMenu, "Tile &Horizontally", - GUIIconSubSys::getIcon(ICON_WINDOWS_TILE_HORI), - myMDIClient, FXMDIClient::ID_MDI_TILEHORIZONTAL); - new FXMenuCommand(myWindowsMenu, "Tile &Vertically", - GUIIconSubSys::getIcon(ICON_WINDOWS_TILE_VERT), - myMDIClient, FXMDIClient::ID_MDI_TILEVERTICAL); - new FXMenuCommand(myWindowsMenu, "Cascade", - GUIIconSubSys::getIcon(ICON_WINDOWS_CASCADE), + new FXMenuCommand(myWindowsMenu, + "Tile &Horizontally", + GUIIconSubSys::getIcon(GUIIcon::WINDOWS_TILE_HORI), myMDIClient, FXMDIClient::ID_MDI_TILEHORIZONTAL); + new FXMenuCommand(myWindowsMenu, + "Tile &Vertically", + GUIIconSubSys::getIcon(GUIIcon::WINDOWS_TILE_VERT), myMDIClient, FXMDIClient::ID_MDI_TILEVERTICAL); + new FXMenuCommand(myWindowsMenu, + "Cascade", + GUIIconSubSys::getIcon(GUIIcon::WINDOWS_CASCADE), myMDIClient, FXMDIClient::ID_MDI_CASCADE); - new FXMenuCommand(myWindowsMenu, "&Close", nullptr, - myMDIClient, FXMDIClient::ID_MDI_CLOSE); + new FXMenuCommand(myWindowsMenu, + "&Close", + nullptr, myMDIClient, FXMDIClient::ID_MDI_CLOSE); sep1 = new FXMenuSeparator(myWindowsMenu); sep1->setTarget(myMDIClient); sep1->setSelector(FXMDIClient::ID_MDI_ANY); @@ -579,11 +560,17 @@ // build help menu myHelpMenu = new FXMenuPane(this); - new FXMenuTitle(myMenuBar, "&Help", nullptr, myHelpMenu); - new FXMenuCommand(myHelpMenu, "&Online Documentation\tF1\tOpen Online documentation.", nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION); - new FXMenuCommand(myHelpMenu, "&About\tF2\tAbout sumo-gui.", GUIIconSubSys::getIcon(ICON_SUMO_MINI), this, MID_HOTKEY_F2_ABOUT); + new FXMenuTitle(myMenuBar, + "&Help", + nullptr, myHelpMenu); + new FXMenuCommand(myHelpMenu, + "&Online Documentation\tF1\tOpen Online documentation.", + nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION); + new FXMenuCommand(myHelpMenu, + "&About\tF12\tAbout sumo-gui.", + GUIIconSubSys::getIcon(GUIIcon::SUMO_MINI), this, MID_HOTKEY_F12_ABOUT); - //new FXButton(myMenuBar, "\t\tShows TraCI status", GUIIconSubSys::getIcon(ICON_ADD), this, MID_TRACI_STATUS, 0, 0, 0, 14, 14, 0, 0, 0, 0); + //new FXButton(myMenuBar, "\t\tShows TraCI status", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_TRACI_STATUS, 0, 0, 0, 14, 14, 0, 0, 0, 0); // build SUMO Accelerators (hotkeys) GUIShortcutsSubSys::buildSUMOAccelerators(this); @@ -599,9 +586,9 @@ myToolBar1 = new FXToolBar(myTopDock, myToolBarDrag1, GUIDesignToolBarRaisedNextTop); new FXToolBarGrip(myToolBar1, myToolBar1, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); // build file tools - new FXButton(myToolBar1, "\t\tOpen a simulation (Configuration file).", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_OPEN_CONFIG, GUIDesignButtonToolbar); - new FXButton(myToolBar1, "\t\tOpen a network.", GUIIconSubSys::getIcon(ICON_OPEN_NET), this, MID_OPEN_NETWORK, GUIDesignButtonToolbar); - new FXButton(myToolBar1, "\t\tReloads the simulation / the network.", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_HOTKEY_CTRL_R_RELOAD, GUIDesignButtonToolbar); + new FXButton(myToolBar1, "\t\tOpen a simulation (Configuration file).", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_OPEN_CONFIG, GUIDesignButtonToolbar); + new FXButton(myToolBar1, "\t\tOpen a network.", GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), this, MID_OPEN_NETWORK, GUIDesignButtonToolbar); + new FXButton(myToolBar1, "\t\tReloads the simulation / the network.", GUIIconSubSys::getIcon(GUIIcon::RELOAD), this, MID_HOTKEY_CTRL_R_RELOAD, GUIDesignButtonToolbar); } { // simulation toolbar @@ -609,9 +596,9 @@ myToolBar2 = new FXToolBar(myTopDock, myToolBarDrag2, GUIDesignToolBarRaisedSameTop); new FXToolBarGrip(myToolBar2, myToolBar2, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); // build simulation tools - new FXButton(myToolBar2, "\t\tStart the loaded simulation.", GUIIconSubSys::getIcon(ICON_START), this, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIDesignButtonToolbar); - new FXButton(myToolBar2, "\t\tStop the running simulation.", GUIIconSubSys::getIcon(ICON_STOP), this, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIDesignButtonToolbar); - new FXButton(myToolBar2, "\t\tPerform a single simulation step.", GUIIconSubSys::getIcon(ICON_STEP), this, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GUIDesignButtonToolbar); + new FXButton(myToolBar2, "\t\tStart the loaded simulation.", GUIIconSubSys::getIcon(GUIIcon::START), this, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, GUIDesignButtonToolbar); + new FXButton(myToolBar2, "\t\tStop the running simulation.", GUIIconSubSys::getIcon(GUIIcon::STOP), this, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIDesignButtonToolbar); + new FXButton(myToolBar2, "\t\tPerform a single simulation step.", GUIIconSubSys::getIcon(GUIIcon::STEP), this, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, GUIDesignButtonToolbar); } { // Simulation Step Display @@ -667,10 +654,10 @@ new FXToolBarGrip(myToolBar5, myToolBar5, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); // build view tools new FXButton(myToolBar5, "\t\tOpen a new microscopic view.", - GUIIconSubSys::getIcon(ICON_MICROVIEW), this, MID_NEW_MICROVIEW, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::MICROVIEW), this, MID_NEW_MICROVIEW, GUIDesignButtonToolbar); #ifdef HAVE_OSG new FXButton(myToolBar5, "\t\tOpen a new 3D view.", - GUIIconSubSys::getIcon(ICON_OSGVIEW), this, MID_NEW_OSGVIEW, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::OSGVIEW), this, MID_NEW_OSGVIEW, GUIDesignButtonToolbar); #endif } { @@ -845,7 +832,7 @@ GUIApplicationWindow::onCmdOpenConfiguration(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Open Simulation Configuration"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList(myConfigPattern.c_str()); if (gCurrentFolder.length() != 0) { @@ -854,8 +841,8 @@ if (opendialog.execute()) { gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); - loadConfigOrNet(file, false); - myRecentConfigs.appendFile(file.c_str()); + loadConfigOrNet(file); + myRecentFiles.appendFile(file.c_str()); } return 1; } @@ -865,7 +852,7 @@ GUIApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Open Network"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -874,8 +861,8 @@ if (opendialog.execute()) { gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); - loadConfigOrNet(file, true); - myRecentNets.appendFile(file.c_str()); + loadConfigOrNet(file); + myRecentFiles.appendFile(file.c_str()); } return 1; } @@ -885,7 +872,7 @@ GUIApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) { // get the shape file name FXFileDialog opendialog(this, "Open Shapes"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("Additional files (*.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -915,7 +902,7 @@ GUIApplicationWindow::onCmdOpenEdgeData(FXObject*, FXSelector, void*) { // get the shape file name FXFileDialog opendialog(this, "Open EdgeData"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("EdgeData files (*.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -954,13 +941,13 @@ long -GUIApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* ptr) { +GUIApplicationWindow::onCmdOpenRecent(FXObject* /* sender */, FXSelector, void* ptr) { if (myAmLoading) { myStatusbar->getStatusLine()->setText("Already loading!"); return 1; } std::string file((const char*)ptr); - loadConfigOrNet(file, sender == &myRecentNets); + loadConfigOrNet(file); return 1; } @@ -969,7 +956,7 @@ GUIApplicationWindow::onCmdSaveConfig(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Save Sumo Configuration"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SAVE)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::SAVE)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("Config (*.sumocfg)"); if (gCurrentFolder.length() != 0) { @@ -1084,9 +1071,9 @@ GUIApplicationWindow::onCmdSaveState(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Save Simulation State"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SAVE)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::SAVE)); opendialog.setSelectMode(SELECTFILE_ANY); - opendialog.setPatternList("Binary State (*.sbx)\nXML State (*.xml)"); + opendialog.setPatternList("GZipped State (*.xml.gz)\nXML State (*.xml)"); if (gCurrentFolder.length() != 0) { opendialog.setDirectory(gCurrentFolder); } @@ -1557,12 +1544,12 @@ const int running = myRunThread->getNet().getVehicleControl().getRunningVehicleNo(); const int backlog = myRunThread->getNet().getInsertionControl().getWaitingVehicleNo(); if (backlog > running) { - if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(ICON_GREENVEHICLE)) { - myStatButtons.front()->setIcon(GUIIconSubSys::getIcon(ICON_YELLOWVEHICLE)); + if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE)) { + myStatButtons.front()->setIcon(GUIIconSubSys::getIcon(GUIIcon::YELLOWVEHICLE)); } } else { - if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(ICON_YELLOWVEHICLE)) { - myStatButtons.front()->setIcon(GUIIconSubSys::getIcon(ICON_GREENVEHICLE)); + if (myStatButtons.front()->getIcon() == GUIIconSubSys::getIcon(GUIIcon::YELLOWVEHICLE)) { + myStatButtons.front()->setIcon(GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE)); } } myStatButtons.front()->setText(toString(running).c_str()); @@ -1704,14 +1691,14 @@ } void -GUIApplicationWindow::loadConfigOrNet(const std::string& file, bool isNet) { +GUIApplicationWindow::loadConfigOrNet(const std::string& file) { if (!myAmLoading) { storeWindowSizeAndPos(); getApp()->beginWaitCursor(); myAmLoading = true; closeAllWindows(); gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view - myLoadThread->loadConfigOrNet(file, isNet); + myLoadThread->loadConfigOrNet(file); setStatusBarText("Loading '" + file + "'."); update(); } @@ -1734,7 +1721,7 @@ std::string caption = "View #" + toString(myViewNumber++); FXuint opts = MDI_TRACKING; GUISUMOViewParent* w = new GUISUMOViewParent(myMDIClient, myMDIMenu, FXString(caption.c_str()), - this, GUIIconSubSys::getIcon(ICON_SUMO_MINI), opts, 10, 10, 300, 200); + this, GUIIconSubSys::getIcon(GUIIcon::SUMO_MINI), opts, 10, 10, 300, 200); GUISUMOAbstractView* v = w->init(getBuildGLCanvas(), myRunThread->getNet(), vt); if (oldView != nullptr) { // copy viewport @@ -1822,7 +1809,7 @@ void GUIApplicationWindow::loadOnStartup() { - loadConfigOrNet("", false); + loadConfigOrNet(""); } @@ -1834,12 +1821,8 @@ void -GUIApplicationWindow::addRecentFile(const FX::FXString& f, const bool isNet) { - if (isNet) { - myRecentNets.appendFile(f); - } else { - myRecentConfigs.appendFile(f); - } +GUIApplicationWindow::addRecentFile(const FX::FXString& f) { + myRecentFiles.appendFile(f); } @@ -1929,4 +1912,5 @@ return result; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIApplicationWindow.h sumo-1.6.0+dfsg1/src/gui/GUIApplicationWindow.h --- sumo-1.5.0+dfsg1/src/gui/GUIApplicationWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIApplicationWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The main window of the SUMO-gui. /****************************************************************************/ -#ifndef GUIApplicationWindow_h -#define GUIApplicationWindow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -100,7 +94,7 @@ void setStatusBarText(const std::string& text); - void addRecentFile(const FX::FXString& f, const bool isNet); + void addRecentFile(const FX::FXString& f); FXGLCanvas* getBuildGLCanvas() const; SUMOTime getCurrentSimTime() const; @@ -304,7 +298,7 @@ private: /** starts to load a simulation */ - void loadConfigOrNet(const std::string& file, bool isNet); + void loadConfigOrNet(const std::string& file); /** this method closes all windows and deletes the current simulation */ void closeAllWindows(); @@ -403,11 +397,8 @@ /// @brief io-event with the run-thread FXEX::FXThreadEvent myRunThreadEvent; - /// @brief List of recent config files - FXRecentFiles myRecentConfigs; - - /// @brief List of recent nets - FXRecentFiles myRecentNets; + /// @brief List of recent files + FXRecentFiles myRecentFiles; /// @brief Input file pattern std::string myConfigPattern; @@ -452,9 +443,3 @@ ////} }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIEvent_SimulationEnded.h sumo-1.6.0+dfsg1/src/gui/GUIEvent_SimulationEnded.h --- sumo-1.5.0+dfsg1/src/gui/GUIEvent_SimulationEnded.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIEvent_SimulationEnded.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Event sent when the the simulation is over /****************************************************************************/ -#ifndef GUIEvent_SimulationEnded_h -#define GUIEvent_SimulationEnded_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -80,9 +74,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIEvent_SimulationLoaded.h sumo-1.6.0+dfsg1/src/gui/GUIEvent_SimulationLoaded.h --- sumo-1.5.0+dfsg1/src/gui/GUIEvent_SimulationLoaded.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIEvent_SimulationLoaded.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Event send when the simulation has been loaded by GUILadThread /****************************************************************************/ -#ifndef GUIEvent_SimulationLoaded_h -#define GUIEvent_SimulationLoaded_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ /// @brief Invalidated assignment operator GUIEvent_SimulationLoaded& operator=(const GUIEvent_SimulationLoaded& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIGlobals.cpp sumo-1.6.0+dfsg1/src/gui/GUIGlobals.cpp --- sumo-1.5.0+dfsg1/src/gui/GUIGlobals.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIGlobals.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // } /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIGlobals.h" @@ -42,4 +37,5 @@ double GUIGlobals::gTrackerInterval = 1.0; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIGlobals.h sumo-1.6.0+dfsg1/src/gui/GUIGlobals.h --- sumo-1.5.0+dfsg1/src/gui/GUIGlobals.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIGlobals.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Some global variables (yep) /****************************************************************************/ -#ifndef GUIGlobals_h -#define GUIGlobals_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -56,8 +50,3 @@ /// the aggregation period for tracker windows in seconds static double gTrackerInterval; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUILoadThread.cpp sumo-1.6.0+dfsg1/src/gui/GUILoadThread.cpp --- sumo-1.5.0+dfsg1/src/gui/GUILoadThread.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUILoadThread.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -95,29 +90,24 @@ // try to load the given configuration OptionsCont& oc = OptionsCont::getOptions(); try { - oc.clear(); - MSFrame::fillOptions(); if (myFile != "") { // triggered by menu option or reload - if (myLoadNet) { - oc.set("net-file", myFile); - } else { - oc.set("configuration-file", myFile); - } + oc.clear(); + MSFrame::fillOptions(); + oc.setByRootElement(OptionsIO::getRoot(myFile), myFile); oc.resetWritable(); // there may be command line options OptionsIO::getOptions(); } else { // triggered at application start - OptionsIO::getOptions(); + OptionsIO::loadConfiguration(); if (oc.isSet("configuration-file")) { myFile = oc.getString("configuration-file"); } else if (oc.isSet("net-file")) { myFile = oc.getString("net-file"); - myLoadNet = true; } myEventQue.push_back(new GUIEvent_Message("Loading '" + myFile + "'.")); myEventThrow.signal(); - myParent->addRecentFile(FXPath::absolute(myFile.c_str()), myLoadNet); + myParent->addRecentFile(FXPath::absolute(myFile.c_str())); } myTitle = myFile; // within gui-based applications, nothing is reported to the console @@ -254,9 +244,8 @@ void -GUILoadThread::loadConfigOrNet(const std::string& file, bool isNet) { +GUILoadThread::loadConfigOrNet(const std::string& file) { myFile = file; - myLoadNet = isNet; if (myFile != "") { OptionsIO::setArgs(0, nullptr); } diff -Nru sumo-1.5.0+dfsg1/src/gui/GUILoadThread.h sumo-1.6.0+dfsg1/src/gui/GUILoadThread.h --- sumo-1.5.0+dfsg1/src/gui/GUILoadThread.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUILoadThread.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Class describing the thread that performs the loading of a simulation /****************************************************************************/ -#ifndef GUILoadThread_h -#define GUILoadThread_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,7 +58,7 @@ FXint run(); /// begins the loading of the given file - void loadConfigOrNet(const std::string& file, bool isNet); + void loadConfigOrNet(const std::string& file); /// Retrieves messages from the loading module void retrieveMessage(const MsgHandler::MsgType type, const std::string& msg); @@ -100,12 +94,4 @@ FXEX::FXThreadEvent& myEventThrow; - /// Information whether only the network shall be loaded - bool myLoadNet; - }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIManipulator.cpp sumo-1.6.0+dfsg1/src/gui/GUIManipulator.cpp --- sumo-1.5.0+dfsg1/src/gui/GUIManipulator.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIManipulator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Abstract GUI manipulation class /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -49,4 +44,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIManipulator.h sumo-1.6.0+dfsg1/src/gui/GUIManipulator.h --- sumo-1.5.0+dfsg1/src/gui/GUIManipulator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIManipulator.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Abstract GUI manipulation class /****************************************************************************/ -#ifndef GUIManipulator_h -#define GUIManipulator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -57,9 +51,3 @@ FOX_CONSTRUCTOR(GUIManipulator) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIRunThread.cpp sumo-1.6.0+dfsg1/src/gui/GUIRunThread.cpp --- sumo-1.5.0+dfsg1/src/gui/GUIRunThread.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIRunThread.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The thread that runs the simulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIRunThread.h sumo-1.6.0+dfsg1/src/gui/GUIRunThread.h --- sumo-1.5.0+dfsg1/src/gui/GUIRunThread.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIRunThread.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The thread that runs the simulation /****************************************************************************/ -#ifndef GUIRunThread_h -#define GUIRunThread_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -168,8 +162,3 @@ FXMutex myBreakpointLock; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUISUMOViewParent.cpp sumo-1.6.0+dfsg1/src/gui/GUISUMOViewParent.cpp --- sumo-1.5.0+dfsg1/src/gui/GUISUMOViewParent.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUISUMOViewParent.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A single child window which contains a view of the simulation area /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -155,7 +150,7 @@ } // get the new file name FXFileDialog opendialog(this, "Save Snapshot"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); #ifdef HAVE_FFMPEG opendialog.setPatternList("All Image and Video Files (*.gif,*.bmp,*.xpm,*.pcx,*.ico,*.rgb,*.xbm,*.tga,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ps,*.eps,*.pdf,*.svg,*.tex,*.pgf,*.h264,*.hevc)\n" @@ -196,12 +191,12 @@ switch (FXSELID(sel)) { case MID_LOCATEJUNCTION: ids = static_cast(GUINet::getInstance())->getJunctionIDs(myParent->listInternal()); - icon = ICON_LOCATEJUNCTION; + icon = GUIIcon::LOCATEJUNCTION; chooserTitle = "Junction Chooser"; break; case MID_LOCATEEDGE: ids = GUIEdge::getIDs(myParent->listInternal()); - icon = ICON_LOCATEEDGE; + icon = GUIIcon::LOCATEEDGE; chooserTitle = "Edge Chooser"; break; case MID_LOCATEVEHICLE: @@ -211,32 +206,32 @@ static_cast(MSNet::getInstance()->getVehicleControl()).insertVehicleIDs( ids, myParent->listParking(), myParent->listTeleporting()); } - icon = ICON_LOCATEVEHICLE; + icon = GUIIcon::LOCATEVEHICLE; chooserTitle = "Vehicle Chooser"; break; case MID_LOCATEPERSON: static_cast(MSNet::getInstance()->getPersonControl()).insertPersonIDs(ids); - icon = ICON_LOCATEPERSON; + icon = GUIIcon::LOCATEPERSON; chooserTitle = "Person Chooser"; break; case MID_LOCATETLS: ids = static_cast(GUINet::getInstance())->getTLSIDs(); - icon = ICON_LOCATETLS; + icon = GUIIcon::LOCATETLS; chooserTitle = "Traffic Lights Chooser"; break; case MID_LOCATEADD: - ids = GUIGlObject_AbstractAdd::getIDList(GLO_ADDITIONAL); - icon = ICON_LOCATEADD; + ids = GUIGlObject_AbstractAdd::getIDList(GLO_ADDITIONALELEMENT); + icon = GUIIcon::LOCATEADD; chooserTitle = "Additional Objects Chooser"; break; case MID_LOCATEPOI: ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPOIIds(); - icon = ICON_LOCATEPOI; + icon = GUIIcon::LOCATEPOI; chooserTitle = "POI Chooser"; break; case MID_LOCATEPOLY: ids = static_cast(GUINet::getInstance()->getShapeContainer()).getPolygonIDs(); - icon = ICON_LOCATEPOLY; + icon = GUIIcon::LOCATEPOLY; chooserTitle = "Polygon Chooser"; break; default: @@ -360,4 +355,5 @@ return 1; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUISUMOViewParent.h sumo-1.6.0+dfsg1/src/gui/GUISUMOViewParent.h --- sumo-1.5.0+dfsg1/src/gui/GUISUMOViewParent.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUISUMOViewParent.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A single child window which contains a view of the simulation area /****************************************************************************/ -#ifndef GUISUMOViewParent_h -#define GUISUMOViewParent_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -138,9 +132,3 @@ FOX_CONSTRUCTOR(GUISUMOViewParent) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.cpp sumo-1.6.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.cpp --- sumo-1.5.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -178,7 +173,7 @@ myPanel = new GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str()); - setIcon(GUIIconSubSys::getIcon(ICON_APP_TLSTRACKER)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TLSTRACKER)); setHeight(height); setWidth(700); } @@ -206,7 +201,7 @@ myPanel = new GUITLLogicPhasesTrackerPanel(glcanvasFrame, *myApplication, *this); setTitle((logic.getID() + " - " + logic.getProgramID() + " - tracker").c_str()); - setIcon(GUIIconSubSys::getIcon(ICON_APP_TLSTRACKER)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TLSTRACKER)); setHeight(height); setWidth(700); } @@ -499,4 +494,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.h sumo-1.6.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.h --- sumo-1.5.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUITLLogicPhasesTrackerWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A window displaying the phase diagram of a tl-logic /****************************************************************************/ -#ifndef GUITLLogicPhasesTrackerWindow_h -#define GUITLLogicPhasesTrackerWindow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -247,8 +241,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIViewTraffic.cpp sumo-1.6.0+dfsg1/src/gui/GUIViewTraffic.cpp --- sumo-1.5.0+dfsg1/src/gui/GUIViewTraffic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIViewTraffic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A view on the simulation; this view is a microscopic one /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_FFMPEG @@ -120,47 +115,47 @@ // for junctions new FXButton(v.getLocatorPopup(), "\tLocate Junction\tLocate a junction within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), &v, MID_LOCATEJUNCTION, + GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), &v, MID_LOCATEJUNCTION, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for edges new FXButton(v.getLocatorPopup(), "\tLocate Street\tLocate a street within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEEDGE), &v, MID_LOCATEEDGE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), &v, MID_LOCATEEDGE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for vehicles new FXButton(v.getLocatorPopup(), "\tLocate Vehicle\tLocate a vehicle within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for persons if (!MSGlobals::gUseMesoSim) { // there are no persons in mesosim (yet) new FXButton(v.getLocatorPopup(), "\tLocate Vehicle\tLocate a person within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &v, MID_LOCATEPERSON, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } // for tls new FXButton(v.getLocatorPopup(), "\tLocate TLS\tLocate a tls within the network.", - GUIIconSubSys::getIcon(ICON_LOCATETLS), &v, MID_LOCATETLS, + GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), &v, MID_LOCATETLS, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for additional stuff new FXButton(v.getLocatorPopup(), "\tLocate Additional\tLocate an additional structure within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEADD), &v, MID_LOCATEADD, + GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), &v, MID_LOCATEADD, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for pois new FXButton(v.getLocatorPopup(), "\tLocate PoI\tLocate a PoI within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOI), &v, MID_LOCATEPOI, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), &v, MID_LOCATEPOI, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for polygons new FXButton(v.getLocatorPopup(), "\tLocate Polygon\tLocate a Polygon within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOLY), &v, MID_LOCATEPOLY, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), &v, MID_LOCATEPOLY, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } @@ -200,12 +195,18 @@ for (MSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) { if (MSGlobals::gUseMesoSim) { const double val = static_cast(*it)->getColorValue(s, active); + if (val == s.MISSING_DATA) { + continue; + } minValue = MIN2(minValue, val); maxValue = MAX2(maxValue, val); } else { const std::vector& lanes = (*it)->getLanes(); for (std::vector::const_iterator it_l = lanes.begin(); it_l != lanes.end(); it_l++) { const double val = static_cast(*it_l)->getColorValue(s, active); + if (val == s.MISSING_DATA) { + continue; + } minValue = MIN2(minValue, val); maxValue = MAX2(maxValue, val); } @@ -245,8 +246,12 @@ if (minValue != std::numeric_limits::infinity()) { scheme.clear(); // add new thresholds + if (scheme.getName() == GUIVisualizationSettings::SCHEME_NAME_EDGEDATA_NUMERICAL) { + scheme.addColor(RGBColor(204, 204, 204), std::numeric_limits::max(), "missing data"); + } if (hide) { - minValue = MAX2(hideThreshold + 1, minValue); + const double rawRange = maxValue - minValue; + minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue); scheme.addColor(RGBColor(204, 204, 204), hideThreshold); } double range = maxValue - minValue; diff -Nru sumo-1.5.0+dfsg1/src/gui/GUIViewTraffic.h sumo-1.6.0+dfsg1/src/gui/GUIViewTraffic.h --- sumo-1.5.0+dfsg1/src/gui/GUIViewTraffic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/GUIViewTraffic.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A view on the simulation; this view is a microscopic one /****************************************************************************/ -#ifndef GUIViewTraffic_h -#define GUIViewTraffic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -151,9 +145,3 @@ GUIViewTraffic() { } }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/gui/TraCIServerAPI_GUI.cpp sumo-1.6.0+dfsg1/src/gui/TraCIServerAPI_GUI.cpp --- sumo-1.5.0+dfsg1/src/gui/TraCIServerAPI_GUI.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/TraCIServerAPI_GUI.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -218,7 +213,7 @@ if (!server.readTypeCheckingString(inputStorage, vehID)) { return server.writeErrorStatusCmd(libsumo::CMD_SET_GUI_VARIABLE, "Tracking requires a string vehicle ID.", outputStorage); } - if (id == "") { + if (vehID == "") { v->stopTrack(); } else { SUMOVehicle* veh = MSNet::getInstance()->getVehicleControl().getVehicle(vehID); diff -Nru sumo-1.5.0+dfsg1/src/gui/TraCIServerAPI_GUI.h sumo-1.6.0+dfsg1/src/gui/TraCIServerAPI_GUI.h --- sumo-1.5.0+dfsg1/src/gui/TraCIServerAPI_GUI.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/gui/TraCIServerAPI_GUI.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting GUI values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_GUI_h -#define TraCIServerAPI_GUI_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -78,9 +72,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUIDetectorBuilder.cpp sumo-1.6.0+dfsg1/src/guinetload/GUIDetectorBuilder.cpp --- sumo-1.5.0+dfsg1/src/guinetload/GUIDetectorBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUIDetectorBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Builds detectors for guisim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -96,6 +91,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUIDetectorBuilder.h sumo-1.6.0+dfsg1/src/guinetload/GUIDetectorBuilder.h --- sumo-1.5.0+dfsg1/src/guinetload/GUIDetectorBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUIDetectorBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Builds detectors for guisim /****************************************************************************/ -#ifndef GUIDetectorBuilder_h -#define GUIDetectorBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -129,9 +123,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.cpp sumo-1.6.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.cpp --- sumo-1.5.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Derivation of NLEdgeControlBuilder which build gui-edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -71,5 +66,5 @@ return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority, distance); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.h sumo-1.6.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.h --- sumo-1.5.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUIEdgeControlBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Derivation of NLEdgeControlBuilder which builds gui-edges /****************************************************************************/ -#ifndef GUIEdgeControlBuilder_h -#define GUIEdgeControlBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -106,9 +100,3 @@ GUIEdgeControlBuilder& operator=(const GUIEdgeControlBuilder& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUITriggerBuilder.cpp sumo-1.6.0+dfsg1/src/guinetload/GUITriggerBuilder.cpp --- sumo-1.5.0+dfsg1/src/guinetload/GUITriggerBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUITriggerBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Builds trigger objects for guisim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -74,12 +69,13 @@ void GUITriggerBuilder::buildStoppingPlace(MSNet& net, std::string id, std::vector lines, MSLane* lane, - double frompos, double topos, const SumoXMLTag element, std::string name, int personCapacity) { + double frompos, double topos, const SumoXMLTag element, std::string name, + int personCapacity, double parkingLength) { if (element == SUMO_TAG_CONTAINER_STOP) { //TODO: shall we also allow names for container stops? might make sense [GL March '17] - myCurrentStop = new GUIContainerStop(id, lines, *lane, frompos, topos, name, personCapacity); + myCurrentStop = new GUIContainerStop(id, lines, *lane, frompos, topos, name, personCapacity, parkingLength); } else { - myCurrentStop = new GUIBusStop(id, lines, *lane, frompos, topos, name, personCapacity); + myCurrentStop = new GUIBusStop(id, lines, *lane, frompos, topos, name, personCapacity, parkingLength); } if (!net.addStoppingPlace(element, myCurrentStop)) { delete myCurrentStop; @@ -160,5 +156,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guinetload/GUITriggerBuilder.h sumo-1.6.0+dfsg1/src/guinetload/GUITriggerBuilder.h --- sumo-1.5.0+dfsg1/src/guinetload/GUITriggerBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guinetload/GUITriggerBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Builds trigger objects for guisim /****************************************************************************/ -#ifndef GUITriggerBuilder_h -#define GUITriggerBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -114,7 +108,8 @@ * @exception InvalidArgument If the stop can not be added to the net (is duplicate) */ virtual void buildStoppingPlace(MSNet& net, std::string id, std::vector lines, MSLane* lane, - double frompos, double topos, const SumoXMLTag element, std::string string, int personCapacity); + double frompos, double topos, const SumoXMLTag element, std::string string, + int personCapacity, double parkingLength); /** @brief Builds a parking area @@ -200,9 +195,3 @@ */ virtual void endStoppingPlace(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIBaseVehicle.cpp sumo-1.6.0+dfsg1/src/guisim/GUIBaseVehicle.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIBaseVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIBaseVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -77,6 +72,8 @@ FXMAPFUNC(SEL_COMMAND, MID_HIDE_CURRENTROUTE, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideCurrentRoute), FXMAPFUNC(SEL_COMMAND, MID_SHOW_FUTUREROUTE, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowFutureRoute), FXMAPFUNC(SEL_COMMAND, MID_HIDE_FUTUREROUTE, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideFutureRoute), + FXMAPFUNC(SEL_COMMAND, MID_SHOW_ROUTE_NOLOOPS, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowRouteNoLoops), + FXMAPFUNC(SEL_COMMAND, MID_HIDE_ROUTE_NOLOOPS, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideRouteNoLoops), FXMAPFUNC(SEL_COMMAND, MID_SHOW_BEST_LANES, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowBestLanes), FXMAPFUNC(SEL_COMMAND, MID_HIDE_BEST_LANES, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideBestLanes), FXMAPFUNC(SEL_COMMAND, MID_START_TRACK, GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdStartTrack), @@ -157,6 +154,23 @@ long +GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowRouteNoLoops(FXObject*, FXSelector, void*) { + assert(myObject->getType() == GLO_VEHICLE); + if (!static_cast(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE_NOLOOP)) { + static_cast(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_ROUTE_NOLOOP); + } + return 1; +} + +long +GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdHideRouteNoLoops(FXObject*, FXSelector, void*) { + assert(myObject->getType() == GLO_VEHICLE); + static_cast(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_ROUTE_NOLOOP); + return 1; +} + + +long GUIBaseVehicle::GUIBaseVehiclePopupMenu::onCmdShowBestLanes(FXObject*, FXSelector, void*) { assert(myObject->getType() == GLO_VEHICLE); if (!static_cast(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_BEST_LANES)) { @@ -220,13 +234,13 @@ GUIBaseVehicle* baseVeh = static_cast(myObject); MSVehicle* microVeh = dynamic_cast(&baseVeh->myVehicle); if (microVeh != nullptr) { - microVeh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED); + microVeh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED_GUI); if (microVeh->getLane() != nullptr) { - microVeh->getLane()->removeVehicle(microVeh, MSMoveReminder::NOTIFICATION_VAPORIZED); + microVeh->getLane()->removeVehicle(microVeh, MSMoveReminder::NOTIFICATION_VAPORIZED_GUI); } } else { MEVehicle* mesoVeh = dynamic_cast(&baseVeh->myVehicle); - MSGlobals::gMesoNet->vaporizeCar(mesoVeh); + MSGlobals::gMesoNet->vaporizeCar(mesoVeh, MSMoveReminder::NOTIFICATION_VAPORIZED_GUI); } MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(&baseVeh->myVehicle); myParent->update(); @@ -287,6 +301,13 @@ } else { new FXMenuCommand(ret, "Show All Routes", nullptr, ret, MID_SHOW_ALLROUTES); } + if (hasActiveAddVisualisation(&parent, VO_SHOW_ROUTE_NOLOOP)) { + FXMenuCheck* showLoops = new FXMenuCheck(ret, "Draw looped routes", ret, MID_HIDE_ROUTE_NOLOOPS); + showLoops->setCheck(false); + } else { + FXMenuCheck* showLoops = new FXMenuCheck(ret, "Draw looped routes", ret, MID_SHOW_ROUTE_NOLOOPS); + showLoops->setCheck(true); + } if (hasActiveAddVisualisation(&parent, VO_SHOW_BEST_LANES)) { new FXMenuCommand(ret, "Hide Best Lanes", nullptr, ret, MID_HIDE_BEST_LANES); } else { @@ -552,11 +573,12 @@ if (hasActiveAddVisualisation(parent, VO_SHOW_BEST_LANES)) { drawBestLanes(); } + bool noLoop = hasActiveAddVisualisation(parent, VO_SHOW_ROUTE_NOLOOP); if (hasActiveAddVisualisation(parent, VO_SHOW_ROUTE)) { - drawRoute(s, 0, 0.25, false); + drawRoute(s, 0, 0.25, false, noLoop); } if (hasActiveAddVisualisation(parent, VO_SHOW_FUTURE_ROUTE)) { - drawRoute(s, 0, 0.25, true); + drawRoute(s, 0, 0.25, true, noLoop); } if (hasActiveAddVisualisation(parent, VO_SHOW_ALL_ROUTES)) { if (myVehicle.getNumberReroutes() > 0) { @@ -566,7 +588,7 @@ drawRoute(s, i, darken); } } else { - drawRoute(s, 0, 0.25); + drawRoute(s, 0, 0.25, false, noLoop); } } if (hasActiveAddVisualisation(parent, VO_SHOW_LFLINKITEMS)) { @@ -682,13 +704,18 @@ col = RGBColor::fromHSV(hue, sat, 1.); return true; } - case 30: { // color randomly (by pointer hash) + case 32: { // color randomly (by pointer hash) std::hash ptr_hash; const double hue = (double)(ptr_hash(veh) % 360); // [0-360] const double sat = ((ptr_hash(veh) / 360) % 67) / 100.0 + 0.33; // [0.33-1] col = RGBColor::fromHSV(hue, sat, 1.); return true; } + case 33: { // color by angle + double hue = GeomHelper::naviDegree(veh->getAngle()); + col = RGBColor::fromHSV(hue, 1., 1.); + return true; + } } return false; } @@ -722,16 +749,16 @@ void -GUIBaseVehicle::drawRoute(const GUIVisualizationSettings& s, int routeNo, double darken, bool future) const { +GUIBaseVehicle::drawRoute(const GUIVisualizationSettings& s, int routeNo, double darken, bool future, bool noLoop) const { RGBColor darker = setColor(s).changedBrightness((int)(darken * -255)); GLHelper::setColor(darker); if (routeNo == 0) { - drawRouteHelper(s, myVehicle.getRoute(), future, darker); + drawRouteHelper(s, myVehicle.getRoute(), future, noLoop, darker); return; } const MSRoute* route = myRoutes->getRoute(routeNo - 1); // only prior routes are stored if (route != nullptr) { - drawRouteHelper(s, *route, future, darker); + drawRouteHelper(s, *route, future, noLoop, darker); } } @@ -857,4 +884,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIBaseVehicle.h sumo-1.6.0+dfsg1/src/guisim/GUIBaseVehicle.h --- sumo-1.5.0+dfsg1/src/guisim/GUIBaseVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIBaseVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUIBaseVehicle_h -#define GUIBaseVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,7 +109,7 @@ /** @brief Draws the route * @param[in] r The route to draw */ - virtual void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, const RGBColor& col) const = 0; + virtual void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, bool noLoop, const RGBColor& col) const = 0; /// @brief retrieve information about the current stop state virtual std::string getStopInfo() const = 0; @@ -271,6 +265,10 @@ long onCmdShowFutureRoute(FXObject*, FXSelector, void*); /// @brief Called if the current route of the vehicle shall be hidden long onCmdHideFutureRoute(FXObject*, FXSelector, void*); + /// @brief Called if the current route of the vehicle shall be shown + long onCmdShowRouteNoLoops(FXObject*, FXSelector, void*); + /// @brief Called if the current route of the vehicle shall be hidden + long onCmdHideRouteNoLoops(FXObject*, FXSelector, void*); /// @brief Called if the vehicle's best lanes shall be shown long onCmdShowBestLanes(FXObject*, FXSelector, void*); /// @brief Called if the vehicle's best lanes shall be hidden @@ -311,7 +309,9 @@ /// @brief draw vehicle outside the road network VO_DRAW_OUTSIDE_NETWORK = 16, /// @brief show vehicle's current continued from the current position - VO_SHOW_FUTURE_ROUTE = 32 + VO_SHOW_FUTURE_ROUTE = 32, + /// @brief show vehicle's routes without loops + VO_SHOW_ROUTE_NOLOOP = 64 }; /// @brief Enabled visualisations, per view @@ -323,7 +323,7 @@ * @param[in] routeNo The route to show (0: the current, >0: prior) * @param[in] darken The amount to darken the route by */ - void drawRoute(const GUIVisualizationSettings& s, int routeNo, double darken, bool future = false) const; + void drawRoute(const GUIVisualizationSettings& s, int routeNo, double darken, bool future = false, bool noLoop = false) const; /// @} @@ -372,9 +372,3 @@ GUIGLObjectPopupMenu* myPopup; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIBusStop.cpp sumo-1.6.0+dfsg1/src/guisim/GUIBusStop.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIBusStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIBusStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -57,8 +52,8 @@ // method definitions // =========================================================================== GUIBusStop::GUIBusStop(const std::string& id, const std::vector& lines, MSLane& lane, - double frompos, double topos, const std::string name, int personCapacity) : - MSStoppingPlace(id, lines, lane, frompos, topos, name, personCapacity), + double frompos, double topos, const std::string name, int personCapacity, double parkingLength) : + MSStoppingPlace(id, lines, lane, frompos, topos, name, personCapacity, parkingLength), GUIGlObject_AbstractAdd(GLO_BUS_STOP, id), myPersonExaggeration(1) { const double offsetSign = MSGlobals::gLefthand ? -1 : 1; @@ -124,6 +119,8 @@ ret->mkItem("name", false, getMyName()); ret->mkItem("begin position [m]", false, myBegPos); ret->mkItem("end position [m]", false, myEndPos); + ret->mkItem("lines", false, joinToString(myLines, " ")); + ret->mkItem("parking length [m]", false, (myEndPos - myBegPos) / myParkingFactor); ret->mkItem("person capacity [#]", false, myTransportableCapacity); ret->mkItem("person number [#]", true, new FunctionBinding(this, &MSStoppingPlace::getTransportableNumber)); ret->mkItem("stopped vehicles[#]", true, new FunctionBinding(this, &MSStoppingPlace::getStoppedVehicleNumber)); @@ -150,17 +147,22 @@ // draw the lines const double rotSign = MSGlobals::gLefthand ? 1 : -1; // Iterate over every line + const double lineAngle = s.getTextAngle(rotSign * myFGSignRot); + RGBColor lineColor = s.stoppingPlaceSettings.busStopColor.changedBrightness(-51); + const double textOffset = s.flippedTextAngle(rotSign * myFGSignRot) ? -1 : 1; + const double textOffset2 = s.flippedTextAngle(rotSign * myFGSignRot) ? -1 : 0.3; for (int i = 0; i < (int)myLines.size(); ++i) { // push a new matrix for every line glPushMatrix(); // traslate and rotate glTranslated(myFGSignPos.x(), myFGSignPos.y(), 0); - glRotated(rotSign * myFGSignRot, 0, 0, 1); + glRotated(lineAngle, 0, 0, 1); // draw line - GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.stoppingPlaceSettings.busStopColor, 0, FONS_ALIGN_LEFT); + GLHelper::drawText(myLines[i].c_str(), Position(1.2, i * textOffset + textOffset2), .1, 1.f, lineColor, 0, FONS_ALIGN_LEFT); // pop matrix for every line glPopMatrix(); } + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); for (std::vector::const_iterator i = myAccessCoords.begin(); i != myAccessCoords.end(); ++i) { GLHelper::drawBoxLine(*i, RAD2DEG(myFGSignPos.angleTo2D(*i)) - 90, myFGSignPos.distanceTo2D(*i), .05); } @@ -218,4 +220,5 @@ return result; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIBusStop.h sumo-1.6.0+dfsg1/src/guisim/GUIBusStop.h --- sumo-1.5.0+dfsg1/src/guisim/GUIBusStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIBusStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ -#ifndef GUIBusStop_h -#define GUIBusStop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -75,7 +69,8 @@ */ GUIBusStop(const std::string& id, const std::vector& lines, MSLane& lane, - double frompos, double topos, const std::string name, int personCapacity); + double frompos, double topos, const std::string name, + int personCapacity, double parkingLength); /// @brief Destructor @@ -162,9 +157,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUICalibrator.cpp sumo-1.6.0+dfsg1/src/guisim/GUICalibrator.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUICalibrator.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUICalibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,9 +19,6 @@ /// // Changes flow and speed on a set of lanes (gui version) /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -410,6 +407,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUICalibrator.h sumo-1.6.0+dfsg1/src/guisim/GUICalibrator.h --- sumo-1.5.0+dfsg1/src/guisim/GUICalibrator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUICalibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Changes flow and speed on a set of lanes (gui version) /****************************************************************************/ -#ifndef GUICalibrator_h -#define GUICalibrator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -191,9 +185,3 @@ bool myShowAsKMH; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIChargingStation.cpp sumo-1.6.0+dfsg1/src/guisim/GUIChargingStation.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIChargingStation.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIChargingStation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -195,4 +190,5 @@ return myName; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIChargingStation.h sumo-1.6.0+dfsg1/src/guisim/GUIChargingStation.h --- sumo-1.5.0+dfsg1/src/guisim/GUIChargingStation.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIChargingStation.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ -#ifndef GUIChargingStation_h -#define GUIChargingStation_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -142,5 +136,4 @@ double myFGSignRot; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIContainer.cpp sumo-1.6.0+dfsg1/src/guisim/GUIContainer.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIContainer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIContainer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A MSContainer extended by some values for usage within the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -150,7 +145,7 @@ buildShowParamsPopupEntry(ret); buildShowTypeParamsPopupEntry(ret); - new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN); + new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(GUIIcon::APP_TABLE), ret, MID_SHOWPLAN); new FXMenuSeparator(ret); buildPositionCopyEntry(ret, false); return ret; @@ -447,5 +442,6 @@ drawAction_drawAsPoly(s); } } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIContainer.h sumo-1.6.0+dfsg1/src/guisim/GUIContainer.h --- sumo-1.5.0+dfsg1/src/guisim/GUIContainer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIContainer.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUIContainer_h -#define GUIContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -207,9 +201,3 @@ void drawAction_drawAsImage(const GUIVisualizationSettings& s) const; /// @} }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIContainerStop.cpp sumo-1.6.0+dfsg1/src/guisim/GUIContainerStop.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIContainerStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIContainerStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -55,8 +50,8 @@ // method definitions // =========================================================================== GUIContainerStop::GUIContainerStop(const std::string& id, const std::vector& lines, MSLane& lane, - double frompos, double topos, const std::string& name, int containerCapacity) : - MSStoppingPlace(id, lines, lane, frompos, topos, name, containerCapacity), + double frompos, double topos, const std::string& name, int containerCapacity, double parkingLength) : + MSStoppingPlace(id, lines, lane, frompos, topos, name, containerCapacity, parkingLength), GUIGlObject_AbstractAdd(GLO_CONTAINER_STOP, id) { const double offsetSign = MSGlobals::gLefthand ? -1 : 1; myFGShape = lane.getShape(); @@ -184,6 +179,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIContainerStop.h sumo-1.6.0+dfsg1/src/guisim/GUIContainerStop.h --- sumo-1.5.0+dfsg1/src/guisim/GUIContainerStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIContainerStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A lane area vehicles can halt at (gui-version) /****************************************************************************/ -#ifndef GUIContainerStop_h -#define GUIContainerStop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,7 +68,8 @@ */ GUIContainerStop(const std::string& id, const std::vector& lines, MSLane& lane, - double frompos, double topos, const std::string& name, int containerCapacity); + double frompos, double topos, const std::string& name, + int containerCapacity, double parkingLength); /// @brief Destructor @@ -145,9 +140,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIDetectorWrapper.cpp sumo-1.6.0+dfsg1/src/guisim/GUIDetectorWrapper.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIDetectorWrapper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIDetectorWrapper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The base class for detector wrapper /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIDetectorWrapper.h" @@ -58,6 +53,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIDetectorWrapper.h sumo-1.6.0+dfsg1/src/guisim/GUIDetectorWrapper.h --- sumo-1.5.0+dfsg1/src/guisim/GUIDetectorWrapper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIDetectorWrapper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The base class for detector wrapper /****************************************************************************/ -#ifndef GUIDetectorWrapper_h -#define GUIDetectorWrapper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -66,9 +60,3 @@ /// @} }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIE2Collector.cpp sumo-1.6.0+dfsg1/src/guisim/GUIE2Collector.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIE2Collector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIE2Collector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The gui-version of the MSE2Collector /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,7 +45,7 @@ double jamDistThreshold, const std::string& vTypes, bool showDetector) : MSE2Collector(id, usage, lane, startPos, endPos, detLength, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes), - myShowDetectorInGUI(showDetector) {} + myShow(showDetector) {} GUIE2Collector::GUIE2Collector(const std::string& id, DetectorUsage usage, std::vector lanes, double startPos, double endPos, @@ -58,7 +53,7 @@ double jamDistThreshold, const std::string& vTypes, bool showDetector) : MSE2Collector(id, usage, lanes, startPos, endPos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes), - myShowDetectorInGUI(showDetector) {} + myShow(showDetector) {} GUIE2Collector::~GUIE2Collector() {} @@ -156,7 +151,7 @@ void GUIE2Collector::MyWrapper::drawGL(const GUIVisualizationSettings& s) const { - if (!myDetector.myShowDetectorInGUI) { + if (!myDetector.myShow) { return; } glPushName(getGlID()); @@ -193,6 +188,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIE2Collector.h sumo-1.6.0+dfsg1/src/guisim/GUIE2Collector.h --- sumo-1.5.0+dfsg1/src/guisim/GUIE2Collector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIE2Collector.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The gui-version of the MS_E2_ZS_Collector /****************************************************************************/ -#ifndef GUIE2Collector_h -#define GUIE2Collector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -102,9 +96,20 @@ */ virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); + /// @brief whether the induction loop shall be visible + bool isVisible() const { + return myShow; + } + + /// @brief toggle visibility + void setVisible(bool show) { + myShow = show; + } + + private: /// @brief Whether the detector shall be drawn in the gui - bool myShowDetectorInGUI; + bool myShow; public: /** @@ -180,9 +185,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIE3Collector.cpp sumo-1.6.0+dfsg1/src/guisim/GUIE3Collector.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIE3Collector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIE3Collector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The gui-version of a MSE3Collector /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIE3Collector.h" @@ -190,6 +185,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIE3Collector.h sumo-1.6.0+dfsg1/src/guisim/GUIE3Collector.h --- sumo-1.5.0+dfsg1/src/guisim/GUIE3Collector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIE3Collector.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The gui-version of a MSE3Collector /****************************************************************************/ -#ifndef GUIE3Collector_h -#define GUIE3Collector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -163,9 +157,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIEdge.cpp sumo-1.6.0+dfsg1/src/guisim/GUIEdge.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -61,11 +56,6 @@ #include #include #include - - -// =========================================================================== -// included modules -// =========================================================================== GUIEdge::GUIEdge(const std::string& id, int numericalID, const SumoXMLEdgeFunc function, const std::string& streetName, const std::string& edgeType, int priority, @@ -190,8 +180,7 @@ ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding(this, &GUIEdge::getMeanSpeed)); ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding(this, &GUIEdge::getFlow)); ret->mkItem("routing speed [m/s]", true, new FunctionBinding(this, &MSEdge::getRoutingSpeed)); - ret->mkItem("#vehicles", true, new CastingFunctionBinding(this, &GUIEdge::getVehicleNo)); - ret->mkItem("vehicle ids", false, getVehicleIDs()); + ret->mkItem("#vehicles", true, new CastingFunctionBinding(this, &MSEdge::getVehicleNumber)); // add segment items MESegment* segment = getSegmentAtPosition(parent.getPositionInformation()); ret->mkItem("segment index", false, segment->getIndex()); @@ -202,7 +191,7 @@ ret->mkItem("segment brutto occupancy [%]", true, new FunctionBinding(segment, &MESegment::getRelativeOccupancy, 100)); ret->mkItem("segment mean vehicle speed [m/s]", true, new FunctionBinding(segment, &MESegment::getMeanSpeed)); ret->mkItem("segment flow [veh/h/lane]", true, new FunctionBinding(segment, &MESegment::getFlow)); - ret->mkItem("segment #vehicles", true, new CastingFunctionBinding(segment, &MESegment::getCarNumber)); + ret->mkItem("segment #vehicles", true, new CastingFunctionBinding(segment, &MESegment::getCarNumber)); ret->mkItem("segment leader leave time", true, new FunctionBinding(segment, &MESegment::getEventTimeSeconds)); ret->mkItem("segment headway [s]", true, new FunctionBinding(segment, &MESegment::getLastHeadwaySeconds)); ret->mkItem("segment entry blocktime [s]", true, new FunctionBinding(segment, &MESegment::getEntryBlockTimeSeconds)); @@ -229,7 +218,7 @@ void GUIEdge::drawGL(const GUIVisualizationSettings& s) const { - if (s.hideConnectors && myFunction == EDGEFUNC_CONNECTOR) { + if (s.hideConnectors && myFunction == SumoXMLEdgeFunc::CONNECTOR) { return; } glPushName(getGlID()); @@ -247,13 +236,13 @@ } glPopName(); // (optionally) draw the name and/or the street name - const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNC_NORMAL; - const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNC_INTERNAL; - const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == EDGEFUNC_CROSSING || myFunction == EDGEFUNC_WALKINGAREA); + 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 == EDGEFUNC_NORMAL - || (myFunction == EDGEFUNC_INTERNAL && !s.drawJunctionShape) - || ((myFunction == EDGEFUNC_CROSSING || myFunction == EDGEFUNC_WALKINGAREA) && s.drawCrossingsAndWalkingareas)); + const bool drawEdgeValue = s.edgeValue.show && (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()); @@ -295,7 +284,7 @@ ? getColorValue(s, activeScheme) : lane2->getColorValue(s, activeScheme)); const RGBColor color = (MSGlobals::gUseMesoSim ? s.edgeColorer : s.laneColorer).getScheme().getColor(doubleValue); - value = color.alpha() == 0 ? "" : toString(doubleValue); + value = doubleValue == s.MISSING_DATA || color.alpha() == 0 ? "" : toString(doubleValue); } if (value != "") { GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, angle); @@ -371,51 +360,6 @@ -int -GUIEdge::getVehicleNo() const { - int vehNo = 0; - for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { - vehNo += segment->getCarNumber(); - } - return (int)vehNo; -} - - -std::string -GUIEdge::getVehicleIDs() const { - std::string result = " "; - std::vector vehs; - for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { - std::vector segmentVehs = segment->getVehicles(); - vehs.insert(vehs.end(), segmentVehs.begin(), segmentVehs.end()); - } - for (std::vector::const_iterator it = vehs.begin(); it != vehs.end(); it++) { - result += (*it)->getID() + " "; - } - return result; -} - - -double -GUIEdge::getFlow() const { - double flow = 0; - for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { - flow += (double) segment->getCarNumber() * segment->getMeanSpeed(); - } - return 3600 * flow / (*myLanes)[0]->getLength(); -} - - -double -GUIEdge::getBruttoOccupancy() const { - double occ = 0; - for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { - occ += segment->getBruttoOccupancy(); - } - return occ / (*myLanes)[0]->getLength() / (double)(myLanes->size()); -} - - double GUIEdge::getAllowedSpeed() const { return (*myLanes)[0]->getSpeedLimit(); @@ -514,7 +458,7 @@ case 1: return gSelected.isSelected(getType(), getGlID()); case 2: - return getFunction(); + return (double)getFunction(); case 3: return getAllowedSpeed(); case 4: @@ -613,5 +557,6 @@ GUIEdge::isSelected() const { return gSelected.isSelected(GLO_EDGE, getGlID()); } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIEdge.h sumo-1.6.0+dfsg1/src/guisim/GUIEdge.h --- sumo-1.5.0+dfsg1/src/guisim/GUIEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A road/street connecting two junctions (gui-version) /****************************************************************************/ -#ifndef GUIEdge_h -#define GUIEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -162,12 +156,7 @@ MSEdge::removeContainer(c); } - int getVehicleNo() const; - std::string getVehicleIDs() const; - double getBruttoOccupancy() const; double getAllowedSpeed() const; - /// @brief return flow based on meanSpead @note: may produced incorrect results when jammed - double getFlow() const; /// @brief return meanSpead divided by allowedSpeed double getRelativeSpeed() const; @@ -245,9 +234,3 @@ mutable RGBColor myMesoColor; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIEventControl.cpp sumo-1.6.0+dfsg1/src/guisim/GUIEventControl.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIEventControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIEventControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -56,6 +51,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIEventControl.h sumo-1.6.0+dfsg1/src/guisim/GUIEventControl.h --- sumo-1.5.0+dfsg1/src/guisim/GUIEventControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIEventControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Stores time-dependant events and executes them at the proper time (guisim) /****************************************************************************/ -#ifndef GUIEventControl_h -#define GUIEventControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -89,9 +83,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIInductLoop.cpp sumo-1.6.0+dfsg1/src/guisim/GUIInductLoop.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -47,7 +42,7 @@ * ----------------------------------------------------------------------- */ GUIInductLoop::GUIInductLoop(const std::string& id, MSLane* const lane, double position, const std::string& vTypes, bool show) : - MSInductLoop(id, lane, position, vTypes), + MSInductLoop(id, lane, position, vTypes, true), myWrapper(nullptr), myShow(show) {} @@ -65,39 +60,6 @@ void -GUIInductLoop::reset() { - FXMutexLock locker(myLock); - MSInductLoop::reset(); -} - - -void -GUIInductLoop::enterDetectorByMove(SUMOTrafficObject& veh, double entryTimestep) { - FXMutexLock locker(myLock); - MSInductLoop::enterDetectorByMove(veh, entryTimestep); -} - -void -GUIInductLoop::leaveDetectorByMove(SUMOTrafficObject& veh, double leaveTimestep) { - FXMutexLock locker(myLock); - MSInductLoop::leaveDetectorByMove(veh, leaveTimestep); -} - -void -GUIInductLoop::leaveDetectorByLaneChange(SUMOTrafficObject& veh, double lastPos) { - FXMutexLock locker(myLock); - MSInductLoop::leaveDetectorByLaneChange(veh, lastPos); -} - - -std::vector -GUIInductLoop::collectVehiclesOnDet(SUMOTime t, bool leaveTime) const { - FXMutexLock locker(myLock); - return MSInductLoop::collectVehiclesOnDet(t, leaveTime); -} - - -void GUIInductLoop::setSpecialColor(const RGBColor* color) { if (myWrapper != nullptr) { myWrapper->setSpecialColor(color); @@ -141,8 +103,8 @@ ret->mkItem("position [m]", false, myPosition); ret->mkItem("lane", false, myDetector.getLane()->getID()); // values - ret->mkItem("passed vehicles [#]", true, - new FuncBinding_IntParam(&myDetector, &GUIInductLoop::getPassedNumber, 0)); + ret->mkItem("entered vehicles [#]", true, + new FuncBinding_IntParam(&myDetector, &GUIInductLoop::getEnteredNumber, 0)); ret->mkItem("speed [m/s]", true, new FuncBinding_IntParam(&myDetector, &GUIInductLoop::getSpeed, 0)); ret->mkItem("occupancy [%]", true, diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIInductLoop.h sumo-1.6.0+dfsg1/src/guisim/GUIInductLoop.h --- sumo-1.5.0+dfsg1/src/guisim/GUIInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The gui-version of the MSInductLoop, together with the according /****************************************************************************/ -#ifndef GUIInductLoop_h -#define GUIInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,33 +58,11 @@ ~GUIInductLoop(); - /** @brief Resets all generated values to allow computation of next interval - * - * Locks the internal mutex before calling MSInductLoop::reset() - * @see MSInductLoop::reset() - */ - void reset(); - - /** @brief Returns this detector's visualisation-wrapper * @return The wrapper representing the detector */ virtual GUIDetectorWrapper* buildDetectorGUIRepresentation(); - - /** @brief Returns vehicle data for vehicles that have been on the detector starting at the given time - * - * This method uses a mutex to prevent parallel read/write access to the vehicle buffer - * - * @param[in] t The time from which vehicles shall be counted - * @param[in] leaveTime Whether entryTime or leaveTime shall be compared against t - * (the latter gives a more complete picture but may include vehicles in multiple steps even if they did not stay on the detector) - * @return The list of vehicles - * @see MSInductLoop::collectVehiclesOnDet() - */ - std::vector collectVehiclesOnDet(SUMOTime t, bool leaveTime = false) const; - - /// @brief sets special caller for myWrapper void setSpecialColor(const RGBColor* color); @@ -104,45 +76,6 @@ myShow = show; } -protected: - /// @name Methods that add and remove vehicles from internal container - /// @{ - - /** @brief Introduces a vehicle to the detector's map myVehiclesOnDet. - * - * Locks the internal mutex before calling MSInductLoop::enterDetectorByMove() - * @see MSInductLoop::enterDetectorByMove() - * @param veh The entering vehicle. - * @param entryTimestep Timestep (not necessary integer) of entrance. - * @see MSInductLoop::enterDetectorByMove() - */ - void enterDetectorByMove(SUMOTrafficObject& veh, double entryTimestep); - - - /** @brief Processes a vehicle that leaves the detector - * - * Locks the internal mutex before calling MSInductLoop::leaveDetectorByMove() - * @see MSInductLoop::leaveDetectorByMove() - * @param veh The leaving vehicle. - * @param leaveTimestep Timestep (not necessary integer) of leaving. - * @see MSInductLoop::leaveDetectorByMove() - */ - void leaveDetectorByMove(SUMOTrafficObject& veh, double leaveTimestep); - - - /** @brief Removes a vehicle from the detector's map myVehiclesOnDet. - * - * Locks the internal mutex before calling MSInductLoop::leaveDetectorByLaneChange() - * @see MSInductLoop::leaveDetectorByLaneChange() - * @param veh The leaving vehicle. - * @param lastPos The last position of the leaving vehicle. - */ - void leaveDetectorByLaneChange(SUMOTrafficObject& veh, double lastPos); - /// @} - - - - public: /** * @class GUIInductLoop::MyWrapper @@ -228,13 +161,4 @@ /// @brief whether this induction loop shall be visible in the gui bool myShow; - /// @brief Mutex preventing parallel read/write access to internal MSInductLoop state - mutable FXMutex myLock; - }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIInstantInductLoop.cpp sumo-1.6.0+dfsg1/src/guisim/GUIInstantInductLoop.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIInstantInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIInstantInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -158,6 +153,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIInstantInductLoop.h sumo-1.6.0+dfsg1/src/guisim/GUIInstantInductLoop.h --- sumo-1.5.0+dfsg1/src/guisim/GUIInstantInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIInstantInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The gui-version of the MSInstantInductLoop /****************************************************************************/ -#ifndef GUIInstantInductLoop_h -#define GUIInstantInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -141,9 +135,3 @@ mutable FXMutex myLock; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIJunctionWrapper.cpp sumo-1.6.0+dfsg1/src/guisim/GUIJunctionWrapper.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIJunctionWrapper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIJunctionWrapper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // } /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -69,7 +64,7 @@ myBoundary = myJunction.getShape().getBoxBoundary(); } myMaxSize = MAX2(myBoundary.getWidth(), myBoundary.getHeight()); - myIsInternal = myJunction.getType() == NODETYPE_INTERNAL; + myIsInternal = myJunction.getType() == SumoXMLNodeType::INTERNAL; myAmWaterway = myJunction.getIncoming().size() + myJunction.getOutgoing().size() > 0; myAmRailway = myJunction.getIncoming().size() + myJunction.getOutgoing().size() > 0; for (auto it = myJunction.getIncoming().begin(); it != myJunction.getIncoming().end() && (myAmWaterway || myAmRailway); ++it) { @@ -117,6 +112,7 @@ GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); // add items ret->mkItem("type", false, toString(myJunction.getType())); + ret->mkItem("name", false, myJunction.getName()); // close building ret->closeBuilding(&myJunction); return ret; @@ -164,7 +160,7 @@ GLHelper::debugVertices(shape, 80 / s.scale); #endif // make small junctions more visible when coloring by type - if (myJunction.getType() == NODETYPE_RAIL_SIGNAL && s.junctionColorer.getActive() == 2) { + if (myJunction.getType() == SumoXMLNodeType::RAIL_SIGNAL && s.junctionColorer.getActive() == 2) { glTranslated(myJunction.getPosition().x(), myJunction.getPosition().y(), getType() + 0.05); GLHelper::drawFilledCircle(2 * exaggeration, 12); } @@ -176,7 +172,10 @@ if (myIsInternal) { drawName(myJunction.getPosition(), s.scale, s.internalJunctionName, s.angle); } else { - drawName(myJunction.getPosition(), s.scale, s.junctionName, s.angle); + drawName(myJunction.getPosition(), s.scale, s.junctionID, s.angle); + if (s.junctionName.show && myJunction.getName() != "") { + GLHelper::drawTextSettings(s.junctionName, myJunction.getName(), myJunction.getPosition(), s.scale, s.angle); + } if ((s.tlsPhaseIndex.show || s.tlsPhaseName.show) && myTLLID != "") { const MSTrafficLightLogic* active = MSNet::getInstance()->getTLSControl().getActive(myTLLID); if (s.tlsPhaseIndex.show) { @@ -212,36 +211,36 @@ return gSelected.isSelected(getType(), getGlID()) ? 1 : 0; case 2: switch (myJunction.getType()) { - case NODETYPE_TRAFFIC_LIGHT: + case SumoXMLNodeType::TRAFFIC_LIGHT: return 0; - case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: + case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: return 1; - case NODETYPE_PRIORITY: + case SumoXMLNodeType::PRIORITY: return 2; - case NODETYPE_PRIORITY_STOP: + case SumoXMLNodeType::PRIORITY_STOP: return 3; - case NODETYPE_RIGHT_BEFORE_LEFT: + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: return 4; - case NODETYPE_ALLWAY_STOP: + case SumoXMLNodeType::ALLWAY_STOP: return 5; - case NODETYPE_DISTRICT: + case SumoXMLNodeType::DISTRICT: return 6; - case NODETYPE_NOJUNCTION: + case SumoXMLNodeType::NOJUNCTION: return 7; - case NODETYPE_DEAD_END: - case NODETYPE_DEAD_END_DEPRECATED: + case SumoXMLNodeType::DEAD_END: + case SumoXMLNodeType::DEAD_END_DEPRECATED: return 8; - case NODETYPE_UNKNOWN: - case NODETYPE_INTERNAL: + case SumoXMLNodeType::UNKNOWN: + case SumoXMLNodeType::INTERNAL: assert(false); return 8; - case NODETYPE_RAIL_SIGNAL: + case SumoXMLNodeType::RAIL_SIGNAL: return 9; - case NODETYPE_ZIPPER: + case SumoXMLNodeType::ZIPPER: return 10; - case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: + case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: return 11; - case NODETYPE_RAIL_CROSSING: + case SumoXMLNodeType::RAIL_CROSSING: return 12; } case 3: @@ -265,4 +264,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIJunctionWrapper.h sumo-1.6.0+dfsg1/src/guisim/GUIJunctionWrapper.h --- sumo-1.5.0+dfsg1/src/guisim/GUIJunctionWrapper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIJunctionWrapper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Holds geometrical values for a junction /****************************************************************************/ -#ifndef GUIJunctionWrapper_h -#define GUIJunctionWrapper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -181,9 +175,3 @@ GUIJunctionWrapper& operator=(const GUIJunctionWrapper&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUILane.cpp sumo-1.6.0+dfsg1/src/guisim/GUILane.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUILane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUILane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -297,7 +292,7 @@ } // draw all links const double w = myWidth / (double) noLinks; - double x1 = myEdge->getToJunction()->getType() == NODETYPE_RAIL_SIGNAL ? -myWidth * 0.5 : 0; + double x1 = myEdge->getToJunction()->getType() == SumoXMLNodeType::RAIL_SIGNAL ? -myWidth * 0.5 : 0; for (int i = 0; i < noLinks; ++i) { double x2 = x1 + w; drawLinkRule(s, net, myLinks[MSGlobals::gLefthand ? noLinks - 1 - i : i], getShape(), x1, x2); @@ -374,7 +369,7 @@ // the white bar should be the default for most railway // links and looks ugly so we do not draw it double scale = isInternal() ? 0.5 : 1; - if (myEdge->getToJunction()->getType() == NODETYPE_RAIL_SIGNAL) { + if (myEdge->getToJunction()->getType() == SumoXMLNodeType::RAIL_SIGNAL) { scale *= MAX2(s.laneWidthExaggeration, s.junctionSize.getExaggeration(s, this, 10)); } glScaled(scale, scale, 1); @@ -409,42 +404,42 @@ for (std::vector::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) { LinkDirection dir = (*i)->getDirection(); LinkState state = (*i)->getState(); - if (state == LINKSTATE_DEADEND || dir == LINKDIR_NODIR) { + if (state == LINKSTATE_DEADEND || dir == LinkDirection::NODIR) { continue; } switch (dir) { - case LINKDIR_STRAIGHT: + case LinkDirection::STRAIGHT: GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); break; - case LINKDIR_TURN: + case LinkDirection::TURN: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05); GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05); GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (double) 1, (double) .25); break; - case LINKDIR_TURN_LEFTHAND: + case LinkDirection::TURN_LEFTHAND: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05); GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (double) 1, (double) .25); break; - case LINKDIR_LEFT: + case LinkDirection::LEFT: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05); GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (double) 1, (double) .25); break; - case LINKDIR_RIGHT: + case LinkDirection::RIGHT: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (double) 1, (double) .25); break; - case LINKDIR_PARTLEFT: + case LinkDirection::PARTLEFT: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05); GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (double) 1, (double) .25); break; - case LINKDIR_PARTRIGHT: + case LinkDirection::PARTRIGHT: GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05); GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (double) 1, (double) .25); @@ -499,7 +494,7 @@ } else { exaggeration *= s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); } - const bool hasRailSignal = myEdge->getToJunction()->getType() == NODETYPE_RAIL_SIGNAL; + const bool hasRailSignal = myEdge->getToJunction()->getType() == SumoXMLNodeType::RAIL_SIGNAL; const bool detailZoom = s.scale * exaggeration > 5; const bool drawDetails = (detailZoom || s.junctionSize.minSize == 0 || hasRailSignal) && !s.drawForRectangleSelection; const bool drawRails = drawAsRailway(s); @@ -531,7 +526,7 @@ // scale tls-controlled lane2lane-arrows along with their junction shapes double junctionExaggeration = 1; if (!isInternal - && myEdge->getToJunction()->getType() <= NODETYPE_RAIL_CROSSING + && myEdge->getToJunction()->getType() <= SumoXMLNodeType::RAIL_CROSSING && (s.junctionSize.constantSize || s.junctionSize.exaggeration > 1)) { junctionExaggeration = MAX2(1.001, s.junctionSize.getExaggeration(s, this, 4)); } @@ -559,7 +554,9 @@ const double width = myWidth; double halfGauge = 0.5 * (width == SUMO_const_laneWidth ? 1.4350 : width) * exaggeration; if (spreadSuperposed) { - shape.move2side(halfGauge * 0.8); + try { + shape.move2side(halfGauge * 0.8); + } catch (InvalidArgument&) {} halfGauge *= 0.4; } const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration; @@ -639,7 +636,7 @@ } if (!isInternal || isCrossing // controlled internal junction - || (getLinkCont()[0]->isInternalJunctionLink() && getLinkCont()[0]->getTLLogic() != nullptr)) { + || (getLinkCont().size() != 0 && getLinkCont()[0]->isInternalJunctionLink() && getLinkCont()[0]->getTLLogic() != nullptr)) { if (MSGlobals::gLateralResolution > 0 && s.showSublanes && !hiddenBidi && (myPermissions & ~(SVC_PEDESTRIAN | SVC_RAIL_CLASSES)) != 0) { // draw sublane-borders const double offsetSign = MSGlobals::gLefthand ? -1 : 1; @@ -858,7 +855,7 @@ // reachability menu FXMenuPane* reachableByClass = new FXMenuPane(ret); ret->insertMenuPaneChild(reachableByClass); - new FXMenuCascade(ret, "Select reachable", GUIIconSubSys::getIcon(ICON_FLAG), reachableByClass); + new FXMenuCascade(ret, "Select reachable", GUIIconSubSys::getIcon(GUIIcon::FLAG), reachableByClass); for (auto i : SumoVehicleClassStrings.getStrings()) { new FXMenuCommand(reachableByClass, i.c_str(), nullptr, &parent, MID_REACHABILITY); } @@ -1071,22 +1068,26 @@ return 2; case 0: // forbidden road or green verge - return myEdge->getPermissions() == 0 ? 9 : 3; + return myEdge->getPermissions() == 0 ? 10 : 3; case SVC_SHIP: return 4; case SVC_AUTHORITY: - return 7; + return 8; default: break; } if (myEdge->isTazConnector()) { - return 8; + return 9; } else if (isRailway(myPermissions)) { return 5; } else if ((myPermissions & SVC_PASSENGER) != 0) { - return 0; + if ((myPermissions & (SVC_RAIL_CLASSES & ~SVC_RAIL_FAST)) != 0 && (myPermissions & SVC_SHIP) == 0) { + return 6; + } else { + return 0; + } } else { - return 6; + return 7; } case 1: return isLaneOrEdgeSelected(); diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUILane.h sumo-1.6.0+dfsg1/src/guisim/GUILane.h --- sumo-1.5.0+dfsg1/src/guisim/GUILane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUILane.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Representation of a lane in the micro simulation (gui-version) /****************************************************************************/ -#ifndef GUILane_h -#define GUILane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -368,9 +362,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUILaneSpeedTrigger.cpp sumo-1.6.0+dfsg1/src/guisim/GUILaneSpeedTrigger.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUILaneSpeedTrigger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUILaneSpeedTrigger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,9 +19,6 @@ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -397,6 +394,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUILaneSpeedTrigger.h sumo-1.6.0+dfsg1/src/guisim/GUILaneSpeedTrigger.h --- sumo-1.5.0+dfsg1/src/guisim/GUILaneSpeedTrigger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUILaneSpeedTrigger.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Changes the speed allowed on a set of lanes (gui version) /****************************************************************************/ -#ifndef GUILaneSpeedTrigger_h -#define GUILaneSpeedTrigger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -203,9 +197,3 @@ mutable std::string myLastValueString; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUINet.cpp sumo-1.6.0+dfsg1/src/guisim/GUINet.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUINet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUINet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,9 +20,6 @@ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -276,8 +273,8 @@ } } // initialise calibrators - for (MSCalibrator* cali : MSCalibrator::getInstances()) { - GUICalibrator* wrapper = new GUICalibrator(cali); + for (auto& item : MSCalibrator::getInstances()) { + GUICalibrator* wrapper = new GUICalibrator(item.second); myCalibratorWrapper.push_back(wrapper); myGrid.addAdditionalGLObject(wrapper); } @@ -567,10 +564,10 @@ if (found) { return value; } else { - return -1; + return GUIVisualizationSettings::MISSING_DATA; } } else { - return -2; + return GUIVisualizationSettings::MISSING_DATA; } } @@ -580,6 +577,12 @@ if (element == SUMO_TAG_EDGE || element == SUMO_TAG_LANE) { std::vector tmp = attrs.getAttributeNames(); edgeAttrs.insert(tmp.begin(), tmp.end()); + } else if (element == SUMO_TAG_EDGEREL) { + for (const std::string& a : attrs.getAttributeNames()) { + if (a != "from" && a != "to") { + edgeAttrs.insert(a); + } + } } else if (element == SUMO_TAG_INTERVAL) { bool ok; lastIntervalEnd = MAX2(lastIntervalEnd, attrs.getSUMOTimeReporting(SUMO_ATTR_END, nullptr, ok)); @@ -603,6 +606,27 @@ } } +void +GUINet::EdgeFloatTimeLineRetriever_GUI::addEdgeRelWeight(const std::string& from, const std::string& to, + double val, double beg, double end) const { + MSEdge* fromEdge = MSEdge::dictionary(from); + MSEdge* toEdge = MSEdge::dictionary(to); + if (fromEdge != nullptr && toEdge != nullptr) { + for (auto item : fromEdge->getViaSuccessors()) { + if (item.first == toEdge) { + const MSEdge* edge = item.second; + while (edge != nullptr && edge->isInternal()) { + myWeightStorage->addEffort(edge, beg, end, val); + edge = edge->getViaSuccessors().front().second; + } + } + } + } else if (fromEdge == nullptr) { + WRITE_ERROR("Trying to set the effort for the unknown edge '" + from + "'."); + } else { + WRITE_ERROR("Trying to set the effort for the unknown edge '" + to + "'."); + } +} bool GUINet::loadEdgeData(const std::string& file) { @@ -661,5 +685,5 @@ } #endif -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUINet.h sumo-1.6.0+dfsg1/src/guisim/GUINet.h --- sumo-1.5.0+dfsg1/src/guisim/GUINet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUINet.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A MSNet extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUINet_h -#define GUINet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -424,6 +418,7 @@ * @see SAXWeightsHandler::EdgeFloatTimeLineRetriever::addEdgeWeight */ void addEdgeWeight(const std::string& id, double val, double beg, double end) const; + void addEdgeRelWeight(const std::string& from, const std::string& to, double val, double beg, double end) const; private: /// @brief The storage that edges shall be added to @@ -436,9 +431,3 @@ mutable FXMutex myLock; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIOverheadWire.cpp sumo-1.6.0+dfsg1/src/guisim/GUIOverheadWire.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIOverheadWire.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIOverheadWire.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The gui-version of a MSOverheadWire /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -408,4 +403,5 @@ drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIOverheadWire.h sumo-1.6.0+dfsg1/src/guisim/GUIOverheadWire.h --- sumo-1.5.0+dfsg1/src/guisim/GUIOverheadWire.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIOverheadWire.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The gui-version of a MSOverheadWire /****************************************************************************/ -#ifndef GUIOverheadWire_h -#define GUIOverheadWire_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -190,5 +184,4 @@ PositionVector myFGShape; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIParkingArea.cpp sumo-1.6.0+dfsg1/src/guisim/GUIParkingArea.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIParkingArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIParkingArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A area where vehicles can park next to the road (gui version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -226,5 +221,5 @@ return myName; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIParkingArea.h sumo-1.6.0+dfsg1/src/guisim/GUIParkingArea.h --- sumo-1.5.0+dfsg1/src/guisim/GUIParkingArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIParkingArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A area where vehicles can park next to the road (gui version) /****************************************************************************/ -#ifndef GUIParkingArea_h -#define GUIParkingArea_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -154,8 +148,3 @@ Boundary myBoundary; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIPerson.cpp sumo-1.6.0+dfsg1/src/guisim/GUIPerson.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIPerson.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIPerson.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A MSPerson extended by some values for usage within the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -169,7 +164,8 @@ GUIPerson::GUIPerson(const SUMOVehicleParameter* pars, MSVehicleType* vtype, MSTransportable::MSTransportablePlan* plan, const double speedFactor) : MSPerson(pars, vtype, plan, speedFactor), - GUIGlObject(GLO_PERSON, pars->id) + GUIGlObject(GLO_PERSON, pars->id), + myLock(true) { } @@ -213,7 +209,7 @@ // buildShowParamsPopupEntry(ret); buildShowTypeParamsPopupEntry(ret); - new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN); + new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(GUIIcon::APP_TABLE), ret, MID_SHOWPLAN); new FXMenuSeparator(ret); buildPositionCopyEntry(ret, false); return ret; @@ -321,7 +317,7 @@ setColor(s); MSPModel_Striping::PState* stripingState = dynamic_cast(stage->getState()); if (stripingState != nullptr) { - MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath; + const MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath; if (waPath != nullptr) { glPushMatrix(); glTranslated(0, 0, getType()); @@ -420,8 +416,8 @@ return true; } case 10: { // color randomly (by pointer) - const double hue = (long)this % 360; // [0-360] - const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1] + const double hue = (double)((long long int)this % 360); // [0-360] + const double sat = (((long long int)this / 360) % 67) / 100.0 + 0.33; // [0.33-1] GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); return true; } @@ -456,6 +452,9 @@ double GUIPerson::getEdgePos() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return -1; + } return MSPerson::getEdgePos(); } @@ -463,6 +462,9 @@ Position GUIPerson::getPosition() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return Position::INVALID; + } return MSPerson::getPosition(); } @@ -470,6 +472,9 @@ Position GUIPerson::getGUIPosition() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return Position::INVALID; + } if (getCurrentStageType() == MSStageType::DRIVING && !isWaiting4Vehicle() && myPositionInVehicle.pos != Position::INVALID) { return myPositionInVehicle.pos; } else { @@ -481,6 +486,9 @@ double GUIPerson::getGUIAngle() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return INVALID_DOUBLE; + } if (getCurrentStageType() == MSStageType::DRIVING && !isWaiting4Vehicle() && myPositionInVehicle.pos != Position::INVALID) { return myPositionInVehicle.angle; } else { @@ -492,6 +500,9 @@ double GUIPerson::getNaviDegree() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return INVALID_DOUBLE; + } return GeomHelper::naviDegree(MSPerson::getAngle()); } @@ -499,6 +510,9 @@ double GUIPerson::getWaitingSeconds() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return -1; + } return MSPerson::getWaitingSeconds(); } @@ -506,6 +520,9 @@ double GUIPerson::getSpeed() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return -1; + } return MSPerson::getSpeed(); } @@ -513,6 +530,9 @@ std::string GUIPerson::getStageIndexDescription() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return "arrived"; + } return toString(getNumStages() - getNumRemainingStages()) + " of " + toString(getNumStages() - 1); } @@ -520,6 +540,9 @@ std::string GUIPerson::getEdgeID() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return "arrived"; + } return getEdge()->getID(); } @@ -527,6 +550,9 @@ std::string GUIPerson::getFromEdgeID() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return "arrived"; + } return getFromEdge()->getID(); } @@ -534,6 +560,9 @@ std::string GUIPerson::getDestinationEdgeID() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return "arrived"; + } return getDestination()->getID(); } @@ -541,9 +570,18 @@ double GUIPerson::getStageArrivalPos() const { FXMutexLock locker(myLock); + if (hasArrived()) { + return INVALID_DOUBLE; + } return getCurrentStage()->getArrivalPos(); } +bool +GUIPerson::proceed(MSNet* net, SUMOTime time) { + FXMutexLock locker(myLock); + return MSTransportable::proceed(net, time); +} + // ------------------------------------------------------------------------- // GUIPerson - Additional Visualsation methods // ------------------------------------------------------------------------- @@ -575,5 +613,5 @@ return gSelected.isSelected(GLO_PERSON, getGlID()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIPerson.h sumo-1.6.0+dfsg1/src/guisim/GUIPerson.h --- sumo-1.5.0+dfsg1/src/guisim/GUIPerson.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIPerson.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUIPerson_h -#define GUIPerson_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -112,6 +106,10 @@ virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const; //* @} + /* @brief proceeds to the next step of the route, + * @return Whether the transportables plan continues */ + bool proceed(MSNet* net, SUMOTime time); + /* @brief set the position of a person while riding in a vehicle * @note This must be called by the vehicle before the call to drawGl */ void setPositionInVehicle(const GUIBaseVehicle::Seat& pos); @@ -269,9 +267,3 @@ /// @brief Enabled visualisations, per view std::map myAdditionalVisualizations; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.cpp sumo-1.6.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -41,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -106,8 +102,13 @@ assert(myObject->getType() == GLO_TLLOGIC); GUITrafficLightLogicWrapper* w = static_cast(myObject); MSActuatedTrafficLightLogic* act = dynamic_cast(&w->getTLLogic()); - assert(act != 0); - act->setShowDetectors(!act->showDetectors()); + if (act == nullptr) { + MSDelayBasedTrafficLightLogic* db = dynamic_cast(&w->getTLLogic()); + assert(db != 0); + db->setShowDetectors(!db->showDetectors()); + } else { + act->setShowDetectors(!act->showDetectors()); + } return 1; } @@ -158,18 +159,22 @@ for (i = logics.begin(); i != logics.end(); ++i, ++index) { if (!vars.isActive(*i)) { new FXMenuCommand(ret, ("Switch to '" + (*i)->getProgramID() + "'").c_str(), - GUIIconSubSys::getIcon(ICON_FLAG_MINUS), ret, (FXSelector)(MID_SWITCH + index)); + GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, (FXSelector)(MID_SWITCH + index)); } } new FXMenuSeparator(ret); } - new FXMenuCommand(ret, "Switch off", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), ret, MID_SWITCH_OFF); + new FXMenuCommand(ret, "Switch off", GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, MID_SWITCH_OFF); new FXMenuCommand(ret, "Track Phases", nullptr, ret, MID_TRACKPHASES); new FXMenuCommand(ret, "Show Phases", nullptr, ret, MID_SHOWPHASES); MSActuatedTrafficLightLogic* act = dynamic_cast(&myTLLogic); if (act != nullptr) { new FXMenuCommand(ret, act->showDetectors() ? "Hide Detectors" : "Show Detectors", nullptr, ret, MID_SHOW_DETECTORS); } + MSDelayBasedTrafficLightLogic* db = dynamic_cast(&myTLLogic); + if (db != nullptr) { + new FXMenuCommand(ret, db->showDetectors() ? "Hide Detectors" : "Show Detectors", nullptr, ret, MID_SHOW_DETECTORS); + } new FXMenuSeparator(ret); MSTrafficLightLogic* tll = getActiveTLLogic(); buildNameCopyPopupEntry(ret); @@ -213,6 +218,7 @@ GUISUMOAbstractView&) { GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); ret->mkItem("tlLogic [id]", false, myTLLogic.getID()); + ret->mkItem("type", false, toString(myTLLogic.getLogicType())); ret->mkItem("program", false, myTLLogic.getProgramID()); ret->mkItem("phase", true, new FunctionBinding(this, &GUITrafficLightLogicWrapper::getCurrentPhase)); ret->mkItem("phase name", true, new FunctionBindingString(this, &GUITrafficLightLogicWrapper::getCurrentPhaseName)); @@ -344,4 +350,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.h sumo-1.6.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.h --- sumo-1.5.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITrafficLightLogicWrapper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A wrapper for tl-logics to allow their visualisation and interaction /****************************************************************************/ -#ifndef GUITrafficLightLogicWrapper_h -#define GUITrafficLightLogicWrapper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -167,9 +161,3 @@ GUIMainWindow* myApp; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITransportableControl.cpp sumo-1.6.0+dfsg1/src/guisim/GUITransportableControl.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUITransportableControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITransportableControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // GUI-version of the person control for building gui persons /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITransportableControl.h sumo-1.6.0+dfsg1/src/guisim/GUITransportableControl.h --- sumo-1.5.0+dfsg1/src/guisim/GUITransportableControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITransportableControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // GUI-version of the transportable control for building gui persons and containers /****************************************************************************/ -#ifndef GUITransportableControl_h -#define GUITransportableControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,8 +64,3 @@ */ void insertPersonIDs(std::vector& into); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITriggeredRerouter.cpp sumo-1.6.0+dfsg1/src/guisim/GUITriggeredRerouter.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUITriggeredRerouter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITriggeredRerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Reroutes vehicles passing an edge (gui version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -556,4 +551,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUITriggeredRerouter.h sumo-1.6.0+dfsg1/src/guisim/GUITriggeredRerouter.h --- sumo-1.5.0+dfsg1/src/guisim/GUITriggeredRerouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUITriggeredRerouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Reroutes vehicles passing an edge (gui-version) /****************************************************************************/ -#ifndef GUITriggeredRerouter_h -#define GUITriggeredRerouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -299,9 +293,3 @@ int myShiftProbDistIndex; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIVehicleControl.cpp sumo-1.6.0+dfsg1/src/guisim/GUIVehicleControl.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIVehicleControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIVehicleControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -53,10 +48,8 @@ GUIVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, MSVehicleType* type, const bool ignoreStopErrors, const bool fromRouteFile) { - myLoadedVehNo++; MSVehicle* built = new GUIVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : nullptr)); - built->addStops(ignoreStopErrors); - MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); + initVehicle(built, ignoreStopErrors); return built; } @@ -114,6 +107,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIVehicleControl.h sumo-1.6.0+dfsg1/src/guisim/GUIVehicleControl.h --- sumo-1.5.0+dfsg1/src/guisim/GUIVehicleControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIVehicleControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The class responsible for building and deletion of vehicles (gui-version) /****************************************************************************/ -#ifndef GUIVehicleControl_h -#define GUIVehicleControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -137,9 +131,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIVehicle.cpp sumo-1.6.0+dfsg1/src/guisim/GUIVehicle.cpp --- sumo-1.5.0+dfsg1/src/guisim/GUIVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -138,6 +133,8 @@ new FunctionBinding(this, &GUIVehicle::getLastLaneChangeOffset)); ret->mkItem("desired depart [s]", false, time2string(getParameter().depart)); ret->mkItem("depart delay [s]", false, time2string(getDepartDelay())); + ret->mkItem("odometer [m]", true, + new FunctionBinding(this, &MSBaseVehicle::getOdometer)); if (getParameter().repetitionNumber < std::numeric_limits::max()) { ret->mkItem("remaining [#]", false, (int) getParameter().repetitionNumber - getParameter().repetitionsDone); } @@ -543,9 +540,6 @@ case 20: return getHarmonoise_NoiseEmissions(); case 21: - if (getNumberReroutes() == 0) { - return -1; - } return getNumberReroutes(); case 22: return gSelected.isSelected(GLO_VEHICLE, getGlID()); @@ -562,6 +556,8 @@ case 28: return getTimeLossSeconds(); case 29: + return getStopDelay(); + case 30: return getLaneChangeModel().getSpeedLat(); case 31: // by numerical param value try { @@ -615,13 +611,18 @@ void -GUIVehicle::drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, const RGBColor& col) const { +GUIVehicle::drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, bool noLoop, const RGBColor& col) const { const double exaggeration = s.vehicleSize.getExaggeration(s, this) * (s.gaming ? 0.5 : 1); - MSRouteIterator i = future ? myCurrEdge : r.begin(); + MSRouteIterator start = future ? myCurrEdge : r.begin(); + MSRouteIterator i = start; const std::vector& bestLaneConts = getBestLanesContinuation(); // draw continuation lanes when drawing the current route where available int bestLaneIndex = (&r == myRoute ? 0 : (int)bestLaneConts.size()); std::map repeatLane; // count repeated occurrences of the same edge + const double textSize = s.vehicleName.size / s.scale; + const GUILane* prevLane = nullptr; + int reversalIndex = 0; + const int indexDigits = (int)toString(r.size()).size(); for (; i != r.end(); ++i) { const GUILane* lane; if (bestLaneIndex < (int)bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) { @@ -635,15 +636,26 @@ lane = static_cast((*i)->getLanes()[0]); } } + GLHelper::setColor(col); GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration); + if (prevLane != nullptr && lane->getBidiLane() == prevLane) { + // indicate train reversal + std::string label = "reverse:" + toString(reversalIndex++); + Position pos = lane->geometryPositionAtOffset(lane->getLength() / 2) - Position(0, textSize * repeatLane[lane]); + GLHelper::drawTextSettings(s.vehicleValue, label, pos, s.scale, s.angle, 1.0); + } if (s.showRouteIndex) { std::string label = toString((int)(i - myCurrEdge)); - const double textSize = s.vehicleName.size / s.scale; - Position pos = lane->getShape().front() - Position(0, textSize * repeatLane[lane]); + const double laneAngle = lane->getShape().angleAt2D(0); + Position pos = lane->getShape().front() - Position(0, textSize * repeatLane[lane]) + Position( + (laneAngle >= -0.25 * M_PI && laneAngle < 0.75 * M_PI ? 1 : -1) * 0.4 * indexDigits * textSize, 0); //GLHelper::drawText(label, pos, 1.0, textSize, s.vehicleName.color); GLHelper::drawTextSettings(s.vehicleName, label, pos, s.scale, s.angle, 1.0); - repeatLane[lane]++; - GLHelper::setColor(col); + } + repeatLane[lane]++; + prevLane = lane; + if (noLoop && i != start && (*i) == (*start)) { + break; } } // draw stop labels @@ -655,9 +667,10 @@ if (stop.pars.speed > 0) { stopLanePos = stop.reached ? stop.pars.endPos : stop.pars.startPos; } else { - stopLanePos = stop.reached ? getPositionOnLane() : stop.getEndPos(*this); + stopLanePos = stop.reached ? getPositionOnLane() : MAX2(0.0, stop.getEndPos(*this)); } Position pos = stop.lane->geometryPositionAtOffset(stopLanePos); + GLHelper::setColor(col); GLHelper::drawBoxLines(stop.lane->getShape().getOrthogonal(pos, 10, true, stop.lane->getWidth()), 0.1); std::string label = stop.reached ? "stopped" : "stop " + toString(stopIndex); #ifdef _DEBUG @@ -694,9 +707,13 @@ label += " duration:" + time2string(stop.duration); } } - std::pair stopPos = std::make_pair(stop.lane, stop.getEndPos(*this)); + std::pair stopPos = std::make_pair(stop.lane, stopLanePos); const double textSize = s.vehicleName.size / s.scale; - GLHelper::drawText(label, pos - Position(0, textSize * repeat[stopPos]), 1.0, textSize, s.vehicleName.color, s.angle); + Position pos2 = pos - Position(0, textSize * repeat[stopPos]); + if (noLoop && repeat[stopPos] > 0) { + break; + } + GLHelper::drawTextSettings(s.vehicleText, label, pos2, s.scale, s.angle, 1.0); repeat[stopPos]++; stopIndex++; } @@ -1009,7 +1026,7 @@ } const bool hasReroutingDevice = getDevice(typeid(MSDevice_Routing)) != nullptr; SUMOAbstractRouter& router = hasReroutingDevice - ? MSRoutingEngine::getRouterTT(getRNGIndex()) + ? MSRoutingEngine::getRouterTT(getRNGIndex(), getVClass()) : MSNet::getInstance()->getRouterTT(getRNGIndex()); // reroute to ensure the new stop is reached reroute(MSNet::getInstance()->getCurrentTimeStep(), "DRT", router); diff -Nru sumo-1.5.0+dfsg1/src/guisim/GUIVehicle.h sumo-1.6.0+dfsg1/src/guisim/GUIVehicle.h --- sumo-1.5.0+dfsg1/src/guisim/GUIVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim/GUIVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUIVehicle_h -#define GUIVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -89,7 +83,7 @@ /** @brief Draws the route * @param[in] r The route to draw */ - void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, const RGBColor& col) const; + void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, bool noLoop, const RGBColor& col) const; void drawAction_drawVehicleBlinker(double length) const; void drawAction_drawVehicleBrakeLight(double length, bool onlyOne = false) const; @@ -183,9 +177,3 @@ std::string getStopInfo() const; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/guisim_main.cpp sumo-1.6.0+dfsg1/src/guisim_main.cpp --- sumo-1.5.0+dfsg1/src/guisim_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/guisim_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Main for GUISIM /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/jtrrouter_main.cpp sumo-1.6.0+dfsg1/src/jtrrouter/jtrrouter_main.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/jtrrouter_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/jtrrouter_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Main for JTRROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -162,7 +157,7 @@ oc.getBool("discount-sources")); RORouteDef::setUsingJTRR(); RORouterProvider provider(router, new PedestrianRouter(), - new ROIntermodalRouter(RONet::adaptIntermodalRouter, 0, "dijkstra")); + new ROIntermodalRouter(RONet::adaptIntermodalRouter, 0, "dijkstra"), nullptr); loader.processRoutes(string2time(oc.getString("begin")), string2time(oc.getString("end")), string2time(oc.getString("route-steps")), net, provider); net.cleanup(); diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.cpp sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The builder for jtrrouter-edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "ROJTREdgeBuilder.h" @@ -46,4 +41,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.h sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.h --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdgeBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Interface for building instances of jtrrouter-edges /****************************************************************************/ -#ifndef ROJTREdgeBuilder_h -#define ROJTREdgeBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -78,9 +72,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdge.cpp sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdge.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // An edge the jtr-router may route through /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -130,6 +125,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdge.h sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdge.h --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTREdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTREdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An edge the jtr-router may route through /****************************************************************************/ -#ifndef ROJTREdge_h -#define ROJTREdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -138,9 +132,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRFrame.cpp sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRFrame.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for jtr-routing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRFrame.h sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRFrame.h --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for jtr-routing /****************************************************************************/ -#ifndef ROJTRFrame_h -#define ROJTRFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -54,9 +48,3 @@ static bool checkOptions(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRRouter.cpp sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRRouter.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRRouter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRRouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Computes routes using junction turning percentages /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -95,4 +90,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRRouter.h sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRRouter.h --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Computes routes using junction turning percentages /****************************************************************************/ -#ifndef ROJTRRouter_h -#define ROJTRRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -113,9 +107,3 @@ /// @brief Whether upstream flows shall be discounted from source flows const bool myDiscountSources; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.cpp sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.cpp --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,7 +45,8 @@ myIntervalBegin(0), myIntervalEnd(STEPS2TIME(SUMOTime_MAX)), myEdge(nullptr), mySourcesAreSinks(OptionsCont::getOptions().getBool("sources-are-sinks")), - myDiscountSources(OptionsCont::getOptions().getBool("discount-sources")) + myDiscountSources(OptionsCont::getOptions().getBool("discount-sources")), + myHaveWarnedAboutDeprecatedFormat(false) {} @@ -67,11 +63,19 @@ myIntervalEnd = attrs.get(SUMO_ATTR_END, nullptr, ok); break; case SUMO_TAG_FROMEDGE: + if (!myHaveWarnedAboutDeprecatedFormat) { + myHaveWarnedAboutDeprecatedFormat = true; + WRITE_WARNING("The turn-file format with elements " + toString(SUMO_TAG_FROMEDGE) + ", " + toString(SUMO_TAG_TOEDGE) + " is deprecated," + + " please use " + toString(SUMO_TAG_EDGEREL) + " instead."); + } beginFromEdge(attrs); break; case SUMO_TAG_TOEDGE: addToEdge(attrs); break; + case SUMO_TAG_EDGEREL: + addEdgeRel(attrs); + break; case SUMO_TAG_SINK: if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { std::string edges = attrs.get(SUMO_ATTR_EDGES, nullptr, ok); @@ -179,6 +183,35 @@ } +void +ROJTRTurnDefLoader::addEdgeRel(const SUMOSAXAttributes& attrs) { + bool ok = true; + // get the id, report an error if not given or empty... + std::string fromID = attrs.get(SUMO_ATTR_FROM, nullptr, ok); + std::string toID = attrs.get(SUMO_ATTR_TO, nullptr, ok); + double probability = attrs.get( + attrs.hasAttribute(SUMO_ATTR_COUNT) && !attrs.hasAttribute(SUMO_ATTR_PROB) ? SUMO_ATTR_COUNT : SUMO_ATTR_PROB, + (fromID + "->" + toID).c_str(), ok); + if (!ok) { + return; + } + // + ROJTREdge* from = static_cast(myNet.getEdge(fromID)); + if (from == nullptr) { + WRITE_ERROR("The edge '" + fromID + "' is not known."); + return; + } + ROJTREdge* to = static_cast(myNet.getEdge(toID)); + if (to == nullptr) { + WRITE_ERROR("The edge '" + toID + "' is not known."); + return; + } + if (probability < 0) { + WRITE_ERROR("'probability' must be positive (in edgeRelation from '" + fromID + "' to '" + toID + "'."); + } else { + from->addFollowerProbability(to, myIntervalBegin, myIntervalEnd, probability); + } +} -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.h sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.h --- sumo-1.5.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/jtrrouter/ROJTRTurnDefLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Loader for the of turning percentages and source/sink definitions /****************************************************************************/ -#ifndef ROJTRTurnDefLoader_h -#define ROJTRTurnDefLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -112,6 +106,10 @@ */ void addToEdge(const SUMOSAXAttributes& attrs); + /** @brief Parses the probability to use a certain incoming-outgoing edge relation + * @param[in] attrs The SAX-attributes to parse the destination edge and the probability to use it from + */ + void addEdgeRel(const SUMOSAXAttributes& attrs); private: /// @brief The network to set the information into @@ -128,10 +126,8 @@ /// @brief whether upstream flows should be discounted from source flows bool myDiscountSources; -}; - -#endif - -/****************************************************************************/ + /// @brief whether the warning for the deprecated format has been issued + bool myHaveWarnedAboutDeprecatedFormat; +}; diff -Nru sumo-1.5.0+dfsg1/src/libsumo/BusStop.cpp sumo-1.6.0+dfsg1/src/libsumo/BusStop.cpp --- sumo-1.5.0+dfsg1/src/libsumo/BusStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/BusStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 BusStop.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "BusStop.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults BusStop::mySubscriptionResults; +ContextSubscriptionResults BusStop::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +BusStop::getIDList() { + std::vector ids; + for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + ids.push_back(item.first); + } + std::sort(ids.begin(), ids.end()); + return ids; +} + +int +BusStop::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +BusStop::getLaneID(const std::string& stopID) { + return getBusStop(stopID)->getLane().getID(); +} + + +std::string +BusStop::getParameter(const std::string& stopID, const std::string& param) { + const MSStoppingPlace* s = getBusStop(stopID); + return s->getParameter(param, ""); +} + +void +BusStop::setParameter(const std::string& stopID, const std::string& key, const std::string& value) { + MSStoppingPlace* s = getBusStop(stopID); + s->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(BusStop, BUSSTOP) + + +MSStoppingPlace* +BusStop::getBusStop(const std::string& id) { + MSStoppingPlace* s = MSNet::getInstance()->getStoppingPlace(id, SUMO_TAG_BUS_STOP); + if (s == nullptr) { + throw TraCIException("BusStop '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +BusStop::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +BusStop::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + case VAR_LANE_ID: + return wrapper->wrapString(objID, variable, getLaneID(objID)); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/BusStop.h sumo-1.6.0+dfsg1/src/libsumo/BusStop.h --- sumo-1.5.0+dfsg1/src/libsumo/BusStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/BusStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,72 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 BusStop.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSBusStop; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class BusStop + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class BusStop { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getLaneID(const std::string& stopID); + static std::string getParameter(const std::string& stopID, const std::string& param); + + static void setParameter(const std::string& stopID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSStoppingPlace* getBusStop(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + BusStop() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Calibrator.cpp sumo-1.6.0+dfsg1/src/libsumo/Calibrator.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Calibrator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Calibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,242 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 Calibrator.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "Helper.h" +#include "Calibrator.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults Calibrator::mySubscriptionResults; +ContextSubscriptionResults Calibrator::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +Calibrator::getIDList() { + std::vector ids; + for (auto& item : MSCalibrator::getInstances()) { + ids.push_back(item.first); + } + std::sort(ids.begin(), ids.end()); + return ids; +} + +int +Calibrator::getIDCount() { + return (int)getIDList().size(); +} + +std::string +Calibrator::getEdgeID(const std::string& calibratorID) { + return getCalibrator(calibratorID)->getEdge()->getID(); +} + +std::string +Calibrator::getLaneID(const std::string& calibratorID) { + const MSLane* lane = getCalibrator(calibratorID)->getLane(); + if (lane == nullptr) { + return ""; + } else { + return lane->getID(); + } +} + +double +Calibrator::getVehsPerHour(const std::string& calibratorID) { + return getCalibratorState(getCalibrator(calibratorID)).q; +} + +double +Calibrator::getSpeed(const std::string& calibratorID) { + return getCalibratorState(getCalibrator(calibratorID)).v; +} + +std::string +Calibrator::getTypeID(const std::string& calibratorID) { + return getCalibratorState(getCalibrator(calibratorID)).vehicleParameter->vtypeid; +} + +double +Calibrator::getBegin(const std::string& calibratorID) { + return STEPS2TIME(getCalibratorState(getCalibrator(calibratorID)).begin); +} + +double +Calibrator::getEnd(const std::string& calibratorID) { + return STEPS2TIME(getCalibratorState(getCalibrator(calibratorID)).end); +} + +std::string +Calibrator::getRouteID(const std::string& calibratorID) { + return getCalibratorState(getCalibrator(calibratorID)).vehicleParameter->routeid; +} + +std::string +Calibrator::getRouteProbeID(const std::string& calibratorID) { + const MSRouteProbe* rp = getCalibrator(calibratorID)->getRouteProbe(); + if (rp == nullptr) { + return ""; + } else { + return rp->getID(); + } +} + +std::vector +Calibrator::getVTypes(const std::string& calibratorID) { + std::vector result; + const std::set& vTypes = getCalibrator(calibratorID)->getVehicleTypes(); + result.insert(result.begin(), vTypes.begin(), vTypes.end()); + std::sort(result.begin(), result.end()); + return result; +} + + +int +Calibrator::getPassed(const std::string& calibratorID) { + return getCalibrator(calibratorID)->passed(); +} + +int +Calibrator::getInserted(const std::string& calibratorID) { + return getCalibrator(calibratorID)->getInserted(); +} + +int +Calibrator::getRemoved(const std::string& calibratorID) { + return getCalibrator(calibratorID)->getRemoved(); +} + +std::string +Calibrator::getParameter(const std::string& calibratorID, const std::string& param) { + const MSCalibrator* c = getCalibrator(calibratorID); + return c->getParameter(param, ""); +} + +void +Calibrator::setParameter(const std::string& calibratorID, const std::string& key, const std::string& value) { + MSCalibrator* c = getCalibrator(calibratorID); + c->setParameter(key, value); +} + +void +Calibrator::setFlow(const std::string& calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string& typeID, + const std::string& routeID, + const std::string& departLane, + const std::string& departSpeed) { + std::string error; + SUMOVehicleParameter vehicleParams; + vehicleParams.vtypeid = typeID; + vehicleParams.routeid = routeID; + MSVehicleType* t = MSNet::getInstance()->getVehicleControl().getVType(typeID); + if (t == nullptr) { + throw TraCIException("Vehicle type '" + typeID + "' is not known"); + } + if (!SUMOVehicleParameter::parseDepartLane(departLane, "calibrator", calibratorID, vehicleParams.departLane, vehicleParams.departLaneProcedure, error)) { + throw TraCIException(error); + } + if (!SUMOVehicleParameter::parseDepartSpeed(departSpeed, "calibrator", calibratorID, vehicleParams.departSpeed, vehicleParams.departSpeedProcedure, error)) { + throw TraCIException(error); + } + getCalibrator(calibratorID)->setFlow(TIME2STEPS(begin), TIME2STEPS(end), vehsPerHour, speed, vehicleParams); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(Calibrator, CALIBRATOR) + + +MSCalibrator* +Calibrator::getCalibrator(const std::string& id) { + const auto& dict = MSCalibrator::getInstances(); + auto it = dict.find(id); + if (it == dict.end()) { + throw TraCIException("Calibrator '" + id + "' is not known"); + } + return it->second; +} + +MSCalibrator::AspiredState +Calibrator::getCalibratorState(const MSCalibrator* c) { + try { + return c->getCurrentStateInterval(); + } catch (ProcessError& e) { + throw TraCIException(e.what()); + } +} + +std::shared_ptr +Calibrator::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +Calibrator::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + case VAR_ROAD_ID: + return wrapper->wrapString(objID, variable, getEdgeID(objID)); + case VAR_LANE_ID: + return wrapper->wrapString(objID, variable, getLaneID(objID)); + case VAR_VEHSPERHOUR: + return wrapper->wrapDouble(objID, variable, getVehsPerHour(objID)); + case VAR_SPEED: + return wrapper->wrapDouble(objID, variable, getSpeed(objID)); + case VAR_TYPE: + return wrapper->wrapString(objID, variable, getTypeID(objID)); + case VAR_BEGIN: + return wrapper->wrapDouble(objID, variable, getBegin(objID)); + case VAR_END: + return wrapper->wrapDouble(objID, variable, getEnd(objID)); + case VAR_ROUTE_ID: + return wrapper->wrapString(objID, variable, getRouteID(objID)); + case VAR_ROUTE_PROBE: + return wrapper->wrapString(objID, variable, getRouteProbeID(objID)); + case VAR_VTYPES: + return wrapper->wrapStringList(objID, variable, getVTypes(objID)); + case VAR_PASSED: + return wrapper->wrapInt(objID, variable, getPassed(objID)); + case VAR_INSERTED: + return wrapper->wrapInt(objID, variable, getInserted(objID)); + case VAR_REMOVED: + return wrapper->wrapInt(objID, variable, getRemoved(objID)); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Calibrator.h sumo-1.6.0+dfsg1/src/libsumo/Calibrator.h --- sumo-1.5.0+dfsg1/src/libsumo/Calibrator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Calibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,90 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 Calibrator.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSCalibrator; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class Calibrator + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class Calibrator { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getEdgeID(const std::string& calibratorID); + static std::string getLaneID(const std::string& calibratorID); + static double getVehsPerHour(const std::string& calibratorID); + static double getSpeed(const std::string& calibratorID); + static std::string getTypeID(const std::string& calibratorID); + static double getBegin(const std::string& calibratorID); + static double getEnd(const std::string& calibratorID); + static std::string getRouteID(const std::string& calibratorID); + static std::string getRouteProbeID(const std::string& calibratorID); + static std::vector getVTypes(const std::string& routeID); + static int getPassed(const std::string& calibratorID); + static int getInserted(const std::string& calibratorID); + static int getRemoved(const std::string& calibratorID); + static std::string getParameter(const std::string& calibratorID, const std::string& param); + + static void setFlow(const std::string& calibratorID, double begin, double end, double vehsPerHour, double speed, const std::string& typeID, + const std::string& routeID, + const std::string& departLane = "first", + const std::string& departSpeed = "max"); + + static void setParameter(const std::string& calibratorID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSCalibrator* getCalibrator(const std::string& id); + static MSCalibrator::AspiredState getCalibratorState(const MSCalibrator* c); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + Calibrator() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/ChargingStation.cpp sumo-1.6.0+dfsg1/src/libsumo/ChargingStation.cpp --- sumo-1.5.0+dfsg1/src/libsumo/ChargingStation.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/ChargingStation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 ChargingStation.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "ChargingStation.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults ChargingStation::mySubscriptionResults; +ContextSubscriptionResults ChargingStation::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +ChargingStation::getIDList() { + std::vector ids; + for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + ids.push_back(item.first); + } + std::sort(ids.begin(), ids.end()); + return ids; +} + +int +ChargingStation::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +ChargingStation::getLaneID(const std::string& stopID) { + return getChargingStation(stopID)->getLane().getID(); +} + + +std::string +ChargingStation::getParameter(const std::string& stopID, const std::string& param) { + const MSStoppingPlace* s = getChargingStation(stopID); + return s->getParameter(param, ""); +} + +void +ChargingStation::setParameter(const std::string& stopID, const std::string& key, const std::string& value) { + MSStoppingPlace* s = getChargingStation(stopID); + s->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(ChargingStation, CHARGINGSTATION) + + +MSStoppingPlace* +ChargingStation::getChargingStation(const std::string& id) { + MSStoppingPlace* s = MSNet::getInstance()->getStoppingPlace(id, SUMO_TAG_BUS_STOP); + if (s == nullptr) { + throw TraCIException("ChargingStation '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +ChargingStation::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +ChargingStation::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + case VAR_LANE_ID: + return wrapper->wrapString(objID, variable, getLaneID(objID)); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/ChargingStation.h sumo-1.6.0+dfsg1/src/libsumo/ChargingStation.h --- sumo-1.5.0+dfsg1/src/libsumo/ChargingStation.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/ChargingStation.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,72 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 ChargingStation.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSChargingStation; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ChargingStation + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class ChargingStation { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getLaneID(const std::string& stopID); + static std::string getParameter(const std::string& stopID, const std::string& param); + + static void setParameter(const std::string& stopID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSStoppingPlace* getChargingStation(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + ChargingStation() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/CMakeLists.txt sumo-1.6.0+dfsg1/src/libsumo/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/libsumo/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -29,6 +29,24 @@ Polygon.cpp Route.h Route.cpp + Calibrator.h + Calibrator.cpp + BusStop.h + BusStop.cpp + ParkingArea.h + ParkingArea.cpp + ChargingStation.h + ChargingStation.cpp + RouteProbe.h + RouteProbe.cpp + Rerouter.h + Rerouter.cpp + VariableSpeedSign.h + VariableSpeedSign.cpp + MeanData.h + MeanData.cpp + OverheadWire.h + OverheadWire.cpp Simulation.cpp Simulation.h Subscription.h diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Edge.cpp sumo-1.6.0+dfsg1/src/libsumo/Edge.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Edge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Edge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -95,11 +95,7 @@ double Edge::getWaitingTime(const std::string& id) { - double wtime = 0; - for (MSLane* lane : getEdge(id)->getLanes()) { - wtime += lane->getWaitingSeconds(); - } - return wtime; + return getEdge(id)->getWaitingSeconds(); } @@ -118,12 +114,8 @@ const std::vector Edge::getLastStepVehicleIDs(const std::string& id) { std::vector vehIDs; - for (MSLane* lane : getEdge(id)->getLanes()) { - const MSLane::VehCont& vehs = lane->getVehiclesSecure(); - for (auto veh : vehs) { - vehIDs.push_back(veh->getID()); - } - lane->releaseVehicles(); + for (const SUMOVehicle* veh : getEdge(id)->getVehicles()) { + vehIDs.push_back(veh->getID()); } return vehIDs; } @@ -214,11 +206,7 @@ int Edge::getLastStepVehicleNumber(const std::string& id) { - int sum = 0; - for (MSLane* lane : getEdge(id)->getLanes()) { - sum += lane->getVehicleNumber(); - } - return sum; + return getEdge(id)->getVehicleNumber(); } @@ -230,47 +218,34 @@ double Edge::getLastStepOccupancy(const std::string& id) { - double sum = 0; - const std::vector& lanes = getEdge(id)->getLanes(); - for (auto lane : lanes) { - sum += lane->getNettoOccupancy(); - } - return sum / (double)lanes.size(); + return getEdge(id)->getOccupancy(); } int Edge::getLastStepHaltingNumber(const std::string& id) { - int halting = 0; - for (MSLane* lane : getEdge(id)->getLanes()) { - const MSLane::VehCont& vehs = lane->getVehiclesSecure(); - for (auto veh : vehs) { - if (veh->getSpeed() < SUMO_const_haltingSpeed) { - ++halting; - } + int result = 0; + for (const SUMOVehicle* veh : getEdge(id)->getVehicles()) { + if (veh->getSpeed() < SUMO_const_haltingSpeed) { + result++; } - lane->releaseVehicles(); } - return halting; + return result; } double Edge::getLastStepLength(const std::string& id) { double lengthSum = 0; - int noVehicles = 0; - for (MSLane* lane : getEdge(id)->getLanes()) { - const MSLane::VehCont& vehs = lane->getVehiclesSecure(); - for (auto veh : vehs) { - lengthSum += veh->getVehicleType().getLength(); - } - noVehicles += (int)vehs.size(); - lane->releaseVehicles(); + int numVehicles = 0; + for (const SUMOVehicle* veh : getEdge(id)->getVehicles()) { + numVehicles++; + lengthSum += dynamic_cast(veh)->getVehicleType().getLength(); } - if (noVehicles == 0) { + if (numVehicles == 0) { return 0; } - return lengthSum / (double)noVehicles; + return lengthSum / numVehicles; } diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Edge.h sumo-1.6.0+dfsg1/src/libsumo/Edge.h --- sumo-1.5.0+dfsg1/src/libsumo/Edge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Edge.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ // C++ TraCI client API implementation /****************************************************************************/ -#ifndef SUMO_Edge_H -#define SUMO_Edge_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -112,8 +107,3 @@ }; } - - -#endif //SUMO_Edge_H - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Helper.cpp sumo-1.6.0+dfsg1/src/libsumo/Helper.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Helper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Helper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -62,15 +58,18 @@ //#define DEBUG_MOVEXY_ANGLE //#define DEBUG_SURROUNDING - void LaneStoringVisitor::add(const MSLane* const l) const { switch (myDomain) { case libsumo::CMD_GET_VEHICLE_VARIABLE: { - const MSLane::VehCont& vehs = l->getVehiclesSecure(); - for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) { - if (myShape.distance2D((*j)->getPosition()) <= myRange) { - myObjects.insert(*j); + for (const MSVehicle* veh : l->getVehiclesSecure()) { + if (myShape.distance2D(veh->getPosition()) <= myRange) { + myObjects.insert(veh); + } + } + for (const MSVehicle* veh : l->getParkingVehicles()) { + if (myShape.distance2D(veh->getPosition()) <= myRange) { + myObjects.insert(veh); } } l->releaseVehicles(); @@ -122,6 +121,19 @@ // =========================================================================== // static member definitions // =========================================================================== + +void +Helper::debugPrint(const SUMOTrafficObject* veh) { + if (veh != nullptr) { + if (veh->isVehicle()) { + std::cout << " '" << veh->getID() << "' on lane '" << ((SUMOVehicle*)veh)->getLane()->getID() << "'\n"; + } else { + std::cout << " '" << veh->getID() << "' on edge '" << veh->getEdge()->getID() << "'\n"; + } + } +} + + void Helper::subscribe(const int commandId, const std::string& id, const std::vector& variables, const double beginTime, const double endTime, const int contextDomain, const double range) { @@ -146,7 +158,8 @@ handleSingleSubscription(s); libsumo::Subscription* modifiedSubscription = nullptr; needNewSubscription(s, mySubscriptions, modifiedSubscription); - if (modifiedSubscription->isVehicleToVehicleContextSubscription()) { + if (modifiedSubscription->isVehicleToVehicleContextSubscription() + || modifiedSubscription->isVehicleToPersonContextSubscription()) { // Set last modified vehicle context subscription active for filter modifications myLastContextSubscription = modifiedSubscription; } @@ -459,20 +472,41 @@ } -MSVehicle* +MSBaseVehicle* Helper::getVehicle(const std::string& id) { SUMOVehicle* sumoVehicle = MSNet::getInstance()->getVehicleControl().getVehicle(id); if (sumoVehicle == nullptr) { throw TraCIException("Vehicle '" + id + "' is not known."); } - MSVehicle* v = dynamic_cast(sumoVehicle); + MSBaseVehicle* v = dynamic_cast(sumoVehicle); if (v == nullptr) { - throw TraCIException("Vehicle '" + id + "' is not a micro-simulation vehicle."); + throw TraCIException("Vehicle '" + id + "' is not a proper vehicle."); } return v; } +MSPerson* +Helper::getPerson(const std::string& personID) { + MSTransportableControl& c = MSNet::getInstance()->getPersonControl(); + MSPerson* p = dynamic_cast(c.get(personID)); + if (p == nullptr) { + throw TraCIException("Person '" + personID + "' is not known"); + } + return p; +} + +SUMOTrafficObject* +Helper::getTrafficObject(int domain, const std::string& id) { + if (domain == CMD_GET_VEHICLE_VARIABLE) { + return getVehicle(id); + } else if (domain == CMD_GET_PERSON_VARIABLE) { + return getPerson(id); + } else { + throw TraCIException("Cannot retrieve traffic object for domain " + toString(domain)); + } +} + const MSVehicleType& Helper::getVehicleType(const std::string& vehicleID) { return getVehicle(vehicleID)->getVehicleType(); @@ -615,7 +649,7 @@ void Helper::applySubscriptionFilters(const Subscription& s, std::set& objIDs) { #ifdef DEBUG_SURROUNDING - MSVehicle* _veh = getVehicle(s.id); + MSBaseVehicle* _veh = getVehicle(s.id); std::cout << SIMTIME << " applySubscriptionFilters for vehicle '" << _veh->getID() << "' on lane '" << _veh->getLane()->getID() << "'" << "\n on edge '" << _veh->getLane()->getEdge().getID() << "' (" << toString(_veh->getLane()->getEdge().getLanes()) << ")\n" << "objIDs = " << toString(objIDs) << std::endl; @@ -640,7 +674,7 @@ // TODO: Treat case, where ego vehicle is currently on opposite lane - std::set vehs; + std::set vehs; if (s.activeFilters & SUBS_FILTER_NO_RTREE) { // Set defaults for upstream/downstream/lateral distances double downstreamDist = s.range, upstreamDist = s.range, lateralDist = s.range; @@ -656,7 +690,10 @@ // Specifies maximal lateral distance for vehicles in context subscription result lateralDist = s.filterLateralDist; } - MSVehicle* v = getVehicle(s.id); + MSVehicle* v = dynamic_cast(getVehicle(s.id)); + if (v == nullptr) { + throw TraCIException("Subscription filter not yet implemented for meso vehicle"); + } if (!v->isOnRoad()) { return; } @@ -767,9 +804,7 @@ #ifdef DEBUG_SURROUNDING std::cout << SIMTIME << " applySubscriptionFilters() for veh '" << v->getID() << "'. Found the following vehicles:\n"; for (auto veh : vehs) { - if (veh != nullptr) { - std::cout << " '" << veh->getID() << "' on lane '" << veh->getLane()->getID() << "'\n"; - } + debugPrint(veh); } #endif } else if (s.activeFilters & SUBS_FILTER_LATERAL_DIST) { @@ -792,12 +827,13 @@ #ifdef DEBUG_SURROUNDING std::cout << "FILTER_LATERAL_DIST: myLane is '" << v->getLane()->getID() << "'" << std::endl; #endif - // 1st pass: downstream - applySubscriptionFilterLateralDistanceSinglePass(objIDs, vehs, v->getUpcomingLanesUntil(downstreamDist), lateralDist, - downstreamDist, v->getPositionOnLane(), true); + // 1st pass: downstream (make sure that the whole length of the vehicle is included in the match) + const double backPosOnLane = MAX2(0.0, v->getPositionOnLane() - v->getVehicleType().getLength()); + applySubscriptionFilterLateralDistanceSinglePass(s, objIDs, vehs, v->getUpcomingLanesUntil(downstreamDist), + backPosOnLane, v->getLateralPositionOnLane(), true); // 2nd pass: upstream - applySubscriptionFilterLateralDistanceSinglePass(objIDs, vehs, v->getPastLanesUntil(upstreamDist), lateralDist, - upstreamDist, v->getPositionOnLane(), false); + applySubscriptionFilterLateralDistanceSinglePass(s, objIDs, vehs, v->getPastLanesUntil(upstreamDist), + v->getPositionOnLane(), v->getLateralPositionOnLane(), false); objIDs.clear(); } else { @@ -883,9 +919,7 @@ #ifdef DEBUG_SURROUNDING std::cout << SIMTIME << " applySubscriptionFilters() for veh '" << v->getID() << "'. Found the following vehicles:\n"; for (auto veh : vehs) { - if (veh != nullptr) { - std::cout << " '" << veh->getID() << "' on lane '" << veh->getLane()->getID() << "'\n"; - } + debugPrint(veh); } #endif } @@ -915,7 +949,7 @@ } } // Write vehs IDs in objIDs - for (const MSVehicle* veh : vehs) { + for (const SUMOTrafficObject* veh : vehs) { if (veh != nullptr) { objIDs.insert(objIDs.end(), veh->getID()); } @@ -925,7 +959,7 @@ // Only return vehicles of the given vClass in context subscription result auto i = objIDs.begin(); while (i != objIDs.end()) { - MSVehicle* veh = getVehicle(*i); + MSBaseVehicle* veh = getVehicle(*i); if ((veh->getVehicleType().getVehicleClass() & s.filterVClasses) == 0) { i = objIDs.erase(i); } else { @@ -937,7 +971,7 @@ // Only return vehicles of the given vType in context subscription result auto i = objIDs.begin(); while (i != objIDs.end()) { - MSVehicle* veh = getVehicle(*i); + MSBaseVehicle* veh = getVehicle(*i); if (s.filterVTypes.find(veh->getVehicleType().getID()) == s.filterVTypes.end()) { i = objIDs.erase(i); } else { @@ -959,7 +993,7 @@ return; } - MSVehicle* egoVehicle = getVehicle(s.id); + MSBaseVehicle* egoVehicle = getVehicle(s.id); Position egoPosition = egoVehicle->getPosition(); double openingAngle = DEG2RAD(s.filterFieldOfVisionOpeningAngle); @@ -973,13 +1007,14 @@ ++i; continue; } - MSVehicle* veh = getVehicle(*i); - double angleEgoToVeh = egoPosition.angleTo2D(veh->getPosition()); + SUMOTrafficObject* obj = getTrafficObject(s.contextDomain, *i); + double angleEgoToVeh = egoPosition.angleTo2D(obj->getPosition()); double alpha = GeomHelper::angleDiff(egoVehicle->getAngle(), angleEgoToVeh); #ifdef DEBUG_SURROUNDING - std::cout << "FOVFILTER: veh '" << *i << "' dist = " << toString(egoPosition.distanceTo2D(veh->getPosition())) << std::endl; - std::cout << "FOVFILTER: veh '" << *i << "' alpha = " << toString(RAD2DEG(alpha)) << " (deg)" << std::endl; + const std::string objType = s.isVehicleToPersonContextSubscription() ? "person" : "veh"; + std::cout << "FOVFILTER: " << objType << " '" << *i << "' dist = " << toString(egoPosition.distanceTo2D(obj->getPosition())) << std::endl; + std::cout << "FOVFILTER: " << objType << " '" << *i << "' alpha = " << toString(RAD2DEG(alpha)) << " (deg)" << std::endl; #endif if (abs(alpha) > openingAngle * 0.5) { @@ -991,9 +1026,13 @@ } void -Helper::applySubscriptionFilterLateralDistanceSinglePass(std::set& objIDs, std::set& vehs, const std::vector& lanes, double lateralDist, double streamDist, double posOnLane, bool isDownstream) { +Helper::applySubscriptionFilterLateralDistanceSinglePass(const Subscription& s, std::set& objIDs, + std::set& vehs, + const std::vector& lanes, double posOnLane, double posLat, bool isDownstream) { + const double streamDist = isDownstream ? s.filterDownstreamDist : s.filterUpstreamDist; double distRemaining = streamDist; bool isFirstLane = true; + PositionVector combinedShape; for (const MSLane* lane : lanes) { #ifdef DEBUG_SURROUNDING std::cout << "FILTER_LATERAL_DIST: current lane " << (isDownstream ? "down" : "up") << " is '" << lane->getID() << "', length " << lane->getLength() @@ -1001,10 +1040,20 @@ #endif PositionVector laneShape = lane->getShape(); if (isFirstLane) { - double geometryPos = lane->interpolateLanePosToGeometryPos(posOnLane); - auto pair = laneShape.splitAt(geometryPos, false); - laneShape = isDownstream ? pair.second : pair.first; isFirstLane = false; + if (posOnLane == 0) { + if (!isDownstream) { + continue; + } + } else { + double geometryPos = lane->interpolateLanePosToGeometryPos(posOnLane); + if (geometryPos >= laneShape.length()) { + laneShape = isDownstream ? PositionVector() : laneShape; + } else { + auto pair = laneShape.splitAt(geometryPos, false); + laneShape = isDownstream ? pair.second : pair.first; + } + } } double laneLength = lane->interpolateGeometryPosToLanePos(laneShape.length()); if (distRemaining - laneLength < 0.) { @@ -1013,18 +1062,32 @@ laneShape = isDownstream ? pair.first : pair.second; } distRemaining -= laneLength; - - // check remaining objects' distances to this lane - auto i = objIDs.begin(); - while (i != objIDs.end()) { - MSVehicle* veh = getVehicle(*i); - double minPerpendicularDist = laneShape.distance2D(veh->getPosition(), true); - if ((minPerpendicularDist != GeomHelper::INVALID_OFFSET) && (minPerpendicularDist <= lateralDist)) { - vehs.insert(veh); - i = objIDs.erase(i); - } else { - ++i; - } + try { + laneShape.move2side(-posLat); + } catch (ProcessError&) { + WRITE_WARNING("addSubscriptionFilterLateralDistance could not determine shape of lane '" + lane->getID() + "' with lateral shift of " + toString(posLat)); + } +#ifdef DEBUG_SURROUNDING + std::cout << " posLat=" << posLat << " laneShape=" << laneShape << "\n"; +#endif + combinedShape.append(laneShape); + if (distRemaining <= 0) { + break; + } + } + // check remaining objects' distances to the combined shape + auto i = objIDs.begin(); + while (i != objIDs.end()) { + SUMOTrafficObject* obj = getTrafficObject(s.contextDomain, *i); + double minPerpendicularDist = combinedShape.distance2D(obj->getPosition(), true); +#ifdef DEBUG_SURROUNDING + std::cout << " obj " << obj->getID() << " dist=" << minPerpendicularDist << " filterDist=" << s.filterLateralDist << "\n"; +#endif + if ((minPerpendicularDist != GeomHelper::INVALID_OFFSET) && (minPerpendicularDist <= s.filterLateralDist)) { + vehs.insert(obj); + i = objIDs.erase(i); + } else { + ++i; } } } diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Helper.h sumo-1.6.0+dfsg1/src/libsumo/Helper.h --- sumo-1.5.0+dfsg1/src/libsumo/Helper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Helper.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Helper_h -#define Helper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -32,6 +26,7 @@ #include #include + // =========================================================================== // class declarations // =========================================================================== @@ -39,8 +34,10 @@ class PositionVector; class RGBColor; class MSEdge; +class SUMOTrafficObject; class MSPerson; class MSVehicle; +class MSBaseVehicle; class MSVehicleType; @@ -135,7 +132,9 @@ static std::pair convertCartesianToRoadMap(const Position& pos, const SUMOVehicleClass vClass); static double getDrivingDistance(std::pair& roadPos1, std::pair& roadPos2); - static MSVehicle* getVehicle(const std::string& id); + static MSBaseVehicle* getVehicle(const std::string& id); + static MSPerson* getPerson(const std::string& id); + static SUMOTrafficObject* getTrafficObject(int domain, const std::string& id); static const MSVehicleType& getVehicleType(const std::string& vehicleID); static void findObjectShape(int domain, const std::string& id, PositionVector& shape); @@ -155,9 +154,11 @@ static void applySubscriptionFilterFieldOfVision(const Subscription& s, std::set& objIDs); - static void applySubscriptionFilterLateralDistanceSinglePass(std::set& objIDs, std::set& vehs, - const std::vector& lanes, double lateralDist, double streamDist, - double posOnLane, bool isDownstream); + static void applySubscriptionFilterLateralDistanceSinglePass(const Subscription& s, + std::set& objIDs, + std::set& vehs, + const std::vector& lanes, + double posOnLane, double posLat, bool isDownstream); static void setRemoteControlled(MSVehicle* v, Position xyPos, MSLane* l, double pos, double posLat, double angle, int edgeOffset, ConstMSEdgeVector route, SUMOTime t); @@ -245,6 +246,8 @@ /// the intermediate range is simply assimilated. static void fuseLaneCoverage(std::shared_ptr aggregatedLaneCoverage, const std::shared_ptr newLaneCoverage); + static void debugPrint(const SUMOTrafficObject* veh); + private: class VehicleStateListener : public MSNet::VehicleStateListener { public: @@ -279,8 +282,3 @@ }; } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/InductionLoop.cpp sumo-1.6.0+dfsg1/src/libsumo/InductionLoop.cpp --- sumo-1.5.0+dfsg1/src/libsumo/InductionLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/InductionLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -75,7 +70,7 @@ int InductionLoop::getLastStepVehicleNumber(const std::string& detID) { - return (int)getDetector(detID)->getPassedNumber((int)DELTA_T); + return (int)getDetector(detID)->getEnteredNumber((int)DELTA_T); } @@ -111,18 +106,17 @@ std::vector InductionLoop::getVehicleData(const std::string& detID) { - std::vector vd = getDetector(detID)->collectVehiclesOnDet(SIMSTEP - DELTA_T, true); + const std::vector vd = getDetector(detID)->collectVehiclesOnDet(SIMSTEP - DELTA_T, true, true); std::vector tvd; - for (std::vector::const_iterator vdi = vd.begin(); vdi != vd.end(); ++vdi) { + for (const MSInductLoop::VehicleData& vdi : vd) { tvd.push_back(libsumo::TraCIVehicleData()); - tvd.back().id = vdi->idM; - tvd.back().length = vdi->lengthM; - tvd.back().entryTime = vdi->entryTimeM; - tvd.back().leaveTime = vdi->leaveTimeM; - tvd.back().typeID = vdi->typeIDM; + tvd.back().id = vdi.idM; + tvd.back().length = vdi.lengthM; + tvd.back().entryTime = vdi.entryTimeM; + tvd.back().leaveTime = vdi.leaveTimeM; + tvd.back().typeID = vdi.typeIDM; } return tvd; - } @@ -197,4 +191,5 @@ } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/InductionLoop.h sumo-1.6.0+dfsg1/src/libsumo/InductionLoop.h --- sumo-1.5.0+dfsg1/src/libsumo/InductionLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/InductionLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef InductionLoop_h -#define InductionLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -94,8 +88,3 @@ }; } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Junction.cpp sumo-1.6.0+dfsg1/src/libsumo/Junction.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Junction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Junction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Junction.h sumo-1.6.0+dfsg1/src/libsumo/Junction.h --- sumo-1.5.0+dfsg1/src/libsumo/Junction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Junction.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Junction_h -#define Junction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -88,8 +82,3 @@ Junction() = delete; }; } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/LaneArea.cpp sumo-1.6.0+dfsg1/src/libsumo/LaneArea.cpp --- sumo-1.5.0+dfsg1/src/libsumo/LaneArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/LaneArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/LaneArea.h sumo-1.6.0+dfsg1/src/libsumo/LaneArea.h --- sumo-1.5.0+dfsg1/src/libsumo/LaneArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/LaneArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef LaneArea_h -#define LaneArea_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -76,8 +70,3 @@ }; } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Lane.cpp sumo-1.6.0+dfsg1/src/libsumo/Lane.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Lane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Lane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Lane.h sumo-1.6.0+dfsg1/src/libsumo/Lane.h --- sumo-1.5.0+dfsg1/src/libsumo/Lane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Lane.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Lane_h -#define Lane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -120,8 +114,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/libsumo.i sumo-1.6.0+dfsg1/src/libsumo/libsumo.i --- sumo-1.5.0+dfsg1/src/libsumo/libsumo.i 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/libsumo.i 2020-04-27 21:47:56.000000000 +0000 @@ -17,6 +17,7 @@ %rename(trafficlight) TrafficLight; %rename(vehicle) Vehicle; %rename(vehicletype) VehicleType; +%rename(calibrator) Calibrator; // adding dummy init and close for easier traci -> libsumo transfer %pythoncode %{ @@ -38,7 +39,6 @@ simulation.load(args[1:]) def load(args): - simulation.close() simulation.load(args) def simulationStep(step=0): @@ -346,6 +346,7 @@ %extend libsumo::TraCILogic { %pythoncode %{ + getPhases = _trafficlight.Logic.getPhases __repr__ = _trafficlight.Logic.__repr__ %} }; diff -Nru sumo-1.5.0+dfsg1/src/libsumo/MeanData.cpp sumo-1.6.0+dfsg1/src/libsumo/MeanData.cpp --- sumo-1.5.0+dfsg1/src/libsumo/MeanData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/MeanData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,104 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 MeanData.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "MeanData.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults MeanData::mySubscriptionResults; +ContextSubscriptionResults MeanData::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +MeanData::getIDList() { + std::vector ids; + //for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + // ids.push_back(item.first); + //} + //std::sort(ids.begin(), ids.end()); + return ids; +} + +int +MeanData::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +MeanData::getParameter(const std::string& /* dataID */, const std::string& /* param */) { + return ""; +} + +void +MeanData::setParameter(const std::string& /* dataID */, const std::string& /* key */, const std::string& /* value */) { + //MSMeanData* r = const_cast(getMeanData(dataID)); + //r->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(MeanData, MEANDATA) + + +MSMeanData* +MeanData::getMeanData(const std::string& id) { + MSMeanData* s = nullptr; + if (s == nullptr) { + throw TraCIException("MeanData '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +MeanData::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +MeanData::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/MeanData.h sumo-1.6.0+dfsg1/src/libsumo/MeanData.h --- sumo-1.5.0+dfsg1/src/libsumo/MeanData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/MeanData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,71 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 MeanData.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSMeanData; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class MeanData + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class MeanData { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getParameter(const std::string& vssID, const std::string& param); + + static void setParameter(const std::string& vssID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSMeanData* getMeanData(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + MeanData() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/MultiEntryExit.cpp sumo-1.6.0+dfsg1/src/libsumo/MultiEntryExit.cpp --- sumo-1.5.0+dfsg1/src/libsumo/MultiEntryExit.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/MultiEntryExit.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/MultiEntryExit.h sumo-1.6.0+dfsg1/src/libsumo/MultiEntryExit.h --- sumo-1.5.0+dfsg1/src/libsumo/MultiEntryExit.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/MultiEntryExit.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef MultiEntryExit_h -#define MultiEntryExit_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -76,8 +70,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/OverheadWire.cpp sumo-1.6.0+dfsg1/src/libsumo/OverheadWire.cpp --- sumo-1.5.0+dfsg1/src/libsumo/OverheadWire.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/OverheadWire.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 OverheadWire.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "OverheadWire.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults OverheadWire::mySubscriptionResults; +ContextSubscriptionResults OverheadWire::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +OverheadWire::getIDList() { + std::vector ids; + for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + ids.push_back(item.first); + } + std::sort(ids.begin(), ids.end()); + return ids; +} + +int +OverheadWire::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +OverheadWire::getLaneID(const std::string& stopID) { + return getOverheadWire(stopID)->getLane().getID(); +} + + +std::string +OverheadWire::getParameter(const std::string& stopID, const std::string& param) { + const MSStoppingPlace* s = getOverheadWire(stopID); + return s->getParameter(param, ""); +} + +void +OverheadWire::setParameter(const std::string& stopID, const std::string& key, const std::string& value) { + MSStoppingPlace* s = getOverheadWire(stopID); + s->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(OverheadWire, OVERHEADWIRE) + + +MSStoppingPlace* +OverheadWire::getOverheadWire(const std::string& id) { + MSStoppingPlace* s = MSNet::getInstance()->getStoppingPlace(id, SUMO_TAG_BUS_STOP); + if (s == nullptr) { + throw TraCIException("OverheadWire '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +OverheadWire::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +OverheadWire::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + case VAR_LANE_ID: + return wrapper->wrapString(objID, variable, getLaneID(objID)); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/OverheadWire.h sumo-1.6.0+dfsg1/src/libsumo/OverheadWire.h --- sumo-1.5.0+dfsg1/src/libsumo/OverheadWire.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/OverheadWire.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,72 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 OverheadWire.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSOverheadWire; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class OverheadWire + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class OverheadWire { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getLaneID(const std::string& stopID); + static std::string getParameter(const std::string& stopID, const std::string& param); + + static void setParameter(const std::string& stopID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSStoppingPlace* getOverheadWire(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + OverheadWire() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/ParkingArea.cpp sumo-1.6.0+dfsg1/src/libsumo/ParkingArea.cpp --- sumo-1.5.0+dfsg1/src/libsumo/ParkingArea.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/ParkingArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,113 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 ParkingArea.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "ParkingArea.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults ParkingArea::mySubscriptionResults; +ContextSubscriptionResults ParkingArea::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +ParkingArea::getIDList() { + std::vector ids; + for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + ids.push_back(item.first); + } + std::sort(ids.begin(), ids.end()); + return ids; +} + +int +ParkingArea::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +ParkingArea::getLaneID(const std::string& stopID) { + return getParkingArea(stopID)->getLane().getID(); +} + + +std::string +ParkingArea::getParameter(const std::string& stopID, const std::string& param) { + const MSStoppingPlace* s = getParkingArea(stopID); + return s->getParameter(param, ""); +} + +void +ParkingArea::setParameter(const std::string& stopID, const std::string& key, const std::string& value) { + MSStoppingPlace* s = getParkingArea(stopID); + s->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(ParkingArea, PARKINGAREA) + + +MSStoppingPlace* +ParkingArea::getParkingArea(const std::string& id) { + MSStoppingPlace* s = MSNet::getInstance()->getStoppingPlace(id, SUMO_TAG_BUS_STOP); + if (s == nullptr) { + throw TraCIException("ParkingArea '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +ParkingArea::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +ParkingArea::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + case VAR_LANE_ID: + return wrapper->wrapString(objID, variable, getLaneID(objID)); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/ParkingArea.h sumo-1.6.0+dfsg1/src/libsumo/ParkingArea.h --- sumo-1.5.0+dfsg1/src/libsumo/ParkingArea.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/ParkingArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,72 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 ParkingArea.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSParkingArea; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class ParkingArea + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class ParkingArea { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getLaneID(const std::string& stopID); + static std::string getParameter(const std::string& stopID, const std::string& param); + + static void setParameter(const std::string& stopID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSStoppingPlace* getParkingArea(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + ParkingArea() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Person.cpp sumo-1.6.0+dfsg1/src/libsumo/Person.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Person.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Person.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -462,6 +457,19 @@ MSStage* Person::convertTraCIStage(const TraCIStage& stage, const std::string personID) { + MSStoppingPlace* bs = nullptr; + if (!stage.destStop.empty()) { + bs = MSNet::getInstance()->getStoppingPlace(stage.destStop, SUMO_TAG_BUS_STOP); + if (bs == nullptr) { + bs = MSNet::getInstance()->getStoppingPlace(stage.destStop, SUMO_TAG_PARKING_AREA); + if (bs == nullptr) { + throw TraCIException("Invalid stopping place id '" + stage.destStop + "' for person: '" + personID + "'"); + } else { + // parkingArea is not a proper arrival place + bs = nullptr; + } + } + } switch (stage.type) { case STAGE_DRIVING: { if (stage.edges.empty()) { @@ -472,13 +480,6 @@ if (!edge) { throw TraCIException("Invalid edge '" + edgeId + "' for person: '" + personID + "'"); } - MSStoppingPlace* bs = nullptr; - if (!stage.destStop.empty()) { - bs = MSNet::getInstance()->getStoppingPlace(stage.destStop, SUMO_TAG_BUS_STOP); - if (bs == nullptr) { - throw TraCIException("Invalid stopping place id '" + stage.destStop + "' for person: '" + personID + "'"); - } - } if (stage.line.empty()) { throw TraCIException("Empty lines parameter for person: '" + personID + "'"); } @@ -504,13 +505,6 @@ arrivalPos += edges.back()->getLength(); } double speed = p->getVehicleType().getMaxSpeed(); - MSStoppingPlace* bs = nullptr; - if (!stage.destStop.empty()) { - bs = MSNet::getInstance()->getStoppingPlace(stage.destStop, SUMO_TAG_BUS_STOP); - if (bs == nullptr) { - throw TraCIException("Invalid stopping place id '" + stage.destStop + "' for person: '" + personID + "'"); - } - } return new MSPerson::MSPersonStage_Walking(p->getID(), edges, bs, -1, speed, p->getArrivalPos(), arrivalPos, 0); } @@ -519,13 +513,6 @@ if (stage.travelTime < 0) { throw TraCIException("Duration for person: '" + personID + "' must not be negative"); } - MSStoppingPlace* bs = nullptr; - if (!stage.destStop.empty()) { - bs = MSNet::getInstance()->getStoppingPlace(stage.destStop, SUMO_TAG_BUS_STOP); - if (bs == nullptr) { - throw TraCIException("Invalid stopping place id '" + stage.destStop + "' for person: '" + personID + "'"); - } - } return new MSStageWaiting(p->getArrivalEdge(), nullptr, TIME2STEPS(stage.travelTime), 0, p->getArrivalPos(), stage.description, false); } default: @@ -535,12 +522,13 @@ void -Person::appendStage(const TraCIStage& stage, const std::string& personID) { +Person::appendStage(const std::string& personID, const TraCIStage& stage) { MSTransportable* p = getPerson(personID); MSStage* personStage = convertTraCIStage(stage, personID); p->appendStage(personStage); } + void Person::replaceStage(const std::string& personID, const int stageIndex, const TraCIStage& stage) { MSTransportable* p = getPerson(personID); @@ -675,7 +663,7 @@ } ConstMSEdgeVector oldEdges = p->getEdges(firstIndex); assert(!oldEdges.empty()); - if (oldEdges.front()->getFunction() != EDGEFUNC_NORMAL) { + if (oldEdges.front()->getFunction() != SumoXMLEdgeFunc::NORMAL) { oldEdges.erase(oldEdges.begin()); } //std::cout << " remainingStages=" << p->getNumRemainingStages() << " oldEdges=" << toString(oldEdges) << " newEdges=" << toString(newEdges) << " firstIndex=" << firstIndex << " nextIndex=" << nextIndex << "\n"; @@ -968,12 +956,7 @@ MSPerson* Person::getPerson(const std::string& personID) { - MSTransportableControl& c = MSNet::getInstance()->getPersonControl(); - MSPerson* p = dynamic_cast(c.get(personID)); - if (p == nullptr) { - throw TraCIException("Person '" + personID + "' is not known"); - } - return p; + return Helper::getPerson(personID); } diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Person.h sumo-1.6.0+dfsg1/src/libsumo/Person.h --- sumo-1.5.0+dfsg1/src/libsumo/Person.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Person.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Person_h -#define Person_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -66,7 +60,7 @@ static int getRemainingStages(const std::string& personID); static TraCIStage getStage(const std::string& personID, int nextStageIndex = 0); static std::vector getEdges(const std::string& personID, int nextStageIndex = 0); - static std::string getParameter(const std::string& routeID, const std::string& param); + static std::string getParameter(const std::string& personID, const std::string& param); static double getAngle(const std::string& personID); static double getSlope(const std::string& personID); static double getLanePosition(const std::string& personID); @@ -74,7 +68,7 @@ LIBSUMO_VEHICLE_TYPE_GETTER static void add(const std::string& personID, const std::string& edgeID, double pos, double depart = DEPARTFLAG_NOW, const std::string typeID = "DEFAULT_PEDTYPE"); - static void appendStage(const TraCIStage& stage, const std::string& personID); + static void appendStage(const std::string& personID, const TraCIStage& stage); static void replaceStage(const std::string& personID, const int stageIndex, const TraCIStage& stage); static void appendWaitingStage(const std::string& personID, double duration, const std::string& description = "waiting", const std::string& stopID = ""); static void appendWalkingStage(const std::string& personID, const std::vector& edgeIDs, double arrivalPos, double duration = -1, double speed = -1, const std::string& stopID = ""); @@ -83,7 +77,7 @@ static void rerouteTraveltime(const std::string& personID); static void moveTo(const std::string& personID, const std::string& edgeID, double position); static void moveToXY(const std::string& personID, const std::string& edgeID, const double x, const double y, double angle = INVALID_DOUBLE_VALUE, const int keepRoute = 1); - static void setParameter(const std::string& personID, const std::string& key, const std::string& value); + static void setParameter(const std::string& personID, const std::string& param, const std::string& value); static void setSpeed(const std::string& personID, double speed); static void setType(const std::string& personID, const std::string& typeID); @@ -117,8 +111,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/POI.cpp sumo-1.6.0+dfsg1/src/libsumo/POI.cpp --- sumo-1.5.0+dfsg1/src/libsumo/POI.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/POI.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/POI.h sumo-1.6.0+dfsg1/src/libsumo/POI.h --- sumo-1.5.0+dfsg1/src/libsumo/POI.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/POI.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef POI_h -#define POI_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -109,8 +103,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Polygon.cpp sumo-1.6.0+dfsg1/src/libsumo/Polygon.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Polygon.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Polygon.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Polygon.h sumo-1.6.0+dfsg1/src/libsumo/Polygon.h --- sumo-1.5.0+dfsg1/src/libsumo/Polygon.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Polygon.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef SUMO_Polygon_H -#define SUMO_Polygon_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -108,8 +102,3 @@ } - - -#endif //SUMO_Polygon_H - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Rerouter.cpp sumo-1.6.0+dfsg1/src/libsumo/Rerouter.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Rerouter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Rerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,104 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 Rerouter.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "Rerouter.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults Rerouter::mySubscriptionResults; +ContextSubscriptionResults Rerouter::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +Rerouter::getIDList() { + std::vector ids; + //for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + // ids.push_back(item.first); + //} + //std::sort(ids.begin(), ids.end()); + return ids; +} + +int +Rerouter::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +Rerouter::getParameter(const std::string& /* rerouterID */, const std::string& /* param */) { + return ""; +} + +void +Rerouter::setParameter(const std::string& /* rerouterID */, const std::string& /* key */, const std::string& /* value */) { + //MSRerouter* r = const_cast(getRerouter(rerouterID)); + //r->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(Rerouter, REROUTER) + + +MSTriggeredRerouter* +Rerouter::getRerouter(const std::string& id) { + MSTriggeredRerouter* s = nullptr; + if (s == nullptr) { + throw TraCIException("Rerouter '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +Rerouter::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +Rerouter::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Rerouter.h sumo-1.6.0+dfsg1/src/libsumo/Rerouter.h --- sumo-1.5.0+dfsg1/src/libsumo/Rerouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Rerouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,71 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 Rerouter.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSTriggeredRerouter; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class Rerouter + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class Rerouter { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getParameter(const std::string& rerouterID, const std::string& param); + + static void setParameter(const std::string& rerouterID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSTriggeredRerouter* getRerouter(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + Rerouter() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Route.cpp sumo-1.6.0+dfsg1/src/libsumo/Route.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Route.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Route.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Route.h sumo-1.6.0+dfsg1/src/libsumo/Route.h --- sumo-1.5.0+dfsg1/src/libsumo/Route.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Route.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Route_h -#define Route_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -57,8 +51,8 @@ static std::vector getEdges(const std::string& routeID); static std::string getParameter(const std::string& routeID, const std::string& param); - static void add(const std::string& routeID, const std::vector& edgeIDs); - static void setParameter(const std::string& routeID, const std::string& key, const std::string& value); // not needed so far + static void add(const std::string& routeID, const std::vector& edges); + static void setParameter(const std::string& routeID, const std::string& param, const std::string& value); // not needed so far LIBSUMO_SUBSCRIPTION_API @@ -79,8 +73,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/RouteProbe.cpp sumo-1.6.0+dfsg1/src/libsumo/RouteProbe.cpp --- sumo-1.5.0+dfsg1/src/libsumo/RouteProbe.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/RouteProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,104 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 RouteProbe.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "RouteProbe.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults RouteProbe::mySubscriptionResults; +ContextSubscriptionResults RouteProbe::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +RouteProbe::getIDList() { + std::vector ids; + //for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + // ids.push_back(item.first); + //} + //std::sort(ids.begin(), ids.end()); + return ids; +} + +int +RouteProbe::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +RouteProbe::getParameter(const std::string& /* probeID */, const std::string& /* param */) { + return ""; +} + +void +RouteProbe::setParameter(const std::string& /* probeID */, const std::string& /* key */, const std::string& /* value */) { + //MSRouteProbe* r = const_cast(getRouteProbe(probeID)); + //r->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(RouteProbe, ROUTEPROBE) + + +MSRouteProbe* +RouteProbe::getRouteProbe(const std::string& id) { + MSRouteProbe* s = nullptr; + if (s == nullptr) { + throw TraCIException("RouteProbe '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +RouteProbe::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +RouteProbe::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/RouteProbe.h sumo-1.6.0+dfsg1/src/libsumo/RouteProbe.h --- sumo-1.5.0+dfsg1/src/libsumo/RouteProbe.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/RouteProbe.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,71 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 RouteProbe.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSRouteProbe; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class RouteProbe + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class RouteProbe { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getParameter(const std::string& probeID, const std::string& param); + + static void setParameter(const std::string& probeID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSRouteProbe* getRouteProbe(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + RouteProbe() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Simulation.cpp sumo-1.6.0+dfsg1/src/libsumo/Simulation.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Simulation.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Simulation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -70,6 +66,7 @@ Simulation::load(const std::vector& args) { close("Libsumo issued load command."); try { + gSimulation = true; XMLSubSys::init(); OptionsIO::setArgs(args); if (NLBuilder::init(true) != nullptr) { @@ -430,24 +427,22 @@ throw TraCIException("Unknown to edge '" + from + "'."); } SUMOVehicle* vehicle = nullptr; - if (typeID != "") { - SUMOVehicleParameter* pars = new SUMOVehicleParameter(); - MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(typeID); - if (type == nullptr) { - throw TraCIException("The vehicle type '" + typeID + "' is not known."); - } - try { - const MSRoute* const routeDummy = new MSRoute("", ConstMSEdgeVector({ fromEdge }), false, nullptr, std::vector()); - vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(pars, routeDummy, type, false); - // we need to fix the speed factor here for deterministic results - vehicle->setChosenSpeedFactor(type->getSpeedFactor().getParameter()[0]); - } catch (ProcessError& e) { - throw TraCIException("Invalid departure edge for vehicle type '" + typeID + "' (" + e.what() + ")"); - } + MSVehicleType* type = MSNet::getInstance()->getVehicleControl().getVType(typeID == "" ? DEFAULT_VTYPE_ID : typeID); + if (type == nullptr) { + throw TraCIException("The vehicle type '" + typeID + "' is not known."); + } + SUMOVehicleParameter* pars = new SUMOVehicleParameter(); + try { + const MSRoute* const routeDummy = new MSRoute("", ConstMSEdgeVector({ fromEdge }), false, nullptr, std::vector()); + vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(pars, routeDummy, type, false); + // we need to fix the speed factor here for deterministic results + vehicle->setChosenSpeedFactor(type->getSpeedFactor().getParameter()[0]); + } catch (ProcessError& e) { + throw TraCIException("Invalid departure edge for vehicle type '" + typeID + "' (" + e.what() + ")"); } ConstMSEdgeVector edges; const SUMOTime dep = depart < 0 ? MSNet::getInstance()->getCurrentTimeStep() : TIME2STEPS(depart); - SUMOAbstractRouter& router = routingMode == ROUTING_MODE_AGGREGATED ? MSRoutingEngine::getRouterTT(0) : MSNet::getInstance()->getRouterTT(0); + SUMOAbstractRouter& router = routingMode == ROUTING_MODE_AGGREGATED ? MSRoutingEngine::getRouterTT(0, vehicle->getVClass()) : MSNet::getInstance()->getRouterTT(0); router.compute(fromEdge, toEdge, vehicle, dep, edges); for (const MSEdge* e : edges) { result.edges.push_back(e->getID()); @@ -486,20 +481,20 @@ } for (StringTokenizer st(modes); st.hasNext();) { const std::string mode = st.next(); - if (mode == toString(PERSONMODE_CAR)) { + if (mode == toString(PersonMode::CAR)) { pars.push_back(new SUMOVehicleParameter()); pars.back()->vtypeid = DEFAULT_VTYPE_ID; pars.back()->id = mode; modeSet |= SVC_PASSENGER; - } else if (mode == toString(PERSONMODE_BICYCLE)) { + } else if (mode == toString(PersonMode::BICYCLE)) { pars.push_back(new SUMOVehicleParameter()); pars.back()->vtypeid = DEFAULT_BIKETYPE_ID; pars.back()->id = mode; modeSet |= SVC_BICYCLE; - } else if (mode == toString(PERSONMODE_PUBLIC)) { + } else if (mode == toString(PersonMode::PUBLIC)) { pars.push_back(nullptr); modeSet |= SVC_BUS; - } else if (mode == toString(PERSONMODE_WALK)) { + } else if (mode == toString(PersonMode::WALK)) { // do nothing } else { throw TraCIException("Unknown person mode '" + mode + "'."); diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Simulation.h sumo-1.6.0+dfsg1/src/libsumo/Simulation.h --- sumo-1.5.0+dfsg1/src/libsumo/Simulation.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Simulation.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef Simulation_h -#define Simulation_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -145,8 +139,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Subscription.h sumo-1.6.0+dfsg1/src/libsumo/Subscription.h --- sumo-1.5.0+dfsg1/src/libsumo/Subscription.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Subscription.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,10 @@ /// // Subscription representation for libsumo and TraCI /****************************************************************************/ -#ifndef Subscription_h -#define Subscription_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include +#include // =========================================================================== @@ -101,10 +96,14 @@ filterFieldOfVisionOpeningAngle(-1), filterLateralDist(-1) {} - bool isVehicleToVehicleContextSubscription() { + bool isVehicleToVehicleContextSubscription() const { return commandId == CMD_SUBSCRIBE_VEHICLE_CONTEXT && contextDomain == CMD_GET_VEHICLE_VARIABLE; } + bool isVehicleToPersonContextSubscription() const { + return commandId == CMD_SUBSCRIBE_VEHICLE_CONTEXT && contextDomain == CMD_GET_PERSON_VARIABLE; + } + /// @brief commandIdArg The command id of the subscription int commandId; /// @brief The id of the object that is subscribed @@ -163,4 +162,3 @@ } -#endif diff -Nru sumo-1.5.0+dfsg1/src/libsumo/TraCIConstants.h sumo-1.6.0+dfsg1/src/libsumo/TraCIConstants.h --- sumo-1.5.0+dfsg1/src/libsumo/TraCIConstants.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/TraCIConstants.h 2020-04-27 21:47:56.000000000 +0000 @@ -27,8 +27,7 @@ /// // holds codes used for TraCI /****************************************************************************/ -#ifndef TRACICONSTANTS_H -#define TRACICONSTANTS_H +#pragma once #if __cplusplus >= 201103L #define TRACI_CONST constexpr @@ -97,6 +96,8 @@ TRACI_CONST int CMD_GET_INDUCTIONLOOP_VARIABLE = 0xa0; // response: get induction loop (e1) variable TRACI_CONST int RESPONSE_GET_INDUCTIONLOOP_VARIABLE = 0xb0; +// command: set induction loop (e1) variable, not used yet +//TRACI_CONST int CMD_GET_INDUCTIONLOOP_VARIABLE = 0xc0; // command: subscribe induction loop (e1) variable TRACI_CONST int CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 0xd0; // response: subscribe induction loop (e1) variable @@ -110,6 +111,8 @@ TRACI_CONST int CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xa1; // response: get multi-entry/multi-exit detector (e3) variable TRACI_CONST int RESPONSE_GET_MULTIENTRYEXIT_VARIABLE = 0xb1; +// command: set multi-entry/multi-exit detector (e3) variable, not used yet +//TRACI_CONST int CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xc1; // command: subscribe multi-entry/multi-exit detector (e3) variable TRACI_CONST int CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE = 0xd1; // response: subscribe multi-entry/multi-exit detector (e3) variable @@ -280,17 +283,19 @@ // response: subscribe GUI variable TRACI_CONST int RESPONSE_SUBSCRIBE_GUI_VARIABLE = 0xec; -// command: subscribe areal detector (e2) context +// command: subscribe lane area detector (e2) context TRACI_CONST int CMD_SUBSCRIBE_LANEAREA_CONTEXT = 0x8d; -// response: subscribe areal detector (e2) context +// response: subscribe lane area detector (e2) context TRACI_CONST int RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT = 0x9d; -// command: get areal detector (e2) variable +// command: get lane area detector (e2) variable TRACI_CONST int CMD_GET_LANEAREA_VARIABLE = 0xad; -// response: get areal detector (e2) variable +// response: get lane area detector (e2) variable TRACI_CONST int RESPONSE_GET_LANEAREA_VARIABLE = 0xbd; -// command: subscribe areal detector (e2) variable +// command: set lane area detector (e2) variable, not used yet +//TRACI_CONST int CMD_GET_LANEAREA_VARIABLE = 0xcd; +// command: subscribe lane area detector (e2) variable TRACI_CONST int CMD_SUBSCRIBE_LANEAREA_VARIABLE = 0xdd; -// response: subscribe areal detector (e2) variable +// response: subscribe lane area detector (e2) variable TRACI_CONST int RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE = 0xed; // command: subscribe person context @@ -308,6 +313,141 @@ // response: subscribe person variable TRACI_CONST int RESPONSE_SUBSCRIBE_PERSON_VARIABLE = 0xee; +// command: subscribe busstop context +TRACI_CONST int CMD_SUBSCRIBE_BUSSTOP_CONTEXT = 0x8f; +// response: subscribe busstop context +TRACI_CONST int RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT = 0x9f; +// command: get busstop variable +TRACI_CONST int CMD_GET_BUSSTOP_VARIABLE = 0xaf; +// response: get busstop variable +TRACI_CONST int RESPONSE_GET_BUSSTOP_VARIABLE = 0xbf; +// command: set busstop variable, not used yet +TRACI_CONST int CMD_SET_BUSSTOP_VARIABLE = 0xcf; +// command: subscribe busstop variable +TRACI_CONST int CMD_SUBSCRIBE_BUSSTOP_VARIABLE = 0xdf; +// response: subscribe busstop variable +TRACI_CONST int RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE = 0xef; + +// command: subscribe parkingarea context +TRACI_CONST int CMD_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x04; +// response: subscribe parkingarea context +TRACI_CONST int RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x14; +// command: get parkingarea variable +TRACI_CONST int CMD_GET_PARKINGAREA_VARIABLE = 0x24; +// response: get parkingarea variable +TRACI_CONST int RESPONSE_GET_PARKINGAREA_VARIABLE = 0x34; +// command: set parkingarea variable +TRACI_CONST int CMD_SET_PARKINGAREA_VARIABLE = 0x44; +// command: subscribe parkingarea variable +TRACI_CONST int CMD_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x54; +// response: subscribe parkingarea variable +TRACI_CONST int RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x64; + +// command: subscribe chargingstation context +TRACI_CONST int CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x05; +// response: subscribe chargingstation context +TRACI_CONST int RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x15; +// command: get chargingstation variable +TRACI_CONST int CMD_GET_CHARGINGSTATION_VARIABLE = 0x25; +// response: get chargingstation variable +TRACI_CONST int RESPONSE_GET_CHARGINGSTATION_VARIABLE = 0x35; +// command: set chargingstation variable +TRACI_CONST int CMD_SET_CHARGINGSTATION_VARIABLE = 0x45; +// command: subscribe chargingstation variable +TRACI_CONST int CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x55; +// response: subscribe chargingstation variable +TRACI_CONST int RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x65; + +// command: subscribe routeprobe context +TRACI_CONST int CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x06; +// response: subscribe routeprobe context +TRACI_CONST int RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x16; +// command: get routeprobe variable +TRACI_CONST int CMD_GET_ROUTEPROBE_VARIABLE = 0x26; +// response: get routeprobe variable +TRACI_CONST int RESPONSE_GET_ROUTEPROBE_VARIABLE = 0x36; +// command: set routeprobe variable +TRACI_CONST int CMD_SET_ROUTEPROBE_VARIABLE = 0x46; +// command: subscribe routeprobe variable +TRACI_CONST int CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x56; +// response: subscribe routeprobe variable +TRACI_CONST int RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x66; + +// command: subscribe calibrator context +TRACI_CONST int CMD_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x07; +// response: subscribe calibrator context +TRACI_CONST int RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x17; +// command: get calibrator variable +TRACI_CONST int CMD_GET_CALIBRATOR_VARIABLE = 0x27; +// response: get calibrator variable +TRACI_CONST int RESPONSE_GET_CALIBRATOR_VARIABLE = 0x37; +// command: set calibrator variable +TRACI_CONST int CMD_SET_CALIBRATOR_VARIABLE = 0x47; +// command: subscribe calibrator variable +TRACI_CONST int CMD_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x57; +// response: subscribe calibrator variable +TRACI_CONST int RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x67; + +// command: subscribe rerouter context +TRACI_CONST int CMD_SUBSCRIBE_REROUTER_CONTEXT = 0x08; +// response: subscribe rerouter context +TRACI_CONST int RESPONSE_SUBSCRIBE_REROUTER_CONTEXT = 0x18; +// command: get rerouter variable +TRACI_CONST int CMD_GET_REROUTER_VARIABLE = 0x28; +// response: get rerouter variable +TRACI_CONST int RESPONSE_GET_REROUTER_VARIABLE = 0x38; +// command: set rerouter variable +TRACI_CONST int CMD_SET_REROUTER_VARIABLE = 0x48; +// command: subscribe rerouter variable +TRACI_CONST int CMD_SUBSCRIBE_REROUTER_VARIABLE = 0x58; +// response: subscribe rerouter variable +TRACI_CONST int RESPONSE_SUBSCRIBE_REROUTER_VARIABLE = 0x68; + +// command: subscribe variablespeedsign context +TRACI_CONST int CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x09; +// response: subscribe variablespeedsign context +TRACI_CONST int RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x19; +// command: get variablespeedsign variable +TRACI_CONST int CMD_GET_VARIABLESPEEDSIGN_VARIABLE = 0x29; +// response: get variablespeedsign variable +TRACI_CONST int RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE = 0x39; +// command: set variablespeedsign variable +TRACI_CONST int CMD_SET_VARIABLESPEEDSIGN_VARIABLE = 0x49; +// command: subscribe variablespeedsign variable +TRACI_CONST int CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x59; +// response: subscribe variablespeedsign variable +TRACI_CONST int RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x69; + +// command: subscribe meandata context +TRACI_CONST int CMD_SUBSCRIBE_MEANDATA_CONTEXT = 0x0a; +// response: subscribe meandata context +TRACI_CONST int RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT = 0x1a; +// command: get meandata variable +TRACI_CONST int CMD_GET_MEANDATA_VARIABLE = 0x2a; +// response: get meandata variable +TRACI_CONST int RESPONSE_GET_MEANDATA_VARIABLE = 0x3a; +// command: set meandata variable, not used yet +//TRACI_CONST int CMD_SET_MEANDATA_VARIABLE = 0x4a; +// command: subscribe meandata variable +TRACI_CONST int CMD_SUBSCRIBE_MEANDATA_VARIABLE = 0x5a; +// response: subscribe meandata variable +TRACI_CONST int RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE = 0x6a; + +// command: subscribe overheadwire context +TRACI_CONST int CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x0b; +// response: subscribe overheadwire context +TRACI_CONST int RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x1b; +// command: get overheadwire variable +TRACI_CONST int CMD_GET_OVERHEADWIRE_VARIABLE = 0x2b; +// response: get overheadwire variable +TRACI_CONST int RESPONSE_GET_OVERHEADWIRE_VARIABLE = 0x3b; +// command: set overheadwire variable +TRACI_CONST int CMD_SET_OVERHEADWIRE_VARIABLE = 0x4b; +// command: subscribe overheadwire variable +TRACI_CONST int CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x5b; +// response: subscribe overheadwire variable +TRACI_CONST int RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x6b; + // **************************************** // POSITION REPRESENTATIONS @@ -554,6 +694,45 @@ // full name (get: edges, simulation, trafficlight) TRACI_CONST int VAR_NAME = 0x1b; +// carFollowModel function followSpeed (get: vehicle) +TRACI_CONST int VAR_FOLLOW_SPEED = 0x1c; + +// carFollowModel function stopSpeed (get: vehicle) +TRACI_CONST int VAR_STOP_SPEED = 0x1d; + +// carFollowModel function getSecureGap (get: vehicle) +TRACI_CONST int VAR_SECURE_GAP = 0x1e; + +// estimated delay for next stop +TRACI_CONST int VAR_STOP_DELAY = 0x1f; + +// begin time(get: calibrator) +TRACI_CONST int VAR_BEGIN = 0x1c; + +// end time(get: calibrator) +TRACI_CONST int VAR_END = 0x1d; + +// vtype list (get: calibrator) +TRACI_CONST int VAR_VTYPES = 0x1e; + +// vehicles per hour (get: calibrator) +TRACI_CONST int VAR_VEHSPERHOUR = 0x13; + +// passed vehicle count (get: calibrator) +TRACI_CONST int VAR_PASSED = 0x14; + +// inserted vehicle count (get: calibrator) +TRACI_CONST int VAR_INSERTED = 0x15; + +// removed vehicle count (get: calibrator) +TRACI_CONST int VAR_REMOVED = 0x16; + +// routeProbe id (get: calibrator) +TRACI_CONST int VAR_ROUTE_PROBE = 0x17; + +// routeProbe id (get: calibrator) +TRACI_CONST int CMD_SET_FLOW = 0x18; + // traffic light states, encoded as rRgGyYoO tuple (get: traffic lights) TRACI_CONST int TL_RED_YELLOW_GREEN_STATE = 0x20; @@ -623,7 +802,7 @@ // maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes) TRACI_CONST int VAR_MAXSPEED = 0x41; -// position (2D) (get: vehicle, poi, inductionloop, areadetector; set: poi) +// position (2D) (get: vehicle, poi, inductionloop, lane area detector; set: poi) TRACI_CONST int VAR_POSITION = 0x42; // position (3D) (get: vehicle, poi, set: poi) @@ -632,7 +811,7 @@ // angle (get: vehicle, poi; set: poi) TRACI_CONST int VAR_ANGLE = 0x43; -// angle (get: vehicle types, lanes, arealdetector, set: lanes) +// angle (get: vehicle types, lanes, lane area detector, set: lanes) TRACI_CONST int VAR_LENGTH = 0x44; // color (get: vehicles, vehicle types, polygons, pois) @@ -683,7 +862,7 @@ // road id (get: vehicles) TRACI_CONST int VAR_ROAD_ID = 0x50; -// lane id (get: vehicles, inductionloop, arealdetector) +// lane id (get: vehicles, inductionloop, lane area detector) TRACI_CONST int VAR_LANE_ID = 0x51; // lane index (get: vehicle, edge) @@ -1030,4 +1209,3 @@ #undef TRACI_CONST -#endif diff -Nru sumo-1.5.0+dfsg1/src/libsumo/TraCIDefs.h sumo-1.6.0+dfsg1/src/libsumo/TraCIDefs.h --- sumo-1.5.0+dfsg1/src/libsumo/TraCIDefs.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/TraCIDefs.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef TraCIDefs_h -#define TraCIDefs_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once // we do not include config.h here, since we should be independent of a special sumo build #include #include @@ -152,6 +146,21 @@ int r, g, b, a; }; + +/** @struct TraCILeaderDistance + * @brief A leaderId and distance to leader + */ +struct TraCILeaderDistance : TraCIResult { + std::string getString() { + std::ostringstream os; + os << "TraCILeaderDistance(" << leaderID << "," << dist << ")"; + return os.str(); + } + std::string leaderID; + double dist; +}; + + /** @struct TraCIPositionVector * @brief A list of positions */ @@ -233,7 +242,7 @@ #ifdef SWIG -%template(TraCIPhaseVector) std::vector; // *NOPAD* +%template(TraCIPhaseVector) std::vector; // *NOPAD* #endif @@ -242,19 +251,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() {} -#ifndef SWIGJAVA - std::vector getPhases() { - return phases; - } -#endif std::string programID; int type; int currentPhaseIndex; - std::vector phases; + std::vector phases; std::map subParameter; }; @@ -318,7 +322,13 @@ }; -struct TraCINextStopData { +struct TraCINextStopData : TraCIResult { + std::string getString() { + std::ostringstream os; + os << "TraCINextStopData(" << lane << "," << endPos << "," << stoppingPlaceID << "," << stopFlags << "," << duration << "," << until << ")"; + return os.str(); + } + /// @brief The lane to stop at std::string lane; /// @brief The stopping position end @@ -334,6 +344,25 @@ }; +/** @struct TraCINextStopDataVector + * @brief A list of vehicle stops + * @see TraCINextStopData + */ +struct TraCINextStopDataVector : TraCIResult { + std::string getString() { + std::ostringstream os; + os << "TraCINextStopDataVector["; + for (TraCINextStopData v : value) { + os << v.getString() << ","; + } + os << "]"; + return os.str(); + } + + std::vector value; +}; + + struct TraCIBestLanesData { /// @brief The id of the lane std::string laneID; @@ -387,8 +416,3 @@ std::string description; }; } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/TrafficLight.cpp sumo-1.6.0+dfsg1/src/libsumo/TrafficLight.cpp --- sumo-1.5.0+dfsg1/src/libsumo/TrafficLight.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/TrafficLight.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -78,9 +73,9 @@ TraCILogic l(logic->getProgramID(), (int)logic->getLogicType(), logic->getCurrentPhaseIndex()); l.subParameter = logic->getParametersMap(); for (const MSPhaseDefinition* const phase : logic->getPhases()) { - l.phases.emplace_back(TraCIPhase(STEPS2TIME(phase->duration), phase->getState(), - STEPS2TIME(phase->minDuration), STEPS2TIME(phase->maxDuration), - phase->getNextPhases(), phase->getName())); + l.phases.emplace_back(new TraCIPhase(STEPS2TIME(phase->duration), phase->getState(), + STEPS2TIME(phase->minDuration), STEPS2TIME(phase->maxDuration), + phase->getNextPhases(), phase->getName())); } result.emplace_back(l); } @@ -265,8 +260,8 @@ 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 (TraCIPhase* phase : logic.phases) { + phases.push_back(new MSPhaseDefinition(TIME2STEPS(phase->duration), phase->state, TIME2STEPS(phase->minDur), TIME2STEPS(phase->maxDur), phase->next, phase->name)); } if (vars.getLogic(logic.programID) == nullptr) { MSTLLogicControl& tlc = MSNet::getInstance()->getTLSControl(); @@ -274,22 +269,22 @@ const std::string basePath = ""; MSTrafficLightLogic* tlLogic = nullptr; SUMOTime nextSwitch = 0; //MSNet::getInstance()->getCurrentTimeStep(); - switch (logic.type) { - case TLTYPE_ACTUATED: + switch ((TrafficLightType)logic.type) { + case TrafficLightType::ACTUATED: tlLogic = new MSActuatedTrafficLightLogic(tlc, tlsID, logic.programID, phases, step, nextSwitch, logic.subParameter, basePath); break; - case TLTYPE_DELAYBASED: + case TrafficLightType::DELAYBASED: tlLogic = new MSDelayBasedTrafficLightLogic(tlc, tlsID, logic.programID, phases, step, nextSwitch, logic.subParameter, basePath); break; - case TLTYPE_STATIC: + case TrafficLightType::STATIC: tlLogic = new MSSimpleTrafficLightLogic(tlc, - tlsID, logic.programID, TLTYPE_STATIC, + tlsID, logic.programID, TrafficLightType::STATIC, phases, step, nextSwitch, logic.subParameter); break; diff -Nru sumo-1.5.0+dfsg1/src/libsumo/TrafficLight.h sumo-1.6.0+dfsg1/src/libsumo/TrafficLight.h --- sumo-1.5.0+dfsg1/src/libsumo/TrafficLight.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/TrafficLight.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef TrafficLight_h -#define TrafficLight_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -103,8 +97,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/VariableSpeedSign.cpp sumo-1.6.0+dfsg1/src/libsumo/VariableSpeedSign.cpp --- sumo-1.5.0+dfsg1/src/libsumo/VariableSpeedSign.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/VariableSpeedSign.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,104 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 VariableSpeedSign.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include "Helper.h" +#include "VariableSpeedSign.h" + + +namespace libsumo { +// =========================================================================== +// static member initializations +// =========================================================================== +SubscriptionResults VariableSpeedSign::mySubscriptionResults; +ContextSubscriptionResults VariableSpeedSign::myContextSubscriptionResults; + + +// =========================================================================== +// static member definitions +// =========================================================================== +std::vector +VariableSpeedSign::getIDList() { + std::vector ids; + //for (auto& item : MSNet::getInstance()->getStoppingPlaces(SUMO_TAG_BUS_STOP)) { + // ids.push_back(item.first); + //} + //std::sort(ids.begin(), ids.end()); + return ids; +} + +int +VariableSpeedSign::getIDCount() { + return (int)getIDList().size(); +} + + +std::string +VariableSpeedSign::getParameter(const std::string& /* vssID */, const std::string& /* param */) { + return ""; +} + +void +VariableSpeedSign::setParameter(const std::string& /* vssID */, const std::string& /* key */, const std::string& /* value */) { + //MSVariableSpeedSign* r = const_cast(getVariableSpeedSign(vssID)); + //r->setParameter(key, value); +} + + +LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(VariableSpeedSign, VARIABLESPEEDSIGN) + + +MSLaneSpeedTrigger* +VariableSpeedSign::getVariableSpeedSign(const std::string& id) { + MSLaneSpeedTrigger* s = nullptr; + if (s == nullptr) { + throw TraCIException("VariableSpeedSign '" + id + "' is not known"); + } + return s; +} + + +std::shared_ptr +VariableSpeedSign::makeWrapper() { + return std::make_shared(handleVariable, mySubscriptionResults, myContextSubscriptionResults); +} + + +bool +VariableSpeedSign::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) { + switch (variable) { + case TRACI_ID_LIST: + return wrapper->wrapStringList(objID, variable, getIDList()); + case ID_COUNT: + return wrapper->wrapInt(objID, variable, getIDCount()); + default: + return false; + } +} + + +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/VariableSpeedSign.h sumo-1.6.0+dfsg1/src/libsumo/VariableSpeedSign.h --- sumo-1.5.0+dfsg1/src/libsumo/VariableSpeedSign.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/VariableSpeedSign.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,71 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 VariableSpeedSign.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// C++ TraCI client API implementation +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class MSLaneSpeedTrigger; +namespace libsumo { +class VariableWrapper; +} + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class VariableSpeedSign + * @brief C++ TraCI client API implementation + */ +namespace libsumo { +class VariableSpeedSign { +public: + + static std::vector getIDList(); + static int getIDCount(); + static std::string getParameter(const std::string& vssID, const std::string& param); + + static void setParameter(const std::string& vssID, const std::string& key, const std::string& value); // not needed so far + + LIBSUMO_SUBSCRIPTION_API + + static std::shared_ptr makeWrapper(); + + static bool handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper); + +private: + static MSLaneSpeedTrigger* getVariableSpeedSign(const std::string& id); + +private: + static SubscriptionResults mySubscriptionResults; + static ContextSubscriptionResults myContextSubscriptionResults; + + /// @brief invalidated standard constructor + VariableSpeedSign() = delete; +}; + + +} diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Vehicle.cpp sumo-1.6.0+dfsg1/src/libsumo/Vehicle.cpp --- sumo-1.5.0+dfsg1/src/libsumo/Vehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Vehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // C++ Vehicle API /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -42,6 +38,7 @@ #include #include #include +#include #include #include #include "Helper.h" @@ -49,6 +46,8 @@ #include "Polygon.h" #include "Vehicle.h" +#define CALL_MICRO_FUN(veh, fun, mesoResult) ((dynamic_cast(veh) == nullptr ? (mesoResult) : dynamic_cast(veh)->fun)) + // =========================================================================== // debug defines @@ -104,34 +103,34 @@ double Vehicle::getSpeed(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getSpeed() : INVALID_DOUBLE_VALUE; } double Vehicle::getLateralSpeed(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return isVisible(veh) ? veh->getLaneChangeModel().getSpeedLat() : INVALID_DOUBLE_VALUE; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return isVisible(veh) ? CALL_MICRO_FUN(veh, getLaneChangeModel().getSpeedLat(), 0) : INVALID_DOUBLE_VALUE; } double Vehicle::getAcceleration(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return isVisible(veh) ? veh->getAcceleration() : INVALID_DOUBLE_VALUE; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return isVisible(veh) ? CALL_MICRO_FUN(veh, getAcceleration(), 0) : INVALID_DOUBLE_VALUE; } double Vehicle::getSpeedWithoutTraCI(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return isVisible(veh) ? veh->getSpeedWithoutTraciInfluence() : INVALID_DOUBLE_VALUE; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return isVisible(veh) ? CALL_MICRO_FUN(veh, getSpeedWithoutTraciInfluence(), veh->getSpeed()) : INVALID_DOUBLE_VALUE; } TraCIPosition Vehicle::getPosition(const std::string& vehicleID, const bool includeZ) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); if (isVisible(veh)) { return Helper::makeTraCIPosition(veh->getPosition(), includeZ); } @@ -147,36 +146,36 @@ double Vehicle::getAngle(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? GeomHelper::naviDegree(veh->getAngle()) : INVALID_DOUBLE_VALUE; } double Vehicle::getSlope(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return veh->isOnRoad() ? veh->getSlope() : INVALID_DOUBLE_VALUE; } std::string Vehicle::getRoadID(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return isVisible(veh) ? veh->getLane()->getEdge().getID() : ""; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return isVisible(veh) ? CALL_MICRO_FUN(veh, getLane()->getEdge().getID(), veh->getEdge()->getID()) : ""; } std::string Vehicle::getLaneID(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return veh->isOnRoad() ? veh->getLane()->getID() : ""; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return veh->isOnRoad() ? CALL_MICRO_FUN(veh, getLane()->getID(), "") : ""; } int Vehicle::getLaneIndex(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return veh->isOnRoad() ? veh->getLane()->getIndex() : INVALID_INT_VALUE; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return veh->isOnRoad() ? CALL_MICRO_FUN(veh, getLane()->getIndex(), INVALID_INT_VALUE) : INVALID_INT_VALUE; } @@ -194,7 +193,7 @@ int Vehicle::getRouteIndex(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return veh->hasDeparted() ? veh->getRoutePosition() : INVALID_INT_VALUE; } @@ -206,61 +205,61 @@ double Vehicle::getLanePosition(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return veh->isOnRoad() ? veh->getPositionOnLane() : INVALID_DOUBLE_VALUE; } double Vehicle::getLateralLanePosition(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - return veh->isOnRoad() ? veh->getLateralPositionOnLane() : INVALID_DOUBLE_VALUE; + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return veh->isOnRoad() ? CALL_MICRO_FUN(veh, getLateralPositionOnLane(), 0) : INVALID_DOUBLE_VALUE; } double Vehicle::getCO2Emission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getCO2Emissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getCOEmission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getCOEmissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getHCEmission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getHCEmissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getPMxEmission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getPMxEmissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getNOxEmission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getNOxEmissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getFuelConsumption(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getFuelConsumption() : INVALID_DOUBLE_VALUE; } double Vehicle::getNoiseEmission(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getHarmonoise_NoiseEmissions() : INVALID_DOUBLE_VALUE; } double Vehicle::getElectricityConsumption(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); return isVisible(veh) ? veh->getElectricityConsumption() : INVALID_DOUBLE_VALUE; } @@ -281,7 +280,7 @@ std::pair Vehicle::getLeader(const std::string& vehicleID, double dist) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); if (veh->isOnRoad()) { std::pair leaderInfo = veh->getLeader(dist); return std::make_pair( @@ -295,13 +294,14 @@ double Vehicle::getWaitingTime(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getWaitingSeconds(); + return STEPS2TIME(Helper::getVehicle(vehicleID)->getWaitingTime()); } double Vehicle::getAccumulatedWaitingTime(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getAccumulatedWaitingSeconds(); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return CALL_MICRO_FUN(veh, getAccumulatedWaitingSeconds(), INVALID_DOUBLE_VALUE); } @@ -333,7 +333,7 @@ std::vector Vehicle::getRoute(const std::string& vehicleID) { std::vector result; - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); const MSRoute& r = veh->getRoute(); for (MSRouteIterator i = r.begin(); i != r.end(); ++i) { result.push_back((*i)->getID()); @@ -344,15 +344,16 @@ int Vehicle::getSignals(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getSignals(); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return CALL_MICRO_FUN(veh, getSignals(), MSVehicle::VEH_SIGNAL_NONE); } std::vector Vehicle::getBestLanes(const std::string& vehicleID) { std::vector result; - MSVehicle* veh = Helper::getVehicle(vehicleID); - if (veh->isOnRoad()) { + MSVehicle* veh = dynamic_cast(Helper::getVehicle(vehicleID)); + if (veh != nullptr && veh->isOnRoad()) { const std::vector& bestLanes = veh->getBestLanes(); for (std::vector::const_iterator i = bestLanes.begin(); i != bestLanes.end(); ++i) { TraCIBestLanesData bld; @@ -377,8 +378,12 @@ std::vector Vehicle::getNextTLS(const std::string& vehicleID) { std::vector result; - MSVehicle* veh = Helper::getVehicle(vehicleID); - if (veh->isOnRoad()) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (!vehicle->isOnRoad()) { + return result; + } + if (veh != nullptr) { const MSLane* lane = veh->getLane(); const std::vector& bestLaneConts = veh->getBestLanesContinuation(lane); double seen = lane->getLength() - veh->getPositionOnLane(); @@ -428,6 +433,8 @@ break; } } + } else { + WRITE_WARNING("getNextTLS not yet implemented for meso"); } return result; } @@ -436,36 +443,40 @@ std::vector Vehicle::getNextStops(const std::string& vehicleID) { std::vector result; - MSVehicle* veh = Helper::getVehicle(vehicleID); - std::list stops = veh->getMyStops(); - for (std::list::iterator it = stops.begin(); it != stops.end(); ++it) { - if (!it->collision) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("getNextStops not yet implemented for meso"); + return result; + } + for (const MSVehicle::Stop& stop : veh->getStops()) { + if (!stop.collision) { TraCINextStopData nsd; - nsd.lane = it->lane->getID(); - nsd.endPos = it->getEndPos(*veh); + nsd.lane = stop.lane->getID(); + nsd.endPos = stop.getEndPos(*veh); // all optionals, only one can be set - if (it->busstop != nullptr) { - nsd.stoppingPlaceID = it->busstop->getID(); + if (stop.busstop != nullptr) { + nsd.stoppingPlaceID = stop.busstop->getID(); } - if (it->containerstop != nullptr) { - nsd.stoppingPlaceID = it->containerstop->getID(); + if (stop.containerstop != nullptr) { + nsd.stoppingPlaceID = stop.containerstop->getID(); } - if (it->parkingarea != nullptr) { - nsd.stoppingPlaceID = it->parkingarea->getID(); + if (stop.parkingarea != nullptr) { + nsd.stoppingPlaceID = stop.parkingarea->getID(); } - if (it->chargingStation != nullptr) { - nsd.stoppingPlaceID = it->chargingStation->getID(); + if (stop.chargingStation != nullptr) { + nsd.stoppingPlaceID = stop.chargingStation->getID(); } - nsd.stopFlags = ((it->reached ? 1 : 0) + - (it->pars.parking ? 2 : 0) + - (it->pars.triggered ? 4 : 0) + - (it->pars.containerTriggered ? 8 : 0) + - (it->busstop != nullptr ? 16 : 0) + - (it->containerstop != nullptr ? 32 : 0) + - (it->chargingStation != nullptr ? 64 : 0) + - (it->parkingarea != nullptr ? 128 : 0)); - nsd.duration = STEPS2TIME(it->reached ? it->duration : it->pars.duration); - nsd.until = STEPS2TIME(it->pars.until); + nsd.stopFlags = ((stop.reached ? 1 : 0) + + (stop.pars.parking ? 2 : 0) + + (stop.pars.triggered ? 4 : 0) + + (stop.pars.containerTriggered ? 8 : 0) + + (stop.busstop != nullptr ? 16 : 0) + + (stop.containerstop != nullptr ? 32 : 0) + + (stop.chargingStation != nullptr ? 64 : 0) + + (stop.parkingarea != nullptr ? 128 : 0)); + nsd.duration = STEPS2TIME(stop.reached ? stop.duration : stop.pars.duration); + nsd.until = STEPS2TIME(stop.pars.until); result.push_back(nsd); } } @@ -475,7 +486,12 @@ int Vehicle::getStopState(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("getStopState not yet implemented for meso"); + return 0; + } int result = 0; if (veh->isStopped()) { const MSVehicle::Stop& stop = veh->getNextStop(); @@ -494,7 +510,7 @@ double Vehicle::getDistance(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); if (veh->isOnRoad()) { return veh->getOdometer(); } else { @@ -505,10 +521,12 @@ double Vehicle::getDrivingDistance(const std::string& vehicleID, const std::string& edgeID, double position, int /* laneIndex */) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + MSVehicle* microVeh = dynamic_cast(veh); if (veh->isOnRoad()) { + const MSEdge* edge = microVeh != nullptr ? &veh->getLane()->getEdge() : veh->getEdge(); double distance = veh->getRoute().getDistanceBetween(veh->getPositionOnLane(), position, - &veh->getLane()->getEdge(), Helper::getEdge(edgeID), true, veh->getRoutePosition()); + edge, Helper::getEdge(edgeID), true, veh->getRoutePosition()); if (distance == std::numeric_limits::max()) { return INVALID_DOUBLE_VALUE; } @@ -521,7 +539,10 @@ double Vehicle::getDrivingDistance2D(const std::string& vehicleID, double x, double y) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + if (veh == nullptr) { + return INVALID_DOUBLE_VALUE; + } if (veh->isOnRoad()) { std::pair roadPos = Helper::convertCartesianToRoadMap(Position(x, y), veh->getVehicleType().getVehicleClass()); double distance = veh->getRoute().getDistanceBetween(veh->getPositionOnLane(), roadPos.second, @@ -538,12 +559,8 @@ double Vehicle::getAllowedSpeed(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - if (veh->isOnRoad()) { - return veh->getLane()->getVehicleMaxSpeed(veh); - } else { - return INVALID_DOUBLE_VALUE; - } + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return veh->isOnRoad() ? CALL_MICRO_FUN(veh, getLane()->getVehicleMaxSpeed(veh), veh->getEdge()->getVehicleMaxSpeed(veh)) : INVALID_DOUBLE_VALUE; } @@ -555,19 +572,21 @@ int Vehicle::getSpeedMode(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getInfluencer().getSpeedMode(); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return CALL_MICRO_FUN(veh, getInfluencer().getSpeedMode(), INVALID_INT_VALUE); } int Vehicle::getLaneChangeMode(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getInfluencer().getLaneChangeMode(); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + return CALL_MICRO_FUN(veh, getInfluencer().getLaneChangeMode(), INVALID_INT_VALUE); } int Vehicle::getRoutingMode(const std::string& vehicleID) { - return Helper::getVehicle(vehicleID)->getInfluencer().getRoutingMode(); + return Helper::getVehicle(vehicleID)->getBaseInfluencer().getRoutingMode(); } @@ -585,18 +604,16 @@ std::pair Vehicle::getLaneChangeState(const std::string& vehicleID, int direction) { - MSVehicle* veh = Helper::getVehicle(vehicleID); - if (veh->isOnRoad()) { - return veh->getLaneChangeModel().getSavedState(direction); - } else { - return std::make_pair((int)LCA_UNKNOWN, (int)LCA_UNKNOWN); - } + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + auto undefined = std::make_pair((int)LCA_UNKNOWN, (int)LCA_UNKNOWN); + return veh->isOnRoad() ? CALL_MICRO_FUN(veh, getLaneChangeModel().getSavedState(direction), undefined) : undefined; } std::string Vehicle::getParameter(const std::string& vehicleID, const std::string& key) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + MSVehicle* microVeh = dynamic_cast(veh); if (StringUtils::startsWith(key, "device.")) { StringTokenizer tok(key, "."); if (tok.size() < 3) { @@ -608,16 +625,22 @@ throw TraCIException("Vehicle '" + vehicleID + "' does not support device parameter '" + key + "' (" + e.what() + ")."); } } else if (StringUtils::startsWith(key, "laneChangeModel.")) { + if (microVeh == nullptr) { + throw TraCIException("Meso Vehicle '" + vehicleID + "' does not support laneChangeModel parameters."); + } const std::string attrName = key.substr(16); try { - return veh->getLaneChangeModel().getParameter(attrName); + return microVeh->getLaneChangeModel().getParameter(attrName); } catch (InvalidArgument& e) { throw TraCIException("Vehicle '" + vehicleID + "' does not support laneChangeModel parameter '" + key + "' (" + e.what() + ")."); } } else if (StringUtils::startsWith(key, "carFollowModel.")) { + if (microVeh == nullptr) { + throw TraCIException("Meso Vehicle '" + vehicleID + "' does not support carFollowModel parameters."); + } const std::string attrName = key.substr(15); try { - return veh->getCarFollowModel().getParameter(veh, attrName); + return microVeh->getCarFollowModel().getParameter(microVeh, attrName); } catch (InvalidArgument& e) { throw TraCIException("Vehicle '" + vehicleID + "' does not support carFollowModel parameter '" + key + "' (" + e.what() + ")."); } @@ -639,8 +662,12 @@ bool queryLeaders = (2 & mode) != 0; bool blockersOnly = (4 & mode) != 0; - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); std::vector > neighs; + if (veh == nullptr) { + return neighs; + } auto& lcm = veh->getLaneChangeModel(); #ifdef DEBUG_NEIGHBORS @@ -700,6 +727,48 @@ } +double +Vehicle::getFollowSpeed(const std::string& vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("getFollowSpeed not applicable for meso"); + return INVALID_DOUBLE_VALUE; + } + MSVehicle* leader = dynamic_cast(MSNet::getInstance()->getVehicleControl().getVehicle(leaderID)); + return veh->getCarFollowModel().followSpeed(veh, speed, gap, leaderSpeed, leaderMaxDecel, leader); +} + + +double +Vehicle::getSecureGap(const std::string& vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("getSecureGap not applicable for meso"); + return INVALID_DOUBLE_VALUE; + } + MSVehicle* leader = dynamic_cast(MSNet::getInstance()->getVehicleControl().getVehicle(leaderID)); + return veh->getCarFollowModel().getSecureGap(veh, leader, speed, leaderSpeed, leaderMaxDecel); +} + + +double +Vehicle::getStopSpeed(const std::string& vehicleID, const double speed, double gap) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("getStopSpeed not applicable for meso"); + return INVALID_DOUBLE_VALUE; + } + return veh->getCarFollowModel().stopSpeed(veh, speed, gap); +} + +double +Vehicle::getStopDelay(const std::string& vehicleID) { + return Helper::getVehicle(vehicleID)->getStopDelay(); +} + std::string Vehicle::getEmissionClass(const std::string& vehicleID) { return PollutantsInterface::getName(Helper::getVehicleType(vehicleID).getEmissionClass()); @@ -745,7 +814,14 @@ double Vehicle::getLastActionTime(const std::string& vehicleID) { - return STEPS2TIME(Helper::getVehicle(vehicleID)->getLastActionTime()); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + MSVehicle* microVeh = dynamic_cast(veh); + if (microVeh != nullptr) { + return STEPS2TIME(microVeh->getLastActionTime()); + } else { + MEVehicle* mesoVeh = dynamic_cast(veh); + return STEPS2TIME(mesoVeh->getEventTime()); + } } @@ -824,7 +900,12 @@ int flags, double startPos, double until) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("setStop not yet implemented for meso"); + return; + } // optional stop flags bool parking = false; bool triggered = false; @@ -884,7 +965,12 @@ void Vehicle::rerouteParkingArea(const std::string& vehicleID, const std::string& parkingAreaID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("rerouteParkingArea not yet implemented for meso"); + return; + } std::string error; // Forward command to vehicle if (!veh->rerouteParkingArea(parkingAreaID, error)) { @@ -894,7 +980,12 @@ void Vehicle::resume(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("resume not yet implemented for meso"); + return; + } if (!veh->hasStops()) { throw TraCIException("Failed to resume vehicle '" + veh->getID() + "', it has no stops."); } @@ -913,7 +1004,7 @@ void Vehicle::changeTarget(const std::string& vehicleID, const std::string& edgeID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); const MSEdge* destEdge = MSEdge::dictionary(edgeID); const bool onInit = isOnInit(vehicleID); if (destEdge == nullptr) { @@ -922,7 +1013,7 @@ // build a new route between the vehicle's current edge and destination edge ConstMSEdgeVector newRoute; const MSEdge* currentEdge = veh->getRerouteOrigin(); - veh->getInfluencer().getRouterTT(veh->getRNGIndex()).compute( + veh->getBaseInfluencer().getRouterTT(veh->getRNGIndex(), veh->getVClass()).compute( currentEdge, destEdge, (const MSVehicle * const)veh, MSNet::getInstance()->getCurrentTimeStep(), newRoute); // replace the vehicle's route by the new one (cost is updated by call to reroute()) if (!veh->replaceRouteEdges(newRoute, -1, 0, "traci:changeTarget", onInit)) { @@ -930,7 +1021,7 @@ } // route again to ensure usage of via/stops try { - veh->reroute(MSNet::getInstance()->getCurrentTimeStep(), "traci:changeTarget", veh->getInfluencer().getRouterTT(veh->getRNGIndex()), onInit); + veh->reroute(MSNet::getInstance()->getCurrentTimeStep(), "traci:changeTarget", veh->getBaseInfluencer().getRouterTT(veh->getRNGIndex(), veh->getVClass()), onInit); } catch (ProcessError& e) { throw TraCIException(e.what()); } @@ -939,30 +1030,50 @@ void Vehicle::changeLane(const std::string& vehicleID, int laneIndex, double duration) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("changeLane not applicable for meso"); + return; + } + std::vector > laneTimeLine; laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), laneIndex)); laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(duration), laneIndex)); - Helper::getVehicle(vehicleID)->getInfluencer().setLaneTimeLine(laneTimeLine); + veh->getInfluencer().setLaneTimeLine(laneTimeLine); } void Vehicle::changeLaneRelative(const std::string& vehicleID, int indexOffset, double duration) { + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("changeLaneRelative not applicable for meso"); + return; + } + std::vector > laneTimeLine; - MSVehicle* veh = Helper::getVehicle(vehicleID); int laneIndex = veh->getLaneIndex() + indexOffset; if (laneIndex < 0 && !veh->getLaneChangeModel().isOpposite()) { WRITE_WARNING("Ignoring indexOffset -1 for vehicle '" + vehicleID + "' which is already on laneIndex 0"); } else { laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), laneIndex)); laneTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(duration), laneIndex)); - Helper::getVehicle(vehicleID)->getInfluencer().setLaneTimeLine(laneTimeLine); + veh->getInfluencer().setLaneTimeLine(laneTimeLine); } } void Vehicle::changeSublane(const std::string& vehicleID, double latDist) { - Helper::getVehicle(vehicleID)->getInfluencer().setSublaneChange(latDist); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("changeSublane not applicable for meso"); + return; + } + + veh->getInfluencer().setSublaneChange(latDist); } @@ -1003,7 +1114,7 @@ route = MSRoute::dictionary(dummyRouteID); if (route == nullptr) { for (MSEdge* e : MSEdge::getAllEdges()) { - if (e->getFunction() == EDGEFUNC_NORMAL && (e->getPermissions() & vclass) == vclass) { + if (e->getFunction() == SumoXMLEdgeFunc::NORMAL && (e->getPermissions() & vclass) == vclass) { std::vector edges; edges.push_back(e->getID()); libsumo::Route::add(dummyRouteID, edges); @@ -1066,8 +1177,14 @@ SUMOVehicleParameter* params = new SUMOVehicleParameter(vehicleParams); try { SUMOVehicle* vehicle = MSNet::getInstance()->getVehicleControl().buildVehicle(params, route, vehicleType, true, false); + if (fromTaz == "" && !route->getEdges().front()->validateDepartSpeed(*vehicle)) { + MSNet::getInstance()->getVehicleControl().deleteVehicle(vehicle, true); + throw TraCIException("Departure speed for vehicle '" + vehicleID + "' is too high for the departure edge '" + route->getEdges().front()->getID() + "'."); + } MSNet::getInstance()->getVehicleControl().addVehicle(vehicleParams.id, vehicle); - MSNet::getInstance()->getInsertionControl().add(vehicle); + if (vehicleParams.departProcedure != DEPART_TRIGGERED && vehicleParams.departProcedure != DEPART_CONTAINER_TRIGGERED) { + MSNet::getInstance()->getInsertionControl().add(vehicle); + } } catch (ProcessError& e) { throw TraCIException(e.what()); } @@ -1077,7 +1194,12 @@ void Vehicle::moveToXY(const std::string& vehicleID, const std::string& edgeID, const int laneIndex, const double x, const double y, double angle, const int keepRoute) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("moveToXY not yet implemented for meso"); + return; + } const bool doKeepRoute = (keepRoute & 1) != 0 && veh->getID() != "VTD_EGO"; const bool mayLeaveNetwork = (keepRoute & 2) != 0; const bool ignorePermissions = (keepRoute & 4) != 0; @@ -1188,7 +1310,13 @@ void Vehicle::slowDown(const std::string& vehicleID, double speed, double duration) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("slowDown not applicable for meso"); + return; + } + std::vector > speedTimeLine; speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), veh->getSpeed())); speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep() + TIME2STEPS(duration), speed)); @@ -1197,10 +1325,16 @@ void Vehicle::openGap(const std::string& vehicleID, double newTimeHeadway, double newSpaceHeadway, double duration, double changeRate, double maxDecel, const std::string& referenceVehID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("openGap not applicable for meso"); + return; + } + MSVehicle* refVeh = nullptr; if (referenceVehID != "") { - refVeh = Helper::getVehicle(referenceVehID); + refVeh = dynamic_cast(Helper::getVehicle(referenceVehID)); } const double originalTau = veh->getVehicleType().getCarFollowModel().getHeadwayTime(); if (newTimeHeadway == -1) { @@ -1215,7 +1349,13 @@ void Vehicle::deactivateGapControl(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("deactivateGapControl not applicable for meso"); + return; + } + if (veh->hasInfluencer()) { veh->getInfluencer().deactivateGapController(); } @@ -1228,7 +1368,13 @@ void Vehicle::setSpeed(const std::string& vehicleID, double speed) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("setSpeed not yet implemented for meso"); + return; + } + std::vector > speedTimeLine; if (speed >= 0) { speedTimeLine.push_back(std::make_pair(MSNet::getInstance()->getCurrentTimeStep(), speed)); @@ -1239,17 +1385,31 @@ void Vehicle::setSpeedMode(const std::string& vehicleID, int speedMode) { - Helper::getVehicle(vehicleID)->getInfluencer().setSpeedMode(speedMode); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("setSpeedMode not yet implemented for meso"); + return; + } + + veh->getInfluencer().setSpeedMode(speedMode); } void Vehicle::setLaneChangeMode(const std::string& vehicleID, int laneChangeMode) { - Helper::getVehicle(vehicleID)->getInfluencer().setLaneChangeMode(laneChangeMode); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("setLaneChangeMode not applicable for meso"); + return; + } + + veh->getInfluencer().setLaneChangeMode(laneChangeMode); } void Vehicle::setRoutingMode(const std::string& vehicleID, int routingMode) { - Helper::getVehicle(vehicleID)->getInfluencer().setRoutingMode(routingMode); + Helper::getVehicle(vehicleID)->getBaseInfluencer().setRoutingMode(routingMode); } void @@ -1263,7 +1423,7 @@ void Vehicle::setRouteID(const std::string& vehicleID, const std::string& routeID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); const MSRoute* r = MSRoute::dictionary(routeID); if (r == nullptr) { throw TraCIException("The route '" + routeID + "' is not known."); @@ -1288,7 +1448,7 @@ void Vehicle::setRoute(const std::string& vehicleID, const std::vector& edgeIDs) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); ConstMSEdgeVector edges; try { MSEdge::parseEdgesList(edgeIDs, edges, ""); @@ -1305,7 +1465,13 @@ void Vehicle::updateBestLanes(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("updateBestLanes not applicable for meso"); + return; + } + veh->updateBestLanes(true); } @@ -1313,7 +1479,7 @@ void Vehicle::setAdaptedTraveltime(const std::string& vehicleID, const std::string& edgeID, double time, double begSeconds, double endSeconds) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); MSEdge* edge = MSEdge::dictionary(edgeID); if (edge == nullptr) { throw TraCIException("Edge '" + edgeID + "' is not known."); @@ -1339,7 +1505,7 @@ void Vehicle::setEffort(const std::string& vehicleID, const std::string& edgeID, double effort, double begSeconds, double endSeconds) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); MSEdge* edge = MSEdge::dictionary(edgeID); if (edge == nullptr) { throw TraCIException("Edge '" + edgeID + "' is not known."); @@ -1365,15 +1531,15 @@ void Vehicle::rerouteTraveltime(const std::string& vehicleID, const bool currentTravelTimes) { UNUSED_PARAMETER(currentTravelTimes); // !!! see #5943 - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); veh->reroute(MSNet::getInstance()->getCurrentTimeStep(), "traci:rerouteTraveltime", - veh->getInfluencer().getRouterTT(veh->getRNGIndex()), isOnInit(vehicleID)); + veh->getBaseInfluencer().getRouterTT(veh->getRNGIndex(), veh->getVClass()), isOnInit(vehicleID)); } void Vehicle::rerouteEffort(const std::string& vehicleID) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); veh->reroute(MSNet::getInstance()->getCurrentTimeStep(), "traci:rerouteEffort", MSNet::getInstance()->getRouterEffort(veh->getRNGIndex()), isOnInit(vehicleID)); } @@ -1381,7 +1547,13 @@ void Vehicle::setSignals(const std::string& vehicleID, int signals) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("setSignals not applicable for meso"); + return; + } + // set influencer to make the change persistent veh->getInfluencer().setSignals(signals); // set them now so that getSignals returns the correct value @@ -1394,7 +1566,13 @@ void Vehicle::moveTo(const std::string& vehicleID, const std::string& laneID, double position) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_WARNING("moveTo not yet implemented for meso"); + return; + } + MSLane* l = MSLane::dictionary(laneID); if (l == nullptr) { throw TraCIException("Unknown lane '" + laneID + "'."); @@ -1437,7 +1615,13 @@ WRITE_ERROR("Invalid action step length (<0). Ignoring command setActionStepLength()."); return; } - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* vehicle = Helper::getVehicle(vehicleID); + MSVehicle* veh = dynamic_cast(vehicle); + if (veh == nullptr) { + WRITE_ERROR("setActionStepLength not applicable for meso"); + return; + } + if (actionStepLength == 0.) { veh->resetActionOffset(); } else { @@ -1448,7 +1632,7 @@ void Vehicle::remove(const std::string& vehicleID, char reason) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); MSMoveReminder::Notification n = MSMoveReminder::NOTIFICATION_ARRIVED; switch (reason) { case REMOVE_TELEPORT: @@ -1465,7 +1649,7 @@ n = MSMoveReminder::NOTIFICATION_ARRIVED; break; case REMOVE_VAPORIZED: - n = MSMoveReminder::NOTIFICATION_VAPORIZED; + n = MSMoveReminder::NOTIFICATION_VAPORIZED_TRACI; break; case REMOVE_TELEPORT_ARRIVED: n = MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED; @@ -1476,9 +1660,12 @@ if (veh->hasDeparted()) { veh->onRemovalFromNet(n); if (veh->getLane() != nullptr) { - veh->getLane()->removeVehicle(veh, n); + veh->getLane()->removeVehicle(dynamic_cast(veh), n); + } + MSVehicle* microVeh = dynamic_cast(veh); + if (microVeh != nullptr) { + MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); } - MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); } else { MSNet::getInstance()->getInsertionControl().alreadyDeparted(veh); MSNet::getInstance()->getVehicleControl().deleteVehicle(veh, true); @@ -1508,7 +1695,7 @@ void Vehicle::setVia(const std::string& vehicleID, const std::vector& via) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); try { // ensure edges exist ConstMSEdgeVector edges; @@ -1624,7 +1811,8 @@ void Vehicle::setParameter(const std::string& vehicleID, const std::string& key, const std::string& value) { - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); + MSVehicle* microVeh = dynamic_cast(veh); if (StringUtils::startsWith(key, "device.")) { StringTokenizer tok(key, "."); if (tok.size() < 3) { @@ -1636,16 +1824,22 @@ throw TraCIException("Vehicle '" + vehicleID + "' does not support device parameter '" + key + "' (" + e.what() + ")."); } } else if (StringUtils::startsWith(key, "laneChangeModel.")) { + if (microVeh == nullptr) { + throw TraCIException("Meso Vehicle '" + vehicleID + "' does not support laneChangeModel parameters."); + } const std::string attrName = key.substr(16); try { - veh->getLaneChangeModel().setParameter(attrName, value); + microVeh->getLaneChangeModel().setParameter(attrName, value); } catch (InvalidArgument& e) { throw TraCIException("Vehicle '" + vehicleID + "' does not support laneChangeModel parameter '" + key + "' (" + e.what() + ")."); } } else if (StringUtils::startsWith(key, "carFollowModel.")) { + if (microVeh == nullptr) { + throw TraCIException("Meso Vehicle '" + vehicleID + "' does not support carFollowModel parameters."); + } const std::string attrName = key.substr(15); try { - veh->getCarFollowModel().setParameter(veh, attrName, value); + microVeh->getCarFollowModel().setParameter(microVeh, attrName, value); } catch (InvalidArgument& e) { throw TraCIException("Vehicle '" + vehicleID + "' does not support carFollowModel parameter '" + key + "' (" + e.what() + ")."); } @@ -1678,7 +1872,7 @@ void Vehicle::highlight(const std::string& vehicleID, const TraCIColor& col, double size, const int alphaMax, const double duration, const int type) { // NOTE: Code is duplicated in large parts in POI.cpp - MSVehicle* veh = Helper::getVehicle(vehicleID); + MSBaseVehicle* veh = Helper::getVehicle(vehicleID); // Center of the highlight circle Position center = veh->getPosition(); @@ -1987,6 +2181,8 @@ return wrapper->wrapDouble(objID, variable, getAcceleration(objID)); case VAR_LASTACTIONTIME: return wrapper->wrapDouble(objID, variable, getLastActionTime(objID)); + case VAR_STOP_DELAY: + return wrapper->wrapDouble(objID, variable, getStopDelay(objID)); case VAR_LEADER: { double dist = 0.; // this fallback is needed since the very first call right on subscribing has no parameters set @@ -2008,4 +2204,5 @@ } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/Vehicle.h sumo-1.6.0+dfsg1/src/libsumo/Vehicle.h --- sumo-1.5.0+dfsg1/src/libsumo/Vehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/Vehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // C++ Vehicle API /****************************************************************************/ -#ifndef Vehicle_h -#define Vehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -106,8 +100,12 @@ static std::vector getVia(const std::string& vehicleID); static std::pair getLaneChangeState(const std::string& vehicleID, int direction); static double getLastActionTime(const std::string& vehicleID); - static std::string getParameter(const std::string& vehicleID, const std::string& key); + static std::string getParameter(const std::string& vehicleID, const std::string& param); static std::vector > getNeighbors(const std::string& vehicleID, const int mode); + static double getFollowSpeed(const std::string& vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID = ""); + static double getSecureGap(const std::string& vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID = ""); + static double getStopSpeed(const std::string& vehicleID, double speed, double gap); + static double getStopDelay(const std::string& vehicleID); /// @} LIBSUMO_VEHICLE_TYPE_GETTER @@ -129,7 +127,7 @@ static void resume(const std::string& vehicleID); - static void add(const std::string& vehicleID, + static void add(const std::string& vehID, const std::string& routeID, const std::string& typeID = "DEFAULT_VEHTYPE", const std::string& depart = "now", @@ -175,7 +173,7 @@ static void remove(const std::string& vehicleID, char reason = REMOVE_VAPORIZED); static void setLine(const std::string& vehicleID, const std::string& line); static void setVia(const std::string& vehicleID, const std::vector& via); - static void setParameter(const std::string& vehicleID, const std::string& key, const std::string& value); + static void setParameter(const std::string& vehicleID, const std::string& param, const std::string& value); static void highlight(const std::string& vehicleID, const TraCIColor& col = TraCIColor(255, 0, 0, 255), double size = -1, const int alphaMax = -1, const double duration = -1, const int type = 0); /// @} @@ -235,8 +233,3 @@ } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/libsumo/VehicleType.cpp sumo-1.6.0+dfsg1/src/libsumo/VehicleType.cpp --- sumo-1.5.0+dfsg1/src/libsumo/VehicleType.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/VehicleType.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/libsumo/VehicleType.h sumo-1.6.0+dfsg1/src/libsumo/VehicleType.h --- sumo-1.5.0+dfsg1/src/libsumo/VehicleType.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/libsumo/VehicleType.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ // C++ TraCI client API implementation /****************************************************************************/ -#ifndef SUMO_VehicleType_H -#define SUMO_VehicleType_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -124,8 +118,3 @@ } - - -#endif //SUMO_VehicleType_H - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/marouter/marouter_main.cpp sumo-1.6.0+dfsg1/src/marouter/marouter_main.cpp --- sumo-1.5.0+dfsg1/src/marouter/marouter_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/marouter_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Main for MAROUTER /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -38,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -118,7 +114,8 @@ */ void computeAllPairs(RONet& net, OptionsCont& oc) { - std::ofstream outFile(oc.getString("all-pairs-output").c_str(), std::ios::binary); + OutputDevice::createDeviceByOption("all-pairs-output"); + OutputDevice& outFile = OutputDevice::getDeviceByOption("all-pairs-output"); // build the router typedef DijkstraRouter Dijkstra; Dijkstra router(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), &getTravelTime); @@ -132,7 +129,7 @@ double fromEffort = router.getEffort(ei.edge, nullptr, 0); for (int j = numInternalEdges; j < numTotalEdges; j++) { double heuTT = router.getEdgeInfo(j).effort - fromEffort; - FileHelpers::writeFloat(outFile, heuTT); + outFile << heuTT; /* if (heuTT > ei.edge->getDistanceTo(router.getEdgeInfo(j).edge) @@ -156,7 +153,7 @@ 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() == EDGEFUNC_NORMAL) { + if (edge->getFunction() == SumoXMLEdgeFunc::NORMAL) { dev.openTag(SUMO_TAG_EDGE).writeAttr(SUMO_ATTR_ID, edge->getID()); const double traveltime = edge->getTravelTime(veh, STEPS2TIME(begin)); const double flow = edge->getFlow(STEPS2TIME(begin)); @@ -180,6 +177,7 @@ SUMOAbstractRouter* router = nullptr; const std::string measure = oc.getString("weight-attribute"); const std::string routingAlgorithm = oc.getString("routing-algorithm"); + const double priorityFactor = oc.getFloat("weights.priority-factor"); SUMOTime begin = string2time(oc.getString("begin")); SUMOTime end = string2time(oc.getString("end")); if (oc.isDefault("begin") && matrix.getBegin() >= 0) { @@ -189,7 +187,7 @@ end = matrix.getEnd(); } DijkstraRouter::Operation ttOp = oc.getInt("paths") > 1 ? &ROMAAssignments::getPenalizedTT : &ROEdge::getTravelTimeStatic; - if (measure == "traveltime") { + if (measure == "traveltime" && priorityFactor == 0) { if (routingAlgorithm == "dijkstra") { router = new DijkstraRouter(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), ttOp, nullptr, false, nullptr, net.hasPermissions()); } else if (routingAlgorithm == "astar") { @@ -211,7 +209,13 @@ } } else { DijkstraRouter::Operation op; - if (measure == "CO") { + if (measure == "traveltime") { + if (ROEdge::initPriorityFactor(priorityFactor)) { + op = &ROEdge::getTravelTimeStaticPriorityFactor; + } else { + op = &ROEdge::getTravelTimeStatic; + } + } else if (measure == "CO") { op = &ROEdge::getEmissionEffort; } else if (measure == "CO2") { op = &ROEdge::getEmissionEffort; @@ -228,12 +232,15 @@ } else if (measure == "noise") { op = &ROEdge::getNoiseEffort; } else { - throw ProcessError("Unknown measure (weight attribute '" + measure + "')!"); + op = &ROEdge::getStoredEffort; + } + if (measure != "traveltime" && !net.hasLoadedEffort()) { + WRITE_WARNING("No weight data was loaded for attribute '" + measure + "'."); } router = new DijkstraRouter(ROEdge::getAllEdges(), oc.getBool("ignore-errors"), op, ttOp, false, nullptr, net.hasPermissions()); } try { - const RORouterProvider provider(router, nullptr, nullptr); + const RORouterProvider provider(router, nullptr, nullptr, nullptr); // prepare the output net.openOutput(oc); // process route definitions @@ -287,7 +294,7 @@ const SUMOTime b = MAX2(begin, c->begin); const SUMOTime e = MIN2(end, c->end); const int numVehs = int(c->vehicleNumber * (e - b) / (c->end - c->begin)); - OutputDevice_String od(dev->isBinary(), 1); + OutputDevice_String od(1); od.openTag(SUMO_TAG_FLOW).writeAttr(SUMO_ATTR_ID, oc.getString("prefix") + toString(num++)); od.writeAttr(SUMO_ATTR_BEGIN, time2string(b)).writeAttr(SUMO_ATTR_END, time2string(e)); od.writeAttr(SUMO_ATTR_NUMBER, numVehs); @@ -307,7 +314,7 @@ } const std::string routeDistId = c->origin + "_" + c->destination + "_" + time2string(c->begin) + "_" + time2string(c->end); for (const std::string& id : deps->second) { - OutputDevice_String od(dev->isBinary(), 1); + OutputDevice_String od(1); od.openTag(SUMO_TAG_VEHICLE).writeAttr(SUMO_ATTR_ID, id).writeAttr(SUMO_ATTR_DEPART, time2string(deps->first)); matrix.writeDefaultAttrs(od, oc.getBool("ignore-vehicle-type"), c); od.openTag(SUMO_TAG_ROUTE_DISTRIBUTION); @@ -455,6 +462,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAAssignments.cpp sumo-1.6.0+dfsg1/src/marouter/ROMAAssignments.cpp --- sumo-1.5.0+dfsg1/src/marouter/ROMAAssignments.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAAssignments.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Assignment methods /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -469,6 +464,6 @@ // --------------------------------------------------------------------------- void ROMAAssignments::RoutingTask::run(FXWorkerThread* context) { - myAssign.computePath(myCell, myBegin, myLinkFlow, &static_cast(context)->getVehicleRouter()); + myAssign.computePath(myCell, myBegin, myLinkFlow, &static_cast(context)->getVehicleRouter(SVC_IGNORING)); } #endif diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAAssignments.h sumo-1.6.0+dfsg1/src/marouter/ROMAAssignments.h --- sumo-1.5.0+dfsg1/src/marouter/ROMAAssignments.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAAssignments.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Assignment methods /****************************************************************************/ -#ifndef ROMAAssignments_h -#define ROMAAssignments_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -168,4 +162,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAEdgeBuilder.cpp sumo-1.6.0+dfsg1/src/marouter/ROMAEdgeBuilder.cpp --- sumo-1.5.0+dfsg1/src/marouter/ROMAEdgeBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAEdgeBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Interface for building instances of duarouter-edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "ROMAEdgeBuilder.h" @@ -47,4 +42,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAEdgeBuilder.h sumo-1.6.0+dfsg1/src/marouter/ROMAEdgeBuilder.h --- sumo-1.5.0+dfsg1/src/marouter/ROMAEdgeBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAEdgeBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Interface for building instances of duarouter-edges /****************************************************************************/ -#ifndef ROMAEdgeBuilder_h -#define ROMAEdgeBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -80,9 +74,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAEdge.cpp sumo-1.6.0+dfsg1/src/marouter/ROMAEdge.cpp --- sumo-1.5.0+dfsg1/src/marouter/ROMAEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A basic edge for routing applications /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "ROMAEdge.h" @@ -53,4 +48,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAEdge.h sumo-1.6.0+dfsg1/src/marouter/ROMAEdge.h --- sumo-1.5.0+dfsg1/src/marouter/ROMAEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A basic edge for routing applications /****************************************************************************/ -#ifndef ROMAEdge_h -#define ROMAEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -111,8 +105,3 @@ ROMAEdge& operator=(const ROMAEdge& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAFrame.cpp sumo-1.6.0+dfsg1/src/marouter/ROMAFrame.cpp --- sumo-1.5.0+dfsg1/src/marouter/ROMAFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Sets and checks options for ma-routing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -160,6 +155,9 @@ oc.addSynonyme("weights.expand", "expand-weights", true); oc.addDescription("weights.expand", "Processing", "Expand weights behind the simulation's end"); + oc.doRegister("weights.priority-factor", new Option_Float(0)); + oc.addDescription("weights.priority-factor", "Processing", "Consider edge priorities in addition to travel times, weighted by factor"); + oc.doRegister("routing-algorithm", new Option_String("dijkstra")); oc.addDescription("routing-algorithm", "Processing", "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']"); @@ -302,6 +300,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMAFrame.h sumo-1.6.0+dfsg1/src/marouter/ROMAFrame.h --- sumo-1.5.0+dfsg1/src/marouter/ROMAFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMAFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Sets and checks options for ma-routing /****************************************************************************/ -#ifndef ROMAFrame_h -#define ROMAFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -71,9 +65,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMARouteHandler.cpp sumo-1.6.0+dfsg1/src/marouter/ROMARouteHandler.cpp --- sumo-1.5.0+dfsg1/src/marouter/ROMARouteHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMARouteHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Parser and container for routes during their loading /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/marouter/ROMARouteHandler.h sumo-1.6.0+dfsg1/src/marouter/ROMARouteHandler.h --- sumo-1.5.0+dfsg1/src/marouter/ROMARouteHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/marouter/ROMARouteHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parser and container for routes during their loading /****************************************************************************/ -#ifndef ROMARouteHandler_h -#define ROMARouteHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -88,9 +82,3 @@ ROMARouteHandler& operator=(const ROMARouteHandler& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEInductLoop.cpp sumo-1.6.0+dfsg1/src/mesogui/GUIMEInductLoop.cpp --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The gui-version of the MEInductLoop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -176,4 +171,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEInductLoop.h sumo-1.6.0+dfsg1/src/mesogui/GUIMEInductLoop.h --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The gui-version of the MEInductLoop /****************************************************************************/ -#ifndef GUIMEInductLoop_h -#define GUIMEInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -137,9 +131,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicleControl.cpp sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicleControl.cpp --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicleControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicleControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The class responsible for building and deletion of meso vehicles (gui-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -51,10 +46,8 @@ GUIMEVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, MSVehicleType* type, const bool ignoreStopErrors, const bool fromRouteFile) { - myLoadedVehNo++; MSBaseVehicle* built = new GUIMEVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : nullptr)); - built->addStops(ignoreStopErrors); - MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); + initVehicle(built, ignoreStopErrors); return built; } @@ -100,6 +93,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicleControl.h sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicleControl.h --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicleControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicleControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The class responsible for building and deletion of meso vehicles (gui-version) /****************************************************************************/ -#ifndef GUIMEVehicleControl_h -#define GUIMEVehicleControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -116,9 +110,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicle.cpp sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicle.cpp --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -84,6 +79,8 @@ // new FunctionBinding(this, &GUIMEVehicle::getLastLaneChangeOffset)); ret->mkItem("desired depart [s]", false, time2string(getParameter().depart)); ret->mkItem("depart delay [s]", false, time2string(getDepartDelay())); + ret->mkItem("odometer [m]", true, + new FunctionBinding(this, &MSBaseVehicle::getOdometer)); if (getParameter().repetitionNumber < std::numeric_limits::max()) { ret->mkItem("remaining [#]", false, (int) getParameter().repetitionNumber - getParameter().repetitionsDone); } @@ -213,13 +210,17 @@ void -GUIMEVehicle::drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, const RGBColor& /*col*/) const { +GUIMEVehicle::drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, bool noLoop, const RGBColor& /*col*/) const { const double exaggeration = s.vehicleSize.getExaggeration(s, this); - MSRouteIterator i = future ? myCurrEdge : r.begin(); + MSRouteIterator start = future ? myCurrEdge : r.begin(); + MSRouteIterator i = start; for (; i != r.end(); ++i) { const GUILane* lane = static_cast((*i)->getLanes()[0]); GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), 1.0); GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration); + if (noLoop && i != start && (*i) == (*start)) { + break; + } } } @@ -259,5 +260,6 @@ GUIMEVehicle::selectBlockingFoes() const { // @todo possibly we could compute something reasonable here } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicle.h sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicle.h --- sumo-1.5.0+dfsg1/src/mesogui/GUIMEVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesogui/GUIMEVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A MSVehicle extended by some values for usage within the gui /****************************************************************************/ -#ifndef GUIMEVehicle_h -#define GUIMEVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -103,7 +97,7 @@ /** @brief Draws the route * @param[in] r The route to draw */ - void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, const RGBColor& col) const; + void drawRouteHelper(const GUIVisualizationSettings& s, const MSRoute& r, bool future, bool noLoop, const RGBColor& col) const; /// @brief retrieve information about the current stop state std::string getStopInfo() const; @@ -133,9 +127,3 @@ GUIParameterTableWindow* getTypeParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEInductLoop.cpp sumo-1.6.0+dfsg1/src/mesosim/MEInductLoop.cpp --- sumo-1.5.0+dfsg1/src/mesosim/MEInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -63,10 +63,9 @@ 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, stopTime - startTime, (double)mySegment->getEdge().getLanes().size(), -1.0); + myMeanData.write(dev, 0, stopTime - startTime, (double)mySegment->getEdge().getLanes().size(), -1.0); myMeanData.reset(); } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEInductLoop.h sumo-1.6.0+dfsg1/src/mesosim/MEInductLoop.h --- sumo-1.5.0+dfsg1/src/mesosim/MEInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An induction loop for mesoscopic simulation /****************************************************************************/ -#ifndef MEInductLoop_h -#define MEInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -111,8 +105,3 @@ /// Hidden assignment operator. MEInductLoop& operator=(const MEInductLoop&); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MELoop.cpp sumo-1.6.0+dfsg1/src/mesosim/MELoop.cpp --- sumo-1.5.0+dfsg1/src/mesosim/MELoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MELoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The main mesocopic simulation loop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,11 +61,11 @@ MELoop::simulate(SUMOTime tMax) { while (!myLeaderCars.empty()) { const SUMOTime time = myLeaderCars.begin()->first; - assert(time > tMax - DELTA_T); + std::vector vehs = myLeaderCars[time]; + assert(time > tMax - DELTA_T || vehs.size() == 0); if (time > tMax) { return; } - std::vector vehs = myLeaderCars[time]; myLeaderCars.erase(time); for (std::vector::const_iterator i = vehs.begin(); i != vehs.end(); ++i) { checkCar(*i); @@ -81,11 +76,11 @@ bool -MELoop::changeSegment(MEVehicle* veh, SUMOTime leaveTime, MESegment* const toSegment, const bool ignoreLink) { +MELoop::changeSegment(MEVehicle* veh, SUMOTime leaveTime, MESegment* const toSegment, MSMoveReminder::Notification reason, const bool ignoreLink) { MESegment* const onSegment = veh->getSegment(); if (MESegment::isInvalid(toSegment)) { if (onSegment != nullptr) { - onSegment->send(veh, toSegment, leaveTime, toSegment == nullptr ? MSMoveReminder::NOTIFICATION_ARRIVED : MSMoveReminder::NOTIFICATION_VAPORIZED); + onSegment->send(veh, toSegment, leaveTime, reason); } else { WRITE_WARNING("Vehicle '" + veh->getID() + "' teleports beyond arrival edge '" + veh->getEdge()->getID() + "', time " + time2string(leaveTime) + "."); } @@ -104,6 +99,9 @@ // this is not quite correct but suffices for interrogation by // subsequent methods (veh->getSpeed() needs segment != 0) veh->setSegment(myEdges2FirstSegments[veh->getEdge()->getNumericalID()]); + // clean up detectors (do not add traffic data) + // note: updateDatector is not called if leaveTime == getLastEntryTime() + veh->updateDetectors(veh->getLastEntryTime(), true, MSMoveReminder::NOTIFICATION_TELEPORT); toSegment->receive(veh, leaveTime, false, true); } return true; @@ -118,7 +116,8 @@ MESegment* const onSegment = veh->getSegment(); MESegment* const toSegment = nextSegment(onSegment, veh); const bool teleporting = (onSegment == nullptr); // is the vehicle currently teleporting? - if (changeSegment(veh, leaveTime, toSegment, teleporting)) { + // @note reason is only evaluated if toSegment == nullptr + if (changeSegment(veh, leaveTime, toSegment, MSMoveReminder::NOTIFICATION_ARRIVED, teleporting)) { return; } if (MSGlobals::gTimeToGridlock > 0 && veh->getWaitingTime() > MSGlobals::gTimeToGridlock) { @@ -167,7 +166,7 @@ + ", time " + time2string(leaveTime) + "."); MSNet::getInstance()->getVehicleControl().registerTeleportJam(); } - changeSegment(veh, leaveTime, teleSegment, true); + changeSegment(veh, leaveTime, teleSegment, MSMoveReminder::NOTIFICATION_TELEPORT, true); teleSegment->setEntryBlockTime(leaveTime); // teleports should not block normal flow } else { // teleport across the current edge and try insertion later @@ -186,7 +185,7 @@ const bool atDest = veh->moveRoutePointer(); if (atDest) { // teleporting to end of route - changeSegment(veh, teleArrival, nullptr, true); + changeSegment(veh, teleArrival, nullptr, MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED, true); } else { veh->setEventTime(teleArrival); addLeaderCar(veh, nullptr); @@ -221,12 +220,15 @@ void MELoop::removeLeaderCar(MEVehicle* v) { std::vector& cands = myLeaderCars[v->getEventTime()]; - cands.erase(find(cands.begin(), cands.end(), v)); + auto it = find(cands.begin(), cands.end(), v); + if (it != cands.end()) { + cands.erase(it); + } } void -MELoop::vaporizeCar(MEVehicle* v) { - v->getSegment()->send(v, nullptr, MSNet::getInstance()->getCurrentTimeStep(), MSMoveReminder::NOTIFICATION_VAPORIZED); +MELoop::vaporizeCar(MEVehicle* v, MSMoveReminder::Notification reason) { + v->getSegment()->send(v, nullptr, MSNet::getInstance()->getCurrentTimeStep(), reason); // try removeLeaderCar std::vector& cands = myLeaderCars[v->getEventTime()]; auto it = find(cands.begin(), cands.end(), v); @@ -320,4 +322,5 @@ return false; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MELoop.h sumo-1.6.0+dfsg1/src/mesosim/MELoop.h --- sumo-1.5.0+dfsg1/src/mesosim/MELoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MELoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The main mesocopic simulation loop /****************************************************************************/ -#ifndef MELoop_h -#define MELoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -38,7 +32,6 @@ class MSEdge; class MSLink; class MSVehicleControl; -class BinaryInputDevice; class OptionsCont; @@ -78,7 +71,7 @@ void removeLeaderCar(MEVehicle* v); /** @brief remove the given car and clean up the relevant data structures */ - void vaporizeCar(MEVehicle* v); + void vaporizeCar(MEVehicle* v, MSMoveReminder::Notification reason); /** @brief Compute number of segments per edge (best value stay close to the configured segment length) */ static int numSegmentsFor(const double length, const double slength); @@ -101,7 +94,7 @@ * this handles combinations of the following cases: * (ending / continuing route) and (leaving segment / finishing teleport) */ - bool changeSegment(MEVehicle* veh, SUMOTime leaveTime, MESegment* const toSegment, const bool ignoreLink = false); + bool changeSegment(MEVehicle* veh, SUMOTime leaveTime, MESegment* const toSegment, MSMoveReminder::Notification reason, const bool ignoreLink = false); /** @brief registers vehicle with the given link * @@ -164,9 +157,3 @@ /// @brief Invalidated assignment operator. MELoop& operator=(const MELoop&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MESegment.cpp sumo-1.6.0+dfsg1/src/mesosim/MESegment.cpp --- sumo-1.5.0+dfsg1/src/mesosim/MESegment.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MESegment.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A single mesoscopic segment (cell) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -36,10 +31,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include "MEVehicle.h" @@ -60,7 +55,7 @@ // =========================================================================== // static member defintion // =========================================================================== -MSEdge MESegment::myDummyParent("MESegmentDummyParent", -1, EDGEFUNC_UNKNOWN, "", "", -1, 0); +MSEdge MESegment::myDummyParent("MESegmentDummyParent", -1, SumoXMLEdgeFunc::UNKNOWN, "", "", -1, 0); MESegment MESegment::myVaporizationTarget("vaporizationTarget"); const double MESegment::DO_NOT_PATCH_JAM_THRESHOLD(std::numeric_limits::max()); @@ -88,15 +83,15 @@ myTLSPenalty(MSGlobals::gMesoTLSPenalty > 0 && // only apply to the last segment of a tls-controlled edge myNextSegment == nullptr && ( - parent.getToJunction()->getType() == NODETYPE_TRAFFIC_LIGHT || - parent.getToJunction()->getType() == NODETYPE_TRAFFIC_LIGHT_NOJUNCTION || - parent.getToJunction()->getType() == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED)), + parent.getToJunction()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT || + parent.getToJunction()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION || + parent.getToJunction()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED)), myMinorPenalty(MSGlobals::gMesoMinorPenalty > 0 && // only apply to the last segment of an uncontrolled edge that has at least 1 minor link myNextSegment == nullptr && - parent.getToJunction()->getType() != NODETYPE_TRAFFIC_LIGHT && - parent.getToJunction()->getType() != NODETYPE_TRAFFIC_LIGHT_NOJUNCTION && - parent.getToJunction()->getType() != NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED && + parent.getToJunction()->getType() != SumoXMLNodeType::TRAFFIC_LIGHT && + parent.getToJunction()->getType() != SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION && + parent.getToJunction()->getType() != SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED && parent.hasMinorLink()), myNumCars(0), myEntryBlockTime(SUMOTime_MIN), @@ -506,7 +501,8 @@ veh->setEventTime(time + TIME2STEPS(myLength / speed)); // for correct arrival speed addReminders(veh); veh->activateReminders(MSMoveReminder::NOTIFICATION_JUNCTION); - veh->updateDetectors(time, true, MSMoveReminder::NOTIFICATION_ARRIVED); + veh->updateDetectors(time, true, + veh->getEdge()->isVaporizing() ? MSMoveReminder::NOTIFICATION_VAPORIZED_VAPORIZER : MSMoveReminder::NOTIFICATION_ARRIVED); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); return; } @@ -577,17 +573,16 @@ bool -MESegment::vaporizeAnyCar(SUMOTime currentTime) { - MEVehicle* remove = nullptr; - for (Queues::const_iterator k = myCarQues.begin(); k != myCarQues.end(); ++k) { - if (!k->empty()) { - // remove last in queue - remove = k->front(); - if (k->size() == 1) { - MSGlobals::gMesoNet->removeLeaderCar(remove); +MESegment::vaporizeAnyCar(SUMOTime currentTime, const MSDetectorFileOutput* filter) { + for (Queue& k : myCarQues) { + if (!k.empty()) { + for (MEVehicle* veh : k) { + if (filter->vehicleApplies(*veh)) { + MSGlobals::gMesoNet->removeLeaderCar(veh); + MSGlobals::gMesoNet->changeSegment(veh, currentTime + 1, &myVaporizationTarget, MSMoveReminder::NOTIFICATION_VAPORIZED_CALIBRATOR); + return true; + } } - MSGlobals::gMesoNet->changeSegment(remove, currentTime, &myVaporizationTarget); - return true; } } return false; @@ -761,4 +756,17 @@ return maxPenalty; } +double +MESegment::getWaitingSeconds() const { + double result = 0; + for (const Queue& q : myCarQues) { + // @note: only the leader currently accumulates waitingTime but this might change in the future + for (const MEVehicle* veh : q) { + result += veh->getWaitingSeconds(); + } + } + return result; +} + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MESegment.h sumo-1.6.0+dfsg1/src/mesosim/MESegment.h --- sumo-1.5.0+dfsg1/src/mesosim/MESegment.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MESegment.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A single mesoscopic segment (cell) /****************************************************************************/ -#ifndef MESegment_h -#define MESegment_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -37,9 +31,9 @@ class MSEdge; class MSLink; class MSMoveReminder; +class MSDetectorFileOutput; class MSVehicleControl; class MEVehicle; -class BinaryInputDevice; class OutputDevice; @@ -261,7 +255,7 @@ * @param[in] currentTime the current time * @return Whether vaporization was successful * @note: cars removed via this method do NOT count as arrivals */ - bool vaporizeAnyCar(SUMOTime currentTime); + bool vaporizeAnyCar(SUMOTime currentTime, const MSDetectorFileOutput* filter); /** @brief Returns the edge this segment belongs to * @return the edge this segment belongs to @@ -297,6 +291,9 @@ return STEPS2TIME(myEntryBlockTime); } + /// @brief Get the waiting time for vehicles in all queues + double getWaitingSeconds() const; + /// @name State saving/loading /// @{ @@ -346,6 +343,10 @@ return segment == 0 || segment == &myVaporizationTarget; } + static MESegment* getVaporizationTarget() { + return &myVaporizationTarget; + } + /// @brief return a time after earliestEntry at which a vehicle may be inserted at full speed SUMOTime getNextInsertionTime(SUMOTime earliestEntry) const; @@ -521,8 +522,3 @@ /// @brief constructor for dummy segment MESegment(const std::string& id); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/mesosim/METriggeredCalibrator.cpp sumo-1.6.0+dfsg1/src/mesosim/METriggeredCalibrator.cpp --- sumo-1.5.0+dfsg1/src/mesosim/METriggeredCalibrator.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/METriggeredCalibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Calibrates the flow on a segment to a specified one /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -140,7 +135,7 @@ WRITE_WARNING("Clearing jam at calibrator '" + getID() + "' at time " + time2string(currentTime)); } // remove one vehicle currently on the segment - if (mySegment->vaporizeAnyCar(currentTime)) { + if (mySegment->vaporizeAnyCar(currentTime, this)) { myClearedInJam++; } else { if (!myHaveWarnedAboutClearingJam) { @@ -227,9 +222,8 @@ //std::cout << " after:" << adaptedNum << "\n"; // we only remove vehicles once we really have to while (totalWishedNum < adaptedNum) { - if (!mySegment->vaporizeAnyCar(currentTime)) { + if (!mySegment->vaporizeAnyCar(currentTime, this)) { // @bug: short edges may be jumped in a single step, giving us no chance to remove a vehicle - // @bug2: vehicleApplies() must be considered (#3082) break; } myRemoved++; @@ -273,4 +267,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/METriggeredCalibrator.h sumo-1.6.0+dfsg1/src/mesosim/METriggeredCalibrator.h --- sumo-1.5.0+dfsg1/src/mesosim/METriggeredCalibrator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/METriggeredCalibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Calibrates the flow on a segment to a specified one /****************************************************************************/ -#ifndef METriggeredCalibrator_h -#define METriggeredCalibrator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -89,7 +83,3 @@ MESegment* mySegment; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEVehicleControl.cpp sumo-1.6.0+dfsg1/src/mesosim/MEVehicleControl.cpp --- sumo-1.5.0+dfsg1/src/mesosim/MEVehicleControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEVehicleControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,17 +17,11 @@ /// // The class responsible for building and deletion of vehicles (meso-version) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include #include #include #include @@ -51,13 +45,10 @@ MEVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, MSVehicleType* type, const bool ignoreStopErrors, const bool fromRouteFile) { - myLoadedVehNo++; MEVehicle* built = new MEVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : nullptr)); - built->addStops(ignoreStopErrors); - MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); + initVehicle(built, ignoreStopErrors); return built; } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEVehicleControl.h sumo-1.6.0+dfsg1/src/mesosim/MEVehicleControl.h --- sumo-1.5.0+dfsg1/src/mesosim/MEVehicleControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEVehicleControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The class responsible for building and deletion of vehicles (meso-version) /****************************************************************************/ -#ifndef MEVehicleControl_h -#define MEVehicleControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -83,9 +77,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEVehicle.cpp sumo-1.6.0+dfsg1/src/mesosim/MEVehicle.cpp --- sumo-1.5.0+dfsg1/src/mesosim/MEVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A vehicle from the mesoscopic point of view /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -29,7 +24,6 @@ #include #include #include -#include #include #include #include @@ -58,7 +52,8 @@ myQueIndex(0), myEventTime(SUMOTime_MIN), myLastEntryTime(SUMOTime_MIN), - myBlockTime(SUMOTime_MAX) { + myBlockTime(SUMOTime_MAX), + myInfluencer(nullptr) { if (!(*myCurrEdge)->isTazConnector()) { if ((*myCurrEdge)->allowedLanes(type->getVehicleClass()) == nullptr) { throw ProcessError("Vehicle '" + pars->id + "' is not allowed to depart on any lane of its first edge."); @@ -156,6 +151,7 @@ } + bool MEVehicle::hasArrived() const { // mySegment may be 0 due to teleporting or arrival @@ -170,6 +166,10 @@ return getSegment() != nullptr; } +bool +MEVehicle::isIdling() const { + return false; +} bool MEVehicle::isParking() const { @@ -234,6 +234,9 @@ if (segmentStops.back().until >= 0) { segmentStops.back().until += untilOffset; } + if (segmentStops.back().arrival >= 0) { + segmentStops.back().arrival += untilOffset; + } if (myStopEdges.empty() || myStopEdges.back() != edge || cyclicRoute) { myStopEdges.push_back(edge); } @@ -433,6 +436,27 @@ } +MEVehicle::BaseInfluencer& +MEVehicle::getBaseInfluencer() { + if (myInfluencer == nullptr) { + myInfluencer = new BaseInfluencer(); + } + return *myInfluencer; +} + + +const MEVehicle::BaseInfluencer* +MEVehicle::getBaseInfluencer() const { + return myInfluencer; +} + + +void +MEVehicle::onRemovalFromNet(const MSMoveReminder::Notification reason) { + MSGlobals::gMesoNet->removeLeaderCar(this); + MSGlobals::gMesoNet->changeSegment(this, MSNet::getInstance()->getCurrentTimeStep(), nullptr, reason); +} + void MEVehicle::saveState(OutputDevice& out) { if (mySegment != nullptr && MESegment::isInvalid(mySegment)) { @@ -509,4 +533,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/mesosim/MEVehicle.h sumo-1.6.0+dfsg1/src/mesosim/MEVehicle.h --- sumo-1.5.0+dfsg1/src/mesosim/MEVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/mesosim/MEVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A vehicle from the mesoscopic point of view /****************************************************************************/ -#ifndef MEVehicle_h -#define MEVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -121,6 +115,19 @@ */ double getConservativeSpeed(SUMOTime& earliestArrival) const; + /// @name insertion/removal + //@{ + + /** @brief Called when the vehicle is removed from the network. + * + * Moves along work reminders and + * informs all devices about quitting. Calls "leaveLane" then. + * + * @param[in] reason why the vehicle leaves (reached its destination, parking, teleport) + */ + void onRemovalFromNet(const MSMoveReminder::Notification reason); + //@} + /** @brief Update when the vehicle enters a new edge in the move step. * @return Whether the vehicle's route has ended (due to vaporization, or because the destination was reached) @@ -137,6 +144,12 @@ */ bool isOnRoad() const; + /** @brief Returns whether the vehicle is trying to re-enter the net + * @return true if the vehicle is trying to enter the net (eg after parking) + */ + virtual bool isIdling() const; + + /** @brief Returns whether the vehicle is parking * @return whether the vehicle is parking */ @@ -215,6 +228,10 @@ throw ProcessError("parkingZoneReroute not implemented for meso"); } + const SUMOVehicleParameter::Stop* getNextStopParameter() const { + throw ProcessError("stop retrieval not yet implemented for meso"); + } + /** @brief Sets the (planned) time at which the vehicle leaves his current cell * @param[in] t The leaving time */ @@ -299,6 +316,11 @@ return MAX2(SUMOTime(0), myEventTime - myBlockTime); } + inline SUMOTime getTimeLoss() const { + // slow-downs while driving are not modelled + return getWaitingTime(); + } + /// @brief Returns the duration for which the vehicle was blocked inline SUMOTime getAccumulatedWaitingTime() const { return getWaitingTime(); @@ -354,6 +376,19 @@ void updateDetectors(SUMOTime currentTime, const bool isLeave, const MSMoveReminder::Notification reason = MSMoveReminder::NOTIFICATION_JUNCTION); + /** @brief Returns the velocity/lane influencer + * + * If no influencer was existing before, one is built, first + * @return Reference to this vehicle's speed influencer + */ + BaseInfluencer& getBaseInfluencer(); + + const BaseInfluencer* getBaseInfluencer() const; + + bool hasInfluencer() const { + return myInfluencer != nullptr; + } + /// @name state io //@{ @@ -388,8 +423,7 @@ /// @brief edges to stop ConstMSEdgeVector myStopEdges; -}; + /// @brief An instance of a velocity/lane influencing instance; built in "getInfluencer" + BaseInfluencer* myInfluencer; -#endif - -/****************************************************************************/ +}; diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Writes e2 state on each tls switch /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLCoupledDet.h" @@ -61,6 +56,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledDet.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Writes e2 state on each tls switch /****************************************************************************/ -#ifndef Command_SaveTLCoupledDet_h -#define Command_SaveTLCoupledDet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -99,9 +93,3 @@ Command_SaveTLCoupledDet& operator=(const Command_SaveTLCoupledDet&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Writes e2 state of a link for the time the link has yellow/red /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLCoupledLaneDet.h" @@ -73,6 +68,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLCoupledLaneDet.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Writes e2 state of a link for the time the link has yellow/red /****************************************************************************/ -#ifndef Command_SaveTLCoupledLaneDet_h -#define Command_SaveTLCoupledLaneDet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -92,9 +86,3 @@ Command_SaveTLCoupledLaneDet& operator=(const Command_SaveTLCoupledLaneDet&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,9 +17,6 @@ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLSProgram.h" @@ -91,4 +88,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSProgram.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -#ifndef Command_SaveTLSProgram_h -#define Command_SaveTLSProgram_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -108,9 +102,3 @@ Command_SaveTLSProgram& operator=(const Command_SaveTLSProgram&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSState.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSState.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSState.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSState.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,9 +18,6 @@ /// // Writes the state of the tls to a file (in each second) /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLSState.h" @@ -58,5 +55,4 @@ } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSState.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSState.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSState.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSState.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Writes the state of the tls to a file (in each second) /****************************************************************************/ -#ifndef Command_SaveTLSState_h -#define Command_SaveTLSState_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -93,9 +87,3 @@ Command_SaveTLSState& operator=(const Command_SaveTLSState&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,9 +19,6 @@ /// // Writes information about the green durations of a tls /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLSSwitches.h" @@ -88,6 +85,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitches.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Writes information about the green durations of a tls /****************************************************************************/ -#ifndef Command_SaveTLSSwitches_h -#define Command_SaveTLSSwitches_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -103,9 +97,3 @@ Command_SaveTLSSwitches& operator=(const Command_SaveTLSSwitches&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,9 +18,6 @@ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include "Command_SaveTLSSwitchStates.h" @@ -63,6 +60,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.h sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.h --- sumo-1.5.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/actions/Command_SaveTLSSwitchStates.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Writes the switch times of a tls into a file when the tls switches /****************************************************************************/ -#ifndef Command_SaveTLSSwitchStates_h -#define Command_SaveTLSSwitchStates_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -103,9 +97,3 @@ Command_SaveTLSSwitchStates& operator=(const Command_SaveTLSSwitchStates&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/CC_Const.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/CC_Const.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/CC_Const.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/CC_Const.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// // File defining constants, structs, and enums for cruise controllers /****************************************************************************/ -#ifndef CC_CONST_H -#define CC_CONST_H +#pragma once #include #include @@ -184,4 +183,3 @@ } -#endif /* CC_CONST_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/CC_VehicleVariables.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/CC_VehicleVariables.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/CC_VehicleVariables.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/CC_VehicleVariables.h 2020-04-27 21:47:56.000000000 +0000 @@ -16,12 +16,7 @@ /// @date Mon, 7 Mar 2016 /// /****************************************************************************/ -#ifndef CC_VEHICLEVARIABLES_H -#define CC_VEHICLEVARIABLES_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "CC_Const.h" @@ -210,4 +205,3 @@ bool autoLaneChange; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -24,11 +24,6 @@ // Control Vehicles. Transportation Research Record: Journal of the // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01). /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -170,7 +165,7 @@ return mySpeedControlGain * vErr; } -double MSCFModel_ACC::accelGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, double vErr) const { +double MSCFModel_ACC::accelGapControl(const MSVehicle* const /* veh */, const double gap2pred, const double speed, const double predSpeed, double vErr) const { #ifdef DEBUG_ACC if (DEBUG_COND) { @@ -181,10 +176,7 @@ // Gap control law double gclAccel = 0.0; double desSpacing = myHeadwayTime * speed; -// The argument gap2pred does not consider minGap -> substract minGap!! -// XXX: It does! (Leo) - double gap = gap2pred - veh->getVehicleType().getMinGap(); - double spacingErr = gap - desSpacing; + double spacingErr = gap2pred - desSpacing; double deltaVel = predSpeed - speed; diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_ACC.h 2020-04-27 21:47:56.000000000 +0000 @@ -24,12 +24,7 @@ // Control Vehicles. Transportation Research Record: Journal of the // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01). /****************************************************************************/ -#ifndef MSCFModel_ACC_H -#define MSCFModel_ACC_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -172,4 +167,3 @@ MSCFModel_ACC& operator=(const MSCFModel_ACC& s); }; -#endif /* MSCFModel_ACC_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -24,10 +24,6 @@ // Control Vehicles. Transportation Research Record: Journal of the // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01). /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -68,6 +64,10 @@ // override followSpeed when deemed unsafe by the given margin (the value was selected to reduce the number of necessary interventions) #define DEFAULT_EMERGENCY_OVERRIDE_THRESHOLD 2.0 +std::map MSCFModel_CACC::VehicleModeNames = { + {ACC_MODE, "ACC"}, + {CACC_MODE, "CACC"} +}; // =========================================================================== // method definitions @@ -88,6 +88,14 @@ MSCFModel_CACC::~MSCFModel_CACC() {} +double +MSCFModel_CACC::freeSpeed(const MSVehicle* const veh, double speed, double seen, double maxSpeed, const bool onInsertion) const { + // set "caccVehicleMode" parameter to default value + if (!MSGlobals::gComputeLC) { + const_cast(veh->getParameter()).setParameter("caccVehicleMode", VehicleModeNames[CACC_MODE]); + } + return MSCFModel::freeSpeed(veh, speed, seen, maxSpeed, onInsertion); +} double MSCFModel_CACC::followSpeed(const MSVehicle* const veh, double speed, double gap2pred, double predSpeed, double predMaxDecel, const MSVehicle* const pred) const { @@ -194,8 +202,9 @@ return 250; } -double MSCFModel_CACC::speedSpeedContol(const double speed, double vErr) const { +double MSCFModel_CACC::speedSpeedControl(const double speed, double vErr, VehicleMode& vehMode) const { // Speed control law + vehMode = CACC_MODE; double sclAccel = mySpeedControlGain * vErr; double newSpeed = speed + ACCEL2SPEED(sclAccel); return newSpeed; @@ -203,22 +212,21 @@ double MSCFModel_CACC::speedGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, const double desSpeed, double vErr, - const MSVehicle* const pred) const { + const MSVehicle* const pred, VehicleMode& vehMode) const { // Gap control law double newSpeed = 0.0; if (pred != nullptr) { if (pred->getCarFollowModel().getModelID() != SUMO_TAG_CF_CACC) { - //ACC control mode + vehMode = ACC_MODE; newSpeed = acc_CFM._v(veh, gap2pred, speed, predSpeed, desSpeed, true); #if DEBUG_CACC == 1 if (DEBUG_COND) { std::cout << " acc control mode" << std::endl; } #endif - } else { - //CACC control mode + vehMode = CACC_MODE; #if DEBUG_CACC == 1 if (DEBUG_COND) { std::cout << " CACC control mode" << std::endl; @@ -265,7 +273,7 @@ std::cout << " no leader" << std::endl; } #endif - newSpeed = speedSpeedContol(speed, vErr); + newSpeed = speedSpeedControl(speed, vErr, vehMode); } return newSpeed; @@ -276,6 +284,7 @@ MSCFModel_CACC::_v(const MSVehicle* const veh, const MSVehicle* const pred, const double gap2pred, const double speed, const double predSpeed, const double desSpeed, const bool /* respectMinGap */) const { double newSpeed = 0.0; + VehicleMode vehMode = CACC_MODE; #if DEBUG_CACC == 1 if (DEBUG_COND) { @@ -302,10 +311,13 @@ } #endif // Find acceleration - Speed control law - newSpeed = speedSpeedContol(speed, vErr); + newSpeed = speedSpeedControl(speed, vErr, vehMode); // Set cl to vehicle parameters if (setControlMode) { vars->CACC_ControlMode = 0; + if (!MSGlobals::gComputeLC) { + const_cast(veh->getParameter()).setParameter("caccVehicleMode", VehicleModeNames[vehMode]); + } } } else if (time_gap < 1.5) { // Find acceleration - Gap control law @@ -314,29 +326,37 @@ std::cout << " speedGapControl" << std::endl; } #endif - newSpeed = speedGapControl(veh, gap2pred, speed, predSpeed, desSpeed, vErr, pred); + + newSpeed = speedGapControl(veh, gap2pred, speed, predSpeed, desSpeed, vErr, pred, vehMode); // Set cl to vehicle parameters if (setControlMode) { vars->CACC_ControlMode = 1; + if (!MSGlobals::gComputeLC) { + const_cast(veh->getParameter()).setParameter("caccVehicleMode", VehicleModeNames[vehMode]); + } } } else { // Follow previous applied law int cm = vars->CACC_ControlMode; - if (!cm) { + if (!cm) { // CACC_ControlMode = speed control #if DEBUG_CACC == 1 if (DEBUG_COND) { std::cout << " applying speedControl (previous)" << std::endl; } #endif - newSpeed = speedSpeedContol(speed, vErr); - } else { + newSpeed = speedSpeedControl(speed, vErr, vehMode); + } else { // CACC_ControlMode = gap control #if DEBUG_CACC == 1 if (DEBUG_COND) { std::cout << " previous speedGapControl (previous)" << std::endl; } #endif - newSpeed = speedGapControl(veh, gap2pred, speed, predSpeed, desSpeed, vErr, pred); + newSpeed = speedGapControl(veh, gap2pred, speed, predSpeed, desSpeed, vErr, pred, vehMode); + } + + if (setControlMode && !MSGlobals::gComputeLC) { + const_cast(veh->getParameter()).setParameter("caccVehicleMode", VehicleModeNames[vehMode]); } } diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CACC.h 2020-04-27 21:47:56.000000000 +0000 @@ -24,12 +24,7 @@ // Control Vehicles. Transportation Research Record: Journal of the // Transportation Research Board, No. 2623, 2017. (DOI: 10.3141/2623-01). /****************************************************************************/ -#ifndef MSCFModel_CACC_H -#define MSCFModel_CACC_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -64,6 +59,22 @@ /// @name Implementations of the MSCFModel interface /// @{ + /** @brief Computes the vehicle's safe speed without a leader + * + * Returns the velocity of the vehicle in dependence to the length of the free street and the target + * velocity at the end of the free range. If onInsertion is true, the vehicle may still brake + * before the next movement. + * XXX: Currently only needed to (re-)set "caccVehicleMode" parameter to default value. + * + * @param[in] veh The vehicle (EGO) + * @param[in] speed The vehicle's speed + * @param[in] seen The look ahead distance + * @param[in] maxSpeed The maximum allowed speed + * @param[in] onInsertion whether speed at insertion is asked for + * @return EGO's safe speed + */ + double freeSpeed(const MSVehicle* const veh, double speed, double seen, double maxSpeed, const bool onInsertion = false) const; + /** @brief Computes the vehicle's safe speed (no dawdling) * @param[in] veh The vehicle (EGO) * @param[in] speed The vehicle's speed @@ -150,15 +161,24 @@ SUMOTime lastUpdateTime; }; + /// @brief Vehicle mode (default is CACC) + /// Switch to ACC mode if CACC_ControlMode = 1 (gap control mode) _and_ leader's CFModel != CACC + enum VehicleMode { + ACC_MODE = 0, + CACC_MODE + }; + + /// @brief Vehicle mode name map + static std::map VehicleModeNames; private: double _v(const MSVehicle* const veh, const MSVehicle* const pred, const double gap2pred, const double mySpeed, const double predSpeed, const double desSpeed, const bool respectMinGap = true) const; - double speedSpeedContol(const double speed, double vErr) const; + double speedSpeedControl(const double speed, double vErr, VehicleMode& vehMode) const; double speedGapControl(const MSVehicle* const veh, const double gap2pred, const double speed, const double predSpeed, const double desSpeed, double vErr, - const MSVehicle* const pred) const; + const MSVehicle* const pred, VehicleMode& vehMode) const; private: MSCFModel_ACC acc_CFM; @@ -176,4 +196,3 @@ MSCFModel_CACC& operator=(const MSCFModel_CACC& s); }; -#endif /* MSCFModel_CACC_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A series of automatic Cruise Controllers (CC, ACC, CACC) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include "MSCFModel_CC.h" #include #include @@ -64,9 +59,7 @@ //if the lanes count has not been specified in the attributes of the model, lane changing cannot properly work if (myLanesCount == -1) { - std::cerr << "The number of lanes needs to be specified in the attributes of carFollowing-CC with the \"lanesCount\" attribute\n"; - WRITE_ERROR("The number of lanes needs to be specified in the attributes of carFollowing-CC with the \"lanesCount\" attribute"); - assert(false); + throw ProcessError("The number of lanes needs to be specified in the attributes of carFollowing-CC with the \"lanesCount\" attribute"); } //instantiate the driver model. For now, use Krauss as default, then needs to be parameterized @@ -180,7 +173,7 @@ //check whether the vehicle has collided and set the flag in case if (!vars->crashed) { - for (const MSVehicle::Stop& s : veh->getMyStops()) { + for (const MSVehicle::Stop& s : veh->getStops()) { if (s.collision) { vars->crashed = true; } diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_CC.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // A series of automatic Cruise Controllers (CC, ACC, CACC) /****************************************************************************/ -#ifndef MSCFMODEL_CC_H -#define MSCFMODEL_CC_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "CC_Const.h" @@ -404,4 +399,3 @@ MSCFModel_CC& operator=(const MSCFModel_CC&) = delete; }; -#endif /* MSCFMODEL_CC_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // The car-following model abstraction /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -1050,7 +1045,4 @@ } - - - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Daniel1.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -#ifndef MSCFModel_Daniel1_h -#define MSCFModel_Daniel1_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -162,5 +157,4 @@ }; -#endif /* MSCFModel_Daniel1_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // The car-following model abstraction /****************************************************************************/ -#ifndef MSCFModel_h -#define MSCFModel_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -637,5 +632,4 @@ }; -#endif /* MSCFModel_h */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSCFModel_IDM.h" @@ -179,7 +174,7 @@ std::cout << " gap=" << gap << " t=" << myHeadwayTime << " t2=" << headwayTime << " s=" << s << " pow=" << pow(newSpeed / desSpeed, myDelta) << " gapDecel=" << (s * s) / (gap * gap) << " a=" << acc; } #endif - newSpeed += ACCEL2SPEED(acc) / myIterations; + newSpeed = MAX2(0.0, newSpeed + ACCEL2SPEED(acc) / myIterations); #ifdef DEBUG_V if (gDebugFlag1) { std::cout << " v2=" << newSpeed << "\n"; diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_IDM.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// // The Intelligent Driver Model (IDM) car-following model /****************************************************************************/ -#ifndef MSCFMODEL_IDM_H -#define MSCFMODEL_IDM_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -215,4 +210,3 @@ MSCFModel_IDM& operator=(const MSCFModel_IDM& s); }; -#endif /* MSCFMODEL_IDM_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // car-following model by B. Kerner /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Kerner.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // car-following model by B. Kerner /****************************************************************************/ -#ifndef MSCFModel_Kerner_h -#define MSCFModel_Kerner_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -131,5 +126,4 @@ }; -#endif /* MSCFModel_Kerner_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Krauss car-following model, with acceleration decrease and faster start /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Krauss.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // Krauss car-following model, with acceleration decrease and faster start /****************************************************************************/ -#ifndef MSCFModel_Krauss_h -#define MSCFModel_Krauss_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel_KraussOrig1.h" @@ -105,5 +100,4 @@ }; -#endif /* MSCFMODEL_KRAUSS_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussOrig1.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // The original Krauss (1998) car-following model and parameter /****************************************************************************/ -#ifndef MSCFModel_KraussOrig1_h -#define MSCFModel_KraussOrig1_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -155,5 +150,4 @@ double myTauDecel; }; -#endif /* MSCFModel_KraussOrig1_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Krauss car-following model, changing accel and speed by slope /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussPS.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // Krauss car-following model, changing accel and speed by slope /****************************************************************************/ -#ifndef MSCFModel_KraussPS_h -#define MSCFModel_KraussPS_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel_Krauss.h" @@ -89,5 +84,4 @@ }; -#endif /* MSCFModel_KraussPS_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Krauss car-following model, changing accel and speed by slope /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -91,5 +86,4 @@ } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_KraussX.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // Experimental extensions to the Krauss car-following model /****************************************************************************/ -#ifndef MSCFModel_KraussX_h -#define MSCFModel_KraussX_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel_Krauss.h" @@ -89,5 +84,4 @@ }; -#endif /* MSCFModel_KraussX_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Scalable model based on Krauss by Peter Wagner /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_PWag2009.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// // Scalable model based on Krauss by Peter Wagner /****************************************************************************/ -#ifndef MSCFModel_PWag2009_h -#define MSCFModel_PWag2009_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -158,4 +153,3 @@ }; -#endif /* MSCFModel_PWag2009_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,9 +18,6 @@ /// // /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -80,12 +77,13 @@ // system CIR-ELKE (based on LZB). Other implementations of moving block systems may differ, but for now no appropriate parameter // can be set (would be per lane, not per train) -> hard-coded - double safetyGap = 5.0; // default value for low speeds (< 30 km/h) + // @note: default train minGap of 5 is already subtracted from gap if (speed >= 30 / 3.6) { - safetyGap = 50.0; // safety distance for higher speeds (>= 30 km/h) + // safety distance for higher speeds (>= 30 km/h) + gap = MAX2(0.0, gap + veh->getVehicleType().getMinGap() - 50); } - const double vsafe = maximumSafeStopSpeed(gap - safetyGap, speed, false, TS); // absolute breaking distance + const double vsafe = maximumSafeStopSpeed(gap, speed, false, TS); // absolute breaking distance const double vmin = minNextSpeed(speed, veh); const double vmax = maxNextSpeed(speed, veh); diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Rail.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// // /****************************************************************************/ -#ifndef SUMO_MSCFMODEL_RAIL_H -#define SUMO_MSCFMODEL_RAIL_H +#pragma once #include "MSCFModel.h" @@ -735,4 +734,3 @@ }; -#endif //SUMO_MSCFMODEL_RAIL_H diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A smarter SK /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_SmartSK.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// // A smarter SK /****************************************************************************/ -#ifndef MSCFModel_SmartSK_h -#define MSCFModel_SmartSK_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -197,5 +192,4 @@ }; -#endif /* MSCFModel_SmartSK_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ // code adapted from https://github.com/glgh/w99-demo // (MIT License, Copyright (c) 2016 glgh) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -190,9 +185,8 @@ double MSCFModel_W99::stopSpeed(const MSVehicle* const veh, const double speed, double gap) const { - // W99 doesn't stop on point so we add some slack - const double vFollow = followSpeed(veh, speed, gap + sqrt(gap) + 2, 0, 4.5, 0); - return MIN3(vFollow, maximumSafeStopSpeed(gap, speed, false, veh->getActionStepLengthSecs()), maxNextSpeed(speed, veh)); + // see reasoning in MSCFModel_Wiedemann::stopSpeed + return MIN2(maximumSafeStopSpeed(gap, speed, false, veh->getActionStepLengthSecs()), maxNextSpeed(speed, veh)); } diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_W99.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ // code adapted from https://github.com/glgh/w99-demo // (MIT License, Copyright (c) 2016 glgh) /****************************************************************************/ -#ifndef MSCFModel_W99_H -#define MSCFModel_W99_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -161,4 +156,3 @@ MSCFModel_W99& operator=(const MSCFModel_W99& s); }; -#endif /* MSCFModel_W99_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ // Werner - Integration von Fahrzeugfolge- und Fahrstreifenwechselmodellen in die Nachtfahrsimulation LucidDrive // Olstam, Tapani - Comparison of Car-following models /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/MSCFModel_Wiedemann.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The psycho-physical model of Wiedemann /****************************************************************************/ -#ifndef MSCFModel_Wiedemann_H -#define MSCFModel_Wiedemann_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSCFModel.h" @@ -179,4 +174,3 @@ MSCFModel_Wiedemann& operator=(const MSCFModel_Wiedemann& s); }; -#endif /* MSCFModel_Wiedemann_H */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/cfmodels/ParBuffer.h sumo-1.6.0+dfsg1/src/microsim/cfmodels/ParBuffer.h --- sumo-1.5.0+dfsg1/src/microsim/cfmodels/ParBuffer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/cfmodels/ParBuffer.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // Class for the string serialization and deserialization of parameters /****************************************************************************/ -#ifndef PARBUFFER_H_ -#define PARBUFFER_H_ +#pragma once #include #include @@ -159,4 +158,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Battery.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Battery.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Battery.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Battery.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // The Battery parameters for the vehicle /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -466,4 +462,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Battery.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Battery.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Battery.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Battery.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The Battery parameters for the vehicle /****************************************************************************/ -#ifndef MSDevice_Battery_h -#define MSDevice_Battery_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -221,5 +215,4 @@ MSDevice_Battery& operator=(const MSDevice_Battery&); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ // A device for emergency vehicle. The behaviour of other traffic participants will be triggered with this device. // For example building a rescue lane. /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -150,6 +146,21 @@ // 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 + MSVehicleType& t = static_cast(veh2)->getSingularType(); + //Setting the lateral alignment to build a rescue lane + if (veh2->getLane()->getIndex() == numLanes - 1) { + t.setPreferredLateralAlignment(LATALIGN_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(LATALIGN_RIGHT); + // the alignement is changet to right for the vehicle std::cout << "New alignment to right for vehicle: " << veh2->getID() << " " << veh2->getVehicleType().getPreferredLateralAlignment() << "\n"; + } + } + 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) { @@ -169,9 +180,13 @@ //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(); + //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 - if (reaction < (distanceDelta * -1.6 + 100) / 100) { + double reactionProb = 0.189; // todo works only for one second steps + if (distanceDelta < 12.5) { + reactionProb = 0.577; + } + if (reaction < reactionProb) { influencedVehicles.insert(static_cast(veh2->getID())); influencedTypes.insert(std::make_pair(static_cast(veh2->getID()), veh2->getVehicleType().getID())); @@ -274,4 +289,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Bluelight.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A device which stands as an implementation example and which outputs movereminder calls /****************************************************************************/ -#ifndef MSDevice_Bluelight_h -#define MSDevice_Bluelight_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -175,9 +169,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A BT Receiver /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -440,8 +436,4 @@ } - - - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTreceiver.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A BT receiver /****************************************************************************/ -#ifndef MSDevice_BTreceiver_h -#define MSDevice_BTreceiver_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -125,7 +119,6 @@ * @param[in] lastPos Position on the lane when leaving. * @param[in] isArrival whether the vehicle arrived at its destination * @param[in] isLaneChange whether the vehicle changed from the lane - * @see leaveDetectorByLaneChange * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ @@ -386,8 +379,3 @@ }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTsender.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTsender.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTsender.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTsender.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // A BT sender /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -140,4 +136,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTsender.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTsender.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_BTsender.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_BTsender.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A BT sender /****************************************************************************/ -#ifndef MSDevice_BTsender_h -#define MSDevice_BTsender_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -123,7 +117,6 @@ * @param[in] lastPos Position on the lane when leaving. * @param[in] isArrival whether the vehicle arrived at its destination * @param[in] isLaneChange whether the vehicle changed from the lane - * @see leaveDetectorByLaneChange * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ @@ -234,9 +227,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // Abstract in-vehicle device /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -208,4 +204,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_DriverState.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_DriverState.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_DriverState.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_DriverState.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,10 +22,6 @@ /// @see microsim/MSDriverState.h /// /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -301,4 +297,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_DriverState.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_DriverState.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_DriverState.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_DriverState.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// @see microsim/MSDriverState.h /// /****************************************************************************/ -#ifndef MSDevice_DriverState_h -#define MSDevice_DriverState_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -163,9 +157,3 @@ MSDevice_DriverState& operator=(const MSDevice_DriverState&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A device ElecHybrid ===description here=== /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -911,5 +906,6 @@ myParam[SUMO_ATTR_ANGLE] = ISNAN(myLastAngle) ? 0. : GeomHelper::angleDiff(myLastAngle, veh.getAngle()); return PollutantsInterface::getEnergyHelper().compute(0, PollutantsInterface::ELEC, newSpeed, a, veh.getSlope(), &myParam); } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ElecHybrid.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A device which stands as an implementation ElecHybrid and which outputs movereminder calls /****************************************************************************/ -#ifndef MSDevice_ElecHybrid_h -#define MSDevice_ElecHybrid_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -299,9 +293,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Emissions.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Emissions.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Emissions.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Emissions.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A device which collects vehicular emissions /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -78,6 +74,13 @@ return true; } +bool +MSDevice_Emissions::notifyIdle(SUMOTrafficObject& veh) { + const SUMOEmissionClass c = veh.getVehicleType().getEmissionClass(); + myEmissions.addScaled(PollutantsInterface::computeAll(c, 0., 0., 0., + static_cast(veh).getEmissionParameters()), TS); + return true; +} void MSDevice_Emissions::notifyMoveInternal(const SUMOTrafficObject& veh, @@ -116,4 +119,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Emissions.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Emissions.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Emissions.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Emissions.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A device which collects vehicular emissions /****************************************************************************/ -#ifndef MSDevice_Emissions_h -#define MSDevice_Emissions_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -99,6 +93,18 @@ * @see PollutantsInterface */ bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed); + + /** @brief Computes idling emission values and adds them to the emission sums + * + * Idling implied by zero velocity, acceleration and slope + * + * @param[in] veh The vehicle + * + * @see MSMoveReminder::notifyMove + * @see PollutantsInterface + */ + bool notifyIdle(SUMOTrafficObject& veh); + /// @} /// @brief return the name for this type of device @@ -154,9 +160,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Example.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Example.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Example.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Example.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A device which stands as an implementation example and which outputs movereminder calls /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -182,4 +178,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Example.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Example.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Example.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Example.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A device which stands as an implementation example and which outputs movereminder calls /****************************************************************************/ -#ifndef MSDevice_Example_h -#define MSDevice_Example_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -172,9 +166,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_FCD.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_FCD.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_FCD.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_FCD.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A device which stands as an implementation FCD and which outputs movereminder calls /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -113,5 +109,5 @@ myEdgeFilterInitialized = false; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_FCD.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_FCD.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_FCD.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_FCD.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A device which records floating car data /****************************************************************************/ -#ifndef MSDevice_FCD_h -#define MSDevice_FCD_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -117,9 +111,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Abstract in-vehicle device /****************************************************************************/ -#ifndef MSDevice_h -#define MSDevice_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -256,8 +250,3 @@ return !nameGiven && outputOptionSet; } } - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Routing.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Routing.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Routing.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Routing.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,6 +83,12 @@ oc.doRegister("device.rerouting.synchronize", new Option_Bool(false)); oc.addDescription("device.rerouting.synchronize", "Routing", "Let rerouting happen at the same time for all vehicles"); + oc.doRegister("device.rerouting.railsignal", new Option_Bool(true)); + oc.addDescription("device.rerouting.railsignal", "Routing", "Allow rerouting triggered by rail signals."); + + oc.doRegister("device.rerouting.bike-speeds", new Option_Bool(false)); + oc.addDescription("device.rerouting.bike-speeds", "Routing", "Compute separate average speeds for bicycles"); + oc.doRegister("device.rerouting.output", new Option_FileName()); oc.addDescription("device.rerouting.output", "Routing", "Save adapting weights to FILE"); } @@ -147,8 +149,14 @@ // MSDevice_Routing-methods // --------------------------------------------------------------------------- MSDevice_Routing::MSDevice_Routing(SUMOVehicle& holder, const std::string& id, - SUMOTime period, SUMOTime preInsertionPeriod) - : MSVehicleDevice(holder, id), myPeriod(period), myPreInsertionPeriod(preInsertionPeriod), myLastRouting(-1), mySkipRouting(-1), myRerouteCommand(nullptr) { + SUMOTime period, SUMOTime preInsertionPeriod) : + MSVehicleDevice(holder, id), + myPeriod(period), + myPreInsertionPeriod(preInsertionPeriod), + myLastRouting(-1), + mySkipRouting(-1), + myRerouteCommand(nullptr), + myRerouteRailSignal(getBoolParam(holder, OptionsCont::getOptions(), "rerouting.railsignal", true, true)) { if (myPreInsertionPeriod > 0 || holder.getParameter().wasSet(VEHPARS_FORCE_REROUTE)) { // we do always a pre insertion reroute for trips to fill the best lanes of the vehicle with somehow meaningful values (especially for deaprtLane="best") myRerouteCommand = new WrappingCommand(this, &MSDevice_Routing::preInsertionReroute); @@ -175,7 +183,10 @@ myRerouteCommand->deschedule(); } else if (myPreInsertionPeriod > 0 && myHolder.getDepartDelay() > myPreInsertionPeriod) { // pre-insertion rerouting was disabled. Reroute once if insertion was delayed - reroute(MSNet::getInstance()->getCurrentTimeStep()); + // this is happening in the run thread (not inbeginOfTimestepEvents) so we cannot safely use the threadPool + myHolder.reroute(MSNet::getInstance()->getCurrentTimeStep(), "device.rerouting", + MSRoutingEngine::getRouterTT(myHolder.getRNGIndex(), myHolder.getVClass()), + false, MSRoutingEngine::withTaz(), false); } myRerouteCommand = nullptr; // build repetition trigger if routing shall be done more often @@ -235,7 +246,7 @@ void MSDevice_Routing::reroute(const SUMOTime currentTime, const bool onInit) { - MSRoutingEngine::initEdgeWeights(); + MSRoutingEngine::initEdgeWeights(myHolder.getVClass()); //check whether the weights did change since the last reroute if (myLastRouting >= MSRoutingEngine::getLastAdaptation()) { return; diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Routing.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Routing.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Routing.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Routing.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ -#ifndef MSDevice_Routing_h -#define MSDevice_Routing_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -158,6 +152,11 @@ return myPeriod; } + /// @brief return whether the equipped vehicle may receive dispatch information at a rail signal + bool mayRerouteRailSignal() const { + return myRerouteRailSignal; + } + /// @brief try to retrieve the given parameter from this device. Throw exception for unsupported key std::string getParameter(const std::string& key) const; @@ -222,6 +221,9 @@ /// @brief The (optional) command responsible for rerouting WrappingCommand< MSDevice_Routing >* myRerouteCommand; + /// @brief Whether the equipped vehicle may receive dispatch information at a rail signal + bool myRerouteRailSignal; + private: /// @brief Invalidated copy constructor. MSDevice_Routing(const MSDevice_Routing&); @@ -231,9 +233,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_SSM.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_SSM.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_SSM.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_SSM.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,10 +22,6 @@ // XXX: Preliminary implementation. Use with care. Especially rerouting vehicles could be problematic. // TODO: implement SSM time-gap (estimated conflict entry and exit times are already calculated for PET calculation) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -3663,5 +3659,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_SSM.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_SSM.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_SSM.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_SSM.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ // An SSM-device logs encounters / conflicts of the carrying vehicle with other surrounding vehicles. // XXX: Preliminary implementation. Use with care. Especially rerouting vehicles could be problematic. /****************************************************************************/ -#ifndef MSDevice_SSM_h -#define MSDevice_SSM_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -776,8 +770,3 @@ }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Taxi.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Taxi.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Taxi.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Taxi.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // A device which controls a taxi /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,11 +62,11 @@ oc.doRegister("device.taxi.dispatch-algorithm", new Option_String("greedy")); oc.addDescription("device.taxi.dispatch-algorithm", "Taxi Device", "The dispatch algorithm [greedy|greedyClosest|greedyShared]"); - oc.doRegister("device.taxi.dispatch-algorithm.output", new Option_String("greedy")); + oc.doRegister("device.taxi.dispatch-algorithm.output", new Option_String("dispatch.xml")); oc.addDescription("device.taxi.dispatch-algorithm.output", "Taxi Device", "Write information from the dispatch algorithm to FILE"); - oc.doRegister("device.taxi.dispatch-algorithm.params", new Option_String("greedy")); - oc.addDescription("device.taxi.dispatch-algorithm.params", "Taxi Device", "Load dispatch algorith parameters in format KEY1:VALUE1[,KEY2:VALUE]"); + oc.doRegister("device.taxi.dispatch-algorithm.params", new Option_String("")); + oc.addDescription("device.taxi.dispatch-algorithm.params", "Taxi Device", "Load dispatch algorithm parameters in format KEY1:VALUE1[,KEY2:VALUE]"); oc.doRegister("device.taxi.dispatch-period", new Option_String("60", "TIME")); oc.addDescription("device.taxi.dispatch-period", "Taxi Device", "The period between successive calls to the dispatcher"); @@ -229,7 +225,7 @@ WRITE_WARNINGF("Could not add taxi stop for vehicle '%' to %. time=% error=%", myHolder.getID(), stop.actType, SIMTIME, error) } } - SUMOAbstractRouter& router = MSRoutingEngine::getRouterTT(0); + SUMOAbstractRouter& router = MSRoutingEngine::getRouterTT(myHolder.getRNGIndex(), myHolder.getVClass()); // SUMOAbstractRouter& router = myHolder.getInfluencer().getRouterTT(veh->getRNGIndex()) myHolder.reroute(MSNet::getInstance()->getCurrentTimeStep(), "taxi:dispatch", router, false); } else { @@ -371,4 +367,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Taxi.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Taxi.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Taxi.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Taxi.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A device which controls a taxi /****************************************************************************/ -#ifndef MSDevice_Taxi_h -#define MSDevice_Taxi_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -239,9 +233,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ToC.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ToC.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ToC.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ToC.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ // The ToC Device controls the transition of control between automated and manual driving. // /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -159,6 +155,10 @@ MSDevice_ToC::buildVehicleDevices(SUMOVehicle& v, std::vector& into) { OptionsCont& oc = OptionsCont::getOptions(); if (equippedByDefaultAssignmentOptions(oc, "toc", v, false)) { + if (MSGlobals::gUseMesoSim) { + WRITE_WARNING("ToC device is not supported by the mesoscopic simulation."); + return; + } const std::string manualType = getStringParam(v, oc, "toc.manualType", DEFAULT_MANUAL_TYPE, true); const std::string automatedType = getStringParam(v, oc, "toc.automatedType", DEFAULT_AUTOMATED_TYPE, true); const SUMOTime responseTime = TIME2STEPS(getFloatParam(v, oc, "toc.responseTime", DEFAULT_RESPONSE_TIME, false)); @@ -290,6 +290,7 @@ myOutputFile(nullptr), myEvents(), myEventLanes(), + myEventXY(), myPreviousLCMode(-1), myOpenGapParams(ogp), myDynamicToCThreshold(dynamicToCThreshold), @@ -543,6 +544,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "TOR")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } } else { // Switch to automated mode is performed immediately @@ -597,6 +599,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "MRM")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } return 0; @@ -626,6 +629,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "ToCup")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } return 0; @@ -662,6 +666,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "ToCdown")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } return 0; } @@ -817,6 +822,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "DYNTOR")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } // Leadtime for dynamic ToC is proportional to the time assumed for the dynamic ToC threshold const double leadTime = myDynamicToCThreshold * 1000 * DYNAMIC_TOC_LEADTIME_FACTOR; @@ -830,6 +836,7 @@ if (generatesOutput()) { myEvents.push(std::make_pair(SIMSTEP, "DYNTOR")); myEventLanes.push(std::make_pair(myHolder.getLane()->getID(), myHolder.getPositionOnLane())); // add lane and lanepos + myEventXY.push(std::make_pair(myHolder.getPosition().x(), myHolder.getPosition().y())); // add (x, y) position } // NOTE: This should not occur if lane changing is prevented during ToC preparation... // TODO: Reset response time to the original value (unnecessary if re-sampling for each call to requestToC) @@ -1022,12 +1029,24 @@ while (!myEvents.empty()) { std::pair& e = myEvents.front(); std::pair& l = myEventLanes.front(); + std::pair& p = myEventXY.front(); myOutputFile->openTag(e.second); myOutputFile->writeAttr("id", myHolder.getID()).writeAttr("t", STEPS2TIME(e.first)); - myOutputFile->writeAttr("lane", l.first).writeAttr("lanePos", STEPS2TIME(l.second)); + myOutputFile->writeAttr("lane", l.first).writeAttr("lanePos", l.second); + myOutputFile->writeAttr("x", p.first).writeAttr("y", p.second); myOutputFile->closeTag(); myEvents.pop(); myEventLanes.pop(); + myEventXY.pop(); + + if (e.second.compare("DYNTOR") == 0 && !myEvents.empty()) { // skip "TOR" events if duplicate of "DYNTOR" + std::pair& eNext = myEvents.front(); + if (eNext.second.compare("TOR") == 0 && eNext.first == e.first) { + myEvents.pop(); + myEventLanes.pop(); + myEventXY.pop(); + } + } } } @@ -1274,4 +1293,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ToC.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ToC.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_ToC.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_ToC.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ // The ToC Device controls the transition of control between automated and manual driving. // /****************************************************************************/ -#ifndef MSDevice_ToC_h -#define MSDevice_ToC_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -321,6 +315,9 @@ /// @brief Storage for events to be written to the output std::queue > myEventLanes; + /// @brief Storage for events to be written to the output + std::queue> myEventXY; + /// @brief LC mode overridden during MRM, stored for restoration int myPreviousLCMode; @@ -391,9 +388,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Transportable.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Transportable.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Transportable.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Transportable.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,10 +22,6 @@ /// // A device which is used to keep track of persons and containers riding with a vehicle /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -33,6 +29,7 @@ #include #include #include +#include #include "MSDevice_Transportable.h" #include "MSDevice_Taxi.h" @@ -61,15 +58,20 @@ MSDevice_Transportable::~MSDevice_Transportable() { // flush any unfortunate riders still remaining - while (!myTransportables.empty()) { - MSTransportable* transportable = myTransportables.front(); + for (auto it = myTransportables.begin(); it != myTransportables.end();) { + MSTransportable* transportable = *it; WRITE_WARNING((myAmContainer ? "Removing container '" : "Removing person '") + transportable->getID() + "' at removal of vehicle '" + myHolder.getID() + "'"); + MSStageDriving* const stage = dynamic_cast(transportable->getCurrentStage()); + if (stage != nullptr) { + stage->setVehicle(nullptr); + } if (myAmContainer) { MSNet::getInstance()->getContainerControl().erase(transportable); } else { MSNet::getInstance()->getPersonControl().erase(transportable); } + it = myTransportables.erase(it); } } @@ -99,7 +101,9 @@ if (veh.isStopped()) { for (std::vector::iterator i = myTransportables.begin(); i != myTransportables.end();) { MSTransportable* transportable = *i; - if (transportable->getDestination() == veh.getEdge()) { + if (transportable->getDestination() == veh.getEdge() + && (transportable->getCurrentStage()->getDestinationStop() == nullptr + || myHolder.isStoppedInRange(transportable->getCurrentStage()->getArrivalPos(), myHolder.getLength()))) { i = myTransportables.erase(i); // erase first in case proceed throws an exception if (!transportable->proceed(MSNet::getInstance(), MSNet::getInstance()->getCurrentTimeStep())) { if (myAmContainer) { @@ -210,4 +214,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Transportable.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Transportable.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Transportable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Transportable.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A device which is used to keep track of persons and containers riding with a vehicle /****************************************************************************/ -#ifndef MSDevice_Transportable_h -#define MSDevice_Transportable_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -182,9 +176,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // A device which collects info on the vehicle trip /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -113,6 +109,7 @@ myArrivalPos(-1), myArrivalPosLat(0.), myArrivalSpeed(-1), + myArrivalReason(MSMoveReminder::NOTIFICATION_ARRIVED), myMesoTimeLoss(0), myRouteLength(0.) { } @@ -151,6 +148,19 @@ } bool +MSDevice_Tripinfo::notifyIdle(SUMOTrafficObject& veh) { + if (veh.isVehicle()) { + myWaitingTime += DELTA_T; + if (!myAmWaiting) { + myWaitingCount++; + myAmWaiting = true; + } + } + return true; +} + + +bool MSDevice_Tripinfo::notifyMove(SUMOTrafficObject& veh, double /*oldPos*/, double /*newPos*/, double newSpeed) { if (veh.isStopped()) { @@ -220,6 +230,7 @@ MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) { if (reason >= MSMoveReminder::NOTIFICATION_ARRIVED) { myArrivalTime = MSNet::getInstance()->getCurrentTimeStep(); + myArrivalReason = reason; if (!MSGlobals::gUseMesoSim) { myArrivalLane = static_cast(veh).getLane()->getID(); myArrivalPosLat = static_cast(veh).getLateralPositionOnLane(); @@ -227,7 +238,8 @@ // @note vehicle may have moved past its arrivalPos during the last step // due to non-zero arrivalspeed but we consider it as arrived at the desired position // However, vaporization may happen anywhere (via TraCI) - if (reason == MSMoveReminder::NOTIFICATION_VAPORIZED) { + if (reason > MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED) { + // vaporized myArrivalPos = veh.getPositionOnLane(); } else { myArrivalPos = myHolder.getArrivalPos(); @@ -240,7 +252,10 @@ if (MSGlobals::gUseMesoSim) { myRouteLength += myHolder.getEdge()->getLength(); } else { - myRouteLength += static_cast(veh).getLane()->getLength(); + MSLane* lane = static_cast(veh).getLane(); + if (lane != nullptr) { + myRouteLength += lane->getLength(); + } } } return true; @@ -292,7 +307,31 @@ os.writeAttr("devices", toString(myHolder.getDevices())); os.writeAttr("vType", myHolder.getVehicleType().getID()); os.writeAttr("speedFactor", myHolder.getChosenSpeedFactor()); - os.writeAttr("vaporized", (myHolder.getEdge() == *(myHolder.getRoute().end() - 1) ? "" : "0")); + std::string vaporized; + switch (myArrivalReason) { + case MSMoveReminder::NOTIFICATION_VAPORIZED_CALIBRATOR: + vaporized = "calibrator"; + break; + case MSMoveReminder::NOTIFICATION_VAPORIZED_GUI: + vaporized = "gui"; + break; + case MSMoveReminder::NOTIFICATION_VAPORIZED_COLLISION: + vaporized = "collision"; + break; + case MSMoveReminder::NOTIFICATION_VAPORIZED_VAPORIZER: + vaporized = "vaporizer"; + break; + case MSMoveReminder::NOTIFICATION_VAPORIZED_TRACI: + vaporized = "traci"; + break; + case MSMoveReminder::NOTIFICATION_TELEPORT_ARRIVED: + vaporized = "teleport"; + break; + default: + vaporized = (myHolder.getEdge() == *(myHolder.getRoute().end() - 1) ? "" : "end"); + + } + os.writeAttr("vaporized", vaporized); // cannot close tag because emission device output might follow } @@ -430,6 +469,47 @@ } + +void +MSDevice_Tripinfo::writeStatistics(OutputDevice& od) { + od.setPrecision(gPrecision); + od.openTag("vehicleTripStatistics"); + od.writeAttr("routeLength", getAvgRouteLength()); + od.writeAttr("speed", getAvgTripSpeed()); + od.writeAttr("duration", getAvgDuration()); + od.writeAttr("waitingTime", getAvgWaitingTime()); + od.writeAttr("timeLoss", getAvgTimeLoss()); + od.writeAttr("departDelay", getAvgDepartDelay()); + od.writeAttr("departDelayWaiting", myWaitingDepartDelay); + od.closeTag(); + od.openTag("pedestrianStatistics"); + od.writeAttr("number", myWalkCount); + od.writeAttr("routeLength", getAvgWalkRouteLength()); + od.writeAttr("duration", getAvgWalkDuration()); + od.writeAttr("timeLoss", getAvgWalkTimeLoss()); + od.closeTag(); + writeRideStatistics(od, "rideStatistics", 0); + writeRideStatistics(od, "transportStatistics", 1); +} + +void +MSDevice_Tripinfo::writeRideStatistics(OutputDevice& od, const std::string& category, const int index) { + od.openTag(category); + od.writeAttr("number", myRideCount[index]); + if (myRideCount[index] > 0) { + od.writeAttr("waitingTime", STEPS2TIME(myTotalRideWaitingTime[index] / myRideCount[index])); + od.writeAttr("routeLength", myTotalRideRouteLength[index] / myRideCount[index]); + od.writeAttr("duration", STEPS2TIME(myTotalRideDuration[index] / myRideCount[index])); + od.writeAttr("bus", myRideBusCount[index]); + od.writeAttr("train", myRideRailCount[index]); + od.writeAttr("taxi", myRideTaxiCount[index]); + od.writeAttr("bike", myRideBikeCount[index]); + od.writeAttr("aborted", myRideAbortCount[index]); + } + od.closeTag(); +} + + double MSDevice_Tripinfo::getAvgRouteLength() { if (myVehicleCount > 0) { diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Tripinfo.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A device which collects info on the vehicle trip /****************************************************************************/ -#ifndef MSDevice_Tripinfo_h -#define MSDevice_Tripinfo_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -80,6 +74,9 @@ /// @brief get statistics for printing to stdout static std::string printStatistics(); + /// @brief write statistic output to (xml) file + static void writeStatistics(OutputDevice& od); + /// @brief accessors for GUINet-Parameters static double getAvgRouteLength(); static double getAvgTripSpeed(); @@ -118,6 +115,14 @@ */ bool notifyMove(SUMOTrafficObject& veh, double oldPos, double newPos, double newSpeed); + /** @brief record idling as waiting time - cf issue 2233 + * + * @param[in] veh The idling vehicle. + * @return Always true + * + * @see MSMoveReminder::notifyIdle + */ + bool notifyIdle(SUMOTrafficObject& veh); /** @brief Saves departure info on insertion * @@ -195,6 +200,8 @@ static void printRideStatistics(std::ostringstream& msg, const std::string& category, const std::string& modeName, const int index); + static void writeRideStatistics(OutputDevice& od, const std::string& category, const int index); + private: /// @brief The lane the vehicle departed at std::string myDepartLane; @@ -235,6 +242,9 @@ /// @brief The speed when arriving double myArrivalSpeed; + /// @brief The reason for vehicle arrival + MSMoveReminder::Notification myArrivalReason; + /// @brief The time loss when compared to the desired and allowed speed SUMOTime myMesoTimeLoss; @@ -278,9 +288,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // A device which collects info on the vehicle trip /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -53,6 +49,7 @@ bool MSDevice_Vehroutes::myRouteLength = false; bool MSDevice_Vehroutes::mySkipPTLines = false; bool MSDevice_Vehroutes::myIncludeIncomplete = false; +bool MSDevice_Vehroutes::myWriteStopPriorEdges = false; MSDevice_Vehroutes::StateListener MSDevice_Vehroutes::myStateListener; std::map MSDevice_Vehroutes::myDepartureCounts; std::map > MSDevice_Vehroutes::myRouteInfos; @@ -78,6 +75,7 @@ myRouteLength = oc.getBool("vehroute-output.route-length"); mySkipPTLines = oc.getBool("vehroute-output.skip-ptlines"); myIncludeIncomplete = oc.getBool("vehroute-output.incomplete"); + myWriteStopPriorEdges = oc.getBool("vehroute-output.stop-edges"); MSNet::getInstance()->addVehicleStateListener(&myStateListener); } } @@ -123,7 +121,7 @@ myDepartPos(-1), myDepartSpeed(-1), myDepartPosLat(0), - myStopOut(false, 2) { + myStopOut(2) { myCurrentRoute->addReference(); } @@ -138,21 +136,24 @@ bool -MSDevice_Vehroutes::notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) { - MSVehicle& vehicle = static_cast(veh); +MSDevice_Vehroutes::notifyEnter(SUMOTrafficObject& veh, MSMoveReminder::Notification reason, const MSLane* enteredLane) { if (reason == MSMoveReminder::NOTIFICATION_DEPARTED) { - if (mySorted && myStateListener.myDevices[&vehicle] == this) { + if (mySorted && myStateListener.myDevices[static_cast(&veh)] == this) { const SUMOTime departure = myIntendedDepart ? myHolder.getParameter().depart : MSNet::getInstance()->getCurrentTimeStep(); myDepartureCounts[departure]++; } if (!MSGlobals::gUseMesoSim) { + const MSVehicle& vehicle = static_cast(veh); myDepartLane = vehicle.getLane()->getIndex(); myDepartPosLat = vehicle.getLateralPositionOnLane(); } myDepartSpeed = veh.getSpeed(); myDepartPos = veh.getPositionOnLane(); } - return mySaveExits; + if (myWriteStopPriorEdges) { + myPriorEdges.push_back(&enteredLane->getEdge()); + } + return mySaveExits || myWriteStopPriorEdges; } @@ -166,13 +167,18 @@ myLastSavedAt = veh.getEdge(); } } - return mySaveExits; + return mySaveExits || myWriteStopPriorEdges; } void MSDevice_Vehroutes::stopEnded(const SUMOVehicleParameter::Stop& stop) { - stop.write(myStopOut); + stop.write(myStopOut, !myWriteStopPriorEdges); + if (myWriteStopPriorEdges) { + myStopOut.writeAttr("priorEdges", myPriorEdges); + myPriorEdges.clear(); + myStopOut.closeTag(); + } } @@ -271,7 +277,7 @@ return; } OutputDevice& routeOut = OutputDevice::getDeviceByOption("vehroute-output"); - OutputDevice_String od(routeOut.isBinary(), 1); + OutputDevice_String od(1); SUMOVehicleParameter tmp = myHolder.getParameter(); tmp.depart = myIntendedDepart ? myHolder.getParameter().depart : myHolder.getDeparture(); if (!MSGlobals::gUseMesoSim) { diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDevice_Vehroutes.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A device which collects info on the vehicle trip /****************************************************************************/ -#ifndef MSDevice_Vehroutes_h -#define MSDevice_Vehroutes_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSVehicleDevice.h" @@ -205,6 +199,8 @@ /// @brief A shortcut for the Option "vehroute-output.incomplete" static bool myIncludeIncomplete; + /// @brief A shortcut for the Option "vehroute-output.stop-edges" + static bool myWriteStopPriorEdges; /** @class StateListener * @brief A class that is notified about reroutings @@ -299,6 +295,9 @@ /// @brief The lateral depart position double myDepartPosLat; + /// @brief the edges that were passed before the current stop + std::vector myPriorEdges; + OutputDevice_String myStopOut; private: @@ -310,9 +309,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // An algorithm that performs dispatch for the taxi device /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -188,7 +184,7 @@ } } // greedy assign closest vehicle in reservation order - SUMOAbstractRouter& router = myRoutingMode == 1 ? MSRoutingEngine::getRouterTT(0) : MSNet::getInstance()->getRouterTT(0); + SUMOAbstractRouter& router = myRoutingMode == 1 ? MSRoutingEngine::getRouterTT(0, SVC_TAXI) : MSNet::getInstance()->getRouterTT(0); std::vector reservations = getReservations(); std::sort(reservations.begin(), reservations.end(), time_sorter()); #ifdef DEBUG_DISPATCH @@ -207,7 +203,7 @@ //Position pos = res.from->getLanes().front()->geometryPositionAtOffset(res.fromPos); MSDevice_Taxi* closest = nullptr; SUMOTime closestTime = SUMOTime_MAX; - bool toEarly = false; + bool tooEarly = false; for (auto* taxi : available) { if (taxi->getHolder().getVehicleType().getPersonCapacity() < (int)res->persons.size()) { continue; @@ -224,14 +220,14 @@ SUMOTime taxiWait = res->pickupTime - (now + closestTime); if (taxiWait > myMaximumWaitingTime) { // no need to service this customer now - toEarly = true; + tooEarly = true; res->recheck += MAX2(now + myRecheckTime, res->pickupTime - closestTime - myRecheckSafety); break; } } } - if (toEarly || closest == nullptr) { - // toEarly or all taxis are too small + if (tooEarly || closest == nullptr) { + // too early or all taxis are too small it++; numPostponed++; } else { @@ -281,7 +277,7 @@ std::cout << SIMTIME << " computeDispatch fleet=" << fleet.size() << " available=" << available.size() << "\n"; #endif // greedy assign closest vehicle - SUMOAbstractRouter& router = myRoutingMode == 1 ? MSRoutingEngine::getRouterTT(0) : MSNet::getInstance()->getRouterTT(0); + SUMOAbstractRouter& router = myRoutingMode == 1 ? MSRoutingEngine::getRouterTT(0, SVC_TAXI) : MSNet::getInstance()->getRouterTT(0); std::vector activeReservations; for (Reservation* res : getReservations()) { if (res->recheck <= now) { diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // An algorithm that performs dispatch for the taxi device /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,13 +72,13 @@ if (absLossPickup < myAbsoluteLossThreshold && relLossPickup < myRelativeLossThreshold) { const SUMOTime startDropOff = MAX2(now, res2->pickupTime); double directTimeTmp = -1; // direct time from picking up res2 to dropping of res - // case 1: res2 is dropped of before res (more detour for res) + // case 1: res2 is dropped off before res (more detour for res) double detourTime2 = computeDetourTime(startDropOff, startDropOff, taxi, res2->from, res2->fromPos, res2->to, res2->toPos, res->to, res->toPos, router, directTimeTmp); const double absLoss_c1 = absLossPickup + (detourTime2 - directTimeTmp); const double relLoss_c1 = absLoss_c1 / directTime; - // case 2: res2 is dropped of after res (detour for res2) + // case 2: res2 is dropped off after res (detour for res2) double detourTime3 = computeDetourTime(startDropOff, startDropOff, taxi, res2->from, res2->fromPos, res->to, res->toPos, res2->to, res2->toPos, router, directTime2); const double absLoss_c2 = detourTime3 - directTime2; diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch_GreedyShared.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ // An algorithm that performs dispatch for the taxi device /****************************************************************************/ #pragma once - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -54,6 +50,3 @@ /// @brief relative time threshold for declining shared ride const double myRelativeLossThreshold; }; - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch.h sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSDispatch.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSDispatch.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An algorithm that performs dispatch for the taxi device /****************************************************************************/ -#ifndef MSDispatch_h -#define MSDispatch_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -203,9 +197,3 @@ void computeDispatch(SUMOTime now, const std::vector& fleet); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSRoutingEngine.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSRoutingEngine.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSRoutingEngine.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSRoutingEngine.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSRoutingEngine.h" @@ -50,7 +46,9 @@ // static member variables // =========================================================================== std::vector MSRoutingEngine::myEdgeSpeeds; +std::vector MSRoutingEngine::myEdgeBikeSpeeds; std::vector > MSRoutingEngine::myPastEdgeSpeeds; +std::vector > MSRoutingEngine::myPastEdgeBikeSpeeds; Command* MSRoutingEngine::myEdgeWeightSettingCommand = nullptr; double MSRoutingEngine::myAdaptationWeight; int MSRoutingEngine::myAdaptationSteps; @@ -58,8 +56,13 @@ SUMOTime MSRoutingEngine::myAdaptationInterval = -1; SUMOTime MSRoutingEngine::myLastAdaptation = -1; bool MSRoutingEngine::myWithTaz; -SUMOAbstractRouter* MSRoutingEngine::myRouter = nullptr; +bool MSRoutingEngine::myBikeSpeeds; +MSRoutingEngine::MSRouterProvider* MSRoutingEngine::myRouterProvider = nullptr; std::map, const MSRoute*> MSRoutingEngine::myCachedRoutes; +double MSRoutingEngine::myPriorityFactor(0); +double MSRoutingEngine::myMinEdgePriority(std::numeric_limits::max()); +double MSRoutingEngine::myEdgePriorityRange(0); + SUMOAbstractRouter::Operation MSRoutingEngine::myEffortFunc = &MSRoutingEngine::getEffort; #ifdef HAVE_FOX FXMutex MSRoutingEngine::myRouteCacheMutex; @@ -94,31 +97,55 @@ void -MSRoutingEngine::initEdgeWeights() { - if (myEdgeSpeeds.empty()) { +MSRoutingEngine::initEdgeWeights(SUMOVehicleClass svc) { + if (myBikeSpeeds && svc == SVC_BICYCLE) { + _initEdgeWeights(myEdgeBikeSpeeds, myPastEdgeBikeSpeeds); + } else { + _initEdgeWeights(myEdgeSpeeds, myPastEdgeSpeeds); + } +} + + +void +MSRoutingEngine::_initEdgeWeights(std::vector& edgeSpeeds, std::vector >& pastEdgeSpeeds) { + if (edgeSpeeds.empty()) { const OptionsCont& oc = OptionsCont::getOptions(); if (myAdaptationWeight == 0 || !oc.isDefault("device.rerouting.adaptation-steps")) { myAdaptationSteps = oc.getInt("device.rerouting.adaptation-steps"); } const bool useLoaded = oc.getBool("device.rerouting.init-with-loaded-weights"); const double currentSecond = SIMTIME; + double maxEdgePriority = -std::numeric_limits::max(); for (const MSEdge* const edge : MSNet::getInstance()->getEdgeControl().getEdges()) { - while (edge->getNumericalID() >= (int)myEdgeSpeeds.size()) { - myEdgeSpeeds.push_back(0); + while (edge->getNumericalID() >= (int)edgeSpeeds.size()) { + edgeSpeeds.push_back(0); if (myAdaptationSteps > 0) { - myPastEdgeSpeeds.push_back(std::vector()); + pastEdgeSpeeds.push_back(std::vector()); } } if (useLoaded) { - myEdgeSpeeds[edge->getNumericalID()] = edge->getLength() / MSNet::getTravelTime(edge, nullptr, currentSecond); + edgeSpeeds[edge->getNumericalID()] = edge->getLength() / MSNet::getTravelTime(edge, nullptr, currentSecond); } else { - myEdgeSpeeds[edge->getNumericalID()] = edge->getMeanSpeed(); + edgeSpeeds[edge->getNumericalID()] = edge->getMeanSpeed(); } if (myAdaptationSteps > 0) { - myPastEdgeSpeeds[edge->getNumericalID()] = std::vector(myAdaptationSteps, myEdgeSpeeds[edge->getNumericalID()]); + pastEdgeSpeeds[edge->getNumericalID()] = std::vector(myAdaptationSteps, edgeSpeeds[edge->getNumericalID()]); } + maxEdgePriority = MAX2(maxEdgePriority, (double)edge->getPriority()); + myMinEdgePriority = MIN2(myMinEdgePriority, (double)edge->getPriority()); } + myEdgePriorityRange = maxEdgePriority - myMinEdgePriority; myLastAdaptation = MSNet::getInstance()->getCurrentTimeStep(); + myPriorityFactor = oc.getFloat("weights.priority-factor"); + if (myPriorityFactor < 0) { + throw ProcessError("weights.priority-factor cannot be negative."); + } + if (myPriorityFactor > 0) { + if (myEdgePriorityRange == 0) { + WRITE_WARNING("Option weights.priority-factor does not take effect because all edges have the same priority"); + myPriorityFactor = 0; + } + } } } @@ -134,28 +161,46 @@ double -MSRoutingEngine::getEffortExtra(const MSEdge* const e, const SUMOVehicle* const v, double t) { - if (e->getBidiEdge() != nullptr && !e->getBidiEdge()->getLanes()[0]->isEmpty()) { - // using std::numeric_limits::max() causing router warnings - return e->getLength() / NUMERICAL_EPS; +MSRoutingEngine::getEffortBike(const MSEdge* const e, const SUMOVehicle* const v, double) { + const int id = e->getNumericalID(); + if (id < (int)myEdgeBikeSpeeds.size()) { + return MAX2(e->getLength() / MAX2(myEdgeBikeSpeeds[id], NUMERICAL_EPS), e->getMinimumTravelTime(v)); } - double effort = getEffort(e, v, t); + return e->getMinimumTravelTime(v); +} + + + +double +MSRoutingEngine::getEffortExtra(const MSEdge* const e, const SUMOVehicle* const v, double t) { + double effort = (!myBikeSpeeds || v == nullptr || v->getVClass() != SVC_BICYCLE + ? getEffort(e, v, t) + : getEffortBike(e, v, t)); if (gWeightsRandomFactor != 1.) { effort *= RandHelper::rand(1., gWeightsRandomFactor); } + if (myPriorityFactor != 0) { + // lower priority should result in higher effort (and the edge with + // minimum priority receives a factor of myPriorityFactor + const double relativeInversePrio = 1 - ((e->getPriority() - myMinEdgePriority) / myEdgePriorityRange); + effort *= 1 + relativeInversePrio * myPriorityFactor; + } return effort; } double -MSRoutingEngine::getAssumedSpeed(const MSEdge* edge) { - return edge->getLength() / myEffortFunc(edge, nullptr, 0); +MSRoutingEngine::getAssumedSpeed(const MSEdge* edge, const SUMOVehicle* veh) { + return edge->getLength() / myEffortFunc(edge, veh, 0); } SUMOTime MSRoutingEngine::adaptEdgeEfforts(SUMOTime currentTime) { - initEdgeWeights(); + initEdgeWeights(SVC_PASSENGER); + if (myBikeSpeeds) { + initEdgeWeights(SVC_BICYCLE); + } if (MSNet::getInstance()->getVehicleControl().getDepartedVehicleNo() == 0) { return myAdaptationInterval; } @@ -175,6 +220,16 @@ myPastEdgeSpeeds[id][myAdaptationStepsIndex] = currSpeed; } } + if (myBikeSpeeds) { + for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + if ((*i)->isDelayed()) { + const int id = (*i)->getNumericalID(); + const double currSpeed = (*i)->getMeanSpeedBike(); + myEdgeBikeSpeeds[id] += (currSpeed - myPastEdgeBikeSpeeds[id][myAdaptationStepsIndex]) / myAdaptationSteps; + myPastEdgeBikeSpeeds[id][myAdaptationStepsIndex] = currSpeed; + } + } + } myAdaptationStepsIndex = (myAdaptationStepsIndex + 1) % myAdaptationSteps; } else { // exponential moving average @@ -188,6 +243,17 @@ } } } + if (myBikeSpeeds) { + for (MSEdgeVector::const_iterator i = edges.begin(); i != edges.end(); ++i) { + if ((*i)->isDelayed()) { + const int id = (*i)->getNumericalID(); + const double currSpeed = (*i)->getMeanSpeedBike(); + if (currSpeed != myEdgeBikeSpeeds[id]) { + myEdgeBikeSpeeds[id] = myEdgeBikeSpeeds[id] * myAdaptationWeight + currSpeed * newWeightFactor; + } + } + } + } } myLastAdaptation = currentTime + DELTA_T; // because we run at the end of the time step if (OptionsCont::getOptions().isSet("device.rerouting.output")) { @@ -200,6 +266,10 @@ dev.openTag(SUMO_TAG_EDGE); dev.writeAttr(SUMO_ATTR_ID, e->getID()); dev.writeAttr("traveltime", myEffortFunc(e, nullptr, STEPS2TIME(currentTime))); + if (myBikeSpeeds) { + // @note edge-priority is not included here + dev.writeAttr("traveltimeBike", getEffortBike(e, nullptr, STEPS2TIME(currentTime))); + } dev.closeTag(); } dev.closeTag(); @@ -222,11 +292,12 @@ MSRoutingEngine::initRouter(SUMOVehicle* vehicle) { OptionsCont& oc = OptionsCont::getOptions(); const std::string routingAlgorithm = oc.getString("routing-algorithm"); - myEffortFunc = (gWeightsRandomFactor != 1 || MSNet::getInstance()->hasBidiEdges() - ? &MSRoutingEngine::getEffortExtra - : &MSRoutingEngine::getEffort); + myBikeSpeeds = oc.getBool("device.rerouting.bike-speeds"); + myEffortFunc = ((gWeightsRandomFactor != 1 || myPriorityFactor != 0 || myBikeSpeeds) ? &MSRoutingEngine::getEffortExtra : &MSRoutingEngine::getEffort); + + SUMOAbstractRouter* router = nullptr; if (routingAlgorithm == "dijkstra") { - myRouter = new DijkstraRouter(MSEdge::getAllEdges(), true, myEffortFunc, nullptr, false, nullptr, true); + router = new DijkstraRouter(MSEdge::getAllEdges(), true, myEffortFunc, nullptr, false, nullptr, true); } else if (routingAlgorithm == "astar") { typedef AStarRouter AStar; std::shared_ptr lookup = nullptr; @@ -242,26 +313,32 @@ lookup = std::make_shared(oc.getString("astar.landmark-distances"), MSEdge::getAllEdges(), &router, nullptr, vehicle, "", oc.getInt("device.rerouting.threads")); vehicle->setChosenSpeedFactor(speedFactor); } - myRouter = new AStar(MSEdge::getAllEdges(), true, myEffortFunc, lookup, true); + router = new AStar(MSEdge::getAllEdges(), true, myEffortFunc, lookup, true); } else if (routingAlgorithm == "CH") { const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : SUMOTime_MAX; - myRouter = new CHRouter( + router = new CHRouter( MSEdge::getAllEdges(), true, myEffortFunc, vehicle->getVClass(), weightPeriod, true, false); } else if (routingAlgorithm == "CHWrapper") { const SUMOTime weightPeriod = myAdaptationInterval > 0 ? myAdaptationInterval : SUMOTime_MAX; - myRouter = new CHRouterWrapper( + router = new CHRouterWrapper( MSEdge::getAllEdges(), true, myEffortFunc, string2time(oc.getString("begin")), string2time(oc.getString("end")), weightPeriod, oc.getInt("device.rerouting.threads")); } else { throw ProcessError("Unknown routing algorithm '" + routingAlgorithm + "'!"); } + + RailwayRouter* railRouter = nullptr; + if (MSNet::getInstance()->hasBidiEdges()) { + railRouter = new RailwayRouter(MSEdge::getAllEdges(), true, myEffortFunc, nullptr, false, true); + } + myRouterProvider = new MSRouterProvider(router, nullptr, nullptr, railRouter); #ifdef HAVE_FOX FXWorkerThread::Pool& threadPool = MSNet::getInstance()->getEdgeControl().getThreadPool(); if (threadPool.size() > 0) { const std::vector& threads = threadPool.getWorkers(); - if (static_cast(threads.front())->setRouter(myRouter)) { + if (static_cast(threads.front())->setRouterProvider(myRouterProvider)) { for (std::vector::const_iterator t = threads.begin() + 1; t != threads.end(); ++t) { - static_cast(*t)->setRouter(myRouter->clone()); + static_cast(*t)->setRouterProvider(myRouterProvider->clone()); } } } @@ -272,9 +349,10 @@ void MSRoutingEngine::reroute(SUMOVehicle& vehicle, const SUMOTime currentTime, const std::string& info, const bool onInit, const bool silent, const MSEdgeVector& prohibited) { - if (myRouter == nullptr) { + if (myRouterProvider == nullptr) { initRouter(&vehicle); } + auto& router = myRouterProvider->getVehicleRouter(vehicle.getVClass()); #ifdef HAVE_FOX FXWorkerThread::Pool& threadPool = MSNet::getInstance()->getEdgeControl().getThreadPool(); if (threadPool.size() > 0) { @@ -283,20 +361,20 @@ } #endif if (!prohibited.empty()) { - myRouter->prohibit(prohibited); + router.prohibit(prohibited); } try { - vehicle.reroute(currentTime, info, *myRouter, onInit, myWithTaz, silent); + vehicle.reroute(currentTime, info, router, onInit, myWithTaz, silent); } catch (ProcessError&) { if (!silent) { if (!prohibited.empty()) { - myRouter->prohibit(MSEdgeVector()); + router.prohibit(MSEdgeVector()); } throw; } } if (!prohibited.empty()) { - myRouter->prohibit(MSEdgeVector()); + router.prohibit(MSEdgeVector()); } } @@ -308,22 +386,22 @@ SUMOAbstractRouter& -MSRoutingEngine::getRouterTT(const int rngIndex, const MSEdgeVector& prohibited) { - if (myRouter == nullptr) { +MSRoutingEngine::getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector& prohibited) { + if (myRouterProvider == nullptr) { initWeightUpdate(); - initEdgeWeights(); + initEdgeWeights(svc); initRouter(); } #ifdef HAVE_FOX FXWorkerThread::Pool& threadPool = MSNet::getInstance()->getEdgeControl().getThreadPool(); if (threadPool.size() > 0) { - auto& router = static_cast(threadPool.getWorkers()[rngIndex % MSGlobals::gNumThreads])->getRouter(); + auto& router = static_cast(threadPool.getWorkers()[rngIndex % MSGlobals::gNumThreads])->getRouter(svc); router.prohibit(prohibited); return router; } #endif - myRouter->prohibit(prohibited); - return *myRouter; + myRouterProvider->getVehicleRouter(svc).prohibit(prohibited); + return myRouterProvider->getVehicleRouter(svc); } @@ -332,6 +410,8 @@ myAdaptationInterval = -1; // responsible for triggering initEdgeWeights myPastEdgeSpeeds.clear(); myEdgeSpeeds.clear(); + myPastEdgeBikeSpeeds.clear(); + myEdgeBikeSpeeds.clear(); // @todo recheck. calling release crashes in parallel routing //for (auto& item : myCachedRoutes) { // item.second->release(); @@ -341,12 +421,12 @@ #ifdef HAVE_FOX if (MSGlobals::gNumThreads > 1) { // router deletion is done in thread destructor - myRouter = nullptr; + myRouterProvider = nullptr; return; } #endif - delete myRouter; - myRouter = nullptr; + delete myRouterProvider; + myRouterProvider = nullptr; } @@ -365,7 +445,7 @@ // --------------------------------------------------------------------------- void MSRoutingEngine::RoutingTask::run(FXWorkerThread* context) { - SUMOAbstractRouter& router = static_cast(context)->getRouter(); + SUMOAbstractRouter& router = static_cast(context)->getRouter(myVehicle.getVClass()); if (!myProhibited.empty()) { router.prohibit(myProhibited); } diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSRoutingEngine.h sumo-1.6.0+dfsg1/src/microsim/devices/MSRoutingEngine.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSRoutingEngine.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSRoutingEngine.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ -#ifndef MSRoutingEngine_h -#define MSRoutingEngine_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -35,6 +29,7 @@ #include #include #include +#include #include #include "MSDevice.h" @@ -66,11 +61,13 @@ */ class MSRoutingEngine { public: + typedef RouterProvider MSRouterProvider; + /// @brief intialize period edge weight update static void initWeightUpdate(); /// @brief initialize the edge weights if not done before - static void initEdgeWeights(); + static void initEdgeWeights(SUMOVehicleClass svc); /// @brief returns whether any routing actions take place static bool hasEdgeUpdates() { @@ -104,6 +101,7 @@ /// @brief return the router instance static SUMOAbstractRouter& getRouterTT(const int rngIndex, + SUMOVehicleClass svc, const MSEdgeVector& prohibited = MSEdgeVector()); /** @brief Returns the effort to pass an edge @@ -121,11 +119,17 @@ * @see DijkstraRouter_ByProxi */ static double getEffort(const MSEdge* const e, const SUMOVehicle* const v, double t); + static double getEffortBike(const MSEdge* const e, const SUMOVehicle* const v, double t); static double getEffortExtra(const MSEdge* const e, const SUMOVehicle* const v, double t); static SUMOAbstractRouter::Operation myEffortFunc; /// @brief return current travel speed assumption - static double getAssumedSpeed(const MSEdge* edge); + static double getAssumedSpeed(const MSEdge* edge, const SUMOVehicle* veh); + + /// @brief whether taz-routing is enabled + static bool withTaz() { + return myWithTaz; + } #ifdef HAVE_FOX static void waitForAll(); @@ -174,14 +178,13 @@ static SUMOTime adaptEdgeEfforts(SUMOTime currentTime); /// @} + /// @brief initialized edge speed storage into the given containers + static void _initEdgeWeights(std::vector& edgeSpeeds, std::vector >& pastEdgeSpeeds); private: /// @brief The weights adaptation/overwriting command static Command* myEdgeWeightSettingCommand; - /// @brief The container of edge speeds - static std::vector myEdgeSpeeds; - /// @brief Information which weight prior edge efforts have static double myAdaptationWeight; @@ -198,17 +201,33 @@ static int myAdaptationStepsIndex; /// @brief The container of edge speeds + static std::vector myEdgeSpeeds; + static std::vector myEdgeBikeSpeeds; + + /// @brief The container of past edge speeds (when using a simple moving average) static std::vector > myPastEdgeSpeeds; + static std::vector > myPastEdgeBikeSpeeds; /// @brief whether taz shall be used at initial rerouting static bool myWithTaz; + /// @brief whether separate speeds for bicycles shall be tracked + static bool myBikeSpeeds; + /// @brief The router to use - static SUMOAbstractRouter* myRouter; + static MSRouterProvider* myRouterProvider; /// @brief The container of pre-calculated routes static std::map, const MSRoute*> myCachedRoutes; + /// @brief Coefficient for factoring edge priority into routing weight + static double myPriorityFactor; + + /// @brief Minimum priority for all edges + static double myMinEdgePriority; + /// @brief the difference between maximum and minimum priority for all edges + static double myEdgePriorityRange; + #ifdef HAVE_FOX /// @brief Mutex for accessing the route cache static FXMutex myRouteCacheMutex; @@ -223,9 +242,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A device which stands as an implementation FCD and which outputs movereminder calls /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -79,5 +75,5 @@ MSTransportableDevice_FCD::cleanup() { } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.h sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_FCD.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A device which records floating car data /****************************************************************************/ -#ifndef MSTransportableDevice_FCD_h -#define MSTransportableDevice_FCD_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSTransportableDevice.h" @@ -104,9 +98,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice.h sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Abstract in-person device /****************************************************************************/ -#ifndef MSTransportableDevice_h -#define MSTransportableDevice_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -89,8 +83,3 @@ MSTransportableDevice& operator=(const MSTransportableDevice&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.cpp sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.cpp --- sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -95,7 +91,7 @@ void MSTransportableDevice_Routing::reroute(const SUMOTime currentTime, const bool /* onInit */) { - MSRoutingEngine::initEdgeWeights(); + MSRoutingEngine::initEdgeWeights(SVC_PEDESTRIAN); //check whether the weights did change since the last reroute if (myLastRouting >= MSRoutingEngine::getLastAdaptation()) { return; diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.h sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSTransportableDevice_Routing.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A device that performs vehicle rerouting based on current edge speeds /****************************************************************************/ -#ifndef MSTransportableDevice_Routing_h -#define MSTransportableDevice_Routing_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSTransportableDevice.h" @@ -160,8 +154,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/devices/MSVehicleDevice.h sumo-1.6.0+dfsg1/src/microsim/devices/MSVehicleDevice.h --- sumo-1.5.0+dfsg1/src/microsim/devices/MSVehicleDevice.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/devices/MSVehicleDevice.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Abstract in-vehicle device /****************************************************************************/ -#ifndef MSVehicleDevice_h -#define MSVehicleDevice_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ MSVehicleDevice& operator=(const MSVehicleDevice&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/EngineParameters.h sumo-1.6.0+dfsg1/src/microsim/engine/EngineParameters.h --- sumo-1.5.0+dfsg1/src/microsim/engine/EngineParameters.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/EngineParameters.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// /****************************************************************************/ -#ifndef ENGINEPARAMETERS_H_ -#define ENGINEPARAMETERS_H_ +#pragma once #include #include @@ -137,4 +136,3 @@ }; -#endif /* ENGINEPARAMETERS_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/FirstOrderLagModel.h sumo-1.6.0+dfsg1/src/microsim/engine/FirstOrderLagModel.h --- sumo-1.5.0+dfsg1/src/microsim/engine/FirstOrderLagModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/FirstOrderLagModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // An engine model using a first order lag /****************************************************************************/ -#ifndef FIRSTORDERLAGMODEL_H_ -#define FIRSTORDERLAGMODEL_H_ +#pragma once #include "GenericEngineModel.h" @@ -82,4 +81,3 @@ }; -#endif /* FIRSTORDERLAGMODEL_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/GenericEngineModel.h sumo-1.6.0+dfsg1/src/microsim/engine/GenericEngineModel.h --- sumo-1.5.0+dfsg1/src/microsim/engine/GenericEngineModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/GenericEngineModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // Generic interface for an engine model /****************************************************************************/ -#ifndef GENERICENGINEMODEL_H_ -#define GENERICENGINEMODEL_H_ +#pragma once #include #include @@ -122,4 +121,3 @@ }; -#endif /* GENERICENGINEMODEL_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/RealisticEngineModel.h sumo-1.6.0+dfsg1/src/microsim/engine/RealisticEngineModel.h --- sumo-1.5.0+dfsg1/src/microsim/engine/RealisticEngineModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/RealisticEngineModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // A detailed engine model /****************************************************************************/ -#ifndef ENGINEMODEL_H_ -#define ENGINEMODEL_H_ +#pragma once #include "GenericEngineModel.h" @@ -381,4 +380,3 @@ #endif }; -#endif /* ENGINEMODEL_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/VehicleEngineHandler.cpp sumo-1.6.0+dfsg1/src/microsim/engine/VehicleEngineHandler.cpp --- sumo-1.5.0+dfsg1/src/microsim/engine/VehicleEngineHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/VehicleEngineHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -16,11 +16,6 @@ /// @date 4 Feb 2015 /// /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -358,4 +353,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/engine/VehicleEngineHandler.h sumo-1.6.0+dfsg1/src/microsim/engine/VehicleEngineHandler.h --- sumo-1.5.0+dfsg1/src/microsim/engine/VehicleEngineHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/engine/VehicleEngineHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// /****************************************************************************/ -#ifndef VEHICLEENGINEHANDLER_H -#define VEHICLEENGINEHANDLER_H +#pragma once #include #include @@ -213,8 +212,3 @@ const VehicleEngineHandler& operator=(const VehicleEngineHandler& s); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -31,11 +31,6 @@ //#define DEBUG_OPPOSITE //#define DEBUG_MANEUVER #define DEBUG_COND (myVehicle.isSelected()) - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -110,8 +105,6 @@ myCommittedSpeed(0), myLaneChangeCompletion(1.0), myLaneChangeDirection(0), - myManeuverDist(0.), - myPreviousManeuverDist(0.), myAlreadyChanged(false), myShadowLane(nullptr), myTargetLane(nullptr), @@ -133,7 +126,9 @@ myMaxSpeedLatFactor(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, 1)), mySigma(v.getVehicleType().getParameter().getLCParam(SUMO_ATTR_LCA_SIGMA, 0.0)), myLastLaneChangeOffset(0), - myAmOpposite(false) { + myAmOpposite(false), + myManeuverDist(0.), + myPreviousManeuverDist(0.) { saveLCState(-1, LCA_UNKNOWN, LCA_UNKNOWN); saveLCState(0, LCA_UNKNOWN, LCA_UNKNOWN); saveLCState(1, LCA_UNKNOWN, LCA_UNKNOWN); diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSAbstractLaneChangeModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,12 +22,7 @@ /// // Interface for lane-change models /****************************************************************************/ -#ifndef MSAbstractLaneChangeModel_h -#define MSAbstractLaneChangeModel_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -633,13 +628,6 @@ /// @brief direction of the lane change maneuver -1 means right, 1 means left int myLaneChangeDirection; - /// @brief The complete lateral distance the vehicle wants to travel to finish its maneuver - /// Only used by sublane model, currently. - double myManeuverDist; - - /// @brief Maneuver distance from the previous simulation step - double myPreviousManeuverDist; - /// @brief whether the vehicle has already moved this step bool myAlreadyChanged; @@ -736,14 +724,15 @@ /// @brief whether the vehicle is driving in the opposite direction bool myAmOpposite; + /// @brief The complete lateral distance the vehicle wants to travel to finish its maneuver + /// Only used by sublane model, currently. + double myManeuverDist; + + /// @brief Maneuver distance from the previous simulation step + double myPreviousManeuverDist; + private: /// @brief Invalidated assignment operator MSAbstractLaneChangeModel& operator=(const MSAbstractLaneChangeModel& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.cpp sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.cpp --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A lane change model developed by D. Krajzewicz between 2004 and 2010 /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -646,4 +641,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.h sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.h --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_DK2008.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A lane change model developed by D. Krajzewicz between 2004 and 2010 /****************************************************************************/ -#ifndef MSLCM_DK2008_h -#define MSLCM_DK2008_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSAbstractLaneChangeModel.h" @@ -150,9 +144,3 @@ bool myDontBrake; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.cpp sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.cpp --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -24,11 +24,6 @@ // A lane change model developed by J. Erdmann // based on the model of D. Krajzewicz developed between 2004 and 2011 (MSLCM_DK2004) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -241,6 +236,8 @@ // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 double MAGIC_offset = 1.; + double nVSafe = wanted; + bool gotOne = false; // if we want to change and have a blocking leader and there is enough room for him in front of us if (myLeadingBlockerLength != 0) { double space = myLeftSpace - myLeadingBlockerLength - MAGIC_offset - myVehicle.getVehicleType().getMinGap(); @@ -260,13 +257,12 @@ std::cout << SIMTIME << " veh=" << myVehicle.getID() << " slowing down for leading blocker, safe=" << safe << (safe + NUMERICAL_EPS < min ? " (not enough)" : "") << "\n"; } #endif - return MAX2(min, safe); + nVSafe = MAX2(min, safe); + gotOne = true; } } } - double nVSafe = wanted; - bool gotOne = false; const double coopWeight = MAX2(0.0, MIN2(1.0, myCooperativeSpeed)); for (std::vector::const_iterator i = myLCAccelerationAdvices.begin(); i != myLCAccelerationAdvices.end(); ++i) { double a = (*i); @@ -537,7 +533,7 @@ const double decel = remainingSeconds == 0. ? myVehicle.getCarFollowModel().getMaxDecel() : MIN2(myVehicle.getCarFollowModel().getMaxDecel(), MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds)); - const double nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - ACCEL2SPEED(decel)); + const double nextSpeed = MIN2(plannedSpeed, MAX2(0.0, myVehicle.getSpeed() - ACCEL2SPEED(decel))); #ifdef DEBUG_INFORMER if (DEBUG_COND) { std::cout << SIMTIME @@ -1035,7 +1031,7 @@ // truncate to work around numerical instability between different builds mySpeedGainProbability = ceil(mySpeedGainProbability * 100000.0) * 0.00001; myKeepRightProbability = ceil(myKeepRightProbability * 100000.0) * 0.00001; - if (mySigma > 0 && MSGlobals::gLaneChangeDuration > DELTA_T && !isChangingLanes()) { + if (mySigma > 0 && !isChangingLanes()) { // disturb lateral position directly const double oldPosLat = myVehicle.getLateralPositionOnLane(); const double deltaPosLat = OUProcess::step(oldPosLat, @@ -2186,5 +2182,5 @@ initDerivedParameters(); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.h sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.h --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_LC2013.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013 /****************************************************************************/ -#ifndef MSLCM_LC2013_h -#define MSLCM_LC2013_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSAbstractLaneChangeModel.h" @@ -278,9 +272,3 @@ double myChangeProbThresholdLeft; //@} }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.cpp sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.cpp --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A lane change model for heterogeneous traffic (based on sub-lanes) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -114,7 +109,7 @@ //#define DEBUG_COND (myVehicle.getID() == "pkw150478" || myVehicle.getID() == "pkw150494" || myVehicle.getID() == "pkw150289") //#define DEBUG_COND (myVehicle.getID() == "A" || myVehicle.getID() == "B") // fail change to left //#define DEBUG_COND (myVehicle.getID() == "disabled") // test stops_overtaking -//#define DEBUG_COND false +//#define DEBUG_COND true // =========================================================================== @@ -277,7 +272,6 @@ } #endif if ((state & LCA_STAY) != 0) { - myManeuverDist = 0; myCanChangeFully = true; // if (DEBUG_COND) { // std::cout << " myCanChangeFully=true\n"; @@ -334,6 +328,8 @@ int state = myOwnState; + double nVSafe = wanted; + bool gotOne = false; // letting vehicles merge in at the end of the lane in case of counter-lane change, step#2 // if we want to change and have a blocking leader and there is enough room for him in front of us if (myLeadingBlockerLength != 0) { @@ -343,7 +339,7 @@ std::cout << SIMTIME << " veh=" << myVehicle.getID() << " myLeadingBlockerLength=" << myLeadingBlockerLength << " space=" << space << "\n"; } #endif - if (space > 0) { // XXX space > -MAGIC_OFFSET + if (space >= 0) { // XXX space > -MAGIC_OFFSET // compute speed for decelerating towards a place which allows the blocking leader to merge in in front double safe = cfModel.stopSpeed(&myVehicle, myVehicle.getSpeed(), space); // if we are approaching this place @@ -353,12 +349,11 @@ std::cout << SIMTIME << " veh=" << myVehicle.getID() << " slowing down for leading blocker, safe=" << safe << (safe + NUMERICAL_EPS < min ? " (not enough)" : "") << "\n"; } #endif - return MAX2(min, safe); + nVSafe = MAX2(min, safe); + gotOne = true; } } } - double nVSafe = wanted; - bool gotOne = false; const double coopWeight = MAX2(0.0, MIN2(1.0, myCooperativeSpeed)); for (std::vector::const_iterator i = myLCAccelerationAdvices.begin(); i != myLCAccelerationAdvices.end(); ++i) { double v = myVehicle.getSpeed() + ACCEL2SPEED(*i); @@ -570,7 +565,7 @@ const double decel = ACCEL2SPEED(MIN2(myVehicle.getCarFollowModel().getMaxDecel(), MAX2(MIN_FALLBEHIND, (myVehicle.getSpeed() - targetSpeed) / remainingSeconds))); //const double nextSpeed = MAX2(0., MIN2(plannedSpeed, myVehicle.getSpeed() - decel)); - const double nextSpeed = MIN2(plannedSpeed, myVehicle.getSpeed() - decel); + const double nextSpeed = MIN2(plannedSpeed, MAX2(0.0, myVehicle.getSpeed() - decel)); #ifdef DEBUG_INFORM if (gDebugFlag2) { std::cout << SIMTIME @@ -861,9 +856,6 @@ MSAbstractLaneChangeModel::prepareStep(); // keep information about strategic change direction myOwnState = (myOwnState & (LCA_STRATEGIC | LCA_COOPERATIVE)) ? (myOwnState & LCA_WANTS_LANECHANGE) : 0; - if (myCanChangeFully) { - myManeuverDist = 0; - } #ifdef DEBUG_INFORM if (debugVehicle()) { std::cout << SIMTIME @@ -1258,7 +1250,8 @@ && curr.bestContinuations.back()->getLinkCont().size() != 0 ) { // there might be a vehicle which needs to counter-lane-change one lane further and we cannot see it yet - myLeadingBlockerLength = MAX2((double)(right ? 20.0 : 40.0), myLeadingBlockerLength); + const double reserve = MIN2(myLeftSpace - MAGIC_OFFSET - myVehicle.getVehicleType().getMinGap(), right ? 20.0 : 40.0); + myLeadingBlockerLength = MAX2(reserve, myLeadingBlockerLength); #ifdef DEBUG_WANTSCHANGE if (gDebugFlag2) { std::cout << " reserving space for unseen blockers myLeadingBlockerLength=" << myLeadingBlockerLength << "\n"; @@ -1276,7 +1269,7 @@ std::vector collectLeadBlockers; std::vector collectFollowBlockers; int blockedFully = 0; // wether execution of the full maneuver is blocked - + maneuverDist = latDist; const double gapFactor = computeGapFactor(LCA_STRATEGIC); blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, @@ -1325,6 +1318,7 @@ if (!cancelRequest(ret, laneOffset)) { if ((ret & LCA_STAY) == 0) { latDist = latLaneDist; + maneuverDist = latLaneDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers); @@ -1354,7 +1348,7 @@ ((myPreviousState & LCA_COOPERATIVE) != 0 && !myCanChangeFully // change is in the right direction - && (laneOffset * myManeuverDist > 0))) + && (laneOffset * getManeuverDist() > 0))) && (inconvenience < myCooperativeParam) && (changeToBest || currentDistAllows(neighDist, abs(bestLaneOffset) + 1, laDist))) { @@ -1365,7 +1359,7 @@ << " veh=" << myVehicle.getID() << " amBlocking=" << amBlockingFollowerPlusNB() << " prevState=" << toString((LaneChangeAction)myPreviousState) - << " origLatDist=" << myManeuverDist + << " origLatDist=" << getManeuverDist() << " wantsChangeToHelp=" << (right ? "right" : "left") << " state=" << myOwnState //<< (((myOwnState & myLca) == 0) ? " (counter)" : "") @@ -1375,7 +1369,8 @@ ret |= LCA_COOPERATIVE | LCA_URGENT ;//| LCA_CHANGE_TO_HELP; if (!cancelRequest(ret, laneOffset)) { - latDist = amBlockingFollowerPlusNB() ? latLaneDist : myManeuverDist; + latDist = amBlockingFollowerPlusNB() ? latLaneDist : getManeuverDist(); + maneuverDist = latDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers); @@ -1571,7 +1566,10 @@ if (!left) { // ONLY FOR CHANGING TO THE RIGHT - if (right && maxGainRight >= 0) { + // start keepRight maneuver when no speed loss is expected and continue + // started maneuvers if the loss isn't too big + if (right && (maxGainRight >= 0 + || ((myPreviousState & LCA_KEEPRIGHT) != 0 && maxGainRight >= -myKeepRightParam))) { // honor the obligation to keep right (Rechtsfahrgebot) // XXX consider fast approaching followers on the current lane //const double vMax = myLookAheadSpeed; @@ -1614,6 +1612,7 @@ assert(myVehicle.getLane()->getIndex() > neighLane.getIndex()); if (!cancelRequest(ret, laneOffset)) { latDist = latLaneDist; + maneuverDist = latLaneDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers); @@ -1640,6 +1639,7 @@ ret |= LCA_SPEEDGAIN; if (!cancelRequest(ret, laneOffset)) { int blockedFully = 0; + maneuverDist = latDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers, @@ -1673,6 +1673,7 @@ ret |= LCA_SPEEDGAIN; if (!cancelRequest(ret, laneOffset)) { int blockedFully = 0; + maneuverDist = latDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers, @@ -1725,18 +1726,18 @@ if (turnInfo.first < myTurnAlignmentDist) { // Vehicle is close enough to the link to change its default alignment switch (turnInfo.second) { - case LINKDIR_TURN: - case LINKDIR_LEFT: - case LINKDIR_PARTLEFT: + case LinkDirection::TURN: + case LinkDirection::LEFT: + case LinkDirection::PARTLEFT: align = MSGlobals::gLefthand ? LATALIGN_RIGHT : LATALIGN_LEFT; break; - case LINKDIR_TURN_LEFTHAND: - case LINKDIR_RIGHT: - case LINKDIR_PARTRIGHT: + case LinkDirection::TURN_LEFTHAND: + case LinkDirection::RIGHT: + case LinkDirection::PARTRIGHT: align = MSGlobals::gLefthand ? LATALIGN_LEFT : LATALIGN_RIGHT; break; - case LINKDIR_STRAIGHT: - case LINKDIR_NODIR: + case LinkDirection::STRAIGHT: + case LinkDirection::NODIR: default: break; } @@ -1774,6 +1775,8 @@ << " relGainSublane=" << computeSpeedGain(latDistSublane, defaultNextSpeed) << " maneuverDist=" << maneuverDist << " myCanChangeFully=" << myCanChangeFully + << " myTurnAlignmentDist=" << myTurnAlignmentDist + << " nextTurn=" << myVehicle.getNextTurn().first << ":" << toString(myVehicle.getNextTurn().second) << " prevState=" << toString((LaneChangeAction)myPreviousState) << "\n"; #endif @@ -1791,7 +1794,7 @@ // Ignore preferred lateral alignment if we are in the middle of an unfinished non-alignment maneuver into the opposite direction if (!myCanChangeFully && (myPreviousState & (LCA_STRATEGIC | LCA_COOPERATIVE | LCA_KEEPRIGHT | LCA_SPEEDGAIN)) != 0 - && ((myManeuverDist < 0 && latDistSublane > 0) || (myManeuverDist > 0 && latDistSublane < 0))) { + && ((getManeuverDist() < 0 && latDistSublane > 0) || (getManeuverDist() > 0 && latDistSublane < 0))) { #if defined(DEBUG_WANTSCHANGE) if (gDebugFlag2) { std::cout << " aborting sublane change due to prior maneuver\n"; @@ -1812,15 +1815,16 @@ #endif ret |= LCA_SUBLANE; // include prior motivation when sublane-change is part of finishing an ongoing maneuver in the same direction - if (myPreviousManeuverDist * latDist > 0) { + if (getPreviousManeuverDist() * latDist > 0) { int priorReason = (myPreviousState & LCA_CHANGE_REASONS & ~LCA_SUBLANE); ret |= priorReason; #ifdef DEBUG_WANTSCHANGE if (gDebugFlag2 && priorReason != 0) std::cout << " including prior reason " << toString((LaneChangeAction)priorReason) - << " prevManeuverDist=" << myPreviousManeuverDist << "\n"; + << " prevManeuverDist=" << getPreviousManeuverDist() << "\n"; #endif } if (!cancelRequest(ret, laneOffset)) { + maneuverDist = latDist; blocked = checkBlocking(neighLane, latDist, maneuverDist, laneOffset, leaders, followers, blockers, neighLeaders, neighFollowers, neighBlockers); @@ -1909,7 +1913,7 @@ std::cout << SIMTIME << " veh=" << myVehicle.getID() << " saveBlockerLength blocker=" << Named::getIDSecure(blocker) - << " bState=" << (blocker == 0 ? "None" : toString(blocker->getLaneChangeModel().getOwnState())) + << " bState=" << (blocker == 0 ? "None" : toString((LaneChangeAction)blocker->getLaneChangeModel().getOwnState())) << "\n"; } #endif @@ -1922,11 +1926,7 @@ myLeadingBlockerLength = MAX2(blocker->getVehicleType().getLengthWithGap(), myLeadingBlockerLength); #ifdef DEBUG_SAVE_BLOCKER_LENGTH if (gDebugFlag2) { - std::cout << SIMTIME - << " veh=" << myVehicle.getID() - << " blocker=" << Named::getIDSecure(blocker) - << " saving myLeadingBlockerLength=" << myLeadingBlockerLength - << "\n"; + std::cout << " saving myLeadingBlockerLength=" << myLeadingBlockerLength << "\n"; } #endif } else { @@ -1934,12 +1934,7 @@ // space for ego instead #ifdef DEBUG_SAVE_BLOCKER_LENGTH if (gDebugFlag2) { - std::cout << SIMTIME - << " veh=" << myVehicle.getID() - << " blocker=" << Named::getIDSecure(blocker) - << " cannot save space=" << blocker->getVehicleType().getLengthWithGap() - << " potential=" << potential - << "\n"; + std::cout << " cannot save space=" << blocker->getVehicleType().getLengthWithGap() << " potential=" << potential << " (blocker must save)\n"; } #endif ((MSVehicle*)blocker)->getLaneChangeModel().saveBlockerLength(myVehicle.getVehicleType().getLengthWithGap()); @@ -2032,17 +2027,16 @@ double MSLCM_SL2015::computeSpeedGain(double latDistSublane, double defaultNextSpeed) const { double result = std::numeric_limits::max(); - const double res = MSGlobals::gLateralResolution > 0 ? MSGlobals::gLateralResolution : myVehicle.getLane()->getWidth(); const std::vector& sublaneSides = myVehicle.getLane()->getEdge().getSubLaneSides(); const double vehWidth = getWidth(); const double rightVehSide = myVehicle.getCenterOnEdge() - vehWidth * 0.5 + latDistSublane; const double leftVehSide = rightVehSide + vehWidth; for (int i = 0; i < (int)sublaneSides.size(); ++i) { - if (overlap(rightVehSide, leftVehSide, sublaneSides[i], sublaneSides[i] + res)) { + const double leftSide = i + 1 < (int)sublaneSides.size() ? sublaneSides[i + 1] : myVehicle.getLane()->getEdge().getWidth(); + if (overlap(rightVehSide, leftVehSide, sublaneSides[i], leftSide)) { result = MIN2(result, myExpectedSublaneSpeeds[i]); } - //std::cout << " i=" << i << " rightVehSide=" << rightVehSide << " leftVehSide=" << leftVehSide << " sublaneR=" << sublaneSides[i] << " sublaneL=" << sublaneSides[i] + res - // << " overlap=" << overlap(rightVehSide, leftVehSide, sublaneSides[i], sublaneSides[i] + res) << " speed=" << myExpectedSublaneSpeeds[i] << " result=" << result << "\n"; + //std::cout << " i=" << i << " rightVehSide=" << rightVehSide << " leftVehSide=" << leftVehSide << " sublaneR=" << sublaneSides[i] << " sublaneL=" << leftSide << " overlap=" << overlap(rightVehSide, leftVehSide, sublaneSides[i], leftSide) << " speed=" << myExpectedSublaneSpeeds[i] << " result=" << result << "\n"; } return result - defaultNextSpeed; } @@ -2083,7 +2077,7 @@ int -MSLCM_SL2015::checkBlocking(const MSLane& neighLane, double& latDist, double& maneuverDist, int laneOffset, +MSLCM_SL2015::checkBlocking(const MSLane& neighLane, double& latDist, double maneuverDist, int laneOffset, const MSLeaderDistanceInfo& leaders, const MSLeaderDistanceInfo& followers, const MSLeaderDistanceInfo& /*blockers */, @@ -2096,10 +2090,6 @@ double gapFactor, int* retBlockedFully) { // truncate latDist according to maxSpeedLat - if (!keepLatGapManeuver) { - myManeuverDist = latDist; - maneuverDist = latDist; - } const double maxDist = SPEED2DIST(myVehicle.getVehicleType().getMaxSpeedLat()); latDist = MAX2(MIN2(latDist, maxDist), -maxDist); if (myVehicle.hasInfluencer() && myVehicle.getInfluencer().getLatDist() != 0 && myVehicle.getInfluencer().ignoreOverlap()) { @@ -2147,10 +2137,10 @@ } } - myCanChangeFully = (myManeuverDist == 0 || latDist == myManeuverDist); + myCanChangeFully = (maneuverDist == 0 || latDist == maneuverDist); #ifdef DEBUG_BLOCKING if (gDebugFlag2) { - std::cout << " checkBlocking fully=" << myCanChangeFully << " latDist=" << latDist << " myManeuverDist=" << myManeuverDist << "\n"; + std::cout << " checkBlocking fully=" << myCanChangeFully << " latDist=" << latDist << " maneuverDist=" << maneuverDist << "\n"; } #endif // destination sublanes must be safe @@ -2174,15 +2164,15 @@ } int blockedFully = 0; - blockedFully |= checkBlockingVehicles(&myVehicle, leaders, myManeuverDist, myVehicle.getLane()->getRightSideOnEdge(), true, LCA_BLOCKED_BY_LEADER, + blockedFully |= checkBlockingVehicles(&myVehicle, leaders, maneuverDist, myVehicle.getLane()->getRightSideOnEdge(), true, LCA_BLOCKED_BY_LEADER, mySafeLatDistRight, mySafeLatDistLeft, collectLeadBlockers); - blockedFully |= checkBlockingVehicles(&myVehicle, followers, myManeuverDist, myVehicle.getLane()->getRightSideOnEdge(), false, LCA_BLOCKED_BY_FOLLOWER, + blockedFully |= checkBlockingVehicles(&myVehicle, followers, maneuverDist, myVehicle.getLane()->getRightSideOnEdge(), false, LCA_BLOCKED_BY_FOLLOWER, mySafeLatDistRight, mySafeLatDistLeft, collectFollowBlockers); if (laneOffset != 0) { - blockedFully |= checkBlockingVehicles(&myVehicle, neighLeaders, myManeuverDist, neighLane.getRightSideOnEdge(), true, + blockedFully |= checkBlockingVehicles(&myVehicle, neighLeaders, maneuverDist, neighLane.getRightSideOnEdge(), true, (laneOffset == -1 ? LCA_BLOCKED_BY_RIGHT_LEADER : LCA_BLOCKED_BY_LEFT_LEADER), mySafeLatDistRight, mySafeLatDistLeft, collectLeadBlockers); - blockedFully |= checkBlockingVehicles(&myVehicle, neighFollowers, myManeuverDist, neighLane.getRightSideOnEdge(), false, + blockedFully |= checkBlockingVehicles(&myVehicle, neighFollowers, maneuverDist, neighLane.getRightSideOnEdge(), false, (laneOffset == -1 ? LCA_BLOCKED_BY_RIGHT_FOLLOWER : LCA_BLOCKED_BY_LEFT_FOLLOWER), mySafeLatDistRight, mySafeLatDistLeft, collectFollowBlockers); } @@ -2197,7 +2187,7 @@ blocked |= blockedFully; } else { // XXX: in case of action step length > simulation step length, pushing may lead to collisions, - // because maneuver is continued until myManeuverDist is reached (perhaps set myManeuverDist=latDist) + // because maneuver is continued until maneuverDist is reached (perhaps set maneuverDist=latDist) } if (collectFollowBlockers != nullptr && collectLeadBlockers != nullptr) { // prevent vehicles from being classified as leader and follower simultaneously @@ -2478,8 +2468,8 @@ << " want2=" << (sd2.state & LCA_WANTS_LANECHANGE) << " dist2=" << sd2.latDist << " dir2=" << sd2.dir - << " reason1=" << reason1 - << " reason2=" << reason2 + << " reason1=" << toString((LaneChangeAction)reason1) + << " reason2=" << toString((LaneChangeAction)reason2) << "\n"; #endif if (want1) { @@ -3023,10 +3013,10 @@ // If foe is maneuvering towards ego, reserve some additional distance. // But don't expect the foe to come closer than currentMinGap if it isn't already there. // (XXX: How can the ego know the foe's maneuver dist?) - if (foeCenter < oldCenter) { + if (foeCenter < oldCenter) { // && foe->getLaneChangeModel().getSpeedLat() > 0) { const double foeManeuverDist = MAX2(0., foe->getLaneChangeModel().getManeuverDist()); surplusGapRight = MIN3(surplusGapRight, gap - currentMinGap, MAX2(currentMinGap, gap - foeManeuverDist)); - } else { + } else { //if (foeCenter > oldCenter && foe->getLaneChangeModel().getSpeedLat() < 0) { const double foeManeuverDist = -MIN2(0., foe->getLaneChangeModel().getManeuverDist()); surplusGapLeft = MIN3(surplusGapLeft, gap - currentMinGap, MAX2(currentMinGap, gap - foeManeuverDist)); } @@ -3487,7 +3477,6 @@ neighLane, preb, lastBlocked, firstBlocked, latDist, maneuverDist, blocked); - myManeuverDist = 0; myCanChangeFully = true; // ignore sublane motivation result &= ~LCA_SUBLANE; @@ -3516,4 +3505,5 @@ return result; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.h sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.h --- sumo-1.5.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/lcmodels/MSLCM_SL2015.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A lane change model for heterogeneous traffic (based on sub-lanes) /****************************************************************************/ -#ifndef MSLCM_SL2015_h -#define MSLCM_SL2015_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSAbstractLaneChangeModel.h" @@ -250,7 +244,7 @@ static CLeaderDist getSlowest(const MSLeaderDistanceInfo& ldi); /// @brief restrict latDist to permissible speed and determine blocking state depending on that distance - int checkBlocking(const MSLane& neighLane, double& latDist, double& maneuverDist, int laneOffset, + int checkBlocking(const MSLane& neighLane, double& latDist, double maneuverDist, int laneOffset, const MSLeaderDistanceInfo& leaders, const MSLeaderDistanceInfo& followers, const MSLeaderDistanceInfo& blockers, @@ -438,9 +432,3 @@ //@} }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/logging/CastingFunctionBinding.h sumo-1.6.0+dfsg1/src/microsim/logging/CastingFunctionBinding.h --- sumo-1.5.0+dfsg1/src/microsim/logging/CastingFunctionBinding.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/logging/CastingFunctionBinding.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Function type template /****************************************************************************/ -#ifndef CastingFunctionBinding_h -#define CastingFunctionBinding_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -78,9 +72,3 @@ CastingFunctionBinding& operator=(const CastingFunctionBinding&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/logging/FuncBinding_IntParam.h sumo-1.6.0+dfsg1/src/microsim/logging/FuncBinding_IntParam.h --- sumo-1.5.0+dfsg1/src/microsim/logging/FuncBinding_IntParam.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/logging/FuncBinding_IntParam.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // �Function type template /****************************************************************************/ -#ifndef FuncBinding_IntParam_h -#define FuncBinding_IntParam_h - - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -79,9 +72,3 @@ int myParam; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/logging/FuncBinding_StringParam.h sumo-1.6.0+dfsg1/src/microsim/logging/FuncBinding_StringParam.h --- sumo-1.5.0+dfsg1/src/microsim/logging/FuncBinding_StringParam.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/logging/FuncBinding_StringParam.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Function type template /****************************************************************************/ -#ifndef FuncBinding_StringParam_h -#define FuncBinding_StringParam_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -78,9 +72,3 @@ std::string myParam; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/logging/FunctionBinding.h sumo-1.6.0+dfsg1/src/microsim/logging/FunctionBinding.h --- sumo-1.5.0+dfsg1/src/microsim/logging/FunctionBinding.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/logging/FunctionBinding.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,14 +20,7 @@ /// // Function type template /****************************************************************************/ -#ifndef FunctionBinding_h -#define FunctionBinding_h - - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -120,8 +113,3 @@ FunctionBindingString& operator=(const FunctionBindingString&); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSBaseVehicle.cpp sumo-1.6.0+dfsg1/src/microsim/MSBaseVehicle.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSBaseVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSBaseVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A base class for vehicle implementations /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -32,6 +27,8 @@ #include #include #include +#include +#include #include #include "MSGlobals.h" #include "MSVehicleControl.h" @@ -39,12 +36,16 @@ #include "MSEdge.h" #include "MSLane.h" #include "MSMoveReminder.h" +#include "MSEdgeWeightsStorage.h" #include "MSBaseVehicle.h" #include "MSNet.h" #include "devices/MSDevice.h" #include "devices/MSDevice_Routing.h" #include "devices/MSDevice_Battery.h" +#include #include +#include +#include #include #include "MSInsertionControl.h" @@ -63,6 +64,24 @@ #endif SUMOVehicle::NumericalID MSBaseVehicle::myCurrentNumericalIndex = 0; +// =========================================================================== +// Influencer method definitions +// =========================================================================== + +MSBaseVehicle::BaseInfluencer::BaseInfluencer() : + myRoutingMode(0) +{} + +SUMOAbstractRouter& +MSBaseVehicle::BaseInfluencer::getRouterTT(const int rngIndex, SUMOVehicleClass svc) const { + if (myRoutingMode == 1) { + return MSRoutingEngine::getRouterTT(rngIndex, svc); + } else { + return MSNet::getInstance()->getRouterTT(rngIndex); + } +} + + // =========================================================================== // method definitions @@ -90,8 +109,10 @@ myArrivalPos(-1), myArrivalLane(-1), myNumberReroutes(0), + myStopUntilOffset(0), myOdometer(0.), - myNumericalID(myCurrentNumericalIndex++) + myNumericalID(myCurrentNumericalIndex++), + myEdgeWeights(nullptr) #ifdef _DEBUG , myTraceMoveReminders(myShallTraceMoveReminders.count(pars->id) > 0) #endif @@ -110,24 +131,12 @@ } } } - // init devices - try { - MSDevice::buildVehicleDevices(*this, myDevices); - } catch (ProcessError&) { - for (MSVehicleDevice* dev : myDevices) { - delete dev; - } - delete myParameter; - throw; - } myRoute->addReference(); - for (MSVehicleDevice* dev : myDevices) { - myMoveReminders.push_back(std::make_pair(dev, 0.)); - } } MSBaseVehicle::~MSBaseVehicle() { + delete myEdgeWeights; myRoute->release(); if (myParameter->repetitionNumber == 0) { MSRoute::checkDist(myParameter->routeid); @@ -140,6 +149,15 @@ void +MSBaseVehicle::initDevices() { + MSDevice::buildVehicleDevices(*this, myDevices); + for (MSVehicleDevice* dev : myDevices) { + myMoveReminders.push_back(std::make_pair(dev, 0.)); + } +} + + +void MSBaseVehicle::setID(const std::string& /*newID*/) { throw ProcessError("Changing a vehicle ID is not permitted"); } @@ -208,11 +226,11 @@ 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 skipLast = stops.back() == sink && myArrivalPos > lastPos; + const bool skipFirst = stops.front() == source && sourcePos <= firstPos; + const bool skipLast = stops.back() == sink && myArrivalPos >= lastPos; #ifdef DEBUG_REROUTE if (DEBUG_COND) { - std::cout << SIMTIME << " reroute " << info << " veh=" << getID() << " lane=" << getLane()->getID() + std::cout << SIMTIME << " reroute " << info << " veh=" << getID() << " lane=" << Named::getIDSecure(getLane()) << " source=" << source->getID() << " sourcePos=" << sourcePos << " firstPos=" << firstPos << " arrivalPos=" << myArrivalPos << " lastPos=" << lastPos << " route=" << toString(myRoute->getEdges()) << " stopEdges=" << toString(stops) << " skipFirst=" << skipFirst << " skipLast=" << skipLast << "\n"; } @@ -607,10 +625,10 @@ void -MSBaseVehicle::addStops(const bool ignoreStopErrors) { +MSBaseVehicle::addStops(const bool ignoreStopErrors, MSRouteIterator* searchStart) { for (std::vector::const_iterator i = myRoute->getStops().begin(); i != myRoute->getStops().end(); ++i) { std::string errorMsg; - if (!addStop(*i, errorMsg, myParameter->depart) && !ignoreStopErrors) { + if (!addStop(*i, errorMsg, myParameter->depart, false, searchStart) && !ignoreStopErrors) { throw ProcessError(errorMsg); } if (errorMsg != "") { @@ -620,7 +638,7 @@ const SUMOTime untilOffset = myParameter->repetitionOffset > 0 ? myParameter->repetitionsDone * myParameter->repetitionOffset : 0; for (std::vector::const_iterator i = myParameter->stops.begin(); i != myParameter->stops.end(); ++i) { std::string errorMsg; - if (!addStop(*i, errorMsg, untilOffset) && !ignoreStopErrors) { + if (!addStop(*i, errorMsg, untilOffset, false, searchStart) && !ignoreStopErrors) { throw ProcessError(errorMsg); } if (errorMsg != "") { @@ -630,6 +648,133 @@ } +double +MSBaseVehicle::getCO2Emissions() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::CO2, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getCOEmissions() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::CO, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getHCEmissions() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::HC, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getNOxEmissions() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::NO_X, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getPMxEmissions() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::PM_X, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getFuelConsumption() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::FUEL, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + + +double +MSBaseVehicle::getElectricityConsumption() const { + if (isOnRoad() || isIdling()) { + return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::ELEC, getSpeed(), getAcceleration(), getSlope()); + } else { + return 0.; + } +} + +double +MSBaseVehicle::getStateOfCharge() const { + if (static_cast(getDevice(typeid(MSDevice_Battery))) != 0) { + MSDevice_Battery* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_Battery))); + return batteryOfVehicle->getActualBatteryCapacity(); + } else { + if (static_cast(getDevice(typeid(MSDevice_ElecHybrid))) != 0) { + MSDevice_ElecHybrid* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_ElecHybrid))); + return batteryOfVehicle->getActualBatteryCapacity(); + } + } + + return -1; +} + +double +MSBaseVehicle::getElecHybridCurrent() const { + if (static_cast(getDevice(typeid(MSDevice_ElecHybrid))) != 0) { + MSDevice_ElecHybrid* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_ElecHybrid))); + return batteryOfVehicle->getCurrentFromOverheadWire(); + } + + return NAN; +} + +double +MSBaseVehicle::getHarmonoise_NoiseEmissions() const { + if (isOnRoad() || isIdling()) { + return HelpersHarmonoise::computeNoise(myType->getEmissionClass(), getSpeed(), getAcceleration()); + } else { + return 0.; + } +} + + +const MSEdgeWeightsStorage& +MSBaseVehicle::getWeightsStorage() const { + return _getWeightsStorage(); +} + + +MSEdgeWeightsStorage& +MSBaseVehicle::getWeightsStorage() { + return _getWeightsStorage(); +} + + +MSEdgeWeightsStorage& +MSBaseVehicle::_getWeightsStorage() const { + if (myEdgeWeights == nullptr) { + myEdgeWeights = new MSEdgeWeightsStorage(); + } + return *myEdgeWeights; +} + + + + int MSBaseVehicle::getPersonNumber() const { int boarded = myPersonDevice == nullptr ? 0 : myPersonDevice->size(); @@ -685,6 +830,25 @@ } +bool +MSBaseVehicle::isLineStop(double position) const { + if (myParameter->line == "") { + // not a public transport line + return false; + } + for (const SUMOVehicleParameter::Stop& stop : myParameter->stops) { + if (stop.startPos <= position && position <= stop.endPos) { + return true; + } + } + for (const SUMOVehicleParameter::Stop& stop : myRoute->getStops()) { + if (stop.startPos <= position && position <= stop.endPos) { + return true; + } + } + return false; +} + bool MSBaseVehicle::hasDevice(const std::string& deviceName) const { @@ -806,5 +970,5 @@ } #endif -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSBaseVehicle.h sumo-1.6.0+dfsg1/src/microsim/MSBaseVehicle.h --- sumo-1.5.0+dfsg1/src/microsim/MSBaseVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSBaseVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A base class for vehicle implementations /****************************************************************************/ -#ifndef MSBaseVehicle_h -#define MSBaseVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -43,6 +37,7 @@ class MSLane; class MSDevice_Transportable; class MSVehicleDevice; +class MSEdgeWeightsStorage; // =========================================================================== @@ -79,6 +74,8 @@ /// @brief Destructor virtual ~MSBaseVehicle(); + virtual void initDevices(); + bool isVehicle() const { return true; } @@ -271,6 +268,12 @@ return getDeparture() - getParameter().depart; } + /** @brief Returns the public transport stop delay in seconds + */ + virtual double getStopDelay() const { + /// @todo implement for meso + return -1; + } /** @brief Returns this vehicle's real departure position * @return This vehicle's real departure position @@ -293,6 +296,15 @@ myArrivalPos = arrivalPos; } + /** @brief Called when the vehicle is removed from the network. + * + * Moves along work reminders and + * informs all devices about quitting. Calls "leaveLane" then. + * + * @param[in] reason why the vehicle leaves (reached its destination, parking, teleport) + */ + virtual void onRemovalFromNet(const MSMoveReminder::Notification /*reason*/) {} + /** @brief Returns whether this vehicle has already departed */ bool hasDeparted() const; @@ -364,6 +376,8 @@ /// @brief retrieve riding containers const std::vector& getContainers() const; + /// @brief returns whether the vehicle serves a public transport line that serves the given stop + bool isLineStop(double position) const; /** @brief Validates the current or given route * @param[out] msg Description why the route is not valid (if it is the case) @@ -469,7 +483,7 @@ * * @param[in] ignoreStopErrors whether invalid stops trigger a warning only */ - void addStops(const bool ignoreStopErrors); + void addStops(const bool ignoreStopErrors, MSRouteIterator* searchStart = 0); /// @brief whether this vehicle is selected in the GUI virtual bool isSelected() const { @@ -494,6 +508,151 @@ return myContainerDevice; } + + /// @name Emission retrieval + //@{ + + /** @brief Returns CO2 emission of the current state + * @return The current CO2 emission + */ + double getCO2Emissions() const; + + + /** @brief Returns CO emission of the current state + * @return The current CO emission + */ + double getCOEmissions() const; + + + /** @brief Returns HC emission of the current state + * @return The current HC emission + */ + double getHCEmissions() const; + + + /** @brief Returns NOx emission of the current state + * @return The current NOx emission + */ + double getNOxEmissions() const; + + + /** @brief Returns PMx emission of the current state + * @return The current PMx emission + */ + double getPMxEmissions() const; + + + /** @brief Returns fuel consumption of the current state + * @return The current fuel consumption + */ + double getFuelConsumption() const; + + + /** @brief Returns electricity consumption of the current state + * @return The current electricity consumption + */ + double getElectricityConsumption() const; + + /** @brief Returns actual state of charge of battery (Wh) + * RICE_CHECK: This may be a misnomer, SOC is typically percentage of the maximum battery capacity. + * @return The actual battery state of charge + */ + double getStateOfCharge() const; + + /** @brief Returns actual current (A) of ElecHybrid device + * RICE_CHECK: Is this the current consumed from the overhead wire or the current driving the poweertrain of the vehicle? + * @return The current of ElecHybrid device + */ + double getElecHybridCurrent() const; + + /** @brief Returns noise emissions of the current state + * @return The noise produced + */ + double getHarmonoise_NoiseEmissions() const; + //@} + + /** @class Influencer + * @brief Changes the wished vehicle speed / lanes + * + * The class is used for passing velocities or velocity profiles obtained via TraCI to the vehicle. + * The speed adaptation is controlled by the stored speedTimeLine + * Additionally, the variables myConsiderSafeVelocity, myConsiderMaxAcceleration, and myConsiderMaxDeceleration + * control whether the safe velocity, the maximum acceleration, and the maximum deceleration + * have to be regarded. + * + * Furthermore this class is used to affect lane changing decisions according to + * LaneChangeMode and any given laneTimeLine + */ + class BaseInfluencer { + public: + /// @brief Constructor + BaseInfluencer(); + + /// @brief Destructor + virtual ~BaseInfluencer() {} + + /// @brief Static initalization + static void init(); + /// @brief Static cleanup + static void cleanup(); + + + /// @brief return the current routing mode + int getRoutingMode() const { + return myRoutingMode; + } + + /** @brief Sets routing behavior + * @param[in] value an enum value controlling the different modes + */ + void setRoutingMode(int value) { + myRoutingMode = value; + } + + + SUMOAbstractRouter& getRouterTT(const int rngIndex, SUMOVehicleClass svc) const; + + protected: + ///@brief routing mode (see TraCIConstants.h) + int myRoutingMode; + + }; + + + + /** @brief Returns the velocity/lane influencer + * + * If no influencer was existing before, one is built, first + * @return Reference to this vehicle's speed influencer + */ + virtual BaseInfluencer& getBaseInfluencer() = 0; + + virtual const BaseInfluencer* getBaseInfluencer() const = 0; + + virtual bool hasInfluencer() const = 0; + + + /** @brief Returns the vehicle's internal edge travel times/efforts container + * + * If the vehicle does not have such a container, it is built. + * @return The vehicle's knowledge about edge weights + */ + const MSEdgeWeightsStorage& getWeightsStorage() const; + MSEdgeWeightsStorage& getWeightsStorage(); + + /** @brief Returns the leader of the vehicle looking for a fixed distance. + * + * If the distance is not given it is calculated from the brake gap. + * The gap returned does not include the minGap. + * @param dist up to which distance to look at least for a leader + * @return The leading vehicle together with the gap; (0, -1) if no leader was found. + */ + virtual std::pair getLeader(double dist = 0) const { + UNUSED_PARAMETER(dist); + WRITE_WARNING("getLeader not yet implemented for meso"); + return std::make_pair(nullptr, -1); + } + protected: /** @brief (Re-)Calculates the arrival position and lane from the vehicle parameters */ @@ -558,6 +717,9 @@ /// @brief The number of reroutings int myNumberReroutes; + /// @brief The offset when adding route stops with 'until' on route replacement + SUMOTime myStopUntilOffset; + /// @brief A simple odometer to keep track of the length of the route already driven double myOdometer; @@ -571,6 +733,12 @@ private: const NumericalID myNumericalID; + /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage + * @note member is initialized on first access */ + mutable MSEdgeWeightsStorage* myEdgeWeights; + + MSEdgeWeightsStorage& _getWeightsStorage() const; + static NumericalID myCurrentNumericalIndex; private: @@ -594,7 +762,3 @@ }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSBitSetLogic.h sumo-1.6.0+dfsg1/src/microsim/MSBitSetLogic.h --- sumo-1.5.0+dfsg1/src/microsim/MSBitSetLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSBitSetLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Container for holding a right-of-way matrix /****************************************************************************/ -#ifndef MSBitSetLogic_h -#define MSBitSetLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -122,9 +116,3 @@ large asian junctions. So, here comes the type which should be used by the netbuilder. */ typedef MSBitSetLogic MSBitsetLogic; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSDriverState.cpp sumo-1.6.0+dfsg1/src/microsim/MSDriverState.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSDriverState.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSDriverState.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -687,22 +682,22 @@ // double result = INTEGRATION_DEMAND_JUNCTION_BASE; //// LinkState linkState = ch->approachingLink->getState(); // switch (ch->junction->getType()) { -// case NODETYPE_NOJUNCTION: -// case NODETYPE_UNKNOWN: -// case NODETYPE_DISTRICT: -// case NODETYPE_DEAD_END: -// case NODETYPE_DEAD_END_DEPRECATED: -// case NODETYPE_RAIL_SIGNAL: { +// case SumoXMLNodeType::NOJUNCTION: +// case SumoXMLNodeType::UNKNOWN: +// case SumoXMLNodeType::DISTRICT: +// case SumoXMLNodeType::DEAD_END: +// case SumoXMLNodeType::DEAD_END_DEPRECATED: +// case SumoXMLNodeType::RAIL_SIGNAL: { // result = 0.; // } // break; -// case NODETYPE_RAIL_CROSSING: { +// case SumoXMLNodeType::RAIL_CROSSING: { // result += INTEGRATION_DEMAND_JUNCTION_RAIL; // } // break; -// case NODETYPE_TRAFFIC_LIGHT: -// case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: -// case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: { +// case SumoXMLNodeType::TRAFFIC_LIGHT: +// case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: +// case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: { // // TODO: Take into account traffic light state? //// switch (linkState) { //// case LINKSTATE_TL_GREEN_MAJOR: @@ -718,18 +713,18 @@ // result += INTEGRATION_DEMAND_JUNCTION_TLS; // } // // no break. TLS has extra integration demand. -// case NODETYPE_PRIORITY: -// case NODETYPE_PRIORITY_STOP: -// case NODETYPE_RIGHT_BEFORE_LEFT: -// case NODETYPE_ALLWAY_STOP: -// case NODETYPE_INTERNAL: { +// case SumoXMLNodeType::PRIORITY: +// case SumoXMLNodeType::PRIORITY_STOP: +// case SumoXMLNodeType::RIGHT_BEFORE_LEFT: +// case SumoXMLNodeType::ALLWAY_STOP: +// case SumoXMLNodeType::INTERNAL: { // // TODO: Consider link type (major or minor...) // double junctionComplexity = (INTEGRATION_DEMAND_JUNCTION_LANE*j->getNrOfIncomingLanes() // + INTEGRATION_DEMAND_JUNCTION_FOE_LANE*j->getFoeLinks(ch->approachingLink).size()); // result += junctionComplexity; // } // break; -// case NODETYPE_ZIPPER: { +// case SumoXMLNodeType::ZIPPER: { // result += INTEGRATION_DEMAND_JUNCTION_ZIPPER; // } // break; @@ -864,22 +859,22 @@ // double result = 0.; // LinkState linkState = ch->approachingLink->getState(); // switch (ch->junction->getType()) { -// case NODETYPE_NOJUNCTION: -// case NODETYPE_UNKNOWN: -// case NODETYPE_DISTRICT: -// case NODETYPE_DEAD_END: -// case NODETYPE_DEAD_END_DEPRECATED: -// case NODETYPE_RAIL_SIGNAL: { +// case SumoXMLNodeType::NOJUNCTION: +// case SumoXMLNodeType::UNKNOWN: +// case SumoXMLNodeType::DISTRICT: +// case SumoXMLNodeType::DEAD_END: +// case SumoXMLNodeType::DEAD_END_DEPRECATED: +// case SumoXMLNodeType::RAIL_SIGNAL: { // result = 0.; // } // break; -// case NODETYPE_RAIL_CROSSING: { +// case SumoXMLNodeType::RAIL_CROSSING: { // result = 0.5; // } // break; -// case NODETYPE_TRAFFIC_LIGHT: -// case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: -// case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: { +// case SumoXMLNodeType::TRAFFIC_LIGHT: +// case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: +// case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: { // // Take into account traffic light state // switch (linkState) { // case LINKSTATE_TL_GREEN_MAJOR: @@ -908,11 +903,11 @@ // } // } // // no break, TLS is accounted extra -// case NODETYPE_PRIORITY: -// case NODETYPE_PRIORITY_STOP: -// case NODETYPE_RIGHT_BEFORE_LEFT: -// case NODETYPE_ALLWAY_STOP: -// case NODETYPE_INTERNAL: { +// case SumoXMLNodeType::PRIORITY: +// case SumoXMLNodeType::PRIORITY_STOP: +// case SumoXMLNodeType::RIGHT_BEFORE_LEFT: +// case SumoXMLNodeType::ALLWAY_STOP: +// case SumoXMLNodeType::INTERNAL: { // // TODO: Consider link type (major or minor...) // double junctionComplexity = (LATENT_DEMAND_COEFF_JUNCTION_INCOMING*j->getNrOfIncomingLanes() // + LATENT_DEMAND_COEFF_JUNCTION_FOES*j->getFoeLinks(ch->approachingLink).size()) @@ -920,7 +915,7 @@ // result += junctionComplexity; // } // break; -// case NODETYPE_ZIPPER: { +// case SumoXMLNodeType::ZIPPER: { // result = 0.5*(1. + 0.1*v); // } // break; @@ -933,8 +928,4 @@ // - - - - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSDriverState.h sumo-1.6.0+dfsg1/src/microsim/MSDriverState.h --- sumo-1.5.0+dfsg1/src/microsim/MSDriverState.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSDriverState.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,12 +22,7 @@ /// @todo: check parameter admissibility in setter methods -#ifndef MSDriverState_h -#define MSDriverState_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -710,9 +705,3 @@ static double headwayErrorCoefficient; static double maximalReactionTimeFactor; }; - - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSDynamicShapeUpdater.cpp sumo-1.6.0+dfsg1/src/microsim/MSDynamicShapeUpdater.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSDynamicShapeUpdater.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSDynamicShapeUpdater.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include "MSDynamicShapeUpdater.h" #include "utils/vehicle/SUMOVehicle.h" diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSDynamicShapeUpdater.h sumo-1.6.0+dfsg1/src/microsim/MSDynamicShapeUpdater.h --- sumo-1.5.0+dfsg1/src/microsim/MSDynamicShapeUpdater.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSDynamicShapeUpdater.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// // /****************************************************************************/ -#ifndef MICROSIM_MSDYNAMICSHAPEUPDATER_H_ -#define MICROSIM_MSDYNAMICSHAPEUPDATER_H_ +#pragma once #include "MSNet.h" #include "utils/shapes/ShapeContainer.h" @@ -42,4 +41,3 @@ MSDynamicShapeUpdater& operator=(const MSDynamicShapeUpdater& s) = delete; }; -#endif /* MICROSIM_MSDYNAMICSHAPEUPDATER_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdgeControl.cpp sumo-1.6.0+dfsg1/src/microsim/MSEdgeControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSEdgeControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdgeControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,6 +45,7 @@ myLanes(MSLane::dictSize()), myWithVehicles2Integrate(MSGlobals::gNumSimThreads > 1), myLastLaneChange(MSEdge::dictSize()), + myInactiveCheckCollisions(MSGlobals::gNumSimThreads > 1), myMinLengthGeometryFactor(1.) { // build the usage definitions for lanes for (MSEdge* const edge : myEdges) { @@ -305,10 +301,11 @@ } } if (myInactiveCheckCollisions.size() > 0) { - for (MSLane* lane : myInactiveCheckCollisions) { + for (MSLane* lane : myInactiveCheckCollisions.getContainer()) { lane->detectCollisions(timestep, stage); } myInactiveCheckCollisions.clear(); + myInactiveCheckCollisions.unlock(); } } @@ -335,4 +332,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdgeControl.h sumo-1.6.0+dfsg1/src/microsim/MSEdgeControl.h --- sumo-1.5.0+dfsg1/src/microsim/MSEdgeControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdgeControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Stores edges and lanes, performs moving of vehicle /****************************************************************************/ -#ifndef MSEdgeControl_h -#define MSEdgeControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -41,9 +35,11 @@ #include #include #include +#include #include #include +#include #ifdef HAVE_FOX #include #endif @@ -54,6 +50,7 @@ // =========================================================================== class MSEdge; class MSLane; +class MSJunction; class OutputDevice; typedef std::vector MSEdgeVector; @@ -78,6 +75,8 @@ class MSEdgeControl { public: + typedef RouterProvider MSRouterProvider; + /** @brief Constructor * * Builds LaneUsage information for each lane and assigns them to lanes. @@ -223,23 +222,24 @@ class WorkerThread : public FXWorkerThread { public: WorkerThread(FXWorkerThread::Pool& pool) - : FXWorkerThread(pool), myRouter(nullptr) {} - bool setRouter(SUMOAbstractRouter* router) { - if (myRouter == nullptr) { - myRouter = router; + : FXWorkerThread(pool), myRouterProvider(nullptr) {} + + bool setRouterProvider(MSRouterProvider* routerProvider) { + if (myRouterProvider == nullptr) { + myRouterProvider = routerProvider; return true; } return false; } - SUMOAbstractRouter& getRouter() const { - return *myRouter; + SUMOAbstractRouter& getRouter(SUMOVehicleClass svc) const { + return myRouterProvider->getVehicleRouter(svc); } virtual ~WorkerThread() { stop(); - delete myRouter; + delete myRouterProvider; } private: - SUMOAbstractRouter* myRouter; + MSRouterProvider* myRouterProvider; }; #endif @@ -266,7 +266,7 @@ std::vector myLastLaneChange; /// @brief Additional lanes for which collision checking must be performed - std::set myInactiveCheckCollisions; + FXSynchSet > myInactiveCheckCollisions; double myMinLengthGeometryFactor; @@ -284,9 +284,3 @@ MSEdgeControl& operator=(const MSEdgeControl&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdge.cpp sumo-1.6.0+dfsg1/src/microsim/MSEdge.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // A road/street connecting two junctions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -99,7 +94,7 @@ MSEdge::initialize(const std::vector* lanes) { assert(lanes != 0); myLanes = std::shared_ptr >(lanes); - if (myFunction == EDGEFUNC_CONNECTOR) { + if (myFunction == SumoXMLEdgeFunc::CONNECTOR) { myCombinedPermissions = SVCAll; } for (MSLane* const lane : *lanes) { @@ -139,7 +134,7 @@ if (minPenalty > 0) { myEmptyTraveltime += STEPS2TIME(minPenalty); } - } else if (isInternal()) { + } else if (isInternal() && MSGlobals::gUsingInternalLanes) { const MSLink* link = myLanes->front()->getIncomingLanes()[0].viaLink; if (!link->isTLSControlled() && !link->havePriority()) { myEmptyTraveltime += MSGlobals::gMinorPenalty; @@ -165,7 +160,7 @@ if (std::find(to.myPredecessors.begin(), to.myPredecessors.end(), this) == to.myPredecessors.end()) { to.myPredecessors.push_back(this); } - if (link->getDirection() != LINKDIR_TURN) { + if (link->getDirection() != LinkDirection::TURN) { myAmFringe = false; } } @@ -208,7 +203,7 @@ bool MSEdge::allowsLaneChanging() const { - if (isInternal()) { + if (isInternal() && MSGlobals::gUsingInternalLanes) { // allow changing only if all links leading to this internal lane have priority // or they are controlled by a traffic light for (std::vector::const_iterator it = myLanes->begin(); it != myLanes->end(); ++it) { @@ -544,16 +539,11 @@ return (*myLanes)[0]; } - bool -MSEdge::insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly, const bool forceCheck) const { - // when vaporizing, no vehicles are inserted, but checking needs to be successful to trigger removal - if (isVaporizing() || isTazConnector()) { - return checkOnly; - } +MSEdge::validateDepartSpeed(SUMOVehicle& v) const { const SUMOVehicleParameter& pars = v.getParameter(); const MSVehicleType& type = v.getVehicleType(); - if (pars.departSpeedProcedure == DEPART_SPEED_GIVEN && pars.departSpeed > getVehicleMaxSpeed(&v)) { + if (pars.departSpeedProcedure == DEPART_SPEED_GIVEN && pars.departSpeed > getVehicleMaxSpeed(&v) + NUMERICAL_EPS) { const std::vector& speedFactorParams = type.getSpeedFactor().getParameter(); if (speedFactorParams[1] > 0.) { v.setChosenSpeedFactor(type.computeChosenSpeedDeviation(nullptr, pars.departSpeed / getSpeedLimit())); @@ -562,8 +552,26 @@ WRITE_WARNING("Choosing new speed factor " + toString(v.getChosenSpeedFactor()) + " for vehicle '" + pars.id + "' to match departure speed."); } } else { - throw ProcessError("Departure speed for vehicle '" + pars.id + - "' is too high for the departure edge '" + getID() + "'."); + return false; + } + } + return true; +} + + +bool +MSEdge::insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly, const bool forceCheck) const { + // when vaporizing, no vehicles are inserted, but checking needs to be successful to trigger removal + if (isVaporizing() || isTazConnector()) { + return checkOnly; + } + const SUMOVehicleParameter& pars = v.getParameter(); + if (!validateDepartSpeed(v)) { + const std::string errorMsg = "Departure speed for vehicle '" + pars.id + "' is too high for the departure edge '" + getID() + "'."; + if (MSGlobals::gCheckRoutes) { + throw ProcessError(errorMsg); + } else { + WRITE_WARNING(errorMsg); } } if (MSGlobals::gUseMesoSim) { @@ -706,7 +714,7 @@ const MSEdge* MSEdge::getNormalBefore() const { const MSEdge* result = this; - while (result->isInternal()) { + while (result->isInternal() && MSGlobals::gUsingInternalLanes) { assert(result->getPredecessors().size() == 1); result = result->getPredecessors().front(); } @@ -749,6 +757,24 @@ return v / no; } +double +MSEdge::getMeanSpeedBike() const { + if (MSGlobals::gUseMesoSim) { + // no separate bicycle speeds in meso + return getMeanSpeed(); + } + double v = 0; + double no = 0; + for (std::vector::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) { + const double vehNo = (double)(*i)->getVehicleNumber(); + v += vehNo * (*i)->getMeanSpeedBike(); + no += vehNo; + } + if (no == 0) { + return getSpeedLimit(); + } + return v / no; +} double MSEdge::getCurrentTravelTime(double minSpeed) const { @@ -762,7 +788,7 @@ double MSEdge::getRoutingSpeed() const { - return MSRoutingEngine::getAssumedSpeed(this); + return MSRoutingEngine::getAssumedSpeed(this, nullptr); } @@ -826,15 +852,8 @@ void MSEdge::parseEdgesList(const std::string& desc, ConstMSEdgeVector& into, const std::string& rid) { - if (desc[0] == BinaryFormatter::BF_ROUTE) { - std::istringstream in(desc, std::ios::binary); - char c; - in >> c; - FileHelpers::readEdgeVector(in, into, rid); - } else { - StringTokenizer st(desc); - parseEdgesList(st.getVector(), into, rid); - } + StringTokenizer st(desc); + parseEdgesList(st.getVector(), into, rid); } @@ -962,7 +981,7 @@ const MSEdgeVector& MSEdge::getSuccessors(SUMOVehicleClass vClass) const { - if (vClass == SVC_IGNORING || !MSNet::getInstance()->hasPermissions() || myFunction == EDGEFUNC_CONNECTOR) { + if (vClass == SVC_IGNORING || !MSNet::getInstance()->hasPermissions() || myFunction == SumoXMLEdgeFunc::CONNECTOR) { return mySuccessors; } #ifdef HAVE_FOX @@ -992,7 +1011,7 @@ const MSConstEdgePairVector& MSEdge::getViaSuccessors(SUMOVehicleClass vClass) const { - if (vClass == SVC_IGNORING || !MSNet::getInstance()->hasPermissions() || myFunction == EDGEFUNC_CONNECTOR) { + if (vClass == SVC_IGNORING || !MSNet::getInstance()->hasPermissions() || myFunction == SumoXMLEdgeFunc::CONNECTOR) { return myViaSuccessors; } #ifdef HAVE_FOX @@ -1035,7 +1054,7 @@ MSEdge::canChangeToOpposite() { return (!myLanes->empty() && myLanes->back()->getOpposite() != nullptr && // do not change on curved internal lanes - (!isInternal() || myLanes->back()->getIncomingLanes()[0].viaLink->getDirection() == LINKDIR_STRAIGHT)); + (!isInternal() || myLanes->back()->getIncomingLanes()[0].viaLink->getDirection() == LinkDirection::STRAIGHT)); } @@ -1072,7 +1091,7 @@ } return; } - if (getFunction() != EDGEFUNC_NORMAL) { + if (getFunction() != SumoXMLEdgeFunc::NORMAL) { return; } ConstMSEdgeVector candidates = myToJunction->getOutgoing(); @@ -1141,13 +1160,98 @@ vehicle->getParameter().departProcedure == DEPART_CONTAINER_TRIGGERED))) { return vehicle; } - // !!! this gives false warnings when there are two stops on the same edge - WRITE_WARNING(transportable->getID() + " at edge '" + getID() + "' position " + toString(position) + " cannot use waiting vehicle '" - + vehicle->getID() + "' at position " + toString(vehicle->getPositionOnLane()) + " because it is too far away."); + if (!vehicle->isLineStop(position)) { + WRITE_WARNING(transportable->getID() + " at edge '" + getID() + "' position " + toString(position) + " cannot use waiting vehicle '" + + vehicle->getID() + "' at position " + toString(vehicle->getPositionOnLane()) + " because it is too far away."); + } } } return nullptr; } +std::vector +MSEdge::getVehicles() const { + std::vector result; + if (MSGlobals::gUseMesoSim) { + for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { + std::vector segmentVehs = segment->getVehicles(); + result.insert(result.end(), segmentVehs.begin(), segmentVehs.end()); + } + } else { + for (MSLane* lane : getLanes()) { + for (auto veh : lane->getVehiclesSecure()) { + result.push_back(veh); + } + lane->releaseVehicles(); + } + } + return result; +} + + +int +MSEdge::getVehicleNumber() const { + return (int)getVehicles().size(); +} + + +double +MSEdge::getWaitingSeconds() const { + double wtime = 0; + if (MSGlobals::gUseMesoSim) { + for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { + wtime += segment->getWaitingSeconds(); + } + } else { + for (MSLane* lane : getLanes()) { + wtime += lane->getWaitingSeconds(); + } + } + return wtime; +} + + +double +MSEdge::getOccupancy() const { + if (MSGlobals::gUseMesoSim) { + /// @note MESegment only tracks brutto occupancy so we compute this from sratch + double sum = 0; + for (const SUMOVehicle* veh : getVehicles()) { + sum += dynamic_cast(veh)->getVehicleType().getLength(); + } + return sum / (myLength * myLanes->size()); + } else { + double sum = 0; + for (auto lane : getLanes()) { + sum += lane->getNettoOccupancy(); + } + return sum / myLanes->size(); + } +} + + +double +MSEdge::getFlow() const { + double flow = 0; + for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { + flow += (double) segment->getCarNumber() * segment->getMeanSpeed(); + } + return 3600 * flow / (*myLanes)[0]->getLength(); +} + + +double +MSEdge::getBruttoOccupancy() const { + double occ = 0; + for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != nullptr; segment = segment->getNextSegment()) { + occ += segment->getBruttoOccupancy(); + } + return occ / (*myLanes)[0]->getLength() / (double)(myLanes->size()); +} + +double +MSEdge::getTravelTimeAggregated(const MSEdge* const edge, const SUMOVehicle* const veh, double /*time*/) { + return edge->getLength() / MIN2(MSRoutingEngine::getAssumedSpeed(edge, veh), veh->getMaxSpeed()); +} /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdge.h sumo-1.6.0+dfsg1/src/microsim/MSEdge.h --- sumo-1.5.0+dfsg1/src/microsim/MSEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A road/street connecting two junctions /****************************************************************************/ -#ifndef MSEdge_h -#define MSEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -43,6 +37,7 @@ #include #include #include +#include #include #include #include "MSNet.h" @@ -172,6 +167,23 @@ return *myLanes; } + /// @brief return total number of vehicles on this edges lanes or segments + int getVehicleNumber() const; + + /// @brief return vehicles on this edges lanes or segments + std::vector getVehicles() const; + + double getBruttoOccupancy() const; + + /// @brief return flow based on meanSpead @note: may produced incorrect results when jammed + double getFlow() const; + + /// @brief return accumated waiting time for all vehicles on this edges lanes or segments + double getWaitingSeconds() const; + + /// @brief return mean occupancy on this edges lanes or segments + double getOccupancy() const; + /** @brief Returns this edge's persons set. * @brief Avoids the creation of new vector as in getSortedPersons * @@ -237,17 +249,17 @@ /// @brief return whether this edge is an internal edge inline bool isNormal() const { - return myFunction == EDGEFUNC_NORMAL; + return myFunction == SumoXMLEdgeFunc::NORMAL; } /// @brief return whether this edge is an internal edge inline bool isInternal() const { - return myFunction == EDGEFUNC_INTERNAL; + return myFunction == SumoXMLEdgeFunc::INTERNAL; } /// @brief return whether this edge is a pedestrian crossing inline bool isCrossing() const { - return myFunction == EDGEFUNC_CROSSING; + return myFunction == SumoXMLEdgeFunc::CROSSING; } @@ -261,11 +273,11 @@ /// @brief return whether this edge is walking area inline bool isWalkingArea() const { - return myFunction == EDGEFUNC_WALKINGAREA; + return myFunction == SumoXMLEdgeFunc::WALKINGAREA; } inline bool isTazConnector() const { - return myFunction == EDGEFUNC_CONNECTOR; + return myFunction == SumoXMLEdgeFunc::CONNECTOR; } void setOtherTazConnector(const MSEdge* edge) { @@ -436,7 +448,7 @@ /// @brief returns the minimum travel time for the given vehicle inline double getMinimumTravelTime(const SUMOVehicle* const veh) const { - if (myFunction == EDGEFUNC_CONNECTOR) { + if (myFunction == SumoXMLEdgeFunc::CONNECTOR) { return 0; } else if (veh != 0) { return getLength() / getVehicleMaxSpeed(veh) + myTimePenalty; @@ -457,6 +469,8 @@ return MSNet::getInstance()->getTravelTime(edge, veh, time); } + static double getTravelTimeAggregated(const MSEdge* const edge, const SUMOVehicle* const veh, double time); + /** @brief Returns the averaged speed used by the routing device */ double getRoutingSpeed() const; @@ -486,6 +500,8 @@ */ bool insertVehicle(SUMOVehicle& v, SUMOTime time, const bool checkOnly = false, const bool forceCheck = false) const; + /// @brief check whether the given departSpeed is valid for this edge + bool validateDepartSpeed(SUMOVehicle& v) const; /** @brief Finds the emptiest lane allowing the vehicle class * @@ -684,6 +700,9 @@ /// @brief get the mean speed double getMeanSpeed() const; + /// @brief get the mean speed of all bicycles on this edge + double getMeanSpeedBike() const; + /// @brief whether any lane has a minor link bool hasMinorLink() const; @@ -770,6 +789,13 @@ return myReversedRoutingEdge; } + RailEdge* getRailwayRoutingEdge() const { + if (myRailwayRoutingEdge == nullptr) { + myRailwayRoutingEdge = new RailEdge(this); + } + return myRailwayRoutingEdge; + } + protected: /** @class by_id_sorter * @brief Sorts edges by their ids @@ -948,6 +974,7 @@ /// @brief a reversed version for backward routing mutable ReversedEdge* myReversedRoutingEdge = nullptr; + mutable RailEdge* myRailwayRoutingEdge = nullptr; /// @brief Invalidated copy constructor. MSEdge(const MSEdge&); @@ -959,9 +986,3 @@ void addToAllowed(const SVCPermissions permissions, std::shared_ptr > allowedLanes, AllowedLanesCont& laneCont) const; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdgeWeightsStorage.cpp sumo-1.6.0+dfsg1/src/microsim/MSEdgeWeightsStorage.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSEdgeWeightsStorage.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdgeWeightsStorage.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // A storage for edge travel times and efforts /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSEdgeWeightsStorage.h" @@ -125,6 +121,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEdgeWeightsStorage.h sumo-1.6.0+dfsg1/src/microsim/MSEdgeWeightsStorage.h --- sumo-1.5.0+dfsg1/src/microsim/MSEdgeWeightsStorage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEdgeWeightsStorage.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A storage for edge travel times and efforts /****************************************************************************/ -#ifndef MSEdgeWeightsStorage_h -#define MSEdgeWeightsStorage_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -133,9 +127,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEventControl.cpp sumo-1.6.0+dfsg1/src/microsim/MSEventControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSEventControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEventControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Stores time-dependant events and executes them at the proper time /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -114,6 +109,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSEventControl.h sumo-1.6.0+dfsg1/src/microsim/MSEventControl.h --- sumo-1.5.0+dfsg1/src/microsim/MSEventControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSEventControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Stores time-dependant events and executes them at the proper time /****************************************************************************/ -#ifndef MSEventControl_h -#define MSEventControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -147,9 +141,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSFrame.cpp sumo-1.6.0+dfsg1/src/microsim/MSFrame.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Sets and checks options for microsim; inits global outputs and settings /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -163,6 +158,8 @@ oc.addDescription("fcd-output.distance", "Output", "Add kilometrage to the FCD output (linear referencing)"); oc.doRegister("fcd-output.acceleration", new Option_Bool(false)); oc.addDescription("fcd-output.acceleration", "Output", "Add acceleration to the FCD output"); + oc.doRegister("fcd-output.params", new Option_StringVector()); + oc.addDescription("fcd-output.params", "Output", "Add generic parameter values to the FCD output"); oc.doRegister("fcd-output.filter-edges.input-file", new Option_FileName()); oc.addDescription("fcd-output.filter-edges.input-file", "Output", "Restrict fcd output to the edge selection from the given input file"); @@ -228,6 +225,9 @@ oc.doRegister("vehroute-output.incomplete", new Option_Bool(false)); oc.addDescription("vehroute-output.incomplete", "Output", "Include invalid routes and route stubs in vehroute output"); + oc.doRegister("vehroute-output.stop-edges", new Option_Bool(false)); + oc.addDescription("vehroute-output.stop-edges", "Output", "Include information about edges between stops"); + oc.doRegister("link-output", new Option_FileName()); oc.addDescription("link-output", "Output", "Save links states into FILE"); @@ -252,6 +252,10 @@ oc.doRegister("stop-output", new Option_FileName()); oc.addDescription("stop-output", "Output", "Record stops and loading/unloading of passenger and containers for all vehicles into FILE"); + oc.doRegister("statistic-output", new Option_FileName()); + oc.addSynonyme("statistic-output", "statistics-output"); + oc.addDescription("statistic-output", "Output", "Write overall statistics into FILE"); + #ifdef _DEBUG oc.doRegister("movereminder-output", new Option_FileName()); oc.addDescription("movereminder-output", "Output", "Save movereminder states of selected vehicles into FILE"); @@ -259,16 +263,18 @@ oc.addDescription("movereminder-output.vehicles", "Output", "List of vehicle ids which shall save their movereminder states"); #endif - oc.doRegister("save-state.times", new Option_IntVector(IntVector())); - oc.addDescription("save-state.times", "Output", "Use INT[] as times at which a network state written"); + oc.doRegister("save-state.times", new Option_StringVector()); + oc.addDescription("save-state.times", "Output", "Use TIME[] as times at which a network state written"); oc.doRegister("save-state.period", new Option_String("-1", "TIME")); oc.addDescription("save-state.period", "Output", "save state repeatedly after TIME period"); oc.doRegister("save-state.prefix", new Option_FileName(StringVector({ "state" }))); oc.addDescription("save-state.prefix", "Output", "Prefix for network states"); - oc.doRegister("save-state.suffix", new Option_String(".sbx")); - oc.addDescription("save-state.suffix", "Output", "Suffix for network states (.sbx or .xml)"); + oc.doRegister("save-state.suffix", new Option_String(".xml.gz")); + oc.addDescription("save-state.suffix", "Output", "Suffix for network states (.xml.gz or .xml)"); oc.doRegister("save-state.files", new Option_FileName());// oc.addDescription("save-state.files", "Output", "Files for network states"); + oc.doRegister("save-state.rng", new Option_Bool(false)); + oc.addDescription("save-state.rng", "Output", "Save random number generator states"); // register the simulation settings oc.doRegister("begin", 'b', new Option_String("0", "TIME")); @@ -283,6 +289,9 @@ oc.doRegister("step-method.ballistic", new Option_Bool(false)); oc.addDescription("step-method.ballistic", "Processing", "Whether to use ballistic method for the positional update of vehicles (default is a semi-implicit Euler method)."); + oc.doRegister("extrapolate-departpos", new Option_Bool(false)); + oc.addDescription("extrapolate-departpos", "Processing", "Whether vehicles that depart between simulation steps should extrapolate the depart position"); + oc.doRegister("threads", new Option_Integer(1)); oc.addDescription("threads", "Processing", "Defines the number of threads for parallel simulation"); @@ -418,11 +427,16 @@ oc.doRegister("routing-algorithm", new Option_String("dijkstra")); oc.addDescription("routing-algorithm", "Routing", "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']"); + oc.doRegister("weights.random-factor", new Option_Float(1.)); oc.addDescription("weights.random-factor", "Routing", "Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT)"); + oc.doRegister("weights.minor-penalty", new Option_Float(1.5)); oc.addDescription("weights.minor-penalty", "Routing", "Apply the given time penalty when computing minimum routing costs for minor-link internal lanes"); + oc.doRegister("weights.priority-factor", new Option_Float(0)); + oc.addDescription("weights.priority-factor", "Routing", "Consider edge priorities in addition to travel times, weighted by factor"); + oc.doRegister("astar.all-distances", new Option_FileName()); oc.addDescription("astar.all-distances", "Routing", "Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output)"); @@ -595,6 +609,7 @@ OutputDevice::createDeviceByOption("bt-output", "bt-output"); OutputDevice::createDeviceByOption("lanechange-output", "lanechanges"); OutputDevice::createDeviceByOption("stop-output", "stops", "stopinfo_file.xsd"); + OutputDevice::createDeviceByOption("statistic-output", "statistics", "statistic_file.xsd"); #ifdef _DEBUG OutputDevice::createDeviceByOption("movereminder-output", "movereminder-output"); @@ -647,7 +662,11 @@ WRITE_ERROR("The begin time should not be negative."); ok = false; } - checkStepLengthMultiple(begin, " for begin"); + // DELTA_T not yet initialized + const SUMOTime deltaT = MAX2((SUMOTime)1, string2time(oc.getString("step-length"))); + if (begin < TIME2STEPS(1)) { + checkStepLengthMultiple(begin, " for begin", deltaT); + } if (end != string2time("-1")) { if (end < begin) { WRITE_ERROR("The end time should be after the begin time."); @@ -660,12 +679,26 @@ } const SUMOTime period = string2time(oc.getString("device.fcd.period")); if (period > 0) { - checkStepLengthMultiple(period, " for device.fcd.period"); + checkStepLengthMultiple(period, " for device.fcd.period", deltaT); } const SUMOTime statePeriod = string2time(oc.getString("save-state.period")); if (statePeriod > 0) { - checkStepLengthMultiple(period, " for save-state.period"); + checkStepLengthMultiple(statePeriod, " for save-state.period", deltaT); } + for (const std::string& timeStr : oc.getStringVector("save-state.times")) { + 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)); + } else { + checkStepLengthMultiple(saveT, " for save-state.times", deltaT); + } + } catch (ProcessError& e) { + WRITE_ERROR("Invalid time '" + timeStr + "' for option 'save-state.times'. " + e.what()); + ok = false; + } + } + #ifdef _DEBUG if (oc.isSet("movereminder-output.vehicles") && !oc.isSet("movereminder-output")) { WRITE_ERROR("option movereminder-output.vehicles requires option movereminder-output to be set"); @@ -723,10 +756,10 @@ try { string2time(val); } catch (ProcessError& e) { - WRITE_ERROR("Invalid time '" + val + "' for option 'breakpoints'." + e.what()); + WRITE_ERROR("Invalid time '" + val + "' for option 'breakpoints'. " + e.what()); ok = false; } - }; + } #ifndef HAVE_FOX if (oc.getInt("threads") > 1) { WRITE_ERROR("Parallel simulation is only possible when compiled with Fox."); diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSFrame.h sumo-1.6.0+dfsg1/src/microsim/MSFrame.h --- sumo-1.5.0+dfsg1/src/microsim/MSFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for microsim; inits global outputs and settings /****************************************************************************/ -#ifndef MSFrame_h -#define MSFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -87,9 +81,3 @@ static void setMSGlobals(OptionsCont& oc); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSGlobals.cpp sumo-1.6.0+dfsg1/src/microsim/MSGlobals.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSGlobals.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSGlobals.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Some static variables for faster access /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSGlobals.h" @@ -86,5 +81,5 @@ bool MSGlobals::gLefthand(false); -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSGlobals.h sumo-1.6.0+dfsg1/src/microsim/MSGlobals.h --- sumo-1.5.0+dfsg1/src/microsim/MSGlobals.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSGlobals.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Some static variables for faster access /****************************************************************************/ -#ifndef MSGlobals_h -#define MSGlobals_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -150,9 +144,3 @@ /// @brief Whether lefthand-drive is being simulated static bool gLefthand; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSInsertionControl.cpp sumo-1.6.0+dfsg1/src/microsim/MSInsertionControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSInsertionControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSInsertionControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -141,7 +136,7 @@ int MSInsertionControl::tryInsert(SUMOTime time, SUMOVehicle* veh, MSVehicleContainer::VehicleVector& refusedEmits) { - assert(veh->getParameter().depart < time + DELTA_T); + assert(veh->getParameter().depart <= time); const MSEdge& edge = *veh->getEdge(); if (veh->isOnRoad()) { return 1; @@ -172,7 +167,7 @@ void MSInsertionControl::checkCandidates(SUMOTime time, const bool preCheck) { - while (myAllVeh.anyWaitingBefore(time + DELTA_T)) { + while (myAllVeh.anyWaitingBefore(time)) { const MSVehicleContainer::VehicleVector& top = myAllVeh.top(); copy(top.begin(), top.end(), back_inserter(myPendingEmits)); myAllVeh.pop(); @@ -203,9 +198,9 @@ bool tryEmitByProb = pars->repetitionProbability > 0; while ((pars->repetitionProbability < 0 && pars->repetitionsDone < pars->repetitionNumber - && pars->depart + pars->repetitionsDone * pars->repetitionOffset < time + DELTA_T) + && pars->depart + pars->repetitionsDone * pars->repetitionOffset <= time) || (tryEmitByProb - && pars->depart < time + DELTA_T + && pars->depart <= time && pars->repetitionEnd > time // only call rand if all other conditions are met && RandHelper::rand(&myFlowRNG) < (pars->repetitionProbability * TS)) @@ -360,5 +355,4 @@ } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSInsertionControl.h sumo-1.6.0+dfsg1/src/microsim/MSInsertionControl.h --- sumo-1.5.0+dfsg1/src/microsim/MSInsertionControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSInsertionControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Inserts vehicles into the network when their departure time is reached /****************************************************************************/ -#ifndef MSInsertionControl_h -#define MSInsertionControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -254,9 +248,3 @@ std::mt19937 myFlowRNG; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSInternalJunction.cpp sumo-1.6.0+dfsg1/src/microsim/MSInternalJunction.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSInternalJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSInternalJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // junction. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSInternalJunction.h" @@ -46,7 +41,7 @@ const PositionVector& shape, std::vector incoming, std::vector internal) - : MSLogicJunction(id, type, position, shape, incoming, internal) {} + : MSLogicJunction(id, type, position, shape, "", incoming, internal) {} @@ -128,7 +123,7 @@ bool MSInternalJunction::indirectBicycleTurn(const MSLane* specialLane, const MSLink* thisLink, const MSLane* foeFirstPart, const MSLink* foeLink) const { if (specialLane->getPermissions() == SVC_BICYCLE && foeFirstPart->getPermissions() == SVC_BICYCLE - && thisLink->getDirection() == LINKDIR_LEFT && foeLink->getDirection() == LINKDIR_LEFT + && thisLink->getDirection() == LinkDirection::LEFT && foeLink->getDirection() == LinkDirection::LEFT && thisLink->getViaLane() != nullptr && thisLink->getViaLane()->getShape().intersects(foeFirstPart->getShape())) { return true; @@ -137,5 +132,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSInternalJunction.h sumo-1.6.0+dfsg1/src/microsim/MSInternalJunction.h --- sumo-1.5.0+dfsg1/src/microsim/MSInternalJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSInternalJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // junction. /****************************************************************************/ -#ifndef MSInternalJunction_h -#define MSInternalJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ MSInternalJunction& operator=(const MSInternalJunction&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunctionControl.cpp sumo-1.6.0+dfsg1/src/microsim/MSJunctionControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSJunctionControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunctionControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -47,12 +42,12 @@ // initialize normal junctions before internal junctions // (to allow calling getIndex() during initialization of internal junction links) for (const auto& i : *this) { - if (i.second->getType() != NODETYPE_INTERNAL) { + if (i.second->getType() != SumoXMLNodeType::INTERNAL) { i.second->postloadInit(); } } for (const auto& i : *this) { - if (i.second->getType() == NODETYPE_INTERNAL) { + if (i.second->getType() == SumoXMLNodeType::INTERNAL) { i.second->postloadInit(); } } @@ -60,4 +55,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunctionControl.h sumo-1.6.0+dfsg1/src/microsim/MSJunctionControl.h --- sumo-1.5.0+dfsg1/src/microsim/MSJunctionControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunctionControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Container for junctions; performs operations on all stored junctions /****************************************************************************/ -#ifndef MSJunctionControl_h -#define MSJunctionControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -72,9 +66,3 @@ MSJunctionControl& operator=(const MSJunctionControl&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunction.cpp sumo-1.6.0+dfsg1/src/microsim/MSJunction.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The base class for an intersection /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSVehicle.h" @@ -57,11 +52,12 @@ // member method definition // =========================================================================== MSJunction::MSJunction(const std::string& id, SumoXMLNodeType type, const Position& position, - const PositionVector& shape) : + const PositionVector& shape, const std::string& name) : Named(id), myType(type), myPosition(position), - myShape(shape) { + myShape(shape), + myName(name) { } @@ -87,5 +83,5 @@ return nr; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunction.h sumo-1.6.0+dfsg1/src/microsim/MSJunction.h --- sumo-1.5.0+dfsg1/src/microsim/MSJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The base class for an intersection /****************************************************************************/ -#ifndef MSJunction_h -#define MSJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -71,7 +65,8 @@ MSJunction(const std::string& id, SumoXMLNodeType type, const Position& position, - const PositionVector& shape); + const PositionVector& shape, + const std::string& name); /// @brief Destructor. @@ -94,6 +89,11 @@ return myShape; } + /// @brief return the junction name + const std::string& getName() const { + return myName; + } + virtual const std::vector& getFoeLinks(const MSLink* const /*srcLink*/) const { return myEmptyLinks; } @@ -149,6 +149,9 @@ /// @brief The shape of the junction PositionVector myShape; + /// @briefh The (optional) junction name + std::string myName; + std::vector myEmptyLinks; std::vector myEmptyLanes; @@ -169,9 +172,3 @@ MSJunction& operator=(const MSJunction&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunctionLogic.cpp sumo-1.6.0+dfsg1/src/microsim/MSJunctionLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSJunctionLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunctionLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // kinds of logic-implementations. /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSJunctionLogic.h" @@ -51,6 +47,4 @@ MSJunctionLogic::~MSJunctionLogic() {} - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSJunctionLogic.h sumo-1.6.0+dfsg1/src/microsim/MSJunctionLogic.h --- sumo-1.5.0+dfsg1/src/microsim/MSJunctionLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSJunctionLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // kinds of logic-implementations. /****************************************************************************/ -#ifndef MSJunctionLogic_h -#define MSJunctionLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -96,9 +90,3 @@ MSJunctionLogic& operator=(const MSJunctionLogic&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLaneChanger.cpp sumo-1.6.0+dfsg1/src/microsim/MSLaneChanger.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLaneChanger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLaneChanger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,10 +22,6 @@ /// // Performs lane changing of vehicles /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSLaneChanger.h" @@ -929,7 +925,7 @@ MSLane* nextLane = vehicle->getLane(); MSLinkCont::const_iterator link = MSLane::succLinkSec(*vehicle, view, *nextLane, bestLaneConts); while (!nextLane->isLinkEnd(link) && seen <= space2change) { - if ((*link)->getDirection() == LINKDIR_LEFT || (*link)->getDirection() == LINKDIR_RIGHT + if ((*link)->getDirection() == LinkDirection::LEFT || (*link)->getDirection() == LinkDirection::RIGHT // the lanes after an internal junction are on different // edges and do not allow lane-changing || (nextLane->getEdge().isInternal() && (*link)->getViaLaneOrLane()->getEdge().isInternal()) @@ -1225,7 +1221,7 @@ if (*(it - 1) != nullptr) { MSLink* link = MSLinkContHelper::getConnectingLink(**(it - 1), **it); if (link == nullptr || link->getState() == LINKSTATE_ZIPPER - || (link->getDirection() != LINKDIR_STRAIGHT && vehicle->getVehicleType().getVehicleClass() != SVC_EMERGENCY) + || (link->getDirection() != LinkDirection::STRAIGHT && vehicle->getVehicleType().getVehicleClass() != SVC_EMERGENCY) || (!link->havePriority() // consider traci-influence && (!vehicle->hasInfluencer() || vehicle->getInfluencer().getRespectJunctionPriority()) @@ -1612,4 +1608,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLaneChanger.h sumo-1.6.0+dfsg1/src/microsim/MSLaneChanger.h --- sumo-1.5.0+dfsg1/src/microsim/MSLaneChanger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLaneChanger.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Performs lane changing of vehicles /****************************************************************************/ -#ifndef MSLaneChanger_h -#define MSLaneChanger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSLane.h" @@ -249,9 +243,3 @@ /// Assignment operator. MSLaneChanger& operator=(const MSLaneChanger&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLaneChangerSublane.cpp sumo-1.6.0+dfsg1/src/microsim/MSLaneChangerSublane.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLaneChangerSublane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLaneChangerSublane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // Performs sub-lane changing of vehicles /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSLaneChangerSublane.h" @@ -640,5 +636,5 @@ return state; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLaneChangerSublane.h sumo-1.6.0+dfsg1/src/microsim/MSLaneChangerSublane.h --- sumo-1.5.0+dfsg1/src/microsim/MSLaneChangerSublane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLaneChangerSublane.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Performs sub-lane changing of vehicles /****************************************************************************/ -#ifndef MSLaneChangerSublane_h -#define MSLaneChangerSublane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -113,9 +107,3 @@ /// Assignment operator. MSLaneChangerSublane& operator=(const MSLaneChangerSublane&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLane.cpp sumo-1.6.0+dfsg1/src/microsim/MSLane.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -25,11 +25,6 @@ /// // Representation of a lane in the micro simulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -103,7 +98,8 @@ MSLane::CollisionAction MSLane::myCollisionAction(MSLane::COLLISION_ACTION_TELEPORT); bool MSLane::myCheckJunctionCollisions(false); SUMOTime MSLane::myCollisionStopTime(0); -double MSLane::myCollisionMinGapFactor(1.0); +double MSLane::myCollisionMinGapFactor(1.0); +bool MSLane::myExtrapolateSubstepDepart(false); std::vector MSLane::myRNGs; @@ -199,7 +195,7 @@ myFollowerInfo(this, nullptr, 0), myLeaderInfoTime(SUMOTime_MIN), myFollowerInfoTime(SUMOTime_MIN), - myLengthGeometryFactor(MAX2(POSITION_EPS, myShape.length()) / myLength), // factor should not be 0 + myLengthGeometryFactor(MAX2(NUMERICAL_EPS, myShape.length() / myLength)), // factor should not be 0 myIsRampAccel(isRampAccel), myLaneType(type), myRightSideOnEdge(0), // initialized in MSEdge::initialize @@ -617,7 +613,22 @@ } } // try to insert - return isInsertionSuccess(&veh, speed, pos, posLat, patchSpeed, MSMoveReminder::NOTIFICATION_DEPARTED); + const bool success = isInsertionSuccess(&veh, speed, pos, posLat, patchSpeed, MSMoveReminder::NOTIFICATION_DEPARTED); + //std::cout << SIMTIME << " veh=" << veh.getID() << " success=" << success << " extrapolate=" << myExtrapolateSubstepDepart << " delay=" << veh.getDepartDelay() << "\n"; + if (success && myExtrapolateSubstepDepart && veh.getDepartDelay() > 0) { + SUMOTime relevantDelay = MIN2(DELTA_T, veh.getDepartDelay()); + // try to compensate sub-step depart delay by moving the vehicle forward + double dist = speed * relevantDelay / (double)DELTA_T; + std::pair leaderInfo = getLeader(&veh, pos, veh.getBestLanesContinuation()); + if (leaderInfo.first != nullptr) { + MSVehicle* leader = leaderInfo.first; + const double frontGapNeeded = veh.getCarFollowModel().getSecureGap(&veh, leader, speed, leader->getSpeed(), + leader->getCarFollowModel().getMaxDecel()); + dist = MIN2(dist, leaderInfo.second - frontGapNeeded); + } + veh.executeFractionalMove(dist); + } + return success; } @@ -722,7 +733,7 @@ } else { // lane does not continue if (checkFailure(aVehicle, speed, dist, cfModel.insertionStopSpeed(aVehicle, speed, seen), - patchSpeed, "junction too close")) { + patchSpeed, "junction '" + currentLane->getEdge().getToJunction()->getID() + "' too close")) { // we may not drive with the given velocity - we cannot stop at the junction return false; } @@ -825,10 +836,14 @@ speed = nspeed; dist = cfModel.brakeGap(speed) + aVehicle->getVehicleType().getMinGap(); } else { - // we may not drive with the given velocity - we would be too fast on the next lane - WRITE_ERROR("Vehicle '" + aVehicle->getID() + "' will not be able to depart using the given velocity (slow lane ahead)!"); - MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle); - return false; + if (!MSGlobals::gCheckRoutes) { + WRITE_WARNING("Vehicle '" + aVehicle->getID() + "' is inserted too fast and will violate the speed limit on a lane '" + nextLane->getID() + "'."); + } else { + // we may not drive with the given velocity - we would be too fast on the next lane + WRITE_ERROR("Vehicle '" + aVehicle->getID() + "' will not be able to depart using the given velocity (slow lane ahead)!"); + MSNet::getInstance()->getInsertionControl().descheduleDeparture(aVehicle); + return false; + } } } // check traffic on next junction @@ -1378,7 +1393,7 @@ double high = (*veh)->getPositionOnLane(this); double low = (*veh)->getBackPositionOnLane(this); for (AnyVehicleIterator veh2 = bidiLane->anyVehiclesBegin(); veh2 != bidiLane->anyVehiclesEnd(); ++veh2) { - // self-collisions might ligitemately occur when a long train loops back on itself + // self-collisions might legitemately occur when a long train loops back on itself //if (*veh == *veh2) { // // no self-collision (when performing a turn-around) // continue; @@ -1386,6 +1401,13 @@ double low2 = myLength - (*veh2)->getPositionOnLane(bidiLane); double high2 = myLength - (*veh2)->getBackPositionOnLane(bidiLane); if (!(high < low2 || high2 < low)) { +#ifdef DEBUG_COLLISIONS + if (DEBUG_COND) { + std::cout << SIMTIME << " bidi-collision veh=" << (*veh)->getID() << " bidiVeh=" << (*veh2)->getID() + << " vehFurther=" << toString((*veh)->getFurtherLanes()) + << " high=" << high << " low=" << low << " high2=" << high2 << " low2=" << low2 << "\n"; + } +#endif // the faster vehicle is at fault MSVehicle* collider = const_cast(*veh); MSVehicle* victim = const_cast(*veh2); @@ -1479,7 +1501,7 @@ if (toTeleport.count(veh) > 0) { MSVehicleTransfer::getInstance()->add(timestep, veh); } else { - veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED); + veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED_COLLISION); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); } } @@ -1743,7 +1765,7 @@ } else if (target != nullptr && moved) { if (target->getEdge().isVaporizing()) { // vehicle has reached a vaporizing edge - veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED); + veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED_VAPORIZER); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); } else { // vehicle has entered a new lane (leaveLane and workOnMoveReminders were already called in MSVehicle::executeMove) @@ -1767,7 +1789,7 @@ if (getCollisionAction() == COLLISION_ACTION_REMOVE) { WRITE_WARNING("Removing vehicle '" + veh->getID() + "' after earlier collision, lane='" + veh->getLane()->getID() + ", time=" + time2string(t) + "."); - veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED); + veh->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED_COLLISION); MSNet::getInstance()->getVehicleControl().scheduleVehicleRemoval(veh); } else if (getCollisionAction() == COLLISION_ACTION_TELEPORT) { WRITE_WARNING("Teleporting vehicle '" + veh->getID() + "' after earlier collision, lane='" + veh->getLane()->getID() + ", time=" + @@ -2756,6 +2778,31 @@ double +MSLane::getMeanSpeedBike() const { + // @note: redudant code with getMeanSpeed to avoid extra checks in a function that is called very often + if (myVehicles.size() == 0) { + return myMaxSpeed; + } + double v = 0; + int numBikes = 0; + for (MSVehicle* veh : getVehiclesSecure()) { + if (veh->getVClass() == SVC_BICYCLE) { + v += veh->getSpeed(); + numBikes++; + } + } + double ret; + if (numBikes > 0) { + ret = v / (double) myVehicles.size(); + } else { + ret = myMaxSpeed; + } + releaseVehicles(); + return ret; +} + + +double MSLane::getCO2Emissions() const { double ret = 0; const MSLane::VehCont& vehs = getVehiclesSecure(); @@ -3173,7 +3220,7 @@ MSLeaderInfo firstFront = next->getFirstVehicleInformation(nullptr, 0, true); #ifdef DEBUG_CONTEXT if (DEBUG_COND2(ego)) { - std::cout << " next=" << next->getID() << " seen=" << (*it).length << " first=" << first.toString() << " firstFront=" << firstFront.toString() << "\n"; + std::cout << " next=" << next->getID() << " seen=" << (*it).length << " first=" << first.toString() << " firstFront=" << firstFront.toString() << " backOffset=" << backOffset << "\n"; gDebugFlag1 = true; // for calling getLeaderInfo } #endif @@ -3181,11 +3228,17 @@ && egoFurther.count(&next->getEdge()) != 0 ) { // check for junction foes that would interfere with lane changing + // @note: we are passing the back of ego as its front position so + // we need to add this back to the returned gap const MSLink::LinkLeaders linkLeaders = (*it).viaLink->getLeaderInfo(ego, -backOffset); for (const auto& ll : linkLeaders) { if (ll.vehAndGap.first != nullptr) { const bool egoIsLeader = ll.vehAndGap.first->isLeader((*it).viaLink, ego); - const double gap = egoIsLeader ? NUMERICAL_EPS : ll.vehAndGap.second; + // if ego is leader the returned gap still assumes that ego follows the leader + // if the foe vehicle follows ego we need to deduce that gap + const double gap = (egoIsLeader + ? -ll.vehAndGap.second - ll.vehAndGap.first->getVehicleType().getLengthWithGap() - ego->getVehicleType().getMinGap() + : ll.vehAndGap.second + ego->getVehicleType().getLength()); result.addFollower(ll.vehAndGap.first, ego, gap); #ifdef DEBUG_CONTEXT if (DEBUG_COND2(ego)) { @@ -3646,6 +3699,7 @@ myCheckJunctionCollisions = oc.getBool("collision.check-junctions"); myCollisionStopTime = string2time(oc.getString("collision.stoptime")); myCollisionMinGapFactor = oc.getFloat("collision.mingap-factor"); + myExtrapolateSubstepDepart = oc.getBool("extrapolate-departpos"); } @@ -3737,6 +3791,24 @@ } } +void +MSLane::saveRNGStates(OutputDevice& out) { + for (int i = 0; i < getNumRNGs(); i++) { + out.openTag(SUMO_TAG_RNGLANE); + out.writeAttr(SUMO_ATTR_INDEX, i); + out.writeAttr(SUMO_ATTR_STATE, RandHelper::saveState(&myRNGs[i])); + out.closeTag(); + } +} + +void +MSLane::loadRNGState(int index, const std::string& state) { + if (index >= getNumRNGs()) { + throw ProcessError("State was saved with more than " + toString(getNumRNGs()) + " threads. Change the number of threads or do not load RNG state"); + } + RandHelper::loadState(state, &myRNGs[index]); +} + MSLane* MSLane::getBidiLane() const { diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLane.h sumo-1.6.0+dfsg1/src/microsim/MSLane.h --- sumo-1.5.0+dfsg1/src/microsim/MSLane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLane.h 2020-04-27 21:47:56.000000000 +0000 @@ -24,13 +24,7 @@ /// // Representation of a lane in the micro simulation /****************************************************************************/ -#ifndef MSLane_h -#define MSLane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -233,6 +227,12 @@ return (int)myRNGs.size(); } + /// @brief save random number generator states to the given output device + static void saveRNGStates(OutputDevice& out); + + /// @brief load random number generator state for the given rng index + static void loadRNGState(int index, const std::string& state); + /// @name Additional initialisation /// @{ @@ -988,6 +988,9 @@ */ double getMeanSpeed() const; + /// @brief get the mean speed of all bicycles on this lane + double getMeanSpeedBike() const; + /** @brief Returns the overall waiting time on this lane * @return The sum of the waiting time of all vehicles during the last step; */ @@ -1441,6 +1444,7 @@ static bool myCheckJunctionCollisions; static SUMOTime myCollisionStopTime; static double myCollisionMinGapFactor; + static bool myExtrapolateSubstepDepart; /** * @class vehicle_position_sorter @@ -1612,9 +1616,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLeaderInfo.cpp sumo-1.6.0+dfsg1/src/microsim/MSLeaderInfo.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLeaderInfo.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLeaderInfo.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ // Information about vehicles ahead (may be multiple vehicles if // lateral-resolution is active) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -407,5 +402,6 @@ oss << " free=" << myFreeSublanes; return oss.str(); } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLeaderInfo.h sumo-1.6.0+dfsg1/src/microsim/MSLeaderInfo.h --- sumo-1.5.0+dfsg1/src/microsim/MSLeaderInfo.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLeaderInfo.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ // Information about vehicles ahead (may be multiple vehicles if // lateral-resolution is active) /****************************************************************************/ -#ifndef MSLeaderInfo_h -#define MSLeaderInfo_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -229,8 +223,3 @@ std::vector myMissingGaps; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLinkCont.cpp sumo-1.6.0+dfsg1/src/microsim/MSLinkCont.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLinkCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLinkCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Helpers for link vector /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSLinkCont.h" @@ -85,6 +80,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLinkCont.h sumo-1.6.0+dfsg1/src/microsim/MSLinkCont.h --- sumo-1.5.0+dfsg1/src/microsim/MSLinkCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLinkCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A vector of links /****************************************************************************/ -#ifndef MSLinkCont_h -#define MSLinkCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -67,9 +61,3 @@ exists */ static MSLink* getConnectingLink(const MSLane& from, const MSLane& to); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLink.cpp sumo-1.6.0+dfsg1/src/microsim/MSLink.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLink.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLink.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // A connnection between lanes /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -335,7 +331,7 @@ #ifdef MSLink_DEBUG_CROSSING_POINTS std::cout << " sublaneFoeLink (same target): " << it->getViaLaneOrLane()->getID() << "\n"; #endif - } else if (myDirection != LINKDIR_STRAIGHT && it->getDirection() == LINKDIR_STRAIGHT) { + } else if (myDirection != LinkDirection::STRAIGHT && it->getDirection() == LinkDirection::STRAIGHT) { // potential turn conflicht mySublaneFoeLinks2.push_back(it); #ifdef MSLink_DEBUG_CROSSING_POINTS @@ -505,13 +501,13 @@ // (straight movers take precedence if the paths cross) const int lhSign = MSGlobals::gLefthand ? -1 : 1; for (const MSLink* foeLink : mySublaneFoeLinks2) { - assert(myDirection != LINKDIR_STRAIGHT); + assert(myDirection != LinkDirection::STRAIGHT); for (const auto& it : foeLink->myApproachingVehicles) { const SUMOVehicle* foe = it.first; // there only is a conflict if the paths cross - if (((myDirection == LINKDIR_RIGHT || myDirection == LINKDIR_PARTRIGHT) + if (((myDirection == LinkDirection::RIGHT || myDirection == LinkDirection::PARTRIGHT) && (posLat * lhSign > foe->getLateralPositionOnLane() * lhSign)) - || ((myDirection == LINKDIR_LEFT || myDirection == LINKDIR_PARTLEFT) + || ((myDirection == LinkDirection::LEFT || myDirection == LinkDirection::PARTLEFT) && (posLat * lhSign < foe->getLateralPositionOnLane() * lhSign))) { if (blockedByFoe(foe, it.second, arrivalTime, leaveTime, arrivalSpeed, leaveSpeed, false, impatience, decel, waitingTime, ego)) { @@ -530,7 +526,7 @@ } } } - if (havePriority() && myState != LINKSTATE_ZIPPER) { + if ((havePriority() || lastWasContMajorGreen()) && myState != LINKSTATE_ZIPPER) { // priority usually means the link is open but there are exceptions: // zipper still needs to collect foes // sublane model could have detected a conflict @@ -774,6 +770,25 @@ } +bool +MSLink::lastWasContMajorGreen() const { + if (myInternalLane == nullptr || myAmCont || myHavePedestrianCrossingFoe) { + return false; + } else { + MSLane* pred = myInternalLane->getLogicalPredecessorLane(); + if (!pred->getEdge().isInternal()) { + return false; + } else { + MSLane* pred2 = pred->getLogicalPredecessorLane(); + assert(pred2 != 0); + MSLink* predLink = MSLinkContHelper::getConnectingLink(*pred2, *pred); + assert(predLink != 0); + return predLink->getState() == LINKSTATE_TL_GREEN_MAJOR || predLink->getState() == LINKSTATE_TL_RED; + } + } +} + + void MSLink::writeApproaching(OutputDevice& od, const std::string fromLaneID) const { if (myApproachingVehicles.size() > 0) { @@ -979,20 +994,34 @@ const bool sameSource = (myInternalLaneBefore != nullptr && myInternalLaneBefore->getLogicalPredecessorLane() == foeLane->getLogicalPredecessorLane()); const double crossingWidth = (sameTarget || sameSource) ? 0 : foeLane->getWidth(); const double foeCrossingWidth = (sameTarget || sameSource) ? 0 : myInternalLaneBefore->getWidth(); + // special treatment of contLane foe only applies if this lane is not a contLane or contLane follower itself + const bool contLane = (foeLane->getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal() && !( + isInternalJunctionLink() || isExitLinkAfterInternalJunction())); if (gDebugFlag1) { std::cout << " distToCrossing=" << distToCrossing << " foeLane=" << foeLane->getID() << " cWidth=" << crossingWidth << " ijl=" << isInternalJunctionLink() << " sT=" << sameTarget << " sS=" << sameSource << " lbc=" << myLengthsBehindCrossing[i].first << " flbc=" << myLengthsBehindCrossing[i].second + << " contLane=" << contLane + << " state=" << toString(myState) + << " foeState=" << toString(foeLane->getLinkCont()[0]->getState()) << "\n"; } - // special treatment of contLane foe only applies if this lane is not a contLane or contLane follower itself - const bool contLane = (foeLane->getLinkCont()[0]->getViaLaneOrLane()->getEdge().isInternal() && !( - isInternalJunctionLink() || isExitLinkAfterInternalJunction())); if (distToCrossing + crossingWidth < 0 && (ego == nullptr || !MSGlobals::gComputeLC || distToCrossing + crossingWidth + ego->getVehicleType().getLength() < 0)) { continue; // vehicle is behind the crossing point, continue with next foe lane } + bool ignoreGreenCont = false; + if (contLane) { + const MSLink* entry = getLaneBefore()->getEntryLink(); + const MSLink* foeEntry = foeLane->getEntryLink(); + if (entry != nullptr && entry->haveGreen() + && foeEntry != nullptr && foeEntry->haveGreen() + && entry->myLaneBefore != foeEntry->myLaneBefore) { + // ignore vehicles before an internaljunction as long as they are still in green minor mode + ignoreGreenCont = true; + } + } const double foeDistToCrossing = foeLane->getLength() - myLengthsBehindCrossing[i].second; // it is not sufficient to return the last vehicle on the foeLane because ego might be its leader // therefore we return all vehicles on the lane @@ -1008,7 +1037,7 @@ const bool pastTheCrossingPoint = leaderBackDist + foeCrossingWidth < 0; const bool ignoreIndirectBicycleTurn = (pastTheCrossingPoint && leader->getVehicleType().getVehicleClass() == SVC_BICYCLE - && foeLane->getIncomingLanes().front().viaLink->getDirection() == LINKDIR_LEFT); + && foeLane->getIncomingLanes().front().viaLink->getDirection() == LinkDirection::LEFT); const bool cannotIgnore = ((contLane && !ignoreIndirectBicycleTurn) || sameTarget || sameSource) && ego != nullptr; const bool inTheWay = !pastTheCrossingPoint && leaderBackDist < leader->getVehicleType().getLength(); const bool isOpposite = leader->getLaneChangeModel().isOpposite(); @@ -1028,6 +1057,10 @@ if (leader == ego) { continue; } + // ignore greenCont foe vehicles that are not in the way + if (ignoreGreenCont && !inTheWay) { + continue; + } // after entering the conflict area, ignore foe vehicles that are not in the way if (distToCrossing < -POSITION_EPS && !inTheWay && (ego == nullptr || !MSGlobals::gComputeLC || distToCrossing < -ego->getVehicleType().getLength())) { @@ -1039,10 +1072,34 @@ && leader->isFrontOnLane(foeLane) && !isOpposite && !inTheWay + // do not ignore vehicles that have already entered the roundabout (they might block the way to the exit) + && !myLane->getEdge().isRoundabout() // willPass is false if the vehicle is already on the stopping edge && !leader->willStop()) { continue; } + if (MSGlobals::gSublane && ego != nullptr && sameSource) { + const double posLat = ego->getLateralPositionOnLane(); + const double posLatLeader = leader->getLateralPositionOnLane() + leader->getLatOffset(foeLane); + const double latGap = (fabs(posLat - posLatLeader) + - 0.5 * ego->getVehicleType().getWidth() + leader->getVehicleType().getWidth()); + if (gDebugFlag1) { + std::cout << " sameSource-sublaneFoe lane=" << myInternalLaneBefore->getID() + << " foeLane=" << foeLane->getID() + << " leader=" << leader->getID() + << " egoLane=" << ego->getLane()->getID() + << " leaderLane=" << leader->getLane()->getID() + << " egoLat=" << posLat + << " leaderLat=" << posLatLeader + << " leaderLatOffset=" << leader->getLatOffset(foeLane) + << " latGap=" << latGap + << "\n"; + } + if (latGap > 0 + && ((posLat > posLatLeader) == (myIndex > foeLane->getIncomingLanes().front().viaLink->getIndex()))) { + continue; + } + } if (cannotIgnore || inTheWay || leader->getWaitingTime() < MSGlobals::gIgnoreJunctionBlocker) { // compute distance between vehicles on the the superimposition of both lanes // where the crossing point is the common point @@ -1079,7 +1136,8 @@ continue; // next vehicle } gap = distToCrossing - ego->getVehicleType().getMinGap() - leaderBackDist - foeCrossingWidth; - if (gap < leader->getVehicleType().getLength() && leader->getLaneChangeModel().isStrategicBlocked()) { + // factor 2 is to give some slack for lane-changing + if (gap < leader->getVehicleType().getLength() * 2 && leader->getLaneChangeModel().isStrategicBlocked()) { // do not encroach on leader when it tries to change lanes gap = -1; } @@ -1416,5 +1474,5 @@ return myLaneBefore->getID() + "->" + getViaLaneOrLane()->getID(); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLink.h sumo-1.6.0+dfsg1/src/microsim/MSLink.h --- sumo-1.5.0+dfsg1/src/microsim/MSLink.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLink.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A connnection between lanes /****************************************************************************/ -#ifndef MSLink_h -#define MSLink_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -364,6 +358,10 @@ return myState == LINKSTATE_TL_YELLOW_MINOR || myState == LINKSTATE_TL_YELLOW_MAJOR; } + inline bool haveGreen() const { + return myState == LINKSTATE_TL_GREEN_MAJOR || myState == LINKSTATE_TL_GREEN_MINOR; + } + inline bool isTLSControlled() const { return myLogic != 0; } @@ -408,6 +406,9 @@ /// @brief whether this is a link past an internal junction which currently has priority bool lastWasContMajor() const; + /// @brief whether this is a link past an internal junction which currently has green major + bool lastWasContMajorGreen() const; + /** @brief Returns the cumulative length of all internal lanes after this link * @return sum of the lengths of all internal lanes following this link */ @@ -676,9 +677,3 @@ MSLink& operator=(const MSLink& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLogicJunction.cpp sumo-1.6.0+dfsg1/src/microsim/MSLogicJunction.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSLogicJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLogicJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // with one ore more logics. /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSLinkCont.h" @@ -41,10 +37,10 @@ SumoXMLNodeType type, const Position& position, const PositionVector& shape, - std::vector incoming - , std::vector internal - ): - MSJunction(id, type, position, shape), + const std::string& name, + std::vector incoming, + std::vector internal): + MSJunction(id, type, position, shape, name), myIncomingLanes(incoming), myInternalLanes(internal) { } @@ -106,6 +102,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSLogicJunction.h sumo-1.6.0+dfsg1/src/microsim/MSLogicJunction.h --- sumo-1.5.0+dfsg1/src/microsim/MSLogicJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSLogicJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // with one ore more logics. /****************************************************************************/ -#ifndef MSLogicJunction_h -#define MSLogicJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSJunction.h" @@ -81,6 +75,7 @@ SumoXMLNodeType type, const Position& position, const PositionVector& shape, + const std::string& name, std::vector incoming, std::vector internal ); @@ -100,9 +95,3 @@ MSLogicJunction& operator=(const MSLogicJunction&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSMoveReminder.cpp sumo-1.6.0+dfsg1/src/microsim/MSMoveReminder.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSMoveReminder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSMoveReminder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSMoveReminder.h sumo-1.6.0+dfsg1/src/microsim/MSMoveReminder.h --- sumo-1.5.0+dfsg1/src/microsim/MSMoveReminder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSMoveReminder.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Something on a lane to be noticed about vehicle movement /****************************************************************************/ -#ifndef MSMoveReminder_h -#define MSMoveReminder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -107,14 +101,22 @@ NOTIFICATION_TELEPORT, /// @brief The vehicle starts or ends parking NOTIFICATION_PARKING, + /// @brief The vehicle needs another parking area + NOTIFICATION_PARKING_REROUTE, /// @brief The vehicle arrived at its destination (is deleted) NOTIFICATION_ARRIVED, // arrived and everything after is treated as permanent deletion from the net - /// @brief The vehicle got vaporized - NOTIFICATION_VAPORIZED, /// @brief The vehicle was teleported out of the net NOTIFICATION_TELEPORT_ARRIVED, - /// @brief The vehicle needs another parking area - NOTIFICATION_PARKING_REROUTE + /// @brief The vehicle got removed by a calibrator + NOTIFICATION_VAPORIZED_CALIBRATOR, + /// @brief The vehicle got removed by a collision + NOTIFICATION_VAPORIZED_COLLISION, + /// @brief The vehicle got removed via TraCI + NOTIFICATION_VAPORIZED_TRACI, + /// @brief The vehicle got removed via the GUI + NOTIFICATION_VAPORIZED_GUI, + /// @brief The vehicle got vaporized with a vaporizer + NOTIFICATION_VAPORIZED_VAPORIZER }; @@ -163,6 +165,19 @@ return true; } + /** @brief Computes idling emission values and adds them to the emission sums + * + * Idling implied by zero velocity, acceleration and slope + * + * @param[in] veh The vehicle + * + * @see MSMoveReminder::notifyMove + * @see PollutantsInterface + */ + virtual bool notifyIdle(SUMOTrafficObject& veh) { + UNUSED_PARAMETER(&veh); + return true; + } /** @brief Called if the vehicle leaves the reminder's lane * @@ -247,7 +262,7 @@ #ifdef HAVE_FOX /// @brief the mutex for notifications - FXMutex myNotificationMutex; + mutable FXMutex myNotificationMutex; #endif private: @@ -258,9 +273,3 @@ MSMoveReminder& operator=(const MSMoveReminder&); // just to avoid a compiler warning }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSNet.cpp sumo-1.6.0+dfsg1/src/microsim/MSNet.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSNet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSNet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -25,11 +25,6 @@ /// // The simulated network and simulation perfomer /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -374,6 +369,10 @@ postSimStepOutput(); } // exit simulation loop + if (myLogStepNumber) { + // start new line for final verbose output + std::cout << "\n"; + } closeSimulation(start, getStateMessage(state)); return state; } @@ -387,53 +386,55 @@ const std::string MSNet::generateStatistics(SUMOTime start) { - long duration = SysUtils::getCurrentMillis() - mySimBeginMillis; std::ostringstream msg; - // print performance notice - msg << "Performance: " << "\n" << " Duration: " << duration << "ms" << "\n"; - if (duration != 0) { - msg << " Real time factor: " << (STEPS2TIME(myStep - start) * 1000. / (double)duration) << "\n"; - msg.setf(std::ios::fixed, std::ios::floatfield); // use decimal format - msg.setf(std::ios::showpoint); // print decimal point - msg << " UPS: " << ((double)myVehiclesMoved / ((double)duration / 1000)) << "\n"; - if (myPersonsMoved > 0) { - msg << " UPS-Persons: " << ((double)myPersonsMoved / ((double)duration / 1000)) << "\n"; - } - } - // print vehicle statistics - const std::string discardNotice = ((myVehicleControl->getLoadedVehicleNo() != myVehicleControl->getDepartedVehicleNo()) ? - " (Loaded: " + toString(myVehicleControl->getLoadedVehicleNo()) + ")" : ""); - msg << "Vehicles: " << "\n" - << " Inserted: " << myVehicleControl->getDepartedVehicleNo() << discardNotice << "\n" - << " Running: " << myVehicleControl->getRunningVehicleNo() << "\n" - << " Waiting: " << myInserter->getWaitingVehicleNo() << "\n"; - - if (myVehicleControl->getTeleportCount() > 0 || myVehicleControl->getCollisionCount() > 0) { - // print optional teleport statistics - std::vector reasons; - if (myVehicleControl->getCollisionCount() > 0) { - reasons.push_back("Collisions: " + toString(myVehicleControl->getCollisionCount())); - } - if (myVehicleControl->getTeleportsJam() > 0) { - reasons.push_back("Jam: " + toString(myVehicleControl->getTeleportsJam())); - } - if (myVehicleControl->getTeleportsYield() > 0) { - reasons.push_back("Yield: " + toString(myVehicleControl->getTeleportsYield())); - } - if (myVehicleControl->getTeleportsWrongLane() > 0) { - reasons.push_back("Wrong Lane: " + toString(myVehicleControl->getTeleportsWrongLane())); - } - msg << "Teleports: " << myVehicleControl->getTeleportCount() << " (" << joinToString(reasons, ", ") << ")\n"; - } - if (myVehicleControl->getEmergencyStops() > 0) { - msg << "Emergency Stops: " << myVehicleControl->getEmergencyStops() << "\n"; - } - if (myPersonControl != nullptr && myPersonControl->getLoadedNumber() > 0) { - msg << "Persons: " << "\n" - << " Inserted: " << myPersonControl->getLoadedNumber() << "\n" - << " Running: " << myPersonControl->getRunningNumber() << "\n"; - if (myPersonControl->getJammedNumber() > 0) { - msg << " Jammed: " << myPersonControl->getJammedNumber() << "\n"; + if (myLogExecutionTime) { + long duration = SysUtils::getCurrentMillis() - mySimBeginMillis; + // print performance notice + msg << "Performance: " << "\n" << " Duration: " << duration << "ms" << "\n"; + if (duration != 0) { + msg << " Real time factor: " << (STEPS2TIME(myStep - start) * 1000. / (double)duration) << "\n"; + msg.setf(std::ios::fixed, std::ios::floatfield); // use decimal format + msg.setf(std::ios::showpoint); // print decimal point + msg << " UPS: " << ((double)myVehiclesMoved / ((double)duration / 1000)) << "\n"; + if (myPersonsMoved > 0) { + msg << " UPS-Persons: " << ((double)myPersonsMoved / ((double)duration / 1000)) << "\n"; + } + } + // print vehicle statistics + const std::string discardNotice = ((myVehicleControl->getLoadedVehicleNo() != myVehicleControl->getDepartedVehicleNo()) ? + " (Loaded: " + toString(myVehicleControl->getLoadedVehicleNo()) + ")" : ""); + msg << "Vehicles: " << "\n" + << " Inserted: " << myVehicleControl->getDepartedVehicleNo() << discardNotice << "\n" + << " Running: " << myVehicleControl->getRunningVehicleNo() << "\n" + << " Waiting: " << myInserter->getWaitingVehicleNo() << "\n"; + + if (myVehicleControl->getTeleportCount() > 0 || myVehicleControl->getCollisionCount() > 0) { + // print optional teleport statistics + std::vector reasons; + if (myVehicleControl->getCollisionCount() > 0) { + reasons.push_back("Collisions: " + toString(myVehicleControl->getCollisionCount())); + } + if (myVehicleControl->getTeleportsJam() > 0) { + reasons.push_back("Jam: " + toString(myVehicleControl->getTeleportsJam())); + } + if (myVehicleControl->getTeleportsYield() > 0) { + reasons.push_back("Yield: " + toString(myVehicleControl->getTeleportsYield())); + } + if (myVehicleControl->getTeleportsWrongLane() > 0) { + reasons.push_back("Wrong Lane: " + toString(myVehicleControl->getTeleportsWrongLane())); + } + msg << "Teleports: " << myVehicleControl->getTeleportCount() << " (" << joinToString(reasons, ", ") << ")\n"; + } + if (myVehicleControl->getEmergencyStops() > 0) { + msg << "Emergency Stops: " << myVehicleControl->getEmergencyStops() << "\n"; + } + if (myPersonControl != nullptr && myPersonControl->getLoadedNumber() > 0) { + msg << "Persons: " << "\n" + << " Inserted: " << myPersonControl->getLoadedNumber() << "\n" + << " Running: " << myPersonControl->getRunningNumber() << "\n"; + if (myPersonControl->getJammedNumber() > 0) { + msg << " Jammed: " << myPersonControl->getJammedNumber() << "\n"; + } } } if (OptionsCont::getOptions().getBool("duration-log.statistics")) { @@ -442,6 +443,35 @@ return msg.str(); } +void +MSNet::writeStatistics() const { + OutputDevice& od = OutputDevice::getDeviceByOption("statistic-output"); + od.openTag("vehicles"); + od.writeAttr("loaded", myVehicleControl->getLoadedVehicleNo()); + od.writeAttr("inserted", myVehicleControl->getDepartedVehicleNo()); + od.writeAttr("running", myVehicleControl->getRunningVehicleNo()); + od.writeAttr("waiting", myInserter->getWaitingVehicleNo()); + od.closeTag(); + od.openTag("teleports"); + od.writeAttr("total", myVehicleControl->getTeleportCount()); + od.writeAttr("jam", myVehicleControl->getTeleportsJam()); + od.writeAttr("yield", myVehicleControl->getTeleportsYield()); + od.writeAttr("wrongLane", myVehicleControl->getTeleportsWrongLane()); + od.closeTag(); + od.openTag("safety"); + od.writeAttr("collisions", myVehicleControl->getCollisionCount()); + od.writeAttr("emergencyStops", myVehicleControl->getEmergencyStops()); + od.closeTag(); + od.openTag("persons"); + od.writeAttr("loaded", myPersonControl != nullptr ? myPersonControl->getLoadedNumber() : 0); + od.writeAttr("running", myPersonControl != nullptr ? myPersonControl->getRunningNumber() : 0); + od.writeAttr("jammed", myPersonControl != nullptr ? myPersonControl->getJammedNumber() : 0); + od.closeTag(); + if (OptionsCont::getOptions().isSet("tripinfo-output") || OptionsCont::getOptions().getBool("duration-log.statistics")) { + MSDevice_Tripinfo::writeStatistics(od); + } + +} void MSNet::closeSimulation(SUMOTime start, const std::string& reason) { @@ -469,9 +499,12 @@ if (OptionsCont::getOptions().isSet("railsignal-block-output")) { writeRailSignalBlocks(); } - if (myLogExecutionTime) { + if (myLogExecutionTime || OptionsCont::getOptions().getBool("duration-log.statistics")) { WRITE_MESSAGE(generateStatistics(start)); } + if (OptionsCont::getOptions().isSet("statistic-output")) { + writeStatistics(); + } } @@ -1196,7 +1229,7 @@ bool MSNet::checkWalkingarea() { for (const MSEdge* e : myEdges->getEdges()) { - if (e->getFunction() == EDGEFUNC_WALKINGAREA) { + if (e->getFunction() == SumoXMLEdgeFunc::WALKINGAREA) { return true; } } diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSNet.h sumo-1.6.0+dfsg1/src/microsim/MSNet.h --- sumo-1.5.0+dfsg1/src/microsim/MSNet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSNet.h 2020-04-27 21:47:56.000000000 +0000 @@ -24,13 +24,7 @@ /// // The simulated network and simulation performer /****************************************************************************/ -#ifndef MSNet_h -#define MSNet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,7 +68,6 @@ class ShapeContainer; class MSDynamicShapeUpdater; class PolygonDynamics; -class BinaryInputDevice; class MSEdgeWeightsStorage; class SUMOVehicle; class MSTractionSubstation; @@ -257,6 +250,8 @@ */ const std::string generateStatistics(SUMOTime start); + /// @brief write statistic output to (xml) file + void writeStatistics() const; /** @brief Closes the simulation (all files, connections, etc.) * @@ -889,9 +884,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSNoLogicJunction.cpp sumo-1.6.0+dfsg1/src/microsim/MSNoLogicJunction.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSNoLogicJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSNoLogicJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSNoLogicJunction.h" @@ -44,8 +39,9 @@ SumoXMLNodeType type, const Position& position, const PositionVector& shape, + const std::string& name, std::vector incoming, std::vector internal): - MSJunction(id, type, position, shape), + MSJunction(id, type, position, shape, name), myIncomingLanes(incoming), myInternalLanes(internal) { } @@ -91,6 +87,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSNoLogicJunction.h sumo-1.6.0+dfsg1/src/microsim/MSNoLogicJunction.h --- sumo-1.5.0+dfsg1/src/microsim/MSNoLogicJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSNoLogicJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // logic, e.g. for exits. /****************************************************************************/ -#ifndef MSNoLogicJunction_h -#define MSNoLogicJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -63,6 +57,7 @@ */ MSNoLogicJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape, + const std::string& name, std::vector incoming, std::vector internal); @@ -88,9 +83,3 @@ MSNoLogicJunction& operator=(const MSNoLogicJunction&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSParkingArea.cpp sumo-1.6.0+dfsg1/src/microsim/MSParkingArea.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSParkingArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSParkingArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A area where vehicles can park next to the road /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -123,23 +118,25 @@ lsd.myEndPos = this->getLane().getLength() - POSITION_EPS; } } - // Work out the angle of the lot relative to the lane (+90 parallels the way the bay is drawn ) - int relativeAngle = static_cast(lsd.myRotation + 90. - RAD2DEG(this->getLane().getShape().rotationAtOffset(lsd.myEndPos))); - if (relativeAngle < 0) { - relativeAngle += 360; + // Work out the angle of the lot relative to the lane (-90 adjusts for the way the bay is drawn ) + double relativeAngle = fmod(lsd.myRotation - 90., 360) - fmod(RAD2DEG(this->getLane().getShape().rotationAtOffset(lsd.myEndPos)), 360) + 0.5; + if (relativeAngle < 0.) { + relativeAngle += 360.; } + lsd.myManoeuverAngle = relativeAngle; - // use this to set the manoeuver angle - real life manoeuver will always be < 180 degrees - hence the modulus // if p2.y is -ve the lot is on LHS of lane relative to lane direction + // we need to know this because it inverts the complexity of the parking manoeuver Position p2 = this->getLane().getShape().transformToVectorCoordinates(lsd.myPosition); if (p2.y() < (0. + POSITION_EPS)) { - lsd.myManoeuverAngle = abs(relativeAngle) % 180; - } else { // lot is on RHS of lane - lsd.myManoeuverAngle = abs(abs(relativeAngle) % 180 - 180) % 180; + lsd.mySideIsLHS = true; + } else { + lsd.mySideIsLHS = false; } } else { lsd.myEndPos = myEndPos; lsd.myManoeuverAngle = int(angle); // unused unless gModelParkingManoeuver is true + lsd.mySideIsLHS = true; } @@ -152,9 +149,27 @@ MSParkingArea::getLastFreeLotAngle() const { assert(myLastFreeLot >= 0); assert(myLastFreeLot < (int)mySpaceOccupancies.size()); - return (mySpaceOccupancies[myLastFreeLot].myManoeuverAngle); + + const LotSpaceDefinition& lsd = mySpaceOccupancies[myLastFreeLot]; + if (lsd.mySideIsLHS) { + return abs(int(lsd.myManoeuverAngle)) % 180; + } else { + return abs(abs(int(lsd.myManoeuverAngle)) % 180 - 180) % 180; + } } +double +MSParkingArea::getLastFreeLotGUIAngle() const { + assert(myLastFreeLot >= 0); + assert(myLastFreeLot < (int)mySpaceOccupancies.size()); + + const LotSpaceDefinition& lsd = mySpaceOccupancies[myLastFreeLot]; + if (lsd.myManoeuverAngle > 180.) { + return DEG2RAD(lsd.myManoeuverAngle - 360.); + } else { + return DEG2RAD(lsd.myManoeuverAngle); + } +} double @@ -201,17 +216,47 @@ return 0; } +double +MSParkingArea::getGUIAngle(const SUMOVehicle& forVehicle) const { + for (const auto& lsd : mySpaceOccupancies) { + if (lsd.vehicle == &forVehicle) { + if (lsd.myManoeuverAngle > 180.) { + return DEG2RAD(lsd.myManoeuverAngle - 360.); + } else { + return DEG2RAD(lsd.myManoeuverAngle); + } + } + } + return 0.; +} + +int +MSParkingArea::getManoeuverAngle(const SUMOVehicle& forVehicle) const { + for (const auto& lsd : mySpaceOccupancies) { + if (lsd.vehicle == &forVehicle) { + if (lsd.mySideIsLHS) { + return abs(int(lsd.myManoeuverAngle)) % 180; + } else { + return abs(abs(int(lsd.myManoeuverAngle)) % 180 - 180) % 180; + } + } + } + return 0; +} + void -MSParkingArea::enter(SUMOVehicle* what, double beg, double end) { +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 = what; - myEndPositions[what] = std::pair(beg, end); + mySpaceOccupancies[myLastFreeLot].vehicle = veh; + myEndPositions[veh] = std::pair(beg, end); computeLastFreePos(); } @@ -370,4 +415,5 @@ computeLastFreePos(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSParkingArea.h sumo-1.6.0+dfsg1/src/microsim/MSParkingArea.h --- sumo-1.5.0+dfsg1/src/microsim/MSParkingArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSParkingArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A area where vehicles can park next to the road /****************************************************************************/ -#ifndef MSParkingArea_h -#define MSParkingArea_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -128,11 +122,9 @@ * Recomputes the free space using "computeLastFreePos" then. * * @param[in] what The vehicle that enters the parking area - * @param[in] beg The begin halting position of the vehicle - * @param[in] end The end halting position of the vehicle * @see computeLastFreePos */ - void enter(SUMOVehicle* what, double beg, double end); + void enter(SUMOVehicle* veh); /** @brief Called if a vehicle leaves this stop @@ -198,6 +190,25 @@ */ int getLastFreeLotAngle() const; + /** @brief Return the GUI angle of myLastFreeLot - the angle the GUI uses to rotate into the next parking lot + * as above, only expected to be called after we have established there is space in the parking area + * + * @return The GUI angle, relative to the lane, in radians + */ + double getLastFreeLotGUIAngle() const; + + /** @brief Return the manoeuver angle of the lot where the vehicle is parked + * + * @return The manoeuver angle in degrees + */ + int getManoeuverAngle(const SUMOVehicle& forVehicle) const; + + /** @brief Return the GUI angle of the lot where the vehicle is parked + * + * @return The GUI angle, relative to the lane, in radians + */ + double getGUIAngle(const SUMOVehicle& forVehicle) const; + /** @brief Add a lot entry to parking area * * @param[in] x X position of the lot center @@ -265,7 +276,9 @@ /// @brief The position along the lane that the vehicle needs to reach for entering this lot double myEndPos; ///@brief The angle between lane and lot through which a vehicle must manoeuver to enter the lot - int myManoeuverAngle; + double myManoeuverAngle; + ///@brief Whether the lot is on the LHS of the lane relative to the lane direction + bool mySideIsLHS; }; @@ -328,8 +341,3 @@ MSParkingArea& operator=(const MSParkingArea&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRightOfWayJunction.cpp sumo-1.6.0+dfsg1/src/microsim/MSRightOfWayJunction.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSRightOfWayJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRightOfWayJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // junction. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSRightOfWayJunction.h" @@ -45,9 +40,10 @@ SumoXMLNodeType type, const Position& position, const PositionVector& shape, + const std::string& name, std::vector incoming, std::vector internal, - MSJunctionLogic* logic) : MSLogicJunction(id, type, position, shape, incoming, internal), + MSJunctionLogic* logic) : MSLogicJunction(id, type, position, shape, name, incoming, internal), myLogic(logic) {} @@ -191,4 +187,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRightOfWayJunction.h sumo-1.6.0+dfsg1/src/microsim/MSRightOfWayJunction.h --- sumo-1.5.0+dfsg1/src/microsim/MSRightOfWayJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRightOfWayJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A junction with right-of-way - rules /****************************************************************************/ -#ifndef MSRightOfWayJunction_h -#define MSRightOfWayJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSLogicJunction.h" @@ -64,6 +58,7 @@ */ MSRightOfWayJunction(const std::string& id, SumoXMLNodeType type, const Position& position, const PositionVector& shape, + const std::string& name, std::vector incoming, std::vector internal, MSJunctionLogic* logic); @@ -103,9 +98,3 @@ MSRightOfWayJunction& operator=(const MSRightOfWayJunction&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRoute.cpp sumo-1.6.0+dfsg1/src/microsim/MSRoute.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSRoute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRoute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A vehicle route /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -32,7 +27,6 @@ #include #include #include -#include #include #include "MSEdge.h" #include "MSLane.h" @@ -59,6 +53,7 @@ Named(id), myEdges(edges), myAmPermanent(isPermanent), myReferenceCounter(isPermanent ? 1 : 0), myColor(c), + myPeriod(0), myCosts(-1), mySavings(0), myStops(stops) {} @@ -392,4 +387,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRoute.h sumo-1.6.0+dfsg1/src/microsim/MSRoute.h --- sumo-1.5.0+dfsg1/src/microsim/MSRoute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRoute.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A vehicle route /****************************************************************************/ -#ifndef MSRoute_h -#define MSRoute_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -49,7 +43,6 @@ // class declarations // =========================================================================== class MSEdge; -class BinaryInputDevice; class OutputDevice; @@ -153,9 +146,14 @@ */ double getDistanceBetween(double fromPos, double toPos, const MSRouteIterator& fromEdge, const MSRouteIterator& toEdge, bool includeInternal = true) const; - /// Returns the color + /// @brief Returns the color const RGBColor& getColor() const; + /// @brief returns the period + SUMOTime getPeriod() const { + return myPeriod; + } + /** @brief Returns the costs of the route * * @return The route's costs (normally the time needed to pass it) @@ -172,6 +170,11 @@ return mySavings; } + /// @brief sets the period + void setPeriod(SUMOTime period) { + myPeriod = period; + } + /** @brief Sets the costs of the route * * @param[in] costs The new route costs @@ -257,6 +260,9 @@ /// The color const RGBColor* const myColor; + /// The period when repeating this route + SUMOTime myPeriod; + /// @brief The assigned or calculated costs double myCosts; @@ -288,9 +294,3 @@ MSRoute& operator=(const MSRoute& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRouteHandler.cpp sumo-1.6.0+dfsg1/src/microsim/MSRouteHandler.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSRouteHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRouteHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Parser and container for routes during their loading /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSRouteHandler.h" @@ -54,6 +49,8 @@ // =========================================================================== MSRouteHandler::MSRouteHandler(const std::string& file, bool addVehiclesDirectly) : SUMORouteHandler(file, addVehiclesDirectly ? "" : "routes", true), + myActiveRouteRepeat(0), + myActiveRoutePeriod(0), myActivePlan(nullptr), myActiveContainerPlan(nullptr), myAddVehiclesDirectly(addVehiclesDirectly), @@ -465,6 +462,23 @@ } myActiveRouteProbability = attrs.getOpt(SUMO_ATTR_PROB, myActiveRouteID.c_str(), ok, DEFAULT_VEH_PROB); myActiveRouteColor = attrs.hasAttribute(SUMO_ATTR_COLOR) ? new RGBColor(attrs.get(SUMO_ATTR_COLOR, myActiveRouteID.c_str(), ok)) : nullptr; + myActiveRouteRepeat = attrs.getOpt(SUMO_ATTR_REPEAT, myActiveRouteID.c_str(), ok, 0); + myActiveRoutePeriod = attrs.getOptSUMOTimeReporting(SUMO_ATTR_PERIOD, myActiveRouteID.c_str(), ok, 0); + if (myActiveRouteRepeat > 0) { + if (MSGlobals::gCheckRoutes) { + SUMOVehicleClass vClass = SVC_IGNORING; + if (myVehicleParameter != nullptr) { + MSVehicleControl& vehControl = MSNet::getInstance()->getVehicleControl(); + MSVehicleType* vtype = vehControl.getVType(myVehicleParameter->vtypeid, &myParsingRNG); + if (vtype != nullptr) { + vClass = vtype->getVehicleClass(); + } + } + if (!myActiveRoute.front()->isConnectedTo(*myActiveRoute.back(), vClass)) { + WRITE_ERROR("Disconnected route " + rid + " when repeating."); + } + } + } myCurrentCosts = attrs.getOpt(SUMO_ATTR_COST, myActiveRouteID.c_str(), ok, -1); if (ok && myCurrentCosts != -1 && myCurrentCosts < 0) { WRITE_ERROR("Invalid cost for route '" + myActiveRouteID + "'."); @@ -479,6 +493,12 @@ void +MSRouteHandler::openRouteFlow(const SUMOSAXAttributes& /*attrs*/) { + // Currently unused +} + + +void MSRouteHandler::openTrip(const SUMOSAXAttributes& /*attrs*/) { // Currently unsued } @@ -519,9 +539,32 @@ if (myActiveRoute.size() == 1 && myActiveRoute.front()->isTazConnector()) { throw ProcessError("The routing information for " + type + " '" + myVehicleParameter->id + "' is insufficient."); } + if (myActiveRouteRepeat > 0) { + // duplicate route + ConstMSEdgeVector tmpEdges = myActiveRoute; + auto tmpStops = myActiveRouteStops; + for (int i = 0; i < myActiveRouteRepeat; i++) { + myActiveRoute.insert(myActiveRoute.begin(), tmpEdges.begin(), tmpEdges.end()); + for (SUMOVehicleParameter::Stop stop : tmpStops) { + if (stop.until > 0) { + if (myActiveRoutePeriod <= 0) { + if (myVehicleParameter != nullptr) { + throw ProcessError("Cannot repeat stops with 'until' in route for " + type + " '" + myVehicleParameter->id + "' because no period is defined."); + } else { + throw ProcessError("Cannot repeat stops with 'until' in route '" + myActiveRouteID + "' because no period is defined."); + } + } + stop.until += myActiveRoutePeriod * (i + 1); + stop.arrival += myActiveRoutePeriod * (i + 1); + } + myActiveRouteStops.push_back(stop); + } + } + } MSRoute* route = new MSRoute(myActiveRouteID, myActiveRoute, myVehicleParameter == nullptr || myVehicleParameter->repetitionNumber >= 1, myActiveRouteColor, myActiveRouteStops); + route->setPeriod(myActiveRoutePeriod); route->setCosts(myCurrentCosts); myActiveRoute.clear(); if (!MSRoute::dictionary(myActiveRouteID, route)) { @@ -557,12 +600,12 @@ void MSRouteHandler::openRouteDistribution(const SUMOSAXAttributes& attrs) { // check whether the id is really necessary - bool ok = true; if (myVehicleParameter != nullptr) { // ok, a vehicle is wrapping the route, // we may use this vehicle's id as default myCurrentRouteDistributionID = "!" + myVehicleParameter->id; // !!! document this } else { + bool ok = true; myCurrentRouteDistributionID = attrs.get(SUMO_ATTR_ID, nullptr, ok); if (!ok) { return; @@ -685,7 +728,7 @@ } catch (const ProcessError& e) { if (!MSGlobals::gCheckRoutes) { WRITE_WARNING(e.what()); - vehControl.deleteVehicle(nullptr, true); + vehControl.fixVehicleCounts(); myVehicleParameter = nullptr; vehicle = nullptr; return; @@ -1030,7 +1073,8 @@ // get the lane stop.lane = attrs.getOpt(SUMO_ATTR_LANE, nullptr, ok, ""); if (ok && stop.lane != "") { - if (MSLane::dictionary(stop.lane) == nullptr) { + MSLane* stopLane = MSLane::dictionary(stop.lane); + if (stopLane == nullptr || (stopLane->isInternal() && !MSGlobals::gUsingInternalLanes)) { WRITE_ERROR("The lane '" + stop.lane + "' for a stop is not known" + errorSuffix); return; } @@ -1324,4 +1368,5 @@ MSRouteHandler::addTranship(const SUMOSAXAttributes& /*attrs*/) { } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSRouteHandler.h sumo-1.6.0+dfsg1/src/microsim/MSRouteHandler.h --- sumo-1.5.0+dfsg1/src/microsim/MSRouteHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSRouteHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parser and container for routes during their loading /****************************************************************************/ -#ifndef MSRouteHandler_h -#define MSRouteHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -102,6 +96,9 @@ /// @brief opens a flow for reading void openFlow(const SUMOSAXAttributes& attrs); + /// @brief opens a route flow for reading + void openRouteFlow(const SUMOSAXAttributes& attrs); + /// @brief opens a trip for reading void openTrip(const SUMOSAXAttributes& attrs); @@ -174,6 +171,10 @@ /// @brief The current route ConstMSEdgeVector myActiveRoute; + /// @brief number of repetitions of the active route + int myActiveRouteRepeat; + SUMOTime myActiveRoutePeriod; + /// @brief The plan of the current person MSTransportable::MSTransportablePlan* myActivePlan; @@ -214,9 +215,3 @@ /// @brief Invalidated assignment operator MSRouteHandler& operator=(const MSRouteHandler& s) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSStateHandler.cpp sumo-1.6.0+dfsg1/src/microsim/MSStateHandler.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSStateHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSStateHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Parser and output filter for routes and vehicles state saving and loading /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -80,7 +75,9 @@ out.writeHeader(SUMO_TAG_SNAPSHOT); out.writeAttr("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance").writeAttr("xsi:noNamespaceSchemaLocation", "http://sumo.dlr.de/xsd/state_file.xsd"); out.writeAttr(SUMO_ATTR_VERSION, VERSION_STRING).writeAttr(SUMO_ATTR_TIME, time2string(step)); - //saveRNGs(out); + if (OptionsCont::getOptions().getBool("save-state.rng")) { + saveRNGs(out); + } MSRoute::dict_saveState(out); MSNet::getInstance()->getInsertionControl().saveState(out); MSNet::getInstance()->getVehicleControl().saveState(out); @@ -140,6 +137,12 @@ } break; } + case SUMO_TAG_RNGLANE: { + const int index = attrs.getInt(SUMO_ATTR_INDEX); + const std::string state = attrs.getString(SUMO_ATTR_STATE); + MSLane::loadRNGState(index, state); + break; + } case SUMO_TAG_DELAY: { vc.setState(attrs.getInt(SUMO_ATTR_NUMBER), attrs.getInt(SUMO_ATTR_BEGIN), @@ -286,6 +289,7 @@ out.writeAttr(SUMO_ATTR_RNG_DEVICE_BT, RandHelper::saveState(MSDevice_BTreceiver::getRNG())); out.writeAttr(SUMO_ATTR_RNG_DRIVERSTATE, RandHelper::saveState(OUProcess::getRNG())); out.writeAttr(SUMO_ATTR_RNG_DEVICE_TOC, RandHelper::saveState(MSDevice_ToC::getResponseTimeRNG())); + MSLane::saveRNGStates(out); out.closeTag(); } diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSStateHandler.h sumo-1.6.0+dfsg1/src/microsim/MSStateHandler.h --- sumo-1.5.0+dfsg1/src/microsim/MSStateHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSStateHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parser and output filter for routes and vehicles state saving and loading /****************************************************************************/ -#ifndef MSStateHandler_h -#define MSStateHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -129,8 +123,3 @@ /// @brief Invalidated assignment operator MSStateHandler& operator=(const MSStateHandler& s) = delete; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSStoppingPlace.cpp sumo-1.6.0+dfsg1/src/microsim/MSStoppingPlace.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSStoppingPlace.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSStoppingPlace.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A lane area vehicles can halt at /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -42,11 +37,13 @@ const std::vector& lines, MSLane& lane, double begPos, double endPos, const std::string name, - int capacity) : + int capacity, + double parkingLength) : Named(id), myLines(lines), myLane(lane), myBegPos(begPos), myEndPos(endPos), myLastFreePos(endPos), myName(name), - myTransportableCapacity(capacity) { + myTransportableCapacity(capacity), + myParkingFactor(parkingLength <= 0 ? 1 : (endPos - begPos) / parkingLength) { computeLastFreePos(); for (int i = 0; i < capacity; i++) { myWaitingSpots.insert(i); @@ -76,8 +73,10 @@ void -MSStoppingPlace::enter(SUMOVehicle* what, double beg, double end) { - myEndPositions[what] = std::pair(beg, end); +MSStoppingPlace::enter(SUMOVehicle* veh, bool parking) { + double beg = veh->getPositionOnLane() + veh->getVehicleType().getMinGap(); + double end = beg - veh->getVehicleType().getLengthWithGap() * (parking ? myParkingFactor : 1); + myEndPositions[veh] = std::make_pair(beg, end); computeLastFreePos(); } @@ -87,6 +86,9 @@ if (myLastFreePos != myEndPos) { const double vehGap = forVehicle.getVehicleType().getMinGap(); double pos = myLastFreePos - vehGap; + if (forVehicle.getLane() == &myLane && forVehicle.getPositionOnLane() < myEndPos && forVehicle.getPositionOnLane() > myBegPos && forVehicle.getSpeed() <= SUMO_const_haltingSpeed) { + return forVehicle.getPositionOnLane(); + } if (!fits(pos, forVehicle)) { // try to find a place ahead of the waiting vehicles const double vehLength = forVehicle.getVehicleType().getLength(); @@ -119,7 +121,7 @@ MSStoppingPlace::fits(double pos, const SUMOVehicle& veh) const { // always fit at the default position or if at least half the vehicle length // is within the stop range (debatable) - return pos + POSITION_EPS >= myEndPos || (pos - myBegPos >= veh.getVehicleType().getLength() / 2); + return pos + POSITION_EPS >= myEndPos || (pos - myBegPos >= veh.getVehicleType().getLength() * myParkingFactor / 2); } double diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSStoppingPlace.h sumo-1.6.0+dfsg1/src/microsim/MSStoppingPlace.h --- sumo-1.5.0+dfsg1/src/microsim/MSStoppingPlace.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSStoppingPlace.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A lane area vehicles can halt at /****************************************************************************/ -#ifndef MSStoppingPlace_h -#define MSStoppingPlace_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,7 +68,8 @@ MSStoppingPlace(const std::string& id, const std::vector& lines, MSLane& lane, double begPos, double endPos, const std::string name = "", - int capacity = 0); + int capacity = 0, + double parkingLength = 0); @@ -114,7 +109,7 @@ * @param[in] what The end halting position of the vehicle * @see computeLastFreePos */ - void enter(SUMOVehicle* what, double beg, double end); + void enter(SUMOVehicle* veh, bool parking); /** @brief Called if a vehicle leaves this stop @@ -240,6 +235,9 @@ /// @brief The number of transportables that can wait here const int myTransportableCapacity; + /// @brief the scaled space capacity for parking vehicles + const double myParkingFactor; + protected: /// @brief Persons waiting at this stop (mapped to waiting position) @@ -258,9 +256,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleContainer.cpp sumo-1.6.0+dfsg1/src/microsim/MSVehicleContainer.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleContainer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleContainer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // vehicles sorted by their departures /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -82,7 +77,9 @@ find_if(array.begin() + 1, array.begin() + currentSize + 1, DepartFinder(veh->getParameter().depart)); if (currentSize == 0 || i == array.begin() + currentSize + 1) { // a new heap-item is necessary - VehicleDepartureVector newElem(veh->getParameter().depart, VehicleVector()); + const SUMOTime delay = veh->getParameter().depart % DELTA_T; + const SUMOTime depart = veh->getParameter().depart + (delay == 0 ? 0 : DELTA_T - delay); + VehicleDepartureVector newElem(depart, VehicleVector()); newElem.second.push_back(veh); addReplacing(newElem); } else { @@ -147,7 +144,7 @@ bool MSVehicleContainer::anyWaitingBefore(SUMOTime time) const { - return !isEmpty() && topTime() < time; + return !isEmpty() && topTime() <= time; } @@ -251,6 +248,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleContainer.h sumo-1.6.0+dfsg1/src/microsim/MSVehicleContainer.h --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleContainer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleContainer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // vehicles sorted by their departures /****************************************************************************/ -#ifndef MSVehicleContainer_h -#define MSVehicleContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -140,9 +134,3 @@ void percolateDown(int hole); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleControl.cpp sumo-1.6.0+dfsg1/src/microsim/MSVehicleControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSVehicleControl.h" @@ -37,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -116,16 +110,23 @@ MSVehicleControl::buildVehicle(SUMOVehicleParameter* defs, const MSRoute* route, MSVehicleType* type, const bool ignoreStopErrors, const bool fromRouteFile) { - myLoadedVehNo++; MSVehicle* built = new MSVehicle(defs, route, type, type->computeChosenSpeedDeviation(fromRouteFile ? MSRouteHandler::getParsingRNG() : nullptr)); + initVehicle(built, ignoreStopErrors); + return built; +} + + +void +MSVehicleControl::initVehicle(MSBaseVehicle* built, const bool ignoreStopErrors) { + myLoadedVehNo++; try { + built->initDevices(); built->addStops(ignoreStopErrors); } catch (ProcessError&) { delete built; throw; } MSNet::getInstance()->informVehicleStateListener(built, MSNet::VEHICLE_STATE_BUILT); - return built; } diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleControl.h sumo-1.6.0+dfsg1/src/microsim/MSVehicleControl.h --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The class responsible for building and deletion of vehicles /****************************************************************************/ -#ifndef MSVehicleControl_h -#define MSVehicleControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -47,6 +41,7 @@ // =========================================================================== class SUMOVehicle; class SUMOVehicleParameter; +class MSBaseVehicle; class MSVehicle; class MSRoute; class MSVehicleType; @@ -146,6 +141,11 @@ */ virtual void deleteVehicle(SUMOVehicle* v, bool discard = false); + void fixVehicleCounts() { + myLoadedVehNo++; + myEndedVehNo++; + myDiscarded++; + } /** @brief Removes a vehicle after it has ended * @@ -521,13 +521,15 @@ bool isPendingRemoval(SUMOVehicle* veh); protected: + void initVehicle(MSBaseVehicle* built, const bool ignoreStopErrors); + +private: /// @name Vehicle statistics (always accessible) /// @{ /// @brief The number of build vehicles int myLoadedVehNo; -private: /// @brief The number of vehicles within the network (build and inserted but not removed) int myRunningVehNo; @@ -640,9 +642,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicle.cpp sumo-1.6.0+dfsg1/src/microsim/MSVehicle.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -30,10 +30,6 @@ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -47,13 +43,10 @@ #include #include #include -#include -#include #include #include #include #include -#include #include #include #include @@ -61,9 +54,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -78,7 +69,6 @@ #include "MSStoppingPlace.h" #include "MSParkingArea.h" #include "devices/MSDevice_Transportable.h" -#include "MSEdgeWeightsStorage.h" #include #include "MSMoveReminder.h" #include @@ -373,8 +363,7 @@ myRightDriveLC(LC_NOCONFLICT), mySublaneLC(LC_NOCONFLICT), myTraciLaneChangePriority(LCP_URGENT), - myTraCISignals(-1), - myRoutingMode(0) + myTraCISignals(-1) {} @@ -905,16 +894,6 @@ } -SUMOAbstractRouter& -MSVehicle::Influencer::getRouterTT(const int rngIndex) const { - if (myRoutingMode == 1) { - return MSRoutingEngine::getRouterTT(rngIndex); - } else { - return MSNet::getInstance()->getRouterTT(rngIndex); - } -} - - /* ------------------------------------------------------------------------- * Stop-methods * ----------------------------------------------------------------------- */ @@ -1002,12 +981,14 @@ myActionStep(true), myLastActionTime(0), myLane(nullptr), + myLaneChangeModel(nullptr), myLastBestLanesEdge(nullptr), myLastBestLanesInternalLane(nullptr), myAcceleration(0), - myNextTurn(0., LINKDIR_NODIR), + myNextTurn(0., LinkDirection::NODIR), mySignals(0), myAmOnNet(false), + myAmIdling(false), myAmRegisteredAsWaitingForPerson(false), myAmRegisteredAsWaitingForContainer(false), myHaveToWaitOnNextLink(false), @@ -1018,7 +999,6 @@ myJunctionEntryTime(SUMOTime_MAX), myJunctionEntryTimeNeverYield(SUMOTime_MAX), myJunctionConflictEntryTime(SUMOTime_MAX), - myEdgeWeights(nullptr), myInfluencer(nullptr) { if (!(*myCurrEdge)->isTazConnector()) { if (pars->departLaneProcedure == DEPART_LANE_GIVEN) { @@ -1035,24 +1015,23 @@ "' is too high for the vehicle type '" + type->getID() + "'."); } } - myLaneChangeModel = MSAbstractLaneChangeModel::build(type->getLaneChangeModel(), *this); myCFVariables = type->getCarFollowModel().createVehicleVariables(); - myDriverState = static_cast(getDevice(typeid(MSDevice_DriverState))); myNextDriveItem = myLFLinkLanes.begin(); } MSVehicle::~MSVehicle() { - delete myEdgeWeights; for (std::vector::iterator i = myFurtherLanes.begin(); i != myFurtherLanes.end(); ++i) { (*i)->resetPartialOccupation(this); } - removeApproachingInformation(myLFLinkLanes); - myLaneChangeModel->cleanupShadowLane(); - myLaneChangeModel->cleanupTargetLane(); - // still needed when calling resetPartialOccupation (getShadowLane) and when removing - // approach information from parallel links - delete myLaneChangeModel; + if (myLaneChangeModel != nullptr) { + removeApproachingInformation(myLFLinkLanes); + myLaneChangeModel->cleanupShadowLane(); + myLaneChangeModel->cleanupTargetLane(); + // still needed when calling resetPartialOccupation (getShadowLane) and when removing + // approach information from parallel links + delete myLaneChangeModel; + } myFurtherLanes.clear(); myFurtherLanesPosLat.clear(); // @@ -1076,6 +1055,14 @@ } +void +MSVehicle::initDevices() { + MSBaseVehicle::initDevices(); + myLaneChangeModel = MSAbstractLaneChangeModel::build(myType->getLaneChangeModel(), *this); + myDriverState = static_cast(getDevice(typeid(MSDevice_DriverState))); +} + + // ------------ interaction with the route bool MSVehicle::hasArrived() const { @@ -1089,16 +1076,14 @@ bool MSVehicle::replaceRoute(const MSRoute* newRoute, const std::string& info, bool onInit, int offset, bool addRouteStops, bool removeStops) { const ConstMSEdgeVector& edges = newRoute->getEdges(); - // assert the vehicle may continue (must not be "teleported" or whatever to another position) - if (!onInit && !newRoute->contains(*myCurrEdge)) { - return false; - } - // rebuild in-vehicle route information if (onInit) { myCurrEdge = newRoute->begin(); } else { MSRouteIterator newCurrEdge = std::find(edges.begin() + offset, edges.end(), *myCurrEdge); + if (newCurrEdge == edges.end()) { + return false; + } if (myLane->getEdge().isInternal() && ( (newCurrEdge + 1) == edges.end() || (*(newCurrEdge + 1)) != &(myLane->getOutgoingViaLanes().front().first->getEdge()))) { return false; @@ -1115,6 +1100,7 @@ calculateArrivalParams(); // save information that the vehicle was rerouted myNumberReroutes++; + myStopUntilOffset += myRoute->getPeriod(); MSNet::getInstance()->informVehicleStateListener(this, MSNet::VEHICLE_STATE_NEWROUTE, info); // if we did not drive yet it may be best to simply reassign the stops from scratch if (stopsFromScratch) { @@ -1172,7 +1158,7 @@ if (addRouteStops) { for (std::vector::const_iterator i = newRoute->getStops().begin(); i != newRoute->getStops().end(); ++i) { std::string error; - addStop(*i, error); + addStop(*i, error, myParameter->depart + myStopUntilOffset); if (error != "") { WRITE_WARNING(error); } @@ -1188,27 +1174,6 @@ } -const MSEdgeWeightsStorage& -MSVehicle::getWeightsStorage() const { - return _getWeightsStorage(); -} - - -MSEdgeWeightsStorage& -MSVehicle::getWeightsStorage() { - return _getWeightsStorage(); -} - - -MSEdgeWeightsStorage& -MSVehicle::_getWeightsStorage() const { - if (myEdgeWeights == nullptr) { - myEdgeWeights = new MSEdgeWeightsStorage(); - } - return *myEdgeWeights; -} - - // ------------ Interaction with move reminders void MSVehicle::workOnMoveReminders(double oldPos, double newPos, double newSpeed) { @@ -1237,6 +1202,21 @@ } } +void +MSVehicle::workOnIdleReminders() { + updateWaitingTime(0.); // cf issue 2233 + + // vehicle move reminders + for (MoveReminderCont::iterator rem = myMoveReminders.begin(); rem != myMoveReminders.end();) { + rem->first->notifyIdle(*this); + ++rem; + } + + // lane move reminders - for aggregated values + for (MSMoveReminder* rem : getLane()->getMoveReminders()) { + rem->notifyIdle(*this); + } +} // XXX: consider renaming... void @@ -1446,6 +1426,13 @@ MSVehicle::computeAngle() const { Position p1; const double posLat = -myState.myPosLat; // @todo get rid of the '-' + const double lefthandSign = (MSGlobals::gLefthand ? -1 : 1); + + // if parking manoeuvre is happening then rotate vehicle on each step + if (MSGlobals::gModelParkingManoeuver && !manoeuvreIsComplete()) { + return getAngle() + myManoeuvre.getGUIIncrement(); + } + if (isParking()) { if (myStops.begin()->parkingarea != nullptr) { return myStops.begin()->parkingarea->getVehicleAngle(*this); @@ -1455,7 +1442,7 @@ } if (getLaneChangeModel().isChangingLanes()) { // cannot use getPosition() because it already includes the offset to the side and thus messes up the angle - p1 = myLane->geometryPositionAtOffset(myState.myPos, posLat); + p1 = myLane->geometryPositionAtOffset(myState.myPos, lefthandSign * posLat); } else { p1 = getPosition(); } @@ -1476,7 +1463,7 @@ double result = (p1 != p2 ? p2.angleTo2D(p1) : myLane->getShape().rotationAtOffset(myLane->interpolateLanePosToGeometryPos(getPositionOnLane()))); if (getLaneChangeModel().isChangingLanes()) { - result += DEG2RAD(getLaneChangeModel().getAngleOffset()); + result += lefthandSign * DEG2RAD(getLaneChangeModel().getAngleOffset()); } #ifdef DEBUG_FURTHER if (DEBUG_COND) { @@ -1538,6 +1525,9 @@ // !!! it would be much cleaner to invent a constructor for stops which takes "until" as an argument const_cast(stop.pars).until += untilOffset; } + if (stopPar.arrival != -1) { + const_cast(stop.pars).arrival += untilOffset; + } stop.collision = collision; stop.numExpectedPerson = (int)stopPar.awaitedPersons.size(); stop.numExpectedContainer = (int)stopPar.awaitedContainers.size(); @@ -1764,8 +1754,8 @@ bool MSVehicle::keepStopping(bool afterProcessing) const { if (isStopped()) { - // after calling processNextStop, DELTA_T has already been subtracted from the duration - return (myStops.front().duration + (afterProcessing ? DELTA_T : 0) > 0 || isStoppedTriggered() || myStops.front().collision + // when coming out of vehicleTransfer we must shift the time forward + return (myStops.front().duration - (afterProcessing ? DELTA_T : 0) > 0 || isStoppedTriggered() || myStops.front().collision || (myStops.front().pars.speed > 0 && myState.myPos < myStops.front().pars.endPos)); } else { return false; @@ -1835,6 +1825,7 @@ Stop& stop = myStops.front(); const SUMOTime time = MSNet::getInstance()->getCurrentTimeStep(); if (stop.reached) { + stop.duration -= getActionStepLength(); #ifdef DEBUG_STOPS if (DEBUG_COND) { @@ -1842,64 +1833,10 @@ << "Remaining duration: " << STEPS2TIME(stop.duration) << std::endl; } #endif - // ok, we have already reached the next stop - // any waiting persons may board now - MSNet* const net = MSNet::getInstance(); - const bool boarded = (time <= stop.endBoarding - && net->hasPersons() - && net->getPersonControl().boardAnyWaiting(&myLane->getEdge(), this, stop.pars, stop.timeToBoardNextPerson, stop.duration) - && stop.numExpectedPerson == 0); - // load containers - const bool loaded = (time <= stop.endBoarding - && net->hasContainers() - && net->getContainerControl().loadAnyWaiting(&myLane->getEdge(), this, stop.pars, stop.timeToLoadNextContainer, stop.duration) - && stop.numExpectedContainer == 0); - if (time > stop.endBoarding) { - stop.triggered = false; - stop.containerTriggered = false; - } - if (boarded) { - if (stop.busstop != nullptr) { - const std::vector& persons = myPersonDevice->getTransportables(); - for (std::vector::const_iterator i = persons.begin(); i != persons.end(); ++i) { - stop.busstop->removeTransportable(*i); - } - } - // the triggering condition has been fulfilled. Maybe we want to wait a bit longer for additional riders (car pooling) - stop.triggered = false; - if (myAmRegisteredAsWaitingForPerson) { - MSNet::getInstance()->getVehicleControl().unregisterOneWaiting(true); - myAmRegisteredAsWaitingForPerson = false; -#ifdef DEBUG_STOPS - if (DEBUG_COND) { - std::cout << SIMTIME << " vehicle '" << getID() << "' unregisters as waiting for person." << std::endl; - } -#endif - } - } - if (loaded) { - if (stop.containerstop != nullptr) { - const std::vector& containers = myContainerDevice->getTransportables(); - for (std::vector::const_iterator i = containers.begin(); i != containers.end(); ++i) { - stop.containerstop->removeTransportable(*i); - } - } - // the triggering condition has been fulfilled - stop.containerTriggered = false; - if (myAmRegisteredAsWaitingForContainer) { - MSNet::getInstance()->getVehicleControl().unregisterOneWaiting(false); - myAmRegisteredAsWaitingForContainer = false; -#ifdef DEBUG_STOPS - if (DEBUG_COND) { - std::cout << SIMTIME << " vehicle '" << getID() << "' unregisters as waiting for container." << std::endl; - } -#endif - } - } if (stop.duration <= 0 && stop.pars.join != "") { // join this train (part) to another one MSVehicle* joinVeh = dynamic_cast(MSNet::getInstance()->getVehicleControl().getVehicle(stop.pars.join)); - if (joinVeh && joinVeh->joinTrainPart(this)) { + if (joinVeh && (joinVeh->joinTrainPart(this) || joinVeh->joinTrainPartFront(this))) { stop.joinTriggered = false; // avoid collision warning before this vehicle is removed (joinVeh was already made longer) myCollisionImmunity = TIME2STEPS(100); @@ -1915,6 +1852,8 @@ #endif resumeFromStopping(); } else { + boardTransportables(stop); + if (stop.triggered && !myAmRegisteredAsWaitingForPerson) { if (getVehicleType().getPersonCapacity() == getPersonNumber()) { WRITE_WARNING("Vehicle '" + getID() + "' ignores triggered stop on lane '" + stop.lane->getID() + "' due to capacity constraints."); @@ -1943,9 +1882,6 @@ } #endif } - // we have to wait some more time - stop.duration -= getActionStepLength(); - if (MSGlobals::gSemiImplicitEulerUpdate || stop.pars.speed > 0) { // euler return stop.pars.speed; @@ -2030,15 +1966,15 @@ } if (stop.busstop != nullptr) { // let the bus stop know the vehicle - stop.busstop->enter(this, myState.pos() + getVehicleType().getMinGap(), myState.pos() - myType->getLength()); + stop.busstop->enter(this, stop.pars.parking); } if (stop.containerstop != nullptr) { // let the container stop know the vehicle - stop.containerstop->enter(this, myState.pos() + getVehicleType().getMinGap(), myState.pos() - myType->getLength()); + stop.containerstop->enter(this, stop.pars.parking); } if (stop.parkingarea != nullptr) { // let the parking area know the vehicle - stop.parkingarea->enter(this, myState.pos() + getVehicleType().getMinGap(), myState.pos() - myType->getLength()); + stop.parkingarea->enter(this); } if (stop.pars.tripId != "") { @@ -2062,19 +1998,80 @@ } } + boardTransportables(stop); } } } return currentVelocity; } + +void +MSVehicle::boardTransportables(Stop& stop) { + // we have reached the stop + // any waiting persons may board now + const SUMOTime time = MSNet::getInstance()->getCurrentTimeStep(); + MSNet* const net = MSNet::getInstance(); + const bool boarded = (time <= stop.endBoarding + && net->hasPersons() + && net->getPersonControl().boardAnyWaiting(&myLane->getEdge(), this, stop.pars, stop.timeToBoardNextPerson, stop.duration) + && stop.numExpectedPerson == 0); + // load containers + const bool loaded = (time <= stop.endBoarding + && net->hasContainers() + && net->getContainerControl().loadAnyWaiting(&myLane->getEdge(), this, stop.pars, stop.timeToLoadNextContainer, stop.duration) + && stop.numExpectedContainer == 0); + if (time > stop.endBoarding) { + stop.triggered = false; + stop.containerTriggered = false; + } + if (boarded) { + if (stop.busstop != nullptr) { + const std::vector& persons = myPersonDevice->getTransportables(); + for (std::vector::const_iterator i = persons.begin(); i != persons.end(); ++i) { + stop.busstop->removeTransportable(*i); + } + } + // the triggering condition has been fulfilled. Maybe we want to wait a bit longer for additional riders (car pooling) + stop.triggered = false; + if (myAmRegisteredAsWaitingForPerson) { + MSNet::getInstance()->getVehicleControl().unregisterOneWaiting(true); + myAmRegisteredAsWaitingForPerson = false; +#ifdef DEBUG_STOPS + if (DEBUG_COND) { + std::cout << SIMTIME << " vehicle '" << getID() << "' unregisters as waiting for person." << std::endl; + } +#endif + } + } + if (loaded) { + if (stop.containerstop != nullptr) { + const std::vector& containers = myContainerDevice->getTransportables(); + for (std::vector::const_iterator i = containers.begin(); i != containers.end(); ++i) { + stop.containerstop->removeTransportable(*i); + } + } + // the triggering condition has been fulfilled + stop.containerTriggered = false; + if (myAmRegisteredAsWaitingForContainer) { + MSNet::getInstance()->getVehicleControl().unregisterOneWaiting(false); + myAmRegisteredAsWaitingForContainer = false; +#ifdef DEBUG_STOPS + if (DEBUG_COND) { + std::cout << SIMTIME << " vehicle '" << getID() << "' unregisters as waiting for container." << std::endl; + } +#endif + } + } +} + bool MSVehicle::joinTrainPart(MSVehicle* veh) { // check if veh is close enough to be joined MSLane* backLane = myFurtherLanes.size() == 0 ? myLane : myFurtherLanes.back(); double gap = getBackPositionOnLane() - veh->getPositionOnLane(); if (isStopped() && myStops.begin()->joinTriggered && backLane == veh->getLane() - && gap >= 0 && gap < 5) { + && gap >= 0 && gap <= getVehicleType().getMinGap() + 1) { const double newLength = myType->getLength() + veh->getVehicleType().getLength(); getSingularType().setLength(newLength); myStops.begin()->joinTriggered = false; @@ -2084,6 +2081,44 @@ } } + +bool +MSVehicle::joinTrainPartFront(MSVehicle* veh) { + // check if veh is close enough to be joined + MSLane* backLane = veh->myFurtherLanes.size() == 0 ? veh->myLane : veh->myFurtherLanes.back(); + double gap = veh->getBackPositionOnLane() - getPositionOnLane(); + if (isStopped() && myStops.begin()->joinTriggered && backLane == getLane() + && gap >= 0 && gap <= getVehicleType().getMinGap() + 1) { + if (veh->myFurtherLanes.size() > 0) { + // this vehicle must be moved to the lane of veh + // ensure that lane and furtherLanes of veh match our route + int routeIndex = getRoutePosition(); + if (myLane->isInternal()) { + routeIndex++; + } + for (int i = (int)veh->myFurtherLanes.size() - 1; i >= 0; i--) { + MSEdge* edge = &veh->myFurtherLanes[i]->getEdge(); + if (!edge->isInternal() && edge != myRoute->getEdges()[routeIndex]) { + WRITE_WARNING("Cannot join vehicle '" + veh->getID() + " to vehicle '" + getID() + + "' due to incompatible routes. time=" + time2string(MSNet::getInstance()->getCurrentTimeStep())); + return false; + } + } + for (int i = (int)veh->myFurtherLanes.size() - 2; i >= 0; i--) { + enterLaneAtMove(veh->myFurtherLanes[i]); + } + } + const double newLength = myType->getLength() + veh->getVehicleType().getLength(); + getSingularType().setLength(newLength); + assert(myLane == veh->getLane()); + myState.myPos = veh->getPositionOnLane(); + myStops.begin()->joinTriggered = false; + return true; + } else { + return false; + } +} + const ConstMSEdgeVector MSVehicle::getStopEdges(double& firstPos, double& lastPos) const { assert(haveValidStopEdges()); @@ -2283,6 +2318,11 @@ // speed limits must hold for the whole length of the train for (MSLane* l : myFurtherLanes) { laneMaxV = MIN2(laneMaxV, l->getVehicleMaxSpeed(this)); +#ifdef DEBUG_PLAN_MOVE + if (DEBUG_COND) { + std::cout << " laneMaxV=" << laneMaxV << " lane=" << l->getID() << "\n"; + } +#endif } } // speed limits are not emergencies (e.g. when the limit changes suddenly due to TraCI or a variableSpeedSignal) @@ -2300,8 +2340,23 @@ if (myInfluencer != nullptr) { const double vMin = MAX2(0., cfModel.minNextSpeed(myState.mySpeed, this)); +#ifdef DEBUG_TRACI + if (DEBUG_COND) { + std::cout << SIMTIME << " veh=" << getID() << " speedBeforeTraci=" << v; + } +#endif v = myInfluencer->influenceSpeed(MSNet::getInstance()->getCurrentTimeStep(), v, v, vMin, maxV); +#ifdef DEBUG_TRACI + if (DEBUG_COND) { + std::cout << " influencedSpeed=" << v; + } +#endif v = myInfluencer->gapControlSpeed(MSNet::getInstance()->getCurrentTimeStep(), this, v, v, vMin, maxV); +#ifdef DEBUG_TRACI + if (DEBUG_COND) { + std::cout << " gapControlSpeed=" << v << "\n"; + } +#endif } // all links within dist are taken into account (potentially) const double dist = SPEED2DIST(maxV) + cfModel.brakeGap(maxV); @@ -2317,7 +2372,7 @@ // the distance already "seen"; in the following always up to the end of the current "lane" double seen = opposite ? myState.myPos : myLane->getLength() - myState.myPos; myNextTurn.first = seen; - myNextTurn.second = LINKDIR_NODIR; + myNextTurn.second = LinkDirection::NODIR; bool encounteredTurn = (MSGlobals::gLateralResolution <= 0); // next turn is only needed for sublane double seenNonInternal = 0; double seenInternal = myLane->isInternal() ? seen : 0; @@ -2458,8 +2513,8 @@ if (!lane->isLinkEnd(link) && lane->getLinkCont().size() > 1) { LinkDirection linkDir = (*link)->getDirection(); switch (linkDir) { - case LINKDIR_STRAIGHT: - case LINKDIR_NODIR: + case LinkDirection::STRAIGHT: + case LinkDirection::NODIR: break; default: myNextTurn.first = seen; @@ -2568,23 +2623,27 @@ } #endif // check for train direction reversal - if (canReverse(laneMaxV)) { - // reverse as soon as comfortably possible but also prevent running into a buffer stop - const double vReverse = MIN2( - cfModel.stopSpeed(this, getSpeed(), seen - POSITION_EPS), - vMinComfortable); -#ifdef DEBUG_REVERSE_BIDI - if (DEBUG_COND) { - std::cout << SIMTIME << " seen=" << seen << " vReverse=" << vReverse << "\n"; - } -#endif - lfLinks.push_back(DriveProcessItem(*link, vReverse, vReverse, false, t, 0, t, 0, seen)); + if ((getVClass() & SVC_RAIL_CLASSES) != 0 + && !lane->isInternal() + && lane->getBidiLane() != nullptr + && (*link)->getLane()->getBidiLane() == lane) { + double vMustReverse = getCarFollowModel().stopSpeed(this, getSpeed(), seen - POSITION_EPS); + v = MIN2(v, vMustReverse); } + bool canReverseEventually = false; + const double vReverse = checkReversal(canReverseEventually, laneMaxV, seen); + v = MIN2(v, vReverse); +#ifdef DEBUG_PLAN_MOVE + if (DEBUG_COND) { + std::cout << SIMTIME << " veh=" << getID() << " canReverseEventually=" << canReverseEventually << " v=" << v << "\n"; + } +#endif + // check whether we need to slow down in order to finish a continuous lane change if (getLaneChangeModel().isChangingLanes()) { if ( // slow down to finish lane change before a turn lane - ((*link)->getDirection() == LINKDIR_LEFT || (*link)->getDirection() == LINKDIR_RIGHT) || + ((*link)->getDirection() == LinkDirection::LEFT || (*link)->getDirection() == LinkDirection::RIGHT) || // slow down to finish lane change before the shadow lane ends (getLaneChangeModel().getShadowLane() != nullptr && (*link)->getViaLaneOrLane()->getParallelLane(getLaneChangeModel().getShadowDirection()) == nullptr)) { @@ -2635,7 +2694,7 @@ // TODO: Consider option on the CFModel side to allow red/yellow light violation - if (yellowOrRed && canBrakeBeforeStopLine && !ignoreRed(*link, canBrakeBeforeStopLine)) { + if (yellowOrRed && canBrakeBeforeStopLine && !ignoreRed(*link, canBrakeBeforeStopLine) && !canReverseEventually) { if (lane->isInternal()) { checkLinkLeaderCurrentAndParallel(*link, lane, seen, lastLink, v, vLinkPass, vLinkWait, setRequest); } @@ -2712,7 +2771,7 @@ } //std::cout << " blockerLink=" << blocker.second << " link=" << *link << "\n"; if (blocker.second == *link) { - const double threshold = (*link)->getDirection() == LINKDIR_STRAIGHT ? 0.25 : 0.75; + const double threshold = (*link)->getDirection() == LinkDirection::STRAIGHT ? 0.25 : 0.75; if (RandHelper::rand(getRNG()) < threshold) { //std::cout << " abort request, threshold=" << threshold << "\n"; setRequest = false; @@ -3578,7 +3637,7 @@ void MSVehicle::updateWaitingTime(double vNext) { - if (vNext <= SUMO_const_haltingSpeed && !isStopped()) { + if (vNext <= SUMO_const_haltingSpeed && (!isStopped() || isIdling())) { // cf issue 2233 myWaitingTime += DELTA_T; myWaitingTimeCollector.passTime(DELTA_T, true); } else { @@ -3600,10 +3659,10 @@ } -bool -MSVehicle::canReverse(double speedThreshold) const { +double +MSVehicle::checkReversal(bool& canReverse, double speedThreshold, double seen) const { #ifdef DEBUG_REVERSE_BIDI - if (DEBUG_COND) std::cout << SIMTIME << " canReverse lane=" << myLane->getID() + if (DEBUG_COND) std::cout << SIMTIME << " checkReversal lane=" << myLane->getID() << " pos=" << myState.myPos << " speed=" << std::setprecision(6) << getPreviousSpeed() << std::setprecision(gPrecision) << " speedThreshold=" << speedThreshold @@ -3626,31 +3685,102 @@ && (myStops.empty() || myStops.front().edge != myCurrEdge) ) { //if (isSelected()) std::cout << " check1 passed\n"; + // ensure that the vehicle is fully on bidi edges that allow reversal if ((int)(myRoute->end() - myCurrEdge) <= (int)myFurtherLanes.size()) { - return false; +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " fail: remainingEdges=" << ((int)(myRoute->end() - myCurrEdge)) << " further=" << myFurtherLanes.size() << "\n"; + } +#endif + return getVehicleType().getMaxSpeed(); } //if (isSelected()) std::cout << " check2 passed\n"; + // ensure that the turn-around connection exists from the current edge to it's bidi-edge const MSEdgeVector& succ = myLane->getEdge().getSuccessors(); if (std::find(succ.begin(), succ.end(), myLane->getEdge().getBidiEdge()) == succ.end()) { - return false; +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " noTurn (bidi=" << myLane->getEdge().getBidiEdge()->getID() << " succ=" << toString(succ) << "\n"; + } +#endif + return getVehicleType().getMaxSpeed(); } - //if (isSelected()) std::cout << " check3 passed\n"; + + // ensure that the vehicle front will not move past a stop on the bidi edge of the current edge + if (!myStops.empty() && myStops.front().edge == (myCurrEdge + 1)) { + const double stopPos = myStops.front().getEndPos(*this); + const double brakeDist = getCarFollowModel().brakeGap(getSpeed(), getCarFollowModel().getMaxDecel(), 0); + const double newPos = myLane->getLength() - (getBackPositionOnLane() + brakeDist); + if (newPos > stopPos) { +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " reversal would go past stop on " << myLane->getBidiLane()->getID() << "\n"; + } +#endif + if (seen > MAX2(brakeDist, 1.0)) { + return getVehicleType().getMaxSpeed(); + } else { +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " train is too long, skipping stop at " << stopPos << " cannot be avoided\n"; + } +#endif + } + } + } + //if (isSelected()) std::cout << " check4 passed\n"; + + // ensure that bidi-edges exist for all further edges and that no stops will be skipped when reversing int view = 2; for (MSLane* further : myFurtherLanes) { if (!further->getEdge().isInternal()) { - if (further->getEdge().getBidiEdge() != *(myCurrEdge + view) - || (!myStops.empty() && myStops.front().edge == (myCurrEdge + view))) { - return false; + if (further->getEdge().getBidiEdge() != *(myCurrEdge + view)) { +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " noBidi view=" << view << " further=" << further->getID() << " furtherBidi=" << Named::getIDSecure(further->getEdge().getBidiEdge()) << " future=" << (*(myCurrEdge + view))->getID() << "\n"; + } +#endif + return getVehicleType().getMaxSpeed(); + } + if (!myStops.empty() && myStops.front().edge == (myCurrEdge + view)) { + const double brakeDist = getCarFollowModel().brakeGap(getSpeed(), getCarFollowModel().getMaxDecel(), 0); + const double stopPos = myStops.front().getEndPos(*this); + const double newPos = further->getLength() - (getBackPositionOnLane(further) + brakeDist); + if (newPos > stopPos) { +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " reversal would go past stop on further-opposite lane " << further->getBidiLane()->getID() << "\n"; + } +#endif + if (seen > MAX2(brakeDist, 1.0)) { + canReverse = false; + return getVehicleType().getMaxSpeed(); + } else { +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << " train is too long, skipping stop at " << stopPos << " cannot be avoided\n"; + } +#endif + } + } } view++; } } - return true; + // reverse as soon as comfortably possible + const double vMinComfortable = getCarFollowModel().minNextSpeed(getSpeed(), this); +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << SIMTIME << " seen=" << seen << " vReverseOK=" << vMinComfortable << "\n"; + } +#endif + canReverse = true; + return vMinComfortable; } - return false; + return getVehicleType().getMaxSpeed(); } @@ -3663,10 +3793,17 @@ passedLanes.push_back(myLane); } // let trains reverse direction - const bool reverseTrain = canReverse(); + bool reverseTrain = false; + checkReversal(reverseTrain); if (reverseTrain) { - myState.myPos += 2 * (myLane->getLength() - myState.myPos) + myType->getLength(); + // add some slack to ensure that the back of train does appear looped + myState.myPos += 2 * (myLane->getLength() - myState.myPos) + myType->getLength() + NUMERICAL_EPS; myState.mySpeed = 0; +#ifdef DEBUG_REVERSE_BIDI + if (DEBUG_COND) { + std::cout << SIMTIME << " reversing train=" << getID() << " newPos=" << myState.myPos << "\n"; + } +#endif } // move on lane(s) if (myState.myPos > myLane->getLength()) { @@ -3688,10 +3825,19 @@ MSNet::getInstance()->getEdgeControl().checkCollisionForInactive(approachedLane); } if (link != nullptr) { + if ((getVClass() & SVC_RAIL_CLASSES) != 0 + && !myLane->isInternal() + && myLane->getBidiLane() != nullptr + && link->getLane()->getBidiLane() == myLane + && !reverseTrain) { + emergencyReason = " because it must reverse direction"; + approachedLane = nullptr; + break; + } approachedLane = link->getViaLaneOrLane(); if (myInfluencer == nullptr || myInfluencer->getEmergencyBrakeRedLight()) { bool beyondStopLine = linkDist < link->getLaneBefore()->getStopOffset(this); - if (link->haveRed() && !ignoreRed(link, false) && !beyondStopLine) { + if (link->haveRed() && !ignoreRed(link, false) && !beyondStopLine && !reverseTrain) { emergencyReason = " because of a red traffic light"; break; } @@ -3702,12 +3848,10 @@ myState.myPos = myLane->getLength(); } else if (reverseTrain) { approachedLane = (*(myCurrEdge + 1))->getLanes()[0]; - if (MSGlobals::gUsingInternalLanes) { - link = MSLinkContHelper::getConnectingLink(*myLane, *approachedLane); - assert(link != 0); - while (link->getViaLane() != nullptr) { - link = link->getViaLane()->getLinkCont()[0]; - } + link = MSLinkContHelper::getConnectingLink(*myLane, *approachedLane); + assert(link != 0); + while (link->getViaLane() != nullptr) { + link = link->getViaLane()->getLinkCont()[0]; } --myNextDriveItem; } else { @@ -3747,7 +3891,7 @@ break; } if (getLaneChangeModel().isChangingLanes()) { - if (link->getDirection() == LINKDIR_LEFT || link->getDirection() == LINKDIR_RIGHT) { + if (link->getDirection() == LinkDirection::LEFT || link->getDirection() == LinkDirection::RIGHT) { // abort lane change WRITE_WARNING("Vehicle '" + getID() + "' could not finish continuous lane change (turn lane) time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); @@ -3756,7 +3900,7 @@ } moved = true; if (approachedLane->getEdge().isVaporizing()) { - leaveLane(MSMoveReminder::NOTIFICATION_VAPORIZED); + leaveLane(MSMoveReminder::NOTIFICATION_VAPORIZED_VAPORIZER); break; } passedLanes.push_back(approachedLane); @@ -3985,6 +4129,23 @@ return moved; } +void +MSVehicle::executeFractionalMove(double dist) { + //std::cout << SIMTIME << " veh=" << getID() << " executeFractionalMove dist=" << dist << "\n"; + myState.myPos += dist; + myState.myLastCoveredDist = dist; + myCachedPosition = Position::INVALID; + + // minimum execute move: + std::vector passedLanes; + // Whether the vehicle did move to another lane + bool moved = false; + // Reason for a possible emergency stop + std::string emergencyReason = " for unknown reasons"; + processLaneAdvances(passedLanes, moved, emergencyReason); + workOnMoveReminders(myState.myPos - myState.myLastCoveredDist, myState.myPos, myState.mySpeed); +} + void MSVehicle::updateState(double vNext) { @@ -4665,7 +4826,10 @@ MSLane* clane = enteredLane; while (leftLength > 0) { clane = clane->getLogicalPredecessorLane(); - if (clane == nullptr || clane == myLane || clane == myLane->getBidiLane()) { + if (clane == nullptr || clane == myLane || clane == myLane->getBidiLane() + || (clane->isInternal() && ( + clane->getLinkCont()[0]->getDirection() == LinkDirection::TURN + || clane->getLinkCont()[0]->getDirection() == LinkDirection::TURN_LEFTHAND))) { break; } myFurtherLanes.push_back(clane); @@ -4903,6 +5067,7 @@ int seen = 0; double seenLength = 0; bool progress = true; + const double maxBrakeDist = getCarFollowModel().brakeGap(getMaxSpeed()) + getVehicleType().getMinGap(); for (MSRouteIterator ce = myCurrEdge; progress;) { std::vector currentLanes; const std::vector* allowed = nullptr; @@ -4946,8 +5111,8 @@ ++seen; seenLength += currentLanes[0].lane->getLength(); ++ce; - progress &= (seen <= 4 || seenLength < 3000); // motorway - progress &= (seen <= 8 || seenLength < 200); // urban + progress &= (seen <= 4 || seenLength < MAX2(maxBrakeDist, 3000.0)); // motorway + progress &= (seen <= 8 || seenLength < MAX2(maxBrakeDist, 200.0)); // urban progress &= ce != myRoute->end(); /* if(progress) { @@ -5217,8 +5382,8 @@ continue; } } else if (routeIt != myRoute->end()) { // bestLanes didn't get us far enough - // choose right-most lane as default - l = (*routeIt)->getLanes().front(); + // choose left-most lane as default (avoid sidewalks, bike lanes etc) + l = (*routeIt)->getLanes().back(); ++routeIt; } else { // the search distance goes beyond our route break; @@ -5263,8 +5428,8 @@ } while (distance > 0.) { - // choose right-most lane as default - MSLane* l = (*routeIt)->getLanes().front(); + // choose left-most lane as default (avoid sidewalks, bike lanes etc) + MSLane* l = (*routeIt)->getLanes().back(); // insert internal lanes if applicable const MSEdge* internalEdge = lanes.size() > 0 ? (*routeIt)->getInternalFollowingEdge(&(lanes.back()->getEdge())) : nullptr; @@ -5381,78 +5546,6 @@ } -double -MSVehicle::getCO2Emissions() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::CO2, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getCOEmissions() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::CO, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getHCEmissions() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::HC, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getNOxEmissions() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::NO_X, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getPMxEmissions() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::PM_X, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getFuelConsumption() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::FUEL, myState.speed(), myAcceleration, getSlope()); -} - - -double -MSVehicle::getElectricityConsumption() const { - return PollutantsInterface::compute(myType->getEmissionClass(), PollutantsInterface::ELEC, myState.speed(), myAcceleration, getSlope()); -} - -double -MSVehicle::getStateOfCharge() const { - if (static_cast(getDevice(typeid(MSDevice_Battery))) != 0) { - MSDevice_Battery* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_Battery))); - return batteryOfVehicle->getActualBatteryCapacity(); - } else { - if (static_cast(getDevice(typeid(MSDevice_ElecHybrid))) != 0) { - MSDevice_ElecHybrid* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_ElecHybrid))); - return batteryOfVehicle->getActualBatteryCapacity(); - } - } - - return -1; -} - -double -MSVehicle::getElecHybridCurrent() const { - if (static_cast(getDevice(typeid(MSDevice_ElecHybrid))) != 0) { - MSDevice_ElecHybrid* batteryOfVehicle = dynamic_cast(getDevice(typeid(MSDevice_ElecHybrid))); - return batteryOfVehicle->getCurrentFromOverheadWire(); - } - - return NAN; -} - -double -MSVehicle::getHarmonoise_NoiseEmissions() const { - return HelpersHarmonoise::computeNoise(myType->getEmissionClass(), myState.speed(), myAcceleration); -} - - void MSVehicle::addTransportable(MSTransportable* transportable) { MSBaseVehicle::addTransportable(transportable); @@ -5498,13 +5591,13 @@ MSLinkCont::const_iterator link = MSLane::succLinkSec(*this, 1, *lane, getBestLanesContinuation()); if (link != lane->getLinkCont().end() && lane->getLength() - getPositionOnLane() < lane->getVehicleMaxSpeed(this) * (double) 7.) { switch ((*link)->getDirection()) { - case LINKDIR_TURN: - case LINKDIR_LEFT: - case LINKDIR_PARTLEFT: + case LinkDirection::TURN: + case LinkDirection::LEFT: + case LinkDirection::PARTLEFT: switchOnSignal(VEH_SIGNAL_BLINKER_LEFT); break; - case LINKDIR_RIGHT: - case LINKDIR_PARTRIGHT: + case LinkDirection::RIGHT: + case LinkDirection::PARTRIGHT: switchOnSignal(VEH_SIGNAL_BLINKER_RIGHT); break; default: @@ -5898,7 +5991,7 @@ } const MSEdge* newEdge = &(newParkingArea->getLane().getEdge()); - SUMOAbstractRouter& router = getInfluencer().getRouterTT(getRNGIndex()); + SUMOAbstractRouter& router = getInfluencer().getRouterTT(getRNGIndex(), getVClass()); // Compute the route from the current edge to the parking area edge ConstMSEdgeVector edgesToPark; @@ -6142,6 +6235,14 @@ return myStops.front(); } +const SUMOVehicleParameter::Stop* +MSVehicle::getNextStopParameter() const { + if (hasStops()) { + return &myStops.front().pars; + } + return nullptr; +} + void MSVehicle::abortNextStop() { if (hasStops()) { @@ -6153,10 +6254,6 @@ } } -std::list -MSVehicle::getMyStops() { - return myStops; -} MSVehicle::Influencer& MSVehicle::getInfluencer() { @@ -6166,12 +6263,22 @@ return *myInfluencer; } +MSVehicle::BaseInfluencer& +MSVehicle::getBaseInfluencer() { + return getInfluencer(); +} + const MSVehicle::Influencer* MSVehicle::getInfluencer() const { return myInfluencer; } +const MSVehicle::BaseInfluencer* +MSVehicle::getBaseInfluencer() const { + return myInfluencer; +} + double MSVehicle::getSpeedWithoutTraciInfluence() const { @@ -6359,7 +6466,8 @@ // leader was on the junction first #ifdef DEBUG_PLAN_MOVE_LEADERINFO if (DEBUG_COND) { - std::cout << " egoET=" << egoET << " foeET=" << foeET << " isLeader=" << (egoET > foeET) << "\n"; + std::cout << SIMTIME << " veh=" << getID() << " egoET " << egoET << " with foe " << veh->getID() + << " foeET=" << foeET << " isLeader=" << (egoET > foeET) << "\n"; } #endif return egoET > foeET; @@ -6414,6 +6522,9 @@ if (hasDeparted()) { myCurrEdge += routeOffset; myDeparture -= offset; + // fix stops + myStops.clear(); + addStops(!MSGlobals::gCheckRoutes, &myCurrEdge); } myState.myPos = attrs.getFloat(SUMO_ATTR_POSITION); myState.mySpeed = attrs.getFloat(SUMO_ATTR_SPEED); @@ -6492,14 +6603,14 @@ * methods of MSVehicle::manoeuvre * ----------------------------------------------------------------------- */ -MSVehicle::Manoeuvre::Manoeuvre() : myManoeuvreStop(""), myManoeuvreStartTime(0), myManoeuvreCompleteTime(0), myManoeuvreType(MSVehicle::MANOEUVRE_NONE), myManoeuvreAngle(0) {} +MSVehicle::Manoeuvre::Manoeuvre() : myManoeuvreStop(""), myManoeuvreStartTime(0), myManoeuvreCompleteTime(0), myManoeuvreType(MSVehicle::MANOEUVRE_NONE), myGUIIncrement(0) {} MSVehicle::Manoeuvre::Manoeuvre(const Manoeuvre& manoeuvre) { myManoeuvreStop = manoeuvre.myManoeuvreStop; myManoeuvreStartTime = manoeuvre.myManoeuvreStartTime; myManoeuvreCompleteTime = manoeuvre.myManoeuvreCompleteTime; myManoeuvreType = manoeuvre.myManoeuvreType; - myManoeuvreAngle = manoeuvre.myManoeuvreAngle; + myGUIIncrement = manoeuvre.myGUIIncrement; } MSVehicle::Manoeuvre& @@ -6508,7 +6619,7 @@ myManoeuvreStartTime = manoeuvre.myManoeuvreStartTime; myManoeuvreCompleteTime = manoeuvre.myManoeuvreCompleteTime; myManoeuvreType = manoeuvre.myManoeuvreType; - myManoeuvreAngle = manoeuvre.myManoeuvreAngle; + myGUIIncrement = manoeuvre.myGUIIncrement; return *this; } @@ -6518,13 +6629,13 @@ myManoeuvreStartTime != manoeuvre.myManoeuvreStartTime || myManoeuvreCompleteTime != manoeuvre.myManoeuvreCompleteTime || myManoeuvreType != manoeuvre.myManoeuvreType || - myManoeuvreAngle != manoeuvre.myManoeuvreAngle + myGUIIncrement != manoeuvre.myGUIIncrement ); } -int -MSVehicle::Manoeuvre::getManoeuvreAngle() const { - return (myManoeuvreAngle); +double +MSVehicle::Manoeuvre::getGUIIncrement() const { + return (myGUIIncrement); } MSVehicle::ManoeuvreType @@ -6556,17 +6667,23 @@ } const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); - const Stop& stop = veh->getMyStops().front(); + const Stop& stop = veh->getNextStop(); + int manoeuverAngle = stop.parkingarea->getLastFreeLotAngle(); + double GUIAngle = stop.parkingarea->getLastFreeLotGUIAngle(); + if (abs(GUIAngle) < 0.1) { + GUIAngle = -0.1; // Wiggle vehicle on parallel entry + } myManoeuvreVehicleID = veh->getID(); myManoeuvreStop = stop.parkingarea->getID(); myManoeuvreType = MSVehicle::MANOEUVRE_ENTRY; - myManoeuvreAngle = stop.parkingarea->getLastFreeLotAngle(); myManoeuvreStartTime = currentTime; - myManoeuvreCompleteTime = currentTime + veh->myType->getEntryManoeuvreTime(myManoeuvreAngle); + myManoeuvreCompleteTime = currentTime + veh->myType->getEntryManoeuvreTime(manoeuverAngle); + myGUIIncrement = GUIAngle / ((myManoeuvreCompleteTime - myManoeuvreStartTime) / (TS * 1000.)); + #ifdef DEBUG_STOPS if (veh->isSelected()) { - std::cout << "ENTRY manoeuvre start: vehicle=" << veh->getID() << " Angle=" << myManoeuvreAngle << " currentTime=" << currentTime << + std::cout << "ENTRY manoeuvre start: vehicle=" << veh->getID() << " Manoeuvre Angle=" << manoeuverAngle << " Rotation angle=" << RAD2DEG(GUIAngle) << " Road Angle" << RAD2DEG(veh->getAngle()) << " increment=" << RAD2DEG(myGUIIncrement) << " currentTime=" << currentTime << " endTime=" << myManoeuvreCompleteTime << " manoeuvre time=" << myManoeuvreCompleteTime - currentTime << " parkArea=" << myManoeuvreStop << std::endl; } #endif @@ -6590,18 +6707,25 @@ const SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); + int manoeuverAngle = veh->getCurrentParkingArea()->getManoeuverAngle(*veh); + double GUIAngle = veh->getCurrentParkingArea()->getGUIAngle(*veh); + if (abs(GUIAngle) < 0.1) { + GUIAngle = 0.1; // Wiggle vehicle on parallel exit + } + myManoeuvreVehicleID = veh->getID(); myManoeuvreStop = veh->getCurrentParkingArea()->getID(); myManoeuvreType = MSVehicle::MANOEUVRE_EXIT; myManoeuvreStartTime = currentTime; - myManoeuvreCompleteTime = currentTime + veh->myType->getExitManoeuvreTime(myManoeuvreAngle); + myManoeuvreCompleteTime = currentTime + veh->myType->getExitManoeuvreTime(manoeuverAngle); + myGUIIncrement = (-GUIAngle) / ((myManoeuvreCompleteTime - myManoeuvreStartTime) / (TS * 1000.)); if (veh->remainingStopDuration() > 0) { myManoeuvreCompleteTime += veh->remainingStopDuration(); } #ifdef DEBUG_STOPS if (veh->isSelected()) { - std::cout << "EXIT manoeuvre start: vehicle=" << veh->getID() << " Angle=" << myManoeuvreAngle << " currentTime=" << currentTime + std::cout << "EXIT manoeuvre start: vehicle=" << veh->getID() << " Manoeuvre Angle=" << manoeuverAngle << " increment=" << RAD2DEG(myGUIIncrement) << " currentTime=" << currentTime << " endTime=" << myManoeuvreCompleteTime << " manoeuvre time=" << myManoeuvreCompleteTime - currentTime << " parkArea=" << myManoeuvreStop << std::endl; } #endif @@ -6628,8 +6752,6 @@ } else if (MSNet::getInstance()->getCurrentTimeStep() < myManoeuvreCompleteTime) { return false; } else { // manoeuvre complete - // in case we ended up in a different lot - reset the angle for exit - to allow recompute - myManoeuvreAngle = currentStop->parkingarea->getLastFreeLotAngle(); myManoeuvreType = MSVehicle::MANOEUVRE_NONE; return true; } @@ -6659,4 +6781,88 @@ return (myManoeuvre.manoeuvreIsComplete()); } +double +MSVehicle::getStopDelay() const { + if (hasStops() && myStops.front().pars.until >= 0) { + const Stop& stop = myStops.front(); + SUMOTime estimatedDepart = MSNet::getInstance()->getCurrentTimeStep() - DELTA_T; + if (stop.reached) { + return STEPS2TIME(estimatedDepart + stop.duration - stop.pars.until); + } + if (stop.pars.duration > 0) { + estimatedDepart += stop.pars.duration; + } + auto it = myCurrEdge + 1; + // drive to end of current edge + //std::cout << SIMTIME << " veh=" << getID() << " ed1=" << time2string(estimatedDepart); + double dist = (myLane->getLength() - getPositionOnLane()); + double travelTime = myLane->getEdge().getMinimumTravelTime(this) * dist / myLane->getLength(); + // drive until stop edge + while (it != myRoute->end() && it < stop.edge) { + travelTime += (*it)->getMinimumTravelTime(this); + dist += (*it)->getLength(); + it++; + } + // drive up to the stop position + const double stopEdgeDist = stop.pars.endPos - (myLane == stop.lane ? myLane->getLength() : 0); + dist += stopEdgeDist; + travelTime += stop.lane->getEdge().getMinimumTravelTime(this) * (stopEdgeDist / stop.lane->getLength()); + // estimate time loss due to acceleration and deceleration + // maximum speed is limited by available distance: + const double a = getCarFollowModel().getMaxAccel(); + const double b = getCarFollowModel().getMaxDecel(); + const double c = getSpeed(); + const double d = dist; + const double len = getVehicleType().getLength(); + // distAccel = (v - v0)^2 / 2a + // distDecel = v^2 / 2b + // distAccel + distDecel < d + const double maxVD = MAX2(c, ((sqrt(MAX2(0.0, pow(2 * c * b, 2) + (4 * b * (2 * d * a - c * c) * (b + a)))) * 0.5) + (c * b)) / (b + a)); + it = myCurrEdge; + double v0 = c; + bool v0Stable = getAcceleration() == 0 && v0 > 0; + double timeLossAccel = 0; + double timeLossDecel = 0; + double timeLossLength = 0; + while (it != myRoute->end() && it <= stop.edge) { + double v = MIN2(maxVD, (*it)->getVehicleMaxSpeed(this)); + double edgeLength = (it == stop.edge ? stop.pars.endPos : (*it)->getLength()) - (it == myCurrEdge ? getPositionOnLane() : 0); + if (edgeLength <= len && v0Stable && v0 < v) { + const double lengthDist = MIN2(len, edgeLength); + const double dTL = lengthDist / v0 - lengthDist / v; + //std::cout << " e=" << (*it)->getID() << " v0=" << v0 << " v=" << v << " el=" << edgeLength << " lDist=" << lengthDist << " newTLL=" << dTL<< "\n"; + timeLossLength += dTL; + } + if (edgeLength > len) { + const double dv = v - v0; + if (dv > 0) { + // timeLossAccel = timeAccel - timeMaxspeed = dv / a - distAccel / v + const double dTA = dv / a - dv * (v + v0) / (2 * a * v); + //std::cout << " e=" << (*it)->getID() << " v0=" << v0 << " v=" << v << " newTLA=" << dTA << "\n"; + timeLossAccel += dTA; + // time loss from vehicle length + } else if (dv < 0) { + // timeLossDecel = timeDecel - timeMaxspeed = dv / b - distDecel / v + const double dTD = -dv / b + dv * (v + v0) / (2 * b * v0); + //std::cout << " e=" << (*it)->getID() << " v0=" << v0 << " v=" << v << " newTLD=" << dTD << "\n"; + timeLossDecel += dTD; + } + v0 = v; + v0Stable = true; + } + it++; + } + // final deceleration to stop + //std::cout << " v0=" << v0 << " finalTLD=" << v0 / (2 * b) << "\n"; + timeLossDecel += v0 / (2 * b); + estimatedDepart += TIME2STEPS(travelTime + timeLossAccel + timeLossDecel + timeLossLength); + const double result = MAX2(0.0, STEPS2TIME(estimatedDepart - stop.pars.until)); + //std::cout << SIMTIME << " v=" << c << " a=" << a << " b=" << b << " maxVD=" << maxVD << " tt=" << travelTime + // << " ta=" << timeLossAccel << " td=" << timeLossDecel << " tl=" << timeLossLength << " res=" << result << "\n"; + return result; + } else { + return -1; + } +} + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicle.h sumo-1.6.0+dfsg1/src/microsim/MSVehicle.h --- sumo-1.5.0+dfsg1/src/microsim/MSVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -26,13 +26,7 @@ /// // Representation of a vehicle in the micro simulation /****************************************************************************/ -#ifndef MSVehicle_h -#define MSVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,7 +59,6 @@ class MSParkingArea; class MSPerson; class MSDevice; -class MSEdgeWeightsStorage; class OutputDevice; class Position; class MSJunction; @@ -243,6 +236,7 @@ /// @brief Destructor. virtual ~MSVehicle(); + void initDevices(); /// @name insertion/removal //@{ @@ -279,13 +273,6 @@ */ bool replaceRoute(const MSRoute* route, const std::string& info, bool onInit = false, int offset = 0, bool addStops = true, bool removeStops = true); - /** @brief Returns the vehicle's internal edge travel times/efforts container - * - * If the vehicle does not have such a container, it is built. - * @return The vehicle's knowledge about edge weights - */ - const MSEdgeWeightsStorage& getWeightsStorage() const; - MSEdgeWeightsStorage& getWeightsStorage(); //@} @@ -312,6 +299,12 @@ void workOnMoveReminders(double oldPos, double newPos, double newSpeed); //@} + /** @brief cycle through vehicle devices invoking notifyIdle + * + * This is only implemented on the emissions device + * implemented to allow capture of emissions when vehicle is not on net. + */ + void workOnIdleReminders(); /** @brief Returns whether the vehicle is supposed to take action in the current simulation step * Updates myActionStep and myLastActionTime in case that the current simstep is an action step @@ -378,6 +371,9 @@ */ bool executeMove(); + /// @brief move vehicle forward by the given distance during insertion + void executeFractionalMove(double dist); + /** @brief calculates the distance covered in the next integration step given * an acceleration and assuming the current velocity. (gives different * results for different integration methods, e.g., euler vs. ballistic) @@ -587,6 +583,21 @@ return myAmOnNet; } + /** @brief access function for Idling flag + * used to record whether vehicle is waiting to enter lane (after parking) + */ + void + setIdling(bool amIdling) { + myAmIdling = amIdling; + } + + /** @brief Returns whether a sim vehicle is waiting to enter a lane + * (after parking has completed) + * @return true if the vehicle is waiting + */ + inline bool isIdling() const { + return myAmIdling; + } /** @brief Returns whether the current simulation step is an action point for the vehicle * @return Whether the vehicle has an action point in the current step. @@ -677,6 +688,9 @@ return myTimeLoss; } + /** @brief Returns the public transport stop delay in seconds + */ + double getStopDelay() const; /** @brief Returns the vehicle's direction in radians * @return The vehicle's current angle @@ -1111,14 +1125,11 @@ double processNextStop(double currentVelocity); - /// @brief handle joining of another vehicle to this one (to resolve joinTriggered) - bool joinTrainPart(MSVehicle* veh); - /** @brief Returns the leader of the vehicle looking for a fixed distance. * * If the distance is not given it is calculated from the brake gap. * The gap returned does not include the minGap. - * @param dist up to which distance to look for a leader + * @param dist up to which distance to look at least for a leader * @return The leading vehicle together with the gap; (0, -1) if no leader was found. */ std::pair getLeader(double dist = 0) const; @@ -1131,67 +1142,6 @@ */ double getTimeGapOnLane() const; - /// @name Emission retrieval - //@{ - - /** @brief Returns CO2 emission of the current state - * @return The current CO2 emission - */ - double getCO2Emissions() const; - - - /** @brief Returns CO emission of the current state - * @return The current CO emission - */ - double getCOEmissions() const; - - - /** @brief Returns HC emission of the current state - * @return The current HC emission - */ - double getHCEmissions() const; - - - /** @brief Returns NOx emission of the current state - * @return The current NOx emission - */ - double getNOxEmissions() const; - - - /** @brief Returns PMx emission of the current state - * @return The current PMx emission - */ - double getPMxEmissions() const; - - - /** @brief Returns fuel consumption of the current state - * @return The current fuel consumption - */ - double getFuelConsumption() const; - - - /** @brief Returns electricity consumption of the current state - * @return The current electricity consumption - */ - double getElectricityConsumption() const; - - /** @brief Returns actual state of charge of battery (Wh) - * RICE_CHECK: This may be a misnomer, SOC is typically percentage of the maximum battery capacity. - * @return The actual battery state of charge - */ - double getStateOfCharge() const; - - /** @brief Returns actual current (A) of ElecHybrid device - * RICE_CHECK: Is this the current consumed from the overhead wire or the current driving the poweertrain of the vehicle? - * @return The current of ElecHybrid device - */ - double getElecHybridCurrent() const; - - /** @brief Returns noise emissions of the current state - * @return The noise produced - */ - double getHarmonoise_NoiseEmissions() const; - //@} /** @brief Adds a person or container to this vehicle * @@ -1351,11 +1301,16 @@ */ Stop& getNextStop(); + /// @brief return parameters for the next stop (SUMOVehicle Interface) + const SUMOVehicleParameter::Stop* getNextStopParameter() const; + /** * returns the list of stops not yet reached in the stop queue * @return the list of upcoming stops */ - std::list getMyStops(); + inline const std::list& getStops() { + return myStops; + } /** * resumes a vehicle from stopping @@ -1439,8 +1394,8 @@ bool manoeuvreIsComplete() const; - /// @brief Accessor for manoeuvre angle - int getManoeuvreAngle() const; + /// @brief Accessor for GUI rotation step when parking (radians) + double getGUIIncrement() const; /// @brief Accessor (get) for manoeuvre type MSVehicle::ManoeuvreType getManoeuvreType() const; @@ -1464,8 +1419,8 @@ /// @brief Manoeuvre type - currently entry, exit or none ManoeuvreType myManoeuvreType; - // @brief Angle (degrees) through which manoeuver will turn vehicle - used to determine manouevre timing - int myManoeuvreAngle; + // @brief Angle (radians) through which parking vehicle moves in each sim step + double myGUIIncrement; }; // Current or previous (completed) manoeuvre @@ -1483,7 +1438,7 @@ * Furthermore this class is used to affect lane changing decisions according to * LaneChangeMode and any given laneTimeLine */ - class Influencer { + class Influencer : public BaseInfluencer { private: /// @brief A static instance of this class in GapControlState deactivates gap control @@ -1547,6 +1502,8 @@ private: static GapControlVehStateListener vehStateListener; }; + + public: /// @brief Constructor Influencer(); @@ -1593,10 +1550,6 @@ /// @brief return the current lane change mode int getLaneChangeMode() const; - /// @brief return the current routing mode - int getRoutingMode() const { - return myRoutingMode; - } SUMOTime getLaneTimeLineDuration(); SUMOTime getLaneTimeLineEnd(); @@ -1676,13 +1629,6 @@ */ void setLaneChangeMode(int value); - /** @brief Sets routing behavior - * @param[in] value an enum value controlling the different modes - */ - void setRoutingMode(int value) { - myRoutingMode = value; - } - /** @brief Returns the originally longitudinal speed to use * @return The speed given before influence or -1 if no influence is active */ @@ -1726,8 +1672,6 @@ return myTraciLaneChangePriority == LCP_ALWAYS; } - SUMOAbstractRouter& getRouterTT(const int rngIndex) const; - private: /// @brief The velocity time line to apply std::vector > mySpeedTimeLine; @@ -1790,9 +1734,6 @@ // @brief the signals set via TraCI int myTraCISignals; - ///@brief routing mode (see TraCIConstants.h) - int myRoutingMode; - }; @@ -1801,8 +1742,10 @@ * If no influencer was existing before, one is built, first * @return Reference to this vehicle's speed influencer */ + BaseInfluencer& getBaseInfluencer(); Influencer& getInfluencer(); + const BaseInfluencer* getBaseInfluencer() const; const Influencer* getInfluencer() const; bool hasInfluencer() const { @@ -1918,8 +1861,14 @@ */ void updateTimeLoss(double vNext); - /// @brief whether the vehicle is a train that can reverse its direction at the current point in its route - bool canReverse(double speedThreshold = SUMO_const_haltingSpeed) const; + /* @brief Check whether the vehicle is a train that can reverse its direction at the current point in its route + * and return the speed in preparation for reversal + * + * @param[out] canReverse + * @param[in] speedThreshold + * @return speed for reversal + */ + double checkReversal(bool& canReverse, double speedThreshold = SUMO_const_haltingSpeed, double seen = 0) const; /** @brief sets the braking lights on/off */ @@ -1953,6 +1902,17 @@ /// @brief register vehicle for drawing while outside the network virtual void drawOutsideNetwork(bool /*add*/) {}; + /// @brief board persons and load transportables at the given stop + void boardTransportables(Stop& stop); + + /// @brief try joining the given vehicle to the rear of this one (to resolve joinTriggered) + bool joinTrainPart(MSVehicle* veh); + + /// @brief try joining the given vehicle to the front of this one (to resolve joinTriggered) + bool joinTrainPartFront(MSVehicle* veh); + +protected: + /// @brief The time the vehicle waits (is not faster than 0.1m/s) in seconds SUMOTime myWaitingTime; WaitingTimeCollector myWaitingTimeCollector; @@ -2017,6 +1977,9 @@ /// @brief Whether the vehicle is on the network (not parking, teleported, vaporized, or arrived) bool myAmOnNet; + /// @brief Whether the vehicle is trying to enter the network (eg after parking so engine is running) + bool myAmIdling; + /// @brief Whether this vehicle is registered as waiting for a person (for deadlock-recognition) bool myAmRegisteredAsWaitingForPerson; @@ -2199,10 +2162,6 @@ bool haveValidStopEdges() const; private: - /* @brief The vehicle's knowledge about edge efforts/travel times; @see MSEdgeWeightsStorage - * @note member is initialized on first access */ - mutable MSEdgeWeightsStorage* myEdgeWeights; - /// @brief The per vehicle variables of the car following model MSCFModel::VehicleVariables* myCFVariables; @@ -2210,7 +2169,6 @@ Influencer* myInfluencer; - private: /// @brief invalidated default constructor MSVehicle(); @@ -2221,12 +2179,4 @@ /// @brief invalidated assignment operator MSVehicle& operator=(const MSVehicle&); - MSEdgeWeightsStorage& _getWeightsStorage() const; - }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleTransfer.cpp sumo-1.6.0+dfsg1/src/microsim/MSVehicleTransfer.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleTransfer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleTransfer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A mover of vehicles that got stucked due to grid locks /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -124,6 +119,7 @@ MSParkingArea* pa = desc.myVeh->getCurrentParkingArea(); const double departPos = pa != nullptr ? pa->getInsertionPosition(*desc.myVeh) : desc.myVeh->getPositionOnLane(); // handle parking vehicles + desc.myVeh->setIdling(true); if (desc.myVeh->getLane()->isInsertionSuccess(desc.myVeh, 0, departPos, desc.myVeh->getLateralPositionOnLane(), false, MSMoveReminder::NOTIFICATION_PARKING)) { MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VEHICLE_STATE_ENDING_PARKING); @@ -132,9 +128,11 @@ if (MSGlobals::gModelParkingManoeuver && desc.myVeh->setExitManoeuvre()) { MSNet::getInstance()->informVehicleStateListener(desc.myVeh, MSNet::VEHICLE_STATE_MANEUVERING); } + desc.myVeh->setIdling(false); i = vehInfos.erase(i); } else { - // blocked from entering the road + // blocked from entering the road - engine assumed to be idling. + desc.myVeh->workOnIdleReminders(); if (!desc.myVeh->signalSet(MSVehicle::VEH_SIGNAL_BLINKER_LEFT | MSVehicle::VEH_SIGNAL_BLINKER_RIGHT)) { // signal wish to re-enter the road desc.myVeh->switchOnSignal(MSGlobals::gLefthand ? MSVehicle::VEH_SIGNAL_BLINKER_RIGHT : MSVehicle::VEH_SIGNAL_BLINKER_LEFT); diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleTransfer.h sumo-1.6.0+dfsg1/src/microsim/MSVehicleTransfer.h --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleTransfer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleTransfer.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ // A mover of vehicles that got stucked due to grid locks // This class also serves as container for parking vehicles /****************************************************************************/ -#ifndef MSVehicleTransfer_h -#define MSVehicleTransfer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -156,9 +150,3 @@ static MSVehicleTransfer* myInstance; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleType.cpp sumo-1.6.0+dfsg1/src/microsim/MSVehicleType.cpp --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleType.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleType.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,15 +21,9 @@ /// // The car-following model and parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include #include #include #include @@ -515,5 +509,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/MSVehicleType.h sumo-1.6.0+dfsg1/src/microsim/MSVehicleType.h --- sumo-1.5.0+dfsg1/src/microsim/MSVehicleType.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/MSVehicleType.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The car-following model and parameter /****************************************************************************/ -#ifndef MSVehicleType_h -#define MSVehicleType_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -45,7 +39,6 @@ // class declarations // =========================================================================== class MSLane; -class BinaryInputDevice; class MSCFModel; class SUMOVTypeParameter; @@ -607,9 +600,3 @@ /// @brief Invalidated assignment operator MSVehicleType& operator=(const MSVehicleType&) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSAmitranTrajectories.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSAmitranTrajectories.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSAmitranTrajectories.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSAmitranTrajectories.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Realises dumping the complete network state /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSAmitranTrajectories.h sumo-1.6.0+dfsg1/src/microsim/output/MSAmitranTrajectories.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSAmitranTrajectories.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSAmitranTrajectories.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Realises dumping the complete network state /****************************************************************************/ -#ifndef MSAmitranTrajectories_h -#define MSAmitranTrajectories_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -90,9 +84,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSBatteryExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSBatteryExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSBatteryExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSBatteryExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Realises dumping Battery Data /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSBatteryExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSBatteryExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSBatteryExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSBatteryExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Realises dumping Battery Data /****************************************************************************/ -#ifndef MSBatteryExport_h -#define MSBatteryExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -73,5 +67,4 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSCrossSection.h sumo-1.6.0+dfsg1/src/microsim/output/MSCrossSection.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSCrossSection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSCrossSection.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A simple description of a position on a lane (crossing of a lane) /****************************************************************************/ -#ifndef MSCrossSection_h -#define MSCrossSection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -67,9 +61,3 @@ typedef std::vector< MSCrossSection > CrossSectionVector; typedef CrossSectionVector::iterator CrossSectionVectorIt; typedef CrossSectionVector::const_iterator CrossSectionVectorConstIt; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorControl.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Detectors container; responsible for string and output generation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -173,6 +168,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorControl.h sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorControl.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Detectors container; responsible for string and output generation /****************************************************************************/ -#ifndef MSDetectorControl_h -#define MSDetectorControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -243,9 +237,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorFileOutput.h sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorFileOutput.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSDetectorFileOutput.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSDetectorFileOutput.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Base of value-generating classes (detectors) /****************************************************************************/ -#ifndef MSDetectorFileOutput_h -#define MSDetectorFileOutput_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -167,6 +161,10 @@ return !myVehicleTypes.empty(); } + const std::set& getVehicleTypes() const { + return myVehicleTypes; + } + inline bool detectPersons() const { return myDetectPersons != 0; } @@ -187,9 +185,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSE2Collector.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSE2Collector.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSE2Collector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSE2Collector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -34,10 +34,6 @@ * Compatibility without internal lanes? * Include leftVehicles into output? */ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -1196,9 +1192,9 @@ // compute current jam's values MoveNotificationInfo* lastVeh = *((*i)->lastStandingVehicle); MoveNotificationInfo* firstVeh = *((*i)->firstStandingVehicle); - const double jamLengthInMeters = lastVeh->distToDetectorEnd - - firstVeh->distToDetectorEnd - + lastVeh->lengthOnDetector; + const double jamLengthInMeters = MAX2(lastVeh->distToDetectorEnd, 0.) - + MAX2(firstVeh->distToDetectorEnd, 0.) + + lastVeh->lengthOnDetector; const int jamLengthInVehicles = (int) distance((*i)->firstStandingVehicle, (*i)->lastStandingVehicle) + 1; // apply them to the statistics myCurrentMaxJamLengthInMeters = MAX2(myCurrentMaxJamLengthInMeters, jamLengthInMeters); @@ -1504,5 +1500,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSE2Collector.h sumo-1.6.0+dfsg1/src/microsim/output/MSE2Collector.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSE2Collector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSE2Collector.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ /// // An areal detector covering to a sequence of consecutive lanes /****************************************************************************/ -#ifndef MSE2Collector_h -#define MSE2Collector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -518,6 +512,7 @@ /// @} + virtual void setVisible(bool /*show*/) {}; private: @@ -781,9 +776,3 @@ /// @brief Invalidated assignment operator. MSE2Collector& operator=(const MSE2Collector&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSE3Collector.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSE3Collector.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSE3Collector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSE3Collector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -575,4 +571,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSE3Collector.h sumo-1.6.0+dfsg1/src/microsim/output/MSE3Collector.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSE3Collector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSE3Collector.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A detector of vehicles passing an area between entry/exit points /****************************************************************************/ -#ifndef MSE3Collector_h -#define MSE3Collector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -437,9 +431,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSElecHybridExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSElecHybridExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSElecHybridExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSElecHybridExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Realises dumping Electric hybrid vehicle data /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSElecHybridExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSElecHybridExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSElecHybridExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSElecHybridExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Realises dumping Electric hybrid vehicle data /****************************************************************************/ -#ifndef MSElecHybridExport_h -#define MSElecHybridExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -73,5 +67,4 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSEmissionExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSEmissionExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSEmissionExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSEmissionExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Realises dumping Emission Data /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,7 +43,7 @@ MSVehicleControl& vc = MSNet::getInstance()->getVehicleControl(); for (MSVehicleControl::constVehIt it = vc.loadedVehBegin(); it != vc.loadedVehEnd(); ++it) { const SUMOVehicle* veh = it->second; - if (veh->isOnRoad()) { + if (veh->isOnRoad() || veh->isIdling()) { std::string fclass = veh->getVehicleType().getID(); fclass = fclass.substr(0, fclass.find_first_of("@")); PollutantsInterface::Emissions emiss = PollutantsInterface::computeAll( diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSEmissionExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSEmissionExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSEmissionExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSEmissionExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Realises dumping Emission Data /****************************************************************************/ -#ifndef MSEmissionExport_h -#define MSEmissionExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -71,8 +65,3 @@ MSEmissionExport& operator=(const MSEmissionExport&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSFCDExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSFCDExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSFCDExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSFCDExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Realises dumping Floating Car Data (FCD) Data /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -56,6 +51,7 @@ 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"); + 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")); if (period > 0 && (timestep - begin) % period != 0) { @@ -107,6 +103,8 @@ of.writeAttr(SUMO_ATTR_POSITION, veh->getPositionOnLane()); if (microVeh != nullptr) { of.writeAttr(SUMO_ATTR_LANE, microVeh->getLane()->getID()); + } else { + of.writeAttr(SUMO_ATTR_EDGE, veh->getEdge()->getID()); } of.writeAttr(SUMO_ATTR_SLOPE, veh->getSlope()); if (microVeh != nullptr) { @@ -130,6 +128,12 @@ // if the kilometrage runs counter to the edge direction edge->getDistance() is negative of.writeAttr("distance", fabs(distance)); } + for (const std::string& key : params) { + const std::string value = veh->getParameter().getParameter(key); + if (value != "") { + of.writeAttr(StringUtils::escapeXML(key), StringUtils::escapeXML(value)); + } + } } of.closeTag(); // write persons and containers diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSFCDExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSFCDExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSFCDExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSFCDExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Realises dumping Floating Car Data (FCD) Data /****************************************************************************/ -#ifndef MSFCDExport_h -#define MSFCDExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -76,10 +70,3 @@ }; - - -#endif - -/****************************************************************************/ - - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSFullExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSFullExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSFullExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSFullExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Dumping a hugh List of Parameters available in the Simulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -95,6 +90,9 @@ const MSEdgeVector& edges = ec.getEdges(); for (MSEdgeVector::const_iterator e = edges.begin(); e != edges.end(); ++e) { MSEdge& edge = **e; + if (!MSGlobals::gUsingInternalLanes && !edge.isNormal()) { + continue; + } of.openTag("edge").writeAttr("id", edge.getID()).writeAttr("traveltime", edge.getCurrentTravelTime()); const std::vector& lanes = edge.getLanes(); for (std::vector::const_iterator lane = lanes.begin(); lane != lanes.end(); ++lane) { diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSFullExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSFullExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSFullExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSFullExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dumping a hugh List of Parameters available in the Simulation /****************************************************************************/ -#ifndef MSFullExport_h -#define MSFullExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -84,9 +78,3 @@ static void writeTLS(OutputDevice& of, SUMOTime timestep); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSInductLoop.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSInductLoop.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSInductLoop.h" @@ -51,10 +46,12 @@ // =========================================================================== MSInductLoop::MSInductLoop(const std::string& id, MSLane* const lane, double positionInMeters, - const std::string& vTypes) : + const std::string& vTypes, + const bool needLocking) : MSMoveReminder(id, lane), MSDetectorFileOutput(id, vTypes), myPosition(positionInMeters), + myNeedLock(needLocking || MSGlobals::gNumSimThreads > 1), myLastLeaveTime(SIMTIME), myVehicleDataCont(), myVehiclesOnDet() { @@ -69,6 +66,9 @@ void MSInductLoop::reset() { +#ifdef HAVE_FOX + FXConditionalLock lock(myNotificationMutex, myNeedLock); +#endif myEnteredVehicleNumber = 0; myLastVehicleDataCont = myVehicleDataCont; myVehicleDataCont.clear(); @@ -80,12 +80,15 @@ if (!vehicleApplies(veh)) { return false; } - if (reason == NOTIFICATION_DEPARTED || - reason == NOTIFICATION_TELEPORT || - reason == NOTIFICATION_PARKING || - reason == NOTIFICATION_LANE_CHANGE) { - if (veh.getPositionOnLane() >= myPosition && veh.getBackPositionOnLane(myLane) < myPosition) { - myVehiclesOnDet.insert(std::make_pair(&veh, SIMTIME)); + if (reason != NOTIFICATION_JUNCTION) { // the junction case is handled in notifyMove + if (veh.getBackPositionOnLane(myLane) >= myPosition) { + return false; + } + if (veh.getPositionOnLane() >= myPosition) { +#ifdef HAVE_FOX + FXConditionalLock lock(myNotificationMutex, myNeedLock); +#endif + myVehiclesOnDet[&veh] = SIMTIME; myEnteredVehicleNumber++; } } @@ -101,14 +104,14 @@ return true; } #ifdef HAVE_FOX - FXConditionalLock lock(myNotificationMutex, MSGlobals::gNumSimThreads > 1); + FXConditionalLock lock(myNotificationMutex, myNeedLock); #endif const double oldSpeed = veh.getPreviousSpeed(); if (newPos >= myPosition && oldPos < myPosition) { // entered the detector by move const double timeBeforeEnter = MSCFModel::passingTime(oldPos, myPosition, newPos, oldSpeed, newSpeed); - double entryTime = SIMTIME + timeBeforeEnter; - enterDetectorByMove(veh, entryTime); + myVehiclesOnDet[&veh] = SIMTIME + timeBeforeEnter; + myEnteredVehicleNumber++; } double oldBackPos = oldPos - veh.getVehicleType().getLength(); double newBackPos = newPos - veh.getVehicleType().getLength(); @@ -117,20 +120,18 @@ // assert(!MSGlobals::gSemiImplicitEulerUpdate || newSpeed > 0 || myVehiclesOnDet.find(&veh) == myVehiclesOnDet.end()); // assertion is invalid in case of teleportation if (oldBackPos <= myPosition) { - const double timeBeforeLeave = MSCFModel::passingTime(oldBackPos, myPosition, newBackPos, oldSpeed, newSpeed); - const double leaveTime = SIMTIME + timeBeforeLeave; - leaveDetectorByMove(veh, leaveTime); + const std::map::iterator it = myVehiclesOnDet.find(&veh); + if (it != myVehiclesOnDet.end()) { + const double entryTime = it->second; + const double leaveTime = SIMTIME + MSCFModel::passingTime(oldBackPos, myPosition, newBackPos, oldSpeed, newSpeed); + myVehiclesOnDet.erase(it); + assert(entryTime < leaveTime); + myVehicleDataCont.push_back(VehicleData(veh, entryTime, leaveTime, false)); + myLastLeaveTime = leaveTime; + } } else { // vehicle is already beyond the detector... // This can happen even if it is still registered in myVehiclesOnDet, e.g., after teleport. - // XXX: would we need to call leaveDetectorByMove(veh, leaveTime) as it was done before - // I inserted this if-else differentiation? (Leo) It seems that such a call only resets - // the last leave Time, which seems inadequate to do for such a situation (though it actually - // appears in test output/e1/one_vehicle/lane_change). Moreover, if the vehicle was - // not removed, this call would tidy up. - // XXX: Indeed, we need to tidy up, e.g., in case of teleport insertion behind detector - // XXX: As a quickfix we just remove it. (should be discussed! Leo) Refs. #2579 - myVehiclesOnDet.erase(&veh); } return false; @@ -141,9 +142,19 @@ bool -MSInductLoop::notifyLeave(SUMOTrafficObject& veh, double lastPos, MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) { +MSInductLoop::notifyLeave(SUMOTrafficObject& veh, double /* lastPos */, MSMoveReminder::Notification reason, const MSLane* /* enteredLane */) { if (reason != MSMoveReminder::NOTIFICATION_JUNCTION) { - leaveDetectorByLaneChange(veh, lastPos); +#ifdef HAVE_FOX + FXConditionalLock lock(myNotificationMutex, myNeedLock); +#endif + const std::map::iterator it = myVehiclesOnDet.find(&veh); + if (it != myVehiclesOnDet.end()) { + const double entryTime = it->second; + const double leaveTime = SIMTIME + TS; + myVehiclesOnDet.erase(it); + myVehicleDataCont.push_back(VehicleData(veh, entryTime, leaveTime, true)); + myLastLeaveTime = leaveTime; + } return false; } return true; @@ -169,7 +180,7 @@ const SUMOTime tbeg = SIMSTEP - DELTA_T; double occupancy = 0; const double csecond = SIMTIME; - for (const VehicleData& i : collectVehiclesOnDet(tbeg)) { + for (const VehicleData& i : collectVehiclesOnDet(tbeg, false, false, true)) { const double leaveTime = i.leaveTimeM == HAS_NOT_LEFT_DETECTOR ? csecond : MIN2(i.leaveTimeM, csecond); const double entryTime = MAX2(i.entryTimeM, STEPS2TIME(tbeg)); occupancy += MIN2(leaveTime - entryTime, TS); @@ -179,16 +190,15 @@ double -MSInductLoop::getPassedNumber(const int offset) const { - return (double)collectVehiclesOnDet(SIMSTEP - offset).size(); +MSInductLoop::getEnteredNumber(const int offset) const { + return (double)collectVehiclesOnDet(SIMSTEP - offset, true, true).size(); } std::vector MSInductLoop::getVehicleIDs(const int offset) const { - const std::vector& d = collectVehiclesOnDet(SIMSTEP - offset); std::vector ret; - for (const VehicleData& i : d) { + for (const VehicleData& i : collectVehiclesOnDet(SIMSTEP - offset, true, true)) { ret.push_back(i.idM); } return ret; @@ -221,84 +231,66 @@ void -MSInductLoop::writeXMLOutput(OutputDevice& dev, - SUMOTime startTime, SUMOTime stopTime) { +MSInductLoop::writeXMLOutput(OutputDevice& dev, SUMOTime startTime, SUMOTime stopTime) { const double t(STEPS2TIME(stopTime - startTime)); - const double flow = ((double)myVehicleDataCont.size() / t) * (double) 3600.0; double occupancy = 0.; double speedSum = 0.; double lengthSum = 0.; + int contrib = 0; // to approximate the space mean speed double inverseSpeedSum = 0.; - for (std::deque< VehicleData >::const_iterator i = myVehicleDataCont.begin(); i != myVehicleDataCont.end(); ++i) { - const double timeOnDetDuringInterval = i->leaveTimeM - MAX2(STEPS2TIME(startTime), i->entryTimeM); + for (const VehicleData& vData : myVehicleDataCont) { + const double timeOnDetDuringInterval = vData.leaveTimeM - MAX2(STEPS2TIME(startTime), vData.entryTimeM); occupancy += MIN2(timeOnDetDuringInterval, t); - speedSum += i->speedM; - assert(i->speedM > 0); - inverseSpeedSum += 1. / i->speedM; - lengthSum += i->lengthM; + if (!vData.leftEarlyM) { + speedSum += vData.speedM; + assert(vData.speedM > 0.); + inverseSpeedSum += 1. / vData.speedM; + lengthSum += vData.lengthM; + contrib++; + } } + const double flow = (double)contrib / t * 3600.; for (std::map< SUMOTrafficObject*, double >::const_iterator i = myVehiclesOnDet.begin(); i != myVehiclesOnDet.end(); ++i) { occupancy += STEPS2TIME(stopTime) - MAX2(STEPS2TIME(startTime), i->second); } - occupancy = occupancy / t * (double) 100.; - const double meanSpeed = myVehicleDataCont.size() != 0 ? speedSum / (double)myVehicleDataCont.size() : -1; - const double harmonicMeanSpeed = myVehicleDataCont.size() != 0 ? (double)myVehicleDataCont.size() / inverseSpeedSum : -1; - const double meanLength = myVehicleDataCont.size() != 0 ? lengthSum / (double)myVehicleDataCont.size() : -1; + occupancy *= 100. / t; + const double meanSpeed = contrib != 0 ? speedSum / (double)contrib : -1; + const double harmonicMeanSpeed = contrib != 0 ? (double)contrib / inverseSpeedSum : -1; + const double meanLength = contrib != 0 ? lengthSum / (double)contrib : -1; dev.openTag(SUMO_TAG_INTERVAL).writeAttr(SUMO_ATTR_BEGIN, STEPS2TIME(startTime)).writeAttr(SUMO_ATTR_END, STEPS2TIME(stopTime)); - dev.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(getID())).writeAttr("nVehContrib", myVehicleDataCont.size()); + dev.writeAttr(SUMO_ATTR_ID, StringUtils::escapeXML(getID())).writeAttr("nVehContrib", contrib); dev.writeAttr("flow", flow).writeAttr("occupancy", occupancy).writeAttr("speed", meanSpeed).writeAttr("harmonicMeanSpeed", harmonicMeanSpeed); dev.writeAttr("length", meanLength).writeAttr("nVehEntered", myEnteredVehicleNumber).closeTag(); reset(); } -void -MSInductLoop::enterDetectorByMove(SUMOTrafficObject& veh, double entryTimestep) { - myVehiclesOnDet.insert(std::make_pair(&veh, entryTimestep)); - myEnteredVehicleNumber++; -} - - -void -MSInductLoop::leaveDetectorByMove(SUMOTrafficObject& veh, double leaveTimestep) { - std::map::iterator it = myVehiclesOnDet.find(&veh); - if (it != myVehiclesOnDet.end()) { - const double entryTimestep = it->second; - myVehiclesOnDet.erase(it); - assert(entryTimestep < leaveTimestep); - myVehicleDataCont.push_back(VehicleData(veh.getID(), veh.getVehicleType().getLength(), entryTimestep, leaveTimestep, veh.getVehicleType().getID())); - } - // XXX: why is this outside the conditional block? (Leo) - myLastLeaveTime = leaveTimestep; -} - - -void -MSInductLoop::leaveDetectorByLaneChange(SUMOTrafficObject& veh, double /* lastPos */) { - // Discard entry data - myVehiclesOnDet.erase(&veh); -} - - std::vector -MSInductLoop::collectVehiclesOnDet(SUMOTime tMS, bool leaveTime) const { +MSInductLoop::collectVehiclesOnDet(SUMOTime tMS, bool includeEarly, bool leaveTime, bool forOccupancy) const { +#ifdef HAVE_FOX + FXConditionalLock lock(myNotificationMutex, myNeedLock); +#endif const double t = STEPS2TIME(tMS); std::vector ret; for (const VehicleData& i : myVehicleDataCont) { - if (i.entryTimeM >= t || (leaveTime && i.leaveTimeM >= t)) { - ret.push_back(i); + if (includeEarly || !i.leftEarlyM) { + if (i.entryTimeM >= t || (leaveTime && i.leaveTimeM >= t)) { + ret.push_back(i); + } } } for (const VehicleData& i : myLastVehicleDataCont) { - if (i.entryTimeM >= t || (leaveTime && i.leaveTimeM >= t)) { - ret.push_back(i); + if (includeEarly || !i.leftEarlyM) { + if (i.entryTimeM >= t || (leaveTime && i.leaveTimeM >= t)) { + ret.push_back(i); + } } } for (const auto& i : myVehiclesOnDet) { - if (i.second >= t || leaveTime) { // no need to check leave time, they are still on the detector + if (i.second >= t || leaveTime || forOccupancy) { // no need to check leave time, they are still on the detector SUMOTrafficObject* const v = i.first; - VehicleData d(v->getID(), v->getVehicleType().getLength(), i.second, HAS_NOT_LEFT_DETECTOR, v->getVehicleType().getID()); + VehicleData d(*v, i.second, HAS_NOT_LEFT_DETECTOR, false); d.speedM = v->getSpeed(); ret.push_back(d); } @@ -307,4 +299,11 @@ } +MSInductLoop::VehicleData::VehicleData(const SUMOTrafficObject& v, double entryTimestep, + double leaveTimestep, const bool leftEarly) + : idM(v.getID()), lengthM(v.getVehicleType().getLength()), entryTimeM(entryTimestep), leaveTimeM(leaveTimestep), + speedM(v.getVehicleType().getLength() / MAX2(leaveTimestep - entryTimestep, NUMERICAL_EPS)), typeIDM(v.getVehicleType().getID()), + leftEarlyM(leftEarly) {} + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSInductLoop.h sumo-1.6.0+dfsg1/src/microsim/output/MSInductLoop.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // An unextended detector measuring at a fixed position on a fixed lane. /****************************************************************************/ -#ifndef MSInductLoop_h -#define MSInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -76,10 +70,12 @@ * @param[in] lane Lane where detector works on * @param[in] position Position of the detector within the lane * @param[in] vTypes which vehicle types are considered + * @param[in] needLocking whether internals need to be guarded against concurrent access (GUI) */ MSInductLoop(const std::string& id, MSLane* const lane, double positionInMeters, - const std::string& vTypes); + const std::string& vTypes, + const bool needLocking); /// @brief Destructor @@ -142,7 +138,7 @@ * @param[in] lastPos Position on the lane when leaving. * @param[in] isArrival whether the vehicle arrived at its destination * @param[in] isLaneChange whether the vehicle changed from the lane - * @see leaveDetectorByLaneChange + * @see discardVehicle * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ @@ -197,7 +193,7 @@ * @return The number of vehicles that have passed the detector * @todo recheck (especially if more than one vehicle has passed) */ - double getPassedNumber(const int offset) const; + double getEnteredNumber(const int offset) const; /** @brief Returns the ids of vehicles that have passed the detector @@ -244,7 +240,6 @@ /// @} - /** @brief Struct to store the data of the counted vehicle internally. * * These data is fed into a container. @@ -254,16 +249,14 @@ struct VehicleData { /** @brief Constructor * - * Used if the vehicle has passed the induct loop completely + * Used if the vehicle has left the induction loop completely * * @param[in] vehLength The length of the vehicle * @param[in] entryTimestep The time at which the vehicle entered the detector * @param[in] leaveTimestep The time at which the vehicle left the detector */ - VehicleData(const std::string& id, double vehLength, double entryTimestep, double leaveTimestep, - const std::string& typeID) - : idM(id), lengthM(vehLength), entryTimeM(entryTimestep), leaveTimeM(leaveTimestep), - speedM(vehLength / MAX2(leaveTimestep - entryTimestep, NUMERICAL_EPS)), typeIDM(typeID) {} + VehicleData(const SUMOTrafficObject& v, double entryTimestep, + double leaveTimestep, const bool leftEarly); /// @brief The id of the vehicle std::string idM; @@ -275,8 +268,10 @@ double leaveTimeM; /// @brief Speed of the vehicle in [m/s] double speedM; - /// @brief Type of the vehicle in + /// @brief Type of the vehicle std::string typeIDM; + /// @brief whether the vehicle left the detector with a lane change / teleport etc. + bool leftEarlyM; }; @@ -287,7 +282,7 @@ * (the latter gives a more complete picture but may include vehicles in multiple steps even if they did not stay on the detector) * @return The list of vehicles */ - virtual std::vector collectVehiclesOnDet(SUMOTime t, bool leaveTime = false) const; + std::vector collectVehiclesOnDet(SUMOTime t, bool includeEarly = false, bool leaveTime = false, bool forOccupancy = false) const; /// @brief allows for special color in the gui version virtual void setSpecialColor(const RGBColor* /*color*/) {}; @@ -295,36 +290,6 @@ virtual void setVisible(bool /*show*/) {}; protected: - /// @name Methods that add and remove vehicles from internal container - /// @{ - - /** @brief Introduces a vehicle to the detector's map myVehiclesOnDet. - * @param veh The entering vehicle. - * @param entryTimestep Timestep (not necessary integer) of entrance. - */ - virtual void enterDetectorByMove(SUMOTrafficObject& veh, double entryTimestep); - - - /** @brief Processes a vehicle that leaves the detector - * - * Removes a vehicle from the detector's map myVehiclesOnDet and - * adds the vehicle data to the internal myVehicleDataCont. - * - * @param veh The leaving vehicle. - * @param leaveTimestep Timestep (not necessary integer) of leaving. - */ - virtual void leaveDetectorByMove(SUMOTrafficObject& veh, double leaveTimestep); - - - /** @brief Removes a vehicle from the detector's map myVehiclesOnDet. - * @param veh The leaving vehicle. - * @param lastPos The last position of the leaving vehicle. - */ - virtual void leaveDetectorByLaneChange(SUMOTrafficObject& veh, double lastPos); - /// @} - - -protected: /// @name Function for summing up values ///@{ @@ -344,6 +309,9 @@ /// @brief Detector's position on lane [m] const double myPosition; + /// @brief whether internals need to be guarded against concurrent access (GUI or multi threading) + const bool myNeedLock; + /// @brief Leave-time of the last vehicle detected [s] double myLastLeaveTime; @@ -371,9 +339,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSInstantInductLoop.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSInstantInductLoop.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSInstantInductLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSInstantInductLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // An instantaneous induction loop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MSInstantInductLoop.h" diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSInstantInductLoop.h sumo-1.6.0+dfsg1/src/microsim/output/MSInstantInductLoop.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSInstantInductLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSInstantInductLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An instantaneous induction loop /****************************************************************************/ -#ifndef MSInstantInductLoop_h -#define MSInstantInductLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -107,7 +101,6 @@ * @param[in] lastPos Position on the lane when leaving. * @param[in] isArrival whether the vehicle arrived at its destination * @param[in] isLaneChange whether the vehicle changed from the lane - * @see leaveDetectorByLaneChange * @see MSMoveReminder * @see MSMoveReminder::notifyLeave */ @@ -178,9 +171,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Amitran.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Amitran.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Amitran.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Amitran.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Network state mean data collector for edges/lanes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -111,19 +106,26 @@ void -MSMeanData_Amitran::MSLaneMeanDataValues::write(OutputDevice& dev, const SUMOTime /* period */, +MSMeanData_Amitran::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime /* period */, const double /* numLanes */, const double defaultTravelTime, const int /* numVehicles */) const { + int averageSpeed; if (sampleSeconds > 0) { - dev.writeAttr("amount", amount).writeAttr("averageSpeed", int(100 * travelledDistance / sampleSeconds)); + averageSpeed = int(100 * travelledDistance / sampleSeconds); } else if (defaultTravelTime >= 0.) { - dev.writeAttr("amount", amount).writeAttr("averageSpeed", int(100 * myLaneLength / defaultTravelTime)); + averageSpeed = int(100 * myLaneLength / defaultTravelTime); } else { - dev.writeAttr("amount", amount).writeAttr("averageSpeed", "-1"); + averageSpeed = -1; } + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_AMOUNT, amount); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_AVERAGESPEED, averageSpeed); + if (myParent->isTyped()) { for (std::map::const_iterator it = typedAmount.begin(); it != typedAmount.end(); ++it) { - dev.openTag("actorConfig").writeAttr(SUMO_ATTR_ID, it->first->getNumericalID()); - dev.writeAttr("amount", it->second).writeAttr("averageSpeed", int(100 * typedTravelDistance.find(it->first)->second / typedSamples.find(it->first)->second)); + dev.openTag("actorConfig"); + const int averageSpeed = int(100 * typedTravelDistance.find(it->first)->second / typedSamples.find(it->first)->second); + dev.writeAttr(SUMO_ATTR_ID, it->first->getNumericalID()); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_AMOUNT, it->second); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_AVERAGESPEED, averageSpeed); dev.closeTag(); } } @@ -143,10 +145,11 @@ const double maxTravelTime, const double minSamples, const double haltSpeed, - const std::string& vTypes) - : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, - withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes), - myHaltSpeed(haltSpeed) { + const std::string& vTypes, + const std::string& writeAttributes) : + MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, + withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes, writeAttributes), + myHaltSpeed(haltSpeed) { } @@ -189,4 +192,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Amitran.h sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Amitran.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Amitran.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Amitran.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -#ifndef MSMeanData_Amitran_h -#define MSMeanData_Amitran_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,7 +109,7 @@ * @param[in] numLanes The total number of lanes for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void write(OutputDevice& dev, const SUMOTime period, + void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const; @@ -166,7 +160,8 @@ const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, - const double haltSpeed, const std::string& vTypes); + const double haltSpeed, const std::string& vTypes, + const std::string& writeAttributes); /// @brief Destructor @@ -236,9 +231,3 @@ MSMeanData_Amitran& operator=(const MSMeanData_Amitran&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,23 +21,19 @@ /// // Data collector for edges/lanes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include +#include +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include #include "MSMeanData_Amitran.h" #include "MSMeanData.h" @@ -375,11 +371,12 @@ void MSMeanData::MeanDataValueTracker::write(OutputDevice& dev, + long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int /*numVehicles*/) const { - myCurrentData.front()->myValues->write(dev, period, numLanes, + myCurrentData.front()->myValues->write(dev, attributeMask, period, numLanes, defaultTravelTime, myCurrentData.front()->myNumVehicleEntered); } @@ -416,7 +413,8 @@ const int detectPersons, const double maxTravelTime, const double minSamples, - const std::string& vTypes) : + const std::string& vTypes, + const std::string& writeAttributes) : MSDetectorFileOutput(id, vTypes, detectPersons), myMinSamples(minSamples), myMaxTravelTime(maxTravelTime), @@ -426,8 +424,9 @@ myDumpEnd(dumpEnd), myPrintDefaults(printDefaults), myDumpInternal(withInternal), - myTrackVehicles(trackVehicles) { -} + myTrackVehicles(trackVehicles), + myWrittenAttributes(initWrittenAttributes(writeAttributes, id)) +{ } void @@ -528,7 +527,7 @@ s = s->getNextSegment(); } if (writePrefix(dev, *data, SUMO_TAG_EDGE, getEdgeID(edge))) { - data->write(dev, stopTime - startTime, + data->write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } @@ -552,7 +551,7 @@ for (lane = edgeValues.begin(); lane != edgeValues.end(); ++lane) { MeanDataValues& meanData = **lane; if (writePrefix(dev, meanData, SUMO_TAG_LANE, meanData.getLane()->getID())) { - meanData.write(dev, stopTime - startTime, 1.f, myPrintDefaults ? meanData.getLane()->getLength() / meanData.getLane()->getSpeedLimit() : -1.); + meanData.write(dev, myWrittenAttributes, stopTime - startTime, 1.f, myPrintDefaults ? meanData.getLane()->getLength() / meanData.getLane()->getSpeedLimit() : -1.); } meanData.reset(true); } @@ -563,7 +562,7 @@ if (myTrackVehicles) { MeanDataValues& meanData = **edgeValues.begin(); if (writePrefix(dev, meanData, SUMO_TAG_EDGE, edge->getID())) { - meanData.write(dev, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); + meanData.write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } meanData.reset(true); } else { @@ -574,7 +573,7 @@ meanData.reset(); } if (writePrefix(dev, *sumData, SUMO_TAG_EDGE, getEdgeID(edge))) { - sumData->write(dev, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); + sumData->write(dev, myWrittenAttributes, stopTime - startTime, (double)edge->getLanes().size(), myPrintDefaults ? edge->getLength() / edge->getSpeedLimit() : -1.); } delete sumData; } @@ -592,7 +591,9 @@ bool MSMeanData::writePrefix(OutputDevice& dev, const MeanDataValues& values, const SumoXMLTag tag, const std::string id) const { if (myDumpEmpty || !values.isEmpty()) { - dev.openTag(tag).writeAttr(SUMO_ATTR_ID, id).writeAttr("sampledSeconds", values.getSamples()); + dev.openTag(tag); + dev.writeAttr(SUMO_ATTR_ID, id); + MeanDataValues::checkWriteAttribute(dev, myWrittenAttributes, SUMO_ATTR_SAMPLEDSECONDS, values.getSamples()); return true; } return false; @@ -652,6 +653,19 @@ } } +long long int +MSMeanData::initWrittenAttributes(const std::string writeAttributes, const std::string& id) { + long long int result = 0; + for (std::string attrName : StringTokenizer(writeAttributes).getVector()) { + if (!SUMOXMLDefinitions::Attrs.hasString(attrName)) { + WRITE_ERROR("Unknown attribute '" + attrName + "' to write in meanData '" + id + "'."); + continue; + } + int attr = SUMOXMLDefinitions::Attrs.get(attrName); + assert(attr < 63); + result |= ((long long int)1 << attr); + } + return result; +} /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Emissions.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Emissions.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Emissions.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Emissions.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Emission data collector for edges/lanes that /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -73,6 +68,9 @@ void MSMeanData_Emissions::MSLaneMeanDataValues::notifyMoveInternal(const SUMOTrafficObject& veh, const double /* frontOnLane */, const double timeOnLane, const double /*meanSpeedFrontOnLane*/, const double meanSpeedVehicleOnLane, const double /*travelledDistanceFrontOnLane*/, const double travelledDistanceVehicleOnLane, const double /* meanLengthOnLane */) { + if (myParent != nullptr && !myParent->vehicleApplies(veh)) { + return; + } if (veh.isVehicle()) { sampleSeconds += timeOnLane; travelledDistance += travelledDistanceVehicleOnLane; @@ -84,25 +82,39 @@ } } +bool +MSMeanData_Emissions::MSLaneMeanDataValues::notifyIdle(SUMOTrafficObject& veh) { + if (veh.isVehicle()) { + myEmissions.addScaled(PollutantsInterface::computeAll(veh.getVehicleType().getEmissionClass(), + 0., 0., 0., + static_cast(veh).getEmissionParameters()), TS); + } + return true; +} + void -MSMeanData_Emissions::MSLaneMeanDataValues::write(OutputDevice& dev, const SUMOTime period, +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 normFactor = double(3600. / STEPS2TIME(period) / myLaneLength); - dev << " CO_abs=\"" << OutputDevice::realString(myEmissions.CO, 6) << - "\" CO2_abs=\"" << OutputDevice::realString(myEmissions.CO2, 6) << - "\" HC_abs=\"" << OutputDevice::realString(myEmissions.HC, 6) << - "\" PMx_abs=\"" << OutputDevice::realString(myEmissions.PMx, 6) << - "\" NOx_abs=\"" << OutputDevice::realString(myEmissions.NOx, 6) << - "\" fuel_abs=\"" << OutputDevice::realString(myEmissions.fuel, 6) << - "\" electricity_abs=\"" << OutputDevice::realString(myEmissions.electricity, 6) << - "\"\n CO_normed=\"" << OutputDevice::realString(normFactor * myEmissions.CO, 6) << - "\" CO2_normed=\"" << OutputDevice::realString(normFactor * myEmissions.CO2, 6) << - "\" HC_normed=\"" << OutputDevice::realString(normFactor * myEmissions.HC, 6) << - "\" PMx_normed=\"" << OutputDevice::realString(normFactor * myEmissions.PMx, 6) << - "\" NOx_normed=\"" << OutputDevice::realString(normFactor * myEmissions.NOx, 6) << - "\" fuel_normed=\"" << OutputDevice::realString(normFactor * myEmissions.fuel, 6) << - "\" electricity_normed=\"" << OutputDevice::realString(normFactor * myEmissions.electricity, 6); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO_ABS, OutputDevice::realString(myEmissions.CO, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO2_ABS, OutputDevice::realString(myEmissions.CO2, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_HC_ABS, OutputDevice::realString(myEmissions.HC, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_PMX_ABS, OutputDevice::realString(myEmissions.PMx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_NOX_ABS, OutputDevice::realString(myEmissions.NOx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_FUEL_ABS, OutputDevice::realString(myEmissions.fuel, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ELECTRICITY_ABS, OutputDevice::realString(myEmissions.electricity, 6)); + if (attributeMask == 0) { + dev << "\n "; + } + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO_NORMED, OutputDevice::realString(normFactor * myEmissions.CO, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO2_NORMED, OutputDevice::realString(normFactor * myEmissions.CO2, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_HC_NORMED, OutputDevice::realString(normFactor * myEmissions.HC, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_PMX_NORMED, OutputDevice::realString(normFactor * myEmissions.PMx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_NOX_NORMED, OutputDevice::realString(normFactor * myEmissions.NOx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_FUEL_NORMED, OutputDevice::realString(normFactor * myEmissions.fuel, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ELECTRICITY_NORMED, OutputDevice::realString(normFactor * myEmissions.electricity, 6)); + if (sampleSeconds > myParent->getMinSamples()) { double vehFactor = myParent->getMaxTravelTime() / sampleSeconds; double traveltime = myParent->getMaxTravelTime(); @@ -110,27 +122,33 @@ vehFactor = MIN2(vehFactor, myLaneLength / travelledDistance); traveltime = MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance); } - dev << "\"\n traveltime=\"" << OutputDevice::realString(traveltime) << - "\" CO_perVeh=\"" << OutputDevice::realString(myEmissions.CO * vehFactor, 6) << - "\" CO2_perVeh=\"" << OutputDevice::realString(myEmissions.CO2 * vehFactor, 6) << - "\" HC_perVeh=\"" << OutputDevice::realString(myEmissions.HC * vehFactor, 6) << - "\" PMx_perVeh=\"" << OutputDevice::realString(myEmissions.PMx * vehFactor, 6) << - "\" NOx_perVeh=\"" << OutputDevice::realString(myEmissions.NOx * vehFactor, 6) << - "\" fuel_perVeh=\"" << OutputDevice::realString(myEmissions.fuel * vehFactor, 6) << - "\" electricity_perVeh=\"" << OutputDevice::realString(myEmissions.electricity * vehFactor, 6); + if (attributeMask == 0) { + dev << "\n "; + } + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, OutputDevice::realString(traveltime)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO_PERVEH, OutputDevice::realString(vehFactor * myEmissions.CO, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO2_PERVEH, OutputDevice::realString(vehFactor * myEmissions.CO2, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_HC_PERVEH, OutputDevice::realString(vehFactor * myEmissions.HC, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_PMX_PERVEH, OutputDevice::realString(vehFactor * myEmissions.PMx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_NOX_PERVEH, OutputDevice::realString(vehFactor * myEmissions.NOx, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_FUEL_PERVEH, OutputDevice::realString(vehFactor * myEmissions.fuel, 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ELECTRICITY_PERVEH, OutputDevice::realString(vehFactor * myEmissions.electricity, 6)); } else if (defaultTravelTime >= 0.) { const MSVehicleType* t = MSNet::getInstance()->getVehicleControl().getVType(); const double speed = MIN2(myLaneLength / defaultTravelTime, t->getMaxSpeed()); - dev << "\"\n traveltime=\"" << OutputDevice::realString(defaultTravelTime) << - "\" CO_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::CO, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" CO2_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::CO2, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" HC_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::HC, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" PMx_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::PM_X, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" NOx_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::NO_X, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" fuel_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::FUEL, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6) << // @todo: give correct slope - "\" electricity_perVeh=\"" << OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::ELEC, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6); // @todo: give correct slope + + if (attributeMask == 0) { + dev << "\n "; + } + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, OutputDevice::realString(defaultTravelTime)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::CO, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_CO2_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::CO2, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_HC_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::HC, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_PMX_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::PM_X, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_NOX_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::NO_X, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_FUEL_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::FUEL, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ELECTRICITY_PERVEH, OutputDevice::realString(PollutantsInterface::computeDefault(t->getEmissionClass(), PollutantsInterface::ELEC, speed, t->getCarFollowModel().getMaxAccel(), 0, defaultTravelTime), 6)); } - dev << "\""; dev.closeTag(); } @@ -148,10 +166,11 @@ const bool trackVehicles, const double maxTravelTime, const double minSamples, - const std::string& vTypes) - : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, - withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes) { -} + const std::string& vTypes, + const std::string& writeAttributes) : + MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, + withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes, writeAttributes) +{ } MSMeanData_Emissions::~MSMeanData_Emissions() {} diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Emissions.h sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Emissions.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Emissions.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Emissions.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Emission data collector for edges/lanes /****************************************************************************/ -#ifndef MSMeanData_Emissions_h -#define MSMeanData_Emissions_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,7 +89,7 @@ * @param[in] length The length of the object for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void write(OutputDevice& dev, const SUMOTime period, + void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const; @@ -106,6 +100,17 @@ */ void notifyMoveInternal(const SUMOTrafficObject& veh, const double /* frontOnLane */, const double timeOnLane, const double /*meanSpeedFrontOnLane*/, const double meanSpeedVehicleOnLane, const double travelledDistanceFrontOnLane, const double travelledDistanceVehicleOnLane, const double /* meanLengthOnLane */); + /** @brief Computes idling emission values and adds them to the aggregate emission sums + * + * Idling implied by zero velocity, acceleration and slope + * + * @param[in] veh The vehicle + * + * @see MSMoveReminder::notifyMove + * @see PollutantsInterface + */ + bool notifyIdle(SUMOTrafficObject& veh); + private: /// @brief Collected values @@ -134,7 +139,8 @@ const bool printDefaults, const bool withInternal, const bool trackVehicles, const double minSamples, const double maxTravelTime, - const std::string& vTypes); + const std::string& vTypes, + const std::string& writeAttributes); /// @brief Destructor @@ -160,9 +166,3 @@ MSMeanData_Emissions& operator=(const MSMeanData_Emissions&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData.h sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Data collector for edges/lanes /****************************************************************************/ -#ifndef MSMeanData_h -#define MSMeanData_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -147,7 +141,7 @@ * @param[in] numLanes The total number of lanes for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - virtual void write(OutputDevice& dev, const SUMOTime period, + virtual void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const = 0; @@ -163,6 +157,14 @@ return travelledDistance; } + /// @brief write attribute if it passed the attribute mask check + template + static void checkWriteAttribute(OutputDevice& dev, long long int attributeMask, const SumoXMLAttr attr, const T& val) { + if (attributeMask == 0 || attributeMask & ((long long int)1 << attr)) { + dev.writeAttr(attr, val); + } + } + protected: /// @brief The meandata parent const MSMeanData* const myParent; @@ -249,7 +251,7 @@ * @param[in] numLanes The total number of lanes for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void write(OutputDevice& dev, const SUMOTime period, + void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const; @@ -313,7 +315,8 @@ const bool trackVehicles, const int detectPersons, const double minSamples, const double maxTravelTime, - const std::string& vTypes); + const std::string& vTypes, + const std::string& writeAttributes); /// @brief Destructor @@ -436,6 +439,8 @@ const bool myDumpEmpty; private: + static long long int initWrittenAttributes(const std::string writeAttributes, const std::string& id); + /// @brief Information whether the output shall be edge-based (not lane-based) const bool myAmEdgeBased; @@ -454,6 +459,9 @@ /// @brief Whether vehicles are tracked const bool myTrackVehicles; + /// @brief bit mask for checking attributes to be written + const long long int myWrittenAttributes; + /// @brief The intervals for which output still has to be generated (only in the tracking case) std::list< std::pair > myPendingIntervals; @@ -465,9 +473,3 @@ MSMeanData& operator=(const MSMeanData&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Redirector for mean data output (net->edgecontrol) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -89,18 +84,19 @@ void -MSMeanData_Harmonoise::MSLaneMeanDataValues::write(OutputDevice& dev, const SUMOTime period, +MSMeanData_Harmonoise::MSLaneMeanDataValues::write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double /*numLanes*/, const double defaultTravelTime, const int /*numVehicles*/) const { - dev.writeAttr("noise", (meanNTemp != 0 ? (double)(10. * log10(meanNTemp * TS / STEPS2TIME(period))) : (double) 0.)); + const double noise = meanNTemp != 0 ? (double)(10. * log10(meanNTemp * TS / STEPS2TIME(period))) : (double) 0.; + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_NOISE, noise); if (sampleSeconds > myParent->myMinSamples) { double traveltime = myParent->myMaxTravelTime; if (travelledDistance > 0.f) { traveltime = MIN2(traveltime, myLaneLength * sampleSeconds / travelledDistance); } - dev.writeAttr("traveltime", traveltime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, traveltime); } else if (defaultTravelTime >= 0.) { // @todo default value for noise - dev.writeAttr("traveltime", defaultTravelTime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, defaultTravelTime); } dev.closeTag(); } @@ -116,9 +112,10 @@ const bool printDefaults, const bool withInternal, const bool trackVehicles, const double maxTravelTime, const double minSamples, - const std::string& vTypes) - : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, - withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes) { + const std::string& vTypes, + const std::string& writeAttributes) : + MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, + withInternal, trackVehicles, 0, maxTravelTime, minSamples, vTypes, writeAttributes) { } @@ -144,4 +141,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.h sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Harmonoise.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Noise data collector for edges/lanes /****************************************************************************/ -#ifndef MSMeanData_Harmonoise_h -#define MSMeanData_Harmonoise_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -96,7 +90,7 @@ * @param[in] length The length of the object for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void write(OutputDevice& dev, const SUMOTime period, + void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const; @@ -145,7 +139,8 @@ const bool printDefaults, const bool withInternal, const bool trackVehicles, const double minSamples, const double maxTravelTime, - const std::string& vTypes); + const std::string& vTypes, + const std::string& writeAttributes); /// @brief Destructor @@ -172,9 +167,3 @@ MSMeanData_Harmonoise& operator=(const MSMeanData_Harmonoise&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Net.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Net.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Net.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Net.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Network state mean data collector for edges/lanes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -160,9 +155,9 @@ frontSampleSeconds += frontOnLane; frontTravelledDistance += travelledDistanceFrontOnLane; if (minimalVehicleLength == INVALID_DOUBLE) { - minimalVehicleLength = veh.getVehicleType().getLength(); + minimalVehicleLength = veh.getVehicleType().getLengthWithGap(); } else { - minimalVehicleLength = MIN2(minimalVehicleLength, veh.getVehicleType().getLength()); + minimalVehicleLength = MIN2(minimalVehicleLength, veh.getVehicleType().getLengthWithGap()); } #ifdef DEBUG_OCCUPANCY2 // refs #3265 @@ -187,7 +182,7 @@ ++nVehLaneChangeFrom; } else if (myParent == nullptr || reason != MSMoveReminder::NOTIFICATION_SEGMENT) { ++nVehLeft; - if (reason == MSMoveReminder::NOTIFICATION_VAPORIZED) { + if (reason > MSMoveReminder::NOTIFICATION_ARRIVED) { ++nVehVaporized; } } @@ -233,9 +228,12 @@ void -MSMeanData_Net::MSLaneMeanDataValues::write(OutputDevice& dev, const SUMOTime period, +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 density = MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength, + 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS)); + const double laneDensity = density / numLanes; #ifdef DEBUG_OCCUPANCY2 // tests #3264 double occupancy = occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 100; @@ -246,18 +244,23 @@ } // refs #3265 std::cout << SIMTIME << "ID: " << getDescription() << " minVehicleLength=" << minimalVehicleLength - << "\ndensity=" << MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength, 1. / MAX2(minimalVehicleLength, NUMERICAL_EPS)) << std::endl; + << "\ndensity=" << density << "\n"; #endif if (myParent == nullptr) { if (sampleSeconds > 0) { - dev.writeAttr("density", MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength, 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS))) - .writeAttr("occupancy", occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 100) - .writeAttr("waitingTime", waitSeconds).writeAttr("speed", travelledDistance / sampleSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_DENSITY, density); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LANEDENSITY, laneDensity); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_OCCUPANCY, occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 100); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_WAITINGTIME, waitSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_SPEED, travelledDistance / sampleSeconds); } - dev.writeAttr("departed", nVehDeparted).writeAttr("arrived", nVehArrived).writeAttr("entered", nVehEntered).writeAttr("left", nVehLeft); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_DEPARTED, nVehDeparted); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ARRIVED, nVehArrived); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ENTERED, nVehEntered); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LEFT, nVehLeft); if (nVehVaporized > 0) { - dev.writeAttr("vaporized", nVehVaporized); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_VAPORIZED, nVehVaporized); } dev.closeTag(); return; @@ -270,27 +273,36 @@ overlapTraveltime = MIN2(overlapTraveltime, (myLaneLength + vehLengthSum / sampleSeconds) * sampleSeconds / travelledDistance); } if (numVehicles > 0) { - dev.writeAttr("traveltime", sampleSeconds / numVehicles).writeAttr("waitingTime", waitSeconds).writeAttr("speed", travelledDistance / sampleSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, sampleSeconds / numVehicles); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_WAITINGTIME, waitSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_SPEED, travelledDistance / sampleSeconds); } else { double traveltime = myParent->myMaxTravelTime; if (frontTravelledDistance > NUMERICAL_EPS) { traveltime = MIN2(traveltime, myLaneLength * frontSampleSeconds / frontTravelledDistance); - dev.writeAttr("traveltime", traveltime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, traveltime); } else if (defaultTravelTime >= 0.) { - dev.writeAttr("traveltime", defaultTravelTime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, defaultTravelTime); } - dev.writeAttr("overlapTraveltime", overlapTraveltime) - .writeAttr("density", MIN2(sampleSeconds / STEPS2TIME(period) * (double) 1000 / myLaneLength, 1000. * numLanes / MAX2(minimalVehicleLength, NUMERICAL_EPS))) - .writeAttr("occupancy", occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 100) - .writeAttr("waitingTime", waitSeconds).writeAttr("speed", travelledDistance / sampleSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_OVERLAPTRAVELTIME, overlapTraveltime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_DENSITY, density); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LANEDENSITY, laneDensity); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_OCCUPANCY, occupationSum / STEPS2TIME(period) / myLaneLength / numLanes * (double) 100); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_WAITINGTIME, waitSeconds); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_SPEED, travelledDistance / sampleSeconds); } } else if (defaultTravelTime >= 0.) { - dev.writeAttr("traveltime", defaultTravelTime).writeAttr("speed", myLaneLength / defaultTravelTime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_TRAVELTIME, defaultTravelTime); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_SPEED, myLaneLength / defaultTravelTime); } - dev.writeAttr("departed", nVehDeparted).writeAttr("arrived", nVehArrived).writeAttr("entered", nVehEntered).writeAttr("left", nVehLeft) - .writeAttr("laneChangedFrom", nVehLaneChangeFrom).writeAttr("laneChangedTo", nVehLaneChangeTo); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_DEPARTED, nVehDeparted); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ARRIVED, nVehArrived); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_ENTERED, nVehEntered); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LEFT, nVehLeft); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LANECHANGEDFROM, nVehLaneChangeFrom); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_LANECHANGEDTO, nVehLaneChangeTo); if (nVehVaporized > 0) { - dev.writeAttr("vaporized", nVehVaporized); + checkWriteAttribute(dev, attributeMask, SUMO_ATTR_VAPORIZED, nVehVaporized); } dev.closeTag(); } @@ -308,11 +320,12 @@ const double maxTravelTime, const double minSamples, const double haltSpeed, - const std::string& vTypes) - : MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, - withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes), - myHaltSpeed(haltSpeed) { -} + const std::string& vTypes, + const std::string& writeAttributes) : + MSMeanData(id, dumpBegin, dumpEnd, useLanes, withEmpty, printDefaults, + withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, vTypes, writeAttributes), + myHaltSpeed(haltSpeed) +{ } MSMeanData_Net::~MSMeanData_Net() {} @@ -325,4 +338,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Net.h sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Net.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSMeanData_Net.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSMeanData_Net.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Network state mean data collector for edges/lanes /****************************************************************************/ -#ifndef MSMeanData_Net_h -#define MSMeanData_Net_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -128,7 +122,7 @@ * @param[in] numLanes The total number of lanes for which the data was collected * @exception IOError If an error on writing occurs (!!! not yet implemented) */ - void write(OutputDevice& dev, const SUMOTime period, + void write(OutputDevice& dev, long long int attributeMask, const SUMOTime period, const double numLanes, const double defaultTravelTime, const int numVehicles = -1) const; @@ -222,7 +216,8 @@ const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, - const double haltSpeed, const std::string& vTypes); + const double haltSpeed, const std::string& vTypes, + const std::string& writeAttributes); /// @brief Destructor @@ -254,8 +249,3 @@ MSMeanData_Net& operator=(const MSMeanData_Net&); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSQueueExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSQueueExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSQueueExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSQueueExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Export the queueing length in front of a junction (very experimental!) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSQueueExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSQueueExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSQueueExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSQueueExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Export the queueing length in front of a junction (very experimental!) /****************************************************************************/ -#ifndef MSQueueExport_h -#define MSQueueExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -77,10 +71,3 @@ static void writeLane(OutputDevice& of, const MSLane& lane); }; - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSRouteProbe.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSRouteProbe.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSRouteProbe.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSRouteProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Writes route distributions at a certain edge /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSRouteProbe.h sumo-1.6.0+dfsg1/src/microsim/output/MSRouteProbe.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSRouteProbe.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSRouteProbe.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Writes route distributions at a certain edge /****************************************************************************/ -#ifndef MSRouteProbe_h -#define MSRouteProbe_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -146,8 +140,3 @@ }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSStopOut.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSStopOut.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSStopOut.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSStopOut.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Ouput information about planned vehicle stop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -107,11 +102,15 @@ + "', time " + time2string(MSNet::getInstance()->getCurrentTimeStep()) + " without entering the stop"); return; } + StopInfo& si = myStopped[veh]; double delay = -1; + double arrivalDelay = -1; if (stop.until >= 0) { delay = STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep() - stop.until); } - StopInfo& si = myStopped[veh]; + if (stop.arrival >= 0) { + arrivalDelay = STEPS2TIME(si.started - stop.arrival); + } myDevice.openTag("stopinfo"); myDevice.writeAttr(SUMO_ATTR_ID, veh->getID()); myDevice.writeAttr(SUMO_ATTR_TYPE, veh->getVehicleType().getID()); @@ -125,6 +124,9 @@ myDevice.writeAttr("started", time2string(si.started)); myDevice.writeAttr("ended", time2string(MSNet::getInstance()->getCurrentTimeStep())); myDevice.writeAttr("delay", delay); + if (stop.arrival >= 0) { + myDevice.writeAttr("arrivalDelay", arrivalDelay); + } myDevice.writeAttr("initialPersons", si.initialNumPersons); myDevice.writeAttr("loadedPersons", si.loadedPersons); myDevice.writeAttr("unloadedPersons", si.unloadedPersons); @@ -159,4 +161,5 @@ myStopped.erase(veh); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSStopOut.h sumo-1.6.0+dfsg1/src/microsim/output/MSStopOut.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSStopOut.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSStopOut.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Ouput information about planned vehicle stop /****************************************************************************/ -#ifndef MSStopOut_h -#define MSStopOut_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -132,9 +126,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSVTKExport.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSVTKExport.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSVTKExport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSVTKExport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Realises VTK Export /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -195,4 +190,5 @@ } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSVTKExport.h sumo-1.6.0+dfsg1/src/microsim/output/MSVTKExport.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSVTKExport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSVTKExport.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Produce a VTK output to use with Tools like ParaView /****************************************************************************/ -#ifndef MSVTKExport_h -#define MSVTKExport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -87,8 +81,3 @@ static std::string getOffset(int nr); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSVTypeProbe.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSVTypeProbe.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSVTypeProbe.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSVTypeProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Writes positions of vehicles that have a certain (named) type /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSVTypeProbe.h sumo-1.6.0+dfsg1/src/microsim/output/MSVTypeProbe.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSVTypeProbe.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSVTypeProbe.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Writes positions of vehicles that have a certain (named) type /****************************************************************************/ -#ifndef MSVTypeProbe_h -#define MSVTypeProbe_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -108,8 +102,3 @@ }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSXMLRawOut.cpp sumo-1.6.0+dfsg1/src/microsim/output/MSXMLRawOut.cpp --- sumo-1.5.0+dfsg1/src/microsim/output/MSXMLRawOut.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSXMLRawOut.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Realises dumping the complete network state /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -64,6 +59,9 @@ void MSXMLRawOut::writeEdge(OutputDevice& of, const MSEdge& edge, SUMOTime timestep) { + if (!MSGlobals::gUsingInternalLanes && !edge.isNormal()) { + return; + } //en bool dump = !MSGlobals::gOmitEmptyEdgesOnDump; if (!dump) { @@ -178,4 +176,5 @@ of.closeTag(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/output/MSXMLRawOut.h sumo-1.6.0+dfsg1/src/microsim/output/MSXMLRawOut.h --- sumo-1.5.0+dfsg1/src/microsim/output/MSXMLRawOut.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/output/MSXMLRawOut.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Realises dumping the complete network state /****************************************************************************/ -#ifndef MSXMLRawOut_h -#define MSXMLRawOut_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -118,9 +112,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -69,8 +64,8 @@ int step, SUMOTime delay, const std::map& parameter, const std::string& basePath) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TLTYPE_ACTUATED, phases, step, delay, parameter) { - + MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::ACTUATED, phases, step, delay, parameter), + myLastTrySwitchTime(0) { 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)); @@ -113,16 +108,12 @@ // change values for setting the loops and lanestate-detectors, here //SUMOTime inductLoopInterval = 1; // - LaneVectorVector::const_iterator i2; - LaneVector::const_iterator i; // build the induct loops std::map laneInductLoopMap; std::map inductLoopLaneMap; // in case loops are placed further upstream double maxDetectorGap = 0; - for (i2 = myLanes.begin(); i2 != myLanes.end(); ++i2) { - const LaneVector& lanes = *i2; - for (i = lanes.begin(); i != lanes.end(); i++) { - MSLane* lane = (*i); + for (LaneVector& lanes : myLanes) { + for (MSLane* lane : lanes) { if (noVehicles(lane->getPermissions())) { // do not build detectors on green verges or sidewalks continue; @@ -136,29 +127,43 @@ // only build detector if this lane is relevant for an actuated phase continue; } + const std::string customID = getParameter(lane->getID()); double length = lane->getLength(); - double speed = lane->getSpeedLimit(); - double inductLoopPosition = MIN2( - myDetectorGap * speed, - (STEPS2TIME(minDur) / myPassingTime + 0.5) * DEFAULT_LENGTH_WITH_GAP); - - // check whether the lane is long enough - double ilpos = length - inductLoopPosition; - MSLane* placementLane = lane; - while (ilpos < 0 && placementLane->getIncomingLanes().size() == 1) { - placementLane = placementLane->getLogicalPredecessorLane(); - ilpos += placementLane->getLength(); - } - if (ilpos < 0) { - ilpos = 0; - } - // Build the induct loop and set it into the container - std::string id = "TLS" + myID + "_" + myProgramID + "_InductLoopOn_" + lane->getID(); - MSInductLoop* loop = static_cast(nb.createInductLoop(id, placementLane, ilpos, myVehicleTypes, myShowDetectors)); + double ilpos; + double inductLoopPosition; + MSInductLoop* loop = nullptr; + if (customID == "") { + double speed = lane->getSpeedLimit(); + inductLoopPosition = MIN2( + myDetectorGap * speed, + (STEPS2TIME(minDur) / myPassingTime + 0.5) * DEFAULT_LENGTH_WITH_GAP); + + // check whether the lane is long enough + ilpos = length - inductLoopPosition; + MSLane* placementLane = lane; + while (ilpos < 0 && placementLane->getIncomingLanes().size() == 1) { + placementLane = placementLane->getLogicalPredecessorLane(); + ilpos += placementLane->getLength(); + } + if (ilpos < 0) { + ilpos = 0; + } + // Build the induct loop and set it into the container + std::string id = "TLS" + myID + "_" + myProgramID + "_InductLoopOn_" + lane->getID(); + loop = static_cast(nb.createInductLoop(id, placementLane, ilpos, myVehicleTypes, myShowDetectors)); + MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, myFile, myFreq); + } else { + loop = dynamic_cast(MSNet::getInstance()->getDetectorControl().getTypedDetectors(SUMO_TAG_INDUCTION_LOOP).get(customID)); + if (loop == nullptr) { + WRITE_ERROR("Unknown inductionLoop '" + customID + "' given as custom detector for actuated tlLogic '" + getID() + "', program '" + getProgramID() + "."); + continue; + } + ilpos = loop->getPosition(); + inductLoopPosition = length - ilpos; + } laneInductLoopMap[lane] = loop; inductLoopLaneMap[loop] = lane; myInductLoops.push_back(InductLoopInfo(loop, (int)myPhases.size())); - MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_INDUCTION_LOOP, loop, myFile, myFreq); maxDetectorGap = MAX2(maxDetectorGap, length - ilpos); if (warn && floor(floor(inductLoopPosition / DEFAULT_LENGTH_WITH_GAP) * myPassingTime) > STEPS2TIME(minDur)) { @@ -338,6 +343,34 @@ WRITE_WARNING("At actuated tlLogic '" + getID() + "', linkIndex " + toString(i) + " has no controlling detector"); } } + // parse maximum green times for each link (optional) + for (const auto& kv : getParametersMap()) { + if (StringUtils::startsWith(kv.first, "linkMaxDur:")) { + int link = StringUtils::toInt(kv.first.substr(11)); + if (link < 0 || link >= myNumLinks) { + WRITE_ERROR("Invalid link '" + kv.first.substr(11) + "' given as linkMaxDur parameter for actuated tlLogic '" + getID() + "', program '" + getProgramID() + "."); + continue; + } + if (myLinkMaxGreenTimes.empty()) { + myLinkMaxGreenTimes = std::vector(myNumLinks, std::numeric_limits::max()); + } + myLinkMaxGreenTimes[link] = string2time(kv.second); + } else if (StringUtils::startsWith(kv.first, "linkMinDur:")) { + int link = StringUtils::toInt(kv.first.substr(11)); + if (link < 0 || link >= myNumLinks) { + WRITE_ERROR("Invalid link '" + kv.first.substr(11) + "' given as linkMinDur parameter for actuated tlLogic '" + getID() + "', program '" + getProgramID() + "."); + continue; + } + if (myLinkMinGreenTimes.empty()) { + myLinkMinGreenTimes = std::vector(myNumLinks, 0); + } + myLinkMinGreenTimes[link] = string2time(kv.second); + } + } + if (myLinkMaxGreenTimes.size() > 0 || myLinkMinGreenTimes.size() > 0) { + myLinkGreenTimes = std::vector(myNumLinks, 0); + } + //std::cout << SIMTIME << " linkMaxGreenTimes=" << toString(myLinkMaxGreenTimes) << "\n"; } @@ -402,6 +435,20 @@ // @note any vehicles which arrived during the previous phases which are now waiting between the detector and the stop line are not // considere here. RiLSA recommends to set minDuration in a way that lets all vehicles pass the detector SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); + if (myLinkGreenTimes.size() > 0) { + // constraints exist, record green time durations for each link + const std::string& state = getCurrentPhaseDef().getState(); + SUMOTime lastDuration = now - myLastTrySwitchTime; + for (int i = 0; i < myNumLinks; i++) { + if (state[i] == 'G' || state[i] == 'g') { + myLinkGreenTimes[i] += lastDuration; + } else { + myLinkGreenTimes[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 @@ -414,21 +461,29 @@ } // decide the next phase const int origStep = myStep; + int nextStep = myStep; SUMOTime actDuration = now - myPhases[myStep]->myLastSwitch; if (multiTarget) { - myStep = decideNextPhase(); + nextStep = decideNextPhase(); } else { if (myPhases[myStep]->nextPhases.size() == 1 && myPhases[myStep]->nextPhases.front() >= 0) { - myStep = myPhases[myStep]->nextPhases.front(); + nextStep = myPhases[myStep]->nextPhases.front(); } else { - myStep++; + nextStep++; } } + if (nextStep == (int)myPhases.size()) { + nextStep = 0; + } + SUMOTime linkMinDur = getLinkMinDuration(getTarget(nextStep)); + if (linkMinDur > 0) { + // for multiTarget, the current phase must be extended but if another + // targer is chosen, earlier switching than linkMinDur is possible + return multiTarget ? TIME2STEPS(1) : linkMinDur; + } + myStep = nextStep; assert(myStep <= (int)myPhases.size()); assert(myStep >= 0); - if (myStep == (int)myPhases.size()) { - myStep = 0; - } //stores the time the phase started if (myStep != origStep) { myPhases[myStep]->myLastSwitch = now; @@ -492,7 +547,7 @@ // 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) { + if (actDuration >= getCurrentPhaseDef().maxDuration || maxLinkDurationReached()) { return result; // end current phase } @@ -518,7 +573,7 @@ int result = cands.front(); int maxPrio = 0; SUMOTime actDuration = MSNet::getInstance()->getCurrentTimeStep() - myPhases[myStep]->myLastSwitch; - const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration; + const bool canExtend = actDuration < getCurrentPhaseDef().maxDuration && !maxLinkDurationReached(); if (canExtend) { // consider keeping the current phase until maxDur is reached // (only when there is still traffic in that phase) @@ -539,7 +594,7 @@ std::cout << SIMTIME << " p=" << myStep << " step=" << step << " target=" << target << " loops=" << myInductLoopsForPhase[target].size() << " prio=" << prio << "\n"; } #endif - if (prio > maxPrio) { + if (prio > maxPrio && canExtendLinkGreen(target)) { maxPrio = prio; result = step; } @@ -578,7 +633,7 @@ } step = myPhases[step]->nextPhases.front(); } else { - step++; + step = (step + 1) % myPhases.size(); } if (step == origStep) { WRITE_WARNING("At actuated tlLogic '" + getID() + "', infinite transition loop from phase " + toString(origStep)); @@ -638,5 +693,54 @@ } } -/****************************************************************************/ +bool +MSActuatedTrafficLightLogic::maxLinkDurationReached() { + if (myLinkMaxGreenTimes.empty()) { + return false; + } + for (int i = 0; i < myNumLinks; i++) { + if (myLinkGreenTimes[i] >= myLinkMaxGreenTimes[i]) { + //std::cout << SIMTIME << " maxLinkDurationReached i=" << i << "\n"; + return true; + } + } + return false; +} + +bool +MSActuatedTrafficLightLogic::canExtendLinkGreen(int target) { + if (myLinkMaxGreenTimes.empty()) { + return true; + } + const std::string& targetState = myPhases[target]->getState(); + for (int i = 0; i < myNumLinks; i++) { + if (myLinkGreenTimes[i] >= myLinkMaxGreenTimes[i] && ( + targetState[i] == 'G' || targetState[i] == 'g')) { + //std::cout << SIMTIME << " cannotExtendLinkGreen target=" << target << " i=" << i << "\n"; + return false; + } + } + return true; +} + +SUMOTime +MSActuatedTrafficLightLogic::getLinkMinDuration(int target) const { + SUMOTime result = 0; + if (target != myStep && myLinkMinGreenTimes.size() > 0) { + const std::string& state = myPhases[myStep]->getState(); + const std::string& targetState = myPhases[target]->getState(); + for (int i = 0; i < myNumLinks; i++) { + if (myLinkGreenTimes[i] < myLinkMinGreenTimes[i] + && (state[i] == 'G' || state[i] == 'g') + && !(targetState[i] == 'G' || targetState[i] == 'g')) { + result = MAX2(result, myLinkMinGreenTimes[i] - myLinkGreenTimes[i]); + //std::cout << SIMTIME << " getLinkMinDuration myStep=" << myStep << " target=" << target << " i=" << i + // << " greenTime=" << STEPS2TIME(myLinkGreenTimes[i]) << " min=" << STEPS2TIME(myLinkMinGreenTimes[i]) << " result=" << STEPS2TIME(result) << "\n"; + } + } + } + return result; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSActuatedTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An actuated (adaptive) traffic light logic /****************************************************************************/ -#ifndef MSActuatedTrafficLightLogic_h -#define MSActuatedTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -148,6 +142,15 @@ /// @brief get the green phase following step int getTarget(int step); + /// @brief whether the current phase cannot be continued due to linkMaxDur constraints + bool maxLinkDurationReached(); + + /// @brief whether the target phase is acceptable in light of linkMaxDur constraints + bool canExtendLinkGreen(int target); + + /// @brief the minimum duratin for keeping the current phase due to linkMinDur constraints + SUMOTime getLinkMinDuration(int target) const; + protected: /// @brief A map from phase to induction loops to be used for gap control InductLoopMap myInductLoopsForPhase; @@ -179,10 +182,12 @@ /// Whether detector output separates by vType std::string myVehicleTypes; + /// @brief last time trySwitch was called + SUMOTime myLastTrySwitchTime; + /// @brief consecutive time that the given link index has been green + std::vector myLinkGreenTimes; + /// @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; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // An actuated traffic light logic based on time delay of approaching vehicles /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -52,7 +47,7 @@ int step, SUMOTime delay, const std::map& parameter, const std::string& basePath) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TLTYPE_DELAYBASED, phases, step, delay, parameter) { + MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::DELAYBASED, phases, step, delay, parameter) { #ifdef DEBUG_TIMELOSS_CONTROL std::cout << "Building delay based tls logic '" << id << "'" << std::endl; #endif @@ -90,10 +85,22 @@ continue; } // Build the detectors and register them at the detector control - std::string id = "TLS" + myID + "_" + myProgramID + "_E2CollectorOn_" + lane->getID(); if (myLaneDetectors.find(lane) == myLaneDetectors.end()) { - myLaneDetectors[lane] = nb.createE2Detector(id, DU_TL_CONTROL, lane, INVALID_POSITION, lane->getLength(), myDetectionRange, 0, 0, 0, myVehicleTypes, myShowDetectors); - MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_E2DETECTOR, myLaneDetectors[lane], myFile, myFreq); + MSE2Collector* det = nullptr; + const std::string customID = getParameter(lane->getID()); + if (customID != "") { + det = dynamic_cast(MSNet::getInstance()->getDetectorControl().getTypedDetectors(SUMO_TAG_LANE_AREA_DETECTOR).get(customID)); + if (det == nullptr) { + WRITE_ERROR("Unknown laneAreaDetector '" + customID + "' given as custom detector for delay_based tlLogic '" + getID() + "', program '" + getProgramID() + "."); + continue; + } + det->setVisible(myShowDetectors); + } else { + std::string id = "TLS" + myID + "_" + myProgramID + "_E2CollectorOn_" + lane->getID(); + det = nb.createE2Detector(id, DU_TL_CONTROL, lane, INVALID_POSITION, lane->getLength(), myDetectionRange, 0, 0, 0, myVehicleTypes, myShowDetectors); + MSNet::getInstance()->getDetectorControl().add(SUMO_TAG_LANE_AREA_DETECTOR, det, myFile, myFreq); + } + myLaneDetectors[lane] = det; } } } @@ -242,6 +249,14 @@ return newPhase->minDuration; } +void +MSDelayBasedTrafficLightLogic::setShowDetectors(bool show) { + myShowDetectors = show; + for (auto& item : myLaneDetectors) { + item.second->setVisible(myShowDetectors); + } +} + -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDelayBasedTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An actuated traffic light logic based on time delay of approaching vehicles /****************************************************************************/ -#ifndef MSDelayBasedTrafficLightLogic_h -#define MSDelayBasedTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -34,6 +28,7 @@ // class declarations // =========================================================================== class NLDetectorBuilder; +class MSE2Collector; // =========================================================================== @@ -51,7 +46,7 @@ public: /// @brief Definition of a map from lanes to corresponding areal detectors // typedef std::map LaneDetectorMap; - typedef std::map LaneDetectorMap; + typedef std::map LaneDetectorMap; public: /** @brief Constructor @@ -93,6 +88,12 @@ SUMOTime trySwitch(); /// @} + bool showDetectors() const { + return myShowDetectors; + } + + void setShowDetectors(bool show); + protected: /// @name "actuated" algorithm methods @@ -121,9 +122,6 @@ /// A map from lanes to the corresponding lane detectors LaneDetectorMap myLaneDetectors; - /// Whether the detectors shall be shown in the GUI - bool myShowDetectors; - /// Range of the connected detector, which provides the information on approaching vehicles double myDetectionRange; @@ -132,6 +130,9 @@ // (Idea: this might be adapted to the detector-length and the vehicle's maximal speed) double myTimeLossThreshold; + /// Whether the detectors shall be shown in the GUI + bool myShowDetectors; + /// The output file for generated detectors std::string myFile; @@ -141,9 +142,3 @@ /// Whether detector output separates by vType std::string myVehicleTypes; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -24,7 +24,7 @@ MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) : - MSSOTLHiLevelTrafficLightLogic(tlcontrol, id, programID, TLTYPE_HILVL_DETERMINISTIC, phases, step, + MSSOTLHiLevelTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::HILVL_DETERMINISTIC, phases, step, delay, parameters) { addPolicy(new MSSOTLPlatoonPolicy(new MSSOTLPolicy3DStimulus("PLATOON", parameters), parameters)); diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSDeterministicHiLevelTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // The class for deterministic high level traffic light logic /****************************************************************************/ -#ifndef MSDeterministicHiLevelTrafficLightLogic_h -#define MSDeterministicHiLevelTrafficLightLogic_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #define SWARM_DEBUG @@ -121,6 +116,3 @@ }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,9 +19,6 @@ /// // A traffic lights logic which represents a tls in an off-mode /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -38,7 +35,7 @@ // =========================================================================== MSOffTrafficLightLogic::MSOffTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id) : - MSTrafficLightLogic(tlcontrol, id, "off", TLTYPE_OFF, 0, std::map()) { + MSTrafficLightLogic(tlcontrol, id, "off", TrafficLightType::OFF, 0, std::map()) { myDefaultCycleTime = TIME2STEPS(120); } @@ -145,6 +142,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSOffTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A traffic lights logic which represents a tls in an off-mode /****************************************************************************/ -#ifndef MSOffTrafficLightLogic_h -#define MSOffTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -203,9 +197,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhaseDefinition.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhaseDefinition.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhaseDefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhaseDefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,19 +21,12 @@ /// // The definition of a single phase of a tls logic /****************************************************************************/ -#ifndef MSPhaseDefinition_h -#define MSPhaseDefinition_h +#pragma once #define TARGET_BIT 0 #define TRANSIENT_NOTDECISIONAL_BIT 1 #define COMMIT_BIT 2 #define UNDEFINED_BIT 3 - - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -298,8 +291,3 @@ } }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The base class for traffic light logic with phases /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPhasedTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The base class for traffic light logic with phases /****************************************************************************/ -#ifndef MSPhasedTrafficLightLogic_h -#define MSPhasedTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -197,9 +191,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPushButton.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPushButton.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSPushButton.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSPushButton.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // The class for a PushButton /****************************************************************************/ -#ifndef SRC_MICROSIM_TRAFFIC_LIGHTS_MSPUSHBUTTON_H_ -#define SRC_MICROSIM_TRAFFIC_LIGHTS_MSPUSHBUTTON_H_ +#pragma once #include #include @@ -104,4 +103,3 @@ static void loadCrossingEdgeMap(); }; -#endif /* SRC_MICROSIM_TRAFFIC_LIGHTS_MSPUSHBUTTON_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A rail signal logic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -44,7 +39,7 @@ MSRailCrossing::MSRailCrossing(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, SUMOTime delay, const std::map& parameters) : - MSSimpleTrafficLightLogic(tlcontrol, id, programID, TLTYPE_RAIL_CROSSING, Phases(), 0, delay, parameters), + MSSimpleTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::RAIL_CROSSING, Phases(), 0, delay, parameters), // XXX make this configurable mySecurityGap(TIME2STEPS(15)), myMinGreenTime(TIME2STEPS(5)), @@ -161,4 +156,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailCrossing.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A rail signal logic /****************************************************************************/ -#ifndef MSRailCrossing_h -#define MSRailCrossing_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSimpleTrafficLightLogic.h" @@ -159,9 +153,3 @@ SUMOTime myYellowTime; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A rail signal logic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -64,6 +59,7 @@ #define DEBUG_SIGNALSTATE #define DEBUG_SIGNALSTATE_PRIORITY #define DEBUG_FIND_PROTECTION +//#define DEBUG_DRIVEWAY_BUILDROUTE //#define DEBUG_REROUTE #define DEBUG_COND DEBUG_HELPER(this) @@ -83,7 +79,7 @@ MSRailSignal::MSRailSignal(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, SUMOTime delay, const std::map& parameters) : - MSTrafficLightLogic(tlcontrol, id, programID, TLTYPE_RAIL_SIGNAL, delay, parameters), + MSTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::RAIL_SIGNAL, delay, parameters), myCurrentPhase(DELTA_T, std::string(SUMO_MAX_CONNECTIONS, 'X'), -1), // dummy phase myPhaseIndex(0) { myDefaultCycleTime = DELTA_T; @@ -298,7 +294,7 @@ bool MSRailSignal::hasOncomingRailTraffic(MSLink* link) { - if (link->getJunction()->getType() == NODETYPE_RAIL_SIGNAL && link->getState() == LINKSTATE_TL_RED) { + if (link->getJunction()->getType() == SumoXMLNodeType::RAIL_SIGNAL && link->getState() == LINKSTATE_TL_RED) { const MSEdge* bidi = link->getLaneBefore()->getEdge().getBidiEdge(); if (bidi == nullptr) { return false; @@ -364,7 +360,25 @@ MSEdge* first = &myLink->getLane()->getEdge(); MSRouteIterator firstIt = std::find(veh->getCurrentRouteEdge(), veh->getRoute().end(), first); if (firstIt == veh->getRoute().end()) { - WRITE_WARNING("Invalid approach information after rerouting"); + // possibly the vehicle has already gone past the first edge (i.e. + // because first is short or the step-length is high) + // lets look backward along the route + // give some slack because the vehicle might have been braking from a higher speed and using ballistic integration + double lookBack = SPEED2DIST(veh->getSpeed() + 10); + int routeIndex = veh->getRoutePosition() - 1; + while (lookBack > 0 && routeIndex > 0) { + const MSEdge* prevEdge = veh->getRoute().getEdges()[routeIndex]; + if (prevEdge == first) { + firstIt = veh->getRoute().begin() + routeIndex; + break; + } + lookBack -= prevEdge->getLength(); + routeIndex--; + } + } + if (firstIt == veh->getRoute().end()) { + WRITE_WARNING("Invalid approach information after rerouting for vehicle '" + veh->getID() + + "' time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); return myDriveways.front(); } //std::cout << SIMTIME << " veh=" << veh->getID() << " rsl=" << getID() << " dws=" << myDriveways.size() << "\n"; @@ -460,11 +474,12 @@ MSRailSignal::LinkInfo::reroute(SUMOVehicle* veh, const MSEdgeVector& occupied) { MSDevice_Routing* rDev = static_cast(veh->getDevice(typeid(MSDevice_Routing))); const SUMOTime now = MSNet::getInstance()->getCurrentTimeStep(); - if (rDev != nullptr && - (myLastRerouteVehicle != veh - // reroute each vehicle only once if no periodic routing is allowed, - // otherwise with the specified period - || (rDev->getPeriod() > 0 && myLastRerouteTime + rDev->getPeriod() <= now))) { + if (rDev != nullptr + && rDev->mayRerouteRailSignal() + && (myLastRerouteVehicle != veh + // reroute each vehicle only once if no periodic routing is allowed, + // otherwise with the specified period + || (rDev->getPeriod() > 0 && myLastRerouteTime + rDev->getPeriod() <= now))) { myLastRerouteVehicle = veh; myLastRerouteTime = now; @@ -493,7 +508,9 @@ bool MSRailSignal::DriveWay::reserve(const Approaching& closest, MSEdgeVector& occupied) { - if (conflictLaneOccupied()) { + const SUMOVehicleParameter::Stop* stop = closest.first->getNextStopParameter(); + const std::string joinVehicle = stop != nullptr ? stop->join : ""; + if (conflictLaneOccupied(joinVehicle)) { for (MSLane* bidi : myBidi) { if (!bidi->empty() && bidi->getBidiLane() != nullptr) { occupied.push_back(&bidi->getBidiLane()->getEdge()); @@ -609,14 +626,31 @@ bool -MSRailSignal::DriveWay::conflictLaneOccupied() const { +MSRailSignal::DriveWay::conflictLaneOccupied(const std::string& joinVehicle) const { for (const MSLane* lane : myConflictLanes) { if (!lane->isEmpty()) { #ifdef DEBUG_SIGNALSTATE if (gDebugFlag4) { std::cout << SIMTIME << " conflictLane " << lane->getID() << " occupied\n"; + if (joinVehicle != "") { + std::cout << " joinVehicle=" << joinVehicle << " occupant=" << toString(lane->getVehiclesSecure()) << "\n"; + lane->releaseVehicles(); + } } #endif + if (lane->getVehicleNumber() == 1 && joinVehicle != "") { + std::vector vehs = lane->getVehiclesSecure(); + const bool ignoreJoinTarget = vehs.front()->getID() == joinVehicle && vehs.front()->isStopped(); + lane->releaseVehicles(); + if (ignoreJoinTarget) { +#ifdef DEBUG_SIGNALSTATE + if (gDebugFlag4) { + std::cout << " ignore join-target '" << joinVehicle << ";\n"; + } +#endif + continue; + } + } return true; } } @@ -730,7 +764,11 @@ bool seekForwardSignal = true; bool seekBidiSwitch = true; MSLane* toLane = origin->getViaLaneOrLane(); - //std::cout << "buildRoute origin=" << getTLLinkID(origin) << " vehRoute=" << toString(ConstMSEdgeVector(next, end)) << " visited=" << joinNamedToString(visited, " ") << "\n"; +#ifdef DEBUG_DRIVEWAY_BUILDROUTE + gDebugFlag4 = getClickableTLLinkID(origin) == "junction '36745', link 0"; + if (gDebugFlag4) std::cout << "buildRoute origin=" << getTLLinkID(origin) << " vehRoute=" << toString(ConstMSEdgeVector(next, end)) + << " visited=" << joinNamedToString(visited, " ") << "\n"; +#endif while ((seekForwardSignal || seekBidiSwitch)) { if (length > MAX_BLOCK_LENGTH) { if (myNumWarnings < MAX_SIGNAL_WARNINGS) { @@ -741,9 +779,14 @@ // length exceeded return; } - //std::cout << " toLane=" << toLane->getID() << " visited=" << joinNamedToString(visited, " ") << "\n"; +#ifdef DEBUG_DRIVEWAY_BUILDROUTE + if (gDebugFlag4) { + std::cout << " toLane=" << toLane->getID() << " visited=" << joinNamedToString(visited, " ") << "\n"; + } +#endif if (visited.count(toLane) != 0) { WRITE_WARNING("Found circular block after railSignal " + getClickableTLLinkID(origin) + " (" + toString(myRoute.size()) + " edges, length " + toString(length) + ")"); + //std::cout << getClickableTLLinkID(origin) << " circularBlock1=" << toString(myRoute) << " visited=" << joinNamedToString(visited, " ") << "\n"; return; } if (toLane->getEdge().isNormal()) { @@ -766,11 +809,11 @@ if (!seekForwardSignal) { // look for switch that could protect from oncoming vehicles for (const auto& ili : bidi->getIncomingLanes()) { - if (ili.viaLink->getDirection() == LINKDIR_TURN) { + if (ili.viaLink->getDirection() == LinkDirection::TURN) { continue; } for (MSLink* link : ili.lane->getLinkCont()) { - if (link->getDirection() == LINKDIR_TURN) { + if (link->getDirection() == LinkDirection::TURN) { continue; } if (link->getViaLaneOrLane() != bidi) { @@ -783,15 +826,21 @@ } } const MSLinkCont& links = toLane->getLinkCont(); + const MSEdge* current = &toLane->getEdge(); toLane = nullptr; for (MSLink* link : links) { if (((next != end && &link->getLane()->getEdge() == *next) || - (next == end && link->getDirection() != LINKDIR_TURN)) + (next == end && link->getDirection() != LinkDirection::TURN)) && isRailway(link->getViaLaneOrLane()->getPermissions())) { toLane = link->getViaLaneOrLane(); + if (link->getLane()->getBidiLane() != nullptr && &link->getLane()->getEdge() == current->getBidiEdge()) { + // do not follow turn-arounds even if the route contains a reversal + return; + } if (link->getTLLogic() != nullptr) { if (link->getTLLogic() == origin->getTLLogic()) { WRITE_WARNING("Found circular block at railSignal " + getClickableTLLinkID(origin) + " (" + toString(myRoute.size()) + " edges, length " + toString(length) + ")"); + //std::cout << getClickableTLLinkID(origin) << " circularBlock2=" << toString(myRoute) << "\n"; return; } seekForwardSignal = false; @@ -897,7 +946,7 @@ #ifdef DEBUG_CHECK_FLANKS std::cout << " lane=" << lane->getID() << " cand=" << l2->getDescription() << "\n"; #endif - if (l2->getDirection() != LINKDIR_TURN && l2->getLane() != link->getLane()) { + if (l2->getDirection() != LinkDirection::TURN && l2->getLane() != link->getLane()) { foundPSwitch = true; // found potential protection #ifdef DEBUG_CHECK_FLANKS @@ -910,7 +959,7 @@ myFlank.push_back(lane); // continue search for protection upstream recursively for (auto ili : lane->getIncomingLanes()) { - if (ili.viaLink->getDirection() != LINKDIR_TURN) { + if (ili.viaLink->getDirection() != LinkDirection::TURN) { findFlankProtection(ili.viaLink, length, visited, origLink); } } @@ -923,4 +972,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSRailSignal.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A rail signal logic /****************************************************************************/ -#ifndef MSRailSignal_h -#define MSRailSignal_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -273,8 +267,8 @@ * current link and any of the conflict links */ std::vector myConflictLinks; - /// @brief whether any of myConflictLanes is occupied - bool conflictLaneOccupied() const; + /// @brief whether any of myConflictLanes is occupied (vehicles that are the target of a join must be ignored) + bool conflictLaneOccupied(const std::string& joinVehicle = "") const; /// @brief attempt reserve this driveway for the given vehicle bool reserve(const Approaching& closest, MSEdgeVector& occupied); @@ -378,9 +372,3 @@ static int myNumWarnings; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A fixed traffic light logic /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -221,4 +216,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSimpleTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A fixed traffic light logic /****************************************************************************/ -#ifndef MSSimpleTrafficLightLogic_h -#define MSSimpleTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -210,9 +204,3 @@ void deletePhases(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLCongestionPolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ // The class for SOTL Congestion logics /****************************************************************************/ -#ifndef MSTLCONGESTIONPOLICY_H_ -#define MSTLCONGESTIONPOLICY_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -54,4 +49,3 @@ }; -#endif /* MSSOTLCONGESTIONTRAFFICLIGHTLOGIC_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLDefinitions.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLDefinitions.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLDefinitions.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLDefinitions.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // The repository for definitions about SOTL and Swarm-based logics /****************************************************************************/ -#ifndef MSSOTLDefinitions_h -#define MSSOTLDefinitions_h +#pragma once ///For MSSOTLSensors //SENSOR_START in meters, counting from the traffic light and moving backward with respect to traffic direction @@ -78,6 +77,3 @@ typedef std::map LaneCheckMap; typedef std::vector LaneIdVector; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLE2Sensors.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLE2Sensors.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLE2Sensors.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLE2Sensors.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,8 +20,7 @@ // XXX: Not tested with MSMultiLaneE2Collector (Generalization of MSE2Collector). If this is to be used in the future and you run into problems, // start taking a look at the getEstimateQueueLength() method of the collector. /****************************************************************************/ -#ifndef MSSOTLE2Sensors_h -#define MSSOTLE2Sensors_h +#pragma once #define SWARM_DEBUG @@ -152,6 +151,3 @@ std::map m_typeWeightMap; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLHiLevelTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// @date Jun 2013 /// /****************************************************************************/ -#ifndef MSSOTLTrafficLightLogic_H -#define MSSOTLTrafficLightLogic_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -123,4 +118,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLMarchingPolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ // The class for SOTL Marching logics /****************************************************************************/ -#ifndef MSTLMARCHINGPOLICY_H_ -#define MSTLMARCHINGPOLICY_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLPolicy.h" @@ -51,6 +46,3 @@ void init(); }; - -#endif /* MSSOTLMARCHINGTRAFFICLIGHTLOGIC_H_ */ -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhasePolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhasePolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhasePolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhasePolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The class for SOTL Phase logics /****************************************************************************/ -#ifndef MSTLPhasePolicy_h -#define MSTLPhasePolicy_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLPolicy.h" @@ -49,6 +44,3 @@ void init(); bool m_useVehicleTypesWeights; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -25,7 +25,7 @@ const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) : - MSSOTLTrafficLightLogic(tlcontrol, id, programID, TLTYPE_SOTL_PHASE, phases, step, delay, + MSSOTLTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::SOTL_PHASE, phases, step, delay, parameters) { MsgHandler::getMessageInstance()->inform( "*** Intersection " + id @@ -37,7 +37,7 @@ const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters, MSSOTLSensors* sensors) : - MSSOTLTrafficLightLogic(tlcontrol, id, programID, TLTYPE_SOTL_PHASE, phases, step, delay, + MSSOTLTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::SOTL_PHASE, phases, step, delay, parameters, sensors) { } diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPhaseTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The class for SOTL Phase logics /****************************************************************************/ -#ifndef MSSOTLPhaseTrafficLightLogic_h -#define MSSOTLPhaseTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLTrafficLightLogic.h" @@ -63,6 +57,3 @@ */ bool canRelease(); }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPlatoonPolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The class for SOTL Platoon logics /****************************************************************************/ -#ifndef MSTLPlatoonPolicy_h -#define MSTLPlatoonPolicy_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #define SWARM_DEBUG @@ -51,6 +46,3 @@ protected: void init(); }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy3DStimulus.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ // The class the low-level policy stimulus /****************************************************************************/ -#ifndef MSSOTLPOLICY3DSTIMULUS_H_ -#define MSSOTLPOLICY3DSTIMULUS_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -48,4 +43,3 @@ }; -#endif /* MSSOTLPOLICYSTIMULUS_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The class for Swarm-based low-level policy /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DFamilyStimulus.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The class the low-level policy stimulus /****************************************************************************/ - -#ifndef MSSOTLPOLICY5DFAMILYSTIMULUS_H_ -#define MSSOTLPOLICY5DFAMILYSTIMULUS_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -78,4 +72,3 @@ virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure); }; -#endif /* MSSOTLPOLICY5DFAMILYSTIMULUS_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy5DStimulus.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The class the low-level policy stimulus /****************************************************************************/ - -#ifndef MSSOTLPOLICY5DSTIMULUS_H_ -#define MSSOTLPOLICY5DSTIMULUS_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -165,4 +159,3 @@ virtual double computeDesirability(double vehInMeasure, double vehOutMeasure, double vehInDispersionMeasure, double vehOutDispersionMeasure); }; -#endif /* MSSOTLPOLICYSTIMULUS_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyBasedTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ // The class for SOTL Policy-based logics /****************************************************************************/ -#ifndef MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ -#define MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -110,4 +105,3 @@ MSSOTLPolicy* myPolicy; }; -#endif /* MSSOTLPOLICYBASEDTRAFFICLIGHTLOGIC_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicyDesirability.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The class a low-level policy desirability /****************************************************************************/ - -#ifndef MSSOTLPOLICYDESIRABILITY_H_ -#define MSSOTLPOLICYDESIRABILITY_H_ - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -68,4 +62,3 @@ }; -#endif /* MSSOTLPOLICYDESIRABILITY_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLPolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,12 +21,7 @@ // The class for low-level policy /****************************************************************************/ -#ifndef MSTLPolicy_h -#define MSTLPolicy_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -132,4 +127,3 @@ double computeDesirability(double vehInMeasure, double vehOutMeasure); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLRequestPolicy.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLRequestPolicy.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLRequestPolicy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLRequestPolicy.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The class for SOTL Request logics /****************************************************************************/ -#ifndef MSTLRequestPolicy_h -#define MSTLRequestPolicy_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLPolicy.h" @@ -50,6 +45,3 @@ } }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLSensors.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLSensors.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLSensors.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLSensors.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The base abstract class for SOTL sensors /****************************************************************************/ -#ifndef MSSOTLSensors_h -#define MSSOTLSensors_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLDefinitions.h" @@ -132,6 +127,3 @@ currentStep = newStep; } }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// // The base abstract class for SOTL logics /****************************************************************************/ -#ifndef MSSOTLTrafficLightLogic_h -#define MSSOTLTrafficLightLogic_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -292,6 +287,3 @@ } }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -26,7 +26,7 @@ const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) : - MSSOTLTrafficLightLogic(tlcontrol, id, programID, TLTYPE_SOTL_WAVE, phases, step, delay, + MSSOTLTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::SOTL_WAVE, phases, step, delay, parameters) { MsgHandler::getMessageInstance()->inform( "*** Intersection " + id @@ -42,7 +42,7 @@ const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters, MSSOTLSensors* sensors) : - MSSOTLTrafficLightLogic(tlcontrol, id, programID, TLTYPE_SOTL_WAVE, phases, step, delay, + MSSOTLTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::SOTL_WAVE, phases, step, delay, parameters, sensors) { //sets the lastDuration of every phase to the same value as the default duration of that phase for (int i = 0; i < getPhaseNumber(); i++) { diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSOTLWaveTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The class for SOTL Platoon logics /****************************************************************************/ -#ifndef MSSOTLWaveTrafficLightLogic_h -#define MSSOTLWaveTrafficLightLogic_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "MSSOTLTrafficLightLogic.h" @@ -81,6 +76,3 @@ int countVehicles(); }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -31,7 +31,7 @@ MSSwarmTrafficLightLogic::MSSwarmTrafficLightLogic(MSTLLogicControl& tlcontrol, const std::string& id, const std::string& programID, const Phases& phases, int step, SUMOTime delay, const std::map& parameters) : - MSSOTLHiLevelTrafficLightLogic(tlcontrol, id, programID, TLTYPE_SWARM_BASED, phases, step, delay, parameters) { + MSSOTLHiLevelTrafficLightLogic(tlcontrol, id, programID, TrafficLightType::SWARM_BASED, phases, step, delay, parameters) { std::string pols = getPoliciesParam(); std::transform(pols.begin(), pols.end(), pols.begin(), ::tolower); diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSSwarmTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The class for Swarm-based logics /****************************************************************************/ -#ifndef MSSwarmTrafficLightLogic_h -#define MSSwarmTrafficLightLogic_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include //#define SWARM_DEBUG @@ -449,9 +444,3 @@ // double pheroBegin; }; - - - - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,9 +23,6 @@ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -165,7 +162,7 @@ MSPhaseDefinition* phase = new MSPhaseDefinition(DELTA_T, state, -1); std::vector phases; phases.push_back(phase); - logic = new MSSimpleTrafficLightLogic(tlc, myCurrentProgram->getID(), TRACI_PROGRAM, TLTYPE_STATIC, phases, 0, + logic = new MSSimpleTrafficLightLogic(tlc, myCurrentProgram->getID(), TRACI_PROGRAM, TrafficLightType::STATIC, phases, 0, MSNet::getInstance()->getCurrentTimeStep() + DELTA_T, std::map()); addLogic(TRACI_PROGRAM, logic, true, true); @@ -870,5 +867,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTLLogicControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A class that stores and controls tls and switching of their programs /****************************************************************************/ -#ifndef MSTLLogicControl_h -#define MSTLLogicControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -830,9 +824,3 @@ MSTLLogicControl& operator=(const MSTLLogicControl&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The parent class for traffic light logics /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -260,6 +255,7 @@ } } } + myNumLinks = (int)myLinks.size(); } @@ -462,5 +458,6 @@ MSTrafficLightLogic::deactivateProgram() { myAmActive = false; } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.h sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/traffic_lights/MSTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // The parent class for traffic light logics /****************************************************************************/ -#ifndef MSTrafficLightLogic_h -#define MSTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -428,6 +422,9 @@ /// @brief The list of LaneVectors; each vector contains the incoming lanes that belong to the same link index LaneVectorVector myLanes; + /// @brief number of controlled links + int myNumLinks; + /// @brief A list of duration overrides std::vector myOverridingTimes; @@ -462,9 +459,3 @@ MSTrafficLightLogic& operator=(const MSTrafficLightLogic& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPerson.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSPerson.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPerson.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPerson.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The class for modelling person-movements /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -215,7 +210,11 @@ const double distance = walkDistance(); const double maxSpeed = getMaxSpeed(person); const SUMOTime duration = myArrived - myDeparted; - const SUMOTime timeLoss = myArrived == -1 ? 0 : duration - TIME2STEPS(distance / maxSpeed); + SUMOTime timeLoss = myArrived == -1 ? 0 : duration - TIME2STEPS(distance / maxSpeed); + if (timeLoss < 0 && timeLoss > TIME2STEPS(-0.1)) { + // avoid negative timeLoss due to rounding errors + timeLoss = 0; + } MSDevice_Tripinfo::addPedestrianData(distance, duration, timeLoss); os.openTag("walk"); os.writeAttr("depart", time2string(myDeparted)); diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPerson.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSPerson.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPerson.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPerson.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The class for modelling person-movements /****************************************************************************/ -#ifndef MSPerson_h -#define MSPerson_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -333,8 +327,3 @@ MSPerson& operator=(const MSPerson&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // The pedestrian following model (prototype) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ // The pedestrian following model (prototype) /****************************************************************************/ #pragma once - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // The pedestrian following model (prototype) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_NonInteracting.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // The pedestrian following model (prototype) /****************************************************************************/ -#ifndef MSPModel_NonInteracting_h -#define MSPModel_NonInteracting_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -147,5 +142,4 @@ }; -#endif /* MSPModel_NonInteracting_h */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Remote.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Remote.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Remote.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Remote.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // The pedestrian following model for remote controlled pedestrian movement /****************************************************************************/ -#ifndef SUMO_MSPMODEL_REMOTE_H -#define SUMO_MSPMODEL_REMOTE_H +#pragma once #include @@ -99,4 +98,3 @@ }; -#endif //SUMO_MSPMODEL_REMOTE_H diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Striping.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Striping.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Striping.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Striping.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // The pedestrian following model (prototype) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -385,7 +381,7 @@ shape = shape.reverse(); } WalkingAreaPath wap = WalkingAreaPath(from, walkingArea, to, shape, fromDir); - myWalkingAreaPaths[std::make_pair(from, to)] = wap; + myWalkingAreaPaths.insert(std::make_pair(std::make_pair(from, to), wap)); myMinNextLengths[walkingArea] = MIN2(myMinNextLengths[walkingArea], wap.length); } } @@ -395,22 +391,20 @@ } -MSPModel_Striping::WalkingAreaPath* +const MSPModel_Striping::WalkingAreaPath* MSPModel_Striping::getArbitraryPath(const MSEdge* walkingArea) { assert(walkingArea->isWalkingArea()); std::vector lanes; - const MSEdgeVector& incoming = walkingArea->getPredecessors(); - for (int j = 0; j < (int)incoming.size(); ++j) { - lanes.push_back(getSidewalk(incoming[j])); - } - const MSEdgeVector& outgoing = walkingArea->getSuccessors(); - for (int j = 0; j < (int)outgoing.size(); ++j) { - lanes.push_back(getSidewalk(outgoing[j])); + for (const MSEdge* const pred : walkingArea->getPredecessors()) { + lanes.push_back(getSidewalk(pred)); + } + for (const MSEdge* const succ : walkingArea->getSuccessors()) { + lanes.push_back(getSidewalk(succ)); } if (lanes.size() < 1) { throw ProcessError("Invalid walkingarea '" + walkingArea->getID() + "' does not allow continuation."); } - return &myWalkingAreaPaths[std::make_pair(lanes.front(), lanes.back())]; + return &myWalkingAreaPaths.find(std::make_pair(lanes.front(), lanes.back()))->second; } @@ -1325,7 +1319,7 @@ if (route.size() == 1) { // only a single edge, move towards end pos myDir = (myRelX <= myStage->getArrivalPos()) ? FORWARD : BACKWARD; - } else if (route.front()->getFunction() != EDGEFUNC_NORMAL) { + } else if (route.front()->getFunction() != SumoXMLEdgeFunc::NORMAL) { // start on an intersection myDir = FORWARD; if (route.front()->isWalkingArea()) { @@ -1483,7 +1477,7 @@ const MSLane* oldLane = myLane; myLane = myNLI.lane; myDir = myNLI.dir; - const bool normalLane = (myLane == nullptr || myLane->getEdge().getFunction() == EDGEFUNC_NORMAL || &myLane->getEdge() == myStage->getNextRouteEdge()); + const bool normalLane = (myLane == nullptr || myLane->getEdge().getFunction() == SumoXMLEdgeFunc::NORMAL || &myLane->getEdge() == myStage->getNextRouteEdge()); if DEBUGCOND(*this) { std::cout << SIMTIME << " ped=" << myPerson->getID() @@ -1513,9 +1507,16 @@ } if (myLane->getEdge().isWalkingArea()) { if (myNLI.dir != UNDEFINED_DIRECTION) { - myWalkingAreaPath = &myWalkingAreaPaths[std::make_pair(oldLane, myNLI.lane)]; - assert(myWalkingAreaPath->from != 0); - assert(myWalkingAreaPath->to != 0); + const auto pathIt = myWalkingAreaPaths.find(std::make_pair(oldLane, myNLI.lane)); + if (pathIt != myWalkingAreaPaths.end()) { + myWalkingAreaPath = &pathIt->second; + } else { + // this can happen in case of moveToXY where oldLane can point anywhere + const MSEdge* const pred = myLane->getEdge().getPredecessors().front(); + const auto pathIt2 = myWalkingAreaPaths.find(std::make_pair(getSidewalk(pred), myNLI.lane)); + assert(pathIt2 != myWalkingAreaPaths.end()); + myWalkingAreaPath = &pathIt2->second; + } assert(myWalkingAreaPath->shape.size() >= 2); if DEBUGCOND(*this) { std::cout << " mWAPath shape=" << myWalkingAreaPath->shape << " length=" << myWalkingAreaPath->length << "\n"; @@ -1536,7 +1537,7 @@ myStage->moveToNextEdge(myPerson, currentTime, nullptr); myLane = myNLI.lane; assert(myLane != 0); - assert(myLane->getEdge().getFunction() == EDGEFUNC_NORMAL); + assert(myLane->getEdge().getFunction() == SumoXMLEdgeFunc::NORMAL); myNLI = getNextLane(*this, myLane, oldLane); myWalkingAreaPath = nullptr; } else { diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Striping.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Striping.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSPModel_Striping.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSPModel_Striping.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // The pedestrian following model (prototype) /****************************************************************************/ -#ifndef MSPModel_Striping_h -#define MSPModel_Striping_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -163,7 +158,7 @@ typedef std::map ActiveLanes; typedef std::vector Obstacles; typedef std::map NextLanesObstacles; - typedef std::map, WalkingAreaPath> WalkingAreaPaths; + typedef std::map, const WalkingAreaPath> WalkingAreaPaths; typedef std::map MinNextLengths; struct NextLaneInfo { @@ -229,14 +224,16 @@ length(_shape.length()) { } - WalkingAreaPath(): from(0), to(0), lane(0) {}; + const MSLane* const from; + const MSLane* const to; + const MSLane* const lane; // the walkingArea; + const PositionVector shape; + const int dir; // the direction when entering this path + const double length; - const MSLane* from; - const MSLane* to; - const MSLane* lane; // the walkingArea; - PositionVector shape; // actually const but needs to be copyable by some stl code - int dir; // the direction when entring this path - double length; + private: + /// @brief Invalidated assignment operator + WalkingAreaPath& operator=(const WalkingAreaPath& s) = delete; }; @@ -302,7 +299,7 @@ /// @brief information about the upcoming lane NextLaneInfo myNLI; /// @brief the current walkingAreaPath or 0 - WalkingAreaPath* myWalkingAreaPath; + const WalkingAreaPath* myWalkingAreaPath; /// @brief whether the person is jammed bool myAmJammed; /// @brief remote-controlled position @@ -448,7 +445,7 @@ static void initWalkingAreaPaths(const MSNet* net); /// @brief return an arbitrary path across the given walkingArea - static WalkingAreaPath* getArbitraryPath(const MSEdge* walkingArea); + static const WalkingAreaPath* getArbitraryPath(const MSEdge* walkingArea); /// @brief return the maximum number of pedestrians walking side by side static int numStripes(const MSLane* lane); @@ -502,5 +499,4 @@ }; -#endif /* MSPModel_Striping_h */ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStage.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSStage.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStage.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStage.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageDriving.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageDriving.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageDriving.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageDriving.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -58,6 +53,7 @@ myVehicleID("NULL"), myVehicleVClass(SVC_IGNORING), myVehicleDistance(-1.), + myTimeLoss(-1), myWaitingSince(-1), myWaitingEdge(nullptr), myStopWaitPos(Position::INVALID), @@ -223,6 +219,7 @@ os.writeAttr("duration", myArrived >= 0 ? time2string(duration) : (myDeparted >= 0 ? time2string(now - myDeparted) : "-1")); os.writeAttr("routeLength", myVehicleDistance); + os.writeAttr("timeLoss", myArrived >= 0 ? time2string(myTimeLoss) : "-1"); os.closeTag(); } @@ -301,11 +298,13 @@ myVehicleDistance = myVehicle->getRoute().getDistanceBetween( myVehicle->getDepartPos(), myVehicle->getPositionOnLane(), myVehicle->getRoute().begin(), myVehicle->getCurrentRouteEdge()) - myVehicleDistance; + myTimeLoss = myVehicle->getTimeLoss() - myTimeLoss; if (myVehicle->isStopped()) { myArrivalPos = myVehicle->getPositionOnLane(); } } else { myVehicleDistance = -1.; + myTimeLoss = -1; } return ""; } @@ -314,12 +313,15 @@ void MSStageDriving::setVehicle(SUMOVehicle* v) { myVehicle = v; - myVehicleID = v->getID(); - myVehicleLine = v->getParameter().line; - myVehicleVClass = v->getVClass(); - myVehicleDistance = myVehicle->getRoute().getDistanceBetween( - myVehicle->getDepartPos(), myVehicle->getPositionOnLane(), - myVehicle->getRoute().begin(), myVehicle->getCurrentRouteEdge()); + if (myVehicle != nullptr) { + myVehicleID = v->getID(); + myVehicleLine = v->getParameter().line; + myVehicleVClass = v->getVClass(); + myVehicleDistance = myVehicle->getRoute().getDistanceBetween( + myVehicle->getDepartPos(), myVehicle->getPositionOnLane(), + myVehicle->getRoute().begin(), myVehicle->getCurrentRouteEdge()); + myTimeLoss = myVehicle->getTimeLoss(); + } } void diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageDriving.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageDriving.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageDriving.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageDriving.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ #pragma once - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -161,6 +157,8 @@ SUMOVehicleClass myVehicleVClass; double myVehicleDistance; + /// @brief While driving, this is the timeLoss of the vehicle when the ride started, after arrival this is the timeLoss which the vehicle accumulated during the ride + SUMOTime myTimeLoss; double myWaitingPos; /// @brief The time since which this person is waiting for a ride @@ -179,6 +177,3 @@ MSStageDriving& operator=(const MSStageDriving&) = delete; }; - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStage.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSStage.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStage.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ #pragma once - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -509,6 +505,3 @@ /// @brief the lateral depart position double myDepartPosLat; }; - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageTranship.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageTranship.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageTranship.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageTranship.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The class for modelling transportable movements without interaction /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageTranship.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageTranship.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSStageTranship.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSStageTranship.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ // The class for modelling container-movements /****************************************************************************/ #pragma once - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -120,6 +116,3 @@ MSStageTranship& operator=(const MSStageTranship&); }; - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportableControl.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportableControl.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportableControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportableControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Stores all persons in the net and handles their waiting for cars. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -183,18 +178,13 @@ for (TransportableVector::iterator i = wait.begin(); i != wait.end();) { if ((*i)->isWaitingFor(vehicle) && vehicle->allowsBoarding(*i) - && timeToBoardNextPerson <= currentTime + && timeToBoardNextPerson - DELTA_T <= currentTime && stop.startPos <= (*i)->getEdgePos() && (*i)->getEdgePos() <= stop.endPos) { edge->removePerson(*i); vehicle->addTransportable(*i); if (timeToBoardNextPerson >= 0) { // meso does not have boarding times - //if the time a person needs to enter the vehicle extends the duration of the stop of the vehicle extend - //the duration by setting it to the boarding duration of the person const SUMOTime boardingDuration = vehicle->getVehicleType().getBoardingDuration(); - if (boardingDuration >= stopDuration) { - stopDuration = boardingDuration; - } //update the time point at which the next person can board the vehicle if (timeToBoardNextPerson > currentTime - DELTA_T) { timeToBoardNextPerson += boardingDuration; @@ -214,6 +204,12 @@ if (wait.size() == 0) { myWaiting4Vehicle.erase(myWaiting4Vehicle.find(edge)); } + if (ret && timeToBoardNextPerson >= 0) { + //if the time a person needs to enter the vehicle extends the duration of the stop of the vehicle extend + //the duration by setting it to the boarding duration of the person + stopDuration = MAX2(stopDuration, timeToBoardNextPerson - currentTime); + timeToBoardNextPerson -= DELTA_T; + } } return ret; } @@ -223,24 +219,27 @@ MSTransportableControl::loadAnyWaiting(MSEdge* edge, SUMOVehicle* vehicle, const SUMOVehicleParameter::Stop& stop, SUMOTime& timeToLoadNextContainer, SUMOTime& stopDuration) { bool ret = false; if (myWaiting4Vehicle.find(edge) != myWaiting4Vehicle.end()) { + SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); TransportableVector& waitContainers = myWaiting4Vehicle[edge]; for (TransportableVector::iterator i = waitContainers.begin(); i != waitContainers.end();) { - SUMOTime currentTime = MSNet::getInstance()->getCurrentTimeStep(); if ((*i)->isWaitingFor(vehicle) && vehicle->getVehicleType().getContainerCapacity() > vehicle->getContainerNumber() - && timeToLoadNextContainer <= currentTime + && timeToLoadNextContainer - DELTA_T <= currentTime && stop.startPos <= (*i)->getEdgePos() && (*i)->getEdgePos() <= stop.endPos) { edge->removeContainer(*i); vehicle->addTransportable(*i); - //if the time a container needs to get loaded on the vehicle extends the duration of the stop of the vehicle extend - //the duration by setting it to the loading duration of the container - const SUMOTime loadingDuration = vehicle->getVehicleType().getLoadingDuration(); - if (loadingDuration >= stopDuration) { - stopDuration = loadingDuration; + if (timeToLoadNextContainer >= 0) { // meso does not have loading times + //if the time a person needs to enter the vehicle extends the duration of the stop of the vehicle extend + //the duration by setting it to the boarding duration of the person + const SUMOTime loadingDuration = vehicle->getVehicleType().getLoadingDuration(); + //update the time point at which the next container can be loaded on the vehicle + if (timeToLoadNextContainer > currentTime - DELTA_T) { + timeToLoadNextContainer += loadingDuration; + } else { + timeToLoadNextContainer = currentTime + loadingDuration; + } } - //update the time point at which the next container can be loaded on the vehicle - timeToLoadNextContainer = currentTime + loadingDuration; static_cast((*i)->getCurrentStage())->setVehicle(vehicle); i = waitContainers.erase(i); @@ -253,6 +252,12 @@ if (waitContainers.size() == 0) { myWaiting4Vehicle.erase(myWaiting4Vehicle.find(edge)); } + if (ret && timeToLoadNextContainer >= 0) { + //if the time a container needs to get loaded on the vehicle extends the duration of the stop of the vehicle extend + //the duration by setting it to the loading duration of the container + stopDuration = MAX2(stopDuration, timeToLoadNextContainer - currentTime); + timeToLoadNextContainer -= DELTA_T; + } } return ret; } diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportableControl.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportableControl.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportableControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportableControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Stores all persons or containers in the net and handles their waiting for cars. /****************************************************************************/ -#ifndef MSTransportableControl_h -#define MSTransportableControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -258,8 +252,3 @@ MSPModel* myNonInteractingModel; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportable.cpp sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportable.cpp --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportable.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportable.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportable.h sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportable.h --- sumo-1.5.0+dfsg1/src/microsim/transportables/MSTransportable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/transportables/MSTransportable.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // The common superclass for modelling transportable objects like persons and containers /****************************************************************************/ -#ifndef MSTransportable_h -#define MSTransportable_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -120,7 +115,7 @@ /* @brief proceeds to the next step of the route, * @return Whether the transportables plan continues */ - bool proceed(MSNet* net, SUMOTime time); + virtual bool proceed(MSNet* net, SUMOTime time); virtual void checkAccess(const MSStage* const prior, const bool isDisembark = true) { UNUSED_PARAMETER(prior); @@ -351,8 +346,3 @@ MSTransportable& operator=(const MSTransportable&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSCalibrator.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSCalibrator.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSCalibrator.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSCalibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Calibrates the flow on an edge by removing an inserting vehicles /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -58,7 +53,7 @@ // =========================================================================== std::vector MSCalibrator::LeftoverReminders; std::vector MSCalibrator::LeftoverVehicleParameters; -std::set MSCalibrator::myInstances; +std::map MSCalibrator::myInstances; // =========================================================================== // method definitions @@ -79,8 +74,8 @@ myEdge(edge), myLane(lane), myPos(pos), myProbe(probe), - myEdgeMeanData(nullptr, length, false, nullptr), - myMeanDataParent(id + "_dummyMeanData", 0, 0, false, false, false, false, false, false, 1, 0, 0, vTypes), + myMeanDataParent(id + "_dummyMeanData", 0, 0, false, false, false, false, false, false, 1, 0, 0, vTypes, ""), + myEdgeMeanData(nullptr, length, false, &myMeanDataParent), myCurrentStateInterval(myIntervals.begin()), myOutput(nullptr), myFrequency(freq), myRemoved(0), myInserted(0), myClearedInJam(0), @@ -89,7 +84,7 @@ myHaveWarnedAboutClearingJam(false), myAmActive(false), myHaveInvalidJam(false) { - myInstances.insert(this); + myInstances[id] = this; if (outputFilename != "") { myOutput = &OutputDevice::getDevice(outputFilename); writeXMLDetectorProlog(*myOutput); @@ -141,9 +136,16 @@ for (VehicleRemover* const remover : myVehicleRemovers) { remover->disable(); } - myInstances.erase(this); + myInstances.erase(getID()); } +MSCalibrator::AspiredState +MSCalibrator::getCurrentStateInterval() const { + if (myCurrentStateInterval == myIntervals.end()) { + throw ProcessError("Calibrator '" + getID() + "' has no active or upcoming interval"); + } + return *myCurrentStateInterval; +} void MSCalibrator::myStartElement(int element, @@ -283,8 +285,8 @@ for (std::set::iterator it = myToRemove.begin(); it != myToRemove.end(); ++it) { MSVehicle* vehicle = dynamic_cast(vc.getVehicle(*it)); if (vehicle != nullptr) { - vehicle->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED); - vehicle->getLane()->removeVehicle(vehicle, MSMoveReminder::NOTIFICATION_VAPORIZED); + vehicle->onRemovalFromNet(MSMoveReminder::NOTIFICATION_VAPORIZED_CALIBRATOR); + vehicle->getLane()->removeVehicle(vehicle, MSMoveReminder::NOTIFICATION_VAPORIZED_CALIBRATOR); vc.scheduleVehicleRemoval(vehicle, true); } else { WRITE_WARNING("Calibrator '" + getID() + "' could not remove vehicle '" + *it + "' time=" + time2string(MSNet::getInstance()->getCurrentTimeStep()) + "."); @@ -637,5 +639,42 @@ return getID() + "." + toString(beginS, precision) + "." + toString(myInserted); } -/****************************************************************************/ +void +MSCalibrator::setFlow(SUMOTime begin, SUMOTime end, double vehsPerHour, double speed, SUMOVehicleParameter vehicleParameter) { + 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."); + } else if (it->begin == begin && it->end == end) { + // update current interval + AspiredState& state = const_cast(*it); + state.q = vehsPerHour; + state.v = speed; + state.vehicleParameter->vtypeid = vehicleParameter.vtypeid; + state.vehicleParameter->routeid = vehicleParameter.routeid; + state.vehicleParameter->departLane = vehicleParameter.departLane; + state.vehicleParameter->departLaneProcedure = vehicleParameter.departLaneProcedure; + state.vehicleParameter->departSpeed = vehicleParameter.departSpeed; + state.vehicleParameter->departSpeedProcedure = vehicleParameter.departSpeedProcedure; + return; + } else if (begin < it->end) { + throw ProcessError("Cannot set flow for calibrator '" + getID() + "' with overlapping interval."); + } else if (begin >= end) { + throw ProcessError("Cannot set flow for calibrator '" + getID() + "' with negative interval."); + } + it++; + } + // add interval at the end of the known intervals + const int intervalIndex = (int)(myCurrentStateInterval - myIntervals.begin()); + AspiredState state; + state.begin = begin; + state.end = end; + state.q = vehsPerHour; + state.v = speed; + state.vehicleParameter = new SUMOVehicleParameter(vehicleParameter); + myIntervals.push_back(state); + // fix iterator + myCurrentStateInterval = myIntervals.begin() + intervalIndex; +} +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSCalibrator.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSCalibrator.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSCalibrator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSCalibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Calibrates the flow on an edge by removing an inserting vehicles /****************************************************************************/ -#ifndef MSCalibrator_h -#define MSCalibrator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -51,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 { +class MSCalibrator : public MSTrigger, public MSRouteHandler, public Command, public MSDetectorFileOutput, public Parameterised { public: /** constructor */ MSCalibrator(const std::string& id, @@ -100,10 +94,51 @@ static void cleanup(); /// @brief return all calibrator instances - static const std::set& getInstances() { + static const std::map& getInstances() { return myInstances; } + struct AspiredState { + AspiredState() : begin(-1), end(-1), q(-1.), v(-1.), vehicleParameter(0) {} + SUMOTime begin; + SUMOTime end; + double q; + double v; + SUMOVehicleParameter* vehicleParameter; + }; + + AspiredState getCurrentStateInterval() const; + + const MSEdge* getEdge() const { + return myEdge; + } + + const MSLane* getLane() const { + return myLane; + } + + const MSRouteProbe* getRouteProbe() const { + return myProbe; + } + + inline virtual int passed() const { + // calibrator measures at start of segment + // vehicles drive to the end of an edge by default so they count as passed + // but vaporized vehicles do not count + // if the calibrator is located on a short edge, the vehicles are + // vaporized on the next edge so we cannot rely on myEdgeMeanData.nVehVaporized + return myEdgeMeanData.nVehEntered + myEdgeMeanData.nVehDeparted - myClearedInJam - myRemoved; + } + + int getInserted() const { + return myEdgeMeanData.nVehDeparted; + } + + int getRemoved() const { + return myClearedInJam + myRemoved; + } + + void setFlow(SUMOTime begin, SUMOTime end, double vehsPerHour, double speed, SUMOVehicleParameter vehicleParameter); protected: class CalibratorCommand : public Command { @@ -181,15 +216,6 @@ protected: - struct AspiredState { - AspiredState() : begin(-1), end(-1), q(-1.), v(-1.), vehicleParameter(0) {} - SUMOTime begin; - SUMOTime end; - double q; - double v; - SUMOVehicleParameter* vehicleParameter; - }; - void intervalEnd(); bool isCurrentStateActive(SUMOTime time); @@ -198,15 +224,6 @@ void init(); - inline virtual int passed() const { - // calibrator measures at start of segment - // vehicles drive to the end of an edge by default so they count as passed - // but vaporized vehicles do not count - // if the calibrator is located on a short edge, the vehicles are - // vaporized on the next edge so we cannot rely on myEdgeMeanData.nVehVaporized - return myEdgeMeanData.nVehEntered + myEdgeMeanData.nVehDeparted - myClearedInJam - myRemoved; - } - /// @brief number of vehicles expected to pass this interval int totalWished() const; @@ -266,12 +283,12 @@ const double myPos; /// @brief the route probe to retrieve routes from const MSRouteProbe* const myProbe; + /// @brief dummy parent to retrieve vType filter + MSMeanData_Net myMeanDataParent; /// @brief data collector for the calibrator std::vector myLaneMeanData; /// @brief accumlated data for the whole edge MSMeanData_Net::MSLaneMeanDataValues myEdgeMeanData; - /// @brief dummy parent to retrieve vType filter - MSMeanData_Net myMeanDataParent; /// @brief List of adaptation intervals std::vector myIntervals; @@ -318,10 +335,6 @@ * instance which created them */ static std::vector LeftoverReminders; static std::vector LeftoverVehicleParameters; - static std::set myInstances; + static std::map myInstances; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSChargingStation.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSChargingStation.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSChargingStation.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSChargingStation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Chargin Station for Electric vehicles /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - #include #include @@ -275,4 +270,5 @@ output.closeTag(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSChargingStation.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSChargingStation.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSChargingStation.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSChargingStation.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,7 @@ /// // Chargin Station for Electric vehicles /****************************************************************************/ -#ifndef MSChargingStation_h -#define MSChargingStation_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -178,4 +173,3 @@ MSChargingStation& operator=(const MSChargingStation&); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -226,4 +221,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSLaneSpeedTrigger.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Changes the speed allowed on a set of lanes /****************************************************************************/ -#ifndef MSLaneSpeedTrigger_h -#define MSLaneSpeedTrigger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -153,9 +147,3 @@ bool myDidInit; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSOverheadWire.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSOverheadWire.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSOverheadWire.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSOverheadWire.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Overhead wires for Electric (equipped with elecHybrid device) vehicles (Overhead wire segments, overhead wire sections, traction substations) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - #include #include @@ -707,4 +702,5 @@ output.closeTag(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSOverheadWire.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSOverheadWire.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSOverheadWire.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSOverheadWire.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // Overhead wires for Electric (equipped with elecHybrid device) vehicles (Overhead wire segments, overhead wire sections, traction substations) /****************************************************************************/ -#ifndef MSOverheadWire_h -#define MSOverheadWire_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -346,4 +341,3 @@ OverheadWireClamp* findClamp(std::string id); //bool findClamp(std::string id); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSTrigger.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSTrigger.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSTrigger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSTrigger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,9 +18,6 @@ /// // An abstract device that changes the state of the micro simulation /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include "MSTrigger.h" diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.cpp sumo-1.6.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.cpp --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Reroutes vehicles passing an edge /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,8 +61,8 @@ // =========================================================================== // static member defintion // =========================================================================== -MSEdge MSTriggeredRerouter::mySpecialDest_keepDestination("MSTriggeredRerouter_keepDestination", -1, EDGEFUNC_UNKNOWN, "", "", -1, 0); -MSEdge MSTriggeredRerouter::mySpecialDest_terminateRoute("MSTriggeredRerouter_terminateRoute", -1, EDGEFUNC_UNKNOWN, "", "", -1, 0); +MSEdge MSTriggeredRerouter::mySpecialDest_keepDestination("MSTriggeredRerouter_keepDestination", -1, SumoXMLEdgeFunc::UNKNOWN, "", "", -1, 0); +MSEdge MSTriggeredRerouter::mySpecialDest_terminateRoute("MSTriggeredRerouter_terminateRoute", -1, SumoXMLEdgeFunc::UNKNOWN, "", "", -1, 0); // =========================================================================== // method definitions @@ -422,14 +417,14 @@ } SUMOAbstractRouter& router = hasReroutingDevice - ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), rerouteDef->closed) + ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), veh.getVClass(), rerouteDef->closed) : MSNet::getInstance()->getRouterTT(veh.getRNGIndex(), rerouteDef->closed); const double routeCost = router.recomputeCosts(newRoute, &veh, MSNet::getInstance()->getCurrentTimeStep()); ConstMSEdgeVector prevEdges(veh.getCurrentRouteEdge(), veh.getRoute().end()); const double previousCost = router.recomputeCosts(prevEdges, &veh, MSNet::getInstance()->getCurrentTimeStep()); const double savings = previousCost - routeCost; hasReroutingDevice - ? MSRoutingEngine::getRouterTT(veh.getRNGIndex()) + ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), veh.getVClass()) : MSNet::getInstance()->getRouterTT(veh.getRNGIndex()); // reset closed edges //if (getID() == "ego") std::cout << SIMTIME << " pCost=" << previousCost << " cost=" << routeCost // << " prevEdges=" << toString(prevEdges) @@ -497,7 +492,7 @@ if (rerouteDef->closed.size() == 0 || destUnreachable || veh.getRoute().containsAnyOf(rerouteDef->closed)) { ConstMSEdgeVector edges; SUMOAbstractRouter& router = hasReroutingDevice - ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), rerouteDef->closed) + ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), veh.getVClass(), rerouteDef->closed) : MSNet::getInstance()->getRouterTT(veh.getRNGIndex(), rerouteDef->closed); router.compute(veh.getEdge(), newEdge, &veh, MSNet::getInstance()->getCurrentTimeStep(), edges); if (edges.size() == 0 && !keepDestination && rerouteDef->edgeProbs.getOverallProb() > 0) { @@ -522,7 +517,7 @@ } const double routeCost = router.recomputeCosts(edges, &veh, MSNet::getInstance()->getCurrentTimeStep()); hasReroutingDevice - ? MSRoutingEngine::getRouterTT(veh.getRNGIndex()) + ? MSRoutingEngine::getRouterTT(veh.getRNGIndex(), veh.getVClass()) : MSNet::getInstance()->getRouterTT(veh.getRNGIndex()); // reset closed edges const bool useNewRoute = veh.replaceRouteEdges(edges, routeCost, 0, getID()); #ifdef DEBUG_REROUTER @@ -911,4 +906,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSTriggeredRerouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Reroutes vehicles passing an edge /****************************************************************************/ -#ifndef MSTriggeredRerouter_h -#define MSTriggeredRerouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -265,9 +259,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/microsim/trigger/MSTrigger.h sumo-1.6.0+dfsg1/src/microsim/trigger/MSTrigger.h --- sumo-1.5.0+dfsg1/src/microsim/trigger/MSTrigger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/microsim/trigger/MSTrigger.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An abstract device that changes the state of the micro simulation /****************************************************************************/ -#ifndef MSTrigger_h -#define MSTrigger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,9 +59,3 @@ static std::set myInstances; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms.cpp sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Algorithms for network computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -80,7 +75,9 @@ const bool badPermissions = ((outedge->getPermissions() & e->getPermissions() & ~SVC_PEDESTRIAN) == 0 && !geometryLike && outedge->getPermissions() != e->getPermissions()); - if (e->getFromNode() == outedge->getToNode() && angle > 120 && !badPermissions) { + if (e->getFromNode() == outedge->getToNode() + && (angle > 120 || e->getFromNode()->getPosition() == e->getToNode()->getPosition()) + && !badPermissions) { // they connect the same nodes; should be the turnaround direction // we'll assign a maximum number // @@ -171,14 +168,14 @@ for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { NBNode* const n = (*i).second; // the type may already be set from the data - if (n->myType != NODETYPE_UNKNOWN && n->myType != NODETYPE_DEAD_END) { + if (n->myType != SumoXMLNodeType::UNKNOWN && n->myType != SumoXMLNodeType::DEAD_END) { n->myTypeWasGuessed = false; continue; } // check whether the node was set to be unregulated by the user if (oc.getBool("keep-nodes-unregulated") || oc.isInStringVector("keep-nodes-unregulated.explicit", n->getID()) || (oc.getBool("keep-nodes-unregulated.district-nodes") && (n->isNearDistrict() || n->isDistrict()))) { - n->myType = NODETYPE_NOJUNCTION; + n->myType = SumoXMLNodeType::NOJUNCTION; continue; } // check whether the node is a waterway node. Set to unregulated by default @@ -189,28 +186,28 @@ break; } } - if (waterway && (n->myType == NODETYPE_UNKNOWN || n->myType == NODETYPE_DEAD_END)) { - n->myType = NODETYPE_NOJUNCTION; + if (waterway && (n->myType == SumoXMLNodeType::UNKNOWN || n->myType == SumoXMLNodeType::DEAD_END)) { + n->myType = SumoXMLNodeType::NOJUNCTION; continue; } // check whether the junction is not a real junction if (n->myIncomingEdges.size() == 1) { - n->myType = NODETYPE_PRIORITY; + n->myType = SumoXMLNodeType::PRIORITY; continue; } // @todo "isSimpleContinuation" should be revalidated if (n->isSimpleContinuation()) { - n->myType = NODETYPE_PRIORITY; + n->myType = SumoXMLNodeType::PRIORITY; continue; } if (isRailwayNode(n)) { // priority instead of unregulated to ensure that collisions can be detected - n->myType = NODETYPE_PRIORITY; + n->myType = SumoXMLNodeType::PRIORITY; continue; } // determine the type - SumoXMLNodeType type = NODETYPE_RIGHT_BEFORE_LEFT; + SumoXMLNodeType type = SumoXMLNodeType::RIGHT_BEFORE_LEFT; for (EdgeVector::const_iterator i = n->myIncomingEdges.begin(); i != n->myIncomingEdges.end(); i++) { for (EdgeVector::const_iterator j = i + 1; j != n->myIncomingEdges.end(); j++) { // @todo "getOppositeIncoming" should probably be refactored into something the edge knows @@ -218,13 +215,13 @@ continue; } // @todo check against a legal document - // @todo figure out when NODETYPE_PRIORITY_STOP is appropriate + // @todo figure out when SumoXMLNodeType::PRIORITY_STOP is appropriate const double s1 = (*i)->getSpeed(); const double s2 = (*j)->getSpeed(); const int p1 = (*i)->getPriority(); const int p2 = (*j)->getPriority(); if (fabs(s1 - s2) > (9.5 / 3.6) || MAX2(s1, s2) >= rightBeforeLeftSpeed || p1 != p2) { - type = NODETYPE_PRIORITY; + type = SumoXMLNodeType::PRIORITY; break; } } @@ -240,7 +237,7 @@ NBNodeTypeComputer::validateRailCrossings(NBNodeCont& nc, NBTrafficLightLogicCont& tlc) { for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { NBNode* n = (*i).second; - if (n->myType == NODETYPE_RAIL_CROSSING) { + if (n->myType == SumoXMLNodeType::RAIL_CROSSING) { // check if it really is a rail crossing int numRailway = 0; int numNonRailway = 0; @@ -262,17 +259,17 @@ } if (numNonRailway == 0 || numRailway == 0) { // not a crossing (maybe unregulated or rail_signal) - n->myType = NODETYPE_PRIORITY; + n->myType = SumoXMLNodeType::PRIORITY; } else if (numNonRailwayNonPed > 2) { // does not look like a rail crossing (roads in conflict). maybe a traffic light? WRITE_WARNINGF("Converting invalid rail_crossing to traffic_light at junction '%'.", n->getID()); TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get(OptionsCont::getOptions().getString("tls.default-type")); NBTrafficLightDefinition* tlDef = new NBOwnTLDef(n->getID(), n, 0, type); - n->myType = NODETYPE_TRAFFIC_LIGHT; + n->myType = SumoXMLNodeType::TRAFFIC_LIGHT; if (!tlc.insert(tlDef)) { // actually, nothing should fail here n->removeTrafficLight(tlDef); - n->myType = NODETYPE_PRIORITY; + n->myType = SumoXMLNodeType::PRIORITY; delete tlDef; WRITE_WARNINGF("Could not allocate tls '%'.", n->getID()); } @@ -284,16 +281,15 @@ bool NBNodeTypeComputer::isRailwayNode(const NBNode* n) { - int numRailway = 0; - int numNonRailway = 0; + bool hasRailway = false; for (NBEdge* e : n->getIncomingEdges()) { if ((e->getPermissions() & ~SVC_RAIL_CLASSES) != 0) { - numNonRailway++; + return false; } else if ((e->getPermissions() & SVC_RAIL_CLASSES) != 0) { - numRailway++; + hasRailway = true; } } - return numRailway > 0 && numNonRailway == 0; + return hasRailway; } // --------------------------------------------------------------------------- @@ -312,8 +308,8 @@ continue; } // compute the priorities on junction when needed - if (node.second->getType() != NODETYPE_RIGHT_BEFORE_LEFT && node.second->getType() != NODETYPE_ALLWAY_STOP && node.second->getType() != NODETYPE_NOJUNCTION) { - if (node.second->getRightOfWay() == RIGHT_OF_WAY_EDGEPRIORITY) { + if (node.second->getType() != SumoXMLNodeType::RIGHT_BEFORE_LEFT && node.second->getType() != SumoXMLNodeType::ALLWAY_STOP && node.second->getType() != SumoXMLNodeType::NOJUNCTION) { + if (node.second->getRightOfWay() == RightOfWay::EDGEPRIORITY) { for (NBEdge* e : node.second->getIncomingEdges()) { e->setJunctionPriority(node.second, e->getPriority()); } @@ -401,7 +397,7 @@ s->setJunctionPriority(&n, 1); } } - n.markBentPriority(n.getDirection(best1, bestOut) != LINKDIR_STRAIGHT); + n.markBentPriority(n.getDirection(best1, bestOut) != LinkDirection::STRAIGHT); return; } @@ -522,4 +518,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms.h sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms.h --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Algorithms for network computation /****************************************************************************/ -#ifndef NBAlgorithms_h -#define NBAlgorithms_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -117,7 +111,7 @@ public: explicit crossing_by_junction_angle_sorter(const NBNode* node, const EdgeVector& ordering); - int operator()(const NBNode::Crossing* c1, const NBNode::Crossing* c2) const { + int operator()(const std::unique_ptr& c1, const std::unique_ptr& c2) const { const int r1 = getMinRank(c1->edges); const int r2 = getMinRank(c2->edges); if (r1 == r2) { @@ -262,8 +256,3 @@ static bool hasDifferentPriorities(const EdgeVector& edges, const NBEdge* excluded); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Railway.cpp sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Railway.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Railway.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Railway.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Algorithms for highway on-/off-ramps computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -43,6 +38,8 @@ #include "NBAlgorithms_Railway.h" //#define DEBUG_SEQSTOREVERSE +//#define DEBUG_DIRECTION_PRIORITY + #define DEBUGNODEID "gneJ34" #define DEBUGNODEID2 "28842974" #define DEBUGEDGEID "22820560#0" @@ -153,7 +150,7 @@ // rebuild connections if given from an earlier network edge->invalidateConnections(true); if (!edge->isBidiRail()) { - if (edge->getLaneSpreadFunction() == LANESPREAD_CENTER) { + if (edge->getLaneSpreadFunction() == LaneSpreadFunction::CENTER) { NBEdge* e2 = addBidiEdge(nb, edge, false); if (e2 != nullptr) { numAddedBidiEdges++; @@ -174,7 +171,7 @@ NBEdge* NBRailwayTopologyAnalyzer::addBidiEdge(NBNetBuilder& nb, NBEdge* edge, bool update) { - assert(edge->getLaneSpreadFunction() == LANESPREAD_CENTER); + assert(edge->getLaneSpreadFunction() == LaneSpreadFunction::CENTER); assert(!edge->isBidiRail()); const std::string id2 = (edge->getID()[0] == '-' ? edge->getID().substr(1) @@ -383,7 +380,7 @@ } std::set railSignals; for (NBNode* node : railNodes) { - if (node->getType() == NODETYPE_RAIL_SIGNAL) { + if (node->getType() == SumoXMLNodeType::RAIL_SIGNAL) { railSignals.insert(node); } } @@ -497,7 +494,6 @@ int NBRailwayTopologyAnalyzer::extendBidiEdges(NBNetBuilder& nb) { int added = 0; - std::set railNodes = getRailNodes(nb); NBEdgeCont& ec = nb.getEdgeCont(); for (auto it = ec.begin(); it != ec.end(); it++) { NBEdge* e = it->second; @@ -531,7 +527,7 @@ for (NBEdge* cand : outRail) { //std::cout << " extendBidiEdges n=" << node->getID() << " bidiIn=" << bidiIn->getID() << " cand=" << cand->getID() << " isStraight=" << isStraight(node, bidiIn, cand) << " allSharp=" << allSharp(node, inRail, tmpBidiOut, true) << "\n"; if (!cand->isBidiRail() && isStraight(node, bidiIn, cand) - && cand->getLaneSpreadFunction() == LANESPREAD_CENTER + && cand->getLaneSpreadFunction() == LaneSpreadFunction::CENTER && allSharp(node, inRail, tmpBidiOut, true)) { NBEdge* e2 = addBidiEdge(nb, cand); if (e2 != nullptr) { @@ -542,7 +538,7 @@ for (NBEdge* cand : inRail) { //std::cout << " extendBidiEdges n=" << node->getID() << " bidiOut=" << bidiOut->getID() << " cand=" << cand->getID() << " isStraight=" << isStraight(node, cand, bidiOut) << " allSharp=" << allSharp(node, outRail, tmpBidiIn, true) << "\n"; if (!cand->isBidiRail() && isStraight(node, cand, bidiOut) - && cand->getLaneSpreadFunction() == LANESPREAD_CENTER + && cand->getLaneSpreadFunction() == LaneSpreadFunction::CENTER && allSharp(node, outRail, tmpBidiIn, true)) { NBEdge* e2 = addBidiEdge(nb, cand); if (e2 != nullptr) { @@ -699,7 +695,7 @@ e = outRail.front() == prev2 ? outRail.back() : outRail.front(); } } - e->setLaneSpreadFunction(LANESPREAD_CENTER); + e->setLaneSpreadFunction(LaneSpreadFunction::CENTER); NBNode* e2From = nullptr; NBNode* e2To = nullptr; if (addAway) { @@ -941,7 +937,7 @@ if (addBidiEdges.count(edge) == 0) { if (!edge->isBidiRail(true)) { bool isStop = i == 1 || i == (int)route.size() - 2; - if (edge->getLaneSpreadFunction() == LANESPREAD_CENTER) { + if (edge->getLaneSpreadFunction() == LaneSpreadFunction::CENTER) { addBidiEdges.insert(edge); if (isStop) { addBidiStops.insert(edge); @@ -1083,5 +1079,89 @@ return NBEdge::getTravelTimeStatic(track->edge, veh, time); } -/****************************************************************************/ +void +NBRailwayTopologyAnalyzer::assignDirectionPriority(NBNetBuilder& nb) { + // 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 + EdgeSet bidi; + EdgeSet uni; + for (NBEdge* edge : nb.getEdgeCont().getAllEdges()) { + if (isRailway(edge->getPermissions())) { + if (!edge->isBidiRail()) { + edge->setPriority(4); + 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"); + } + return; + } + EdgeSet seen; + EdgeSet check = uni; + EdgeSet forward; + while (!check.empty()) { + NBEdge* edge = *check.begin(); + check.erase(edge); + if (seen.count(edge) != 0) { + continue; + } + seen.insert(edge); + NBEdge* straightOut = edge->getStraightContinuation(edge->getPermissions()); + if (straightOut != nullptr && straightOut->getStraightPredecessor(straightOut->getPermissions()) == edge) { + forward.insert(straightOut); + check.insert(straightOut); + } + NBEdge* straightIn = edge->getStraightPredecessor(edge->getPermissions()); + if (straightIn != nullptr && straightIn->getStraightContinuation(straightIn->getPermissions()) == edge) { + forward.insert(straightIn); + check.insert(straightIn); + } +#ifdef DEBUG_DIRECTION_PRIORITY + std::cout << "edge=" << edge->getID() << " in=" << Named::getIDSecure(straightIn) << " out=" << Named::getIDSecure(straightOut) + << " outPred=" << (straightOut != nullptr ? Named::getIDSecure(straightOut->getStraightPredecessor(straightOut->getPermissions())) : "") + << " inSucc=" << (straightIn != nullptr ? Named::getIDSecure(straightIn->getStraightContinuation(straightIn->getPermissions())) : "") + << "\n"; +#endif + } + + for (NBEdge* edge : bidi) { + NBEdge* bidiEdge = const_cast(edge->getBidiEdge()); + if (forward.count(edge) != 0) { + if (forward.count(bidiEdge) == 0) { + edge->setPriority(3); + bidiEdge->setPriority(0); + } else { + // both forward + edge->setPriority(2); + bidiEdge->setPriority(2); + } + } else { + if (forward.count(bidiEdge) != 0) { + edge->setPriority(0); + bidiEdge->setPriority(3); + } else { + // neither forward + edge->setPriority(1); + bidiEdge->setPriority(1); + } + } + } + std::map numPrios; + for (NBEdge* edge : bidi) { + numPrios[edge->getPriority()]++; + } + WRITE_MESSAGE("Assigned edge priority based on main direction: " + joinToString(numPrios, " ", ":") + ".") +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Railway.h sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Railway.h --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Railway.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Railway.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Algorithms for railways /****************************************************************************/ -#ifndef NBAlgorithms_Railway_h -#define NBAlgorithms_Railway_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -57,6 +51,7 @@ static void analyzeTopology(NBNetBuilder& nb); static void repairTopology(NBNetBuilder& nb); static void makeAllBidi(NBNetBuilder& nb); + static void assignDirectionPriority(NBNetBuilder& nb); /// routing edge class Track { @@ -81,6 +76,9 @@ double getLength() const { return 0.; } + const Track* getBidiEdge() const { + return this; + } bool isInternal() const { return false; } @@ -146,9 +144,3 @@ static void updateTurns(NBEdge* edge); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.cpp sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Algorithms for highway on-/off-ramps computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -407,7 +402,7 @@ void NBRampsComputer::moveRampRight(NBEdge* ramp, int addedLanes) { - if (ramp->getLaneSpreadFunction() != LANESPREAD_CENTER) { + if (ramp->getLaneSpreadFunction() != LaneSpreadFunction::CENTER) { return; } try { @@ -592,7 +587,7 @@ void NBRampsComputer::patchRampGeometry(NBEdge* potRamp, NBEdge* first, NBEdge* potHighway, bool onRamp) { // geometry of first and highway should allign on the left side - if (first->getLaneSpreadFunction() == LANESPREAD_CENTER && first->hasDefaultGeometryEndpoints()) { + if (first->getLaneSpreadFunction() == LaneSpreadFunction::CENTER && first->hasDefaultGeometryEndpoints()) { const NBNode* n = onRamp ? potHighway->getToNode() : potHighway->getFromNode(); if (potHighway->hasDefaultGeometryEndpointAtNode(n)) { PositionVector p2 = first->getGeometry(); @@ -607,7 +602,7 @@ PositionVector p = potRamp->getGeometry(); double offset = 0; int firstIndex = MAX2(0, MIN2(potRamp->getNumLanes(), first->getNumLanes()) - 1); - if (potRamp->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + if (potRamp->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT) { offset = -first->getLaneWidth(firstIndex) / 2; } else { if (firstIndex % 2 == 1) { @@ -634,5 +629,5 @@ } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.h sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.h --- sumo-1.5.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBAlgorithms_Ramps.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Algorithms for highway on-/off-ramps computation /****************************************************************************/ -#ifndef NBAlgorithms_Ramps_h -#define NBAlgorithms_Ramps_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -143,9 +137,3 @@ /// @brief shift ramp geometry to merge smoothly with the motorway static void patchRampGeometry(NBEdge* potRamp, NBEdge* first, NBEdge* potHighway, bool onRamp); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBCapacity2Lanes.h sumo-1.6.0+dfsg1/src/netbuild/NBCapacity2Lanes.h --- sumo-1.5.0+dfsg1/src/netbuild/NBCapacity2Lanes.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBCapacity2Lanes.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A helper class which computes the lane number from given capacity /****************************************************************************/ -#ifndef NBCapacity2Lanes_h -#define NBCapacity2Lanes_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -78,9 +72,3 @@ double myDivider; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBConnection.cpp sumo-1.6.0+dfsg1/src/netbuild/NBConnection.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBConnection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBConnection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The class holds a description of a connection between two edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -269,6 +264,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBConnectionDefs.h sumo-1.6.0+dfsg1/src/netbuild/NBConnectionDefs.h --- sumo-1.5.0+dfsg1/src/netbuild/NBConnectionDefs.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBConnectionDefs.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Some container for connections /****************************************************************************/ -#ifndef NBConnectionDefs_h -#define NBConnectionDefs_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -41,9 +35,3 @@ /** @brief Definition of a container for connection block dependencies Includes a list of all connections which prohibit the key connection */ typedef std::map NBConnectionProhibits; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBConnection.h sumo-1.6.0+dfsg1/src/netbuild/NBConnection.h --- sumo-1.5.0+dfsg1/src/netbuild/NBConnection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBConnection.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The class holds a description of a connection between two edges /****************************************************************************/ -#ifndef NBConnection_h -#define NBConnection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -151,9 +145,3 @@ /// @brief The index of the internal junction within the controlling traffic light (optional) int myTlIndex2; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBCont.h sumo-1.6.0+dfsg1/src/netbuild/NBCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,15 +18,10 @@ /// // Some typedef definitions fir containers /****************************************************************************/ -#ifndef NBCont_h -#define NBCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include +#include #include @@ -35,6 +30,7 @@ // class declarations // =========================================================================== class NBEdge; +class NBNode; class NBRouterEdge; @@ -52,11 +48,7 @@ /// @brief container for unique edges typedef std::set EdgeSet; +typedef std::set NodeSet; + /// @brief container for (sorted) lanes. The lanes are sorted from rightmost (id=0) to leftmost (id=nolanes-1) typedef std::vector LaneVector; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBContHelper.cpp sumo-1.6.0+dfsg1/src/netbuild/NBContHelper.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBContHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBContHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Some methods for traversing lists of edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -163,6 +158,10 @@ } lookAhead *= 2; } + if (fabs(relAngle1 - relAngle2) < NUMERICAL_EPS) { + // need to break ties for windows debug version, numerical id may be -1 for both + return e1->getID() > e2->getID(); + } return relAngle1 > relAngle2; } @@ -194,6 +193,10 @@ } lookAhead *= 2; } + if (fabs(relAngle1 - relAngle2) < NUMERICAL_EPS) { + // need to break ties for windows debug version, numerical id may be -1 for both + return e1->getID() > e2->getID(); + } return relAngle1 > relAngle2; } @@ -284,5 +287,5 @@ return angle1 < angle2; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBContHelper.h sumo-1.6.0+dfsg1/src/netbuild/NBContHelper.h --- sumo-1.5.0+dfsg1/src/netbuild/NBContHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBContHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Some methods for traversing lists of edges /****************************************************************************/ -#ifndef NBContHelper_h -#define NBContHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -225,13 +219,15 @@ class edge_similar_direction_sorter { public: /// constructor - explicit edge_similar_direction_sorter(const NBEdge* const e) - : myAngle(e->getShapeEndAngle()) {} + explicit edge_similar_direction_sorter(const NBEdge* const e, bool outgoing = true) : + myCompareOutgoing(outgoing), + myAngle(outgoing ? e->getShapeEndAngle() : e->getShapeStartAngle()) + {} /// comparing operation int operator()(const NBEdge* e1, const NBEdge* e2) const { - const double d1 = angleDiff(e1->getShapeStartAngle(), myAngle); - const double d2 = angleDiff(e2->getShapeStartAngle(), myAngle); + const double d1 = angleDiff(myCompareOutgoing ? e1->getShapeStartAngle() : e1->getShapeEndAngle(), myAngle); + const double d2 = angleDiff(myCompareOutgoing ? e2->getShapeStartAngle() : e2->getShapeEndAngle(), myAngle); if (fabs(fabs(d1) - fabs(d2)) < NUMERICAL_EPS) { if (fabs(d1 - d2) > NUMERICAL_EPS) { return d1 < d2; @@ -257,6 +253,7 @@ private: /// the angle to find the edge with the opposite direction + bool myCompareOutgoing; double myAngle; }; @@ -415,9 +412,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBDistrictCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBDistrictCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBDistrictCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBDistrictCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A container for districts /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -105,6 +100,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBDistrictCont.h sumo-1.6.0+dfsg1/src/netbuild/NBDistrictCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBDistrictCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBDistrictCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A container for districts /****************************************************************************/ -#ifndef NBDistrictCont_h -#define NBDistrictCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -159,9 +153,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBDistrict.cpp sumo-1.6.0+dfsg1/src/netbuild/NBDistrict.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBDistrict.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBDistrict.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class representing a single district /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -189,6 +184,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBDistrict.h sumo-1.6.0+dfsg1/src/netbuild/NBDistrict.h --- sumo-1.5.0+dfsg1/src/netbuild/NBDistrict.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBDistrict.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A class representing a single district /****************************************************************************/ -#ifndef NBDistrict_h -#define NBDistrict_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -270,9 +264,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBEdgeCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBEdgeCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBEdgeCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBEdgeCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -237,6 +232,10 @@ } if (!(edge->getGeometry().getBoxBoundary().grow(POSITION_EPS).overlapsWith(myPruningBoundary))) { return true; + } else if (!(edge->getGeometry().partialWithin(myPruningBoundary, 2 * POSITION_EPS) || edge->getGeometry().intersects(myPruningBoundary))) { + // a more detailed check is necessary because the bounding box may be much bigger than the edge + // @note: overlapsWith implicitly closes the edge shape but this is not wanted here + return true; } } if (myTypeCont.knows(edge->getTypeID()) && myTypeCont.getShallBeDiscarded(edge->getTypeID())) { @@ -533,14 +532,14 @@ int maxLeft = (*i).lanes.back(); double offset = (*i).offset; if (maxLeft < noLanesMax) { - if (e->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + if (e->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT) { offset += (*i).offsetFactor * SUMO_const_laneWidthAndOffset * (noLanesMax - 1 - maxLeft); } else { offset += (*i).offsetFactor * SUMO_const_halfLaneAndOffset * (noLanesMax - 1 - maxLeft); } } int maxRight = (*i).lanes.front(); - if (maxRight > 0 && e->getLaneSpreadFunction() == LANESPREAD_CENTER) { + if (maxRight > 0 && e->getLaneSpreadFunction() == LaneSpreadFunction::CENTER) { offset -= (*i).offsetFactor * SUMO_const_halfLaneAndOffset * maxRight; } //std::cout << " processSplits " << origID << " splitOffset=" << (*i).offset << " offset=" << offset << "\n"; @@ -1029,10 +1028,10 @@ for (EdgeCont::iterator i = myEdges.begin(); i != myEdges.end(); ++i) { NBEdge* opposite = getOppositeByID(i->first); if (opposite != nullptr) { - i->second->setLaneSpreadFunction(LANESPREAD_RIGHT); - opposite->setLaneSpreadFunction(LANESPREAD_RIGHT); + i->second->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); + opposite->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); } else { - i->second->setLaneSpreadFunction(LANESPREAD_CENTER); + i->second->setLaneSpreadFunction(LaneSpreadFunction::CENTER); } } } @@ -1054,9 +1053,10 @@ // ----- other void NBEdgeCont::addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass, - bool keepClear, double contPos, double visibility, double speed, + bool keepClear, double contPos, double visibility, double speed, double length, const PositionVector& customShape, bool uncontrolled, bool warnOnly, SVCPermissions permissions) { - myConnections[from].push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape, uncontrolled, warnOnly, permissions)); + myConnections[from].push_back(PostProcessConnection(from, fromLane, to, toLane, mayDefinitelyPass, keepClear, contPos, visibility, + speed, length, customShape, uncontrolled, warnOnly, permissions)); } bool @@ -1086,7 +1086,7 @@ NBEdge* to = retrievePossiblySplit((*i).to, false); if (from == nullptr || to == nullptr || !from->addLane2LaneConnection((*i).fromLane, to, (*i).toLane, NBEdge::L2L_USER, true, (*i).mayDefinitelyPass, - (*i).keepClear, (*i).contPos, (*i).visibility, (*i).speed, (*i).customShape, + (*i).keepClear, (*i).contPos, (*i).visibility, (*i).speed, (*i).customLength, (*i).customShape, (*i).uncontrolled, SVC_UNSPECIFIED, true)) { const std::string msg = "Could not insert connection between '" + (*i).from + "' and '" + (*i).to + "' after build."; @@ -1208,7 +1208,7 @@ #endif visited.insert(e); const EdgeVector& edges = e->getToNode()->getEdges(); - if (e->getToNode()->getType() == NODETYPE_RIGHT_BEFORE_LEFT && !e->getToNode()->typeWasGuessed()) { + if (e->getToNode()->getType() == SumoXMLNodeType::RIGHT_BEFORE_LEFT && !e->getToNode()->typeWasGuessed()) { doLoop = false; #ifdef DEBUG_GUESS_ROUNDABOUT if (gDebugFlag1) { @@ -1416,7 +1416,7 @@ } const SumoXMLNodeType nodeType = e->getToNode()->getType(); switch (nodeType) { - case NODETYPE_PRIORITY: + case SumoXMLNodeType::PRIORITY: // yield or major? if (e->getJunctionPriority(e->getToNode()) > 0) { e->addSign(NBSign(NBSign::SIGN_TYPE_PRIORITY, offset)); @@ -1424,7 +1424,7 @@ e->addSign(NBSign(NBSign::SIGN_TYPE_YIELD, offset)); } break; - case NODETYPE_PRIORITY_STOP: + case SumoXMLNodeType::PRIORITY_STOP: // yield or major? if (e->getJunctionPriority(e->getToNode()) > 0) { e->addSign(NBSign(NBSign::SIGN_TYPE_PRIORITY, offset)); @@ -1432,10 +1432,10 @@ e->addSign(NBSign(NBSign::SIGN_TYPE_STOP, offset)); } break; - case NODETYPE_ALLWAY_STOP: + case SumoXMLNodeType::ALLWAY_STOP: e->addSign(NBSign(NBSign::SIGN_TYPE_ALLWAY_STOP, offset)); break; - case NODETYPE_RIGHT_BEFORE_LEFT: + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: e->addSign(NBSign(NBSign::SIGN_TYPE_RIGHT_BEFORE_LEFT, offset)); break; default: @@ -1564,7 +1564,7 @@ outline2.append(e2->getCCWBoundaryLine(*e2->getToNode())); const double overlap = outline1.getOverlapWith(outline2, zThreshold); if (overlap > threshold) { - WRITE_WARNING("Edge '" + e1->getID() + "' overlaps with edge '" + e2->getID() + "' by " + toString(overlap) + "."); + WRITE_WARNINGF("Edge '%' overlaps with edge '%' by %.", e1->getID(), e2->getID(), toString(overlap)); } } } @@ -1580,9 +1580,9 @@ double maxJump = 0; const double grade = edge->getLaneShape(i).getMaxGrade(maxJump); if (maxJump > 0.01) { - WRITE_WARNING("Edge '" + edge->getID() + "' has a vertical jump of " + toString(maxJump) + "m."); + WRITE_WARNINGF("Edge '%s' has a vertical jump of %sm.", edge->getID(), toString(maxJump)); } else if (grade > threshold) { - WRITE_WARNING("Edge '" + edge->getID() + "' has a grade of " + toString(grade * 100) + "%."); + WRITE_WARNINGF("Edge '%' has a grade of %%.", edge->getID(), toString(grade * 100), "%"); break; } } @@ -1592,9 +1592,9 @@ double maxJump = 0; const double grade = MAX2(c.shape.getMaxGrade(maxJump), c.viaShape.getMaxGrade(maxJump)); if (maxJump > 0.01) { - WRITE_WARNING("Connection '" + c.getDescription(edge) + "' has a vertical jump of " + toString(maxJump) + "m."); + WRITE_WARNINGF("Connection '%' has a vertical jump of %m.", c.getDescription(edge), toString(maxJump)); } else if (grade > threshold) { - WRITE_WARNING("Connection '" + c.getDescription(edge) + "' has a grade of " + toString(grade * 100) + "%."); + WRITE_WARNINGF("Connection '%' has a grade of %%.", c.getDescription(edge), toString(grade * 100), "%"); break; } } @@ -1628,4 +1628,23 @@ return RouterEdgeVector(all.begin(), all.end()); } +bool +NBEdgeCont::checkConsistency(const NBNodeCont& nc) { + bool ok = true; + for (const auto& item : myEdges) { + NBEdge* e = item.second; + if (nc.retrieve(e->getFromNode()->getID()) == nullptr) { + WRITE_ERROR("Edge's '" + e->getID() + "' from-node '" + e->getFromNode()->getID() + "' is not known."); + ok = false; + } + if (nc.retrieve(e->getToNode()->getID()) == nullptr) { + WRITE_ERROR("Edge's '" + e->getID() + "' to-node '" + e->getToNode()->getID() + "' is not known."); + ok = false; + } + + } + return ok; +} + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBEdgeCont.h sumo-1.6.0+dfsg1/src/netbuild/NBEdgeCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBEdgeCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBEdgeCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Storage for edges, including some functionality operating on multiple edges /****************************************************************************/ -#ifndef NBEdgeCont_h -#define NBEdgeCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -542,7 +536,8 @@ * @param[in] warnOnly Whether a failure to set this connection should only result in a warning */ void addPostProcessConnection(const std::string& from, int fromLane, const std::string& to, int toLane, bool mayDefinitelyPass, - bool keepClear, double contPos, double visibility, double speed, + bool keepClear, double contPos, double visibility, + double speed, double length, const PositionVector& customShape, bool uncontrolled, bool warnOnly, @@ -608,6 +603,9 @@ EdgeVector getAllEdges() const; RouterEdgeVector getAllRouterEdges() const; + /// @brief ensure that all edges have valid nodes + bool checkConsistency(const NBNodeCont& nc); + private: /// @brief compute the form factor for a loop of edges static double formFactor(const EdgeVector& loopEdges); @@ -630,12 +628,14 @@ */ PostProcessConnection(const std::string& from_, int fromLane_, const std::string& to_, int toLane_, bool mayDefinitelyPass_, bool keepClear_, double contPos_, double visibility_, double speed_, + double length_, const PositionVector& customShape_, bool uncontrolled_, bool warnOnly_, SVCPermissions permissions_) : from(from_), fromLane(fromLane_), to(to_), toLane(toLane_), mayDefinitelyPass(mayDefinitelyPass_), keepClear(keepClear_), contPos(contPos_), visibility(visibility_), speed(speed_), + customLength(length_), customShape(customShape_), uncontrolled(uncontrolled_), permissions(permissions_), @@ -659,6 +659,8 @@ double visibility; /// @brief custom speed for connection double speed; + /// @brief custom length for connection + double customLength; /// @brief custom shape for connection PositionVector customShape; /// @brief whether this connection shall not be controlled by a traffic light @@ -750,9 +752,3 @@ NBEdgeCont& operator=(const NBEdgeCont& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBEdge.cpp sumo-1.6.0+dfsg1/src/netbuild/NBEdge.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Methods for the representation of a single edge /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -77,6 +72,8 @@ const int NBEdge::UNSPECIFIED_INTERNAL_LANE_INDEX = -1; const bool NBEdge::UNSPECIFIED_CONNECTION_UNCONTROLLED = false; +double NBEdge::myDefaultConnectionLength = NBEdge::UNSPECIFIED_LOADED_LENGTH; + NBEdge NBEdge::DummyEdge; ConstRouterEdgePairVector NBEdge::Connection::myViaSuccessors = ConstRouterEdgePairVector({ std::pair(nullptr, nullptr) }); @@ -107,6 +104,7 @@ contPos(UNSPECIFIED_CONTPOS), visibility(UNSPECIFIED_VISIBILITY_DISTANCE), speed(UNSPECIFIED_SPEED), + customLength(myDefaultConnectionLength), permissions(SVC_UNSPECIFIED), id(toEdge_ == nullptr ? "" : toEdge->getFromNode()->getID()), haveVia(false), @@ -116,7 +114,7 @@ NBEdge::Connection::Connection(int fromLane_, NBEdge* toEdge_, int toLane_, bool mayDefinitelyPass_, bool keepClear_, double contPos_, - double visibility_, double speed_, bool haveVia_, bool uncontrolled_, const PositionVector& customShape_, SVCPermissions permissions_) : + double visibility_, double speed_, double length_, bool haveVia_, bool uncontrolled_, const PositionVector& customShape_, SVCPermissions permissions_) : fromLane(fromLane_), toEdge(toEdge_), toLane(toLane_), @@ -127,6 +125,7 @@ contPos(contPos_), visibility(visibility_), speed(speed_), + customLength(length_), customShape(customShape_), permissions(permissions_), id(toEdge_ == nullptr ? "" : toEdge->getFromNode()->getID()), @@ -215,7 +214,7 @@ } #endif if (NBNode::isTrafficLight(to->getType()) && - (straightestDir == LINKDIR_STRAIGHT || straightestDir == LINKDIR_PARTLEFT || straightestDir == LINKDIR_PARTRIGHT)) { + (straightestDir == LinkDirection::STRAIGHT || straightestDir == LinkDirection::PARTLEFT || straightestDir == LinkDirection::PARTRIGHT)) { myDirs.push_back(MainDirections::DIR_FORWARD); return; } @@ -237,7 +236,7 @@ } // check whether the forward direction has a higher priority // check whether it has a higher priority and is going straight - if (straight->getJunctionPriority(to) == 1 && to->getDirection(parent, straight) == LINKDIR_STRAIGHT) { + if (straight->getJunctionPriority(to) == 1 && to->getDirection(parent, straight) == LinkDirection::STRAIGHT) { myDirs.push_back(MainDirections::DIR_FORWARD); } } @@ -484,7 +483,8 @@ } if (myGeom.size() == 2 && myGeom[0] == myGeom[1]) { WRITE_WARNINGF("Edge's '%' from- and to-node are at the same position.", myID); - myGeom[1].add(Position(POSITION_EPS, POSITION_EPS)); + int patchIndex = myFrom->getID() < myTo->getID() ? 1 : 0; + myGeom[patchIndex].add(Position(POSITION_EPS, POSITION_EPS)); } // myFrom->addOutgoingEdge(this); @@ -533,6 +533,9 @@ void NBEdge::reshiftPosition(double xoff, double yoff) { myGeom.add(xoff, yoff, 0); + for (Lane& lane : myLanes) { + lane.customShape.add(xoff, yoff, 0); + } computeLaneShapes(); // old shapes are dubious if computed with large coordinates for (std::vector::iterator i = myConnections.begin(); i != myConnections.end(); ++i) { (*i).customShape.add(xoff, yoff, 0); @@ -706,9 +709,9 @@ bool NBEdge::isBidiRail(bool ignoreSpread) const { return (isRailway(getPermissions()) - && (ignoreSpread || myLaneSpreadFunction == LANESPREAD_CENTER) + && (ignoreSpread || myLaneSpreadFunction == LaneSpreadFunction::CENTER) && myPossibleTurnDestination != nullptr - && (ignoreSpread || myPossibleTurnDestination->getLaneSpreadFunction() == LANESPREAD_CENTER) + && (ignoreSpread || myPossibleTurnDestination->getLaneSpreadFunction() == LaneSpreadFunction::CENTER) && isRailway(myPossibleTurnDestination->getPermissions()) && myPossibleTurnDestination->getGeometry().reverse() == getGeometry()); } @@ -922,6 +925,9 @@ myGeom = reverse.reverse(); } else { myGeom.removeDoublePoints(minDist, true); + for (Lane& lane : myLanes) { + lane.customShape.removeDoublePoints(minDist, true); + } } } @@ -1015,6 +1021,7 @@ double contPos, double visibility, double speed, + double length, const PositionVector& customShape, bool uncontrolled, SVCPermissions permissions, @@ -1031,7 +1038,7 @@ if (!addEdge2EdgeConnection(dest)) { return false; } - return setConnection(from, dest, toLane, type, mayUseSameDestination, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape, uncontrolled, permissions, postProcess); + return setConnection(from, dest, toLane, type, mayUseSameDestination, mayDefinitelyPass, keepClear, contPos, visibility, speed, length, customShape, uncontrolled, permissions, postProcess); } @@ -1061,6 +1068,7 @@ double contPos, double visibility, double speed, + double length, const PositionVector& customShape, bool uncontrolled, SVCPermissions permissions, @@ -1104,6 +1112,7 @@ myConnections.back().visibility = visibility; myConnections.back().permissions = permissions; myConnections.back().speed = speed; + myConnections.back().customLength = length; myConnections.back().customShape = customShape; myConnections.back().uncontrolled = uncontrolled; if (type == L2L_USER) { @@ -1491,7 +1500,7 @@ } #endif setConnection(toUse, i->toEdge, i->toLane, L2L_COMPUTED, false, i->mayDefinitelyPass, i->keepClear, - i->contPos, i->visibility, i->speed, i->customShape, i->uncontrolled); + i->contPos, i->visibility, i->speed, i->customLength, i->customShape, i->uncontrolled); } // remove the remapped edge from connections removeFromConnections(which); @@ -1565,8 +1574,8 @@ continue; } LinkDirection dir = n.getDirection(this, con.toEdge); - const bool isRightTurn = (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT); - const bool isTurn = (isRightTurn || dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT); + const bool isRightTurn = (dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT); + const bool isTurn = (isRightTurn || dir == LinkDirection::LEFT || dir == LinkDirection::PARTLEFT); // put turning internal lanes on separate edges if (con.toEdge != toEdge || (isTurn && !joinTurns)) { @@ -1584,7 +1593,7 @@ PositionVector shape = n.computeInternalLaneShape(this, con, numPoints, myTo, shapeFlag); std::vector foeInternalLinks; - if (dir != LINKDIR_STRAIGHT && shape.length() < POSITION_EPS && !(isBidiRail() && getTurnDestination(true) == con.toEdge)) { + if (dir != LinkDirection::STRAIGHT && shape.length() < POSITION_EPS && !(isBidiRail() && getTurnDestination(true) == con.toEdge)) { WRITE_WARNINGF("Connection '%_%->%_%' is only %m short.", getID(), con.fromLane, con.toEdge->getID(), con.toLane, shape.length()); } @@ -1592,11 +1601,11 @@ std::pair > crossingPositions(-1, std::vector()); std::set tmpFoeIncomingLanes; switch (dir) { - case LINKDIR_RIGHT: - case LINKDIR_PARTRIGHT: - case LINKDIR_LEFT: - case LINKDIR_PARTLEFT: - case LINKDIR_TURN: { + case LinkDirection::RIGHT: + case LinkDirection::PARTRIGHT: + case LinkDirection::LEFT: + case LinkDirection::PARTLEFT: + case LinkDirection::TURN: { int index = 0; const std::vector& incoming = n.getIncomingEdges(); for (EdgeVector::const_iterator i2 = incoming.begin(); i2 != incoming.end(); ++i2) { @@ -1616,7 +1625,7 @@ bool oppositeLeftIntersect = !foes && bothLeftIntersect(n, shape, dir, *i2, *k2, numPoints, width2); int shapeFlag = 0; // do not warn if only bicycles pedestrians or delivery vehicles are involved as this is a typical occurence - SVCPermissions warn = SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_DELIVERY); + SVCPermissions warn = SVCAll & ~(SVC_PEDESTRIAN | SVC_BICYCLE | SVC_DELIVERY | SVC_RAIL_CLASSES); if (oppositeLeftIntersect && (((*i2)->getPermissions((*k2).fromLane) & warn) != 0 && ((*k2).toEdge->getPermissions((*k2).toLane) & warn) != 0)) { @@ -1654,14 +1663,14 @@ && ((*i2)->getPermissions((*k2).fromLane) & warn) != 0 && ((*k2).toEdge->getPermissions((*k2).toLane) & warn) != 0 // do not warn for unregulated nodes - && n.getType() != NODETYPE_NOJUNCTION + && n.getType() != SumoXMLNodeType::NOJUNCTION ) { WRITE_WARNINGF("Intersecting left turns at junction '%' from lane '%' and lane '%' (increase junction radius to avoid this).", n.getID(), getLaneID(con.fromLane), (*i2)->getLaneID((*k2).fromLane)); } // compute foe incoming lanes const bool signalised = hasSignalisedConnectionTo(con.toEdge); - if ((n.forbids(*i2, (*k2).toEdge, this, con.toEdge, signalised) || rightTurnConflict) && (needsCont || dir == LINKDIR_TURN)) { + if ((n.forbids(*i2, (*k2).toEdge, this, con.toEdge, signalised) || rightTurnConflict) && (needsCont || dir == LinkDirection::TURN)) { tmpFoeIncomingLanes.insert((*i2)->getID() + "_" + toString((*k2).fromLane)); } if (bothPrio && oppositeLeftIntersect && getID() < (*i2)->getID()) { @@ -1699,7 +1708,7 @@ index++; } - if (dir == LINKDIR_TURN && crossingPositions.first < 0 && crossingPositions.second.size() != 0 && shape.length() > 2. * POSITION_EPS) { + if (dir == LinkDirection::TURN && crossingPositions.first < 0 && crossingPositions.second.size() != 0 && shape.length() > 2. * POSITION_EPS) { // let turnarounds wait in the middle if no other crossing point was found and it has a sensible length // (if endOffset is used, the crossing point is in the middle of the part within the junction shape) crossingPositions.first = (double)(shape.length() + getEndOffset(con.fromLane)) / 2.; @@ -1747,10 +1756,10 @@ const double reduction = con.vmax - limit; // always treat connctions at roundabout as turns when warning const bool atRoundabout = getJunctionPriority(myTo) == ROUNDABOUT || con.toEdge->getJunctionPriority(myFrom) == ROUNDABOUT; - int dir2 = atRoundabout ? LINKDIR_LEFT : dir; - if ((dir2 == LINKDIR_STRAIGHT && reduction > limitTurnSpeedWarnStraight) - || (dir2 != LINKDIR_TURN && reduction > limitTurnSpeedWarnTurn)) { - std::string dirType = std::string(dir == LINKDIR_STRAIGHT ? "straight" : "turning"); + const LinkDirection dir2 = atRoundabout ? LinkDirection::LEFT : dir; + if ((dir2 == LinkDirection::STRAIGHT && reduction > limitTurnSpeedWarnStraight) + || (dir2 != LinkDirection::TURN && reduction > limitTurnSpeedWarnTurn)) { + std::string dirType = std::string(dir == LinkDirection::STRAIGHT ? "straight" : "turning"); if (atRoundabout) { dirType = "roundabout"; } @@ -1766,6 +1775,8 @@ // std::cout << con.getDescription(this) << " angleRaw=" << angleRaw << " angle=" << RAD2DEG(angle) << " length=" << length << " radius=" << length / angle // << " vmaxTurn=" << sqrt(limitTurnSpeed * length / angle) << " vmax=" << con.vmax << "\n"; //} + } else if (fromRail && dir == LinkDirection::TURN) { + con.vmax = 0.01; } } else { con.vmax = con.speed; @@ -1790,7 +1801,11 @@ ++internalLaneIndex; ++linkIndex; ++numLanes; - lengthSum += MAX2(POSITION_EPS, con.shape.length()); + if (con.customLength != UNSPECIFIED_LOADED_LENGTH) { + lengthSum += con.customLength; + } else { + lengthSum += con.shape.length(); + } } assignInternalLaneLength(myConnections.end(), numLanes, lengthSum); } @@ -1804,7 +1819,19 @@ assert(i - myConnections.begin() >= numLanes); for (int prevIndex = 1; prevIndex <= numLanes; prevIndex++) { //std::cout << " con=" << (*(i - prevIndex)).getDescription(this) << " numLanes=" << numLanes << " avgLength=" << lengthSum / numLanes << "\n"; - (*(i - prevIndex)).length = lengthSum / numLanes; + Connection& c = (*(i - prevIndex)); + const double minLength = c.customLength != UNSPECIFIED_LOADED_LENGTH ? pow(10, -gPrecision) : POSITION_EPS; + c.length = MAX2(minLength, lengthSum / numLanes); + if (c.haveVia) { + c.viaLength = c.viaShape.length(); + if (c.customLength != UNSPECIFIED_LOADED_LENGTH) { + // split length proportionally + const double firstLength = c.shape.length(); + const double a = firstLength / (firstLength + c.viaLength); + c.length = MAX2(minLength, a * c.customLength); + c.viaLength = MAX2(minLength, c.customLength - c.length); + } + } } } @@ -1847,7 +1874,7 @@ return false; } LinkDirection dir2 = n.getDirection(otherFrom, otherCon.toEdge); - const bool bothLeft = (dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT) && (dir2 == LINKDIR_LEFT || dir2 == LINKDIR_PARTLEFT); + const bool bothLeft = (dir == LinkDirection::LEFT || dir == LinkDirection::PARTLEFT) && (dir2 == LinkDirection::LEFT || dir2 == LinkDirection::PARTLEFT); if (bothLeft) { const PositionVector otherShape = n.computeInternalLaneShape(otherFrom, otherCon, numPoints, 0, shapeFlag); const double minDV = firstIntersection(shape, otherShape, width2); @@ -1942,17 +1969,26 @@ offset += (getLaneWidth(i) + getLaneWidth(i + 1)) / 2. + SUMO_const_laneOffset; offsets[i] = offset; } - if (myLaneSpreadFunction == LANESPREAD_RIGHT) { - double laneWidth = myLanes.back().width != UNSPECIFIED_WIDTH ? myLanes.back().width : SUMO_const_laneWidth; - offset = (laneWidth + SUMO_const_laneOffset) / 2.; // @note: offset for half of the center-line marking of the road - } else { + if (myLaneSpreadFunction == LaneSpreadFunction::CENTER) { double width = 0; for (int i = 0; i < (int)myLanes.size(); ++i) { width += getLaneWidth(i); } width += SUMO_const_laneOffset * double(myLanes.size() - 1); offset = -width / 2. + getLaneWidth((int)myLanes.size() - 1) / 2.; + } else { + double laneWidth = myLanes.back().width != UNSPECIFIED_WIDTH ? myLanes.back().width : SUMO_const_laneWidth; + offset = (laneWidth + SUMO_const_laneOffset) / 2.; // @note: offset for half of the center-line marking of the road } + if (myLaneSpreadFunction == LaneSpreadFunction::ROADCENTER) { + for (NBEdge* e : myTo->getOutgoingEdges()) { + if (e->getToNode() == myFrom && getInnerGeometry().reverse() == e->getInnerGeometry()) { + offset += (e->getTotalWidth() - getTotalWidth()) / 2; + break; + } + } + } + for (int i = 0; i < (int)myLanes.size(); ++i) { offsets[i] += offset; } @@ -1996,7 +2032,7 @@ Position toCenter = (hasToShape ? myTo->getShape().getCentroid() : myTo->getPosition()); PositionVector shape = myGeom; if ((hasFromShape || hasToShape) && getNumLanes() > 0) { - if (myLaneSpreadFunction == LANESPREAD_RIGHT) { + if (myLaneSpreadFunction == LaneSpreadFunction::RIGHT) { shape = myLanes[getNumLanes() - 1].shape ; } else { shape = myLanes[getNumLanes() / 2].shape; @@ -2707,7 +2743,7 @@ for (int i = 0; i < numOutgoing; i++) { if (maxPrio < priorities[i]) { const LinkDirection dir = myTo->getDirection(this, (*outgoing)[i]); - if (dir == LINKDIR_STRAIGHT) { + if (dir == LinkDirection::STRAIGHT) { maxPrio = priorities[i]; target = (*outgoing)[i]; rightOfTarget = i == 0 ? outgoing->back() : (*outgoing)[i - 1]; @@ -2863,7 +2899,7 @@ void NBEdge::appendTurnaround(bool noTLSControlled, bool noFringe, bool onlyDeadends, bool onlyTurnlane, bool noGeometryLike, bool checkPermissions) { // do nothing if no turnaround is known - if (myTurnDestination == nullptr || myTo->getType() == NODETYPE_RAIL_CROSSING) { + if (myTurnDestination == nullptr || myTo->getType() == SumoXMLNodeType::RAIL_CROSSING) { return; } // do nothing if the destination node is controlled by a tls and no turnarounds @@ -2871,7 +2907,7 @@ if (noTLSControlled && myTo->isTLControlled()) { return; } - if (noFringe && myTo->getFringeType() == FRINGE_TYPE_OUTER) { + if (noFringe && myTo->getFringeType() == FringeType::OUTER) { return; } bool isDeadEnd = true; @@ -2891,7 +2927,7 @@ if (onlyTurnlane) { for (const Connection& c : getConnectionsFromLane(fromLane)) { LinkDirection dir = myTo->getDirection(this, c.toEdge); - if (dir != LINKDIR_LEFT && dir != LINKDIR_PARTLEFT) { + if (dir != LinkDirection::LEFT && dir != LinkDirection::PARTLEFT) { return; } } @@ -3206,7 +3242,7 @@ // append geometry myGeom.append(e->myGeom); for (int i = 0; i < (int)myLanes.size(); i++) { - myLanes[i].shape.append(e->myLanes[i].shape); + myLanes[i].customShape.append(e->myLanes[i].customShape); if (myLanes[i].knowsParameter(SUMO_PARAM_ORIGID) || e->myLanes[i].knowsParameter(SUMO_PARAM_ORIGID) || OptionsCont::getOptions().getBool("output.original-names")) { const std::string origID = myLanes[i].getParameter(SUMO_PARAM_ORIGID, getID()); @@ -3629,7 +3665,7 @@ if (mySignalPosition == Position::INVALID) { return UNSPECIFIED_SIGNAL_OFFSET; } else { - Position laneEnd = myLaneSpreadFunction == LANESPREAD_RIGHT ? + Position laneEnd = myLaneSpreadFunction == LaneSpreadFunction::RIGHT ? myLanes.back().shape.back() : myLanes[getNumLanes() / 2].shape.back(); //std::cout << getID() << " signalPos=" << mySignalPosition << " laneEnd=" << laneEnd << " toShape=" << myTo->getShape() << " toBorder=" << myToBorder << "\n"; return mySignalPosition.distanceTo2D(laneEnd); @@ -3780,7 +3816,7 @@ WRITE_WARNINGF("Edge '%' already has a dedicated lane for %s. Not adding another one.", getID(), toString(vclass)); return; } - if (myLaneSpreadFunction == LANESPREAD_CENTER) { + if (myLaneSpreadFunction == LaneSpreadFunction::CENTER) { myGeom.move2side(width / 2); } // disallow pedestrians on all lanes to ensure that sidewalks are used and @@ -3844,7 +3880,7 @@ void NBEdge::shiftPositionAtNode(NBNode* node, NBEdge* other) { - if (myLaneSpreadFunction == LANESPREAD_CENTER && !isRailway(getPermissions())) { + if (myLaneSpreadFunction == LaneSpreadFunction::CENTER && !isRailway(getPermissions())) { const int i = (node == myTo ? -1 : 0); const int i2 = (node == myTo ? 0 : -1); const double dist = myGeom[i].distanceTo2D(node->getPosition()); @@ -4024,4 +4060,20 @@ } } +NBEdge* +NBEdge::getStraightPredecessor(SVCPermissions permissions) const { + EdgeVector cands = filterByPermissions(myFrom->getIncomingEdges(), permissions); + if (cands.size() == 0) { + return nullptr; + } + sort(cands.begin(), cands.end(), NBContHelper::edge_similar_direction_sorter(this, false)); + NBEdge* best = cands.front(); + if (best->isTurningDirectionAt(this)) { + return nullptr; + } else { + return best; + } +} + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBEdge.h sumo-1.6.0+dfsg1/src/netbuild/NBEdge.h --- sumo-1.5.0+dfsg1/src/netbuild/NBEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The representation of a single edge during network building /****************************************************************************/ -#ifndef NBEdge_h -#define NBEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,6 +64,7 @@ virtual const std::string& getID() const = 0; virtual double getSpeed() const = 0; virtual double getLength() const = 0; + virtual const NBRouterEdge* getBidiEdge() const = 0; virtual int getNumericalID() const = 0; virtual const ConstRouterEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const = 0; virtual bool isInternal() const { @@ -82,6 +77,7 @@ return false; } + static inline double getTravelTimeStatic(const NBRouterEdge* const edge, const NBVehicle* const /*veh*/, double /*time*/) { return edge->getLength() / edge->getSpeed(); } @@ -204,6 +200,7 @@ double contPos_ = UNSPECIFIED_CONTPOS, double visibility_ = UNSPECIFIED_VISIBILITY_DISTANCE, double speed_ = UNSPECIFIED_SPEED, + double length_ = myDefaultConnectionLength, bool haveVia_ = false, bool uncontrolled_ = false, const PositionVector& customShape_ = PositionVector::EMPTY, @@ -242,6 +239,9 @@ /// @brief custom speed for connection double speed; + /// @brief custom length for connection + double customLength; + /// @brief custom shape for connection PositionVector customShape; @@ -266,6 +266,9 @@ /// @brief shape of via PositionVector viaShape; + /// @brief the length of the via shape (maybe customized) + double viaLength; + /// @brief FOE Internal links std::vector foeInternalLinks; @@ -302,6 +305,9 @@ int getNumericalID() const { throw ProcessError("NBEdge::Connection does not implement getNumericalID()"); } + const Connection* getBidiEdge() const { + return nullptr; + } bool isInternal() const { return true; } @@ -352,6 +358,10 @@ ROUNDABOUT = 1000 }; + static void setDefaultConnectionLength(double length) { + myDefaultConnectionLength = length; + } + public: /** @brief Constructor * @@ -376,7 +386,7 @@ double speed, int nolanes, int priority, double width, double endOffset, const std::string& streetName = "", - LaneSpreadFunction spread = LANESPREAD_RIGHT); + LaneSpreadFunction spread = LaneSpreadFunction::RIGHT); /** @brief Constructor @@ -407,7 +417,7 @@ PositionVector geom, const std::string& streetName = "", const std::string& origID = "", - LaneSpreadFunction spread = LANESPREAD_RIGHT, + LaneSpreadFunction spread = LaneSpreadFunction::RIGHT, bool tryIgnoreNodePositions = false); /** @brief Constructor @@ -451,7 +461,7 @@ double speed, int nolanes, int priority, PositionVector geom, double width, double endOffset, const std::string& streetName, - LaneSpreadFunction spread = LANESPREAD_RIGHT, + LaneSpreadFunction spread = LaneSpreadFunction::RIGHT, bool tryIgnoreNodePositions = false); /** @brief Resets nodes but keeps all other values the same (used when joining) @@ -489,6 +499,11 @@ return myPriority; } + /// @brief Sets the priority of the edge + void setPriority(int priority) { + myPriority = priority; + } + /** @brief Returns the origin node of the edge * @return The node this edge starts at */ @@ -847,6 +862,7 @@ double contPos = UNSPECIFIED_CONTPOS, double visibility = UNSPECIFIED_VISIBILITY_DISTANCE, double speed = UNSPECIFIED_SPEED, + double length = myDefaultConnectionLength, const PositionVector& customShape = PositionVector::EMPTY, const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions = SVC_UNSPECIFIED, @@ -893,6 +909,7 @@ double contPos = UNSPECIFIED_CONTPOS, double visibility = UNSPECIFIED_VISIBILITY_DISTANCE, double speed = UNSPECIFIED_SPEED, + double length = myDefaultConnectionLength, const PositionVector& customShape = PositionVector::EMPTY, const bool uncontrolled = UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions = SVC_UNSPECIFIED, @@ -1388,6 +1405,10 @@ return myIndex; } + const NBEdge* getBidiEdge() const { + return isBidiRail() ? myPossibleTurnDestination : nullptr; + } + /** @brief Returns the following edges for the given vClass */ const EdgeVector& getSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const; @@ -1412,6 +1433,10 @@ /// @note: this method is called before connections are built and simply goes by node graph topology NBEdge* getStraightContinuation(SVCPermissions permissions) const; + /// @brief return the straightest predecessor edge for the given permissions or nullptr (never returns turn-arounds) + /// @note: this method is called before connections are built and simply goes by node graph topology + NBEdge* getStraightPredecessor(SVCPermissions permissions) const; + /// @brief return only those edges that permit at least one of the give permissions static EdgeVector filterByPermissions(const EdgeVector& edges, SVCPermissions permissions); @@ -1675,6 +1700,9 @@ // @brief a static list of successor edges. Set by NBEdgeCont and requires reset when the network changes mutable ConstRouterEdgePairVector myViaSuccessors; + // @brief default length for overriding connection lengths + static double myDefaultConnectionLength; + public: /// @class connections_toedge_finder @@ -1848,9 +1876,3 @@ NBEdge(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBFrame.cpp sumo-1.6.0+dfsg1/src/netbuild/NBFrame.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for netbuild /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -60,6 +55,9 @@ oc.addSynonyme("default.lanewidth", "lanewidth", true); oc.addDescription("default.lanewidth", "Building Defaults", "The default width of lanes"); + oc.doRegister("default.spreadtype", new Option_String("right")); + oc.addDescription("default.spreadtype", "Building Defaults", "The default method for computing lane shapes from edge shapes"); + oc.doRegister("default.speed", 'S', new Option_Float((double) 13.89)); oc.addSynonyme("default.speed", "speed", true); oc.addDescription("default.speed", "Building Defaults", "The default speed on an edge (in m/s)"); @@ -89,6 +87,9 @@ oc.doRegister("default.junctions.radius", new Option_Float(4)); oc.addDescription("default.junctions.radius", "Building Defaults", "The default turning radius of intersections"); + oc.doRegister("default.connection-length", new Option_Float((double) NBEdge::UNSPECIFIED_LOADED_LENGTH)); + oc.addDescription("default.connection-length", "Building Defaults", "The default length when overriding connection lengths"); + oc.doRegister("default.right-of-way", new Option_String("default")); oc.addDescription("default.right-of-way", "Building Defaults", "The default algorithm for computing right of way rules ('default', 'edgePriority')"); @@ -206,12 +207,18 @@ oc.doRegister("railway.topology.repair.connect-straight", new Option_Bool(false)); oc.addDescription("railway.topology.repair.connect-straight", "Railway", "Allow bidiretional rail use wherever rails with opposite directions meet at a straight angle"); + oc.doRegister("railway.topology.repair.stop-turn", new Option_Bool(false)); + oc.addDescription("railway.topology.repair.stop-turn", "Railway", "Add turn-around connections at all loaded stops."); + oc.doRegister("railway.topology.all-bidi", new Option_Bool(false)); oc.addDescription("railway.topology.all-bidi", "Railway", "Make all rails usable in both direction"); oc.doRegister("railway.topology.all-bidi.input-file", new Option_FileName()); oc.addDescription("railway.topology.all-bidi.input-file", "Railway", "Make all rails edge ids from FILE usable in both direction"); + 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.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); @@ -677,6 +684,13 @@ if (oc.isDefault("railway.topology.all-bidi") && !oc.isDefault("railway.topology.all-bidi.input-file")) { oc.set("railway.topology.all-bidi", "true"); } + if (oc.isDefault("railway.topology.repair.stop-turn") && !oc.isDefault("railway.topology.repair")) { + oc.set("railway.topology.repair.stop-turn", "true"); + } + if (!SUMOXMLDefinitions::LaneSpreadFunctions.hasString(oc.getString("default.spreadtype"))) { + WRITE_ERROR("Unknown value for default.spreadtype '" + oc.getString("default.spreadtype") + "'."); + ok = false; + } return ok; } diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBFrame.h sumo-1.6.0+dfsg1/src/netbuild/NBFrame.h --- sumo-1.5.0+dfsg1/src/netbuild/NBFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for netbuild /****************************************************************************/ -#ifndef NBFrame_h -#define NBFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -62,9 +56,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBHeightMapper.cpp sumo-1.6.0+dfsg1/src/netbuild/NBHeightMapper.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBHeightMapper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBHeightMapper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Set z-values for all network positions based on data from a height map /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -52,13 +47,12 @@ // =========================================================================== // static members // =========================================================================== -NBHeightMapper NBHeightMapper::Singleton; +NBHeightMapper NBHeightMapper::myInstance; + // =========================================================================== // method definitions // =========================================================================== - - NBHeightMapper::NBHeightMapper(): myRTree(&Triangle::addSelf) { } @@ -71,7 +65,7 @@ const NBHeightMapper& NBHeightMapper::get() { - return Singleton; + return myInstance; } @@ -155,10 +149,10 @@ std::vector files = oc.getStringVector("heightmap.geotiff"); for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { PROGRESS_BEGIN_MESSAGE("Parsing from GeoTIFF '" + *file + "'"); - int numFeatures = Singleton.loadTiff(*file); + int numFeatures = myInstance.loadTiff(*file); MsgHandler::getMessageInstance()->endProcessMsg( " done (parsed " + toString(numFeatures) + - " features, Boundary: " + toString(Singleton.getBoundary()) + ")."); + " features, Boundary: " + toString(myInstance.getBoundary()) + ")."); } } if (oc.isSet("heightmap.shapefiles")) { @@ -166,10 +160,10 @@ std::vector files = oc.getStringVector("heightmap.shapefiles"); for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { PROGRESS_BEGIN_MESSAGE("Parsing from shape-file '" + *file + "'"); - int numFeatures = Singleton.loadShapeFile(*file); + int numFeatures = myInstance.loadShapeFile(*file); MsgHandler::getMessageInstance()->endProcessMsg( " done (parsed " + toString(numFeatures) + - " features, Boundary: " + toString(Singleton.getBoundary()) + ")."); + " features, Boundary: " + toString(myInstance.getBoundary()) + ")."); } } } @@ -183,9 +177,9 @@ OGRDataSource* ds = OGRSFDriverRegistrar::Open(file.c_str(), FALSE); #else GDALAllRegister(); - GDALDataset* ds = (GDALDataset*)GDALOpenEx(file.c_str(), GDAL_OF_VECTOR | GA_ReadOnly, NULL, NULL, NULL); + GDALDataset* ds = (GDALDataset*)GDALOpenEx(file.c_str(), GDAL_OF_VECTOR | GA_ReadOnly, nullptr, nullptr, nullptr); #endif - if (ds == NULL) { + if (ds == nullptr) { throw ProcessError("Could not open shape file '" + file + "'."); } @@ -199,14 +193,14 @@ OGRSpatialReference sr_dest; sr_dest.SetWellKnownGeogCS("WGS84"); OGRCoordinateTransformation* toWGS84 = OGRCreateCoordinateTransformation(sr_src, &sr_dest); - if (toWGS84 == 0) { + if (toWGS84 == nullptr) { WRITE_WARNING("Could not create geocoordinates converter; check whether proj.4 is installed."); } int numFeatures = 0; OGRFeature* feature; layer->ResetReading(); - while ((feature = layer->GetNextFeature()) != NULL) { + while ((feature = layer->GetNextFeature()) != nullptr) { OGRGeometry* geom = feature->GetGeometryRef(); assert(geom != 0); @@ -390,4 +384,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBHeightMapper.h sumo-1.6.0+dfsg1/src/netbuild/NBHeightMapper.h --- sumo-1.5.0+dfsg1/src/netbuild/NBHeightMapper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBHeightMapper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Set z-values for all network positions based on data from a height map /****************************************************************************/ -#ifndef NBHeightMapper_h -#define NBHeightMapper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef _MSC_VER @@ -63,7 +57,7 @@ friend class NBHeightMapperTest; public: - /** @brief loads heigh map data if any loading options are set + /** @brief loads height map data if any loading options are set * * @param[in] oc The options container to get further options from * @exception ProcessError if something fails @@ -78,7 +72,7 @@ /// @brief returns the convex boundary of all known triangles const Boundary& getBoundary() { - return Singleton.myBoundary; + return myInstance.myBoundary; } /// @brief returns height for the given geo coordinate (WGS84) @@ -129,7 +123,7 @@ private: /// @brief the singleton instance - static NBHeightMapper Singleton; + static NBHeightMapper myInstance; Triangles myTriangles; @@ -198,9 +192,3 @@ newRect.m_max[1] = rtree_max(a_rectA->m_max[1], a_rectB->m_max[1]); return newRect; } - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBHelpers.cpp sumo-1.6.0+dfsg1/src/netbuild/NBHelpers.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBHelpers.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBHelpers.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Some mathematical helper methods /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -136,4 +131,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBHelpers.h sumo-1.6.0+dfsg1/src/netbuild/NBHelpers.h --- sumo-1.5.0+dfsg1/src/netbuild/NBHelpers.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBHelpers.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Some mathematical helper methods /****************************************************************************/ -#ifndef NBHelpers_h -#define NBHelpers_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,9 +68,3 @@ */ static void interpretLaneID(const std::string& lane_id, std::string& edge_id, int& index); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBLinkPossibilityMatrix.h sumo-1.6.0+dfsg1/src/netbuild/NBLinkPossibilityMatrix.h --- sumo-1.5.0+dfsg1/src/netbuild/NBLinkPossibilityMatrix.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBLinkPossibilityMatrix.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A matric to describe whether two links are foes to each other /****************************************************************************/ -#ifndef NBLinkPossibilityMatrix_h -#define NBLinkPossibilityMatrix_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -41,8 +35,3 @@ * is simply made by a vector of bitsets */ typedef std::vector > NBLinkPossibilityMatrix; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.cpp sumo-1.6.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -58,19 +54,19 @@ } -NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(NBTrafficLightDefinition* def, NBTrafficLightLogic* logic) : +NBLoadedSUMOTLDef::NBLoadedSUMOTLDef(const NBTrafficLightDefinition& def, const NBTrafficLightLogic& logic) : // allow for adding a new program for the same def: take the offset and programID from the new logic - NBTrafficLightDefinition(def->getID(), logic->getProgramID(), logic->getOffset(), def->getType()), + NBTrafficLightDefinition(def.getID(), logic.getProgramID(), logic.getOffset(), def.getType()), myTLLogic(new NBTrafficLightLogic(logic)), - myOriginalNodes(def->getNodes().begin(), def->getNodes().end()), + myOriginalNodes(def.getNodes().begin(), def.getNodes().end()), myReconstructAddedConnections(false), myReconstructRemovedConnections(false), myPhasesLoaded(false) { - assert(def->getType() == logic->getType()); - myControlledLinks = def->getControlledLinks(); - myControlledNodes = def->getNodes(); - NBLoadedSUMOTLDef* sumoDef = dynamic_cast(def); - updateParameters(def->getParametersMap()); + assert(def.getType() == logic.getType()); + myControlledLinks = def.getControlledLinks(); + myControlledNodes = def.getNodes(); + const NBLoadedSUMOTLDef* sumoDef = dynamic_cast(&def); + updateParameters(def.getParametersMap()); if (sumoDef != nullptr) { myReconstructAddedConnections = sumoDef->myReconstructAddedConnections; myReconstructRemovedConnections = sumoDef->myReconstructRemovedConnections; @@ -416,8 +412,9 @@ if (forbidden || rightTurnConflict) { myNeedsContRelation.insert(StreamPair(c1.getFrom(), c1.getTo(), c2.getFrom(), c2.getTo())); } - if (isFoes) { + if (isFoes && state[i1] == 's') { myRightOnRedConflicts.insert(std::make_pair(i1, i2)); + //std::cout << getID() << " prog=" << getProgramID() << " phase=" << (it - phases.begin()) << " rightOnRedConflict i1=" << i1 << " i2=" << i2 << "\n"; } //std::cout << getID() << " i1=" << i1 << " i2=" << i2 << " rightTurnConflict=" << rightTurnConflict << " forbidden=" << forbidden << " isFoes=" << isFoes << "\n"; } @@ -536,12 +533,11 @@ } } // rebuild the logic - const std::vector phases = myTLLogic->getPhases(); NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(getID(), getProgramID(), 0, myOffset, myType); - for (std::vector::const_iterator it = phases.begin(); it != phases.end(); it++) { - std::string newState = it->state; + for (const NBTrafficLightLogic::PhaseDefinition& phase : myTLLogic->getPhases()) { + std::string newState = phase.state; newState.erase(newState.begin() + removed); - newLogic->addStep(it->duration, newState); + newLogic->addStep(phase.duration, newState); } delete myTLLogic; myTLLogic = newLogic; @@ -868,5 +864,6 @@ } } } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.h sumo-1.6.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.h --- sumo-1.5.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBLoadedSUMOTLDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ // A complete traffic light logic loaded from a sumo-net. (opted to reimplement // since NBLoadedTLDef is quite vissim specific) /****************************************************************************/ -#ifndef NBLoadedSUMOTLDef_h -#define NBLoadedSUMOTLDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -60,7 +54,7 @@ * @param[in] def The definition to copy * @param[in] logic The computed logic of the given def */ - NBLoadedSUMOTLDef(NBTrafficLightDefinition* def, NBTrafficLightLogic* logic); + NBLoadedSUMOTLDef(const NBTrafficLightDefinition& def, const NBTrafficLightLogic& logic); /// @brief Destructor @@ -260,9 +254,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBLoadedTLDef.cpp sumo-1.6.0+dfsg1/src/netbuild/NBLoadedTLDef.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBLoadedTLDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBLoadedTLDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // A loaded (complete) traffic light logic /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -669,5 +665,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBLoadedTLDef.h sumo-1.6.0+dfsg1/src/netbuild/NBLoadedTLDef.h --- sumo-1.5.0+dfsg1/src/netbuild/NBLoadedTLDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBLoadedTLDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A loaded (complete) traffic light logic /****************************************************************************/ -#ifndef NBLoadedTLDef_h -#define NBLoadedTLDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -390,9 +384,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNetBuilder.cpp sumo-1.6.0+dfsg1/src/netbuild/NBNetBuilder.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBNetBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNetBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Instance responsible for building networks /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -74,6 +69,7 @@ myEdgeCont.applyOptions(oc); // apply options to traffic light logics control myTLLCont.applyOptions(oc); + NBEdge::setDefaultConnectionLength(oc.getFloat("default.connection-length")); } @@ -111,7 +107,8 @@ // Processing pt stops and lines if (oc.exists("ptstop-output") && oc.isSet("ptstop-output")) { before = PROGRESS_BEGIN_TIME_MESSAGE("Processing public transport stops"); - if (!(oc.exists("ptline-output") && oc.isSet("ptline-output"))) { + if (!(oc.exists("ptline-output") && oc.isSet("ptline-output")) + && !oc.getBool("ptstop-output.no-bidi")) { myPTStopCont.localizePTStops(myEdgeCont); } myPTStopCont.assignLanes(myEdgeCont); @@ -137,7 +134,7 @@ } } - if (oc.exists("ptstop-output") && oc.isSet("ptstop-output")) { + if (oc.exists("ptstop-output") && oc.isSet("ptstop-output") && !oc.getBool("ptstop-output.no-bidi")) { before = PROGRESS_BEGIN_TIME_MESSAGE("Align pt stop id signs with corresponding edge id signs"); myPTStopCont.alignIdSigns(); PROGRESS_TIME_MESSAGE(before); @@ -155,6 +152,10 @@ NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false); NBRailwayTopologyAnalyzer::repairTopology(*this); } + 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); + } if (oc.exists("railway.topology.output") && oc.isSet("railway.topology.output")) { NBTurningDirectionsComputer::computeTurnDirections(myNodeCont, false); // recompute after new edges were added NBRailwayTopologyAnalyzer::analyzeTopology(*this); @@ -301,6 +302,7 @@ } } // guess bike lanes + int addedLanes = 0; if (mayAddOrRemove && ((oc.getBool("bikelanes.guess") || oc.getBool("bikelanes.guess.from-permissions")))) { const int bikelanes = myEdgeCont.guessSpecialLanes(SVC_BICYCLE, oc.getFloat("default.bikelane-width"), oc.getFloat("bikelanes.guess.min-speed"), @@ -308,6 +310,7 @@ oc.getBool("bikelanes.guess.from-permissions"), "bikelanes.guess.exclude"); WRITE_MESSAGE("Guessed " + toString(bikelanes) + " bike lanes."); + addedLanes += bikelanes; } // guess sidewalks @@ -318,6 +321,11 @@ oc.getBool("sidewalks.guess.from-permissions"), "sidewalks.guess.exclude"); WRITE_MESSAGE("Guessed " + toString(sidewalks) + " sidewalks."); + addedLanes += sidewalks; + } + // re-adapt stop lanes after adding special lanes + if (oc.exists("ptstop-output") && oc.isSet("ptstop-output") && addedLanes > 0) { + myPTStopCont.assignLanes(myEdgeCont); } // check whether any not previously setable connections may be set now @@ -454,7 +462,7 @@ } else { myEdgeCont.appendTurnarounds(explicitTurnarounds, oc.getBool("no-turnarounds.tls")); } - if (oc.exists("railway.topology.repair") && oc.getBool("railway.topology.repair") + if (oc.exists("railway.topology.repair.stop-turn") && oc.getBool("railway.topology.repair.stop-turn") && myPTStopCont.getStops().size() > 0) { // allow direction reversal at all bidi-edges with stops myEdgeCont.appendRailwayTurnarounds(myPTStopCont); @@ -492,6 +500,9 @@ // before = PROGRESS_BEGIN_TIME_MESSAGE("Computing traffic light control information"); myTLLCont.setTLControllingInformation(myEdgeCont, myNodeCont); + if (oc.exists("opendrive-files") && oc.isSet("opendrive-files")) { + myTLLCont.setOpenDriveSignalParameters(); + } PROGRESS_TIME_MESSAGE(before); // before = PROGRESS_BEGIN_TIME_MESSAGE("Computing node logics"); @@ -672,8 +683,7 @@ if (from_srs != nullptr && from_srs->usingGeoProjection()) { from_srs->cartesian2geo(orig); } - double z = hm.getZ(orig); - from = Position(from.x(), from.y(), z); + from.setz(hm.getZ(orig)); } } return ok; diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNetBuilder.h sumo-1.6.0+dfsg1/src/netbuild/NBNetBuilder.h --- sumo-1.5.0+dfsg1/src/netbuild/NBNetBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNetBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Instance responsible for building networks /****************************************************************************/ -#ifndef NBNetBuilder_h -#define NBNetBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -283,9 +277,3 @@ /// @brief invalidated assignment operator NBNetBuilder& operator=(const NBNetBuilder& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNodeCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBNodeCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBNodeCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNodeCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // Container for nodes during the netbuilding process /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -509,7 +504,7 @@ << " clusterNode=" << n->getID() << " edge=" << e->getID() << " length=" << length << " with cluster " << joinNamedToString(c, ' ') << "\n"; } #endif - if (railAndPeds && n->getType() != NODETYPE_RAIL_CROSSING) { + if (railAndPeds && n->getType() != SumoXMLNodeType::RAIL_CROSSING) { bool railAndPeds2 = true; for (NBEdge* e : n->getEdges()) { if ((e->getPermissions() & ~(SVC_RAIL_CLASSES | SVC_PEDESTRIAN)) != 0) { @@ -517,13 +512,13 @@ break; } } - if (railAndPeds2 && s->getType() != NODETYPE_RAIL_CROSSING) { + if (railAndPeds2 && s->getType() != SumoXMLNodeType::RAIL_CROSSING) { // do not join rail/ped nodes unless at a rail crossing // (neither nodes nor the traffic lights) continue; } } - const bool bothCrossing = n->getType() == NODETYPE_RAIL_CROSSING && s->getType() == NODETYPE_RAIL_CROSSING; + const bool bothCrossing = n->getType() == SumoXMLNodeType::RAIL_CROSSING && s->getType() == SumoXMLNodeType::RAIL_CROSSING; const bool joinPedCrossings = bothCrossing && e->getPermissions() == SVC_PEDESTRIAN; if ( // never join pedestrian stuff (unless at a rail crossing !joinPedCrossings && ( @@ -535,11 +530,11 @@ continue; } // never join rail_crossings with other node types unless the crossing is only for tram - if ((n->getType() == NODETYPE_RAIL_CROSSING && s->getType() != NODETYPE_RAIL_CROSSING) - || (n->getType() != NODETYPE_RAIL_CROSSING && s->getType() == NODETYPE_RAIL_CROSSING)) { + if ((n->getType() == SumoXMLNodeType::RAIL_CROSSING && s->getType() != SumoXMLNodeType::RAIL_CROSSING) + || (n->getType() != SumoXMLNodeType::RAIL_CROSSING && s->getType() == SumoXMLNodeType::RAIL_CROSSING)) { const SVCPermissions railNoTram = (SVC_RAIL_CLASSES & ~SVC_TRAM); bool foundRail = false; - NBNode* crossingNode = n->getType() == NODETYPE_RAIL_CROSSING ? n : s; + NBNode* crossingNode = n->getType() == SumoXMLNodeType::RAIL_CROSSING ? n : s; for (NBEdge* e2 : crossingNode->getIncomingEdges()) { if ((e2->getPermissions() & railNoTram) != 0) { foundRail = true; @@ -924,7 +919,7 @@ } -NBNodeCont::NodeSet +NodeSet NBNodeCont::getClusterNeighbors(const NBNode* n, NodeSet& cluster) { NodeSet result; for (NBEdge* e : n->getEdges()) { @@ -1493,7 +1488,7 @@ bool setTL; std::string id = "cluster"; TrafficLightType type; - SumoXMLNodeType nodeType = NODETYPE_UNKNOWN; + SumoXMLNodeType nodeType = SumoXMLNodeType::UNKNOWN; analyzeCluster(cluster, id, pos, setTL, type, nodeType); NBNode* newNode = nullptr; if (predefined != nullptr) { @@ -1508,7 +1503,7 @@ } std::string tlID = id; if (predefined != nullptr) { - if (predefined->getType() != NODETYPE_UNKNOWN) { + if (predefined->getType() != SumoXMLNodeType::UNKNOWN) { nodeType = predefined->getType(); } Position ppos = predefined->getPosition(); @@ -1685,17 +1680,17 @@ hasTLS = true; } SumoXMLNodeType otherType = j->getType(); - if (nodeType == NODETYPE_UNKNOWN) { + if (nodeType == SumoXMLNodeType::UNKNOWN) { nodeType = otherType; } else if (nodeType != otherType) { if (hasTLS) { - nodeType = NODETYPE_TRAFFIC_LIGHT; + nodeType = SumoXMLNodeType::TRAFFIC_LIGHT; } else { - if ((nodeType != NODETYPE_PRIORITY && (nodeType != NODETYPE_NOJUNCTION || otherType != NODETYPE_PRIORITY)) - || (otherType != NODETYPE_NOJUNCTION && otherType != NODETYPE_UNKNOWN && otherType != NODETYPE_PRIORITY)) { - WRITE_WARNINGF("Ambiguous node type for node cluster '%' (%,%), setting to '" + toString(NODETYPE_PRIORITY) + "'.", id, toString(nodeType), toString(otherType)); + if ((nodeType != SumoXMLNodeType::PRIORITY && (nodeType != SumoXMLNodeType::NOJUNCTION || otherType != SumoXMLNodeType::PRIORITY)) + || (otherType != SumoXMLNodeType::NOJUNCTION && otherType != SumoXMLNodeType::UNKNOWN && otherType != SumoXMLNodeType::PRIORITY)) { + WRITE_WARNINGF("Ambiguous node type for node cluster '%' (%,%), setting to '" + toString(SumoXMLNodeType::PRIORITY) + "'.", id, toString(nodeType), toString(otherType)); } - nodeType = NODETYPE_PRIORITY; + nodeType = SumoXMLNodeType::PRIORITY; } } } @@ -1876,7 +1871,7 @@ const EdgeVector& outgoing = node->getOutgoingEdges(); if (!node->isTLControlled() && incoming.size() > 1 && !node->geometryLike() && !NBNodeTypeComputer::isRailwayNode(node) - && node->getType() != NODETYPE_RAIL_CROSSING) { + && node->getType() != SumoXMLNodeType::RAIL_CROSSING) { std::vector signals; bool isTLS = true; // check if there is a signal at every incoming edge @@ -1930,7 +1925,7 @@ if (isTLS) { for (const NBNode* s : signals) { std::set tls = s->getControllingTLS(); - const_cast(s)->reinit(s->getPosition(), NODETYPE_PRIORITY); + const_cast(s)->reinit(s->getPosition(), SumoXMLNodeType::PRIORITY); for (std::set::iterator k = tls.begin(); k != tls.end(); ++k) { tlc.removeFully(s->getID()); } @@ -2061,7 +2056,7 @@ bool dummySetTL; std::string id = "joined"; // prefix (see #3871) TrafficLightType type; - SumoXMLNodeType nodeType = NODETYPE_UNKNOWN; + SumoXMLNodeType nodeType = SumoXMLNodeType::UNKNOWN; analyzeCluster(c, id, dummyPos, dummySetTL, type, nodeType); for (NBNode* j : c) { std::set tls = j->getControllingTLS(); @@ -2192,40 +2187,40 @@ int numRailSignals = 0; for (NodeCont::const_iterator i = myNodes.begin(); i != myNodes.end(); i++) { switch ((*i).second->getType()) { - case NODETYPE_NOJUNCTION: + case SumoXMLNodeType::NOJUNCTION: ++numUnregulatedJunctions; break; - case NODETYPE_DEAD_END: + case SumoXMLNodeType::DEAD_END: ++numDeadEndJunctions; break; - case NODETYPE_TRAFFIC_LIGHT: - case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: - case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: + case SumoXMLNodeType::TRAFFIC_LIGHT: + case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: + case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: ++numTrafficLightJunctions; break; - case NODETYPE_PRIORITY: - case NODETYPE_PRIORITY_STOP: + case SumoXMLNodeType::PRIORITY: + case SumoXMLNodeType::PRIORITY_STOP: ++numPriorityJunctions; break; - case NODETYPE_RIGHT_BEFORE_LEFT: + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: ++numRightBeforeLeftJunctions; break; - case NODETYPE_ALLWAY_STOP: + case SumoXMLNodeType::ALLWAY_STOP: ++numAllWayStopJunctions; break; - case NODETYPE_ZIPPER: + case SumoXMLNodeType::ZIPPER: ++numZipperJunctions; break; - case NODETYPE_DISTRICT: + case SumoXMLNodeType::DISTRICT: ++numDistrictJunctions; break; - case NODETYPE_RAIL_CROSSING: + case SumoXMLNodeType::RAIL_CROSSING: ++numRailCrossing; break; - case NODETYPE_RAIL_SIGNAL: + case SumoXMLNodeType::RAIL_SIGNAL: ++numRailSignals; break; - case NODETYPE_UNKNOWN: + case SumoXMLNodeType::UNKNOWN: // should not happen break; default: @@ -2306,7 +2301,7 @@ node->removeTrafficLight(tlDef); tlc.extract(tlDef); } - SumoXMLNodeType newType = NBNodeTypeComputer::isRailwayNode(node) ? NODETYPE_RAIL_SIGNAL : NODETYPE_UNKNOWN; + SumoXMLNodeType newType = NBNodeTypeComputer::isRailwayNode(node) ? SumoXMLNodeType::RAIL_SIGNAL : SumoXMLNodeType::UNKNOWN; node->reinit(node->getPosition(), newType); } } @@ -2317,8 +2312,8 @@ NBNodeCont::discardRailSignals() { for (auto& item : myNodes) { NBNode* node = item.second; - if (node->getType() == NODETYPE_RAIL_SIGNAL) { - node->reinit(node->getPosition(), NODETYPE_PRIORITY); + if (node->getType() == SumoXMLNodeType::RAIL_SIGNAL) { + node->reinit(node->getPosition(), SumoXMLNodeType::PRIORITY); } } } @@ -2409,7 +2404,7 @@ if ((in <= 1 && out <= 1) && (in == 0 || out == 0 || n->getIncomingEdges().front()->isTurningDirectionAt(n->getOutgoingEdges().front()))) { - n->setFringeType(FRINGE_TYPE_OUTER); + n->setFringeType(FringeType::OUTER); numFringe++; } } @@ -2437,5 +2432,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNodeCont.h sumo-1.6.0+dfsg1/src/netbuild/NBNodeCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBNodeCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNodeCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Container for nodes during the netbuilding process /****************************************************************************/ -#ifndef NBNodeCont_h -#define NBNodeCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -36,6 +30,7 @@ #include #include #include +#include "NBCont.h" #include "NBEdgeCont.h" #include "NBNode.h" #include @@ -63,7 +58,6 @@ class NBNodeCont { public: /// @brief Definition of a node cluster container - typedef std::set NodeSet; typedef std::vector NodeClusters; typedef std::pair NodeAndDist; @@ -425,9 +419,3 @@ NBNodeCont& operator=(const NBNodeCont& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNode.cpp sumo-1.6.0+dfsg1/src/netbuild/NBNode.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBNode.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNode.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The representation of a single node /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -264,7 +259,7 @@ myRadius(UNSPECIFIED_RADIUS), myKeepClear(OptionsCont::getOptions().getBool("default.junctions.keep-clear")), myRightOfWay(SUMOXMLDefinitions::RightOfWayValues.get(OptionsCont::getOptions().getString("default.right-of-way"))), - myFringeType(FRINGE_TYPE_DEFAULT), + myFringeType(FringeType::DEFAULT), myDiscardAllCrossings(false), myCrossingsLoadedFromSumoNet(0), myDisplacementError(0), @@ -279,14 +274,14 @@ NBNode::NBNode(const std::string& id, const Position& position, NBDistrict* district) : Named(StringUtils::convertUmlaute(id)), myPosition(position), - myType(district == nullptr ? NODETYPE_UNKNOWN : NODETYPE_DISTRICT), + myType(district == nullptr ? SumoXMLNodeType::UNKNOWN : SumoXMLNodeType::DISTRICT), myDistrict(district), myHaveCustomPoly(false), myRequest(nullptr), myRadius(UNSPECIFIED_RADIUS), myKeepClear(OptionsCont::getOptions().getBool("default.junctions.keep-clear")), myRightOfWay(SUMOXMLDefinitions::RightOfWayValues.get(OptionsCont::getOptions().getString("default.right-of-way"))), - myFringeType(FRINGE_TYPE_DEFAULT), + myFringeType(FringeType::DEFAULT), myDiscardAllCrossings(false), myCrossingsLoadedFromSumoNet(0), myDisplacementError(0), @@ -365,8 +360,8 @@ NBNode::addTrafficLight(NBTrafficLightDefinition* tlDef) { myTrafficLights.insert(tlDef); // rail signals receive a temporary traffic light in order to set connection tl-linkIndex - if (!isTrafficLight(myType) && myType != NODETYPE_RAIL_SIGNAL && myType != NODETYPE_RAIL_CROSSING) { - myType = NODETYPE_TRAFFIC_LIGHT; + if (!isTrafficLight(myType) && myType != SumoXMLNodeType::RAIL_SIGNAL && myType != SumoXMLNodeType::RAIL_CROSSING) { + myType = SumoXMLNodeType::TRAFFIC_LIGHT; } } @@ -385,8 +380,8 @@ removeTrafficLight(*i); } if (setAsPriority) { - myType = myRequest != nullptr ? NODETYPE_PRIORITY : ( - myType == NODETYPE_TRAFFIC_LIGHT_NOJUNCTION ? NODETYPE_NOJUNCTION : NODETYPE_DEAD_END); + myType = myRequest != nullptr ? SumoXMLNodeType::PRIORITY : ( + myType == SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION ? SumoXMLNodeType::NOJUNCTION : SumoXMLNodeType::DEAD_END); } } @@ -758,7 +753,7 @@ double extrapolateBeg = 5. * fromE->getNumLanes(); double extrapolateEnd = 5. * con.toEdge->getNumLanes(); LinkDirection dir = getDirection(fromE, con.toEdge); - if (dir == LINKDIR_LEFT || dir == LINKDIR_TURN) { + if (dir == LinkDirection::LEFT || dir == LinkDirection::TURN) { shapeFlag += AVOID_WIDE_LEFT_TURN; } #ifdef DEBUG_SMOOTH_GEOM @@ -828,7 +823,7 @@ // (on the left side for left turns) // XXX indirect left turns should also start on the right side LinkDirection dir = getDirection(from, con.toEdge); - if (dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT || dir == LINKDIR_TURN) { + if (dir == LinkDirection::LEFT || dir == LinkDirection::PARTLEFT || dir == LinkDirection::TURN) { fromShape.move2side(-shift); } else { fromShape.move2side(shift); @@ -847,11 +842,11 @@ const NBEdge* toE = c.toEdge; const NBEdge* otherToE = otherC.toEdge; - if (myType == NODETYPE_RIGHT_BEFORE_LEFT || myType == NODETYPE_ALLWAY_STOP) { + if (myType == SumoXMLNodeType::RIGHT_BEFORE_LEFT || myType == SumoXMLNodeType::ALLWAY_STOP) { return false; } LinkDirection d1 = getDirection(fromE, toE); - const bool thisRight = (d1 == LINKDIR_RIGHT || d1 == LINKDIR_PARTRIGHT); + const bool thisRight = (d1 == LinkDirection::RIGHT || d1 == LinkDirection::PARTRIGHT); const bool rightTurnConflict = (thisRight && NBNode::rightTurnConflict(fromE, toE, c.fromLane, otherFromE, otherToE, otherC.fromLane)); if (thisRight && !rightTurnConflict) { @@ -862,21 +857,21 @@ return false; } LinkDirection d2 = getDirection(otherFromE, otherToE); - if (d2 == LINKDIR_TURN) { + if (d2 == LinkDirection::TURN) { return false; } - const bool thisLeft = (d1 == LINKDIR_LEFT || d1 == LINKDIR_TURN); - const bool otherLeft = (d2 == LINKDIR_LEFT || d2 == LINKDIR_TURN); + const bool thisLeft = (d1 == LinkDirection::LEFT || d1 == LinkDirection::TURN); + const bool otherLeft = (d2 == LinkDirection::LEFT || d2 == LinkDirection::TURN); const bool bothLeft = thisLeft && otherLeft; if (fromE == otherFromE && !thisRight) { // ignore same edge links except for right-turns return false; } - if (thisRight && d2 != LINKDIR_STRAIGHT) { + if (thisRight && d2 != LinkDirection::STRAIGHT) { return false; } if (c.tlID != "" && !bothLeft) { - assert(myTrafficLights.size() > 0 || myType == NODETYPE_RAIL_CROSSING || myType == NODETYPE_RAIL_SIGNAL); + assert(myTrafficLights.size() > 0 || myType == SumoXMLNodeType::RAIL_CROSSING || myType == SumoXMLNodeType::RAIL_SIGNAL); for (std::set::const_iterator it = myTrafficLights.begin(); it != myTrafficLights.end(); ++it) { if ((*it)->needsCont(fromE, toE, otherFromE, otherToE)) { return true; @@ -921,12 +916,12 @@ myRequest = nullptr; if (myIncomingEdges.size() == 0 || myOutgoingEdges.size() == 0) { // no logic if nothing happens here - myType = NODETYPE_DEAD_END; + myType = SumoXMLNodeType::DEAD_END; removeJoinedTrafficLights(); return; } // compute the logic if necessary or split the junction - if (myType != NODETYPE_NOJUNCTION && myType != NODETYPE_DISTRICT && myType != NODETYPE_TRAFFIC_LIGHT_NOJUNCTION) { + if (myType != SumoXMLNodeType::NOJUNCTION && myType != SumoXMLNodeType::DISTRICT && myType != SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION) { // build the request myRequest = new NBRequest(ec, this, myAllEdges, myIncomingEdges, myOutgoingEdges, myBlockedConnections); // check whether it is not too large @@ -935,17 +930,17 @@ // yep -> make it untcontrolled, warn delete myRequest; myRequest = nullptr; - if (myType == NODETYPE_TRAFFIC_LIGHT) { - myType = NODETYPE_TRAFFIC_LIGHT_NOJUNCTION; + if (myType == SumoXMLNodeType::TRAFFIC_LIGHT) { + myType = SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION; } else { - myType = NODETYPE_NOJUNCTION; + myType = SumoXMLNodeType::NOJUNCTION; } WRITE_WARNINGF("Junction '%' is too complicated (% connections, max %); will be set to %.", getID(), numConnections, SUMO_MAX_CONNECTIONS, toString(myType)); } else if (numConnections == 0) { delete myRequest; myRequest = nullptr; - myType = NODETYPE_DEAD_END; + myType = SumoXMLNodeType::DEAD_END; removeJoinedTrafficLights(); } else { myRequest->buildBitfieldLogic(); @@ -993,7 +988,6 @@ bool NBNode::hasConflict() const { - assert(myRequest != nullptr); if (myRequest == nullptr) { return false; } else { @@ -1167,7 +1161,7 @@ } // special case d): // one in, one out, the outgoing has one lane less and node has type 'zipper' - if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 1 && myType == NODETYPE_ZIPPER) { + if (myIncomingEdges.size() == 1 && myOutgoingEdges.size() == 1 && myType == SumoXMLNodeType::ZIPPER) { NBEdge* in = myIncomingEdges[0]; NBEdge* out = myOutgoingEdges[0]; // check if it's not the turnaround @@ -1303,8 +1297,8 @@ // assume that left-turns and turn-arounds are better satisfied from lanes to the left LinkDirection dir = getDirection(incoming, currentOutgoing); if (incoming->getStep() <= NBEdge::EdgeBuildingStep::LANES2LANES_DONE - && ((bikeLaneTarget >= 0 && dir != LINKDIR_TURN) - || dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT || dir == LINKDIR_STRAIGHT)) { + && ((bikeLaneTarget >= 0 && dir != LinkDirection::TURN) + || dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT || dir == LinkDirection::STRAIGHT)) { bool builtConnection = false; for (int i = 0; i < (int)incoming->getNumLanes(); i++) { if (incoming->getPermissions(i) == SVC_BICYCLE @@ -1333,7 +1327,7 @@ int start = 0; int end = (int)incoming->getNumLanes(); int inc = 1; - if (dir == LINKDIR_TURN || dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT) { + if (dir == LinkDirection::TURN || dir == LinkDirection::LEFT || dir == LinkDirection::PARTLEFT) { std::swap(start, end); inc = -1; } @@ -1349,11 +1343,11 @@ } // special case e): rail_crossing // there should only be straight connections here - if (myType == NODETYPE_RAIL_CROSSING) { + if (myType == SumoXMLNodeType::RAIL_CROSSING) { for (EdgeVector::const_iterator i = myIncomingEdges.begin(); i != myIncomingEdges.end(); i++) { const std::vector cons = (*i)->getConnections(); for (std::vector::const_iterator k = cons.begin(); k != cons.end(); ++k) { - if (getDirection(*i, (*k).toEdge) == LINKDIR_TURN) { + if (getDirection(*i, (*k).toEdge) == LinkDirection::TURN) { (*i)->removeFromConnections((*k).toEdge); } } @@ -1415,9 +1409,9 @@ const int outOffset = MAX2(0, succ->getFirstNonPedestrianLaneIndex(FORWARD, true)); const int usableLanes = succ->getNumLanes() - outOffset; LinkDirection dir = to->getDirection(out, succ); - if (dir == LINKDIR_STRAIGHT) { + if (dir == LinkDirection::STRAIGHT) { outLanesStraight += usableLanes; - } else if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) { + } else if (dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT) { outLanesRight += usableLanes; } else { outLanesLeft += usableLanes; @@ -1804,7 +1798,7 @@ } const LinkDirection d1 = from->getToNode()->getDirection(from, to); // must be a right turn to qualify as rightTurnConflict - if (d1 == LINKDIR_STRAIGHT) { + if (d1 == LinkDirection::STRAIGHT) { // no conflict for straight going connections // XXX actually this should check the main direction (which could also // be a turn) @@ -1817,10 +1811,10 @@ << " d1=" << toString(d1) << " d2=" << toString(d2) << "\n"; */ bool flip = false; - if (d1 == LINKDIR_LEFT || d1 == LINKDIR_PARTLEFT) { + if (d1 == LinkDirection::LEFT || d1 == LinkDirection::PARTLEFT) { // check for leftTurnConflicht flip = !flip; - if (d2 == LINKDIR_RIGHT || d1 == LINKDIR_PARTRIGHT) { + if (d2 == LinkDirection::RIGHT || d1 == LinkDirection::PARTRIGHT) { // assume that the left-turning bicycle goes straight at first // and thus gets precedence over a right turning vehicle return false; @@ -2030,14 +2024,14 @@ NBNode::getDirection(const NBEdge* const incoming, const NBEdge* const outgoing, bool leftHand) const { // ok, no connection at all -> dead end if (outgoing == nullptr) { - return LINKDIR_NODIR; + return LinkDirection::NODIR; } if (incoming->getJunctionPriority(this) == NBEdge::ROUNDABOUT && outgoing->getJunctionPriority(this) == NBEdge::ROUNDABOUT) { - return LINKDIR_STRAIGHT; + return LinkDirection::STRAIGHT; } // turning direction if (incoming->isTurningDirectionAt(outgoing)) { - return leftHand ? LINKDIR_TURN_LEFTHAND : LINKDIR_TURN; + return leftHand ? LinkDirection::TURN_LEFTHAND : LinkDirection::TURN; } // get the angle between incoming/outgoing at the junction const double angle = NBHelpers::normRelAngle(incoming->getAngleAtNode(this), outgoing->getAngleAtNode(this)); @@ -2055,9 +2049,9 @@ if (fabs(angle2) < fabs(angle)) { if (fabs(angle2 - angle) > 5) { if (angle2 > angle) { - return LINKDIR_PARTLEFT; + return LinkDirection::PARTLEFT; } else { - return LINKDIR_PARTRIGHT; + return LinkDirection::PARTRIGHT; } } } @@ -2068,37 +2062,37 @@ if (fabs(angle2) < fabs(angle)) { if (fabs(angle2 - angle) > 5) { if (angle2 > angle) { - return LINKDIR_PARTLEFT; + return LinkDirection::PARTLEFT; } else { - return LINKDIR_PARTRIGHT; + return LinkDirection::PARTRIGHT; } } } } - return LINKDIR_STRAIGHT; + return LinkDirection::STRAIGHT; } if (angle > 0) { // check whether any other edge goes further to the right if (angle > 90) { - return LINKDIR_RIGHT; + return LinkDirection::RIGHT; } NBEdge* outCW = getNextCompatibleOutgoing(incoming, vehPerm, itOut, !leftHand); if (outCW != nullptr) { - return LINKDIR_PARTRIGHT; + return LinkDirection::PARTRIGHT; } else { - return LINKDIR_RIGHT; + return LinkDirection::RIGHT; } } else { // check whether any other edge goes further to the left if (angle < -90) { - return LINKDIR_LEFT; + return LinkDirection::LEFT; } NBEdge* outCCW = getNextCompatibleOutgoing(incoming, vehPerm, itOut, leftHand); if (outCCW != nullptr) { - return LINKDIR_PARTLEFT; + return LinkDirection::PARTLEFT; } else { - return LINKDIR_LEFT; + return LinkDirection::LEFT; } } } @@ -2107,7 +2101,7 @@ LinkState NBNode::getLinkState(const NBEdge* incoming, NBEdge* outgoing, int fromlane, int toLane, bool mayDefinitelyPass, const std::string& tlID) const { - if (myType == NODETYPE_RAIL_CROSSING && isRailway(incoming->getPermissions())) { + if (myType == SumoXMLNodeType::RAIL_CROSSING && isRailway(incoming->getPermissions())) { return LINKSTATE_MAJOR; // the trains must run on time } if (tlID != "") { @@ -2116,22 +2110,22 @@ if (outgoing == nullptr) { // always off return LINKSTATE_TL_OFF_NOSIGNAL; } - if (myType == NODETYPE_RIGHT_BEFORE_LEFT) { + if (myType == SumoXMLNodeType::RIGHT_BEFORE_LEFT) { return LINKSTATE_EQUAL; // all the same } - if (myType == NODETYPE_ALLWAY_STOP) { + if (myType == SumoXMLNodeType::ALLWAY_STOP) { return LINKSTATE_ALLWAY_STOP; // all drive, first one to arrive may drive first } - if (myType == NODETYPE_ZIPPER && mustBrake(incoming, outgoing, fromlane, toLane, false)) { + if (myType == SumoXMLNodeType::ZIPPER && mustBrake(incoming, outgoing, fromlane, toLane, false)) { return LINKSTATE_ZIPPER; } if (!mayDefinitelyPass && mustBrake(incoming, outgoing, fromlane, toLane, true) // legacy mode - && (!incoming->isInsideTLS() || getDirection(incoming, outgoing) != LINKDIR_STRAIGHT) + && (!incoming->isInsideTLS() || getDirection(incoming, outgoing) != LinkDirection::STRAIGHT) // avoid linkstate minor at pure railway nodes - && (incoming->getPriority() != outgoing->getPriority() || !NBNodeTypeComputer::isRailwayNode(this))) { - return myType == NODETYPE_PRIORITY_STOP ? LINKSTATE_STOP : LINKSTATE_MINOR; // minor road + && !NBNodeTypeComputer::isRailwayNode(this)) { + return myType == SumoXMLNodeType::PRIORITY_STOP ? LINKSTATE_STOP : LINKSTATE_MINOR; // minor road } // traffic lights are not regarded here return LINKSTATE_MAJOR; @@ -2150,7 +2144,7 @@ reason = "TLS"; return false; } - if (myType == NODETYPE_RAIL_SIGNAL) { + if (myType == SumoXMLNodeType::RAIL_SIGNAL) { reason = "rail_signal"; return false; } @@ -2281,7 +2275,7 @@ bool NBNode::isDistrict() const { - return myType == NODETYPE_DISTRICT; + return myType == SumoXMLNodeType::DISTRICT; } @@ -2381,7 +2375,7 @@ std::sort(myCrossings.begin(), myCrossings.end(), NBNodesEdgesSorter::crossing_by_junction_angle_sorter(this, myAllEdges)); if (gDebugFlag1) { std::cout << "guessedCrossings:\n"; - for (auto crossing : myCrossings) { + for (auto& crossing : myCrossings) { std::cout << " edges=" << toString(crossing->edges) << "\n"; } } @@ -2412,7 +2406,7 @@ } return 0; } - if (!isTLControlled() && myType != NODETYPE_RAIL_CROSSING && edge->getSpeed() > OptionsCont::getOptions().getFloat("crossings.guess.speed-threshold")) { + if (!isTLControlled() && myType != SumoXMLNodeType::RAIL_CROSSING && edge->getSpeed() > OptionsCont::getOptions().getFloat("crossings.guess.speed-threshold")) { if (gDebugFlag1) { std::cout << "no crossing added (uncontrolled, edge with speed > " << edge->getSpeed() << ")\n"; } @@ -2420,7 +2414,7 @@ } prevAngle = angle; } - if (candidates.size() == 1 || getType() == NODETYPE_RAIL_CROSSING) { + if (candidates.size() == 1 || getType() == SumoXMLNodeType::RAIL_CROSSING) { addCrossing(candidates, NBEdge::UNSPECIFIED_WIDTH, isTLControlled()); if (gDebugFlag1) { std::cout << "adding crossing: " << toString(candidates) << "\n"; @@ -2485,7 +2479,7 @@ // sort edge vector std::sort(edges.begin(), edges.end()); // iterate over crossing to find a crossing with the same edges - for (auto crossing : myCrossings) { + for (auto& crossing : myCrossings) { // sort edges of crossing before compare EdgeVector edgesOfCrossing = crossing->edges; std::sort(edgesOfCrossing.begin(), edgesOfCrossing.end()); @@ -2513,7 +2507,7 @@ buildCrossings(); buildWalkingAreas(OptionsCont::getOptions().getInt("junctions.corner-detail")); // ensure that all crossings are properly connected - for (auto crossing : myCrossings) { + for (auto& crossing : myCrossings) { if (crossing->prevWalkingArea == "" || crossing->nextWalkingArea == "" || !crossing->valid) { if (crossing->valid) { WRITE_WARNINGF("Discarding invalid crossing '%' at junction '%' with edges [%] (no walkingarea found).", @@ -2535,9 +2529,9 @@ std::vector NBNode::getCrossings() const { std::vector result; - for (Crossing* const c : myCrossings) { + for (auto& c : myCrossings) { if (c->valid) { - result.push_back(c); + result.push_back(c.get()); } } //if (myCrossings.size() > 0) { @@ -2552,9 +2546,6 @@ void NBNode::discardAllCrossings(bool rejectAll) { - for (auto c : myCrossings) { - delete c; - } myCrossings.clear(); // also discard all further crossings if (rejectAll) { @@ -2605,7 +2596,7 @@ } int index = 0; const double defaultWidth = OptionsCont::getOptions().getFloat("default.crossing-width"); - for (auto c : myCrossings) { + for (auto& c : myCrossings) { c->valid = true; if (!isTLControlled()) { c->tlID = ""; // reset for Netedit, set via setCrossingTLIndices() @@ -3156,8 +3147,8 @@ void NBNode::setRoundabout() { - if (myType == NODETYPE_RIGHT_BEFORE_LEFT) { - myType = NODETYPE_PRIORITY; + if (myType == SumoXMLNodeType::RIGHT_BEFORE_LEFT) { + myType = SumoXMLNodeType::PRIORITY; } } @@ -3166,7 +3157,7 @@ NBNode::addCrossing(EdgeVector edges, double width, bool priority, int tlIndex, int tlIndex2, const PositionVector& customShape, bool fromSumoNet) { Crossing* c = new Crossing(this, edges, width, priority, tlIndex, tlIndex2, customShape); - myCrossings.push_back(c); + myCrossings.push_back(std::unique_ptr(c)); if (fromSumoNet) { myCrossingsLoadedFromSumoNet += 1; } @@ -3177,10 +3168,9 @@ void NBNode::removeCrossing(const EdgeVector& edges) { EdgeSet edgeSet(edges.begin(), edges.end()); - for (std::vector::iterator it = myCrossings.begin(); it != myCrossings.end();) { + for (auto it = myCrossings.begin(); it != myCrossings.end();) { EdgeSet edgeSet2((*it)->edges.begin(), (*it)->edges.end()); if (edgeSet == edgeSet2) { - delete *it; it = myCrossings.erase(it); } else { ++it; @@ -3191,9 +3181,9 @@ NBNode::Crossing* NBNode::getCrossing(const std::string& id) const { - for (auto c : myCrossings) { + for (auto& c : myCrossings) { if (c->id == id) { - return c; + return c.get(); } } throw ProcessError("Request for unknown crossing '" + id + "'"); @@ -3203,10 +3193,10 @@ NBNode::Crossing* NBNode::getCrossing(const EdgeVector& edges, bool hardFail) const { EdgeSet edgeSet(edges.begin(), edges.end()); - for (auto it : myCrossings) { + for (auto& it : myCrossings) { EdgeSet edgeSet2(it->edges.begin(), it->edges.end()); if (edgeSet == edgeSet2) { - return it; + return it.get(); } } if (!hardFail) { @@ -3330,7 +3320,7 @@ void NBNode::avoidOverlap() { - // simple case: edges with LANESPREAD_CENTER and a (possible) turndirection at the same node + // simple case: edges with LaneSpreadFunction::CENTER and a (possible) turndirection at the same node for (EdgeVector::iterator it = myIncomingEdges.begin(); it != myIncomingEdges.end(); it++) { NBEdge* edge = *it; NBEdge* turnDest = edge->getTurnDestination(true); @@ -3345,19 +3335,17 @@ bool NBNode::isTrafficLight(SumoXMLNodeType type) { - return type == NODETYPE_TRAFFIC_LIGHT - || type == NODETYPE_TRAFFIC_LIGHT_NOJUNCTION - || type == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED; + return type == SumoXMLNodeType::TRAFFIC_LIGHT + || type == SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION + || type == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED; } bool NBNode::rightOnRedConflict(int index, int foeIndex) const { - if (myType == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED) { - for (std::set::const_iterator i = myTrafficLights.begin(); i != myTrafficLights.end(); ++i) { - if ((*i)->rightOnRedConflict(index, foeIndex)) { - return true; - } + for (NBTrafficLightDefinition* def : myTrafficLights) { + if (def->rightOnRedConflict(index, foeIndex)) { + return true; } } return false; diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNode.h sumo-1.6.0+dfsg1/src/netbuild/NBNode.h --- sumo-1.5.0+dfsg1/src/netbuild/NBNode.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNode.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The representation of a single node /****************************************************************************/ -#ifndef NBNode_h -#define NBNode_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -34,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -296,6 +291,11 @@ FringeType getFringeType() const { return myFringeType; } + + /// @brief Returns intersection name + const std::string& getName() const { + return myName; + } /// @} /// @name Methods for dealing with assigned traffic lights @@ -534,6 +534,11 @@ myFringeType = fringeType; } + /// @brief set intersection name + void setName(const std::string& name) { + myName = name; + } + /// @brief return whether the shape was set by the user bool hasCustomShape() const { return myHaveCustomPoly; @@ -678,7 +683,7 @@ /// @brief return this junctions pedestrian crossings std::vector getCrossings() const; - inline const std::vector& getCrossingsIncludingInvalid() const { + inline const std::vector >& getCrossingsIncludingInvalid() const { return myCrossings; } @@ -837,7 +842,7 @@ EdgeVector myAllEdges; /// @brief Vector of crossings - std::vector myCrossings; + std::vector > myCrossings; /// @brief Vector of walking areas std::vector myWalkingAreas; @@ -878,6 +883,9 @@ /// @brief fringe type of this node FringeType myFringeType; + /// @brief The intersection name (or whatever arbitrary string you wish to attach) + std::string myName; + /// @brief whether to discard all pedestrian crossings bool myDiscardAllCrossings; @@ -895,7 +903,6 @@ /// @brief whether the node type was guessed rather than loaded bool myTypeWasGuessed; - private: /// @brief invalidated copy constructor NBNode(const NBNode& s); @@ -903,9 +910,3 @@ /// @brief invalidated assignment operator NBNode& operator=(const NBNode& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNodeShapeComputer.cpp sumo-1.6.0+dfsg1/src/netbuild/NBNodeShapeComputer.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBNodeShapeComputer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNodeShapeComputer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // This class computes shapes of junctions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -685,10 +680,10 @@ PositionVector geom1 = e1->getGeometry(); PositionVector geom2 = e2->getGeometry(); // shift to make geom the centerline of the edge regardless of spreadtype - if (e1->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + if (e1->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT) { geom1.move2side(e1->getTotalWidth() / 2); } - if (e2->getLaneSpreadFunction() == LANESPREAD_RIGHT) { + if (e2->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT) { geom2.move2side(e2->getTotalWidth() / 2); } // always let geometry start at myNode @@ -906,7 +901,7 @@ } for (NBEdge* out : myNode.getOutgoingEdges()) { if ((in->getPermissions() & out->getPermissions() & large) != 0) { - if (myNode.getDirection(in, out) == LINKDIR_TURN) { + if (myNode.getDirection(in, out) == LinkDirection::TURN) { continue; }; const double angle = GeomHelper::angleDiff( @@ -988,4 +983,6 @@ } return result; } + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBNodeShapeComputer.h sumo-1.6.0+dfsg1/src/netbuild/NBNodeShapeComputer.h --- sumo-1.5.0+dfsg1/src/netbuild/NBNodeShapeComputer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBNodeShapeComputer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // This class computes shapes of junctions /****************************************************************************/ -#ifndef NBNodeShapeComputer_h -#define NBNodeShapeComputer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -163,8 +157,3 @@ NBNodeShapeComputer& operator=(const NBNodeShapeComputer& s); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBOwnTLDef.cpp sumo-1.6.0+dfsg1/src/netbuild/NBOwnTLDef.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBOwnTLDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBOwnTLDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -89,12 +84,12 @@ double NBOwnTLDef::getDirectionalWeight(LinkDirection dir) { switch (dir) { - case LINKDIR_STRAIGHT: - case LINKDIR_PARTLEFT: - case LINKDIR_PARTRIGHT: + case LinkDirection::STRAIGHT: + case LinkDirection::PARTLEFT: + case LinkDirection::PARTRIGHT: return HEIGH_WEIGHT; - case LINKDIR_LEFT: - case LINKDIR_RIGHT: + case LinkDirection::LEFT: + case LinkDirection::RIGHT: return LOW_WEIGHT; default: break; @@ -245,8 +240,8 @@ myRightOnRedConflicts.clear(); const SUMOTime brakingTime = TIME2STEPS(brakingTimeSeconds); const SUMOTime leftTurnTime = TIME2STEPS(OptionsCont::getOptions().getInt("tls.left-green.time")); - const SUMOTime minMinDur = myType == TLTYPE_STATIC ? UNSPECIFIED_DURATION : TIME2STEPS(OptionsCont::getOptions().getInt("tls.min-dur")); - const SUMOTime maxDur = myType == TLTYPE_STATIC ? UNSPECIFIED_DURATION : TIME2STEPS(OptionsCont::getOptions().getInt("tls.max-dur")); + const SUMOTime minMinDur = myType == TrafficLightType::STATIC ? UNSPECIFIED_DURATION : TIME2STEPS(OptionsCont::getOptions().getInt("tls.min-dur")); + const SUMOTime maxDur = myType == TrafficLightType::STATIC ? UNSPECIFIED_DURATION : TIME2STEPS(OptionsCont::getOptions().getInt("tls.max-dur")); // build complete lists first const EdgeVector& incoming = getIncomingEdges(); @@ -277,13 +272,13 @@ isTurnaround.push_back(true); } LinkDirection dir = fromEdge->getToNode()->getDirection(fromEdge, approached.toEdge); - if (dir == LINKDIR_STRAIGHT) { + if (dir == LinkDirection::STRAIGHT) { hasStraight = true; - } else if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) { + } else if (dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT) { hasRight = true; - } else if (dir == LINKDIR_LEFT || dir == LINKDIR_PARTLEFT) { + } else if (dir == LinkDirection::LEFT || dir == LinkDirection::PARTLEFT) { hasLeft = true; - } else if (dir == LINKDIR_TURN) { + } else if (dir == LinkDirection::TURN) { hasTurnaround = true; } noLinksAll++; @@ -423,7 +418,7 @@ std::cout << " state after grouping by vClass " << state << "\n"; } #endif - if (groupOpposites || chosen.first->getToNode()->getType() == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED) { + if (groupOpposites || chosen.first->getToNode()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) { state = allowUnrelated(state, fromEdges, toEdges, isTurnaround, crossings); } #ifdef DEBUG_PHASES @@ -696,7 +691,7 @@ const NBEdge* edge = *it; const LinkDirection i2dir = cross.node->getDirection(fromEdges[i2], toEdges[i2]); if (state[i2] != 'r' && state[i2] != 's' && (edge == fromEdges[i2] || - (edge == toEdges[i2] && (i2dir == LINKDIR_STRAIGHT || i2dir == LINKDIR_PARTLEFT || i2dir == LINKDIR_PARTRIGHT)))) { + (edge == toEdges[i2] && (i2dir == LinkDirection::STRAIGHT || i2dir == LinkDirection::PARTLEFT || i2dir == LinkDirection::PARTRIGHT)))) { isForbidden = true; break; } @@ -764,7 +759,7 @@ if (myControlledNodes.size() > 0) { // we use a dummy node just to maintain const-correctness myNeedsContRelation.clear(); - NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TLTYPE_STATIC); + NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TrafficLightType::STATIC); dummy.setParticipantsInformation(); NBTrafficLightLogic* tllDummy = dummy.computeLogicAndConts(0, true); delete tllDummy; @@ -964,8 +959,8 @@ } } if (state[i1] == 'r') { - if (fromEdges[i1]->getToNode()->getType() == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED && - fromEdges[i1]->getToNode()->getDirection(fromEdges[i1], toEdges[i1]) == LINKDIR_RIGHT) { + if (fromEdges[i1]->getToNode()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED && + fromEdges[i1]->getToNode()->getDirection(fromEdges[i1], toEdges[i1]) == LinkDirection::RIGHT) { state[i1] = 's'; // do not allow right-on-red when in conflict with exclusive left-turn phase for (int i2 = 0; i2 < (int)fromEdges.size(); ++i2) { @@ -973,7 +968,7 @@ (forbids(fromEdges[i2], toEdges[i2], fromEdges[i1], toEdges[i1], true) || forbids(fromEdges[i1], toEdges[i1], fromEdges[i2], toEdges[i2], true))) { const LinkDirection foeDir = fromEdges[i2]->getToNode()->getDirection(fromEdges[i2], toEdges[i2]); - if (foeDir == LINKDIR_LEFT || foeDir == LINKDIR_PARTLEFT) { + if (foeDir == LinkDirection::LEFT || foeDir == LinkDirection::PARTLEFT) { state[i1] = 'r'; break; } @@ -1095,7 +1090,7 @@ return true; } assert(myControlledNodes.size() >= 2); - NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TLTYPE_STATIC); + NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TrafficLightType::STATIC); dummy.setParticipantsInformation(); NBTrafficLightLogic* tllDummy = dummy.computeLogicAndConts(0, true); int greenPhases = 0; @@ -1111,4 +1106,5 @@ return greenPhases <= 2; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBOwnTLDef.h sumo-1.6.0+dfsg1/src/netbuild/NBOwnTLDef.h --- sumo-1.5.0+dfsg1/src/netbuild/NBOwnTLDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBOwnTLDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A traffic light logics which must be computed (only nodes/edges are given) /****************************************************************************/ -#ifndef NBOwnTLDef_h -#define NBOwnTLDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -285,9 +279,3 @@ bool myHaveSinglePhase; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBParking.cpp sumo-1.6.0+dfsg1/src/netbuild/NBParking.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBParking.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBParking.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The representation of an imported parking area /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBParking.h sumo-1.6.0+dfsg1/src/netbuild/NBParking.h --- sumo-1.5.0+dfsg1/src/netbuild/NBParking.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBParking.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // The representation of an imported parking area /****************************************************************************/ -#ifndef SUMO_NBParking_H -#define SUMO_NBParking_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,4 +69,3 @@ void addEdges2Keep(const OptionsCont& oc, std::set& into); }; -#endif //SUMO_NBParking_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTLineCont.h sumo-1.6.0+dfsg1/src/netbuild/NBPTLineCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBPTLineCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTLineCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // Container for NBPTLine during netbuild /****************************************************************************/ -#ifndef SUMO_NBPTLINECONT_H -#define SUMO_NBPTLINECONT_H +#pragma once #include @@ -78,4 +77,3 @@ }; -#endif //SUMO_NBPTLINECONT_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTLine.h sumo-1.6.0+dfsg1/src/netbuild/NBPTLine.h --- sumo-1.5.0+dfsg1/src/netbuild/NBPTLine.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTLine.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ /// // The representation of one direction of a single pt line /****************************************************************************/ -#ifndef SUMO_NBPTLINE_H -#define SUMO_NBPTLINE_H +#pragma once #include @@ -81,6 +80,10 @@ /// @brief replace the given stop void replaceStop(NBPTStop* oldStop, NBPTStop* newStop); + void setName(const std::string& name) { + myName = name; + } + private: std::string myName; std::string myType; @@ -97,7 +100,10 @@ std::string myCurrentWay; std::string myPTLineId; std::string myRef; + + // @brief the service interval in minutes int myInterval; + std::string myNightService; SUMOVehicleClass myVClass; @@ -114,4 +120,3 @@ }; -#endif //SUMO_NBPTLINE_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTPlatform.h sumo-1.6.0+dfsg1/src/netbuild/NBPTPlatform.h --- sumo-1.5.0+dfsg1/src/netbuild/NBPTPlatform.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTPlatform.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // The representation of a pt platform /****************************************************************************/ -#ifndef SUMO_NBPTPLATFORM_H -#define SUMO_NBPTPLATFORM_H +#pragma once #include @@ -36,4 +35,3 @@ }; -#endif //SUMO_NBPTPLATFORM_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTStopCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBPTStopCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBPTStopCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTStopCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -424,4 +424,5 @@ return nullptr; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTStopCont.h sumo-1.6.0+dfsg1/src/netbuild/NBPTStopCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBPTStopCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTStopCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // Container for pt stops during the netbuilding process /****************************************************************************/ -#ifndef SUMO_NBPTSTOPCONT_H -#define SUMO_NBPTSTOPCONT_H +#pragma once #include #include @@ -113,4 +112,3 @@ void alignIdSigns(); }; -#endif //SUMO_NBPTSTOPCONT_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTStop.cpp sumo-1.6.0+dfsg1/src/netbuild/NBPTStop.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBPTStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The representation of a single pt stop /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -35,13 +30,14 @@ // method definitions // =========================================================================== NBPTStop::NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, - std::string name, SVCPermissions svcPermissions) : + std::string name, SVCPermissions svcPermissions, double parkingLength) : myPTStopId(ptStopId), myPosition(position), myEdgeId(edgeId), myOrigEdgeId(origEdgeId), myPTStopLength(length), myName(name), + myParkingLength(parkingLength), myPermissions(svcPermissions), myBidiStop(nullptr), myIsLoose(origEdgeId == ""), @@ -107,6 +103,9 @@ if (myLines.size() > 0) { device.writeAttr(SUMO_ATTR_LINES, toString(myLines)); } + if (myParkingLength > 0) { + device.writeAttr(SUMO_ATTR_PARKING_LENGTH, myParkingLength); + } if (!myAccesses.empty()) { std::sort(myAccesses.begin(), myAccesses.end()); for (auto tuple : myAccesses) { diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBPTStop.h sumo-1.6.0+dfsg1/src/netbuild/NBPTStop.h --- sumo-1.5.0+dfsg1/src/netbuild/NBPTStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBPTStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // The representation of a single pt stop /****************************************************************************/ -#ifndef SUMO_NBPTSTOP_H -#define SUMO_NBPTSTOP_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -54,7 +49,8 @@ * @param[in] edgeId The edge id of the pt stop * @param[in] length The length of the pt stop */ - NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name, SVCPermissions svcPermissions); + NBPTStop(std::string ptStopId, Position position, std::string edgeId, std::string origEdgeId, double length, std::string name, + SVCPermissions svcPermissions, double parkingLength = 0); std::string getID() const; const std::string getEdgeId() const; @@ -115,6 +111,7 @@ void setMyPTStopLength(double myPTStopLength); private: const std::string myName; + const double myParkingLength; std::string myLaneId; const SVCPermissions myPermissions; @@ -141,4 +138,3 @@ bool myIsMultipleStopPositions; }; -#endif //SUMO_NBPTSTOP_H diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBRequest.cpp sumo-1.6.0+dfsg1/src/netbuild/NBRequest.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBRequest.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBRequest.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // This class computes the logic of a junction /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -220,7 +215,7 @@ myDone[idx1][idx2] = true; myDone[idx2][idx1] = true; // special case all-way stop - if (myJunction->getType() == NODETYPE_ALLWAY_STOP) { + if (myJunction->getType() == SumoXMLNodeType::ALLWAY_STOP) { // all ways forbid each other. Conflict resolution happens via arrival time myForbids[idx1][idx2] = true; myForbids[idx2][idx1] = true; @@ -260,7 +255,7 @@ << " 2:" << from2->getID() << "->" << to2->getID() << "\n"; #endif // check the priorities if required by node type - if (myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT) { + if (myJunction->getType() != SumoXMLNodeType::RIGHT_BEFORE_LEFT) { int from1p = from1->getJunctionPriority(myJunction); int from2p = from2->getJunctionPriority(myJunction); #ifdef DEBUG_SETBLOCKING @@ -282,7 +277,7 @@ } // straight connections prohibit turning connections if the priorities are equal // (unless the junction is a bent priority junction) - if (myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT && !myJunction->isBentPriority()) { + if (myJunction->getType() != SumoXMLNodeType::RIGHT_BEFORE_LEFT && !myJunction->isBentPriority()) { LinkDirection ld1 = myJunction->getDirection(from1, to1); LinkDirection ld2 = myJunction->getDirection(from2, to2); #ifdef DEBUG_SETBLOCKING @@ -291,14 +286,14 @@ << " 2:" << from2->getID() << "->" << to2->getID() << " dir1=" << toString(ld1) << " dir2=" << toString(ld2) << "\n"; #endif - if (ld1 == LINKDIR_STRAIGHT) { - if (ld2 != LINKDIR_STRAIGHT) { + if (ld1 == LinkDirection::STRAIGHT) { + if (ld2 != LinkDirection::STRAIGHT) { myForbids[idx1][idx2] = true; myForbids[idx2][idx1] = false; return; } } else { - if (ld2 == LINKDIR_STRAIGHT) { + if (ld2 == LinkDirection::STRAIGHT) { myForbids[idx1][idx2] = false; myForbids[idx2][idx1] = true; return; @@ -312,7 +307,7 @@ // should be valid for priority junctions only /* if (from1p > 0 && from2p > 0) { - assert(myJunction->getType() != NODETYPE_RIGHT_BEFORE_LEFT); + assert(myJunction->getType() != SumoXMLNodeType::RIGHT_BEFORE_LEFT); int to1p = to1->getJunctionPriority(myJunction); int to2p = to2->getJunctionPriority(myJunction); if (to1p > to2p) { @@ -423,7 +418,7 @@ for (i = myIncoming.begin(); i != myIncoming.end(); i++) { int noLanes = (*i)->getNumLanes(); for (int k = 0; k < noLanes; k++) { - pos = computeLaneResponse(*i, k, pos, checkLaneFoes || myJunction->getType() == NODETYPE_ZIPPER); + pos = computeLaneResponse(*i, k, pos, checkLaneFoes || myJunction->getType() == SumoXMLNodeType::ZIPPER); } } // crossings @@ -568,7 +563,7 @@ assert(c.toEdge != 0); pos++; const std::string foes = getFoesString(from, c.toEdge, fromLane, c.toLane, checkLaneFoes); - const std::string response = myJunction->getType() == NODETYPE_ZIPPER ? foes : getResponseString(from, c, checkLaneFoes); + const std::string response = myJunction->getType() == SumoXMLNodeType::ZIPPER ? foes : getResponseString(from, c, checkLaneFoes); myFoes.push_back(foes); myResponse.push_back(response); myHaveVia.push_back(c.haveVia); @@ -779,7 +774,7 @@ // for right turns the rightmost lane gets priority // otherwise the left lane LinkDirection dir = myJunction->getDirection(from, con.toEdge); - if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) { + if (dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT) { return con.fromLane > prohibitorCon.fromLane; } else { return con.fromLane < prohibitorCon.fromLane; @@ -797,11 +792,11 @@ const NBEdge* prohibitorFrom, const NBEdge::Connection& prohibitorCon, bool foes) const { LinkDirection dir = myJunction->getDirection(from, con.toEdge); // XXX lefthand issue (solve via #4256) - if (dir != LINKDIR_LEFT && dir != LINKDIR_PARTLEFT) { + if (dir != LinkDirection::LEFT && dir != LinkDirection::PARTLEFT) { return false; } dir = myJunction->getDirection(prohibitorFrom, prohibitorCon.toEdge); - if (dir != LINKDIR_LEFT && dir != LINKDIR_PARTLEFT) { + if (dir != LinkDirection::LEFT && dir != LinkDirection::PARTLEFT) { return false; } if (from == prohibitorFrom || NBRequest::foes(from, con.toEdge, prohibitorFrom, prohibitorCon.toEdge)) { @@ -964,7 +959,7 @@ // bicycles NBEdge::Connection queryCon = from->getConnection(fromLane, to, toLane); LinkDirection dir = myJunction->getDirection(from, to); - if (dir == LINKDIR_RIGHT || dir == LINKDIR_PARTRIGHT) { + if (dir == LinkDirection::RIGHT || dir == LinkDirection::PARTRIGHT) { for (const NBEdge::Connection& con : from->getConnections()) { if (rightTurnConflict(from, queryCon, from, con)) { return true; @@ -979,14 +974,14 @@ const int size = (int) connected.size(); for (int k = size; k-- > 0;) { if ((*i) == from && fromLane != j - && mergeConflict(from, queryCon, *i, connected[k], myJunction->getType() == NODETYPE_ZIPPER)) { + && mergeConflict(from, queryCon, *i, connected[k], myJunction->getType() == SumoXMLNodeType::ZIPPER)) { return true; } } } } // maybe we need to brake due to a zipper conflict - if (myJunction->getType() == NODETYPE_ZIPPER) { + if (myJunction->getType() == SumoXMLNodeType::ZIPPER) { for (int idx1 = 0; idx1 < numLinks(); idx1++) { //assert(myDone[idx1][idx2]); if (myDone[idx1][idx2] && myForbids[idx2][idx1]) { @@ -1001,7 +996,7 @@ bool NBRequest::mustBrakeForCrossing(const NBNode* node, const NBEdge* const from, const NBEdge* const to, const NBNode::Crossing& crossing) { const LinkDirection dir = node->getDirection(from, to); - const bool mustYield = dir == LINKDIR_LEFT || dir == LINKDIR_RIGHT; + const bool mustYield = dir == LinkDirection::LEFT || dir == LinkDirection::RIGHT; if (crossing.priority || mustYield) { for (EdgeVector::const_iterator it_e = crossing.edges.begin(); it_e != crossing.edges.end(); ++it_e) { // left and right turns must yield to unprioritized crossings only on their destination edge @@ -1081,5 +1076,5 @@ return (int)(myIncoming.size() * myOutgoing.size() + myJunction->getCrossings().size()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBRequest.h sumo-1.6.0+dfsg1/src/netbuild/NBRequest.h --- sumo-1.5.0+dfsg1/src/netbuild/NBRequest.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBRequest.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // This class computes the logic of a junction /****************************************************************************/ -#ifndef NBRequest_h -#define NBRequest_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -283,8 +277,3 @@ /// @brief Invalidated assignment operator NBRequest& operator=(const NBRequest& s) = delete; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBSign.cpp sumo-1.6.0+dfsg1/src/netbuild/NBSign.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBSign.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBSign.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class representing a street sign /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -118,4 +113,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBSign.h sumo-1.6.0+dfsg1/src/netbuild/NBSign.h --- sumo-1.5.0+dfsg1/src/netbuild/NBSign.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBSign.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A class representing a street sign /****************************************************************************/ -#ifndef NBSign_h -#define NBSign_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -91,9 +85,3 @@ static StringBijection SignTypeStrings; static StringBijection SignTypeColors; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightDefinition.cpp sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightDefinition.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightDefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightDefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The base class for traffic light logic definitions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -320,7 +315,7 @@ if (incnode != outnode2) { continue; } - if (incnode->getDirection(possProhibitedTo, *i) != LINKDIR_STRAIGHT) { + if (incnode->getDirection(possProhibitedTo, *i) != LinkDirection::STRAIGHT) { continue; } bool ret1 = incnode->foes(possProhibitorFrom, possProhibitorTo, @@ -352,7 +347,7 @@ if (incnode2 != outnode) { continue; } - if (incnode2->getDirection(possProhibitorTo, *i) != LINKDIR_STRAIGHT) { + if (incnode2->getDirection(possProhibitorTo, *i) != LinkDirection::STRAIGHT) { continue; } bool ret1 = incnode2->foes(possProhibitorTo, *i, @@ -467,13 +462,13 @@ if (el.toEdge != nullptr && el.toLane >= (int) el.toEdge->getNumLanes()) { throw ProcessError("Connection '" + incoming->getID() + "_" + toString(j) + "->" + el.toEdge->getID() + "_" + toString(el.toLane) + "' yields in a not existing lane."); } - if (incoming->getToNode()->getType() == NODETYPE_RAIL_CROSSING + if (incoming->getToNode()->getType() == SumoXMLNodeType::RAIL_CROSSING && isRailway(incoming->getPermissions())) { // railways stay uncontrolled at rail crossing but they // must be registered in MSRailCrossing into.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, -1)); - } else if (incoming->getToNode()->getType() == NODETYPE_RAIL_SIGNAL - && incoming->getToNode()->getDirection(incoming, el.toEdge) == LINKDIR_TURN) { + } else if (incoming->getToNode()->getType() == SumoXMLNodeType::RAIL_SIGNAL + && incoming->getToNode()->getDirection(incoming, el.toEdge) == LinkDirection::TURN) { // turnarounds stay uncontrolled at rail signal } else { into.push_back(NBConnection(incoming, el.fromLane, el.toEdge, el.toLane, tlIndex++)); @@ -502,7 +497,7 @@ void NBTrafficLightDefinition::initNeedsContRelation() const { if (!amInvalid()) { - NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TLTYPE_STATIC); + NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TrafficLightType::STATIC); dummy.initNeedsContRelation(); myNeedsContRelation = dummy.myNeedsContRelation; for (std::vector::const_iterator i = myControlledNodes.begin(); i != myControlledNodes.end(); i++) { @@ -516,7 +511,7 @@ bool NBTrafficLightDefinition::rightOnRedConflict(int index, int foeIndex) const { if (!myRightOnRedConflictsReady) { - NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TLTYPE_STATIC); + NBOwnTLDef dummy(DummyID, myControlledNodes, 0, TrafficLightType::STATIC); dummy.setParticipantsInformation(); NBTrafficLightLogic* tllDummy = dummy.computeLogicAndConts(0, true); delete tllDummy; @@ -538,5 +533,5 @@ return getID() + ':' + getProgramID() + '@' + toString(this); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightDefinition.h sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightDefinition.h --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightDefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightDefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The base class for traffic light logic definitions /****************************************************************************/ -#ifndef NBTrafficLightDefinition_h -#define NBTrafficLightDefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -474,9 +468,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A container for traffic light definitions and built programs /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -157,7 +152,7 @@ if (lDef == nullptr) { NBTrafficLightLogic* logic = def->compute(oc); if (logic != nullptr) { - lDef = new NBLoadedSUMOTLDef(def, logic); + lDef = new NBLoadedSUMOTLDef(*def, *logic); lDef->setParticipantsInformation(); for (NBNode* node : lDef->getNodes()) { node->removeTrafficLight(def); @@ -316,8 +311,8 @@ // handle rail signals which are not instantiated as normal definitions for (std::map::const_iterator it = nc.begin(); it != nc.end(); it ++) { NBNode* n = it->second; - if (n->getType() == NODETYPE_RAIL_SIGNAL || n->getType() == NODETYPE_RAIL_CROSSING) { - NBOwnTLDef dummy(n->getID(), n, 0, TLTYPE_STATIC); + if (n->getType() == SumoXMLNodeType::RAIL_SIGNAL || n->getType() == SumoXMLNodeType::RAIL_CROSSING) { + NBOwnTLDef dummy(n->getID(), n, 0, TrafficLightType::STATIC); dummy.setParticipantsInformation(); dummy.setTLControllingInformation(); n->setCrossingTLIndices(dummy.getID(), (int)dummy.getControlledLinks().size()); @@ -327,6 +322,30 @@ } +void +NBTrafficLightLogicCont::setOpenDriveSignalParameters() { + Definitions definitions = getDefinitions(); + for (NBTrafficLightDefinition* def : getDefinitions()) { + std::map defaultSignalIDs; + for (const NBConnection& con : def->getControlledLinks()) { + const NBEdge::Connection& c = con.getFrom()->getConnection(con.getFromLane(), con.getTo(), con.getToLane()); + if (c.knowsParameter("signalID")) { + defaultSignalIDs[con.getFrom()] = c.getParameter("signalID"); + def->setParameter("linkSignalID:" + toString(con.getTLIndex()), c.getParameter("signalID")); + } + } + // oftentimes, signals are placed on connecting road but are meant to apply to all connections from the incoming edge + for (const NBConnection& con : def->getControlledLinks()) { + const NBEdge::Connection& c = con.getFrom()->getConnection(con.getFromLane(), con.getTo(), con.getToLane()); + if (!c.knowsParameter("signalID") && defaultSignalIDs.count(con.getFrom()) != 0) { + WRITE_WARNINGF("Guessing signalID for link index % at traffic light '%'.", con.getTLIndex(), def->getID()); + def->setParameter("linkSignalID:" + toString(con.getTLIndex()), defaultSignalIDs[con.getFrom()]); + } + } + } +} + + NBTrafficLightLogicCont::Logics NBTrafficLightLogicCont::getComputed() const { Logics result; @@ -354,4 +373,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.h sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogicCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A container for traffic light definitions and built programs /****************************************************************************/ -#ifndef NBTrafficLightLogicCont_h -#define NBTrafficLightLogicCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -210,6 +204,9 @@ */ void setTLControllingInformation(const NBEdgeCont& ec, const NBNodeCont& nc); + /// @brief set OpenDRIVE signal reference parameters after all link indices are known + void setOpenDriveSignalParameters(); + /// @brief Returns a list of all definitions (convenience for easier iteration) typedef std::vector Definitions; Definitions getDefinitions() const; @@ -247,9 +244,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogic.cpp sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogic.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogic.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogic.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -180,7 +175,7 @@ } // check if actuated lights are defined correctly if (checkVarDurations) { - if (myType != TLTYPE_STATIC) { + if (myType != TrafficLightType::STATIC) { bool found = false; for (auto p : myPhases) { if (p.minDur != NBTrafficLightDefinition::UNSPECIFIED_DURATION @@ -236,5 +231,5 @@ myPhases[phaseIndex].name = name; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogic.h sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogic.h --- sumo-1.5.0+dfsg1/src/netbuild/NBTrafficLightLogic.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTrafficLightLogic.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A SUMO-compliant built logic for a traffic light /****************************************************************************/ -#ifndef NBTrafficLightLogic_h -#define NBTrafficLightLogic_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -113,7 +107,7 @@ * @param[in] type The algorithm type for the computed traffic light */ NBTrafficLightLogic(const std::string& id, const std::string& subid, int noLinks, - SUMOTime offset = 0, TrafficLightType type = TLTYPE_STATIC); + SUMOTime offset = 0, TrafficLightType type = TrafficLightType::STATIC); /** @brief Copy Constructor @@ -270,9 +264,3 @@ NBTrafficLightLogic& operator=(const NBTrafficLightLogic& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTypeCont.cpp sumo-1.6.0+dfsg1/src/netbuild/NBTypeCont.cpp --- sumo-1.5.0+dfsg1/src/netbuild/NBTypeCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTypeCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A storage for the available types of an edge /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -254,5 +249,5 @@ return (*i).second; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBTypeCont.h sumo-1.6.0+dfsg1/src/netbuild/NBTypeCont.h --- sumo-1.5.0+dfsg1/src/netbuild/NBTypeCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBTypeCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // A storage for available types of edges /****************************************************************************/ -#ifndef NBTypeCont_h -#define NBTypeCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -356,9 +350,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netbuild/NBVehicle.h sumo-1.6.0+dfsg1/src/netbuild/NBVehicle.h --- sumo-1.5.0+dfsg1/src/netbuild/NBVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netbuild/NBVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,17 +19,12 @@ /// // A vehicle as used by router /****************************************************************************/ -#ifndef NBVehicle_h -#define NBVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include +#include // =========================================================================== @@ -53,7 +48,7 @@ * @param[in] type The type of the vehicle */ NBVehicle(const std::string& id, SUMOVehicleClass vClass): - myID(id), myVClass(vClass) {} + myID(id), myVClass(vClass), myLength(getDefaultVehicleLength(vClass)) {} const std::string& getID() const { return myID; @@ -63,6 +58,9 @@ return myVClass; } + double getLength() const { + return myLength; + } /// @brief Destructor virtual ~NBVehicle() {} @@ -72,9 +70,12 @@ /// @brief vehicle ID for error reporting std::string myID; - /// @brief The vehicle class of the + /// @brief The vehicle class of the vehicle SUMOVehicleClass myVClass; + /// @brief The length of the vehicle (for rail-routing) + double myLength; + private: /// @brief Invalidated copy constructor @@ -84,8 +85,3 @@ NBVehicle& operator=(const NBVehicle& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netconvert_main.cpp sumo-1.6.0+dfsg1/src/netconvert_main.cpp --- sumo-1.5.0+dfsg1/src/netconvert_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netconvert_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Main for NETCONVERT /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -131,9 +126,8 @@ // load data NILoader nl(nb); nl.load(oc); - if (oc.getBool("ignore-errors")) { - MsgHandler::getErrorInstance()->clear(); - } + // flush aggregated errors and optionally ignore them + MsgHandler::getErrorInstance()->clear(oc.getBool("ignore-errors")); // check whether any errors occurred if (MsgHandler::getErrorInstance()->wasInformed()) { throw ProcessError(); @@ -145,6 +139,7 @@ } NWFrame::writeNetwork(oc, nb); } catch (const ProcessError& e) { + MsgHandler::getErrorInstance()->clear(false); if (std::string(e.what()) != std::string("Process Error") && std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } @@ -152,12 +147,14 @@ ret = 1; #ifndef _DEBUG } catch (const std::exception& e) { + MsgHandler::getErrorInstance()->clear(false); if (std::string(e.what()) != std::string("")) { WRITE_ERROR(e.what()); } MsgHandler::getErrorInstance()->inform("Quitting (on error).", false); ret = 1; } catch (...) { + MsgHandler::getErrorInstance()->clear(false); MsgHandler::getErrorInstance()->inform("Quitting (on unknown error).", false); ret = 1; #endif @@ -172,6 +169,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/additionals/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/additionals/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,71 +0,0 @@ -set(netedit_additionals_SRCS - GNEPOI.h - GNEPOI.cpp - GNEPoly.h - GNEPoly.cpp - GNEAdditionalHandler.h - GNEAdditionalHandler.cpp - GNEAdditional.h - GNEAdditional.cpp - GNEShape.h - GNEShape.cpp - GNEChargingStation.h - GNEChargingStation.cpp - GNEStoppingPlace.h - GNEStoppingPlace.cpp - GNEBusStop.h - GNEBusStop.cpp - GNEAccess.h - GNEAccess.cpp - GNEContainerStop.h - GNEContainerStop.cpp - GNEParkingArea.h - GNEParkingArea.cpp - GNEParkingSpace.h - GNEParkingSpace.cpp - GNETAZ.h - GNETAZ.cpp - GNETAZSourceSink.h - GNETAZSourceSink.cpp - GNEDetector.h - GNEDetector.cpp - GNEDetectorE1.h - GNEDetectorE1.cpp - GNEDetectorE1Instant.h - GNEDetectorE1Instant.cpp - GNEDetectorE2.h - GNEDetectorE2.cpp - GNEDetectorE3.h - GNEDetectorE3.cpp - GNEDetectorEntryExit.h - GNEDetectorEntryExit.cpp - GNERerouter.h - GNERerouter.cpp - GNERouteProbe.h - GNERouteProbe.cpp - GNEVaporizer.h - GNEVaporizer.cpp - GNECalibrator.h - GNECalibrator.cpp - GNECalibratorFlow.h - GNECalibratorFlow.cpp - GNEVariableSpeedSign.h - GNEVariableSpeedSign.cpp - GNEVariableSpeedSignStep.h - GNEVariableSpeedSignStep.cpp - GNEClosingLaneReroute.h - GNEClosingLaneReroute.cpp - GNEParkingAreaReroute.h - GNEParkingAreaReroute.cpp - GNEClosingReroute.h - GNEClosingReroute.cpp - GNEDestProbReroute.h - GNEDestProbReroute.cpp - GNERouteProbReroute.h - GNERouteProbReroute.cpp - GNERerouterInterval.h - GNERerouterInterval.cpp - ) - -add_library(netedit_additionals STATIC ${netedit_additionals_SRCS}) -set_property(TARGET netedit_additionals PROPERTY PROJECT_LABEL "z_netedit_additionals") diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAccess.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAccess.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAccess.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAccess.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,362 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAccess.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2018 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEAccess.h" -#include "GNEAdditionalHandler.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEAccess::GNEAccess(GNEAdditional* busStop, GNELane* lane, GNEViewNet* viewNet, double pos, const std::string& length, bool friendlyPos, bool blockMovement) : - GNEAdditional(busStop, viewNet, GLO_ACCESS, SUMO_TAG_ACCESS, "", blockMovement, {}, {lane}, {}, {busStop}, {}, {}, {}, {}, {}, {}), - myPositionOverLane(pos), - myLength(length), -myFriendlyPosition(friendlyPos) { -} - - -GNEAccess::~GNEAccess() { -} - - -void -GNEAccess::moveGeometry(const Position& offset) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); - // Update geometry - updateGeometry(); -} - - -void -GNEAccess::commitGeometryMoving(GNEUndoList* undoList) { - if (!myBlockMovement) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_end(); - } -} - - -void -GNEAccess::updateGeometry() { - // set start position - double fixedPositionOverLane; - if (myPositionOverLane == -1) { - fixedPositionOverLane = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } else if (myPositionOverLane < 0) { - fixedPositionOverLane = 0; - } else if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - fixedPositionOverLane = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } else { - fixedPositionOverLane = myPositionOverLane; - } - // update geometry - myAdditionalGeometry.updateGeometry(getParentLanes().front(), fixedPositionOverLane * getParentLanes().front()->getLengthGeometryFactor()); - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - // Set offset of the block icon - myBlockIcon.offset = Position(-1, 0); - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(getParentLanes().front()); - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEAccess::updateDottedContour() { - // -} - - -Position -GNEAccess::getPositionInView() const { - if (myPositionOverLane == -1) { - return getParentLanes().front()->getLaneShape().front(); - } else { - if (myPositionOverLane < 0) { - return getParentLanes().front()->getLaneShape().front(); - } else if (myPositionOverLane > getParentLanes().front()->getLaneShape().length()) { - return getParentLanes().front()->getLaneShape().back(); - } else { - return getParentLanes().front()->getLaneShape().positionAtOffset(myPositionOverLane); - } - } -} - - -Boundary -GNEAccess::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNEAccess::splitEdgeGeometry(const double splitPosition, const GNENetElement* /*originalElement*/, const GNENetElement* newElement, GNEUndoList* undoList) { - if (splitPosition < myPositionOverLane) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust start position - setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); - } -} - - -bool -GNEAccess::isAccessPositionFixed() const { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - if (myPositionOverLane != -1) { - return (myPositionOverLane >= 0) && (myPositionOverLane <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - } else { - return false; - } - } -} - - -GNEEdge* -GNEAccess::getEdge() const { - return getParentLanes().front()->getParentEdge(); -} - - -std::string -GNEAccess::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEAccess::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(exaggeration)) { - // Start drawing adding an gl identificator - glPushName(getGlID()); - // push matrix - glPushMatrix(); - // set color depending of selection - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); - } - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), GLO_ACCESS); - // draw circle - if (s.drawForRectangleSelection) { - GLHelper::drawFilledCircle((double) 0.5 * exaggeration, 8); - } else { - GLHelper::drawFilledCircle((double) 0.5 * exaggeration, 16); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - /* - GLHelper::drawShapeDottedContourAroundClosedShape(s, getType(), vertices); - */ - } - } - // pop matrix - glPopMatrix(); - // pop gl identficador - glPopName(); - } -} - - -std::string -GNEAccess::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_LENGTH: - return toString(myLength); - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEAccess::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEAccess::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_FRIENDLY_POS: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEAccess::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: { - GNELane* lane = myViewNet->getNet()->retrieveLane(value, false); - if (lane != nullptr) { - if (getParentLanes().front()->getParentEdge()->getID() != lane->getParentEdge()->getID()) { - return GNEAdditionalHandler::accessCanBeCreated(getParentAdditionals().at(0), lane->getParentEdge()); - } else { - return true; - } - } else { - return false; - } - } - case SUMO_ATTR_POSITION: - if (value.empty()) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_LENGTH: - if (value.empty()) { - return true; - } else { - return (canParse(value) && (parse(value) >= 0)); - } - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEAccess::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEAccess::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEAccess::getHierarchyName() const { - return getTagStr() + ": " + getParentLanes().front()->getParentEdge()->getID(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEAccess::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_LENGTH: - myLength = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAccess.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAccess.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAccess.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAccess.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAccess.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2018 -/// -// -/****************************************************************************/ -#ifndef GNEAccess_h -#define GNEAccess_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEBusStop; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEAccess - * class for busStop acces - */ -class GNEAccess : public GNEAdditional { - -public: - /**@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 - * @param[in] lane GNELane of this Access belongs - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position of the Access on the lane - * @param[in] length The length of the Access in meters. - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEAccess(GNEAdditional* busStop, GNELane* lane, GNEViewNet* viewNet, double pos, const std::string& length, bool friendlyPos, bool blockMovement); - - /// @brief Destructor - ~GNEAccess(); - - /// @brief check if Position of Access is fixed - bool isAccessPositionFixed() const; - - /// @brief get edge in which this Access is placed - GNEEdge* getEdge() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const ; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name (ID) of the parent object - std::string getParentName() const; - - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief position over lane - double myPositionOverLane; - - /// @brief Acces length - std::string myLength; - - /// @brief flag to check if friendly position is enabled - bool myFriendlyPosition; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEAccess(const GNEAccess&) = delete; - - /// @brief Invalidated assignment operator. - GNEAccess& operator=(const GNEAccess&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditional.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditional.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditional.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditional.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,597 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditional.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// A abstract class for representation of additional elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEAdditional.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEAdditional::GNEAdditional(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - GUIGlObject(type, id), - GNEAttributeCarrier(tag), - Parameterised(), - GNEHierarchicalParentElements(this, parentEdges, parentLanes, parentShapes, parentAdditionals, parentDemandElements), - GNEHierarchicalChildElements(this, childEdges, childLanes, childShapes, childAdditionals, childDemandElements), - myViewNet(viewNet), - myAdditionalName(additionalName), - myBlockMovement(blockMovement), - myBlockIcon(this), - mySpecialColor(nullptr) { -} - - -GNEAdditional::GNEAdditional(GNEAdditional* additionalParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - GUIGlObject(type, additionalParent->generateChildID(tag)), - GNEAttributeCarrier(tag), - Parameterised(), - GNEHierarchicalParentElements(this, parentEdges, parentLanes, parentShapes, parentAdditionals, parentDemandElements), - GNEHierarchicalChildElements(this, childEdges, childLanes, childShapes, childAdditionals, childDemandElements), - myViewNet(viewNet), - myAdditionalName(additionalName), - myBlockMovement(blockMovement), - myBlockIcon(this), - mySpecialColor(nullptr) { -} - - -GNEAdditional::~GNEAdditional() {} - - -std::string -GNEAdditional::generateChildID(SumoXMLTag childTag) { - int counter = (int)getChildAdditionals().size(); - while (myViewNet->getNet()->retrieveAdditional(childTag, getID() + toString(childTag) + toString(counter), false) != nullptr) { - counter++; - } - return (getID() + toString(childTag) + toString(counter)); -} - - -const GNEGeometry::Geometry& -GNEAdditional::getAdditionalGeometry() const { - return myAdditionalGeometry; -} - - -const GNEGeometry::SegmentGeometry& -GNEAdditional::getAdditionalSegmentGeometry() const { - return mySegmentGeometry; -} - - -void -GNEAdditional::setSpecialColor(const RGBColor* color) { - mySpecialColor = color; -} - - -void -GNEAdditional::writeAdditional(OutputDevice& device) const { - // first check if minimum number of children is correct - if ((myTagProperty.hasMinimumNumberOfChildren() || myTagProperty.hasMinimumNumberOfChildren()) && !checkChildAdditionalRestriction()) { - WRITE_WARNING(getTagStr() + " with ID='" + getID() + "' cannot be written"); - } else { - // Open Tag or synonym Tag - if (myTagProperty.hasTagSynonym()) { - device.openTag(myTagProperty.getTagSynonym()); - } else { - device.openTag(myTagProperty.getTag()); - } - // iterate over attributes and write it - for (auto i : myTagProperty) { - // obtain attribute - std::string attributeValue = getAttribute(i.getAttr()); - // first check if attribute is optional but not vehicle classes - if (i.isOptional() && !i.isVClasses()) { - // Only write attributes with default value if is different from original - if (i.getDefaultValue() != attributeValue) { - // check if attribute must be written using a synonim - if (i.hasAttrSynonym()) { - device.writeAttr(i.getAttrSynonym(), attributeValue); - } else { - // SVC permissions uses their own writting function - if (i.isSVCPermission()) { - // disallow attribute musn't be written - if (i.getAttr() != SUMO_ATTR_DISALLOW) { - writePermissions(device, parseVehicleClasses(attributeValue)); - } - } else if (myTagProperty.canMaskXYZPositions() && (i.getAttr() == SUMO_ATTR_POSITION)) { - // get position attribute and write it separate - Position pos = parse(getAttribute(SUMO_ATTR_POSITION)); - device.writeAttr(SUMO_ATTR_X, toString(pos.x())); - device.writeAttr(SUMO_ATTR_Y, toString(pos.y())); - // write 0 only if is different from 0 (the default value) - if (pos.z() != 0) { - device.writeAttr(SUMO_ATTR_Z, toString(pos.z())); - } - } else { - device.writeAttr(i.getAttr(), attributeValue); - } - } - } - } else { - // Attributes without default values are always writted - if (i.hasAttrSynonym()) { - device.writeAttr(i.getAttrSynonym(), attributeValue); - } else { - // SVC permissions uses their own writting function - if (i.isSVCPermission()) { - // disallow attribute musn't be written - if (i.getAttr() != SUMO_ATTR_DISALLOW) { - writePermissions(device, parseVehicleClasses(attributeValue)); - } - } else if (myTagProperty.canMaskXYZPositions() && (i.getAttr() == SUMO_ATTR_POSITION)) { - // get position attribute and write it separate - Position pos = parse(getAttribute(SUMO_ATTR_POSITION)); - device.writeAttr(SUMO_ATTR_X, toString(pos.x())); - device.writeAttr(SUMO_ATTR_Y, toString(pos.y())); - // write 0 only if is different from 0 (the default value) - if (pos.z() != 0) { - device.writeAttr(SUMO_ATTR_Z, toString(pos.z())); - } - } else { - device.writeAttr(i.getAttr(), attributeValue); - } - } - } - } - // iterate over children and write it in XML (or in a different file) - if (myTagProperty.canWriteChildrenSeparate() && myTagProperty.hasAttribute(SUMO_ATTR_FILE) && !getAttribute(SUMO_ATTR_FILE).empty()) { - // we assume that rerouter values files is placed in the same folder as the additional file - OutputDevice& deviceChildren = OutputDevice::getDevice(FileHelpers::getFilePath(OptionsCont::getOptions().getString("additional-files")) + getAttribute(SUMO_ATTR_FILE)); - deviceChildren.writeXMLHeader("rerouterValue", "additional_file.xsd"); - // save children in a different filename - for (auto i : getChildAdditionals()) { - // avoid to write two times additionals that haben two parents (Only write as child of first parent) - if (i->getParentAdditionals().size() < 1) { - i->writeAdditional(deviceChildren); - } else if (myTagProperty.getTag() == i->getTagProperty().getParentTag()) { - i->writeAdditional(deviceChildren); - } - } - deviceChildren.close(); - } else { - for (auto i : getChildAdditionals()) { - // avoid to write two times additionals that haben two parents (Only write as child of first parent) - if (i->getParentAdditionals().size() < 2) { - i->writeAdditional(device); - } else if (myTagProperty.getTag() == i->getTagProperty().getParentTag()) { - i->writeAdditional(device); - } - } - } - // write parameters (Always after children to avoid problems with additionals.xsd) - writeParams(device); - // Close tag - device.closeTag(); - } -} - - -bool -GNEAdditional::isAdditionalValid() const { - return true; -} - - -std::string -GNEAdditional::getAdditionalProblem() const { - return ""; -} - - -void -GNEAdditional::fixAdditionalProblem() { - throw InvalidArgument(getTagStr() + " cannot fix any problem"); -} - - -void -GNEAdditional::openAdditionalDialog() { - throw InvalidArgument(getTagStr() + " doesn't have an additional dialog"); -} - - -void -GNEAdditional::startGeometryMoving() { - // only move if additional is drawable - if (myTagProperty.isDrawable()) { - // always save original position over view - myMove.originalViewPosition = getPositionInView(); - // check if position over lane or lanes has to be saved - if (myTagProperty.hasAttribute(SUMO_ATTR_LANE)) { - if (myTagProperty.canMaskStartEndPos()) { - // obtain start and end position - myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_STARTPOS); - myMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); - } else { - // obtain position attribute - myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_POSITION); - } - } else if (myTagProperty.hasAttribute(SUMO_ATTR_LANES) && - myTagProperty.hasAttribute(SUMO_ATTR_POSITION) && - myTagProperty.hasAttribute(SUMO_ATTR_ENDPOS)) { - // obtain start and end position - myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_POSITION); - myMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); - } - // save current centering boundary if element is placed in RTree - if (myTagProperty.isPlacedInRTree()) { - myMove.movingGeometryBoundary = getCenteringBoundary(); - } - // start geometry in all children - for (const auto& i : getChildDemandElements()) { - i->startGeometryMoving(); - } - } -} - - -void -GNEAdditional::endGeometryMoving() { - // check that endGeometryMoving was called only once - if (myTagProperty.isDrawable()) { - // check if object must be placed in RTREE - if (myTagProperty.isPlacedInRTree()) { - // Remove object from net - myViewNet->getNet()->removeGLObjectFromGrid(this); - // reset myMovingGeometryBoundary - myMove.movingGeometryBoundary.reset(); - // add object into grid again (using the new centering boundary) - myViewNet->getNet()->addGLObjectIntoGrid(this); - } - // end geometry in all children - for (const auto& i : getChildDemandElements()) { - i->endGeometryMoving(); - } - } -} - - -void -GNEAdditional::updateDottedContour() { - // -} - - -GNEViewNet* -GNEAdditional::getViewNet() const { - return myViewNet; -} - - -bool -GNEAdditional::isAdditionalBlocked() const { - return myBlockMovement; -} - - -GUIGLObjectPopupMenu* -GNEAdditional::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open additional dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - // Show position parameters - if (myTagProperty.hasAttribute(SUMO_ATTR_LANE)) { - GNELane* lane = myViewNet->getNet()->retrieveLane(getAttribute(SUMO_ATTR_LANE)); - // Show menu command inner position - const double innerPos = myAdditionalGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); - new FXMenuCommand(ret, ("Cursor position over additional shape: " + toString(innerPos)).c_str(), nullptr, nullptr, 0); - // If shape isn't empty, show menu command lane position - if (myAdditionalGeometry.getShape().size() > 0) { - const double lanePos = lane->getLaneShape().nearest_offset_to_point2D(myAdditionalGeometry.getShape().front()); - new FXMenuCommand(ret, ("Cursor position over " + toString(SUMO_TAG_LANE) + ": " + toString(innerPos + lanePos)).c_str(), nullptr, nullptr, 0); - } - } else if (myTagProperty.hasAttribute(SUMO_ATTR_EDGE)) { - GNEEdge* edge = myViewNet->getNet()->retrieveEdge(getAttribute(SUMO_ATTR_EDGE)); - // Show menu command inner position - const double innerPos = myAdditionalGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); - new FXMenuCommand(ret, ("Cursor position over additional shape: " + toString(innerPos)).c_str(), nullptr, nullptr, 0); - // If shape isn't empty, show menu command edge position - if (myAdditionalGeometry.getShape().size() > 0) { - const double edgePos = edge->getLanes().at(0)->getLaneShape().nearest_offset_to_point2D(myAdditionalGeometry.getShape().front()); - new FXMenuCommand(ret, ("Mouse position over " + toString(SUMO_TAG_EDGE) + ": " + toString(innerPos + edgePos)).c_str(), nullptr, nullptr, 0); - } - } else { - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - } - return ret; -} - - -GUIParameterTableWindow* -GNEAdditional::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - // Create table - GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); - // Iterate over attributes - for (const auto& i : myTagProperty) { - // Add attribute and set it dynamic if aren't unique - if (i.isUnique()) { - ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); - } else { - ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); - } - } - // close building - ret->closeBuilding(); - return ret; -} - - -const std::string& -GNEAdditional::getOptionalAdditionalName() const { - return myAdditionalName; -} - -// --------------------------------------------------------------------------- -// GNEAdditional::BlockIcon - methods -// --------------------------------------------------------------------------- - -GNEAdditional::BlockIcon::BlockIcon(GNEAdditional* additional) : - rotation(0.), - myAdditional(additional) {} - - -void -GNEAdditional::BlockIcon::setRotation(GNELane* additionalLane) { - if (myAdditional->myAdditionalGeometry.getShape().size() > 0 && myAdditional->myAdditionalGeometry.getShape().length() != 0) { - // If length of the shape is distint to 0, Obtain rotation of center of shape - rotation = myAdditional->myAdditionalGeometry.getShape().rotationDegreeAtOffset((myAdditional->myAdditionalGeometry.getShape().length() / 2.)) - 90; - } else if (additionalLane) { - // If additional is over a lane, set rotation in the position over lane - double posOverLane = additionalLane->getLaneShape().nearest_offset_to_point2D(myAdditional->getPositionInView()); - rotation = additionalLane->getLaneShape().rotationDegreeAtOffset(posOverLane) - 90; - } else { - // In other case, rotation is 0 - rotation = 0; - } -} - - -void -GNEAdditional::BlockIcon::drawIcon(const GUIVisualizationSettings& s, const double exaggeration, const double size) const { - // check if block icon can be draw - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.lockIcon, exaggeration) && myAdditional->myViewNet->showLockIcon()) { - // Start pushing matrix - glPushMatrix(); - // Traslate to middle of shape - glTranslated(position.x(), position.y(), myAdditional->getType() + 0.1); - // Set draw color - glColor3d(1, 1, 1); - // Rotate depending of rotation - glRotated(rotation, 0, 0, -1); - // Rotate 180 degrees - glRotated(180, 0, 0, 1); - // Traslate depending of the offset - glTranslated(offset.x(), offset.y(), 0); - // Draw icon depending of the state of additional - if (myAdditional->drawUsingSelectColor()) { - if (!myAdditional->getTagProperty().canBlockMovement()) { - // Draw not movable texture if additional isn't movable and is selected - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_NOTMOVINGSELECTED), size); - } else if (myAdditional->myBlockMovement) { - // Draw lock texture if additional is movable, is blocked and is selected - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCKSELECTED), size); - } else { - // Draw empty texture if additional is movable, isn't blocked and is selected - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTYSELECTED), size); - } - } else { - if (!myAdditional->getTagProperty().canBlockMovement()) { - // Draw not movable texture if additional isn't movable - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_NOTMOVING), size); - } else if (myAdditional->myBlockMovement) { - // Draw lock texture if additional is movable and is blocked - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCK), size); - } else { - // Draw empty texture if additional is movable and isn't blocked - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTY), size); - } - } - // Pop matrix - glPopMatrix(); - } -} - -// --------------------------------------------------------------------------- -// GNEAdditional - protected methods -// --------------------------------------------------------------------------- - -void -GNEAdditional::setDefaultValues() { - // iterate over attributes and set default value - for (const auto& i : myTagProperty) { - if (i.hasStaticDefaultValue()) { - setAttribute(i.getAttr(), i.getDefaultValue()); - } - } -} - - -const std::string& -GNEAdditional::getAdditionalID() const { - return getMicrosimID(); -} - - -bool -GNEAdditional::isValidAdditionalID(const std::string& newID) const { - if (SUMOXMLDefinitions::isValidAdditionalID(newID) && (myViewNet->getNet()->retrieveAdditional(myTagProperty.getTag(), newID, false) == nullptr)) { - return true; - } else { - return false; - } -} - - -bool -GNEAdditional::isValidDetectorID(const std::string& newID) const { - if (SUMOXMLDefinitions::isValidDetectorID(newID) && (myViewNet->getNet()->retrieveAdditional(myTagProperty.getTag(), newID, false) == nullptr)) { - return true; - } else { - return false; - } -} - - -void -GNEAdditional::changeAdditionalID(const std::string& newID) { - if (myViewNet->getNet()->retrieveAdditional(myTagProperty.getTag(), newID, false) != nullptr) { - throw InvalidArgument("An Additional with tag " + getTagStr() + " and ID = " + newID + " already exists"); - } else { - // Save old ID - std::string oldID = getMicrosimID(); - // set New ID - setMicrosimID(newID); - // update additional ID in the container of net - myViewNet->getNet()->updateAdditionalID(oldID, this); - } -} - - -void -GNEAdditional::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(GLO_ADDITIONAL); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEAdditional::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(GLO_ADDITIONAL); - if (changeFlag) { - mySelected = false; - - } - } -} - - -bool -GNEAdditional::isAttributeCarrierSelected() const { - return mySelected; -} - - -bool -GNEAdditional::drawUsingSelectColor() const { - if (mySelected && (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK)) { - return true; - } else { - return false; - } -} - - -void -GNEAdditional::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNEAdditional::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -bool -GNEAdditional::checkChildAdditionalRestriction() const { - // throw exception because this function mus be implemented in child (see GNEE3Detector) - throw ProcessError("Calling non-implemented function checkChildAdditionalRestriction during saving of " + getTagStr() + ". It muss be reimplemented in child class"); -} - - -void -GNEAdditional::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditional.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditional.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditional.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditional.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,406 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditional.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2016 -/// -// A abstract class for representation of additional elements -/****************************************************************************/ -#ifndef GNEAdditional_h -#define GNEAdditional_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include -#include -#include -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNENetElement; -class GUIGLObjectPopupMenu; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEAdditional - * @brief An Element which don't belongs to GNENet but has influency in the simulation - */ -class GNEAdditional : public GUIGlObject, public GNEAttributeCarrier, public Parameterised, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { - -public: - /**@brief Constructor - * @param[in] id Gl-id of the additional element (Must be unique) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] type GUIGlObjectType of additional - * @param[in] tag Type of xml tag that define the additional element (SUMO_TAG_BUS_STOP, SUMO_TAG_REROUTER, etc...) - * @param[in] name Additional name - * @param[in] block movement enable or disable additional movement - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] childDemandElements vector of demandElement parents - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of demandElement children - */ - GNEAdditional(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /**@brief Constructor used by Additionals that have two additionals as parent - * @param[in] additionalParent pointer to parent additional pointer (used to generate an ID) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] type GUIGlObjectType of additional - * @param[in] tag Type of xml tag that define the additional element (SUMO_TAG_BUS_STOP, SUMO_TAG_REROUTER, etc...) - * @param[in] name Additional name - * @param[in] block movement enable or disable additional movement - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] childDemandElements vector of demandElement parents - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of demandElement children - */ - GNEAdditional(GNEAdditional* additionalParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /// @brief Destructor - ~GNEAdditional(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @brief obtain additional geometry - const GNEGeometry::Geometry& getAdditionalGeometry() const; - - /// @brief obtain additional segment geometry - const GNEGeometry::SegmentGeometry& getAdditionalSegmentGeometry() const; - - /// @brief set special color - void setSpecialColor(const RGBColor* color); - - /// @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 (by default true, can be reimplemented in children) - virtual bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem (by default empty, can be reimplemented in children) - virtual std::string getAdditionalProblem() const; - - /// @brief fix additional problem (by default throw an exception, has to be reimplemented in children) - virtual void fixAdditionalProblem(); - /// @} - - /**@brief open Additional Dialog - * @note: if additional needs an additional dialog, this function has to be implemented in childrens (see GNERerouter and GNEVariableSpeedSign) - * @throw invalid argument if additional doesn't have an additional Dialog - */ - virtual void openAdditionalDialog(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief begin movement (used when user click over additional to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(); - - /// @brief begin movement (used when user click over additional to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - virtual void moveGeometry(const Position& offset) = 0; - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; - - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief Returns position of additional in view - virtual Position getPositionInView() const = 0; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - virtual Boundary getCenteringBoundary() const = 0; - - /// @brief split geometry - virtual void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) = 0; - /// @} - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief Returns a pointer to GNEViewNet in which additional element is located - GNEViewNet* getViewNet() const; - - /// @brief Check if additional item is currently blocked (i.e. cannot be moved with mouse) - bool isAdditionalBlocked() const; - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief Returns the additional name - const std::string& getOptionalAdditionalName() const; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /// @brief check if attribute carrier is selected - bool isAttributeCarrierSelected() const; - - /// @brief check if attribute carrier must be drawn using selecting color. - bool drawUsingSelectColor() const; - - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 - */ - virtual double getAttributeDouble(SumoXMLAttr key) const = 0; - - /**@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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /**@brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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 - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - virtual std::string getPopUpID() const = 0; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - virtual std::string getHierarchyName() const = 0; - /// @} - -protected: - - /// @brief struct for pack all variables related with additional move - struct AdditionalMove { - /// @brief boundary used during moving of elements (to avoid insertion in RTREE - Boundary movingGeometryBoundary; - - /// @brief value for saving first original position over lane before moving - Position originalViewPosition; - - /// @brief value for saving first original position over lane before moving - std::string firstOriginalLanePosition; - - /// @brief value for saving second original position over lane before moving - std::string secondOriginalPosition; - - private: - /// @brief Invalidated assignment operator - AdditionalMove& operator=(const AdditionalMove& other) = delete; - - }; - - /// @brief struct for pack all variables and functions related with Block Icon - struct BlockIcon { - /// @brief constructor - BlockIcon(GNEAdditional* additional); - - /// @brief set Rotation of block Icon (must be called in updateGeometry() function) - void setRotation(GNELane* additionalLane = nullptr); - - /// @brief draw lock icon - void drawIcon(const GUIVisualizationSettings& s, const double exaggeration, const double size = 0.5) const; - - public: - /// @brief position of the block icon - Position position; - - /// @brief The offSet of the block icon - Position offset; - - /// @brief The rotation of the block icon - double rotation; - - private: - /// @brief pointer to parent additional - GNEAdditional* myAdditional; - - /// @brief Invalidated assignment operator - BlockIcon& operator=(const BlockIcon& other) = delete; - }; - - /// @brief The GNEViewNet this additional element belongs - GNEViewNet* myViewNet; - - /// @brief geometry to be precomputed in updateGeometry(...) - GNEGeometry::Geometry myAdditionalGeometry; - - /// @brief segment geometry to be precomputed in updateGeometry(...) (used by E2Multilane) - GNEGeometry::SegmentGeometry mySegmentGeometry; - - /// @brief variable AdditionalMove - AdditionalMove myMove; - - /// @brief name of additional - std::string myAdditionalName; - - /// @brief boolean to check if additional element is blocked (i.e. cannot be moved with mouse) - bool myBlockMovement; - - /// @brief variable BlockIcon - BlockIcon myBlockIcon; - - /// @brief pointer to special color (used for drawing Additional with a certain color, mainly used for selections) - const RGBColor* mySpecialColor; - - /// @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(...) - /// @{ - /// @brief returns Additional ID - const std::string& getAdditionalID() const; - - /// @brief check if a new additional ID is valid - bool isValidAdditionalID(const std::string& newID) const; - - /// @brief check if a new detector ID is valid - bool isValidDetectorID(const std::string& newID) const; - - /**@brief change ID of additional - * @throw exception if exist already an additional whith the same ID - * @throw exception if ID isn't valid - */ - void changeAdditionalID(const std::string& newID); - - /// @} - -private: - /**@brief check restriction with the number of children - * @throw ProcessError if itis called without be reimplemented in child class - */ - virtual bool checkChildAdditionalRestriction() const; - - /// @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 Invalidated copy constructor. - GNEAdditional(const GNEAdditional&) = delete; - - /// @brief Invalidated assignment operator. - GNEAdditional& operator=(const GNEAdditional&) = delete; -}; - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2682 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditionalHandler.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// Builds trigger objects for netedit -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEAdditionalHandler.h" -#include "GNEBusStop.h" -#include "GNEAccess.h" -#include "GNECalibrator.h" -#include "GNECalibratorFlow.h" -#include "GNEChargingStation.h" -#include "GNEClosingLaneReroute.h" -#include "GNEClosingReroute.h" -#include "GNEContainerStop.h" -#include "GNEDestProbReroute.h" -#include "GNEDetectorE1.h" -#include "GNEDetectorE2.h" -#include "GNEDetectorE3.h" -#include "GNEDetectorEntryExit.h" -#include "GNEDetectorE1Instant.h" -#include "GNEParkingArea.h" -#include "GNEParkingSpace.h" -#include "GNERerouter.h" -#include "GNERerouterInterval.h" -#include "GNERouteProbReroute.h" -#include "GNEParkingAreaReroute.h" -#include "GNERouteProbe.h" -#include "GNEVaporizer.h" -#include "GNEVariableSpeedSign.h" -#include "GNEVariableSpeedSignStep.h" -#include "GNETAZ.h" -#include "GNETAZSourceSink.h" - - -// =========================================================================== -// GNEAdditionalHandler method definitions -// =========================================================================== - -GNEAdditionalHandler::GNEAdditionalHandler(const std::string& file, GNEViewNet* viewNet, GNEAdditional* additionalParent) : - ShapeHandler(file, *viewNet->getNet()), - myViewNet(viewNet) { - // check if we're loading values of another additionals (example: Rerouter values) - if (additionalParent) { - myHierarchyInsertedAdditionals.insertElement(additionalParent->getTagProperty().getTag()); - myHierarchyInsertedAdditionals.commitElementInsertion(additionalParent); - } - // define default values for shapes - setDefaults("", RGBColor::RED, Shape::DEFAULT_LAYER_POI, true); -} - - -GNEAdditionalHandler::~GNEAdditionalHandler() {} - - -void -GNEAdditionalHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - // Obtain tag of element - SumoXMLTag tag = static_cast(element); - // check if we're parsing a parameter - if (tag == SUMO_TAG_PARAM) { - // push element int stack - myHierarchyInsertedAdditionals.insertElement(tag); - // parse parameter - parseParameter(attrs); - } else if (tag != SUMO_TAG_NOTHING) { - // push element int stack - if (tag == SUMO_TAG_TRAIN_STOP) { - // ensure that access elements can find their parent in myHierarchyInsertedAdditionals - tag = SUMO_TAG_BUS_STOP; - } - myHierarchyInsertedAdditionals.insertElement(tag); - // Call parse and build depending of tag - switch (tag) { - case SUMO_TAG_POLY: - return parseAndBuildPoly(attrs); - case SUMO_TAG_POI: - return parseAndBuildPOI(attrs); - default: - // build additional - buildAdditional(myViewNet, true, tag, attrs, &myHierarchyInsertedAdditionals); - } - } -} - - -void -GNEAdditionalHandler::myEndElement(int element) { - // Obtain tag of element - SumoXMLTag tag = static_cast(element); - switch (tag) { - case SUMO_TAG_TAZ: { - GNETAZ* TAZ = dynamic_cast(myHierarchyInsertedAdditionals.getLastInsertedAdditional()); - if (TAZ != nullptr) { - if (TAZ->getTAZShape().size() == 0) { - Boundary b; - if (TAZ->getChildAdditionals().size() > 0) { - for (const auto& i : TAZ->getChildAdditionals()) { - b.add(i->getCenteringBoundary()); - } - PositionVector boundaryShape; - boundaryShape.push_back(Position(b.xmin(), b.ymin())); - boundaryShape.push_back(Position(b.xmax(), b.ymin())); - boundaryShape.push_back(Position(b.xmax(), b.ymax())); - boundaryShape.push_back(Position(b.xmin(), b.ymax())); - boundaryShape.push_back(Position(b.xmin(), b.ymin())); - TAZ->setAttribute(SUMO_ATTR_SHAPE, toString(boundaryShape), myViewNet->getUndoList()); - } - } - } - break; - } - default: - break; - } - // pop last inserted element - myHierarchyInsertedAdditionals.popElement(); - // execute myEndElement of ShapeHandler (needed to update myLastParameterised) - ShapeHandler::myEndElement(element); -} - - -Position -GNEAdditionalHandler::getLanePos(const std::string& poiID, const std::string& laneID, double lanePos, double lanePosLat) { - std::string edgeID; - int laneIndex; - NBHelpers::interpretLaneID(laneID, edgeID, laneIndex); - NBEdge* edge = myViewNet->getNet()->retrieveEdge(edgeID)->getNBEdge(); - if (edge == nullptr || laneIndex < 0 || edge->getNumLanes() <= laneIndex) { - WRITE_ERROR("Lane '" + laneID + "' to place poi '" + poiID + "' on is not known."); - return Position::INVALID; - } - if (lanePos < 0) { - lanePos = edge->getLength() + lanePos; - } - if (lanePos < 0 || lanePos > edge->getLength()) { - WRITE_WARNING("lane position " + toString(lanePos) + " for poi '" + poiID + "' is not valid."); - } - return edge->getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat); -} - - -bool -GNEAdditionalHandler::buildAdditional(GNEViewNet* viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - // Call parse and build depending of tag - switch (tag) { - case SUMO_TAG_BUS_STOP: - case SUMO_TAG_TRAIN_STOP: - return parseAndBuildBusStop(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_ACCESS: - return parseAndBuildAccess(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_CONTAINER_STOP: - return parseAndBuildContainerStop(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_CHARGING_STATION: - return parseAndBuildChargingStation(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_E1DETECTOR: - case SUMO_TAG_INDUCTION_LOOP: - return parseAndBuildDetectorE1(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_E2DETECTOR: - case SUMO_TAG_E2DETECTOR_MULTILANE: - case SUMO_TAG_LANE_AREA_DETECTOR: - return parseAndBuildDetectorE2(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_E3DETECTOR: - case SUMO_TAG_ENTRY_EXIT_DETECTOR: - return parseAndBuildDetectorE3(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_DET_ENTRY: - return parseAndBuildDetectorEntry(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_DET_EXIT: - return parseAndBuildDetectorExit(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_INSTANT_INDUCTION_LOOP: - return parseAndBuildDetectorE1Instant(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_ROUTEPROBE: - return parseAndBuildRouteProbe(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_VAPORIZER: - return parseAndBuildVaporizer(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_TAZ: - return parseAndBuildTAZ(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_TAZSOURCE: - return parseAndBuildTAZSource(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_TAZSINK: - return parseAndBuildTAZSink(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_VSS: - return parseAndBuildVariableSpeedSign(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_STEP: - return parseAndBuildVariableSpeedSignStep(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_CALIBRATOR: - case SUMO_TAG_LANECALIBRATOR: - return parseAndBuildCalibrator(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_PARKING_AREA: - return parseAndBuildParkingArea(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_PARKING_SPACE: - return parseAndBuildParkingSpace(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_FLOW_CALIBRATOR: - return parseAndBuildCalibratorFlow(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_REROUTER: - return parseAndBuildRerouter(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_INTERVAL: - return parseAndBuildRerouterInterval(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_CLOSING_LANE_REROUTE: - return parseAndBuildRerouterClosingLaneReroute(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_CLOSING_REROUTE: - return parseAndBuildRerouterClosingReroute(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_DEST_PROB_REROUTE: - return parseAndBuildRerouterDestProbReroute(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_PARKING_ZONE_REROUTE: - return parseAndBuildRerouterParkingAreaReroute(viewNet, allowUndoRedo, attrs, insertedAdditionals); - case SUMO_TAG_ROUTE_PROB_REROUTE: - return parseAndBuildRerouterRouteProbReroute(viewNet, allowUndoRedo, attrs, insertedAdditionals); - default: - return false; - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildBusStop(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, int personCapacity, bool friendlyPosition, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, id, false) == nullptr) { - GNEBusStop* busStop = new GNEBusStop(id, lane, viewNet, startPos, endPos, parametersSet, name, lines, personCapacity, friendlyPosition, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_BUS_STOP)); - viewNet->getUndoList()->add(new GNEChange_Additional(busStop, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(busStop); - lane->addChildAdditional(busStop); - busStop->incRef("buildBusStop"); - } - return busStop; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_BUS_STOP) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildAccess(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* busStop, GNELane* lane, double pos, const std::string& length, bool friendlyPos, bool blockMovement) { - // Check if busStop parent and lane is correct - if (lane == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); - } else if (busStop == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_BUS_STOP) + " parent doesn't exist."); - } else if (!accessCanBeCreated(busStop, lane->getParentEdge())) { - throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_BUS_STOP) + " parent already owns a Acces in the edge '" + lane->getParentEdge()->getID() + "'"); - } else { - GNEAccess* access = new GNEAccess(busStop, lane, viewNet, pos, length, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_ACCESS)); - viewNet->getUndoList()->add(new GNEChange_Additional(access, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(access); - lane->addChildAdditional(access); - busStop->addChildAdditional(access); - access->incRef("buildAccess"); - } - return access; - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildContainerStop(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, id, false) == nullptr) { - GNEContainerStop* containerStop = new GNEContainerStop(id, lane, viewNet, startPos, endPos, parametersSet, name, lines, friendlyPosition, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_CONTAINER_STOP)); - viewNet->getUndoList()->add(new GNEChange_Additional(containerStop, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(containerStop); - lane->addChildAdditional(containerStop); - containerStop->incRef("buildContainerStop"); - } - return containerStop; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_CONTAINER_STOP) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildChargingStation(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, id, false) == nullptr) { - GNEChargingStation* chargingStation = new GNEChargingStation(id, lane, viewNet, startPos, endPos, parametersSet, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_CHARGING_STATION)); - viewNet->getUndoList()->add(new GNEChange_Additional(chargingStation, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(chargingStation); - lane->addChildAdditional(chargingStation); - chargingStation->incRef("buildChargingStation"); - } - return chargingStation; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_CHARGING_STATION) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildParkingArea(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, id, false) == nullptr) { - GNEParkingArea* parkingArea = new GNEParkingArea(id, lane, viewNet, startPos, endPos, parametersSet, name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_PARKING_AREA)); - viewNet->getUndoList()->add(new GNEChange_Additional(parkingArea, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(parkingArea); - lane->addChildAdditional(parkingArea); - parkingArea->incRef("buildParkingArea"); - } - return parkingArea; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_PARKING_AREA) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildParkingSpace(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement) { - GNEParkingSpace* parkingSpace = new GNEParkingSpace(viewNet, parkingAreaParent, pos, width, length, angle, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_PARKING_SPACE)); - viewNet->getUndoList()->add(new GNEChange_Additional(parkingSpace, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(parkingSpace); - parkingAreaParent->addChildAdditional(parkingSpace); - parkingSpace->incRef("buildParkingSpace"); - } - return parkingSpace; -} - - -GNEAdditional* -GNEAdditionalHandler::buildDetectorE1(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E1DETECTOR, id, false) == nullptr) { - GNEDetectorE1* detectorE1 = new GNEDetectorE1(id, lane, viewNet, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_E1DETECTOR)); - viewNet->getUndoList()->add(new GNEChange_Additional(detectorE1, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(detectorE1); - lane->addChildAdditional(detectorE1); - detectorE1->incRef("buildDetectorE1"); - } - return detectorE1; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_E1DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildSingleLaneDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, double length, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E2DETECTOR, id, false) == nullptr) { - GNEDetectorE2* detectorE2 = new GNEDetectorE2(id, lane, viewNet, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_E2DETECTOR)); - viewNet->getUndoList()->add(new GNEChange_Additional(detectorE2, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(detectorE2); - lane->addChildAdditional(detectorE2); - detectorE2->incRef("buildDetectorE2"); - } - return detectorE2; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_E2DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildMultiLaneDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, const std::vector& lanes, double pos, double endPos, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E2DETECTOR_MULTILANE, id, false) == nullptr) { - GNEDetectorE2* detectorE2 = new GNEDetectorE2(id, lanes, viewNet, pos, endPos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_E2DETECTOR_MULTILANE)); - viewNet->getUndoList()->add(new GNEChange_Additional(detectorE2, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(detectorE2); - for (auto i : lanes) { - i->addChildAdditional(detectorE2); - } - detectorE2->incRef("buildDetectorE2Multilane"); - } - // check E2 integrity - detectorE2->checkE2MultilaneIntegrity(); - return detectorE2; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_E2DETECTOR_MULTILANE) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildDetectorE3(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, id, false) == nullptr) { - GNEDetectorE3* detectorE3 = new GNEDetectorE3(id, viewNet, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_E3DETECTOR)); - viewNet->getUndoList()->add(new GNEChange_Additional(detectorE3, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(detectorE3); - detectorE3->incRef("buildDetectorE3"); - } - return detectorE3; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_E3DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildDetectorEntry(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) { - // Check if Detector E3 parent and lane is correct - if (lane == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_DET_ENTRY) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); - } else if (E3Parent == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_DET_ENTRY) + " in netedit; " + toString(SUMO_TAG_E3DETECTOR) + " parent doesn't exist."); - } else { - GNEDetectorEntryExit* entry = new GNEDetectorEntryExit(SUMO_TAG_DET_ENTRY, viewNet, E3Parent, lane, pos, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_DET_ENTRY)); - viewNet->getUndoList()->add(new GNEChange_Additional(entry, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(entry); - lane->addChildAdditional(entry); - E3Parent->addChildAdditional(entry); - entry->incRef("buildDetectorEntry"); - } - return entry; - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildDetectorExit(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) { - // Check if Detector E3 parent and lane is correct - if (lane == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_DET_EXIT) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); - } else if (E3Parent == nullptr) { - throw ProcessError("Could not build " + toString(SUMO_TAG_DET_EXIT) + " in netedit; " + toString(SUMO_TAG_E3DETECTOR) + " parent doesn't exist."); - } else { - GNEDetectorEntryExit* exit = new GNEDetectorEntryExit(SUMO_TAG_DET_EXIT, viewNet, E3Parent, lane, pos, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_DET_EXIT)); - viewNet->getUndoList()->add(new GNEChange_Additional(exit, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(exit); - lane->addChildAdditional(exit); - E3Parent->addChildAdditional(exit); - exit->incRef("buildDetectorExit"); - } - return exit; - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildDetectorE1Instant(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_INSTANT_INDUCTION_LOOP, id, false) == nullptr) { - GNEDetectorE1Instant* detectorE1Instant = new GNEDetectorE1Instant(id, lane, viewNet, pos, filename, vehicleTypes, name, friendlyPos, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP)); - viewNet->getUndoList()->add(new GNEChange_Additional(detectorE1Instant, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(detectorE1Instant); - lane->addChildAdditional(detectorE1Instant); - detectorE1Instant->incRef("buildDetectorE1Instant"); - } - return detectorE1Instant; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& name, const std::string& outfile, const SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) == nullptr) { - GNECalibrator* calibrator = new GNECalibrator(id, viewNet, lane, pos, freq, name, outfile, routeprobe); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_CALIBRATOR)); - viewNet->getUndoList()->add(new GNEChange_Additional(calibrator, true), true); - viewNet->getUndoList()->p_end(); - // center after creation - if (centerAfterCreation) { - viewNet->centerTo(calibrator->getPositionInView(), false); - } - } else { - viewNet->getNet()->insertAdditional(calibrator); - lane->addChildAdditional(calibrator); - calibrator->incRef("buildCalibrator"); - } - return calibrator; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_CALIBRATOR) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNEEdge* edge, double pos, const std::string& name, const std::string& outfile, const SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) == nullptr) { - GNECalibrator* calibrator = new GNECalibrator(id, viewNet, edge, pos, freq, name, outfile, routeprobe); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_CALIBRATOR)); - viewNet->getUndoList()->add(new GNEChange_Additional(calibrator, true), true); - viewNet->getUndoList()->p_end(); - // center after creation - if (centerAfterCreation) { - viewNet->centerTo(calibrator->getPositionInView(), false); - } - } else { - viewNet->getNet()->insertAdditional(calibrator); - edge->addChildAdditional(calibrator); - calibrator->incRef("buildCalibrator"); - } - return calibrator; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_CALIBRATOR) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildCalibratorFlow(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* calibratorParent, GNEDemandElement* route, GNEDemandElement* vType, - const std::string& vehsPerHour, const std::string& speed, const RGBColor& color, const std::string& departLane, const std::string& departPos, - const std::string& departSpeed, const std::string& arrivalLane, const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, - int personNumber, int containerNumber, bool reroute, const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end) { - - // create Flow and add it to calibrator parent - GNECalibratorFlow* flow = new GNECalibratorFlow(calibratorParent, vType, route, vehsPerHour, speed, color, departLane, departPos, departSpeed, - arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute, - departPosLat, arrivalPosLat, begin, end); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + flow->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(flow, true), true); - viewNet->getUndoList()->p_end(); - } else { - calibratorParent->addChildAdditional(flow); - flow->incRef("buildCalibratorFlow"); - } - return flow; -} - - -GNEAdditional* -GNEAdditionalHandler::buildRerouter(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& edges, double prob, const std::string& name, const std::string& file, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_REROUTER, id, false) == nullptr) { - GNERerouter* rerouter = new GNERerouter(id, viewNet, pos, edges, name, file, prob, off, timeThreshold, vTypes, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_REROUTER)); - viewNet->getUndoList()->add(new GNEChange_Additional(rerouter, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(rerouter); - // add this rerouter as parent of all edges - for (auto i : edges) { - i->addParentAdditional(rerouter); - } - rerouter->incRef("buildRerouter"); - } - // parse rerouter children - if (!file.empty()) { - // we assume that rerouter values files is placed in the same folder as the additional file - std::string currentAdditionalFilename = FileHelpers::getFilePath(OptionsCont::getOptions().getString("additional-files")); - // Create additional handler for parse rerouter values - GNEAdditionalHandler rerouterValuesHandler(currentAdditionalFilename + file, viewNet, rerouter); - // disable validation for rerouters - XMLSubSys::setValidation("never", "auto"); - // Run parser - if (!XMLSubSys::runParser(rerouterValuesHandler, currentAdditionalFilename + file, false)) { - WRITE_MESSAGE("Loading of " + file + " failed."); - } - // enable validation for rerouters - XMLSubSys::setValidation("auto", "auto"); - } - return rerouter; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_REROUTER) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildRerouterInterval(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end) { - // check if new interval will produce a overlapping - if (checkOverlappingRerouterIntervals(rerouterParent, begin, end)) { - // create rerouter interval and add it into rerouter parent - GNERerouterInterval* rerouterInterval = new GNERerouterInterval(rerouterParent, begin, end); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + rerouterInterval->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(rerouterInterval, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterParent->addChildAdditional(rerouterInterval); - rerouterInterval->incRef("buildRerouterInterval"); - } - return rerouterInterval; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_INTERVAL) + " with begin '" + toString(begin) + "' and '" + toString(end) + "' in '" + rerouterParent->getID() + "' due overlapping."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildClosingLaneReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions) { - // create closing lane reorute - GNEClosingLaneReroute* closingLaneReroute = new GNEClosingLaneReroute(rerouterIntervalParent, closedLane, permissions); - // add it to interval parent depending of allowUndoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + closingLaneReroute->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterIntervalParent->addChildAdditional(closingLaneReroute); - closingLaneReroute->incRef("buildClosingLaneReroute"); - } - return closingLaneReroute; -} - - -GNEAdditional* -GNEAdditionalHandler::buildClosingReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions) { - // create closing reroute - GNEClosingReroute* closingReroute = new GNEClosingReroute(rerouterIntervalParent, closedEdge, permissions); - // add it to interval parent depending of allowUndoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + closingReroute->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterIntervalParent->addChildAdditional(closingReroute); - closingReroute->incRef("buildClosingReroute"); - } - return closingReroute; -} - - -GNEAdditional* -GNEAdditionalHandler::builDestProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability) { - // create dest probability reroute - GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(rerouterIntervalParent, newEdgeDestination, probability); - // add it to interval parent depending of allowUndoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + destProbReroute->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterIntervalParent->addChildAdditional(destProbReroute); - destProbReroute->incRef("builDestProbReroute"); - } - return destProbReroute; -} - - -GNEAdditional* -GNEAdditionalHandler::builParkingAreaReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible) { - // create dest probability reroute - GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(rerouterIntervalParent, newParkingArea, probability, visible); - // add it to interval parent depending of allowUndoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + parkingAreaReroute->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterIntervalParent->addChildAdditional(parkingAreaReroute); - parkingAreaReroute->incRef("builParkingAreaReroute"); - } - return parkingAreaReroute; -} - - -GNEAdditional* -GNEAdditionalHandler::buildRouteProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability) { - // create rout prob rereoute - GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(rerouterIntervalParent, newRouteId, probability); - // add it to interval parent depending of allowUndoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + routeProbReroute->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true); - viewNet->getUndoList()->p_end(); - } else { - rerouterIntervalParent->addChildAdditional(routeProbReroute); - routeProbReroute->incRef("buildRouteProbReroute"); - } - return routeProbReroute; -} - - -GNEAdditional* -GNEAdditionalHandler::buildRouteProbe(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNEEdge* edge, const std::string& freq, const std::string& name, const std::string& file, SUMOTime begin, bool centerAfterCreation) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_ROUTEPROBE, id, false) == nullptr) { - GNERouteProbe* routeProbe = new GNERouteProbe(id, viewNet, edge, freq, name, file, begin); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_ROUTEPROBE)); - viewNet->getUndoList()->add(new GNEChange_Additional(routeProbe, true), true); - viewNet->getUndoList()->p_end(); - // center after creation - if (centerAfterCreation) { - viewNet->centerTo(routeProbe->getPositionInView(), false); - } - } else { - viewNet->getNet()->insertAdditional(routeProbe); - edge->addChildAdditional(routeProbe); - routeProbe->incRef("buildRouteProbe"); - } - return routeProbe; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_ROUTEPROBE) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildVariableSpeedSign(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& lanes, const std::string& name, bool blockMovement) { - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_VSS, id, false) == nullptr) { - GNEVariableSpeedSign* variableSpeedSign = new GNEVariableSpeedSign(id, viewNet, pos, lanes, name, blockMovement); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_VSS)); - viewNet->getUndoList()->add(new GNEChange_Additional(variableSpeedSign, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(variableSpeedSign); - // add this VSS as parent of all edges - for (auto i : lanes) { - i->addParentAdditional(variableSpeedSign); - } - variableSpeedSign->incRef("buildVariableSpeedSign"); - } - return variableSpeedSign; - } else { - throw ProcessError("Could not build " + toString(SUMO_TAG_VSS) + " with ID '" + id + "' in netedit; probably declared twice."); - } -} - - -GNEAdditional* -GNEAdditionalHandler::buildVariableSpeedSignStep(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* VSSParent, double time, double speed) { - // create Variable Speed Sign - GNEVariableSpeedSignStep* variableSpeedSignStep = new GNEVariableSpeedSignStep(VSSParent, time, speed); - // add it depending of allow undoRedo - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + variableSpeedSignStep->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_Additional(variableSpeedSignStep, true), true); - viewNet->getUndoList()->p_end(); - } else { - VSSParent->addChildAdditional(variableSpeedSignStep); - variableSpeedSignStep->incRef("buildVariableSpeedSignStep"); - } - return variableSpeedSignStep; -} - - -GNEAdditional* -GNEAdditionalHandler::buildVaporizer(GNEViewNet* viewNet, bool allowUndoRedo, GNEEdge* edge, SUMOTime startTime, SUMOTime endTime, const std::string& name, bool centerAfterCreation) { - GNEVaporizer* vaporizer = new GNEVaporizer(viewNet, edge, startTime, endTime, name); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_VAPORIZER)); - viewNet->getUndoList()->add(new GNEChange_Additional(vaporizer, true), true); - viewNet->getUndoList()->p_end(); - // center after creation - if (centerAfterCreation) { - viewNet->centerTo(vaporizer->getPositionInView(), false); - } - } else { - viewNet->getNet()->insertAdditional(vaporizer); - edge->addChildAdditional(vaporizer); - vaporizer->incRef("buildVaporizer"); - } - return vaporizer; -} - - -GNEAdditional* -GNEAdditionalHandler::buildTAZ(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, const PositionVector& shape, const RGBColor& color, const std::vector& edges, bool blockMovement) { - GNETAZ* TAZ = new GNETAZ(id, viewNet, shape, color, blockMovement); - // disable updating geometry of TAZ children during insertion (because in large nets provokes slowdowns) - viewNet->getNet()->disableUpdateGeometry(); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZ)); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZ, true), true); - // create TAZEdges - for (auto i : edges) { - // create TAZ Source using GNEChange_Additional - GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, i, 1); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); - // create TAZ Sink using GNEChange_Additional - GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, i, 1); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); - } - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(TAZ); - TAZ->incRef("buildTAZ"); - for (auto i : edges) { - // create TAZ Source - GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, i, 1); - TAZSource->incRef("buildTAZ"); - TAZ->addChildAdditional(TAZSource); - // create TAZ Sink - GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, i, 1); - TAZSink->incRef("buildTAZ"); - TAZ->addChildAdditional(TAZSink); - } - } - // enable updating geometry again and update geometry of TAZ - viewNet->getNet()->enableUpdateGeometry(); - // update TAZ Frame - TAZ->updateGeometry(); - TAZ->updateParentAdditional(); - return TAZ; -} - - -GNEAdditional* -GNEAdditionalHandler::buildTAZSource(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double departWeight) { - GNEAdditional* TAZSink = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (auto i : TAZ->getChildAdditionals()) { - if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSink = i; - } - } - // 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); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSINK)); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(TAZSink); - TAZSink->incRef("buildTAZSource"); - } - } - // now check check if TAZSource exist - GNEAdditional* TAZSource = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (auto i : TAZ->getChildAdditionals()) { - if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSource = i; - } - } - // check if TAZSource has to be created - if (TAZSource == nullptr) { - // Create TAZ only with departWeight - TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, departWeight); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSOURCE)); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(TAZSource); - TAZSource->incRef("buildTAZSource"); - } - } else { - // update TAZ Attribute - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("update " + toString(SUMO_TAG_TAZSOURCE)); - TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), viewNet->getUndoList()); - viewNet->getUndoList()->p_end(); - } else { - TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), nullptr); - TAZSource->incRef("buildTAZSource"); - } - } - return TAZSource; -} - - -GNEAdditional* -GNEAdditionalHandler::buildTAZSink(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double arrivalWeight) { - GNEAdditional* TAZSource = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (auto i : TAZ->getChildAdditionals()) { - if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSource = i; - } - } - // check if TAZSource has to be created - if (TAZSource == nullptr) { - // Create TAZ with empty value - TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSOURCE)); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(TAZSource); - TAZSource->incRef("buildTAZSink"); - } - } - GNEAdditional* TAZSink = nullptr; - // first check if a TAZSink in the same edge for the same TAZ - for (auto i : TAZ->getChildAdditionals()) { - if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { - TAZSink = i; - } - } - // check if TAZSink has to be created - if (TAZSink == nullptr) { - // Create TAZ only with arrivalWeight - TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, arrivalWeight); - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSINK)); - viewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertAdditional(TAZSink); - TAZSink->incRef("buildTAZSink"); - } - } else { - // update TAZ Attribute - if (allowUndoRedo) { - viewNet->getUndoList()->p_begin("update " + toString(SUMO_TAG_TAZSINK)); - TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), viewNet->getUndoList()); - viewNet->getUndoList()->p_end(); - } else { - TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), nullptr); - TAZSink->incRef("buildTAZSink"); - } - } - return TAZSink; -} - - -double -GNEAdditionalHandler::getPosition(double pos, GNELane& lane, bool friendlyPos, const std::string& additionalID) { - if (pos < 0) { - pos = lane.getLaneShapeLength() + pos; - } - if (pos > lane.getLaneShapeLength()) { - if (friendlyPos) { - pos = lane.getLaneShapeLength() - (double) 0.1; - } else { - WRITE_WARNING("The position of additional '" + additionalID + "' lies beyond the lane's '" + lane.getID() + "' length."); - } - } - return pos; -} - - -bool GNEAdditionalHandler::checkAndFixDetectorPosition(double& pos, const double laneLength, const bool friendlyPos) { - if (fabs(pos) > laneLength) { - if (!friendlyPos) { - return false; - } else if (pos < 0) { - pos = 0; - } else if (pos > laneLength) { - pos = laneLength - 0.01; - } - } - return true; -} - - -bool GNEAdditionalHandler::fixE2DetectorPosition(double& pos, double& length, const double laneLength, const bool friendlyPos) { - if ((pos < 0) || ((pos + length) > laneLength)) { - if (!friendlyPos) { - return false; - } else if (pos < 0) { - pos = 0; - } else if (pos > laneLength) { - pos = laneLength - 0.01; - length = 0; - } else if ((pos + length) > laneLength) { - length = laneLength - pos - 0.01; - } - } - return true; -} - - -bool -GNEAdditionalHandler::accessCanBeCreated(GNEAdditional* busStopParent, GNEEdge* edge) { - // check that busStopParent is a busStop - assert(busStopParent->getTagProperty().getTag() == SUMO_TAG_BUS_STOP); - // check if exist another acces for the same busStop in the given edge - for (auto i : busStopParent->getChildAdditionals()) { - for (auto j : edge->getLanes()) { - if (i->getAttribute(SUMO_ATTR_LANE) == j->getID()) { - return false; - } - } - } - return true; -} - - -bool -GNEAdditionalHandler::checkOverlappingRerouterIntervals(GNEAdditional* rerouter, SUMOTime newBegin, SUMOTime newEnd) { - // check that rerouter is correct - assert(rerouter->getTagProperty().getTag() == SUMO_TAG_REROUTER); - // declare a vector to keep sorted rerouter children - std::vector> sortedIntervals; - // iterate over child additional - for (auto i : rerouter->getChildAdditionals()) { - sortedIntervals.push_back(std::make_pair((SUMOTime)0., (SUMOTime)0.)); - // set begin and end - sortedIntervals.back().first = TIME2STEPS(i->getAttributeDouble(SUMO_ATTR_BEGIN)); - sortedIntervals.back().second = TIME2STEPS(i->getAttributeDouble(SUMO_ATTR_END)); - } - // add new intervals - sortedIntervals.push_back(std::make_pair(newBegin, newEnd)); - // sort children - std::sort(sortedIntervals.begin(), sortedIntervals.end()); - // check overlapping after sorting - for (int i = 0; i < (int)sortedIntervals.size() - 1; i++) { - if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) { - return false; - } - } - return true; -} - - - - -bool -GNEAdditionalHandler::parseAndBuildVaporizer(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Vaporizer - const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_ID, abort); - SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_BEGIN, abort); - SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_END, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_NAME, abort); - // extra check for center element after creation - bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); - // Continue if all parameters were successfully loaded - if (!abort) { - // get GNEEdge - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - // check that all parameters are valid - if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_VAPORIZER) + " is not known."); - } else if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_VAPORIZER, edgeID, false) != nullptr) { - WRITE_WARNING("There is already a " + toString(SUMO_TAG_VAPORIZER) + " in the edge '" + edgeID + "'."); - } else if (begin > end) { - WRITE_WARNING("Time interval of " + toString(SUMO_TAG_VAPORIZER) + " isn't valid. Attribute '" + toString(SUMO_ATTR_BEGIN) + "' is greater than attribute '" + toString(SUMO_ATTR_END) + "'."); - } else { - // build vaporizer - GNEAdditional* additionalCreated = buildVaporizer(viewNet, allowUndoRedo, edge, begin, end, name, centerAfterCreation); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildTAZ(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Vaporizer - const std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZ, SUMO_ATTR_ID, abort); - const PositionVector shape = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, SUMO_ATTR_SHAPE, abort); - RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, SUMO_ATTR_COLOR, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // check edges - std::vector edgeIDs; - if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { - std::string parsedAttribute = attrs.get(SUMO_ATTR_EDGES, id.c_str(), abort, false); - edgeIDs = GNEAttributeCarrier::parse >(parsedAttribute); - } - // check if all edge IDs are valid - std::vector edges; - for (auto i : edgeIDs) { - GNEEdge* edge = viewNet->getNet()->retrieveEdge(i, false); - if (edge == nullptr) { - WRITE_WARNING("Invalid " + toString(SUMO_TAG_EDGE) + " with ID = '" + i + "' within taz '" + id + "'."); - abort = true; - } else { - edges.push_back(edge); - } - } - // Continue if all parameters were successfully loaded - if (!abort) { - // check that all parameters are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_TAZ, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_TAZ) + " with the same ID='" + id + "'."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildTAZ(viewNet, allowUndoRedo, id, shape, color, edges, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildTAZSource(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Vaporizer - const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZSOURCE, SUMO_ATTR_ID, abort); - const double departWeight = GNEAttributeCarrier::parseAttributeFromXML(attrs, edgeID, SUMO_TAG_TAZSOURCE, SUMO_ATTR_WEIGHT, abort); - // Continue if all parameters were successfully loaded - if (!abort) { - // get edge and TAZ - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - GNEAdditional* TAZ = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - TAZ = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_TAZ); - } else { - bool ok = true; - TAZ = viewNet->getNet()->retrieveAdditional(SUMO_TAG_TAZ, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_TAZSOURCE) + " is not known."); - } else if (TAZ == nullptr) { - WRITE_WARNING("A " + toString(SUMO_TAG_TAZSOURCE) + " must be declared within the definition of a " + toString(SUMO_TAG_TAZ) + "."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildTAZSource(viewNet, allowUndoRedo, TAZ, edge, departWeight); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildTAZSink(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Vaporizer - const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZSINK, SUMO_ATTR_ID, abort); - const double arrivalWeight = GNEAttributeCarrier::parseAttributeFromXML(attrs, edgeID, SUMO_TAG_TAZSINK, SUMO_ATTR_WEIGHT, abort); - // Continue if all parameters were successfully loaded - if (!abort) { - // get edge and TAZ - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - GNEAdditional* TAZ = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - TAZ = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_TAZ); - } else { - bool ok = true; - TAZ = viewNet->getNet()->retrieveAdditional(SUMO_TAG_TAZ, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_TAZSINK) + " is not known."); - } else if (TAZ == nullptr) { - WRITE_WARNING("A " + toString(SUMO_TAG_TAZSINK) + " must be declared within the definition of a " + toString(SUMO_TAG_TAZ) + "."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildTAZSink(viewNet, allowUndoRedo, TAZ, edge, arrivalWeight); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRouteProbe(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of RouteProbe - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTEPROBE, SUMO_ATTR_ID, abort); - std::string edgeId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_EDGE, abort); - std::string freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_FREQUENCY, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_NAME, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_FILE, abort); - SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_BEGIN, abort); - // extra check for center element after creation - bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get edge - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeId, false); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_ROUTEPROBE, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_ROUTEPROBE) + " with the same ID='" + id + "'."); - } else if (edge == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The edge '" + edgeId + "' to use within the " + toString(SUMO_TAG_ROUTEPROBE) + " '" + id + "' is not known."); - } else { - // Freq needs an extra check, because it can be empty - if (GNEAttributeCarrier::canParse(freq)) { - if (GNEAttributeCarrier::parse(freq) < 0) { - WRITE_WARNING(toString(SUMO_ATTR_FREQUENCY) + "of " + toString(SUMO_TAG_ROUTEPROBE) + "'" + id + "' cannot be negative."); - freq = ""; - } - } else { - if (freq.empty()) { - WRITE_WARNING(toString(SUMO_ATTR_FREQUENCY) + "of " + toString(SUMO_TAG_ROUTEPROBE) + "'" + id + "' cannot be parsed to float."); - } - freq = ""; - } - // save ID of last created element - GNEAdditional* additionalCreated = buildRouteProbe(viewNet, allowUndoRedo, id, edge, freq, name, file, begin, centerAfterCreation); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildCalibratorFlow(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of calibrator flows - std::string vehicleTypeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_TYPE, abort); - std::string routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ROUTE, abort); - std::string vehsPerHour = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_VEHSPERHOUR, abort); - std::string speed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_SPEED, abort); - RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_COLOR, abort); - std::string departLane = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTLANE, abort); - std::string departPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTPOS, abort); - std::string departSpeed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTSPEED, abort); - std::string arrivalLane = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALLANE, abort); - std::string arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALPOS, abort); - std::string arrivalSpeed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALSPEED, abort); - std::string line = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_LINE, abort); - int personNumber = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_PERSON_NUMBER, abort); - int containerNumber = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_CONTAINER_NUMBER, abort); - bool reroute = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_REROUTE, abort); - std::string departPosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTPOS_LAT, abort); - std::string arrivalPosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALPOS_LAT, abort); - SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_BEGIN, abort); - SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_END, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain route, vehicle type and calibrator parent - GNEDemandElement* route = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, routeID, false); - GNEDemandElement* vtype = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleTypeID, false); - GNEAdditional* calibrator = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - calibrator = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_CALIBRATOR); - } else { - bool ok = true; - calibrator = viewNet->getNet()->retrieveAdditional(SUMO_TAG_CALIBRATOR, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (route == nullptr) { - WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; their " + toString(SUMO_TAG_ROUTE) + " with ID = '" + routeID + "' doesn't exist"); - abort = true; - } else if (vtype == nullptr) { - WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; their " + toString(SUMO_TAG_VTYPE) + " with ID = '" + vehicleTypeID + "' doesn't exist"); - abort = true; - } else if ((vehsPerHour.empty()) && (speed.empty())) { - WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; At least parameters " + toString(SUMO_ATTR_VEHSPERHOUR) + " or " + toString(SUMO_ATTR_SPEED) + " has to be defined"); - abort = true; - } else if (calibrator != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildCalibratorFlow(viewNet, allowUndoRedo, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed, - line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -void -GNEAdditionalHandler::parseAndBuildPoly(const SUMOSAXAttributes& attrs) { - bool abort = false; - // parse attributes of polygons - std::string polygonID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POLY, SUMO_ATTR_ID, abort); - PositionVector shape = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_SHAPE, abort); - double layer = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_LAYER, abort); - bool fill = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POLY, SUMO_ATTR_FILL, abort); - double lineWidth = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_LINEWIDTH, abort); - std::string type = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_TYPE, abort); - RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_COLOR, abort); - double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_ANGLE, abort); - std::string imgFile = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_IMGFILE, abort); - bool relativePath = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_RELATIVEPATH, abort); - // check if ID is valid - if (SUMOXMLDefinitions::isValidTypeID(polygonID) == false) { - WRITE_WARNING("Invalid characters for polygon ID"); - abort = true; - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // check if shape must be loaded as geo attribute - bool geo = false; - const GeoConvHelper* gch = myGeoConvHelper != nullptr ? myGeoConvHelper : &GeoConvHelper::getFinal(); - if (attrs.getOpt(SUMO_ATTR_GEO, polygonID.c_str(), abort, false)) { - geo = true; - bool success = true; - for (int i = 0; i < (int)shape.size(); i++) { - success &= gch->x2cartesian_const(shape[i]); - } - if (!success) { - WRITE_WARNING("Unable to project coordinates for polygon '" + polygonID + "'."); - return; - } - } - // check if img file is absolute - if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { - imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); - } - // create polygon, or show an error if polygon already exists - if (!myShapeContainer.addPolygon(polygonID, type, color, layer, angle, imgFile, relativePath, shape, geo, fill, lineWidth, false)) { - WRITE_WARNING("Polygon with ID '" + polygonID + "' already exists."); - } else { - // update myLastParameterised with the last inserted Polygon - myLastParameterised = myShapeContainer.getPolygons().get(polygonID); - } - } -} - - -bool -GNEAdditionalHandler::parseAndBuildVariableSpeedSign(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of VSS - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VSS, SUMO_ATTR_ID, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_NAME, abort); - GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_FILE, abort); // deprecated - std::string lanesIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_LANES, abort); - Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_POSITION, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain lanes - std::vector lanes; - if (GNEAttributeCarrier::canParse >(viewNet->getNet(), lanesIDs, true)) { - lanes = GNEAttributeCarrier::parse >(viewNet->getNet(), lanesIDs); - } - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_VSS, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_VSS) + " with the same ID='" + id + "'."); - } else if (lanes.size() == 0) { - WRITE_WARNING("A Variable Speed Sign needs at least one lane."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildVariableSpeedSign(viewNet, allowUndoRedo, id, pos, lanes, name, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildVariableSpeedSignStep(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // Load step values - double time = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_STEP, SUMO_ATTR_TIME, abort); - double speed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_STEP, SUMO_ATTR_SPEED, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get Variable Speed Signal - GNEAdditional* variableSpeedSign = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - variableSpeedSign = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_VSS); - } else { - bool ok = true; - variableSpeedSign = viewNet->getNet()->retrieveAdditional(SUMO_TAG_VSS, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (variableSpeedSign != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildVariableSpeedSignStep(viewNet, allowUndoRedo, variableSpeedSign, time, speed); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouter(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_REROUTER, SUMO_ATTR_ID, abort); - std::string edgesIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_EDGES, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_NAME, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_FILE, abort); - double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_PROB, abort); - bool off = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_OFF, abort); - SUMOTime timeThreshold = attrs.getOptSUMOTimeReporting(SUMO_ATTR_HALTING_TIME_THRESHOLD, id.c_str(), abort, 0); - const std::string vTypes = attrs.getOpt(SUMO_ATTR_VTYPES, id.c_str(), abort, ""); - Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_POSITION, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain edges - std::vector edges; - if (GNEAttributeCarrier::canParse >(viewNet->getNet(), edgesIDs, true)) { - edges = GNEAttributeCarrier::parse >(viewNet->getNet(), edgesIDs); - } - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_REROUTER, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_REROUTER) + " with the same ID='" + id + "'."); - } else if (edges.size() == 0) { - WRITE_WARNING("A rerouter needs at least one Edge"); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildRerouter(viewNet, allowUndoRedo, id, pos, edges, probability, name, - file, off, timeThreshold, vTypes, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterInterval(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INTERVAL, SUMO_ATTR_BEGIN, abort); - SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INTERVAL, SUMO_ATTR_END, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain rerouter - GNEAdditional* rerouter; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouter = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_REROUTER); - } else { - bool ok = true; - rerouter = viewNet->getNet()->retrieveAdditional(SUMO_TAG_REROUTER, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // special case for load multiple intervals in the same rerouter - if (rerouter == nullptr) { - GNEAdditional* lastInsertedRerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - lastInsertedRerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - lastInsertedRerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - if (lastInsertedRerouterInterval) { - rerouter = lastInsertedRerouterInterval->getParentAdditionals().at(0); - } - } - // check that rerouterInterval can be created - if (begin >= end) { - WRITE_WARNING(toString(SUMO_TAG_INTERVAL) + " cannot be created; Attribute " + toString(SUMO_ATTR_END) + " must be greather than " + toString(SUMO_ATTR_BEGIN) + "."); - } else if (rerouter != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildRerouterInterval(viewNet, allowUndoRedo, rerouter, begin, end); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterClosingLaneReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string laneID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_ID, abort); - std::string allow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_ALLOW, abort); - std::string disallow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_DISALLOW, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain lane and rerouter interval - GNELane* lane = viewNet->getNet()->retrieveLane(laneID, false, true); - GNEAdditional* rerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - rerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (lane == nullptr) { - WRITE_WARNING("The lane '" + laneID + "' to use within the " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + " is not known."); - } else if (rerouterInterval != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildClosingLaneReroute(viewNet, allowUndoRedo, rerouterInterval, lane, parseVehicleClasses(allow, disallow)); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterClosingReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_ID, abort); - std::string allow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_ALLOW, abort); - std::string disallow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_DISALLOW, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain edge and rerouter interval - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - GNEAdditional* rerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - rerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_CLOSING_REROUTE) + " is not known."); - } else if (rerouterInterval != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildClosingReroute(viewNet, allowUndoRedo, rerouterInterval, edge, parseVehicleClasses(allow, disallow)); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterDestProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DEST_PROB_REROUTE, SUMO_ATTR_ID, abort); - double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DEST_PROB_REROUTE, SUMO_ATTR_PROB, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain edge and rerouter interval - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - GNEAdditional* rerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - rerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_DEST_PROB_REROUTE) + " is not known."); - } else if (rerouterInterval != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = builDestProbReroute(viewNet, allowUndoRedo, rerouterInterval, edge, probability); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterParkingAreaReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string parkingAreaID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_ID, abort); - double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_PROB, abort); - bool visible = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_VISIBLE, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain edge and rerouter interval - GNEAdditional* parkingArea = viewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, parkingAreaID, false); - GNEAdditional* rerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - rerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (parkingArea == nullptr) { - WRITE_WARNING("The parkingArea '" + parkingAreaID + "' to use within the " + toString(SUMO_TAG_PARKING_ZONE_REROUTE) + " is not known."); - } else if (rerouterInterval != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = builParkingAreaReroute(viewNet, allowUndoRedo, rerouterInterval, parkingArea, probability, visible); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildRerouterRouteProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Rerouter - std::string routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE_PROB_REROUTE, SUMO_ATTR_ID, abort); - double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE_PROB_REROUTE, SUMO_ATTR_PROB, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // obtain rerouter interval - GNEAdditional* rerouterInterval = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - rerouterInterval = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_INTERVAL); - } else { - bool ok = true; - rerouterInterval = viewNet->getNet()->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all elements are valid - if (rerouterInterval != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildRouteProbReroute(viewNet, allowUndoRedo, rerouterInterval, routeID, probability); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildBusStop(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of bus stop - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_BUS_STOP, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_LANE, abort); - std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_STARTPOS, abort); - std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_ENDPOS, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_NAME, abort); - std::vector lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_LINES, abort); - const int personCapacity = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_PERSON_CAPACITY, abort); - bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_BUS_STOP) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_BUS_STOP) + " '" + id + "' is not known."); - } else { - // declare variables for start and end position - double startPosDouble = 0; - double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - const double stoppingPlaceLength = (endPosDouble - startPosDouble); - int parametersSet = 0; - // check if startPos and endPos were defined - if (GNEAttributeCarrier::canParse(startPos)) { - startPosDouble = GNEAttributeCarrier::parse(startPos); - parametersSet |= STOPPINGPLACE_STARTPOS_SET; - } - if (GNEAttributeCarrier::canParse(endPos)) { - endPosDouble = GNEAttributeCarrier::parse(endPos); - parametersSet |= STOPPINGPLACE_ENDPOS_SET; - } - // check if stoppingPlace has to be adjusted - SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); - // update start and end positions depending of checkStopPosResult - if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { - startPosDouble = 0; - endPosDouble = stoppingPlaceLength; - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { - startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; - endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { - // Write error if position isn't valid - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_BUS_STOP) + " with ID = '" + id + "'."); - return false; - } - // save ID of last created element - GNEAdditional* additionalCreated = buildBusStop(viewNet, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, - name, lines, personCapacity, friendlyPosition, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildContainerStop(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of container stop - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_LANE, abort); - std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_STARTPOS, abort); - std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_ENDPOS, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_NAME, abort); - std::vector lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_LINES, abort); - bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_CONTAINER_STOP) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CONTAINER_STOP) + " '" + id + "' is not known."); - } else { - // declare variables for start and end position - double startPosDouble = 0; - double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - const double stoppingPlaceLength = (endPosDouble - startPosDouble); - int parametersSet = 0; - // check if startPos and endPos were defined - if (GNEAttributeCarrier::canParse(startPos)) { - startPosDouble = GNEAttributeCarrier::parse(startPos); - parametersSet |= STOPPINGPLACE_STARTPOS_SET; - } - if (GNEAttributeCarrier::canParse(endPos)) { - endPosDouble = GNEAttributeCarrier::parse(endPos); - parametersSet |= STOPPINGPLACE_ENDPOS_SET; - } - // check if stoppingPlace has to be adjusted - SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); - // update start and end positions depending of checkStopPosResult - if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { - startPosDouble = 0; - endPosDouble = stoppingPlaceLength; - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { - startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; - endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { - // Write error if position isn't valid - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_CONTAINER_STOP) + " with ID = '" + id + "'."); - return false; - } - // save ID of last created element - GNEAdditional* additionalCreated = buildContainerStop(viewNet, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, - name, lines, friendlyPosition, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildAccess(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Entry - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_LANE, abort); - std::string position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_POSITION, abort); - std::string length = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_LENGTH, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Check if parsing of parameters was correct - if (!abort) { - double posDouble = GNEAttributeCarrier::parse(position); - // get lane and busStop parent - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - GNEAdditional* busStop = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - busStop = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_BUS_STOP); - } else { - bool ok = true; - busStop = viewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (lane == nullptr) { - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_ACCESS) + " is not known."); - } else if (busStop == nullptr) { - WRITE_WARNING("A " + toString(SUMO_TAG_ACCESS) + " must be declared within the definition of a " + toString(SUMO_TAG_BUS_STOP) + "."); - } else if (!checkAndFixDetectorPosition(posDouble, lane->getLaneShapeLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_ACCESS) + "."); - } else if (!accessCanBeCreated(busStop, lane->getParentEdge())) { - WRITE_WARNING("Edge '" + lane->getParentEdge()->getID() + "' already has an Access for busStop '" + busStop->getID() + "'"); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildAccess(viewNet, allowUndoRedo, busStop, lane, posDouble, length, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildChargingStation(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of charging station - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CHARGING_STATION, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_LANE, abort); - std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_STARTPOS, abort); - std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_ENDPOS, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_NAME, abort); - double chargingPower = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGINGPOWER, abort); - double efficiency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_EFFICIENCY, abort); - bool chargeInTransit = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGEINTRANSIT, abort); - SUMOTime chargeDelay = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGEDELAY, abort); - bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_CHARGING_STATION) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CHARGING_STATION) + " '" + id + "' is not known."); - } else { - // declare variables for start and end position - double startPosDouble = 0; - double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - const double stoppingPlaceLength = (endPosDouble - startPosDouble); - int parametersSet = 0; - // check if startPos and endPos were defined - if (GNEAttributeCarrier::canParse(startPos)) { - startPosDouble = GNEAttributeCarrier::parse(startPos); - parametersSet |= STOPPINGPLACE_STARTPOS_SET; - } - if (GNEAttributeCarrier::canParse(endPos)) { - endPosDouble = GNEAttributeCarrier::parse(endPos); - parametersSet |= STOPPINGPLACE_ENDPOS_SET; - } - // check if stoppingPlace has to be adjusted - SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); - // update start and end positions depending of checkStopPosResult - if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { - startPosDouble = 0; - endPosDouble = stoppingPlaceLength; - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { - startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; - endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { - // Write error if position isn't valid - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_CHARGING_STATION) + " with ID = '" + id + "'."); - return false; - } - // save ID of last created element - GNEAdditional* additionalCreated = buildChargingStation(viewNet, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, - name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildParkingArea(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of charging station - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_AREA, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_LANE, abort); - std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_STARTPOS, abort); - std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ENDPOS, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_NAME, abort); - bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_FRIENDLY_POS, abort); - int roadSideCapacity = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ROADSIDE_CAPACITY, abort); - bool onRoad = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ONROAD, abort); - double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_WIDTH, abort); - std::string length = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_LENGTH, abort); - double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ANGLE, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_PARKING_AREA) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_PARKING_AREA) + " '" + id + "' is not known."); - } else { - // declare variables for start and end position - double startPosDouble = 0; - double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - const double stoppingPlaceLength = (endPosDouble - startPosDouble); - int parametersSet = 0; - // check if startPos and endPos were defined - if (GNEAttributeCarrier::canParse(startPos)) { - startPosDouble = GNEAttributeCarrier::parse(startPos); - parametersSet |= STOPPINGPLACE_STARTPOS_SET; - } - if (GNEAttributeCarrier::canParse(endPos)) { - endPosDouble = GNEAttributeCarrier::parse(endPos); - parametersSet |= STOPPINGPLACE_ENDPOS_SET; - } - // check if stoppingPlace has to be adjusted - SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); - // update start and end positions depending of checkStopPosResult - if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { - startPosDouble = 0; - endPosDouble = stoppingPlaceLength; - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { - startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; - endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); - } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { - // Write error if position isn't valid - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_PARKING_AREA) + " with ID = '" + id + "'."); - return false; - } - // save ID of last created element - GNEAdditional* additionalCreated = buildParkingArea(viewNet, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, - name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildParkingSpace(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Parking Spaces - Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_POSITION, abort); - double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_WIDTH, abort); - double length = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_LENGTH, abort); - double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_ANGLE, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get Parking Area Parent - GNEAdditional* parkingAreaParent = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - parkingAreaParent = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_PARKING_AREA); - } else { - bool ok = true; - parkingAreaParent = viewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that Parking Area Parent exists - if (parkingAreaParent != nullptr) { - // save ID of last created element - GNEAdditional* additionalCreated = buildParkingSpace(viewNet, allowUndoRedo, parkingAreaParent, pos, width, length, angle, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // due there is two differents calibrators, has to be parsed in a different way - std::string edgeID, laneId, id; - // change tag depending of XML parmeters - if (attrs.hasAttribute(SUMO_ATTR_EDGE)) { - id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CALIBRATOR, SUMO_ATTR_ID, abort); - edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_EDGE, abort); - std::string outfile = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_OUTPUT, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_POSITION, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_NAME, abort); - SUMOTime freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_FREQUENCY, abort); - std::string routeProbe = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_ROUTEPROBE, abort); - // extra check for center element after creation - bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer and edge - GNEEdge* edge = viewNet->getNet()->retrieveEdge(edgeID, false); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_CALIBRATOR) + " with the same ID='" + id + "'."); - } else if (edge == nullptr) { - WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_CALIBRATOR) + " '" + id + "' is not known."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildCalibrator(viewNet, allowUndoRedo, id, edge, position, name, outfile, freq, routeProbe, centerAfterCreation); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - } else if (attrs.hasAttribute(SUMO_ATTR_LANE)) { - id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_ID, abort); - laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_LANE, abort); - std::string outfile = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_OUTPUT, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_POSITION, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_NAME, abort); - SUMOTime freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_FREQUENCY, abort); - std::string routeProbe = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_ROUTEPROBE, abort); - // extra check for center element after creation - bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_LANECALIBRATOR, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_CALIBRATOR) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CALIBRATOR) + " '" + id + "' is not known."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildCalibrator(viewNet, allowUndoRedo, id, lane, position, name, outfile, freq, routeProbe, centerAfterCreation); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - } else { - WRITE_WARNING("additional " + toString(SUMO_TAG_CALIBRATOR) + " must have either a lane or an edge attribute."); - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorE1(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of E1 - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_E1DETECTOR, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_LANE, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_POSITION, abort); - SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FREQUENCY, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FILE, abort); - std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_VTYPES, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_NAME, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E1DETECTOR, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_E1DETECTOR) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_E1DETECTOR) + " '" + id + "' is not known."); - } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_E1DETECTOR) + " with ID = '" + id + "'."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildDetectorE1(viewNet, allowUndoRedo, id, lane, position, frequency, file, vehicleTypes, name, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - // Tag E2 detectors can build either E2 single lanes or E2 multilanes, depending of attribute "lanes" - SumoXMLTag E2Tag = attrs.hasAttribute(SUMO_ATTR_LANES) ? SUMO_TAG_E2DETECTOR_MULTILANE : SUMO_TAG_E2DETECTOR; - bool abort = false; - // start parsing ID - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", E2Tag, SUMO_ATTR_ID, abort); - // parse attributes of E2 SingleLanes - std::string laneId = (E2Tag == SUMO_TAG_E2DETECTOR) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LANE, abort) : ""; - double length = (E2Tag == SUMO_TAG_E2DETECTOR) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LENGTH, abort) : 0; - // parse attributes of E2 Multilanes - std::string laneIds = (E2Tag == SUMO_TAG_E2DETECTOR_MULTILANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LANES, abort) : ""; - double endPos = (E2Tag == SUMO_TAG_E2DETECTOR_MULTILANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_ENDPOS, abort) : 0; - // parse common attributes - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_POSITION, abort); - SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FREQUENCY, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FILE, abort); - std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_VTYPES, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_NAME, abort); - SUMOTime haltingTimeThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_HALTING_TIME_THRESHOLD, abort); - double haltingSpeedThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_HALTING_SPEED_THRESHOLD, abort); - double jamDistThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_JAM_DIST_THRESHOLD, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // cont attribute is deprecated - GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_CONT, abort); - // Continue if all parameters were sucesfully loaded - if (!abort) { - // check if at leas lane or laneIDS are defined - if (laneId.empty() && laneIds.empty()) { - WRITE_WARNING("A " + toString(E2Tag) + " needs at least a lane or a list of lanes."); - } else { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // get list of lanes - std::vector lanes; - bool laneConsecutives = true; - if (GNEAttributeCarrier::canParse >(viewNet->getNet(), laneIds, false)) { - lanes = GNEAttributeCarrier::parse >(viewNet->getNet(), laneIds); - // check if lanes are consecutives - laneConsecutives = GNEAttributeCarrier::lanesConsecutives(lanes); - } - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(E2Tag, id, false) != nullptr) { - // write error if neither lane nor lane aren't defined - WRITE_WARNING("There is another " + toString(E2Tag) + " with the same ID='" + id + "'."); - } else if (attrs.hasAttribute(SUMO_ATTR_LANE) && (lane == nullptr)) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(E2Tag) + " '" + id + "' is not known."); - } else if (attrs.hasAttribute(SUMO_ATTR_LANES) && lanes.empty()) { - // Write error if lane isn't valid - WRITE_WARNING("The list of lanes cannot be empty."); - } else if (attrs.hasAttribute(SUMO_ATTR_LANES) && lanes.empty()) { - // Write error if lane isn't valid - WRITE_WARNING("The list of lanes '" + laneIds + "' to use within the " + toString(E2Tag) + " '" + id + "' isn't valid."); - } else if (!lanes.empty() && !laneConsecutives) { - WRITE_WARNING("The lanes '" + laneIds + "' to use within the " + toString(E2Tag) + " '" + id + "' aren't consecutives."); - } else if (lane && !fixE2DetectorPosition(position, length, lane->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(E2Tag) + " with ID = '" + id + "'."); - } else if (!lanes.empty() && !fixE2DetectorPosition(position, length, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(E2Tag) + " with ID = '" + id + "'."); - } else if (!lanes.empty() && !fixE2DetectorPosition(endPos, length, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { - WRITE_WARNING("Invalid end position for " + toString(E2Tag) + " with ID = '" + id + "'."); - } else if (lane) { - // save ID of last created element - GNEAdditional* additionalCreated = buildSingleLaneDetectorE2(viewNet, allowUndoRedo, id, lane, position, length, frequency, file, vehicleTypes, - name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildMultiLaneDetectorE2(viewNet, allowUndoRedo, id, lanes, position, endPos, frequency, file, vehicleTypes, - name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorE3(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of E3 - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_E3DETECTOR, SUMO_ATTR_ID, abort); - SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_FREQUENCY, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_FILE, abort); - std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_VTYPES, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_NAME, abort); - SUMOTime haltingTimeThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_HALTING_TIME_THRESHOLD, abort); - double haltingSpeedThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_HALTING_SPEED_THRESHOLD, abort); - Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_POSITION, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_E3DETECTOR) + " with the same ID='" + id + "'."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildDetectorE3(viewNet, allowUndoRedo, id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorEntry(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Entry - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_LANE, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_POSITION, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Check if parsing of parameters was correct - if (!abort) { - // get lane and E3 parent - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - GNEAdditional* E3Parent = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - E3Parent = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_E3DETECTOR); - } else { - bool ok = true; - E3Parent = viewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (lane == nullptr) { - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_DET_ENTRY) + " is not known."); - } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_DET_ENTRY) + "."); - } else if (E3Parent) { - // save ID of last created element - GNEAdditional* additionalCreated = buildDetectorEntry(viewNet, allowUndoRedo, E3Parent, lane, position, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorExit(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of Exit - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_LANE, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_POSITION, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Check if parsing of parameters was correct - if (!abort) { - // get lane and E3 parent - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - GNEAdditional* E3Parent = nullptr; - // obtain parent depending if we're loading or creating it using GNEAdditionalFrame - if (insertedAdditionals) { - E3Parent = insertedAdditionals->retrieveParentAdditional(viewNet, SUMO_TAG_E3DETECTOR); - } else { - bool ok = true; - E3Parent = viewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, attrs.get(GNE_ATTR_PARENT, "", ok)); - } - // check that all parameters are valid - if (lane == nullptr) { - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_DET_EXIT) + " is not known."); - } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_DET_EXIT) + "."); - } else if (E3Parent) { - // save ID of last created element - GNEAdditional* additionalCreated = buildDetectorExit(viewNet, allowUndoRedo, E3Parent, lane, position, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - - -bool -GNEAdditionalHandler::parseAndBuildDetectorE1Instant(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals) { - bool abort = false; - // parse attributes of E1Instant - std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_ID, abort); - std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_LANE, abort); - double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_POSITION, abort); - std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_FILE, abort); - std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_VTYPES, abort); - std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_NAME, abort); - bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_FRIENDLY_POS, abort); - // parse Netedit attributes - bool blockMovement = false; - if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { - blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, GNE_ATTR_BLOCK_MOVEMENT, abort); - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // get pointer to lane - GNELane* lane = viewNet->getNet()->retrieveLane(laneId, false, true); - // check that all elements are valid - if (viewNet->getNet()->retrieveAdditional(SUMO_TAG_INSTANT_INDUCTION_LOOP, id, false) != nullptr) { - WRITE_WARNING("There is another " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with the same ID='" + id + "'."); - } else if (lane == nullptr) { - // Write error if lane isn't valid - WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " '" + id + "' is not known."); - } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { - WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with ID = '" + id + "'."); - } else { - // save ID of last created element - GNEAdditional* additionalCreated = buildDetectorE1Instant(viewNet, allowUndoRedo, id, lane, position, file, vehicleTypes, name, friendlyPos, blockMovement); - // check if insertion has to be commited - if (insertedAdditionals) { - insertedAdditionals->commitElementInsertion(additionalCreated); - } - return true; - } - } - return false; -} - -// =========================================================================== -// private method definitions -// =========================================================================== - -void -GNEAdditionalHandler::parseAndBuildPOI(const SUMOSAXAttributes& attrs) { - bool abort = false; - // parse attributes of POIs - std::string POIID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POI, SUMO_ATTR_ID, abort); - // POIs can be defined using a X,Y position,... - Position pos = attrs.hasAttribute(SUMO_ATTR_X) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_POSITION, abort) : Position::INVALID; - // ... a Lon-Lat,... - double lon = attrs.hasAttribute(SUMO_ATTR_LON) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LON, abort) : GNEAttributeCarrier::INVALID_POSITION; - double lat = attrs.hasAttribute(SUMO_ATTR_LAT) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LAT, abort) : GNEAttributeCarrier::INVALID_POSITION; - // .. or as Lane-PosLane - std::string laneID = attrs.hasAttribute(SUMO_ATTR_LANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_LANE, abort) : ""; - double lanePos = attrs.hasAttribute(SUMO_ATTR_POSITION) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_POSITION, abort) : GNEAttributeCarrier::INVALID_POSITION; - double lanePosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_POSITION_LAT, abort); - // continue with common parameters - double layer = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LAYER, abort); - std::string type = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_TYPE, abort); - RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_COLOR, abort); - double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_ANGLE, abort); - std::string imgFile = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_IMGFILE, abort); - bool relativePath = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_RELATIVEPATH, abort); - double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_WIDTH, abort); - double height = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_HEIGHT, abort); - // check if ID is valid - if (SUMOXMLDefinitions::isValidTypeID(POIID) == false) { - WRITE_WARNING("Invalid characters for POI ID"); - abort = true; - } - // Continue if all parameters were sucesfully loaded - if (!abort) { - // check if img file is absolute - if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { - imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); - } - // check if lane exist - if (laneID != "" && !myViewNet->getNet()->retrieveLane(laneID, false)) { - WRITE_WARNING("The lane '" + laneID + "' to use within the PoI '" + POIID + "' is not known."); - return; - } - // check position - bool useGeo = false; - // if position is invalid, then is either a POILane or a GEOPoi - if (pos == Position::INVALID) { - // try computing x,y from lane,pos - if (laneID != "") { - // if LaneID is defined, then is a POILane - pos = getLanePos(POIID, laneID, lanePos, lanePosLat); - } else { - // try computing x,y from lon,lat - if (lat == GNEAttributeCarrier::INVALID_POSITION || lon == GNEAttributeCarrier::INVALID_POSITION) { - WRITE_WARNING("Either (x, y), (lon, lat) or (lane, pos) must be specified for PoI '" + POIID + "'."); - return; - } else if (!GeoConvHelper::getFinal().usingGeoProjection()) { - WRITE_WARNING("(lon, lat) is specified for PoI '" + POIID + "' but no geo-conversion is specified for the network."); - return; - } - // set GEO Position - pos.set(lon, lat); - useGeo = true; - if (!GeoConvHelper::getFinal().x2cartesian_const(pos)) { - WRITE_WARNING("Unable to project coordinates for PoI '" + POIID + "'."); - return; - } - } - } - // create POI, or show an error if POI already exists - if (!myShapeContainer.addPOI(POIID, type, color, pos, useGeo, laneID, lanePos, lanePosLat, layer, angle, imgFile, relativePath, width, height, false)) { - WRITE_WARNING("POI with ID '" + POIID + "' already exists."); - } else { - // update myLastParameterised with the last inserted POI - myLastParameterised = myShapeContainer.getPOIs().get(POIID); - } - } -} - - -void -GNEAdditionalHandler::parseParameter(const SUMOSAXAttributes& attrs) { - // we have two cases: if we're parsing a Shape or we're parsing an Additional - if (getLastParameterised()) { - bool ok = true; - std::string key; - if (attrs.hasAttribute(SUMO_ATTR_KEY)) { - // obtain key - key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); - if (key.empty()) { - WRITE_WARNING("Error parsing key from shape parameter. Key cannot be empty"); - ok = false; - } - if (!SUMOXMLDefinitions::isValidTypeID(key)) { - WRITE_WARNING("Error parsing key from shape parameter. Key contains invalid characters"); - ok = false; - } - } else { - WRITE_WARNING("Error parsing key from shape parameter. Key doesn't exist"); - ok = false; - } - // circumventing empty string test - const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; - if (!SUMOXMLDefinitions::isValidAttribute(val)) { - WRITE_WARNING("Error parsing value from shape parameter. Value contains invalid characters"); - ok = false; - } - // set parameter in last inserted additional - if (ok) { - WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into shape."); - getLastParameterised()->setParameter(key, val); - } - } else if (myHierarchyInsertedAdditionals.getLastInsertedAdditional()) { - // first check if given additional supports parameters - if (myHierarchyInsertedAdditionals.getLastInsertedAdditional()->getTagProperty().hasParameters()) { - bool ok = true; - std::string key; - if (attrs.hasAttribute(SUMO_ATTR_KEY)) { - // obtain key - key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); - if (key.empty()) { - WRITE_WARNING("Error parsing key from additional parameter. Key cannot be empty"); - ok = false; - } - if (!SUMOXMLDefinitions::isValidTypeID(key)) { - WRITE_WARNING("Error parsing key from additional parameter. Key contains invalid characters"); - ok = false; - } - } else { - WRITE_WARNING("Error parsing key from additional parameter. Key doesn't exist"); - ok = false; - } - // circumventing empty string test - const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; - if (!SUMOXMLDefinitions::isValidAttribute(val)) { - WRITE_WARNING("Error parsing value from additional parameter. Value contains invalid characters"); - ok = false; - } - // set parameter in last inserted additional - if (ok) { - WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into additional " + myHierarchyInsertedAdditionals.getLastInsertedAdditional()->getTagStr() + "."); - myHierarchyInsertedAdditionals.getLastInsertedAdditional()->setParameter(key, val); - } - } else { - WRITE_WARNING("Additionals of type '" + myHierarchyInsertedAdditionals.getLastInsertedAdditional()->getTagStr() + "' doesn't support parameters"); - } - } else { - WRITE_WARNING("Parameters has to be declared within the definition of an additional or a shape element"); - } -} - -// =========================================================================== -// GNEAdditionalHandler::HierarchyInsertedAdditionals method definitions -// =========================================================================== - -void -GNEAdditionalHandler::HierarchyInsertedAdditionals::insertElement(SumoXMLTag tag) { - myInsertedElements.push_back(std::make_pair(tag, nullptr)); -} - - -void -GNEAdditionalHandler::HierarchyInsertedAdditionals::commitElementInsertion(GNEAdditional* additional) { - myInsertedElements.back().second = additional; -} - - -void -GNEAdditionalHandler::HierarchyInsertedAdditionals::popElement() { - if (!myInsertedElements.empty()) { - myInsertedElements.pop_back(); - } -} - - -GNEAdditional* -GNEAdditionalHandler::HierarchyInsertedAdditionals::retrieveParentAdditional(GNEViewNet* viewNet, SumoXMLTag expectedTag) const { - if (myInsertedElements.size() < 2) { - // currently we're finding parent additional in the additional XML root - WRITE_WARNING("A " + toString(myInsertedElements.back().first) + " must be declared within the definition of a " + toString(expectedTag) + "."); - return nullptr; - } else { - if (myInsertedElements.size() < 2) { - // additional was hierarchically bad loaded, then return nullptr - return nullptr; - } else if ((myInsertedElements.end() - 2)->second == nullptr) { - WRITE_WARNING(toString(expectedTag) + " parent of " + toString((myInsertedElements.end() - 1)->first) + " was not loaded sucesfully."); - // parent additional wasn't sucesfully loaded, then return nullptr - return nullptr; - } - GNEAdditional* retrievedAdditional = viewNet->getNet()->retrieveAdditional((myInsertedElements.end() - 2)->first, (myInsertedElements.end() - 2)->second->getID(), false); - if (retrievedAdditional == nullptr) { - // additional doesn't exist - WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->first) + " must be declared within the definition of a " + toString(expectedTag) + "."); - return nullptr; - } else if (retrievedAdditional->getTagProperty().getTag() != expectedTag) { - // invalid parent additional - WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->first) + " cannot be declared within the definition of a " + retrievedAdditional->getTagStr() + "."); - return nullptr; - } else { - return retrievedAdditional; - } - } -} - - -GNEAdditional* -GNEAdditionalHandler::HierarchyInsertedAdditionals::getLastInsertedAdditional() const { - // ierate in reverse mode over myInsertedElements to obtain last inserted additional - for (std::vector >::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) { - // we need to avoid Tag Param because isn't an additional - if (i->first != SUMO_TAG_PARAM) { - return i->second; - } - } - return nullptr; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEAdditionalHandler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,755 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditionalHandler.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// Builds additional objects for netedit -/****************************************************************************/ -#ifndef GNEAdditionalHandler_h -#define GNEAdditionalHandler_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEEdge; -class GNELane; -class GNEAdditional; -class GNEDemandElement; - -// =========================================================================== -// class definitions -// =========================================================================== - -/// @class GNEAdditionalHandler -/// @brief Builds additional objects for GNENet (busStops, chargingStations, detectors, etc..) -class GNEAdditionalHandler : public ShapeHandler { -public: - - /// @brief Stack used to save the last inserted element - struct HierarchyInsertedAdditionals { - - /// @brief insert new element (called only in function myStartElement) - void insertElement(SumoXMLTag tag); - - /// @brief commit element insertion (used to save last correct created element) - void commitElementInsertion(GNEAdditional* additionalCreated); - - /// @brief pop last inserted element (used only in function myEndElement) - void popElement(); - - /// @brief retrieve parent additional correspond to current status of myInsertedElements - GNEAdditional* retrieveParentAdditional(GNEViewNet* viewNet, SumoXMLTag expectedTag) const; - - /// @brief return last additional inserted - GNEAdditional* getLastInsertedAdditional() const; - - private: - /// @brief vector used as stack - std::vector > myInsertedElements; - }; - - /// @brief Constructor - GNEAdditionalHandler(const std::string& file, GNEViewNet* viewNet, GNEAdditional* additionalParent = nullptr); - - /// @brief Destructor - ~GNEAdditionalHandler(); - - /// @name inherited from ShapeHandler - /// @{ - /**@brief Called on the opening of a tag; - * @param[in] element ID of the currently opened element - * @param[in] attrs Attributes within the currently opened element - * @exception ProcessError If something fails - * @see GenericSAXHandler::myStartElement - */ - void myStartElement(int element, const SUMOSAXAttributes& attrs); - - /** @brief Called when a closing tag occurs - * @param[in] element ID of the currently opened element - * @exception ProcessError If something fails - * @see GenericSAXHandler::myEndElement - */ - void myEndElement(int element); - - /**@brief get lane position - * @param[in] poi poi ID - * @param[in] laneID lane ID - * @param[in] SlanePos position in the lane - */ - Position getLanePos(const std::string& poiID, const std::string& laneID, double lanePos, double lanePosLat); - /// @} - - /// @name building methods - /// - /// Called with parsed values, these methods build the additional. - /// @{ - /**@brief Build additionals - * @param[in] viewNet pointer to viewNet in wich additional will be created - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] tag tag of the additiona lto create - * @param[in] attrs SUMOSAXAttributes with attributes - * @param[in] HierarchyInsertedAdditionals pointer to HierarchyInsertedAdditionals (can be null) - * @return true if was sucesfully created, false in other case - */ - static bool buildAdditional(GNEViewNet* viewNet, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Builds a bus stop - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the bus stop - * @param[in] lane The lane the bus stop is placed on - * @param[in] startPos Begin position of the bus stop on the lane - * @param[in] endPos End position of the bus stop on the lane - * @param[in] name Name of busStop - * @param[in] lines Names of the bus lines that halt on this bus stop - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the bus stop can not be added to the net (is duplicate) - */ - static GNEAdditional* buildBusStop(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, int personCapacity, bool friendlyPosition, bool blockMovement); - - /**@brief Builds an Access - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] busStop GNEAdditional of this Access belongs - * @param[in] lane The lane the Access is placed on - * @param[in] pos position of the Access on the lane - * @param[in[ length length of the Access - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildAccess(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* busStop, GNELane* lane, double pos, const std::string& length, bool friendlyPos, bool blockMovement); - - /**@brief Builds a container stop - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the container stop - * @param[in] lane The lane the container stop is placed on - * @param[in] startPos Begin position of the container stop on the lane - * @param[in] endPos End position of the container stop on the lane - * @param[in] name Name of container stop - * @param[in] lines Names of the bus lines that halt on this container stop - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the container stop can not be added to the net (is duplicate) - */ - static GNEAdditional* buildContainerStop(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement); - - /**@brief Builds a charging Station - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the charging Station - * @param[in] lane The lane the charging Station is placed on - * @param[in] startPos Begin position of the charging Station on the lane - * @param[in] endPos End position of the charging Station on the lane - * @param[in] name Name of charging station - * @param[in] chargingPower power charged in every timeStep - * @param[in] efficiency efficiency of the charge - * @param[in] chargeInTransit enable or disable charge in transit - * @param[in] chargeDelay delay in the charge - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) - */ - static GNEAdditional* buildChargingStation(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement); - - /**@brief Builds a Parking Area - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the Parking >Area - * @param[in] lane The lane the Parking Area is placed on - * @param[in] startPos Begin position of the Parking Area on the lane - * @param[in] endPos End position of the Parking Area on the lane - * @param[in] name Name of Parking Area - * @param[in] friendlyPos enable or disable friendly position - * @param[in] roadSideCapacity road side capacity of ParkingArea - * @param[in] width ParkingArea's length - * @param[in] length ParkingArea's length - * @param[in] angle ParkingArea's angle - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) - */ - static GNEAdditional* buildParkingArea(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, - const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement); - - /**@brief Builds a Parking Space - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] parkingAreaParent Pointer to Parking Area Parent - * @param[in] pos ParkingSpace's X-Y position - * @param[in] width ParkingArea's width - * @param[in] length ParkingArea's length - * @param[in] angle ParkingArea's angle - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) - */ - static GNEAdditional* buildParkingSpace(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement); - - /**@brief Builds a induction loop detector (E1) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the detector - * @param[in] lane The lane the detector is placed on - * @param[in] pos position of the detector on the lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vtypes list of vehicle types to be reported - * @param[in] name E2 detector name - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildDetectorE1(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); - - /**@brief Builds a single-lane Area Detector (E2) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the detector - * @param[in] lane The lane the detector is placed on - * @param[in] pos position of the detector on the lane - * @param[in[ length length of the detector - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vtypes list of vehicle types to be reported - * @param[in] name E2 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildSingleLaneDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, double length, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); - - /**@brief Builds a multi-lane Area Detector (E2) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the detector - * @param[in] lanes The lanes the detector is placed on - * @param[in] pos position of the detector on the first lane - * @param[in] endPos position of the detector on the last lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vtypes list of vehicle types to be reported - * @param[in] name E2 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildMultiLaneDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, const std::vector& lanes, double pos, double endPos, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); - - /**@brief Builds a multi entry exit detector (E3) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the detector - * @param[in] pos position of the detector in the map - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vtypes list of vehicle types to be reported - * @param[in] name E2 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildDetectorE3(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement); - - /**@brief Builds a entry detector (E3) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] E3Parent pointer to E3 detector parent - * @param[in] lane The lane in which the entry detector is placed on - * @param[in] pos position of the entry detector on the lane - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the entry detector can not be added to the net (invalid parent or lane) - */ - static GNEAdditional* buildDetectorEntry(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); - - /**@brief Builds a exit detector (E3) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] E3Parent pointer to E3 detector parent - * @param[in] lane The lane in which the exit detector is placed on - * @param[in] pos position of the exit detector on the lane - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the exit detector can not be added to the net (invalid parent or lane - */ - static GNEAdditional* buildDetectorExit(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); - - /**@brief Builds a Instant Induction Loop Detector (E1Instant) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the detector - * @param[in] lane The lane the detector is placed on - * @param[in] pos position of the detector on the lane - * @param[in] filename The path to the output file. - * @param[in] name E2 detector name - * @param[in] vtypes list of vehicle types to be reported - * @param[in] friendlyPos enable or disable friendly position - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildDetectorE1Instant(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); - - /**@brief builds a microscopic calibrator over a lane - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the calibrator - * @param[in] lane The lane the calibrator is placed at - * @param[in] pos The position on the edge the calibrator lies at - * @param[in] name Calibrator name - * @param[in] outfile te file in which write results - * @param[in] centerAfterCreation center camera after creation - * @return true if was sucesfully created, false in other case - * @todo Is the position correct/needed - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the entry detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& name, const std::string& outfile, SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation); - - /**@brief builds a microscopic calibrator over an edge - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the calibrator - * @param[in] edge The edge the calibrator is placed at - * @param[in] pos The position on the edge the calibrator lies at - * @param[in] name Calibrator name - * @param[in] outfile te file in which write results - * @param[in] centerAfterCreation center camera after creation - * @param[in] routeProbe route probe vinculated with this calibrator - * @return true if was sucesfully created, false in other case - * @todo Is the position correct/needed - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the entry detector can not be added to the net (is duplicate) - */ - static GNEAdditional* buildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNEEdge* edge, double pos, const std::string& name, const std::string& outfile, SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation); - - /**@brief builds a calibrator flow - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] type The id of the vehicle's flow type to use for this vehicle's flow. - * @param[in] route The id of the route the vehicle's flow shall drive along - * @param[in] vehsPerHour number of vehicles per hour, equally spaced (not together with period or probability) - * @param[in] speed The speed with which the vehicles shall enter the network. NOTE: this attribute is exclusive of CalibratorFlows! - * @param[in] color This vehicle's flow's color - * @param[in] departLane The lane on which the vehicle's flow shall be inserted; see #departLane. default: "first" - * @param[in] departPos The position at which the vehicle's flow shall enter the net; see #departPos. default: "base" - * @param[in] departSpeed The speed with which the vehicle's flow shall enter the network; see #departSpeed. default: 0 - * @param[in] arrivalLane The lane at which the vehicle's flow shall leave the network; see #arrivalLane. default: "current" - * @param[in] arrivalPos The position at which the vehicle's flow shall leave the network; see #arrivalPos. default: "max" - * @param[in] arrivalSpeed The speed with which the vehicle's flow shall leave the network; see #arrivalSpeed. default: "current" - * @param[in] line A string specifying the id of a public transport line which can be used when specifying person rides - * @param[in] personNumber The number of occupied seats when the vehicle's flow is inserted. default: 0 - * @param[in] containerNumber The number of occupied container places when the vehicle's flow is inserted. default: 0 - * @param[in] reroute List of intermediate edges that shall be passed on rerouting. - * @param[in] via List of intermediate edges that shall be passed on rerouting. - * @param[in] departPosLat The lateral position on the departure lane at which the vehicle's flow shall enter the net; see Simulation/SublaneModel. default: "center" - * @param[in] arrivalPosLat The lateral position on the arrival lane at which the vehicle's flow shall arrive; see Simulation/SublaneModel. by default the vehicle's flow does not care about lateral arrival position - * @param[in] begin first vehicle's flow departure time - * @param[in] end end of departure interval (if undefined, defaults to 24 hours) - * @return true if was sucesfully created, false in other case - */ - static GNEAdditional* buildCalibratorFlow(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* calibratorParent, GNEDemandElement* route, GNEDemandElement* vType, - const std::string& vehsPerHour, const std::string& speed, const RGBColor& color, const std::string& departLane, const std::string& departPos, - const std::string& departSpeed, const std::string& arrivalLane, const std::string& arrivalPos, const std::string& arrivalSpeed, - const std::string& line, int personNumber, int containerNumber, bool reroute, const std::string& departPosLat, - const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end); - - /**@brief builds a rerouter - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the rerouter - * @param[in] pos position of the rerouter in the map - * @param[in] edges The edges the rerouter is placed at - * @param[in] prob The probability the rerouter reoutes vehicles with - * @param[in] name Calibrator name - * @param[in] file The file to read the reroute definitions from - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - */ - static GNEAdditional* buildRerouter(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& edges, double prob, const std::string& name, const std::string& file, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement); - - /**@brief builds a rerouter interval - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] rerouterParent rerouter in which interval is placed - * @param[in] begin begin of interval - * @param[in] end end of interval - * @return true if was sucesfully created, false in other case - */ - static GNEAdditional* buildRerouterInterval(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end); - - /** - DOCUMENTAR - */ - static GNEAdditional* buildClosingLaneReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions); - - /** - DOCUMENTAR - */ - static GNEAdditional* buildClosingReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions); - - /** - DOCUMENTAR - */ - static GNEAdditional* builDestProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability); - - /** - DOCUMENTAR - */ - static GNEAdditional* builParkingAreaReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkignArea, double probability, bool visible); - - /** - DOCUMENTAR - */ - static GNEAdditional* buildRouteProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability); - - /**@brief builds a Route probe - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the routeprobe - * @param[in] edge The edges the routeprobe is placed at - * @param[in] freq the aggregation period the values the routeprobe collects shall be summed up. - * @param[in] name Calibrator name - * @param[in] file The file to read the routeprobe definitions from - * @param[in] begin The time at which to start generating output - * @param[in] centerAfterCreation center camera after creation - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the Route Probe can not be added to the net (is duplicate) - */ - static GNEAdditional* buildRouteProbe(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, GNEEdge* edge, const std::string& freq, const std::string& name, const std::string& file, SUMOTime begin, bool centerAfterCreation); - - /**@brief Builds a VariableSpeedSign (lane speed additional) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id The id of the lane speed additional - * @param[in] destLanes List of lanes affected by this speed additional - * @param[in] name Calibrator name - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the VariableSpeedSign can not be added to the net (is duplicate) - */ - static GNEAdditional* buildVariableSpeedSign(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& destLanes, const std::string& name, bool blockMovement); - - /**@brief Builds a VariableSpeedSign Step - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] VSSParent Variable Speed Sign parent - * @param[in] time step's time - * @param[in] speed step's speed - * @return true if was sucesfully created, false in other case - * @exception InvalidArgument If the Variable Speed Sign Step can not be added to the net (is duplicate) - */ - static GNEAdditional* buildVariableSpeedSignStep(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* VSSParent, double time, double speed); - - /**@brief Builds a vaporizer (lane speed additional) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] edge edge in which this vaporizer is placed - * @param[in] startTime time in which this vaporizer start - * @param[in] endTime time in which this vaporizer ends - * @param[in] name Vaporizer name - * @param[in] centerAfterCreation center camera after creation - * @return true if was sucesfully created, false in other case - * @exception ProcessError If the XML definition file is errornous - */ - static GNEAdditional* buildVaporizer(GNEViewNet* viewNet, bool allowUndoRedo, GNEEdge* edge, SUMOTime start, SUMOTime endTime, const std::string& name, bool centerAfterCreation); - - /**@brief Builds a TAZ (Traffic Assignment Zone) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] id TAZ ID - * @param[in] shape TAZ shape - * @param[in] edges list of edges (note: This will create GNETAZSourceSinks/Sinks with default values) - * @param[in] blockMovemet enable or disable block movement - * @return true if was sucesfully created, false in other case - * @exception ProcessError If the XML definition file is errornous - */ - static GNEAdditional* buildTAZ(GNEViewNet* viewNet, bool allowUndoRedo, const std::string& id, const PositionVector& shape, const RGBColor& color, const std::vector& edges, bool blockMovement); - - /**@brief Builds a TAZSource (Traffic Assignment Zone) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] TAZ Traffic Assignment Zone in which this TAZSource is palced - * @param[in] ege edge in which TAZSource is placed - * @param[in] departWeight depart weight of TAZSource - * @return true if was sucesfully created, false in other case - * @exception ProcessError If the XML definition file is errornous - */ - static GNEAdditional* buildTAZSource(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double departWeight); - - /**@brief Builds a TAZSink (Traffic Assignment Zone) - * @param[in] viewNet viewNet in which element will be inserted - * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y - * @param[in] TAZ Traffic Assignment Zone in which this TAZSink is palced - * @param[in] ege edge in which TAZSink is placed - * @param[in] arrivalWeight arrival weight of TAZSink - * @return true if was sucesfully created, false in other case - * @exception ProcessError If the XML definition file is errornous - */ - static GNEAdditional* buildTAZSink(GNEViewNet* viewNet, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double arrivalWeight); - - /**@brief extracts the position, checks whether it shall be mirrored and checks whether it is within the lane. - * @param[in] pos position of additional over lane - * @param[in] lane The lane the position shall be valid for - * @param[in] friendlyPos flag to indicate if friendlyPos is enabled - * @param[in] additionalID ID of additional - * @return The position on the lane - */ - double getPosition(double pos, GNELane& lane, bool friendlyPos, const std::string& additionalID); - - /**@brief check if the position of a detector over a lane is valid - * @param[in] pos pos position of detector - * @param[in] laneLength Length of the lane - * @param[in] friendlyPos Attribute of detector - * @return true if the detector position is valid, false in otherweise - */ - static bool checkAndFixDetectorPosition(double& pos, const double laneLength, const bool friendlyPos); - - /**@brief check if the position of a detector over a lane is valid - * @param[in] startPos Start position of detector - * @param[in] length length of detector - * @param[in] laneLength Length of the lane - * @param[in] friendlyPos Attribute of detector - * @return true if the detector position is valid, false in otherweise - */ - static bool fixE2DetectorPosition(double& pos, double& length, const double laneLength, const bool friendlyPos); - - /// @brief check if a GNEAccess can be created in a certain Edge - static bool accessCanBeCreated(GNEAdditional* busStopParent, GNEEdge* edge); - - /// @brief check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted - static bool checkOverlappingRerouterIntervals(GNEAdditional* rerouter, SUMOTime newBegin, SUMOTime newEnd); - -protected: - /// @name parsing methods - /// - /// These methods parse the attributes for each of the described additional - /// and call the according methods to build the additional - /// @{ - /**@brief Builds a Vaporizer - * @param[in] attrs SAX-attributes which define the vaporizer - */ - static bool parseAndBuildVaporizer(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Builds a TAZ - * @param[in] attrs SAX-attributes which define the vaporizer - */ - static bool parseAndBuildTAZ(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Builds a TAZ Source - * @param[in] attrs SAX-attributes which define the vaporizer - */ - static bool parseAndBuildTAZSource(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Builds a TAZ Sink - * @param[in] attrs SAX-attributes which define the vaporizer - */ - static bool parseAndBuildTAZSink(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Variable Speed Signal (GNEViewNet* viewNet, bool allowUndoRedo, lane speed additional) - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildVariableSpeedSign(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Variable Speed Signal Step - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildVariableSpeedSignStep(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a rerouter - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouter(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Rerouter Interval - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterInterval(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Closing Lane reroute - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterClosingLaneReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Closing Reroute - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterClosingReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Destiny Prob Reroute - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterDestProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a parkingAreaReroute - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterParkingAreaReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Route Prob Reroute - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRerouterRouteProbReroute(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a bus stop - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildBusStop(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses values and adds access to the current bus stop - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildAccess(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a container stop - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildContainerStop(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a charging station - * @param[in] attrs SAXattributes which define the additional - */ - static bool parseAndBuildChargingStation(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a parking area - * @param[in] attrs SAXattributes which define the additional - */ - static bool parseAndBuildParkingArea(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a parking space - * @param[in] attrs SAXattributes which define the additional - * @param[in] tag of the additional - */ - static bool parseAndBuildParkingSpace(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a mesoscopic or microscopic calibrator - * @param[in] attrs SAX-attributes which define the additional - * @param[in] tag of the additional - */ - static bool parseAndBuildCalibrator(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a induction loop detector (GNEViewNet* viewNet, bool allowUndoRedo, E1) - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorE1(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a lane area detector (GNEViewNet* viewNet, bool allowUndoRedo, E2) - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorE2(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a multi entry exit detector (GNEViewNet* viewNet, bool allowUndoRedo, E3) - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorE3(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Entry detector - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorEntry(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Exit detector - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorExit(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds a Instant induction loop detector (GNEViewNet* viewNet, bool allowUndoRedo, E1Instant) - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildDetectorE1Instant(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses his values and builds routeProbe - * @param[in] attrs SAX-attributes which define the additional - */ - static bool parseAndBuildRouteProbe(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /**@brief Parses flow values of Calibrators - * @param[in] attrs SAX-attributes which define the flows - */ - static bool parseAndBuildCalibratorFlow(GNEViewNet* viewNet, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedAdditionals* insertedAdditionals); - - /// @} - -private: - /**@brief Parses his values and builds a Poly - * @param[in] attrs SAX-attributes which define the Poly - */ - void parseAndBuildPoly(const SUMOSAXAttributes& attrs); - - /**@brief Parses his values and builds a POI - * @param[in] attrs SAX-attributes which define the shape - */ - void parseAndBuildPOI(const SUMOSAXAttributes& attrs); - - /**@brief Parse parameter and insert it in the last created additional - * @param[in] attrs SAX-attributes which define the parameter - */ - void parseParameter(const SUMOSAXAttributes& attrs); - - /// @brief pointer to View's Net - GNEViewNet* myViewNet; - - /// @brief HierarchyInsertedAdditionals used for insert children - HierarchyInsertedAdditionals myHierarchyInsertedAdditionals; - - /// @brief invalidate copy constructor - GNEAdditionalHandler(const GNEAdditionalHandler& s) = delete; - - /// @brief invalidate assignment operator - GNEAdditionalHandler& operator=(const GNEAdditionalHandler& s) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEBusStop.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEBusStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEBusStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEBusStop.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,419 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEBusStop.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// A lane area vehicles can halt at (GNE version) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEBusStop.h" - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEBusStop::GNEBusStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, int personCapacity, bool friendlyPosition, bool blockMovement) : - GNEStoppingPlace(id, viewNet, GLO_BUS_STOP, SUMO_TAG_BUS_STOP, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), - myLines(lines), - myPersonCapacity(personCapacity) { -} - - -GNEBusStop::~GNEBusStop() {} - - -void -GNEBusStop::updateGeometry() { - // Get value of option "lefthand" - 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 shape to side - tmpShape.move2side(myViewNet->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); - - // Get position of the sign - mySignPos = tmpShape.getLineCenter(); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set block icon rotation, and using their rotation for sign - myBlockIcon.setRotation(getParentLanes().front()); - - // obtain parent edge - const GNEEdge* edge = getParentLanes().front()->getParentEdge(); - - // update child demand elements geometry - for (const auto& i : getChildDemandElements()) { - // special case for person trips - if (i->getTagProperty().isPersonTrip()) { - // update previous and next person plan - GNEDemandElement* previousDemandElement = i->getParentDemandElements().front()->getPreviousChildDemandElement(i); - if (previousDemandElement) { - previousDemandElement->updatePartialGeometry(edge); - } - GNEDemandElement* nextDemandElement = i->getParentDemandElements().front()->getNextChildDemandElement(i); - if (nextDemandElement) { - nextDemandElement->updatePartialGeometry(edge); - } - } - i->updatePartialGeometry(edge); - } - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEBusStop::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getShape(), - myViewNet->getVisualisationSettings().stoppingPlaceSettings.busStopWidth); -} - - -Boundary -GNEBusStop::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNEBusStop::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double busStopExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(busStopExaggeration)) { - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, getType()); - // Set color of the base - if (mySpecialColor) { - GLHelper::setColor(*mySpecialColor); - } else if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); - } - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GNEGeometry::drawGeometry(myViewNet, myAdditionalGeometry, s.stoppingPlaceSettings.busStopWidth * busStopExaggeration); - // Check if the distance is enought to draw details and if is being drawn for selecting - if (s.drawForRectangleSelection) { - // only draw circle depending of distance between sign and mouse cursor - if (myViewNet->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { - // Add a draw matrix for details - glPushMatrix(); - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(busStopExaggeration, busStopExaggeration, 1); - // set color - GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // pop draw matrix - glPopMatrix(); - } - } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, busStopExaggeration)) { - // draw lines between BusStops and Acces - for (auto i : getChildAdditionals()) { - GLHelper::drawBoxLine(i->getAdditionalGeometry().getPosition(), - RAD2DEG(mySignPos.angleTo2D(i->getAdditionalGeometry().getPosition())) - 90, mySignPos.distanceTo2D(i->getAdditionalGeometry().getPosition()), .05); - } - // Add a draw matrix for details - glPushMatrix(); - // draw lines depending of detailSettings - if (s.drawDetail(s.detailSettings.stoppingPlaceText, busStopExaggeration) && !s.drawForPositionSelection) { - // Iterate over every line - for (int i = 0; i < (int)myLines.size(); ++i) { - // push a new matrix for every line - glPushMatrix(); - // Rotate and traslaste - glTranslated(mySignPos.x(), mySignPos.y(), 0); - glRotated(-1 * myBlockIcon.rotation, 0, 0, 1); - // draw line with a color depending of the selection status - if (drawUsingSelectColor()) { - GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT); - } else { - GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.stoppingPlaceSettings.busStopColor, 0, FONS_ALIGN_LEFT); - } - // pop matrix for every line - glPopMatrix(); - } - } - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(busStopExaggeration, busStopExaggeration, 1); - // Set color of the externe circle - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); - } - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // Traslate to front - glTranslated(0, 0, .1); - // Set color of the interne circle - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.busStopColorSign); - } - // draw another circle in the same position, but a little bit more small - GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); - // draw H depending of detailSettings - if (s.drawDetail(s.detailSettings.stoppingPlaceText, busStopExaggeration) && !s.drawForPositionSelection) { - if (drawUsingSelectColor()) { - GLHelper::drawText("H", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); - } else { - GLHelper::drawText("H", Position(), .1, myCircleInText, s.stoppingPlaceSettings.busStopColor, myBlockIcon.rotation); - } - } - // pop draw matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, busStopExaggeration); - } - // pop draw matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - drawName(getPositionInView(), s.scale, s.addName); - if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), busStopExaggeration, myDottedGeometry); - } - // Pop name - glPopName(); - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } -} - - -std::string -GNEBusStop::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_STARTPOS: - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return toString(myStartPosition); - } else { - return ""; - } - case SUMO_ATTR_ENDPOS: - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return toString(myEndPosition); - } else { - return ""; - } - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case SUMO_ATTR_LINES: - return joinToString(myLines, " "); - case SUMO_ATTR_PERSON_CAPACITY: - return toString(myPersonCapacity); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEBusStop::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: { - // change ID of BusStop - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Acces children - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_ACCESS), undoList); - } - break; - } - case SUMO_ATTR_LANE: - case SUMO_ATTR_STARTPOS: - case SUMO_ATTR_ENDPOS: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FRIENDLY_POS: - case SUMO_ATTR_LINES: - case SUMO_ATTR_PERSON_CAPACITY: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case SUMO_ATTR_LINES: - return canParse >(value); - case SUMO_ATTR_PERSON_CAPACITY: - return canParse(value) && (parse(value) > 0 || parse(value) == -1); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_STARTPOS: - if (!value.empty()) { - myStartPosition = parse(value); - myParametersSet |= STOPPINGPLACE_STARTPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; - } - break; - case SUMO_ATTR_ENDPOS: - if (!value.empty()) { - myEndPosition = parse(value); - myParametersSet |= STOPPINGPLACE_ENDPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; - } - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case SUMO_ATTR_LINES: - myLines = GNEAttributeCarrier::parse >(value); - break; - case SUMO_ATTR_PERSON_CAPACITY: - myPersonCapacity = GNEAttributeCarrier::parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEBusStop.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEBusStop.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEBusStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEBusStop.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEBusStop.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// A class for visualizing busStop geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNEBusStop_h -#define GNEBusStop_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEStoppingPlace.h" - - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEBusStop - * @brief A lane area vehicles can halt at (netedit-version) - */ -class GNEBusStop : public GNEStoppingPlace { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] startPos Start position of the StoppingPlace - * @param[in] endPos End position of the StoppingPlace - * @param[in] name Name of busStop - * @param[in] lines lines of the busStop - * @param[in] friendlyPos enable or disable friendly position - * @param[in] block movement enable or disable additional movement - */ - GNEBusStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, int personCapacity, bool friendlyPosition, bool blockMovement); - - /// @brief Destructor - ~GNEBusStop(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /// @} - -protected: - /// @brief The list of lines that are assigned to this stop - std::vector myLines; - - /// @brief maximum number of persons that can wait at this stop - int myPersonCapacity; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEBusStop(const GNEBusStop&) = delete; - - /// @brief Invalidated assignment operator. - GNEBusStop& operator=(const GNEBusStop&) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibrator.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibrator.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibrator.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibrator.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,401 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECalibrator.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNECalibrator.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNECalibrator::GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe) : - GNEAdditional(id, viewNet, GLO_CALIBRATOR, SUMO_TAG_CALIBRATOR, name, false, { - edge -}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -myPositionOverLane(pos), -myFrequency(frequency), -myOutput(output), -myRouteProbe(routeprobe) { -} - - -GNECalibrator::GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNELane* lane, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe) : - GNEAdditional(id, viewNet, GLO_CALIBRATOR, SUMO_TAG_LANECALIBRATOR, name, false, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}), -myPositionOverLane(pos), -myFrequency(frequency), -myOutput(output), -myRouteProbe(routeprobe) { -} - - -GNECalibrator::~GNECalibrator() {} - - -void -GNECalibrator::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNECalibrator::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNECalibrator::updateGeometry() { - // get shape depending of we have a edge or a lane - if (getParentLanes().size() > 0) { - // update geometry - myAdditionalGeometry.updateGeometry(getParentLanes().front(), myPositionOverLane); - } else if (getParentEdges().size() > 0) { - // update geometry of first edge - myAdditionalGeometry.updateGeometry(getParentEdges().front()->getLanes().front(), myPositionOverLane); - // clear extra geometries - myEdgeCalibratorGeometries.clear(); - // iterate over every lane and get point - for (int i = 1; i < (int)getParentEdges().front()->getLanes().size(); i++) { - // add new calibrator geometry - GNEGeometry::Geometry calibratorGeometry; - calibratorGeometry.updateGeometry(getParentEdges().front()->getLanes().at(i), myPositionOverLane); - myEdgeCalibratorGeometries.push_back(calibratorGeometry); - } - } else { - throw ProcessError("Both edges and lanes aren't defined"); - } - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void GNECalibrator::updateDottedContour() { - //GLHelper::drawShapeDottedContourRectangle(s, getType(), pos, 2.8, 6, rot, 0, 3); -} - - -Position -GNECalibrator::getPositionInView() const { - PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getLanes().at(0)->getLaneShape(); - if (myPositionOverLane < 0) { - return shape.front(); - } else if (myPositionOverLane > shape.length()) { - return shape.back(); - } else { - return shape.positionAtOffset(myPositionOverLane); - } -} - - -Boundary -GNECalibrator::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNECalibrator::splitEdgeGeometry(const double splitPosition, const GNENetElement* /*originalElement*/, const GNENetElement* newElement, GNEUndoList* undoList) { - if (splitPosition < myPositionOverLane) { - // change lane or edge - if (newElement->getTagProperty().getTag() == SUMO_TAG_LANE) { - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - } else { - setAttribute(SUMO_ATTR_EDGE, newElement->getID(), undoList); - } - // now adjust start position - setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); - } -} - - -std::string -GNECalibrator::getParentName() const { - // get parent name depending of we have a edge or a lane - if (getParentLanes().size() > 0) { - return getParentLanes().front()->getMicrosimID(); - } else if (getParentEdges().size() > 0) { - return getParentEdges().front()->getLanes().at(0)->getMicrosimID(); - } else { - throw ProcessError("Both myEdge and myLane aren't defined"); - } -} - - -void -GNECalibrator::drawGL(const GUIVisualizationSettings& s) const { - // get values - const double exaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(exaggeration)) { - // begin draw - glPushName(getGlID()); - glLineWidth(1.0); - // draw first symbol - drawCalibratorSymbol(s, exaggeration, myAdditionalGeometry.getPosition(), myAdditionalGeometry.getRotation()); - // continue with the other symbols - for (const auto& edgeCalibratorGeometry : myEdgeCalibratorGeometries) { - drawCalibratorSymbol(s, exaggeration, edgeCalibratorGeometry.getPosition(), edgeCalibratorGeometry.getRotation()); - } - // draw name - drawName(getPositionInView(), s.scale, s.addName); - // pop name - glPopName(); - } -} - - -void -GNECalibrator::openAdditionalDialog() { - // Open calibrator dialog - GNECalibratorDialog calibratorDialog(this); -} - - -std::string -GNECalibrator::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGE: - return getParentEdges().front()->getID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_FREQUENCY: - return time2string(myFrequency); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_OUTPUT: - return myOutput; - case SUMO_ATTR_ROUTEPROBE: - return myRouteProbe; - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNECalibrator::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNECalibrator::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: - case SUMO_ATTR_EDGE: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_FREQUENCY: - case SUMO_ATTR_NAME: - case SUMO_ATTR_OUTPUT: - case SUMO_ATTR_ROUTEPROBE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - -} - - -bool -GNECalibrator::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_EDGE: - if (myViewNet->getNet()->retrieveEdge(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_POSITION: - if (canParse(value)) { - // obtain position and check if is valid - double newPosition = parse(value); - PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getLanes().at(0)->getLaneShape(); - if ((newPosition < 0) || (newPosition > shape.length())) { - return false; - } else { - return true; - } - } else { - return false; - } - case SUMO_ATTR_FREQUENCY: - return canParse(value); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_OUTPUT: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_ROUTEPROBE: - return SUMOXMLDefinitions::isValidAdditionalID(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNECalibrator::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNECalibrator::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNECalibrator::getHierarchyName() const { - return getTagStr(); -} - -// =========================================================================== -// private -// =========================================================================== - -void GNECalibrator::drawCalibratorSymbol(const GUIVisualizationSettings& s, const double exaggeration, const Position& pos, const double rot) const { - glPushMatrix(); - glTranslated(pos.x(), pos.y(), getType()); - glRotated(rot, 0, 0, 1); - glTranslated(0, 0, getType()); - glScaled(exaggeration, exaggeration, 1); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.additionalSettings.calibratorColor); - } - // base - glBegin(GL_TRIANGLES); - glVertex2d(0 - s.additionalSettings.calibratorWidth, 0); - glVertex2d(0 - s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); - glVertex2d(0 + s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); - glVertex2d(0 + s.additionalSettings.calibratorWidth, 0); - glVertex2d(0 - s.additionalSettings.calibratorWidth, 0); - glVertex2d(0 + s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); - glEnd(); - // draw text if isn't being drawn for selecting - if (!s.drawForRectangleSelection && !s.drawForPositionSelection && s.drawDetail(s.detailSettings.calibratorText, exaggeration)) { - // set color depending of selection status - RGBColor textColor = drawUsingSelectColor() ? s.colorSettings.selectionColor : RGBColor::BLACK; - // draw "C" - GLHelper::drawText("C", Position(0, 1.5), 0.1, 3, textColor, 180); - // draw "edge" or "lane " - if (getParentLanes().size() > 0) { - GLHelper::drawText("lane", Position(0, 3), .1, 1, textColor, 180); - } else if (getParentEdges().size() > 0) { - GLHelper::drawText("edge", Position(0, 3), .1, 1, textColor, 180); - } else { - throw ProcessError("Both myEdge and myLane aren't defined"); - } - } - glPopMatrix(); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), exaggeration, myDottedGeometry); - } -} - -void -GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_EDGE: - replaceParentEdges(this, value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_FREQUENCY: - myFrequency = parse(value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_OUTPUT: - myOutput = value; - break; - case SUMO_ATTR_ROUTEPROBE: - myRouteProbe = value; - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,422 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECalibratorFlow.cpp -/// @author Pablo Alvarez Lopez -/// @date March 2016 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include - -#include "GNECalibratorFlow.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - - -GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent) : - GNEAdditional(calibratorParent, calibratorParent->getViewNet(), GLO_CALIBRATOR, SUMO_TAG_FLOW_CALIBRATOR, "", false, -{}, {}, {}, {calibratorParent}, {}, {}, {}, {}, {}, {}), -myVehicleType(calibratorParent->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)), -myRoute(calibratorParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).begin()->second) { - // fill calibrator flows with default values - setDefaultValues(); -} - - -GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed, - const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane, - const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute, - const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end) : - GNEAdditional(calibratorParent, calibratorParent->getViewNet(), GLO_CALIBRATOR, SUMO_TAG_FLOW_CALIBRATOR, "", false, {}, {}, {}, {calibratorParent}, {}, {}, {}, {}, {}, {}), -myVehicleType(vehicleType), -myRoute(route), -myVehsPerHour(vehsPerHour), -mySpeed(speed), -myColor(color), -myDepartLane(departLane), -myDepartPos(departPos), -myDepartSpeed(departSpeed), -myArrivalLane(arrivalLane), -myArrivalPos(arrivalPos), -myArrivalSpeed(arrivalSpeed), -myLine(line), -myPersonNumber(personNumber), -myContainerNumber(containerNumber), -myReroute(reroute), -myDepartPosLat(departPosLat), -myArrivalPosLat(arrivalPosLat), -myBegin(begin), -myEnd(end) { -} - - -GNECalibratorFlow::~GNECalibratorFlow() {} - - -void -GNECalibratorFlow::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNECalibratorFlow::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNECalibratorFlow::updateGeometry() { - // This additional doesn't own a geometry -} - - -void GNECalibratorFlow::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNECalibratorFlow::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNECalibratorFlow::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNECalibratorFlow::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNECalibratorFlow::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNECalibratorFlow::drawGL(const GUIVisualizationSettings& /* s */) const { - // Currently This additional isn't drawn -} - - -std::string -GNECalibratorFlow::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_TYPE: - return myVehicleType->getID(); - case SUMO_ATTR_ROUTE: - return myRoute->getID(); - case SUMO_ATTR_VEHSPERHOUR: - return myVehsPerHour; - case SUMO_ATTR_SPEED: - return mySpeed; - case SUMO_ATTR_COLOR: - return toString(myColor); - case SUMO_ATTR_BEGIN: - return time2string(myBegin); - case SUMO_ATTR_END: - return time2string(myEnd); - case SUMO_ATTR_DEPARTLANE: - return myDepartLane; - case SUMO_ATTR_DEPARTPOS: - return myDepartPos; - case SUMO_ATTR_DEPARTSPEED: - return myDepartSpeed; - case SUMO_ATTR_ARRIVALLANE: - return myArrivalLane; - case SUMO_ATTR_ARRIVALPOS: - return myArrivalPos; - case SUMO_ATTR_ARRIVALSPEED: - return myArrivalSpeed; - case SUMO_ATTR_LINE: - return myLine; - case SUMO_ATTR_PERSON_NUMBER: - return toString(myPersonNumber); - case SUMO_ATTR_CONTAINER_NUMBER: - return toString(myContainerNumber); - case SUMO_ATTR_REROUTE: - return toString(myReroute); - case SUMO_ATTR_DEPARTPOS_LAT: - return myDepartPosLat; - case SUMO_ATTR_ARRIVALPOS_LAT: - return myArrivalPosLat; - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNECalibratorFlow::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_BEGIN: - return STEPS2TIME(myBegin); - case SUMO_ATTR_END: - return STEPS2TIME(myEnd); - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNECalibratorFlow::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: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_ROUTE: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_VEHSPERHOUR: - case SUMO_ATTR_SPEED: - case SUMO_ATTR_BEGIN: - case SUMO_ATTR_END: - case SUMO_ATTR_DEPARTLANE: - case SUMO_ATTR_DEPARTPOS: - case SUMO_ATTR_DEPARTSPEED: - case SUMO_ATTR_ARRIVALLANE: - case SUMO_ATTR_ARRIVALPOS: - case SUMO_ATTR_ARRIVALSPEED: - case SUMO_ATTR_LINE: - case SUMO_ATTR_PERSON_NUMBER: - case SUMO_ATTR_CONTAINER_NUMBER: - case SUMO_ATTR_REROUTE: - case SUMO_ATTR_DEPARTPOS_LAT: - case SUMO_ATTR_ARRIVALPOS_LAT: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_TYPE: - return SUMOXMLDefinitions::isValidTypeID(value) && (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); - case SUMO_ATTR_ROUTE: - return SUMOXMLDefinitions::isValidVehicleID(value) && (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_ROUTE, value, false) != nullptr); - case SUMO_ATTR_VEHSPERHOUR: - if (value.empty()) { - // speed and vehsPerHour cannot be empty at the same time - if (mySpeed.empty()) { - return false; - } else { - return true; - } - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_SPEED: - if (value.empty()) { - // speed and vehsPerHour cannot be empty at the same time - if (myVehsPerHour.empty()) { - return false; - } else { - return true; - } - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_BEGIN: - return canParse(value); - case SUMO_ATTR_END: - return canParse(value); - case SUMO_ATTR_DEPARTLANE: - if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) { - return true; - } else { - return (myViewNet->getNet()->retrieveLane(value, false) != nullptr); - } - case SUMO_ATTR_DEPARTPOS: - if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_DEPARTSPEED: - if ((value == "random") || (value == "max")) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_ARRIVALLANE: - if (value == "current") { - return true; - } else { - return (myViewNet->getNet()->retrieveLane(value, false) != nullptr); - } - case SUMO_ATTR_ARRIVALPOS: - if ((value == "random") || (value == "max")) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_ARRIVALSPEED: - if (value == "current") { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_LINE: - return true; - case SUMO_ATTR_PERSON_NUMBER: - return canParse(value) && parse(value) >= 0; - case SUMO_ATTR_CONTAINER_NUMBER: - return canParse(value) && parse(value) >= 0; - case SUMO_ATTR_REROUTE: - return canParse(value); - case SUMO_ATTR_DEPARTPOS_LAT: - return SUMOXMLDefinitions::LateralAlignments.hasString(value); - case SUMO_ATTR_ARRIVALPOS_LAT: - return SUMOXMLDefinitions::LateralAlignments.hasString(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNECalibratorFlow::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNECalibratorFlow::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNECalibratorFlow::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_TYPE: - myVehicleType = myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, value); - break; - case SUMO_ATTR_ROUTE: - myRoute = myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, value); - break; - case SUMO_ATTR_VEHSPERHOUR: - myVehsPerHour = value; - break; - case SUMO_ATTR_SPEED: - mySpeed = value; - break; - case SUMO_ATTR_COLOR: - myColor = parse(value); - break; - case SUMO_ATTR_BEGIN: - myBegin = parse(value); - break; - case SUMO_ATTR_END: - myEnd = parse(value); - break; - case SUMO_ATTR_DEPARTLANE: - myDepartLane = value; - break; - case SUMO_ATTR_DEPARTPOS: - myDepartPos = value; - break; - case SUMO_ATTR_DEPARTSPEED: - myDepartSpeed = value; - break; - case SUMO_ATTR_ARRIVALLANE: - myArrivalLane = value; - break; - case SUMO_ATTR_ARRIVALPOS: - myArrivalPos = value; - break; - case SUMO_ATTR_ARRIVALSPEED: - myArrivalSpeed = value; - break; - case SUMO_ATTR_LINE: - myLine = value; - break; - case SUMO_ATTR_PERSON_NUMBER: - myPersonNumber = parse(value); - break; - case SUMO_ATTR_CONTAINER_NUMBER: - myContainerNumber = parse(value); - break; - case SUMO_ATTR_REROUTE: - myReroute = parse(value); - break; - case SUMO_ATTR_DEPARTPOS_LAT: - myDepartPosLat = value; - break; - case SUMO_ATTR_ARRIVALPOS_LAT: - myArrivalPosLat = value; - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibratorFlow.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,215 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECalibratorFlow.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// Flow used by GNECalibrators -/****************************************************************************/ -#ifndef GNECalibratorFlow_h -#define GNECalibratorFlow_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declaration -// =========================================================================== - -class GNECalibrator; -class GNECalibratorDialog; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNECalibratorFlow - * flow flow used by GNECalibrators - */ -class GNECalibratorFlow : public GNEAdditional { - -public: - /// @brief default constructor (used only in GNECalibratorDialog) - GNECalibratorFlow(GNEAdditional* calibratorParent); - - /// @brief parameter constructor - GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed, - const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane, - const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute, - const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end); - - /// @brief destructor - ~GNECalibratorFlow(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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; - /// @} - - /// @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 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 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; - /// @} - -protected: - /// @brief type of flow - GNEDemandElement* myVehicleType; - - /// @brief route in which this flow is used - GNEDemandElement* myRoute; - - /// @brief flows per hour (String instead float because can be empty) - std::string myVehsPerHour; - - /// @brief flow speed (String instead float because can be empty) - std::string mySpeed; - - /// @brief color of flow - RGBColor myColor; - - /// @brief depart lane - std::string myDepartLane; - - /// @brief depart position - std::string myDepartPos; - - /// @brief depart speed - std::string myDepartSpeed; - - /// @brief arrival lane - std::string myArrivalLane; - - /// @brief arrival pos - std::string myArrivalPos; - - /// @brief arrival speed - std::string myArrivalSpeed; - - /// @brief line of bus/container stop - std::string myLine; - - /// @brief number of person - int myPersonNumber; - - /// @brief number of container - int myContainerNumber; - - /// @brief reroute - bool myReroute; - - /// @brief departPosLat - std::string myDepartPosLat; - - //// @brief arrivalPosLat - std::string myArrivalPosLat; - - /// @name specific of flows - /// @{ - /// @brief time step begin - SUMOTime myBegin; - - /// @brief time step end - SUMOTime myEnd; - /// @} - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNECalibratorFlow(const GNECalibratorFlow&) = delete; - - /// @brief Invalidated assignment operator - GNECalibratorFlow& operator=(const GNECalibratorFlow&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibrator.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibrator.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNECalibrator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNECalibrator.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,196 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECalibrator.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNECalibrator_h -#define GNECalibrator_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declaration -// =========================================================================== - -class GNERouteProbe; -class GNECalibratorFlow; -class GNERoute; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNECalibrator - * class for represent Calibratos in netedit - */ -class GNECalibrator : public GNEAdditional { - -public: - - /**@brief Constructor using edge - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] edge Edge of this calibrator belongs - * @param[in] pos position of the calibrator on the edge (Currently not used) - * @param[in] frequency the aggregation interval in which to calibrate the flows - * @param[in] name Calibrator name - * @param[in] output The output file for writing calibrator information - * @param[in] routeprobe route probe vinculated with this calibrator - * @param[in] calibratorRoutes vector with the calibratorRoutes of calibrator - * @param[in] calibratorFlows vector with the calibratorFlows of calibrator - */ - GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe); - - /**@brief Constructor using lane - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] lane Lane of this calibrator belongs - * @param[in] pos position of the calibrator on the edge (Currently not used) - * @param[in] frequency the aggregation interval in which to calibrate the flows - * @param[in] name Calibrator name - * @param[in] routeprobe route probe vinculated with this calibrator - * @param[in] output The output file for writing calibrator information - * @param[in] calibratorRoutes vector with the calibratorRoutes of calibrator - * @param[in] calibratorFlows vector with the calibratorFlows of calibrator - */ - GNECalibrator(const std::string& id, GNEViewNet* viewNet, GNELane* lane, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe); - - /// @brief Destructor - ~GNECalibrator(); - - /// @brief open Calibrator Dialog - void openAdditionalDialog(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief position over Lane - double myPositionOverLane; - - /// @brief Frequency of calibrator - SUMOTime myFrequency; - - /// @brief output of calibrator - std::string myOutput; - - /// @brief ID to current RouteProbe - std::string myRouteProbe; - - /// @brief extra calibrator geometries - std::vector myEdgeCalibratorGeometries; - -private: - /// @brief draw calibrator symbol - void drawCalibratorSymbol(const GUIVisualizationSettings& s, const double exaggeration, const Position& pos, const double rot) const; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNECalibrator(const GNECalibrator&) = delete; - - /// @brief Invalidated assignment operator. - GNECalibrator& operator=(const GNECalibrator&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEChargingStation.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEChargingStation.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEChargingStation.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEChargingStation.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEChargingStation.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEChargingStation.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEChargingStation::GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement) : - GNEStoppingPlace(id, viewNet, GLO_CHARGING_STATION, SUMO_TAG_CHARGING_STATION, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), - myChargingPower(chargingPower), - myEfficiency(efficiency), - myChargeInTransit(chargeInTransit), - myChargeDelay(chargeDelay) { -} - - -GNEChargingStation::~GNEChargingStation() {} - - -void -GNEChargingStation::updateGeometry() { - // Get value of option "lefthand" - const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; - - // Update common geometry of stopping place - setStoppingPlaceGeometry(0); - - // Obtain a copy of the shape - PositionVector tmpShape = myAdditionalGeometry.getShape(); - - // Move shape to side - tmpShape.move2side(myViewNet->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); - - // Get position of the sign - mySignPos = tmpShape.getLineCenter(); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set block icon rotation, and using their rotation for sign - myBlockIcon.setRotation(getParentLanes().front()); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEChargingStation::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getShape(), - myViewNet->getVisualisationSettings().stoppingPlaceSettings.chargingStationWidth); -} - - -Boundary -GNEChargingStation::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNEChargingStation::drawGL(const GUIVisualizationSettings& s) const { - // Get exaggeration - const double chargingStationExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(chargingStationExaggeration)) { - // Push name - glPushName(getGlID()); - // Push base matrix - glPushMatrix(); - // Traslate matrix - glTranslated(0, 0, getType()); - // Set Color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); - } - // Draw base - GNEGeometry::drawGeometry(myViewNet, myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * chargingStationExaggeration); - // Check if the distance is enought to draw details and if is being drawn for selecting - if (s.drawForRectangleSelection) { - // only draw circle depending of distance between sign and mouse cursor - if (myViewNet->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { - // Add a draw matrix for details - glPushMatrix(); - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(chargingStationExaggeration, chargingStationExaggeration, 1); - // set color - GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // pop draw matrix - glPopMatrix(); - } - } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, chargingStationExaggeration)) { - // Push matrix for details - glPushMatrix(); - // draw power depending of detailSettings - if (s.drawDetail(s.detailSettings.stoppingPlaceText, chargingStationExaggeration) && !s.drawForPositionSelection) { - // push a new matrix for charging power - glPushMatrix(); - // draw line with a color depending of the selection status - if (drawUsingSelectColor()) { - GLHelper::drawText((toString(myChargingPower) + " W").c_str(), mySignPos + Position(1.2, 0), .1, 1.f, s.colorSettings.selectionColor, myBlockIcon.rotation, FONS_ALIGN_LEFT); - } else { - GLHelper::drawText((toString(myChargingPower) + " W").c_str(), mySignPos + Position(1.2, 0), .1, 1.f, s.stoppingPlaceSettings.chargingStationColor, myBlockIcon.rotation, FONS_ALIGN_LEFT); - } - // pop matrix for charging power - glPopMatrix(); - } - // Set position over sign - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // Scale matrix - glScaled(chargingStationExaggeration, chargingStationExaggeration, 1); - // Set base color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); - } - // Draw extern - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // Move to top - glTranslated(0, 0, .1); - // Set sign color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColorSign); - } - // Draw internt sign - GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); - // Draw sign 'C' depending of detail settings - if (s.drawDetail(s.detailSettings.stoppingPlaceText, chargingStationExaggeration) && !s.drawForPositionSelection) { - if (drawUsingSelectColor()) { - GLHelper::drawText("C", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); - } else { - GLHelper::drawText("C", Position(), .1, myCircleInText, s.stoppingPlaceSettings.chargingStationColor, myBlockIcon.rotation); - } - } - // Pop sign matrix - glPopMatrix(); - // Draw icon - myBlockIcon.drawIcon(s, chargingStationExaggeration); - } - // Pop base matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - drawName(getPositionInView(), s.scale, s.addName); - if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), chargingStationExaggeration, myDottedGeometry); - } - // Pop name matrix - glPopName(); - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } -} - - -std::string -GNEChargingStation::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_STARTPOS: - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return toString(myStartPosition); - } else { - return ""; - } - case SUMO_ATTR_ENDPOS: - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return toString(myEndPosition); - } else { - return ""; - } - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case SUMO_ATTR_CHARGINGPOWER: - return toString(myChargingPower); - case SUMO_ATTR_EFFICIENCY: - return toString(myEfficiency); - case SUMO_ATTR_CHARGEINTRANSIT: - return toString(myChargeInTransit); - case SUMO_ATTR_CHARGEDELAY: - return time2string(myChargeDelay); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEChargingStation::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_STARTPOS: - case SUMO_ATTR_ENDPOS: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FRIENDLY_POS: - case SUMO_ATTR_CHARGINGPOWER: - case SUMO_ATTR_EFFICIENCY: - case SUMO_ATTR_CHARGEINTRANSIT: - case SUMO_ATTR_CHARGEDELAY: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEChargingStation::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case SUMO_ATTR_CHARGINGPOWER: - return (canParse(value) && parse(value) >= 0); - case SUMO_ATTR_EFFICIENCY: - return (canParse(value) && parse(value) >= 0 && parse(value) <= 1); - case SUMO_ATTR_CHARGEINTRANSIT: - return canParse(value); - case SUMO_ATTR_CHARGEDELAY: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEChargingStation::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_STARTPOS: - if (!value.empty()) { - myStartPosition = parse(value); - myParametersSet |= STOPPINGPLACE_STARTPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; - } - break; - case SUMO_ATTR_ENDPOS: - if (!value.empty()) { - myEndPosition = parse(value); - myParametersSet |= STOPPINGPLACE_ENDPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; - } - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case SUMO_ATTR_CHARGINGPOWER: - myChargingPower = parse(value); - break; - case SUMO_ATTR_EFFICIENCY: - myEfficiency = parse(value); - break; - case SUMO_ATTR_CHARGEINTRANSIT: - myChargeInTransit = parse(value); - break; - case SUMO_ATTR_CHARGEDELAY: - myChargeDelay = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + "attribute '" + toString(key) + "' not allowed"); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEChargingStation.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEChargingStation.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEChargingStation.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEChargingStation.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,129 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEChargingStation.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNEChargingStation_h -#define GNEChargingStation_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEStoppingPlace.h" - - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEChargingStation : public GNEStoppingPlace { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] startPos Start position of the StoppingPlace - * @param[in] endPos End position of the StoppingPlace - * @param[in] name Name of busStop - * @param[in] chargingPower charging power of the charging station - * @param[in] efficiency efficiency of the charge [0,1] - * @param[in] chargeInTransit enable or disable charge in transit - * @param[in] chargeDelay delay in timeSteps in the charge - * @param[in] friendlyPos enable or disable friendly position - * @param[in] block movement enable or disable additional movement - */ - GNEChargingStation(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, - bool friendlyPosition, bool blockMovement); - - /// @brief Destructor - ~GNEChargingStation(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /// @} - -protected: - /// @brief Charging power pro timestep - double myChargingPower; - - /// @brief efficiency of the charge - double myEfficiency; - - /// @brief enable or disable charge in transit - bool myChargeInTransit; - - /// @brief delay in the starting of charge - SUMOTime myChargeDelay; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEChargingStation(const GNEChargingStation&) = delete; - - /// @brief Invalidated assignment operator. - GNEChargingStation& operator=(const GNEChargingStation&) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEClosingLaneReroute.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include "GNEClosingLaneReroute.h" -#include -#include -#include -#include - -#include -#include -#include - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEClosingLaneReroute::GNEClosingLaneReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : - GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet(), GLO_REROUTER, SUMO_TAG_CLOSING_LANE_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}), -myClosedLane(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)->getLanes().at(0)) { - // fill closing lane reroute interval with default values - setDefaultValues(); -} - - -GNEClosingLaneReroute::GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions) : - GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getViewNet(), GLO_REROUTER, SUMO_TAG_CLOSING_LANE_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, {}, {}), -myClosedLane(closedLane), -myPermissions(permissions) { -} - - -GNEClosingLaneReroute::~GNEClosingLaneReroute() {} - - -void -GNEClosingLaneReroute::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEClosingLaneReroute::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNEClosingLaneReroute::updateGeometry() { - // This additional doesn't own a geometry -} - - -void -GNEClosingLaneReroute::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNEClosingLaneReroute::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNEClosingLaneReroute::getCenteringBoundary() const { - return myClosedLane->getCenteringBoundary(); -} - - -void -GNEClosingLaneReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEClosingLaneReroute::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEClosingLaneReroute::drawGL(const GUIVisualizationSettings& /* s */) const { - // Currently this additional isn't drawn -} - - -std::string -GNEClosingLaneReroute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return myClosedLane->getID(); - case SUMO_ATTR_ALLOW: - return getVehicleClassNames(myPermissions); - case SUMO_ATTR_DISALLOW: - return getVehicleClassNames(invertPermissions(myPermissions)); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEClosingLaneReroute::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEClosingLaneReroute::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEClosingLaneReroute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - return (myViewNet->getNet()->retrieveLane(value, false) != nullptr); - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - return canParseVehicleClasses(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEClosingLaneReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEClosingLaneReroute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEClosingLaneReroute::getHierarchyName() const { - return getTagStr() + ": " + myClosedLane->getID(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEClosingLaneReroute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - myClosedLane = myViewNet->getNet()->retrieveLane(value); - break; - case SUMO_ATTR_ALLOW: - myPermissions = parseVehicleClasses(value); - break; - case SUMO_ATTR_DISALLOW: - myPermissions = invertPermissions(parseVehicleClasses(value)); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingLaneReroute.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEClosingLaneReroute.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ -#ifndef GNEClosingLaneReroute_h -#define GNEClosingLaneReroute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNELane; -class GNERerouterInterval; -class GNERerouterIntervalDialog; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEClosingLaneReroute - * forces the rerouter to close the lane - */ -class GNEClosingLaneReroute : public GNEAdditional { - -public: - /// @brief constructor (Used in GNERerouterIntervalDialog) - GNEClosingLaneReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); - - /// @brief parameter constructor - GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions); - - /// @brief destructor - ~GNEClosingLaneReroute(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief closed lane - GNELane* myClosedLane; - - // @brief Permissions of This Closing Lane Reroute - SVCPermissions myPermissions; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEClosingLaneReroute(const GNEClosingLaneReroute&) = delete; - - /// @brief Invalidated assignment operator. - GNEClosingLaneReroute& operator=(const GNEClosingLaneReroute&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingReroute.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingReroute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingReroute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,222 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEClosingReroute.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include "GNEClosingReroute.h" -#include -#include -#include - -#include -#include -#include - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEClosingReroute::GNEClosingReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : - GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet(), GLO_CALIBRATOR, SUMO_TAG_CLOSING_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}), -myClosedEdge(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)) { - // fill closing reroute interval with default values - setDefaultValues(); -} - - -GNEClosingReroute::GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions) : - GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getViewNet(), GLO_CALIBRATOR, SUMO_TAG_CLOSING_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, {}, {}), -myClosedEdge(closedEdge), -myPermissions(permissions) { -} - - -GNEClosingReroute::~GNEClosingReroute() {} - - -void -GNEClosingReroute::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEClosingReroute::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNEClosingReroute::updateGeometry() { - // This additional doesn't own a geometry -} - - -void GNEClosingReroute::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNEClosingReroute::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNEClosingReroute::getCenteringBoundary() const { - return myClosedEdge->getCenteringBoundary(); -} - - -void -GNEClosingReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEClosingReroute::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEClosingReroute::drawGL(const GUIVisualizationSettings& /* s */) const { - // Currently this additional isn't drawn -} - - -std::string -GNEClosingReroute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGE: - return myClosedEdge->getID(); - case SUMO_ATTR_ALLOW: - return getVehicleClassNames(myPermissions); - case SUMO_ATTR_DISALLOW: - return getVehicleClassNames(invertPermissions(myPermissions)); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEClosingReroute::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEClosingReroute::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: - case SUMO_ATTR_EDGE: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEClosingReroute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_EDGE: - return (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_ALLOW: - return canParseVehicleClasses(value); - case SUMO_ATTR_DISALLOW: - return canParseVehicleClasses(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEClosingReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEClosingReroute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEClosingReroute::getHierarchyName() const { - return getTagStr() + ": " + myClosedEdge->getID(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEClosingReroute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_EDGE: - myClosedEdge = myViewNet->getNet()->retrieveEdge(value); - break; - case SUMO_ATTR_ALLOW: - myPermissions = parseVehicleClasses(value); - break; - case SUMO_ATTR_DISALLOW: - myPermissions = invertPermissions(parseVehicleClasses(value)); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingReroute.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingReroute.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEClosingReroute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEClosingReroute.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,158 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEClosingReroute.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ -#ifndef GNEClosingReroute_h -#define GNEClosingReroute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNERerouterInterval; -class GNERerouterIntervalDialog; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEClosingReroute - * the rerouter to close the street (edge) - */ -class GNEClosingReroute : public GNEAdditional { - -public: - /// @brief constructor (Used in GNERerouterIntervalDialog) - GNEClosingReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); - - /// @brief parameter constructor - GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions); - - /// @brief destructor - ~GNEClosingReroute(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief closed edge - GNEEdge* myClosedEdge; - - // @brief permissions of this Closing Reroute - SVCPermissions myPermissions; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEClosingReroute(const GNEClosingReroute&) = delete; - - /// @brief Invalidated assignment operator. - GNEClosingReroute& operator=(const GNEClosingReroute&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEContainerStop.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEContainerStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEContainerStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEContainerStop.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,373 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEContainerStop.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A lane area vehicles can halt at (GNE version) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEContainerStop.h" - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEContainerStop::GNEContainerStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement) : - GNEStoppingPlace(id, viewNet, GLO_CONTAINER_STOP, SUMO_TAG_CONTAINER_STOP, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), - myLines(lines) { -} - - -GNEContainerStop::~GNEContainerStop() {} - - -void -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 shape to side - tmpShape.move2side(myViewNet->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); - - // Get position of the sign - mySignPos = tmpShape.getLineCenter(); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set block icon rotation, and using their rotation for sign - myBlockIcon.setRotation(getParentLanes().front()); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEContainerStop::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getShape(), - myViewNet->getVisualisationSettings().stoppingPlaceSettings.containerStopWidth); -} - - -Boundary -GNEContainerStop::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNEContainerStop::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double containerStopExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(containerStopExaggeration)) { - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, getType()); - // Set color of the base - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); - } - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GNEGeometry::drawGeometry(myViewNet, myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * containerStopExaggeration); - // Check if the distance is enought to draw details and if is being drawn for selecting - if (s.drawForRectangleSelection) { - // only draw circle depending of distance between sign and mouse cursor - if (myViewNet->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { - // Add a draw matrix for details - glPushMatrix(); - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(containerStopExaggeration, containerStopExaggeration, 1); - // set color - GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // pop draw matrix - glPopMatrix(); - } - } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, containerStopExaggeration)) { - // Add a draw matrix for details - glPushMatrix(); - // only draw lines if we aren't in draw for position selection - if (!s.drawForPositionSelection) { - // Iterate over every line - for (int i = 0; i < (int)myLines.size(); ++i) { - // push a new matrix for every line - glPushMatrix(); - // Rotate and traslaste - glTranslated(mySignPos.x(), mySignPos.y(), 0); - glRotated(-1 * myBlockIcon.rotation, 0, 0, 1); - // draw line with a color depending of the selection status - if (drawUsingSelectColor()) { - GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT); - } else { - GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.stoppingPlaceSettings.containerStopColor, 0, FONS_ALIGN_LEFT); - } - // pop matrix for every line - glPopMatrix(); - } - } - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(containerStopExaggeration, containerStopExaggeration, 1); - // Set color of the externe circle - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); - } - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // Traslate to front - glTranslated(0, 0, .1); - // Set color of the inner circle - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.containerStopColorSign); - } - // draw another circle in the same position, but a little bit more small - GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); - // draw text depending of detail settings - if (s.drawDetail(s.detailSettings.stoppingPlaceText, containerStopExaggeration) && !s.drawForPositionSelection) { - if (drawUsingSelectColor()) { - GLHelper::drawText("C", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); - } else { - GLHelper::drawText("C", Position(), .1, myCircleInText, s.stoppingPlaceSettings.containerStopColor, myBlockIcon.rotation); - } - } - // pop draw matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, containerStopExaggeration); - } - // pop draw matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), containerStopExaggeration, myDottedGeometry); - } - // Pop name - glPopName(); - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } -} - - -std::string -GNEContainerStop::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_STARTPOS: - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return toString(myStartPosition); - } else { - return ""; - } - case SUMO_ATTR_ENDPOS: - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return toString(myEndPosition); - } else { - return ""; - } - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case SUMO_ATTR_LINES: - return joinToString(myLines, " "); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEContainerStop::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_STARTPOS: - case SUMO_ATTR_ENDPOS: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FRIENDLY_POS: - case SUMO_ATTR_LINES: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEContainerStop::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case SUMO_ATTR_LINES: - return canParse >(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEContainerStop::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_STARTPOS: - if (!value.empty()) { - myStartPosition = parse(value); - myParametersSet |= STOPPINGPLACE_STARTPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; - } - break; - case SUMO_ATTR_ENDPOS: - if (!value.empty()) { - myEndPosition = parse(value); - myParametersSet |= STOPPINGPLACE_ENDPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; - } - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case SUMO_ATTR_LINES: - myLines = GNEAttributeCarrier::parse >(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEContainerStop.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEContainerStop.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEContainerStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEContainerStop.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,119 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEContainerStop.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A class for visualizing busStop geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNEContainerStop_h -#define GNEContainerStop_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEStoppingPlace.h" - - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEContainerStop - * @brief A lane area vehicles can halt at (netedit-version) - */ -class GNEContainerStop : public GNEStoppingPlace { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] startPos Start position of the StoppingPlace - * @param[in] endPos End position of the StoppingPlace - * @param[in] name Name of busStop - * @param[in] lines lines of the busStop - * @param[in] friendlyPos enable or disable friendly position - * @param[in] block movement enable or disable additional movement - */ - GNEContainerStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement); - - /// @brief Destructor - ~GNEContainerStop(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /// @} - -protected: - /// @brief The list of lines that are assigned to this stop - std::vector myLines; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEContainerStop(const GNEContainerStop&) = delete; - - /// @brief Invalidated assignment operator. - GNEContainerStop& operator=(const GNEContainerStop&) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDestProbReroute.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include - -#include "GNEDestProbReroute.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDestProbReroute::GNEDestProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : - GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet(), GLO_REROUTER, SUMO_TAG_DEST_PROB_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}), -myNewEdgeDestination(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)) { - // fill dest prob reroute interval with default values - setDefaultValues(); -} - - -GNEDestProbReroute::GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability): - GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getViewNet(), GLO_REROUTER, SUMO_TAG_DEST_PROB_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, {}, {}), -myNewEdgeDestination(newEdgeDestination), -myProbability(probability) { -} - - -GNEDestProbReroute::~GNEDestProbReroute() {} - - -void -GNEDestProbReroute::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEDestProbReroute::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - -void -GNEDestProbReroute::updateGeometry() { - // This additional doesn't own a geometry -} - - -void -GNEDestProbReroute::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNEDestProbReroute::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNEDestProbReroute::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNEDestProbReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEDestProbReroute::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEDestProbReroute::drawGL(const GUIVisualizationSettings&) const { - // Currently This additional isn't drawn -} - - -std::string -GNEDestProbReroute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGE: - return myNewEdgeDestination->getID(); - case SUMO_ATTR_PROB: - return toString(myProbability); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEDestProbReroute::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEDestProbReroute::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: - case SUMO_ATTR_EDGE: - case SUMO_ATTR_PROB: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDestProbReroute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_EDGE: - return (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_PROB: - return canParse(value) && parse(value) >= 0 && parse(value) <= 1; - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDestProbReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEDestProbReroute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEDestProbReroute::getHierarchyName() const { - return getTagStr() + ": " + myNewEdgeDestination->getID(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEDestProbReroute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_EDGE: - myNewEdgeDestination = myViewNet->getNet()->retrieveEdge(value); - break; - case SUMO_ATTR_PROB: - myProbability = parse(value); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDestProbReroute.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDestProbReroute.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ -#ifndef GNEDestProbReroute_h -#define GNEDestProbReroute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEEdge; -class GNERerouterInterval; -class GNERerouterIntervalDialog; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDestProbReroute - * forces the rerouter to assign a new route - */ -class GNEDestProbReroute : public GNEAdditional { - -public: - /// @brief constructor (Used in GNERerouterIntervalDialog) - GNEDestProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); - - /// @brief constructor - GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability); - - /// @brief destructor - ~GNEDestProbReroute(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief id of new edge destination - GNEEdge* myNewEdgeDestination; - - /// @brief probability with which a vehicle will use the given edge as destination - double myProbability; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDestProbReroute(const GNEDestProbReroute&) = delete; - - /// @brief Invalidated assignment operator. - GNEDestProbReroute& operator=(const GNEDestProbReroute&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetector.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetector.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetector.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,148 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetector.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include - -#include "GNEDetector.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetector::GNEDetector(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes) : - GNEAdditional(id, viewNet, type, tag, name, blockMovement, {}, parentLanes, {}, {}, {}, {}, {}, {}, {}, {}), - myPositionOverLane(pos), - myFreq(freq), - myFilename(filename), - myVehicleTypes(vehicleTypes), -myFriendlyPosition(friendlyPos) { -} - - -GNEDetector::GNEDetector(GNEAdditional* additionalParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - double pos, SUMOTime freq, const std::string& filename, const std::string& name, bool friendlyPos, - bool blockMovement, const std::vector& parentLanes) : - GNEAdditional(additionalParent, viewNet, type, tag, name, blockMovement, {}, parentLanes, {}, {additionalParent}, {}, {}, {}, {}, {}, {}), -myPositionOverLane(pos), -myFreq(freq), -myFilename(filename), -myFriendlyPosition(friendlyPos) { -} - - -GNEDetector::~GNEDetector() {} - - -double -GNEDetector::getPositionOverLane() const { - return myPositionOverLane; -} - - -GNELane* -GNEDetector::getLane() const { - return getParentLanes().front(); -} - - -Position -GNEDetector::getPositionInView() const { - return getLane()->getLaneShape().positionAtOffset(getGeometryPositionOverLane()); -} - - -Boundary -GNEDetector::getCenteringBoundary() const { - if (getParentLanes().size() > 1) { - return mySegmentGeometry.getBoxBoundary().grow(10); - } else { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); - } -} - - -void -GNEDetector::splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) { - // only split geometry of E2 multilane detectors - if (myTagProperty.getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && - (originalElement->getTagProperty().getTag() == SUMO_TAG_LANE)) { - // obtain new list of E2 lanes - std::string newE2Lanes = getNewListOfParents(originalElement, newElement); - // update E2 Lanes - if (newE2Lanes.size() > 0) { - setAttribute(SUMO_ATTR_LANES, newE2Lanes, undoList); - } - } - } else if (splitPosition < myPositionOverLane) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust start position - setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); - } -} - - -double -GNEDetector::getGeometryPositionOverLane() const { - double fixedPos = myPositionOverLane; - const double len = getLane()->getParentEdge()->getNBEdge()->getFinalLength(); - if (fixedPos < 0) { - fixedPos += len; - } - GNEAdditionalHandler::checkAndFixDetectorPosition(fixedPos, len, true); - return fixedPos * getLane()->getLengthGeometryFactor(); -} - - -double -GNEDetector::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -std::string -GNEDetector::getParentName() const { - return getLane()->getMicrosimID(); -} - - -std::string -GNEDetector::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNEDetector::getHierarchyName() const { - return getTagStr(); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,400 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE1.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDetectorE1.h" -#include "GNEAdditionalHandler.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetectorE1::GNEDetectorE1(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) : - GNEDetector(id, viewNet, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, { - lane -}) { -} - - -GNEDetectorE1::~GNEDetectorE1() { -} - - -bool -GNEDetectorE1::isAdditionalValid() const { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } -} - - -std::string -GNEDetectorE1::getAdditionalProblem() const { - // declare variable for error position - std::string errorPosition; - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // check positions over lane - if (myPositionOverLane < -len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); - } - if (myPositionOverLane > len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); - } - return errorPosition; -} - - -void -GNEDetectorE1::fixAdditionalProblem() { - // declare new position - double newPositionOverLane = myPositionOverLane; - // fix pos and length checkAndFixDetectorPosition - GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position - setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myViewNet->getUndoList()); -} - - -void -GNEDetectorE1::moveGeometry(const Position& offset) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - const bool storeNegative = myPositionOverLane < 0; - myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); - if (storeNegative) { - myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } - // Update geometry - updateGeometry(); -} - - -void -GNEDetectorE1::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_end(); -} - - -void -GNEDetectorE1::updateGeometry() { - // update geometry - myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set offset of the block icon - myBlockIcon.offset = Position(-1, 0); - - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(getParentLanes().front()); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEDetectorE1::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getPosition(), - myAdditionalGeometry.getRotation(), - myViewNet->getVisualisationSettings().detectorSettings.E1Width, - myViewNet->getVisualisationSettings().detectorSettings.E1Height); -} - - -void -GNEDetectorE1::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double E1Exaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(E1Exaggeration)) { - // obtain scaledSize - const double scaledWidth = s.detectorSettings.E1Width * 0.5 * s.scale; - // start drawing - glPushName(getGlID()); - glLineWidth(1.0); - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.detectorSettings.E1Color); - } - // draw shape - glPushMatrix(); - glTranslated(0, 0, getType()); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glScaled(E1Exaggeration, E1Exaggeration, 1); - glBegin(GL_QUADS); - glVertex2d(-1.0, 2); - glVertex2d(-1.0, -2); - glVertex2d(1.0, -2); - glVertex2d(1.0, 2); - glEnd(); - glTranslated(0, 0, .01); - glBegin(GL_LINES); - glVertex2d(0, 2 - .1); - glVertex2d(0, -2 + .1); - glEnd(); - // outline if isn't being drawn for selecting - if ((scaledWidth * E1Exaggeration > 1) && !s.drawForRectangleSelection) { - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glBegin(GL_QUADS); - glVertex2f(-1.0, 2); - glVertex2f(-1.0, -2); - glVertex2f(1.0, -2); - glVertex2f(1.0, 2); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - // position indicator if isn't being drawn for selecting - if ((scaledWidth * E1Exaggeration > 1) && !s.drawForRectangleSelection) { - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glRotated(90, 0, 0, -1); - glBegin(GL_LINES); - glVertex2d(0, 1.7); - glVertex2d(0, -1.7); - glEnd(); - } - // Pop shape matrix - glPopMatrix(); - // Check if the distance is enought to draw details and isn't being drawn for selecting - if ((s.drawDetail(s.detailSettings.detectorDetails, E1Exaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); - // Rotate depending of myBlockIcon.rotation - glRotated(myBlockIcon.rotation, 0, 0, -1); - //move to logo position - glTranslated(-1, 0, 0); - // scale text - glScaled(E1Exaggeration, E1Exaggeration, 1); - // draw E1 logo - if (drawUsingSelectColor()) { - GLHelper::drawText("E1", Position(), .1, 1.5, s.colorSettings.selectionColor); - } else { - GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK); - } - // pop matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, E1Exaggeration); - } - // Finish draw if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), E1Exaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -std::string -GNEDetectorE1::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_FREQUENCY: - return time2string(myFreq); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_VTYPES: - return myVehicleTypes; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEDetectorE1::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_FREQUENCY: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_FRIENDLY_POS: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - -} - - -bool -GNEDetectorE1::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidDetectorID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_POSITION: - return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - case SUMO_ATTR_FREQUENCY: - return (canParse(value) && (parse(value) >= 0)); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_VTYPES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE1::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_FREQUENCY: - myFreq = parse(value); - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_VTYPES: - myVehicleTypes = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE1.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNEDetectorE1_h -#define GNEDetectorE1_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDetector.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDetectorE1 - * Class for detector of type E1 - */ -class GNEDetectorE1 : public GNEDetector { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position of the detector on the lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] name E1 detector name - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorE1(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); - - /// @brief Destructor - ~GNEDetectorE1(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML - bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem - std::string getAdditionalProblem() const; - - /// @brief fix additional problem - void fixAdditionalProblem(); - /// @} - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDetectorE1(const GNEDetectorE1&) = delete; - - /// @brief Invalidated assignment operator. - GNEDetectorE1& operator=(const GNEDetectorE1&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,390 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE1Instant.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2018 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDetectorE1Instant.h" -#include "GNEAdditionalHandler.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetectorE1Instant::GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) : - GNEDetector(id, viewNet, GLO_E1DETECTOR_INSTANT, SUMO_TAG_INSTANT_INDUCTION_LOOP, pos, 0, filename, vehicleTypes, name, friendlyPos, blockMovement, { - lane -}) { -} - - -GNEDetectorE1Instant::~GNEDetectorE1Instant() { -} - - -bool -GNEDetectorE1Instant::isAdditionalValid() const { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } -} - - -std::string -GNEDetectorE1Instant::getAdditionalProblem() const { - // declare variable for error position - std::string errorPosition; - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // check positions over lane - if (myPositionOverLane < -len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); - } - if (myPositionOverLane > len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); - } - return errorPosition; -} - - -void -GNEDetectorE1Instant::fixAdditionalProblem() { - // declare new position - double newPositionOverLane = myPositionOverLane; - // fix pos and length checkAndFixDetectorPosition - GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position - setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myViewNet->getUndoList()); -} - - -void -GNEDetectorE1Instant::moveGeometry(const Position& offset) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - const bool storeNegative = myPositionOverLane < 0; - myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); - if (storeNegative) { - myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } - // Update geometry - updateGeometry(); -} - - -void -GNEDetectorE1Instant::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_end(); -} - - -void -GNEDetectorE1Instant::updateGeometry() { - // update geometry - myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set offset of the block icon - myBlockIcon.offset = Position(-1, 0); - - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(getParentLanes().front()); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void GNEDetectorE1Instant::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getPosition(), - myAdditionalGeometry.getRotation(), - myViewNet->getVisualisationSettings().detectorSettings.E1InstantWidth, - myViewNet->getVisualisationSettings().detectorSettings.E1InstantHeight); -} - - -void -GNEDetectorE1Instant::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double E1InstantExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(E1InstantExaggeration)) { - // obtain scaledSize - const double scaledWidth = s.detectorSettings.E1InstantWidth * 0.5 * s.scale; - // start drawing - glPushName(getGlID()); - glLineWidth(1.0); - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.detectorSettings.E1InstantColor); - } - // draw shape - glPushMatrix(); - glTranslated(0, 0, getType()); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glScaled(E1InstantExaggeration, E1InstantExaggeration, 1); - glBegin(GL_QUADS); - glVertex2d(-1.0, 2); - glVertex2d(-1.0, -2); - glVertex2d(1.0, -2); - glVertex2d(1.0, 2); - glEnd(); - glTranslated(0, 0, .01); - glBegin(GL_LINES); - glVertex2d(0, 2 - .1); - glVertex2d(0, -2 + .1); - glEnd(); - // outline if isn't being drawn for selecting - if ((scaledWidth * E1InstantExaggeration > 1) && !s.drawForRectangleSelection) { - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - glBegin(GL_QUADS); - glVertex2f(-1.0, 2); - glVertex2f(-1.0, -2); - glVertex2f(1.0, -2); - glVertex2f(1.0, 2); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - } - // position indicator if isn't being drawn for selecting - if ((scaledWidth * E1InstantExaggeration > 1) && !s.drawForRectangleSelection) { - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glRotated(90, 0, 0, -1); - glBegin(GL_LINES); - glVertex2d(0, 1.7); - glVertex2d(0, -1.7); - glEnd(); - } - // Pop shape matrix - glPopMatrix(); - // Check if the distance is enought to draw details and isn't being drawn for selecting - if ((s.drawDetail(s.detailSettings.detectorDetails, E1InstantExaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); - // Rotate depending of myBlockIcon.rotation - glRotated(myBlockIcon.rotation, 0, 0, -1); - //move to logo position - glTranslated(-1, 0, 0); - // scale text - glScaled(E1InstantExaggeration, E1InstantExaggeration, 1); - // draw E1 logo - if (drawUsingSelectColor()) { - GLHelper::drawText("E1", Position(), .1, 1.5, s.colorSettings.selectionColor); - } else { - GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK); - } - // pop matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, E1InstantExaggeration); - } - // Finish draw if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), E1InstantExaggeration, myDottedGeometry); - } - glPopName(); - } -} - - -std::string -GNEDetectorE1Instant::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_VTYPES: - return myVehicleTypes; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEDetectorE1Instant::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_FRIENDLY_POS: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - -} - - -bool -GNEDetectorE1Instant::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidDetectorID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_POSITION: - return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_VTYPES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE1Instant::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_VTYPES: - myVehicleTypes = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE1Instant.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,146 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE1Instant.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2018 -/// -// -/****************************************************************************/ -#ifndef GNEDetectorE1Instant_h -#define GNEDetectorE1Instant_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDetector.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDetectorE1Instant - * Class for detector of type E1 - */ -class GNEDetectorE1Instant : public GNEDetector { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position of the detector on the lane - * @param[in] filename The path to the output file. - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] name E1 Instant detector name - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); - - /// @brief Destructor - ~GNEDetectorE1Instant(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML - bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem - std::string getAdditionalProblem() const; - - /// @brief fix additional problem - void fixAdditionalProblem(); - /// @} - - /// @name inherited from GNEDetector - /// @{ - /// @brief check if Position of detector is fixed - bool isDetectorPositionFixed() const; - - /// @brief get lane - GNELane* getLane() const; - /// @} - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDetectorE1Instant(const GNEDetectorE1Instant&) = delete; - - /// @brief Invalidated assignment operator. - GNEDetectorE1Instant& operator=(const GNEDetectorE1Instant&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE2.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE2.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE2.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE2.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,641 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE2.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDetectorE2.h" -#include "GNEAdditionalHandler.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetectorE2::GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, double length, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) : - GNEDetector(id, viewNet, GLO_E2DETECTOR, SUMO_TAG_E2DETECTOR, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, { - lane -}), -myLength(length), -myEndPositionOverLane(0.), -myTimeThreshold(timeThreshold), -mySpeedThreshold(speedThreshold), -myJamThreshold(jamThreshold), -myE2valid(true) { -} - - -GNEDetectorE2::GNEDetectorE2(const std::string& id, std::vector lanes, GNEViewNet* viewNet, double pos, double endPos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) : - GNEDetector(id, viewNet, GLO_E2DETECTOR, SUMO_TAG_E2DETECTOR_MULTILANE, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, lanes), - myLength(0), - myEndPositionOverLane(endPos), - myTimeThreshold(timeThreshold), - mySpeedThreshold(speedThreshold), - myJamThreshold(jamThreshold), - myE2valid(true) { -} - - -GNEDetectorE2::~GNEDetectorE2() { -} - - -bool -GNEDetectorE2::isAdditionalValid() const { - if (getParentLanes().size() == 1) { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - return (myPositionOverLane >= 0) && ((myPositionOverLane + myLength) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - } - } else { - // first check if there is connection between all consecutive lanes - if (myE2valid) { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - return (myPositionOverLane >= 0) && ((myPositionOverLane) <= getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength() && - myEndPositionOverLane >= 0) && ((myEndPositionOverLane) <= getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()); - } - } else { - return false; - } - } -} - - -std::string -GNEDetectorE2::getAdditionalProblem() const { - // declare variable for error position - std::string errorFirstLanePosition, separator, errorLastLanePosition; - if (getParentLanes().size() == 1) { - // check positions over lane - if (myPositionOverLane < 0) { - errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " < 0"); - } - if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); - } - if ((myPositionOverLane + myLength) > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " + " + toString(SUMO_ATTR_LENGTH) + " > lanes's length"); - } - } else { - if (myE2valid) { - // check positions over first lane - if (myPositionOverLane < 0) { - errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " < 0"); - } - if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); - } - // check positions over last lane - if (myEndPositionOverLane < 0) { - errorLastLanePosition = (toString(SUMO_ATTR_ENDPOS) + " < 0"); - } - if (myEndPositionOverLane > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorLastLanePosition = (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); - } - } else { - errorFirstLanePosition = "lanes aren't consecutives"; - } - } - // check separator - if ((errorFirstLanePosition.size() > 0) && (errorLastLanePosition.size() > 0)) { - separator = " and "; - } - // return error message - return errorFirstLanePosition + separator + errorLastLanePosition; -} - - -void -GNEDetectorE2::fixAdditionalProblem() { - if (getParentLanes().size() == 1) { - // obtain position and length - double newPositionOverLane = myPositionOverLane; - double newLength = myLength; - // fix pos and length using fixE2DetectorPosition - GNEAdditionalHandler::fixE2DetectorPosition(newPositionOverLane, newLength, getParentLanes().at(0)->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position and length - setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myViewNet->getUndoList()); - setAttribute(SUMO_ATTR_LENGTH, toString(myLength), myViewNet->getUndoList()); - } else { - if (!myE2valid) { - // build connections between all consecutive lanes - bool foundConnection = true; - int i = 0; - // iterate over all lanes, and stop if myE2valid is false - while (i < ((int)getParentLanes().size() - 1)) { - // change foundConnection to false - foundConnection = false; - // if a connection betwen "from" lane and "to" lane of connection is found, change myE2valid to true again - for (auto j : getParentLanes().at(i)->getParentEdge()->getGNEConnections()) { - if (j->getLaneFrom() == getParentLanes().at(i) && j->getLaneTo() == getParentLanes().at(i + 1)) { - foundConnection = true; - } - } - // if connection wasn't found - if (!foundConnection) { - // create new connection manually - NBEdge::Connection newCon(getParentLanes().at(i)->getIndex(), getParentLanes().at(i + 1)->getParentEdge()->getNBEdge(), getParentLanes().at(i + 1)->getIndex()); - // allow to undo creation of new lane - myViewNet->getUndoList()->add(new GNEChange_Connection(getParentLanes().at(i)->getParentEdge(), newCon, false, true), true); - } - // update lane iterator - i++; - } - } else { - // declare new position - double newPositionOverLane = myPositionOverLane; - // fix pos and length checkAndFixDetectorPosition - GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position - setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myViewNet->getUndoList()); - // declare new end position - double newEndPositionOverLane = myEndPositionOverLane; - // fix pos and length checkAndFixDetectorPosition - GNEAdditionalHandler::checkAndFixDetectorPosition(newEndPositionOverLane, getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position - setAttribute(SUMO_ATTR_ENDPOS, toString(newEndPositionOverLane), myViewNet->getUndoList()); - } - } -} - - -void -GNEDetectorE2::moveGeometry(const Position& offset) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myMove.originalViewPosition, false); - // move geometry depending of number of lanes - if (getParentLanes().size() == 1) { - // calculate new position over lane - double newPositionOverLane = parse(myMove.firstOriginalLanePosition) + offsetLane; - // obtain lane length - double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getLane()->getLengthGeometryFactor(); - if (newPositionOverLane < 0) { - myPositionOverLane = 0; - } else if (newPositionOverLane + myLength > laneLength) { - myPositionOverLane = laneLength - myLength; - } else { - myPositionOverLane = newPositionOverLane; - } - } else { - // calculate new start and end positions - double newStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; - double newEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; - // change start and end position of E2 detector ONLY if both extremes aren't overpassed - if ((newStartPosition >= 0) && (newStartPosition <= getParentLanes().front()->getLaneShapeLength()) && - (newEndPosition >= 0) && (newEndPosition <= getParentLanes().back()->getLaneShapeLength())) { - myPositionOverLane = newStartPosition; - myEndPositionOverLane = newEndPosition; - } - } - // Update geometry - updateGeometry(); -} - - -void -GNEDetectorE2::commitGeometryMoving(GNEUndoList* undoList) { - // commit geometry moving depending of number of lanes - if (getParentLanes().size() == 1) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_end(); - } else { - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ENDPOS, toString(myEndPositionOverLane), true, myMove.secondOriginalPosition)); - undoList->p_end(); - } -} - - -void -GNEDetectorE2::updateGeometry() { - // declare variables for start and end positions - double startPosFixed, endPosFixed; - - // calculate start and end positions dependin of number of lanes - if (getParentLanes().size() == 1) { - - // set start position - if (myPositionOverLane < 0) { - startPosFixed = 0; - } else if (myPositionOverLane > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { - startPosFixed = getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(); - } else { - startPosFixed = myPositionOverLane; - } - - // set end position - if ((myPositionOverLane + myLength) < 0) { - endPosFixed = 0; - } else if ((myPositionOverLane + myLength) > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { - endPosFixed = getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(); - } else { - endPosFixed = (myPositionOverLane + myLength); - } - - // Cut shape using as delimitators fixed start position and fixed end position - myAdditionalGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), startPosFixed * getParentLanes().front()->getLengthGeometryFactor(), endPosFixed * getParentLanes().back()->getLengthGeometryFactor()); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - } else if (getParentLanes().size() > 1) { - GNEGeometry::calculateLaneGeometricPath(this, mySegmentGeometry, getParentLanes(), myPositionOverLane, myEndPositionOverLane); - /* - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.multiShape.front().getLineCenter(); - - // check integrity - checkE2MultilaneIntegrity(); - */ - } - - // Set offset of the block icon - myBlockIcon.offset = Position(-0.75, 0); - - // Set block icon rotation, and using their rotation for draw logo - myBlockIcon.setRotation(getParentLanes().front()); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEDetectorE2::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getShape(), - myViewNet->getVisualisationSettings().detectorSettings.E2Width); -} - - -double -GNEDetectorE2::getLength() const { - return myLength; -} - - -void -GNEDetectorE2::checkE2MultilaneIntegrity() { - // we assume that E2 is valid - myE2valid = true; - int i = 0; - // iterate over all lanes, and stop if myE2valid is false - while (i < ((int)getParentLanes().size() - 1) && myE2valid) { - // set myE2valid to false - myE2valid = false; - // if a connection betwen "from" lane and "to" lane of connection is found, change myE2valid to true again - for (auto j : getParentLanes().at(i)->getParentEdge()->getGNEConnections()) { - if (j->getLaneFrom() == getParentLanes().at(i) && j->getLaneTo() == getParentLanes().at(i + 1)) { - myE2valid = true; - } - } - // update iterator - i++; - } -} - - -void -GNEDetectorE2::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double E2Exaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if ((myTagProperty.getTag() == SUMO_TAG_E2DETECTOR) && s.drawAdditionals(E2Exaggeration)) { - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, getType()); - // Set color of the base - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - // set color depending if is or isn't valid - if (myE2valid) { - GLHelper::setColor(s.detectorSettings.E2Color); - } else { - GLHelper::setColor(RGBColor::RED); - } - } - // check if we have to drawn a E2 single lane or a E2 multiLane - if (myAdditionalGeometry.getShape().size() > 0) { - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GNEGeometry::drawGeometry(myViewNet, myAdditionalGeometry, s.detectorSettings.E2Width * E2Exaggeration); - } - // Pop last matrix - glPopMatrix(); - // Check if the distance is enougth to draw details and isn't being drawn for selecting - if ((s.drawDetail(s.detailSettings.detectorDetails, E2Exaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - // draw logo depending if this is an Multilane E2 detector - if (myTagProperty.getTag() == SUMO_TAG_E2DETECTOR) { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); - // Rotate depending of myBlockIcon.rotation - glRotated(myBlockIcon.rotation, 0, 0, -1); - // move to logo position - glTranslated(-0.75, 0, 0); - // scale text - glScaled(E2Exaggeration, E2Exaggeration, 1); - // draw E2 logo - if (drawUsingSelectColor()) { - GLHelper::drawText("E2", Position(), .1, 1.5, s.colorSettings.selectionColor); - } else { - GLHelper::drawText("E2", Position(), .1, 1.5, RGBColor::BLACK); - } - } else { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(myBlockIcon.position.x(), myBlockIcon.position.y(), getType() + 0.1); - // Rotate depending of myBlockIcon.rotation - glRotated(myBlockIcon.rotation, 0, 0, -1); - //move to logo position - glTranslated(-1.5, 0, 0); - // scale text - glScaled(E2Exaggeration, E2Exaggeration, 1); - // draw E2 logo - if (drawUsingSelectColor()) { - GLHelper::drawText("E2", Position(), .1, 1.5, s.colorSettings.selectionColor); - } else { - GLHelper::drawText("E2", Position(), .1, 1.5, RGBColor::BLACK); - } - //move to logo position - glTranslated(1.2, 0, 0); - // Rotate depending of myBlockIcon.rotation - glRotated(90, 0, 0, 1); - if (drawUsingSelectColor()) { - GLHelper::drawText("multi", Position(), .1, 0.9, s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::drawText("multi", Position(), .1, 0.9, RGBColor::BLACK); - } - } - // pop matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, E2Exaggeration); - } - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - if (myAdditionalGeometry.getShape().size() > 0) { - GNEGeometry::drawShapeDottedContour(s, getType(), E2Exaggeration, myDottedGeometry); - } - } - // Pop name - glPopName(); - } -} - - -std::string -GNEDetectorE2::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - case SUMO_ATTR_LANES: - return parseIDs(getParentLanes()); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_ENDPOS: - return toString(myEndPositionOverLane); - case SUMO_ATTR_FREQUENCY: - return time2string(myFreq); - case SUMO_ATTR_LENGTH: - return toString(myLength); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_VTYPES: - return myVehicleTypes; - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return time2string(myTimeThreshold); - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - return toString(mySpeedThreshold); - case SUMO_ATTR_JAM_DIST_THRESHOLD: - return toString(myJamThreshold); - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEDetectorE2::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_LANES: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_ENDPOS: - case SUMO_ATTR_FREQUENCY: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - case SUMO_ATTR_JAM_DIST_THRESHOLD: - case SUMO_ATTR_FRIENDLY_POS: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE2::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidDetectorID(value); - case SUMO_ATTR_LANE: - if (value.empty()) { - return false; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_LANES: - if (value.empty()) { - return false; - } else if (canParse >(myViewNet->getNet(), value, false)) { - // check if lanes are consecutives - return lanesConsecutives(parse >(myViewNet->getNet(), value)); - } else { - return false; - } - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_ENDPOS: - return canParse(value); - case SUMO_ATTR_FREQUENCY: - return (canParse(value) && (parse(value) >= 0)); - case SUMO_ATTR_LENGTH: - return (canParse(value) && (parse(value) >= 0)); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_VTYPES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return canParse(value); - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - return (canParse(value) && (parse(value) >= 0)); - case SUMO_ATTR_JAM_DIST_THRESHOLD: - return (canParse(value) && (parse(value) >= 0)); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE2::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEDetectorE2::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - case SUMO_ATTR_LANES: - replaceParentLanes(this, value); - checkE2MultilaneIntegrity(); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_ENDPOS: - myEndPositionOverLane = parse(value); - break; - case SUMO_ATTR_FREQUENCY: - myFreq = parse(value); - break; - case SUMO_ATTR_LENGTH: - myLength = parse(value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_VTYPES: - myVehicleTypes = value; - break; - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - myTimeThreshold = parse(value); - break; - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - mySpeedThreshold = parse(value); - break; - case SUMO_ATTR_JAM_DIST_THRESHOLD: - myJamThreshold = parse(value); - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE2.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE2.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE2.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE2.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE2.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNEDetectorE2_h -#define GNEDetectorE2_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDetector.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDetectorE2 - * class for detector of type E2 - */ -class GNEDetectorE2 : public GNEDetector { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position of the detector on the lane - * @param[in] length The length of the detector in meters. - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] name E2 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] speedThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, double length, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); - - /**@brief Constructor for Multi-Lane detectors - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] lanes vector of lanes Lane of this StoppingPlace belongs - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position of the detector on the first lane - * @param[in] endPos position of the detector on the last lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] name E2 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] speedThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorE2(const std::string& id, std::vector lanes, GNEViewNet* viewNet, double pos, double endPos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, - const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); - - /// @brief Destructor - ~GNEDetectorE2(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML - bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem - std::string getAdditionalProblem() const; - - /// @brief fix additional problem - void fixAdditionalProblem(); - /// @} - - /// @brief get length of E2 Detector - double getLength() const; - - /// @brief check if E2 is valid (all of their lanes are connected, it must called after every operation which involves lane's connections) - void checkE2MultilaneIntegrity(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -protected: - /// @brief E2 detector length - double myLength; - - /// @brief end position over lane (only for Multilane E2 detectors) - double myEndPositionOverLane; - - /// @brief The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - SUMOTime myTimeThreshold; - - /// @brief The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - double mySpeedThreshold; - - /// @brief The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam - double myJamThreshold; - - /// @brief flag to check if E2 multilane is valid or invalid - bool myE2valid; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDetectorE2(const GNEDetectorE2&) = delete; - - /// @brief Invalidated assignment operator. - GNEDetectorE2& operator=(const GNEDetectorE2&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE3.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE3.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE3.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE3.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,391 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE3.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDetectorE3.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetectorE3::GNEDetectorE3(const std::string& id, GNEViewNet* viewNet, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement) : - GNEAdditional(id, viewNet, GLO_E3DETECTOR, SUMO_TAG_E3DETECTOR, name, blockMovement, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), - myPosition(pos), - myFreq(freq), - myFilename(filename), - myVehicleTypes(vehicleTypes), - myTimeThreshold(timeThreshold), -mySpeedThreshold(speedThreshold) { -} - - -GNEDetectorE3::~GNEDetectorE3() {} - - -void -GNEDetectorE3::updateGeometry() { - // Set block icon position - myBlockIcon.position = myPosition; - - // Set block icon offset - myBlockIcon.offset = Position(-0.5, -0.5); - - // Set block icon rotation, and using their rotation for draw logo - myBlockIcon.setRotation(); - - // Update connection's geometry - myChildConnections.update(); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEDetectorE3::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), myPosition, 0, - myViewNet->getVisualisationSettings().detectorSettings.E3Size, - myViewNet->getVisualisationSettings().detectorSettings.E3Size); -} - - -Position -GNEDetectorE3::getPositionInView() const { - return myPosition; -} - - -Boundary -GNEDetectorE3::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else { - Boundary b; - b.add(myPosition); - b.grow(5); - return b; - } -} - - -void -GNEDetectorE3::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEDetectorE3::moveGeometry(const Position& offset) { - // restore old position, apply offset and update Geometry - myPosition = myMove.originalViewPosition; - myPosition.add(offset); - // filtern position using snap to active grid - // filtern position using snap to active grid - myPosition = myViewNet->snapToActiveGrid(myPosition); - updateGeometry(); -} - - -void -GNEDetectorE3::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPosition), true, toString(myMove.originalViewPosition))); - undoList->p_end(); -} - - -std::string -GNEDetectorE3::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -void -GNEDetectorE3::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double E3Exaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(E3Exaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(myPosition.x(), myPosition.y(), getType()); - // scale - glScaled(E3Exaggeration, E3Exaggeration, 1); - // Draw icon depending of detector is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, E3Exaggeration)) { - glColor3d(1, 1, 1); - glRotated(180, 0, 0, 1); - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_E3SELECTED), s.detectorSettings.E3Size); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_E3), s.detectorSettings.E3Size); - } - } else { - GLHelper::setColor(RGBColor::GREY); - GLHelper::drawBoxLine(Position(0, s.detectorSettings.E3Size), 0, 2 * s.detectorSettings.E3Size, s.detectorSettings.E3Size); - } - // Pop logo matrix - glPopMatrix(); - // Show Lock icon depending - myBlockIcon.drawIcon(s, E3Exaggeration, 0.4); - // Draw child connections - drawChildConnections(s, getType()); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), E3Exaggeration, myDottedGeometry); - // draw shape dotte contour aroud alld connections between child and parents - for (auto i : myChildConnections.connectionPositions) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); - } - } - // Pop name - glPopName(); - } -} - - -std::string -GNEDetectorE3::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_POSITION: - return toString(myPosition); - case SUMO_ATTR_FREQUENCY: - return time2string(myFreq); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_VTYPES: - return myVehicleTypes; - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return time2string(myTimeThreshold); - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - return toString(mySpeedThreshold); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEDetectorE3::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEDetectorE3::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: { - // change ID of Entry - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Entry/Exits children - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(i->getTagProperty().getTag()), undoList); - } - break; - } - case SUMO_ATTR_FREQUENCY: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE3::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidDetectorID(value); - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_FREQUENCY: - return canParse(value); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_VTYPES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return canParse(value); - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - return canParse(value) && (parse(value) >= 0); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorE3::checkChildAdditionalRestriction() const { - int numEntrys = 0; - int numExits = 0; - // iterate over additional chidls and obtain number of entrys and exits - for (auto i : getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_DET_ENTRY) { - numEntrys++; - } else if (i->getTagProperty().getTag() == SUMO_TAG_DET_EXIT) { - numExits++; - } - } - // write warnings - if (numEntrys == 0) { - WRITE_WARNING("An " + toString(SUMO_TAG_E3DETECTOR) + " need at least one " + toString(SUMO_TAG_DET_ENTRY) + " detector"); - } - if (numExits == 0) { - WRITE_WARNING("An " + toString(SUMO_TAG_E3DETECTOR) + " need at least one " + toString(SUMO_TAG_DET_EXIT) + " detector"); - } - // return false depending of number of Entrys and Exits - return ((numEntrys != 0) && (numExits != 0)); -} - - -bool -GNEDetectorE3::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEDetectorE3::getPopUpID() const { - return getTagStr() + ":" + getID(); -} - - -std::string -GNEDetectorE3::getHierarchyName() const { - return getTagStr(); -} - - -void -GNEDetectorE3::updateParentAdditional() { - myChildConnections.update(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEDetectorE3::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_POSITION: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myPosition = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_FREQUENCY: - myFreq = parse(value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_VTYPES: - myVehicleTypes = value; - break; - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - myTimeThreshold = parse(value); - break; - case SUMO_ATTR_HALTING_SPEED_THRESHOLD: - mySpeedThreshold = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE3.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE3.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorE3.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorE3.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorE3.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNEDetectorE3_h -#define GNEDetectorE3_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDetectorE3 - * Class for multy Entry/multy Exits detectors - */ -class GNEDetectorE3 : public GNEAdditional { - -public: - /**@brief GNEDetectorE3 Constructor - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position (center) of the detector in the map - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] name E3 detector name - * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorE3(const std::string& id, GNEViewNet* viewNet, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement); - - /// @brief GNEDetectorE3 Destructor - ~GNEDetectorE3(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - - /// @name inherited from GNEHierarchicalChildElements - /// @{ - /// @brief update parent after add or remove a child - void updateParentAdditional(); - /// @} - -protected: - /// @brief position of E3 in view - Position myPosition; - - /// @brief frequency of E3 detector - SUMOTime myFreq; - - /// @brief fielname of E3 detector - std::string myFilename; - - /// @brief attribute vehicle types - std::string myVehicleTypes; - - /// @brief The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting - SUMOTime myTimeThreshold; - - /// @brief The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting - double mySpeedThreshold; - -private: - /// @brief check restriction with the number of children - bool checkChildAdditionalRestriction() const; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDetectorE3(const GNEDetectorE3&) = delete; - - /// @brief Invalidated assignment operator. - GNEDetectorE3& operator=(const GNEDetectorE3&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,388 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorEntryExit.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDetectorEntryExit.h" -#include "GNEAdditionalHandler.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet* viewNet, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) : - GNEDetector(parent, viewNet, GLO_DET_ENTRY, entryExitTag, pos, 0, "", "", friendlyPos, blockMovement, { - lane -}) { - //check that this is a TAZ Source OR a TAZ Sink - if ((entryExitTag != SUMO_TAG_DET_ENTRY) && (entryExitTag != SUMO_TAG_DET_EXIT)) { - throw InvalidArgument("Invalid E3 Child Tag"); - } -} - - -GNEDetectorEntryExit::~GNEDetectorEntryExit() {} - - -bool -GNEDetectorEntryExit::isAdditionalValid() const { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } -} - - -std::string -GNEDetectorEntryExit::getAdditionalProblem() const { - // declare variable for error position - std::string errorPosition; - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // check positions over lane - if (myPositionOverLane < -len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); - } - if (myPositionOverLane > len) { - errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); - } - return errorPosition; -} - - -void -GNEDetectorEntryExit::fixAdditionalProblem() { - // declare new position - double newPositionOverLane = myPositionOverLane; - // fix pos and length checkAndFixDetectorPosition - GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); - // set new position - setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myViewNet->getUndoList()); -} - - -void -GNEDetectorEntryExit::moveGeometry(const Position& offset) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - const bool storeNegative = myPositionOverLane < 0; - myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); - if (storeNegative) { - myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } - // Update geometry - updateGeometry(); -} - - -void -GNEDetectorEntryExit::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPositionOverLane), true, myMove.firstOriginalLanePosition)); - undoList->p_end(); -} - - -void -GNEDetectorEntryExit::updateGeometry() { - // update geometry - myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set offset of the block icon - myBlockIcon.offset = Position(-1, 0); - - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(getParentLanes().front()); - - // update E3 parent children - getParentAdditionals().at(0)->updateChildConnections(); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEDetectorEntryExit::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getPosition(), - myAdditionalGeometry.getRotation(), - myViewNet->getVisualisationSettings().detectorSettings.E3EntryExitWidth, - myViewNet->getVisualisationSettings().detectorSettings.E3EntryExitHeight); -} - - -void -GNEDetectorEntryExit::drawGL(const GUIVisualizationSettings& s) const { - // Set initial values - const double entryExitExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(entryExitExaggeration)) { - // Start drawing adding gl identificator - glPushName(getGlID()); - // Push detector matrix - glPushMatrix(); - glTranslated(0, 0, getType()); - // Set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { - GLHelper::setColor(s.detectorSettings.E3EntryColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { - GLHelper::setColor(s.detectorSettings.E3ExitColor); - } - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - // Push polygon matrix - glPushMatrix(); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glScaled(entryExitExaggeration, entryExitExaggeration, 1); - // draw details if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - // Draw polygon - glBegin(GL_LINES); - glVertex2d(1.7, 0); - glVertex2d(-1.7, 0); - glEnd(); - glBegin(GL_QUADS); - glVertex2d(-1.7, .5); - glVertex2d(-1.7, -.5); - glVertex2d(1.7, -.5); - glVertex2d(1.7, .5); - glEnd(); - // first Arrow - glTranslated(1.5, 0, 0); - GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); - GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); - // second Arrow - glTranslated(-3, 0, 0); - GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); - GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); - } else { - // Draw square in drawy for selecting mode - glBegin(GL_QUADS); - glVertex2d(-1.7, 4.3); - glVertex2d(-1.7, -.5); - glVertex2d(1.7, -.5); - glVertex2d(1.7, 4.3); - glEnd(); - } - // Pop polygon matrix - glPopMatrix(); - // Pop detector matrix - glPopMatrix(); - // Check if the distance is enought to draw details - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.detectorDetails, entryExitExaggeration)) { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); - // Rotate depending of myBlockIcon.rotation - glRotated(myBlockIcon.rotation, 0, 0, -1); - //move to logo position - glTranslated(1.9, 0, 0); - // scale - glScaled(entryExitExaggeration, entryExitExaggeration, 1); - // draw Entry or Exit logo if isn't being drawn for selecting - if (s.drawForRectangleSelection || s.drawForPositionSelection) { - GLHelper::setColor(s.detectorSettings.E3EntryColor); - GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); - } else if (drawUsingSelectColor()) { - GLHelper::drawText("E3", Position(), .1, 2.8, s.colorSettings.selectedAdditionalColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { - GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3EntryColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { - GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3ExitColor); - } - //move to logo position - glTranslated(1.7, 0, 0); - // Rotate depending of myBlockIcon.rotation - glRotated(90, 0, 0, 1); - // draw Entry or Exit text if isn't being drawn for selecting - if (s.drawForRectangleSelection || s.drawForPositionSelection) { - GLHelper::setColor(s.detectorSettings.E3EntryColor); - GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); - } else if (drawUsingSelectColor()) { - if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { - GLHelper::drawText("Entry", Position(), .1, 1, s.colorSettings.selectedAdditionalColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { - GLHelper::drawText("Exit", Position(), .1, 1, s.colorSettings.selectedAdditionalColor); - } - } else { - if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { - GLHelper::drawText("Entry", Position(), .1, 1, s.detectorSettings.E3EntryColor); - } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { - GLHelper::drawText("Exit", Position(), .1, 1, s.detectorSettings.E3ExitColor); - } - } - // pop matrix - glPopMatrix(); - // draw lock icon - myBlockIcon.drawIcon(s, entryExitExaggeration, 0.4); - } - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), entryExitExaggeration, myDottedGeometry); - } - // pop gl identificator - glPopName(); - } -} - - -std::string -GNEDetectorEntryExit::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_POSITION: - return toString(myPositionOverLane); - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEDetectorEntryExit::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: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_FRIENDLY_POS: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_PARENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorEntryExit::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - return (myViewNet->getNet()->retrieveLane(value, false) != nullptr); - case SUMO_ATTR_POSITION: - return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_PARENT: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_E3DETECTOR, value, false) != nullptr); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEDetectorEntryExit::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -void -GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myPositionOverLane = parse(value); - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_PARENT: - replaceParentAdditional(this, value, 0); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetectorEntryExit.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,140 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetectorEntryExit.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNEDetectorEntryExit_h -#define GNEDetectorEntryExit_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDetector.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEDetectorE3; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDetectorEntryExit - * Class for detector of type Entry - */ -class GNEDetectorEntryExit : public GNEDetector { - -public: - /**@brief Constructor - * @param[in] entryExitTag Child Tag (Either SUMO_TAG_DET_ENTRY or SUMO_TAG_DET_EXIT) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] parent pointer to GNEDetectorE3 of this GNEDetectorEntryExit belongs - * @param[in] lane Lane of this detector is placed - * @param[in] pos position of the detector on the lane - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - */ - GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNEViewNet* viewNet, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); - - /// @brief destructor - ~GNEDetectorEntryExit(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML - bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem - std::string getAdditionalProblem() const; - - /// @brief fix additional problem - void fixAdditionalProblem(); - /// @} - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEDetectorEntryExit(const GNEDetectorEntryExit&) = delete; - - /// @brief Invalidated assignment operator. - GNEDetectorEntryExit& operator=(const GNEDetectorEntryExit&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetector.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetector.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEDetector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEDetector.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,208 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDetector.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// A abstract class to define common parameters of detectors placed over lanes -/****************************************************************************/ -#ifndef GNEDetector_h -#define GNEDetector_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEdetector - * @briefA abstract class to define common parameters and functions of detectors - */ -class GNEDetector : public GNEAdditional { - -public: - /**@brief Constructor. - * @param[in] id Gl-id of the detector (Must be unique) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] type GUIGlObjectType of detector - * @param[in] tag Type of xml tag that define the detector (SUMO_TAG_E1DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, etc...) - * @param[in] pos position of the detector on the lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] vehicleTypes space separated list of vehicle type ids to consider - * @param[in] filename The path to the output file. - * @param[in] name detector name - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - * @param[in] parentLanes vector of parent lanes - */ - GNEDetector(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, double pos, SUMOTime freq, const std::string& filename, - const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes); - - /**@brief Constructor. - * @param[in] additionalParent parent additional of this detector (ID will be generated automatically) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] type GUIGlObjectType of detector - * @param[in] tag Type of xml tag that define the detector (SUMO_TAG_E1DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, etc...) - * @param[in] pos position of the detector on the lane - * @param[in] freq the aggregation period the values the detector collects shall be summed up. - * @param[in] filename The path to the output file. - * @param[in] name detector name - * @param[in] friendlyPos enable or disable friendly positions - * @param[in] block movement enable or disable additional movement - * @param[in] parentLanes vector of parent lanes - */ - GNEDetector(GNEAdditional* additionalParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, double pos, SUMOTime freq, const std::string& filename, - const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes); - - /// @brief Destructor - ~GNEDetector(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML (must be reimplemented in all detector children) - virtual bool isAdditionalValid() const = 0; - - /// @brief return a string with the current additional problem (must be reimplemented in all detector children) - virtual std::string getAdditionalProblem() const = 0; - - /// @brief fix additional problem (must be reimplemented in all detector children) - virtual void fixAdditionalProblem() = 0; - /// @} - - /// @brief get lane - GNELane* getLane() const; - - /// @brief get position over lane - double getPositionOverLane() const; - - /// @brief get position over lane that is applicable to the shape - double getGeometryPositionOverLane() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - virtual void moveGeometry(const Position& offset) = 0; - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; - - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGLObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name 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 - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /* @brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - -protected: - /// @brief position of detector over Lane - double myPositionOverLane; - - /// @brief The aggregation period the values the detector collects shall be summed up. - SUMOTime myFreq; - - /// @brief The path to the output file - std::string myFilename; - - /// @brief attribute vehicle types - std::string myVehicleTypes; - - /// @brief Flag for friendly position - bool myFriendlyPosition; - -private: - /// @brief set attribute after validation - virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - - /// @brief Invalidate return position of additional - const Position& getPosition() const = delete; - - /// @brief Invalidate set new position in the view - void setPosition(const Position& pos) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingArea.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingArea.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingArea.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,437 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingArea.cpp -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// A lane area vehicles can park at (GNE version) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEParkingArea.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement) : - GNEStoppingPlace(id, viewNet, GLO_PARKING_AREA, SUMO_TAG_PARKING_AREA, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), - myRoadSideCapacity(roadSideCapacity), - myOnRoad(onRoad), - myWidth(width), - myLength(length), - myAngle(angle) { -} - - -GNEParkingArea::~GNEParkingArea() {} - - -void -GNEParkingArea::updateGeometry() { - // first check if object has to be removed from grid (SUMOTree) - if (!myMove.movingGeometryBoundary.isInitialised()) { - myViewNet->getNet()->removeGLObjectFromGrid(this); - } - - // Get value of option "lefthand" - double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; - - // Update common geometry of stopping place - setStoppingPlaceGeometry(getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) / 2 + myWidth); - - // Obtain a copy of the shape - PositionVector tmpShape = myAdditionalGeometry.getShape(); - - // Move shape to side - tmpShape.move2side(1.5 * offsetSign); - - // Get position of the sign - mySignPos = tmpShape.getLineCenter(); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set block icon rotation, and using their rotation for sign - myBlockIcon.setRotation(getParentLanes().front()); - - // last step is to check if object has to be added into grid (SUMOTree) again - if (!myMove.movingGeometryBoundary.isInitialised()) { - myViewNet->getNet()->addGLObjectIntoGrid(this); - } - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEParkingArea::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), myAdditionalGeometry.getShape(), myWidth); -} - - -Boundary -GNEParkingArea::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else if (myAdditionalGeometry.getShape().size() > 0) { - Boundary b = myAdditionalGeometry.getShape().getBoxBoundary(); - b.grow(myWidth + 1); - return b; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNEParkingArea::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEParkingArea::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double parkingAreaExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(parkingAreaExaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // Push name - glPushName(getGlID()); - // Push base matrix - glPushMatrix(); - // Traslate matrix - glTranslated(0, 0, getType()); - // Set Color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColor); - } - // Draw base - GNEGeometry::drawGeometry(myViewNet, myAdditionalGeometry, myWidth * parkingAreaExaggeration); - // Check if the distance is enought to draw details and if is being drawn for selecting - if (s.drawForRectangleSelection) { - // only draw circle depending of distance between sign and mouse cursor - if (myViewNet->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { - // Add a draw matrix for details - glPushMatrix(); - // Start drawing sign traslating matrix to signal position - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // scale matrix depending of the exaggeration - glScaled(parkingAreaExaggeration, parkingAreaExaggeration, 1); - // set color - GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); - // Draw circle - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // pop draw matrix - glPopMatrix(); - } - } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) { - // Push matrix for details - glPushMatrix(); - // Set position over sign - glTranslated(mySignPos.x(), mySignPos.y(), 0); - // Scale matrix - glScaled(parkingAreaExaggeration, parkingAreaExaggeration, 1); - // Set base color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColor); - } - // Draw extern - GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); - // Move to top - glTranslated(0, 0, .1); - // Set sign color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColorSign); - } - // Draw internt sign - GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); - // Draw sign 'C' - if (s.drawDetail(s.detailSettings.stoppingPlaceText, parkingAreaExaggeration) && !s.drawForPositionSelection) { - if (drawUsingSelectColor()) { - GLHelper::drawText("P", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); - } else { - GLHelper::drawText("P", Position(), .1, myCircleInText, s.stoppingPlaceSettings.parkingAreaColor, myBlockIcon.rotation); - } - } - // Pop sign matrix - glPopMatrix(); - // Draw icon - myBlockIcon.drawIcon(s, parkingAreaExaggeration); - } - // Pop base matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - drawName(getPositionInView(), s.scale, s.addName); - if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), parkingAreaExaggeration, myDottedGeometry); - } - // Pop name matrix - glPopName(); - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } -} - - -std::string -GNEParkingArea::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_STARTPOS: - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return toString(myStartPosition); - } else { - return ""; - } - case SUMO_ATTR_ENDPOS: - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return toString(myEndPosition); - } else { - return ""; - } - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FRIENDLY_POS: - return toString(myFriendlyPosition); - case SUMO_ATTR_ROADSIDE_CAPACITY: - return toString(myRoadSideCapacity); - case SUMO_ATTR_ONROAD: - return toString(myOnRoad); - case SUMO_ATTR_WIDTH: - return toString(myWidth); - case SUMO_ATTR_LENGTH: - return myLength; - case SUMO_ATTR_ANGLE: - return toString(myAngle); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEParkingArea::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: { - // change ID of Entry - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Parking Spaces - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_PARKING_SPACE), undoList); - } - break; - } - case SUMO_ATTR_LANE: - case SUMO_ATTR_STARTPOS: - case SUMO_ATTR_ENDPOS: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FRIENDLY_POS: - case SUMO_ATTR_ROADSIDE_CAPACITY: - case SUMO_ATTR_ONROAD: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_ANGLE: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FRIENDLY_POS: - return canParse(value); - case SUMO_ATTR_ROADSIDE_CAPACITY: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_ONROAD: - return canParse(value); - case SUMO_ATTR_WIDTH: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_LENGTH: - if (value.empty()) { - return true; - } else { - return canParse(value) && (parse(value) > 0); - } - case SUMO_ATTR_ANGLE: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - break; - case SUMO_ATTR_STARTPOS: - myViewNet->getNet()->removeGLObjectFromGrid(this); - if (!value.empty()) { - myStartPosition = parse(value); - myParametersSet |= STOPPINGPLACE_STARTPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; - } - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_ENDPOS: - myViewNet->getNet()->removeGLObjectFromGrid(this); - if (!value.empty()) { - myEndPosition = parse(value); - myParametersSet |= STOPPINGPLACE_ENDPOS_SET; - } else { - myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; - } - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FRIENDLY_POS: - myFriendlyPosition = parse(value); - break; - case SUMO_ATTR_ROADSIDE_CAPACITY: - myRoadSideCapacity = parse(value); - break; - case SUMO_ATTR_ONROAD: - myOnRoad = parse(value); - break; - case SUMO_ATTR_WIDTH: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myWidth = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_LENGTH: - myLength = value; - break; - case SUMO_ATTR_ANGLE: - myAngle = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingArea.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingArea.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingArea.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingArea.h -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// A class for visualizing ParkingArea geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNEParkingArea_h -#define GNEParkingArea_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEStoppingPlace.h" - - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEParkingArea - * @brief A lane area vehicles can park at (netedit-version) - */ -class GNEParkingArea : public GNEStoppingPlace { - -public: - /**@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 - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] startPos Start position of the StoppingPlace - * @param[in] endPos End position of the StoppingPlace - * @param[in] name Name of ParkingArea - * @param[in] friendlyPos enable or disable friendly position - * @param[in] roadSideCapacity road side capacity of ParkingArea - * @param[in] width ParkingArea's length - * @param[in] length ParkingArea's length - * @param[in] angle ParkingArea's angle - * @param[in] block movement enable or disable additional movement - */ - GNEParkingArea(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet, - const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, - double angle, bool blockMovement); - - /// @brief Destructor - ~GNEParkingArea(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /// @} - -protected: - /// @brief roadside capacity of Parking Area - int myRoadSideCapacity; - - /// @brief Whether vehicles stay on the road - bool myOnRoad; - - /// @brief width of Parking Area - double myWidth; - - /// @brief Length of Parking Area (by default (endPos - startPos) / roadsideCapacity - std::string myLength; - - /// @brief Angle of Parking Area - double myAngle; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEParkingArea(const GNEParkingArea&) = delete; - - /// @brief Invalidated assignment operator. - GNEParkingArea& operator=(const GNEParkingArea&) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingAreaReroute.cpp -/// @author Jakob Erdmann -/// @date May 2018 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include - -#include "GNEParkingAreaReroute.h" -#include -#include -#include - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEParkingAreaReroute::GNEParkingAreaReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : - GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet(), GLO_REROUTER, SUMO_TAG_PARKING_ZONE_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet()->getNet()->getAttributeCarriers().additionals.at(SUMO_TAG_PARKING_AREA).begin()->second}, {}, {}, {}, {}, {}, {}) { - // fill route type with default values - setDefaultValues(); -} - - -GNEParkingAreaReroute::GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible): - GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getViewNet(), GLO_REROUTER, SUMO_TAG_PARKING_ZONE_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalParent, newParkingArea}, {}, {}, {}, {}, {}, {}), -myProbability(probability), -myVisible(visible) { -} - - -GNEParkingAreaReroute::~GNEParkingAreaReroute() {} - - -void -GNEParkingAreaReroute::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEParkingAreaReroute::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNEParkingAreaReroute::updateGeometry() { - // This additional doesn't own a geometry -} - - -void -GNEParkingAreaReroute::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNEParkingAreaReroute::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNEParkingAreaReroute::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNEParkingAreaReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEParkingAreaReroute::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEParkingAreaReroute::drawGL(const GUIVisualizationSettings& /* s */) const { - // Currently this additional isn't drawn -} - - -std::string -GNEParkingAreaReroute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_PARKING: - return getParentAdditionals().at(1)->getID(); - case SUMO_ATTR_PROB: - return toString(myProbability); - case SUMO_ATTR_VISIBLE: - return toString(myVisible); - case GNE_ATTR_PARENT: - return toString(getParentAdditionals().at(0)->getID()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEParkingAreaReroute::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEParkingAreaReroute::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: - case SUMO_ATTR_PARKING: - case SUMO_ATTR_PROB: - case SUMO_ATTR_VISIBLE: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEParkingAreaReroute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_PARKING: - return isValidAdditionalID(value) && (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); - case SUMO_ATTR_PROB: - return canParse(value) && parse(value) >= 0 && parse(value) <= 1; - case SUMO_ATTR_VISIBLE: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEParkingAreaReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEParkingAreaReroute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEParkingAreaReroute::getHierarchyName() const { - return getTagStr() + ": " + getParentAdditionals().at(1)->getID(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEParkingAreaReroute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_PARKING: - replaceParentAdditional(this, value, 1); - break; - case SUMO_ATTR_PROB: - myProbability = parse(value); - break; - case SUMO_ATTR_VISIBLE: - myVisible = parse(value); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingAreaReroute.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingAreaReroute.h -/// @author Jakob Erdmann -/// @date May 2018 -/// -// -/****************************************************************************/ -#ifndef GNEParkingAreaReroute_h -#define GNEParkingAreaReroute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEEdge; -class GNERerouterInterval; -class GNERerouterIntervalDialog; -class GNEParkingArea; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEParkingAreaReroute - * forces the rerouter to assign a new route - */ -class GNEParkingAreaReroute : public GNEAdditional { - -public: - /// @brief constructor (Used in GNERerouterIntervalDialog) - GNEParkingAreaReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); - - /// @brief constructor - GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible); - - /// @brief destructor - ~GNEParkingAreaReroute(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief probability with which a vehicle will use the given edge as destination - double myProbability; - - /// @brief enable or disable visibility of Parking Area Reroute - bool myVisible; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEParkingAreaReroute(const GNEParkingAreaReroute&) = delete; - - /// @brief Invalidated assignment operator. - GNEParkingAreaReroute& operator=(const GNEParkingAreaReroute&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingSpace.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingSpace.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingSpace.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingSpace.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,342 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingSpace.cpp -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// A lane area vehicles can halt at (GNE version) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include - -#include "GNEParkingSpace.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEParkingSpace::GNEParkingSpace(GNEViewNet* viewNet, GNEAdditional* parkingAreaParent, const Position& pos, double width, double length, double angle, bool blockMovement) : - GNEAdditional(parkingAreaParent, viewNet, GLO_PARKING_SPACE, SUMO_TAG_PARKING_SPACE, "", blockMovement, {}, {}, {}, {parkingAreaParent}, {}, {}, {}, {}, {}, {}), - myPosition(pos), - myWidth(width), - myLength(length), -myAngle(angle) { -} - - -GNEParkingSpace::~GNEParkingSpace() {} - - -void -GNEParkingSpace::moveGeometry(const Position& offset) { - // restore old position, apply offset and update Geometry - myPosition = myMove.originalViewPosition; - myPosition.add(offset); - // filtern position using snap to active grid - myPosition = myViewNet->snapToActiveGrid(myPosition); - updateGeometry(); -} - - -void -GNEParkingSpace::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPosition), true, toString(myMove.originalViewPosition))); - undoList->p_end(); -} - - -void -GNEParkingSpace::updateGeometry() { - // Nothing to update -} - - -void -GNEParkingSpace::updateDottedContour() { - // calculate shape using a Position vector as reference - PositionVector shape({ - {-(myWidth / 2), 0}, - { (myWidth / 2), 0}, - { (myWidth / 2), myLength}, - {-(myWidth / 2), myLength}, - }); - // close shape - shape.closePolygon(); - // rotate position vector (note: convert from degree to rads - shape.rotate2D(myAngle * PI / 180.0); - // move to space position - shape.add(myPosition); - // set dotted geometry - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), shape); -} - - -Position -GNEParkingSpace::getPositionInView() const { - return myPosition; -} - - -Boundary -GNEParkingSpace::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else { - // calculate shape using a Position vector as reference - PositionVector boundaryShape({ - {-(myWidth / 2), 0}, - { (myWidth / 2), 0}, - { (myWidth / 2), myLength}, - {-(myWidth / 2), myLength}, - }); - // rotate position vector (note: convert from degree to rads - boundaryShape.rotate2D(myAngle * PI / 180.0); - // move to space position - boundaryShape.add(myPosition); - // return boundary associated to boundaryShape - return boundaryShape.getBoxBoundary().grow(5); - } -} - - -void -GNEParkingSpace::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEParkingSpace::getParentName() const { - return getParentAdditionals().at(0)->getMicrosimID(); -} - - -void -GNEParkingSpace::drawGL(const GUIVisualizationSettings& s) const { - // Set initial values - const double parkingAreaExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(parkingAreaExaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // push name and matrix - glPushName(getGlID()); - glPushMatrix(); - // Traslate matrix and draw green contour - glTranslated(myPosition.x(), myPosition.y(), getType() + 0.1); - glRotated(myAngle, 0, 0, 1); - // only drawn small box if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - // Set Color depending of selection - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.parkingSpaceColorContour); - } - GLHelper::drawBoxLine(Position(0, myLength + 0.05), 0, myLength + 0.1, (myWidth / 2) + 0.05); - } - // Traslate matrix and draw blue innen - glTranslated(0, 0, 0.1); - // Set Color depending of selection - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.stoppingPlaceSettings.parkingSpaceColor); - } - GLHelper::drawBoxLine(Position(0, myLength), 0, myLength, myWidth / 2); - // Traslate matrix and draw lock icon if isn't being drawn for selecting - glTranslated(0, myLength / 2, 0.1); - myBlockIcon.drawIcon(s, parkingAreaExaggeration); - // pop draw matrix - glPopMatrix(); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), parkingAreaExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -std::string -GNEParkingSpace::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_POSITION: - return toString(myPosition); - case SUMO_ATTR_WIDTH: - return toString(myWidth); - case SUMO_ATTR_LENGTH: - return toString(myLength); - case SUMO_ATTR_ANGLE: - return toString(myAngle); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEParkingSpace::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEParkingSpace::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: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_ANGLE: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_PARENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEParkingSpace::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_WIDTH: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_LENGTH: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_ANGLE: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_PARENT: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEParkingSpace::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEParkingSpace::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEParkingSpace::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_POSITION); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEParkingSpace::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_POSITION: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myPosition = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_WIDTH: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myWidth = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_LENGTH: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myLength = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_ANGLE: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myAngle = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_PARENT: - replaceParentAdditional(this, value, 0); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingSpace.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingSpace.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEParkingSpace.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEParkingSpace.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEParkingSpace.h -/// @author Pablo Alvarez Lopez -/// @date Feb 2018 -/// -// A class for visualizing ParkingSpace geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNEParkingSpace_h -#define GNEParkingSpace_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEParkingArea; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEParkingSpace - * @brief vehicle space used by GNEParkingAreas - */ -class GNEParkingSpace : public GNEAdditional { - -public: - /**@brief Constructor - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] parkingAreaParent pointer to Parking Area parent - * @param[in] pos ParkingSpace's X-Y position - * @param[in] width ParkingArea's width - * @param[in] length ParkingArea's length - * @param[in] angle ParkingArea's angle - * @param[in] block movement enable or disable additional movement - */ - GNEParkingSpace(GNEViewNet* viewNet, GNEAdditional* parkingAreaParent, const Position& pos, double width, double length, double angle, bool blockMovement); - - /// @brief Destructor - ~GNEParkingSpace(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief position of Parking Space in view - Position myPosition; - - /// @brief width of Parking Space - double myWidth; - - /// @brief Length of Parking Space - double myLength; - - /// @brief Angle of Parking Space - double myAngle; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEParkingSpace(const GNEParkingSpace&) = delete; - - /// @brief Invalidated assignment operator. - GNEParkingSpace& operator=(const GNEParkingSpace&) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPOI.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPOI.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPOI.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPOI.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,547 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPOI.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// A class for visualizing and editing POIS in netedit (adapted from -// GUIPointOfInterest and NLHandler) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPOI.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEPOI::GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, - const Position& pos, bool geo, double layer, double angle, const std::string& imgFile, - bool relativePath, double width, double height, bool movementBlocked) : - GUIPointOfInterest(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, width, height), - GNEShape(net, SUMO_TAG_POI, movementBlocked, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}) { - // set GEO Position - myGEOPosition = pos; - GeoConvHelper::getFinal().cartesian2geo(myGEOPosition); -} - - -GNEPOI::GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, - double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane, double posLat, - double width, double height, bool movementBlocked) : - GUIPointOfInterest(id, type, color, Position(), false, lane->getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height), - GNEShape(net, SUMO_TAG_POILANE, movementBlocked, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}) { -} - - -GNEPOI::~GNEPOI() {} - - -std::string -GNEPOI::generateChildID(SumoXMLTag childTag) { - int counter = myNet->getPOIs().size(); - while (myNet->retrievePOI(getID() + toString(childTag) + toString(counter), false) != nullptr) { - counter++; - } - return (getID() + toString(childTag) + toString(counter)); -} - - -void -GNEPOI::startGeometryMoving() { -} - - -void -GNEPOI::endGeometryMoving() { -} - - -void -GNEPOI::writeShape(OutputDevice& device) { - if (getParentLanes().size() > 0) { - // obtain fixed position over lane - double fixedPositionOverLane = myPosOverLane > getParentLanes().at(0)->getLaneShape().length() ? getParentLanes().at(0)->getLaneShape().length() : myPosOverLane < 0 ? 0 : myPosOverLane; - // write POILane using POI::writeXML - writeXML(device, false, 0, getParentLanes().at(0)->getID(), fixedPositionOverLane, myPosLat); - } else { - writeXML(device, myGeo); - } -} - - -void -GNEPOI::moveGeometry(const Position& oldPos, const Position& offset) { - if (!myBlockMovement) { - // Calculate new position using old position - Position newPosition = oldPos; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); - // set position depending of POI Type - if (getParentLanes().size() > 0) { - myPosOverLane = getParentLanes().at(0)->getLaneShape().nearest_offset_to_point2D(newPosition, false); - } else { - set(newPosition); - } - // Update geometry - updateGeometry(); - } -} - - -void -GNEPOI::commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList) { - if (!myBlockMovement) { - // restore original Position before moving (to avoid problems in GL Tree) - Position myNewPosition(*this); - set(oldPos); - // commit new position allowing undo/redo - if (getParentLanes().size() > 0) { - // restore old position before commit new position - double originalPosOverLane = getParentLanes().at(0)->getLaneShape().nearest_offset_to_point2D(oldPos, false); - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_POSITION, toString(myPosOverLane), true, toString(originalPosOverLane))); - undoList->p_end(); - } else { - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_POSITION, toString(myNewPosition), true, toString(oldPos))); - undoList->p_end(); - } - } -} - - -void -GNEPOI::updateGeometry() { - if (getParentLanes().size() > 0) { - // obtain fixed position over lane - double fixedPositionOverLane = myPosOverLane > getParentLanes().at(0)->getLaneShapeLength() ? getParentLanes().at(0)->getLaneShapeLength() : myPosOverLane < 0 ? 0 : myPosOverLane; - // set new position regarding to lane - set(getParentLanes().at(0)->getLaneShape().positionAtOffset(fixedPositionOverLane * getParentLanes().at(0)->getLengthGeometryFactor(), -myPosLat)); - } - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEPOI::updateDottedContour() { - // check if we have to calculate buuble or shape - if (getShapeImgFile() != DEFAULT_IMG_FILE) { - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), *this, getShapeNaviDegree(), getWidth(), getHeight()); - } else { - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), GNEGeometry::getVertexCircleAroundPosition(*this, 1.5, 32)); - } -} - - -Position -GNEPOI::getPositionInView() const { - return Position(x(), y()); -} - - -Boundary -GNEPOI::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMovingGeometryBoundary.isInitialised()) { - return myMovingGeometryBoundary; - } else { - return GUIPointOfInterest::getCenteringBoundary(); - } -} - - -GUIGlID -GNEPOI::getGlID() const { - return GUIPointOfInterest::getGlID(); -} - - -std::string -GNEPOI::getParentName() const { - return myNet->getMicrosimID(); -} - - -GUIGLObjectPopupMenu* -GNEPOI::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - if (getParentLanes().size() > 0) { - // build shape header - buildShapePopupOptions(app, ret, getShapeType()); - // add option for convert to GNEPOI - new FXMenuCommand(ret, ("Release from " + toString(SUMO_TAG_LANE)).c_str(), GUIIconSubSys::getIcon(ICON_LANE), &parent, MID_GNE_POI_TRANSFORM); - return ret; - } else { - // build shape header - buildShapePopupOptions(app, ret, getShapeType()); - // add option for convert to GNEPOI - new FXMenuCommand(ret, ("Attach to nearest " + toString(SUMO_TAG_LANE)).c_str(), GUIIconSubSys::getIcon(ICON_LANE), &parent, MID_GNE_POI_TRANSFORM); - } - return ret; -} - - -GUIParameterTableWindow* -GNEPOI::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) { - return GUIPointOfInterest::getParameterWindow(app, parent); -} - - -void -GNEPOI::drawGL(const GUIVisualizationSettings& s) const { - // first check if POI can be drawn - if (myNet->getViewNet()->getDemandViewOptions().showShapes()) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // check if POI can be drawn - if (checkDraw(s)) { - // obtain POIExaggeration - const double POIExaggeration = s.poiSize.getExaggeration(s, this); - // push name (needed for getGUIGlObjectsUnderCursor(...) - glPushName(getGlID()); - // draw inner polygon - drawInnerPOI(s, drawUsingSelectColor()); - // draw an orange square mode if there is an image(see #4036) - if (!getShapeImgFile().empty() && myNet->getViewNet()->getTestingMode().isTestingEnabled()) { - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(x(), y(), getType() + 0.01); - GLHelper::setColor(RGBColor::ORANGE); - GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); - glPopMatrix(); - } - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), POIExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } - } -} - - -std::string -GNEPOI::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return myID; - case SUMO_ATTR_COLOR: - return toString(getShapeColor()); - case SUMO_ATTR_LANE: - return myLane; - case SUMO_ATTR_POSITION: - if (getParentLanes().size() > 0) { - return toString(myPosOverLane); - } else { - return toString(*this); - } - case SUMO_ATTR_POSITION_LAT: - return toString(myPosLat); - case SUMO_ATTR_GEOPOSITION: - return toString(myGEOPosition, gPrecisionGeo); - case SUMO_ATTR_GEO: - return toString(myGeo); - case SUMO_ATTR_TYPE: - return getShapeType(); - case SUMO_ATTR_LAYER: - if (getShapeLayer() == Shape::DEFAULT_LAYER_POI) { - return "default"; - } else { - return toString(getShapeLayer()); - } - case SUMO_ATTR_IMGFILE: - return getShapeImgFile(); - case SUMO_ATTR_RELATIVEPATH: - return toString(getShapeRelativePath()); - case SUMO_ATTR_WIDTH: - return toString(getWidth()); - case SUMO_ATTR_HEIGHT: - return toString(getHeight()); - case SUMO_ATTR_ANGLE: - return toString(getShapeNaviDegree()); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " attribute '" + toString(key) + "' not allowed"); - } -} - - -void -GNEPOI::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: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_LANE: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_POSITION_LAT: - case SUMO_ATTR_GEOPOSITION: - case SUMO_ATTR_GEO: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_LAYER: - case SUMO_ATTR_IMGFILE: - case SUMO_ATTR_RELATIVEPATH: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_HEIGHT: - case SUMO_ATTR_ANGLE: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEPOI::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrievePOI(value, false) == nullptr); - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_LANE: - return (myNet->retrieveLane(value, false) != nullptr); - case SUMO_ATTR_POSITION: - if (getParentLanes().size() > 0) { - return canParse(value); - } else { - return canParse(value); - } - case SUMO_ATTR_POSITION_LAT: - return canParse(value); - case SUMO_ATTR_GEOPOSITION: { - return canParse(value); - } - case SUMO_ATTR_GEO: - return canParse(value); - case SUMO_ATTR_TYPE: - return true; - case SUMO_ATTR_LAYER: - if (value == "default") { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_IMGFILE: - if (value == "") { - return true; - } else { - // check that image can be loaded - return GUITexturesHelper::getTextureID(value) != -1; - } - case SUMO_ATTR_RELATIVEPATH: - return canParse(value); - case SUMO_ATTR_WIDTH: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_HEIGHT: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_ANGLE: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEPOI::isAttributeEnabled(SumoXMLAttr /* key */) const { - // check if we're in supermode Network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - return true; - } else { - return false; - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEPOI::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: { - std::string oldID = myID; - myID = value; - myNet->changeShapeID(this, oldID); - setMicrosimID(value); - break; - } - case SUMO_ATTR_COLOR: - setShapeColor(parse(value)); - break; - case SUMO_ATTR_LANE: - myLane = value; - replaceParentLanes(this, value); - break; - case SUMO_ATTR_POSITION: { - if (getParentLanes().size() > 0) { - myPosOverLane = parse(value); - } else { - // first remove object from grid due position is used for boundary - myNet->removeGLObjectFromGrid(this); - // set position - set(parse(value)); - // set GEO Position - myGEOPosition.setx(this->x()); - myGEOPosition.sety(this->y()); - myGEOPosition.setz(this->z()); - GeoConvHelper::getFinal().cartesian2geo(myGEOPosition); - // add object into grid again - myNet->addGLObjectIntoGrid(this); - } - break; - } - case SUMO_ATTR_POSITION_LAT: - myPosLat = parse(value); - break; - case SUMO_ATTR_GEOPOSITION: { - // first remove object from grid due position is used for boundary - myNet->removeGLObjectFromGrid(this); - // set new position - myGEOPosition = parse(value); - // set cartesian Position - set(myGEOPosition); - GeoConvHelper::getFinal().x2cartesian_const(*this); - // add object into grid again - myNet->addGLObjectIntoGrid(this); - break; - } - case SUMO_ATTR_GEO: - myGeo = parse(value); - break; - case SUMO_ATTR_TYPE: - setShapeType(value); - break; - case SUMO_ATTR_LAYER: - if (value == "default") { - setShapeLayer(Shape::DEFAULT_LAYER_POI); - } else { - setShapeLayer(parse(value)); - } - break; - case SUMO_ATTR_IMGFILE: - // first remove object from grid due img file affect to boundary - myNet->removeGLObjectFromGrid(this); - setShapeImgFile(value); - // all textures must be refresh - GUITexturesHelper::clearTextures(); - // add object into grid again - myNet->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_RELATIVEPATH: - setShapeRelativePath(parse(value)); - break; - case SUMO_ATTR_WIDTH: - if (getParentLanes().size() > 0) { - // set new width - setWidth(parse(value)); - } else { - // first remove object from grid due position is used for boundary - myNet->removeGLObjectFromGrid(this); - // set new width - setWidth(parse(value)); - // add object into grid again - myNet->addGLObjectIntoGrid(this); - } - break; - case SUMO_ATTR_HEIGHT: - if (getParentLanes().size() > 0) { - // set new height - setHeight(parse(value)); - } else { - // first remove object from grid due position is used for boundary - myNet->removeGLObjectFromGrid(this); - // set new height - setHeight(parse(value)); - // add object into grid again - myNet->addGLObjectIntoGrid(this); - } - break; - case SUMO_ATTR_ANGLE: - setShapeNaviDegree(parse(value)); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " attribute '" + toString(key) + "' not allowed"); - } -} - - -const GUIGlObject* -GNEPOI::getGUIGlObject() const { - return this; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPOI.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPOI.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPOI.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPOI.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,226 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPOI.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// A class for visualizing and editing POIS in netedit (adapted from -// GUIPointOfInterest and NLHandler) -/****************************************************************************/ -#ifndef GNEPOI_h -#define GNEPOI_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include "GNEShape.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GNELane; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPOI - * - * In the case the represented junction's shape is empty, the boundary - * is computed using the junction's position to which an offset of 1m to each - * side is added. - */ -class GNEPOI : public GUIPointOfInterest, public GNEShape { - -public: - /// @brief needed to avoid diamond Problem between GUIPointOfInterest and GNEShape - using GNEShape::getID; - - /** @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 - * @param[in] color The color of the POI - * @param[in] pos The position of the POI - * @param[in[ geo use GEO coordinates (lon/lat) - * @param[in] layer The layer of the POI - * @param[in] angle The rotation of the POI - * @param[in] imgFile The raster image of the shape - * @param[in] relativePath set image file as relative path - * @param[in] width The width of the POI image - * @param[in] height The height of the POI image - * @param[in] movementBlocked if movement of POI is blocked - */ - GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, - double layer, double angle, const std::string& imgFile, bool relativePath, double width, double height, bool movementBlocked); - - /** @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 - * @param[in] color The color of the POI - * @param[in] layer The layer of the POI - * @param[in] angle The rotation of the POI - * @param[in] imgFile The raster image of the shape - * @param[in] relativePath set image file as relative path - * @param[in] lane lane in which this POILane is placed - * @param[in] posOverLane Position over lane in which this POILane is placed - * @param[in] posLat Lateral position over lane - * @param[in] width The width of the POI image - * @param[in] height The height of the POI image - * @param[in] movementBlocked if movement of POI is blocked - */ - GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, - double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane, - double posLat, double width, double height, bool movementBlocked); - - /// @brief Destructor - ~GNEPOI(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name functions for edit geometry - /// @{ - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(); - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] newPosition new position of geometry - * @note should't be called in drawGL(...) functions to avoid smoothness issues - */ - void moveGeometry(const Position& oldPos, const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] oldPos the old position of additional - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList); - /// @} - - /// @name inherited from GNEShape - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /**@brief writte shape element into a xml file - * @param[in] device device in which write parameters of additional element - */ - void writeShape(OutputDevice& device); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the numerical id of the object - GUIGlID getGlID() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -protected: - /// @brief Position of POI in GEO coordinates (Only used by POIs that aren't placed over lanes) - Position myGEOPosition; - -private: - /// @brief position used for move POILanes - Position myOriginalViewPosition; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief get GUIGlObject associated to this GNEShape - const GUIGlObject* getGUIGlObject() const; - - /// @brief Invalidated copy constructor. - GNEPOI(const GNEPOI&) = delete; - - /// @brief Invalidated assignment operator. - GNEPOI& operator=(const GNEPOI&) = delete; -}; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPoly.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPoly.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPoly.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPoly.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,922 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPoly.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// A class for visualizing and editing POIS in netedit (adapted from -// GUIPolygon and NLHandler) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPoly.h" - - -// =========================================================================== -// static members -// =========================================================================== - -const double GNEPoly::myHintSize = 0.8; - -// =========================================================================== -// method definitions -// =========================================================================== -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, bool movementBlocked, bool shapeBlocked) : - GUIPolygon(id, type, color, shape, geo, fill, lineWidth, layer, angle, imgFile, relativePath), - GNEShape(net, SUMO_TAG_POLY, movementBlocked, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), - myNetElementShapeEdited(nullptr), - myBlockShape(shapeBlocked), - myClosedShape(shape.front() == shape.back()), - mySimplifiedShape(false), -myCurrentMovingVertexIndex(-1) { - // check if imgFile is valid - if (!imgFile.empty() && GUITexturesHelper::getTextureID(imgFile) == -1) { - setShapeImgFile(""); - } - // set GEO shape - myGeoShape = myShape; - for (int i = 0; i < (int) myGeoShape.size(); i++) { - GeoConvHelper::getFinal().cartesian2geo(myGeoShape[i]); - } -} - - -GNEPoly::~GNEPoly() {} - - -std::string -GNEPoly::generateChildID(SumoXMLTag childTag) { - int counter = myNet->getPolygons().size(); - while (myNet->retrievePolygon(getID() + toString(childTag) + toString(counter), false) != nullptr) { - counter++; - } - return (getID() + toString(childTag) + toString(counter)); -} - - -void -GNEPoly::startGeometryMoving() { - // save current centering boundary - myMovingGeometryBoundary = getCenteringBoundary(); -} - - -void -GNEPoly::endGeometryMoving() { - // check that endGeometryMoving was called only once - if (myMovingGeometryBoundary.isInitialised()) { - // Remove object from net - myNet->removeGLObjectFromGrid(this); - // reset myMovingGeometryBoundary - myMovingGeometryBoundary.reset(); - // add object into grid again (using the new centering boundary) - myNet->addGLObjectIntoGrid(this); - } -} - - -int -GNEPoly::moveVertexShape(const int index, const Position& oldPos, const Position& offset) { - // only move shape if block movement block shape are disabled - if (!myBlockMovement && !myBlockShape && (index != -1)) { - // check that index is correct before change position - if (index < (int)myShape.size()) { - // save current moving Geometry Point - myCurrentMovingVertexIndex = index; - // if closed shape and cliked is first or last, move both giving more priority to first always - if (myClosedShape && (index == 0 || index == (int)myShape.size() - 1)) { - // Change position of first shape Geometry Point and filtern position using snap to active grid - myShape.front() = oldPos; - myShape.front().add(offset); - myShape.front() = myNet->getViewNet()->snapToActiveGrid(myShape[index]); - // Change position of last shape Geometry Point and filtern position using snap to active grid - myShape.back() = oldPos; - myShape.back().add(offset); - myShape.back() = myNet->getViewNet()->snapToActiveGrid(myShape[index]); - } else { - // change position of Geometry Point and filtern position using snap to active grid - myShape[index] = oldPos; - myShape[index].add(offset); - myShape[index] = myNet->getViewNet()->snapToActiveGrid(myShape[index]); - } - // return index of moved Geometry Point - return index; - } else { - throw InvalidArgument("Index greater than shape size"); - } - } else { - return index; - } -} - - -void -GNEPoly::moveEntireShape(const PositionVector& oldShape, const Position& offset) { - // only move shape if block movement is disabled and block shape is enabled - if (!myBlockMovement && myBlockShape) { - // restore original shape - myShape = oldShape; - // change all points of the shape shape using offset - for (auto& i : myShape) { - i.add(offset); - } - // update Geometry after moving - updateGeometry(); - } -} - - -void -GNEPoly::commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList) { - if (!myBlockMovement) { - // disable current moving vertex - myCurrentMovingVertexIndex = -1; - // restore original shape into shapeToCommit - PositionVector shapeToCommit = myShape; - // restore old shape in polygon (to avoid problems with RTree) - myShape = oldShape; - // first check if double points has to be removed - shapeToCommit.removeDoublePoints(myHintSize); - if (shapeToCommit.size() != myShape.size() && !myNet->getViewNet()->getEditShapes().editingNetElementShapes) { - WRITE_WARNING("Merged shape's point") - } - - // check if polygon has to be closed - if (shapeToCommit.size() > 1 && shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < (2 * myHintSize)) { - shapeToCommit.pop_back(); - shapeToCommit.push_back(shapeToCommit.front()); - } - // only use GNEChange_Attribute if we aren't editing a junction's shape - if (myNetElementShapeEdited == nullptr) { - // commit new shape - undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_SHAPE, toString(shapeToCommit))); - undoList->p_end(); - } else { - // set new shape calling private setAttribute function - setAttribute(SUMO_ATTR_SHAPE, toString(shapeToCommit)); - } - } -} - - -void -GNEPoly::updateGeometry() { - // Nothing to update -} - - -void -GNEPoly::updateDottedContour() { - if (myShape.isClosed()) { - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myShape); - } else { - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myShape, 0); - } -} - - -void -GNEPoly::writeShape(OutputDevice& device) { - writeXML(device, myGEO); -} - - -Position -GNEPoly::getPositionInView() const { - return myShape.getPolygonCenter(); -} - - -Boundary -GNEPoly::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMovingGeometryBoundary.isInitialised()) { - return myMovingGeometryBoundary; - } else { - return GUIPolygon::getCenteringBoundary(); - } -} - - -GUIGlID -GNEPoly::getGlID() const { - return GUIPolygon::getGlID(); -} - - -std::string -GNEPoly::getParentName() const { - if (myNetElementShapeEdited != nullptr) { - return myNetElementShapeEdited->getMicrosimID(); - } else { - return myNet->getMicrosimID(); - } -} - - -GUIGLObjectPopupMenu* -GNEPoly::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - FXMenuCommand* simplifyShape = new FXMenuCommand(ret, "Simplify Shape\t\tReplace current shape with a rectangle", nullptr, &parent, MID_GNE_POLYGON_SIMPLIFY_SHAPE); - // disable simplify shape if polygon was already simplified - if (mySimplifiedShape || myShape.size() <= 2) { - simplifyShape->disable(); - } - // create open or close polygon's shape only if myNetElementShapeEdited is nullptr - if (myNetElementShapeEdited == nullptr) { - if (myClosedShape) { - new FXMenuCommand(ret, "Open shape\t\tOpen polygon's shape", nullptr, &parent, MID_GNE_POLYGON_OPEN); - } else { - new FXMenuCommand(ret, "Close shape\t\tClose polygon's shape", nullptr, &parent, MID_GNE_POLYGON_CLOSE); - } - } - // create a extra FXMenuCommand if mouse is over a vertex - int index = getVertexIndex(myNet->getViewNet()->getPositionInformation(), false, false); - if (index != -1) { - FXMenuCommand* removeGeometryPoint = new FXMenuCommand(ret, "Remove geometry point\t\tRemove geometry point under mouse", nullptr, &parent, MID_GNE_POLYGON_DELETE_GEOMETRY_POINT); - FXMenuCommand* setFirstPoint = new FXMenuCommand(ret, "Set first geometry point\t\tSet", nullptr, &parent, MID_GNE_POLYGON_SET_FIRST_POINT); - // disable setFirstPoint if shape only have three points - if ((myClosedShape && (myShape.size() <= 4)) || (!myClosedShape && (myShape.size() <= 2))) { - removeGeometryPoint->disable(); - } - // disable setFirstPoint if mouse is over first point - if (index == 0) { - setFirstPoint->disable(); - } - } - return ret; -} - - -GUIParameterTableWindow* -GNEPoly::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) { - return GUIPolygon::getParameterWindow(app, parent); -} - - -void -GNEPoly::drawGL(const GUIVisualizationSettings& s) const { - // first obtain poly exaggeration - const double polyExaggeration = s.polySize.getExaggeration(s, this); - // first check if poly can be drawn - if ((polyExaggeration > 0) && myNet->getViewNet()->getDemandViewOptions().showShapes()) { - // Obtain constants - const Position mousePosition = myNet->getViewNet()->getPositionInformation(); - const double vertexWidth = myHintSize * MIN2((double)1, s.polySize.getExaggeration(s, this)); - const double vertexWidthSquared = (vertexWidth * vertexWidth); - const double contourWidth = (myHintSize / 4.0) * polyExaggeration; - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // push name (needed for getGUIGlObjectsUnderCursor(...) - glPushName(getGlID()); - // first check if inner polygon can be drawn - if (s.drawForPositionSelection && getFill()) { - if (myShape.around(mousePosition)) { - // push matrix - glPushMatrix(); - glTranslated(mousePosition.x(), mousePosition.y(), GLO_POLYGON + 0.04); - setColor(s, false); - GLHelper::drawFilledCircle(1, s.getCircleResolution()); - glPopMatrix(); - } - } else if (checkDraw(s)) { - // draw inner polygon - drawInnerPolygon(s, drawUsingSelectColor()); - } - // draw geometry details hints if is not too small and isn't in selecting mode - if (s.scale * vertexWidth > 1.) { - // obtain values relative to mouse position regarding to shape - bool mouseOverVertex = false; - const double distanceToShape = myShape.distance2D(mousePosition); - const Position positionOverLane = myShape.positionAtOffset2D(myShape.nearest_offset_to_point2D(mousePosition)); - // set colors - RGBColor invertedColor, darkerColor; - if (drawUsingSelectColor()) { - invertedColor = s.colorSettings.selectionColor.invertedColor(); - darkerColor = s.colorSettings.selectionColor.changedBrightness(-32); - } else { - invertedColor = GLHelper::getColor().invertedColor(); - darkerColor = GLHelper::getColor().changedBrightness(-32); - } - // Draw geometry hints if polygon's shape isn't blocked - if (myBlockShape == false) { - // draw a boundary for moving using darkerColor - glPushMatrix(); - glTranslated(0, 0, GLO_POLYGON + 0.01); - GLHelper::setColor(darkerColor); - if (s.drawForPositionSelection) { - if (positionOverLane.distanceSquaredTo2D(mousePosition) <= (contourWidth * contourWidth)) { - // push matrix - glPushMatrix(); - // translate to position over lane - glTranslated(positionOverLane.x(), positionOverLane.y(), 0); - // Draw circle - GLHelper::drawFilledCircle(contourWidth, myNet->getViewNet()->getVisualisationSettings().getCircleResolution()); - // pop draw matrix - glPopMatrix(); - } - } else if (!s.drawForPositionSelection) { - GLHelper::drawBoxLines(myShape, (myHintSize / 4) * s.polySize.getExaggeration(s, this)); - } - glPopMatrix(); - // draw shape points only in Network supemode - if (myNet->getViewNet()->getEditModes().currentSupermode != GNE_SUPERMODE_DEMAND) { - for (const auto vertex : myShape) { - if (!s.drawForRectangleSelection || (mousePosition.distanceSquaredTo2D(vertex) <= (vertexWidthSquared + 2))) { - glPushMatrix(); - glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.02); - // Change color of vertex and flag mouseOverVertex if mouse is over vertex - if ((myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_MOVE) && (vertex.distanceSquaredTo2D(mousePosition) < vertexWidthSquared)) { - mouseOverVertex = true; - GLHelper::setColor(invertedColor); - } else { - GLHelper::setColor(darkerColor); - } - GLHelper::drawFilledCircle(vertexWidth, s.getCircleResolution()); - glPopMatrix(); - // draw elevation or special symbols (Start, End and Block) - if (!s.drawForRectangleSelection && !s.drawForPositionSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { - // Push matrix - glPushMatrix(); - // Traslate to center of detector - glTranslated(vertex.x(), vertex.y(), getType() + 1); - // draw Z - GLHelper::drawText(toString(vertex.z()), Position(), .1, 0.7, RGBColor::BLUE); - // pop matrix - glPopMatrix(); - } else if ((vertex == myShape.front()) && !s.drawForRectangleSelection && - s.drawDetail(s.detailSettings.geometryPointsText, polyExaggeration)) { - // draw a "s" over first point - glPushMatrix(); - glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.03); - GLHelper::drawText("S", Position(), .1, 2 * vertexWidth, invertedColor); - glPopMatrix(); - } else if ((vertex == myShape.back()) && (myClosedShape == false) && !s.drawForRectangleSelection && - s.drawDetail(s.detailSettings.geometryPointsText, polyExaggeration)) { - // draw a "e" over last point if polygon isn't closed - glPushMatrix(); - glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.03); - GLHelper::drawText("E", Position(), .1, 2 * vertexWidth, invertedColor); - glPopMatrix(); - } - } - } - // check if draw moving hint has to be drawed - if ((myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_MOVE) && (distanceToShape < vertexWidth) && - (mouseOverVertex == false) && (myBlockMovement == false)) { - // push matrix - glPushMatrix(); - const Position hintPos = myShape.size() > 1 ? positionOverLane : myShape[0]; - glTranslated(hintPos.x(), hintPos.y(), GLO_POLYGON + 0.04); - GLHelper::setColor(invertedColor); - GLHelper:: drawFilledCircle(vertexWidth, s.getCircleResolution()); - glPopMatrix(); - } - } - } - } - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), polyExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -int -GNEPoly::getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid) { - // check if position has to be snapped to grid - if (snapToGrid) { - pos = myNet->getViewNet()->snapToActiveGrid(pos); - } - // first check if vertex already exists - for (auto i : myShape) { - if (i.distanceTo2D(pos) < myHintSize) { - return myShape.indexOfClosest(i); - } - } - // if vertex doesn't exist, insert it - if (createIfNoExist) { - return myShape.insertAtClosest(pos, true); - } else { - return -1; - } -} - - -void -GNEPoly::deleteGeometryPoint(const Position& pos, bool allowUndo) { - if (myShape.size() > 1) { - // obtain index - PositionVector modifiedShape = myShape; - int index = modifiedShape.indexOfClosest(pos); - // remove point dependending of - if (myClosedShape && (index == 0 || index == (int)modifiedShape.size() - 1) && (myShape.size() > 2)) { - modifiedShape.erase(modifiedShape.begin()); - modifiedShape.erase(modifiedShape.end() - 1); - modifiedShape.push_back(modifiedShape.front()); - } else { - modifiedShape.erase(modifiedShape.begin() + index); - } - // set new shape depending of allowUndo - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("delete geometry point"); - setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - // first remove object from grid due shape is used for boundary - myNet->removeGLObjectFromGrid(this); - // set new shape - myShape = modifiedShape; - // Check if new shape is closed - myClosedShape = (myShape.front() == myShape.back()); - // disable simplified shape flag - mySimplifiedShape = false; - // add object into grid again - myNet->addGLObjectIntoGrid(this); - } - } else { - WRITE_WARNING("Number of remaining points insufficient") - } -} - - -bool -GNEPoly::isPolygonBlocked() const { - return myBlockShape; -} - - -bool -GNEPoly::isPolygonClosed() const { - return myClosedShape; -} - - -void -GNEPoly::setShapeEditedElement(GNENetElement* element) { - if (element) { - myNetElementShapeEdited = element; - } else { - throw InvalidArgument("Junction cannot be nullptr"); - } -} - - -GNENetElement* -GNEPoly::getShapeEditedElement() const { - return myNetElementShapeEdited; -} - - -void -GNEPoly::openPolygon(bool allowUndo) { - // only open if shape is closed - if (myClosedShape) { - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("open polygon"); - setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - myClosedShape = false; - myShape.pop_back(); - // disable simplified shape flag - mySimplifiedShape = false; - // update geometry to avoid grabbing Problems - updateGeometry(); - } - } else { - WRITE_WARNING("Polygon already opened") - } -} - - -void -GNEPoly::closePolygon(bool allowUndo) { - // only close if shape is opened - if (myClosedShape == false) { - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("close shape"); - setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - myClosedShape = true; - myShape.closePolygon(); - // disable simplified shape flag - mySimplifiedShape = false; - // update geometry to avoid grabbing Problems - updateGeometry(); - } - } else { - WRITE_WARNING("Polygon already closed") - } -} - - -void -GNEPoly::changeFirstGeometryPoint(int oldIndex, bool allowUndo) { - // check that old index is correct - if (oldIndex >= (int)myShape.size()) { - throw InvalidArgument("Invalid old Index"); - } else if (oldIndex == 0) { - WRITE_WARNING("Selected point must be different of the first point") - } else { - // Configure new shape - PositionVector newShape; - for (int i = oldIndex; i < (int)myShape.size(); i++) { - newShape.push_back(myShape[i]); - } - if (myClosedShape) { - for (int i = 1; i < oldIndex; i++) { - newShape.push_back(myShape[i]); - } - newShape.push_back(newShape.front()); - } else { - for (int i = 0; i < oldIndex; i++) { - newShape.push_back(myShape[i]); - } - } - // set new rotated shape - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("change first geometry point"); - setAttribute(SUMO_ATTR_SHAPE, toString(newShape), myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - // set new shape - myShape = newShape; - // Check if new shape is closed - myClosedShape = (myShape.front() == myShape.back()); - // disable simplified shape flag - mySimplifiedShape = false; - // update geometry to avoid grabbing Problems - updateGeometry(); - } - } -} - - -void -GNEPoly::simplifyShape(bool allowUndo) { - if (!mySimplifiedShape && myShape.size() > 2) { - const Boundary b = myShape.getBoxBoundary(); - PositionVector simplifiedShape; - if (myShape.isClosed()) { - // create a square as simplified shape - simplifiedShape.push_back(Position(b.xmin(), b.ymin())); - simplifiedShape.push_back(Position(b.xmin(), b.ymax())); - simplifiedShape.push_back(Position(b.xmax(), b.ymax())); - simplifiedShape.push_back(Position(b.xmax(), b.ymin())); - simplifiedShape.push_back(simplifiedShape[0]); - } else { - // create a line as simplified shape - simplifiedShape.push_back(myShape.front()); - simplifiedShape.push_back(myShape.back()); - } - // set new shape depending of allowUndo - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("simplify shape"); - setAttribute(SUMO_ATTR_SHAPE, toString(simplifiedShape), myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - // set new shape - myShape = simplifiedShape; - // Check if new shape is closed - myClosedShape = (myShape.front() == myShape.back()); - // update geometry to avoid grabbing Problems - updateGeometry(); - } - // change flag after setting simplified shape - mySimplifiedShape = true; - } else { - WRITE_WARNING("Polygon already simplified") - } -} - - -std::string -GNEPoly::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return myID; - case SUMO_ATTR_SHAPE: - return toString(myShape); - case SUMO_ATTR_GEOSHAPE: - return toString(myGeoShape, gPrecisionGeo); - case SUMO_ATTR_COLOR: - return toString(getShapeColor()); - case SUMO_ATTR_FILL: - return toString(myFill); - case SUMO_ATTR_LINEWIDTH: - return toString(myLineWidth); - case SUMO_ATTR_LAYER: - if (getShapeLayer() == Shape::DEFAULT_LAYER) { - return "default"; - } else { - return toString(getShapeLayer()); - } - case SUMO_ATTR_TYPE: - return getShapeType(); - case SUMO_ATTR_IMGFILE: - return getShapeImgFile(); - case SUMO_ATTR_RELATIVEPATH: - return toString(getShapeRelativePath()); - case SUMO_ATTR_ANGLE: - return toString(getShapeNaviDegree()); - case SUMO_ATTR_GEO: - return toString(myGEO); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_BLOCK_SHAPE: - return toString(myBlockShape); - case GNE_ATTR_CLOSE_SHAPE: - return toString(myClosedShape); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPoly::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: - case SUMO_ATTR_SHAPE: - case SUMO_ATTR_GEOSHAPE: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_FILL: - case SUMO_ATTR_LINEWIDTH: - case SUMO_ATTR_LAYER: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_IMGFILE: - case SUMO_ATTR_RELATIVEPATH: - case SUMO_ATTR_ANGLE: - case SUMO_ATTR_GEO: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_BLOCK_SHAPE: - case GNE_ATTR_CLOSE_SHAPE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEPoly::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrievePolygon(value, false) == nullptr); - case SUMO_ATTR_SHAPE: - case SUMO_ATTR_GEOSHAPE: - // empty shapes AREN'T allowed - if (value.empty()) { - return false; - } else { - return canParse(value); - } - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_FILL: - return canParse(value); - case SUMO_ATTR_LINEWIDTH: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_LAYER: - if (value == "default") { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_TYPE: - return true; - case SUMO_ATTR_IMGFILE: - if (value == "") { - return true; - } else { - // check that image can be loaded - return GUITexturesHelper::getTextureID(value) != -1; - } - case SUMO_ATTR_RELATIVEPATH: - return canParse(value); - case SUMO_ATTR_ANGLE: - return canParse(value); - case SUMO_ATTR_GEO: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_BLOCK_SHAPE: - return canParse(value); - case GNE_ATTR_CLOSE_SHAPE: - if (canParse(value)) { - bool closePolygon = parse(value); - if (closePolygon && (myShape.begin() == myShape.end())) { - // Polygon already closed, then invalid value - return false; - } else if (!closePolygon && (myShape.begin() != myShape.end())) { - // Polygon already open, then invalid value - return false; - } else { - return true; - } - } else { - return false; - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -bool -GNEPoly::isAttributeEnabled(SumoXMLAttr /* key */) const { - // check if we're in supermode Network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - return true; - } else { - return false; - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEPoly::setAttribute(SumoXMLAttr key, const std::string& value) { - // first remove object from grid due almost modificactions affects to boundary (but avoided for certain attributes) - if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { - myNet->removeGLObjectFromGrid(this); - } - switch (key) { - case SUMO_ATTR_ID: { - std::string oldID = myID; - myID = value; - myNet->changeShapeID(this, oldID); - setMicrosimID(value); - break; - } - case SUMO_ATTR_SHAPE: { - // set new shape - myShape = parse(value); - // set GEO shape - myGeoShape = myShape; - for (int i = 0; i < (int) myGeoShape.size(); i++) { - GeoConvHelper::getFinal().cartesian2geo(myGeoShape[i]); - } - // Check if new shape is closed - myClosedShape = (myShape.front() == myShape.back()); - // disable simplified shape flag - mySimplifiedShape = false; - // update geometry of shape edited element - if (myNetElementShapeEdited) { - myNetElementShapeEdited->updateGeometry(); - } - break; - } - case SUMO_ATTR_GEOSHAPE: { - // set new GEO shape - myGeoShape = parse(value); - // set shape - myShape = myGeoShape ; - for (int i = 0; i < (int) myShape.size(); i++) { - GeoConvHelper::getFinal().x2cartesian_const(myShape[i]); - } - // Check if new shape is closed - myClosedShape = (myShape.front() == myShape.back()); - // disable simplified shape flag - mySimplifiedShape = false; - // update geometry of shape edited element - if (myNetElementShapeEdited) { - myNetElementShapeEdited->updateGeometry(); - } - break; - } - case SUMO_ATTR_COLOR: - setShapeColor(parse(value)); - break; - case SUMO_ATTR_FILL: - myFill = parse(value); - break; - case SUMO_ATTR_LINEWIDTH: - myLineWidth = parse(value); - break; - case SUMO_ATTR_LAYER: - if (value == "default") { - setShapeLayer(Shape::DEFAULT_LAYER); - } else { - setShapeLayer(parse(value)); - } - break; - case SUMO_ATTR_TYPE: - setShapeType(value); - break; - case SUMO_ATTR_IMGFILE: - setShapeImgFile(value); - // all textures must be refresh - GUITexturesHelper::clearTextures(); - break; - case SUMO_ATTR_RELATIVEPATH: - setShapeRelativePath(parse(value)); - break; - case SUMO_ATTR_ANGLE: - setShapeNaviDegree(parse(value)); - break; - case SUMO_ATTR_GEO: - myGEO = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_BLOCK_SHAPE: - myBlockShape = parse(value); - break; - case GNE_ATTR_CLOSE_SHAPE: - myClosedShape = parse(value); - if (myClosedShape) { - myShape.closePolygon(); - myGeoShape.closePolygon(); - } else { - myShape.pop_back(); - myGeoShape.pop_back(); - } - // disable simplified shape flag - mySimplifiedShape = false; - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - // add object into grid again (but avoided for certain attributes) - if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { - myNet->addGLObjectIntoGrid(this); - } - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -const GUIGlObject* -GNEPoly::getGUIGlObject() const { - return this; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPoly.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPoly.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEPoly.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEPoly.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,266 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPoly.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// A class for visualizing and editing POIS in netedit (adapted from -// GUIPolygon and NLHandler) -/****************************************************************************/ -#ifndef GNEPoly_h -#define GNEPoly_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include "GNEShape.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GeoConvHelper; -class GNENetElement; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPoly - * - * In the case the represented junction's shape is empty, the boundary - * is computed using the junction's position to which an offset of 1m to each - * side is added. - */ -class GNEPoly : public GUIPolygon, public GNEShape { - -public: - /// @brief needed to avoid diamond Problem between GUIPolygon and GNEShape - using GNEShape::getID; - - /** @brief Constructor - * @param[in] net net in which this polygon is placed - * @param[in] id The name of the polygon - * @param[in] type The (abstract) type of the polygon - * @param[in] shape The shape of the polygon - * @param[in] geo specifiy if shape was loaded as GEO - * @param[in] color The color of the polygon - * @param[in] layer The layer of the polygon - * @param[in] angle The rotation of the polygon - * @param[in] imgFile The raster image of the polygon - * @param[in] relativePath set image file as relative path - * @param[in] fill Whether the polygon shall be filled - * @param[in] lineWidth Line width when drawing unfilled polygon - * @param[in] movementBlocked if movement of POI is blocked - * @param[in] shapeBlocked if shape of POI is blocked - */ - 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, bool movementBlocked, bool shapeBlocked); - - /// @brief Destructor - ~GNEPoly(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name functions for edit geometry - /// @{ - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(); - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(); - - /**@brief change position of a vertex of shape without commiting change - * @param[in] index index of Vertex shape - * @param[in] newPos The new position of vertex - * @return index of vertex (in some cases index can change - */ - int moveVertexShape(const int index, const Position& oldPos, const Position& offset); - - /**@brief move entire shape without commiting change - * @param[in] oldShape the old shape of polygon before moving - * @param[in] offset the offset of movement - */ - void moveEntireShape(const PositionVector& oldShape, const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) - * @param[in] oldShape the old shape of polygon - * @param[in] undoList The undoList on which to register changes - */ - void commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList); - /// @} - - /// @name inherited from GNEShape - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /**@brief writte shape element into a xml file - * @param[in] device device in which write parameters of additional element - */ - void writeShape(OutputDevice& device); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the numerical id of the object - GUIGlID getGlID() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@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 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 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 checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - - /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge - * @param pos position of new/existent vertex - * @param createIfNoExist enable or disable creation of new verte if there isn't another vertex in position - * @param snapToGrid enable or disable snapToActiveGrid - * @return index of position vector - */ - int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid); - - /// @brief delete the geometry point closest to the given pos - void deleteGeometryPoint(const Position& pos, bool allowUndo = true); - - /// @brief return true if polygon is blocked - bool isPolygonBlocked() const; - - /// @brief check if polygon is closed - bool isPolygonClosed() const; - - /// @brief retrieve the netElement of which the shape is being edited - void setShapeEditedElement(GNENetElement* element); - - /// @brief retrieve the junction of which the shape is being edited - GNENetElement* getShapeEditedElement() const; - - /// @brief open polygon - void openPolygon(bool allowUndo = true); - - /// @brief close polygon - void closePolygon(bool allowUndo = true); - - /// @brief change first geometry point - void changeFirstGeometryPoint(int oldIndex, bool allowUndo = true); - - /// @brief replace the current shape with a rectangle - void simplifyShape(bool allowUndo = true); - -protected: - /// @brief junction of which the shape is being edited (optional) - GNENetElement* myNetElementShapeEdited; - - /// @brief Latitude of Polygon - PositionVector myGeoShape; - - /// @brief flag for block shape - bool myBlockShape; - - /// @brief flag to indicate if polygon is open or closed - bool myClosedShape; - - /// @brief flag to indicate if polygon is simplified - bool mySimplifiedShape; - - /// @brief index of vertex that is been moved (-1 means that none vertex is been moved) - int myCurrentMovingVertexIndex; - -private: - /// @brief hint size of vertex - static const double myHintSize; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief get GUIGlObject associated to this GNEShape - const GUIGlObject* getGUIGlObject() const; - - /// @brief Invalidated copy constructor. - GNEPoly(const GNEPoly&) = delete; - - /// @brief Invalidated assignment operator. - GNEPoly& operator=(const GNEPoly&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouter.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouter.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouter.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,379 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERerouter.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNERerouter.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNERerouter::GNERerouter(const std::string& id, GNEViewNet* viewNet, const Position& pos, const std::vector& edges, const std::string& name, const std::string& filename, double probability, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement) : - GNEAdditional(id, viewNet, GLO_REROUTER, SUMO_TAG_REROUTER, name, blockMovement, {}, {}, {}, {}, {}, edges, {}, {}, {}, {}), - myPosition(pos), - myFilename(filename), - myProbability(probability), - myOff(off), - myTimeThreshold(timeThreshold), -myVTypes(vTypes) { -} - - -GNERerouter::~GNERerouter() { -} - - -void -GNERerouter::updateGeometry() { - // Set block icon position - myBlockIcon.position = myPosition; - - // Set block icon offset - myBlockIcon.offset = Position(-0.5, -0.5); - - // Set block icon rotation, and using their rotation for draw logo - myBlockIcon.setRotation(); - - // update connection positions - myChildConnections.update(); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNERerouter::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), myPosition, 0, - myViewNet->getVisualisationSettings().additionalSettings.rerouterSize, - myViewNet->getVisualisationSettings().additionalSettings.rerouterSize); -} - - -Position -GNERerouter::getPositionInView() const { - return myPosition; -} - - -Boundary -GNERerouter::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else { - Boundary b; - b.add(myPosition); - b.grow(5); - return b; - } -} - - -void -GNERerouter::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNERerouter::openAdditionalDialog() { - // Open rerouter dialog - GNERerouterDialog(this); -} - - -void -GNERerouter::moveGeometry(const Position& offset) { - // restore old position, apply offset and update Geometry - myPosition = myMove.originalViewPosition; - myPosition.add(offset); - // filtern position using snap to active grid - myPosition = myViewNet->snapToActiveGrid(myPosition); - updateGeometry(); -} - - -void -GNERerouter::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPosition), true, toString(myMove.originalViewPosition))); - undoList->p_end(); -} - - -std::string -GNERerouter::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -void -GNERerouter::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double rerouterExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(rerouterExaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(myPosition.x(), myPosition.y(), getType()); - // scale - glScaled(rerouterExaggeration, rerouterExaggeration, 1); - // Draw icon depending of detector is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, rerouterExaggeration)) { - glColor3d(1, 1, 1); - glRotated(180, 0, 0, 1); - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_REROUTERSELECTED), s.additionalSettings.rerouterSize); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_REROUTER), s.additionalSettings.rerouterSize); - } - } else { - GLHelper::setColor(RGBColor::RED); - GLHelper::drawBoxLine(Position(0, s.additionalSettings.rerouterSize), 0, 2 * s.additionalSettings.rerouterSize, s.additionalSettings.rerouterSize); - } - // Pop draw matrix - glPopMatrix(); - // Show Lock icon - myBlockIcon.drawIcon(s, rerouterExaggeration, 0.4); - // Draw child connections - drawChildConnections(s, getType()); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), rerouterExaggeration, myDottedGeometry); - // draw shape dotte contour aroud alld connections between child and parents - for (auto i : myChildConnections.connectionPositions) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); - } - } - // Draw name - drawName(getPositionInView(), s.scale, s.addName); - // Pop name - glPopName(); - } -} - - -std::string -GNERerouter::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGES: - return parseIDs(getChildEdges()); - case SUMO_ATTR_POSITION: - return toString(myPosition); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_PROB: - return toString(myProbability); - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return time2string(myTimeThreshold); - case SUMO_ATTR_VTYPES: - return myVTypes; - case SUMO_ATTR_OFF: - return toString(myOff); - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERerouter::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNERerouter::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: { - // change ID of Rerouter Interval - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Rerouter interval children - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_INTERVAL), undoList); - } - break; - } - case SUMO_ATTR_EDGES: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_PROB: - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_OFF: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERerouter::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_EDGES: - if (value.empty()) { - return false; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_PROB: - return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - return canParse(value); - case SUMO_ATTR_VTYPES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case SUMO_ATTR_OFF: - return canParse(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERerouter::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNERerouter::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNERerouter::getHierarchyName() const { - return getTagStr(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNERerouter::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_EDGES: - changeChildEdges(this, value); - break; - case SUMO_ATTR_POSITION: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myPosition = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_PROB: - myProbability = parse(value); - break; - case SUMO_ATTR_HALTING_TIME_THRESHOLD: - myTimeThreshold = parse(value); - break; - case SUMO_ATTR_VTYPES: - myVTypes = value; - break; - case SUMO_ATTR_OFF: - myOff = parse(value); - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouter.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouter.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERerouter.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNERerouter_h -#define GNERerouter_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEEdge; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNERerouter - * Rerouter changes the route of a vehicle as soon as the vehicle moves onto a specified edge. - */ -class GNERerouter : public GNEAdditional { - -public: - /**@brief Constructor - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position (center) of the rerouter in the map - * @param[in] edges vector with the edges of rerotuer - * @param[in] name Rerouter name - * @param[in] filename The path to the definition file - * @param[in] probability The probability for vehicle rerouting - * @param[in] off Whether the router should be inactive initially - * @param[in] block movement enable or disable additional movement - */ - GNERerouter(const std::string& id, GNEViewNet* viewNet, const Position& pos, const std::vector& edges, const std::string& name, - const std::string& filename, double probability, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement); - - /// @brief Destructor - ~GNERerouter(); - - /// @brief open GNERerouterDialog - void openAdditionalDialog(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief position of rerouter in view - Position myPosition; - - /// @brief filename of rerouter - std::string myFilename; - - /// @brief probability of rerouter - double myProbability; - - /// @brief attribute to enable or disable inactive initially - bool myOff; - - /// @brief attribute to configure activation time threshold - SUMOTime myTimeThreshold; - - /// @brief optional vehicle types for restricting the rerouter - std::string myVTypes; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNERerouter(const GNERerouter&) = delete; - - /// @brief Invalidated assignment operator. - GNERerouter& operator=(const GNERerouter&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouterInterval.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouterInterval.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouterInterval.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouterInterval.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,224 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERerouterInterval.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include - -#include "GNERerouterInterval.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNERerouterInterval::GNERerouterInterval(GNERerouterDialog* rerouterDialog) : - GNEAdditional(rerouterDialog->getEditedAdditional(), rerouterDialog->getEditedAdditional()->getViewNet(), GLO_REROUTER, SUMO_TAG_INTERVAL, "", false, -{}, {}, {}, {rerouterDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}) { - // fill reroute interval with default values - setDefaultValues(); -} - - -GNERerouterInterval::GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end) : - GNEAdditional(rerouterParent, rerouterParent->getViewNet(), GLO_REROUTER, SUMO_TAG_INTERVAL, "", false, -{}, {}, {}, {rerouterParent}, {}, {}, {}, {}, {}, {}), -myBegin(begin), -myEnd(end) { -} - - -GNERerouterInterval::~GNERerouterInterval() {} - -void -GNERerouterInterval::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNERerouterInterval::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNERerouterInterval::updateGeometry() { - // This additional doesn't own a geometry -} - - -void GNERerouterInterval::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNERerouterInterval::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNERerouterInterval::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNERerouterInterval::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNERerouterInterval::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNERerouterInterval::drawGL(const GUIVisualizationSettings&) const { - // Currently This additional isn't drawn -} - - -std::string -GNERerouterInterval::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_BEGIN: - return time2string(myBegin); - case SUMO_ATTR_END: - return time2string(myEnd); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERerouterInterval::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_BEGIN: - return STEPS2TIME(myBegin); - case SUMO_ATTR_END: - return STEPS2TIME(myEnd); - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERerouterInterval::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: { - // change ID of Rerouter Interval - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Rerouter children - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(i->getTagProperty().getTag()), undoList); - } - break; - } - case SUMO_ATTR_BEGIN: - case SUMO_ATTR_END: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERerouterInterval::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_BEGIN: - return canParse(value) && (parse(value) < myEnd); - case SUMO_ATTR_END: - return canParse(value) && (parse(value) > myBegin); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERerouterInterval::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNERerouterInterval::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNERerouterInterval::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNERerouterInterval::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_BEGIN: - myBegin = parse(value); - break; - case SUMO_ATTR_END: - myEnd = parse(value); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouterInterval.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouterInterval.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERerouterInterval.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERerouterInterval.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERerouterInterval.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ -#ifndef GNERerouterInterval_h -#define GNERerouterInterval_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNERerouter; -class GNERerouterDialog; -class GNEClosingLaneReroute; -class GNEClosingReroute; -class GNEDestProbReroute; -class GNERouteProbReroute; -class GNEParkingAreaReroute; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNERerouterInterval - * class used to represent a interval used in rerouters - */ -class GNERerouterInterval : public GNEAdditional { - -public: - /// @brief constructor (Used in GNERerouterDialog) - GNERerouterInterval(GNERerouterDialog* rerouterDialog); - - /// @brief constructor - GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end); - - /// @brief destructor - ~GNERerouterInterval(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief begin timeStep - SUMOTime myBegin; - - /// @brief end timeStep - SUMOTime myEnd; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNERerouterInterval(GNERerouterInterval*) = delete; - - /// @brief Invalidated assignment operator. - GNERerouterInterval& operator=(GNERerouterInterval*) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbe.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbe.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbe.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbe.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,372 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteProbe.cpp -/// @author Pablo Alvarez Lopez -/// @date May 2016 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNERouteProbe.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNERouteProbe::GNERouteProbe(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, const std::string& frequency, const std::string& name, const std::string& filename, SUMOTime begin) : - GNEAdditional(id, viewNet, GLO_ROUTEPROBE, SUMO_TAG_ROUTEPROBE, name, false, { - edge -}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -myFrequency(frequency), -myFilename(filename), -myBegin(begin), -myRelativePositionY(0) { -} - - -GNERouteProbe::~GNERouteProbe() { -} - - -void -GNERouteProbe::updateGeometry() { - // obtain relative position of routeProbe in edge - myRelativePositionY = 2 * getParentEdges().front()->getRouteProbeRelativePosition(this); - - // get lanes of edge - GNELane* firstLane = getParentEdges().front()->getLanes().at(0); - - // Get shape of parent lane - const double offset = firstLane->getLaneShape().length() < 0.5 ? firstLane->getLaneShape().length() : 0.5; - - // update geometry - myAdditionalGeometry.updateGeometry(firstLane, offset); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set offset of the block icon - myBlockIcon.offset = Position(1.1, (-3.06) - myRelativePositionY); - - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(firstLane); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNERouteProbe::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getPosition(), - myAdditionalGeometry.getRotation(), - myViewNet->getVisualisationSettings().additionalSettings.routeProbeSize, - myViewNet->getVisualisationSettings().additionalSettings.routeProbeSize); -} - - -Position -GNERouteProbe::getPositionInView() const { - if (getParentEdges().front()->getLanes().front()->getLaneShape().length() < 0.5) { - return getParentEdges().front()->getLanes().front()->getLaneShape().front(); - } else { - Position A = getParentEdges().front()->getLanes().front()->getLaneShape().positionAtOffset(0.5); - Position B = getParentEdges().front()->getLanes().back()->getLaneShape().positionAtOffset(0.5); - // return Middle point - return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); - } -} - - -Boundary -GNERouteProbe::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNERouteProbe::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNERouteProbe::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNERouteProbe::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -std::string -GNERouteProbe::getParentName() const { - return getParentEdges().front()->getMicrosimID(); -} - - -void -GNERouteProbe::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double routeProbeExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(routeProbeExaggeration)) { - // get values - const double width = (double) 2.0 * s.scale; - const int numberOfLanes = int(getParentEdges().front()->getLanes().size()); - // start drawing - glPushName(getGlID()); - glLineWidth(1.0); - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.additionalSettings.routeProbeColor); - } - // draw shape - glPushMatrix(); - glTranslated(0, 0, getType()); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glScaled(routeProbeExaggeration, routeProbeExaggeration, 1); - glTranslated(-1.6, -1.6, 0); - glBegin(GL_QUADS); - glVertex2d(0, 0.25); - glVertex2d(0, -0.25); - glVertex2d((numberOfLanes * 3.3), -0.25); - glVertex2d((numberOfLanes * 3.3), 0.25); - glEnd(); - glTranslated(0, 0, .01); - glBegin(GL_LINES); - glVertex2d(0, 0.25 - .1); - glVertex2d(0, -0.25 + .1); - glEnd(); - // position indicator (White) - if ((width * routeProbeExaggeration > 1) && !s.drawForRectangleSelection) { - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glRotated(90, 0, 0, -1); - glBegin(GL_LINES); - glVertex2d(0, 0); - glVertex2d(0, (numberOfLanes * 3.3)); - glEnd(); - } - // Pop shape matrix - glPopMatrix(); - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), getType()); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glTranslated((-2.56) - myRelativePositionY, (-1.6), 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, routeProbeExaggeration)) { - glColor3d(1, 1, 1); - glRotated(-90, 0, 0, 1); - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_ROUTEPROBESELECTED), s.additionalSettings.routeProbeSize); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_ROUTEPROBE), s.additionalSettings.routeProbeSize); - } - } else { - GLHelper::setColor(s.additionalSettings.routeProbeColor); - GLHelper::drawBoxLine(Position(0, s.additionalSettings.routeProbeSize), 0, 2 * s.additionalSettings.routeProbeSize, s.additionalSettings.routeProbeSize); - } - // Pop logo matrix - glPopMatrix(); - // Show Lock icon depending of the Edit mode - myBlockIcon.drawIcon(s, routeProbeExaggeration, 0.4); - // draw name - drawName(getPositionInView(), s.scale, s.addName); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), routeProbeExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -std::string -GNERouteProbe::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGE: - return getParentEdges().front()->getID(); - case SUMO_ATTR_NAME: - return myAdditionalName; - case SUMO_ATTR_FILE: - return myFilename; - case SUMO_ATTR_FREQUENCY: - return toString(myFrequency); - case SUMO_ATTR_BEGIN: - return time2string(myBegin); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERouteProbe::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_BEGIN: - return STEPS2TIME(myBegin); - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERouteProbe::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: - case SUMO_ATTR_EDGE: - case SUMO_ATTR_NAME: - case SUMO_ATTR_FILE: - case SUMO_ATTR_FREQUENCY: - case SUMO_ATTR_BEGIN: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERouteProbe::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNERouteProbe::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNERouteProbe::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN); -} - -// =========================================================================== -// private -// =========================================================================== - -bool -GNERouteProbe::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_EDGE: - if (myViewNet->getNet()->retrieveEdge(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case SUMO_ATTR_FILE: - return SUMOXMLDefinitions::isValidFilename(value); - case SUMO_ATTR_FREQUENCY: - if (value.empty()) { - return true; - } else { - return canParse(value); - } - case SUMO_ATTR_BEGIN: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERouteProbe::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_EDGE: - replaceParentEdges(this, value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case SUMO_ATTR_FILE: - myFilename = value; - break; - case SUMO_ATTR_FREQUENCY: - myFrequency = value; - break; - case SUMO_ATTR_BEGIN: - myBegin = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbe.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbe.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbe.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbe.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,165 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteProbe.h -/// @author Pablo Alvarez Lopez -/// @date May 2016 -/// -// -/****************************************************************************/ -#ifndef GNERouteProbe_h -#define GNERouteProbe_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNERouteProbe - * @brief Representation of a RouteProbe in netedit - */ -class GNERouteProbe : public GNEAdditional { - -public: - /**@brief Constructor - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] edge edge in which this routeProbe is placed - * @param[in] frequency The frequency in which to report the distribution - * @oaran[in] name Route Probe Name - * @param[in] filename The file for generated output - * @param[in] begin The time at which to start generating output - */ - GNERouteProbe(const std::string& id, GNEViewNet* viewNet, GNEEdge* edge, const std::string& frequency, const std::string& name, const std::string& filename, SUMOTime begin); - - /// @brief Destructor - ~GNERouteProbe(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief Frequency of RouteProbe - std::string myFrequency; - - /// @brief filename of RouteProbe - std::string myFilename; - - /// @brief begin of rerouter - SUMOTime myBegin; - - /// @brief route probe logo offset - Position myRouteProbeLogoOffset; - - /// @brief relative position regarding to other route probes - int myRelativePositionY; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNERouteProbe(const GNERouteProbe&) = delete; - - /// @brief Invalidated assignment operator. - GNERouteProbe& operator=(const GNERouteProbe&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,216 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteProbReroute.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include - -#include "GNERouteProbReroute.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNERouteProbReroute::GNERouteProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : - GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getViewNet(), GLO_REROUTER, SUMO_TAG_ROUTE_PROB_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}) { - // if exist a reroute, set newRoute ID - if (rerouterIntervalDialog->getEditedAdditional()->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size() > 0) { - myNewRouteId = rerouterIntervalDialog->getEditedAdditional()->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).begin()->first; - } - // fill route prob reroute interval with default values - setDefaultValues(); -} - - -GNERouteProbReroute::GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability) : - GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getViewNet(), GLO_REROUTER, SUMO_TAG_ROUTE_PROB_REROUTE, "", false, -{}, {}, {}, {rerouterIntervalParent}, {}, {}, {}, {}, {}, {}), -myNewRouteId(newRouteId), -myProbability(probability) { -} - - -GNERouteProbReroute::~GNERouteProbReroute() {} - - -void -GNERouteProbReroute::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNERouteProbReroute::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNERouteProbReroute::updateGeometry() { - // This additional doesn't own a geometry -} - - -void -GNERouteProbReroute::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNERouteProbReroute::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNERouteProbReroute::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNERouteProbReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNERouteProbReroute::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNERouteProbReroute::drawGL(const GUIVisualizationSettings&) const { - // Currently This additional isn't drawn -} - - -std::string -GNERouteProbReroute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_ROUTE: - return myNewRouteId; - case SUMO_ATTR_PROB: - return toString(myProbability); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERouteProbReroute::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNERouteProbReroute::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: - case SUMO_ATTR_ROUTE: - case SUMO_ATTR_PROB: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERouteProbReroute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_ROUTE: - return SUMOXMLDefinitions::isValidVehicleID(value); - case SUMO_ATTR_PROB: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERouteProbReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNERouteProbReroute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNERouteProbReroute::getHierarchyName() const { - return getTagStr() + ": " + myNewRouteId; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNERouteProbReroute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_ROUTE: - myNewRouteId = value; - break; - case SUMO_ATTR_PROB: - myProbability = parse(value); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNERouteProbReroute.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,159 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteProbReroute.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2017 -/// -// -/****************************************************************************/ -#ifndef GNERouteProbReroute_h -#define GNERouteProbReroute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEEdge; -class GNERerouterInterval; -class GNERerouterIntervalDialog; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNERerouter - * GNERouteProbReroute - */ -class GNERouteProbReroute : public GNEAdditional { -public: - /// @brief constructor (Used in GNERerouterIntervalDialog) - GNERouteProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); - - /// @brief constructor - GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability); - - /// @brief destructor - ~GNERouteProbReroute(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief id of new route - std::string myNewRouteId; - - /// @brief probability with which a vehicle will use the given edge as destination - double myProbability; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNERouteProbReroute(const GNERouteProbReroute&) = delete; - - /// @brief Invalidated assignment operator. - GNERouteProbReroute& operator=(const GNERouteProbReroute&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEShape.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEShape.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEShape.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEShape.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,186 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEShape.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// Abstract class for Shapes uses in netedit -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEShape.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEShape::GNEShape(GNENet* net, SumoXMLTag tag, bool movementBlocked, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - GNEAttributeCarrier(tag), - GNEHierarchicalParentElements(this, parentEdges, parentLanes, parentShapes, parentAdditionals, parentDemandElements), - GNEHierarchicalChildElements(this, childEdges, childLanes, childShapes, childAdditionals, childDemandElements), - myNet(net), - myBlockMovement(movementBlocked) { -} - - -GNEShape::~GNEShape() {} - - -GNENet* -GNEShape::getNet() const { - return myNet; -} - - -bool -GNEShape::isMovementBlocked() const { - return myBlockMovement; -} - - -void -GNEShape::draw(const Position& pos, double layer, double size) const { - if (myNet->getViewNet()->showLockIcon()) { - // Start pushing matrix - glPushMatrix(); - // Traslate to middle of shape - glTranslated(pos.x(), pos.y(), layer + 0.1); - // Rotate 180 degrees - glRotated(180, 0, 0, 1); - // Set draw color - glColor3d(1, 1, 1); - // Draw icon depending of the selection status - if (mySelected) { - if (myBlockMovement) { - // Draw lock texture if shape is movable, is blocked and is selected - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCKSELECTED), size); - } else { - // Draw empty texture if shape is movable, isn't blocked and is selected - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTYSELECTED), size); - } - } else { - if (myBlockMovement) { - // Draw lock texture if shape is movable and is blocked - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCK), size); - } else { - // Draw empty texture if shape is movable and isn't blocked - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTY), size); - } - } - // Pop matrix - glPopMatrix(); - } -} - - -void -GNEShape::selectAttributeCarrier(bool changeFlag) { - if (!myNet) { - throw ProcessError("Net cannot be nullptr"); - } else { - gSelected.select(getGUIGlObject()->getGlID()); - // add object into list of selected objects - myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getGUIGlObject()->getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEShape::unselectAttributeCarrier(bool changeFlag) { - if (!myNet) { - throw ProcessError("Net cannot be nullptr"); - } else { - gSelected.deselect(getGUIGlObject()->getGlID()); - // remove object of list of selected objects - myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getGUIGlObject()->getType()); - if (changeFlag) { - mySelected = false; - } - } -} - - -bool -GNEShape::isAttributeCarrierSelected() const { - return mySelected; -} - - -bool -GNEShape::drawUsingSelectColor() const { - if (mySelected && (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK)) { - return true; - } else { - return false; - } -} - - -void -GNEShape::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNEShape::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -std::string -GNEShape::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNEShape::getHierarchyName() const { - return getTagStr(); -} - - -void -GNEShape::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEShape.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEShape.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEShape.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEShape.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,233 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEShape.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2017 -/// -// Abstract class for Shapes uses in netedit -/****************************************************************************/ -#ifndef GNEShape_h -#define GNEShape_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - - -#include -#include - - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEShape : public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { -public: - /**@brief Constructor. - * @param[in] net The net to inform about gui updates - * @param[in] tag sumo xml tag of the element - * @param[in] movementBlocked if movement of POI is blocked - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] childDemandElements vector of demandElement parents - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of demandElement children - */ - GNEShape(GNENet* net, SumoXMLTag tag, bool movementBlocked, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /// @brief Destructor - ~GNEShape(); - - /// @brief gererate a new ID for an element child - virtual std::string generateChildID(SumoXMLTag childTag) = 0; - - /**@brief writte shape element into a xml file - * @param[in] device device in which write parameters of additional element - */ - virtual void writeShape(OutputDevice& device) = 0; - - /// @brief Returns the numerical id of the object - virtual GUIGlID getGlID() const = 0; - - /// @brief get Net in which this element is placed - GNENet* getNet() const; - - /// @brief return true if movement is blocked - bool isMovementBlocked() const; - - /// @brief draw lock icon - void draw(const Position& pos, double layer, double size = 0.5) const; - - /// @name functions for edit geometry - /// @{ - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - virtual void startGeometryMoving() = 0; - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - virtual void endGeometryMoving() = 0; - - /**@brief update pre-computed geometry information - * @note: must be called when geometry changes (i.e. lane moved) and implemented in ALL childrens - */ - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief Returns position of additional in view - virtual Position getPositionInView() const = 0; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - virtual Boundary getCenteringBoundary() const = 0; - - /// @} - - /// @name inherited from GUIPolygon/GUIPointOfInterest - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - virtual GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /// @brief check if attribute carrier is selected - bool isAttributeCarrierSelected() const; - - /// @brief check if attribute carrier must be drawn using selecting color. - bool drawUsingSelectColor() const; - - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /* @brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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 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 disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - -protected: - /// @brief the net to inform about updates - GNENet* myNet; - - /// @brief boundary used during moving of elements - Boundary myMovingGeometryBoundary; - - /// @brief flag to block movement - bool myBlockMovement; - -private: - /// @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 get GUIGlObject associated to this GNEShape - virtual const GUIGlObject* getGUIGlObject() const = 0; - - /// @brief Invalidated copy constructor. - GNEShape(const GNEShape&) = delete; - - /// @brief Invalidated assignment operator. - GNEShape& operator=(const GNEShape&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,374 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStoppingPlace.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// A abstract class to define common parameters of lane area in which vehicles can halt (GNE version) -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEStoppingPlace.h" - -// =========================================================================== -// static members -// =========================================================================== - -const double GNEStoppingPlace::myCircleWidth = 1.1; -const double GNEStoppingPlace::myCircleWidthSquared = 1.21; -const double GNEStoppingPlace::myCircleInWidth = 0.9; -const double GNEStoppingPlace::myCircleInText = 1.6; - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEStoppingPlace::GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, GNELane* lane, double startPos, double endPos, - int parametersSet, const std::string& name, bool friendlyPosition, bool blockMovement) : - GNEAdditional(id, viewNet, type, tag, name, blockMovement, {}, {lane}, {}, {}, {}, {}, {}, {}, {}, {}), - myStartPosition(startPos), - myEndPosition(endPos), - myParametersSet(parametersSet), -myFriendlyPosition(friendlyPosition) { -} - - -GNEStoppingPlace::~GNEStoppingPlace() {} - - -bool -GNEStoppingPlace::isAdditionalValid() const { - // with friendly position enabled position are "always fixed" - if (myFriendlyPosition) { - return true; - } else { - // obtain lane length - double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); - // calculate start and end positions - double startPos = (myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0; - double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : laneLength; - // check if position has to be fixed - if (startPos < 0) { - startPos += laneLength; - } - if (endPos < 0) { - endPos += laneLength; - } - // check values - if (myParametersSet == 0) { - return true; - } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) == 0) { - return (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) == 0) { - return (startPos >= 0); - } else { - return ((startPos >= 0) && (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPos - startPos) >= POSITION_EPS)); - } - } -} - - -std::string -GNEStoppingPlace::getAdditionalProblem() const { - // calculate start and end positions - double startPos = (myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0; - double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // obtain lane length - double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - // check if position has to be fixed - if (startPos < 0) { - startPos += laneLength; - } - if (endPos < 0) { - endPos += laneLength; - } - // declare variables - std::string errorStart, separator, errorEnd; - // check positions over lane - if (startPos < 0) { - errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0"); - } else if (startPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { - errorStart = (toString(SUMO_ATTR_STARTPOS) + " > lanes's length"); - } - if (endPos < 0) { - errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0"); - } else if (endPos > 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; -} - - -void -GNEStoppingPlace::fixAdditionalProblem() { - // declare new start and end position - double newStartPos = myStartPosition; - double newEndPos = myEndPosition; - // fix start and end positions using fixStoppingPlacePosition - SUMORouteHandler::checkStopPos(newStartPos, newEndPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, true); - // set new start and end positions - setAttribute(SUMO_ATTR_STARTPOS, toString(newStartPos), myViewNet->getUndoList()); - setAttribute(SUMO_ATTR_ENDPOS, toString(newEndPos), myViewNet->getUndoList()); -} - - -Position -GNEStoppingPlace::getPositionInView() const { - // calculate start and end positions as absolute values - double startPos = fabs((myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0); - double endPos = fabs((myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - // obtain position in view depending if both positions are defined - if (myParametersSet == 0) { - return getParentLanes().front()->getLaneShape().positionAtOffset(getParentLanes().front()->getLaneShape().length() / 2); - } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) == 0) { - return getParentLanes().front()->getLaneShape().positionAtOffset(endPos); - } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) == 0) { - return getParentLanes().front()->getLaneShape().positionAtOffset(startPos); - } else { - return getParentLanes().front()->getLaneShape().positionAtOffset((startPos + endPos) / 2.0); - } -} - - -void -GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) { - // first check tat both net elements are lanes and originalElement correspond to stoppingPlace lane - if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && - (originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && - (getParentLanes().front() == originalElement)) { - // check if we have to change additional lane depending of split position - if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (myParametersSet & STOPPINGPLACE_ENDPOS_SET)) { - // calculate middle position - const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition; - // four cases: - if (splitPosition < myStartPosition) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust start and end position - setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList); - setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); - } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust start and end position - setAttribute(SUMO_ATTR_STARTPOS, "0", undoList); - setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); - } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) { - // only adjust end position - setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList); - } else if ((splitPosition > myEndPosition)) { - // nothing to do - } - } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (splitPosition < myStartPosition)) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust start position - setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList); - } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) && (splitPosition < myEndPosition)) { - // change lane - setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); - // now adjust end position - setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); - } - } -} - - -void -GNEStoppingPlace::moveGeometry(const Position& offset) { - // only move if at leats start or end positions is defined - if (myParametersSet > 0) { - // Calculate new position using old position - Position newPosition = myMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myMove.originalViewPosition, false); - // check if both position has to be moved - if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (myParametersSet & STOPPINGPLACE_ENDPOS_SET)) { - // calculate stoppingPlace length and lane length (After apply geometry factor) - double stoppingPlaceLength = fabs(parse(myMove.secondOriginalPosition) - parse(myMove.firstOriginalLanePosition)); - double laneLengt = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); - // avoid changing stopping place's length - if ((parse(myMove.firstOriginalLanePosition) + offsetLane) < 0) { - myStartPosition = 0; - myEndPosition = stoppingPlaceLength; - } else if ((parse(myMove.secondOriginalPosition) + offsetLane) > laneLengt) { - myStartPosition = laneLengt - stoppingPlaceLength; - myEndPosition = laneLengt; - } else { - myStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; - myEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; - } - } else { - // check if start position must be moved - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - myStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; - } - // check if start position must be moved - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - myEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; - } - } - // Update geometry - updateGeometry(); - } -} - - -void -GNEStoppingPlace::commitGeometryMoving(GNEUndoList* undoList) { - // only commit geometry moving if at leats start or end positions is defined - if (myParametersSet > 0) { - undoList->p_begin("position of " + getTagStr()); - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_STARTPOS, toString(myStartPosition), true, myMove.firstOriginalLanePosition)); - } - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ENDPOS, toString(myEndPosition), true, myMove.secondOriginalPosition)); - } - undoList->p_end(); - } -} - - -double -GNEStoppingPlace::getStartPosition() const { - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return myStartPosition; - } else { - return 0; - } -} - - -double -GNEStoppingPlace::getEndPosition() const { - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return myEndPosition; - } else { - return getParentLanes().front()->getLaneShapeLength(); - } -} - - -std::string -GNEStoppingPlace::getParentName() const { - return getParentLanes().front()->getMicrosimID(); -} - - -void -GNEStoppingPlace::setStoppingPlaceGeometry(double movingToSide) { - // Get value of option "lefthand" - const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; - - // obtain laneShape - PositionVector laneShape = getParentLanes().front()->getLaneShape(); - - // Move shape to side - laneShape.move2side(movingToSide * offsetSign); - - // Cut shape using as delimitators fixed start position and fixed end position - myAdditionalGeometry.updateGeometry(laneShape, getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); -} - - -double -GNEStoppingPlace::getStartGeometryPositionOverLane() const { - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - double fixedPos = myStartPosition; - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - if (fixedPos < 0) { - fixedPos += len; - } - return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); - } else { - return 0; - } -} - - -double -GNEStoppingPlace::getEndGeometryPositionOverLane() const { - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - double fixedPos = myEndPosition; - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - if (fixedPos < 0) { - fixedPos += len; - } - return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); - } else { - return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } -} - - -double -GNEStoppingPlace::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_STARTPOS: - if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { - return myStartPosition; - } else { - return -1; - } - case SUMO_ATTR_ENDPOS: - if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { - return myEndPosition; - } else { - return -1; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEStoppingPlace::isAttributeEnabled(SumoXMLAttr /*key*/) const { - // all stopping place attributes are always enabled - return true; -} - - -std::string -GNEStoppingPlace::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNEStoppingPlace::getHierarchyName() const { - return getTagStr(); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEStoppingPlace.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,210 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStoppingPlace.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// A abstract class to define common parameters of lane area in which vehicles can halt (GNE version) -/****************************************************************************/ -#ifndef GNEStoppingPlace_h -#define GNEStoppingPlace_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// value definitions -// =========================================================================== -const int STOPPINGPLACE_STARTPOS_SET = 1; -const int STOPPINGPLACE_ENDPOS_SET = 2; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEStoppingPlace - * @briefA abstract class to define common parameters and functions of stopping places - */ -class GNEStoppingPlace : public GNEAdditional { - -public: - /**@brief Constructor. - * @param[in] id Gl-id of the stopping place (Must be unique) - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] type GUIGlObjectType of stoppingPlace - * @param[in] tag Type of xml tag that define the StoppingPlace (SUMO_TAG_BUS_STOP, SUMO_TAG_CHARGING_STATION, etc...) - * @param[in] lane Lane of this StoppingPlace belongs - * @param[in] startPos Start position of the StoppingPlace - * @param[in] endPos End position of the StoppingPlace - * @param[in] parametersSet Variable used to save flags STOPPINGPLACE_STARTPOS_SET and STOPPINGPLACE_ENDPOS_SET - * @param[in] name Name of stoppingPlace - * @param[in] friendlyPos enable or disable friendly position - * @param[in] block movement enable or disable additional movement - */ - GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, GNELane* lane, double startPos, double endPos, - int parametersSet, const std::string& name, bool friendlyPosition, bool blockMovement); - - /// @brief Destructor - ~GNEStoppingPlace(); - - /// @name members and functions relative to write additionals into XML - /// @{ - /// @brief check if current additional is valid to be writed into XML - bool isAdditionalValid() const; - - /// @brief return a string with the current additional problem - std::string getAdditionalProblem() const; - - /// @brief fix additional problem - void fixAdditionalProblem(); - /// @} - - /// @brief get start Position - double getStartPosition() const; - - /// @brief get end Position - double getEndPosition() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - virtual Boundary getCenteringBoundary() const = 0; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GNEAdditional - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name 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 - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /* @brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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; - /// @} - -protected: - /// @brief The relative start position this stopping place is located at (optional, if empty takes 0) - double myStartPosition; - - /// @brief The position this stopping place is located at (optional, if empty takes the lane length) - double myEndPosition; - - /// @brief Variable used for set/unset start/endPositions - int myParametersSet; - - /// @brief Flag for friendly position - bool myFriendlyPosition; - - /// @brief The position of the sign - Position mySignPos; - - /// @brief circle width resolution for all stopping places - static const double myCircleWidth; - - /// @brief squared circle width resolution for all stopping places - static const double myCircleWidthSquared; - - /// @brief inner circle width resolution for all stopping places - static const double myCircleInWidth; - - /// @brief text inner circle width resolution for all stopping places - static const double myCircleInText; - - /// @brief set geometry common to all stopping places - void setStoppingPlaceGeometry(double movingToSide); - - /// @brief get start position over lane that is applicable to the shape - double getStartGeometryPositionOverLane() const; - - /// @brief get end position over lane that is applicable to the shape - double getEndGeometryPositionOverLane() const; - -private: - /// @brief set attribute after validation - virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - - /// @brief Invalidate set new position in the view - void setPosition(const Position& pos) = delete; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZ.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZ.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZ.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZ.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,585 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZ.cpp -/// @author Pablo Alvarez Lopez -/// @date Oct 2018 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "GNETAZ.h" - - -// =========================================================================== -// static members -// =========================================================================== -const double GNETAZ::myHintSize = 0.8; -const double GNETAZ::myHintSizeSquared = 0.64; - - -// =========================================================================== -// member method definitions -// =========================================================================== -GNETAZ::GNETAZ(const std::string& id, GNEViewNet* viewNet, PositionVector shape, RGBColor color, bool blockMovement) : - GNEAdditional(id, viewNet, GLO_TAZ, SUMO_TAG_TAZ, "", blockMovement, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), - myColor(color), - myTAZShape(shape), - myBlockShape(false), - myCurrentMovingVertexIndex(-1), - myMaxWeightSource(0), - myMinWeightSource(0), - myAverageWeightSource(0), - myMaxWeightSink(0), - myMinWeightSink(0), -myAverageWeightSink(0) { -} - - -GNETAZ::~GNETAZ() {} - - -const PositionVector& -GNETAZ::getTAZShape() const { - return myTAZShape; -} - - -void -GNETAZ::updateGeometry() { - // Nothing to do -} - - -void -GNETAZ::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), myTAZShape); -} - - -Position -GNETAZ::getPositionInView() const { - return myTAZShape.getCentroid(); -} - - -Boundary -GNETAZ::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else if (myTAZShape.size() > 0) { - Boundary b = myTAZShape.getBoxBoundary(); - b.grow(20); - return b; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNETAZ::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNETAZ::moveGeometry(const Position& offset) { - // restore old position, apply offset and update Geometry - myTAZShape[0] = myMove.originalViewPosition; - myTAZShape[0].add(offset); - // filtern position using snap to active grid - myTAZShape[0] = myViewNet->snapToActiveGrid(myTAZShape[0]); -} - - -void -GNETAZ::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_SHAPE, toString(myTAZShape[0]), true, toString(myMove.originalViewPosition))); - undoList->p_end(); -} - - -int -GNETAZ::moveVertexShape(const int index, const Position& oldPos, const Position& offset) { - // only move shape if block movement block shape are disabled - if (!myBlockMovement && !myBlockShape && (index != -1)) { - // check that index is correct before change position - if (index < (int)myTAZShape.size()) { - // save current moving Geometry Point - myCurrentMovingVertexIndex = index; - // if closed shape and cliked is first or last, move both giving more priority to first always - if ((index == 0 || index == (int)myTAZShape.size() - 1)) { - // Change position of first shape Geometry Point and filtern position using snap to active grid - myTAZShape.front() = oldPos; - myTAZShape.front().add(offset); - myTAZShape.front() = myViewNet->snapToActiveGrid(myTAZShape.front()); - // Change position of last shape Geometry Point and filtern position using snap to active grid - myTAZShape.back() = oldPos; - myTAZShape.back().add(offset); - myTAZShape.back() = myViewNet->snapToActiveGrid(myTAZShape.back()); - } else { - // change position of Geometry Point and filtern position using snap to active grid - myTAZShape[index] = oldPos; - myTAZShape[index].add(offset); - myTAZShape[index] = myViewNet->snapToActiveGrid(myTAZShape[index]); - } - // return index of moved Geometry Point - return index; - } else { - throw InvalidArgument("Index greater than shape size"); - } - } else { - return index; - } -} - - -void -GNETAZ::moveEntireShape(const PositionVector& oldShape, const Position& offset) { - // only move shape if block movement is disabled and block shape is enabled - if (!myBlockMovement && myBlockShape) { - // restore original shape - myTAZShape = oldShape; - // change all points of the shape shape using offset - for (auto& i : myTAZShape) { - i.add(offset); - } - } -} - - -void -GNETAZ::commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList) { - if (!myBlockMovement) { - // disable current moving vertex - myCurrentMovingVertexIndex = -1; - // restore original shape into shapeToCommit - PositionVector shapeToCommit = myTAZShape; - // restore old shape in polygon (to avoid problems with RTree) - myTAZShape = oldShape; - // first check if double points has to be removed - shapeToCommit.removeDoublePoints(myHintSize); - if (shapeToCommit.size() != myTAZShape.size()) { - WRITE_WARNING("Merged shape's point") - } - // check if polygon has to be closed - if (shapeToCommit.size() > 1 && shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < (2 * myHintSize)) { - shapeToCommit.pop_back(); - shapeToCommit.push_back(shapeToCommit.front()); - } - // commit new shape - undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_SHAPE, toString(shapeToCommit))); - undoList->p_end(); - } -} - - -int -GNETAZ::getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid) { - // check if position has to be snapped to grid - if (snapToGrid) { - pos = myViewNet->snapToActiveGrid(pos); - } - // first check if vertex already exists - for (auto i : myTAZShape) { - if (i.distanceTo2D(pos) < myHintSize) { - return myTAZShape.indexOfClosest(i); - } - } - // if vertex doesn't exist, insert it - if (createIfNoExist) { - return myTAZShape.insertAtClosest(pos, true); - } else { - return -1; - } -} - - -void -GNETAZ::deleteGeometryPoint(const Position& pos, bool allowUndo) { - if (myTAZShape.size() > 2) { - // obtain index - PositionVector modifiedShape = myTAZShape; - int index = modifiedShape.indexOfClosest(pos); - // remove point dependending of - if ((index == 0 || index == (int)modifiedShape.size() - 1)) { - modifiedShape.erase(modifiedShape.begin()); - modifiedShape.erase(modifiedShape.end() - 1); - modifiedShape.push_back(modifiedShape.front()); - } else { - modifiedShape.erase(modifiedShape.begin() + index); - } - // set new shape depending of allowUndo - if (allowUndo) { - myViewNet->getUndoList()->p_begin("delete geometry point"); - setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myViewNet->getUndoList()); - myViewNet->getUndoList()->p_end(); - } else { - // first remove object from grid due shape is used for boundary - myViewNet->getNet()->removeGLObjectFromGrid(this); - // set new shape - myTAZShape = modifiedShape; - // add object into grid again - myViewNet->getNet()->addGLObjectIntoGrid(this); - } - } else { - WRITE_WARNING("Number of remaining points insufficient") - } -} - - -bool -GNETAZ::isShapeBlocked() const { - return myBlockShape; -} - - -std::string -GNETAZ::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -void -GNETAZ::drawGL(const GUIVisualizationSettings& s) const { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // obtain Exaggeration - const double TAZExaggeration = s.polySize.getExaggeration(s, this); - const Boundary TAZBoundary = myTAZShape.getBoxBoundary(); - // check if TAZ can be drawn - if ((TAZExaggeration > 0) && (s.scale * MAX2(TAZBoundary.getWidth(), TAZBoundary.getHeight())) >= s.polySize.minSize) { - // push name - glPushName(getGlID()); - if (myTAZShape.size() > 1) { - glPushMatrix(); - glTranslated(0, 0, 128); - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(myColor); - } - GLHelper::drawLine(myTAZShape); - GLHelper::drawBoxLines(myTAZShape, s.polySize.getExaggeration(s, this)); - glPopMatrix(); - // draw name - drawName(myTAZShape.getPolygonCenter(), s.scale, s.polyName, s.angle); - } - // draw geometry details hints if is not too small and isn't in selecting mode - if (s.scale * myHintSize > 1.) { - // set values relative to mouse position regarding to shape - bool mouseOverVertex = false; - bool modeMove = myViewNet->getEditModes().networkEditMode == GNE_NMODE_MOVE; - Position mousePosition = myViewNet->getPositionInformation(); - double distanceToShape = myTAZShape.distance2D(mousePosition); - // set colors - RGBColor invertedColor, darkerColor; - if (drawUsingSelectColor()) { - invertedColor = s.colorSettings.selectionColor.invertedColor(); - darkerColor = s.colorSettings.selectionColor.changedBrightness(-32); - } else { - invertedColor = GLHelper::getColor().invertedColor(); - darkerColor = GLHelper::getColor().changedBrightness(-32); - } - // Draw geometry hints if polygon's shape isn't blocked - if (myBlockShape == false) { - // draw a boundary for moving using darkerColor - glPushMatrix(); - glTranslated(0, 0, GLO_POLYGON + 0.01); - GLHelper::setColor(darkerColor); - GLHelper::drawBoxLines(myTAZShape, (myHintSize / 4) * s.polySize.getExaggeration(s, this)); - glPopMatrix(); - // draw shape points only in Network supemode - if (myViewNet->getEditModes().currentSupermode != GNE_SUPERMODE_DEMAND) { - for (const auto& TAZVertex : myTAZShape) { - if (!s.drawForRectangleSelection || (myViewNet->getPositionInformation().distanceSquaredTo2D(TAZVertex) <= (myHintSizeSquared + 2))) { - glPushMatrix(); - glTranslated(TAZVertex.x(), TAZVertex.y(), GLO_POLYGON + 0.02); - // Change color of vertex and flag mouseOverVertex if mouse is over vertex - if (modeMove && (TAZVertex.distanceTo2D(mousePosition) < myHintSize)) { - mouseOverVertex = true; - GLHelper::setColor(invertedColor); - } else { - GLHelper::setColor(darkerColor); - } - GLHelper::drawFilledCircle(myHintSize, s.getCircleResolution()); - glPopMatrix(); - } - } - // check if draw moving hint has to be drawed - if (modeMove && (mouseOverVertex == false) && (myBlockMovement == false) && (distanceToShape < myHintSize)) { - // push matrix - glPushMatrix(); - Position hintPos = myTAZShape.size() > 1 ? myTAZShape.positionAtOffset2D(myTAZShape.nearest_offset_to_point2D(mousePosition)) : myTAZShape[0]; - glTranslated(hintPos.x(), hintPos.y(), GLO_POLYGON + 0.04); - GLHelper::setColor(invertedColor); - GLHelper:: drawFilledCircle(myHintSize, s.getCircleResolution()); - glPopMatrix(); - } - } - } - } - // check if dotted contour has to be drawn - if ((myViewNet->getDottedAC() == this) || (myViewNet->getViewParent()->getTAZFrame()->getTAZCurrentModul()->getTAZ() == this)) { - GNEGeometry::drawShapeDottedContour(s, GLO_POLYGON + 1, TAZExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -std::string -GNETAZ::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_SHAPE: - return toString(myTAZShape); - case SUMO_ATTR_COLOR: - return toString(myColor); - case SUMO_ATTR_EDGES: { - std::vector edgeIDs; - for (auto i : getChildAdditionals()) { - edgeIDs.push_back(i->getAttribute(SUMO_ATTR_EDGE)); - } - return toString(edgeIDs); - } - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_BLOCK_SHAPE: - return toString(myBlockShape); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_MIN_SOURCE: - return toString(myMinWeightSource); - case GNE_ATTR_MIN_SINK: - return toString(myMinWeightSink); - case GNE_ATTR_MAX_SOURCE: - return toString(myMaxWeightSource); - case GNE_ATTR_MAX_SINK: - return toString(myMaxWeightSink); - case GNE_ATTR_AVERAGE_SOURCE: - return toString(myAverageWeightSource); - case GNE_ATTR_AVERAGE_SINK: - return toString(myAverageWeightSink); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNETAZ::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case GNE_ATTR_MIN_SOURCE: - return myMinWeightSource; - case GNE_ATTR_MIN_SINK: - return myMinWeightSink; - case GNE_ATTR_MAX_SOURCE: - return myMaxWeightSource; - case GNE_ATTR_MAX_SINK: - return myMaxWeightSink; - case GNE_ATTR_AVERAGE_SOURCE: - return myAverageWeightSource; - case GNE_ATTR_AVERAGE_SINK: - return myAverageWeightSink; - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNETAZ::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: - case SUMO_ATTR_SHAPE: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_EDGES: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_BLOCK_SHAPE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNETAZ::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_SHAPE: - return canParse(value); - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_EDGES: - if (value.empty()) { - return true; - } else { - return SUMOXMLDefinitions::isValidListOfTypeID(value); - } - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_BLOCK_SHAPE: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNETAZ::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNETAZ::getPopUpID() const { - return getTagStr() + ":" + getID(); -} - - -std::string -GNETAZ::getHierarchyName() const { - return getTagStr(); -} - - -void -GNETAZ::updateParentAdditional() { - // reset all stadistic variables - myMaxWeightSource = 0; - myMinWeightSource = -1; - myAverageWeightSource = 0; - myMaxWeightSink = 0; - myMinWeightSink = -1; - myAverageWeightSink = 0; - // declare an extra variables for saving number of children - int numberOfSources = 0; - int numberOfSinks = 0; - // iterate over child additional - for (auto i : getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { - double weight = i->getAttributeDouble(SUMO_ATTR_WEIGHT); - // check max Weight - if (myMaxWeightSource < weight) { - myMaxWeightSource = weight; - } - // check min Weight - if ((myMinWeightSource == -1) || (weight < myMinWeightSource)) { - myMinWeightSource = weight; - } - // update Average - myAverageWeightSource += weight; - // update number of sources - numberOfSources++; - } else if (i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { - double weight = i->getAttributeDouble(SUMO_ATTR_WEIGHT); - // check max Weight - if (myMaxWeightSink < weight) { - myMaxWeightSink = weight; - } - // check min Weight - if ((myMinWeightSink == -1) || (weight < myMinWeightSink)) { - myMinWeightSink = weight; - } - // update Average - myAverageWeightSink += weight; - // update number of sinks - numberOfSinks++; - } - } - // calculate average - myAverageWeightSource /= numberOfSources; - myAverageWeightSink /= numberOfSinks; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_SHAPE: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myTAZShape = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_COLOR: - myColor = parse(value); - break; - case SUMO_ATTR_EDGES: - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_BLOCK_SHAPE: - myBlockShape = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZ.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZ.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZ.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZ.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZ.h -/// @author Pablo Alvarez Lopez -/// @date Oct 2018 -/// -// -/****************************************************************************/ -#ifndef GNETAZ_h -#define GNETAZ_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNETAZ - * Class for multy Entry/multy Exits detectors - */ -class GNETAZ : public GNEAdditional { - -public: - /**@brief GNETAZ Constructor - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] block movement enable or disable additional movement - */ - GNETAZ(const std::string& id, GNEViewNet* viewNet, PositionVector shape, RGBColor color, bool blockMovement); - - /// @brief GNETAZ Destructor - ~GNETAZ(); - - /// @brief get TAZ shape - const PositionVector& getTAZShape() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name Functions related with shape of element - /// @{ - /**@brief change position of a vertex of shape without commiting change - * @param[in] index index of Vertex shape - * @param[in] newPos The new position of vertex - * @return index of vertex (in some cases index can change - */ - int moveVertexShape(const int index, const Position& oldPos, const Position& offset); - - /**@brief move entire shape without commiting change - * @param[in] oldShape the old shape of polygon before moving - * @param[in] offset the offset of movement - */ - void moveEntireShape(const PositionVector& oldShape, const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) - * @param[in] oldShape the old shape of polygon - * @param[in] undoList The undoList on which to register changes - */ - void commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList); - - /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge - * @param pos position of new/existent vertex - * @param createIfNoExist enable or disable creation of new verte if there isn't another vertex in position - * @param snapToGrid enable or disable snapToActiveGrid - * @return index of position vector - */ - int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid); - - /// @brief delete the geometry point closest to the given pos - void deleteGeometryPoint(const Position& pos, bool allowUndo = true); - - /// @brief return true if Shape TAZ is blocked - bool isShapeBlocked() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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 update TAZ after add or remove a Source/sink, or change their weight - void updateParentAdditional(); - -protected: - /// @brief TAZ Color - RGBColor myColor; - - /// @brief TAZ shape - PositionVector myTAZShape; - - /// @brief flag for block shape - bool myBlockShape; - - /// @brief index of vertex that is been moved (-1 means that none vertex is been moved) - int myCurrentMovingVertexIndex; - -private: - /// @brief hint size of vertex - static const double myHintSize; - - /// @brief squaredhint size of vertex - static const double myHintSizeSquared; - - /// @brief Max source weight - double myMaxWeightSource; - - /// @brief Min source weight - double myMinWeightSource; - - /// @brief Average source weight - double myAverageWeightSource; - - /// @brief Max Sink weight - double myMaxWeightSink; - - /// @brief Min Sink weight - double myMinWeightSink; - - /// @brief Average Sink weight - double myAverageWeightSink; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNETAZ(const GNETAZ&) = delete; - - /// @brief Invalidated assignment operator. - GNETAZ& operator=(const GNETAZ&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,245 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZSourceSink.cpp -/// @author Pablo Alvarez Lopez -/// @date Apr 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include - -#include "GNETAZSourceSink.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNETAZSourceSink::GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight) : - GNEAdditional(TAZParent, TAZParent->getViewNet(), GLO_TAZ, sourceSinkTag, "", false, { - edge -}, {}, {}, {TAZParent}, {}, {}, {}, {}, {}, {}), -myDepartWeight(departWeight) { - //check that this is a TAZ Source OR a TAZ Sink - if ((sourceSinkTag != SUMO_TAG_TAZSOURCE) && (sourceSinkTag != SUMO_TAG_TAZSINK)) { - throw InvalidArgument("Invalid TAZ Child Tag"); - } -} - - -GNETAZSourceSink::~GNETAZSourceSink() {} - - -double -GNETAZSourceSink::getDepartWeight() const { - return myDepartWeight; -} - - -void -GNETAZSourceSink::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNETAZSourceSink::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNETAZSourceSink::updateGeometry() { - // This additional doesn't own a geometry -} - -void -GNETAZSourceSink::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNETAZSourceSink::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNETAZSourceSink::getCenteringBoundary() const { - return getParentEdges().front()->getCenteringBoundary(); -} - - -void -GNETAZSourceSink::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNETAZSourceSink::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNETAZSourceSink::drawGL(const GUIVisualizationSettings&) const { - // Currently This additional isn't drawn -} - - -std::string -GNETAZSourceSink::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_EDGE: - return getParentEdges().front()->getID(); - case SUMO_ATTR_WEIGHT: - return toString(myDepartWeight); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_TAZCOLOR: { - // obtain max and min weight source - double maxWeightSource = getParentAdditionals().at(0)->getAttributeDouble(GNE_ATTR_MAX_SOURCE); - double minWeightSource = getParentAdditionals().at(0)->getAttributeDouble(GNE_ATTR_MIN_SOURCE); - // avoid division between zero - if ((maxWeightSource - minWeightSource) == 0) { - return "0"; - } else { - // calculate percentage relative to the max and min weight - double percentage = (myDepartWeight - minWeightSource) / (maxWeightSource - minWeightSource); - // convert percentage to a value between [0-9] (because we have only 10 colors) - if (percentage >= 1) { - return "9"; - } else if (percentage < 0) { - return "0"; - } else { - return toString((int)(percentage * 10)); - } - } - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -double -GNETAZSourceSink::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_WEIGHT: - return myDepartWeight; - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNETAZSourceSink::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - // this additional is the only that can edit a variable directly, see GNEAdditionalHandler::buildTAZEdge(...) - if (undoList == nullptr) { - setAttribute(key, value); - } else { - if (value == getAttribute(key)) { - return; //avoid needless changes, later logic relies on the fact that attributes have changed - } - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_WEIGHT: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - } -} - - -bool -GNETAZSourceSink::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_WEIGHT: - return canParse(value) && (parse(value) >= 0); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - - -bool -GNETAZSourceSink::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_EDGE: - return false; - default: - return true; - } -} - - -std::string -GNETAZSourceSink::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNETAZSourceSink::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_WEIGHT); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNETAZSourceSink::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_WEIGHT: - myDepartWeight = parse(value); - // update statictis of TAZ parent - getParentAdditionals().at(0)->updateParentAdditional(); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNETAZSourceSink.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZSourceSink.h -/// @author Pablo Alvarez Lopez -/// @date Apr 2017 -/// -// -/****************************************************************************/ -#ifndef GNETAZSourceSink_h -#define GNETAZSourceSink_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNETAZ; -class GNETAZSink; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNETAZSourceSink - * class used to represent a interval used in Traffic Assignment Zones - */ -class GNETAZSourceSink : public GNEAdditional { - -public: - /**@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 - * @param[in] edge Edge of this TAZ Child belongs - * @param[in] departWeight depart weight of this TAZ child - */ - GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight); - - /// @brief destructor - ~GNETAZSourceSink(); - - /// @brief get depart weight - double getDepartWeight() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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; - /// @} - - /// @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 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 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; - - /// @} - -protected: - /// @brief depart Weight - double myDepartWeight; - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNETAZSourceSink(const GNETAZSourceSink&) = delete; - - /// @brief Invalidated assignment operator - GNETAZSourceSink& operator=(const GNETAZSourceSink&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVaporizer.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVaporizer.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVaporizer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVaporizer.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,362 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVaporizer.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVaporizer.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEVaporizer::GNEVaporizer(GNEViewNet* viewNet, GNEEdge* edge, SUMOTime begin, SUMOTime end, const std::string& name) : - GNEAdditional(edge->getID(), viewNet, GLO_VAPORIZER, SUMO_TAG_VAPORIZER, name, false, { - edge -}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -myBegin(begin), -myEnd(end) { -} - - -GNEVaporizer::~GNEVaporizer() { -} - - -void -GNEVaporizer::updateGeometry() { - // get lanes of edge - GNELane* firstLane = getParentEdges().front()->getLanes().at(0); - - // Get shape of parent lane - const double offset = firstLane->getLaneShape().length() < 2.5 ? firstLane->getLaneShape().length() : 2.5; - - // update geometry - myAdditionalGeometry.updateGeometry(firstLane, offset); - - // Set block icon position - myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); - - // Set offset of the block icon - myBlockIcon.offset = Position(1.1, (-3.06)); - - // Set block icon rotation, and using their rotation for logo - myBlockIcon.setRotation(firstLane); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEVaporizer::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), - myAdditionalGeometry.getPosition(), - myAdditionalGeometry.getRotation(), - myViewNet->getVisualisationSettings().additionalSettings.vaporizerSize, - myViewNet->getVisualisationSettings().additionalSettings.vaporizerSize); -} - - -Position -GNEVaporizer::getPositionInView() const { - if (getParentEdges().front()->getLanes().front()->getLaneShape().length() < 2.5) { - return getParentEdges().front()->getLanes().front()->getLaneShape().front(); - } else { - Position A = getParentEdges().front()->getLanes().front()->getLaneShape().positionAtOffset(2.5); - Position B = getParentEdges().front()->getLanes().back()->getLaneShape().positionAtOffset(2.5); - - // return Middle point - return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); - } -} - - -Boundary -GNEVaporizer::getCenteringBoundary() const { - return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); -} - - -void -GNEVaporizer::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEVaporizer::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEVaporizer::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -std::string -GNEVaporizer::getParentName() const { - return getParentEdges().front()->getMicrosimID(); -} - - -void -GNEVaporizer::drawGL(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double vaporizerExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(vaporizerExaggeration)) { - // get values - const int numberOfLanes = int(getParentEdges().front()->getLanes().size()); - const double width = (double) 2.0 * s.scale; - // begin draw - glPushName(getGlID()); - glLineWidth(1.0); - // set color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedAdditionalColor); - } else { - GLHelper::setColor(s.additionalSettings.vaporizerColor); - } - // draw shape - glPushMatrix(); - glTranslated(0, 0, getType()); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glScaled(vaporizerExaggeration, vaporizerExaggeration, 1); - glTranslated(-1.6, -1.6, 0); - glBegin(GL_QUADS); - glVertex2d(0, 0.25); - glVertex2d(0, -0.25); - glVertex2d((numberOfLanes * 3.3), -0.25); - glVertex2d((numberOfLanes * 3.3), 0.25); - glEnd(); - glTranslated(0, 0, .01); - glBegin(GL_LINES); - glVertex2d(0, 0.25 - .1); - glVertex2d(0, -0.25 + .1); - glEnd(); - // draw position indicator (White) if isn't being drawn for selecting - if ((width * vaporizerExaggeration > 1) && !s.drawForRectangleSelection) { - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectionColor); - } else { - GLHelper::setColor(RGBColor::WHITE); - } - glRotated(90, 0, 0, -1); - glBegin(GL_LINES); - glVertex2d(0, 0); - glVertex2d(0, (numberOfLanes * 3.3)); - glEnd(); - } - // Pop shape matrix - glPopMatrix(); - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), getType()); - glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); - glTranslated((-2.56), (-1.6), 0); - // Draw icon depending of Vaporizer is selected and if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, vaporizerExaggeration)) { - glColor3d(1, 1, 1); - glRotated(-90, 0, 0, 1); - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VAPORIZERSELECTED), s.additionalSettings.vaporizerSize); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VAPORIZER), s.additionalSettings.vaporizerSize); - } - } else { - GLHelper::setColor(s.additionalSettings.vaporizerColor); - GLHelper::drawBoxLine(Position(0, s.additionalSettings.vaporizerSize), 0, 2 * s.additionalSettings.vaporizerSize, s.additionalSettings.vaporizerSize); - } - // Pop logo matrix - glPopMatrix(); - // Show Lock icon - myBlockIcon.drawIcon(s, vaporizerExaggeration, 0.4); - // draw name - drawName(getPositionInView(), s.scale, s.addName); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), vaporizerExaggeration, myDottedGeometry); - } - // pop name - glPopName(); - } -} - - -std::string -GNEVaporizer::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_EDGE: - return getAdditionalID(); - case SUMO_ATTR_BEGIN: - return time2string(myBegin); - case SUMO_ATTR_END: - return time2string(myEnd); - case SUMO_ATTR_NAME: - return myAdditionalName; - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEVaporizer::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_BEGIN: - return STEPS2TIME(myBegin); - case SUMO_ATTR_END: - return STEPS2TIME(myEnd); - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEVaporizer::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: - case SUMO_ATTR_EDGE: - case SUMO_ATTR_BEGIN: - case SUMO_ATTR_END: - case SUMO_ATTR_NAME: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVaporizer::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_EDGE: - if (myViewNet->getNet()->retrieveEdge(value, false) != nullptr) { - return isValidAdditionalID(value); - } else { - return false; - } - case SUMO_ATTR_BEGIN: - if (canParse(value)) { - return (parse(value) <= myEnd); - } else { - return false; - } - case SUMO_ATTR_END: - if (canParse(value)) { - return (myBegin <= parse(value)); - } else { - return false; - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVaporizer::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEVaporizer::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEVaporizer::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEVaporizer::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_EDGE: - changeAdditionalID(value); - replaceParentEdges(this, value); - break; - case SUMO_ATTR_BEGIN: - myBegin = parse(value); - break; - case SUMO_ATTR_END: - myEnd = parse(value); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVaporizer.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVaporizer.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVaporizer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVaporizer.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,154 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVaporizer.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// -/****************************************************************************/ -#ifndef GNEVaporizer_h -#define GNEVaporizer_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVaporizer - * @brief Representation of a vaporizer in netedit - */ -class GNEVaporizer : public GNEAdditional { - -public: - /**@brief Constructor - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] edge edge in which this vaporizer is placed - * @param[in] begin start time of vaporizer - * @param[in] end end time of vaporizer - * @param[in] name Vaporizer name - */ - GNEVaporizer(GNEViewNet* viewNet, GNEEdge* edge, SUMOTime begin, SUMOTime end, const std::string& name); - - /// @brief Destructor - ~GNEVaporizer(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /// @brief Returns the name of the parent object - /// @return This object's parent id - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief begin time of vaporizer - SUMOTime myBegin; - - /// @brief end time in which this vaporizer is placed - SUMOTime myEnd; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEVaporizer(const GNEVaporizer&) = delete; - - /// @brief Invalidated assignment operator. - GNEVaporizer& operator=(const GNEVaporizer&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,334 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVariableSpeedSign.cpp -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVariableSpeedSign.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEVariableSpeedSign::GNEVariableSpeedSign(const std::string& id, GNEViewNet* viewNet, const Position& pos, const std::vector& lanes, const std::string& name, bool blockMovement) : - GNEAdditional(id, viewNet, GLO_VSS, SUMO_TAG_VSS, name, blockMovement, {}, {}, {}, {}, {}, {}, lanes, {}, {}, {}), -myPosition(pos) { -} - - -GNEVariableSpeedSign::~GNEVariableSpeedSign() { -} - - -void -GNEVariableSpeedSign::updateGeometry() { - // Set block icon position - myBlockIcon.position = myPosition; - - // Set block icon offset - myBlockIcon.offset = Position(-0.5, -0.5); - - // Set block icon rotation, and using their rotation for draw logo - myBlockIcon.setRotation(); - - // update child connections - myChildConnections.update(); - - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEVariableSpeedSign::updateDottedContour() { - myDottedGeometry.updateDottedGeometry(myViewNet->getVisualisationSettings(), myPosition, 0, - myViewNet->getVisualisationSettings().additionalSettings.VSSSize, - myViewNet->getVisualisationSettings().additionalSettings.VSSSize); -} - - -Position -GNEVariableSpeedSign::getPositionInView() const { - return myPosition; -} - - -Boundary -GNEVariableSpeedSign::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMove.movingGeometryBoundary.isInitialised()) { - return myMove.movingGeometryBoundary; - } else { - Boundary b; - b.add(myPosition); - b.grow(5); - return b; - } -} - - -void -GNEVariableSpeedSign::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEVariableSpeedSign::openAdditionalDialog() { - // Open VSS dialog - GNEVariableSpeedSignDialog(this); -} - - -void -GNEVariableSpeedSign::moveGeometry(const Position& offset) { - // restore old position, apply offset and update Geometry - myPosition = myMove.originalViewPosition; - myPosition.add(offset); - // filtern position using snap to active grid - myPosition = myViewNet->snapToActiveGrid(myPosition); - updateGeometry(); -} - - -void -GNEVariableSpeedSign::commitGeometryMoving(GNEUndoList* undoList) { - // commit new position allowing undo/redo - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_POSITION, toString(myPosition), true, toString(myMove.originalViewPosition))); - undoList->p_end(); -} - - -std::string -GNEVariableSpeedSign::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -void -GNEVariableSpeedSign::drawGL(const GUIVisualizationSettings& s) const { - // obtain exaggeration - const double VSSExaggeration = s.addSize.getExaggeration(s, this); - // first check if additional has to be drawn - if (s.drawAdditionals(VSSExaggeration)) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix for drawing logo - glPushMatrix(); - glTranslated(myPosition.x(), myPosition.y(), getType()); - // scale - glScaled(VSSExaggeration, VSSExaggeration, 1); - // Draw icon depending of variable speed sign is or if isn't being drawn for selecting - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, VSSExaggeration)) { - glColor3d(1, 1, 1); - glRotated(180, 0, 0, 1); - if (drawUsingSelectColor()) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VARIABLESPEEDSIGNSELECTED), s.additionalSettings.VSSSize); - } else { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VARIABLESPEEDSIGN), s.additionalSettings.VSSSize); - } - } else { - GLHelper::setColor(RGBColor::WHITE); - GLHelper::drawBoxLine(Position(0, s.additionalSettings.VSSSize), 0, 2 * s.additionalSettings.VSSSize, s.additionalSettings.VSSSize); - - } - // Pop draw icon matrix - glPopMatrix(); - // Show Lock icon - myBlockIcon.drawIcon(s, VSSExaggeration, 0.4); - // Draw child connections - drawChildConnections(s, getType()); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getPositionInView(), s.scale, s.addName); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), VSSExaggeration, myDottedGeometry); - // draw shape dotte contour aroud alld connections between child and parents - for (auto i : myChildConnections.connectionPositions) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); - } - } - // Pop name - glPopName(); - } -} - - -std::string -GNEVariableSpeedSign::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_LANES: - return parseIDs(getChildLanes()); - case SUMO_ATTR_POSITION: - return toString(myPosition); - case SUMO_ATTR_NAME: - return myAdditionalName; - case GNE_ATTR_BLOCK_MOVEMENT: - return toString(myBlockMovement); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEVariableSpeedSign::getAttributeDouble(SumoXMLAttr key) const { - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); -} - - -void -GNEVariableSpeedSign::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: { - // change ID of Rerouter Interval - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - // Change Ids of all Variable Speed Sign - for (auto i : getChildAdditionals()) { - i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_STEP), undoList); - } - break; - } - case SUMO_ATTR_LANES: - case SUMO_ATTR_POSITION: - case SUMO_ATTR_NAME: - case GNE_ATTR_BLOCK_MOVEMENT: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVariableSpeedSign::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_LANES: - if (value.empty()) { - return false; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_NAME: - return SUMOXMLDefinitions::isValidAttribute(value); - case GNE_ATTR_BLOCK_MOVEMENT: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVariableSpeedSign::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEVariableSpeedSign::getPopUpID() const { - return getTagStr() + ": " + getID(); -} - - -std::string -GNEVariableSpeedSign::getHierarchyName() const { - return getTagStr(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEVariableSpeedSign::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_LANES: - changeChildLanes(this, value); - break; - case SUMO_ATTR_POSITION: - myViewNet->getNet()->removeGLObjectFromGrid(this); - myPosition = parse(value); - myViewNet->getNet()->addGLObjectIntoGrid(this); - break; - case SUMO_ATTR_NAME: - myAdditionalName = value; - break; - case GNE_ATTR_BLOCK_MOVEMENT: - myBlockMovement = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSign.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVariableSpeedSign.h -/// @author Pablo Alvarez Lopez -/// @date Nov 2015 -/// -// -/****************************************************************************/ -#ifndef GNEVariableSpeedSign_h -#define GNEVariableSpeedSign_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEVariableSpeedSignStep; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVariableSpeedSign - * allows the simulation of variable speed signs - */ -class GNEVariableSpeedSign : public GNEAdditional { - -public: - - /**@brief Constructor - * @param[in] id The storage of gl-ids to get the one for this lane representation from - * @param[in] viewNet pointer to GNEViewNet of this additional element belongs - * @param[in] pos position (center) of the variable speed sign in the map - * @param[in] lanes vector with the lanes of variable speed signal - * @param[in] name VSS name - * @param[in] block movement enable or disable additional movement - */ - GNEVariableSpeedSign(const std::string& id, GNEViewNet* viewNet, const Position& pos, const std::vector& lanes, const std::string& name, bool blockMovement); - - /// @brief Destructor - ~GNEVariableSpeedSign(); - - /// @brief open GNEVariableSpeedSignDialog - void openAdditionalDialog(); - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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; - /// @} - -protected: - /// @brief position of VSS in view - Position myPosition; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEVariableSpeedSign(const GNEVariableSpeedSign&) = delete; - - /// @brief Invalidated assignment operator. - GNEVariableSpeedSign& operator=(const GNEVariableSpeedSign&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.cpp sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.cpp --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,247 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVariableSpeedSignStep.cpp -/// @author Pablo Alvarez Lopez -/// @date Apr 2017 -/// -// -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include - -#include "GNEVariableSpeedSignStep.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog) : - GNEAdditional(variableSpeedSignDialog->getEditedAdditional(), variableSpeedSignDialog->getEditedAdditional()->getViewNet(), GLO_VSS, SUMO_TAG_STEP, "", false, -{}, {}, {}, {variableSpeedSignDialog->getEditedAdditional()}, {}, {}, {}, {}, {}, {}) { - // fill VSS Step with default values - setDefaultValues(); - // set time Attribute manually - if (getParentAdditionals().at(0)->getChildAdditionals().size() > 0) { - myTime = getParentAdditionals().at(0)->getChildAdditionals().back()->getAttributeDouble(SUMO_ATTR_TIME) + 1; - } else { - myTime = 0; - } -} - - -GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed) : - GNEAdditional(variableSpeedSignParent, variableSpeedSignParent->getViewNet(), GLO_VSS, SUMO_TAG_STEP, "", false, -{}, {}, {}, {variableSpeedSignParent}, {}, {}, {}, {}, {}, {}), -myTime(time), -mySpeed(speed) { -} - - -GNEVariableSpeedSignStep::~GNEVariableSpeedSignStep() {} - - -double -GNEVariableSpeedSignStep::getTime() const { - return myTime; -} - - -void -GNEVariableSpeedSignStep::moveGeometry(const Position&) { - // This additional cannot be moved -} - - -void -GNEVariableSpeedSignStep::commitGeometryMoving(GNEUndoList*) { - // This additional cannot be moved -} - - -void -GNEVariableSpeedSignStep::updateGeometry() { - // This additional doesn't own a geometry -} - - -void -GNEVariableSpeedSignStep::updateDottedContour() { - // This additional doesn't own a dotted contour -} - - -Position -GNEVariableSpeedSignStep::getPositionInView() const { - return getParentAdditionals().at(0)->getPositionInView(); -} - - -Boundary -GNEVariableSpeedSignStep::getCenteringBoundary() const { - return getParentAdditionals().at(0)->getCenteringBoundary(); -} - - -void -GNEVariableSpeedSignStep::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -std::string -GNEVariableSpeedSignStep::getParentName() const { - return getParentAdditionals().at(0)->getID(); -} - - -void -GNEVariableSpeedSignStep::drawGL(const GUIVisualizationSettings&) const { - // Currently This additional isn't drawn -} - - -std::string -GNEVariableSpeedSignStep::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getAdditionalID(); - case SUMO_ATTR_TIME: - return toString(myTime); - case SUMO_ATTR_SPEED: - return toString(mySpeed); - case GNE_ATTR_PARENT: - return getParentAdditionals().at(0)->getID(); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEVariableSpeedSignStep::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_TIME: - return myTime; - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEVariableSpeedSignStep::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: - case SUMO_ATTR_TIME: - case SUMO_ATTR_SPEED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVariableSpeedSignStep::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidAdditionalID(value); - case SUMO_ATTR_TIME: - if (canParse(value)) { - // Check that - double newTime = parse(value); - // Only allowed positiv times - if (newTime < 0) { - return false; - } - // check that there isn't duplicate times - int counter = 0; - for (auto i : getParentAdditionals().at(0)->getChildAdditionals()) { - if (i->getAttributeDouble(SUMO_ATTR_TIME) == newTime) { - counter++; - } - } - return (counter <= 1); - } else { - return false; - } - case SUMO_ATTR_SPEED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVariableSpeedSignStep::isAttributeEnabled(SumoXMLAttr /* key */) const { - return true; -} - - -std::string -GNEVariableSpeedSignStep::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEVariableSpeedSignStep::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_TIME); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEVariableSpeedSignStep::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeAdditionalID(value); - break; - case SUMO_ATTR_TIME: - myTime = parse(value); - break; - case SUMO_ATTR_SPEED: - mySpeed = parse(value); - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.h sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.h --- sumo-1.5.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/additionals/GNEVariableSpeedSignStep.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,162 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVariableSpeedSignStep.h -/// @author Pablo Alvarez Lopez -/// @date Apr 2017 -/// -// -/****************************************************************************/ -#ifndef GNEVariableSpeedSignStep_h -#define GNEVariableSpeedSignStep_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEAdditional.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEVariableSpeedSign; -class GNEVariableSpeedSignDialog; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVariableSpeedSignStep - * class used to represent a interval used in variable speed sign - */ -class GNEVariableSpeedSignStep : public GNEAdditional { - -public: - /// @brief default constructor - GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog); - - /// @brief constructor - GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed); - - /// @brief destructor - ~GNEVariableSpeedSignStep(); - - /// @brief get time - double getTime() const; - - /// @name Functions related with geometry of element - /// @{ - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - Boundary getCenteringBoundary() const; - - /// @brief split geometry - void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() const; - - /**@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; - /// @} - - /// @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 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 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; - /// @} - -protected: - /// @brief timeStep - double myTime; - - /// @brief speed in this timeStep - double mySpeed; - -private: - /// @brief method for setting the attribute and nothing else - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief Invalidated copy constructor. - GNEVariableSpeedSignStep(const GNEVariableSpeedSignStep&) = delete; - - /// @brief Invalidated assignment operator - GNEVariableSpeedSignStep& operator=(const GNEVariableSpeedSignStep&) = delete; -}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/changes/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/changes/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -21,6 +21,12 @@ GNEChange_Additional.cpp GNEChange_DemandElement.h GNEChange_DemandElement.cpp + GNEChange_DataSet.h + GNEChange_DataSet.cpp + GNEChange_DataInterval.h + GNEChange_DataInterval.cpp + GNEChange_GenericData.h + GNEChange_GenericData.cpp GNEChange_Shape.h GNEChange_Shape.cpp GNEChange_Children.h diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Additional.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Additional.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Additional.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Additional.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,19 +17,10 @@ /// // A network change in which a busStop is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include -#include +#include #include "GNEChange_Additional.h" @@ -43,63 +34,23 @@ // =========================================================================== GNEChange_Additional::GNEChange_Additional(GNEAdditional* additional, bool forward) : - GNEChange(additional->getViewNet()->getNet(), forward), - myAdditional(additional), - myParentEdges(myAdditional->getParentEdges()), - myParentLanes(myAdditional->getParentLanes()), - myParentShapes(myAdditional->getParentShapes()), - myParentAdditionals(myAdditional->getParentAdditionals()), - myParentDemandElements(myAdditional->getParentDemandElements()), - myChildEdges(myAdditional->getChildEdges()), - myChildLanes(myAdditional->getChildLanes()), - myChildShapes(myAdditional->getChildShapes()), - myChildAdditionals(myAdditional->getChildAdditionals()), - myChildDemandElements(myAdditional->getChildDemandElements()) { + GNEChange(additional, additional, forward), + myAdditional(additional) { myAdditional->incRef("GNEChange_Additional"); } GNEChange_Additional::~GNEChange_Additional() { - assert(myAdditional); myAdditional->decRef("GNEChange_Additional"); if (myAdditional->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myAdditional->getTagStr() + " '" + myAdditional->getID() + "'"); // make sure that additional isn't in net before removing - if (myNet->additionalExist(myAdditional)) { - myNet->deleteAdditional(myAdditional, false); - // Remove additional from parent elements - for (const auto& i : myParentEdges) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentLanes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentAdditionals) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentDemandElements) { - i->removeChildAdditional(myAdditional); - } - // Remove additional from child elements - for (const auto& i : myChildEdges) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildLanes) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myChildAdditionals) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildDemandElements) { - i->removeParentAdditional(myAdditional); - } + if (myAdditional->getNet()->getAttributeCarriers()->additionalExist(myAdditional)) { + // delete additional from net + myAdditional->getNet()->getAttributeCarriers()->deleteAdditional(myAdditional); + // remove additional from parents and children + removeAdditional(myAdditional); } delete myAdditional; } @@ -112,79 +63,19 @@ // show extra information for tests WRITE_DEBUG("Removing " + myAdditional->getTagStr() + " '" + myAdditional->getID() + "' in GNEChange_Additional"); // delete additional from net - myNet->deleteAdditional(myAdditional, false); - // Remove additional from parent elements - for (const auto& i : myParentEdges) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentLanes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentAdditionals) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentDemandElements) { - i->removeChildAdditional(myAdditional); - } - // Remove additional from child elements - for (const auto& i : myChildEdges) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildLanes) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myChildAdditionals) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildDemandElements) { - i->removeParentAdditional(myAdditional); - } + myAdditional->getNet()->getAttributeCarriers()->deleteAdditional(myAdditional); + // remove additional from parents and children + removeAdditional(myAdditional); } else { // show extra information for tests WRITE_DEBUG("Adding " + myAdditional->getTagStr() + " '" + myAdditional->getID() + "' in GNEChange_Additional"); // insert additional into net - myNet->insertAdditional(myAdditional); + myAdditional->getNet()->getAttributeCarriers()->insertAdditional(myAdditional); // add additional in parent elements - for (const auto& i : myParentEdges) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentLanes) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentShapes) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentAdditionals) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentDemandElements) { - i->addChildAdditional(myAdditional); - } - // add additional in child elements - for (const auto& i : myChildEdges) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildLanes) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildShapes) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildAdditionals) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildDemandElements) { - i->addParentAdditional(myAdditional); - } + addAdditional(myAdditional); } // Requiere always save additionals - myNet->requireSaveAdditionals(true); + myAdditional->getNet()->requireSaveAdditionals(true); } @@ -194,79 +85,19 @@ // show extra information for tests WRITE_DEBUG("Adding " + myAdditional->getTagStr() + " '" + myAdditional->getID() + "' in GNEChange_Additional"); // insert additional into net - myNet->insertAdditional(myAdditional); + myAdditional->getNet()->getAttributeCarriers()->insertAdditional(myAdditional); // add additional in parent elements - for (const auto& i : myParentEdges) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentLanes) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentShapes) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentAdditionals) { - i->addChildAdditional(myAdditional); - } - for (const auto& i : myParentDemandElements) { - i->addChildAdditional(myAdditional); - } - // add additional in child elements - for (const auto& i : myChildEdges) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildLanes) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildShapes) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildAdditionals) { - i->addParentAdditional(myAdditional); - } - for (const auto& i : myChildDemandElements) { - i->addParentAdditional(myAdditional); - } + addAdditional(myAdditional); } else { // show extra information for tests WRITE_DEBUG("Removing " + myAdditional->getTagStr() + " '" + myAdditional->getID() + "' in GNEChange_Additional"); // delete additional from net - myNet->deleteAdditional(myAdditional, false); - // Remove additional from parent elements - for (const auto& i : myParentEdges) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentLanes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentAdditionals) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myParentDemandElements) { - i->removeChildAdditional(myAdditional); - } - // Remove additional from child elements - for (const auto& i : myChildEdges) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildLanes) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildShapes) { - i->removeChildAdditional(myAdditional); - } - for (const auto& i : myChildAdditionals) { - i->removeParentAdditional(myAdditional); - } - for (const auto& i : myChildDemandElements) { - i->removeParentAdditional(myAdditional); - } + myAdditional->getNet()->getAttributeCarriers()->deleteAdditional(myAdditional); + // remove additional from parents and children + removeAdditional(myAdditional); } // Requiere always save additionals - myNet->requireSaveAdditionals(true); + myAdditional->getNet()->requireSaveAdditionals(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Additional.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Additional.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Additional.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Additional.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,26 +17,11 @@ /// // A network change in which a additional element is created or deleted /****************************************************************************/ -#ifndef GNEChange_Additional_h -#define GNEChange_Additional_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GNEChange.h" -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEEdge; -class GNELane; -class GNEShape; -class GNEAdditional; -class GNEDemandElement; // =========================================================================== // class definitions @@ -78,37 +63,4 @@ * @note we assume shared responsibility for the pointer (via reference counting) */ GNEAdditional* myAdditional; - - /// @brief reference to vector of parent edges - const std::vector& myParentEdges; - - /// @brief reference to vector of parent lanes - const std::vector& myParentLanes; - - /// @brief reference to vector of parent shapes - const std::vector& myParentShapes; - - /// @brief reference to vector of parent additionals - const std::vector& myParentAdditionals; - - /// @brief reference to vector of parent demand elements - const std::vector& myParentDemandElements; - - /// @brief reference to vector of child edges - const std::vector& myChildEdges; - - /// @brief reference to vector of child lanes - const std::vector& myChildLanes; - - /// @brief reference to vector of child shapes - const std::vector& myChildShapes; - - /// @brief reference to vector of child additional - const std::vector& myChildAdditionals; - - /// @brief reference to vector of child demand elements - const std::vector& myChildDemandElements; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Attribute.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Attribute.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Attribute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Attribute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,14 +17,10 @@ /// // A network change in which something is changed (for undo/redo) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include +#include #include "GNEChange_Attribute.h" @@ -37,26 +33,24 @@ // member method definitions // =========================================================================== -GNEChange_Attribute::GNEChange_Attribute(GNEAttributeCarrier* ac, GNENet* net, - SumoXMLAttr key, const std::string& value, - bool customOrigValue, const std::string& origValue) : - GNEChange(net, true), +GNEChange_Attribute::GNEChange_Attribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& value) : + GNEChange(true), myAC(ac), myKey(key), myForceChange(false), - myOrigValue(customOrigValue ? origValue : ac->getAttribute(key)), + myOrigValue(ac->getAttribute(key)), myNewValue(value) { myAC->incRef("GNEChange_Attribute " + toString(myKey)); } -GNEChange_Attribute::GNEChange_Attribute(GNEAttributeCarrier* ac, GNENet* net, - bool forceChange, SumoXMLAttr key, const std::string& value) : - GNEChange(net, true), +GNEChange_Attribute::GNEChange_Attribute(GNEAttributeCarrier* ac, + SumoXMLAttr key, const std::string& value, const std::string& origValue) : + GNEChange(true), myAC(ac), myKey(key), - myForceChange(forceChange), - myOrigValue(ac->getAttribute(key)), + myForceChange(false), + myOrigValue(origValue), myNewValue(value) { myAC->incRef("GNEChange_Attribute " + toString(myKey)); } @@ -69,17 +63,8 @@ if (myAC->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myAC->getTagStr() + " '" + myAC->getID() + "' in GNEChange_Attribute"); - // Check if attribute carrier is a shape - if (myAC->getTagProperty().isShape()) { - // remove shape using specific functions - if (myAC->getTagProperty().getTag() == SUMO_TAG_POLY) { - myNet->removePolygon(myAC->getID()); - } else if ((myAC->getTagProperty().getTag() == SUMO_TAG_POI) || (myAC->getTagProperty().getTag() == SUMO_TAG_POILANE)) { - myNet->removePOI(myAC->getID()); - } - } else { - delete myAC; - } + // delete AC + delete myAC; } } @@ -96,13 +81,15 @@ if (myAC->getTagProperty().hasAttribute(myKey) && myAC->getTagProperty().getAttributeProperties(myKey).requireUpdateGeometry()) { myAC->updateGeometry(); } - // check if netElements, additional or shapes has to be saved (only if key isn't GNE_ATTR_SELECTED) - if (myAC->getTagProperty().isNetElement()) { - myNet->requireSaveNet(true); - } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isShape()) { - myNet->requireSaveAdditionals(true); + // check if networkElements, additional or shapes has to be saved (only if key isn't GNE_ATTR_SELECTED) + if (myAC->getTagProperty().isNetworkElement()) { + myAC->getNet()->requireSaveNet(true); + } else if (myAC->getTagProperty().isAdditionalElement() || myAC->getTagProperty().isShape() || myAC->getTagProperty().isTAZ()) { + myAC->getNet()->requireSaveAdditionals(true); } else if (myAC->getTagProperty().isDemandElement()) { - myNet->requireSaveDemandElements(true); + myAC->getNet()->requireSaveDemandElements(true); + } else if (myAC->getTagProperty().isDemandElement()) { + myAC->getNet()->requireSaveDataElements(true); } } } @@ -120,18 +107,26 @@ if (myAC->getTagProperty().hasAttribute(myKey) && myAC->getTagProperty().getAttributeProperties(myKey).requireUpdateGeometry()) { myAC->updateGeometry(); } - // check if netElements, additional or shapes has to be saved (only if key isn't GNE_ATTR_SELECTED) - if (myAC->getTagProperty().isNetElement()) { - myNet->requireSaveNet(true); - } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isShape()) { - myNet->requireSaveAdditionals(true); + // check if networkElements, additional or shapes has to be saved (only if key isn't GNE_ATTR_SELECTED) + if (myAC->getTagProperty().isNetworkElement()) { + myAC->getNet()->requireSaveNet(true); + } else if (myAC->getTagProperty().isAdditionalElement() || myAC->getTagProperty().isShape() || myAC->getTagProperty().isTAZ()) { + myAC->getNet()->requireSaveAdditionals(true); + } else if (myAC->getTagProperty().isDemandElement()) { + myAC->getNet()->requireSaveDemandElements(true); } else if (myAC->getTagProperty().isDemandElement()) { - myNet->requireSaveDemandElements(true); + myAC->getNet()->requireSaveDataElements(true); } } } +void +GNEChange_Attribute::forceChange() { + myForceChange = true; +} + + bool GNEChange_Attribute::trueChange() { // check if we're editing the value of an attribute or changing a disjoint attribute @@ -154,5 +149,4 @@ return ("Redo change " + myAC->getTagStr() + " attribute").c_str(); } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Attribute.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Attribute.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Attribute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Attribute.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,31 +17,12 @@ /// // A network change in which the attribute of some object is modified /****************************************************************************/ -#ifndef GNEChange_Attribute_h -#define GNEChange_Attribute_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNEAttributeCarrier; -class GNENetElement; -class GNEAdditional; -class GNEDemandElement; -class GNEShape; -class GNENet; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -52,31 +33,21 @@ FXDECLARE_ABSTRACT(GNEChange_Attribute) public: - /**@brief Constructor + /**@brief constructor * @param[in] ac The attribute-carrier to be modified - * @param[in] net Net in which AC is saved * @param[in] key The attribute key * @param[in] value The new value */ - GNEChange_Attribute(GNEAttributeCarrier* ac, - GNENet* net, - const SumoXMLAttr key, - const std::string& value, - bool customOrigValue = false, - const std::string& origValue = ""); + GNEChange_Attribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const std::string& value); - /**@brief Constructor + /**@brief Constructor with custom origin value * @param[in] ac The attribute-carrier to be modified - * @param[in] net Net in which AC is saved - * @param[in] forceChange enable or disable force change * @param[in] key The attribute key * @param[in] value The new value + * @param[in] customOrigValue custon original value */ - GNEChange_Attribute(GNEAttributeCarrier* ac, - GNENet* net, - bool forceChange, - const SumoXMLAttr key, - const std::string& value); + GNEChange_Attribute(GNEAttributeCarrier* ac, const SumoXMLAttr key, const std::string& value, + const std::string& customOrigValue); /// @brief Destructor ~GNEChange_Attribute(); @@ -96,6 +67,9 @@ void redo(); /// @} + /// @brief force change + void forceChange(); + /// @brief wether original and new value differ bool trueChange(); @@ -114,9 +88,6 @@ /// @brief the original value const std::string myOrigValue; - /// @brief the original value + /// @brief the new value const std::string myNewValue; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Children.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Children.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Children.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Children.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -15,16 +15,11 @@ /// @author Pablo Alvarez Lopez /// @date Jul 2019 /// -// A network change used to modify sorting of hierarchical element childrens +// A network change used to modify sorting of hierarchical element children /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include -#include -#include +#include #include #include "GNEChange_Children.h" @@ -39,7 +34,7 @@ // =========================================================================== GNEChange_Children::GNEChange_Children(GNEDemandElement* demandElementParent, GNEDemandElement* demandElementChild, const Operation operation) : - GNEChange(demandElementParent->getViewNet()->getNet(), true), + GNEChange(true), myParentDemandElement(demandElementParent), myChildDemandElement(demandElementChild), myOperation(operation), @@ -100,8 +95,8 @@ myParentDemandElement->myChildDemandElements = myEditedChildElements; } } - // Requiere always save childrens - myNet->requireSaveDemandElements(true); + // Requiere always save children + myParentDemandElement->getNet()->requireSaveDemandElements(true); } @@ -134,8 +129,8 @@ myParentDemandElement->myChildDemandElements = myOriginalChildElements; } } - // Requiere always save childrens - myNet->requireSaveDemandElements(true); + // Requiere always save children + myParentDemandElement->getNet()->requireSaveDemandElements(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Children.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Children.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Children.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Children.h 2020-04-27 21:47:56.000000000 +0000 @@ -15,26 +15,14 @@ /// @author Pablo Alvarez Lopez /// @date Jul 2019 /// -// A network change used to modify sorting of hierarchical element childrens +// A network change used to modify sorting of hierarchical element children /****************************************************************************/ -#ifndef GNEChange_Children_h -#define GNEChange_Children_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEDemandElement; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -90,9 +78,6 @@ /// @brief copy of child demand elementss before apply operation const std::vector myOriginalChildElements; - /// @brief element childrens after apply operation + /// @brief element children after apply operation std::vector myEditedChildElements; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Connection.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Connection.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Connection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Connection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,9 @@ /// // A network change in which a single connection is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include -#include +#include #include #include "GNEChange_Connection.h" @@ -39,7 +35,7 @@ GNEChange_Connection::GNEChange_Connection(GNEEdge* edge, NBEdge::Connection nbCon, bool selected, bool forward) : - GNEChange(edge->getNet(), forward), + GNEChange(forward), myEdge(edge), myNBEdgeConnection(nbCon), mySelected(selected) { @@ -70,8 +66,8 @@ // add connection into edge myEdge->addConnection(myNBEdgeConnection, mySelected); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } @@ -93,8 +89,8 @@ // remove connection from edge myEdge->removeConnection(myNBEdgeConnection); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Connection.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Connection.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Connection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Connection.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,28 +17,12 @@ /// // A network change in which a single connection is created or deleted /****************************************************************************/ -#ifndef GNEChange_Connection_h -#define GNEChange_Connection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include -#include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNEConnection; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -87,6 +71,3 @@ /// @brief flag to indicates if crossing was previously selected bool mySelected; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,26 +19,68 @@ // inherits from FXCommand and is used to for undo/redo /****************************************************************************/ +#include "GNEChange.h" + +#include +#include +#include +#include +#include +#include + // =========================================================================== -// included modules +// FOX-declarations // =========================================================================== -#include +FXIMPLEMENT_ABSTRACT(GNEChange, FXCommand, nullptr, 0) -#include "GNEChange.h" // =========================================================================== -// FOX-declarations +// static // =========================================================================== -FXIMPLEMENT_ABSTRACT(GNEChange, FXCommand, nullptr, 0) + +const std::vector GNEChange::myEmptyEdges = {}; +const std::vector GNEChange::myEmptyLanes = {}; +const std::vector GNEChange::myEmptyShapes = {}; +const std::vector GNEChange::myEmptyAdditionals = {}; +const std::vector GNEChange::myEmptyDemandElements = {}; +const std::vector GNEChange::myEmptyGenericDatas = {}; + // =========================================================================== // member method definitions // =========================================================================== -GNEChange::GNEChange(GNENet* net, bool forward) : - myNet(net), - myForward(forward) {} +GNEChange::GNEChange(bool forward) : + myForward(forward), + myParentEdges(myEmptyEdges), + myParentLanes(myEmptyLanes), + myParentShapes(myEmptyShapes), + myParentAdditionals(myEmptyAdditionals), + myParentDemandElements(myEmptyDemandElements), + myParentGenericDatas(myEmptyGenericDatas), + myChildEdges(myEmptyEdges), + myChildLanes(myEmptyLanes), + myChildShapes(myEmptyShapes), + myChildAdditionals(myEmptyAdditionals), + myChildDemandElements(myEmptyDemandElements), + myChildGenericDatas(myEmptyGenericDatas) {} + + +GNEChange::GNEChange(GNEHierarchicalParentElements* parents, GNEHierarchicalChildElements* childs, bool forward) : + myForward(forward), + myParentEdges(parents->getParentEdges()), + myParentLanes(parents->getParentLanes()), + myParentShapes(parents->getParentShapes()), + myParentAdditionals(parents->getParentAdditionals()), + myParentDemandElements(parents->getParentDemandElements()), + myParentGenericDatas(parents->getParentGenericDatas()), + myChildEdges(childs->getChildEdges()), + myChildLanes(childs->getChildLanes()), + myChildShapes(childs->getChildShapes()), + myChildAdditionals(childs->getChildAdditionals()), + myChildDemandElements(childs->getChildDemandElements()), + myChildGenericDatas(childs->getChildGenericDataElements()) {} GNEChange::~GNEChange() {} @@ -69,5 +111,520 @@ void GNEChange::redo() {} +void +GNEChange::addEdge(GNEEdge* edge) { + // add edge in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildEdge(edge); + } + for (const auto& parent : myParentLanes) { + parent->addChildEdge(edge); + } + for (const auto& parent : myParentShapes) { + parent->addChildEdge(edge); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildEdge(edge); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildEdge(edge); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildEdge(edge); + } + // add edge in child elements + for (const auto& child : myChildEdges) { + child->addParentEdge(edge); + } + for (const auto& child : myChildLanes) { + child->addParentEdge(edge); + } + for (const auto& child : myChildShapes) { + child->addParentEdge(edge); + } + for (const auto& child : myChildAdditionals) { + child->addParentEdge(edge); + } + for (const auto& child : myChildDemandElements) { + child->addParentEdge(edge); + } + for (const auto& child : myChildGenericDatas) { + child->addParentEdge(edge); + } +} + + +void +GNEChange::removeEdge(GNEEdge* edge) { + // Remove edge from parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildEdge(edge); + } + for (const auto& parent : myParentLanes) { + parent->removeChildEdge(edge); + } + for (const auto& parent : myParentShapes) { + parent->removeChildEdge(edge); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildEdge(edge); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildEdge(edge); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildEdge(edge); + } + // Remove edge from child elements + for (const auto& child : myChildEdges) { + child->addParentEdge(edge); + } + for (const auto& child : myChildLanes) { + child->addParentEdge(edge); + } + for (const auto& child : myChildShapes) { + child->addParentEdge(edge); + } + for (const auto& child : myChildAdditionals) { + child->addParentEdge(edge); + } + for (const auto& child : myChildDemandElements) { + child->addParentEdge(edge); + } + for (const auto& child : myChildGenericDatas) { + child->addParentEdge(edge); + } +} + + +void +GNEChange::addLane(GNELane* lane) { + // add lane in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildLane(lane); + } + for (const auto& parent : myParentLanes) { + parent->addChildLane(lane); + } + for (const auto& parent : myParentShapes) { + parent->addChildLane(lane); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildLane(lane); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildLane(lane); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildLane(lane); + } + // add lane in child elements + for (const auto& child : myChildEdges) { + child->addParentLane(lane); + } + for (const auto& child : myChildLanes) { + child->addParentLane(lane); + } + for (const auto& child : myChildShapes) { + child->addParentLane(lane); + } + for (const auto& child : myChildAdditionals) { + child->addParentLane(lane); + } + for (const auto& child : myChildDemandElements) { + child->addParentLane(lane); + } + for (const auto& child : myChildGenericDatas) { + child->addParentLane(lane); + } +} + + +void +GNEChange::removeLane(GNELane* lane) { + // Remove lane from parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildLane(lane); + } + for (const auto& parent : myParentLanes) { + parent->removeChildLane(lane); + } + for (const auto& parent : myParentShapes) { + parent->removeChildLane(lane); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildLane(lane); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildLane(lane); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildLane(lane); + } + // Remove lane from child elements + for (const auto& child : myChildEdges) { + child->removeParentLane(lane); + } + for (const auto& child : myChildLanes) { + child->removeParentLane(lane); + } + for (const auto& child : myChildShapes) { + child->removeParentLane(lane); + } + for (const auto& child : myChildAdditionals) { + child->removeParentLane(lane); + } + for (const auto& child : myChildDemandElements) { + child->removeParentLane(lane); + } + for (const auto& child : myChildGenericDatas) { + child->removeParentLane(lane); + } +} + + +void +GNEChange::addShape(GNEShape* shape) { + // add shape in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildShape(shape); + } + for (const auto& parent : myParentLanes) { + parent->addChildShape(shape); + } + for (const auto& parent : myParentShapes) { + parent->addChildShape(shape); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildShape(shape); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildShape(shape); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildShape(shape); + } + // add shape in child elements + for (const auto& child : myChildEdges) { + child->addParentShape(shape); + } + for (const auto& child : myChildLanes) { + child->addParentShape(shape); + } + for (const auto& child : myChildShapes) { + child->addParentShape(shape); + } + for (const auto& child : myChildAdditionals) { + child->addParentShape(shape); + } + for (const auto& child : myChildDemandElements) { + child->addParentShape(shape); + } + for (const auto& child : myChildGenericDatas) { + child->addParentShape(shape); + } +} + + +void +GNEChange::removeShape(GNEShape* shape) { + // Remove shape from parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildShape(shape); + } + for (const auto& parent : myParentLanes) { + parent->removeChildShape(shape); + } + for (const auto& parent : myParentShapes) { + parent->removeChildShape(shape); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildShape(shape); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildShape(shape); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildShape(shape); + } + // Remove shape from child elements + for (const auto& child : myChildEdges) { + child->removeParentShape(shape); + } + for (const auto& child : myChildLanes) { + child->removeParentShape(shape); + } + for (const auto& child : myChildShapes) { + child->removeParentShape(shape); + } + for (const auto& child : myChildAdditionals) { + child->removeParentShape(shape); + } + for (const auto& child : myChildDemandElements) { + child->removeParentShape(shape); + } + for (const auto& child : myChildGenericDatas) { + child->removeParentShape(shape); + } +} + + +void +GNEChange::addAdditional(GNEAdditional* additional) { + // add additional in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildAdditional(additional); + } + for (const auto& parent : myParentLanes) { + parent->addChildAdditional(additional); + } + for (const auto& parent : myParentShapes) { + parent->addChildAdditional(additional); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildAdditional(additional); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildAdditional(additional); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildAdditional(additional); + } + // add additional in child elements + for (const auto& child : myChildEdges) { + child->addParentAdditional(additional); + } + for (const auto& child : myChildLanes) { + child->addParentAdditional(additional); + } + for (const auto& child : myChildShapes) { + child->addParentAdditional(additional); + } + for (const auto& child : myChildAdditionals) { + child->addParentAdditional(additional); + } + for (const auto& child : myChildDemandElements) { + child->addParentAdditional(additional); + } + for (const auto& child : myChildGenericDatas) { + child->addChildAdditional(additional); + } +} + + +void +GNEChange::removeAdditional(GNEAdditional* additional) { + // Remove additional from parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildAdditional(additional); + } + for (const auto& parent : myParentLanes) { + parent->removeChildAdditional(additional); + } + for (const auto& parent : myParentShapes) { + parent->removeChildAdditional(additional); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildAdditional(additional); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildAdditional(additional); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildAdditional(additional); + } + // Remove additional from child elements + for (const auto& child : myChildEdges) { + child->removeParentAdditional(additional); + } + for (const auto& child : myChildLanes) { + child->removeParentAdditional(additional); + } + for (const auto& child : myChildShapes) { + child->removeChildAdditional(additional); + } + for (const auto& child : myChildAdditionals) { + child->removeParentAdditional(additional); + } + for (const auto& child : myChildDemandElements) { + child->removeParentAdditional(additional); + } + for (const auto& child : myChildGenericDatas) { + child->removeParentAdditional(additional); + } +} + + +void +GNEChange::addDemandElement(GNEDemandElement* demandElement) { + // add demandElement in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildDemandElement(demandElement); + } + for (const auto& parent : myParentLanes) { + parent->addChildDemandElement(demandElement); + } + for (const auto& parent : myParentShapes) { + parent->addChildDemandElement(demandElement); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildDemandElement(demandElement); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildDemandElement(demandElement); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildDemandElement(demandElement); + } + // add demandElement in child elements + for (const auto& child : myChildEdges) { + child->addParentDemandElement(demandElement); + } + for (const auto& child : myChildLanes) { + child->addParentDemandElement(demandElement); + } + for (const auto& child : myChildShapes) { + child->addParentDemandElement(demandElement); + } + for (const auto& child : myChildAdditionals) { + child->addParentDemandElement(demandElement); + } + for (const auto& child : myChildDemandElements) { + child->addParentDemandElement(demandElement); + } + for (const auto& child : myChildGenericDatas) { + child->addParentDemandElement(demandElement); + } +} + + +void +GNEChange::removeDemandElement(GNEDemandElement* demandElement) { + // remove demandElement in parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildDemandElement(demandElement); + } + for (const auto& parent : myParentLanes) { + parent->removeChildDemandElement(demandElement); + } + for (const auto& parent : myParentShapes) { + parent->removeChildDemandElement(demandElement); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildDemandElement(demandElement); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildDemandElement(demandElement); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildDemandElement(demandElement); + } + // remove demandElement in child elements + for (const auto& child : myChildEdges) { + child->removeParentDemandElement(demandElement); + } + for (const auto& child : myChildLanes) { + child->removeParentDemandElement(demandElement); + } + for (const auto& child : myChildShapes) { + child->removeParentDemandElement(demandElement); + } + for (const auto& child : myChildAdditionals) { + child->removeParentDemandElement(demandElement); + } + for (const auto& child : myChildDemandElements) { + child->removeParentDemandElement(demandElement); + } + for (const auto& child : myChildGenericDatas) { + child->removeParentDemandElement(demandElement); + } +} + + +void +GNEChange::addGenericData(GNEGenericData* genericData) { + // add genericData in parent elements + for (const auto& parent : myParentEdges) { + parent->addChildGenericDataElement(genericData); + } + for (const auto& parent : myParentLanes) { + parent->addChildGenericDataElement(genericData); + } + for (const auto& parent : myParentShapes) { + parent->addChildGenericDataElement(genericData); + } + for (const auto& parent : myParentAdditionals) { + parent->addChildGenericDataElement(genericData); + } + for (const auto& parent : myParentDemandElements) { + parent->addChildGenericDataElement(genericData); + } + for (const auto& parent : myParentGenericDatas) { + parent->addChildGenericDataElement(genericData); + } + // add genericData in child elements + for (const auto& child : myChildEdges) { + child->addParentGenericData(genericData); + } + for (const auto& child : myChildLanes) { + child->addParentGenericData(genericData); + } + for (const auto& child : myChildShapes) { + child->addParentGenericData(genericData); + } + for (const auto& child : myChildAdditionals) { + child->addParentGenericData(genericData); + } + for (const auto& child : myChildDemandElements) { + child->addParentGenericData(genericData); + } + for (const auto& child : myChildGenericDatas) { + child->addParentGenericData(genericData); + } +} + + +void +GNEChange::removeGenericData(GNEGenericData* genericData) { + // remove genericData in parent elements + for (const auto& parent : myParentEdges) { + parent->removeChildGenericDataElement(genericData); + } + for (const auto& parent : myParentLanes) { + parent->removeChildGenericDataElement(genericData); + } + for (const auto& parent : myParentShapes) { + parent->removeChildGenericDataElement(genericData); + } + for (const auto& parent : myParentAdditionals) { + parent->removeChildGenericDataElement(genericData); + } + for (const auto& parent : myParentDemandElements) { + parent->removeChildGenericDataElement(genericData); + } + for (const auto& parent : myParentGenericDatas) { + parent->removeChildGenericDataElement(genericData); + } + // remove genericData in child elements + for (const auto& child : myChildEdges) { + child->removeParentGenericData(genericData); + } + for (const auto& child : myChildLanes) { + child->removeParentGenericData(genericData); + } + for (const auto& child : myChildShapes) { + child->removeParentGenericData(genericData); + } + for (const auto& child : myChildAdditionals) { + child->removeParentGenericData(genericData); + } + for (const auto& child : myChildDemandElements) { + child->removeParentGenericData(genericData); + } + for (const auto& child : myChildGenericDatas) { + child->removeParentGenericData(genericData); + } +} + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Crossing.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Crossing.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Crossing.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Crossing.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,17 +17,12 @@ /// // A network change in which a single junction is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include +#include +#include #include -#include #include "GNEChange_Crossing.h" @@ -44,7 +39,7 @@ GNEChange_Crossing::GNEChange_Crossing(GNEJunction* junctionParent, const std::vector& edges, double width, bool priority, int customTLIndex, int customTLIndex2, const PositionVector& customShape, bool selected, bool forward): - GNEChange(junctionParent->getNet(), forward), + GNEChange(junctionParent, junctionParent, forward), myJunctionParent(junctionParent), myEdges(edges), myWidth(width), @@ -53,12 +48,11 @@ myCustomTLIndex2(customTLIndex2), myCustomShape(customShape), mySelected(selected) { - assert(myNet); } GNEChange_Crossing::GNEChange_Crossing(GNEJunction* junctionParent, const NBNode::Crossing& crossing, bool forward): - GNEChange(junctionParent->getNet(), forward), + GNEChange(forward), myJunctionParent(junctionParent), myEdges(crossing.edges), myWidth(crossing.width), @@ -67,12 +61,10 @@ myCustomTLIndex2(crossing.customTLIndex2), myCustomShape(crossing.customShape), mySelected(false) { - assert(myNet); } GNEChange_Crossing::~GNEChange_Crossing() { - assert(myNet); } @@ -85,22 +77,20 @@ // rebuild GNECrossings myJunctionParent->rebuildGNECrossings(); // Check if Flag "haveNetworkCrossings" has to be disabled - if ((myNet->netHasGNECrossings() == false) && (myNet->getNetBuilder()->haveNetworkCrossings())) { + if ((myJunctionParent->getNet()->netHasGNECrossings() == false) && (myJunctionParent->getNet()->getNetBuilder()->haveNetworkCrossings())) { // change flag of NetBuilder (For build GNECrossing) - myNet->getNetBuilder()->setHaveNetworkCrossings(false); + myJunctionParent->getNet()->getNetBuilder()->setHaveNetworkCrossings(false); // show extra information for tests WRITE_DEBUG("Changed flag netBuilder::haveNetworkCrossings from 'true' to 'false'"); } - // Update view - myNet->getViewNet()->update(); } else { // show extra information for tests WRITE_DEBUG("Adding " + toString(SUMO_TAG_CROSSING) + " into " + myJunctionParent->getTagStr() + " '" + myJunctionParent->getID() + "'"); // add crossing of NBNode NBNode::Crossing* c = myJunctionParent->getNBNode()->addCrossing(myEdges, myWidth, myPriority, myCustomTLIndex, myCustomTLIndex2, myCustomShape); // Check if Flag "haveNetworkCrossings" has to be enabled - if (myNet->getNetBuilder()->haveNetworkCrossings() == false) { - myNet->getNetBuilder()->setHaveNetworkCrossings(true); + if (myJunctionParent->getNet()->getNetBuilder()->haveNetworkCrossings() == false) { + myJunctionParent->getNet()->getNetBuilder()->setHaveNetworkCrossings(true); // show extra information for tests WRITE_DEBUG("Changed flag netBuilder::haveNetworkCrossings from 'false' to 'true'"); } @@ -110,11 +100,9 @@ if (mySelected) { myJunctionParent->retrieveGNECrossing(c, false)->selectAttributeCarrier(); } - // Update view - myNet->getViewNet()->update(); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunctionParent->getNet()->requireSaveNet(true); } @@ -125,8 +113,8 @@ // add crossing of NBNode and update geometry NBNode::Crossing* c = myJunctionParent->getNBNode()->addCrossing(myEdges, myWidth, myPriority, myCustomTLIndex, myCustomTLIndex2, myCustomShape); // Check if Flag "haveNetworkCrossings" has to be enabled - if (myNet->getNetBuilder()->haveNetworkCrossings() == false) { - myNet->getNetBuilder()->setHaveNetworkCrossings(true); + if (myJunctionParent->getNet()->getNetBuilder()->haveNetworkCrossings() == false) { + myJunctionParent->getNet()->getNetBuilder()->setHaveNetworkCrossings(true); // show extra information for tests WRITE_DEBUG("Changed flag netBuilder::haveNetworkCrossings from 'false' to 'true'"); } @@ -136,8 +124,6 @@ if (mySelected) { myJunctionParent->retrieveGNECrossing(c, false)->selectAttributeCarrier(); } - // Update view - myNet->getViewNet()->update(); } else { // show extra information for tests WRITE_DEBUG("Removing " + toString(SUMO_TAG_CROSSING) + " from " + myJunctionParent->getTagStr() + " '" + myJunctionParent->getID() + "'"); @@ -146,17 +132,15 @@ // rebuild GNECrossings myJunctionParent->rebuildGNECrossings(); // Check if Flag "haveNetworkCrossings" has to be disabled - if ((myNet->netHasGNECrossings() == false) && (myNet->getNetBuilder()->haveNetworkCrossings())) { + if ((myJunctionParent->getNet()->netHasGNECrossings() == false) && (myJunctionParent->getNet()->getNetBuilder()->haveNetworkCrossings())) { // change flag of NetBuilder (For build GNECrossing) - myNet->getNetBuilder()->setHaveNetworkCrossings(false); + myJunctionParent->getNet()->getNetBuilder()->setHaveNetworkCrossings(false); // show extra information for tests WRITE_DEBUG("Changed flag netBuilder::haveNetworkCrossings from 'true' to 'false'"); } - // Update view - myNet->getViewNet()->update(); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunctionParent->getNet()->requireSaveNet(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Crossing.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Crossing.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Crossing.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Crossing.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,30 +17,12 @@ /// // A network change in which a single crossing is created or deleted /****************************************************************************/ -#ifndef GNEChange_Crossing_h -#define GNEChange_Crossing_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include -#include -#include -#include #include "GNEChange.h" -// =========================================================================== -// class declarations -// =========================================================================== -class GNENet; class GNEJunction; -class GNECrossing; -class NBEdge; // =========================================================================== // class definitions @@ -112,6 +94,3 @@ /// @brief flag to check if crossing is selected bool mySelected; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,122 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_DataInterval.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a data interval element is created or deleted +/****************************************************************************/ +#include + +#include +#include +#include + +#include "GNEChange_DataInterval.h" + +// =========================================================================== +// FOX-declarations +// =========================================================================== +FXIMPLEMENT_ABSTRACT(GNEChange_DataInterval, GNEChange, nullptr, 0) + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChange_DataInterval::GNEChange_DataInterval(GNEDataInterval* dataInterval, bool forward) : + GNEChange(forward), + myDataInterval(dataInterval), + myDataSetParent(dataInterval->getDataSetParent()) { + myDataInterval->incRef("GNEChange_DataInterval"); +} + + +GNEChange_DataInterval::~GNEChange_DataInterval() { + myDataInterval->decRef("GNEChange_DataInterval"); + if (myDataInterval->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + myDataInterval->getTagStr() + " [" + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + ", " + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + "] in ~GNEChange_DataInterval()"); + // delete dataInterval + delete myDataInterval; + } +} + + +void +GNEChange_DataInterval::undo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Removing " + myDataInterval->getTagStr() + " [" + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + ", " + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + "] in GNEChange_DataInterval"); + // remove data interval from data set parent + myDataSetParent->removeDataIntervalChild(myDataInterval); + } else { + // show extra information for tests + WRITE_DEBUG("adding " + myDataInterval->getTagStr() + " [" + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + ", " + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + "] in GNEChange_DataInterval"); + // add data interval into data set parent + myDataSetParent->addDataIntervalChild(myDataInterval); + } + // Requiere always save elements + myDataInterval->getDataSetParent()->getNet()->requireSaveDataElements(true); +} + + +void +GNEChange_DataInterval::redo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("adding " + myDataInterval->getTagStr() + " [" + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + ", " + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + "] in GNEChange_DataInterval"); + // add data interval into data set parent + myDataSetParent->addDataIntervalChild(myDataInterval); + } else { + // show extra information for tests + WRITE_DEBUG("Removing " + myDataInterval->getTagStr() + " [" + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + ", " + + myDataInterval->getAttribute(SUMO_ATTR_BEGIN) + "] in GNEChange_DataInterval"); + // remove data interval from data set parent + myDataSetParent->removeDataIntervalChild(myDataInterval); + } + // Requiere always save elements + myDataInterval->getDataSetParent()->getNet()->requireSaveDataElements(true); +} + + +FXString +GNEChange_DataInterval::undoName() const { + if (myForward) { + return ("Undo create " + myDataInterval->getTagStr()).c_str(); + } else { + return ("Undo delete " + myDataInterval->getTagStr()).c_str(); + } +} + + +FXString +GNEChange_DataInterval::redoName() const { + if (myForward) { + return ("Redo create " + myDataInterval->getTagStr()).c_str(); + } else { + return ("Redo delete " + myDataInterval->getTagStr()).c_str(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataInterval.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,68 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_DataInterval.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a data interval element is created or deleted +/****************************************************************************/ +#pragma once +#include + +#include "GNEChange.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEChange_DataInterval + * A network change in which a data interval element is created or deleted + */ +class GNEChange_DataInterval : public GNEChange { + FXDECLARE_ABSTRACT(GNEChange_DataInterval) + +public: + /**@brief Constructor for creating/deleting an data interval element + * @param[in] data interval The data interval element to be created/deleted + * @param[in] forward Whether to create/delete (true/false) + */ + GNEChange_DataInterval(GNEDataInterval* dataInterval, bool forward); + + /// @brief Destructor + ~GNEChange_DataInterval(); + + /// @name inherited from GNEChange + /// @{ + /// @brief get undo Name + FXString undoName() const; + + /// @brief get Redo name + FXString redoName() const; + + /// @brief undo action + void undo(); + + /// @brief redo action + void redo(); + /// @} + +private: + /**@brief full information regarding the data interval element that is to be created/deleted + * @note we assume shared responsibility for the pointer (via reference counting) + */ + GNEDataInterval* myDataInterval; + + /// @brief pointer to data set parent + GNEDataSet* myDataSetParent; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataSet.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataSet.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataSet.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataSet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,120 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_DataSet.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a data set element is created or deleted +/****************************************************************************/ +#include + +#include +#include +#include + +#include "GNEChange_DataSet.h" + +// =========================================================================== +// FOX-declarations +// =========================================================================== +FXIMPLEMENT_ABSTRACT(GNEChange_DataSet, GNEChange, nullptr, 0) + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChange_DataSet::GNEChange_DataSet(GNEDataSet* dataSet, bool forward) : + GNEChange(forward), + myDataSet(dataSet) { + myDataSet->incRef("GNEChange_DataSet"); +} + + +GNEChange_DataSet::~GNEChange_DataSet() { + assert(myDataSet); + myDataSet->decRef("GNEChange_DataSet"); + if (myDataSet->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + myDataSet->getTagStr() + " '" + myDataSet->getID() + "'"); + // make sure that element isn't in net before removing + if (myDataSet->getNet()->getAttributeCarriers()->dataSetExist(myDataSet)) { + myDataSet->getNet()->getAttributeCarriers()->deleteDataSet(myDataSet); + } + // delete data set + delete myDataSet; + } +} + + +void +GNEChange_DataSet::undo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Removing " + myDataSet->getTagStr() + " '" + myDataSet->getID() + "' in GNEChange_DataSet"); + // delete data set from net + myDataSet->getNet()->getAttributeCarriers()->deleteDataSet(myDataSet); + } else { + // show extra information for tests + WRITE_DEBUG("Adding " + myDataSet->getTagStr() + " '" + myDataSet->getID() + "' in GNEChange_DataSet"); + // insert data set into net + myDataSet->getNet()->getAttributeCarriers()->insertDataSet(myDataSet); + } + // update toolbar + myDataSet->getNet()->getViewNet()->getIntervalBar().updateIntervalBar(); + // Requiere always save elements + myDataSet->getNet()->requireSaveDataElements(true); +} + + +void +GNEChange_DataSet::redo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Adding " + myDataSet->getTagStr() + " '" + myDataSet->getID() + "' in GNEChange_DataSet"); + // insert data set into net + myDataSet->getNet()->getAttributeCarriers()->insertDataSet(myDataSet); + } else { + // show extra information for tests + WRITE_DEBUG("Removing " + myDataSet->getTagStr() + " '" + myDataSet->getID() + "' in GNEChange_DataSet"); + // delete data set from net + myDataSet->getNet()->getAttributeCarriers()->deleteDataSet(myDataSet); + } + // update toolbar + myDataSet->getNet()->getViewNet()->getIntervalBar().updateIntervalBar(); + // Requiere always save elements + myDataSet->getNet()->requireSaveDataElements(true); +} + + +FXString +GNEChange_DataSet::undoName() const { + if (myForward) { + return ("Undo create " + myDataSet->getTagStr()).c_str(); + } else { + return ("Undo delete " + myDataSet->getTagStr()).c_str(); + } +} + + +FXString +GNEChange_DataSet::redoName() const { + if (myForward) { + return ("Redo create " + myDataSet->getTagStr()).c_str(); + } else { + return ("Redo delete " + myDataSet->getTagStr()).c_str(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataSet.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataSet.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DataSet.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DataSet.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,65 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_DataSet.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a data set element is created or deleted +/****************************************************************************/ +#pragma once +#include + +#include "GNEChange.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEChange_DataSet + * A network change in which a data set element is created or deleted + */ +class GNEChange_DataSet : public GNEChange { + FXDECLARE_ABSTRACT(GNEChange_DataSet) + +public: + /**@brief Constructor for creating/deleting an data set element + * @param[in] data set The data set element to be created/deleted + * @param[in] forward Whether to create/delete (true/false) + */ + GNEChange_DataSet(GNEDataSet* dataSet, bool forward); + + /// @brief Destructor + ~GNEChange_DataSet(); + + /// @name inherited from GNEChange + /// @{ + /// @brief get undo Name + FXString undoName() const; + + /// @brief get Redo name + FXString redoName() const; + + /// @brief undo action + void undo(); + + /// @brief redo action + void redo(); + /// @} + +private: + /**@brief full information regarding the data set element that is to be created/deleted + * @note we assume shared responsibility for the pointer (via reference counting) + */ + GNEDataSet* myDataSet; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,19 +17,12 @@ /// // A network change in which a busStop is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include #include @@ -45,68 +38,28 @@ // =========================================================================== GNEChange_DemandElement::GNEChange_DemandElement(GNEDemandElement* demandElement, bool forward) : - GNEChange(demandElement->getViewNet()->getNet(), forward), + GNEChange(demandElement, demandElement, forward), myDemandElement(demandElement), - myEdgePath(demandElement->getPathEdges()), - myParentEdges(demandElement->getParentEdges()), - myParentLanes(demandElement->getParentLanes()), - myParentShapes(demandElement->getParentShapes()), - myParentAdditionals(demandElement->getParentAdditionals()), - myParentDemandElements(demandElement->getParentDemandElements()), - myChildEdges(demandElement->getChildEdges()), - myChildLanes(demandElement->getChildLanes()), - myChildShapes(demandElement->getChildShapes()), - myChildAdditionals(demandElement->getChildAdditionals()), - myChildDemandElements(demandElement->getChildDemandElements()) { + myEdgePath(demandElement->getPathEdges()) { myDemandElement->incRef("GNEChange_DemandElement"); } GNEChange_DemandElement::~GNEChange_DemandElement() { - assert(myDemandElement); myDemandElement->decRef("GNEChange_DemandElement"); if (myDemandElement->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myDemandElement->getTagStr() + " '" + myDemandElement->getID() + "'"); // make sure that element isn't in net before removing - if (myNet->demandElementExist(myDemandElement)) { - myNet->deleteDemandElement(myDemandElement, false); + if (myDemandElement->getNet()->getAttributeCarriers()->demandElementExist(myDemandElement)) { + // remove demand element of network + myDemandElement->getNet()->getAttributeCarriers()->deleteDemandElement(myDemandElement); // remove element from path for (const auto& i : myEdgePath) { i->removePathElement(myDemandElement); } - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentLanes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentShapes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentAdditionals) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentDemandElements) { - i->removeChildDemandElement(myDemandElement); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildLanes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildShapes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildAdditionals) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildDemandElements) { - i->removeParentDemandElement(myDemandElement); - } + // remove demand element from parents and children + removeDemandElement(myDemandElement); } delete myDemandElement; } @@ -119,91 +72,31 @@ // show extra information for tests WRITE_DEBUG("Removing " + myDemandElement->getTagStr() + " '" + myDemandElement->getID() + "' in GNEChange_DemandElement"); // delete demand element from net - myNet->deleteDemandElement(myDemandElement, false); + myDemandElement->getNet()->getAttributeCarriers()->deleteDemandElement(myDemandElement); // remove element from path for (const auto& i : myEdgePath) { i->removePathElement(myDemandElement); } - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentLanes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentShapes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentAdditionals) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentDemandElements) { - i->removeChildDemandElement(myDemandElement); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildLanes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildShapes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildAdditionals) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildDemandElements) { - i->removeParentDemandElement(myDemandElement); - } + // remove demand element from parents and children + removeDemandElement(myDemandElement); } else { // show extra information for tests WRITE_DEBUG("Adding " + myDemandElement->getTagStr() + " '" + myDemandElement->getID() + "' in GNEChange_DemandElement"); // insert demand element into net - myNet->insertDemandElement(myDemandElement); - // add element in parent elements - for (const auto& i : myParentEdges) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentLanes) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentShapes) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentAdditionals) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentDemandElements) { - i->addChildDemandElement(myDemandElement); - } - // add element in child elements - for (const auto& i : myChildEdges) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildLanes) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildShapes) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildAdditionals) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildDemandElements) { - i->addParentDemandElement(myDemandElement); - } + myDemandElement->getNet()->getAttributeCarriers()->insertDemandElement(myDemandElement); + // add demand element in parents and children + addDemandElement(myDemandElement); } // update vehicle type selector if demand element is a VType and vehicle type Frame is shown - if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myNet->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { - myNet->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); + if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { + myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); } // update stack labels if (myParentEdges.size() > 0) { myParentEdges.front()->updateVehicleStackLabels(); } // Requiere always save elements - myNet->requireSaveDemandElements(true); + myDemandElement->getNet()->requireSaveDemandElements(true); } @@ -213,91 +106,31 @@ // show extra information for tests WRITE_DEBUG("Adding " + myDemandElement->getTagStr() + " '" + myDemandElement->getID() + "' in GNEChange_DemandElement"); // insert demand element into net - myNet->insertDemandElement(myDemandElement); - // add element in parent elements - for (const auto& i : myParentEdges) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentLanes) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentShapes) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentAdditionals) { - i->addChildDemandElement(myDemandElement); - } - for (const auto& i : myParentDemandElements) { - i->addChildDemandElement(myDemandElement); - } - // add element in child elements - for (const auto& i : myChildEdges) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildLanes) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildShapes) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildAdditionals) { - i->addParentDemandElement(myDemandElement); - } - for (const auto& i : myChildDemandElements) { - i->addParentDemandElement(myDemandElement); - } + myDemandElement->getNet()->getAttributeCarriers()->insertDemandElement(myDemandElement); + // add demand element in parents and children + addDemandElement(myDemandElement); } else { // show extra information for tests WRITE_DEBUG("Removing " + myDemandElement->getTagStr() + " '" + myDemandElement->getID() + "' in GNEChange_DemandElement"); // delete demand element from net - myNet->deleteDemandElement(myDemandElement, false); + myDemandElement->getNet()->getAttributeCarriers()->deleteDemandElement(myDemandElement); // remove element from path for (const auto& i : myEdgePath) { i->removePathElement(myDemandElement); } - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentLanes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentShapes) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentAdditionals) { - i->removeChildDemandElement(myDemandElement); - } - for (const auto& i : myParentDemandElements) { - i->removeChildDemandElement(myDemandElement); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildLanes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildShapes) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildAdditionals) { - i->removeParentDemandElement(myDemandElement); - } - for (const auto& i : myChildDemandElements) { - i->removeParentDemandElement(myDemandElement); - } + // remove demand element from parents and children + removeDemandElement(myDemandElement); } // update vehicle type selector if demand element is a VType and vehicle type Frame is shown - if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myNet->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { - myNet->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); + if ((myDemandElement->getTagProperty().getTag() == SUMO_TAG_VTYPE) && myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->shown()) { + myDemandElement->getNet()->getViewNet()->getViewParent()->getVehicleTypeFrame()->getVehicleTypeSelector()->refreshVehicleTypeSelector(); } // update stack labels if (myParentEdges.size() > 0) { myParentEdges.front()->updateVehicleStackLabels(); } // Requiere always save elements - myNet->requireSaveDemandElements(true); + myDemandElement->getNet()->requireSaveDemandElements(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_DemandElement.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,29 +17,12 @@ /// // A network change in which a demand element element is created or deleted /****************************************************************************/ -#ifndef GNEChange_DemandElement_h -#define GNEChange_DemandElement_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEEdge; -class GNELane; -class GNEShape; -class GNEAdditional; -class GNEDemandElement; -class GNEXMLChild; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -82,37 +65,4 @@ /// @brief reference to edge path vector const std::vector& myEdgePath; - - /// @brief reference to vector of parent edges - const std::vector& myParentEdges; - - /// @brief reference to vector of parent lanes - const std::vector& myParentLanes; - - /// @brief reference to vector of parent shapes - const std::vector& myParentShapes; - - /// @brief reference to vector of parent additionals - const std::vector& myParentAdditionals; - - /// @brief reference to vector of parent demand elements - const std::vector& myParentDemandElements; - - /// @brief reference to vector of child edges - const std::vector& myChildEdges; - - /// @brief reference to vector of child lanes - const std::vector& myChildLanes; - - /// @brief reference to vector of child shapes - const std::vector& myChildShapes; - - /// @brief reference to vector of child additional - const std::vector& myChildAdditionals; - - /// @brief reference to vector of child demand elements - const std::vector& myChildDemandElements; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Edge.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Edge.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Edge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Edge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,18 +17,15 @@ /// // A network change in which a single junction is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "GNEChange_Edge.h" @@ -45,34 +42,33 @@ /// @brief constructor for creating an edge GNEChange_Edge::GNEChange_Edge(GNEEdge* edge, bool forward): - GNEChange(edge->getNet(), forward), - myEdge(edge), - myEdgeParentShapes(edge->getParentShapes()), - myEdgeParentAdditionals(edge->getParentAdditionals()), - myEdgeParentDemandElements(edge->getParentDemandElements()), - myChildEdgeShapes(edge->getChildShapes()), - myChildEdgeAdditionals(edge->getChildAdditionals()), - myChildEdgeDemandElements(edge->getChildDemandElements()) { - // now save all hierarchical elements of edge's lane - for (const auto& i : edge->getLanes()) { - myLaneParentShapes.push_back(i->getParentShapes()); - myLaneParentAdditionals.push_back(i->getParentAdditionals()); - myLaneParentDemandElements.push_back(i->getParentDemandElements()); - myChildLaneShapes.push_back(i->getChildShapes()); - myChildLaneAdditionals.push_back(i->getChildAdditionals()); - myChildLaneDemandElements.push_back(i->getChildDemandElements()); - } - + GNEChange(edge, edge, forward), + myEdge(edge) { edge->incRef("GNEChange_Edge"); + // save all hierarchical elements of edge's lane + for (const auto& lane : edge->getLanes()) { + myLaneParentShapes.push_back(lane->getParentShapes()); + myLaneParentAdditionals.push_back(lane->getParentAdditionals()); + myLaneParentDemandElements.push_back(lane->getParentDemandElements()); + myLaneParentGenericData.push_back(lane->getParentGenericDatas()); + myChildLaneShapes.push_back(lane->getChildShapes()); + myChildLaneAdditionals.push_back(lane->getChildAdditionals()); + myChildLaneDemandElements.push_back(lane->getChildDemandElements()); + myChildLaneGenericData.push_back(lane->getChildGenericDataElements()); + } } GNEChange_Edge::~GNEChange_Edge() { - assert(myEdge); myEdge->decRef("GNEChange_Edge"); if (myEdge->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myEdge->getTagStr() + " '" + myEdge->getID() + "' GNEChange_Edge"); + // remove edge from parents and children + removeEdge(myEdge); + // remove edge lanes from parents and children + removeEdgeLanes(); + // delete edge delete myEdge; } } @@ -83,102 +79,24 @@ if (myForward) { // show extra information for tests WRITE_DEBUG("Removing " + myEdge->getTagStr() + " '" + myEdge->getID() + "' from " + toString(SUMO_TAG_NET)); - // Remove edge from parent elements - for (const auto& i : myEdgeParentShapes) { - i->removeChildEdge(myEdge); - } - for (const auto& i : myEdgeParentAdditionals) { - i->removeChildEdge(myEdge); - } - for (const auto& i : myEdgeParentDemandElements) { - i->removeChildEdge(myEdge); - } - // Remove edge from child elements - for (const auto& i : myChildEdgeShapes) { - i->removeParentEdge(myEdge); - } - for (const auto& i : myChildEdgeAdditionals) { - i->removeParentEdge(myEdge); - } - for (const auto& i : myChildEdgeDemandElements) { - i->removeParentEdge(myEdge); - } - // repeat operations for all lane's edge - for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { - // Remove every lane's edge from parent elements - for (const auto& j : myLaneParentShapes.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentAdditionals.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentDemandElements.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - // Remove every lane's edge from child elements - for (const auto& j : myChildLaneShapes.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneAdditionals.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneDemandElements.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - } + // remove edge from parents and children + removeEdge(myEdge); + // remove edge lanes from parents and children + removeEdgeLanes(); // delete edge from net - myNet->deleteSingleEdge(myEdge, false); + myEdge->getNet()->getAttributeCarriers()->deleteSingleEdge(myEdge); } else { // show extra information for tests WRITE_DEBUG("Adding " + myEdge->getTagStr() + " '" + myEdge->getID() + "' from " + toString(SUMO_TAG_NET)); // insert edge into net - myNet->insertEdge(myEdge); - // add edge in parent elements - for (const auto& i : myEdgeParentShapes) { - i->addChildEdge(myEdge); - } - for (const auto& i : myEdgeParentAdditionals) { - i->addChildEdge(myEdge); - } - for (const auto& i : myEdgeParentDemandElements) { - i->addChildEdge(myEdge); - } - // add edge in child elements - for (const auto& i : myChildEdgeShapes) { - i->addParentEdge(myEdge); - } - for (const auto& i : myChildEdgeAdditionals) { - i->addParentEdge(myEdge); - } - for (const auto& i : myChildEdgeDemandElements) { - i->addParentEdge(myEdge); - } - // repeat operations for all lane's edge - for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { - // add lane's edge in parent elements - for (const auto& j : myLaneParentShapes.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentAdditionals.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentDemandElements.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - // add lane's edge in child elements - for (const auto& j : myChildLaneShapes.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneAdditionals.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneDemandElements.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - } + myEdge->getNet()->getAttributeCarriers()->insertEdge(myEdge); + // add edge into parents and children + addEdge(myEdge); + // add edge lanes into parents and children + addEdgeLanes(); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } @@ -188,101 +106,23 @@ // show extra information for tests WRITE_DEBUG("Adding " + myEdge->getTagStr() + " '" + myEdge->getID() + "' from " + toString(SUMO_TAG_NET)); // insert edge into net - myNet->insertEdge(myEdge); - // add edge in parent elements - for (const auto& i : myEdgeParentShapes) { - i->addChildEdge(myEdge); - } - for (const auto& i : myEdgeParentAdditionals) { - i->addChildEdge(myEdge); - } - for (const auto& i : myEdgeParentDemandElements) { - i->addChildEdge(myEdge); - } - // add edge in child elements - for (const auto& i : myChildEdgeShapes) { - i->addParentEdge(myEdge); - } - for (const auto& i : myChildEdgeAdditionals) { - i->addParentEdge(myEdge); - } - for (const auto& i : myChildEdgeDemandElements) { - i->addParentEdge(myEdge); - } - // repeat operations for all lane's edge - for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { - // add lane's edge in parent elements - for (const auto& j : myLaneParentShapes.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentAdditionals.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentDemandElements.at(i)) { - j->addChildLane(myEdge->getLanes().at(i)); - } - // add lane's edge in child elements - for (const auto& j : myChildLaneShapes.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneAdditionals.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneDemandElements.at(i)) { - j->addParentLane(myEdge->getLanes().at(i)); - } - } + myEdge->getNet()->getAttributeCarriers()->insertEdge(myEdge); + // add edge into parents and children + addEdge(myEdge); + // add edge lanes into parents and children + addEdgeLanes(); } else { // show extra information for tests WRITE_DEBUG("Removing " + myEdge->getTagStr() + " '" + myEdge->getID() + "' from " + toString(SUMO_TAG_NET)); - // Remove edge from parent elements - for (const auto& i : myEdgeParentShapes) { - i->removeChildEdge(myEdge); - } - for (const auto& i : myEdgeParentAdditionals) { - i->removeChildEdge(myEdge); - } - for (const auto& i : myEdgeParentDemandElements) { - i->removeChildEdge(myEdge); - } - // Remove edge from child elements - for (const auto& i : myChildEdgeShapes) { - i->removeParentEdge(myEdge); - } - for (const auto& i : myChildEdgeAdditionals) { - i->removeParentEdge(myEdge); - } - for (const auto& i : myChildEdgeDemandElements) { - i->removeParentEdge(myEdge); - } - // repeat operations for all lane's edge - for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { - // Remove every lane's edge from parent elements - for (const auto& j : myLaneParentShapes.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentAdditionals.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myLaneParentDemandElements.at(i)) { - j->removeChildLane(myEdge->getLanes().at(i)); - } - // Remove every lane's edge from child elements - for (const auto& j : myChildLaneShapes.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneAdditionals.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - for (const auto& j : myChildLaneDemandElements.at(i)) { - j->removeParentLane(myEdge->getLanes().at(i)); - } - } + // remove edge from parents and children + removeEdge(myEdge); + // remove edge lanes from parents and children + removeEdgeLanes(); // delete edge from net - myNet->deleteSingleEdge(myEdge, false); + myEdge->getNet()->getAttributeCarriers()->deleteSingleEdge(myEdge); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } @@ -304,3 +144,72 @@ return ("Redo delete " + toString(SUMO_TAG_EDGE)).c_str(); } } + + + +void +GNEChange_Edge::addEdgeLanes() { + // iterate over edge lanes + for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { + // add lane's edge in parent elements + for (const auto& j : myLaneParentShapes.at(i)) { + j->addChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentAdditionals.at(i)) { + j->addChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentDemandElements.at(i)) { + j->addChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentGenericData.at(i)) { + j->addChildLane(myEdge->getLanes().at(i)); + } + // add lane's edge in child elements + for (const auto& j : myChildLaneShapes.at(i)) { + j->addParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneAdditionals.at(i)) { + j->addParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneDemandElements.at(i)) { + j->addParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneGenericData.at(i)) { + j->addParentLane(myEdge->getLanes().at(i)); + } + } +} + + +void +GNEChange_Edge::removeEdgeLanes() { + // iterate over edge lanes + for (int i = 0; i < (int)myEdge->getLanes().size(); i++) { + // Remove every lane's edge from parent elements + for (const auto& j : myLaneParentShapes.at(i)) { + j->removeChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentAdditionals.at(i)) { + j->removeChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentDemandElements.at(i)) { + j->removeChildLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myLaneParentGenericData.at(i)) { + j->removeChildLane(myEdge->getLanes().at(i)); + } + // Remove every lane's edge from child elements + for (const auto& j : myChildLaneShapes.at(i)) { + j->removeParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneAdditionals.at(i)) { + j->removeParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneDemandElements.at(i)) { + j->removeParentLane(myEdge->getLanes().at(i)); + } + for (const auto& j : myChildLaneGenericData.at(i)) { + j->removeParentLane(myEdge->getLanes().at(i)); + } + } +} diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Edge.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Edge.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Edge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Edge.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,31 +17,12 @@ /// // A network change in which a single edge is created or deleted /****************************************************************************/ -#ifndef GNEChange_Edge_h -#define GNEChange_Edge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include -#include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEEdge; -class GNELane; -class GNEAdditional; -class GNERerouter; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -77,49 +58,40 @@ void redo(); /// @} +protected: + /// @brief add given lane into parents and children + void addEdgeLanes(); -private: - /**@brief full information regarding the edge that is to be created/deleted - * @note we assume shared responsibility for the pointer (via reference counting) - */ - GNEEdge* myEdge; - - /// @brief reference to vector of parent shapes - const std::vector& myEdgeParentShapes; - - /// @brief reference to vector of parent additionals - const std::vector& myEdgeParentAdditionals; + /// @brief remove given lane from parents and children + void removeEdgeLanes(); - /// @brief reference to vector of parent demand elements - const std::vector& myEdgeParentDemandElements; - - /// @brief reference to vector of child shapes - const std::vector& myChildEdgeShapes; - - /// @brief reference to vector of child additional - const std::vector& myChildEdgeAdditionals; - - /// @brief vector of references to vector of child demand elements (used by lanes) - const std::vector& myChildEdgeDemandElements; - - /// @brief vector of references to vector of parent shapes (used by lanes) + /// @brief vector of references to vector of parent shapes (used by edge lanes) std::vector > myLaneParentShapes; - /// @brief vector of references to vector of parent additionals (used by lanes) + /// @brief vector of references to vector of parent additionals (used by edge lanes) std::vector > myLaneParentAdditionals; - /// @brief vector of references to vector of parent demand elements (used by lanes) + /// @brief vector of references to vector of parent demand elements (used by edge lanes) std::vector > myLaneParentDemandElements; - /// @brief vector of references to vector of child shapes (used by lanes) + /// @brief vector of references to vector of parent generic datas (used by edge lanes) + std::vector > myLaneParentGenericData; + + /// @brief vector of references to vector of child shapes (used by edge lanes) std::vector > myChildLaneShapes; - /// @brief vector of references to vector of child additional (used by lanes) + /// @brief vector of references to vector of child additional (used by edge lanes) std::vector > myChildLaneAdditionals; - /// @brief vector of references to vector of child demand elements (used by lanes) + /// @brief vector of references to vector of child demand elements (used by edge lanes) std::vector > myChildLaneDemandElements; -}; -#endif -/****************************************************************************/ + /// @brief vector of references to vector of child generic datas (used by edge lanes) + std::vector > myChildLaneGenericData; + +private: + /**@brief full information regarding the edge that is to be created/deleted + * @note we assume shared responsibility for the pointer (via reference counting) + */ + GNEEdge* myEdge; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,14 +17,10 @@ /// // A network change in which something is changed (for undo/redo) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include +#include #include "GNEChange_EnableAttribute.h" @@ -37,8 +33,8 @@ // member method definitions // =========================================================================== -GNEChange_EnableAttribute::GNEChange_EnableAttribute(GNEAttributeCarrier* ac, GNENet* net, const int originalAttributes, const int newAttributes) : - GNEChange(net, true), +GNEChange_EnableAttribute::GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const int originalAttributes, const int newAttributes) : + GNEChange(true), myAC(ac), myOriginalAttributes(originalAttributes), myNewAttributes(newAttributes) { @@ -53,17 +49,8 @@ if (myAC->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myAC->getTagStr() + " '" + myAC->getID() + "' in GNEChange_EnableAttribute"); - // Check if attribute carrier is a shape - if (myAC->getTagProperty().isShape()) { - // remove shape using specific functions - if (myAC->getTagProperty().getTag() == SUMO_TAG_POLY) { - myNet->removePolygon(myAC->getID()); - } else if ((myAC->getTagProperty().getTag() == SUMO_TAG_POI) || (myAC->getTagProperty().getTag() == SUMO_TAG_POILANE)) { - myNet->removePOI(myAC->getID()); - } - } else { - delete myAC; - } + // delete AC + delete myAC; } } @@ -74,13 +61,13 @@ WRITE_DEBUG("Setting previous attribute into " + myAC->getTagStr() + " '" + myAC->getID() + "'"); // set original attributes myAC->setEnabledAttribute(myOriginalAttributes); - // check if netElements, additional or shapes has to be saved - if (myAC->getTagProperty().isNetElement()) { - myNet->requireSaveNet(true); - } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isShape()) { - myNet->requireSaveAdditionals(true); + // check if networkElements, additional or shapes has to be saved + if (myAC->getTagProperty().isNetworkElement()) { + myAC->getNet()->requireSaveNet(true); + } else if (myAC->getTagProperty().isAdditionalElement() || myAC->getTagProperty().isShape()) { + myAC->getNet()->requireSaveAdditionals(true); } else if (myAC->getTagProperty().isDemandElement()) { - myNet->requireSaveDemandElements(true); + myAC->getNet()->requireSaveDemandElements(true); } } @@ -91,13 +78,13 @@ WRITE_DEBUG("Setting new attribute into " + myAC->getTagStr() + " '" + myAC->getID() + "'"); // set new attributes myAC->setEnabledAttribute(myNewAttributes); - // check if netElements, additional or shapes has to be saved - if (myAC->getTagProperty().isNetElement()) { - myNet->requireSaveNet(true); - } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isShape()) { - myNet->requireSaveAdditionals(true); + // check if networkElements, additional or shapes has to be saved + if (myAC->getTagProperty().isNetworkElement()) { + myAC->getNet()->requireSaveNet(true); + } else if (myAC->getTagProperty().isAdditionalElement() || myAC->getTagProperty().isShape()) { + myAC->getNet()->requireSaveAdditionals(true); } else if (myAC->getTagProperty().isDemandElement()) { - myNet->requireSaveDemandElements(true); + myAC->getNet()->requireSaveDemandElements(true); } } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_EnableAttribute.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,28 +17,12 @@ /// // A network change in which the attribute of some object is modified /****************************************************************************/ -#ifndef GNEChange_EnableAttribute_h -#define GNEChange_EnableAttribute_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNEAttributeCarrier; -class GNENetElement; -class GNEAdditional; -class GNEDemandElement; -class GNEShape; -class GNENet; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -51,11 +35,10 @@ public: /**@brief Constructor * @param[in] ac The attribute-carrier to be modified - * @param[in] net Net in which AC is saved * @param[in] originalAttributes original set of attributes * @param[in] newAttributes new set of attributes */ - GNEChange_EnableAttribute(GNEAttributeCarrier* ac, GNENet* net, const int originalAttributes, const int newAttributes); + GNEChange_EnableAttribute(GNEAttributeCarrier* ac, const int originalAttributes, const int newAttributes); /// @brief Destructor ~GNEChange_EnableAttribute(); @@ -87,6 +70,3 @@ /// @brief original attributes const int myNewAttributes; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_GenericData.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_GenericData.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_GenericData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_GenericData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,122 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_GenericData.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a generic data set is created or deleted +/****************************************************************************/ + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include + +#include "GNEChange_GenericData.h" + +// =========================================================================== +// FOX-declarations +// =========================================================================== +FXIMPLEMENT_ABSTRACT(GNEChange_GenericData, GNEChange, nullptr, 0) + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChange_GenericData::GNEChange_GenericData(GNEGenericData* genericData, bool forward) : + GNEChange(genericData, genericData, forward), + myGenericData(genericData), + myDataIntervalParent(genericData->getDataIntervalParent()) { + myGenericData->incRef("GNEChange_GenericData"); +} + + +GNEChange_GenericData::~GNEChange_GenericData() { + assert(myGenericData); + myGenericData->decRef("GNEChange_GenericData"); + if (myGenericData->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + myGenericData->getTagStr() + " '" + myGenericData->getID() + "'"); + // delete generic data + delete myGenericData; + } +} + + +void +GNEChange_GenericData::undo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Removing " + myGenericData->getTagStr() + " '" + myGenericData->getID() + "' in GNEChange_GenericData"); + // delete generic data from interval parent + myDataIntervalParent->removeGenericDataChild(myGenericData); + // remove genericData from parents and children + removeGenericData(myGenericData); + } else { + // show extra information for tests + WRITE_DEBUG("Adding " + myGenericData->getTagStr() + " '" + myGenericData->getID() + "' in GNEChange_GenericData"); + // insert generic data into interval parent + myDataIntervalParent->addGenericDataChild(myGenericData); + // add genericData in parents and children + addGenericData(myGenericData); + } + // Requiere always save elements + myGenericData->getNet()->requireSaveDataElements(true); +} + + +void +GNEChange_GenericData::redo() { + if (myForward) { + // show extra information for tests + WRITE_DEBUG("Adding " + myGenericData->getTagStr() + " '" + myGenericData->getID() + "' in GNEChange_GenericData"); + // insert generic data into interval parent + myDataIntervalParent->addGenericDataChild(myGenericData); + // add genericData in parents and children + addGenericData(myGenericData); + } else { + // show extra information for tests + WRITE_DEBUG("Removing " + myGenericData->getTagStr() + " '" + myGenericData->getID() + "' in GNEChange_GenericData"); + // delete generic data from interval parent + myDataIntervalParent->removeGenericDataChild(myGenericData); + // remove genericData from parents and children + removeGenericData(myGenericData); + } + // Requiere always save elements + myGenericData->getNet()->requireSaveDataElements(true); +} + + +FXString +GNEChange_GenericData::undoName() const { + if (myForward) { + return ("Undo create " + myGenericData->getTagStr()).c_str(); + } else { + return ("Undo delete " + myGenericData->getTagStr()).c_str(); + } +} + + +FXString +GNEChange_GenericData::redoName() const { + if (myForward) { + return ("Redo create " + myGenericData->getTagStr()).c_str(); + } else { + return ("Redo delete " + myGenericData->getTagStr()).c_str(); + } +} diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_GenericData.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_GenericData.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_GenericData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_GenericData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,74 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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_GenericData.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A network change in which a generic data set is created or deleted +/****************************************************************************/ +#pragma once + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include "GNEChange.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEChange_GenericData + * A network change in which a generic data set is created or deleted + */ +class GNEChange_GenericData : public GNEChange { + FXDECLARE_ABSTRACT(GNEChange_GenericData) + +public: + /**@brief Constructor for creating/deleting an generic data set + * @param[in] generic data The generic data set to be created/deleted + * @param[in] forward Whether to create/delete (true/false) + */ + GNEChange_GenericData(GNEGenericData* genericData, bool forward); + + /// @brief Destructor + ~GNEChange_GenericData(); + + /// @name inherited from GNEChange + /// @{ + /// @brief get undo Name + FXString undoName() const; + + /// @brief get Redo name + FXString redoName() const; + + /// @brief undo action + void undo(); + + /// @brief redo action + void redo(); + /// @} + +private: + /**@brief full information regarding the generic data set that is to be created/deleted + * @note we assume shared responsibility for the pointer (via reference counting) + */ + GNEGenericData* myGenericData; + + /// @brief data interval parent + GNEDataInterval* myDataIntervalParent; +}; + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,23 +18,32 @@ // The reification of a NETEDIT editing operation (see command pattern) // inherits from FXCommand and is used to for undo/redo /****************************************************************************/ -#ifndef GNEChange_h -#define GNEChange_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include -#include +#include +#include #include +#include +#include // =========================================================================== // class declarations // =========================================================================== +class GNEAttributeCarrier; +class GNEAdditional; +class GNEDataSet; +class GNEDemandElement; +class GNEGenericData; +class GNEDataInterval; +class GNEEdge; +class GNELane; +class GNEShape; class GNENet; +class GNEViewNet; +class GNEHierarchicalChildElements; +class GNEHierarchicalParentElements; // =========================================================================== // class definitions @@ -48,10 +57,16 @@ public: /**@brief Constructor - * @param[in] net GNENet net on which to apply changes * @param[in] forward The direction of this change */ - GNEChange(GNENet* net, bool forward); + GNEChange(bool forward); + + /**@brief Constructor + * @param[in] forward The direction of this change + * @param[in] parents hierarchical parent elements + * @param[in] children hierarchical children elements + */ + GNEChange(GNEHierarchicalParentElements* parents, GNEHierarchicalChildElements* children, bool forward); /// @brief Destructor ~GNEChange(); @@ -72,17 +87,99 @@ virtual void redo(); protected: - /**@brief the net to which operations shall be applied or which shall be - * informed about gui updates - * (we are not responsible for the pointer) - */ - GNENet* myNet; + /// @brief add given edge into parents and children + void addEdge(GNEEdge* edge); + + /// @brief remove given edge from parents and children + void removeEdge(GNEEdge* edge); + + /// @brief add given lane into parents and children + void addLane(GNELane* lane); + + /// @brief remove given lane from parents and children + void removeLane(GNELane* lane); + + /// @brief add given shape into parents and children + void addShape(GNEShape* shape); + + /// @brief remove given shape from parents and children + void removeShape(GNEShape* shape); + + /// @brief add given additional into parents and children + void addAdditional(GNEAdditional* additional); + + /// @brief remove given additional from parents and children + void removeAdditional(GNEAdditional* additional); + + /// @brief add given demand element into parents and children + void addDemandElement(GNEDemandElement* demandElement); + + /// @brief remove given demand element from parents and children + void removeDemandElement(GNEDemandElement* demandElement); + + /// @brief add given generic data into parents and children + void addGenericData(GNEGenericData* genericData); + + /// @brief remove given generic data from parents and children + void removeGenericData(GNEGenericData* genericData); /**@brief we group antagonistic commands (create junction/delete * junction) and keep them apart by this flag */ bool myForward; -}; -#endif -/****************************************************************************/ + /// @brief reference to vector of parent edges + const std::vector& myParentEdges; + + /// @brief reference to vector of parent lanes + const std::vector& myParentLanes; + + /// @brief reference to vector of parent shapes + const std::vector& myParentShapes; + + /// @brief reference to vector of parent additionals + const std::vector& myParentAdditionals; + + /// @brief reference to vector of parent demand elements + const std::vector& myParentDemandElements; + + /// @brief reference to vector of parent generic datas + const std::vector& myParentGenericDatas; + + /// @brief reference to vector of child edges + const std::vector& myChildEdges; + + /// @brief reference to vector of child lanes + const std::vector& myChildLanes; + + /// @brief reference to vector of child shapes + const std::vector& myChildShapes; + + /// @brief reference to vector of child additional + const std::vector& myChildAdditionals; + + /// @brief reference to vector of child demand elements + const std::vector& myChildDemandElements; + + /// @brief reference to vector of child generic datas + const std::vector& myChildGenericDatas; + +private: + /// @brief vector of empty edges + static const std::vector myEmptyEdges; + + /// @brief vector of empty lanes + static const std::vector myEmptyLanes; + + /// @brief vector of empty shapes + static const std::vector myEmptyShapes; + + /// @brief vector of empty additionals + static const std::vector myEmptyAdditionals; + + /// @brief vector of empty demand elements + static const std::vector myEmptyDemandElements; + + /// @brief vector of empty generic datas + static const std::vector myEmptyGenericDatas; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Junction.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Junction.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Junction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Junction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,14 +17,10 @@ /// // A network change in which a single junction is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include +#include #include "GNEChange_Junction.h" @@ -40,15 +36,13 @@ /// @brief constructor for creating a junction GNEChange_Junction::GNEChange_Junction(GNEJunction* junction, bool forward): - GNEChange(junction->getNet(), forward), + GNEChange(junction, junction, forward), myJunction(junction) { - assert(myNet); junction->incRef("GNEChange_Junction"); } GNEChange_Junction::~GNEChange_Junction() { - assert(myJunction); myJunction->decRef("GNEChange_Junction"); if (myJunction->unreferenced()) { // show extra information for tests @@ -64,15 +58,15 @@ // show extra information for tests WRITE_DEBUG("Removing " + myJunction->getTagStr() + " '" + myJunction->getID() + "' from " + toString(SUMO_TAG_NET)); // add junction to net - myNet->deleteSingleJunction(myJunction, false); + myJunction->getNet()->getAttributeCarriers()->deleteSingleJunction(myJunction); } else { // show extra information for tests WRITE_DEBUG("Adding " + myJunction->getTagStr() + " '" + myJunction->getID() + "' into " + toString(SUMO_TAG_NET)); // delete junction from net - myNet->insertJunction(myJunction); + myJunction->getNet()->getAttributeCarriers()->insertJunction(myJunction); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunction->getNet()->requireSaveNet(true); } @@ -82,15 +76,15 @@ // show extra information for tests WRITE_DEBUG("Adding " + myJunction->getTagStr() + " '" + myJunction->getID() + "' into " + toString(SUMO_TAG_NET)); // add junction into net - myNet->insertJunction(myJunction); + myJunction->getNet()->getAttributeCarriers()->insertJunction(myJunction); } else { // show extra information for tests WRITE_DEBUG("Removing " + myJunction->getTagStr() + " '" + myJunction->getID() + "' from " + toString(SUMO_TAG_NET)); // delete junction from net - myNet->deleteSingleJunction(myJunction, false); + myJunction->getNet()->getAttributeCarriers()->deleteSingleJunction(myJunction); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunction->getNet()->requireSaveNet(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Junction.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Junction.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Junction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Junction.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,26 +17,12 @@ /// // A network change in which a single junction is created or deleted /****************************************************************************/ -#ifndef GNEChange_Junction_h -#define GNEChange_Junction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEJunction; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -78,6 +64,3 @@ */ GNEJunction* myJunction; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Lane.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Lane.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Lane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Lane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,18 +17,11 @@ /// // A network change in which a single lane is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include +#include +#include #include "GNEChange_Lane.h" @@ -38,33 +31,30 @@ // =========================================================================== FXIMPLEMENT_ABSTRACT(GNEChange_Lane, GNEChange, nullptr, 0) + // =========================================================================== // member method definitions // =========================================================================== +GNEChange_Lane::GNEChange_Lane(GNEEdge* edge, const NBEdge::Lane& laneAttrs): + GNEChange(true), + myEdge(edge), + myLane(nullptr), + myLaneAttrs(laneAttrs), + myRecomputeConnections(true) { + myEdge->incRef("GNEChange_Lane"); +} + -/// @brief constructor for creating an edge GNEChange_Lane::GNEChange_Lane(GNEEdge* edge, GNELane* lane, const NBEdge::Lane& laneAttrs, bool forward, bool recomputeConnections): - GNEChange(edge->getNet(), forward), + GNEChange(lane, lane, forward), myEdge(edge), myLane(lane), myLaneAttrs(laneAttrs), myRecomputeConnections(recomputeConnections) { - assert(myNet); + // include both references (To edge and lane) myEdge->incRef("GNEChange_Lane"); - if (myLane) { - // non-zero pointer is passsed in case of removal or duplication - myLane->incRef("GNEChange_Lane"); - // Save hierarchy elements of lane - myParentShapes = myLane->getParentShapes(); - myParentAdditionals = myLane->getParentAdditionals(); - myParentDemandElements = myLane->getParentDemandElements(); - myChildShapes = myLane->getChildShapes(); - myChildAdditionals = myLane->getChildAdditionals(); - myChildDemandElements = myLane->getChildDemandElements(); - } else { - assert(forward); - } + myLane->incRef("GNEChange_Lane"); } @@ -81,6 +71,9 @@ if (myLane->unreferenced()) { // show extra information for tests WRITE_DEBUG("Deleting unreferenced " + myLane->getTagStr() + " '" + myLane->getID() + "' in GNEChange_Lane"); + // remove lane from parents and children + removeLane(myLane); + // delete lane delete myLane; } } @@ -93,64 +86,27 @@ // show extra information for tests if (myLane != nullptr) { WRITE_DEBUG("Removing " + myLane->getTagStr() + " '" + myLane->getID() + "' from " + toString(SUMO_TAG_EDGE)); + // remove lane from parents and children + removeLane(myLane); } else { WRITE_DEBUG("Removing nullptr " + toString(SUMO_TAG_LANE) + " from " + toString(SUMO_TAG_EDGE)); } - // remove lane from edge + // remove lane from edge (note: myLane can be nullptr) myEdge->removeLane(myLane, false); - // Remove lane from parent elements - for (const auto& i : myParentShapes) { - i->removeChildLane(myLane); - } - for (const auto& i : myParentAdditionals) { - i->removeChildLane(myLane); - } - for (const auto& i : myParentDemandElements) { - i->removeChildLane(myLane); - } - // Remove lane from child elements - for (const auto& i : myChildShapes) { - i->removeParentLane(myLane); - } - for (const auto& i : myChildAdditionals) { - i->removeParentLane(myLane); - } - for (const auto& i : myChildDemandElements) { - i->removeParentLane(myLane); - } } else { // show extra information for tests if (myLane != nullptr) { WRITE_DEBUG("Adding " + myLane->getTagStr() + " '" + myLane->getID() + "' into " + toString(SUMO_TAG_EDGE)); + // add lane into parents and children + addLane(myLane); } else { WRITE_DEBUG("Adding nullptr " + toString(SUMO_TAG_LANE) + " into " + toString(SUMO_TAG_EDGE)); } - // add lane and their attributes to edge - // (lane removal is reverted, no need to recompute connections) + // add lane and their attributes to edge (lane removal is reverted, no need to recompute connections) myEdge->addLane(myLane, myLaneAttrs, false); - // add lane in parent elements - for (const auto& i : myParentShapes) { - i->addChildLane(myLane); - } - for (const auto& i : myParentAdditionals) { - i->addChildLane(myLane); - } - for (const auto& i : myParentDemandElements) { - i->addChildLane(myLane); - } - // add lane in child elements - for (const auto& i : myChildShapes) { - i->addParentLane(myLane); - } - for (const auto& i : myChildAdditionals) { - i->addParentLane(myLane); - } - for (const auto& i : myChildDemandElements) { - i->addParentLane(myLane); - } } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } @@ -160,63 +116,27 @@ // show extra information for tests if (myLane != nullptr) { WRITE_DEBUG("Adding " + myLane->getTagStr() + " '" + myLane->getID() + "' into " + toString(SUMO_TAG_EDGE)); + // add lane into parents and children + addLane(myLane); } else { WRITE_DEBUG("Adding nullptr " + toString(SUMO_TAG_LANE) + " into " + toString(SUMO_TAG_EDGE)); } // add lane and their attributes to edge myEdge->addLane(myLane, myLaneAttrs, myRecomputeConnections); - // add lane in parent elements - for (const auto& i : myParentShapes) { - i->addChildLane(myLane); - } - for (const auto& i : myParentAdditionals) { - i->addChildLane(myLane); - } - for (const auto& i : myParentDemandElements) { - i->addChildLane(myLane); - } - // add additional in child elements - for (const auto& i : myChildShapes) { - i->addParentLane(myLane); - } - for (const auto& i : myChildAdditionals) { - i->addParentLane(myLane); - } - for (const auto& i : myChildDemandElements) { - i->addParentLane(myLane); - } } else { // show extra information for tests if (myLane != nullptr) { WRITE_DEBUG("Removing " + myLane->getTagStr() + " '" + myLane->getID() + "' from " + toString(SUMO_TAG_EDGE)); + // remove lane from parents and children + removeLane(myLane); } else { WRITE_DEBUG("Removing nullptr " + toString(SUMO_TAG_LANE) + " from " + toString(SUMO_TAG_EDGE)); } - // Remove lane from parent elements - for (const auto& i : myParentShapes) { - i->removeChildLane(myLane); - } - for (const auto& i : myParentAdditionals) { - i->removeChildLane(myLane); - } - for (const auto& i : myParentDemandElements) { - i->removeChildLane(myLane); - } - // Remove additional from child elements - for (const auto& i : myChildShapes) { - i->removeParentLane(myLane); - } - for (const auto& i : myChildAdditionals) { - i->removeParentLane(myLane); - } - for (const auto& i : myChildDemandElements) { - i->removeParentLane(myLane); - } // remove lane from edge myEdge->removeLane(myLane, myRecomputeConnections); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myEdge->getNet()->requireSaveNet(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Lane.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Lane.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Lane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Lane.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,30 +17,12 @@ /// // A network change in which a single lane is created or deleted /****************************************************************************/ -#ifndef GNEChange_Lane_h -#define GNEChange_Lane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include - #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNELane; -class GNEAdditional; -class GNEShape; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -51,11 +33,17 @@ FXDECLARE_ABSTRACT(GNEChange_Lane) public: - /**@brief Constructor for creating/deleting an edge + /**@brief Constructor for creating a lane + * @param[in] edge The edge on which to apply changes + * @param[in] laneAttrs The attributes of the lane to be created/ + */ + GNEChange_Lane(GNEEdge* edge, const NBEdge::Lane& laneAttrs); + + /**@brief Constructor for deleting a lane * @param[in] edge The edge on which to apply changes - * @param[in] lane The lane to be deleted or 0 if a lane should be created - * @param[in] laneAttrs The attributes of the lane to be created/deleted - * @param[in] forward Whether to create/delete (true/false) + * @param[in] lane The lane to be deleted + * @param[in] laneAttrs The attributes of the lane to be deleted + * @param[in] forward Whether to delete (true/false) * @param[in] recomputeConnections Whether to recompute all connections for the affected edge */ GNEChange_Lane(GNEEdge* edge, GNELane* lane, const NBEdge::Lane& laneAttrs, bool forward, bool recomputeConnections = true); @@ -78,7 +66,6 @@ void redo(); /// @} - private: /// @brief we need the edge because it is the target of our change commands GNEEdge* myEdge; @@ -91,25 +78,4 @@ /// @bried whether to recompute connection when adding a new lane bool myRecomputeConnections; - - /// @brief vector of parent shapes - std::vector myParentShapes; - - /// @brief vector of parent additionals - std::vector myParentAdditionals; - - /// @brief vector of parent demand elements - std::vector myParentDemandElements; - - /// @brief vector of child shapes - std::vector myChildShapes; - - /// @brief vector of child additional - std::vector myChildAdditionals; - - /// @brief vector of child demand elements - std::vector myChildDemandElements; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Shape.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Shape.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Shape.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Shape.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,18 +17,10 @@ /// // A network change in which a single poly is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include +#include #include "GNEChange_Shape.h" @@ -42,107 +34,23 @@ // =========================================================================== GNEChange_Shape::GNEChange_Shape(GNEShape* shape, bool forward) : - GNEChange(shape->getNet(), forward), - myShape(shape), - myParentEdges(shape->getParentEdges()), - myParentLanes(shape->getParentLanes()), - myParentShapes(shape->getParentShapes()), - myParentAdditionals(shape->getParentAdditionals()), - myParentDemandElements(shape->getParentDemandElements()), - myChildEdges(shape->getChildEdges()), - myChildLanes(shape->getChildLanes()), - myChildShapes(shape->getChildShapes()), - myChildAdditionals(shape->getChildAdditionals()), - myChildDemandElements(shape->getChildDemandElements()) { + GNEChange(shape, shape, forward), + myShape(shape) { myShape->incRef("GNEChange_Shape"); } GNEChange_Shape::~GNEChange_Shape() { - assert(myShape); myShape->decRef("GNEChange_Shape"); if (myShape->unreferenced()) { // make sure that shape are removed of ShapeContainer (net) AND grid - if (myNet->retrievePolygon(myShape->getID(), false) != nullptr) { + if (myShape->getNet()->retrieveShape(myShape->getTagProperty().getTag(), myShape->getID(), false) != nullptr) { // show extra information for tests WRITE_DEBUG("Removing " + myShape->getTagStr() + " '" + myShape->getID() + "' from net in ~GNEChange_Shape()"); - // all polygons are placed in RTREE - myNet->removeGLObjectFromGrid(dynamic_cast(myShape)); - // remove polygon from container - myNet->myPolygons.remove(myShape->getID(), false); - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->removeChildShape(myShape); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->removeParentShape(myShape); - } - } else if (myNet->retrievePOI(myShape->getID(), false) != nullptr) { - // show extra information for tests - WRITE_DEBUG("Removing " + myShape->getTagStr() + " '" + myShape->getID() + "' from net in ~GNEChange_Shape()"); - // only certain POIS are placed in RTREE - if (myShape->getTagProperty().isPlacedInRTree()) { - myNet->removeGLObjectFromGrid(dynamic_cast(myShape)); - } - // remove POI from container - myNet->myPOIs.remove(myShape->getID(), false); - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->removeChildShape(myShape); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->removeParentShape(myShape); - } + // remove polygon from AttributeCarreirs + myShape->getNet()->getAttributeCarriers()->deleteShape(myShape); + // Remove element from parents and children + removeShape(myShape); } // show extra information for tests WRITE_DEBUG("delete " + myShape->getTagStr() + " '" + myShape->getID() + "' in ~GNEChange_Shape()"); @@ -157,76 +65,16 @@ // show extra information for tests WRITE_DEBUG("Removing " + myShape->getTagStr() + " '" + myShape->getID() + "' from viewNet"); // remove shape from net - myNet->removeShape(myShape, false); - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->removeChildShape(myShape); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->removeParentShape(myShape); - } + myShape->getNet()->getAttributeCarriers()->deleteShape(myShape); + // Remove element from parents and children + removeShape(myShape); } else { // show extra information for tests WRITE_DEBUG("Adding " + myShape->getTagStr() + " '" + myShape->getID() + "' into viewNet"); // Add shape in net - myNet->insertShape(myShape, false); - // add element in parent elements - for (const auto& i : myParentEdges) { - i->addChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->addChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->addChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->addChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->addChildShape(myShape); - } - // add element in child elements - for (const auto& i : myChildEdges) { - i->addParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->addParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->addParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->addParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->addParentShape(myShape); - } + myShape->getNet()->getAttributeCarriers()->insertShape(myShape); + // Add element in parents and children + addShape(myShape); } } @@ -237,76 +85,16 @@ // show extra information for tests WRITE_DEBUG("Adding " + myShape->getTagStr() + " '" + myShape->getID() + "' into viewNet"); // Add shape in net - myNet->insertShape(myShape, false); - // add element in parent elements - for (const auto& i : myParentEdges) { - i->addChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->addChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->addChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->addChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->addChildShape(myShape); - } - // add element in child elements - for (const auto& i : myChildEdges) { - i->addParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->addParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->addParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->addParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->addParentShape(myShape); - } + myShape->getNet()->getAttributeCarriers()->insertShape(myShape); + // Add element in parents and children + addShape(myShape); } else { // show extra information for tests WRITE_DEBUG("Removing " + myShape->getTagStr() + " '" + myShape->getID() + "' from viewNet"); // remove shape from net - myNet->removeShape(myShape, false); - // Remove element from parent elements - for (const auto& i : myParentEdges) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentLanes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentShapes) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentAdditionals) { - i->removeChildShape(myShape); - } - for (const auto& i : myParentDemandElements) { - i->removeChildShape(myShape); - } - // Remove element from child elements - for (const auto& i : myChildEdges) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildLanes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildShapes) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildAdditionals) { - i->removeParentShape(myShape); - } - for (const auto& i : myChildDemandElements) { - i->removeParentShape(myShape); - } + myShape->getNet()->getAttributeCarriers()->deleteShape(myShape); + // Remove element from parents and children + removeShape(myShape); } } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Shape.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Shape.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_Shape.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_Shape.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,26 +17,12 @@ /// // A network change in which a single Shape is created or deleted /****************************************************************************/ -#ifndef GNEChange_Shape_h -#define GNEChange_Shape_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include #include "GNEChange.h" // =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEShape; - -// =========================================================================== // class definitions // =========================================================================== /** @@ -74,37 +60,4 @@ private: /// @brief pointer to shape GNEShape* myShape; - - /// @brief reference to vector of parent edges - const std::vector& myParentEdges; - - /// @brief reference to vector of parent lanes - const std::vector& myParentLanes; - - /// @brief reference to vector of parent shapes - const std::vector& myParentShapes; - - /// @brief reference to vector of parent additionals - const std::vector& myParentAdditionals; - - /// @brief reference to vector of parent demand elements - const std::vector& myParentDemandElements; - - /// @brief reference to vector of child edges - const std::vector& myChildEdges; - - /// @brief reference to vector of child lanes - const std::vector& myChildLanes; - - /// @brief reference to vector of child shapes - const std::vector& myChildShapes; - - /// @brief reference to vector of child additional - const std::vector& myChildAdditionals; - - /// @brief reference to vector of child demand elements - const std::vector& myChildDemandElements; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_TLS.cpp sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_TLS.cpp --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_TLS.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_TLS.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,12 @@ /// // A network change in which a traffic light is created or deleted /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include -#include +#include #include #include "GNEChange_TLS.h" @@ -44,11 +40,10 @@ /// @brief constructor for creating an edge GNEChange_TLS::GNEChange_TLS(GNEJunction* junction, NBTrafficLightDefinition* tlDef, bool forward, bool forceInsert, const std::string tlID): - GNEChange(junction->getNet(), forward), + GNEChange(forward), myJunction(junction), myTlDef(tlDef), myForceInsert(forceInsert) { - assert(myNet); myJunction->incRef("GNEChange_TLS"); if (myTlDef == nullptr) { assert(forward); @@ -64,7 +59,6 @@ GNEChange_TLS::~GNEChange_TLS() { - assert(myJunction); myJunction->decRef("GNEChange_TLS"); if (myJunction->unreferenced()) { // show extra information for tests @@ -87,8 +81,8 @@ // add traffic light to junction myJunction->addTrafficLight(myTlDef, myForceInsert); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunction->getNet()->requireSaveNet(true); } @@ -105,8 +99,8 @@ // remove traffic light from junction myJunction->removeTrafficLight(myTlDef); } - // enable save netElements - myNet->requireSaveNet(true); + // enable save networkElements + myJunction->getNet()->requireSaveNet(true); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_TLS.h sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_TLS.h --- sumo-1.5.0+dfsg1/src/netedit/changes/GNEChange_TLS.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/changes/GNEChange_TLS.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,23 +17,11 @@ /// // A network change in which a traffic light is created or deleted /****************************************************************************/ -#ifndef GNEChange_TLS_h -#define GNEChange_TLS_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include #include "GNEChange.h" -// =========================================================================== -// class declarations -// =========================================================================== -class NBTrafficLightDefinition; class GNEJunction; // =========================================================================== @@ -88,6 +76,3 @@ /// @brief check if forceInsert is enabled bool myForceInsert; }; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -1,18 +1,20 @@ -add_subdirectory(additionals) add_subdirectory(changes) add_subdirectory(dialogs) add_subdirectory(frames) -add_subdirectory(netelements) -add_subdirectory(demandelements) +add_subdirectory(elements) set(netedit_SRCS netedit_main.cpp + GNEApplicationWindowHelper.h + GNEApplicationWindowHelper.cpp GNEApplicationWindow.h GNEApplicationWindow.cpp GNELoadThread.h GNELoadThread.cpp GNENet.h GNENet.cpp + GNENetHelper.h + GNENetHelper.cpp GNEViewNet.h GNEViewNet.cpp GNEViewNetHelper.h @@ -21,14 +23,10 @@ GNEViewParent.cpp GNEUndoList.h GNEUndoList.cpp - GNEAttributeCarrier.h - GNEAttributeCarrier.cpp GNEGeometry.h GNEGeometry.cpp - GNEHierarchicalParentElements.h - GNEHierarchicalParentElements.cpp - GNEHierarchicalChildElements.h - GNEHierarchicalChildElements.cpp + GNEMoveShape.h + GNEMoveShape.cpp GNEReferenceCounter.h GNEEvent_NetworkLoaded.h ) @@ -36,10 +34,10 @@ add_executable(netedit ${netedit_SRCS} netedit.rc) set_target_properties(netedit PROPERTIES OUTPUT_NAME netedit${BINARY_SUFFIX}) set_target_properties(netedit PROPERTIES OUTPUT_NAME_DEBUG netedit${BINARY_SUFFIX}D) -target_link_libraries(netedit utils_gui_cursors utils_gui_shortcuts - utils_foxtools foreign_eulerspiral netedit_frames - netedit_netelements netedit_demandelements netedit_changes utils_gui_div - utils_gui_settings utils_gui_images netedit_additionals netedit_dialogs +target_link_libraries(netedit utils_gui_cursors utils_gui_shortcuts utils_foxtools foreign_eulerspiral + netedit_frames netedit_frames_common netedit_frames_network netedit_frames_demand netedit_frames_data + netedit_elements netedit_elements_network netedit_elements_additional netedit_elements_demand netedit_elements_data netedit_changes + utils_gui_div utils_gui_settings utils_gui_images netedit_dialogs utils_gui_windows utils_gui_globjects utils_gui_tracker utils_foxtools utils_vehicle utils_emissions foreign_phemlight ${netconvertlibs} ${FOX_LIBRARY} ${GL2PS_LIBRARIES}) if (MSVC) set_target_properties(netedit PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/demandelements/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/demandelements/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -set(netedit_demandelements_SRCS - GNERouteHandler.h - GNERouteHandler.cpp - GNEDemandElement.h - GNEDemandElement.cpp - GNERoute.h - GNERoute.cpp - GNEVehicleType.h - GNEVehicleType.cpp - GNEVehicle.h - GNEVehicle.cpp - GNEStop.h - GNEStop.cpp - GNEWalk.h - GNEWalk.cpp - GNERide.h - GNERide.cpp - GNEPersonTrip.h - GNEPersonTrip.cpp - GNEPerson.h - GNEPerson.cpp - ) - -add_library(netedit_demandelements STATIC ${netedit_demandelements_SRCS}) -set_property(TARGET netedit_demandelements PROPERTY PROJECT_LABEL "z_netedit_demandelements") diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEDemandElement.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEDemandElement.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEDemandElement.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEDemandElement.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,580 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDemandElement.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2018 -/// -// A abstract class for demand elements -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDemandElement.h" - -// =========================================================================== -// static members -// =========================================================================== - -GNEDemandElement::RouteCalculator* GNEDemandElement::myRouteCalculatorInstance = nullptr; - -// =========================================================================== -// member method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEDemandElement::RouteCalculator - methods -// --------------------------------------------------------------------------- - -GNEDemandElement::RouteCalculator::RouteCalculator(GNENet* net) : - myNet(net) { - myDijkstraRouter = new DijkstraRouter( - myNet->getNetBuilder()->getEdgeCont().getAllRouterEdges(), - true, &NBRouterEdge::getTravelTimeStatic, nullptr, true); -} - - -GNEDemandElement::RouteCalculator::~RouteCalculator() { - delete myDijkstraRouter; -} - - -void -GNEDemandElement::RouteCalculator::updateDijkstraRouter() { - // simply delete and create myDijkstraRouter again - if (myDijkstraRouter) { - delete myDijkstraRouter; - } - myDijkstraRouter = new DijkstraRouter( - myNet->getNetBuilder()->getEdgeCont().getAllRouterEdges(), - true, &NBRouterEdge::getTravelTimeStatic, nullptr, true); -} - - -std::vector -GNEDemandElement::RouteCalculator::calculateDijkstraRoute(const SUMOVehicleClass vClass, const std::vector& partialEdges) const { - // declare a solution vector - std::vector solution; - // calculate route depending of number of partial edges - if (partialEdges.size() == 1) { - // if there is only one partialEdges, route has only one edge - solution.push_back(partialEdges.front()); - } else { - // declare temporal vehicle - NBVehicle tmpVehicle("temporalNBVehicle", vClass); - // obtain pointer to GNENet - GNENet* net = partialEdges.front()->getNet(); - // iterate over every selected edges - for (int i = 1; i < (int)partialEdges.size(); i++) { - // declare a temporal route in which save route between two last edges - std::vector partialRoute; - myDijkstraRouter->compute(partialEdges.at(i - 1)->getNBEdge(), partialEdges.at(i)->getNBEdge(), &tmpVehicle, 10, partialRoute); - // save partial route in solution - for (const auto& j : partialRoute) { - solution.push_back(net->retrieveEdge(j->getID())); - } - } - } - // filter solution - auto solutionIt = solution.begin(); - // iterate over solution - while (solutionIt != solution.end()) { - if ((solutionIt + 1) != solution.end()) { - // if next edge is the same of current edge, remove it - if (*solutionIt == *(solutionIt + 1)) { - solutionIt = solution.erase(solutionIt); - } else { - solutionIt++; - } - } else { - solutionIt++; - } - } - return solution; -} - - -std::vector -GNEDemandElement::RouteCalculator::calculateDijkstraRoute(const GNENet* net, const SUMOVehicleClass vClass, const std::vector& partialEdgesStr) const { - // declare a vector of GNEEdges - std::vector partialEdges; - partialEdges.reserve(partialEdgesStr.size()); - // convert to vector of GNEEdges - for (const auto& i : partialEdgesStr) { - partialEdges.push_back(net->retrieveEdge(i)); - } - // calculate DijkstraRoute using partialEdges - return calculateDijkstraRoute(vClass, partialEdges); -} - - -bool -GNEDemandElement::RouteCalculator::consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge* from, const GNEEdge* to) const { - // check conditions - if ((from == nullptr) || (to == nullptr)) { - // edges cannot be null - return false; - } else if (from == to) { - // the same edge cannot be consecutive of itself - return false; - } else if (vClass == SVC_PEDESTRIAN) { - // for pedestrians consecutive edges are always connected - return true; - } else { - // declare temporal vehicle - NBVehicle tmpVehicle("temporalNBVehicle", vClass); - // declare a temporal route in which save route between two last edges - std::vector solution; - // calculate route betwen from and to edge - myDijkstraRouter->compute(from->getNBEdge(), to->getNBEdge(), &tmpVehicle, 10, solution); - // check if soultion is enmpty - if (solution.size() == 2) { - return true; - } else { - return false; - } - } -} - -// --------------------------------------------------------------------------- -// GNEDemandElement - methods -// --------------------------------------------------------------------------- - -GNEDemandElement::GNEDemandElement(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - GUIGlObject(type, id), - GNEAttributeCarrier(tag), - GNEHierarchicalParentElements(this, parentEdges, parentLanes, parentShapes, parentAdditionals, parentDemandElements), - GNEHierarchicalChildElements(this, childEdges, childLanes, childShapes, childAdditionals, childDemandElements), - myViewNet(viewNet) { -} - - -GNEDemandElement::GNEDemandElement(GNEDemandElement* demandElementParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - GUIGlObject(type, demandElementParent->generateChildID(tag)), - GNEAttributeCarrier(tag), - GNEHierarchicalParentElements(this, parentEdges, parentLanes, parentShapes, parentAdditionals, parentDemandElements), - GNEHierarchicalChildElements(this, childEdges, childLanes, childShapes, childAdditionals, childDemandElements), - myViewNet(viewNet) { -} - - -GNEDemandElement::~GNEDemandElement() {} - - -std::string -GNEDemandElement::generateChildID(SumoXMLTag childTag) { - int counter = (int)getChildDemandElements().size(); - while (myViewNet->getNet()->retrieveDemandElement(childTag, getID() + toString(childTag) + toString(counter), false) != nullptr) { - counter++; - } - return (getID() + toString(childTag) + toString(counter)); -} - - -const GNEGeometry::Geometry& -GNEDemandElement::getDemandElementGeometry() { - return myDemandElementGeometry; -} - - -const GNEGeometry::SegmentGeometry& -GNEDemandElement::getDemandElementSegmentGeometry() const { - return myDemandElementSegmentGeometry; -} - - -void -GNEDemandElement::updateDemandElementGeometry(const GNELane* lane, const double posOverLane) { - myDemandElementGeometry.updateGeometry(lane, posOverLane); -} - - -void -GNEDemandElement::updateDemandElementStackLabel(const int stack) { - myStackedLabelNumber = stack; -} - - -const GNEGeometry::SegmentGeometry& -GNEDemandElement::getDemandElementSegmentSpreadGeometry() const { - return mySpreadSegmentGeometry; -} - - -void -GNEDemandElement::updateDemandElementSpreadGeometry(const GNELane* lane, const double posOverLane) { - mySpreadGeometry.updateGeometry(lane, posOverLane); -} - - -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"); -} - - -std::string -GNEDemandElement::getBegin() const { - throw InvalidArgument(getTagStr() + " doesn't have an begin time"); -} - - -GNEViewNet* -GNEDemandElement::getViewNet() const { - return myViewNet; -} - - -void -GNEDemandElement::createRouteCalculatorInstance(GNENet* net) { - if (myRouteCalculatorInstance == nullptr) { - myRouteCalculatorInstance = new RouteCalculator(net); - } else { - throw ProcessError("Instance already created"); - } -} - - -void -GNEDemandElement::deleteRouteCalculatorInstance() { - if (myRouteCalculatorInstance) { - delete myRouteCalculatorInstance; - myRouteCalculatorInstance = nullptr; - } else { - throw ProcessError("Instance wasn't created"); - } -} - - -GNEDemandElement::RouteCalculator* -GNEDemandElement::getRouteCalculatorInstance() { - if (myRouteCalculatorInstance) { - return myRouteCalculatorInstance; - } else { - throw ProcessError("Instance wasn't created"); - } -} - - -GUIGLObjectPopupMenu* -GNEDemandElement::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open demand element dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - return ret; -} - - -GUIParameterTableWindow* -GNEDemandElement::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - // Create table - GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); - // Iterate over attributes - for (const auto& i : myTagProperty) { - // Add attribute and set it dynamic if aren't unique - if (i.isUnique()) { - ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); - } else { - ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); - } - } - // close building - ret->closeBuilding(); - return ret; -} - - -const std::string& -GNEDemandElement::getDemandElementID() const { - return getMicrosimID(); -} - - -bool -GNEDemandElement::isValidDemandElementID(const std::string& newID) const { - if (SUMOXMLDefinitions::isValidVehicleID(newID) && (myViewNet->getNet()->retrieveDemandElement(myTagProperty.getTag(), newID, false) == nullptr)) { - return true; - } else { - return false; - } -} - - -void -GNEDemandElement::changeDemandElementID(const std::string& newID) { - if (myViewNet->getNet()->retrieveDemandElement(myTagProperty.getTag(), newID, false) != nullptr) { - throw InvalidArgument("An DemandElement with tag " + getTagStr() + " and ID = " + newID + " already exists"); - } else { - // Save old ID - std::string oldID = getMicrosimID(); - // set New ID - setMicrosimID(newID); - // update demand element ID in the container of net - myViewNet->getNet()->updateDemandElementID(oldID, this); - } -} - - -GNELane* -GNEDemandElement::getFirstAllowedVehicleLane() const { - // first check if current demand element has parent edges - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - // use route edges - return getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); - } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { - // check if vehicle use a embedded route - if (getParentDemandElements().size() == 2) { - return getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); - } else if (getChildDemandElements().size() > 0) { - return getChildDemandElements().front()->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); - } else { - return nullptr; - } - } else if (getParentEdges().size() > 0) { - // obtain Lane depending of attribute "departLane" - if (myTagProperty.hasAttribute(SUMO_ATTR_DEPARTLANE)) { - // obtain depart lane - std::string departLane = getAttribute(SUMO_ATTR_DEPARTLANE); - // check depart lane - if ((departLane == "random") || (departLane == "free") || (departLane == "allowed") || (departLane == "best") || (departLane == "first")) { - return getParentEdges().front()->getLaneByAllowedVClass(getVClass()); - } - // obtain index - const int departLaneIndex = parse(getAttribute(SUMO_ATTR_DEPARTLANE)); - // if index is correct, return lane. In other case, return nullptr; - if ((departLaneIndex >= 0) && (departLaneIndex < getParentEdges().front()->getNBEdge()->getNumLanes())) { - return getParentEdges().front()->getLanes().at(departLaneIndex); - } else { - return nullptr; - } - } else if (myTagProperty.isRide()) { - // special case for rides - return getParentEdges().front()->getLaneByDisallowedVClass(getVClass()); - } else { - // in other case, always return the first allowed - return getParentEdges().front()->getLaneByAllowedVClass(getVClass()); - } - } else { - return nullptr; - } -} - - -GNELane* -GNEDemandElement::getLastAllowedVehicleLane() const { - // first check if current demand element has parent edges - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - // use route edges - return getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(getVClass()); - } else if (getParentEdges().size() > 0) { - if ((myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) || - (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) || - (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP)) { - // return busStop lane - return getParentAdditionals().front()->getParentLanes().front(); - } else if (myTagProperty.hasAttribute(SUMO_ATTR_ARRIVALLANE)) { - // obtain Lane depending of attribute "arrivalLane" - std::string arrivalLane = getAttribute(SUMO_ATTR_ARRIVALLANE); - // check depart lane - if (arrivalLane == "current") { - return getParentEdges().back()->getLaneByAllowedVClass(getVClass()); - } - // obtain index - const int arrivalLaneIndex = parse(getAttribute(SUMO_ATTR_ARRIVALLANE)); - // if index is correct, return lane. In other case, return nullptr; - if ((arrivalLaneIndex >= 0) && (arrivalLaneIndex < getParentEdges().back()->getNBEdge()->getNumLanes())) { - return getParentEdges().back()->getLanes().at(arrivalLaneIndex); - } else { - return nullptr; - } - } else if (myTagProperty.isRide()) { - // special case for rides - return getParentEdges().back()->getLaneByDisallowedVClass(getVClass()); - } else { - // in other case, always return the first allowed - return getParentEdges().back()->getLaneByAllowedVClass(getVClass()); - } - } else { - return nullptr; - } -} - - -void -GNEDemandElement::calculatePersonPlanLaneStartEndPos(double& startPos, double& endPos) const { - // obtain pointer to current busStop - GNEAdditional* busStop = getParentAdditionals().size() > 0 ? getParentAdditionals().front() : nullptr; - // declare pointers for previous elements - GNEAdditional* previousBusStop = nullptr; - GNEDemandElement* previousPersonPlan = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); - // declare pointer to next person plan - GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); - // obtain departlane throught previous element - if (previousPersonPlan && (previousPersonPlan->getParentAdditionals().size() > 0)) { - // set previous busStop - previousBusStop = previousPersonPlan->getParentAdditionals().front(); - } - // adjust startPos depending of previous busStop - if (previousBusStop) { - startPos = previousBusStop->getAttributeDouble(SUMO_ATTR_ENDPOS); - } else if (previousPersonPlan) { - // check if previous element is a stop or another person plan (walk, ride, trip...) - if (previousPersonPlan->getTagProperty().isPersonStop()) { - startPos = previousPersonPlan->getAttributeDouble(SUMO_ATTR_ENDPOS); - } else { - startPos = previousPersonPlan->getAttributeDouble(SUMO_ATTR_ARRIVALPOS); - } - } else { - // if this is the first person plan, use departPos of pedestrian - startPos = getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPARTPOS); - } - // adjust endPos depending of next busStop - if (busStop) { - endPos = busStop->getAttributeDouble(SUMO_ATTR_STARTPOS); - } else if (nextPersonPlan && nextPersonPlan->getTagProperty().isPersonStop()) { - endPos = nextPersonPlan->getAttributeDouble(SUMO_ATTR_STARTPOS); - } else { - // if this is the last element, simply use arrival position - endPos = getAttributeDouble(SUMO_ATTR_ARRIVALPOS); - } -} - - -void -GNEDemandElement::calculatePersonPlanPositionStartEndPos(Position& startPos, Position& endPos) const { - // obtain previous demand element - GNEDemandElement* previousDemandElmement = getParentDemandElements().front()->getPreviousChildDemandElement(this); - if (previousDemandElmement) { - // update startPos - if ((previousDemandElmement->getParentAdditionals().size() > 0) && - (previousDemandElmement->getParentAdditionals().front()->getAdditionalGeometry().getShape().size() > 0)) { - // Previous demand element ends in an busStop - startPos = previousDemandElmement->getParentAdditionals().front()->getAdditionalGeometry().getShape().back(); - } else if (previousDemandElmement->getTagProperty().isPersonStop() && (previousDemandElmement->getDemandElementGeometry().getShape().size() > 0)) { - // Previous demand element ends in an Stop - startPos = previousDemandElmement->getDemandElementGeometry().getShape().back(); - } else if ((previousDemandElmement->getDemandElementSegmentGeometry().size() > 0) && - (previousDemandElmement->getDemandElementSegmentGeometry().back().getShape().size() > 0)) { - // add last shape segment of previous segment geometry - startPos = previousDemandElmement->getDemandElementSegmentGeometry().back().getShape().back(); - } - } - // check if demand element ends in an busStop - if ((getParentAdditionals().size() > 0) && (getParentAdditionals().front()->getAdditionalGeometry().getShape().size() > 0)) { - endPos = getParentAdditionals().front()->getAdditionalGeometry().getShape().front(); - } else { - // obtain next demand element - GNEDemandElement* nextDemandElmement = getParentDemandElements().front()->getNextChildDemandElement(this); - if (nextDemandElmement) { - // update end pos - if (nextDemandElmement->getTagProperty().isPersonStop() && (nextDemandElmement->getDemandElementGeometry().getShape().size() > 0)) { - // previous demand element ends in an Stop - endPos = nextDemandElmement->getDemandElementGeometry().getShape().front(); - } - } - } -} - - -bool -GNEDemandElement::isAttributeCarrierSelected() const { - return mySelected; -} - - -bool -GNEDemandElement::drawUsingSelectColor() const { - if (mySelected && (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND)) { - return true; - } else { - return false; - } -} - - -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"); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEDemandElement.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEDemandElement.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEDemandElement.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEDemandElement.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,464 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDemandElement.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2018 -/// -// A abstract class for demand elements -/****************************************************************************/ -#ifndef GNEDemandElement_h -#define GNEDemandElement_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEAdditional; -class GNEDemandElement; -class GNENetElement; -class GNEEdge; -class GNELane; -class GNEJunction; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEDemandElement - * @brief An Element which don't belongs to GNENet but has influency in the simulation - */ -class GNEDemandElement : public GUIGlObject, public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { - -public: - /// @brief struct for pack all variables related with Demand Element moving - struct DemandElementMove { - /// @brief boundary used during moving of elements (to avoid insertion in RTREE) - Boundary movingGeometryBoundary; - - /// @brief value for saving first original position over lane before moving - Position originalViewPosition; - - /// @brief value for saving first original position over lane before moving - std::string firstOriginalLanePosition; - - /// @brief value for saving second original position over lane before moving - std::string secondOriginalPosition; - }; - - /// @brief class used to calculate routes in nets - class RouteCalculator { - - public: - /// @brief constructor - RouteCalculator(GNENet* net); - - /// @brief destructor - ~RouteCalculator(); - - /// @brief update DijkstraRoute (called when SuperMode Demand is selected) - void updateDijkstraRouter(); - - /// @brief calculate Dijkstra route between a list of partial edges - std::vector calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector& partialEdges) const; - - /// @brief calculate Dijkstra route between a list of partial edges (in string format) - std::vector calculateDijkstraRoute(const GNENet* net, const SUMOVehicleClass vClass, const std::vector& partialEdgesStr) const; - - /// @brief check if exist a route between the two given consecutives edges for the given VClass - bool consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge* from, const GNEEdge* to) const; - - private: - /// @brief pointer to net - GNENet* myNet; - - /// @brief SUMO Abstract DijkstraRouter - SUMOAbstractRouter* myDijkstraRouter; - }; - - /**@brief Constructor - * @param[in] id Gl-id of the demand element element (Must be unique) - * @param[in] viewNet pointer to GNEViewNet of this demand element element belongs - * @param[in] type GUIGlObjectType of demand element - * @param[in] tag Type of xml tag that define the demand element element (SUMO_TAG_ROUTE, SUMO_TAG_VEHICLE, etc...) - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] childDemandElements vector of demandElement parents - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of demandElement children - */ - GNEDemandElement(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /**@brief Constructor - * @param[in] demandElementParent pointer to parent demand element pointer (used to generate an ID) - * @param[in] viewNet pointer to GNEViewNet of this demand element element belongs - * @param[in] type GUIGlObjectType of demand element - * @param[in] tag Type of xml tag that define the demand element element (SUMO_TAG_ROUTE, SUMO_TAG_VEHICLE, etc...) - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] childDemandElements vector of demandElement parents - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of demandElement children - */ - GNEDemandElement(GNEDemandElement* demandElementParent, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /// @brief Destructor - ~GNEDemandElement(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name members and functions relative to demand element (stacked) geometries - /// @{ - /// @brief get demand element geometry (stacked) - const GNEGeometry::Geometry& getDemandElementGeometry(); - - /// @brief get demand element segment geometry (stacked) - const GNEGeometry::SegmentGeometry& getDemandElementSegmentGeometry() const; - - /// @brief update element stacked geometry (stacked) - void updateDemandElementGeometry(const GNELane* lane, const double posOverLane); - - /// @brief update stack label - void updateDemandElementStackLabel(const int stack); - /// @} - - /// @name members and functions relative to demand element spread geometries - /// @{ - /// @brief get demand element segment spread geometry - const GNEGeometry::SegmentGeometry& getDemandElementSegmentSpreadGeometry() const; - - /// @brief update element spread geometry - void updateDemandElementSpreadGeometry(const GNELane* lane, const double posOverLane); - /// @} - - /// @name members and functions relative to elements common to all demand elements - /// @{ - /// @brief obtain from edge of this demand element - virtual GNEEdge* getFromEdge() const = 0; - - /// @brief obtain to edge of this demand element - virtual GNEEdge* getToEdge() const = 0; - - /// @brief obtain VClass related with this demand element - virtual SUMOVehicleClass getVClass() const = 0; - - /// @brief get color - virtual const RGBColor& getColor() const = 0; - /// @} - - /// @name members and functions relative to write demand elements into XML - /// @{ - /**@brief writte demand element element into a xml file - * @param[in] device device in which write parameters of demand element element - */ - 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; - - /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) - virtual std::string getDemandElementProblem() const; - - /// @brief fix demand element problem (by default throw an exception, has to be reimplemented in children) - virtual void fixDemandElementProblem(); - /// @} - - /**@brief open DemandElement Dialog - * @note: if demand element needs an demand element dialog, this function has to be implemented in childrens (see GNERerouter and GNEVariableSpeedSign) - * @throw invalid argument if demand element doesn't have an demand element Dialog - */ - virtual void openDemandElementDialog(); - - /**@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 - */ - virtual std::string getBegin() const; - - /// @name Functions related with geometry of element - /// @{ - /// @brief begin geometry movement - virtual void startGeometryMoving() = 0; - - /// @brief end geometry movement - virtual void endGeometryMoving() = 0; - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - virtual void moveGeometry(const Position& offset) = 0; - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; - - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief partial update pre-computed geometry information - virtual void updatePartialGeometry(const GNEEdge* edge) = 0; - - /// @brief compute path - virtual void computePath() = 0; - - /// @brief invalidate path - virtual void invalidatePath() = 0; - - /// @brief Returns position of demand element in view - virtual Position getPositionInView() const = 0; - - /// @brief split geometry - virtual void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) = 0; - /// @} - - /// @brief Returns a pointer to GNEViewNet in which demand element element is located - GNEViewNet* getViewNet() const; - - /// @name members and functions relative to RouteCalculator isntance - /// @{ - - /// @brief create instance of RouteCalculator - static void createRouteCalculatorInstance(GNENet* net); - - /// @brief delete instance of RouteCalculator - static void deleteRouteCalculatorInstance(); - - /// @brief obtain instance of RouteCalculator - static RouteCalculator* getRouteCalculatorInstance(); - - /// @} - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * @return The boundary the object is within - */ - virtual Boundary getCenteringBoundary() const = 0; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - virtual void selectAttributeCarrier(bool changeFlag = true) = 0; - - /// @brief unselect attribute carrier using GUIGlobalSelection - virtual void unselectAttributeCarrier(bool changeFlag = true) = 0; - - /// @brief check if attribute carrier is selected - bool isAttributeCarrierSelected() const; - - /// @brief check if attribute carrier must be drawn using selecting color. - bool drawUsingSelectColor() const; - - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 - */ - virtual double getAttributeDouble(SumoXMLAttr key) const = 0; - - /**@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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /**@brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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 - */ - virtual void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; - - /* @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 - */ - virtual void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - virtual std::string getPopUpID() const = 0; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - virtual std::string getHierarchyName() const = 0; - /// @} - - /// @brief get first allowed vehicle lane - GNELane* getFirstAllowedVehicleLane() const; - - /// @brief get first allowed vehicle lane - GNELane* getLastAllowedVehicleLane() const; - -protected: - /// @brief The GNEViewNet this demand element element belongs - GNEViewNet* myViewNet; - - /// @brief demand element geometry (also called "stacked geometry") - GNEGeometry::Geometry myDemandElementGeometry; - - /// @brief demand element segment geometry (also called "stacked geometry") - GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry; - - /// @brief demand element spread geometry (Only used by vehicles and pedestrians) - GNEGeometry::Geometry mySpreadGeometry; - - /// @brief demand element spread segment geometry (Only used by vehicles and pedestrians) - GNEGeometry::SegmentGeometry mySpreadSegmentGeometry; - - /// @brief stacked label number - int myStackedLabelNumber; - - /// @name Functions relative to change values in setAttribute(...) - /// @{ - - /// @brief returns DemandElement ID - const std::string& getDemandElementID() const; - - /// @brief check if a new demand element ID is valid - bool isValidDemandElementID(const std::string& newID) const; - - /**@brief change ID of demand element - * @throw exception if exist already an demand element whith the same ID - * @throw exception if ID isn't valid - */ - void changeDemandElementID(const std::string& newID); - - /// @} - - /// @brief calculate personPlan start and end positions over lanes - void calculatePersonPlanLaneStartEndPos(double& startPos, double& endPos) const; - - /// @brief calculate personPlan start and end positions - void calculatePersonPlanPositionStartEndPos(Position& startPos, Position& endPos) const; - -private: - /**@brief check restriction with the number of children - * @throw ProcessError if itis called without be reimplemented in child class - */ - virtual bool checkChildDemandElementRestriction() const; - - /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) - virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; - - /// @brief RouteCalculator instance - static RouteCalculator* myRouteCalculatorInstance; - - /// @brief Invalidated copy constructor. - GNEDemandElement(const GNEDemandElement&) = delete; - - /// @brief Invalidated assignment operator. - GNEDemandElement& operator=(const GNEDemandElement&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPerson.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPerson.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPerson.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPerson.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,933 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPerson.cpp -/// @author Pablo Alvarez Lopez -/// @date May 2019 -/// -// Representation of persons in NETEDIT -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPerson.h" -#include "GNERouteHandler.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -FXDEFMAP(GNEPerson::GNEPersonPopupMenu) personPopupMenuMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_PERSON_TRANSFORM, GNEPerson::GNEPersonPopupMenu::onCmdTransform), -}; - -FXDEFMAP(GNEPerson::GNESelectedPersonsPopupMenu) selectedPersonsPopupMenuMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_PERSON_TRANSFORM, GNEPerson::GNESelectedPersonsPopupMenu::onCmdTransform), -}; - -// Object implementation -FXIMPLEMENT(GNEPerson::GNEPersonPopupMenu, GUIGLObjectPopupMenu, personPopupMenuMap, ARRAYNUMBER(personPopupMenuMap)) -FXIMPLEMENT(GNEPerson::GNESelectedPersonsPopupMenu, GUIGLObjectPopupMenu, selectedPersonsPopupMenuMap, ARRAYNUMBER(selectedPersonsPopupMenuMap)) - -// =========================================================================== -// GNEPerson::GNEPersonPopupMenu -// =========================================================================== - -GNEPerson::GNEPersonPopupMenu::GNEPersonPopupMenu(GNEPerson* person, GUIMainWindow& app, GUISUMOAbstractView& parent) : - GUIGLObjectPopupMenu(app, parent, *person), - myPerson(person), - myTransformToPerson(nullptr), - myTransformToPersonFlow(nullptr) { - // build header - myPerson->buildPopupHeader(this, app); - // build menu command for center button and copy cursor position to clipboard - myPerson->buildCenterPopupEntry(this); - myPerson->buildPositionCopyEntry(this, false); - // buld menu commands for names - new FXMenuCommand(this, ("Copy " + myPerson->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); - new FXMenuCommand(this, ("Copy " + myPerson->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); - new FXMenuSeparator(this); - // build selection and show parameters menu - myPerson->getViewNet()->buildSelectionACPopupEntry(this, myPerson); - myPerson->buildShowParamsPopupEntry(this); - // add transform functions only in demand mode - if (myPerson->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) { - // create menu pane for transform operations - FXMenuPane* transformOperation = new FXMenuPane(this); - this->insertMenuPaneChild(transformOperation); - new FXMenuCascade(this, "transform to", nullptr, transformOperation); - // Create menu comands for all transformations - myTransformToPerson = new FXMenuCommand(transformOperation, "Person", GUIIconSubSys::getIcon(ICON_PERSON), this, MID_GNE_PERSON_TRANSFORM); - myTransformToPersonFlow = new FXMenuCommand(transformOperation, "Person (embedded route)", GUIIconSubSys::getIcon(ICON_PERSONFLOW), this, MID_GNE_PERSON_TRANSFORM); - // check what menu command has to be disabled - if (myPerson->getTagProperty().getTag() == SUMO_TAG_PERSON) { - myTransformToPerson->disable(); - } else if (myPerson->getTagProperty().getTag() == SUMO_TAG_PERSONFLOW) { - myTransformToPersonFlow->disable(); - } - } -} - - -GNEPerson::GNEPersonPopupMenu::~GNEPersonPopupMenu() {} - - -long -GNEPerson::GNEPersonPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { - if (obj == myTransformToPerson) { - GNERouteHandler::transformToPerson(myPerson); - } else if (obj == myTransformToPersonFlow) { - GNERouteHandler::transformToPersonFlow(myPerson); - } - return 1; -} - - -// =========================================================================== -// GNEPerson::GNESelectedPersonsPopupMenu -// =========================================================================== - -GNEPerson::GNESelectedPersonsPopupMenu::GNESelectedPersonsPopupMenu(GNEPerson* person, const std::vector& selectedPerson, GUIMainWindow& app, GUISUMOAbstractView& parent) : - GUIGLObjectPopupMenu(app, parent, *person), - myPersonTag(person->getTagProperty().getTag()), - mySelectedPersons(selectedPerson), - myTransformToPerson(nullptr), - myTransformToPersonFlow(nullptr) { - // build header - person->buildPopupHeader(this, app); - // build menu command for center button and copy cursor position to clipboard - person->buildCenterPopupEntry(this); - person->buildPositionCopyEntry(this, false); - // buld menu commands for names - new FXMenuCommand(this, ("Copy " + person->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); - new FXMenuCommand(this, ("Copy " + person->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); - new FXMenuSeparator(this); - // build selection and show parameters menu - person->getViewNet()->buildSelectionACPopupEntry(this, person); - person->buildShowParamsPopupEntry(this); - // add transform functions only in demand mode - if (person->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) { - // create menu pane for transform operations - FXMenuPane* transformOperation = new FXMenuPane(this); - this->insertMenuPaneChild(transformOperation); - new FXMenuCascade(this, "transform to", nullptr, transformOperation); - // Create menu comands for all transformations - myTransformToPerson = new FXMenuCommand(transformOperation, "Person", GUIIconSubSys::getIcon(ICON_PERSON), this, MID_GNE_PERSON_TRANSFORM); - myTransformToPersonFlow = new FXMenuCommand(transformOperation, "PersonFlow", GUIIconSubSys::getIcon(ICON_PERSONFLOW), this, MID_GNE_PERSON_TRANSFORM); - } -} - - -GNEPerson::GNESelectedPersonsPopupMenu::~GNESelectedPersonsPopupMenu() {} - - -long -GNEPerson::GNESelectedPersonsPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { - // iterate over all selected persons - for (const auto& i : mySelectedPersons) { - if ((obj == myTransformToPerson) && - (i->getTagProperty().getTag() == myPersonTag)) { - GNERouteHandler::transformToPerson(i); - } else if ((obj == myTransformToPersonFlow) && - (i->getTagProperty().getTag() == myPersonTag)) { - GNERouteHandler::transformToPerson(i); - } - } - return 1; -} - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEPerson::GNEPerson(SumoXMLTag tag, GNEViewNet* viewNet, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters) : - GNEDemandElement(personparameters.id, viewNet, (tag == SUMO_TAG_PERSONFLOW) ? GLO_PERSONFLOW : GLO_PERSON, tag, -{}, {}, {}, {}, {pType}, {}, {}, {}, {}, {}), -SUMOVehicleParameter(personparameters) { - // set manually vtypeID (needed for saving) - vtypeid = pType->getID(); -} - - -GNEPerson::~GNEPerson() {} - - -std::string -GNEPerson::getBegin() const { - // obtain depart depending if is a Person, trip or routeFlow - std::string departStr; - if (myTagProperty.getTag() == SUMO_TAG_PERSONFLOW) { - departStr = toString(depart); - } else { - departStr = getDepart(); - } - // we need to handle depart as a tuple of 20 numbers (format: 000000...00) - departStr.reserve(20 - departStr.size()); - // add 0s at the beginning of departStr until we have 20 numbers - for (int i = (int)departStr.size(); i < 20; i++) { - departStr.insert(departStr.begin(), '0'); - } - return departStr; -} - - -void -GNEPerson::writeDemandElement(OutputDevice& device) const { - // obtain tag depending if tagProperty has a synonym - SumoXMLTag synonymTag = myTagProperty.hasTagSynonym() ? myTagProperty.getTagSynonym() : myTagProperty.getTag(); - // attribute VType musn't be written if is DEFAULT_PEDTYPE_ID - if (getParentDemandElements().at(0)->getID() == DEFAULT_PEDTYPE_ID) { - // unset VType parameter - parametersSet &= ~VEHPARS_VTYPE_SET; - // write person attributes (VType will not be written) - write(device, OptionsCont::getOptions(), synonymTag); - // set VType parameter again - parametersSet |= VEHPARS_VTYPE_SET; - } else { - // write person attributes, including VType - write(device, OptionsCont::getOptions(), synonymTag, getParentDemandElements().at(0)->getID()); - } - // write specific flow attributes - if (myTagProperty.getTag() == SUMO_TAG_PERSONFLOW) { - // write routeFlow values depending if it was set - if (isAttributeEnabled(SUMO_ATTR_END)) { - device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); - } - if (isAttributeEnabled(SUMO_ATTR_NUMBER)) { - device.writeAttr(SUMO_ATTR_NUMBER, repetitionNumber); - } - if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { - device.writeAttr(SUMO_ATTR_VEHSPERHOUR, 3600. / STEPS2TIME(repetitionOffset)); - } - if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { - device.writeAttr(SUMO_ATTR_PERIOD, time2string(repetitionOffset)); - } - if (isAttributeEnabled(SUMO_ATTR_PROB)) { - device.writeAttr(SUMO_ATTR_PROB, repetitionProbability); - } - } - // write parameters - writeParams(device); - // write child demand elements associated to this person (Rides, Walks...) - for (const auto& i : getChildDemandElements()) { - i->writeDemandElement(device); - } - // close person tag - device.closeTag(); -} - - -bool -GNEPerson::isDemandElementValid() const { - // a single person is always valid - return true; -} - - -std::string -GNEPerson::getDemandElementProblem() const { - // A single person cannot habe problem (but their children) - return ""; -} - - -void -GNEPerson::fixDemandElementProblem() { - // nothing to fix -} - - -GNEEdge* -GNEPerson::getFromEdge() const { - return getChildDemandElements().front()->getFromEdge(); -} - - -GNEEdge* -GNEPerson::getToEdge() const { - return getChildDemandElements().front()->getToEdge(); -} - - -SUMOVehicleClass -GNEPerson::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEPerson::getColor() const { - return color; -} - - -void -GNEPerson::startGeometryMoving() { - // Persons cannot be moved -} - - -void -GNEPerson::endGeometryMoving() { - // Persons cannot be moved -} - - -void -GNEPerson::moveGeometry(const Position&) { - // Persons cannot be moved -} - - -void -GNEPerson::commitGeometryMoving(GNEUndoList*) { - // Persons cannot be moved -} - - -void -GNEPerson::updateGeometry() { - // only update geometry of childrens - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - -void -GNEPerson::updateDottedContour() { - // -} - - -void -GNEPerson::updatePartialGeometry(const GNEEdge* edge) { - // only update partial geometry of childrens - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNEPerson::computePath() { - // nothing to compute -} - - -void -GNEPerson::invalidatePath() { - // nothing to invalidate -} - - -Position -GNEPerson::getPositionInView() const { - // Position in view depend of first child element - if (getChildDemandElements().size() > 0) { - if (getChildDemandElements().at(0)->getTagProperty().isPersonStop()) { - return getChildDemandElements().at(0)->getDemandElementGeometry().getShape().getLineCenter(); - } else { - // obtain lane (special case for rides) - SUMOVehicleClass vClassEdgeFrom = getChildDemandElements().front()->getTagProperty().isRide() ? SVC_PASSENGER : SVC_PEDESTRIAN; - GNELane* lane = getChildDemandElements().at(0)->getParentEdges().at(0)->getLaneByAllowedVClass(vClassEdgeFrom); - // return position in view depending of lane - if (lane->getLaneShape().length() < 2.5) { - return lane->getLaneShape().front(); - } else { - Position A = lane->getLaneShape().positionAtOffset(2.5); - Position B = lane->getLaneShape().positionAtOffset(2.5); - // return Middle point - return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); - } - } - } else { - return Position(0, 0); - } -} - - -GUIGLObjectPopupMenu* -GNEPerson::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - // return a GNEPersonPopupMenu - return new GNEPersonPopupMenu(this, app, parent); -} - - -std::string -GNEPerson::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -Boundary -GNEPerson::getCenteringBoundary() const { - Boundary personBoundary; - if (getChildDemandElements().size() > 0) { - personBoundary.add(getChildDemandElements().front()->getCenteringBoundary()); - } else { - personBoundary = Boundary(-0.1, -0.1, 0.1, 0.1); - } - personBoundary.grow(20); - return personBoundary; -} - - -void -GNEPerson::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEPerson::drawGL(const GUIVisualizationSettings& s) const { - bool drawPerson = true; - // check if person can be drawn - if (!myViewNet->getNetworkViewOptions().showDemandElements()) { - drawPerson = false; - } else if (!myViewNet->getDemandViewOptions().showNonInspectedDemandElements(this)) { - drawPerson = false; - } else if (getChildDemandElements().empty()) { - drawPerson = false; - } - // continue if person can be drawn - if (drawPerson) { - // obtain exaggeration (and add the special personExaggeration) - const double exaggeration = s.personSize.getExaggeration(s, this, 80) + s.detailSettings.personExaggeration; - // obtain width and length - const double length = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_LENGTH); - const double width = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_WIDTH); - // obtain diameter around person (used to calculate distance bewteen cursor and person) - const double distanceSquared = pow(exaggeration * std::max(length, width), 2); - // obtain img file - const std::string file = getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_IMGFILE); - Position personPosition; - // obtain position depending of first PersonPlan child - if (getChildDemandElements().front()->getTagProperty().isPersonStop()) { - // obtain position of stop center - personPosition = getChildDemandElements().front()->getPositionInView(); - } else { - // obtain position of first edge - personPosition = getChildDemandElements().front()->getDemandElementSegmentGeometry().getFirstPosition(); - } - // check that position is valid and person can be drawn - if ((personPosition != Position::INVALID) && - !(s.drawForPositionSelection && (personPosition.distanceSquaredTo(myViewNet->getPositionInformation()) > distanceSquared))) { - // push GL ID - glPushName(getGlID()); - // push draw matrix - glPushMatrix(); - // translate and rotate - glTranslated(personPosition.x(), personPosition.y(), getType()); - glRotated(90, 0, 0, 1); - // set person color - setColor(s); - // set scale - 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); - } else if (s.drawDetail(s.detailSettings.personCircles, exaggeration)) { - GUIBasePersonHelper::drawAction_drawAsCircle(length, width); - } else if (s.drawDetail(s.detailSettings.personTriangles, exaggeration)) { - GUIBasePersonHelper::drawAction_drawAsTriangle(0, length, width); - } - // pop matrix - glPopMatrix(); - drawName(personPosition, s.scale, s.personName, s.angle); - if (s.personValue.show) { - 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()); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GLHelper::drawShapeDottedContourRectangle(s, getType(), personPosition, exaggeration, exaggeration); - } - // pop name - glPopName(); - } - } -} - - -void -GNEPerson::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEPerson::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEPerson::getAttribute(SumoXMLAttr key) const { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_TYPE: - return getParentDemandElements().at(0)->getID(); - case SUMO_ATTR_COLOR: - if (wasSet(VEHPARS_COLOR_SET)) { - return toString(color); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_COLOR); - } - case SUMO_ATTR_DEPARTPOS: - if (wasSet(VEHPARS_DEPARTPOS_SET)) { - return getDepartPos(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS); - } - // Specific of persons - case SUMO_ATTR_DEPART: - return toString(depart); - // Specific of personFlows - case SUMO_ATTR_BEGIN: - return time2string(depart); - case SUMO_ATTR_END: - return time2string(repetitionEnd); - case SUMO_ATTR_VEHSPERHOUR: - return toString(3600 / STEPS2TIME(repetitionOffset)); - case SUMO_ATTR_PERIOD: - return time2string(repetitionOffset); - case SUMO_ATTR_PROB: - return toString(repetitionProbability); - case SUMO_ATTR_NUMBER: - return toString(repetitionNumber); - // - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEPerson::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_DEPARTPOS: - if (departPosProcedure == DEPART_POS_GIVEN) { - return departPos; - } else { - return 0; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPerson::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: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_DEPARTPOS: - // Specific of persons - case SUMO_ATTR_DEPART: - // Specific of personFlows - case SUMO_ATTR_BEGIN: - case SUMO_ATTR_END: - case SUMO_ATTR_NUMBER: - case SUMO_ATTR_VEHSPERHOUR: - case SUMO_ATTR_PERIOD: - case SUMO_ATTR_PROB: - // - case GNE_ATTR_PARAMETERS: - case GNE_ATTR_SELECTED: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEPerson::isValid(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_ID: - // Persons and personflows share namespace - if (SUMOXMLDefinitions::isValidVehicleID(value) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_PERSON, value, false) == nullptr) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) == nullptr)) { - return true; - } else { - return false; - } - case SUMO_ATTR_TYPE: - return SUMOXMLDefinitions::isValidTypeID(value) && (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_DEPARTPOS: { - double dummyDepartPos; - DepartPosDefinition dummyDepartPosProcedure; - parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPos, dummyDepartPosProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - // Specific of persons - case SUMO_ATTR_DEPART: { - if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - } - // Specific of personflows - case SUMO_ATTR_BEGIN: - if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_END: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_VEHSPERHOUR: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) > 0); - } else { - return false; - } - case SUMO_ATTR_PERIOD: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) > 0); - } else { - return false; - } - case SUMO_ATTR_PROB: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_NUMBER: - if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - // - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -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, myViewNet->getNet(), parametersSet, newParametersSet), true); -} - - -void -GNEPerson::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // nothing to disable -} - - -bool -GNEPerson::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_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; - default: - return true; - } -} - - -std::string -GNEPerson::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEPerson::getHierarchyName() const { - // special case for Trips and flow - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // check if we're inspecting a Edge - if (myViewNet->getNet()->getViewNet()->getDottedAC() && - myViewNet->getNet()->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_EDGE) { - // check if edge correspond to a "from", "to" or "via" edge - if (getParentEdges().front() == myViewNet->getNet()->getViewNet()->getDottedAC()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (from)"; - } else if (getParentEdges().front() == myViewNet->getNet()->getViewNet()->getDottedAC()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (to)"; - } else { - // iterate over via - for (const auto& i : via) { - if (i == myViewNet->getNet()->getViewNet()->getDottedAC()->getID()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (via)"; - } - } - } - } - } - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID); -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEPerson::setColor(const GUIVisualizationSettings& s) const { - const GUIColorer& c = s.personColorer; - if (!setFunctionalColor(c.getActive())) { - GLHelper::setColor(c.getScheme().getColor(getColorValue(s, c.getActive()))); - } -} - - -bool -GNEPerson::setFunctionalColor(int /* activeScheme */) const { - /* - switch (activeScheme) { - case 0: { - if (getParameter().wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(getParameter().color); - return true; - } - if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { - GLHelper::setColor(getVehicleType().getColor()); - return true; - } - return false; - } - case 2: { - if (getParameter().wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(getParameter().color); - return true; - } - return false; - } - case 3: { - if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { - GLHelper::setColor(getVehicleType().getColor()); - return true; - } - return false; - } - case 8: { // color by angle - double hue = GeomHelper::naviDegree(getAngle()); - GLHelper::setColor(RGBColor::fromHSV(hue, 1., 1.)); - return true; - } - case 9: { // color randomly (by pointer) - const double hue = (long)this % 360; // [0-360] - const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1] - GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); - return true; - } - default: - return false; - } - */ - return false; -} - -// =========================================================================== -// private -// =========================================================================== - -GNEPerson::personPlanSegment::personPlanSegment(GNEDemandElement* _personPlan) : - personPlan(_personPlan), - edge(nullptr), - arrivalPos(-1) { -} - - -GNEPerson::personPlanSegment::personPlanSegment() : - personPlan(nullptr), - edge(nullptr), - arrivalPos(-1) { -} - - -void -GNEPerson::setAttribute(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_ID: - changeDemandElementID(value); - break; - case SUMO_ATTR_TYPE: - replaceParentDemandElement(this, value, 0); - // set manually vtypeID (needed for saving) - vtypeid = value; - break; - case SUMO_ATTR_COLOR: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - color = parse(value); - // mark parameter as set - parametersSet |= VEHPARS_COLOR_SET; - } else { - // set default value - color = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VEHPARS_COLOR_SET; - } - break; - case SUMO_ATTR_DEPARTPOS: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_DEPARTPOS_SET; - } else { - // set default value - parseDepartPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_DEPARTPOS_SET; - } - // compute person - updateGeometry(); - break; - // Specific of persons - case SUMO_ATTR_DEPART: { - std::string oldDepart = getBegin(); - parseDepart(value, toString(SUMO_TAG_VEHICLE), id, depart, departProcedure, error); - myViewNet->getNet()->updateDemandElementBegin(oldDepart, this); - break; - } - // Specific of personFlows - case SUMO_ATTR_BEGIN: { - std::string oldBegin = getBegin(); - depart = string2time(value); - myViewNet->getNet()->updateDemandElementBegin(oldBegin, this); - break; - } - case SUMO_ATTR_END: - repetitionEnd = string2time(value); - break; - case SUMO_ATTR_VEHSPERHOUR: - repetitionOffset = TIME2STEPS(3600 / parse(value)); - break; - case SUMO_ATTR_PERIOD: - repetitionOffset = string2time(value); - break; - case SUMO_ATTR_PROB: - repetitionProbability = parse(value); - break; - case SUMO_ATTR_NUMBER: - repetitionNumber = parse(value); - break; - // - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPerson::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPerson.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPerson.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPerson.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPerson.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,331 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPerson.h -/// @author Pablo Alvarez Lopez -/// @date May 2019 -/// -// Representation of persons in NETEDIT -/****************************************************************************/ -#ifndef GNEPerson_h -#define GNEPerson_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include - - -#include "GNEDemandElement.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPerson - */ -class GNEPerson : public GNEDemandElement, public SUMOVehicleParameter { - -public: - /// @brief class used in GUIGLObjectPopupMenu for person transformations - class GNEPersonPopupMenu : public GUIGLObjectPopupMenu { - FXDECLARE(GNEPersonPopupMenu) - - public: - /** @brief Constructor - * @param[in] person GNEPerson to be transformed - * @param[in] app The main window for instantiation of other windows - * @param[in] parent The parent view for changing it - */ - GNEPersonPopupMenu(GNEPerson* person, GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief Destructor - ~GNEPersonPopupMenu(); - - /// @brief Called to transform the current person to another person type - long onCmdTransform(FXObject* obj, FXSelector, void*); - - protected: - /// @brief default constructor needed by FOX - GNEPersonPopupMenu() { } - - private: - /// @brief current person - GNEPerson* myPerson; - - /// @brief menu command for transform to person - FXMenuCommand* myTransformToPerson; - - /// @brief menu command for transform to personFlow - FXMenuCommand* myTransformToPersonFlow; - }; - - /// @brief class used in GUIGLObjectPopupMenu for single person transformations - class GNESelectedPersonsPopupMenu : public GUIGLObjectPopupMenu { - FXDECLARE(GNESelectedPersonsPopupMenu) - - public: - /** @brief Constructor - * @param[in] person clicked GNEPerson - * @param[in] selectedPerson vector with selected GNEPerson - * @param[in] app The main window for instantiation of other windows - * @param[in] parent The parent view for changing it - */ - GNESelectedPersonsPopupMenu(GNEPerson* person, const std::vector& selectedPerson, GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief Destructor - ~GNESelectedPersonsPopupMenu(); - - /// @brief Called to transform the current person to another person type - long onCmdTransform(FXObject* obj, FXSelector, void*); - - protected: - /// @brief default constructor needed by FOX - GNESelectedPersonsPopupMenu() { } - - private: - /// @brief tag of clicked person - SumoXMLTag myPersonTag; - - /// @brief current selected persons - std::vector mySelectedPersons; - - /// @brief menu command for transform to person - FXMenuCommand* myTransformToPerson; - - /// @brief menu command for transform to personFlow - FXMenuCommand* myTransformToPersonFlow; - }; - - /// @brief constructor for persons - GNEPerson(SumoXMLTag tag, GNEViewNet* viewNet, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters); - - /// @brief destructor - ~GNEPerson(); - - /**@brief get begin time of demand element - * @note: used by demand elements of type "Person", 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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 start geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of demand element in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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; - /// @} - -protected: - /// @brief sets the color according to the currente settings - void setColor(const GUIVisualizationSettings& s) const; - - /// @brief sets the color according to the current scheme index and some vehicle function - bool setFunctionalColor(int activeScheme) const; - -private: - // @brief struct used for calculating person plan geometry segments - struct personPlanSegment { - /// @brief parameter constructor - personPlanSegment(GNEDemandElement* _personPlan); - - /// @brief person plan - const GNEDemandElement* personPlan; - - /// @brief edge - GNEEdge* edge; - - /// @brief busStops placed in this segment - std::vector busStops; - - /// @brief stops placed in this segment - std::vector stops; - - /// @brief arrival position - double arrivalPos; - - private: - /// @brief constructor - personPlanSegment(); - }; - - /// @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 Invalidated copy constructor. - GNEPerson(const GNEPerson&) = delete; - - /// @brief Invalidated assignment operator - GNEPerson& operator=(const GNEPerson&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,650 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonTrip.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing person trips in Netedit -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPersonTrip.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEPersonTrip::GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, - double arrivalPosition, const std::vector& types, const std::vector& modes) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_PERSONTRIP_FROMTO), viewNet, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_FROMTO, { - fromEdge, toEdge -}, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(arrivalPosition), -myVTypes(types), -myModes(modes) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute person trip - computePath(); -} - - -GNEPersonTrip::GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via, - const std::vector& types, const std::vector& modes) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_PERSONTRIP_BUSSTOP), viewNet, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_BUSSTOP, { - fromEdge -}, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(-1), -myVTypes(types), -myModes(modes) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute person trip - computePath(); -} - - -GNEPersonTrip::~GNEPersonTrip() {} - - -GUIGLObjectPopupMenu* -GNEPersonTrip::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open demand element dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - return ret; -} - - -void -GNEPersonTrip::writeDemandElement(OutputDevice& device) const { - // open tag - device.openTag(SUMO_TAG_PERSONTRIP); - // only write From attribute if this is the first Person Plan - if (getParentDemandElements().front()->getChildDemandElements().front() == this) { - device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); - } - // check if write busStop or edge to - if (getParentAdditionals().size() > 0) { - device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); - } else { - device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); - } - // write modes - if (myModes.size() > 0) { - device.writeAttr(SUMO_ATTR_MODES, myModes); - } - // write vTypes - if (myVTypes.size() > 0) { - device.writeAttr(SUMO_ATTR_VTYPES, myVTypes); - } - // only write arrivalPos if is different of -1 - if (myArrivalPosition != -1) { - device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); - } - // write parameters - writeParams(device); - // close tag - device.closeTag(); -} - - -bool -GNEPersonTrip::isDemandElementValid() const { - if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { - // from and to are the same edges - return true; - } else if (getPathEdges().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - } else { - return false; - } -} - - -std::string -GNEPersonTrip::getDemandElementProblem() const { - if (getParentEdges().size() == 0) { - return ("A person trip need at least one edge"); - } else { - // check if exist at least a connection between every edge - for (int i = 1; i < (int)getParentEdges().size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { - return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } -} - - -void -GNEPersonTrip::fixDemandElementProblem() { - // currently the only solution is removing PersonTrip -} - - -GNEEdge* -GNEPersonTrip::getFromEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getFromEdge(); - } else { - return getParentEdges().front(); - } -} - - -GNEEdge* -GNEPersonTrip::getToEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getToEdge(); - } else { - return getParentEdges().back(); - } -} - - -SUMOVehicleClass -GNEPersonTrip::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEPersonTrip::getColor() const { - return getParentDemandElements().front()->getColor(); -} - - -void -GNEPersonTrip::startGeometryMoving() { - // only start geometry moving if arrival position isn't -1 - if (myArrivalPosition != -1) { - // always save original position over view - myPersonTripMove.originalViewPosition = getPositionInView(); - // save arrival position - myPersonTripMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); - // save current centering boundary - myPersonTripMove.movingGeometryBoundary = getCenteringBoundary(); - } -} - - -void -GNEPersonTrip::endGeometryMoving() { - // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once - if ((myArrivalPosition != -1) && myPersonTripMove.movingGeometryBoundary.isInitialised()) { - // reset myMovingGeometryBoundary - myPersonTripMove.movingGeometryBoundary.reset(); - } -} - - -void -GNEPersonTrip::moveGeometry(const Position& offset) { - // only move if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - // Calculate new position using old position - Position newPosition = myPersonTripMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - // obtain lane shape (to improve code legibility) - const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); - // calculate offset lane - double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myPersonTripMove.originalViewPosition, false); - std::cout << offsetLane << std::endl; - // Update arrival Position - myArrivalPosition = parse(myPersonTripMove.firstOriginalLanePosition) + offsetLane; - // Update geometry - updateGeometry(); - } -} - - -void -GNEPersonTrip::commitGeometryMoving(GNEUndoList* undoList) { - // only commit geometry moving if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - undoList->p_begin("arrivalPos of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), true, myPersonTripMove.firstOriginalLanePosition)); - undoList->p_end(); - } -} - - -void -GNEPersonTrip::updateGeometry() { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // calculate geometry path - if (getPathEdges().size() > 0) { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } else { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - - -void -GNEPersonTrip::updateDottedContour() { - // -} - - -void -GNEPersonTrip::updatePartialGeometry(const GNEEdge* edge) { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // calculate geometry path - GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNEPersonTrip::computePath() { - if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) { - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentEdges())); - } else if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); - } - // update geometry - updateGeometry(); -} - - -void -GNEPersonTrip::invalidatePath() { - if ((myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) || (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP)) { - // calculate route and update routeEdges - replacePathEdges(this, getParentEdges()); - } else if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, fromViaBusStopEdges); - } - // update geometry - updateGeometry(); -} - - -Position -GNEPersonTrip::getPositionInView() const { - return Position(); -} - - -std::string -GNEPersonTrip::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -Boundary -GNEPersonTrip::getCenteringBoundary() const { - Boundary personTripBoundary; - // return the combination of all parent edges's boundaries - for (const auto& i : getParentEdges()) { - personTripBoundary.add(i->getCenteringBoundary()); - } - // check if is valid - if (personTripBoundary.isInitialised()) { - return personTripBoundary; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNEPersonTrip::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEPersonTrip::drawGL(const GUIVisualizationSettings& /*s*/) const { - // PersonTrips are drawn in GNEEdges -} - - -void -GNEPersonTrip::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEPersonTrip::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEPersonTrip::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_FROM: - return getParentEdges().front()->getID(); - case SUMO_ATTR_TO: - return getParentEdges().back()->getID(); - case SUMO_ATTR_VIA: - return toString(getMiddleParentEdges()); - case SUMO_ATTR_BUS_STOP: - return getParentAdditionals().front()->getID(); - case SUMO_ATTR_MODES: - return joinToString(myModes, " "); - case SUMO_ATTR_VTYPES: - return joinToString(myVTypes, " "); - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition == -1) { - return ""; - } else { - return toString(myArrivalPosition); - } - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_PARENT: - return getParentDemandElements().front()->getID(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEPersonTrip::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition != -1) { - return myArrivalPosition; - } else { - return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPersonTrip::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_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_VIA: - case SUMO_ATTR_BUS_STOP: - case SUMO_ATTR_MODES: - case SUMO_ATTR_VTYPES: - case SUMO_ATTR_ARRIVALPOS: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEPersonTrip::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - return SUMOXMLDefinitions::isValidNetID(value) && (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_VIA: - if (value.empty()) { - return true; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_BUS_STOP: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); - case SUMO_ATTR_MODES: { - SVCPermissions dummyModeSet; - std::string dummyError; - return SUMOVehicleParameter::parsePersonModes(value, myTagProperty.getTagStr(), getID(), dummyModeSet, dummyError); - } - case SUMO_ATTR_VTYPES: - return canParse >(value); - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - const double parsedValue = canParse(value); - if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { - return false; - } else { - return true; - } - } else { - return false; - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPersonTrip::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNEPersonTrip::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -bool -GNEPersonTrip::isAttributeEnabled(SumoXMLAttr /*key*/) const { - return true; -} - - -std::string -GNEPersonTrip::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEPersonTrip::getHierarchyName() const { - if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) { - return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); - } else { - return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - // Specific of Trips and flow - case SUMO_ATTR_FROM: { - // change first edge - replaceFirstParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute person trip - computePath(); - break; - } - case SUMO_ATTR_TO: { - // change last edge - replaceLastParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute person trip - computePath(); - break; - } - case SUMO_ATTR_VIA: { - // update via - replaceMiddleParentEdges(this, parse >(myViewNet->getNet(), value), true); - // compute person trip - computePath(); - break; - } - case SUMO_ATTR_BUS_STOP: - replaceParentAdditional(this, value, 0); - // compute person trip - computePath(); - break; - case SUMO_ATTR_MODES: - myModes = GNEAttributeCarrier::parse >(value); - break; - case SUMO_ATTR_VTYPES: - myVTypes = GNEAttributeCarrier::parse >(value); - break; - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - myArrivalPosition = -1; - } else { - myArrivalPosition = parse(value); - } - updateGeometry(); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEPersonTrip::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEPersonTrip.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,262 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonTrip.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing person trips in Netedit -/****************************************************************************/ -#ifndef GNEPersonTrip_h -#define GNEPersonTrip_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDemandElement.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNEConnection; -class GNEVehicle; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEPersonTrip : public GNEDemandElement, public Parameterised { - -public: - /**@brief parameter constructor for person tripEdges - * @param[in] viewNet view in which this PersonTrip is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this person trip - * @param[in] arrivalPosition arrival position on the destination edge - * @param[in] types list of possible vehicle types to take - * @param[in] modes list of possible traffic modes - */ - GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, - const std::vector& via, double arrivalPosition, const std::vector& types, - const std::vector& modes); - - /**@brief parameter constructor for person tripBusStop - * @param[in] viewNet view in which this PersonTrip is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this person trip - * @param[in] busStop destination busStop - * @param[in] types list of possible vehicle types to take - * @param[in] modes list of possible traffic modes - */ - GNEPersonTrip(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, - const std::vector& via, const std::vector& types, const std::vector& modes); - - /// @brief destructor - ~GNEPersonTrip(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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; - /// @} - -protected: - /// @brief variable for move person trips - DemandElementMove myPersonTripMove; - - /// @brief arrival position - double myArrivalPosition; - - /// @brief valid line or vehicle types - std::vector myVTypes; - - /// @brief valid line or modes - std::vector myModes; - -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 Invalidated copy constructor. - GNEPersonTrip(GNEPersonTrip*) = delete; - - /// @brief Invalidated assignment operator. - GNEPersonTrip& operator=(GNEPersonTrip*) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERide.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERide.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERide.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERide.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,627 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERide.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing rides in Netedit -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNERide.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNERide::GNERide(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, - double arrivalPosition, const std::vector& lines) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_RIDE_FROMTO), viewNet, GLO_RIDE, SUMO_TAG_RIDE_FROMTO, { - fromEdge, toEdge -}, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(arrivalPosition), -myLines(lines) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute ride - computePath(); -} - - -GNERide::GNERide(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via, - const std::vector& lines) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_RIDE_BUSSTOP), viewNet, GLO_RIDE, SUMO_TAG_RIDE_BUSSTOP, { - fromEdge -}, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(-1), -myLines(lines) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute ride - computePath(); -} - - -GNERide::~GNERide() {} - - -GUIGLObjectPopupMenu* -GNERide::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open demand element dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - return ret; -} - - -void -GNERide::writeDemandElement(OutputDevice& device) const { - // open tag - device.openTag(SUMO_TAG_RIDE); - // write attributes depending of ride type - if (getParentDemandElements().front()->getChildDemandElements().front() == this) { - device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); - } - // check if write busStop or edge to - if (getParentAdditionals().size() > 0) { - device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); - } else { - device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); - } - // only write arrivalPos if is different of -1 - if (myArrivalPosition != -1) { - device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); - } - // write parameters - writeParams(device); - // close tag - device.closeTag(); -} - - -bool -GNERide::isDemandElementValid() const { - if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { - // from and to are the same edges - return true; - } else if (getPathEdges().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - } else { - return false; - } -} - - -std::string -GNERide::getDemandElementProblem() const { - if (getParentEdges().size() == 0) { - return ("A ride need at least one edge"); - } else { - // check if exist at least a connection between every edge - for (int i = 1; i < (int)getParentEdges().size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { - return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } -} - - -void -GNERide::fixDemandElementProblem() { - // currently the only solution is removing Ride -} - - -GNEEdge* -GNERide::getFromEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getFromEdge(); - } else { - return getParentEdges().front(); - } -} - - -GNEEdge* -GNERide::getToEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getToEdge(); - } else { - return getParentEdges().back(); - } -} - - -SUMOVehicleClass -GNERide::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNERide::getColor() const { - return getParentDemandElements().front()->getColor(); -} - - -void -GNERide::startGeometryMoving() { - // only start geometry moving if arrival position isn't -1 - if (myArrivalPosition != -1) { - // always save original position over view - myRideMove.originalViewPosition = getPositionInView(); - // save arrival position - myRideMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); - // save current centering boundary - myRideMove.movingGeometryBoundary = getCenteringBoundary(); - } -} - - -void -GNERide::endGeometryMoving() { - // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once - if ((myArrivalPosition != -1) && myRideMove.movingGeometryBoundary.isInitialised()) { - // reset myMovingGeometryBoundary - myRideMove.movingGeometryBoundary.reset(); - } -} - - -void -GNERide::moveGeometry(const Position& offset) { - // only move if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - // Calculate new position using old position - Position newPosition = myRideMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - // obtain lane shape (to improve code legibility) - const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); - // calculate offset lane - double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myRideMove.originalViewPosition, false); - std::cout << offsetLane << std::endl; - // Update arrival Position - myArrivalPosition = parse(myRideMove.firstOriginalLanePosition) + offsetLane; - // Update geometry - updateGeometry(); - } -} - - -void -GNERide::commitGeometryMoving(GNEUndoList* undoList) { - // only commit geometry moving if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - undoList->p_begin("arrivalPos of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), true, myRideMove.firstOriginalLanePosition)); - undoList->p_end(); - } -} - - -void -GNERide::updateGeometry() { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // calculate geometry path - if (getPathEdges().size() > 0) { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } else { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - -void -GNERide::updateDottedContour() { - // -} - - -void -GNERide::updatePartialGeometry(const GNEEdge* edge) { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // calculate geometry path - GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNERide::computePath() { - if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentEdges())); - } else if (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); - } - // update geometry - updateGeometry(); -} - - -void -GNERide::invalidatePath() { - if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { - // calculate route and update routeEdges - replacePathEdges(this, getParentEdges()); - } else if (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, fromViaBusStopEdges); - } - // update geometry - updateGeometry(); -} - - -Position -GNERide::getPositionInView() const { - return Position(); -} - - -std::string -GNERide::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -Boundary -GNERide::getCenteringBoundary() const { - Boundary rideBoundary; - // return the combination of all parent edges's boundaries - for (const auto& i : getParentEdges()) { - rideBoundary.add(i->getCenteringBoundary()); - } - // check if is valid - if (rideBoundary.isInitialised()) { - return rideBoundary; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNERide::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNERide::drawGL(const GUIVisualizationSettings& /*s*/) const { - // Rides are drawn in GNEEdges -} - - -void -GNERide::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNERide::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNERide::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_FROM: - return getParentEdges().front()->getID(); - case SUMO_ATTR_TO: - return getParentEdges().back()->getID(); - case SUMO_ATTR_VIA: - return toString(getMiddleParentEdges()); - case SUMO_ATTR_BUS_STOP: - return getParentAdditionals().front()->getID(); - case SUMO_ATTR_LINES: - return joinToString(myLines, " "); - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition == -1) { - return ""; - } else { - return toString(myArrivalPosition); - } - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_PARENT: - return getParentDemandElements().front()->getID(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERide::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition != -1) { - return myArrivalPosition; - } else { - return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERide::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_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_VIA: - case SUMO_ATTR_BUS_STOP: - case SUMO_ATTR_LINES: - case SUMO_ATTR_ARRIVALPOS: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERide::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - return SUMOXMLDefinitions::isValidNetID(value) && (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_VIA: - if (value.empty()) { - return true; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_BUS_STOP: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); - case SUMO_ATTR_LINES: - return canParse >(value); - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - const double parsedValue = canParse(value); - if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { - return false; - } else { - return true; - } - } else { - return false; - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERide::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNERide::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -bool -GNERide::isAttributeEnabled(SumoXMLAttr /*key*/) const { - return true; -} - - -std::string -GNERide::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNERide::getHierarchyName() const { - if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { - return "ride: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); - } else { - return "ride: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNERide::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - // Specific of Trips and flow - case SUMO_ATTR_FROM: { - // change first edge - replaceFirstParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute ride - computePath(); - break; - } - case SUMO_ATTR_TO: { - // change last edge - replaceLastParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute ride - computePath(); - break; - } - case SUMO_ATTR_VIA: { - // update via - replaceMiddleParentEdges(this, parse >(myViewNet->getNet(), value), true); - // compute ride - computePath(); - break; - } - case SUMO_ATTR_BUS_STOP: - replaceParentAdditional(this, value, 0); - // compute ride - computePath(); - break; - case SUMO_ATTR_LINES: - myLines = GNEAttributeCarrier::parse >(value); - break; - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - myArrivalPosition = -1; - } else { - myArrivalPosition = parse(value); - } - updateGeometry(); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERide::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERide.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERide.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERide.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERide.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,254 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERide.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing rides in Netedit -/****************************************************************************/ -#ifndef GNERide_h -#define GNERide_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDemandElement.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNEConnection; -class GNEVehicle; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNERide : public GNEDemandElement, public Parameterised { - -public: - /**@brief parameter constructor for rideEdges - * @param[in] viewNet view in which this Ride is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this ride - * @param[in] arrivalPosition arrival position on the destination edge - */ - GNERide(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, - const std::vector& via, double arrivalPosition, const std::vector& lines); - - /**@brief parameter constructor for rideBusStop - * @param[in] viewNet view in which this Ride is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this ride - * @param[in] busStop destination busStop - */ - GNERide(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, - const std::vector& via, const std::vector& lines); - - /// @brief destructor - ~GNERide(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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; - /// @} - -protected: - /// @brief variable for move rides - DemandElementMove myRideMove; - - /// @brief arrival position - double myArrivalPosition; - - /// @brief valid line or vehicle ids or ANY - std::vector myLines; - -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 Invalidated copy constructor. - GNERide(GNERide*) = delete; - - /// @brief Invalidated assignment operator. - GNERide& operator=(GNERide*) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERoute.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERoute.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERoute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERoute.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,540 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERoute.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// A class for visualizing routes in Netedit -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNERoute.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTE_APPLY_DISTANCE, GNERoute::GNERoutePopupMenu::onCmdApplyDistance), -}; - -// Object implementation -FXIMPLEMENT(GNERoute::GNERoutePopupMenu, GUIGLObjectPopupMenu, GNERoutePopupMenuMap, ARRAYNUMBER(GNERoutePopupMenuMap)) - -// =========================================================================== -// GNERoute::GNERoutePopupMenu - methods -// =========================================================================== - -GNERoute::GNERoutePopupMenu::GNERoutePopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o) : - GUIGLObjectPopupMenu(app, parent, o) { -} - - -GNERoute::GNERoutePopupMenu::~GNERoutePopupMenu() {} - - -long -GNERoute::GNERoutePopupMenu::onCmdApplyDistance(FXObject*, FXSelector, void*) { - GNERoute* route = static_cast(myObject); - GNEViewNet* viewNet = static_cast(myParent); - GNEUndoList* undoList = route->myViewNet->getUndoList(); - undoList->p_begin("apply distance along route"); - double dist = (route->getParentEdges().size() > 0) ? route->getParentEdges().front()->getNBEdge()->getDistance() : 0; - for (GNEEdge* edge : route->getParentEdges()) { - undoList->p_add(new GNEChange_Attribute(edge, viewNet->getNet(), SUMO_ATTR_DISTANCE, toString(dist), true, edge->getAttribute(SUMO_ATTR_DISTANCE))); - dist += edge->getNBEdge()->getFinalLength(); - } - undoList->p_end(); - return 1; -} - -// =========================================================================== -// GNERoute - methods -// =========================================================================== - -GNERoute::GNERoute(GNEViewNet* viewNet) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE), viewNet, GLO_ROUTE, SUMO_TAG_ROUTE, -{}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -Parameterised(), -myColor(RGBColor::YELLOW), -myVClass(SVC_PASSENGER) { -} - - -GNERoute::GNERoute(GNEViewNet* viewNet, const GNERouteHandler::RouteParameter& routeParameters) : - GNEDemandElement(routeParameters.routeID, viewNet, GLO_ROUTE, SUMO_TAG_ROUTE, - routeParameters.edges, {}, {}, {}, {}, {}, {}, {}, {}, {}), -Parameterised(routeParameters.parameters), -myColor(routeParameters.color), -myVClass(routeParameters.vClass) { -} - - -GNERoute::GNERoute(GNEViewNet* viewNet, GNEDemandElement* vehicleParent, const GNERouteHandler::RouteParameter& routeParameters) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_EMBEDDEDROUTE), viewNet, GLO_EMBEDDEDROUTE, SUMO_TAG_EMBEDDEDROUTE, - routeParameters.edges, {}, {}, {}, {vehicleParent}, {}, {}, {}, {}, {}), -Parameterised(routeParameters.parameters), -myColor(routeParameters.color), -myVClass(routeParameters.vClass) { -} - - -GNERoute::GNERoute(GNEDemandElement* route) : - GNEDemandElement(route->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE), route->getViewNet(), GLO_ROUTE, SUMO_TAG_ROUTE, - route->getParentEdges(), {}, {}, {}, {}, {}, {}, {}, {}, {}), -Parameterised(), -myColor(route->getColor()), -myVClass(route->getVClass()) { -} - - -GNERoute::~GNERoute() {} - - -GUIGLObjectPopupMenu* -GNERoute::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GNERoutePopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open demand element dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - new FXMenuSeparator(ret); - new FXMenuCommand(ret, "Apply distance along route", nullptr, ret, MID_GNE_ROUTE_APPLY_DISTANCE); - return ret; -} - - -void -GNERoute::writeDemandElement(OutputDevice& device) const { - device.openTag(SUMO_TAG_ROUTE); - device.writeAttr(SUMO_ATTR_EDGES, parseIDs(getParentEdges())); - device.writeAttr(SUMO_ATTR_COLOR, toString(myColor)); - // write extra attributes depending if is an embedded route - if (myTagProperty.getTag() == SUMO_TAG_ROUTE) { - device.writeAttr(SUMO_ATTR_ID, getDemandElementID()); - // write stops associated to this route - for (const auto& stop : getChildDemandElements()) { - if (stop->getTagProperty().isStop()) { - stop->writeDemandElement(device); - } - } - } - // write parameters - writeParams(device); - // close tag - device.closeTag(); -} - - -bool -GNERoute::isDemandElementValid() const { - if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { - // from and to are the same edges, then return true - return true; - } else if (getParentEdges().size() > 0) { - // check that exist a connection between every edge - return isRouteValid(getParentEdges()).empty(); - } else { - return false; - } -} - - -std::string -GNERoute::getDemandElementProblem() const { - // return string with the problem obtained from isRouteValid - return isRouteValid(getParentEdges()); -} - - -void -GNERoute::fixDemandElementProblem() { - // currently the only solution is removing Route -} - - -GNEEdge* -GNERoute::getFromEdge() const { - return getParentEdges().front(); -} - - -GNEEdge* -GNERoute::getToEdge() const { - return getParentEdges().back(); -} - - -SUMOVehicleClass -GNERoute::getVClass() const { - return myVClass; -} - - -const RGBColor& -GNERoute::getColor() const { - return myColor; -} - - -void -GNERoute::startGeometryMoving() { - // Routes cannot be moved -} - - -void -GNERoute::endGeometryMoving() { - // Routes cannot be moved -} - - -void -GNERoute::moveGeometry(const Position&) { - // Routes cannot be moved -} - - -void -GNERoute::commitGeometryMoving(GNEUndoList*) { - // Routes cannot be moved -} - - -void -GNERoute::updateGeometry() { - // calculate geometry path - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), - getVClass(), getFirstAllowedVehicleLane(), getLastAllowedVehicleLane()); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) { - i->updateGeometry(); - } - } -} - - -void -GNERoute::updateDottedContour() { - // -} - - -void -GNERoute::updatePartialGeometry(const GNEEdge* edge) { - // calculate geometry path - GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) { - i->updatePartialGeometry(edge); - } - } -} - - -void -GNERoute::computePath() { - // nothing to compute -} - - -void -GNERoute::invalidatePath() { - // nothing to invalidate -} - - -Position -GNERoute::getPositionInView() const { - return Position(); -} - - -std::string -GNERoute::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -Boundary -GNERoute::getCenteringBoundary() const { - Boundary routeBoundary; - // return the combination of all parent edges's boundaries - for (const auto& i : getParentEdges()) { - routeBoundary.add(i->getCenteringBoundary()); - } - // check if is valid - if (routeBoundary.isInitialised()) { - return routeBoundary; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNERoute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) { - // check that both net elementes are edges - if ((originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && - (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { - // obtain new list of route edges - std::string newRouteEdges = getNewListOfParents(originalElement, newElement); - // update route edges - if (newRouteEdges.size() > 0) { - setAttribute(SUMO_ATTR_EDGES, newRouteEdges, undoList); - } - } -} - - -void -GNERoute::drawGL(const GUIVisualizationSettings& /*s*/) const { - // Routes are drawn in GNEEdges -} - - -void -GNERoute::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNERoute::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNERoute::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_EDGES: - return parseIDs(getParentEdges()); - case SUMO_ATTR_COLOR: - return toString(myColor); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNERoute::getAttributeDouble(SumoXMLAttr /*key*/) const { - return 0; -} - - -void -GNERoute::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: - case SUMO_ATTR_EDGES: - case SUMO_ATTR_COLOR: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNERoute::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return isValidDemandElementID(value); - case SUMO_ATTR_EDGES: - if (canParse >(myViewNet->getNet(), value, false)) { - // all edges exist, then check if compounds a valid route - return isRouteValid(parse >(myViewNet->getNet(), value)).empty(); - } else { - return false; - } - case SUMO_ATTR_COLOR: - return canParse(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERoute::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNERoute::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -bool -GNERoute::isAttributeEnabled(SumoXMLAttr /*key*/) const { - return true; -} - - -std::string -GNERoute::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNERoute::getHierarchyName() const { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ; -} - - -std::string -GNERoute::isRouteValid(const std::vector& edges) { - if (edges.size() == 0) { - // routes cannot be empty - return ("list of route edges cannot be empty"); - } else if (edges.size() == 1) { - // routes with a single edge are valid, then return an empty string - return (""); - } else { - // iterate over edges to check that compounds a chain - auto it = edges.begin(); - while (it != edges.end() - 1) { - const GNEEdge* currentEdge = *it; - const GNEEdge* nextEdge = *(it + 1); - // same consecutive edges aren't allowed - if (currentEdge->getID() == nextEdge->getID()) { - return ("consecutive duplicated edges (" + currentEdge->getID() + ") aren't allowed in a route"); - } - // obtain outgoing edges of currentEdge - const std::vector& outgoingEdges = currentEdge->getGNEJunctionDestiny()->getGNEOutgoingEdges(); - // check if nextEdge is in outgoingEdges - if (std::find(outgoingEdges.begin(), outgoingEdges.end(), nextEdge) == outgoingEdges.end()) { - return ("Edges '" + currentEdge->getID() + "' and '" + nextEdge->getID() + "' aren't consecutives"); - } - it++; - } - // all edges consecutives, then return an empty string - return (""); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNERoute::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeDemandElementID(value); - break; - case SUMO_ATTR_EDGES: - replaceParentEdges(this, value); - // compute route - updateGeometry(); - break; - case SUMO_ATTR_COLOR: - myColor = parse(value); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNERoute::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERoute.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERoute.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERoute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERoute.h 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-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERoute.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// A class for visualizing routes in Netedit -/****************************************************************************/ -#ifndef GNERoute_h -#define GNERoute_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include "GNEDemandElement.h" -#include "GNERouteHandler.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNEConnection; -class GNEVehicle; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNERoute : public GNEDemandElement, public Parameterised { - -public: - - /// @brief class used in GUIGLObjectPopupMenu for routes - class GNERoutePopupMenu : public GUIGLObjectPopupMenu { - FXDECLARE(GNERoutePopupMenu) - - public: - /** @brief Constructor - * @param[in] app The main window for instantiation of other windows - * @param[in] parent The parent view for changing it - * @param[in] o The object of interest - * @param[in, out] additionalVisualizations Information which additional visualisations are enabled (per view) - */ - GNERoutePopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o); - - /// @brief Destructor - ~GNERoutePopupMenu(); - - /// @brief Called to modify edge distance values along the route - long onCmdApplyDistance(FXObject*, FXSelector, void*); - - protected: - /// @brief default constructor needed by FOX - GNERoutePopupMenu() {} - }; - - /**@brief default constructor - * @param[in] viewNet view in which this Route is placed - */ - GNERoute(GNEViewNet* viewNet); - - /**@brief parameter constructor - * @param[in] viewNet view in which this Route is placed - * @param[in] routeParameters route parameters - */ - GNERoute(GNEViewNet* viewNet, const GNERouteHandler::RouteParameter& routeParameters); - - /**@brief parameter constructor for embedded routes - * @param[in] viewNet view in which this Route is placed - * @param[in] vehicleParent vehicle parent of this embedded route - * @param[in] routeParameters route parameters - */ - GNERoute(GNEViewNet* viewNet, GNEDemandElement* vehicleParent, const GNERouteHandler::RouteParameter& routeParameters); - - /// @brief copy constructor (used to create a route based on the parameters of other GNERoute) - GNERoute(GNEDemandElement* route); - - /// @brief destructor - ~GNERoute(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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 check if a route is valid - * @param[in] edges vector with the route's edges - * @return an empty string if route is valid, or a string with the problem - */ - static std::string isRouteValid(const std::vector& edges); - -protected: - /// @brief route color - RGBColor myColor; - - /// @brief SUMOVehicleClass (Only used for drawing) - SUMOVehicleClass myVClass; - -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 Invalidated copy constructor. - GNERoute(GNERoute*) = delete; - - /// @brief Invalidated assignment operator. - GNERoute& operator=(GNERoute*) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERouteHandler.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERouteHandler.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERouteHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERouteHandler.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1995 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteHandler.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// Builds demand objects for netedit -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPerson.h" -#include "GNEPersonTrip.h" -#include "GNERide.h" -#include "GNERoute.h" -#include "GNERouteHandler.h" -#include "GNEStop.h" -#include "GNEVehicle.h" -#include "GNEVehicleType.h" -#include "GNEWalk.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNERouteHandler::RouteParameter - methods -// --------------------------------------------------------------------------- - -GNERouteHandler::RouteParameter::RouteParameter() : - loadedID(false), - vClass(SVC_PASSENGER), - color(RGBColor::BLACK) { -} - - -GNERouteHandler::RouteParameter::RouteParameter(GNEDemandElement* originalDemandElement) : - routeID(originalDemandElement->getTagProperty().isRoute() ? - originalDemandElement->getID() : - originalDemandElement->getViewNet()->getNet()->generateDemandElementID(originalDemandElement->getID(), SUMO_TAG_ROUTE)), - edges(originalDemandElement->getParentEdges()), - vClass(originalDemandElement->getVClass()), - color(originalDemandElement->getColor()) { -} - - -void -GNERouteHandler::RouteParameter::setEdges(GNEViewNet* viewNet, const std::string& edgeIDs) { - // clear edges - edges.clear(); - // obtain edges (And show warnings if isn't valid) - if (GNEAttributeCarrier::canParse >(viewNet->getNet(), edgeIDs, true)) { - edges = GNEAttributeCarrier::parse >(viewNet->getNet(), edgeIDs); - } -} - - -void -GNERouteHandler::RouteParameter::setEdges(GNEViewNet* viewNet, const std::string& vehicleID, const std::string& fromID, const std::string& toID, const std::string& viaIDs) { - // clear edges - edges.clear(); - // only continue if at least one of the edges is defined - if (fromID.size() + toID.size() > 0) { - // obtain from and to edges - GNEEdge* from = viewNet->getNet()->retrieveEdge(fromID, false); - GNEEdge* to = viewNet->getNet()->retrieveEdge(toID, false); - // check if edges are valid - if (from == nullptr) { - WRITE_ERROR("Invalid from-edge '" + fromID + "' used in trip '" + vehicleID + "'."); - } else if (to == nullptr) { - WRITE_ERROR("Invalid to-edge '" + toID + "' used in trip '" + vehicleID + "'."); - } else if (!GNEAttributeCarrier::canParse >(viewNet->getNet(), viaIDs, false)) { - WRITE_ERROR("Invalid 'via' edges used in trip '" + vehicleID + "'."); - } else { - // obtain via - std::vector viaEdges = GNEAttributeCarrier::parse >(viewNet->getNet(), viaIDs); - // build edges (from - via - to) - edges.push_back(from); - for (const auto& i : viaEdges) { - edges.push_back(i); - } - // check that from and to edge are different - if (from != to) { - edges.push_back(to); - } - } - } -} - -// --------------------------------------------------------------------------- -// GNERouteHandler - methods -// --------------------------------------------------------------------------- - -GNERouteHandler::GNERouteHandler(const std::string& file, GNEViewNet* viewNet, bool undoDemandElements) : - SUMORouteHandler(file, "", false), - myViewNet(viewNet), - myUndoDemandElements(undoDemandElements), - myLoadedVehicleWithEmbebbedRoute(nullptr) { -} - - -GNERouteHandler::~GNERouteHandler() {} - - -bool -GNERouteHandler::isVehicleIdDuplicated(GNEViewNet* viewNet, const std::string& id) { - for (SumoXMLTag vehicleTag : std::vector({SUMO_TAG_VEHICLE, SUMO_TAG_TRIP, SUMO_TAG_ROUTEFLOW, SUMO_TAG_FLOW})) { - if (viewNet->getNet()->retrieveDemandElement(vehicleTag, id, false) != nullptr) { - WRITE_ERROR("There is another " + toString(vehicleTag) + " with the same ID='" + id + "'."); - return true; - } - } - return false; -} - - -bool -GNERouteHandler::isPersonIdDuplicated(GNEViewNet* viewNet, const std::string& id) { - for (SumoXMLTag personTag : std::vector({SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW})) { - if (viewNet->getNet()->retrieveDemandElement(personTag, id, false) != nullptr) { - WRITE_ERROR("There is another " + toString(personTag) + " with the same ID='" + id + "'."); - return true; - } - } - return false; -} - - -void -GNERouteHandler::buildVehicleOverRoute(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters) { - // Check tag - assert(vehicleParameters.tag == SUMO_TAG_VEHICLE); - // first check if ID is duplicated - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* vType = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); - GNEDemandElement* route = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, vehicleParameters.routeid, false); - if (vType == nullptr) { - WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); - } else if (route == nullptr) { - WRITE_ERROR("Invalid route '" + vehicleParameters.routeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)route->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // create vehicle using vehicleParameters - GNEVehicle* vehicle = new GNEVehicle(viewNet, vType, route, vehicleParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + vehicle->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, true, i, vehicle); - } - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(vehicle); - // set vehicle as child of vType and Route - vType->addChildDemandElement(vehicle); - route->addChildDemandElement(vehicle); - vehicle->incRef("buildVehicleOverRoute"); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, false, i, vehicle); - } - } - } - } -} - - -void -GNERouteHandler::buildFlowOverRoute(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters) { - // Check tag - assert(vehicleParameters.tag == SUMO_TAG_ROUTEFLOW); - // first check if ID is duplicated - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* vType = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); - GNEDemandElement* route = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, vehicleParameters.routeid, false); - if (vType == nullptr) { - WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); - } else if (route == nullptr) { - WRITE_ERROR("Invalid route '" + vehicleParameters.routeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)route->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // create flow or trips using vehicleParameters - GNEVehicle* flow = new GNEVehicle(viewNet, vType, route, vehicleParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + flow->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, true, i, flow); - } - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(flow); - // set flow as child of vType and Route - vType->addChildDemandElement(flow); - route->addChildDemandElement(flow); - flow->incRef("buildFlowOverRoute"); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, false, i, flow); - } - } - } - } -} - - -void -GNERouteHandler::buildVehicleWithEmbeddedRoute(GNEViewNet* viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy) { - // Check tags - assert(vehicleParameters.tag == SUMO_TAG_VEHICLE); - // first check if ID is duplicated - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain vType - GNEDemandElement* vType = viewNet->getNet()->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)embeddedRouteCopy->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // generate a new route ID and add it to vehicleParameters - vehicleParameters.routeid = viewNet->getNet()->generateDemandElementID(vehicleParameters.id, SUMO_TAG_ROUTE); - // due vehicle was loaded without a route, change tag - vehicleParameters.tag = SUMO_TAG_VEHICLE; - // create vehicle or trips using myTemporalVehicleParameter without a route - GNEVehicle* vehicle = new GNEVehicle(viewNet, vType, vehicleParameters); - // creaste embedded route - GNERoute* embeddedRoute = new GNERoute(viewNet, vehicle, RouteParameter(embeddedRouteCopy)); - // add both to net depending of myUndoDemandElements - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); - // add both in net using undoList - viewNet->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); - viewNet->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrRouteFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(vehicle); - // set vehicle as child of vType - vType->addChildDemandElement(vehicle); - vehicle->incRef("buildVehicleWithEmbeddedRoute"); - // add route manually in net, and in all of their edges and in vehicleOrRouteFlow - viewNet->getNet()->insertDemandElement(embeddedRoute); - for (const auto& i : embeddedRouteCopy->getParentEdges()) { - i->addChildDemandElement(vehicle); - } - // set route as child of vehicle - vehicle->addChildDemandElement(embeddedRoute); - embeddedRoute->incRef("buildVehicleWithEmbeddedRoute"); - } - } - } -} - - -void -GNERouteHandler::buildFlowWithEmbeddedRoute(GNEViewNet* viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy) { - // Check tags - assert(vehicleParameters.tag == SUMO_TAG_ROUTEFLOW); - // first check if ID is duplicated - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain vType - GNEDemandElement* vType = viewNet->getNet()->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)embeddedRouteCopy->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // generate a new route ID and add it to vehicleParameters - vehicleParameters.routeid = viewNet->getNet()->generateDemandElementID(vehicleParameters.id, SUMO_TAG_ROUTE); - // due vehicle was loaded without a route, change tag - vehicleParameters.tag = SUMO_TAG_ROUTEFLOW; - // create vehicle or trips using myTemporalVehicleParameter without a route - GNEVehicle* flow = new GNEVehicle(viewNet, vType, vehicleParameters); - // creaste embedded route - GNERoute* embeddedRoute = new GNERoute(viewNet, flow, RouteParameter(embeddedRouteCopy)); - // add both to net depending of myUndoDemandElements - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); - // add both in net using undoList - viewNet->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); - viewNet->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrRouteFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(flow); - // set vehicle as child of vType - vType->addChildDemandElement(flow); - flow->incRef("buildFlowWithEmbeddedRoute"); - // add route manually in net, and in all of their edges and in vehicleOrRouteFlow - viewNet->getNet()->insertDemandElement(embeddedRoute); - for (const auto& i : embeddedRouteCopy->getParentEdges()) { - i->addChildDemandElement(flow); - } - // set route as child of flow - flow->addChildDemandElement(embeddedRoute); - embeddedRoute->incRef("buildFlowWithEmbeddedRoute"); - } - } - } -} - - -void -GNERouteHandler::buildTrip(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via) { - // Check tag - assert(vehicleParameters.tag == SUMO_TAG_TRIP); - // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain vtypes - GNEDemandElement* vType = viewNet->getNet()->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && ((vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN)) && ((int)fromEdge->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // add "via" edges in vehicleParameters - for (const auto& viaEdge : via) { - vehicleParameters.via.push_back(viaEdge->getID()); - } - // create trip or flow using tripParameters - GNEVehicle* trip = new GNEVehicle(viewNet, vType, fromEdge, toEdge, via, vehicleParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + trip->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(trip, true), true); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, true, i, trip); - } - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(trip); - // set vehicle as child of vType - vType->addChildDemandElement(trip); - trip->incRef("buildTrip"); - // add reference in all edges - fromEdge->addChildDemandElement(trip); - toEdge->addChildDemandElement(trip); - for (const auto& viaEdge : via) { - viaEdge->addChildDemandElement(trip); - } - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, false, i, trip); - } - } - } - } -} - - -void -GNERouteHandler::buildFlow(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via) { - // Check tag - assert(vehicleParameters.tag == SUMO_TAG_FLOW); - // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) - if (!isVehicleIdDuplicated(viewNet, vehicleParameters.id)) { - // obtain vtypes - GNEDemandElement* vType = viewNet->getNet()->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)fromEdge->getLanes().size() < vehicleParameters.departLane)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); - } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { - WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); - } else { - // add "via" edges in vehicleParameters - for (const auto& viaEdge : via) { - vehicleParameters.via.push_back(viaEdge->getID()); - } - // create trip or flow using tripParameters - GNEVehicle* flow = new GNEVehicle(viewNet, vType, fromEdge, toEdge, via, vehicleParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + flow->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, true, i, flow); - } - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(flow); - // set vehicle as child of vType - vType->addChildDemandElement(flow); - flow->incRef("buildFlow"); - // add reference in all edges - fromEdge->addChildDemandElement(flow); - toEdge->addChildDemandElement(flow); - for (const auto& viaEdge : via) { - viaEdge->addChildDemandElement(flow); - } - // iterate over stops of vehicleParameters and create stops associated with it - for (const auto& i : vehicleParameters.stops) { - buildStop(viewNet, false, i, flow); - } - } - } - } -} - - -void -GNERouteHandler::buildStop(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter::Stop& stopParameters, GNEDemandElement* stopParent) { - // declare pointers to stopping place and lane and obtain it - GNEAdditional* stoppingPlace = nullptr; - GNELane* lane = nullptr; - SumoXMLTag stopTagType = SUMO_TAG_NOTHING; - bool validParentDemandElement = true; - if (stopParameters.busstop.size() > 0) { - stoppingPlace = viewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, stopParameters.busstop, false); - // distinguish between stop for vehicles and stops for persons - if (stopParent->getTagProperty().isPerson()) { - stopTagType = SUMO_TAG_PERSONSTOP_BUSSTOP; - } else { - stopTagType = SUMO_TAG_STOP_BUSSTOP; - } - } else if (stopParameters.containerstop.size() > 0) { - stoppingPlace = viewNet->getNet()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, stopParameters.containerstop, false); - // distinguish between stop for vehicles and stops for persons - if (stopParent->getTagProperty().isPerson()) { - WRITE_ERROR("Persons doesn't support stops over container stops"); - validParentDemandElement = false; - } else { - stopTagType = SUMO_TAG_STOP_CONTAINERSTOP; - } - } else if (stopParameters.chargingStation.size() > 0) { - stoppingPlace = viewNet->getNet()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, stopParameters.chargingStation, false); - // distinguish between stop for vehicles and stops for persons - if (stopParent->getTagProperty().isPerson()) { - WRITE_ERROR("Persons doesn't support stops over charging stations"); - validParentDemandElement = false; - } else { - stopTagType = SUMO_TAG_STOP_CHARGINGSTATION; - } - } else if (stopParameters.parkingarea.size() > 0) { - stoppingPlace = viewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, stopParameters.parkingarea, false); - // distinguish between stop for vehicles and stops for persons - if (stopParent->getTagProperty().isPerson()) { - WRITE_ERROR("Persons doesn't support stops over parking areas"); - validParentDemandElement = false; - } else { - stopTagType = SUMO_TAG_STOP_PARKINGAREA; - } - } else if (stopParameters.lane.size() > 0) { - lane = viewNet->getNet()->retrieveLane(stopParameters.lane, false); - // distinguish between stop for vehicles and stops for persons - if (stopParent->getTagProperty().isPerson()) { - stopTagType = SUMO_TAG_PERSONSTOP_LANE; - } else { - stopTagType = SUMO_TAG_STOP_LANE; - } - } - // first check that parent is valid - if (validParentDemandElement) { - // check if values are correct - if (stoppingPlace && lane) { - WRITE_ERROR("A stop must be defined either over a stoppingPlace or over a lane"); - } else if (!stoppingPlace && !lane) { - WRITE_ERROR("A stop requires a stoppingPlace or a lane"); - } else if (stoppingPlace) { - // create stop using stopParameters and stoppingPlace - GNEStop* stop = new GNEStop(stopTagType, viewNet, stopParameters, stoppingPlace, stopParent); - // add it depending of undoDemandElements - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + stop->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(stop, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(stop); - stoppingPlace->addChildDemandElement(stop); - stopParent->addChildDemandElement(stop); - stop->incRef("buildStoppingPlaceStop"); - } - } else { - // create stop using stopParameters and lane - GNEStop* stop = new GNEStop(viewNet, stopParameters, lane, stopParent); - // add it depending of undoDemandElements - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + stop->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(stop, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(stop); - lane->addChildDemandElement(stop); - stopParent->addChildDemandElement(stop); - stop->incRef("buildLaneStop"); - } - } - } -} - - -void -GNERouteHandler::buildPerson(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& personParameters) { - // first check if ID is duplicated - if (!isPersonIdDuplicated(viewNet, personParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_PTYPE, personParameters.vtypeid, false); - if (pType == nullptr) { - WRITE_ERROR("Invalid person type '" + personParameters.vtypeid + "' used in " + toString(personParameters.tag) + " '" + personParameters.id + "'."); - } else { - // create person using personParameters - GNEPerson* person = new GNEPerson(SUMO_TAG_PERSON, viewNet, pType, personParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + person->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(person, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(person); - // set person as child of pType and Route - pType->addChildDemandElement(person); - person->incRef("buildPerson"); - } - } - } -} - - -void -GNERouteHandler::buildPersonFlow(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& personFlowParameters) { - // first check if ID is duplicated - if (!isPersonIdDuplicated(viewNet, personFlowParameters.id)) { - // obtain routes and vtypes - GNEDemandElement* pType = viewNet->getNet()->retrieveDemandElement(SUMO_TAG_PTYPE, personFlowParameters.vtypeid, false); - if (pType == nullptr) { - WRITE_ERROR("Invalid personFlow type '" + personFlowParameters.vtypeid + "' used in " + toString(personFlowParameters.tag) + " '" + personFlowParameters.id + "'."); - } else { - // create personFlow using personFlowParameters - GNEPerson* personFlow = new GNEPerson(SUMO_TAG_PERSONFLOW, viewNet, pType, personFlowParameters); - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + personFlow->getTagStr()); - viewNet->getUndoList()->add(new GNEChange_DemandElement(personFlow, true), true); - viewNet->getUndoList()->p_end(); - } else { - viewNet->getNet()->insertDemandElement(personFlow); - // set personFlow as child of pType and Route - pType->addChildDemandElement(personFlow); - personFlow->incRef("buildPersonFlow"); - } - } - } -} - - -void -GNERouteHandler::buildPersonTripFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos, - const std::vector& types, const std::vector& modes) { - // create personTripFromTo - GNEPersonTrip* personTripFromTo = new GNEPersonTrip(viewNet, personParent, fromEdge, toEdge, {}, arrivalPos, types, modes); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_PERSONTRIP_FROMTO) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(personTripFromTo, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrPersonTripFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(personTripFromTo); - personParent->addChildDemandElement(personTripFromTo); - personTripFromTo->incRef("buildPersonTripFromTo"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildPersonTripBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, - const std::vector& types, const std::vector& modes) { - // create personTripBusStop - GNEPersonTrip* personTripBusStop = new GNEPersonTrip(viewNet, personParent, fromEdge, busStop, {}, types, modes); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_PERSONTRIP_BUSSTOP) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(personTripBusStop, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrPersonTripFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(personTripBusStop); - personParent->addChildDemandElement(personTripBusStop); - busStop->addChildDemandElement(personTripBusStop); - fromEdge->addChildDemandElement(personTripBusStop); - personTripBusStop->incRef("buildPersonTripBusStop"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildWalkEdges(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, const std::vector& edges, double arrivalPos) { - // check that at least there is an edge - if (edges.size() == 0) { - WRITE_ERROR("A walk needs at least one edge. " + toString(SUMO_TAG_WALK_EDGES) + " within person with ID='" + personParent->getID() + "' cannot be created"); - } else { - // obtain path between edges - std::vector pathEdges = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(personParent->getVClass(), edges); - // check if obtained path is valid - if (pathEdges.size() == 0) { - pathEdges = edges; - } - // create walkEdges - GNEWalk* walkEdges = new GNEWalk(viewNet, personParent, pathEdges, arrivalPos); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_EDGES) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(walkEdges, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrWalkEdgesFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(walkEdges); - personParent->addChildDemandElement(walkEdges); - // add reference in all edges - for (const auto& i : edges) { - i->addChildDemandElement(walkEdges); - } - walkEdges->incRef("buildWalkEdges"); - } - // update geometry - personParent->updateGeometry(); - } -} - - -void -GNERouteHandler::buildWalkFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos) { - // create walkFromTo - GNEWalk* walkFromTo = new GNEWalk(viewNet, personParent, fromEdge, toEdge, {}, arrivalPos); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_FROMTO) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(walkFromTo, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrWalkFromToFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(walkFromTo); - personParent->addChildDemandElement(walkFromTo); - // add reference in all edges - fromEdge->addChildDemandElement(walkFromTo); - toEdge->addChildDemandElement(walkFromTo); - walkFromTo->incRef("buildWalkFromTo"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildWalkBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop) { - // create walkBusStop - GNEWalk* walkBusStop = new GNEWalk(viewNet, personParent, fromEdge, busStop, {}); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_BUSSTOP) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(walkBusStop, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrWalkBusStopFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(walkBusStop); - personParent->addChildDemandElement(walkBusStop); - busStop->addChildDemandElement(walkBusStop); - fromEdge->addChildDemandElement(walkBusStop); - walkBusStop->incRef("buildWalkBusStop"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildWalkRoute(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEDemandElement* route, double arrivalPos) { - // create walkRoute - GNEWalk* walkRoute = new GNEWalk(viewNet, personParent, route, arrivalPos); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_ROUTE) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(walkRoute, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrWalkBusStopFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(walkRoute); - personParent->addChildDemandElement(walkRoute); - route->addChildDemandElement(walkRoute); - walkRoute->incRef("buildWalkRoute"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildRideFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& lines, double arrivalPos) { - // create rideFromTo - GNERide* rideFromTo = new GNERide(viewNet, personParent, fromEdge, toEdge, {}, arrivalPos, lines); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_RIDE_FROMTO) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(rideFromTo, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrRideFromToFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(rideFromTo); - personParent->addChildDemandElement(rideFromTo); - // add reference in all edges - fromEdge->addChildDemandElement(rideFromTo); - toEdge->addChildDemandElement(rideFromTo); - rideFromTo->incRef("buildRideFromTo"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::buildRideBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& lines) { - // create rideBusStop - GNERide* rideBusStop = new GNERide(viewNet, personParent, fromEdge, busStop, {}, lines); - // add element using undo list or directly, depending of undoDemandElements flag - if (undoDemandElements) { - viewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_RIDE_BUSSTOP) + " within person '" + personParent->getID() + "'"); - viewNet->getUndoList()->add(new GNEChange_DemandElement(rideBusStop, true), true); - viewNet->getUndoList()->p_end(); - } else { - // add vehicleOrRideBusStopFlow in net and in their vehicle type parent - viewNet->getNet()->insertDemandElement(rideBusStop); - personParent->addChildDemandElement(rideBusStop); - busStop->addChildDemandElement(rideBusStop); - // add reference in first edge - fromEdge->addChildDemandElement(rideBusStop); - rideBusStop->incRef("buildRideBusStop"); - } - // update geometry - personParent->updateGeometry(); -} - - -void -GNERouteHandler::transformToVehicle(GNEVehicle* originalVehicle, bool createEmbeddedRoute) { - // first check that given vehicle isn't already a vehicle - if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_VEHICLE) { - // get pointer to undo list (due originalVehicle will be deleted) - GNEUndoList* undoList = originalVehicle->getViewNet()->getUndoList(); - // begin undo-redo operation - undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_VEHICLE)); - // declare flag to save if vehicle is selected - bool selected = originalVehicle->isAttributeCarrierSelected(); - // first check if originalVehicle has an embedded route, and if true, separate it - if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && - (originalVehicle->getParentDemandElements().size() == 1)) { - originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); - } - // obtain VType of original vehicle - GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); - // extract vehicleParameters of originalVehicle - SUMOVehicleParameter newVehicleParameters = *originalVehicle; - // change tag in newVehicleParameters (needed for GNEVehicle constructor) - newVehicleParameters.tag = SUMO_TAG_VEHICLE; - // make transformation depending of vehicle tag - if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { - // obtain vehicle's route (it always exist due call to function separateEmbeddedRoute(...) - GNEDemandElement* route = originalVehicle->getParentDemandElements().at(1); - // create Vehicle using values of original vehicle - GNEVehicle* vehicle = new GNEVehicle(originalVehicle->getViewNet(), vType, route, newVehicleParameters); - // remove original vehicle (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new vehicle - undoList->add(new GNEChange_DemandElement(vehicle, true), true); - // as last step change vehicle's route to embedded route if createEmbeddedRoute is enabled - if (createEmbeddedRoute) { - embebbeRoute(vehicle, undoList); - } - // check if vehicle has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(vehicle, vehicle->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { - // create route using values of originalVehicle flow/trip - GNERoute* route = new GNERoute(originalVehicle->getViewNet(), RouteParameter(originalVehicle)); - // create Vehicle using values of original vehicle (including ID) - GNEVehicle* vehicle = new GNEVehicle(originalVehicle->getViewNet(), vType, route, newVehicleParameters); - // remove flow/trip (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add both new vehicle and route - undoList->add(new GNEChange_DemandElement(route, true), true); - undoList->add(new GNEChange_DemandElement(vehicle, true), true); - // check if vehicle has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(vehicle, vehicle->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } - // end undo-redo operation - undoList->p_end(); - } -} - - -void -GNERouteHandler::transformToRouteFlow(GNEVehicle* originalVehicle, bool createEmbeddedRoute) { - // first check that given vehicle isn't already a routeflow - if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_ROUTEFLOW) { - // get pointer to undo list (due originalVehicle will be deleted) - GNEUndoList* undoList = originalVehicle->getViewNet()->getUndoList(); - // begin undo-redo operation - undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_ROUTEFLOW)); - // declare flag to save if vehicle is selected - bool selected = originalVehicle->isAttributeCarrierSelected(); - // first check if originalVehicle has an embedded route, and if true, separate it - if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && - (originalVehicle->getParentDemandElements().size() == 1)) { - originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); - } - // obtain VType of original vehicle - GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); - // extract vehicleParameters of originalVehicle - SUMOVehicleParameter newVehicleParameters = *originalVehicle; - // change tag in newVehicleParameters (needed for GNEVehicle constructor) - newVehicleParameters.tag = SUMO_TAG_ROUTEFLOW; - // make transformation depending of vehicle tag - if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { - // obtain vehicle's route (it always exist due call to function separateEmbeddedRoute(...) - GNEDemandElement* route = originalVehicle->getParentDemandElements().at(1); - // create flow using newVehicleParameters - GNEVehicle* flow = new GNEVehicle(originalVehicle->getViewNet(), vType, route, newVehicleParameters); - // remove original vehicle (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new vehicle - undoList->add(new GNEChange_DemandElement(flow, true), true); - // as last step change vehicle's route to embedded route if createEmbeddedRoute is enabled - if (createEmbeddedRoute) { - embebbeRoute(flow, undoList); - } - // check if flow has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(flow, flow->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { - // create route using values of originalVehicle flow/trip - GNERoute* route = new GNERoute(originalVehicle->getViewNet(), RouteParameter(originalVehicle)); - // create flow using values of original vehicle (including ID) - GNEVehicle* flow = new GNEVehicle(originalVehicle->getViewNet(), vType, route, newVehicleParameters); - // remove flow/trip (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add both new vehicle and route - undoList->add(new GNEChange_DemandElement(route, true), true); - undoList->add(new GNEChange_DemandElement(flow, true), true); - // check if flow has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(flow, flow->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } - // end undo-redo operation - undoList->p_end(); - } -} - - -void -GNERouteHandler::transformToTrip(GNEVehicle* originalVehicle) { - // first check that given vehicle isn't already a trip - if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_TRIP) { - // get pointer to undo list (due originalVehicle will be deleted) - GNEUndoList* undoList = originalVehicle->getViewNet()->getUndoList(); - // begin undo-redo operation - undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_FLOW)); - // declare pointer to get embedded route if is created - GNEDemandElement* separatedEmbeddedRoute = nullptr; - // declare flag to save if vehicle is selected - bool selected = originalVehicle->isAttributeCarrierSelected(); - // first check if originalVehicle has an embedded route, and if true, separate it - if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && - (originalVehicle->getParentDemandElements().size() == 1)) { - originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); - } - // obtain VType of original vehicle - GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); - // extract vehicleParameters of originalVehicle - SUMOVehicleParameter newVehicleParameters = *originalVehicle; - // change tag in newVehicleParameters (needed for GNEVehicle constructor) - newVehicleParameters.tag = SUMO_TAG_TRIP; - // make transformation depending of vehicle tag - if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { - // create trip using values of original vehicle (including ID) and route's edges - GNEVehicle* trip = new GNEVehicle(originalVehicle->getViewNet(), vType, - originalVehicle->getParentDemandElements().at(1)->getParentEdges().front(), - originalVehicle->getParentDemandElements().at(1)->getParentEdges().back(), - originalVehicle->getParentDemandElements().at(1)->getMiddleParentEdges(), - newVehicleParameters); - // first remove vehicle (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new vehicle - undoList->add(new GNEChange_DemandElement(trip, true), true); - // check if trip has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(trip, trip->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { - // create trip using values of original vehicle (including ID) - GNEVehicle* trip = new GNEVehicle(originalVehicle->getViewNet(), vType, - originalVehicle->getParentEdges().front(), - originalVehicle->getParentEdges().back(), - originalVehicle->getMiddleParentEdges(), - newVehicleParameters); - // remove originalVehicle - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new trip - undoList->add(new GNEChange_DemandElement(trip, true), true); - // check if trip has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(trip, trip->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } - // check if separatedEmbeddedRoute has to be removed - if (separatedEmbeddedRoute) { - undoList->add(new GNEChange_DemandElement(separatedEmbeddedRoute, false), true); - } - // end undo-redo operation - undoList->p_end(); - } -} - - -void -GNERouteHandler::transformToFlow(GNEVehicle* originalVehicle) { - // first check that given vehicle isn't already a flow - if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_FLOW) { - // get pointer to undo list (due originalVehicle will be deleted) - GNEUndoList* undoList = originalVehicle->getViewNet()->getUndoList(); - // begin undo-redo operation - undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_FLOW)); - // declare pointer to get embedded route if is created - GNEDemandElement* separatedEmbeddedRoute = nullptr; - // declare flag to save if vehicle is selected - bool selected = originalVehicle->isAttributeCarrierSelected(); - // first check if originalVehicle has an embedded route, and if true, separate it - if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && - (originalVehicle->getParentDemandElements().size() == 1)) { - originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); - separatedEmbeddedRoute = originalVehicle->getParentDemandElements().at(1); - } - // obtain VType of original vehicle - GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); - // extract vehicleParameters of originalVehicle - SUMOVehicleParameter newVehicleParameters = *originalVehicle; - // change tag in newVehicleParameters (needed for GNEVehicle constructor) - newVehicleParameters.tag = SUMO_TAG_FLOW; - // make transformation depending of vehicle tag - if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { - // create Vehicle using values of original vehicle (including ID) and route's edges - GNEVehicle* flow = new GNEVehicle(originalVehicle->getViewNet(), vType, - originalVehicle->getParentDemandElements().at(1)->getParentEdges().front(), - originalVehicle->getParentDemandElements().at(1)->getParentEdges().back(), - originalVehicle->getParentDemandElements().at(1)->getMiddleParentEdges(), - newVehicleParameters); - // first remove vehicle (to avoid problem with ID) - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new flow - undoList->add(new GNEChange_DemandElement(flow, true), true); - } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { - // create flow using values of original vehicle (including ID) - GNEVehicle* flow = new GNEVehicle(originalVehicle->getViewNet(), vType, - originalVehicle->getParentEdges().front(), - originalVehicle->getParentEdges().back(), - originalVehicle->getMiddleParentEdges(), - newVehicleParameters); - // remove originalVehicle - undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); - // add new flow - undoList->add(new GNEChange_DemandElement(flow, true), true); - // check if flow has to be selected - if (selected) { - undoList->p_add(new GNEChange_Attribute(flow, flow->getViewNet()->getNet(), GNE_ATTR_SELECTED, "true")); - } - } - // check if separatedEmbeddedRoute has to be removed - if (separatedEmbeddedRoute) { - undoList->add(new GNEChange_DemandElement(separatedEmbeddedRoute, false), true); - } - // end undo-redo operation - undoList->p_end(); - } -} - - -void -GNERouteHandler::transformToPerson(GNEPerson* /*originalPerson*/) { - // -} - - -void -GNERouteHandler::transformToPersonFlow(GNEPerson* /*originalPerson*/) { - // -} - - -void -GNERouteHandler::setFlowParameters(const SumoXMLAttr attribute, int& parameters) { - // modify parametersSetCopy depending of given Flow attribute - switch (attribute) { - case SUMO_ATTR_END: { - // give more priority to end - parameters = VEHPARS_END_SET | VEHPARS_NUMBER_SET; - break; - } - case SUMO_ATTR_NUMBER: - parameters ^= VEHPARS_END_SET; - parameters |= VEHPARS_NUMBER_SET; - break; - case SUMO_ATTR_VEHSPERHOUR: { - // give more priority to end - if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_END_SET) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_NUMBER_SET) { - parameters = VEHPARS_NUMBER_SET; - } - // set VehsPerHour - parameters |= VEHPARS_VPH_SET; - break; - } - case SUMO_ATTR_PERIOD: { - // give more priority to end - if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_END_SET) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_NUMBER_SET) { - parameters = VEHPARS_NUMBER_SET; - } - // set period - parameters |= VEHPARS_PERIOD_SET; - break; - } - case SUMO_ATTR_PROB: { - // give more priority to end - if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_END_SET) { - parameters = VEHPARS_END_SET; - } else if (parameters & VEHPARS_NUMBER_SET) { - parameters = VEHPARS_NUMBER_SET; - } - // set probability - parameters |= VEHPARS_PROB_SET; - break; - } - default: - break; - } -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNERouteHandler::embebbeRoute(GNEVehicle* vehicle, GNEUndoList* undoList) { - // create a copy of vehicle with the same attributes but without embedded route - GNEVehicle* vehicleWithEmbebbeRoute = new GNEVehicle(vehicle->getViewNet(), vehicle->getParentDemandElements().at(0), *vehicle); - // create a embeddedRoute based on parameters of vehicle's route - GNERoute* embeddedRoute = new GNERoute(vehicleWithEmbebbeRoute->getViewNet(), vehicleWithEmbebbeRoute, RouteParameter(vehicle->getParentDemandElements().at(1))); - // remove vehicle, but NOT route - undoList->add(new GNEChange_DemandElement(vehicle, false), true); - // now add bot vehicleWithEmbebbeRoute and embeddedRoute - undoList->add(new GNEChange_DemandElement(vehicleWithEmbebbeRoute, true), true); - undoList->add(new GNEChange_DemandElement(embeddedRoute, true), true); -} - - -GNEVehicle* -GNERouteHandler::separateEmbeddedRoute(GNEVehicle* vehicle, GNEUndoList* undoList) { - // first create a Route based on the parameters of vehicle's embedded route - GNERoute* nonEmbeddedRoute = new GNERoute(vehicle->getChildDemandElements().at(0)); - // create a copy of vehicle with the same attributes but with the nonEmbeddedRoute - GNEVehicle* vehicleWithoutEmbebbeRoute = new GNEVehicle(vehicle->getViewNet(), vehicle->getParentDemandElements().at(0), nonEmbeddedRoute, *vehicle); - // remove embedded route andvehicle (because a embebbbed route without vehicle cannot exist) - undoList->add(new GNEChange_DemandElement(vehicle->getChildDemandElements().at(0), false), true); - undoList->add(new GNEChange_DemandElement(vehicle, false), true); - // now add bot nonEmbeddedRoute and vehicleWithoutEmbebbeRoute - undoList->add(new GNEChange_DemandElement(nonEmbeddedRoute, true), true); - undoList->add(new GNEChange_DemandElement(vehicleWithoutEmbebbeRoute, true), true); - // return vehicleWithoutEmbebbeRoute - return vehicleWithoutEmbebbeRoute; -} - - -void -GNERouteHandler::openVehicleTypeDistribution(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - - -void -GNERouteHandler::closeVehicleTypeDistribution() { - // currently unused -} - - -void -GNERouteHandler::openRoute(const SUMOSAXAttributes& attrs) { - // change abort flag - myAbort = false; - // check if route has ID (due embebbed routes) - if (attrs.hasAttribute(SUMO_ATTR_ID)) { - myRouteParameter.routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE, SUMO_ATTR_ID, myAbort); - myRouteParameter.loadedID = true; - } else { - myRouteParameter.routeID.clear(); - myRouteParameter.loadedID = false; - } - // parse other attributes - myRouteParameter.setEdges(myViewNet, GNEAttributeCarrier::parseAttributeFromXML(attrs, myRouteParameter.routeID, SUMO_TAG_ROUTE, SUMO_ATTR_EDGES, myAbort)); - myRouteParameter.color = GNEAttributeCarrier::parseAttributeFromXML(attrs, myRouteParameter.routeID, SUMO_TAG_ROUTE, SUMO_ATTR_COLOR, myAbort); -} - - -void -GNERouteHandler::openFlow(const SUMOSAXAttributes& attrs) { - // change abort flag - myAbort = false; - // parse flow attributes - myRouteParameter.setEdges(myViewNet, myVehicleParameter->id, - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_FROM, myAbort), - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_TO, myAbort), - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_VIA, myAbort)); -} - - -void -GNERouteHandler::openTrip(const SUMOSAXAttributes& attrs) { - // change abort flag - myAbort = false; - // parse trips attributes - myRouteParameter.setEdges(myViewNet, myVehicleParameter->id, - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_FROM, myAbort), - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_TO, myAbort), - GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_VIA, myAbort)); -} - - -void -GNERouteHandler::closeRoute(const bool /* mayBeDisconnected */) { - // first copy parameters from SUMORouteHanlder to myRouteParameter - myRouteParameter.parameters = myLoadedParameterised; - // clear loaded parameters after set - myLoadedParameterised.clearParameter(); - // we have two possibilities: Either create a route with their own ID, or create a route within a vehicle - if (myVehicleParameter) { - // extra warning for embebbed routes - if (myRouteParameter.loadedID) { - WRITE_WARNING("Attribute ID ignored in embedded routes"); - } - // check edges - if (myRouteParameter.edges.size() == 0) { - WRITE_ERROR("A route needs at least one edge. Vehicle with ID='" + myVehicleParameter->id + "' cannot be created"); - } else { - // obtain vType - GNEDemandElement* vType = myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, myVehicleParameter->vtypeid, false); - if (vType == nullptr) { - WRITE_ERROR("Invalid vehicle type '" + myVehicleParameter->vtypeid + "' used in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->id + "'."); - } else { - // generate a new route ID and add it to myVehicleParameter - myVehicleParameter->routeid = myViewNet->getNet()->generateDemandElementID(myVehicleParameter->id, SUMO_TAG_ROUTE); - // due vehicle was loaded without a route, change tag - myVehicleParameter->tag = (myVehicleParameter->tag == SUMO_TAG_FLOW) ? SUMO_TAG_ROUTEFLOW : SUMO_TAG_VEHICLE; - // create vehicle or trips using myTemporalVehicleParameter without a route - myLoadedVehicleWithEmbebbedRoute = new GNEVehicle(myViewNet, vType, *myVehicleParameter); - // creaste embedded route - GNERoute* embeddedRoute = new GNERoute(myViewNet, myLoadedVehicleWithEmbebbedRoute, myRouteParameter); - // add both to net depending of myUndoDemandElements - if (myUndoDemandElements) { - myViewNet->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); - // add both in net using undoList - myViewNet->getUndoList()->add(new GNEChange_DemandElement(myLoadedVehicleWithEmbebbedRoute, true), true); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); - // iterate over stops of myActiveRouteStops and create stops associated with it - for (const auto& i : myActiveRouteStops) { - buildStop(myViewNet, true, i, myLoadedVehicleWithEmbebbedRoute); - } - } else { - // add vehicleOrRouteFlow in net and in their vehicle type parent - myViewNet->getNet()->insertDemandElement(myLoadedVehicleWithEmbebbedRoute); - vType->addChildDemandElement(myLoadedVehicleWithEmbebbedRoute); - myLoadedVehicleWithEmbebbedRoute->incRef("buildVehicleAndRoute"); - // add route manually in net, and in all of their edges and in vehicleOrRouteFlow - myViewNet->getNet()->insertDemandElement(embeddedRoute); - for (const auto& i : myRouteParameter.edges) { - i->addChildDemandElement(myLoadedVehicleWithEmbebbedRoute); - } - myLoadedVehicleWithEmbebbedRoute->addChildDemandElement(embeddedRoute); - embeddedRoute->incRef("buildVehicleAndRoute"); - // iterate over stops of myActiveRouteStops and create stops associated with it - for (const auto& i : myActiveRouteStops) { - buildStop(myViewNet, false, i, myLoadedVehicleWithEmbebbedRoute); - } - } - } - } - } else if (myRouteParameter.loadedID == false) { - WRITE_ERROR(toString(SUMO_TAG_ROUTE) + " needs a valid ID."); - } else if (!SUMOXMLDefinitions::isValidVehicleID(myRouteParameter.routeID)) { - WRITE_ERROR(toString(SUMO_TAG_ROUTE) + " ID='" + myRouteParameter.routeID + "' contains invalid characters."); - } else if (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteParameter.routeID, false) != nullptr) { - WRITE_ERROR("There is another " + toString(SUMO_TAG_ROUTE) + " with the same ID='" + myRouteParameter.routeID + "'."); - } else if (myRouteParameter.edges.size() == 0) { - WRITE_ERROR("A route needs at least one edge."); - } else { - // creaste GNERoute - GNERoute* route = new GNERoute(myViewNet, myRouteParameter); - if (myUndoDemandElements) { - myViewNet->getUndoList()->p_begin("add " + route->getTagStr()); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(route, true), true); - // iterate over stops of myActiveRouteStops and create stops associated with it - for (const auto& i : myActiveRouteStops) { - buildStop(myViewNet, true, i, route); - } - myViewNet->getUndoList()->p_end(); - } else { - myViewNet->getNet()->insertDemandElement(route); - for (const auto& i : myRouteParameter.edges) { - i->addChildDemandElement(route); - } - route->incRef("buildRoute"); - // iterate over stops of myActiveRouteStops and create stops associated with it - for (const auto& i : myActiveRouteStops) { - buildStop(myViewNet, false, i, route); - } - } - } -} - - -void -GNERouteHandler::openRouteDistribution(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - - -void -GNERouteHandler::closeRouteDistribution() { - // currently unused -} - - -void -GNERouteHandler::closeVehicle() { - // first check if we're closing a vehicle with embebbed routes and stops - if (myLoadedVehicleWithEmbebbedRoute) { - myLoadedVehicleWithEmbebbedRoute = nullptr; - // check if current command group size has to be ended - if (myViewNet->getUndoList()->currentCommandGroupSize() > 0) { - myViewNet->getUndoList()->p_end(); - } - } else { - // now check if myVehicleParameter was sucesfully created - if (myVehicleParameter) { - // build vehicle over route - buildVehicleOverRoute(myViewNet, myUndoDemandElements, *myVehicleParameter); - } - } -} - - -void -GNERouteHandler::closeVType() { - // first check that VType was sucesfully created - if (myCurrentVType) { - // first check if we're creating a vType or a pType - SumoXMLTag vTypeTag = (myCurrentVType->vehicleClass == SVC_PEDESTRIAN) ? SUMO_TAG_PTYPE : SUMO_TAG_VTYPE; - // check if loaded vType/pType is a default vtype - if ((myCurrentVType->id == DEFAULT_VTYPE_ID) || (myCurrentVType->id == DEFAULT_PEDTYPE_ID) || (myCurrentVType->id == DEFAULT_BIKETYPE_ID)) { - // overwrite default vehicle type - GNEVehicleType::overwriteVType(myViewNet->getNet()->retrieveDemandElement(vTypeTag, myCurrentVType->id, false), myCurrentVType, myViewNet->getUndoList()); - } else if (myViewNet->getNet()->retrieveDemandElement(vTypeTag, myCurrentVType->id, false) != nullptr) { - WRITE_ERROR("There is another " + toString(vTypeTag) + " with the same ID='" + myCurrentVType->id + "'."); - } else { - // create vType/pType using myCurrentVType - GNEVehicleType* vType = new GNEVehicleType(myViewNet, *myCurrentVType, vTypeTag); - if (myUndoDemandElements) { - myViewNet->getUndoList()->p_begin("add " + vType->getTagStr()); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(vType, true), true); - myViewNet->getUndoList()->p_end(); - } else { - myViewNet->getNet()->insertDemandElement(vType); - vType->incRef("buildVType"); - } - } - } -} - - -void -GNERouteHandler::closePerson() { - // first check if myVehicleParameter was sucesfully created - if (myVehicleParameter) { - // first check if ID is duplicated - if (!isPersonIdDuplicated(myViewNet, myVehicleParameter->id)) { - // obtain ptype - GNEDemandElement* pType = myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_PTYPE, myVehicleParameter->vtypeid, false); - if (pType == nullptr) { - WRITE_ERROR("Invalid person type '" + myVehicleParameter->vtypeid + "' used in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->vtypeid + "'."); - } else { - // declare flag to abort person plans creation - bool abortPersonPlans = false; - // create person using personParameters - GNEPerson* person = new GNEPerson(SUMO_TAG_PERSON, myViewNet, pType, *myVehicleParameter); - // begin undo-list creation - myViewNet->getUndoList()->p_begin("add " + person->getTagStr()); - // add person - myViewNet->getUndoList()->add(new GNEChange_DemandElement(person, true), true); - // iterate over all personplan childs and add it - for (auto i = myPersonPlanValues.begin(); (i != myPersonPlanValues.end()) && !abortPersonPlans; i++) { - switch (i->tag) { - case SUMO_TAG_PERSONTRIP_FROMTO: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from && i->to) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myViewNet, person, i->from, i->to, {}, i->arrivalPos, i->vTypes, i->modes), true), true); - } else if ((i != myPersonPlanValues.begin()) && i->to) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myViewNet, person, i->from, i->to, {}, i->arrivalPos, i->vTypes, i->modes), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_PERSONTRIP_BUSSTOP: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myViewNet, person, i->from, i->busStop, {}, i->vTypes, i->modes), true), true); - } else if (i != myPersonPlanValues.begin()) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myViewNet, person, i->from, i->busStop, {}, i->vTypes, i->modes), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_RIDE_FROMTO: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from && i->to) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myViewNet, person, i->from, i->to, {}, i->arrivalPos, i->lines), true), true); - } else if ((i != myPersonPlanValues.begin()) && i->to) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myViewNet, person, i->from, i->to, {}, i->arrivalPos, i->lines), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_RIDE_BUSSTOP: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myViewNet, person, i->from, i->busStop, {}, i->lines), true), true); - } else if (i != myPersonPlanValues.begin()) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myViewNet, person, i->from, i->busStop, {}, i->lines), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_WALK_EDGES: - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->edges, i->arrivalPos), true), true); - break; - case SUMO_TAG_WALK_FROMTO: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from && i->to) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->from, i->to, {}, i->arrivalPos), true), true); - } else if ((i != myPersonPlanValues.begin()) && i->to) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->from, i->to, {}, i->arrivalPos), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_WALK_BUSSTOP: - // check if "from" attribute was loaded, or it must be taked fron previous personPlan values - if (i->from) { - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->from, i->busStop, {}), true), true); - } else if (i != myPersonPlanValues.begin()) { - // update 'from' edge using 'to' edge of last personPlan element - i->from = (i - 1)->getLastEdge(); - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->from, i->busStop, {}), true), true); - } else { - WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); - // abort last command group (to remove created person) - myViewNet->getUndoList()->p_abortLastCommandGroup(); - // abort person plan creation - abortPersonPlans = true; - } - break; - case SUMO_TAG_WALK_ROUTE: - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myViewNet, person, i->route, i->arrivalPos), true), true); - break; - case SUMO_TAG_PERSONSTOP_LANE: - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEStop(myViewNet, i->stopParameters, i->laneStop, person), true), true); - break; - case SUMO_TAG_PERSONSTOP_BUSSTOP: - myViewNet->getUndoList()->add(new GNEChange_DemandElement(new GNEStop(i->tag, myViewNet, i->stopParameters, i->busStop, person), true), true); - break; - default: - break; - } - } - // end undo-list depending of abortPersonPlans - if (!abortPersonPlans) { - myViewNet->getUndoList()->p_end(); - } - } - } - - } - // clear person plan values clear - myPersonPlanValues.clear(); -} - -void -GNERouteHandler::closePersonFlow() { - // first check if myVehicleParameter was sucesfully created - if (myVehicleParameter) { - // build person flow - buildPersonFlow(myViewNet, myUndoDemandElements, *myVehicleParameter); - } -} - -void -GNERouteHandler::closeContainer() { - // currently unused -} - - -void -GNERouteHandler::closeFlow() { - // first check if myVehicleParameter was sucesfully created - if (myVehicleParameter) { - // check if we're creating a flow or a routeFlow over route - if (myRouteParameter.edges.size() > 1) { - // extract via edges - std::vector viaEdges; - for (int i = 1; i < ((int)myRouteParameter.edges.size() - 1); i++) { - viaEdges.push_back(myRouteParameter.edges.at(i)); - } - // build flow - buildFlow(myViewNet, true, *myVehicleParameter, myRouteParameter.edges.front(), myRouteParameter.edges.back(), viaEdges); - } else if (myRouteParameter.edges.size() == 0) { - // build flow over route - buildFlowOverRoute(myViewNet, myUndoDemandElements, *myVehicleParameter); - } - } -} - - -void -GNERouteHandler::closeTrip() { - // first check if myVehicleParameter was sucesfully created - if (myVehicleParameter && (myRouteParameter.edges.size() > 1)) { - // force reroute - myVehicleParameter->parametersSet |= VEHPARS_FORCE_REROUTE; - // extract via edges - std::vector viaEdges; - for (int i = 1; i < ((int)myRouteParameter.edges.size() - 1); i++) { - viaEdges.push_back(myRouteParameter.edges.at(i)); - } - // build trip - buildTrip(myViewNet, true, *myVehicleParameter, myRouteParameter.edges.front(), myRouteParameter.edges.back(), viaEdges); - } -} - - -void -GNERouteHandler::addStop(const SUMOSAXAttributes& attrs) { - // declare a personStop - PersonPlansValues stop; - std::string errorSuffix; - if (myVehicleParameter != nullptr) { - errorSuffix = " in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->id + "'."; - } else { - errorSuffix = " in route '" + myActiveRouteID + "'."; - } - // try to parse stop - myAbort = parseStop(stop.stopParameters, attrs, errorSuffix, MsgHandler::getErrorInstance()); - if (!myAbort) { - return; - } - // try to parse the assigned bus stop - if (stop.stopParameters.busstop != "") { - // ok, we have a busStop - GNEBusStop* bs = dynamic_cast(myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, stop.stopParameters.busstop, false)); - if (bs == nullptr) { - WRITE_ERROR(toString(SUMO_TAG_BUS_STOP) + " '" + stop.stopParameters.busstop + "' is not known" + errorSuffix); - return; - } - // save lane - stop.stopParameters.lane = bs->getAttribute(SUMO_ATTR_LANE); - // save stoping place in stop - stop.busStop = bs; - // set tag - stop.tag = SUMO_TAG_STOP_BUSSTOP; - // special case for persons - if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { - stop.tag = SUMO_TAG_PERSONSTOP_BUSSTOP; - } - } else if (stop.stopParameters.containerstop != "") { - // special case for persons - if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { - WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_CONTAINER_STOP) + "s"); - return; - } - // ok, we have a containerStop - GNEContainerStop* cs = dynamic_cast(myViewNet->getNet()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, stop.stopParameters.containerstop, false)); - if (cs == nullptr) { - WRITE_ERROR(toString(SUMO_TAG_CONTAINER_STOP) + " '" + stop.stopParameters.containerstop + "' is not known" + errorSuffix); - return; - } - // save lane - stop.stopParameters.lane = cs->getAttribute(SUMO_ATTR_LANE); - // save stoping place in stop - stop.containerStop = cs; - // set tag - stop.tag = SUMO_TAG_STOP_CONTAINERSTOP; - - } else if (stop.stopParameters.chargingStation != "") { - // special case for persons - if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { - WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_CHARGING_STATION) + "s"); - return; - } - // ok, we have a chargingStation - GNEChargingStation* cs = dynamic_cast(myViewNet->getNet()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, stop.stopParameters.chargingStation, false)); - if (cs == nullptr) { - WRITE_ERROR(toString(SUMO_TAG_CHARGING_STATION) + " '" + stop.stopParameters.chargingStation + "' is not known" + errorSuffix); - return; - } - // save lane - stop.stopParameters.lane = cs->getAttribute(SUMO_ATTR_LANE); - // save stoping place in stop - stop.chargingStation = cs; - // set tag - stop.tag = SUMO_TAG_STOP_CHARGINGSTATION; - } else if (stop.stopParameters.parkingarea != "") { - // special case for persons - if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { - WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_PARKING_AREA) + "s"); - return; - } - // ok, we have a parkingArea - GNEParkingArea* pa = dynamic_cast(myViewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, stop.stopParameters.parkingarea, false)); - if (pa == nullptr) { - WRITE_ERROR(toString(SUMO_TAG_PARKING_AREA) + " '" + stop.stopParameters.parkingarea + "' is not known" + errorSuffix); - return; - } - // save lane - stop.stopParameters.lane = pa->getAttribute(SUMO_ATTR_LANE); - // save stoping place in stop - stop.parkingArea = pa; - // set tag - stop.tag = SUMO_TAG_STOP_PARKINGAREA; - } else { - // no, the lane and the position should be given - // get the lane - stop.stopParameters.lane = attrs.getOpt(SUMO_ATTR_LANE, nullptr, myAbort, ""); - stop.laneStop = myViewNet->getNet()->retrieveLane(stop.stopParameters.lane, false); - // check if lane is valid - if (myAbort && stop.stopParameters.lane != "") { - if (stop.laneStop == nullptr) { - WRITE_ERROR("The lane '" + stop.stopParameters.lane + "' for a stop is not known" + errorSuffix); - return; - } - } else { - WRITE_ERROR("A stop must be placed over a " + toString(SUMO_TAG_BUS_STOP) + ", a " + toString(SUMO_TAG_CONTAINER_STOP) + - ", a " + toString(SUMO_TAG_CHARGING_STATION) + ", a " + toString(SUMO_TAG_PARKING_AREA) + " or a " + toString(SUMO_TAG_LANE) + errorSuffix); - return; - } - // calculate start and end position - stop.stopParameters.endPos = attrs.getOpt(SUMO_ATTR_ENDPOS, nullptr, myAbort, stop.laneStop->getLaneParametricLength()); - if (attrs.hasAttribute(SUMO_ATTR_POSITION)) { - WRITE_ERROR("Deprecated attribute 'pos' in description of stop" + errorSuffix); - stop.stopParameters.endPos = attrs.getOpt(SUMO_ATTR_POSITION, nullptr, myAbort, stop.stopParameters.endPos); - } - stop.stopParameters.startPos = attrs.getOpt(SUMO_ATTR_STARTPOS, nullptr, myAbort, MAX2(0., stop.stopParameters.endPos - 2 * POSITION_EPS)); - stop.stopParameters.friendlyPos = attrs.getOpt(SUMO_ATTR_FRIENDLY_POS, nullptr, myAbort, false); - if (!myAbort || (checkStopPos(stop.stopParameters.startPos, stop.stopParameters.endPos, stop.laneStop->getLaneParametricLength(), POSITION_EPS, stop.stopParameters.friendlyPos) != STOPPOS_VALID)) { - WRITE_ERROR("Invalid start or end position for stop on lane '" + stop.stopParameters.lane + "'" + errorSuffix); - return; - } - // set tag - stop.tag = SUMO_TAG_STOP_LANE; - // special case for persons - if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { - stop.tag = SUMO_TAG_PERSONSTOP_LANE; - } - } - // now create or store stop - if (myLoadedVehicleWithEmbebbedRoute) { - buildStop(myViewNet, true, stop.stopParameters, myLoadedVehicleWithEmbebbedRoute); - } else if (myVehicleParameter != nullptr) { - if ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW)) { - myPersonPlanValues.push_back(stop); - } else { - myVehicleParameter->stops.push_back(stop.stopParameters); - } - } else { - myActiveRouteStops.push_back(stop.stopParameters); - } -} - - -void -GNERouteHandler::addPersonTrip(const SUMOSAXAttributes& attrs) { - // SUMORouteHandler handle certain walks configurations as PersonTrips, then it needs a manually call to addWalk(...) - if (attrs.getObjectType() == "walk") { - addWalk(attrs); - } else { - // change abort flag - myAbort = false; - // declare value for saving loaded values - PersonPlansValues personTripValuesLoaded; - // first set tag - if (attrs.hasAttribute(SUMO_ATTR_TO)) { - // set tag - personTripValuesLoaded.tag = SUMO_TAG_PERSONTRIP_FROMTO; - // declare a flag to check if values are valid - bool validValues = true; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - personTripValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (personTripValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - } - personTripValuesLoaded.to = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); - personTripValuesLoaded.vTypes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_VTYPES, myAbort); - personTripValuesLoaded.modes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_MODES, myAbort); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - personTripValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (personTripValuesLoaded.to == nullptr) { - WRITE_ERROR("Invalid edge to in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - // check modes - for (const auto& i : personTripValuesLoaded.modes) { - if ((i != "public") && (i != "car") && (i != "bicycle")) { - validValues = false; - } - } - if (validValues) { - // remove duplicated modes - std::sort(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()); - personTripValuesLoaded.modes.erase(unique(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()), personTripValuesLoaded.modes.end()); - } else { - WRITE_ERROR("A person trip mode can be only a combination of 'public', 'car' or 'bicycle'"); - } - for (const auto& i : personTripValuesLoaded.vTypes) { - if (!SUMOXMLDefinitions::isValidTypeID(i)) { - WRITE_ERROR("Invalid vehicle type '" + i + "' used in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - } - // save loaded values in container only if all parameters are valid - if (validValues) { - myPersonPlanValues.push_back(personTripValuesLoaded); - } - } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { - // set tag - personTripValuesLoaded.tag = SUMO_TAG_PERSONTRIP_BUSSTOP; - // declare a flag to check if values are valid - bool validValues = true; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - personTripValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (personTripValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - } - personTripValuesLoaded.busStop = myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); - personTripValuesLoaded.vTypes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_VTYPES, myAbort); - personTripValuesLoaded.modes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_MODES, myAbort); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - personTripValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (personTripValuesLoaded.busStop == nullptr) { - WRITE_ERROR("Invalid busStop to in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - // check modes - for (const auto& i : personTripValuesLoaded.modes) { - if ((i != "public") && (i != "car") && (i != "bicycle")) { - validValues = false; - } - } - if (validValues) { - // remove duplicated modes - std::sort(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()); - personTripValuesLoaded.modes.erase(unique(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()), personTripValuesLoaded.modes.end()); - } else { - WRITE_ERROR("A person trip mode can be only a combination of 'public', 'car' or 'bicycle'"); - } - for (const auto& i : personTripValuesLoaded.vTypes) { - if (!SUMOXMLDefinitions::isValidTypeID(i)) { - WRITE_ERROR("Invalid vehicle type '" + i + "' used in " + toString(personTripValuesLoaded.tag)); - validValues = false; - } - } - // save loaded values in container only if all parameters are valid - if (validValues) { - myPersonPlanValues.push_back(personTripValuesLoaded); - } - } else { - WRITE_ERROR("A personTrip requires either a from-to edges or a from edge and a busStop"); - } - } -} - - -void -GNERouteHandler::addWalk(const SUMOSAXAttributes& attrs) { - // change abort flag - myAbort = false; - // declare value for saving loaded values - PersonPlansValues walkValuesLoaded; - // first set tag - if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { - // set tag - walkValuesLoaded.tag = SUMO_TAG_WALK_EDGES; - // parse edges - std::string edgeIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_EDGES, myAbort); - if (GNEAttributeCarrier::canParse >(myViewNet->getNet(), edgeIDs, true)) { - walkValuesLoaded.edges = GNEAttributeCarrier::parse >(myViewNet->getNet(), edgeIDs); - } - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (walkValuesLoaded.edges.empty()) { - WRITE_ERROR("Invalid edges of " + toString(walkValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(walkValuesLoaded); - } - } else if (attrs.hasAttribute(SUMO_ATTR_TO)) { - // set tag - walkValuesLoaded.tag = SUMO_TAG_WALK_FROMTO; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - walkValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (walkValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(walkValuesLoaded.tag)); - } - } - walkValuesLoaded.to = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (walkValuesLoaded.to == nullptr) { - WRITE_ERROR("Invalid edge to in " + toString(walkValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(walkValuesLoaded); - } - } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { - // set tag - walkValuesLoaded.tag = SUMO_TAG_WALK_BUSSTOP; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - walkValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (walkValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(walkValuesLoaded.tag)); - } - } - walkValuesLoaded.busStop = myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); - // use edge of busstop's lane as to edge - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (walkValuesLoaded.busStop == nullptr) { - WRITE_ERROR("Invalid busStop to in " + toString(walkValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(walkValuesLoaded); - } - } else if (attrs.hasAttribute(SUMO_ATTR_ROUTE)) { - // set tag - walkValuesLoaded.tag = SUMO_TAG_WALK_ROUTE; - // extract rest of parameters - walkValuesLoaded.route = myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ROUTE, myAbort), false); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check that all parameters are correct - if (walkValuesLoaded.route == nullptr) { - WRITE_ERROR("Invalid route from in " + toString(walkValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(walkValuesLoaded); - } - } else { - WRITE_ERROR("A walk requires either a from-to edges, a from edge and a busStop or a route"); - } -} - - -void -GNERouteHandler::addPerson(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - - -void -GNERouteHandler::addContainer(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - - -void -GNERouteHandler::addRide(const SUMOSAXAttributes& attrs) { - // change abort flag - myAbort = false; - // declare value for saving loaded values - PersonPlansValues rideValuesLoaded; - // first set tag - if (attrs.hasAttribute(SUMO_ATTR_TO)) { - // set tag - rideValuesLoaded.tag = SUMO_TAG_RIDE_FROMTO; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - rideValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (rideValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(rideValuesLoaded.tag)); - } - } - rideValuesLoaded.to = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); - rideValuesLoaded.lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_LINES, myAbort); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - rideValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check lines - if (rideValuesLoaded.lines.empty()) { - rideValuesLoaded.lines.push_back("ANY"); - } - // check that all parameters are correct - if (rideValuesLoaded.to == nullptr) { - WRITE_ERROR("Invalid edge to in " + toString(rideValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(rideValuesLoaded); - } - } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { - // set tag - rideValuesLoaded.tag = SUMO_TAG_RIDE_BUSSTOP; - // extract rest of parameters - if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - rideValuesLoaded.from = myViewNet->getNet()->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); - if (rideValuesLoaded.from == nullptr) { - WRITE_ERROR("Invalid edge from in " + toString(rideValuesLoaded.tag)); - } - } - rideValuesLoaded.busStop = myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); - rideValuesLoaded.lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_LINES, myAbort); - if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - rideValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); - } - // check lines - if (rideValuesLoaded.lines.empty()) { - rideValuesLoaded.lines.push_back("ANY"); - } - // check that all parameters are correct - if (rideValuesLoaded.busStop == nullptr) { - WRITE_ERROR("Invalid busStop to in " + toString(rideValuesLoaded.tag)); - } else { - // save loaded values in container - myPersonPlanValues.push_back(rideValuesLoaded); - } - } else { - WRITE_ERROR("A ride requires either a from-to edges or a from edge and a busStop"); - } -} - - -void -GNERouteHandler::addTransport(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - - -void -GNERouteHandler::addTranship(const SUMOSAXAttributes& /*attrs*/) { - // currently unused -} - -// =========================================================================== -// private members -// =========================================================================== - -GNERouteHandler::PersonPlansValues::PersonPlansValues() : - tag(SUMO_TAG_NOTHING), - from(nullptr), - to(nullptr), - busStop(nullptr), - containerStop(nullptr), - chargingStation(nullptr), - parkingArea(nullptr), - route(nullptr), - arrivalPos(-1), - laneStop(nullptr) { -} - - -GNEEdge* -GNERouteHandler::PersonPlansValues::getLastEdge() const { - if (edges.size() > 0) { - return edges.back(); - } else if (route) { - return route->getParentEdges().back(); - } else if (busStop) { - return busStop->getParentLanes().front()->getParentEdge(); - } else if (laneStop) { - return laneStop->getParentEdge(); - } else if (to) { - return to; - } else { - return nullptr; - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERouteHandler.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERouteHandler.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNERouteHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNERouteHandler.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,349 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteHandler.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// Builds demand objects for netedit -/****************************************************************************/ -#ifndef GNERouteHandler_h -#define GNERouteHandler_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEViewNet; -class GNEEdge; -class GNETAZ; -class GNEDemandElement; -class GNEVehicle; -class GNEPerson; -class GNEUndoList; - -// =========================================================================== -// class definitions -// =========================================================================== - -/// @class GNERouteHandler -/// @brief Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..) -class GNERouteHandler : public SUMORouteHandler { -public: - /// @brief struct for saving route parameters - struct RouteParameter { - - /// @brief constructor - RouteParameter(); - - /// @brief parameter constructor (use values of originalDemandElement) - RouteParameter(GNEDemandElement* originalDemandElement); - - /// @brief set edges (list of consecutive edges) - void setEdges(GNEViewNet* viewNet, const std::string& edgeIDs); - - /// @brief set edges (from, to and via edges) - void setEdges(GNEViewNet* viewNet, const std::string& vehicleID, const std::string& fromID, const std::string& toID, const std::string& viaIDs); - - /// @brief string for saving parsed Route ID - std::string routeID; - - /// @brief flag to check if route was loaded - bool loadedID; - - /// @brief edges - std::vector edges; - - /// @brief vClass used by this route - SUMOVehicleClass vClass; - - /// @brief string for saving parsed route colors - RGBColor color; - - /// @brief parameters - Parameterised parameters; - }; - - /// @brief Constructor - GNERouteHandler(const std::string& file, GNEViewNet* viewNet, bool undoDemandElements = true); - - /// @brief Destructor - ~GNERouteHandler(); - - /// @brief check if there is already a vehicle (Vehicle, Trip, Flow or Flow) with the given ID - static bool isVehicleIdDuplicated(GNEViewNet* viewNet, const std::string& id); - - /// @brief check if there is already a person (Person or PersonFlow) with the given ID - static bool isPersonIdDuplicated(GNEViewNet* viewNet, const std::string& id); - - /// @brief build functions - /// @{ - /// @brief build a vehicle over an existent route - static void buildVehicleOverRoute(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters); - - /// @brief build a flow over an existent route - static void buildFlowOverRoute(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters); - - /// @brief build vehicle with a embedded route - static void buildVehicleWithEmbeddedRoute(GNEViewNet* viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy); - - /// @brief build flow with a embedded route - static void buildFlowWithEmbeddedRoute(GNEViewNet* viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy); - - /// @brief build trip - static void buildTrip(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); - - /// @brief build flow - static void buildFlow(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); - - /// @brief build stop - static void buildStop(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter::Stop& stopParameters, GNEDemandElement* stopParent); - - /// @brief build person - static void buildPerson(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& personParameters); - - /// @brief build person flow - static void buildPersonFlow(GNEViewNet* viewNet, bool undoDemandElements, const SUMOVehicleParameter& personFlowParameters); - - /// @brief build trip using a from-to edges - static void buildPersonTripFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos, - const std::vector& types, const std::vector& modes); - - /// @brief build trip using a from edge and a busStop - static void buildPersonTripBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, - const std::vector& types, const std::vector& modes); - - /// @brief build walk using a list of consecutive edges - static void buildWalkEdges(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, const std::vector& edges, double arrivalPos); - - /// @brief build walk using a from-to edges - static void buildWalkFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos); - - /// @brief build walk using a from edge an a busStop - static void buildWalkBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop); - - /// @brief build walk using a list of consecutive edges - static void buildWalkRoute(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEDemandElement* route, double arrivalPos); - - /// @brief build ride using a from-to edges - static void buildRideFromTo(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& lines, double arrivalPos); - - /// @brief build ride using a from edge and a busStop - static void buildRideBusStop(GNEViewNet* viewNet, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& lines); - - /// @} - - /// @brief transform vehicle functions - /// @{ - - /// @brief transform to vehicle over an existent route - static void transformToVehicle(GNEVehicle* originalVehicle, bool createEmbeddedRoute); - - /// @brief transform routeFlow over an existent route - static void transformToRouteFlow(GNEVehicle* originalVehicle, bool createEmbeddedRoute); - - /// @brief transform to trip - static void transformToTrip(GNEVehicle* originalVehicle); - - /// @brief transform to flow - static void transformToFlow(GNEVehicle* originalVehicle); - - /// @} - - /// @brief transform person functions - /// @{ - - /// @brief transform to vehicle over an existent route - static void transformToPerson(GNEPerson* originalPerson); - - /// @brief transform routeFlow over an existent route - static void transformToPersonFlow(GNEPerson* originalPerson); - - /// @} - - /// @brief configure flow parameters - static void setFlowParameters(const SumoXMLAttr attribute, int& parameters); - -protected: - /// @brief embebbe route within a vehicle - static void embebbeRoute(GNEVehicle* vehicle, GNEUndoList* undoList); - - /// @brief separate vehicle and embedded route - static GNEVehicle* separateEmbeddedRoute(GNEVehicle* vehicle, GNEUndoList* undoList); - - /// @brief opens a type distribution for reading - void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs); - - /// @brief closes (ends) the building of a distribution - void closeVehicleTypeDistribution(); - - /// @brief opens a route for reading - void openRoute(const SUMOSAXAttributes& attrs); - - /// @brief opens a routeFlow for reading - void openFlow(const SUMOSAXAttributes& attrs); - - /// @brief opens a trip for reading - void openTrip(const SUMOSAXAttributes& attrs); - - /**closes (ends) the building of a route. - * Afterwards no edges may be added to it; - * this method may throw exceptions when - * a) the route is empty or - * b) another route with the same id already exists - */ - void closeRoute(const bool mayBeDisconnected = false); - - /// @brief opens a route distribution for reading - void openRouteDistribution(const SUMOSAXAttributes& attrs); - - /// @brief closes (ends) the building of a distribution - void closeRouteDistribution(); - - /// @brief Ends the processing of a vehicle - void closeVehicle(); - - /// @brief Ends the processing of a vehicle Type - void closeVType(); - - /// @brief Ends the processing of a person - void closePerson(); - - /// @brief Ends the processing of a personFlow - void closePersonFlow(); - - /// @brief Ends the processing of a container - void closeContainer(); - - /// @brief Ends the processing of a routeFlow - void closeFlow(); - - /// @brief Ends the processing of a trip - void closeTrip(); - - /// @brief Processing of a stop - void addStop(const SUMOSAXAttributes& attrs); - - /// @brief add a routing request for a walking or intermodal person - void addPersonTrip(const SUMOSAXAttributes& attrs); - - /// @brief add a fully specified walk - void addWalk(const SUMOSAXAttributes& attrs); - - /// @brief Processing of a person - void addPerson(const SUMOSAXAttributes& attrs); - - /// @brief Processing of a container - void addContainer(const SUMOSAXAttributes& attrs); - - /// @brief Processing of a ride - void addRide(const SUMOSAXAttributes& attrs); - - /// @brief Processing of a transport - void addTransport(const SUMOSAXAttributes& attrs); - - /// @brief Processing of a tranship - void addTranship(const SUMOSAXAttributes& attrs); - -private: - /// @brief struct used for load person plans (Rides, Walks, etc.) - struct PersonPlansValues { - /// @brief default constructor - PersonPlansValues(); - - /// @brief return last valid edge (used to create consecutive person plans) - GNEEdge* getLastEdge() const; - - /// @brief walk tag - SumoXMLTag tag; - - /// @brief from edge - GNEEdge* from; - - /// @brief to edge - GNEEdge* to; - - /// @brief via edges - std::vector via; - - /// @brief list of edges - std::vector edges; - - /// @brief busStop - GNEAdditional* busStop; - - /// @brief containerStop - GNEAdditional* containerStop; - - /// @brief chargingStation - GNEAdditional* chargingStation; - - /// @brief parkingArea - GNEAdditional* parkingArea; - - /// @brief arrival route - GNEDemandElement* route; - - /// @brief vehicle types - std::vector vTypes; - - /// @brief modes - std::vector modes; - - /// @brief lines - std::vector lines; - - /// @brief arrival pos - double arrivalPos; - - /// @brief laneStop - GNELane* laneStop; - - /// @brief stop parameters - SUMOVehicleParameter::Stop stopParameters; - }; - - /// @brief pointer to View's Net - GNEViewNet* myViewNet; - - /// @brief container for person trips loaded values - std::vector myPersonPlanValues; - - /// @brief NETEDIT Route Parameters - RouteParameter myRouteParameter; - - /// @brief flag used for parsing values - bool myAbort; - - /// @brief flag to check if created demand elements must be undo and redo - bool myUndoDemandElements; - - /// @brief Pointer to loaded vehicle with embebbed route (needed for GNEStops) - GNEDemandElement* myLoadedVehicleWithEmbebbedRoute; -}; - - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEStop.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEStop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEStop.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1127 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStop.cpp -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// Representation of Stops in NETEDIT -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEStop.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEStop::GNEStop(SumoXMLTag tag, GNEViewNet* viewNet, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent) : - GNEDemandElement(stopParent, viewNet, stopParent->getTagProperty().isPerson() ? GLO_PERSONSTOP : GLO_STOP, tag, -{}, {}, {}, {stoppingPlace}, {stopParent}, {}, {}, {}, {}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStop::GNEStop(GNEViewNet* viewNet, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent) : - GNEDemandElement(stopParent, viewNet, - stopParent->getTagProperty().isPerson() ? GLO_PERSONSTOP : GLO_STOP, - stopParent->getTagProperty().isPerson() ? SUMO_TAG_PERSONSTOP_LANE : SUMO_TAG_STOP_LANE, -{}, {lane}, {}, {}, {stopParent}, {}, {}, {}, {}, {}), -SUMOVehicleParameter::Stop(stopParameter) { -} - - -GNEStop::~GNEStop() {} - - -std::string -GNEStop::getBegin() const { - return ""; -} - - -void -GNEStop::writeDemandElement(OutputDevice& device) const { - write(device); -} - - -bool -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; - } 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 (!(parametersSet & STOP_START_SET) && !(parametersSet & STOP_END_SET)) { - return true; - } else if (!(parametersSet & STOP_START_SET)) { - return (endPosCopy <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - } else if (!(parametersSet & STOP_END_SET)) { - return (startPosCopy >= 0); - } else { - 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 "; - } - return errorStart + separator + errorEnd; -} - - -void -GNEStop::fixDemandElementProblem() { - // -} - - -GNEEdge* -GNEStop::getFromEdge() const { - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); - } else { - return getParentLanes().front()->getParentEdge(); - } -} - - -GNEEdge* -GNEStop::getToEdge() const { - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); - } else { - return getParentLanes().front()->getParentEdge(); - } -} - - -SUMOVehicleClass -GNEStop::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEStop::getColor() const { - if (myTagProperty.isPersonStop()) { - return myViewNet->getVisualisationSettings().colorSettings.personStops; - } else { - return myViewNet->getVisualisationSettings().colorSettings.stops; - } -} - - -void -GNEStop::startGeometryMoving() { - // only start geometry moving if stop is placed over a lane - if (getParentLanes().size() > 0) { - // always save original position over view - myStopMove.originalViewPosition = getPositionInView(); - // save start and end position - myStopMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_STARTPOS); - myStopMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); - // save current centering boundary - myStopMove.movingGeometryBoundary = getCenteringBoundary(); - } -} - - -void -GNEStop::endGeometryMoving() { - // check that stop is placed over a lane and endGeometryMoving was called only once - if ((getParentLanes().size() > 0) && myStopMove.movingGeometryBoundary.isInitialised()) { - // reset myMovingGeometryBoundary - myStopMove.movingGeometryBoundary.reset(); - } -} - - -void -GNEStop::moveGeometry(const Position& offset) { - // only move if at leats start or end positions is defined - if ((getParentLanes().size() > 0) && ((parametersSet & STOP_START_SET) || (parametersSet & STOP_END_SET))) { - // Calculate new position using old position - Position newPosition = myStopMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myStopMove.originalViewPosition, false); - // check if both position has to be moved - if ((parametersSet & STOP_START_SET) && (parametersSet & STOP_END_SET)) { - // calculate stoppingPlace length and lane length (After apply geometry factor) - double stoppingPlaceLength = fabs(parse(myStopMove.secondOriginalPosition) - parse(myStopMove.firstOriginalLanePosition)); - double laneLengt = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); - // avoid changing stopping place's length - if ((parse(myStopMove.firstOriginalLanePosition) + offsetLane) < 0) { - startPos = 0; - endPos = stoppingPlaceLength; - } else if ((parse(myStopMove.secondOriginalPosition) + offsetLane) > laneLengt) { - startPos = laneLengt - stoppingPlaceLength; - endPos = laneLengt; - } else { - startPos = parse(myStopMove.firstOriginalLanePosition) + offsetLane; - endPos = parse(myStopMove.secondOriginalPosition) + offsetLane; - } - } else { - // check if start position must be moved - if ((parametersSet & STOP_START_SET)) { - startPos = parse(myStopMove.firstOriginalLanePosition) + offsetLane; - } - // check if start position must be moved - if ((parametersSet & STOP_END_SET)) { - endPos = parse(myStopMove.secondOriginalPosition) + offsetLane; - } - } - // update geometry - updateGeometry(); - } -} - - -void -GNEStop::commitGeometryMoving(GNEUndoList* undoList) { - // only commit geometry moving if at leats start or end positions is defined - if ((getParentLanes().size() > 0) && ((parametersSet & STOP_START_SET) || (parametersSet & STOP_END_SET))) { - undoList->p_begin("position of " + getTagStr()); - if (parametersSet & STOP_START_SET) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_STARTPOS, toString(startPos), true, myStopMove.firstOriginalLanePosition)); - } - if (parametersSet & STOP_END_SET) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ENDPOS, toString(endPos), true, myStopMove.secondOriginalPosition)); - } - undoList->p_end(); - } -} - - -void -GNEStop::updateGeometry() { - //only update Stops over lanes, because other uses the geometry of stopping place parent - if (getParentLanes().size() > 0) { - // Cut shape using as delimitators fixed start position and fixed end position - myDemandElementGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); - } else if (getParentAdditionals().size() > 0) { - // use geometry of additional (busStop) - myDemandElementGeometry.updateGeometry(getParentAdditionals().at(0)); - } - // recompute geometry of all Demand elements related with this this stop - if (getParentDemandElements().front()->getTagProperty().isRoute()) { - getParentDemandElements().front()->updateGeometry(); - } else if (getParentDemandElements().front()->getTagProperty().isPerson()) { - // compute previous and next person plan - GNEDemandElement* previousDemandElement = getParentDemandElements().front()->getPreviousChildDemandElement(this); - if (previousDemandElement) { - previousDemandElement->updateGeometry(); - } - GNEDemandElement* nextDemandElement = getParentDemandElements().front()->getNextChildDemandElement(this); - if (nextDemandElement) { - nextDemandElement->updateGeometry(); - } - } -} - - -void -GNEStop::updateDottedContour() { - // -} - - -void -GNEStop::updatePartialGeometry(const GNEEdge* edge) { - //only update Stops over lanes, because other uses the geometry of stopping place parent - if (getParentLanes().size() > 0) { - // Cut shape using as delimitators fixed start position and fixed end position - myDemandElementGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); - } else if (getParentAdditionals().size() > 0) { - // use geometry of additional (busStop) - myDemandElementGeometry.updateGeometry(getParentAdditionals().at(0)); - } - // recompute geometry of all Demand elements related with this this stop - if (getParentDemandElements().front()->getTagProperty().isRoute()) { - getParentDemandElements().front()->updatePartialGeometry(edge); - } else if (getParentDemandElements().front()->getTagProperty().isPerson()) { - // compute previous and next person plan - GNEDemandElement* previousDemandElement = getParentDemandElements().front()->getPreviousChildDemandElement(this); - if (previousDemandElement) { - previousDemandElement->updatePartialGeometry(edge); - } - GNEDemandElement* nextDemandElement = getParentDemandElements().front()->getNextChildDemandElement(this); - if (nextDemandElement) { - nextDemandElement->updatePartialGeometry(edge); - } - } -} - - -void -GNEStop::computePath() { - // nothing to compute -} - - -void -GNEStop::invalidatePath() { - // nothing to invalidate -} - - -Position -GNEStop::getPositionInView() const { - if (getParentLanes().size() > 0) { - // calculate start and end positions as absolute values - double start = fabs(parametersSet & STOP_START_SET ? startPos : 0); - double end = fabs(parametersSet & STOP_END_SET ? endPos : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); - // obtain position in view depending if both positions are defined - if (!(parametersSet & STOP_START_SET) && !(parametersSet & STOP_END_SET)) { - return getParentLanes().front()->getLaneShape().positionAtOffset(getParentLanes().front()->getLaneShape().length() / 2); - } else if (!(parametersSet & STOP_START_SET)) { - return getParentLanes().front()->getLaneShape().positionAtOffset(end); - } else if (!(parametersSet & STOP_END_SET)) { - return getParentLanes().front()->getLaneShape().positionAtOffset(start); - } else { - return getParentLanes().front()->getLaneShape().positionAtOffset((start + end) / 2.0); - } - } else if (getParentDemandElements().size() > 0) { - return getParentDemandElements().front()->getPositionInView(); - } else { - throw ProcessError("Invalid Stop parent"); - } -} - - -std::string -GNEStop::getParentName() const { - if (getParentDemandElements().size() > 0) { - return getParentDemandElements().front()->getID(); - } else if (getParentAdditionals().size() > 0) { - return getParentAdditionals().front()->getID(); - } else if (getParentLanes().size() > 0) { - return getParentLanes().front()->getID(); - } else { - throw ProcessError("Invalid parent"); - } -} - - -Boundary -GNEStop::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (getParentAdditionals().size() > 0) { - return getParentAdditionals().at(0)->getCenteringBoundary(); - } else if (myStopMove.movingGeometryBoundary.isInitialised()) { - return myStopMove.movingGeometryBoundary; - } else if (myDemandElementGeometry.getShape().size() > 0) { - Boundary b = myDemandElementGeometry.getShape().getBoxBoundary(); - b.grow(20); - return b; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNEStop::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEStop::drawGL(const GUIVisualizationSettings& s) const { - // declare flag to enable or disable draw person plan - bool drawPersonPlan = false; - if (myTagProperty.isStop() || myTagProperty.isPersonStop()) { - if (myViewNet->getNetworkViewOptions().showDemandElements() && myViewNet->getDemandViewOptions().showNonInspectedDemandElements(this)) { - drawPersonPlan = true; - } - } else if (myViewNet->getDemandViewOptions().showAllPersonPlans()) { - drawPersonPlan = true; - } else if (myViewNet->getDottedAC() == getParentDemandElements().front()) { - drawPersonPlan = true; - } else if (myViewNet->getDemandViewOptions().getLockedPerson() == getParentDemandElements().front()) { - drawPersonPlan = true; - } else if (myViewNet->getDottedAC() && myViewNet->getDottedAC()->getTagProperty().isPersonPlan() && - (myViewNet->getDottedAC()->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT))) { - drawPersonPlan = true; - } - // check if stop can be drawn - if (drawPersonPlan) { - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, this); - // declare value to save stop color - RGBColor stopColor; - // Set color - if (drawUsingSelectColor()) { - if (myTagProperty.isPersonStop()) { - stopColor = s.colorSettings.selectedPersonPlanColor; - } else { - stopColor = s.colorSettings.selectedRouteColor; - } - } else if (myTagProperty.isPersonStop()) { - stopColor = s.colorSettings.personStops; - } else { - stopColor = s.colorSettings.stops; - } - // Start drawing adding an gl identificator - glPushName(getGlID()); - // Add a draw matrix - glPushMatrix(); - // set Color - GLHelper::setColor(stopColor); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, getType()); - // draw depending of details - if (s.drawDetail(s.detailSettings.stopsDetails, exaggeration) && getParentLanes().size() > 0) { - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), myDemandElementGeometry.getShapeRotations(), myDemandElementGeometry.getShapeLengths(), exaggeration * 0.1, 0, - getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); - GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), myDemandElementGeometry.getShapeRotations(), myDemandElementGeometry.getShapeLengths(), exaggeration * 0.1, 0, - getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * -0.5); - // pop draw matrix - glPopMatrix(); - // Add a draw matrix - glPushMatrix(); - // move to geometry front - glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), getType()); - glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1); - // draw front of Stop depending if it's placed over a lane or over a stoppingPlace - if (getParentLanes().size() > 0) { - // draw front of Stop - GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, - getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); - } else { - // draw front of Stop - GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, exaggeration); - } - // move to "S" position - glTranslated(0, 1, 0); - // 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 draw matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - // draw dooted contour depending if it's placed over a lane or over a stoppingPlace - if (getParentLanes().size() > 0) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), myDemandElementGeometry.getShape(), - getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); - } else { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), myDemandElementGeometry.getShape(), exaggeration); - } - } - } else { - // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration - GNEGeometry::drawGeometry(myViewNet, myDemandElementGeometry, exaggeration * 0.8); - // pop draw matrix - glPopMatrix(); - } - // Pop name - glPopName(); - // 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::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(GLO_STOP); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEStop::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(GLO_STOP); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEStop::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - 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_EXTENSION: - if (parametersSet & STOP_EXTENSION_SET) { - return time2string(extension); - } else { - return ""; - } - case SUMO_ATTR_INDEX: - if (index == STOP_INDEX_END) { - return "end"; - } else if (index == STOP_INDEX_FIT) { - return "fit"; - } else { - return toString(index); - } - 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"; - } else { - return "0"; - } - case SUMO_ATTR_EXPECTED: - if (parametersSet & STOP_EXPECTED_SET) { - 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) { - return tripId; - } else { - return ""; - } - // 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: - return getParentAdditionals().front()->getID(); - // specific of stops over lanes - case SUMO_ATTR_LANE: - return getParentLanes().front()->getID(); - case SUMO_ATTR_STARTPOS: - if (parametersSet & STOP_START_SET) { - return toString(startPos); - } else { - return ""; - } - case SUMO_ATTR_ENDPOS: - if (parametersSet & STOP_END_SET) { - return toString(endPos); - } else { - return ""; - } - 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 an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEStop::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_STARTPOS: - if (parametersSet & STOP_START_SET) { - return startPos; - } else { - return 0; - } - case SUMO_ATTR_ENDPOS: - if (parametersSet & STOP_END_SET) { - return endPos; - } else { - return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEStop::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: - case SUMO_ATTR_DURATION: - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - case SUMO_ATTR_INDEX: - 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 GNE_ATTR_SELECTED: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEStop::isValid(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_ID: - return isValidDemandElementID(value); - 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_INDEX: - if ((value == "fit") || (value == "end")) { - return true; - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - 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 true; - } else { - std::vector IDs = parse>(value); - for (const auto& i : IDs) { - if (SUMOXMLDefinitions::isValidVehicleID(i) == false) { - return false; - } - } - return true; - } - case SUMO_ATTR_PARKING: - return canParse(value); - case SUMO_ATTR_ACTTYPE: - return true; - case SUMO_ATTR_TRIP_ID: - return SUMOXMLDefinitions::isValidVehicleID(value); - // specific of Stops over stoppingPlaces - case SUMO_ATTR_BUS_STOP: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); - case SUMO_ATTR_CONTAINER_STOP: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr); - case SUMO_ATTR_CHARGING_STATION: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_CHARGING_STATION, value, false) != nullptr); - case SUMO_ATTR_PARKING_AREA: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); - // specific of stops over lanes - case SUMO_ATTR_LANE: - if (myViewNet->getNet()->retrieveLane(value, false) != nullptr) { - return true; - } else { - return false; - } - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(parse(value), endPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPos); - } else { - return false; - } - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return SUMORouteHandler::isStopPosValid(startPos, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPos); - } else { - return false; - } - 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 -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_STARTPOS: - newParametersSet |= STOP_START_SET; - break; - case SUMO_ATTR_ENDPOS: - newParametersSet |= STOP_END_SET; - break; - 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; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, myViewNet->getNet(), parametersSet, newParametersSet), true); - // modify parametersSetCopy depending of attr - switch (key) { - case SUMO_ATTR_STARTPOS: - if (parametersSet & STOP_END_SET) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, toString(endPos - MIN_STOP_LENGTH))); - } else { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, toString(getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() - MIN_STOP_LENGTH))); - } - break; - case SUMO_ATTR_ENDPOS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, toString(getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()))); - break; - case SUMO_ATTR_DURATION: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - case SUMO_ATTR_UNTIL: - case SUMO_ATTR_EXTENSION: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, myTagProperty.getAttributeProperties(key).getDefaultValue())); - break; - default: - break; - } -} - - -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_STARTPOS: - newParametersSet &= ~STOP_START_SET; - break; - case SUMO_ATTR_ENDPOS: - newParametersSet &= ~STOP_END_SET; - break; - 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; - break; - default: - break; - } - // add GNEChange_EnableAttribute - undoList->add(new GNEChange_EnableAttribute(this, myViewNet->getNet(), parametersSet, newParametersSet), true); -} - - -bool -GNEStop::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - // Currently stops parents cannot be edited - case SUMO_ATTR_BUS_STOP: - case SUMO_ATTR_CONTAINER_STOP: - case SUMO_ATTR_CHARGING_STATION: - case SUMO_ATTR_PARKING_AREA: - return false; - case SUMO_ATTR_STARTPOS: - return (parametersSet & STOP_START_SET) != 0; - case SUMO_ATTR_ENDPOS: - return (parametersSet & STOP_END_SET) != 0; - case SUMO_ATTR_DURATION: - return (parametersSet & STOP_DURATION_SET) != 0; - case SUMO_ATTR_UNTIL: - return (parametersSet & STOP_UNTIL_SET) != 0; - case SUMO_ATTR_EXTENSION: - return (parametersSet & STOP_EXTENSION_SET) != 0; - case SUMO_ATTR_EXPECTED: - return (parametersSet & STOP_TRIGGER_SET) != 0; - case SUMO_ATTR_EXPECTED_CONTAINERS: - return (parametersSet & STOP_CONTAINER_TRIGGER_SET) != 0; - case SUMO_ATTR_PARKING: - return (parametersSet & STOP_PARKING_SET) != 0; - default: - return true; - } -} - - -std::string -GNEStop::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEStop::getHierarchyName() const { - std::string stopType; - // first distinguish between person stops and vehicles stops - if (getParentDemandElements().front()->getTagProperty().isPerson()) { - stopType = "person stop"; - } else { - stopType = "vehicle stop"; - } - if (getParentAdditionals().size() > 0) { - return stopType + ": " + getParentAdditionals().front()->getTagStr(); - } else { - return stopType + ": lane"; - } -} - - -double -GNEStop::getStartGeometryPositionOverLane() const { - double fixedPos = 0; - if (parametersSet & STOP_START_SET) { - fixedPos = startPos; - } else if (parametersSet & STOP_END_SET) { - fixedPos = endPos - MIN_STOP_LENGTH; - } else { - fixedPos = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() - MIN_STOP_LENGTH; - } - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - if (fixedPos < 0) { - fixedPos += len; - } - return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); -} - - -double -GNEStop::getEndGeometryPositionOverLane() const { - double fixedPos = 0; - if (parametersSet & STOP_END_SET) { - fixedPos = endPos; - } else { - fixedPos = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - } - const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); - if (fixedPos < 0) { - fixedPos += len; - } - return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEStop::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - changeDemandElementID(value); - break; - 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_EXTENSION: - if (value.empty()) { - parametersSet &= ~STOP_EXTENSION_SET; - } else { - extension = string2time(value); - parametersSet |= STOP_EXTENSION_SET; - } - break; - case SUMO_ATTR_INDEX: - if (value == "fit") { - index = STOP_INDEX_FIT; - } else if (value == "end") { - index = STOP_INDEX_END; - } else { - index = parse(value); - } - 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; - } 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; - } - 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; - } - break; - case SUMO_ATTR_PARKING: - parking = parse(value); - break; - case SUMO_ATTR_ACTTYPE: - actType = value; - break; - case SUMO_ATTR_TRIP_ID: - if (value.empty()) { - parametersSet &= ~STOP_TRIP_ID_SET; - } else { - tripId = value; - parametersSet |= STOP_TRIP_ID_SET; - } - break; - // 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: - replaceParentAdditional(this, value, 0); - updateGeometry(); - break; - // specific of Stops over lanes - case SUMO_ATTR_LANE: - replaceParentLanes(this, value); - updateGeometry(); - break; - case SUMO_ATTR_STARTPOS: - if (value.empty()) { - parametersSet &= ~STOP_START_SET; - } else { - startPos = parse(value); - parametersSet |= STOP_START_SET; - } - updateGeometry(); - break; - case SUMO_ATTR_ENDPOS: - if (value.empty()) { - parametersSet &= ~STOP_END_SET; - } else { - endPos = parse(value); - parametersSet |= STOP_END_SET; - } - 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 -GNEStop::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEStop.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEStop.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEStop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEStop.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,231 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStop.h -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// Representation of Stops in NETEDIT -/****************************************************************************/ -#ifndef GNEStop_h -#define GNEStop_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include "GNEDemandElement.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEStop - */ -class GNEStop : public GNEDemandElement, public SUMOVehicleParameter::Stop { - -public: - /// @brief constructor used for stops over stoppingPlaces - GNEStop(SumoXMLTag tag, GNEViewNet* viewNet, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent); - - /// @brief constructor used for stops over lanes - GNEStop(GNEViewNet* viewNet, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent); - - /// @brief destructor - ~GNEStop(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @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 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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 start position over lane that is applicable to the shape - double getStartGeometryPositionOverLane() const; - - /// @brief get end position over lane that is applicable to the shape - double getEndGeometryPositionOverLane() const; - -protected: - /// @brief variable demand element move - DemandElementMove myStopMove; - -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 Invalidated copy constructor. - GNEStop(const GNEStop&) = delete; - - /// @brief Invalidated assignment operator - GNEStop& operator=(const GNEStop&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicle.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicle.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicle.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1848 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVehicle.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// Representation of vehicles in NETEDIT -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVehicle.h" -#include "GNERouteHandler.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -FXDEFMAP(GNEVehicle::GNESingleVehiclePopupMenu) GNESingleVehiclePopupMenuMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_VEHICLE_TRANSFORM, GNEVehicle::GNESingleVehiclePopupMenu::onCmdTransform), -}; - -FXDEFMAP(GNEVehicle::GNESelectedVehiclesPopupMenu) GNESelectedVehiclesPopupMenuMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_VEHICLE_TRANSFORM, GNEVehicle::GNESelectedVehiclesPopupMenu::onCmdTransform), -}; - -// Object implementation -FXIMPLEMENT(GNEVehicle::GNESingleVehiclePopupMenu, GUIGLObjectPopupMenu, GNESingleVehiclePopupMenuMap, ARRAYNUMBER(GNESingleVehiclePopupMenuMap)) -FXIMPLEMENT(GNEVehicle::GNESelectedVehiclesPopupMenu, GUIGLObjectPopupMenu, GNESelectedVehiclesPopupMenuMap, ARRAYNUMBER(GNESelectedVehiclesPopupMenuMap)) - -// =========================================================================== -// GNEVehicle::GNESingleVehiclePopupMenu -// =========================================================================== - -GNEVehicle::GNESingleVehiclePopupMenu::GNESingleVehiclePopupMenu(GNEVehicle* vehicle, GUIMainWindow& app, GUISUMOAbstractView& parent) : - GUIGLObjectPopupMenu(app, parent, *vehicle), - myVehicle(vehicle), - myTransformToVehicle(nullptr), - myTransformToVehicleWithEmbeddedRoute(nullptr), - myTransformToRouteFlow(nullptr), - myTransformToRouteFlowWithEmbeddedRoute(nullptr), - myTransformToTrip(nullptr), - myTransformToFlow(nullptr) { - // build header - myVehicle->buildPopupHeader(this, app); - // build menu command for center button and copy cursor position to clipboard - myVehicle->buildCenterPopupEntry(this); - myVehicle->buildPositionCopyEntry(this, false); - // buld menu commands for names - new FXMenuCommand(this, ("Copy " + myVehicle->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); - new FXMenuCommand(this, ("Copy " + myVehicle->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); - new FXMenuSeparator(this); - // build selection and show parameters menu - myVehicle->getViewNet()->buildSelectionACPopupEntry(this, myVehicle); - myVehicle->buildShowParamsPopupEntry(this); - // add transform functions only in demand mode - if (myVehicle->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) { - // Get icons - FXIcon* vehicleIcon = GUIIconSubSys::getIcon(ICON_VEHICLE); - FXIcon* tripIcon = GUIIconSubSys::getIcon(ICON_TRIP); - FXIcon* routeFlowIcon = GUIIconSubSys::getIcon(ICON_ROUTEFLOW); - FXIcon* flowIcon = GUIIconSubSys::getIcon(ICON_FLOW); - // create menu pane for transform operations - FXMenuPane* transformOperation = new FXMenuPane(this); - this->insertMenuPaneChild(transformOperation); - new FXMenuCascade(this, "transform to", nullptr, transformOperation); - // Create menu comands for all transform - myTransformToVehicle = new FXMenuCommand(transformOperation, "Vehicle", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, "Vehicle (embedded route)", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToRouteFlow = new FXMenuCommand(transformOperation, "RouteFlow", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, "RouteFlow (embedded route)", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToTrip = new FXMenuCommand(transformOperation, "Trip", tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToFlow = new FXMenuCommand(transformOperation, "Flow", flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - // check what menu command has to be disabled - if (myVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) { - if (myVehicle->getParentDemandElements().size() > 1) { - myTransformToVehicle->disable(); - } else { - myTransformToVehicleWithEmbeddedRoute->disable(); - } - } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW) { - if (myVehicle->getParentDemandElements().size() > 1) { - myTransformToRouteFlow->disable(); - } else { - myTransformToRouteFlowWithEmbeddedRoute->disable(); - } - } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP) { - myTransformToTrip->disable(); - } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) { - myTransformToFlow->disable(); - } - } -} - - -GNEVehicle::GNESingleVehiclePopupMenu::~GNESingleVehiclePopupMenu() {} - - -long -GNEVehicle::GNESingleVehiclePopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { - if (obj == myTransformToVehicle) { - GNERouteHandler::transformToVehicle(myVehicle, false); - } else if (obj == myTransformToVehicleWithEmbeddedRoute) { - GNERouteHandler::transformToVehicle(myVehicle, true); - } else if (obj == myTransformToRouteFlow) { - GNERouteHandler::transformToRouteFlow(myVehicle, false); - } else if (obj == myTransformToRouteFlowWithEmbeddedRoute) { - GNERouteHandler::transformToRouteFlow(myVehicle, true); - } else if (obj == myTransformToTrip) { - GNERouteHandler::transformToTrip(myVehicle); - } else if (obj == myTransformToFlow) { - GNERouteHandler::transformToFlow(myVehicle); - } - return 1; -} - -// =========================================================================== -// GNEVehicle::GNESelectedVehiclesPopupMenu -// =========================================================================== - -GNEVehicle::GNESelectedVehiclesPopupMenu::GNESelectedVehiclesPopupMenu(GNEVehicle* vehicle, const std::vector& selectedVehicle, GUIMainWindow& app, GUISUMOAbstractView& parent) : - GUIGLObjectPopupMenu(app, parent, *vehicle), - mySelectedVehicles(selectedVehicle), - myVehicleTag(vehicle->getTagProperty().getTag()), - myTransformToVehicle(nullptr), - myTransformToVehicleWithEmbeddedRoute(nullptr), - myTransformToRouteFlow(nullptr), - myTransformToRouteFlowWithEmbeddedRoute(nullptr), - myTransformToTrip(nullptr), - myTransformToFlow(nullptr), - myTransformAllVehiclesToVehicle(nullptr), - myTransformAllVehiclesToVehicleWithEmbeddedRoute(nullptr), - myTransformAllVehiclesToRouteFlow(nullptr), - myTransformAllVehiclesToRouteFlowWithEmbeddedRoute(nullptr), - myTransformAllVehiclesToTrip(nullptr), - myTransformAllVehiclesToFlow(nullptr) { - // build header - vehicle->buildPopupHeader(this, app); - // build menu command for center button and copy cursor position to clipboard - vehicle->buildCenterPopupEntry(this); - vehicle->buildPositionCopyEntry(this, false); - // buld menu commands for names - new FXMenuCommand(this, ("Copy " + vehicle->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); - new FXMenuCommand(this, ("Copy " + vehicle->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); - new FXMenuSeparator(this); - // build selection and show parameters menu - vehicle->getViewNet()->buildSelectionACPopupEntry(this, vehicle); - vehicle->buildShowParamsPopupEntry(this); - // add transform functions only in demand mode - if (vehicle->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) { - // Get icons - FXIcon* vehicleIcon = GUIIconSubSys::getIcon(ICON_VEHICLE); - FXIcon* tripIcon = GUIIconSubSys::getIcon(ICON_TRIP); - FXIcon* routeFlowIcon = GUIIconSubSys::getIcon(ICON_ROUTEFLOW); - FXIcon* flowIcon = GUIIconSubSys::getIcon(ICON_FLOW); - // create menu pane for transform operations - FXMenuPane* transformOperation = new FXMenuPane(this); - this->insertMenuPaneChild(transformOperation); - new FXMenuCascade(this, "transform to", nullptr, transformOperation); - // Create menu comands for all transform - myTransformToVehicle = new FXMenuCommand(transformOperation, - ("Vehicles (Only " + vehicle->getTagStr() + ")").c_str(), vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, - ("Vehicles (embedded route, only " + vehicle->getTagStr() + ")").c_str(), vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToRouteFlow = new FXMenuCommand(transformOperation, - ("RouteFlows (Only " + vehicle->getTagStr() + ")").c_str(), routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, - ("RouteFlows (embedded route, only " + vehicle->getTagStr() + ")").c_str(), routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToTrip = new FXMenuCommand(transformOperation, - ("Trips (Only " + vehicle->getTagStr() + ")").c_str(), tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformToFlow = new FXMenuCommand(transformOperation, - ("Flows (Only " + vehicle->getTagStr() + ")").c_str(), flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - // create separator - new FXMenuSeparator(transformOperation); - // Create menu comands for all transform all vehicles - myTransformAllVehiclesToVehicle = new FXMenuCommand(transformOperation, "Vehicles", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformAllVehiclesToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, "Vehicles (embedded route)", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformAllVehiclesToRouteFlow = new FXMenuCommand(transformOperation, "RouteFlows", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformAllVehiclesToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, "RouteFlows (embedded route)", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformAllVehiclesToTrip = new FXMenuCommand(transformOperation, "Trips", tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); - myTransformAllVehiclesToFlow = new FXMenuCommand(transformOperation, "Flows", flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); - } -} - - -GNEVehicle::GNESelectedVehiclesPopupMenu::~GNESelectedVehiclesPopupMenu() {} - - -long -GNEVehicle::GNESelectedVehiclesPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { - // iterate over all selected vehicles - for (const auto& i : mySelectedVehicles) { - if ((obj == myTransformToVehicle) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToVehicle(i, false); - } else if ((obj == myTransformToVehicleWithEmbeddedRoute) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToVehicle(i, true); - } else if ((obj == myTransformToRouteFlow) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToRouteFlow(i, false); - } else if ((obj == myTransformToRouteFlowWithEmbeddedRoute) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToRouteFlow(i, true); - } else if ((obj == myTransformToTrip) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToTrip(i); - } else if ((obj == myTransformToFlow) && - (i->getTagProperty().getTag() == myVehicleTag)) { - GNERouteHandler::transformToFlow(i); - } else if (obj == myTransformAllVehiclesToVehicle) { - GNERouteHandler::transformToVehicle(i, false); - } else if (obj == myTransformAllVehiclesToVehicleWithEmbeddedRoute) { - GNERouteHandler::transformToVehicle(i, true); - } else if (obj == myTransformAllVehiclesToRouteFlow) { - GNERouteHandler::transformToRouteFlow(i, false); - } else if (obj == myTransformAllVehiclesToRouteFlowWithEmbeddedRoute) { - GNERouteHandler::transformToRouteFlow(i, true); - } else if (obj == myTransformAllVehiclesToTrip) { - GNERouteHandler::transformToTrip(i); - } else if (obj == myTransformAllVehiclesToFlow) { - GNERouteHandler::transformToFlow(i); - } - } - return 1; -} - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEVehicle::GNEVehicle(SumoXMLTag tag, GNEViewNet* viewNet, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route) : - GNEDemandElement(vehicleID, viewNet, (tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, tag, -{}, {}, {}, {}, {vehicleType, route}, {}, {}, {}, {}, {}), -SUMOVehicleParameter() { - // SUMOVehicleParameter ID has to be set manually - id = vehicleID; - // set manually vtypeID (needed for saving) - vtypeid = vehicleType->getID(); -} - - -GNEVehicle::GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters) : - GNEDemandElement(vehicleParameters.id, viewNet, (vehicleParameters.tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, vehicleParameters.tag, -{}, {}, {}, {}, {vehicleType, route}, {}, {}, {}, {}, {}), -SUMOVehicleParameter(vehicleParameters) { - // SUMOVehicleParameter ID has to be set manually - id = vehicleParameters.id; - // set manually vtypeID (needed for saving) - vtypeid = vehicleType->getID(); -} - - -GNEVehicle::GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, const SUMOVehicleParameter& vehicleParameters) : - GNEDemandElement(vehicleParameters.id, viewNet, (vehicleParameters.tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, vehicleParameters.tag, -{}, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}), -SUMOVehicleParameter(vehicleParameters) { - // SUMOVehicleParameter ID has to be set manually - id = vehicleParameters.id; - // reset routeid - routeid.clear(); - // set manually vtypeID (needed for saving) - vtypeid = vehicleType->getID(); -} - - -GNEVehicle::GNEVehicle(SumoXMLTag tag, GNEViewNet* viewNet, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, - const std::vector& via) : - GNEDemandElement(vehicleID, viewNet, (tag == SUMO_TAG_FLOW) ? GLO_FLOW : GLO_TRIP, tag, { - fromEdge, toEdge -}, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}), -SUMOVehicleParameter() { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute vehicle - computePath(); -} - - -GNEVehicle::GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, - const SUMOVehicleParameter& vehicleParameters) : - GNEDemandElement(vehicleParameters.id, viewNet, (vehicleParameters.tag == SUMO_TAG_FLOW) ? GLO_FLOW : GLO_TRIP, vehicleParameters.tag, { - fromEdge, toEdge -}, {}, {}, {}, {vehicleType}, {}, {}, {}, {}, {}), -SUMOVehicleParameter(vehicleParameters) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute vehicle - computePath(); -} - - -GNEVehicle::~GNEVehicle() {} - - -std::string -GNEVehicle::getBegin() const { - // obtain depart depending if is a Vehicle, trip or routeFlow - std::string departStr; - if ((myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - departStr = toString(depart); - } else { - departStr = getDepart(); - } - // we need to handle depart as a tuple of 20 numbers (format: 000000...00) - departStr.reserve(20 - departStr.size()); - // add 0s at the beginning of departStr until we have 20 numbers - for (int i = (int)departStr.size(); i < 20; i++) { - departStr.insert(departStr.begin(), '0'); - } - return departStr; -} - - -void -GNEVehicle::writeDemandElement(OutputDevice& device) const { - // obtain tag depending if tagProperty has a synonym - SumoXMLTag synonymTag = myTagProperty.hasTagSynonym() ? myTagProperty.getTagSynonym() : myTagProperty.getTag(); - // 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(), synonymTag); - // set VType parameter again - parametersSet |= VEHPARS_VTYPE_SET; - } else { - // write vehicle attributes, including VType - write(device, OptionsCont::getOptions(), synonymTag, getParentDemandElements().at(0)->getID()); - } - // write specific attribute depeding of tag property - if ((getParentDemandElements().size() == 2) && (myTagProperty.getTag() == SUMO_TAG_VEHICLE || myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { - // write manually route - device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); - } - // write from, to and edge vias - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // write manually from/to edges (it correspond to fron and back parent edges) - device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); - device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); - // only write via if there isn't empty - if (via.size() > 0) { - device.writeAttr(SUMO_ATTR_VIA, via); - } - } - // write specific routeFlow/flow attributes - if ((myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // write routeFlow values depending if it was set - if (isAttributeEnabled(SUMO_ATTR_END)) { - device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); - } - if (isAttributeEnabled(SUMO_ATTR_NUMBER)) { - device.writeAttr(SUMO_ATTR_NUMBER, repetitionNumber); - } - if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { - device.writeAttr(SUMO_ATTR_VEHSPERHOUR, 3600. / STEPS2TIME(repetitionOffset)); - } - if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { - device.writeAttr(SUMO_ATTR_PERIOD, time2string(repetitionOffset)); - } - if (isAttributeEnabled(SUMO_ATTR_PROB)) { - device.writeAttr(SUMO_ATTR_PROB, repetitionProbability); - } - } - // write parameters - writeParams(device); - // write child demand elements associated to this vehicle - for (const auto& i : getChildDemandElements()) { - i->writeDemandElement(device); - } - // close vehicle tag - device.closeTag(); -} - - -bool -GNEVehicle::isDemandElementValid() const { - // only trips or flows can have problems - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // check if from and to are the same edges - if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { - return true; - } else if (getPathEdges().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - } else { - return false; - } - } else if (getParentDemandElements().size() == 2) { - // check if exist a valid path using route parent edges - if (getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentDemandElements().at(1)->getParentEdges()).size() > 0) { - return true; - } else { - return false; - } - } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE)) { - // check if exist a valid path using embebbed route edges - if (getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getChildDemandElements().front()->getParentEdges()).size() > 0) { - return true; - } else { - return false; - } - } else { - return false; - } -} - - -std::string -GNEVehicle::getDemandElementProblem() const { - // only trips or flows can have problems - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // check if exist at least a connection between every edge - for (int i = 1; i < (int)getParentEdges().size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { - return ("There is no valid path between edges '" + getParentEdges().at((int)i - 1)->getID() + "' and '" + getParentEdges().at(i)->getID() + "'"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } else if (getParentDemandElements().size() == 2) { - // get route parent edges - const std::vector& routeEdges = getParentDemandElements().at(1)->getParentEdges(); - // check if exist at least a connection between every edge - for (int i = 1; i < (int)routeEdges.size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), routeEdges.at((int)i - 1), routeEdges.at(i)) == false) { - return ("There is no valid path between route edges '" + routeEdges.at((int)i - 1)->getID() + "' and '" + routeEdges.at(i)->getID() + "'"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE)) { - // get embebbed route edges - const std::vector& routeEdges = getChildDemandElements().front()->getParentEdges(); - // check if exist at least a connection between every edge - for (int i = 1; i < (int)routeEdges.size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), routeEdges.at((int)i - 1), routeEdges.at(i)) == false) { - return ("There is no valid path between embebbed route edges '" + routeEdges.at((int)i - 1)->getID() + "' and '" + routeEdges.at(i)->getID() + "'"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } else { - return ""; - } -} - - -void -GNEVehicle::fixDemandElementProblem() { - -} - - -GNEEdge* -GNEVehicle::getFromEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain edge of route - return getParentDemandElements().at(1)->getFromEdge(); - } else if (getParentEdges().size() > 0) { - return getParentEdges().front(); - } else if (getChildDemandElements().size() > 0) { - // obtain edge of embedded route - return getChildDemandElements().at(0)->getFromEdge(); - } else { - throw ProcessError("Undefined from edge"); - } -} - - -GNEEdge* -GNEVehicle::getToEdge() const { - if (getParentDemandElements().size() == 2) { - // oobtain edge of route - return getParentDemandElements().at(1)->getToEdge(); - } else if (getParentEdges().size() > 0) { - return getParentEdges().back(); - } else if (getChildDemandElements().size() > 0) { - // obtain edge of embedded route - return getChildDemandElements().at(0)->getToEdge(); - } else { - throw ProcessError("Undefined to edge"); - } -} - - -SUMOVehicleClass -GNEVehicle::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEVehicle::getColor() const { - return color; -} - - -void -GNEVehicle::startGeometryMoving() { - // Vehicles cannot be moved -} - - -void -GNEVehicle::endGeometryMoving() { - // Vehicles cannot be moved -} - - -void -GNEVehicle::moveGeometry(const Position&) { - // Vehicles cannot be moved -} - - -void -GNEVehicle::commitGeometryMoving(GNEUndoList*) { - // Vehicles cannot be moved -} - - -void -GNEVehicle::updateGeometry() { - // update spread geometry - updateSpreadGeometry(); - // update stacked geometry - updateStackedGeometry(); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - - -void -GNEVehicle::updateDottedContour() { - // -} - - -void -GNEVehicle::updatePartialGeometry(const GNEEdge* edge) { - // update partial spread geometry - updatePartialSpreadGeometry(edge); - // update partial stacked geometry - updatePartialStackedGeometry(edge); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNEVehicle::computePath() { - // calculate route and update routeEdges (only for flows and trips) - if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentEdges())); - } - // update geometry - updateGeometry(); -} - - -void -GNEVehicle::invalidatePath() { - // calculate route and update routeEdges (only for flows and trips) - if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { - replacePathEdges(this, getParentEdges()); - } - // update geometry - updateGeometry(); -} - - -Position -GNEVehicle::getPositionInView() const { - // obtain lane - GNELane* lane = getFromEdge()->getLanes().front(); - // get position depending of lane's length - if (lane->getLaneShape().length() < 2.5) { - return lane->getLaneShape().front(); - } else { - Position A = lane->getLaneShape().positionAtOffset(2.5); - Position B = lane->getLaneShape().positionAtOffset(2.5); - // return Middle point - return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); - } -} - - -GUIGLObjectPopupMenu* -GNEVehicle::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - if (isAttributeCarrierSelected()) { - // obtain all selected vehicles - std::vector selectedDemandElements = myViewNet->getNet()->retrieveDemandElements(true); - std::vector selectedVehicles; - selectedVehicles.reserve(selectedDemandElements.size()); - for (const auto& i : selectedDemandElements) { - if (i->getTagProperty().isVehicle()) { - selectedVehicles.push_back(dynamic_cast(i)); - } - } - // return a GNESelectedVehiclesPopupMenu - return new GNESelectedVehiclesPopupMenu(this, selectedVehicles, app, parent); - } else { - // return a GNESingleVehiclePopupMenu - return new GNESingleVehiclePopupMenu(this, app, parent); - } -} - - -std::string -GNEVehicle::getParentName() const { - if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { - return getParentDemandElements().at(1)->getID(); - } else if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - return getParentEdges().front()->getID(); - } else { - throw ProcessError("Invalid vehicle tag"); - } -} - - -Boundary -GNEVehicle::getCenteringBoundary() const { - Boundary vehicleBoundary; - vehicleBoundary.add(getFromEdge()->getLanes().front()->getLaneShape().front()); - vehicleBoundary.grow(20); - return vehicleBoundary; -} - - -void -GNEVehicle::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEVehicle::drawGL(const GUIVisualizationSettings& s) const { - // only drawn in super mode demand - if (myViewNet->getNetworkViewOptions().showDemandElements() && myViewNet->getDemandViewOptions().showNonInspectedDemandElements(this)) { - // declare common attributes - const double exaggeration = s.vehicleSize.getExaggeration(s, this); - const double width = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_WIDTH); - const double length = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_LENGTH); - const double vehicleSizeSquared = (width * width) * (length * length) * (exaggeration * exaggeration); - // obtain Position an rotation (depending of draw spread vehicles) - const Position vehiclePosition = myViewNet->getCommonViewOptions().drawSpreadVehicles() ? mySpreadGeometry.getPosition() : myDemandElementGeometry.getPosition(); - const double vehicleRotation = myViewNet->getCommonViewOptions().drawSpreadVehicles() ? mySpreadGeometry.getRotation() : myDemandElementGeometry.getRotation(); - // check that position is valid - if (vehiclePosition != Position::INVALID) { - // first push name - glPushName(getGlID()); - // first check if if mouse is enought near to this vehicle to draw it - if (s.drawForRectangleSelection && (myViewNet->getPositionInformation().distanceSquaredTo2D(vehiclePosition) >= (vehicleSizeSquared + 2))) { - // push draw matrix - glPushMatrix(); - // translate to drawing position - glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1); - glRotated(vehicleRotation, 0, 0, 1); - // extra translation needed to draw vehicle over edge (to avoid selecting problems) - glTranslated(0, (-1) * length, 0); - GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); - // Pop last matrix - glPopMatrix(); - } else { - SUMOVehicleShape shape = getVehicleShapeID(getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE)); - // push draw matrix - glPushMatrix(); - // translate to drawing position - glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1); - glRotated(vehicleRotation, 0, 0, 1); - // extra translation needed to draw vehicle over edge (to avoid selecting problems) - glTranslated(0, (-1) * length, 0); - // set lane color - setColor(s); - double upscaleLength = exaggeration; - if ((exaggeration > 1) && (length > 5)) { - // reduce the length/width ratio because this is not usefull at high zoom - upscaleLength = MAX2(1.0, upscaleLength * (5 + sqrt(length - 5)) / length); - } - glScaled(exaggeration, upscaleLength, 1); - // check if we're drawing in selecting mode - if (s.drawForRectangleSelection) { - // draw vehicle as a box and don't draw the rest of details - GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(width, length); - } else { - // draw the vehicle depending of detail level - if (s.drawDetail(s.detailSettings.vehicleShapes, exaggeration)) { - GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(s, shape, width, length); - } else if (s.drawDetail(s.detailSettings.vehicleBoxes, exaggeration)) { - GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(width, length); - } 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); - glColor3d(0., 1., 0.); - glBegin(GL_LINES); - glVertex2d(0., 0); - glVertex2d(0., minGap); - glVertex2d(-.5, minGap); - glVertex2d(.5, minGap); - glEnd(); - } - // drawing name at GLO_MAX fails unless translating z - glTranslated(0, MIN2(length / 2, double(5)), -getType()); - glScaled(1 / exaggeration, 1 / upscaleLength, 1); - glRotated(-1 * 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 != "") { - glTranslated(0, 0.6 * s.vehicleName.scaledSize(s.scale), 0); - GLHelper::drawTextSettings(s.vehicleName, "line:" + line, Position(0, 0), s.scale, s.angle); - } - } - // pop draw matrix - glPopMatrix(); - // draw stack label - if ((myStackedLabelNumber > 0) && !myViewNet->getCommonViewOptions().drawSpreadVehicles()) { - drawStackLabel(vehiclePosition, vehicleRotation, width, length); - } - // draw flow label - if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { - drawFlowLabel(vehiclePosition, vehicleRotation, width, length); - } - // check if dotted contour has to be drawn - if (myViewNet->getDottedAC() == this) { - GLHelper::drawShapeDottedContourRectangle(s, getType(), vehiclePosition, width, length, vehicleRotation, 0, length / (-2)); - } - } - // pop name - glPopName(); - } - } -} - - -void -GNEVehicle::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEVehicle::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEVehicle::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_TYPE: - return getParentDemandElements().at(0)->getID(); - case SUMO_ATTR_COLOR: - if (wasSet(VEHPARS_COLOR_SET)) { - return toString(color); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_COLOR); - } - case SUMO_ATTR_DEPARTLANE: - if (wasSet(VEHPARS_DEPARTLANE_SET)) { - return getDepartLane(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTLANE); - } - case SUMO_ATTR_DEPARTPOS: - if (wasSet(VEHPARS_DEPARTPOS_SET)) { - return getDepartPos(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS); - } - case SUMO_ATTR_DEPARTSPEED: - if (wasSet(VEHPARS_DEPARTSPEED_SET)) { - return getDepartSpeed(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTSPEED); - } - case SUMO_ATTR_ARRIVALLANE: - if (wasSet(VEHPARS_ARRIVALLANE_SET)) { - return getArrivalLane(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALLANE); - } - case SUMO_ATTR_ARRIVALPOS: - if (wasSet(VEHPARS_ARRIVALPOS_SET)) { - return getArrivalPos(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALPOS); - } - case SUMO_ATTR_ARRIVALSPEED: - if (wasSet(VEHPARS_ARRIVALSPEED_SET)) { - return getArrivalSpeed(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALSPEED); - } - case SUMO_ATTR_LINE: - if (wasSet(VEHPARS_LINE_SET)) { - return line; - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_LINE); - } - case SUMO_ATTR_PERSON_NUMBER: - if (wasSet(VEHPARS_PERSON_NUMBER_SET)) { - return toString(personNumber); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_PERSON_NUMBER); - } - case SUMO_ATTR_CONTAINER_NUMBER: - if (wasSet(VEHPARS_CONTAINER_NUMBER_SET)) { - return toString(containerNumber); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_CONTAINER_NUMBER); - } - case SUMO_ATTR_REROUTE: - if (wasSet(VEHPARS_CONTAINER_NUMBER_SET)) { - return "true"; - } else { - return "false"; - } - case SUMO_ATTR_DEPARTPOS_LAT: - if (wasSet(VEHPARS_DEPARTPOSLAT_SET)) { - return getDepartPosLat(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS_LAT); - } - case SUMO_ATTR_ARRIVALPOS_LAT: - if (wasSet(VEHPARS_ARRIVALPOSLAT_SET)) { - return getArrivalPosLat(); - } else { - return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALPOS_LAT); - } - // Specific of vehicles - case SUMO_ATTR_DEPART: - return time2string(depart); - case SUMO_ATTR_ROUTE: - if (getParentDemandElements().size() == 2) { - return getParentDemandElements().at(1)->getID(); - } else { - return ""; - } - // Specific of Trips - case SUMO_ATTR_FROM: - return getParentEdges().front()->getID(); - case SUMO_ATTR_TO: - return getParentEdges().back()->getID(); - case SUMO_ATTR_VIA: - return toString(via); - // Specific of routeFlows - case SUMO_ATTR_BEGIN: - return time2string(depart); - case SUMO_ATTR_END: - return time2string(repetitionEnd); - case SUMO_ATTR_VEHSPERHOUR: - return toString(3600 / STEPS2TIME(repetitionOffset)); - case SUMO_ATTR_PERIOD: - return time2string(repetitionOffset); - case SUMO_ATTR_PROB: - return toString(repetitionProbability); - case SUMO_ATTR_NUMBER: - return toString(repetitionNumber); - // - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEVehicle::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_DEPART: - case SUMO_ATTR_BEGIN: - return STEPS2TIME(depart); - case SUMO_ATTR_DEPARTPOS: - // check if depart and arrival pos lanes are defined - if (departPosProcedure == DEPART_POS_GIVEN) { - return departPos; - } else { - return 0; - } - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_MINGAP: - return getParentDemandElements().at(0)->getAttributeDouble(key); - default: - throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEVehicle::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: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_COLOR: - case SUMO_ATTR_DEPARTLANE: - case SUMO_ATTR_DEPARTPOS: - case SUMO_ATTR_DEPARTSPEED: - case SUMO_ATTR_ARRIVALLANE: - case SUMO_ATTR_ARRIVALPOS: - case SUMO_ATTR_ARRIVALSPEED: - case SUMO_ATTR_LINE: - case SUMO_ATTR_PERSON_NUMBER: - case SUMO_ATTR_CONTAINER_NUMBER: - case SUMO_ATTR_REROUTE: - case SUMO_ATTR_DEPARTPOS_LAT: - case SUMO_ATTR_ARRIVALPOS_LAT: - // Specific of vehicles - case SUMO_ATTR_DEPART: - case SUMO_ATTR_ROUTE: - // Specific of Trips - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_VIA: - // - // Specific of routeFlows - case SUMO_ATTR_BEGIN: - case SUMO_ATTR_END: - case SUMO_ATTR_NUMBER: - case SUMO_ATTR_VEHSPERHOUR: - case SUMO_ATTR_PERIOD: - case SUMO_ATTR_PROB: - // - case GNE_ATTR_PARAMETERS: - case GNE_ATTR_SELECTED: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEVehicle::isValid(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - switch (key) { - case SUMO_ATTR_ID: - // Vehicles, Trips and Flows share namespace - if (SUMOXMLDefinitions::isValidVehicleID(value) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VEHICLE, value, false) == nullptr) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_TRIP, value, false) == nullptr) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTEFLOW, value, false) == nullptr) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_FLOW, value, false) == nullptr)) { - return true; - } else { - return false; - } - case SUMO_ATTR_TYPE: - return SUMOXMLDefinitions::isValidTypeID(value) && (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); - case SUMO_ATTR_COLOR: - return canParse(value); - case SUMO_ATTR_DEPARTLANE: { - int dummyDepartLane; - DepartLaneDefinition dummyDepartLaneProcedure; - parseDepartLane(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartLane, dummyDepartLaneProcedure, error); - // if error is empty, check if depart lane is correct - if (error.empty()) { - if (dummyDepartLaneProcedure != DEPART_LANE_GIVEN) { - return true; - } else { - return dummyDepartLane < (int)getFromEdge()->getLanes().size(); - } - } else { - return false; - } - } - case SUMO_ATTR_DEPARTPOS: { - double dummyDepartPos; - DepartPosDefinition dummyDepartPosProcedure; - parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPos, dummyDepartPosProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_DEPARTSPEED: { - double dummyDepartSpeed; - DepartSpeedDefinition dummyDepartSpeedProcedure; - parseDepartSpeed(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartSpeed, dummyDepartSpeedProcedure, error); - // if error is empty, check if depart speed is correct - if (error.empty()) { - if (dummyDepartSpeedProcedure != DEPART_SPEED_GIVEN) { - return true; - } else { - return (dummyDepartSpeed <= getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_MAXSPEED)); - } - } else { - return false; - } - } - case SUMO_ATTR_ARRIVALLANE: { - int dummyArrivalLane; - ArrivalLaneDefinition dummyArrivalLaneProcedure; - parseArrivalLane(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalLane, dummyArrivalLaneProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_ARRIVALPOS: { - double dummyArrivalPos; - ArrivalPosDefinition dummyArrivalPosProcedure; - parseArrivalPos(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalPos, dummyArrivalPosProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_ARRIVALSPEED: { - double dummyArrivalSpeed; - ArrivalSpeedDefinition dummyArrivalSpeedProcedure; - parseArrivalSpeed(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalSpeed, dummyArrivalSpeedProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_LINE: - return true; - case SUMO_ATTR_PERSON_NUMBER: - return canParse(value) && parse(value) >= 0; - case SUMO_ATTR_CONTAINER_NUMBER: - return canParse(value) && parse(value) >= 0; - case SUMO_ATTR_REROUTE: - return true; // check - case SUMO_ATTR_DEPARTPOS_LAT: { - double dummyDepartPosLat; - DepartPosLatDefinition dummyDepartPosLatProcedure; - parseDepartPosLat(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPosLat, dummyDepartPosLatProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_ARRIVALPOS_LAT: { - double dummyArrivalPosLat; - ArrivalPosLatDefinition dummyArrivalPosLatProcedure; - parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalPosLat, dummyArrivalPosLatProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - // Specific of vehicles - case SUMO_ATTR_DEPART: { - SUMOTime dummyDepart; - DepartDefinition dummyDepartProcedure; - parseDepart(value, toString(SUMO_TAG_VEHICLE), id, dummyDepart, dummyDepartProcedure, error); - // if error is empty, given value is valid - return error.empty(); - } - case SUMO_ATTR_ROUTE: - if (getParentDemandElements().size() == 2) { - return SUMOXMLDefinitions::isValidVehicleID(value) && (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, value, false) != nullptr); - } else { - return true; - } - // Specific of Trips - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - return SUMOXMLDefinitions::isValidNetID(value) && (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_VIA: - if (value.empty()) { - return true; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - // Specific of routeFlows - case SUMO_ATTR_BEGIN: - if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_END: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_VEHSPERHOUR: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) > 0); - } else { - return false; - } - case SUMO_ATTR_PERIOD: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) > 0); - } else { - return false; - } - case SUMO_ATTR_PROB: - if (value.empty()) { - return true; - } else if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - case SUMO_ATTR_NUMBER: - if (canParse(value)) { - return (parse(value) >= 0); - } else { - return false; - } - // - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -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, myViewNet->getNet(), parametersSet, newParametersSet), true); -} - - -void -GNEVehicle::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // nothing to disable -} - - -bool -GNEVehicle::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_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; - default: - return true; - } -} - - -std::string -GNEVehicle::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEVehicle::getHierarchyName() const { - // special case for Trips and flow - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // check if we're inspecting a Edge - if (myViewNet->getNet()->getViewNet()->getDottedAC() && - myViewNet->getNet()->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_EDGE) { - // check if edge correspond to a "from", "to" or "via" edge - if (getParentEdges().front() == myViewNet->getNet()->getViewNet()->getDottedAC()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (from)"; - } else if (getParentEdges().front() == myViewNet->getNet()->getViewNet()->getDottedAC()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (to)"; - } else { - // iterate over via - for (const auto& i : via) { - if (i == myViewNet->getNet()->getViewNet()->getDottedAC()->getID()) { - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (via)"; - } - } - } - } - } - return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID); -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEVehicle::setColor(const GUIVisualizationSettings& s) const { - // change color - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedVehicleColor); - } else { - // obtain vehicle color - const GUIColorer& c = s.vehicleColorer; - // set color depending of vehicle color active - switch (c.getActive()) { - case 0: { - // test for emergency vehicle - if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "emergency") { - GLHelper::setColor(RGBColor::WHITE); - break; - } - // test for firebrigade - if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "firebrigade") { - GLHelper::setColor(RGBColor::RED); - break; - } - // test for police car - if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "police") { - GLHelper::setColor(RGBColor::BLUE); - break; - } - // check if color was set - if (wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(color); - break; - } else { - // take their parent's color) - GLHelper::setColor(getParentDemandElements().at(0)->getColor()); - break; - } - break; - } - case 2: { - if (wasSet(VEHPARS_COLOR_SET)) { - GLHelper::setColor(color); - } else { - GLHelper::setColor(c.getScheme().getColor(0)); - } - break; - } - case 3: { - if (getParentDemandElements().at(0)->isAttributeEnabled(SUMO_ATTR_COLOR)) { - GLHelper::setColor(getParentDemandElements().at(0)->getColor()); - } else { - GLHelper::setColor(c.getScheme().getColor(0)); - } - break; - } - case 4: { - if (getParentDemandElements().at(1)->getColor() != RGBColor::DEFAULT_COLOR) { - GLHelper::setColor(getParentDemandElements().at(1)->getColor()); - } else { - GLHelper::setColor(c.getScheme().getColor(0)); - } - break; - } - case 5: { - Position p = getParentDemandElements().at(1)->getParentEdges().at(0)->getLanes().at(0)->getLaneShape()[0]; - const Boundary& b = myViewNet->getNet()->getBoundary(); - Position center = b.getCenter(); - double hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / M_PI; - double sat = p.distanceTo(center) / center.distanceTo(Position(b.xmin(), b.ymin())); - GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); - break; - } - case 6: { - Position p = getParentDemandElements().at(1)->getParentEdges().back()->getLanes().at(0)->getLaneShape()[-1]; - const Boundary& b = myViewNet->getNet()->getBoundary(); - Position center = b.getCenter(); - double hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / M_PI; - double sat = p.distanceTo(center) / center.distanceTo(Position(b.xmin(), b.ymin())); - GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); - break; - } - case 7: { - Position pb = getParentDemandElements().at(1)->getParentEdges().at(0)->getLanes().at(0)->getLaneShape()[0]; - Position pe = getParentDemandElements().at(1)->getParentEdges().back()->getLanes().at(0)->getLaneShape()[-1]; - const Boundary& b = myViewNet->getNet()->getBoundary(); - double hue = 180. + atan2(pb.x() - pe.x(), pb.y() - pe.y()) * 180. / M_PI; - Position minp(b.xmin(), b.ymin()); - Position maxp(b.xmax(), b.ymax()); - double sat = pb.distanceTo(pe) / minp.distanceTo(maxp); - GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); - break; - } - case 29: { // color randomly (by pointer hash) - std::hash ptr_hash; - const double hue = (double)(ptr_hash(this) % 360); // [0-360] - const double sat = ((ptr_hash(this) / 360) % 67) / 100.0 + 0.33; // [0.33-1] - GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); - break; - } - default: { - GLHelper::setColor(c.getScheme().getColor(0)); - } - } - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEVehicle::setAttribute(SumoXMLAttr key, const std::string& value) { - // declare string error - std::string error; - // flag to upate stack label - bool updateSpreadStackGeometry = false; - switch (key) { - case SUMO_ATTR_ID: - changeDemandElementID(value); - // set manually vehicle ID (needed for saving) - id = value; - break; - case SUMO_ATTR_TYPE: - replaceParentDemandElement(this, value, 0); - // set manually vtypeID (needed for saving) - vtypeid = value; - break; - case SUMO_ATTR_COLOR: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - color = parse(value); - // mark parameter as set - parametersSet |= VEHPARS_COLOR_SET; - } else { - // set default value - color = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VEHPARS_COLOR_SET; - } - break; - case SUMO_ATTR_DEPARTLANE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseDepartLane(value, toString(SUMO_TAG_VEHICLE), id, departLane, departLaneProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_DEPARTLANE_SET; - } else { - // set default value - parseDepartLane(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departLane, departLaneProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_DEPARTLANE_SET; - } - break; - case SUMO_ATTR_DEPARTPOS: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_DEPARTPOS_SET; - } else { - // set default value - parseDepartPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_DEPARTPOS_SET; - } - updateGeometry(); - updateSpreadStackGeometry = true; - break; - case SUMO_ATTR_DEPARTSPEED: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseDepartSpeed(value, toString(SUMO_TAG_VEHICLE), id, departSpeed, departSpeedProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_DEPARTSPEED_SET; - } else { - // set default value - parseDepartSpeed(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departSpeed, departSpeedProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_DEPARTSPEED_SET; - } - break; - case SUMO_ATTR_ARRIVALLANE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseArrivalLane(value, toString(SUMO_TAG_VEHICLE), id, arrivalLane, arrivalLaneProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_ARRIVALLANE_SET; - } else { - // set default value - parseArrivalLane(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalLane, arrivalLaneProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_ARRIVALLANE_SET; - } - break; - case SUMO_ATTR_ARRIVALPOS: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseArrivalPos(value, toString(SUMO_TAG_VEHICLE), id, arrivalPos, arrivalPosProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_ARRIVALPOS_SET; - } else { - // set default value - parseArrivalPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalPos, arrivalPosProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_ARRIVALPOS_SET; - } - updateGeometry(); - updateSpreadStackGeometry = true; - break; - case SUMO_ATTR_ARRIVALSPEED: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseArrivalSpeed(value, toString(SUMO_TAG_VEHICLE), id, arrivalSpeed, arrivalSpeedProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_ARRIVALSPEED_SET; - } else { - // set default value - parseArrivalSpeed(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalSpeed, arrivalSpeedProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_ARRIVALSPEED_SET; - } - break; - case SUMO_ATTR_LINE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - line = value; - // mark parameter as set - parametersSet |= VEHPARS_LINE_SET; - } else { - // set default value - line = myTagProperty.getDefaultValue(key); - // unset parameter - parametersSet &= ~VEHPARS_LINE_SET; - } - break; - case SUMO_ATTR_PERSON_NUMBER: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - personNumber = parse(value); - // mark parameter as set - parametersSet |= VEHPARS_PERSON_NUMBER_SET; - } else { - // set default value - personNumber = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VEHPARS_PERSON_NUMBER_SET; - } - break; - case SUMO_ATTR_CONTAINER_NUMBER: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - containerNumber = parse(value); - // mark parameter as set - parametersSet |= VEHPARS_CONTAINER_NUMBER_SET; - } else { - // set default value - containerNumber = parse(myTagProperty.getDefaultValue(key)); - // unset parameter - parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET; - } - break; - case SUMO_ATTR_REROUTE: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - // mark parameter as set - parametersSet |= VEHPARS_ROUTE_SET; - } else { - // unset parameter - parametersSet &= ~VEHPARS_ROUTE_SET; - } - break; - case SUMO_ATTR_DEPARTPOS_LAT: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseDepartPosLat(value, toString(SUMO_TAG_VEHICLE), id, departPosLat, departPosLatProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_DEPARTPOSLAT_SET; - } else { - // set default value - parseDepartPosLat(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPosLat, departPosLatProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET; - } - break; - case SUMO_ATTR_ARRIVALPOS_LAT: - if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { - parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); - // mark parameter as set - parametersSet |= VEHPARS_ARRIVALPOSLAT_SET; - } else { - // set default value - parseArrivalPosLat(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); - // unset parameter - parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET; - } - parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); - break; - // Specific of vehicles - case SUMO_ATTR_DEPART: { - std::string oldDepart = getBegin(); - parseDepart(value, toString(SUMO_TAG_VEHICLE), id, depart, departProcedure, error); - myViewNet->getNet()->updateDemandElementBegin(oldDepart, this); - break; - } - case SUMO_ATTR_ROUTE: - if (getParentDemandElements().size() == 2) { - replaceParentDemandElement(this, value, 1); - } - updateGeometry(); - updateSpreadStackGeometry = true; - break; - // Specific of Trips and flow - case SUMO_ATTR_FROM: { - // change first edge - replaceFirstParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute vehicle - computePath(); - updateSpreadStackGeometry = true; - break; - } - case SUMO_ATTR_TO: { - // change last edge - replaceLastParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute vehicle - computePath(); - updateSpreadStackGeometry = true; - break; - } - case SUMO_ATTR_VIA: { - if (!value.empty()) { - // set new via edges - via = parse< std::vector >(value); - // mark parameter as set - parametersSet |= VEHPARS_VIA_SET; - } else { - // clear via - via.clear(); - // unset parameter - parametersSet &= ~VEHPARS_VIA_SET; - } - // update via - replaceMiddleParentEdges(this, parse >(myViewNet->getNet(), value), true); - // compute vehicle - computePath(); - updateSpreadStackGeometry = true; - break; - } - // Specific of routeFlows - case SUMO_ATTR_BEGIN: { - std::string oldBegin = getBegin(); - depart = string2time(value); - myViewNet->getNet()->updateDemandElementBegin(oldBegin, this); - break; - } - case SUMO_ATTR_END: - repetitionEnd = string2time(value); - break; - case SUMO_ATTR_VEHSPERHOUR: - repetitionOffset = TIME2STEPS(3600 / parse(value)); - break; - case SUMO_ATTR_PERIOD: - repetitionOffset = string2time(value); - break; - case SUMO_ATTR_PROB: - repetitionProbability = parse(value); - break; - case SUMO_ATTR_NUMBER: - repetitionNumber = parse(value); - break; - // - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - // check if stack label has to be updated - if (updateSpreadStackGeometry) { - if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - getParentEdges().front()->updateVehicleStackLabels(); - getParentEdges().front()->updateVehicleSpreadGeometries(); - } else if (getParentDemandElements().size() == 2) { - getParentDemandElements().at(1)->getParentEdges().front()->updateVehicleStackLabels(); - getParentDemandElements().at(1)->getParentEdges().front()->updateVehicleSpreadGeometries(); - } else if (getChildDemandElements().size() > 0) { - getChildDemandElements().front()->getParentEdges().front()->updateVehicleStackLabels(); - getChildDemandElements().front()->getParentEdges().front()->updateVehicleSpreadGeometries(); - } - } -} - - -void -GNEVehicle::setEnabledAttribute(const int enabledAttributes) { - parametersSet = enabledAttributes; -} - - -void -GNEVehicle::updateSpreadGeometry() { - // get vehicle lane - const GNELane* vehicleLane = getFirstAllowedVehicleLane(); - // update spread vehicle geometry depending of edgeParent - if (vehicleLane) { - vehicleLane->getParentEdge()->updateVehicleSpreadGeometries(); - } else { - mySpreadGeometry.updateGeometry(Position(), 0); - } - // declare two pointers for depart and arrival pos lanes - double departPosLane = -1; - double arrivalPosLane = -1; - // calculate departPosLane - if (vehicleLane && (mySpreadGeometry.getPosition() != Position::INVALID)) { - departPosLane = vehicleLane->getLaneShape().nearest_offset_to_point2D(mySpreadGeometry.getPosition()); - } - // check if arrival pos lane is defined - if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { - arrivalPosLane = arrivalPos; - } - // calculate depart pos geometry path starting at the lane begin - if (getPathEdges().size() > 0) { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getPathEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // use route edges - if (getParentDemandElements().size() == 2) { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } else if (getChildDemandElements().size() > 0) { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getChildDemandElements().front()->getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } - } else { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } -} - - -void -GNEVehicle::updatePartialSpreadGeometry(const GNEEdge* edge) { - // get vehicle lane - const GNELane* vehicleLane = getFirstAllowedVehicleLane(); - // declare two pointers for depart and arrival pos lanes - double departPosLane = -1; - double arrivalPosLane = -1; - // calculate departPosLane - if (vehicleLane && (mySpreadGeometry.getPosition() != Position::INVALID)) { - departPosLane = vehicleLane->getLaneShape().nearest_offset_to_point2D(mySpreadGeometry.getPosition()); - } - // check if arrival pos lane is defined - if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { - arrivalPosLane = arrivalPos; - } - // update geometry path for the given edge - GNEGeometry::updateGeometricPath(mySpreadSegmentGeometry, edge, departPosLane, arrivalPosLane); -} - - -void -GNEVehicle::updateStackedGeometry() { - // declare two pointers for depart and arrival pos lanes - double departPosLane = -1; - double arrivalPosLane = -1; - // check if depart and arrival pos lanes are defined - if (departPosProcedure == DEPART_POS_GIVEN) { - departPosLane = departPos; - } - if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { - arrivalPosLane = arrivalPos; - } - // get first allowed lane - GNELane* firstLane = getFirstAllowedVehicleLane(); - // check if first lane wasn't sucesfully obtained - if (!firstLane) { - if (getPathEdges().size() > 0) { - firstLane = getPathEdges().front()->getLanes().front(); - } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // use route edges - if (getParentDemandElements().size() == 2) { - firstLane = getParentDemandElements().at(1)->getParentEdges().front()->getLanes().front(); - } else if (getChildDemandElements().size() > 0) { - firstLane = getChildDemandElements().front()->getParentEdges().front()->getLanes().front(); - } - } else { - firstLane = getParentEdges().front()->getLanes().front(); - } - } - // continue only if lane was sucesfully found - if (firstLane) { - // check if depart pos has to be adjusted - if ((departPosProcedure == DEPART_POS_GIVEN) && (departPosLane < 0)) { - departPosLane += firstLane->getLaneShape().length(); - } - // calculate spread geometry path - if (getPathEdges().size() > 0) { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), - firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { - // use route edges - if (getParentDemandElements().size() == 2) { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), - firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } else if (getChildDemandElements().size() > 0) { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getChildDemandElements().front()->getParentEdges(), getVClass(), - firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } - } else { - // calculate edge geometry path - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), - firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); - } - // update start pos geometry - myDemandElementGeometry.updateGeometry(firstLane, departPosLane); - firstLane->getParentEdge()->updateVehicleStackLabels(); - } -} - - -void -GNEVehicle::updatePartialStackedGeometry(const GNEEdge* edge) { - // declare two pointers for depart and arrival pos lanes - double departPosLane = -1; - double arrivalPosLane = -1; - // check if depart and arrival pos lanes are defined - if (departPosProcedure == DEPART_POS_GIVEN) { - departPosLane = departPos; - } - if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { - arrivalPosLane = arrivalPos; - } - // update geometry path for the given edge - GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane); -} - - -void -GNEVehicle::drawStackLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const { - // declare contour width - const double contourWidth = 0.05; - // Push matrix - glPushMatrix(); - // Traslate to vehicle top - glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW); - glRotated(vehicleRotation, 0, 0, 1); - glTranslated((width / 2.0) + 0.35, 0, 0); - // draw external box - GLHelper::setColor(RGBColor::GREY); - GLHelper::drawBoxLine(Position(), Position(), 0, length, 0.3); - // draw internal box - glTranslated(0, 0, 0.1); - GLHelper::setColor(RGBColor(0, 128, 0)); - GLHelper::drawBoxLine(Position(0, -contourWidth), Position(0, -contourWidth), 0, length - (contourWidth * 2), 0.3 - contourWidth); - // draw stack label - GLHelper::drawText("vehicles stacked: " + toString(myStackedLabelNumber), Position(0, length / -2.0), .1, 0.6, RGBColor::WHITE, 90); - // pop draw matrix - glPopMatrix(); -} - - -void -GNEVehicle::drawFlowLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const { - // declare contour width - const double contourWidth = 0.05; - // Push matrix - glPushMatrix(); - // Traslate to vehicle bot - glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW); - glRotated(vehicleRotation, 0, 0, 1); - glTranslated(-1 * ((width / 2.0) + 0.35), 0, 0); - // draw external box - GLHelper::setColor(RGBColor::GREY); - GLHelper::drawBoxLine(Position(), Position(), 0, length, 0.3); - // draw internal box - glTranslated(0, 0, 0.1); - GLHelper::setColor(RGBColor::CYAN); - GLHelper::drawBoxLine(Position(0, -contourWidth), Position(0, -contourWidth), 0, length - (contourWidth * 2), 0.3 - contourWidth); - // draw stack label - GLHelper::drawText("Flow", Position(0, length / -2.0), .1, 0.6, RGBColor::BLACK, 90); - // pop draw matrix - glPopMatrix(); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicle.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicle.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicle.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,374 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVehicle.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2019 -/// -// Representation of vehicles in NETEDIT -/****************************************************************************/ -#ifndef GNEVehicle_h -#define GNEVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include - -#include "GNEDemandElement.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVehicle - */ -class GNEVehicle : public GNEDemandElement, public SUMOVehicleParameter { - -public: - /// @brief class used in GUIGLObjectPopupMenu for single vehicle transformations - class GNESingleVehiclePopupMenu : public GUIGLObjectPopupMenu { - FXDECLARE(GNESingleVehiclePopupMenu) - - public: - /** @brief Constructor - * @param[in] vehicle GNEVehicle to be transformed - * @param[in] app The main window for instantiation of other windows - * @param[in] parent The parent view for changing it - */ - GNESingleVehiclePopupMenu(GNEVehicle* vehicle, GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief Destructor - ~GNESingleVehiclePopupMenu(); - - /// @brief Called to transform the current vehicle to another vehicle type - long onCmdTransform(FXObject* obj, FXSelector, void*); - - protected: - /// @brief default constructor needed by FOX - GNESingleVehiclePopupMenu() { } - - private: - /// @brief current vehicle - GNEVehicle* myVehicle; - - /// @brief menu command for transform to vehicle - FXMenuCommand* myTransformToVehicle; - - /// @brief menu command for transform to vehicle with an embedded route - FXMenuCommand* myTransformToVehicleWithEmbeddedRoute; - - /// @brief menu command for transform to route flow - FXMenuCommand* myTransformToRouteFlow; - - /// @brief menu command for transform to route flow with an embedded route - FXMenuCommand* myTransformToRouteFlowWithEmbeddedRoute; - - /// @brief menu command for transform to trip - FXMenuCommand* myTransformToTrip; - - /// @brief menu command for transform to flow - FXMenuCommand* myTransformToFlow; - }; - - /// @brief class used in GUIGLObjectPopupMenu for single vehicle transformations - class GNESelectedVehiclesPopupMenu : public GUIGLObjectPopupMenu { - FXDECLARE(GNESelectedVehiclesPopupMenu) - - public: - /** @brief Constructor - * @param[in] vehicle clicked GNEVehicle - * @param[in] selectedVehicle vector with selected GNEVehicle - * @param[in] app The main window for instantiation of other windows - * @param[in] parent The parent view for changing it - */ - GNESelectedVehiclesPopupMenu(GNEVehicle* vehicle, const std::vector& selectedVehicle, GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief Destructor - ~GNESelectedVehiclesPopupMenu(); - - /// @brief Called to transform the current vehicle to another vehicle type - long onCmdTransform(FXObject* obj, FXSelector, void*); - - protected: - /// @brief default constructor needed by FOX - GNESelectedVehiclesPopupMenu() { } - - private: - /// @brief current selected vehicles - std::vector mySelectedVehicles; - - /// @brief tag of clicked vehicle - SumoXMLTag myVehicleTag; - - /// @brief menu command for transform to vehicle - FXMenuCommand* myTransformToVehicle; - - /// @brief menu command for transform to vehicle with an embedded route - FXMenuCommand* myTransformToVehicleWithEmbeddedRoute; - - /// @brief menu command for transform to route flow - FXMenuCommand* myTransformToRouteFlow; - - /// @brief menu command for transform to route flow with an embedded route - FXMenuCommand* myTransformToRouteFlowWithEmbeddedRoute; - - /// @brief menu command for transform to trip - FXMenuCommand* myTransformToTrip; - - /// @brief menu command for transform to flow - FXMenuCommand* myTransformToFlow; - - /// @brief menu command for transform all selected vehicles to vehicle - FXMenuCommand* myTransformAllVehiclesToVehicle; - - /// @brief menu command for transform all selected vehicles to vehicle with an embedded route - FXMenuCommand* myTransformAllVehiclesToVehicleWithEmbeddedRoute; - - /// @brief menu command for transform all selected vehicles to route flow - FXMenuCommand* myTransformAllVehiclesToRouteFlow; - - /// @brief menu command for transform all selected vehicles to route flow with an embedded route - FXMenuCommand* myTransformAllVehiclesToRouteFlowWithEmbeddedRoute; - - /// @brief menu command for transform all selected vehicles to trip - FXMenuCommand* myTransformAllVehiclesToTrip; - - /// @brief menu command for transform all selected vehicles to flow - FXMenuCommand* myTransformAllVehiclesToFlow; - }; - - /// @brief default constructor for vehicles and routeFlows without embedded routes - GNEVehicle(SumoXMLTag tag, GNEViewNet* viewNet, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route); - - /// @brief parameter constructor for vehicles and routeFlows without embedded routes - GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters); - - /// @brief parameter constructor for vehicles and routeFlows with embedded routes (note: After creation create immediately a embedded route referencing this vehicle) - GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, const SUMOVehicleParameter& vehicleParameters); - - /// @brief default constructor for trips and Flows - GNEVehicle(SumoXMLTag tag, GNEViewNet* viewNet, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); - - /// @brief parameter constructor for trips and Flows - GNEVehicle(GNEViewNet* viewNet, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, const SUMOVehicleParameter& vehicleParameters); - - /// @brief destructor - ~GNEVehicle(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 start geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of demand element in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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; - /// @} - -protected: - /// @brief sets the color according to the currente settings - void setColor(const GUIVisualizationSettings& s) 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 update spread geometry - void updateSpreadGeometry(); - - /// @brief partial update pre-computed spread geometry information - void updatePartialSpreadGeometry(const GNEEdge* edge); - - /// @brief update stacked geometry - void updateStackedGeometry(); - - /// @brief partial update pre-computed departPosgeometry information - void updatePartialStackedGeometry(const GNEEdge* edge); - - /// @brief draw stack label - void drawStackLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const; - - /// @brief draw flow label - void drawFlowLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const; - - /// @brief Invalidated copy constructor. - GNEVehicle(const GNEVehicle&) = delete; - - /// @brief Invalidated assignment operator - GNEVehicle& operator=(const GNEVehicle&) = delete; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicleType.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicleType.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicleType.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicleType.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1711 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVehicleType.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== - - -GNEVehicleType::GNEVehicleType(GNEViewNet* viewNet, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass, SumoXMLTag tag) : - GNEDemandElement(vTypeID, viewNet, GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), - SUMOVTypeParameter(vTypeID), - myDefaultVehicleType(true), -myDefaultVehicleTypeModified(false) { - // set default vehicle class - vehicleClass = defaultVClass; - parametersSet |= VTYPEPARS_VEHICLECLASS_SET; - // init Rail Visualization Parameters - initRailVisualizationParameters(); -} - - -GNEVehicleType::GNEVehicleType(GNEViewNet* viewNet, const SUMOVTypeParameter& vTypeParameter, SumoXMLTag tag) : - GNEDemandElement(vTypeParameter.id, viewNet, GLO_VTYPE, tag, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -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(GNEViewNet* viewNet, const std::string& vTypeID, GNEVehicleType* vTypeOriginal) : - GNEDemandElement(vTypeID, viewNet, GLO_VTYPE, vTypeOriginal->getTagProperty().getTag(), {}, {}, {}, {}, {}, {}, {}, {}, {}, {}), -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() {} - - -void -GNEVehicleType::writeDemandElement(OutputDevice& device) const { - // only write default vehicle types if it was modified - if (myDefaultVehicleType) { - if (myDefaultVehicleTypeModified) { - write(device); - } - } else { - write(device); - } -} - - -GNEEdge* -GNEVehicleType::getFromEdge() const { - return nullptr; -} - - -GNEEdge* -GNEVehicleType::getToEdge() const { - return nullptr; -} - - -SUMOVehicleClass -GNEVehicleType::getVClass() const { - return vehicleClass; -} - - -const RGBColor& -GNEVehicleType::getColor() const { - return color; -} - - -void -GNEVehicleType::startGeometryMoving() { - // VTypes cannot be moved -} - - -void -GNEVehicleType::endGeometryMoving() { - // VTypes cannot be moved -} - - -void -GNEVehicleType::moveGeometry(const Position&) { - // VTypes cannot be moved -} - - -void -GNEVehicleType::commitGeometryMoving(GNEUndoList*) { - // VTypes cannot be moved -} - - -void -GNEVehicleType::updateGeometry() { - // update geometry of all childrens - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - - -void -GNEVehicleType::updateDottedContour() { - // -} - - -void -GNEVehicleType::updatePartialGeometry(const GNEEdge* edge) { - // update geometry of all childrens - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNEVehicleType::computePath() { - // nothing to compute -} - - -void -GNEVehicleType::invalidatePath() { - // nothing to invalidate -} - - -Position -GNEVehicleType::getPositionInView() const { - return Position(); -} - - -std::string -GNEVehicleType::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -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 GNENetElement* /*originalElement*/, const GNENetElement* /*newElement*/, GNEUndoList* /*undoList*/) { - // geometry of this element cannot be splitted -} - - -void -GNEVehicleType::drawGL(const GUIVisualizationSettings&) const { - // Vehicle Types aren't draw -} - - -void -GNEVehicleType::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(GLO_VTYPE); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEVehicleType::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(GLO_VTYPE); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEVehicleType::getAttribute(SumoXMLAttr key) const { - // obtain default values depending of vehicle class - VClassDefaultValues defaultValues(vehicleClass); - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - // 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_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.getParameter()[0]); - } else { - return toString(defaultValues.speedFactor.getParameter()[0]); - } - case SUMO_ATTR_SPEEDDEV: - if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - return toString(speedFactor.getParameter()[1]); - } else { - return toString(defaultValues.speedFactor.getParameter()[1]); - } - 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)) { - return toString(latAlignment); - } 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((getDemandElementID() == DEFAULT_VTYPE_ID) || - (getDemandElementID() == DEFAULT_PEDTYPE_ID) || - (getDemandElementID() == 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) + "'"); - } -} - - -void -GNEVehicleType::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->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), 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_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_SPEEDDEV: - 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) { - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), true, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true")); - } - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), true, key, value)); - break; - case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), true, key, value)); - 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) && - (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) == nullptr) && - (myViewNet->getNet()->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_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 canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_SPEEDDEV: - return canParse(value) && (parse(value) >= 0); - 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 SUMOXMLDefinitions::LateralAlignments.hasString(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_SPEEDDEV: - 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) ; -} - - -void -GNEVehicleType::overwriteVType(GNEDemandElement* vType, SUMOVTypeParameter* newVTypeParameter, GNEUndoList* undoList) { - // open undo list and overwritte all values of default VType - undoList->p_begin("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_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.getParameter()[0]), undoList); - } - if (newVTypeParameter->wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { - vType->setAttribute(SUMO_ATTR_SPEEDDEV, toString(newVTypeParameter->speedFactor.getParameter()[1]), 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)) { - vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter->latAlignment), 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 (auto i : newVTypeParameter->getParametersMap()) { - parametersStr += i.first + "=" + i.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->p_end(); -} - - -void -GNEVehicleType::initRailVisualizationParameters() { - if (SUMOVTypeParameter::knowsParameter("carriageLength")) { - carriageLength = StringUtils::toDouble(SUMOVTypeParameter::getParameter("carriageLength")); - parametersSet |= VTYPEPARS_CARRIAGE_LENGTH_SET; - } else if (wasSet(VTYPEPARS_SHAPE_SET)) { - switch (shape) { - case SVS_BUS_FLEXIBLE: - carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180 - carriageGap = 0; - break; - case SVS_RAIL: - carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29 - break; - case SVS_RAIL_CAR: - carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423 - break; - case SVS_RAIL_CARGO: - carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen - break; - case SVS_TRUCK_SEMITRAILER: - carriageLength = 13.5; - locomotiveLength = 2.5; - carriageGap = 0.5; - break; - case SVS_TRUCK_1TRAILER: - carriageLength = 6.75; - locomotiveLength = 2.5 + 6.75; - carriageGap = 0.5; - break; - default: - break; - } - } - if (SUMOVTypeParameter::knowsParameter("locomotiveLength")) { - locomotiveLength = StringUtils::toDouble(SUMOVTypeParameter::getParameter("locomotiveLength")); - parametersSet |= VTYPEPARS_LOCOMOTIVE_LENGTH_SET; - } else if (locomotiveLength <= 0) { - locomotiveLength = carriageLength; - } - if (SUMOVTypeParameter::knowsParameter("carriageGap")) { - carriageGap = StringUtils::toDouble(SUMOVTypeParameter::getParameter("carriageGap")); - parametersSet |= VTYPEPARS_CARRIAGE_GAP_SET; - } -} - -// =========================================================================== -// 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: - changeDemandElementID(value); - 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_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.getParameter()[0]))) { - speedFactor.getParameter()[0] = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; - } else { - // set default value - speedFactor.getParameter()[0] = defaultValues.speedFactor.getParameter()[0]; - // unset parameter - parametersSet &= ~VTYPEPARS_SPEEDFACTOR_SET; - } - break; - case SUMO_ATTR_SPEEDDEV: - if (!value.empty() && (value != toString(defaultValues.speedFactor.getParameter()[1]))) { - speedFactor.getParameter()[1] = parse(value); - // mark parameter as set - parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; - } else { - // set default value - speedFactor.getParameter()[1] = defaultValues.speedFactor.getParameter()[1]; - // 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))) { - latAlignment = SUMOXMLDefinitions::LateralAlignments.get(value); - // mark parameter as set - parametersSet |= VTYPEPARS_LATALIGNMENT_SET; - } else { - // set default value - latAlignment = SUMOXMLDefinitions::LateralAlignments.get(myTagProperty.getDefaultValue(key)); - // 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::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.5.0+dfsg1/src/netedit/demandelements/GNEVehicleType.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicleType.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEVehicleType.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEVehicleType.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ -#ifndef GNECalibratorVehicleType_h -#define GNECalibratorVehicleType_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#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(GNEViewNet* viewNet, const std::string& vTypeID, const SUMOVehicleClass& defaultVClass, SumoXMLTag tag); - - /// @brief constructor - GNEVehicleType(GNEViewNet* viewNet, const SUMOVTypeParameter& vTypeParameter, SumoXMLTag tag); - - /// @brief copy constructor - GNEVehicleType(GNEViewNet* viewNet, const std::string& vTypeID, GNEVehicleType* vTypeOriginal); - - /// @brief destructor - ~GNEVehicleType(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @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 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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 overwrite all values of GNEVehicleType with a SUMOVTypeParameter - static void overwriteVType(GNEDemandElement* vType, SUMOVTypeParameter* newVTypeParameter, GNEUndoList* undoList); - -protected: - /// @brief init Rail Visualization Parameters - void initRailVisualizationParameters(); - - /// @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 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; -}; - -#endif -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEWalk.cpp sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEWalk.cpp --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEWalk.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEWalk.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,690 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEWalk.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing walks in Netedit -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEWalk.h" -#include "GNERoute.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEWalk::GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, const std::vector& edges, double arrivalPosition) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_WALK_EDGES), viewNet, GLO_WALK, SUMO_TAG_WALK_EDGES, { - edges -}, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(arrivalPosition) { -} - - -GNEWalk::GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, - double arrivalPosition) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_WALK_FROMTO), viewNet, GLO_WALK, SUMO_TAG_WALK_FROMTO, { - fromEdge, toEdge -}, {}, {}, {}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(arrivalPosition) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute walk - computePath(); -} - - -GNEWalk::GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_WALK_BUSSTOP), viewNet, GLO_WALK, SUMO_TAG_WALK_BUSSTOP, { - fromEdge -}, {}, {}, {busStop}, {personParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(-1) { - // set via parameter without updating references - replaceMiddleParentEdges(this, via, false); - // compute walk - computePath(); -} - - -GNEWalk::GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEDemandElement* routeParent, double arrivalPosition) : - GNEDemandElement(viewNet->getNet()->generateDemandElementID("", SUMO_TAG_WALK_ROUTE), viewNet, GLO_WALK, SUMO_TAG_WALK_ROUTE, -{}, {}, {}, {}, {personParent, routeParent}, {}, {}, {}, {}, {}), -Parameterised(), -myArrivalPosition(arrivalPosition) { -} - - -GNEWalk::~GNEWalk() {} - - -GUIGLObjectPopupMenu* -GNEWalk::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - // build header - buildPopupHeader(ret, app); - // build menu command for center button and copy cursor position to clipboard - buildCenterPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // buld menu commands for names - new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); - new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); - new FXMenuSeparator(ret); - // build selection and show parameters menu - myViewNet->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // show option to open demand element dialog - if (myTagProperty.hasDialog()) { - new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); - new FXMenuSeparator(ret); - } - new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); - return ret; -} - - -void -GNEWalk::writeDemandElement(OutputDevice& device) const { - // open tag - device.openTag(SUMO_TAG_WALK); - // write attributes depending of walk type - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); - } else if (myTagProperty.getTag() == SUMO_TAG_WALK_EDGES) { - device.writeAttr(SUMO_ATTR_EDGES, parseIDs(getParentEdges())); - } else { - // only write From attribute if this is the first Person Plan - if (getParentDemandElements().front()->getChildDemandElements().front() == this) { - device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); - } - // check if write busStop or edge to - if (getParentAdditionals().size() > 0) { - device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); - } else { - device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); - } - } - // only write arrivalPos if is different of -1 - if (myArrivalPosition != -1) { - device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); - } - // write parameters - writeParams(device); - // close tag - device.closeTag(); -} - - -bool -GNEWalk::isDemandElementValid() const { - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - // check if route parent is valid - return getParentDemandElements().at(1)->isDemandElementValid(); - } else if (getParentEdges().size() == 2) { - if (getParentEdges().at(0) == getParentEdges().at(1)) { - // from and to are the same edges, then path is valid - return true; - } else { - // check if exist a route between parent edges - return (getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0); - } - } else if (getPathEdges().size() > 0) { - // if path edges isn't empty, then there is a valid route - return true; - } else { - return false; - } -} - - -std::string -GNEWalk::getDemandElementProblem() const { - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - return ""; - } else if (getParentEdges().size() == 0) { - return ("A walk need at least one edge"); - } else { - // check if exist at least a connection between every edge - for (int i = 1; i < (int)getParentEdges().size(); i++) { - if (getRouteCalculatorInstance()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { - return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); - } - } - // there is connections bewteen all edges, then all ok - return ""; - } -} - - -void -GNEWalk::fixDemandElementProblem() { - // currently the only solution is removing Walk -} - - -GNEEdge* -GNEWalk::getFromEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getFromEdge(); - } else { - return getParentEdges().front(); - } -} - - -GNEEdge* -GNEWalk::getToEdge() const { - if (getParentDemandElements().size() == 2) { - // obtain position and rotation of first edge route - return getParentDemandElements().at(1)->getToEdge(); - } else { - return getParentEdges().back(); - } -} - - -SUMOVehicleClass -GNEWalk::getVClass() const { - return getParentDemandElements().front()->getVClass(); -} - - -const RGBColor& -GNEWalk::getColor() const { - return getParentDemandElements().front()->getColor(); -} - - -void -GNEWalk::startGeometryMoving() { - // only start geometry moving if arrival position isn't -1 - if (myArrivalPosition != -1) { - // always save original position over view - myWalkMove.originalViewPosition = getPositionInView(); - // save arrival position - myWalkMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); - // save current centering boundary - myWalkMove.movingGeometryBoundary = getCenteringBoundary(); - } -} - - -void -GNEWalk::endGeometryMoving() { - // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once - if ((myArrivalPosition != -1) && myWalkMove.movingGeometryBoundary.isInitialised()) { - // reset myMovingGeometryBoundary - myWalkMove.movingGeometryBoundary.reset(); - } -} - - -void -GNEWalk::moveGeometry(const Position& offset) { - // only move if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - // Calculate new position using old position - Position newPosition = myWalkMove.originalViewPosition; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myViewNet->snapToActiveGrid(newPosition); - // obtain lane shape (to improve code legibility) - const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); - // calculate offset lane - double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myWalkMove.originalViewPosition, false); - std::cout << offsetLane << std::endl; - // Update arrival Position - myArrivalPosition = parse(myWalkMove.firstOriginalLanePosition) + offsetLane; - // Update geometry - updateGeometry(); - } -} - - -void -GNEWalk::commitGeometryMoving(GNEUndoList* undoList) { - // only commit geometry moving if myArrivalPosition isn't -1 - if (myArrivalPosition != -1) { - undoList->p_begin("arrivalPos of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), true, myWalkMove.firstOriginalLanePosition)); - undoList->p_end(); - } -} - - -void -GNEWalk::updateGeometry() { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // calculate geometry path depending if is a Walk over route - if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { - // use edges of route parent - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } else if (getPathEdges().empty()) { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } else { - GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), - getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); - } - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updateGeometry(); - } -} - - -void -GNEWalk::updateDottedContour() { - // -} - - -void -GNEWalk::updatePartialGeometry(const GNEEdge* edge) { - // declare depart and arrival pos lane - double departPosLane = -1; - double arrivalPosLane = -1; - // declare start and end positions - Position startPos = Position::INVALID; - Position endPos = Position::INVALID; - // calculate person plan start and end lanepositions - calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); - // calculate person plan start and end positions - calculatePersonPlanPositionStartEndPos(startPos, endPos); - // udpate geometry path - GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); - // update child demand elementss - for (const auto& i : getChildDemandElements()) { - i->updatePartialGeometry(edge); - } -} - - -void -GNEWalk::computePath() { - if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO)) { - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), getParentEdges())); - } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, getRouteCalculatorInstance()->calculateDijkstraRoute(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); - } - // update geometry - updateGeometry(); -} - - -void -GNEWalk::invalidatePath() { - if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO)) { - // calculate route and update routeEdges - replacePathEdges(this, getParentEdges()); - } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { - // declare a from-via-busStop edges vector - std::vector fromViaBusStopEdges = getParentEdges(); - // add busStop edge - fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - // calculate route and update routeEdges - replacePathEdges(this, fromViaBusStopEdges); - } - // update geometry - updateGeometry(); -} - - -Position -GNEWalk::getPositionInView() const { - return Position(); -} - - -std::string -GNEWalk::getParentName() const { - return myViewNet->getNet()->getMicrosimID(); -} - - -Boundary -GNEWalk::getCenteringBoundary() const { - Boundary walkBoundary; - // return the combination of all parent edges's boundaries - for (const auto& i : getParentEdges()) { - walkBoundary.add(i->getCenteringBoundary()); - } - // check if is valid - if (walkBoundary.isInitialised()) { - return walkBoundary; - } else { - return Boundary(-0.1, -0.1, 0.1, 0.1); - } -} - - -void -GNEWalk::splitEdgeGeometry(const double /*splitPosition*/, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList) { - // only split geometry of WalkEdges - if ((myTagProperty.getTag() == SUMO_TAG_WALK_EDGES) && - (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && - (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { - // obtain new list of walk edges - std::string newWalkEdges = getNewListOfParents(originalElement, newElement); - // update walk edges - if (newWalkEdges.size() > 0) { - setAttribute(SUMO_ATTR_EDGES, newWalkEdges, undoList); - } - } -} - - -void -GNEWalk::drawGL(const GUIVisualizationSettings& /*s*/) const { - // Walks are drawn in GNEEdges -} - - -void -GNEWalk::selectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object of list into selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - } - } -} - - -void -GNEWalk::unselectAttributeCarrier(bool changeFlag) { - if (!myViewNet) { - throw ProcessError("ViewNet cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - - } - } -} - - -std::string -GNEWalk::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getDemandElementID(); - case SUMO_ATTR_FROM: - return getParentEdges().front()->getID(); - case SUMO_ATTR_TO: - return getParentEdges().back()->getID(); - case SUMO_ATTR_VIA: - return toString(getMiddleParentEdges()); - case SUMO_ATTR_EDGES: - return parseIDs(getParentEdges()); - case SUMO_ATTR_ROUTE: - return getParentDemandElements().at(1)->getID(); - case SUMO_ATTR_BUS_STOP: - return getParentAdditionals().front()->getID(); - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition == -1) { - return ""; - } else { - return toString(myArrivalPosition); - } - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return getParametersStr(); - case GNE_ATTR_PARENT: - return getParentDemandElements().front()->getID(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -double -GNEWalk::getAttributeDouble(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ARRIVALPOS: - if (myArrivalPosition != -1) { - return myArrivalPosition; - } else { - return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEWalk::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_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_VIA: - case SUMO_ATTR_EDGES: - case SUMO_ATTR_ROUTE: - case SUMO_ATTR_BUS_STOP: - case SUMO_ATTR_ARRIVALPOS: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myViewNet->getNet(), key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEWalk::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - return SUMOXMLDefinitions::isValidNetID(value) && (myViewNet->getNet()->retrieveEdge(value, false) != nullptr); - case SUMO_ATTR_VIA: - if (value.empty()) { - return true; - } else { - return canParse >(myViewNet->getNet(), value, false); - } - case SUMO_ATTR_EDGES: - if (canParse >(myViewNet->getNet(), value, false)) { - // all edges exist, then check if compounds a valid route - return GNERoute::isRouteValid(parse >(myViewNet->getNet(), value)).empty(); - } else { - return false; - } - case SUMO_ATTR_BUS_STOP: - return (myViewNet->getNet()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); - case SUMO_ATTR_ROUTE: - return (myViewNet->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, value, false) != nullptr); - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - return true; - } else if (canParse(value)) { - const double parsedValue = canParse(value); - if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { - return false; - } else { - return true; - } - } else { - return false; - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEWalk::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNEWalk::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -bool -GNEWalk::isAttributeEnabled(SumoXMLAttr /*key*/) const { - return true; -} - - -std::string -GNEWalk::getPopUpID() const { - return getTagStr(); -} - - -std::string -GNEWalk::getHierarchyName() const { - if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO) || (myTagProperty.getTag() == SUMO_TAG_WALK_EDGES)) { - return "walk: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); - } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { - return "walk: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); - } else { - return "walk: " + getParentDemandElements().at(1)->getID(); - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEWalk::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - // Specific of Trips and flow - case SUMO_ATTR_FROM: { - // update first edge - replaceFirstParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute walk - computePath(); - break; - } - case SUMO_ATTR_TO: { - // update last edge - replaceLastParentEdge(this, myViewNet->getNet()->retrieveEdge(value)); - // compute walk - computePath(); - break; - } - case SUMO_ATTR_VIA: { - // update via - replaceMiddleParentEdges(this, parse >(myViewNet->getNet(), value), true); - // compute walk - computePath(); - break; - } - case SUMO_ATTR_EDGES: - replaceParentEdges(this, value); - updateGeometry(); - break; - case SUMO_ATTR_ROUTE: - replaceParentDemandElement(this, value, 1); - updateGeometry(); - break; - case SUMO_ATTR_BUS_STOP: - replaceParentAdditional(this, value, 0); - // compute walk - computePath(); - break; - case SUMO_ATTR_ARRIVALPOS: - if (value.empty()) { - myArrivalPosition = -1; - } else { - myArrivalPosition = parse(value); - } - updateGeometry(); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEWalk::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEWalk.h sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEWalk.h --- sumo-1.5.0+dfsg1/src/netedit/demandelements/GNEWalk.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/demandelements/GNEWalk.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,267 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEWalk.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// A class for visualizing walks in Netedit -/****************************************************************************/ -#ifndef GNEWalk_h -#define GNEWalk_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEDemandElement.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; -class GNEConnection; -class GNEVehicle; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEWalk : public GNEDemandElement, public Parameterised { - -public: - /**@brief parameter constructor for walkEdges - * @param[in] viewNet view in which this Walk is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this walk - * @param[in] arrivalPosition arrival position on the destination edge - */ - GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, const std::vector& edges, double arrivalPosition); - - /**@brief parameter constructor for walkEdges - * @param[in] viewNet view in which this Walk is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this walk - * @param[in] arrivalPosition arrival position on the destination edge - */ - GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, - const std::vector& via, double arrivalPosition); - - /**@brief parameter constructor for walkBusStop - * @param[in] viewNet view in which this Walk is placed - * @param[in] personParent person parent - * @param[in] edges list of consecutive edges of this walk - * @param[in] busStop destination busStop - */ - GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, - const std::vector& via); - - /**@brief parameter constructor for walkRoute - * @param[in] viewNet view in which this Walk is placed - * @param[in] personParent person parent - * @param[in] personParent route parent - * @param[in] arrivalPosition arrival position on the last route's edge - */ - GNEWalk(GNEViewNet* viewNet, GNEDemandElement* personParent, GNEDemandElement* routeParent, double arrivalPosition); - - /// @brief destructor - ~GNEWalk(); - - /**@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 from edge of this demand element - GNEEdge* getFromEdge() const; - - /// @brief obtain to edge of this demand element - GNEEdge* getToEdge() const; - - /// @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 begin geometry movement - void startGeometryMoving(); - - /// @brief end geometry movement - void endGeometryMoving(); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] offset Position used for calculate new position of geometry without updating RTree - */ - void moveGeometry(const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) - * @param[in] undoList The undoList on which to register changes - */ - void commitGeometryMoving(GNEUndoList* undoList); - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief partial update pre-computed geometry information - void updatePartialGeometry(const GNEEdge* edge); - - /// @brief compute path - void computePath(); - - /// @brief invalidate path - void invalidatePath(); - - /// @brief Returns position of additional in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the name of the parent object - * @return This object's parent id - */ - std::string getParentName() 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 GNENetElement* originalElement, const GNENetElement* 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; - /// @} - - /// @brief inherited from GNEAttributeCarrier - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /* @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 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; - /// @} - -protected: - /// @brief variable for move walks - DemandElementMove myWalkMove; - - /// @brief arrival position - double myArrivalPosition; - -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 Invalidated copy constructor. - GNEWalk(GNEWalk*) = delete; - - /// @brief Invalidated assignment operator. - GNEWalk& operator=(GNEWalk*) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAbout.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAbout.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAbout.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAbout.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The "About" - dialog for NETEDIT, (adapted from GUIDialog_AboutSUMO) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -42,13 +37,13 @@ GNEAbout::GNEAbout(FXWindow* parent) : FXDialogBox(parent, "About Eclipse SUMO netedit", GUIDesignDialogBox) { // set dialog icon - setIcon(GUIIconSubSys::getIcon(ICON_NETEDIT)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::NETEDIT)); // create frame for main info FXHorizontalFrame* mainInfoFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); // Netedit icon - new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(ICON_SUMO_LOGO), GUIDesignLabelIcon); + new FXLabel(mainInfoFrame, "", GUIIconSubSys::getIcon(GUIIcon::SUMO_LOGO), GUIDesignLabelIcon); // "SUMO " FXVerticalFrame* descriptionFrame = new FXVerticalFrame(mainInfoFrame, GUIDesignLabelAboutInfo); @@ -78,7 +73,7 @@ // centered ok-button FXHorizontalFrame* buttonFrame = new FXHorizontalFrame(this, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); - FXButton* OKButton = new FXButton(buttonFrame, "&OK\t\t", GUIIconSubSys::getIcon(ICON_ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); + FXButton* OKButton = new FXButton(buttonFrame, "&OK\t\t", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); new FXHorizontalFrame(buttonFrame, GUIDesignAuxiliarHorizontalFrame); // focus OK button diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAbout.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAbout.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAbout.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAbout.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The "About" - dialog for NETEDIT, (adapted from GUIDialog_AboutSUMO) /****************************************************************************/ -#ifndef GNEAbout_h -#define GNEAbout_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -53,9 +47,3 @@ /// @brief Font for the widget FXFont* myHeadlineFont; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,12 @@ /// // A abstract class for editing additional elements /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include -#include +#include +#include #include #include @@ -36,12 +33,12 @@ // =========================================================================== FXDEFMAP(GNEAdditionalDialog) GNEAdditionalDialogMap[] = { - FXMAPFUNC(SEL_KEYPRESS, 0, GNEAdditionalDialog::onKeyPress), - FXMAPFUNC(SEL_KEYRELEASE, 0, GNEAdditionalDialog::onKeyRelease), - FXMAPFUNC(SEL_CLOSE, 0, GNEAdditionalDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEAdditionalDialog::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEAdditionalDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GNEAdditionalDialog::onCmdReset), + FXMAPFUNC(SEL_KEYPRESS, 0, GNEAdditionalDialog::onKeyPress), + FXMAPFUNC(SEL_KEYRELEASE, 0, GNEAdditionalDialog::onKeyRelease), + FXMAPFUNC(SEL_CLOSE, 0, GNEAdditionalDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEAdditionalDialog::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEAdditionalDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_RESET, GNEAdditionalDialog::onCmdReset), }; // Object abstract implementation @@ -52,7 +49,7 @@ // =========================================================================== GNEAdditionalDialog::GNEAdditionalDialog(GNEAdditional* editedAdditional, bool updatingElement, int width, int height) : - FXTopWindow(editedAdditional->getViewNet(), ("Edit '" + editedAdditional->getID() + "' data").c_str(), editedAdditional->getIcon(), editedAdditional->getIcon(), GUIDesignDialogBoxExplicit(width, height)), + FXTopWindow(editedAdditional->getNet()->getViewNet(), ("Edit '" + editedAdditional->getID() + "' data").c_str(), editedAdditional->getIcon(), editedAdditional->getIcon(), GUIDesignDialogBoxExplicit(width, height)), myEditedAdditional(editedAdditional), myUpdatingElement(updatingElement), myChangesDescription("change " + editedAdditional->getTagStr() + " values"), @@ -64,9 +61,9 @@ // create buttons centered FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose accepting changes", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose discarding changes", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); - myResetButton = new FXButton(buttonsFrame, "reset\t\treset to previous values", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GUIDesignButtonReset); + myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose accepting changes", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); + myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose discarding changes", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); + myResetButton = new FXButton(buttonsFrame, "reset\t\treset to previous values", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_BUTTON_RESET, GUIDesignButtonReset); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); } @@ -118,34 +115,35 @@ void GNEAdditionalDialog::initChanges() { // init commandGroup - myEditedAdditional->getViewNet()->getUndoList()->p_begin(myChangesDescription); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_begin(myChangesDescription); // save number of command group changes - myNumberOfChanges = myEditedAdditional->getViewNet()->getUndoList()->currentCommandGroupSize(); + myNumberOfChanges = myEditedAdditional->getNet()->getViewNet()->getUndoList()->currentCommandGroupSize(); } void GNEAdditionalDialog::acceptChanges() { // commit changes or abort last command group depending of number of changes did - if (myNumberOfChanges < myEditedAdditional->getViewNet()->getUndoList()->currentCommandGroupSize()) { - myEditedAdditional->getViewNet()->getUndoList()->p_end(); + if (myNumberOfChanges < myEditedAdditional->getNet()->getViewNet()->getUndoList()->currentCommandGroupSize()) { + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_end(); } else { - myEditedAdditional->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); } } void GNEAdditionalDialog::cancelChanges() { - myEditedAdditional->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); } void GNEAdditionalDialog::resetChanges() { // abort last command group an start editing again - myEditedAdditional->getViewNet()->getUndoList()->p_abortLastCommandGroup(); - myEditedAdditional->getViewNet()->getUndoList()->p_begin(myChangesDescription); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->p_begin(myChangesDescription); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAdditionalDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A abstract class for editing additional elements /****************************************************************************/ -#ifndef GNEAdditionalDialog_h -#define GNEAdditionalDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -131,4 +125,3 @@ GNEAdditionalDialog& operator=(const GNEAdditionalDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,12 @@ /// // Dialog for edit rerouters /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include +#include #include #include "GNEAllowDisallow.h" @@ -38,13 +34,13 @@ // =========================================================================== FXDEFMAP(GNEAllowDisallow) GNEAllowDisallowMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_CHANGE, GNEAllowDisallow::onCmdValueChanged), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_SELECTALL, GNEAllowDisallow::onCmdSelectAll), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_UNSELECTALL, GNEAllowDisallow::onCmdUnselectAll), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_SELECTONLYROAD, GNEAllowDisallow::onCmdSelectOnlyRoad), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEAllowDisallow::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEAllowDisallow::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GNEAllowDisallow::onCmdReset), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_CHANGE, GNEAllowDisallow::onCmdValueChanged), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_SELECTALL, GNEAllowDisallow::onCmdSelectAll), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_UNSELECTALL, GNEAllowDisallow::onCmdUnselectAll), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ALLOWDISALLOW_SELECTONLYROAD, GNEAllowDisallow::onCmdSelectOnlyRoad), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEAllowDisallow::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEAllowDisallow::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_RESET, GNEAllowDisallow::onCmdReset), }; // Object implementation @@ -60,17 +56,17 @@ myAC(AC) { assert(AC->getTagProperty().hasAttribute(SUMO_ATTR_ALLOW)); // set vehicle icon for this dialog - setIcon(GUIIconSubSys::getIcon(ICON_GREENVEHICLE)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE)); // create main frame FXVerticalFrame* mainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame); // create groupbox for options FXGroupBox* myGroupBoxOptions = new FXGroupBox(mainFrame, "Selection options", GUIDesignGroupBoxFrame); FXHorizontalFrame* myOptionsFrame = new FXHorizontalFrame(myGroupBoxOptions, GUIDesignAuxiliarHorizontalFrame); - mySelectAllVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(ICON_OK), this, MID_GNE_ALLOWDISALLOW_SELECTALL, GUIDesignButtonIcon); + mySelectAllVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(GUIIcon::OK), this, MID_GNE_ALLOWDISALLOW_SELECTALL, GUIDesignButtonIcon); new FXLabel(myOptionsFrame, "Allow all vehicles", nullptr, GUIDesignLabelLeftThick); - mySelectOnlyRoadVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(ICON_OK), this, MID_GNE_ALLOWDISALLOW_SELECTONLYROAD, GUIDesignButtonIcon); + mySelectOnlyRoadVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(GUIIcon::OK), this, MID_GNE_ALLOWDISALLOW_SELECTONLYROAD, GUIDesignButtonIcon); new FXLabel(myOptionsFrame, "Allow only road vehicles", nullptr, GUIDesignLabelLeftThick); - myUnselectAllVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ALLOWDISALLOW_UNSELECTALL, GUIDesignButtonIcon); + myUnselectAllVClassButton = new FXButton(myOptionsFrame, "", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_ALLOWDISALLOW_UNSELECTALL, GUIDesignButtonIcon); new FXLabel(myOptionsFrame, "Disallow all vehicles", nullptr, GUIDesignLabelLeftThick); // create groupbox for vehicles FXGroupBox* myGroupBoxVehiclesFrame = new FXGroupBox(mainFrame, ("Select " + toString(SUMO_ATTR_VCLASS) + "es").c_str(), GUIDesignGroupBoxFrame); @@ -78,42 +74,42 @@ FXHorizontalFrame* myVehiclesFrame = new FXHorizontalFrame(myGroupBoxVehiclesFrame, GUIDesignContentsFrame); // create left frame and fill it FXVerticalFrame* myContentLeftFrame = new FXVerticalFrame(myVehiclesFrame, GUIDesignAuxiliarFrame); - buildVClass(myContentLeftFrame, SVC_PASSENGER, ICON_VCLASS_PASSENGER, "Default vehicle class"); - buildVClass(myContentLeftFrame, SVC_PRIVATE, ICON_VCLASS_PRIVATE, "A passenger car assigned for private use"); - buildVClass(myContentLeftFrame, SVC_TAXI, ICON_VCLASS_TAXI, "Vehicle for hire with a driver"); - buildVClass(myContentLeftFrame, SVC_BUS, ICON_VCLASS_BUS, "Urban line traffic"); - buildVClass(myContentLeftFrame, SVC_COACH, ICON_VCLASS_COACH, "Overland transport"); - buildVClass(myContentLeftFrame, SVC_DELIVERY, ICON_VCLASS_DELIVERY, "Vehicles specialized to deliver goods"); - buildVClass(myContentLeftFrame, SVC_TRUCK, ICON_VCLASS_TRUCK, "Vehicle designed to transport cargo"); - buildVClass(myContentLeftFrame, SVC_TRAILER, ICON_VCLASS_TRAILER, "Truck with trailer"); - buildVClass(myContentLeftFrame, SVC_EMERGENCY, ICON_VCLASS_EMERGENCY, "Vehicle designated to respond to an emergency"); + buildVClass(myContentLeftFrame, SVC_PASSENGER, GUIIcon::VCLASS_PASSENGER, "Default vehicle class"); + buildVClass(myContentLeftFrame, SVC_PRIVATE, GUIIcon::VCLASS_PRIVATE, "A passenger car assigned for private use"); + buildVClass(myContentLeftFrame, SVC_TAXI, GUIIcon::VCLASS_TAXI, "Vehicle for hire with a driver"); + buildVClass(myContentLeftFrame, SVC_BUS, GUIIcon::VCLASS_BUS, "Urban line traffic"); + buildVClass(myContentLeftFrame, SVC_COACH, GUIIcon::VCLASS_COACH, "Overland transport"); + buildVClass(myContentLeftFrame, SVC_DELIVERY, GUIIcon::VCLASS_DELIVERY, "Vehicles specialized to deliver goods"); + buildVClass(myContentLeftFrame, SVC_TRUCK, GUIIcon::VCLASS_TRUCK, "Vehicle designed to transport cargo"); + buildVClass(myContentLeftFrame, SVC_TRAILER, GUIIcon::VCLASS_TRAILER, "Truck with trailer"); + buildVClass(myContentLeftFrame, SVC_EMERGENCY, GUIIcon::VCLASS_EMERGENCY, "Vehicle designated to respond to an emergency"); // create center frame and fill it FXVerticalFrame* myContentCenterFrame = new FXVerticalFrame(myVehiclesFrame, GUIDesignAuxiliarFrame); - buildVClass(myContentCenterFrame, SVC_MOTORCYCLE, ICON_VCLASS_MOTORCYCLE, "Two- or three-wheeled motor vehicle"); - buildVClass(myContentCenterFrame, SVC_MOPED, ICON_VCLASS_MOPED, "Motorcycle not allowed in motorways"); - buildVClass(myContentCenterFrame, SVC_BICYCLE, ICON_VCLASS_BICYCLE, "Human-powered, pedal-driven vehicle"); - buildVClass(myContentCenterFrame, SVC_PEDESTRIAN, ICON_VCLASS_PEDESTRIAN, "Person traveling on foot"); - buildVClass(myContentCenterFrame, SVC_TRAM, ICON_VCLASS_TRAM, "Rail vehicle which runs on tracks"); - buildVClass(myContentCenterFrame, SVC_RAIL_ELECTRIC, ICON_VCLASS_RAIL_ELECTRIC, "Rail electric vehicle"); - buildVClass(myContentCenterFrame, SVC_RAIL_FAST, ICON_VCLASS_RAIL_ELECTRIC, "High-speed rail vehicle"); - buildVClass(myContentCenterFrame, SVC_RAIL_URBAN, ICON_VCLASS_RAIL_URBAN, "Heavier than tram"); - buildVClass(myContentCenterFrame, SVC_RAIL, ICON_VCLASS_RAIL, "Heavy rail vehicle"); + buildVClass(myContentCenterFrame, SVC_MOTORCYCLE, GUIIcon::VCLASS_MOTORCYCLE, "Two- or three-wheeled motor vehicle"); + buildVClass(myContentCenterFrame, SVC_MOPED, GUIIcon::VCLASS_MOPED, "Motorcycle not allowed in motorways"); + buildVClass(myContentCenterFrame, SVC_BICYCLE, GUIIcon::VCLASS_BICYCLE, "Human-powered, pedal-driven vehicle"); + buildVClass(myContentCenterFrame, SVC_PEDESTRIAN, GUIIcon::VCLASS_PEDESTRIAN, "Person traveling on foot"); + buildVClass(myContentCenterFrame, SVC_TRAM, GUIIcon::VCLASS_TRAM, "Rail vehicle which runs on tracks"); + buildVClass(myContentCenterFrame, SVC_RAIL_ELECTRIC, GUIIcon::VCLASS_RAIL_ELECTRIC, "Rail electric vehicle"); + buildVClass(myContentCenterFrame, SVC_RAIL_FAST, GUIIcon::VCLASS_RAIL_ELECTRIC, "High-speed rail vehicle"); + buildVClass(myContentCenterFrame, SVC_RAIL_URBAN, GUIIcon::VCLASS_RAIL_URBAN, "Heavier than tram"); + buildVClass(myContentCenterFrame, SVC_RAIL, GUIIcon::VCLASS_RAIL, "Heavy rail vehicle"); // create right frame and fill it (8 vehicles) FXVerticalFrame* myContentRightFrame = new FXVerticalFrame(myVehiclesFrame, GUIDesignAuxiliarFrame); - buildVClass(myContentRightFrame, SVC_E_VEHICLE, ICON_VCLASS_EVEHICLE, "Future electric mobility vehicles"); - buildVClass(myContentRightFrame, SVC_ARMY, ICON_VCLASS_ARMY, "Vehicle designed for military forces"); - buildVClass(myContentRightFrame, SVC_SHIP, ICON_VCLASS_SHIP, "Basic class for navigating waterway"); - buildVClass(myContentRightFrame, SVC_AUTHORITY, ICON_VCLASS_AUTHORITY, "Vehicle of a governmental security agency"); - buildVClass(myContentRightFrame, SVC_VIP, ICON_VCLASS_VIP, "A civilian security armored car used by VIPs"); - buildVClass(myContentRightFrame, SVC_HOV, ICON_VCLASS_HOV, "High-Occupancy Vehicle (two or more passengers)"); - buildVClass(myContentRightFrame, SVC_CUSTOM1, ICON_VCLASS_CUSTOM1, "Reserved for user-defined semantics"); - buildVClass(myContentRightFrame, SVC_CUSTOM2, ICON_VCLASS_CUSTOM2, "Reserved for user-defined semantics"); + buildVClass(myContentRightFrame, SVC_E_VEHICLE, GUIIcon::VCLASS_EVEHICLE, "Future electric mobility vehicles"); + buildVClass(myContentRightFrame, SVC_ARMY, GUIIcon::VCLASS_ARMY, "Vehicle designed for military forces"); + buildVClass(myContentRightFrame, SVC_SHIP, GUIIcon::VCLASS_SHIP, "Basic class for navigating waterway"); + buildVClass(myContentRightFrame, SVC_AUTHORITY, GUIIcon::VCLASS_AUTHORITY, "Vehicle of a governmental security agency"); + buildVClass(myContentRightFrame, SVC_VIP, GUIIcon::VCLASS_VIP, "A civilian security armored car used by VIPs"); + buildVClass(myContentRightFrame, SVC_HOV, GUIIcon::VCLASS_HOV, "High-Occupancy Vehicle (two or more passengers)"); + buildVClass(myContentRightFrame, SVC_CUSTOM1, GUIIcon::VCLASS_CUSTOM1, "Reserved for user-defined semantics"); + buildVClass(myContentRightFrame, SVC_CUSTOM2, GUIIcon::VCLASS_CUSTOM2, "Reserved for user-defined semantics"); // create dialog buttons bot centered FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); - myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GUIDesignButtonReset); + myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); + myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); + myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_BUTTON_RESET, GUIDesignButtonReset); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); // reset dialog onCmdReset(nullptr, 0, nullptr); @@ -130,10 +126,10 @@ // change icon of button for (auto i = myVClassMap.begin(); i != myVClassMap.end(); i++) { if (i->second.first == buttonPressed) { - if (buttonPressed->getIcon() == GUIIconSubSys::getIcon(ICON_ACCEPT)) { - buttonPressed->setIcon(GUIIconSubSys::getIcon(ICON_CANCEL)); + if (buttonPressed->getIcon() == GUIIconSubSys::getIcon(GUIIcon::ACCEPT)) { + buttonPressed->setIcon(GUIIconSubSys::getIcon(GUIIcon::CANCEL)); } else { - buttonPressed->setIcon(GUIIconSubSys::getIcon(ICON_ACCEPT)); + buttonPressed->setIcon(GUIIconSubSys::getIcon(GUIIcon::ACCEPT)); } return 1; } @@ -146,7 +142,7 @@ GNEAllowDisallow::onCmdSelectAll(FXObject*, FXSelector, void*) { // change all icons to accept for (auto i : myVClassMap) { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_ACCEPT)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::ACCEPT)); } return 1; } @@ -156,7 +152,7 @@ GNEAllowDisallow::onCmdUnselectAll(FXObject*, FXSelector, void*) { // change all icons to cancel for (auto i : myVClassMap) { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_CANCEL)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::CANCEL)); } return 1; } @@ -167,9 +163,9 @@ // change all non-road icons to disallow, and allow for the rest for (auto i : myVClassMap) { if ((i.first & (SVC_PEDESTRIAN | SVC_NON_ROAD)) == 0) { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_ACCEPT)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::ACCEPT)); } else { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_CANCEL)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::CANCEL)); } } return 1; @@ -182,7 +178,7 @@ std::vector allowedVehicles; for (auto i : myVClassMap) { // check if vehicle is alloweddepending of the Icon - if (i.second.first->getIcon() == GUIIconSubSys::getIcon(ICON_ACCEPT)) { + if (i.second.first->getIcon() == GUIIconSubSys::getIcon(GUIIcon::ACCEPT)) { allowedVehicles.push_back(getVehicleClassNames(i.first)); } } @@ -207,7 +203,7 @@ if (myAC->getAttribute(SUMO_ATTR_ALLOW) == "all") { // iterate over myVClassMap and set all icons as true for (auto i : myVClassMap) { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_ACCEPT)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::ACCEPT)); } } else { // declare string vector for saving all vclasses @@ -216,9 +212,9 @@ // iterate over myVClassMap and set icons for (auto i : myVClassMap) { if (allowSet.count(getVehicleClassNames(i.first)) > 0) { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_ACCEPT)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::ACCEPT)); } else { - i.second.first->setIcon(GUIIconSubSys::getIcon(ICON_CANCEL)); + i.second.first->setIcon(GUIIconSubSys::getIcon(GUIIcon::CANCEL)); } } } @@ -236,10 +232,11 @@ FXVerticalFrame* buttonAndInformationFrame = new FXVerticalFrame(vehicleFrame, GUIDesignAuxiliarHorizontalFrame); FXHorizontalFrame* buttonAndStatusFrame = new FXHorizontalFrame(buttonAndInformationFrame, GUIDesignAuxiliarHorizontalFrame); // create status and text button - myVClassMap[vclass].first = new FXButton(buttonAndStatusFrame, "", GUIIconSubSys::getIcon(ICON_EMPTY), this, MID_GNE_ALLOWDISALLOW_CHANGE, GUIDesignButtonIcon); + myVClassMap[vclass].first = new FXButton(buttonAndStatusFrame, "", GUIIconSubSys::getIcon(GUIIcon::EMPTY), this, MID_GNE_ALLOWDISALLOW_CHANGE, GUIDesignButtonIcon); myVClassMap[vclass].second = new FXLabel(buttonAndStatusFrame, toString(vclass).c_str(), nullptr, GUIDesignLabelLeftThick); // create label for description of vehicle new FXLabel(buttonAndInformationFrame, description.c_str(), nullptr, GUIDesignLabelLeftThick); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEAllowDisallow.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // Dialog for edit allow and disallow attributes /****************************************************************************/ -#ifndef GNEAllowDisallow_h -#define GNEAllowDisallow_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -118,4 +113,3 @@ GNEAllowDisallow& operator=(const GNEAllowDisallow&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // Dialog for edit calibrators /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -30,10 +26,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "GNECalibratorDialog.h" #include "GNECalibratorFlowDialog.h" @@ -70,7 +66,7 @@ // create add buton and label for routes FXHorizontalFrame* buttonAndLabelRoute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame); - myAddRoute = new FXButton(buttonAndLabelRoute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_ROUTE, GUIDesignButtonIcon); + myAddRoute = new FXButton(buttonAndLabelRoute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_ROUTE, GUIDesignButtonIcon); new FXLabel(buttonAndLabelRoute, ("Add new " + toString(SUMO_TAG_ROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); // Create table in left frame @@ -81,7 +77,7 @@ // create add buton and label for vehicle types FXHorizontalFrame* buttonAndLabelVehicleType = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame); - myAddVehicleType = new FXButton(buttonAndLabelVehicleType, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE, GUIDesignButtonIcon); + myAddVehicleType = new FXButton(buttonAndLabelVehicleType, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE, GUIDesignButtonIcon); new FXLabel(buttonAndLabelVehicleType, ("Add new " + toString(SUMO_TAG_VTYPE) + "s").c_str(), nullptr, GUIDesignLabelThick); // Create table in left frame @@ -92,7 +88,7 @@ // create add buton and label for flows in right frame FXHorizontalFrame* buttonAndLabelFlow = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame); - myAddFlow = new FXButton(buttonAndLabelFlow, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_FLOW, GUIDesignButtonIcon); + myAddFlow = new FXButton(buttonAndLabelFlow, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_CALIBRATORDIALOG_ADD_FLOW, GUIDesignButtonIcon); myLabelFlow = new FXLabel(buttonAndLabelFlow, ("Add new " + toString(SUMO_TAG_FLOW_CALIBRATOR) + "s").c_str(), nullptr, GUIDesignLabelThick); // Create table in right frame @@ -152,7 +148,7 @@ long GNECalibratorDialog::onCmdAddRoute(FXObject*, FXSelector, void*) { // create nes calibrator route and configure it with GNERouteDialog - GNERouteDialog(new GNERoute(myEditedAdditional->getViewNet()), false); + GNERouteDialog(new GNERoute(myEditedAdditional->getNet()), false); // update routes table updateRouteTable(); return 1; @@ -162,9 +158,9 @@ long GNECalibratorDialog::onCmdClickedRoute(FXObject*, FXSelector, void*) { // check if some delete button was pressed - for (int i = 0; i < (int)myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size(); i++) { + for (int i = 0; i < (int)myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size(); i++) { // obtain rerouter - GNEDemandElement* routeToEdit = myEditedAdditional->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteList->getItem(i, 0)->getText().text()); + GNEDemandElement* routeToEdit = myEditedAdditional->getNet()->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteList->getItem(i, 0)->getText().text()); if (myRouteList->getItem(i, 2)->hasFocus()) { // find all flows that contains route to delete as "route" parameter std::vector calibratorFlowsToErase; @@ -195,10 +191,10 @@ WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'Yes'"); // remove affected flows of calibrator flows for (auto j : calibratorFlowsToErase) { - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true); } // remove route of calibrator routes - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true); // update flows and route table updateFlowTable(); updateRouteTable(); @@ -206,7 +202,7 @@ } } else { // remove route - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(routeToEdit, false), true); // update routes table updateRouteTable(); return 1; @@ -229,14 +225,14 @@ long GNECalibratorDialog::onCmdAddFlow(FXObject*, FXSelector, void*) { // only add flow if there is at least a GNERoute (There is always a Vehicle Type) - if (myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size() > 0) { + if (myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size() > 0) { // create new calibrator and configure it with GNECalibratorFlowDialog GNECalibratorFlowDialog(new GNECalibratorFlow(myEditedAdditional), false); // update flows table updateFlowTable(); return 1; } else { - throw ProcessError("myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE) cannot be empty"); + throw ProcessError("myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE) cannot be empty"); } } @@ -247,7 +243,7 @@ for (int i = 0; i < (int)myEditedAdditional->getChildAdditionals().size(); i++) { if (myFlowList->getItem(i, 2)->hasFocus()) { // remove flow of calibrator flows - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); // update flows table updateFlowTable(); return 1; @@ -267,8 +263,8 @@ long GNECalibratorDialog::onCmdAddVehicleType(FXObject*, FXSelector, void*) { // create a new Vehicle Type and configure it with GNEVehicleTypeDialog - std::string vehicleTypeID = myEditedAdditional->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_VTYPE); - GNEVehicleTypeDialog(new GNEVehicleType(myEditedAdditional->getViewNet(), vehicleTypeID, SVC_PASSENGER, SUMO_TAG_VTYPE), false); + std::string vehicleTypeID = myEditedAdditional->getNet()->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_VTYPE); + GNEVehicleTypeDialog(new GNEVehicleType(myEditedAdditional->getNet(), vehicleTypeID, SVC_PASSENGER, SUMO_TAG_VTYPE), false); // update vehicle types table updateVehicleTypeTable(); return 1; @@ -278,9 +274,9 @@ long GNECalibratorDialog::onCmdClickedVehicleType(FXObject*, FXSelector, void*) { // check if some delete button was pressed - for (int i = 0; i < (int)myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE).size(); i++) { + for (int i = 0; i < (int)myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE).size(); i++) { // obtain vehicle type - GNEDemandElement* vType = myEditedAdditional->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, myVehicleTypeList->getItem(i, 0)->getText().text()); + GNEDemandElement* vType = myEditedAdditional->getNet()->getViewNet()->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, myVehicleTypeList->getItem(i, 0)->getText().text()); // Make sure that default vehicle isn't edited if ((i == 0) && (myVehicleTypeList->getItem(i, 0)->hasFocus() || myVehicleTypeList->getItem(i, 1)->hasFocus() || myVehicleTypeList->getItem(i, 2)->hasFocus())) { FXMessageBox::warning(getApp(), MBOX_OK, @@ -313,10 +309,10 @@ WRITE_DEBUG("Closed FXMessageBox of type 'question' with 'Yes'"); // remove affected flows of calibrator flows for (auto j : calibratorFlowsToErase) { - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(j, false), true); } // remove vehicle type of calibrator vehicle types - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true); // update flows and vehicle types table updateFlowTable(); updateVehicleTypeTable(); @@ -324,7 +320,7 @@ } } else { // remove vehicle type of calibrator vehicle types - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, false), true); // update vehicle types table updateVehicleTypeTable(); return 1; @@ -349,7 +345,7 @@ // clear table myRouteList->clearItems(); // set number of rows - myRouteList->setTableSize(int(myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size()), 3); + myRouteList->setTableSize(int(myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size()), 3); // Configure list myRouteList->setVisibleColumns(4); myRouteList->setColumnWidth(0, 136); @@ -363,7 +359,7 @@ int indexRow = 0; FXTableItem* item = nullptr; // iterate over routes - for (auto i : myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { + for (auto i : myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE)) { // Set ID item = new FXTableItem(toString(i.second->getAttribute(SUMO_ATTR_ID)).c_str()); myRouteList->setItem(indexRow, 0, item); @@ -371,7 +367,7 @@ item = new FXTableItem(toString(i.second->getAttribute(SUMO_ATTR_EDGES)).c_str()); myRouteList->setItem(indexRow, 1, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myRouteList->setItem(indexRow, 2, item); @@ -410,7 +406,7 @@ item = new FXTableItem(i->getAttribute(SUMO_ATTR_ROUTE).c_str()); myFlowList->setItem(indexRow, 1, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myFlowList->setItem(indexRow, 2, item); @@ -427,7 +423,7 @@ // clear table myVehicleTypeList->clearItems(); // set number of rows - myVehicleTypeList->setTableSize(int(myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE).size()), 3); + myVehicleTypeList->setTableSize(int(myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE).size()), 3); // Configure list myVehicleTypeList->setVisibleColumns(4); myVehicleTypeList->setColumnWidth(0, 136); @@ -441,7 +437,7 @@ int indexRow = 0; FXTableItem* item = nullptr; // iterate over vehicle types - for (auto i : myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE)) { + for (auto i : myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { // Set id item = new FXTableItem(i.second->getAttribute(SUMO_ATTR_ID).c_str()); myVehicleTypeList->setItem(indexRow, 0, item); @@ -450,7 +446,7 @@ myVehicleTypeList->setItem(indexRow, 1, item); // set remove icon except for default vehicle type if (indexRow != 0) { - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); } else { item = new FXTableItem(""); } @@ -468,7 +464,7 @@ void GNECalibratorDialog::updateFlowAndLabelButton() { // disable AddFlow button if no route is defined - if (myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size() == 0) { + if (myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size() == 0) { myAddFlow->disable(); myFlowList->disable(); myLabelFlow->setText("No routes defined"); @@ -479,4 +475,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit calibrators /****************************************************************************/ -#ifndef GNECalibratorDialog_h -#define GNECalibratorDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include "GNEAdditionalDialog.h" @@ -132,4 +126,3 @@ GNECalibratorDialog& operator=(const GNECalibratorDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,12 @@ /// // Dialog for edit calibrator flows /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include +#include #include #include @@ -40,10 +36,10 @@ // =========================================================================== FXDEFMAP(GNECalibratorFlowDialog) GNECalibratorFlowDialogMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNECalibratorFlowDialog::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNECalibratorFlowDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GNECalibratorFlowDialog::onCmdReset), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GNECalibratorFlowDialog::onCmdSetVariable), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNECalibratorFlowDialog::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNECalibratorFlowDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_RESET, GNECalibratorFlowDialog::onCmdReset), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECalibratorFlowDialog::onCmdSetVariable), }; // Object implementation @@ -70,72 +66,72 @@ // 1 create combobox for type new FXLabel(columnLeftLabel, toString(SUMO_TAG_VTYPE).c_str(), nullptr, GUIDesignLabelThick); - myComboBoxVehicleType = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox); + myComboBoxVehicleType = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox); // 2 create combobox for route new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ROUTE).c_str(), nullptr, GUIDesignLabelThick); - myComboBoxRoute = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignComboBox); + myComboBoxRoute = new FXComboBox(columnLeftValue, GUIDesignComboBoxNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignComboBox); // 3 create textfield for vehs per hour new FXLabel(columnLeftLabel, toString(SUMO_ATTR_VEHSPERHOUR).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldVehsPerHour = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldVehsPerHour = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTextFieldVehsPerHour->setTextColor(FXRGB(255, 0, 0)); // 4 create textfield for vehs per hour new FXLabel(columnLeftLabel, toString(SUMO_ATTR_SPEED).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); myTextFieldSpeed->setTextColor(FXRGB(255, 0, 0)); // 5 create textfield for color new FXLabel(columnLeftLabel, toString(SUMO_ATTR_COLOR).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldColor = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldColor = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 6 create textfield for lane new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTLANE).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldDepartLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldDepartLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 7 create textfield for pos new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTPOS).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldDepartPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldDepartPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 8 create textfield for speed new FXLabel(columnLeftLabel, toString(SUMO_ATTR_DEPARTSPEED).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldDepartSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldDepartSpeed = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 9 create textfield for lane new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ARRIVALLANE).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldArrivalLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldArrivalLane = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 10 create textfield for arrival pos new FXLabel(columnLeftLabel, toString(SUMO_ATTR_ARRIVALPOS).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldArrivalPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldArrivalPos = new FXTextField(columnLeftValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 11 create textfield for arrival speed new FXLabel(columnRightLabel, toString(SUMO_ATTR_ARRIVALSPEED).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldArrivalSpeed = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldArrivalSpeed = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 12 create textfield for arrival line new FXLabel(columnRightLabel, toString(SUMO_ATTR_LINE).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldLine = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldLine = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 13 create textfield for person number new FXLabel(columnRightLabel, toString(SUMO_ATTR_PERSON_NUMBER).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldPersonNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldPersonNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 14 create textfield for container number new FXLabel(columnRightLabel, toString(SUMO_ATTR_CONTAINER_NUMBER).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldContainerNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldContainerNumber = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 15 create textfield for reroute new FXLabel(columnRightLabel, toString(SUMO_ATTR_REROUTE).c_str(), nullptr, GUIDesignLabelThick); - myRerouteCheckButton = new FXCheckButton(columnRightValue, "false", this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignCheckButton); + myRerouteCheckButton = new FXCheckButton(columnRightValue, "false", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); // 16 create textfield for depart pos lat new FXLabel(columnRightLabel, toString(SUMO_ATTR_DEPARTPOS_LAT).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldDepartPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldDepartPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 17 create textfield for arrival pos lat new FXLabel(columnRightLabel, toString(SUMO_ATTR_ARRIVALPOS_LAT).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldArrivalPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldArrivalPosLat = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 18 create textfield for begin new FXLabel(columnRightLabel, toString(SUMO_ATTR_BEGIN).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldBegin = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldBegin = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // 19 create textfield for end new FXLabel(columnRightLabel, toString(SUMO_ATTR_END).c_str(), nullptr, GUIDesignLabelThick); - myTextFieldEnd = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldEnd = new FXTextField(columnRightValue, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // fill comboBox of VTypes - for (auto i : myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE)) { + for (auto i : myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { myComboBoxVehicleType->appendItem(i.first.c_str()); } myComboBoxVehicleType->setNumVisible((int)myComboBoxVehicleType->getNumItems()); // fill comboBox of Routes - for (auto i : myEditedAdditional->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { + for (auto i : myEditedAdditional->getNet()->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE)) { myComboBoxRoute->appendItem(i.first.c_str()); } myComboBoxRoute->setNumVisible((int)myComboBoxRoute->getNumItems()); @@ -148,7 +144,7 @@ // add element if we aren't updating an existent element if (myUpdatingElement == false) { - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true); } // open as modal dialog @@ -224,7 +220,7 @@ myCalibratorFlowValid = true; myInvalidAttr = SUMO_ATTR_NOTHING; // get pointer to undo list (Only for code legilibity) - GNEUndoList* undoList = myEditedAdditional->getViewNet()->getUndoList(); + GNEUndoList* undoList = myEditedAdditional->getNet()->getViewNet()->getUndoList(); // set color of myComboBoxVehicleType, depending if current value is valid or not if (myEditedAdditional->isValid(SUMO_ATTR_TYPE, myComboBoxVehicleType->getText().text())) { myComboBoxVehicleType->setTextColor(FXRGB(0, 0, 0)); diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNECalibratorFlowDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit calibrator flows /****************************************************************************/ -#ifndef GNECalibratorFlowDialog_h -#define GNECalibratorFlowDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include "GNEAdditionalDialog.h" @@ -146,4 +140,3 @@ GNECalibratorFlowDialog& operator=(const GNECalibratorFlowDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,12 @@ /// // A abstract class for editing additional elements /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include -#include +#include +#include #include #include @@ -36,12 +33,12 @@ // =========================================================================== FXDEFMAP(GNEDemandElementDialog) GNEDemandElementDialogMap[] = { - FXMAPFUNC(SEL_KEYPRESS, 0, GNEDemandElementDialog::onKeyPress), - FXMAPFUNC(SEL_KEYRELEASE, 0, GNEDemandElementDialog::onKeyRelease), - FXMAPFUNC(SEL_CLOSE, 0, GNEDemandElementDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEDemandElementDialog::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEDemandElementDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GNEDemandElementDialog::onCmdReset), + FXMAPFUNC(SEL_KEYPRESS, 0, GNEDemandElementDialog::onKeyPress), + FXMAPFUNC(SEL_KEYRELEASE, 0, GNEDemandElementDialog::onKeyRelease), + FXMAPFUNC(SEL_CLOSE, 0, GNEDemandElementDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEDemandElementDialog::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEDemandElementDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_RESET, GNEDemandElementDialog::onCmdReset), }; // Object abstract implementation @@ -52,7 +49,7 @@ // =========================================================================== GNEDemandElementDialog::GNEDemandElementDialog(GNEDemandElement* editedDemandElement, bool updatingElement, int width, int height) : - FXTopWindow(editedDemandElement->getViewNet(), ("Edit '" + editedDemandElement->getID() + "' data").c_str(), editedDemandElement->getIcon(), editedDemandElement->getIcon(), GUIDesignDialogBoxExplicit(width, height)), + FXTopWindow(editedDemandElement->getNet()->getViewNet(), ("Edit '" + editedDemandElement->getID() + "' data").c_str(), editedDemandElement->getIcon(), editedDemandElement->getIcon(), GUIDesignDialogBoxExplicit(width, height)), myEditedDemandElement(editedDemandElement), myUpdatingElement(updatingElement), myChangesDescription("change " + editedDemandElement->getTagStr() + " values"), @@ -64,9 +61,9 @@ // create buttons centered FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose accepting changes", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose discarding changes", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); - myResetButton = new FXButton(buttonsFrame, "reset\t\treset to previous values", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GUIDesignButtonReset); + myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose accepting changes", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); + myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose discarding changes", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); + myResetButton = new FXButton(buttonsFrame, "reset\t\treset to previous values", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_BUTTON_RESET, GUIDesignButtonReset); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); } @@ -118,34 +115,35 @@ void GNEDemandElementDialog::initChanges() { // init commandGroup - myEditedDemandElement->getViewNet()->getUndoList()->p_begin(myChangesDescription); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_begin(myChangesDescription); // save number of command group changes - myNumberOfChanges = myEditedDemandElement->getViewNet()->getUndoList()->currentCommandGroupSize(); + myNumberOfChanges = myEditedDemandElement->getNet()->getViewNet()->getUndoList()->currentCommandGroupSize(); } void GNEDemandElementDialog::acceptChanges() { // commit changes or abort last command group depending of number of changes did - if (myNumberOfChanges < myEditedDemandElement->getViewNet()->getUndoList()->currentCommandGroupSize()) { - myEditedDemandElement->getViewNet()->getUndoList()->p_end(); + if (myNumberOfChanges < myEditedDemandElement->getNet()->getViewNet()->getUndoList()->currentCommandGroupSize()) { + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_end(); } else { - myEditedDemandElement->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); } } void GNEDemandElementDialog::cancelChanges() { - myEditedDemandElement->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); } void GNEDemandElementDialog::resetChanges() { // abort last command group an start editing again - myEditedDemandElement->getViewNet()->getUndoList()->p_abortLastCommandGroup(); - myEditedDemandElement->getViewNet()->getUndoList()->p_begin(myChangesDescription); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->p_begin(myChangesDescription); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDemandElementDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A abstract class for editing additional elements /****************************************************************************/ -#ifndef GNEDemandElementDialog_h -#define GNEDemandElementDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -131,4 +125,3 @@ GNEDemandElementDialog& operator=(const GNEDemandElementDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,18 +17,12 @@ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - #include #include #include #include -#include +#include #include "GNEDialogACChooser.h" @@ -86,5 +80,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEDialogACChooser.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ -#ifndef GNEDialogACChooser_h -#define GNEDialogACChooser_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -81,9 +74,3 @@ /// @brief whether the current locator is for TLS bool myLocateTLS; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,11 @@ /// // Dialog used to fix additional elements /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include -#include +#include #include #include #include @@ -38,9 +34,9 @@ // =========================================================================== FXDEFMAP(GNEFixAdditionalElements) GNEFixAdditionalElementsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEFixAdditionalElements::onCmdSelectOption), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEFixAdditionalElements::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEFixAdditionalElements::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEFixAdditionalElements::onCmdSelectOption), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEFixAdditionalElements::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEFixAdditionalElements::onCmdCancel), }; // Object implementation @@ -54,7 +50,7 @@ FXDialogBox(viewNet->getApp(), ("Fix additional problems"), GUIDesignDialogBoxExplicit(500, 380)), myViewNet(viewNet) { // set busStop icon for this dialog - setIcon(GUIIconSubSys::getIcon(ICON_BUSSTOP)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::BUSSTOP)); // create main frame myMainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame); // create AdditionalList @@ -74,8 +70,8 @@ // create dialog buttons bot centered FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(myMainFrame, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, FXWindow::tr("&Accept"), GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, FXWindow::tr("&Cancel"), GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); + 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(); @@ -380,4 +376,5 @@ fixPositionsAndSave->disable(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixAdditionalElements.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog used to fix additional elements /****************************************************************************/ -#ifndef GNEFixAdditionalElements_h -#define GNEFixAdditionalElements_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -173,4 +167,3 @@ GNEFixAdditionalElements& operator=(const GNEFixAdditionalElements&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,11 @@ /// // Dialog used to fix demand elements during saving /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include -#include +#include #include #include #include @@ -38,9 +34,9 @@ // =========================================================================== FXDEFMAP(GNEFixDemandElements) GNEFixDemandElementsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEFixDemandElements::onCmdSelectOption), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEFixDemandElements::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEFixDemandElements::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEFixDemandElements::onCmdSelectOption), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEFixDemandElements::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEFixDemandElements::onCmdCancel), }; // Object implementation @@ -51,10 +47,10 @@ // =========================================================================== GNEFixDemandElements::GNEFixDemandElements(GNEViewNet* viewNet, const std::vector& invalidDemandElements) : - FXDialogBox(viewNet->getApp(), "Fix demand elements problems", GUIDesignDialogBoxExplicit(500, 420)), + FXDialogBox(viewNet->getApp(), "Fix demand elements problems", GUIDesignDialogBoxExplicit(500, 450)), myViewNet(viewNet) { // set busStop icon for this dialog - setIcon(GUIIconSubSys::getIcon(ICON_ROUTE)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::ROUTE)); // create main frame myMainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame); // create demand list @@ -65,6 +61,8 @@ myFixVehicleOptions = new FixVehicleOptions(this); // create fix stops options myFixStopOptions = new FixStopOptions(this); + // create fix person plans options + myFixPersonPlanOptions = new FixPersonPlanOptions(this); // check if fix route options has to be disabled if (myDemandList->myInvalidRoutes.empty()) { myFixRouteOptions->disableFixRouteOptions(); @@ -73,15 +71,19 @@ if (myDemandList->myInvalidVehicles.empty()) { myFixVehicleOptions->disableFixVehicleOptions(); } - // check if fix vehicle options has to be disabled - if (myDemandList->myInvalidVehicles.empty()) { + // 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(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, FXWindow::tr("&Cancel"), GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); + 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(); @@ -97,6 +99,7 @@ myFixRouteOptions->selectOption(obj); myFixVehicleOptions->selectOption(obj); myFixStopOptions->selectOption(obj); + myFixPersonPlanOptions->selectOption(obj); return 1; } @@ -104,7 +107,7 @@ long GNEFixDemandElements::onCmdAccept(FXObject*, FXSelector, void*) { bool continueSaving = true; - // first check options for invalid routes + // check options for invalid routes if (myDemandList->myInvalidRoutes.size() > 0) { if (myFixRouteOptions->removeInvalidRoutes->getCheck() == TRUE) { // begin undo list @@ -128,7 +131,7 @@ continueSaving = false; } } - // first check options for invalid vehicles + // check options for invalid vehicles if (myDemandList->myInvalidVehicles.size() > 0) { if (myFixVehicleOptions->removeInvalidVehicles->getCheck() == TRUE) { // begin undo list @@ -152,7 +155,7 @@ continueSaving = false; } } - // first check options for stops + // check options for stops if (myDemandList->myInvalidStops.size() > 0) { if (myFixStopOptions->activateFriendlyPositionAndSave->getCheck() == TRUE) { // begin undo list @@ -181,6 +184,30 @@ continueSaving = false; } } + // check options for person plans + if (myDemandList->myInvalidPersonPlans.size() > 0) { + if (myFixPersonPlanOptions->deletePersonPlan->getCheck() == TRUE) { + /* + // begin undo list + myViewNet->getUndoList()->p_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()->p_end(); + */ + } else if (myFixPersonPlanOptions->selectInvalidPersonPlansAndCancel->getCheck() == TRUE) { + myViewNet->getUndoList()->p_begin("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()->p_end(); + // abort saving + continueSaving = false; + } + } if (continueSaving) { // stop modal with TRUE (continue saving) getApp()->stopModal(this, TRUE); @@ -214,8 +241,10 @@ for (const auto& i : invalidDemandElements) { if (i->getTagProperty().isVehicle()) { myInvalidVehicles.push_back(i); - } else if (i->getTagProperty().isStop() || i->getTagProperty().isPersonPlan()) { + } else if (i->getTagProperty().isStop() || i->getTagProperty().isPersonStop()) { myInvalidStops.push_back(i); + } else if (i->getTagProperty().isPersonPlan()) { + myInvalidPersonPlans.push_back(i); } else { myInvalidRoutes.push_back(i); } @@ -223,7 +252,7 @@ // clear table myTable->clearItems(); // set number of rows - myTable->setTableSize((int)(myInvalidRoutes.size() + myInvalidVehicles.size() + myInvalidStops.size()), 3); + myTable->setTableSize((int)(myInvalidRoutes.size() + myInvalidVehicles.size() + myInvalidStops.size() + myInvalidPersonPlans.size()), 3); // Configure list myTable->setVisibleColumns(4); myTable->setColumnWidth(0, GUIDesignTableIconCellWidth); @@ -237,51 +266,68 @@ int indexRow = 0; FXTableItem* item = nullptr; // iterate over invalid routes - for (auto i : myInvalidRoutes) { + for (const auto& invalidRoute : myInvalidRoutes) { // Set icon - item = new FXTableItem("", i->getIcon()); + item = new FXTableItem("", invalidRoute->getIcon()); item->setIconPosition(FXTableItem::CENTER_X); myTable->setItem(indexRow, 0, item); // Set ID - item = new FXTableItem(i->getID().c_str()); + item = new FXTableItem(invalidRoute->getID().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 1, item); // Set conflict - item = new FXTableItem(i->getDemandElementProblem().c_str()); + item = new FXTableItem(invalidRoute->getDemandElementProblem().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 2, item); // Update index indexRow++; } // iterate over invalid vehicles - for (auto i : myInvalidVehicles) { + for (const auto& invalidVehicle : myInvalidVehicles) { // Set icon - item = new FXTableItem("", i->getIcon()); + item = new FXTableItem("", invalidVehicle->getIcon()); item->setIconPosition(FXTableItem::CENTER_X); myTable->setItem(indexRow, 0, item); // Set ID - item = new FXTableItem(i->getID().c_str()); + item = new FXTableItem(invalidVehicle->getID().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 1, item); // Set conflict - item = new FXTableItem(i->getDemandElementProblem().c_str()); + item = new FXTableItem(invalidVehicle->getDemandElementProblem().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 2, item); // Update index indexRow++; } // iterate over invalid stops - for (auto i : myInvalidStops) { + 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 + item = new FXTableItem(invalidStop->getDemandElementProblem().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("", i->getIcon()); + item = new FXTableItem("", invalidPersonPlan->getIcon()); item->setIconPosition(FXTableItem::CENTER_X); myTable->setItem(indexRow, 0, item); // Set ID - item = new FXTableItem(i->getID().c_str()); + item = new FXTableItem(invalidPersonPlan->getID().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 1, item); // Set conflict - item = new FXTableItem(i->getDemandElementProblem().c_str()); + item = new FXTableItem(invalidPersonPlan->getDemandElementProblem().c_str()); item->setJustify(FXTableItem::LEFT | FXTableItem::CENTER_Y); myTable->setItem(indexRow, 2, item); // Update index @@ -468,4 +514,61 @@ selectInvalidStopsAndCancel->disable(); } +// --------------------------------------------------------------------------- +// 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); + // leave option "activateFriendlyPositionAndSave" as default + deletePersonPlan->setCheck(true); +} + + +void +GNEFixDemandElements::FixPersonPlanOptions::selectOption(FXObject* option) { + if (option == deletePersonPlan) { + deletePersonPlan->setCheck(true); + saveInvalid->setCheck(false); + selectInvalidPersonPlansAndCancel->setCheck(false); + selectInvalidPersonPlansAndCancel->setCheck(false); + } else if (option == saveInvalid) { + deletePersonPlan->setCheck(false); + saveInvalid->setCheck(true); + selectInvalidPersonPlansAndCancel->setCheck(false); + } else if (option == selectInvalidPersonPlansAndCancel) { + deletePersonPlan->setCheck(false); + saveInvalid->setCheck(false); + selectInvalidPersonPlansAndCancel->setCheck(true); + } +} + + +void +GNEFixDemandElements::FixPersonPlanOptions::enableFixPersonPlanOptions() { + deletePersonPlan->enable(); + saveInvalid->enable(); + selectInvalidPersonPlansAndCancel->enable(); +} + + +void +GNEFixDemandElements::FixPersonPlanOptions::disableFixPersonPlanOptions() { + deletePersonPlan->disable(); + saveInvalid->disable(); + selectInvalidPersonPlansAndCancel->disable(); +} + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEFixDemandElements.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog used to fix demand elements during saving /****************************************************************************/ -#ifndef GNEFixDemandElements_h -#define GNEFixDemandElements_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -82,6 +76,9 @@ /// @brief vector with the invalid stops std::vector myInvalidStops; + /// @brief vector with the invalid person plans + std::vector myInvalidPersonPlans; + /// @brief list with the demand elements FXTable* myTable; }; @@ -167,6 +164,32 @@ FXRadioButton* selectInvalidStopsAndCancel; }; + /// @brief groupbox for all radio buttons related with fix person plan options + class FixPersonPlanOptions : public FXGroupBox { + + public: + /// @brief build Position Options + FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsDialogParents); + + /// @brief select option + void selectOption(FXObject* option); + + /// @brief enable position options + void enableFixPersonPlanOptions(); + + /// @brief disable position options + void disableFixPersonPlanOptions(); + + /// @brief Option "delete person plan" + FXRadioButton* deletePersonPlan; + + /// @brief Option "Save invalid" + FXRadioButton* saveInvalid; + + /// @brief Option "Select invalid person plans and cancel" + FXRadioButton* selectInvalidPersonPlansAndCancel; + }; + FOX_CONSTRUCTOR(GNEFixDemandElements) /// @brief view net @@ -187,6 +210,9 @@ /// @brief fix stop options FixStopOptions* myFixStopOptions; + /// @brief fix person plan options + FixPersonPlanOptions* myFixPersonPlanOptions; + /// @brief accept button FXButton* myAcceptButton; @@ -201,4 +227,3 @@ GNEFixDemandElements& operator=(const GNEFixDemandElements&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // Dialog for edit parameters /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -37,13 +33,13 @@ // =========================================================================== FXDEFMAP(GNEParametersDialog) GNEParametersDialogMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GNEParametersDialog::onCmdAccept), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GNEParametersDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GNEParametersDialog::onCmdReset), - FXMAPFUNC(SEL_CHORE, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), - FXMAPFUNC(SEL_TIMEOUT, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), - FXMAPFUNC(SEL_CLOSE, 0, GNEParametersDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_ACCEPT, GNEParametersDialog::onCmdAccept), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CANCEL, GNEParametersDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_RESET, GNEParametersDialog::onCmdReset), + FXMAPFUNC(SEL_CHORE, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), + FXMAPFUNC(SEL_TIMEOUT, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, FXDialogBox::ID_CANCEL, GNEParametersDialog::onCmdCancel), + FXMAPFUNC(SEL_CLOSE, 0, GNEParametersDialog::onCmdCancel), }; FXDEFMAP(GNEParametersDialog::ParametersValues) ParametersValuesMap[] = { @@ -53,17 +49,17 @@ }; FXDEFMAP(GNEParametersDialog::ParametersOptions) ParametersOptionsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_PARAMETERS_LOAD, GNEParametersDialog::ParametersOptions::onCmdLoadParameters), - FXMAPFUNC(SEL_COMMAND, MID_GNE_PARAMETERS_SAVE, GNEParametersDialog::ParametersOptions::onCmdSaveParameters), - FXMAPFUNC(SEL_COMMAND, MID_GNE_PARAMETERS_CLEAR, GNEParametersDialog::ParametersOptions::onCmdClearParameters), - FXMAPFUNC(SEL_COMMAND, MID_GNE_PARAMETERS_SORT, GNEParametersDialog::ParametersOptions::onCmdSortParameters), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEParametersDialog::ParametersOptions::onCmdHelpParameter), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_LOAD, GNEParametersDialog::ParametersOptions::onCmdLoadParameters), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_SAVE, GNEParametersDialog::ParametersOptions::onCmdSaveParameters), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_CLEAR, GNEParametersDialog::ParametersOptions::onCmdClearParameters), + FXMAPFUNC(SEL_COMMAND, MID_GNE_BUTTON_SORT, GNEParametersDialog::ParametersOptions::onCmdSortParameters), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEParametersDialog::ParametersOptions::onCmdHelpParameter), }; // Object implementation -FXIMPLEMENT(GNEParametersDialog, FXDialogBox, GNEParametersDialogMap, ARRAYNUMBER(GNEParametersDialogMap)) -FXIMPLEMENT(GNEParametersDialog::ParametersValues, FXGroupBox, ParametersValuesMap, ARRAYNUMBER(ParametersValuesMap)) -FXIMPLEMENT(GNEParametersDialog::ParametersOptions, FXGroupBox, ParametersOptionsMap, ARRAYNUMBER(ParametersOptionsMap)) +FXIMPLEMENT(GNEParametersDialog, FXDialogBox, GNEParametersDialogMap, ARRAYNUMBER(GNEParametersDialogMap)) +FXIMPLEMENT(GNEParametersDialog::ParametersValues, FXGroupBox, ParametersValuesMap, ARRAYNUMBER(ParametersValuesMap)) +FXIMPLEMENT(GNEParametersDialog::ParametersOptions, FXGroupBox, ParametersOptionsMap, ARRAYNUMBER(ParametersOptionsMap)) // =========================================================================== // member method definitions @@ -150,7 +146,7 @@ // find what value was changed for (int i = 0; i < (int)myParameterRows.size(); i++) { if (myParameterRows.at(i)->keyField == obj) { - // change key of Parameter + // change key of Parameter myParameterDialogParent->myEditedParameters.at(i).first = myParameterRows.at(i)->keyField->getText().text(); // change color of text field depending if key is valid or empty if (myParameterDialogParent->myEditedParameters.at(i).first.empty() || SUMOXMLDefinitions::isValidParameterKey(myParameterDialogParent->myEditedParameters.at(i).first)) { @@ -160,7 +156,7 @@ myParameterRows.at(i)->keyField->killFocus(); } } else if (myParameterRows.at(i)->valueField == obj) { - // change value of Parameter + // change value of Parameter myParameterDialogParent->myEditedParameters.at(i).second = myParameterRows.at(i)->valueField->getText().text(); // change color of text field depending if attribute is valid if (SUMOXMLDefinitions::isValidParameterValue(myParameterDialogParent->myEditedParameters.at(i).second)) { @@ -179,16 +175,16 @@ GNEParametersDialog::ParametersValues::onCmdButtonPress(FXObject* obj, FXSelector, void*) { // first check if add button was pressed if (myParameterRows.back()->button == obj) { - // create new parameter + // create new parameter myParameterDialogParent->myEditedParameters.push_back(std::make_pair("", "")); // update values and finish updateValues(); return 1; } else { - // in other case, button press was a "remove button". Find id and remove the Parameter + // in other case, button press was a "remove button". Find id and remove the Parameter for (int i = 0; i < (int)myParameterRows.size(); i++) { if (myParameterRows.at(i)->button == obj && i < (int)myParameterDialogParent->myEditedParameters.size()) { - // remove parameter + // remove parameter myParameterDialogParent->myEditedParameters.erase(myParameterDialogParent->myEditedParameters.begin() + i); // update values and finish updateValues(); @@ -205,7 +201,7 @@ horizontalFrame = new FXHorizontalFrame(verticalFrameParent, GUIDesignAuxiliarHorizontalFrame); keyField = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, ParametersValues, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); valueField = new FXTextField(horizontalFrame, GUIDesignTextFieldNCol, ParametersValues, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - button = new FXButton(horizontalFrame, "", GUIIconSubSys::getIcon(ICON_REMOVE), ParametersValues, MID_GNE_REMOVE_ATTRIBUTE, GUIDesignButtonIcon); + button = new FXButton(horizontalFrame, "", GUIIconSubSys::getIcon(GUIIcon::REMOVE), ParametersValues, MID_GNE_REMOVE_ATTRIBUTE, GUIDesignButtonIcon); // only create elements if vertical frame was previously created if (verticalFrameParent->id()) { horizontalFrame->create(); @@ -229,7 +225,7 @@ valueField->setText(""); valueField->disable(); button->disable(); - button->setIcon(GUIIconSubSys::getIcon(ICON_REMOVE)); + button->setIcon(GUIIconSubSys::getIcon(GUIIcon::REMOVE)); } @@ -253,7 +249,7 @@ valueField->enable(); // enable button and set icon remove button->enable(); - button->setIcon(GUIIconSubSys::getIcon(ICON_REMOVE)); + button->setIcon(GUIIconSubSys::getIcon(GUIIcon::REMOVE)); } @@ -266,14 +262,14 @@ valueField->disable(); // enable remove button and set "add" icon and focus button->enable(); - button->setIcon(GUIIconSubSys::getIcon(ICON_ADD)); + button->setIcon(GUIIconSubSys::getIcon(GUIIcon::ADD)); button->setFocus(); } bool GNEParametersDialog::ParametersValues::ParameterRow::isButtonInAddMode() const { - return (button->getIcon() == GUIIconSubSys::getIcon(ICON_ADD)); + return (button->getIcon() == GUIIconSubSys::getIcon(GUIIcon::ADD)); } @@ -291,11 +287,11 @@ FXGroupBox(frame, "Options", GUIDesignGroupBoxFrame100), myParameterDialogParent(ParameterDialogParent) { // create buttons - mySortButton = new FXButton(this, "Sort", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_GNE_PARAMETERS_SORT, GUIDesignButtonRectangular100x23); - myClearButton = new FXButton(this, "Clear", GUIIconSubSys::getIcon(ICON_CLEANJUNCTIONS), this, MID_GNE_PARAMETERS_CLEAR, GUIDesignButtonRectangular100x23); - myLoadButton = new FXButton(this, "Load", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_GNE_PARAMETERS_LOAD, GUIDesignButtonRectangular100x23); - mySaveButton = new FXButton(this, "Save", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_GNE_PARAMETERS_SAVE, GUIDesignButtonRectangular100x23); - myHelpButton = new FXButton(this, "Help", GUIIconSubSys::getIcon(ICON_HELP), this, MID_HELP, GUIDesignButtonRectangular100x23); + mySortButton = new FXButton(this, "Sort", GUIIconSubSys::getIcon(GUIIcon::RELOAD), this, MID_GNE_BUTTON_SORT, GUIDesignButtonRectangular100x23); + myClearButton = new FXButton(this, "Clear", GUIIconSubSys::getIcon(GUIIcon::CLEANJUNCTIONS), this, MID_GNE_BUTTON_CLEAR, GUIDesignButtonRectangular100x23); + myLoadButton = new FXButton(this, "Load", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_GNE_BUTTON_LOAD, GUIDesignButtonRectangular100x23); + mySaveButton = new FXButton(this, "Save", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_GNE_BUTTON_SAVE, GUIDesignButtonRectangular100x23); + myHelpButton = new FXButton(this, "Help", GUIIconSubSys::getIcon(GUIIcon::HELP), this, MID_HELP, GUIDesignButtonRectangular100x23); } @@ -305,8 +301,8 @@ long GNEParametersDialog::ParametersOptions::onCmdLoadParameters(FXObject*, FXSelector, void*) { // get the Additional file name - FXFileDialog opendialog(this, "Open Parameter Template"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_GREENVEHICLE)); + FXFileDialog opendialog(this, "Open Parameter Template"); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList(" Parameter Template files (*.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -315,15 +311,15 @@ if (opendialog.execute()) { gCurrentFolder = opendialog.getDirectory(); std::string file = opendialog.getFilename().text(); - // save current number of parameters + // save current number of parameters int numberOfParametersbeforeLoad = (int)myParameterDialogParent->myEditedParameters.size(); // Create additional handler and run parser GNEParameterHandler handler(this, file); if (!XMLSubSys::runParser(handler, file, false)) { - WRITE_MESSAGE("Loading of Parameters From " + file + " failed."); + WRITE_MESSAGE("Loading of Parameters From " + file + " failed."); } // show loaded attributes - WRITE_MESSAGE("Loaded " + toString((int)myParameterDialogParent->myEditedParameters.size() - numberOfParametersbeforeLoad) + " Parameters."); + WRITE_MESSAGE("Loaded " + toString((int)myParameterDialogParent->myEditedParameters.size() - numberOfParametersbeforeLoad) + " Parameters."); // update values myParameterDialogParent->myParametersValues->updateValues(); } @@ -333,18 +329,18 @@ long GNEParametersDialog::ParametersOptions::onCmdSaveParameters(FXObject*, FXSelector, void*) { - // obtain file to save parameters + // obtain file to save parameters FXString file = MFXUtils::getFilename2Write(this, - "Select name of the Parameter Template file", ".xml", - GUIIconSubSys::getIcon(ICON_GREENVEHICLE), + "Select name of the Parameter Template file", ".xml", + GUIIconSubSys::getIcon(GUIIcon::GREENVEHICLE), gCurrentFolder); if (file == "") { - // None parameter file was selected, then stop function + // None parameter file was selected, then stop function return 1; } else { OutputDevice& device = OutputDevice::getDevice(file.text()); device.writeXMLHeader("Parameter", "parameter_file.xsd"); - // iterate over all parameters and save it in the filename + // iterate over all parameters and save it in the filename for (auto i = myParameterDialogParent->myEditedParameters.begin(); i != myParameterDialogParent->myEditedParameters.end(); i++) { device.openTag(SUMO_TAG_PARAM); device.writeAttr(SUMO_ATTR_KEY, i->first); @@ -359,7 +355,7 @@ long GNEParametersDialog::ParametersOptions::onCmdClearParameters(FXObject*, FXSelector, void*) { - // simply clear parameters from ParametersValues + // simply clear parameters from ParametersValues myParameterDialogParent->myParametersValues->clearParameters(); return 1; } @@ -377,7 +373,7 @@ valuesEmpty.push_back(i->second); } } - // now sort non-empty parameters + // now sort non-empty parameters std::sort(ParametersNoEmpty.begin(), ParametersNoEmpty.end()); // add values without key for (auto i : valuesEmpty) { @@ -387,7 +383,7 @@ while (ParametersNoEmpty.size() < myParameterDialogParent->myEditedParameters.size()) { ParametersNoEmpty.push_back(std::make_pair("", "")); } - // finally replace parameters in myParametersValues with ParametersNoEmpty + // finally replace parameters in myParametersValues with ParametersNoEmpty myParameterDialogParent->myParametersValues->setParameters(ParametersNoEmpty); // update values myParameterDialogParent->myParametersValues->updateValues(); @@ -399,11 +395,11 @@ GNEParametersDialog::ParametersOptions::onCmdHelpParameter(FXObject*, FXSelector, void*) { // Create dialog box FXDialogBox* ParameterHelpDialog = new FXDialogBox(this, " Parameters Help", GUIDesignDialogBox); - ParameterHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_APP_TABLE)); + ParameterHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TABLE)); // set help text std::ostringstream help; help - << "- Parameters are defined by a Key and a Value.\n" + << "- Parameters are defined by a Key and a Value.\n" << "- In Netedit can be defined using format key1=parameter1|key2=parameter2|...\n" << " - Duplicated and empty Keys aren't valid.\n" << " - Certain characters aren't allowed (\t\n\r@$%^&/|\\....)\n"; @@ -415,10 +411,10 @@ FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(ParameterHelpDialog, GUIDesignAuxiliarHorizontalFrame); // Create Button Close (And two more horizontal frames to center it) new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); - new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), ParameterHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), ParameterHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); // Write Warning in console if we're in testing mode - WRITE_DEBUG("Opening Parameter help dialog"); + WRITE_DEBUG("Opening Parameter help dialog"); // create Dialog ParameterHelpDialog->create(); // show in the given position @@ -428,7 +424,7 @@ // open as modal dialog (will block all windows until stop() or stopModal() is called) getApp()->runModalFor(ParameterHelpDialog); // Write Warning in console if we're in testing mode - WRITE_DEBUG("Closing Parameter help dialog"); + WRITE_DEBUG("Closing Parameter help dialog"); return 1; } @@ -451,11 +447,11 @@ // Call parse and build depending of tag switch (tag) { case SUMO_TAG_PARAM: - // Check that format of Parameter is correct + // Check that format of Parameter is correct if (!attrs.hasAttribute(SUMO_ATTR_KEY)) { - WRITE_WARNING("Key of Parameter not defined"); + WRITE_WARNING("Key of Parameter not defined"); } else if (!attrs.hasAttribute(SUMO_ATTR_VALUE)) { - WRITE_WARNING("Value of Parameter not defined"); + WRITE_WARNING("Value of Parameter not defined"); } else { // obtain Key and value std::string key = attrs.getString(SUMO_ATTR_KEY); @@ -463,14 +459,14 @@ // check that parsed values are correct if (!SUMOXMLDefinitions::isValidParameterKey(key)) { if (key.size() == 0) { - WRITE_WARNING("Key of Parameter cannot be empty"); + WRITE_WARNING("Key of Parameter cannot be empty"); } else { - WRITE_WARNING("Key '" + key + "' of Parameter contains invalid characters"); + WRITE_WARNING("Key '" + key + "' of Parameter contains invalid characters"); } } else if (!SUMOXMLDefinitions::isValidParameterValue(value)) { - WRITE_WARNING("Value '" + value + "'of Parameter contains invalid characters"); + WRITE_WARNING("Value '" + value + "'of Parameter contains invalid characters"); } else { - // add parameter to vector of myParameterDialogParent + // add parameter to vector of myParameterDialogParent myParametersOptionsParent->myParameterDialogParent->myParametersValues->addParameter(std::make_pair(key, value)); } } @@ -486,28 +482,28 @@ // --------------------------------------------------------------------------- GNEParametersDialog::GNEParametersDialog(GNEFrameAttributesModuls::ParametersEditor* ParametersEditor) : - FXDialogBox(ParametersEditor->getFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), + FXDialogBox(ParametersEditor->getFrameParent()->getViewNet()->getApp(), "Edit parameters", GUIDesignDialogBoxExplicitStretchable(400, 300)), myParametersEditor(ParametersEditor), myEditedParameters(ParametersEditor->getParametersVectorStr()), myCopyOfParameters(ParametersEditor->getParametersVectorStr()) { // set vehicle icon for this dialog - setIcon(GUIIconSubSys::getIcon(ICON_APP_TABLE)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TABLE)); // create main frame FXVerticalFrame* mainFrame = new FXVerticalFrame(this, GUIDesignAuxiliarFrame); - // create frame for Parameters and options + // create frame for Parameters and options FXHorizontalFrame* horizontalFrameParametersAndOptions = new FXHorizontalFrame(mainFrame, GUIDesignAuxiliarFrame); - // create parameters values + // create parameters values myParametersValues = new ParametersValues(horizontalFrameParametersAndOptions, this); - // create parameters options + // create parameters options myParametersOptions = new ParametersOptions(horizontalFrameParametersAndOptions, this); // add separator new FXHorizontalSeparator(mainFrame, GUIDesignHorizontalSeparator); // create dialog buttons bot centered FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(mainFrame, GUIDesignHorizontalFrame); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); - myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, GUIDesignButtonAccept); - myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, GUIDesignButtonCancel); - myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(ICON_RESET), this, MID_GNE_ADDITIONALDIALOG_BUTTONRESET, GUIDesignButtonReset); + myAcceptButton = new FXButton(buttonsFrame, "accept\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, MID_GNE_BUTTON_ACCEPT, GUIDesignButtonAccept); + myCancelButton = new FXButton(buttonsFrame, "cancel\t\tclose", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, MID_GNE_BUTTON_CANCEL, GUIDesignButtonCancel); + myResetButton = new FXButton(buttonsFrame, "reset\t\tclose", GUIIconSubSys::getIcon(GUIIcon::RESET), this, MID_GNE_BUTTON_RESET, GUIDesignButtonReset); new FXHorizontalFrame(buttonsFrame, GUIDesignAuxiliarHorizontalFrame); } @@ -517,35 +513,43 @@ long GNEParametersDialog::onCmdAccept(FXObject*, FXSelector, void*) { - // check if all edited parameters are valid - for (const auto& i : myEditedParameters) { - if (i.first.empty()) { + // check if all edited parameters are valid + for (const auto& parameter : myEditedParameters) { + if (parameter.first.empty()) { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox of type 'warning'"); + // open warning Box + FXMessageBox::warning(getApp(), MBOX_OK, "Empty Parameter key", "%s", "Parameters with empty keys aren't allowed"); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'"); + return 1; + } else if (!SUMOXMLDefinitions::isValidParameterKey(parameter.first)) { // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox of type 'warning'"); // open warning Box - FXMessageBox::warning(getApp(), MBOX_OK, "Empty Parameter key", "%s", " Parameters with empty keys aren't allowed"); + FXMessageBox::warning(getApp(), MBOX_OK, "Invalid Parameter key", "%s", "There are keys with invalid characters"); // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'"); return 1; - } else if (!SUMOXMLDefinitions::isValidParameterKey(i.first)) { + } else if (!SUMOXMLDefinitions::isValidParameterValue(parameter.second)) { // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox of type 'warning'"); // open warning Box - FXMessageBox::warning(getApp(), MBOX_OK, "Invalid Parameter key", "%s", "There are keys of Parameters with invalid characters"); + FXMessageBox::warning(getApp(), MBOX_OK, "Invalid Parameter value", "%s", "There are values with invalid characters"); // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'"); return 1; - } else if (!SUMOXMLDefinitions::isValidParameterValue(i.second)) { + } else if ((myParametersEditor->getAttrType() == Parameterised::ParameterisedAttrType::DOUBLE) && !GNEAttributeCarrier::canParse(parameter.second)) { // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox of type 'warning'"); // open warning Box - FXMessageBox::warning(getApp(), MBOX_OK, "Invalid Parameter value", "%s", "There are values of Parameters with invalid characters"); + FXMessageBox::warning(getApp(), MBOX_OK, "Invalid double Parameter value", "%s", "There are values that cannot be parsed to floats"); // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'"); return 1; } } - // now check if there is duplicates parameters + // now check if there is duplicates parameters std::vector > sortedParameters = myEditedParameters; std::sort(sortedParameters.begin(), sortedParameters.end()); for (auto i = sortedParameters.begin(); i != sortedParameters.end(); i++) { @@ -553,7 +557,7 @@ // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox of type 'warning'"); // open warning Box - FXMessageBox::warning(getApp(), MBOX_OK, "Duplicated Parameters", "%s", " Parameters with the same Key aren't allowed"); + FXMessageBox::warning(getApp(), MBOX_OK, "Duplicated Parameters", "%s", "Parameters with the same Key aren't allowed"); // write warning if netedit is running in testing mode WRITE_DEBUG("Closed FXMessageBox of type 'warning' with 'OK'"); return 1; @@ -569,7 +573,7 @@ long GNEParametersDialog::onCmdCancel(FXObject*, FXSelector, void*) { - // restore copy of parameters + // restore copy of parameters myParametersValues->setParameters(myCopyOfParameters); // Stop Modal getApp()->stopModal(this, FALSE); @@ -579,9 +583,10 @@ long GNEParametersDialog::onCmdReset(FXObject*, FXSelector, void*) { - // simply restore copy of parameters and continue editing + // simply restore copy of parameters and continue editing myParametersValues->setParameters(myCopyOfParameters); return 1; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEParametersDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit parameters /****************************************************************************/ -#ifndef GNEParametersDialog_h -#define GNEParametersDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -282,4 +276,3 @@ GNEParametersDialog& operator=(const GNEParametersDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,13 @@ /// // Dialog for edit rerouters /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include +#include +#include #include #include @@ -59,10 +56,10 @@ // create Horizontal frame for row elements FXHorizontalFrame* myAddIntervalFrame = new FXHorizontalFrame(myContentFrame, GUIDesignAuxiliarHorizontalFrame); // create Button and Label for adding new Wors - myAddInterval = new FXButton(myAddIntervalFrame, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_INTERVAL, GUIDesignButtonIcon); + myAddInterval = new FXButton(myAddIntervalFrame, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_INTERVAL, GUIDesignButtonIcon); new FXLabel(myAddIntervalFrame, ("Add new " + toString(SUMO_TAG_INTERVAL)).c_str(), nullptr, GUIDesignLabelThick); // create Button and Label for sort intervals - mySortIntervals = new FXButton(myAddIntervalFrame, "", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_GNE_REROUTEDIALOG_SORT_INTERVAL, GUIDesignButtonIcon); + mySortIntervals = new FXButton(myAddIntervalFrame, "", GUIIconSubSys::getIcon(GUIIcon::RELOAD), this, MID_GNE_REROUTEDIALOG_SORT_INTERVAL, GUIDesignButtonIcon); new FXLabel(myAddIntervalFrame, ("Sort " + toString(SUMO_TAG_INTERVAL) + "s").c_str(), nullptr, GUIDesignLabelThick); // Create table @@ -152,7 +149,7 @@ for (int i = 0; i < (int)myEditedAdditional->getChildAdditionals().size(); i++) { if (myIntervalTable->getItem(i, 2)->hasFocus()) { // remove interval - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); // update interval table after removing updateIntervalTable(); return 1; @@ -200,7 +197,7 @@ item = new FXTableItem(i->getAttribute(SUMO_ATTR_END).c_str()); myIntervalTable->setItem(indexRow, 1, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myIntervalTable->setItem(indexRow, 2, item); @@ -209,4 +206,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit rerouters /****************************************************************************/ -#ifndef GNERerouterDialog_h -#define GNERerouterDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include "GNEAdditionalDialog.h" @@ -100,4 +94,3 @@ GNERerouterDialog& operator=(const GNERerouterDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // Dialog for edit rerouter intervals /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -129,7 +125,7 @@ // create horizontal frame for begin and end label FXHorizontalFrame* beginEndElementsLeft = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame); new FXLabel(beginEndElementsLeft, (toString(SUMO_ATTR_BEGIN) + " and " + toString(SUMO_ATTR_END) + " of " + myEditedAdditional->getTagStr()).c_str(), nullptr, GUIDesignLabelLeftThick); - myCheckLabel = new FXLabel(beginEndElementsLeft, "", GUIIconSubSys::getIcon(ICON_CORRECT), GUIDesignLabelIcon32x32Thicked); + myCheckLabel = new FXLabel(beginEndElementsLeft, "", GUIIconSubSys::getIcon(GUIIcon::CORRECT), GUIDesignLabelIcon32x32Thicked); // create horizontal frame for begin and end text fields FXHorizontalFrame* beginEndElementsRight = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame); @@ -140,42 +136,42 @@ // Create labels and tables FXHorizontalFrame* buttonAndLabelClosingLaneReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame); - myAddClosingLaneReroutes = new FXButton(buttonAndLabelClosingLaneReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE, GUIDesignButtonIcon); + myAddClosingLaneReroutes = new FXButton(buttonAndLabelClosingLaneReroute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGLANEREROUTE, GUIDesignButtonIcon); new FXLabel(buttonAndLabelClosingLaneReroute, ("Add new " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); myClosingLaneRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGLANEREROUTE, GUIDesignTableAdditionals); myClosingLaneRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myClosingLaneRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); FXHorizontalFrame* buttonAndLabelClosinReroute = new FXHorizontalFrame(columnLeft, GUIDesignAuxiliarHorizontalFrame); - myAddClosingReroutes = new FXButton(buttonAndLabelClosinReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE, GUIDesignButtonIcon); + myAddClosingReroutes = new FXButton(buttonAndLabelClosinReroute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_CLOSINGREROUTE, GUIDesignButtonIcon); new FXLabel(buttonAndLabelClosinReroute, ("Add new " + toString(SUMO_TAG_CLOSING_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); myClosingRerouteTable = new FXTable(columnLeft, this, MID_GNE_REROUTEDIALOG_TABLE_CLOSINGREROUTE, GUIDesignTableAdditionals); myClosingRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myClosingRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); FXHorizontalFrame* buttonAndLabelDestProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame); - myAddDestProbReroutes = new FXButton(buttonAndLabelDestProbReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE, GUIDesignButtonIcon); + myAddDestProbReroutes = new FXButton(buttonAndLabelDestProbReroute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_DESTPROBREROUTE, GUIDesignButtonIcon); new FXLabel(buttonAndLabelDestProbReroute, ("Add new " + toString(SUMO_TAG_DEST_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); myDestProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_DESTPROBREROUTE, GUIDesignTableAdditionals); myDestProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myDestProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); FXHorizontalFrame* buttonAndLabelRouteProbReroute = new FXHorizontalFrame(columnRight, GUIDesignAuxiliarHorizontalFrame); - myAddRouteProbReroute = new FXButton(buttonAndLabelRouteProbReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE, GUIDesignButtonIcon); + myAddRouteProbReroute = new FXButton(buttonAndLabelRouteProbReroute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_ROUTEPROBREROUTE, GUIDesignButtonIcon); FXLabel* routeProbRerouteLabel = new FXLabel(buttonAndLabelRouteProbReroute, ("Add new " + toString(SUMO_TAG_ROUTE_PROB_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); myRouteProbRerouteTable = new FXTable(columnRight, this, MID_GNE_REROUTEDIALOG_TABLE_ROUTEPROBREROUTE, GUIDesignTableAdditionals); myRouteProbRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myRouteProbRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); FXHorizontalFrame* buttonAndLabelParkingAreaReroute = new FXHorizontalFrame(columnRight2, GUIDesignAuxiliarHorizontalFrame); - FXButton* parkingAreaRerouteButton = myAddParkingAreaReroute = new FXButton(buttonAndLabelParkingAreaReroute, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE, GUIDesignButtonIcon); + FXButton* parkingAreaRerouteButton = myAddParkingAreaReroute = new FXButton(buttonAndLabelParkingAreaReroute, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_REROUTEDIALOG_ADD_PARKINGAREAREROUTE, GUIDesignButtonIcon); FXLabel* parkingAreaRerouteLabel = new FXLabel(buttonAndLabelParkingAreaReroute, ("Add new " + toString(SUMO_TAG_PARKING_ZONE_REROUTE) + "s").c_str(), nullptr, GUIDesignLabelThick); myParkingAreaRerouteTable = new FXTable(columnRight2, this, MID_GNE_REROUTEDIALOG_TABLE_PARKINGAREAREROUTE, GUIDesignTableAdditionals); myParkingAreaRerouteTable->setSelBackColor(FXRGBA(255, 255, 255, 255)); myParkingAreaRerouteTable->setSelTextColor(FXRGBA(0, 0, 0, 255)); // disable add parkingAreaReroute Button and change label if there isn't parkingAreas in net - if (rerouterInterval->getViewNet()->getNet()->getAttributeCarriers().additionals.at(SUMO_TAG_PARKING_AREA).size() == 0) { + if (rerouterInterval->getNet()->getAttributeCarriers()->getAdditionals().at(SUMO_TAG_PARKING_AREA).size() == 0) { parkingAreaRerouteButton->disable(); parkingAreaRerouteLabel->setText(("There isn't " + toString(SUMO_TAG_PARKING_AREA) + "s in net").c_str()); } @@ -198,7 +194,7 @@ // add element if we aren't updating an existent element if (myUpdatingElement == false) { - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional, true), true); } // Open as modal dialog @@ -311,7 +307,7 @@ GNERerouterIntervalDialog::onCmdAddClosingLaneReroute(FXObject*, FXSelector, void*) { // create closing lane reroute GNEClosingLaneReroute* closingLaneReroute = new GNEClosingLaneReroute(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true); myClosingLaneReroutesEdited.push_back(closingLaneReroute); // update closing lane reroutes table updateClosingLaneReroutesTable(); @@ -323,7 +319,7 @@ GNERerouterIntervalDialog::onCmdAddClosingReroute(FXObject*, FXSelector, void*) { // create closing reroute GNEClosingReroute* closingReroute = new GNEClosingReroute(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true); myClosingReroutesEdited.push_back(closingReroute); // update closing reroutes table updateClosingReroutesTable(); @@ -335,7 +331,7 @@ GNERerouterIntervalDialog::onCmdAddDestProbReroute(FXObject*, FXSelector, void*) { // create closing reroute and add it to table GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true); myDestProbReroutesEdited.push_back(destProbReroute); // update dest Prob reroutes table updateDestProbReroutesTable(); @@ -347,7 +343,7 @@ GNERerouterIntervalDialog::onCmdAddRouteProbReroute(FXObject*, FXSelector, void*) { // create route Prob Reroute GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true); myRouteProbReroutesEdited.push_back(routeProbReroute); // update route prob reroutes table updateRouteProbReroutesTable(); @@ -359,7 +355,7 @@ GNERerouterIntervalDialog::onCmdAddParkingAreaReroute(FXObject*, FXSelector, void*) { // create parkingAreaReroute and add it to table GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true); myParkingAreaRerouteEdited.push_back(parkingAreaReroute); // update dest Prob reroutes table updateParkingAreaReroutesTable(); @@ -373,7 +369,7 @@ for (int i = 0; i < (int)myClosingLaneReroutesEdited.size(); i++) { if (myClosingLaneRerouteTable->getItem(i, 4)->hasFocus()) { myClosingLaneRerouteTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myClosingLaneReroutesEdited.at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myClosingLaneReroutesEdited.at(i), false), true); myClosingLaneReroutesEdited.erase(myClosingLaneReroutesEdited.begin() + i); updateClosingLaneReroutesTable(); return 1; @@ -389,7 +385,7 @@ for (int i = 0; i < (int)myClosingReroutesEdited.size(); i++) { if (myClosingRerouteTable->getItem(i, 4)->hasFocus()) { myClosingRerouteTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myClosingReroutesEdited.at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myClosingReroutesEdited.at(i), false), true); myClosingReroutesEdited.erase(myClosingReroutesEdited.begin() + i); updateClosingReroutesTable(); return 1; @@ -405,7 +401,7 @@ for (int i = 0; i < (int)myDestProbReroutesEdited.size(); i++) { if (myDestProbRerouteTable->getItem(i, 3)->hasFocus()) { myDestProbRerouteTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myDestProbReroutesEdited.at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myDestProbReroutesEdited.at(i), false), true); myDestProbReroutesEdited.erase(myDestProbReroutesEdited.begin() + i); updateDestProbReroutesTable(); return 1; @@ -421,7 +417,7 @@ for (int i = 0; i < (int)myRouteProbReroutesEdited.size(); i++) { if (myRouteProbRerouteTable->getItem(i, 3)->hasFocus()) { myRouteProbRerouteTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myRouteProbReroutesEdited.at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myRouteProbReroutesEdited.at(i), false), true); myRouteProbReroutesEdited.erase(myRouteProbReroutesEdited.begin() + i); updateRouteProbReroutesTable(); return 1; @@ -439,7 +435,7 @@ ; } else if (myParkingAreaRerouteTable->getItem(i, 4)->hasFocus()) { myParkingAreaRerouteTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myParkingAreaRerouteEdited.at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myParkingAreaRerouteEdited.at(i), false), true); myParkingAreaRerouteEdited.erase(myParkingAreaRerouteEdited.begin() + i); updateParkingAreaReroutesTable(); return 1; @@ -457,30 +453,30 @@ GNEAdditional* closingLaneReroute = myClosingLaneReroutesEdited.at(i); if (!SUMOXMLDefinitions::isValidNetID(myClosingLaneRerouteTable->getItem(i, 0)->getText().text())) { myClosingLaneReroutesValid = false; - myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (closingLaneReroute->isValid(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text()) == false) { myClosingLaneReroutesValid = false; - myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (closingLaneReroute->isValid(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text()) == false) { myClosingLaneReroutesValid = false; - myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // check if allow/disallow should be changed bool changeAllow = myClosingLaneRerouteTable->getItem(i, 1)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW); bool changeDisallow = myClosingLaneRerouteTable->getItem(i, 2)->getText().text() != closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW); // set new values in Closing reroute - closingLaneReroute->setAttribute(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingLaneReroute->setAttribute(SUMO_ATTR_LANE, myClosingLaneRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); if (changeAllow) { - closingLaneReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingLaneReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingLaneRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); myClosingLaneRerouteTable->getItem(i, 2)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str()); } if (changeDisallow) { - closingLaneReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingLaneReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingLaneRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); myClosingLaneRerouteTable->getItem(i, 1)->setText(closingLaneReroute->getAttribute(SUMO_ATTR_ALLOW).c_str()); } // set Correct label - myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myClosingLaneRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -497,30 +493,30 @@ GNEAdditional* closingReroute = myClosingReroutesEdited.at(i); if (!SUMOXMLDefinitions::isValidNetID(myClosingRerouteTable->getItem(i, 0)->getText().text())) { myClosingReroutesValid = false; - myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (closingReroute->isValid(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text()) == false) { myClosingReroutesValid = false; - myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (closingReroute->isValid(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text()) == false) { myClosingReroutesValid = false; - myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // check if allow/disallow should be changed bool changeAllow = myClosingRerouteTable->getItem(i, 1)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_ALLOW); bool changeDisallow = myClosingRerouteTable->getItem(i, 2)->getText().text() != closingReroute->getAttribute(SUMO_ATTR_DISALLOW); // set new values in Closing reroute - closingReroute->setAttribute(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingReroute->setAttribute(SUMO_ATTR_EDGE, myClosingRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); if (changeAllow) { - closingReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingReroute->setAttribute(SUMO_ATTR_ALLOW, myClosingRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); myClosingRerouteTable->getItem(i, 2)->setText(closingReroute->getAttribute(SUMO_ATTR_DISALLOW).c_str()); } if (changeDisallow) { - closingReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + closingReroute->setAttribute(SUMO_ATTR_DISALLOW, myClosingRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); myClosingRerouteTable->getItem(i, 1)->setText(closingReroute->getAttribute(SUMO_ATTR_ALLOW).c_str()); } // set Correct label - myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myClosingRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -537,16 +533,16 @@ GNEAdditional* destProbReroute = myDestProbReroutesEdited.at(i); if (!SUMOXMLDefinitions::isValidNetID(myDestProbRerouteTable->getItem(i, 0)->getText().text())) { myDestProbReroutesValid = false; - myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (destProbReroute->isValid(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text()) == false) { myDestProbReroutesValid = false; - myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // set new values in Closing reroute - destProbReroute->setAttribute(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); - destProbReroute->setAttribute(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + destProbReroute->setAttribute(SUMO_ATTR_EDGE, myDestProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + destProbReroute->setAttribute(SUMO_ATTR_PROB, myDestProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); // set Correct label - myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myDestProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -563,16 +559,16 @@ GNEAdditional* routeProbReroute = myRouteProbReroutesEdited.at(i); if (!SUMOXMLDefinitions::isValidNetID(myRouteProbRerouteTable->getItem(i, 0)->getText().text())) { myRouteProbReroutesValid = false; - myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (routeProbReroute->isValid(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text()) == false) { myRouteProbReroutesValid = false; - myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // set new values in Closing reroute - routeProbReroute->setAttribute(SUMO_ATTR_ROUTE, myRouteProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); - routeProbReroute->setAttribute(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + routeProbReroute->setAttribute(SUMO_ATTR_ROUTE, myRouteProbRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + routeProbReroute->setAttribute(SUMO_ATTR_PROB, myRouteProbRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); // set Correct label - myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myRouteProbRerouteTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -589,20 +585,20 @@ GNEAdditional* parkingAreaReroute = myParkingAreaRerouteEdited.at(i); if (!SUMOXMLDefinitions::isValidNetID(myParkingAreaRerouteTable->getItem(i, 0)->getText().text())) { myParkingAreaReroutesValid = false; - myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (parkingAreaReroute->isValid(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text()) == false) { myParkingAreaReroutesValid = false; - myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (parkingAreaReroute->isValid(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text()) == false) { myParkingAreaReroutesValid = false; - myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // set new values in Closing reroute - parkingAreaReroute->setAttribute(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); - parkingAreaReroute->setAttribute(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); - parkingAreaReroute->setAttribute(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + parkingAreaReroute->setAttribute(SUMO_ATTR_PARKING, myParkingAreaRerouteTable->getItem(i, 0)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + parkingAreaReroute->setAttribute(SUMO_ATTR_PROB, myParkingAreaRerouteTable->getItem(i, 1)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + parkingAreaReroute->setAttribute(SUMO_ATTR_VISIBLE, myParkingAreaRerouteTable->getItem(i, 2)->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); // set Correct label - myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myParkingAreaRerouteTable->getItem(i, 3)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -616,16 +612,16 @@ if (myEditedAdditional->isValid(SUMO_ATTR_BEGIN, myBeginTextField->getText().text()) && myEditedAdditional->isValid(SUMO_ATTR_END, myEndTextField->getText().text())) { // set new values in rerouter interval - myEditedAdditional->setAttribute(SUMO_ATTR_BEGIN, myBeginTextField->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); - myEditedAdditional->setAttribute(SUMO_ATTR_END, myEndTextField->getText().text(), myEditedAdditional->getViewNet()->getUndoList()); + myEditedAdditional->setAttribute(SUMO_ATTR_BEGIN, myBeginTextField->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + myEditedAdditional->setAttribute(SUMO_ATTR_END, myEndTextField->getText().text(), myEditedAdditional->getNet()->getViewNet()->getUndoList()); // sort intervals of rerouter myEditedAdditional->sortChildAdditionals(); // change icon myBeginEndValid = true; - myCheckLabel->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myCheckLabel->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } else { myBeginEndValid = false; - myCheckLabel->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myCheckLabel->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } return 0; } @@ -665,12 +661,12 @@ myClosingLaneRerouteTable->setItem(i, 2, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myClosingLaneRerouteTable->setItem(i, 3, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myClosingLaneRerouteTable->setItem(i, 4, item); @@ -712,12 +708,12 @@ myClosingRerouteTable->setItem(i, 2, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myClosingRerouteTable->setItem(i, 3, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myClosingRerouteTable->setItem(i, 4, item); @@ -754,12 +750,12 @@ myDestProbRerouteTable->setItem(i, 1, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myDestProbRerouteTable->setItem(i, 2, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myDestProbRerouteTable->setItem(i, 3, item); @@ -796,12 +792,12 @@ myRouteProbRerouteTable->setItem(i, 1, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myRouteProbRerouteTable->setItem(i, 2, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myRouteProbRerouteTable->setItem(i, 3, item); @@ -843,12 +839,12 @@ myParkingAreaRerouteTable->setItem(i, 2, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myParkingAreaRerouteTable->setItem(i, 3, item); // set remove - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myParkingAreaRerouteTable->setItem(i, 4, item); diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERerouterIntervalDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,19 +17,14 @@ /// // Dialog for edit rerouter intervals /****************************************************************************/ -#ifndef GNERerouterIntervalDialog_h -#define GNERerouterIntervalDialog_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "GNEAdditionalDialog.h" @@ -220,4 +215,3 @@ GNERerouterIntervalDialog& operator=(const GNERerouterIntervalDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERouteDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERouteDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERouteDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERouteDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,13 @@ /// // Dialog for edit calibrator routes /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include +#include +#include #include #include @@ -38,7 +35,7 @@ // =========================================================================== FXDEFMAP(GNERouteDialog) GNERouteDialogMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GNERouteDialog::onCmdSetVariable), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNERouteDialog::onCmdSetVariable), }; // Object implementation @@ -62,15 +59,15 @@ // create ID's elements new FXLabel(columnLeft, toString(SUMO_ATTR_ID).c_str(), nullptr, GUIDesignLabelLeftThick); - myTextFieldRouteID = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldRouteID = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // create list of edge's elements new FXLabel(columnLeft, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelLeftThick); - myTextFieldEdges = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldEdges = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // create color's elements new FXLabel(columnLeft, toString(SUMO_ATTR_COLOR).c_str(), nullptr, GUIDesignLabelLeftThick); - myTextFieldColor = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, GUIDesignTextField); + myTextFieldColor = new FXTextField(columnRight, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); // update tables updateCalibratorRouteValues(); @@ -80,7 +77,7 @@ // add element if we aren't updating an existent element if (myUpdatingElement == false) { - myEditedDemandElement->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(myEditedDemandElement, true), true); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(myEditedDemandElement, true), true); // Routes are created without edges myCalibratorRouteValid = false; myInvalidAttr = SUMO_ATTR_EDGES; @@ -147,10 +144,10 @@ // set color of myTextFieldRouteID, depending if current value is valid or not if (myEditedDemandElement->getID() == myTextFieldRouteID->getText().text()) { myTextFieldRouteID->setTextColor(FXRGB(0, 0, 0)); - myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldRouteID->getText().text(), myEditedDemandElement->getViewNet()->getUndoList()); + myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldRouteID->getText().text(), myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else if (myEditedDemandElement->isValid(SUMO_ATTR_ID, myTextFieldRouteID->getText().text())) { myTextFieldRouteID->setTextColor(FXRGB(0, 0, 0)); - myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldRouteID->getText().text(), myEditedDemandElement->getViewNet()->getUndoList()); + myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldRouteID->getText().text(), myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myTextFieldRouteID->setTextColor(FXRGB(255, 0, 0)); myCalibratorRouteValid = false; @@ -159,7 +156,7 @@ // set color of myTextFieldRouteEdges, depending if current value is valEdges or not if (myEditedDemandElement->isValid(SUMO_ATTR_EDGES, myTextFieldEdges->getText().text())) { myTextFieldEdges->setTextColor(FXRGB(0, 0, 0)); - myEditedDemandElement->setAttribute(SUMO_ATTR_EDGES, myTextFieldEdges->getText().text(), myEditedDemandElement->getViewNet()->getUndoList()); + myEditedDemandElement->setAttribute(SUMO_ATTR_EDGES, myTextFieldEdges->getText().text(), myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myTextFieldEdges->setTextColor(FXRGB(255, 0, 0)); myCalibratorRouteValid = false; @@ -168,7 +165,7 @@ // set color of myTextFieldColor, depending if current value is valid or not if (myEditedDemandElement->isValid(SUMO_ATTR_COLOR, myTextFieldColor->getText().text())) { myTextFieldColor->setTextColor(FXRGB(0, 0, 0)); - myEditedDemandElement->setAttribute(SUMO_ATTR_COLOR, myTextFieldColor->getText().text(), myEditedDemandElement->getViewNet()->getUndoList()); + myEditedDemandElement->setAttribute(SUMO_ATTR_COLOR, myTextFieldColor->getText().text(), myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myTextFieldColor->setTextColor(FXRGB(255, 0, 0)); myCalibratorRouteValid = false; @@ -185,4 +182,5 @@ myTextFieldColor->setText(myEditedDemandElement->getAttribute(SUMO_ATTR_COLOR).c_str()); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERouteDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERouteDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNERouteDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNERouteDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit calibrator routes /****************************************************************************/ -#ifndef GNERouteDialog_h -#define GNERouteDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include "GNEDemandElementDialog.h" @@ -98,4 +92,3 @@ GNERouteDialog& operator=(const GNERouteDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,13 @@ /// // A class for edit phases of Variable Speed Signals /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include -#include +#include +#include #include #include @@ -60,10 +57,10 @@ // create Horizontal frame for row elements FXHorizontalFrame* myAddStepFrame = new FXHorizontalFrame(myContentFrame, GUIDesignAuxiliarHorizontalFrame); // create Button and Label for adding new Wors - myAddStepButton = new FXButton(myAddStepFrame, "", GUIIconSubSys::getIcon(ICON_ADD), this, MID_GNE_VARIABLESPEEDSIGN_ADDROW, GUIDesignButtonIcon); + myAddStepButton = new FXButton(myAddStepFrame, "", GUIIconSubSys::getIcon(GUIIcon::ADD), this, MID_GNE_VARIABLESPEEDSIGN_ADDROW, GUIDesignButtonIcon); new FXLabel(myAddStepFrame, ("Add new " + toString(SUMO_TAG_STEP)).c_str(), nullptr, GUIDesignLabelThick); // create Button and Label for sort intervals - mySortStepButton = new FXButton(myAddStepFrame, "", GUIIconSubSys::getIcon(ICON_RELOAD), this, MID_GNE_VARIABLESPEEDSIGN_SORT, GUIDesignButtonIcon); + mySortStepButton = new FXButton(myAddStepFrame, "", GUIIconSubSys::getIcon(GUIIcon::RELOAD), this, MID_GNE_VARIABLESPEEDSIGN_SORT, GUIDesignButtonIcon); new FXLabel(myAddStepFrame, ("Sort " + toString(SUMO_TAG_STEP) + "s").c_str(), nullptr, GUIDesignLabelThick); // create List with the data @@ -89,7 +86,7 @@ GNEVariableSpeedSignDialog::onCmdAddStep(FXObject*, FXSelector, void*) { // Declare variables for time and speed GNEVariableSpeedSignStep* step = new GNEVariableSpeedSignStep(this); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(step, true), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(step, true), true); // Update table updateTableSteps(); return 1; @@ -104,19 +101,19 @@ GNEAdditional* step = myEditedAdditional->getChildAdditionals().at(i); if (step->isValid(SUMO_ATTR_TIME, myStepsTable->getItem(i, 0)->getText().text()) == false) { myStepsValids = false; - myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else if (step->isValid(SUMO_ATTR_SPEED, myStepsTable->getItem(i, 1)->getText().text()) == false) { myStepsValids = false; - myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_ERROR)); + myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::INCORRECT)); } else { // we need filter attribute (to avoid problemes as 1 != 1.00) double time = GNEAttributeCarrier::parse(myStepsTable->getItem(i, 0)->getText().text()); double speed = GNEAttributeCarrier::parse(myStepsTable->getItem(i, 1)->getText().text()); // set new values in Closing reroute - step->setAttribute(SUMO_ATTR_TIME, toString(time), myEditedAdditional->getViewNet()->getUndoList()); - step->setAttribute(SUMO_ATTR_SPEED, toString(speed), myEditedAdditional->getViewNet()->getUndoList()); + step->setAttribute(SUMO_ATTR_TIME, toString(time), myEditedAdditional->getNet()->getViewNet()->getUndoList()); + step->setAttribute(SUMO_ATTR_SPEED, toString(speed), myEditedAdditional->getNet()->getViewNet()->getUndoList()); // set Correct label - myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + myStepsTable->getItem(i, 2)->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); } } // update list @@ -131,7 +128,7 @@ for (int i = 0; i < (int)myEditedAdditional->getChildAdditionals().size(); i++) { if (myStepsTable->getItem(i, 3)->hasFocus()) { myStepsTable->removeRows(i); - myEditedAdditional->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); + myEditedAdditional->getNet()->getViewNet()->getUndoList()->add(new GNEChange_Additional(myEditedAdditional->getChildAdditionals().at(i), false), true); // Update table updateTableSteps(); return 1; @@ -223,16 +220,17 @@ myStepsTable->setItem(i, 1, item); // set valid icon item = new FXTableItem(""); - item->setIcon(GUIIconSubSys::getIcon(ICON_CORRECT)); + item->setIcon(GUIIconSubSys::getIcon(GUIIcon::CORRECT)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myStepsTable->setItem(i, 2, item); // set remove Icon - item = new FXTableItem("", GUIIconSubSys::getIcon(ICON_REMOVE)); + item = new FXTableItem("", GUIIconSubSys::getIcon(GUIIcon::REMOVE)); item->setJustify(FXTableItem::CENTER_X | FXTableItem::CENTER_Y); item->setEnabled(false); myStepsTable->setItem(i, 3, item); } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVariableSpeedSignDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,17 +17,11 @@ /// // A class for edit phases of Variable Speed Signals /****************************************************************************/ -#ifndef GNEVariableSpeedSignDialog_h -#define GNEVariableSpeedSignDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include -#include +#include #include "GNEAdditionalDialog.h" @@ -106,4 +100,3 @@ GNEVariableSpeedSignDialog& operator=(const GNEVariableSpeedSignDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.cpp sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.cpp --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,13 @@ /// // Dialog for edit vehicleTypes /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include +#include #include #include #include -#include +#include #include #include #include @@ -95,7 +92,7 @@ if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_VCLASS) != myComboBoxVClass->getText().text()) { // update VClass in VType myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_VCLASS, myComboBoxVClass->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update label image setVClassLabelImage(); // obtain default vType parameters @@ -162,90 +159,90 @@ GNEVehicleTypeDialog::VTypeAtributes::VClassRow::setVClassLabelImage() { // by default vclass is passenger if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_VCLASS).empty()) { - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_PASSENGER)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PASSENGER)); } else { // set Icon in label depending of current VClass switch (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getVClass()) { case SVC_PRIVATE: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_PRIVATE)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PRIVATE)); break; case SVC_EMERGENCY: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_EMERGENCY)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_EMERGENCY)); break; case SVC_AUTHORITY: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_AUTHORITY)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_AUTHORITY)); break; case SVC_ARMY: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_ARMY)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_ARMY)); break; case SVC_VIP: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_VIP)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_VIP)); break; case SVC_PASSENGER: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_PASSENGER)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PASSENGER)); break; case SVC_HOV: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_HOV)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_HOV)); break; case SVC_TAXI: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_TAXI)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TAXI)); break; case SVC_BUS: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_BUS)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_BUS)); break; case SVC_COACH: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_COACH)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_COACH)); break; case SVC_DELIVERY: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_DELIVERY)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_DELIVERY)); break; case SVC_TRUCK: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_TRUCK)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRUCK)); break; case SVC_TRAILER: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_TRAILER)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRAILER)); break; case SVC_TRAM: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_TRAM)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_TRAM)); break; case SVC_RAIL_URBAN: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_RAIL_URBAN)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_URBAN)); break; case SVC_RAIL: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_RAIL)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL)); break; case SVC_RAIL_ELECTRIC: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_RAIL_ELECTRIC)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_ELECTRIC)); break; case SVC_RAIL_FAST: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_RAIL_ELECTRIC)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_RAIL_ELECTRIC)); break; case SVC_MOTORCYCLE: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_MOTORCYCLE)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_MOTORCYCLE)); break; case SVC_MOPED: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_MOPED)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_MOPED)); break; case SVC_BICYCLE: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_BICYCLE)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_BICYCLE)); break; case SVC_PEDESTRIAN: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_PEDESTRIAN)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_PEDESTRIAN)); break; case SVC_E_VEHICLE: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_EVEHICLE)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_EVEHICLE)); break; case SVC_SHIP: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_SHIP)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_SHIP)); break; case SVC_CUSTOM1: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_CUSTOM1)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM1)); break; case SVC_CUSTOM2: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_CUSTOM2)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_CUSTOM2)); break; default: - myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_IGNORING)); + myComboBoxVClassLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_IGNORING)); break; } } @@ -284,7 +281,7 @@ if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text())) { myComboBoxShape->setTextColor(FXRGB(0, 0, 0)); myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_GUISHAPE, myComboBoxShape->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); setVShapeLabelImage(); } else { myComboBoxShape->setTextColor(FXRGB(255, 0, 0)); @@ -306,89 +303,89 @@ // set Icon in label depending of current VClass switch (getVehicleShapeID(myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_GUISHAPE))) { case SVS_UNKNOWN: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_UNKNOWN)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_UNKNOWN)); break; case SVS_PEDESTRIAN: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PEDESTRIAN)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PEDESTRIAN)); break; case SVS_BICYCLE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_BICYCLE)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BICYCLE)); break; case SVS_MOPED: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_MOPED)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOPED)); break; case SVS_MOTORCYCLE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_MOTORCYCLE)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_MOTORCYCLE)); break; case SVS_PASSENGER: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PASSENGER)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER)); break; case SVS_PASSENGER_SEDAN: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PASSENGER_SEDAN)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_SEDAN)); break; case SVS_PASSENGER_HATCHBACK: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PASSENGER_HATCHBACK)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_HATCHBACK)); break; case SVS_PASSENGER_WAGON: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PASSENGER_WAGON)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_WAGON)); break; case SVS_PASSENGER_VAN: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_PASSENGER_VAN)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_PASSENGER_VAN)); break; case SVS_DELIVERY: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_DELIVERY)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_DELIVERY)); break; case SVS_TRUCK: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_TRUCK)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK)); break; case SVS_TRUCK_SEMITRAILER: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_TRUCK_SEMITRAILER)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_SEMITRAILER)); break; case SVS_TRUCK_1TRAILER: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_TRUCK_1TRAILER)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_TRUCK_1TRAILER)); break; case SVS_BUS: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_BUS)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS)); break; case SVS_BUS_COACH: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_BUS_COACH)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_COACH)); break; case SVS_BUS_FLEXIBLE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_BUS_FLEXIBLE)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_FLEXIBLE)); break; case SVS_BUS_TROLLEY: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_BUS_TROLLEY)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_BUS_TROLLEY)); break; case SVS_RAIL: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_RAIL)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL)); break; case SVS_RAIL_CAR: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_RAIL_CAR)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CAR)); break; case SVS_RAIL_CARGO: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_RAIL_CARGO)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RAIL_CARGO)); break; case SVS_E_VEHICLE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_E_VEHICLE)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_E_VEHICLE)); break; case SVS_ANT: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_ANT)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_ANT)); break; case SVS_SHIP: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_SHIP)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_SHIP)); break; case SVS_EMERGENCY: case SVS_FIREBRIGADE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_EMERGENCY)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_EMERGENCY)); break; case SVS_POLICE: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_POLICE)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_POLICE)); break; case SVS_RICKSHAW: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VSHAPE_RICKSHAW)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VSHAPE_RICKSHAW)); break; default: - myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(ICON_VCLASS_IGNORING)); + myComboBoxShapeLabelImage->setIcon(GUIIconSubSys::getIcon(GUIIcon::VCLASS_IGNORING)); break; } } @@ -440,7 +437,7 @@ // set color of myComboBox, depending if current value is valid or not if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) { myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update value after setting it updateValue(); } else { @@ -458,7 +455,7 @@ } else { myTextField->setTextColor(FXRGB(195, 195, 195)); } - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_COLOR, myTextField->getText().text(), myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myTextField->setTextColor(FXRGB(255, 0, 0)); myVTypeAtributesParent->myVehicleTypeDialog->myVehicleTypeValid = false; @@ -468,7 +465,7 @@ // set color of textField, depending if current value is valid or not if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) { myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update value after setting it updateValue(); } else { @@ -487,7 +484,7 @@ // set color of myComboBox, depending if current value is valid or not if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myComboBox->getText().text())) { myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myComboBox->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update value after setting it updateValue(defaultValue); } else { @@ -500,7 +497,7 @@ // set color of textField, depending if current value is valid or not if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, myTextField->getText().text())) { myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(), - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update value after setting it updateValue(defaultValue); } else { @@ -592,7 +589,7 @@ std::string newValue = toString(MFXUtils::getRGBColor(colordialog.getRGBA())); myTextField->setText(newValue.c_str()); if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, newValue)) { - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, newValue, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, newValue, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // If previously value was incorrect, change font color to black myTextField->setTextColor(FXRGB(0, 0, 0)); myTextField->killFocus(); @@ -605,7 +602,7 @@ GNEVehicleTypeDialog::VTypeAtributes::VTypeAttributeRow::openImageFileDialog() { // get the new image file FXFileDialog opendialog(this, "Open Image"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_VTYPE)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("All files (*)"); if (gCurrentFolder.length() != 0) { @@ -618,7 +615,7 @@ std::string imagePath = opendialog.getFilename().text(); // check if image is valid if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) { - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); myTextField->setText(imagePath.c_str()); // If previously value was incorrect, change font color to black myTextField->setTextColor(FXRGB(0, 0, 0)); @@ -632,7 +629,7 @@ GNEVehicleTypeDialog::VTypeAtributes::VTypeAttributeRow::openOSGFileDialog() { // get the new file name FXFileDialog opendialog(this, "Open OSG File"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_VTYPE)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::VTYPE)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("OSG file (*.obj)"); if (gCurrentFolder.length() != 0) { @@ -645,7 +642,7 @@ std::string imagePath = opendialog.getFilename().text(); // check if image is valid if (myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->isValid(myAttr, imagePath)) { - myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, imagePath, myVTypeAtributesParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); myTextField->setText(imagePath.c_str()); // If previously value was incorrect, change font color to black myTextField->setTextColor(FXRGB(0, 0, 0)); @@ -1019,10 +1016,10 @@ // set color of myTextFieldVehicleTypeID, depending if current value is valid or not if (myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text())) { myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0)); - myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else if (myVehicleTypeDialog->myEditedDemandElement->getAttribute(SUMO_ATTR_ID) == myTextFieldVehicleTypeID->getText().text()) { myTextFieldVehicleTypeID->setTextColor(FXRGB(0, 0, 0)); - myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_ID, myTextFieldVehicleTypeID->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myTextFieldVehicleTypeID->setTextColor(FXRGB(255, 0, 0)); myVehicleTypeDialog->myVehicleTypeValid = false; @@ -1439,7 +1436,7 @@ // set color of myTextFieldCarFollowModel, depending if current value is valid or not if (myVehicleTypeDialog->myEditedDemandElement->isValid(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text())) { myComboBoxCarFollowModel->setTextColor(FXRGB(0, 0, 0)); - myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myVehicleTypeDialog->myEditedDemandElement->setAttribute(SUMO_ATTR_CAR_FOLLOW_MODEL, myComboBoxCarFollowModel->getText().text(), myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); } else { myComboBoxCarFollowModel->setTextColor(FXRGB(255, 0, 0)); myVehicleTypeDialog->myVehicleTypeValid = false; @@ -1480,7 +1477,7 @@ // add element if we aren't updating an existent element if (myUpdatingElement == false) { - myEditedDemandElement->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(myEditedDemandElement, true), true); + myEditedDemandElement->getNet()->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(myEditedDemandElement, true), true); } // update values of Vehicle Type common attributes @@ -1570,7 +1567,7 @@ myTextField->setTextColor(FXRGB(195, 195, 195)); } myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->setAttribute(myAttr, myTextField->getText().text(), - myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getViewNet()->getUndoList()); + myCarFollowingModelParametersParent->myVehicleTypeDialog->myEditedDemandElement->getNet()->getViewNet()->getUndoList()); // update value after setting it updateValue(); } else { @@ -1594,4 +1591,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.h sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.h --- sumo-1.5.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/dialogs/GNEVehicleTypeDialog.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Dialog for edit vehicleTypes /****************************************************************************/ -#ifndef GNEVehicleTypeDialog_h -#define GNEVehicleTypeDialog_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -568,4 +562,3 @@ GNEVehicleTypeDialog& operator=(const GNEVehicleTypeDialog&) = delete; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/elements/additional/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,71 @@ +set(netedit_elements_additional_SRCS + GNEPOI.h + GNEPOI.cpp + GNEPoly.h + GNEPoly.cpp + GNEAdditionalHandler.h + GNEAdditionalHandler.cpp + GNEAdditional.h + GNEAdditional.cpp + GNEShape.h + GNEShape.cpp + GNEChargingStation.h + GNEChargingStation.cpp + GNEStoppingPlace.h + GNEStoppingPlace.cpp + GNEBusStop.h + GNEBusStop.cpp + GNEAccess.h + GNEAccess.cpp + GNEContainerStop.h + GNEContainerStop.cpp + GNEParkingArea.h + GNEParkingArea.cpp + GNEParkingSpace.h + GNEParkingSpace.cpp + GNETAZ.h + GNETAZ.cpp + GNETAZSourceSink.h + GNETAZSourceSink.cpp + GNEDetector.h + GNEDetector.cpp + GNEDetectorE1.h + GNEDetectorE1.cpp + GNEDetectorE1Instant.h + GNEDetectorE1Instant.cpp + GNEDetectorE2.h + GNEDetectorE2.cpp + GNEDetectorE3.h + GNEDetectorE3.cpp + GNEDetectorEntryExit.h + GNEDetectorEntryExit.cpp + GNERerouter.h + GNERerouter.cpp + GNERouteProbe.h + GNERouteProbe.cpp + GNEVaporizer.h + GNEVaporizer.cpp + GNECalibrator.h + GNECalibrator.cpp + GNECalibratorFlow.h + GNECalibratorFlow.cpp + GNEVariableSpeedSign.h + GNEVariableSpeedSign.cpp + GNEVariableSpeedSignStep.h + GNEVariableSpeedSignStep.cpp + GNEClosingLaneReroute.h + GNEClosingLaneReroute.cpp + GNEParkingAreaReroute.h + GNEParkingAreaReroute.cpp + GNEClosingReroute.h + GNEClosingReroute.cpp + GNEDestProbReroute.h + GNEDestProbReroute.cpp + GNERouteProbReroute.h + GNERouteProbReroute.cpp + GNERerouterInterval.h + GNERerouterInterval.cpp + ) + +add_library(netedit_elements_additional STATIC ${netedit_elements_additional_SRCS}) +set_property(TARGET netedit_elements_additional PROPERTY PROJECT_LABEL "z_netedit_elements_additional") diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAccess.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAccess.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAccess.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAccess.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,361 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAccess.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2018 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEAccess.h" +#include "GNEAdditionalHandler.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEAccess::GNEAccess(GNEAdditional* busStop, GNELane* lane, GNENet* net, double pos, const std::string& length, bool friendlyPos, bool blockMovement) : + GNEAdditional(busStop, net, GLO_ACCESS, SUMO_TAG_ACCESS, "", blockMovement, +{}, {}, {lane}, {}, {busStop}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPositionOverLane(pos), +myLength(length), +myFriendlyPosition(friendlyPos) { +} + + +GNEAccess::~GNEAccess() { +} + + +void +GNEAccess::moveGeometry(const Position& offset) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); + // Update geometry + updateGeometry(); +} + + +void +GNEAccess::commitGeometryMoving(GNEUndoList* undoList) { + if (!myBlockMovement) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_end(); + } +} + + +void +GNEAccess::updateGeometry() { + // set start position + double fixedPositionOverLane; + if (myPositionOverLane == -1) { + fixedPositionOverLane = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } else if (myPositionOverLane < 0) { + fixedPositionOverLane = 0; + } else if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + fixedPositionOverLane = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } else { + fixedPositionOverLane = myPositionOverLane; + } + // update geometry + myAdditionalGeometry.updateGeometry(getParentLanes().front(), fixedPositionOverLane * getParentLanes().front()->getLengthGeometryFactor()); + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + // Set offset of the block icon + myBlockIcon.offset = Position(-1, 0); + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(getParentLanes().front()); + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEAccess::updateDottedContour() { + // +} + + +Position +GNEAccess::getPositionInView() const { + if (myPositionOverLane == -1) { + return getParentLanes().front()->getLaneShape().front(); + } else { + if (myPositionOverLane < 0) { + return getParentLanes().front()->getLaneShape().front(); + } else if (myPositionOverLane > getParentLanes().front()->getLaneShape().length()) { + return getParentLanes().front()->getLaneShape().back(); + } else { + return getParentLanes().front()->getLaneShape().positionAtOffset(myPositionOverLane); + } + } +} + + +Boundary +GNEAccess::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNEAccess::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) { + if (splitPosition < myPositionOverLane) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust start position + setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); + } +} + + +bool +GNEAccess::isAccessPositionFixed() const { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + if (myPositionOverLane != -1) { + return (myPositionOverLane >= 0) && (myPositionOverLane <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + } else { + return false; + } + } +} + + +GNEEdge* +GNEAccess::getEdge() const { + return getParentLanes().front()->getParentEdge(); +} + + +std::string +GNEAccess::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEAccess::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding an gl identificator + glPushName(getGlID()); + // push matrix + glPushMatrix(); + // set color depending of selection + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); + } + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), GLO_ACCESS); + // draw circle + if (s.drawForRectangleSelection) { + GLHelper::drawFilledCircle((double) 0.5 * exaggeration, 8); + } else { + GLHelper::drawFilledCircle((double) 0.5 * exaggeration, 16); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + /* + GLHelper::drawShapeDottedContourAroundClosedShape(s, getType(), vertices); + */ + } + } + // pop matrix + glPopMatrix(); + // pop gl identficador + glPopName(); + } +} + + +std::string +GNEAccess::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_LENGTH: + return toString(myLength); + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEAccess::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEAccess::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_FRIENDLY_POS: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEAccess::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: { + GNELane* lane = myNet->retrieveLane(value, false); + if (lane != nullptr) { + if (getParentLanes().front()->getParentEdge()->getID() != lane->getParentEdge()->getID()) { + return GNEAdditionalHandler::accessCanBeCreated(getParentAdditionals().at(0), lane->getParentEdge()); + } else { + return true; + } + } else { + return false; + } + } + case SUMO_ATTR_POSITION: + if (value.empty()) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_LENGTH: + if (value.empty()) { + return true; + } else { + return (canParse(value) && (parse(value) >= 0)); + } + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEAccess::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEAccess::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEAccess::getHierarchyName() const { + return getTagStr() + ": " + getParentLanes().front()->getParentEdge()->getID(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEAccess::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_LENGTH: + myLength = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAccess.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAccess.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAccess.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAccess.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,159 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAccess.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2018 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEBusStop; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEAccess + * class for busStop acces + */ +class GNEAccess : public GNEAdditional { + +public: + /**@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 + * @param[in] lane GNELane of this Access belongs + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] pos position of the Access on the lane + * @param[in] length The length of the Access in meters. + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEAccess(GNEAdditional* busStop, GNELane* lane, GNENet* net, double pos, const std::string& length, bool friendlyPos, bool blockMovement); + + /// @brief Destructor + ~GNEAccess(); + + /// @brief check if Position of Access is fixed + bool isAccessPositionFixed() const; + + /// @brief get edge in which this Access is placed + GNEEdge* getEdge() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const ; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name (ID) of the parent object + std::string getParentName() const; + + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief position over lane + double myPositionOverLane; + + /// @brief Acces length + std::string myLength; + + /// @brief flag to check if friendly position is enabled + bool myFriendlyPosition; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEAccess(const GNEAccess&) = delete; + + /// @brief Invalidated assignment operator. + GNEAccess& operator=(const GNEAccess&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditional.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditional.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditional.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditional.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,536 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditional.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// A abstract class for representation of additional elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEAdditional.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEAdditional::GNEAdditional(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, id), + GNEAttributeCarrier(tag, net), + Parameterised(), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myAdditionalName(additionalName), + myBlockMovement(blockMovement), + myBlockIcon(this), + mySpecialColor(nullptr) { +} + + +GNEAdditional::GNEAdditional(GNEAdditional* additionalParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, additionalParent->generateChildID(tag)), + GNEAttributeCarrier(tag, net), + Parameterised(), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myAdditionalName(additionalName), + myBlockMovement(blockMovement), + myBlockIcon(this), + mySpecialColor(nullptr) { +} + + +GNEAdditional::~GNEAdditional() {} + + +const std::string& +GNEAdditional::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNEAdditional::getGUIGlObject() { + return this; +} + + +std::string +GNEAdditional::generateChildID(SumoXMLTag childTag) { + int counter = (int)getChildAdditionals().size(); + while (myNet->retrieveAdditional(childTag, getID() + toString(childTag) + toString(counter), false) != nullptr) { + counter++; + } + return (getID() + toString(childTag) + toString(counter)); +} + + +const GNEGeometry::Geometry& +GNEAdditional::getAdditionalGeometry() const { + return myAdditionalGeometry; +} + + +const GNEGeometry::SegmentGeometry& +GNEAdditional::getAdditionalSegmentGeometry() const { + return mySegmentGeometry; +} + + +void +GNEAdditional::setSpecialColor(const RGBColor* color) { + mySpecialColor = color; +} + + +void +GNEAdditional::writeAdditional(OutputDevice& device) const { + // first check if minimum number of children is correct + if ((myTagProperty.hasMinimumNumberOfChildren() || myTagProperty.hasMinimumNumberOfChildren()) && !checkChildAdditionalRestriction()) { + WRITE_WARNING(getTagStr() + " with ID='" + getID() + "' cannot be written"); + } else { + // Open Tag or synonym Tag + if (myTagProperty.hasTagSynonym()) { + device.openTag(myTagProperty.getTagSynonym()); + } else { + device.openTag(myTagProperty.getTag()); + } + // iterate over attributes and write it + for (const auto& tagProperty : myTagProperty) { + // first check that attribute isn't ignored + if (!tagProperty.isIgnored()) { + // obtain attribute + const std::string attributeValue = getAttribute(tagProperty.getAttr()); + // first check if attribute is optional but not vehicle classes + if (tagProperty.isOptional() && !tagProperty.isVClasses()) { + // Only write attributes with default value if is different from original + if (tagProperty.getDefaultValue() != attributeValue) { + // check if attribute must be written using a synonim + if (tagProperty.hasAttrSynonym()) { + device.writeAttr(tagProperty.getAttrSynonym(), attributeValue); + } else { + // SVC permissions uses their own writting function + if (tagProperty.isSVCPermission()) { + // disallow attribute musn't be written + if (tagProperty.getAttr() != SUMO_ATTR_DISALLOW) { + writePermissions(device, parseVehicleClasses(attributeValue)); + } + } else if (myTagProperty.canMaskXYZPositions() && (tagProperty.getAttr() == SUMO_ATTR_POSITION)) { + // get position attribute and write it separate + Position pos = parse(getAttribute(SUMO_ATTR_POSITION)); + device.writeAttr(SUMO_ATTR_X, toString(pos.x())); + device.writeAttr(SUMO_ATTR_Y, toString(pos.y())); + // write 0 only if is different from 0 (the default value) + if (pos.z() != 0) { + device.writeAttr(SUMO_ATTR_Z, toString(pos.z())); + } + } else { + device.writeAttr(tagProperty.getAttr(), attributeValue); + } + } + } + } else { + // Attributes without default values are always writted + if (tagProperty.hasAttrSynonym()) { + device.writeAttr(tagProperty.getAttrSynonym(), attributeValue); + } else { + // SVC permissions uses their own writting function + if (tagProperty.isSVCPermission()) { + // disallow attribute musn't be written + if (tagProperty.getAttr() != SUMO_ATTR_DISALLOW) { + writePermissions(device, parseVehicleClasses(attributeValue)); + } + } else if (myTagProperty.canMaskXYZPositions() && (tagProperty.getAttr() == SUMO_ATTR_POSITION)) { + // get position attribute and write it separate + Position pos = parse(getAttribute(SUMO_ATTR_POSITION)); + device.writeAttr(SUMO_ATTR_X, toString(pos.x())); + device.writeAttr(SUMO_ATTR_Y, toString(pos.y())); + // write 0 only if is different from 0 (the default value) + if (pos.z() != 0) { + device.writeAttr(SUMO_ATTR_Z, toString(pos.z())); + } + } else { + device.writeAttr(tagProperty.getAttr(), attributeValue); + } + } + } + } + } + // iterate over children and write it in XML (or in a different file) + if (myTagProperty.canWriteChildrenSeparate() && myTagProperty.hasAttribute(SUMO_ATTR_FILE) && !getAttribute(SUMO_ATTR_FILE).empty()) { + // we assume that rerouter values files is placed in the same folder as the additional file + OutputDevice& deviceChildren = OutputDevice::getDevice(FileHelpers::getFilePath(OptionsCont::getOptions().getString("additional-files")) + getAttribute(SUMO_ATTR_FILE)); + deviceChildren.writeXMLHeader("rerouterValue", "additional_file.xsd"); + // save children in a different filename + for (const auto& additionalChild : getChildAdditionals()) { + // avoid to write two times additionals that haben two parents (Only write as child of first parent) + if (additionalChild->getParentAdditionals().size() < 1) { + additionalChild->writeAdditional(deviceChildren); + } else if (myTagProperty.getTag() == additionalChild->getTagProperty().getParentTag()) { + additionalChild->writeAdditional(deviceChildren); + } + } + deviceChildren.close(); + } else { + for (const auto& additionalChild : getChildAdditionals()) { + // avoid to write two times additionals that haben two parents (Only write as child of first parent) + if (additionalChild->getParentAdditionals().size() < 2) { + additionalChild->writeAdditional(device); + } else if (myTagProperty.getTag() == additionalChild->getTagProperty().getParentTag()) { + additionalChild->writeAdditional(device); + } + } + } + // write parameters (Always after children to avoid problems with additionals.xsd) + writeParams(device); + // Close tag + device.closeTag(); + } +} + + +bool +GNEAdditional::isAdditionalValid() const { + return true; +} + + +std::string +GNEAdditional::getAdditionalProblem() const { + return ""; +} + + +void +GNEAdditional::fixAdditionalProblem() { + throw InvalidArgument(getTagStr() + " cannot fix any problem"); +} + + +void +GNEAdditional::openAdditionalDialog() { + throw InvalidArgument(getTagStr() + " doesn't have an additional dialog"); +} + + +void +GNEAdditional::startGeometryMoving() { + // only move if additional is drawable + if (myTagProperty.isDrawable()) { + // always save original position over view + myMove.originalViewPosition = getPositionInView(); + // check if position over lane or lanes has to be saved + if (myTagProperty.hasAttribute(SUMO_ATTR_LANE)) { + if (myTagProperty.canMaskStartEndPos()) { + // obtain start and end position + myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_STARTPOS); + myMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); + } else { + // obtain position attribute + myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_POSITION); + } + } else if (myTagProperty.hasAttribute(SUMO_ATTR_LANES) && + myTagProperty.hasAttribute(SUMO_ATTR_POSITION) && + myTagProperty.hasAttribute(SUMO_ATTR_ENDPOS)) { + // obtain start and end position + myMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_POSITION); + myMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); + } + // save current centering boundary if element is placed in RTree + if (myTagProperty.isPlacedInRTree()) { + myMove.movingGeometryBoundary = getCenteringBoundary(); + } + // start geometry in all children + for (const auto& i : getChildDemandElements()) { + i->startGeometryMoving(); + } + } +} + + +void +GNEAdditional::endGeometryMoving() { + // check that endGeometryMoving was called only once + if (myTagProperty.isDrawable()) { + // check if object must be placed in RTREE + if (myTagProperty.isPlacedInRTree()) { + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // reset myMovingGeometryBoundary + myMove.movingGeometryBoundary.reset(); + // add object into grid again (using the new centering boundary) + myNet->addGLObjectIntoGrid(this); + } + // end geometry in all children + for (const auto& i : getChildDemandElements()) { + i->endGeometryMoving(); + } + } +} + + +void +GNEAdditional::updateDottedContour() { + // +} + + +bool +GNEAdditional::isAdditionalBlocked() const { + return myBlockMovement; +} + + +GUIGLObjectPopupMenu* +GNEAdditional::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open additional dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + // Show position parameters + if (myTagProperty.hasAttribute(SUMO_ATTR_LANE)) { + GNELane* lane = myNet->retrieveLane(getAttribute(SUMO_ATTR_LANE)); + // Show menu command inner position + const double innerPos = myAdditionalGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); + new FXMenuCommand(ret, ("Cursor position over additional shape: " + toString(innerPos)).c_str(), nullptr, nullptr, 0); + // If shape isn't empty, show menu command lane position + if (myAdditionalGeometry.getShape().size() > 0) { + const double lanePos = lane->getLaneShape().nearest_offset_to_point2D(myAdditionalGeometry.getShape().front()); + new FXMenuCommand(ret, ("Cursor position over " + toString(SUMO_TAG_LANE) + ": " + toString(innerPos + lanePos)).c_str(), nullptr, nullptr, 0); + } + } else if (myTagProperty.hasAttribute(SUMO_ATTR_EDGE)) { + GNEEdge* edge = myNet->retrieveEdge(getAttribute(SUMO_ATTR_EDGE)); + // Show menu command inner position + const double innerPos = myAdditionalGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); + new FXMenuCommand(ret, ("Cursor position over additional shape: " + toString(innerPos)).c_str(), nullptr, nullptr, 0); + // If shape isn't empty, show menu command edge position + if (myAdditionalGeometry.getShape().size() > 0) { + const double edgePos = edge->getLanes().at(0)->getLaneShape().nearest_offset_to_point2D(myAdditionalGeometry.getShape().front()); + new FXMenuCommand(ret, ("Mouse position over " + toString(SUMO_TAG_EDGE) + ": " + toString(innerPos + edgePos)).c_str(), nullptr, nullptr, 0); + } + } else { + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + } + return ret; +} + + +GUIParameterTableWindow* +GNEAdditional::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { + // Create table + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); + // Iterate over attributes + for (const auto& i : myTagProperty) { + // Add attribute and set it dynamic if aren't unique + if (i.isUnique()) { + ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); + } else { + ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); + } + } + // close building + ret->closeBuilding(); + return ret; +} + + +const std::string& +GNEAdditional::getOptionalAdditionalName() const { + return myAdditionalName; +} + +// --------------------------------------------------------------------------- +// GNEAdditional::BlockIcon - methods +// --------------------------------------------------------------------------- + +GNEAdditional::BlockIcon::BlockIcon(GNEAdditional* additional) : + rotation(0.), + myAdditional(additional) {} + + +void +GNEAdditional::BlockIcon::setRotation(GNELane* additionalLane) { + if (myAdditional->myAdditionalGeometry.getShape().size() > 0 && myAdditional->myAdditionalGeometry.getShape().length() != 0) { + // If length of the shape is distint to 0, Obtain rotation of center of shape + rotation = myAdditional->myAdditionalGeometry.getShape().rotationDegreeAtOffset((myAdditional->myAdditionalGeometry.getShape().length() / 2.)) - 90; + } else if (additionalLane) { + // If additional is over a lane, set rotation in the position over lane + double posOverLane = additionalLane->getLaneShape().nearest_offset_to_point2D(myAdditional->getPositionInView()); + rotation = additionalLane->getLaneShape().rotationDegreeAtOffset(posOverLane) - 90; + } else { + // In other case, rotation is 0 + rotation = 0; + } +} + + +void +GNEAdditional::BlockIcon::drawIcon(const GUIVisualizationSettings& s, const double exaggeration, const double size) const { + // check if block icon can be draw + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.lockIcon, exaggeration) && myAdditional->myNet->getViewNet()->showLockIcon()) { + // Start pushing matrix + glPushMatrix(); + // Traslate to middle of shape + glTranslated(position.x(), position.y(), myAdditional->getType() + 0.1); + // Set draw color + glColor3d(1, 1, 1); + // Rotate depending of rotation + glRotated(rotation, 0, 0, -1); + // Rotate 180 degrees + glRotated(180, 0, 0, 1); + // Traslate depending of the offset + glTranslated(offset.x(), offset.y(), 0); + // Draw icon depending of the state of additional + if (myAdditional->drawUsingSelectColor()) { + if (!myAdditional->getTagProperty().canBlockMovement()) { + // Draw not movable texture if additional isn't movable and is selected + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_NOTMOVINGSELECTED), size); + } else if (myAdditional->myBlockMovement) { + // Draw lock texture if additional is movable, is blocked and is selected + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCKSELECTED), size); + } else { + // Draw empty texture if additional is movable, isn't blocked and is selected + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTYSELECTED), size); + } + } else { + if (!myAdditional->getTagProperty().canBlockMovement()) { + // Draw not movable texture if additional isn't movable + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_NOTMOVING), size); + } else if (myAdditional->myBlockMovement) { + // Draw lock texture if additional is movable and is blocked + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCK), size); + } else { + // Draw empty texture if additional is movable and isn't blocked + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTY), size); + } + } + // Pop matrix + glPopMatrix(); + } +} + +// --------------------------------------------------------------------------- +// GNEAdditional - protected methods +// --------------------------------------------------------------------------- + +void +GNEAdditional::setDefaultValues() { + // iterate over attributes and set default value + for (const auto& i : myTagProperty) { + if (i.hasStaticDefaultValue()) { + setAttribute(i.getAttr(), i.getDefaultValue()); + } + } +} + + +bool +GNEAdditional::isValidAdditionalID(const std::string& newID) const { + if (SUMOXMLDefinitions::isValidAdditionalID(newID) && (myNet->retrieveAdditional(myTagProperty.getTag(), newID, false) == nullptr)) { + return true; + } else { + return false; + } +} + + +bool +GNEAdditional::isValidDetectorID(const std::string& newID) const { + if (SUMOXMLDefinitions::isValidDetectorID(newID) && (myNet->retrieveAdditional(myTagProperty.getTag(), newID, false) == nullptr)) { + return true; + } else { + return false; + } +} + + +void +GNEAdditional::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNEAdditional::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +bool +GNEAdditional::checkChildAdditionalRestriction() const { + // throw exception because this function mus be implemented in child (see GNEE3Detector) + throw ProcessError("Calling non-implemented function checkChildAdditionalRestriction during saving of " + getTagStr() + ". It muss be reimplemented in child class"); +} + + +void +GNEAdditional::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditional.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditional.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditional.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditional.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,395 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditional.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2016 +/// +// A abstract class for representation of additional elements +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEViewNet; +class GNENetworkElement; +class GUIGLObjectPopupMenu; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEAdditional + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEAdditional : public GUIGlObject, public GNEAttributeCarrier, public Parameterised, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { + +public: + /**@brief Constructor + * @param[in] id Gl-id of the additional element (Must be unique) + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] type GUIGlObjectType of additional + * @param[in] tag Type of xml tag that define the additional element (SUMO_TAG_BUS_STOP, SUMO_TAG_REROUTER, etc...) + * @param[in] name Additional name + * @param[in] block movement enable or disable additional movement + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEAdditional(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /**@brief Constructor used by Additionals that have two additionals as parent + * @param[in] additionalParent pointer to parent additional pointer (used to generate an ID) + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] type GUIGlObjectType of additional + * @param[in] tag Type of xml tag that define the additional element (SUMO_TAG_BUS_STOP, SUMO_TAG_REROUTER, etc...) + * @param[in] name Additional name + * @param[in] block movement enable or disable additional movement + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEAdditional(GNEAdditional* additionalParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, std::string additionalName, bool blockMovement, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /// @brief Destructor + virtual ~GNEAdditional(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @brief obtain additional geometry + const GNEGeometry::Geometry& getAdditionalGeometry() const; + + /// @brief obtain additional segment geometry + const GNEGeometry::SegmentGeometry& getAdditionalSegmentGeometry() const; + + /// @brief set special color + void setSpecialColor(const RGBColor* color); + + /// @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 (by default true, can be reimplemented in children) + virtual bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem (by default empty, can be reimplemented in children) + virtual std::string getAdditionalProblem() const; + + /// @brief fix additional problem (by default throw an exception, has to be reimplemented in children) + virtual void fixAdditionalProblem(); + /// @} + + /**@brief open Additional Dialog + * @note: if additional needs an additional dialog, this function has to be implemented in childrens (see GNERerouter and GNEVariableSpeedSign) + * @throw invalid argument if additional doesn't have an additional Dialog + */ + virtual void openAdditionalDialog(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief begin movement (used when user click over additional to start a movement, to avoid problems with problems with GL Tree) + void startGeometryMoving(); + + /// @brief begin movement (used when user click over additional to start a movement, to avoid problems with problems with GL Tree) + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + virtual void moveGeometry(const Position& offset) = 0; + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief Returns position of additional in view + virtual Position getPositionInView() const = 0; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + virtual Boundary getCenteringBoundary() const = 0; + + /// @brief split geometry + virtual void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) = 0; + /// @} + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Check if additional item is currently blocked (i.e. cannot be moved with mouse) + bool isAdditionalBlocked() const; + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief Returns the additional name + const std::string& getOptionalAdditionalName() const; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual double getAttributeDouble(SumoXMLAttr key) const = 0; + + /**@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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /**@brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + virtual std::string getPopUpID() const = 0; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + virtual std::string getHierarchyName() const = 0; + /// @} + +protected: + + /// @brief struct for pack all variables related with additional move + struct AdditionalMove { + /// @brief boundary used during moving of elements (to avoid insertion in RTREE + Boundary movingGeometryBoundary; + + /// @brief value for saving first original position over lane before moving + Position originalViewPosition; + + /// @brief value for saving first original position over lane before moving + std::string firstOriginalLanePosition; + + /// @brief value for saving second original position over lane before moving + std::string secondOriginalPosition; + + private: + /// @brief Invalidated assignment operator + AdditionalMove& operator=(const AdditionalMove& other) = delete; + + }; + + /// @brief struct for pack all variables and functions related with Block Icon + struct BlockIcon { + /// @brief constructor + BlockIcon(GNEAdditional* additional); + + /// @brief set Rotation of block Icon (must be called in updateGeometry() function) + void setRotation(GNELane* additionalLane = nullptr); + + /// @brief draw lock icon + void drawIcon(const GUIVisualizationSettings& s, const double exaggeration, const double size = 0.5) const; + + public: + /// @brief position of the block icon + Position position; + + /// @brief The offSet of the block icon + Position offset; + + /// @brief The rotation of the block icon + double rotation; + + private: + /// @brief pointer to parent additional + GNEAdditional* myAdditional; + + /// @brief Invalidated assignment operator + BlockIcon& operator=(const BlockIcon& other) = delete; + }; + + /// @brief geometry to be precomputed in updateGeometry(...) + GNEGeometry::Geometry myAdditionalGeometry; + + /// @brief segment geometry to be precomputed in updateGeometry(...) (used by E2Multilane) + GNEGeometry::SegmentGeometry mySegmentGeometry; + + /// @brief variable AdditionalMove + AdditionalMove myMove; + + /// @brief name of additional + std::string myAdditionalName; + + /// @brief boolean to check if additional element is blocked (i.e. cannot be moved with mouse) + bool myBlockMovement; + + /// @brief variable BlockIcon + BlockIcon myBlockIcon; + + /// @brief pointer to special color (used for drawing Additional with a certain color, mainly used for selections) + const RGBColor* mySpecialColor; + + /// @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(...) + /// @{ + + /// @brief check if a new additional ID is valid + bool isValidAdditionalID(const std::string& newID) const; + + /// @brief check if a new detector ID is valid + bool isValidDetectorID(const std::string& newID) const; + + /// @} + +private: + /**@brief check restriction with the number of children + * @throw ProcessError if itis called without be reimplemented in child class + */ + virtual bool checkChildAdditionalRestriction() const; + + /// @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 Invalidated copy constructor. + GNEAdditional(const GNEAdditional&) = delete; + + /// @brief Invalidated assignment operator. + GNEAdditional& operator=(const GNEAdditional&) = delete; +}; + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,2787 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditionalHandler.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// Builds trigger objects for netedit +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEAdditionalHandler.h" +#include "GNEShape.h" +#include "GNEBusStop.h" +#include "GNEAccess.h" +#include "GNECalibrator.h" +#include "GNECalibratorFlow.h" +#include "GNEChargingStation.h" +#include "GNEClosingLaneReroute.h" +#include "GNEClosingReroute.h" +#include "GNEContainerStop.h" +#include "GNEDestProbReroute.h" +#include "GNEDetectorE1.h" +#include "GNEDetectorE2.h" +#include "GNEDetectorE3.h" +#include "GNEDetectorEntryExit.h" +#include "GNEDetectorE1Instant.h" +#include "GNEParkingArea.h" +#include "GNEParkingSpace.h" +#include "GNERerouter.h" +#include "GNERerouterInterval.h" +#include "GNERouteProbReroute.h" +#include "GNEParkingAreaReroute.h" +#include "GNERouteProbe.h" +#include "GNEVaporizer.h" +#include "GNEVariableSpeedSign.h" +#include "GNEVariableSpeedSignStep.h" +#include "GNETAZ.h" +#include "GNETAZSourceSink.h" + + +// =========================================================================== +// GNEAdditionalHandler method definitions +// =========================================================================== + +GNEAdditionalHandler::GNEAdditionalHandler(const std::string& file, GNENet* net, GNEAdditional* additionalParent) : + ShapeHandler(file, *net->getAttributeCarriers()), + myNet(net) { + myLastInsertedElement = new LastInsertedElement(); + // check if we're loading values of another additionals (example: Rerouter values) + if (additionalParent) { + myLastInsertedElement->insertElement(additionalParent->getTagProperty().getTag()); + myLastInsertedElement->commitAdditionalInsertion(additionalParent); + } + // define default values for shapes + setDefaults("", RGBColor::RED, Shape::DEFAULT_LAYER_POI, true); +} + + +GNEAdditionalHandler::~GNEAdditionalHandler() { + delete myLastInsertedElement; +} + + +void +GNEAdditionalHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { + // Obtain tag of element + SumoXMLTag tag = static_cast(element); + // check if we're parsing a parameter + if (tag == SUMO_TAG_PARAM) { + // push element int stack + myLastInsertedElement->insertElement(tag); + // parse parameter + parseParameter(attrs); + } else if (tag != SUMO_TAG_NOTHING) { + // push element int stack + if (tag == SUMO_TAG_TRAIN_STOP) { + // ensure that access elements can find their parent in myLastInsertedElement + tag = SUMO_TAG_BUS_STOP; + } + myLastInsertedElement->insertElement(tag); + // Call parse and build depending of tag + switch (tag) { + case SUMO_TAG_POLY: + return parseAndBuildPoly(attrs); + case SUMO_TAG_POI: + return parseAndBuildPOI(attrs); + default: + // build additional + buildAdditional(myNet, true, tag, attrs, myLastInsertedElement); + } + } +} + + +void +GNEAdditionalHandler::myEndElement(int element) { + // Obtain tag of element + SumoXMLTag tag = static_cast(element); + switch (tag) { + case SUMO_TAG_TAZ: { + GNETAZ* TAZ = dynamic_cast(myLastInsertedElement->getLastInsertedAdditional()); + if (TAZ != nullptr) { + if (TAZ->getTAZShape().size() == 0) { + Boundary b; + if (TAZ->getChildAdditionals().size() > 0) { + for (const auto& i : TAZ->getChildAdditionals()) { + b.add(i->getCenteringBoundary()); + } + PositionVector boundaryShape; + boundaryShape.push_back(Position(b.xmin(), b.ymin())); + boundaryShape.push_back(Position(b.xmax(), b.ymin())); + boundaryShape.push_back(Position(b.xmax(), b.ymax())); + boundaryShape.push_back(Position(b.xmin(), b.ymax())); + boundaryShape.push_back(Position(b.xmin(), b.ymin())); + TAZ->setAttribute(SUMO_ATTR_SHAPE, toString(boundaryShape), myNet->getViewNet()->getUndoList()); + } + } + } + break; + } + default: + break; + } + // pop last inserted element + myLastInsertedElement->popElement(); + // execute myEndElement of ShapeHandler (needed to update myLastParameterised) + ShapeHandler::myEndElement(element); +} + + +Position +GNEAdditionalHandler::getLanePos(const std::string& poiID, const std::string& laneID, double lanePos, double lanePosLat) { + std::string edgeID; + int laneIndex; + NBHelpers::interpretLaneID(laneID, edgeID, laneIndex); + NBEdge* edge = myNet->retrieveEdge(edgeID)->getNBEdge(); + if (edge == nullptr || laneIndex < 0 || edge->getNumLanes() <= laneIndex) { + WRITE_ERROR("Lane '" + laneID + "' to place poi '" + poiID + "' on is not known."); + return Position::INVALID; + } + if (lanePos < 0) { + lanePos = edge->getLength() + lanePos; + } + if (lanePos < 0 || lanePos > edge->getLength()) { + WRITE_WARNING("lane position " + toString(lanePos) + " for poi '" + poiID + "' is not valid."); + } + return edge->getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat); +} + + +bool +GNEAdditionalHandler::buildAdditional(GNENet* net, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + // Call parse and build depending of tag + switch (tag) { + case SUMO_TAG_BUS_STOP: + case SUMO_TAG_TRAIN_STOP: + return parseAndBuildBusStop(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_ACCESS: + return parseAndBuildAccess(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_CONTAINER_STOP: + return parseAndBuildContainerStop(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_CHARGING_STATION: + return parseAndBuildChargingStation(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_E1DETECTOR: + case SUMO_TAG_INDUCTION_LOOP: + return parseAndBuildDetectorE1(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_E2DETECTOR: + case SUMO_TAG_E2DETECTOR_MULTILANE: + case SUMO_TAG_LANE_AREA_DETECTOR: + return parseAndBuildDetectorE2(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_E3DETECTOR: + case SUMO_TAG_ENTRY_EXIT_DETECTOR: + return parseAndBuildDetectorE3(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_DET_ENTRY: + return parseAndBuildDetectorEntry(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_DET_EXIT: + return parseAndBuildDetectorExit(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_INSTANT_INDUCTION_LOOP: + return parseAndBuildDetectorE1Instant(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_ROUTEPROBE: + return parseAndBuildRouteProbe(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_VAPORIZER: + return parseAndBuildVaporizer(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_TAZ: + return parseAndBuildTAZ(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_TAZSOURCE: + return parseAndBuildTAZSource(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_TAZSINK: + return parseAndBuildTAZSink(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_VSS: + return parseAndBuildVariableSpeedSign(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_STEP: + return parseAndBuildVariableSpeedSignStep(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_CALIBRATOR: + case SUMO_TAG_LANECALIBRATOR: + return parseAndBuildCalibrator(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_PARKING_AREA: + return parseAndBuildParkingArea(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_PARKING_SPACE: + return parseAndBuildParkingSpace(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_FLOW_CALIBRATOR: + return parseAndBuildCalibratorFlow(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_REROUTER: + return parseAndBuildRerouter(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_INTERVAL: + return parseAndBuildRerouterInterval(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_CLOSING_LANE_REROUTE: + return parseAndBuildRerouterClosingLaneReroute(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_CLOSING_REROUTE: + return parseAndBuildRerouterClosingReroute(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_DEST_PROB_REROUTE: + return parseAndBuildRerouterDestProbReroute(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_PARKING_ZONE_REROUTE: + return parseAndBuildRerouterParkingAreaReroute(net, allowUndoRedo, attrs, insertedAdditionals); + case SUMO_TAG_ROUTE_PROB_REROUTE: + return parseAndBuildRerouterRouteProbReroute(net, allowUndoRedo, attrs, insertedAdditionals); + default: + return false; + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildBusStop(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, + const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, int personCapacity, double parkingLength, + bool friendlyPosition, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_BUS_STOP, id, false) == nullptr) { + GNEBusStop* busStop = new GNEBusStop(id, lane, net, startPos, endPos, parametersSet, name, lines, personCapacity, parkingLength, friendlyPosition, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_BUS_STOP)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(busStop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(busStop); + lane->addChildAdditional(busStop); + busStop->incRef("buildBusStop"); + } + return busStop; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_BUS_STOP) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildAccess(GNENet* net, bool allowUndoRedo, GNEAdditional* busStop, GNELane* lane, double pos, const std::string& length, bool friendlyPos, bool blockMovement) { + // Check if busStop parent and lane is correct + if (lane == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); + } else if (busStop == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_BUS_STOP) + " parent doesn't exist."); + } else if (!accessCanBeCreated(busStop, lane->getParentEdge())) { + throw ProcessError("Could not build " + toString(SUMO_TAG_ACCESS) + " in netedit; " + toString(SUMO_TAG_BUS_STOP) + " parent already owns a Acces in the edge '" + lane->getParentEdge()->getID() + "'"); + } else { + GNEAccess* access = new GNEAccess(busStop, lane, net, pos, length, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_ACCESS)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(access, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(access); + lane->addChildAdditional(access); + busStop->addChildAdditional(access); + access->incRef("buildAccess"); + } + return access; + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildContainerStop(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, id, false) == nullptr) { + GNEContainerStop* containerStop = new GNEContainerStop(id, lane, net, startPos, endPos, parametersSet, name, lines, friendlyPosition, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_CONTAINER_STOP)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(containerStop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(containerStop); + lane->addChildAdditional(containerStop); + containerStop->incRef("buildContainerStop"); + } + return containerStop; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_CONTAINER_STOP) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildChargingStation(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_CHARGING_STATION, id, false) == nullptr) { + GNEChargingStation* chargingStation = new GNEChargingStation(id, lane, net, startPos, endPos, parametersSet, name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_CHARGING_STATION)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(chargingStation, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(chargingStation); + lane->addChildAdditional(chargingStation); + chargingStation->incRef("buildChargingStation"); + } + return chargingStation; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_CHARGING_STATION) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildParkingArea(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_PARKING_AREA, id, false) == nullptr) { + GNEParkingArea* parkingArea = new GNEParkingArea(id, lane, net, startPos, endPos, parametersSet, name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_PARKING_AREA)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingArea, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(parkingArea); + lane->addChildAdditional(parkingArea); + parkingArea->incRef("buildParkingArea"); + } + return parkingArea; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_PARKING_AREA) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildParkingSpace(GNENet* net, bool allowUndoRedo, GNEAdditional* parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement) { + GNEParkingSpace* parkingSpace = new GNEParkingSpace(net, parkingAreaParent, pos, width, length, angle, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_PARKING_SPACE)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingSpace, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(parkingSpace); + parkingAreaParent->addChildAdditional(parkingSpace); + parkingSpace->incRef("buildParkingSpace"); + } + return parkingSpace; +} + + +GNEAdditional* +GNEAdditionalHandler::buildDetectorE1(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_E1DETECTOR, id, false) == nullptr) { + GNEDetectorE1* detectorE1 = new GNEDetectorE1(id, lane, net, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_E1DETECTOR)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(detectorE1, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(detectorE1); + lane->addChildAdditional(detectorE1); + detectorE1->incRef("buildDetectorE1"); + } + return detectorE1; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_E1DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildSingleLaneDetectorE2(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, double length, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_E2DETECTOR, id, false) == nullptr) { + GNEDetectorE2* detectorE2 = new GNEDetectorE2(id, lane, net, pos, length, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_E2DETECTOR)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(detectorE2, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(detectorE2); + lane->addChildAdditional(detectorE2); + detectorE2->incRef("buildDetectorE2"); + } + return detectorE2; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_E2DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildMultiLaneDetectorE2(GNENet* net, bool allowUndoRedo, const std::string& id, const std::vector& lanes, double pos, double endPos, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_E2DETECTOR_MULTILANE, id, false) == nullptr) { + GNEDetectorE2* detectorE2 = new GNEDetectorE2(id, lanes, net, pos, endPos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, jamThreshold, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_E2DETECTOR_MULTILANE)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(detectorE2, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(detectorE2); + for (auto i : lanes) { + i->addChildAdditional(detectorE2); + } + detectorE2->incRef("buildDetectorE2Multilane"); + } + // check E2 integrity + detectorE2->checkE2MultilaneIntegrity(); + return detectorE2; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_E2DETECTOR_MULTILANE) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildDetectorE3(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_E3DETECTOR, id, false) == nullptr) { + GNEDetectorE3* detectorE3 = new GNEDetectorE3(id, net, pos, freq, filename, vehicleTypes, name, timeThreshold, speedThreshold, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_E3DETECTOR)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(detectorE3, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(detectorE3); + detectorE3->incRef("buildDetectorE3"); + } + return detectorE3; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_E3DETECTOR) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildDetectorEntry(GNENet* net, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) { + // Check if Detector E3 parent and lane is correct + if (lane == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_DET_ENTRY) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); + } else if (E3Parent == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_DET_ENTRY) + " in netedit; " + toString(SUMO_TAG_E3DETECTOR) + " parent doesn't exist."); + } else { + GNEDetectorEntryExit* entry = new GNEDetectorEntryExit(SUMO_TAG_DET_ENTRY, net, E3Parent, lane, pos, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_DET_ENTRY)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(entry, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(entry); + lane->addChildAdditional(entry); + E3Parent->addChildAdditional(entry); + entry->incRef("buildDetectorEntry"); + } + return entry; + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildDetectorExit(GNENet* net, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) { + // Check if Detector E3 parent and lane is correct + if (lane == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_DET_EXIT) + " in netedit; " + toString(SUMO_TAG_LANE) + " doesn't exist."); + } else if (E3Parent == nullptr) { + throw ProcessError("Could not build " + toString(SUMO_TAG_DET_EXIT) + " in netedit; " + toString(SUMO_TAG_E3DETECTOR) + " parent doesn't exist."); + } else { + GNEDetectorEntryExit* exit = new GNEDetectorEntryExit(SUMO_TAG_DET_EXIT, net, E3Parent, lane, pos, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_DET_EXIT)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(exit, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(exit); + lane->addChildAdditional(exit); + E3Parent->addChildAdditional(exit); + exit->incRef("buildDetectorExit"); + } + return exit; + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildDetectorE1Instant(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_INSTANT_INDUCTION_LOOP, id, false) == nullptr) { + GNEDetectorE1Instant* detectorE1Instant = new GNEDetectorE1Instant(id, lane, net, pos, filename, vehicleTypes, name, friendlyPos, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(detectorE1Instant, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(detectorE1Instant); + lane->addChildAdditional(detectorE1Instant); + detectorE1Instant->incRef("buildDetectorE1Instant"); + } + return detectorE1Instant; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildCalibrator(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& name, const std::string& outfile, const SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation) { + if (net->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) == nullptr) { + GNECalibrator* calibrator = new GNECalibrator(id, net, lane, pos, freq, name, outfile, routeprobe); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_CALIBRATOR)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(calibrator, true), true); + net->getViewNet()->getUndoList()->p_end(); + // center after creation + if (centerAfterCreation) { + net->getViewNet()->centerTo(calibrator->getPositionInView(), false); + } + } else { + net->getAttributeCarriers()->insertAdditional(calibrator); + lane->addChildAdditional(calibrator); + calibrator->incRef("buildCalibrator"); + } + return calibrator; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_CALIBRATOR) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildCalibrator(GNENet* net, bool allowUndoRedo, const std::string& id, GNEEdge* edge, double pos, const std::string& name, const std::string& outfile, const SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation) { + if (net->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) == nullptr) { + GNECalibrator* calibrator = new GNECalibrator(id, net, edge, pos, freq, name, outfile, routeprobe); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_CALIBRATOR)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(calibrator, true), true); + net->getViewNet()->getUndoList()->p_end(); + // center after creation + if (centerAfterCreation) { + net->getViewNet()->centerTo(calibrator->getPositionInView(), false); + } + } else { + net->getAttributeCarriers()->insertAdditional(calibrator); + edge->addChildAdditional(calibrator); + calibrator->incRef("buildCalibrator"); + } + return calibrator; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_CALIBRATOR) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildCalibratorFlow(GNENet* net, bool allowUndoRedo, GNEAdditional* calibratorParent, GNEDemandElement* route, GNEDemandElement* vType, + const std::string& vehsPerHour, const std::string& speed, const RGBColor& color, const std::string& departLane, const std::string& departPos, + const std::string& departSpeed, const std::string& arrivalLane, const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, + int personNumber, int containerNumber, bool reroute, const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end) { + + // create Flow and add it to calibrator parent + GNECalibratorFlow* flow = new GNECalibratorFlow(calibratorParent, vType, route, vehsPerHour, speed, color, departLane, departPos, departSpeed, + arrivalLane, arrivalPos, arrivalSpeed, line, personNumber, containerNumber, reroute, + departPosLat, arrivalPosLat, begin, end); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + flow->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(flow, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + calibratorParent->addChildAdditional(flow); + flow->incRef("buildCalibratorFlow"); + } + return flow; +} + + +GNEAdditional* +GNEAdditionalHandler::buildRerouter(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& edges, double prob, const std::string& name, const std::string& file, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_REROUTER, id, false) == nullptr) { + GNERerouter* rerouter = new GNERerouter(id, net, pos, edges, name, file, prob, off, timeThreshold, vTypes, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_REROUTER)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(rerouter, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(rerouter); + // add this rerouter as parent of all edges + for (auto i : edges) { + i->addParentAdditional(rerouter); + } + rerouter->incRef("buildRerouter"); + } + // parse rerouter children + if (!file.empty()) { + // we assume that rerouter values files is placed in the same folder as the additional file + std::string currentAdditionalFilename = FileHelpers::getFilePath(OptionsCont::getOptions().getString("additional-files")); + // Create additional handler for parse rerouter values + GNEAdditionalHandler rerouterValuesHandler(currentAdditionalFilename + file, net, rerouter); + // disable validation for rerouters + XMLSubSys::setValidation("never", "auto"); + // Run parser + if (!XMLSubSys::runParser(rerouterValuesHandler, currentAdditionalFilename + file, false)) { + WRITE_MESSAGE("Loading of " + file + " failed."); + } + // enable validation for rerouters + XMLSubSys::setValidation("auto", "auto"); + } + return rerouter; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_REROUTER) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildRerouterInterval(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end) { + // check if new interval will produce a overlapping + if (checkOverlappingRerouterIntervals(rerouterParent, begin, end)) { + // create rerouter interval and add it into rerouter parent + GNERerouterInterval* rerouterInterval = new GNERerouterInterval(rerouterParent, begin, end); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + rerouterInterval->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(rerouterInterval, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterParent->addChildAdditional(rerouterInterval); + rerouterInterval->incRef("buildRerouterInterval"); + } + return rerouterInterval; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_INTERVAL) + " with begin '" + toString(begin) + "' and '" + toString(end) + "' in '" + rerouterParent->getID() + "' due overlapping."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildClosingLaneReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions) { + // create closing lane reorute + GNEClosingLaneReroute* closingLaneReroute = new GNEClosingLaneReroute(rerouterIntervalParent, closedLane, permissions); + // add it to interval parent depending of allowUndoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + closingLaneReroute->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingLaneReroute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterIntervalParent->addChildAdditional(closingLaneReroute); + closingLaneReroute->incRef("buildClosingLaneReroute"); + } + return closingLaneReroute; +} + + +GNEAdditional* +GNEAdditionalHandler::buildClosingReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions) { + // create closing reroute + GNEClosingReroute* closingReroute = new GNEClosingReroute(rerouterIntervalParent, closedEdge, permissions); + // add it to interval parent depending of allowUndoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + closingReroute->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(closingReroute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterIntervalParent->addChildAdditional(closingReroute); + closingReroute->incRef("buildClosingReroute"); + } + return closingReroute; +} + + +GNEAdditional* +GNEAdditionalHandler::builDestProbReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability) { + // create dest probability reroute + GNEDestProbReroute* destProbReroute = new GNEDestProbReroute(rerouterIntervalParent, newEdgeDestination, probability); + // add it to interval parent depending of allowUndoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + destProbReroute->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(destProbReroute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterIntervalParent->addChildAdditional(destProbReroute); + destProbReroute->incRef("builDestProbReroute"); + } + return destProbReroute; +} + + +GNEAdditional* +GNEAdditionalHandler::builParkingAreaReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible) { + // create dest probability reroute + GNEParkingAreaReroute* parkingAreaReroute = new GNEParkingAreaReroute(rerouterIntervalParent, newParkingArea, probability, visible); + // add it to interval parent depending of allowUndoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + parkingAreaReroute->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(parkingAreaReroute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterIntervalParent->addChildAdditional(parkingAreaReroute); + parkingAreaReroute->incRef("builParkingAreaReroute"); + } + return parkingAreaReroute; +} + + +GNEAdditional* +GNEAdditionalHandler::buildRouteProbReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability) { + // create rout prob rereoute + GNERouteProbReroute* routeProbReroute = new GNERouteProbReroute(rerouterIntervalParent, newRouteId, probability); + // add it to interval parent depending of allowUndoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + routeProbReroute->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbReroute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + rerouterIntervalParent->addChildAdditional(routeProbReroute); + routeProbReroute->incRef("buildRouteProbReroute"); + } + return routeProbReroute; +} + + +GNEAdditional* +GNEAdditionalHandler::buildRouteProbe(GNENet* net, bool allowUndoRedo, const std::string& id, GNEEdge* edge, const std::string& freq, const std::string& name, const std::string& file, SUMOTime begin, bool centerAfterCreation) { + if (net->retrieveAdditional(SUMO_TAG_ROUTEPROBE, id, false) == nullptr) { + GNERouteProbe* routeProbe = new GNERouteProbe(id, net, edge, freq, name, file, begin); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_ROUTEPROBE)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(routeProbe, true), true); + net->getViewNet()->getUndoList()->p_end(); + // center after creation + if (centerAfterCreation) { + net->getViewNet()->centerTo(routeProbe->getPositionInView(), false); + } + } else { + net->getAttributeCarriers()->insertAdditional(routeProbe); + edge->addChildAdditional(routeProbe); + routeProbe->incRef("buildRouteProbe"); + } + return routeProbe; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_ROUTEPROBE) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildVariableSpeedSign(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& lanes, const std::string& name, bool blockMovement) { + if (net->retrieveAdditional(SUMO_TAG_VSS, id, false) == nullptr) { + GNEVariableSpeedSign* variableSpeedSign = new GNEVariableSpeedSign(id, net, pos, lanes, name, blockMovement); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_VSS)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(variableSpeedSign, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(variableSpeedSign); + // add this VSS as parent of all edges + for (auto i : lanes) { + i->addParentAdditional(variableSpeedSign); + } + variableSpeedSign->incRef("buildVariableSpeedSign"); + } + return variableSpeedSign; + } else { + throw ProcessError("Could not build " + toString(SUMO_TAG_VSS) + " with ID '" + id + "' in netedit; probably declared twice."); + } +} + + +GNEAdditional* +GNEAdditionalHandler::buildVariableSpeedSignStep(GNENet* net, bool allowUndoRedo, GNEAdditional* VSSParent, double time, double speed) { + // create Variable Speed Sign + GNEVariableSpeedSignStep* variableSpeedSignStep = new GNEVariableSpeedSignStep(VSSParent, time, speed); + // add it depending of allow undoRedo + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + variableSpeedSignStep->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(variableSpeedSignStep, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + VSSParent->addChildAdditional(variableSpeedSignStep); + variableSpeedSignStep->incRef("buildVariableSpeedSignStep"); + } + return variableSpeedSignStep; +} + + +GNEAdditional* +GNEAdditionalHandler::buildVaporizer(GNENet* net, bool allowUndoRedo, GNEEdge* edge, SUMOTime startTime, SUMOTime endTime, const std::string& name, bool centerAfterCreation) { + GNEVaporizer* vaporizer = new GNEVaporizer(net, edge, startTime, endTime, name); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_VAPORIZER)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(vaporizer, true), true); + net->getViewNet()->getUndoList()->p_end(); + // center after creation + if (centerAfterCreation) { + net->getViewNet()->centerTo(vaporizer->getPositionInView(), false); + } + } else { + net->getAttributeCarriers()->insertAdditional(vaporizer); + edge->addChildAdditional(vaporizer); + vaporizer->incRef("buildVaporizer"); + } + return vaporizer; +} + + +GNEAdditional* +GNEAdditionalHandler::buildTAZ(GNENet* net, bool allowUndoRedo, const std::string& id, const PositionVector& shape, const RGBColor& color, const std::vector& edges, bool blockMovement) { + GNETAZ* TAZ = new GNETAZ(id, net, shape, color, blockMovement); + // disable updating geometry of TAZ children during insertion (because in large nets provokes slowdowns) + net->disableUpdateGeometry(); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZ)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZ, true), true); + // create TAZEdges + for (auto i : edges) { + // create TAZ Source using GNEChange_Additional + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, i, 1); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + // create TAZ Sink using GNEChange_Additional + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, i, 1); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + } + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(TAZ); + TAZ->incRef("buildTAZ"); + for (auto i : edges) { + // create TAZ Source + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, i, 1); + TAZSource->incRef("buildTAZ"); + TAZ->addChildAdditional(TAZSource); + // create TAZ Sink + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, i, 1); + TAZSink->incRef("buildTAZ"); + TAZ->addChildAdditional(TAZSink); + } + } + // enable updating geometry again and update geometry of TAZ + net->enableUpdateGeometry(); + // update TAZ Frame + TAZ->updateGeometry(); + TAZ->updateParentAdditional(); + return TAZ; +} + + +GNEAdditional* +GNEAdditionalHandler::buildTAZSource(GNENet* net, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double departWeight) { + GNEAdditional* TAZSink = nullptr; + // first check if a TAZSink in the same edge for the same TAZ + for (auto i : TAZ->getChildAdditionals()) { + if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { + TAZSink = i; + } + } + // 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); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSINK)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(TAZSink); + TAZSink->incRef("buildTAZSource"); + } + } + // now check check if TAZSource exist + GNEAdditional* TAZSource = nullptr; + // first check if a TAZSink in the same edge for the same TAZ + for (auto i : TAZ->getChildAdditionals()) { + if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { + TAZSource = i; + } + } + // check if TAZSource has to be created + if (TAZSource == nullptr) { + // Create TAZ only with departWeight + TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, departWeight); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSOURCE)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(TAZSource); + TAZSource->incRef("buildTAZSource"); + } + } else { + // update TAZ Attribute + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("update " + toString(SUMO_TAG_TAZSOURCE)); + TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), net->getViewNet()->getUndoList()); + net->getViewNet()->getUndoList()->p_end(); + } else { + TAZSource->setAttribute(SUMO_ATTR_WEIGHT, toString(departWeight), nullptr); + TAZSource->incRef("buildTAZSource"); + } + } + return TAZSource; +} + + +GNEAdditional* +GNEAdditionalHandler::buildTAZSink(GNENet* net, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double arrivalWeight) { + GNEAdditional* TAZSource = nullptr; + // first check if a TAZSink in the same edge for the same TAZ + for (auto i : TAZ->getChildAdditionals()) { + if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { + TAZSource = i; + } + } + // check if TAZSource has to be created + if (TAZSource == nullptr) { + // Create TAZ with empty value + TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, TAZ, edge, 1); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSOURCE)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(TAZSource); + TAZSource->incRef("buildTAZSink"); + } + } + GNEAdditional* TAZSink = nullptr; + // first check if a TAZSink in the same edge for the same TAZ + for (auto i : TAZ->getChildAdditionals()) { + if ((i->getTagProperty().getTag() == SUMO_TAG_TAZSINK) && (i->getAttribute(SUMO_ATTR_EDGE) == edge->getID())) { + TAZSink = i; + } + } + // check if TAZSink has to be created + if (TAZSink == nullptr) { + // Create TAZ only with arrivalWeight + TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, TAZ, edge, arrivalWeight); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_TAZSINK)); + net->getViewNet()->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertAdditional(TAZSink); + TAZSink->incRef("buildTAZSink"); + } + } else { + // update TAZ Attribute + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("update " + toString(SUMO_TAG_TAZSINK)); + TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), net->getViewNet()->getUndoList()); + net->getViewNet()->getUndoList()->p_end(); + } else { + TAZSink->setAttribute(SUMO_ATTR_WEIGHT, toString(arrivalWeight), nullptr); + TAZSink->incRef("buildTAZSink"); + } + } + return TAZSink; +} + + +double +GNEAdditionalHandler::getPosition(double pos, GNELane& lane, bool friendlyPos, const std::string& additionalID) { + if (pos < 0) { + pos = lane.getLaneShapeLength() + pos; + } + if (pos > lane.getLaneShapeLength()) { + if (friendlyPos) { + pos = lane.getLaneShapeLength() - (double) 0.1; + } else { + WRITE_WARNING("The position of additional '" + additionalID + "' lies beyond the lane's '" + lane.getID() + "' length."); + } + } + return pos; +} + + +bool GNEAdditionalHandler::checkAndFixDetectorPosition(double& pos, const double laneLength, const bool friendlyPos) { + if (fabs(pos) > laneLength) { + if (!friendlyPos) { + return false; + } else if (pos < 0) { + pos = 0; + } else if (pos > laneLength) { + pos = laneLength - 0.01; + } + } + return true; +} + + +bool GNEAdditionalHandler::fixE2DetectorPosition(double& pos, double& length, const double laneLength, const bool friendlyPos) { + if ((pos < 0) || ((pos + length) > laneLength)) { + if (!friendlyPos) { + return false; + } else if (pos < 0) { + pos = 0; + } else if (pos > laneLength) { + pos = laneLength - 0.01; + length = 0; + } else if ((pos + length) > laneLength) { + length = laneLength - pos - 0.01; + } + } + return true; +} + + +bool +GNEAdditionalHandler::accessCanBeCreated(GNEAdditional* busStopParent, GNEEdge* edge) { + // check that busStopParent is a busStop + assert(busStopParent->getTagProperty().getTag() == SUMO_TAG_BUS_STOP); + // check if exist another acces for the same busStop in the given edge + for (auto i : busStopParent->getChildAdditionals()) { + for (auto j : edge->getLanes()) { + if (i->getAttribute(SUMO_ATTR_LANE) == j->getID()) { + return false; + } + } + } + return true; +} + + +bool +GNEAdditionalHandler::checkOverlappingRerouterIntervals(GNEAdditional* rerouter, SUMOTime newBegin, SUMOTime newEnd) { + // check that rerouter is correct + assert(rerouter->getTagProperty().getTag() == SUMO_TAG_REROUTER); + // declare a vector to keep sorted rerouter children + std::vector> sortedIntervals; + // iterate over child additional + for (auto i : rerouter->getChildAdditionals()) { + sortedIntervals.push_back(std::make_pair((SUMOTime)0., (SUMOTime)0.)); + // set begin and end + sortedIntervals.back().first = TIME2STEPS(i->getAttributeDouble(SUMO_ATTR_BEGIN)); + sortedIntervals.back().second = TIME2STEPS(i->getAttributeDouble(SUMO_ATTR_END)); + } + // add new intervals + sortedIntervals.push_back(std::make_pair(newBegin, newEnd)); + // sort children + std::sort(sortedIntervals.begin(), sortedIntervals.end()); + // check overlapping after sorting + for (int i = 0; i < (int)sortedIntervals.size() - 1; i++) { + if (sortedIntervals.at(i).second > sortedIntervals.at(i + 1).first) { + return false; + } + } + return true; +} + + + + +bool +GNEAdditionalHandler::parseAndBuildVaporizer(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Vaporizer + const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_ID, abort); + SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_BEGIN, abort); + SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_END, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VAPORIZER, SUMO_ATTR_NAME, abort); + // extra check for center element after creation + bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); + // Continue if all parameters were successfully loaded + if (!abort) { + // get GNEEdge + GNEEdge* edge = net->retrieveEdge(edgeID, false); + // check that all parameters are valid + if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_VAPORIZER) + " is not known."); + } else if (net->retrieveAdditional(SUMO_TAG_VAPORIZER, edgeID, false) != nullptr) { + WRITE_WARNING("There is already a " + toString(SUMO_TAG_VAPORIZER) + " in the edge '" + edgeID + "'."); + } else if (begin > end) { + WRITE_WARNING("Time interval of " + toString(SUMO_TAG_VAPORIZER) + " isn't valid. Attribute '" + toString(SUMO_ATTR_BEGIN) + "' is greater than attribute '" + toString(SUMO_ATTR_END) + "'."); + } else { + // build vaporizer + GNEAdditional* additionalCreated = buildVaporizer(net, allowUndoRedo, edge, begin, end, name, centerAfterCreation); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildTAZ(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Vaporizer + const std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZ, SUMO_ATTR_ID, abort); + const PositionVector shape = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, SUMO_ATTR_SHAPE, abort); + RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, SUMO_ATTR_COLOR, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_TAZ, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // check edges + std::vector edgeIDs; + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + std::string parsedAttribute = attrs.get(SUMO_ATTR_EDGES, id.c_str(), abort, false); + edgeIDs = GNEAttributeCarrier::parse >(parsedAttribute); + } + // check if all edge IDs are valid + std::vector edges; + for (auto i : edgeIDs) { + GNEEdge* edge = net->retrieveEdge(i, false); + if (edge == nullptr) { + WRITE_WARNING("Invalid " + toString(SUMO_TAG_EDGE) + " with ID = '" + i + "' within taz '" + id + "'."); + abort = true; + } else { + edges.push_back(edge); + } + } + // Continue if all parameters were successfully loaded + if (!abort) { + // check that all parameters are valid + if (net->retrieveAdditional(SUMO_TAG_TAZ, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_TAZ) + " with the same ID='" + id + "'."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildTAZ(net, allowUndoRedo, id, shape, color, edges, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildTAZSource(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Vaporizer + const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZSOURCE, SUMO_ATTR_ID, abort); + const double departWeight = GNEAttributeCarrier::parseAttributeFromXML(attrs, edgeID, SUMO_TAG_TAZSOURCE, SUMO_ATTR_WEIGHT, abort); + // Continue if all parameters were successfully loaded + if (!abort) { + // get edge and TAZ + GNEEdge* edge = net->retrieveEdge(edgeID, false); + GNEAdditional* TAZ = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + TAZ = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_TAZ); + } else { + bool ok = true; + TAZ = net->retrieveAdditional(SUMO_TAG_TAZ, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_TAZSOURCE) + " is not known."); + } else if (TAZ == nullptr) { + WRITE_WARNING("A " + toString(SUMO_TAG_TAZSOURCE) + " must be declared within the definition of a " + toString(SUMO_TAG_TAZ) + "."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildTAZSource(net, allowUndoRedo, TAZ, edge, departWeight); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildTAZSink(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Vaporizer + const std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_TAZSINK, SUMO_ATTR_ID, abort); + const double arrivalWeight = GNEAttributeCarrier::parseAttributeFromXML(attrs, edgeID, SUMO_TAG_TAZSINK, SUMO_ATTR_WEIGHT, abort); + // Continue if all parameters were successfully loaded + if (!abort) { + // get edge and TAZ + GNEEdge* edge = net->retrieveEdge(edgeID, false); + GNEAdditional* TAZ = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + TAZ = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_TAZ); + } else { + bool ok = true; + TAZ = net->retrieveAdditional(SUMO_TAG_TAZ, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_TAZSINK) + " is not known."); + } else if (TAZ == nullptr) { + WRITE_WARNING("A " + toString(SUMO_TAG_TAZSINK) + " must be declared within the definition of a " + toString(SUMO_TAG_TAZ) + "."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildTAZSink(net, allowUndoRedo, TAZ, edge, arrivalWeight); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRouteProbe(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of RouteProbe + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTEPROBE, SUMO_ATTR_ID, abort); + std::string edgeId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_EDGE, abort); + std::string freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_FREQUENCY, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_NAME, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_FILE, abort); + SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_ROUTEPROBE, SUMO_ATTR_BEGIN, abort); + // extra check for center element after creation + bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get edge + GNEEdge* edge = net->retrieveEdge(edgeId, false); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_ROUTEPROBE, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_ROUTEPROBE) + " with the same ID='" + id + "'."); + } else if (edge == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The edge '" + edgeId + "' to use within the " + toString(SUMO_TAG_ROUTEPROBE) + " '" + id + "' is not known."); + } else { + // Freq needs an extra check, because it can be empty + if (GNEAttributeCarrier::canParse(freq)) { + if (GNEAttributeCarrier::parse(freq) < 0) { + WRITE_WARNING(toString(SUMO_ATTR_FREQUENCY) + "of " + toString(SUMO_TAG_ROUTEPROBE) + "'" + id + "' cannot be negative."); + freq = ""; + } + } else { + if (freq.empty()) { + WRITE_WARNING(toString(SUMO_ATTR_FREQUENCY) + "of " + toString(SUMO_TAG_ROUTEPROBE) + "'" + id + "' cannot be parsed to float."); + } + freq = ""; + } + // save ID of last created element + GNEAdditional* additionalCreated = buildRouteProbe(net, allowUndoRedo, id, edge, freq, name, file, begin, centerAfterCreation); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildCalibratorFlow(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of calibrator flows + std::string vehicleTypeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_TYPE, abort); + std::string routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ROUTE, abort); + std::string vehsPerHour = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_VEHSPERHOUR, abort); + std::string speed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_SPEED, abort); + RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_COLOR, abort); + std::string departLane = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTLANE, abort); + std::string departPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTPOS, abort); + std::string departSpeed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTSPEED, abort); + std::string arrivalLane = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALLANE, abort); + std::string arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALPOS, abort); + std::string arrivalSpeed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALSPEED, abort); + std::string line = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_LINE, abort); + int personNumber = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_PERSON_NUMBER, abort); + int containerNumber = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_CONTAINER_NUMBER, abort); + bool reroute = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_REROUTE, abort); + std::string departPosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_DEPARTPOS_LAT, abort); + std::string arrivalPosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_ARRIVALPOS_LAT, abort); + SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_BEGIN, abort); + SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_FLOW_CALIBRATOR, SUMO_ATTR_END, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain route, vehicle type and calibrator parent + GNEDemandElement* route = net->retrieveDemandElement(SUMO_TAG_ROUTE, routeID, false); + GNEDemandElement* vtype = net->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleTypeID, false); + GNEAdditional* calibrator = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + calibrator = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_CALIBRATOR); + } else { + bool ok = true; + calibrator = net->retrieveAdditional(SUMO_TAG_CALIBRATOR, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (route == nullptr) { + WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; their " + toString(SUMO_TAG_ROUTE) + " with ID = '" + routeID + "' doesn't exist"); + abort = true; + } else if (vtype == nullptr) { + WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; their " + toString(SUMO_TAG_VTYPE) + " with ID = '" + vehicleTypeID + "' doesn't exist"); + abort = true; + } else if ((vehsPerHour.empty()) && (speed.empty())) { + WRITE_WARNING(toString(SUMO_TAG_FLOW_CALIBRATOR) + " cannot be created; At least parameters " + toString(SUMO_ATTR_VEHSPERHOUR) + " or " + toString(SUMO_ATTR_SPEED) + " has to be defined"); + abort = true; + } else if (calibrator != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildCalibratorFlow(net, allowUndoRedo, calibrator, route, vtype, vehsPerHour, speed, color, departLane, departPos, departSpeed, arrivalLane, arrivalPos, arrivalSpeed, + line, personNumber, containerNumber, reroute, departPosLat, arrivalPosLat, begin, end); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildVariableSpeedSign(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of VSS + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_VSS, SUMO_ATTR_ID, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_NAME, abort); + GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_FILE, abort); // deprecated + std::string lanesIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_LANES, abort); + Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, SUMO_ATTR_POSITION, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_VSS, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain lanes + std::vector lanes; + if (GNEAttributeCarrier::canParse >(net, lanesIDs, true)) { + lanes = GNEAttributeCarrier::parse >(net, lanesIDs); + } + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_VSS, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_VSS) + " with the same ID='" + id + "'."); + } else if (lanes.size() == 0) { + WRITE_WARNING("A Variable Speed Sign needs at least one lane."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildVariableSpeedSign(net, allowUndoRedo, id, pos, lanes, name, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildVariableSpeedSignStep(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // Load step values + double time = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_STEP, SUMO_ATTR_TIME, abort); + double speed = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_STEP, SUMO_ATTR_SPEED, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get Variable Speed Signal + GNEAdditional* variableSpeedSign = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + variableSpeedSign = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_VSS); + } else { + bool ok = true; + variableSpeedSign = net->retrieveAdditional(SUMO_TAG_VSS, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (variableSpeedSign != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildVariableSpeedSignStep(net, allowUndoRedo, variableSpeedSign, time, speed); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouter(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_REROUTER, SUMO_ATTR_ID, abort); + std::string edgesIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_EDGES, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_NAME, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_FILE, abort); + double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_PROB, abort); + bool off = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_OFF, abort); + SUMOTime timeThreshold = attrs.getOptSUMOTimeReporting(SUMO_ATTR_HALTING_TIME_THRESHOLD, id.c_str(), abort, 0); + const std::string vTypes = attrs.getOpt(SUMO_ATTR_VTYPES, id.c_str(), abort, ""); + Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, SUMO_ATTR_POSITION, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_REROUTER, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain edges + std::vector edges; + if (GNEAttributeCarrier::canParse >(net, edgesIDs, true)) { + edges = GNEAttributeCarrier::parse >(net, edgesIDs); + } + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_REROUTER, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_REROUTER) + " with the same ID='" + id + "'."); + } else if (edges.size() == 0) { + WRITE_WARNING("A rerouter needs at least one Edge"); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildRerouter(net, allowUndoRedo, id, pos, edges, probability, name, + file, off, timeThreshold, vTypes, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterInterval(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + SUMOTime begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INTERVAL, SUMO_ATTR_BEGIN, abort); + SUMOTime end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INTERVAL, SUMO_ATTR_END, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain rerouter + GNEAdditional* rerouter; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouter = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_REROUTER); + } else { + bool ok = true; + rerouter = net->retrieveAdditional(SUMO_TAG_REROUTER, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // special case for load multiple intervals in the same rerouter + if (rerouter == nullptr) { + GNEAdditional* lastInsertedRerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + lastInsertedRerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + lastInsertedRerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + if (lastInsertedRerouterInterval) { + rerouter = lastInsertedRerouterInterval->getParentAdditionals().at(0); + } + } + // check that rerouterInterval can be created + if (begin >= end) { + WRITE_WARNING(toString(SUMO_TAG_INTERVAL) + " cannot be created; Attribute " + toString(SUMO_ATTR_END) + " must be greather than " + toString(SUMO_ATTR_BEGIN) + "."); + } else if (rerouter != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildRerouterInterval(net, allowUndoRedo, rerouter, begin, end); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterClosingLaneReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string laneID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_ID, abort); + std::string allow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_ALLOW, abort); + std::string disallow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_LANE_REROUTE, SUMO_ATTR_DISALLOW, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain lane and rerouter interval + GNELane* lane = net->retrieveLane(laneID, false, true); + GNEAdditional* rerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + rerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (lane == nullptr) { + WRITE_WARNING("The lane '" + laneID + "' to use within the " + toString(SUMO_TAG_CLOSING_LANE_REROUTE) + " is not known."); + } else if (rerouterInterval != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildClosingLaneReroute(net, allowUndoRedo, rerouterInterval, lane, parseVehicleClasses(allow, disallow)); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterClosingReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_ID, abort); + std::string allow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_ALLOW, abort); + std::string disallow = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CLOSING_REROUTE, SUMO_ATTR_DISALLOW, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain edge and rerouter interval + GNEEdge* edge = net->retrieveEdge(edgeID, false); + GNEAdditional* rerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + rerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_CLOSING_REROUTE) + " is not known."); + } else if (rerouterInterval != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildClosingReroute(net, allowUndoRedo, rerouterInterval, edge, parseVehicleClasses(allow, disallow)); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterDestProbReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DEST_PROB_REROUTE, SUMO_ATTR_ID, abort); + double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DEST_PROB_REROUTE, SUMO_ATTR_PROB, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain edge and rerouter interval + GNEEdge* edge = net->retrieveEdge(edgeID, false); + GNEAdditional* rerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + rerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_DEST_PROB_REROUTE) + " is not known."); + } else if (rerouterInterval != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = builDestProbReroute(net, allowUndoRedo, rerouterInterval, edge, probability); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterParkingAreaReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string parkingAreaID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_ID, abort); + double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_PROB, abort); + bool visible = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_ZONE_REROUTE, SUMO_ATTR_VISIBLE, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain edge and rerouter interval + GNEAdditional* parkingArea = net->retrieveAdditional(SUMO_TAG_PARKING_AREA, parkingAreaID, false); + GNEAdditional* rerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + rerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (parkingArea == nullptr) { + WRITE_WARNING("The parkingArea '" + parkingAreaID + "' to use within the " + toString(SUMO_TAG_PARKING_ZONE_REROUTE) + " is not known."); + } else if (rerouterInterval != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = builParkingAreaReroute(net, allowUndoRedo, rerouterInterval, parkingArea, probability, visible); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildRerouterRouteProbReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Rerouter + std::string routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE_PROB_REROUTE, SUMO_ATTR_ID, abort); + double probability = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE_PROB_REROUTE, SUMO_ATTR_PROB, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // obtain rerouter interval + GNEAdditional* rerouterInterval = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + rerouterInterval = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_INTERVAL); + } else { + bool ok = true; + rerouterInterval = net->retrieveAdditional(SUMO_TAG_INTERVAL, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all elements are valid + if (rerouterInterval != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildRouteProbReroute(net, allowUndoRedo, rerouterInterval, routeID, probability); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildBusStop(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of bus stop + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_BUS_STOP, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_LANE, abort); + std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_STARTPOS, abort); + std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_ENDPOS, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_NAME, abort); + std::vector lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_LINES, abort); + const int personCapacity = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_PERSON_CAPACITY, abort); + const double parkingLength = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_PARKING_LENGTH, abort); + bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_BUS_STOP, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_BUS_STOP, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_BUS_STOP) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_BUS_STOP) + " '" + id + "' is not known."); + } else { + // declare variables for start and end position + double startPosDouble = 0; + double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + const double stoppingPlaceLength = (endPosDouble - startPosDouble); + int parametersSet = 0; + // check if startPos and endPos were defined + if (GNEAttributeCarrier::canParse(startPos)) { + startPosDouble = GNEAttributeCarrier::parse(startPos); + parametersSet |= STOPPINGPLACE_STARTPOS_SET; + } + if (GNEAttributeCarrier::canParse(endPos)) { + endPosDouble = GNEAttributeCarrier::parse(endPos); + parametersSet |= STOPPINGPLACE_ENDPOS_SET; + } + // check if stoppingPlace has to be adjusted + SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); + // update start and end positions depending of checkStopPosResult + if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { + startPosDouble = 0; + endPosDouble = stoppingPlaceLength; + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { + startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; + endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { + // Write error if position isn't valid + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_BUS_STOP) + " with ID = '" + id + "'."); + return false; + } + // save ID of last created element + GNEAdditional* additionalCreated = buildBusStop(net, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, + name, lines, personCapacity, parkingLength, friendlyPosition, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildContainerStop(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of container stop + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_LANE, abort); + std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_STARTPOS, abort); + std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_ENDPOS, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_NAME, abort); + std::vector lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_LINES, abort); + bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CONTAINER_STOP, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_CONTAINER_STOP) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CONTAINER_STOP) + " '" + id + "' is not known."); + } else { + // declare variables for start and end position + double startPosDouble = 0; + double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + const double stoppingPlaceLength = (endPosDouble - startPosDouble); + int parametersSet = 0; + // check if startPos and endPos were defined + if (GNEAttributeCarrier::canParse(startPos)) { + startPosDouble = GNEAttributeCarrier::parse(startPos); + parametersSet |= STOPPINGPLACE_STARTPOS_SET; + } + if (GNEAttributeCarrier::canParse(endPos)) { + endPosDouble = GNEAttributeCarrier::parse(endPos); + parametersSet |= STOPPINGPLACE_ENDPOS_SET; + } + // check if stoppingPlace has to be adjusted + SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); + // update start and end positions depending of checkStopPosResult + if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { + startPosDouble = 0; + endPosDouble = stoppingPlaceLength; + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { + startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; + endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { + // Write error if position isn't valid + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_CONTAINER_STOP) + " with ID = '" + id + "'."); + return false; + } + // save ID of last created element + GNEAdditional* additionalCreated = buildContainerStop(net, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, + name, lines, friendlyPosition, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildAccess(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Entry + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_LANE, abort); + std::string position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_POSITION, abort); + std::string length = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_LENGTH, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ACCESS, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Check if parsing of parameters was correct + if (!abort) { + double posDouble = GNEAttributeCarrier::parse(position); + // get lane and busStop parent + GNELane* lane = net->retrieveLane(laneId, false, true); + GNEAdditional* busStop = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + busStop = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_BUS_STOP); + } else { + bool ok = true; + busStop = net->retrieveAdditional(SUMO_TAG_BUS_STOP, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (lane == nullptr) { + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_ACCESS) + " is not known."); + } else if (busStop == nullptr) { + WRITE_WARNING("A " + toString(SUMO_TAG_ACCESS) + " must be declared within the definition of a " + toString(SUMO_TAG_BUS_STOP) + "."); + } else if (!checkAndFixDetectorPosition(posDouble, lane->getLaneShapeLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_ACCESS) + "."); + } else if (!accessCanBeCreated(busStop, lane->getParentEdge())) { + WRITE_WARNING("Edge '" + lane->getParentEdge()->getID() + "' already has an Access for busStop '" + busStop->getID() + "'"); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildAccess(net, allowUndoRedo, busStop, lane, posDouble, length, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildChargingStation(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of charging station + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CHARGING_STATION, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_LANE, abort); + std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_STARTPOS, abort); + std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_ENDPOS, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_NAME, abort); + double chargingPower = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGINGPOWER, abort); + double efficiency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_EFFICIENCY, abort); + bool chargeInTransit = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGEINTRANSIT, abort); + SUMOTime chargeDelay = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_CHARGEDELAY, abort); + bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CHARGING_STATION, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_CHARGING_STATION, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_CHARGING_STATION) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CHARGING_STATION) + " '" + id + "' is not known."); + } else { + // declare variables for start and end position + double startPosDouble = 0; + double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + const double stoppingPlaceLength = (endPosDouble - startPosDouble); + int parametersSet = 0; + // check if startPos and endPos were defined + if (GNEAttributeCarrier::canParse(startPos)) { + startPosDouble = GNEAttributeCarrier::parse(startPos); + parametersSet |= STOPPINGPLACE_STARTPOS_SET; + } + if (GNEAttributeCarrier::canParse(endPos)) { + endPosDouble = GNEAttributeCarrier::parse(endPos); + parametersSet |= STOPPINGPLACE_ENDPOS_SET; + } + // check if stoppingPlace has to be adjusted + SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); + // update start and end positions depending of checkStopPosResult + if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { + startPosDouble = 0; + endPosDouble = stoppingPlaceLength; + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { + startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; + endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { + // Write error if position isn't valid + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_CHARGING_STATION) + " with ID = '" + id + "'."); + return false; + } + // save ID of last created element + GNEAdditional* additionalCreated = buildChargingStation(net, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, + name, chargingPower, efficiency, chargeInTransit, chargeDelay, friendlyPosition, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildParkingArea(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of charging station + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_AREA, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_LANE, abort); + std::string startPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_STARTPOS, abort); + std::string endPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ENDPOS, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_NAME, abort); + bool friendlyPosition = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_FRIENDLY_POS, abort); + int roadSideCapacity = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ROADSIDE_CAPACITY, abort); + bool onRoad = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ONROAD, abort); + double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_WIDTH, abort); + std::string length = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_LENGTH, abort); + double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, SUMO_ATTR_ANGLE, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_PARKING_AREA, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_PARKING_AREA, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_PARKING_AREA) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_PARKING_AREA) + " '" + id + "' is not known."); + } else { + // declare variables for start and end position + double startPosDouble = 0; + double endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + const double stoppingPlaceLength = (endPosDouble - startPosDouble); + int parametersSet = 0; + // check if startPos and endPos were defined + if (GNEAttributeCarrier::canParse(startPos)) { + startPosDouble = GNEAttributeCarrier::parse(startPos); + parametersSet |= STOPPINGPLACE_STARTPOS_SET; + } + if (GNEAttributeCarrier::canParse(endPos)) { + endPosDouble = GNEAttributeCarrier::parse(endPos); + parametersSet |= STOPPINGPLACE_ENDPOS_SET; + } + // check if stoppingPlace has to be adjusted + SUMORouteHandler::StopPos checkStopPosResult = SUMORouteHandler::checkStopPos(startPosDouble, endPosDouble, lane->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPosition); + // update start and end positions depending of checkStopPosResult + if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_STARTPOS) { + startPosDouble = 0; + endPosDouble = stoppingPlaceLength; + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_ENDPOS) { + startPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength() - stoppingPlaceLength; + endPosDouble = lane->getParentEdge()->getNBEdge()->getFinalLength(); + } else if (checkStopPosResult == SUMORouteHandler::StopPos::STOPPOS_INVALID_LANELENGTH) { + // Write error if position isn't valid + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_PARKING_AREA) + " with ID = '" + id + "'."); + return false; + } + // save ID of last created element + GNEAdditional* additionalCreated = buildParkingArea(net, allowUndoRedo, id, lane, startPosDouble, endPosDouble, parametersSet, + name, friendlyPosition, roadSideCapacity, onRoad, width, length, angle, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildParkingSpace(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Parking Spaces + Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_POSITION, abort); + double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_WIDTH, abort); + double length = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_LENGTH, abort); + double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, SUMO_ATTR_ANGLE, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_PARKING_SPACE, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get Parking Area Parent + GNEAdditional* parkingAreaParent = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + parkingAreaParent = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_PARKING_AREA); + } else { + bool ok = true; + parkingAreaParent = net->retrieveAdditional(SUMO_TAG_PARKING_AREA, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that Parking Area Parent exists + if (parkingAreaParent != nullptr) { + // save ID of last created element + GNEAdditional* additionalCreated = buildParkingSpace(net, allowUndoRedo, parkingAreaParent, pos, width, length, angle, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildCalibrator(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // due there is two differents calibrators, has to be parsed in a different way + std::string edgeID, laneId, id; + // change tag depending of XML parmeters + if (attrs.hasAttribute(SUMO_ATTR_EDGE)) { + id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_CALIBRATOR, SUMO_ATTR_ID, abort); + edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_EDGE, abort); + std::string outfile = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_OUTPUT, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_POSITION, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_NAME, abort); + SUMOTime freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_FREQUENCY, abort); + std::string routeProbe = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_CALIBRATOR, SUMO_ATTR_ROUTEPROBE, abort); + // extra check for center element after creation + bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer and edge + GNEEdge* edge = net->retrieveEdge(edgeID, false); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_CALIBRATOR, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_CALIBRATOR) + " with the same ID='" + id + "'."); + } else if (edge == nullptr) { + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_CALIBRATOR) + " '" + id + "' is not known."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildCalibrator(net, allowUndoRedo, id, edge, position, name, outfile, freq, routeProbe, centerAfterCreation); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + } else if (attrs.hasAttribute(SUMO_ATTR_LANE)) { + id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_ID, abort); + laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_LANE, abort); + std::string outfile = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_OUTPUT, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_POSITION, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_NAME, abort); + SUMOTime freq = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_FREQUENCY, abort); + std::string routeProbe = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_LANECALIBRATOR, SUMO_ATTR_ROUTEPROBE, abort); + // extra check for center element after creation + bool centerAfterCreation = attrs.hasAttribute(GNE_ATTR_CENTER_AFTER_CREATION); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_LANECALIBRATOR, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_CALIBRATOR) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_CALIBRATOR) + " '" + id + "' is not known."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildCalibrator(net, allowUndoRedo, id, lane, position, name, outfile, freq, routeProbe, centerAfterCreation); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + } else { + WRITE_WARNING("additional " + toString(SUMO_TAG_CALIBRATOR) + " must have either a lane or an edge attribute."); + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorE1(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of E1 + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_E1DETECTOR, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_LANE, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_POSITION, abort); + SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FREQUENCY, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FILE, abort); + std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_VTYPES, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_NAME, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E1DETECTOR, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_E1DETECTOR, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_E1DETECTOR) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_E1DETECTOR) + " '" + id + "' is not known."); + } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_E1DETECTOR) + " with ID = '" + id + "'."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildDetectorE1(net, allowUndoRedo, id, lane, position, frequency, file, vehicleTypes, name, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorE2(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + // Tag E2 detectors can build either E2 single lanes or E2 multilanes, depending of attribute "lanes" + SumoXMLTag E2Tag = attrs.hasAttribute(SUMO_ATTR_LANES) ? SUMO_TAG_E2DETECTOR_MULTILANE : SUMO_TAG_E2DETECTOR; + bool abort = false; + // start parsing ID + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", E2Tag, SUMO_ATTR_ID, abort); + // parse attributes of E2 SingleLanes + std::string laneId = (E2Tag == SUMO_TAG_E2DETECTOR) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LANE, abort) : ""; + double length = (E2Tag == SUMO_TAG_E2DETECTOR) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LENGTH, abort) : 0; + // parse attributes of E2 Multilanes + std::string laneIds = (E2Tag == SUMO_TAG_E2DETECTOR_MULTILANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_LANES, abort) : ""; + double endPos = (E2Tag == SUMO_TAG_E2DETECTOR_MULTILANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_ENDPOS, abort) : 0; + // parse common attributes + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_POSITION, abort); + SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FREQUENCY, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FILE, abort); + std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_VTYPES, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_NAME, abort); + SUMOTime haltingTimeThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_HALTING_TIME_THRESHOLD, abort); + double haltingSpeedThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_HALTING_SPEED_THRESHOLD, abort); + double jamDistThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_JAM_DIST_THRESHOLD, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // cont attribute is deprecated + GNEAttributeCarrier::parseAttributeFromXML(attrs, id, E2Tag, SUMO_ATTR_CONT, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // check if at leas lane or laneIDS are defined + if (laneId.empty() && laneIds.empty()) { + WRITE_WARNING("A " + toString(E2Tag) + " needs at least a lane or a list of lanes."); + } else { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // get list of lanes + std::vector lanes; + bool laneConsecutives = true; + if (GNEAttributeCarrier::canParse >(net, laneIds, false)) { + lanes = GNEAttributeCarrier::parse >(net, laneIds); + // check if lanes are consecutives + laneConsecutives = GNEAttributeCarrier::lanesConsecutives(lanes); + } + // check that all elements are valid + if (net->retrieveAdditional(E2Tag, id, false) != nullptr) { + // write error if neither lane nor lane aren't defined + WRITE_WARNING("There is another " + toString(E2Tag) + " with the same ID='" + id + "'."); + } else if (attrs.hasAttribute(SUMO_ATTR_LANE) && (lane == nullptr)) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(E2Tag) + " '" + id + "' is not known."); + } else if (attrs.hasAttribute(SUMO_ATTR_LANES) && lanes.empty()) { + // Write error if lane isn't valid + WRITE_WARNING("The list of lanes cannot be empty."); + } else if (attrs.hasAttribute(SUMO_ATTR_LANES) && lanes.empty()) { + // Write error if lane isn't valid + WRITE_WARNING("The list of lanes '" + laneIds + "' to use within the " + toString(E2Tag) + " '" + id + "' isn't valid."); + } else if (!lanes.empty() && !laneConsecutives) { + WRITE_WARNING("The lanes '" + laneIds + "' to use within the " + toString(E2Tag) + " '" + id + "' aren't consecutives."); + } else if (lane && !fixE2DetectorPosition(position, length, lane->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(E2Tag) + " with ID = '" + id + "'."); + } else if (!lanes.empty() && !fixE2DetectorPosition(position, length, lanes.front()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(E2Tag) + " with ID = '" + id + "'."); + } else if (!lanes.empty() && !fixE2DetectorPosition(endPos, length, lanes.back()->getParentEdge()->getNBEdge()->getFinalLength(), friendlyPos)) { + WRITE_WARNING("Invalid end position for " + toString(E2Tag) + " with ID = '" + id + "'."); + } else if (lane) { + // save ID of last created element + GNEAdditional* additionalCreated = buildSingleLaneDetectorE2(net, allowUndoRedo, id, lane, position, length, frequency, file, vehicleTypes, + name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildMultiLaneDetectorE2(net, allowUndoRedo, id, lanes, position, endPos, frequency, file, vehicleTypes, + name, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorE3(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of E3 + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_E3DETECTOR, SUMO_ATTR_ID, abort); + SUMOTime frequency = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_FREQUENCY, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_FILE, abort); + std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_VTYPES, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_NAME, abort); + SUMOTime haltingTimeThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_HALTING_TIME_THRESHOLD, abort); + double haltingSpeedThreshold = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_HALTING_SPEED_THRESHOLD, abort); + Position pos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, SUMO_ATTR_POSITION, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_E3DETECTOR, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_E3DETECTOR, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_E3DETECTOR) + " with the same ID='" + id + "'."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildDetectorE3(net, allowUndoRedo, id, pos, frequency, file, vehicleTypes, name, haltingTimeThreshold, haltingSpeedThreshold, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorEntry(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Entry + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_LANE, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_POSITION, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_ENTRY, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Check if parsing of parameters was correct + if (!abort) { + // get lane and E3 parent + GNELane* lane = net->retrieveLane(laneId, false, true); + GNEAdditional* E3Parent = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + E3Parent = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_E3DETECTOR); + } else { + bool ok = true; + E3Parent = net->retrieveAdditional(SUMO_TAG_E3DETECTOR, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (lane == nullptr) { + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_DET_ENTRY) + " is not known."); + } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_DET_ENTRY) + "."); + } else if (E3Parent) { + // save ID of last created element + GNEAdditional* additionalCreated = buildDetectorEntry(net, allowUndoRedo, E3Parent, lane, position, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorExit(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of Exit + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_LANE, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_POSITION, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DET_EXIT, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Check if parsing of parameters was correct + if (!abort) { + // get lane and E3 parent + GNELane* lane = net->retrieveLane(laneId, false, true); + GNEAdditional* E3Parent = nullptr; + // obtain parent depending if we're loading or creating it using GNEAdditionalFrame + if (insertedAdditionals) { + E3Parent = insertedAdditionals->getAdditionalParent(net, SUMO_TAG_E3DETECTOR); + } else { + bool ok = true; + E3Parent = net->retrieveAdditional(SUMO_TAG_E3DETECTOR, attrs.get(GNE_ATTR_PARENT, "", ok)); + } + // check that all parameters are valid + if (lane == nullptr) { + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_DET_EXIT) + " is not known."); + } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_DET_EXIT) + "."); + } else if (E3Parent) { + // save ID of last created element + GNEAdditional* additionalCreated = buildDetectorExit(net, allowUndoRedo, E3Parent, lane, position, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + + +bool +GNEAdditionalHandler::parseAndBuildDetectorE1Instant(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals) { + bool abort = false; + // parse attributes of E1Instant + std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_ID, abort); + std::string laneId = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_LANE, abort); + double position = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_POSITION, abort); + std::string file = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_FILE, abort); + std::string vehicleTypes = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_VTYPES, abort); + std::string name = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_NAME, abort); + bool friendlyPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, SUMO_ATTR_FRIENDLY_POS, abort); + // parse Netedit attributes + bool blockMovement = false; + if (attrs.hasAttribute(GNE_ATTR_BLOCK_MOVEMENT)) { + blockMovement = GNEAttributeCarrier::parseAttributeFromXML(attrs, id, SUMO_TAG_INSTANT_INDUCTION_LOOP, GNE_ATTR_BLOCK_MOVEMENT, abort); + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to lane + GNELane* lane = net->retrieveLane(laneId, false, true); + // check that all elements are valid + if (net->retrieveAdditional(SUMO_TAG_INSTANT_INDUCTION_LOOP, id, false) != nullptr) { + WRITE_WARNING("There is another " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with the same ID='" + id + "'."); + } else if (lane == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The lane '" + laneId + "' to use within the " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " '" + id + "' is not known."); + } else if (!checkAndFixDetectorPosition(position, lane->getLaneShapeLength(), friendlyPos)) { + WRITE_WARNING("Invalid position for " + toString(SUMO_TAG_INSTANT_INDUCTION_LOOP) + " with ID = '" + id + "'."); + } else { + // save ID of last created element + GNEAdditional* additionalCreated = buildDetectorE1Instant(net, allowUndoRedo, id, lane, position, file, vehicleTypes, name, friendlyPos, blockMovement); + // check if insertion has to be commited + if (insertedAdditionals) { + insertedAdditionals->commitAdditionalInsertion(additionalCreated); + } + return true; + } + } + return false; +} + +// =========================================================================== +// private method definitions +// =========================================================================== + +void +GNEAdditionalHandler::parseAndBuildPoly(const SUMOSAXAttributes& attrs) { + bool abort = false; + // parse attributes of polygons + std::string polygonID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POLY, SUMO_ATTR_ID, abort); + PositionVector shape = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_SHAPE, abort); + double layer = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_LAYER, abort); + bool fill = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POLY, SUMO_ATTR_FILL, abort); + double lineWidth = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_LINEWIDTH, abort); + std::string type = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_TYPE, abort); + RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_COLOR, abort); + double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_ANGLE, abort); + std::string imgFile = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_IMGFILE, abort); + bool relativePath = GNEAttributeCarrier::parseAttributeFromXML(attrs, polygonID, SUMO_TAG_POLY, SUMO_ATTR_RELATIVEPATH, abort); + // check if ID is valid + if (SUMOXMLDefinitions::isValidTypeID(polygonID) == false) { + WRITE_WARNING("Invalid characters for polygon ID"); + abort = true; + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // check if shape must be loaded as geo attribute + bool geo = false; + const GeoConvHelper* gch = myGeoConvHelper != nullptr ? myGeoConvHelper : &GeoConvHelper::getFinal(); + if (attrs.getOpt(SUMO_ATTR_GEO, polygonID.c_str(), abort, false)) { + geo = true; + bool success = true; + for (int i = 0; i < (int)shape.size(); i++) { + success &= gch->x2cartesian_const(shape[i]); + } + if (!success) { + WRITE_WARNING("Unable to project coordinates for polygon '" + polygonID + "'."); + return; + } + } + // check if img file is absolute + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + // create polygon, or show an error if polygon already exists + if (!myNet->getAttributeCarriers()->addPolygon(polygonID, type, color, layer, angle, imgFile, relativePath, shape, geo, fill, lineWidth, false)) { + WRITE_WARNING("Polygon with ID '" + polygonID + "' already exists."); + } else { + // commit shape element insertion + myLastInsertedElement->commitShapeInsertion(myNet->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY).at(polygonID)); + } + } +} + + +void +GNEAdditionalHandler::parseAndBuildPOI(const SUMOSAXAttributes& attrs) { + bool abort = false; + const SumoXMLTag POITag = attrs.hasAttribute(SUMO_ATTR_LANE) ? SUMO_TAG_POILANE : SUMO_TAG_POI; + // parse attributes of POIs + std::string POIID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_POI, SUMO_ATTR_ID, abort); + // POIs can be defined using a X,Y position,... + Position pos = attrs.hasAttribute(SUMO_ATTR_X) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_POSITION, abort) : Position::INVALID; + // ... a Lon-Lat,... + double lon = attrs.hasAttribute(SUMO_ATTR_LON) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LON, abort) : GNEAttributeCarrier::INVALID_POSITION; + double lat = attrs.hasAttribute(SUMO_ATTR_LAT) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LAT, abort) : GNEAttributeCarrier::INVALID_POSITION; + // .. or as Lane-PosLane + std::string laneID = attrs.hasAttribute(SUMO_ATTR_LANE) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_LANE, abort) : ""; + double lanePos = attrs.hasAttribute(SUMO_ATTR_POSITION) ? GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_POSITION, abort) : GNEAttributeCarrier::INVALID_POSITION; + double lanePosLat = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POILANE, SUMO_ATTR_POSITION_LAT, abort); + // continue with common parameters + double layer = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_LAYER, abort); + std::string type = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_TYPE, abort); + RGBColor color = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_COLOR, abort); + double angle = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_ANGLE, abort); + std::string imgFile = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_IMGFILE, abort); + bool relativePath = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_RELATIVEPATH, abort); + double width = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_WIDTH, abort); + double height = GNEAttributeCarrier::parseAttributeFromXML(attrs, POIID, SUMO_TAG_POI, SUMO_ATTR_HEIGHT, abort); + // check if ID is valid + if (SUMOXMLDefinitions::isValidTypeID(POIID) == false) { + WRITE_WARNING("Invalid characters for POI ID"); + abort = true; + } + // Continue if all parameters were sucesfully loaded + if (!abort) { + // check if img file is absolute + if (imgFile != "" && !FileHelpers::isAbsolute(imgFile)) { + imgFile = FileHelpers::getConfigurationRelative(getFileName(), imgFile); + } + // check if lane exist + if (laneID != "" && !myNet->retrieveLane(laneID, false)) { + WRITE_WARNING("The lane '" + laneID + "' to use within the PoI '" + POIID + "' is not known."); + return; + } + // check position + bool useGeo = false; + // if position is invalid, then is either a POILane or a GEOPoi + if (pos == Position::INVALID) { + // try computing x,y from lane,pos + if (laneID != "") { + // if LaneID is defined, then is a POILane + pos = getLanePos(POIID, laneID, lanePos, lanePosLat); + } else { + // try computing x,y from lon,lat + if (lat == GNEAttributeCarrier::INVALID_POSITION || lon == GNEAttributeCarrier::INVALID_POSITION) { + WRITE_WARNING("Either (x, y), (lon, lat) or (lane, pos) must be specified for PoI '" + POIID + "'."); + return; + } else if (!GeoConvHelper::getFinal().usingGeoProjection()) { + WRITE_WARNING("(lon, lat) is specified for PoI '" + POIID + "' but no geo-conversion is specified for the network."); + return; + } + // set GEO Position + pos.set(lon, lat); + useGeo = true; + if (!GeoConvHelper::getFinal().x2cartesian_const(pos)) { + WRITE_WARNING("Unable to project coordinates for PoI '" + POIID + "'."); + return; + } + } + } + // create POI, or show an error if POI already exists + if (!myNet->getAttributeCarriers()->addPOI(POIID, type, color, pos, useGeo, laneID, lanePos, lanePosLat, layer, angle, imgFile, relativePath, width, height, false)) { + WRITE_WARNING("POI with ID '" + POIID + "' already exists."); + } else { + // commit shape element insertion + myLastInsertedElement->commitShapeInsertion(myNet->getAttributeCarriers()->getShapes().at(POITag).at(POIID)); + } + } +} + + +void +GNEAdditionalHandler::parseParameter(const SUMOSAXAttributes& attrs) { + // we have two cases: if we're parsing a Shape or we're parsing an Additional + if (getLastParameterised()) { + bool ok = true; + std::string key; + if (attrs.hasAttribute(SUMO_ATTR_KEY)) { + // obtain key + key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); + if (key.empty()) { + WRITE_WARNING("Error parsing key from shape parameter. Key cannot be empty"); + ok = false; + } + if (!SUMOXMLDefinitions::isValidTypeID(key)) { + WRITE_WARNING("Error parsing key from shape parameter. Key contains invalid characters"); + ok = false; + } + } else { + WRITE_WARNING("Error parsing key from shape parameter. Key doesn't exist"); + ok = false; + } + // circumventing empty string test + const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; + if (!SUMOXMLDefinitions::isValidAttribute(val)) { + WRITE_WARNING("Error parsing value from shape parameter. Value contains invalid characters"); + ok = false; + } + // set parameter in last inserted additional + if (ok) { + WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into shape."); + getLastParameterised()->setParameter(key, val); + } + } else if (myLastInsertedElement->getLastInsertedAdditional()) { + // first check if given additional supports parameters + if (myLastInsertedElement->getLastInsertedAdditional()->getTagProperty().hasParameters()) { + bool ok = true; + std::string key; + if (attrs.hasAttribute(SUMO_ATTR_KEY)) { + // obtain key + key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); + if (key.empty()) { + WRITE_WARNING("Error parsing key from additional parameter. Key cannot be empty"); + ok = false; + } + if (!SUMOXMLDefinitions::isValidTypeID(key)) { + WRITE_WARNING("Error parsing key from additional parameter. Key contains invalid characters"); + ok = false; + } + } else { + WRITE_WARNING("Error parsing key from additional parameter. Key doesn't exist"); + ok = false; + } + // circumventing empty string test + const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; + if (!SUMOXMLDefinitions::isValidAttribute(val)) { + WRITE_WARNING("Error parsing value from additional parameter. Value contains invalid characters"); + ok = false; + } + // check double values + if (myLastInsertedElement->getLastInsertedAdditional()->getTagProperty().hasDoubleParameters() && !GNEAttributeCarrier::canParse(val)) { + WRITE_WARNING("Error parsing value from additional float parameter. Value cannot be parsed to float"); + ok = false; + } + // set parameter in last inserted additional + if (ok) { + WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into additional " + myLastInsertedElement->getLastInsertedAdditional()->getTagStr() + "."); + myLastInsertedElement->getLastInsertedAdditional()->setParameter(key, val); + } + } else { + WRITE_WARNING("Additionals of type '" + myLastInsertedElement->getLastInsertedAdditional()->getTagStr() + "' doesn't support parameters"); + } + } else if (myLastInsertedElement->getLastInsertedShape()) { + // first check if given shape supports parameters + if (myLastInsertedElement->getLastInsertedShape()->getTagProperty().hasParameters()) { + bool ok = true; + std::string key; + if (attrs.hasAttribute(SUMO_ATTR_KEY)) { + // obtain key + key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); + if (key.empty()) { + WRITE_WARNING("Error parsing key from shape parameter. Key cannot be empty"); + ok = false; + } + if (!SUMOXMLDefinitions::isValidTypeID(key)) { + WRITE_WARNING("Error parsing key from shape parameter. Key contains invalid characters"); + ok = false; + } + } else { + WRITE_WARNING("Error parsing key from shape parameter. Key doesn't exist"); + ok = false; + } + // circumventing empty string test + const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; + if (!SUMOXMLDefinitions::isValidAttribute(val)) { + WRITE_WARNING("Error parsing value from shape parameter. Value contains invalid characters"); + ok = false; + } + // check double values + if (myLastInsertedElement->getLastInsertedShape()->getTagProperty().hasDoubleParameters() && !GNEAttributeCarrier::canParse(val)) { + WRITE_WARNING("Error parsing value from shape float parameter. Value cannot be parsed to float"); + ok = false; + } + // set parameter in last inserted shape + if (ok) { + WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into shape " + myLastInsertedElement->getLastInsertedShape()->getTagStr() + "."); + myLastInsertedElement->getLastInsertedShape()->setParameter(key, val); + } + } else { + WRITE_WARNING("Shape of type '" + myLastInsertedElement->getLastInsertedAdditional()->getTagStr() + "' doesn't support parameters"); + } + } else { + WRITE_WARNING("Parameters has to be declared within the definition of an additional or a shape element"); + } +} + +// =========================================================================== +// GNEAdditionalHandler::LastInsertedElement method definitions +// =========================================================================== + +void +GNEAdditionalHandler::LastInsertedElement::insertElement(SumoXMLTag tag) { + myInsertedElements.push_back(StackElement(tag)); +} + + +void +GNEAdditionalHandler::LastInsertedElement::commitAdditionalInsertion(GNEAdditional* additional) { + myInsertedElements.back().additional = additional; +} + + +void +GNEAdditionalHandler::LastInsertedElement::commitShapeInsertion(GNEShape* shapeCreated) { + myInsertedElements.back().shape = shapeCreated; +} + + +void +GNEAdditionalHandler::LastInsertedElement::popElement() { + if (!myInsertedElements.empty()) { + myInsertedElements.pop_back(); + } +} + + +GNEAdditional* +GNEAdditionalHandler::LastInsertedElement::getAdditionalParent(GNENet* net, SumoXMLTag expectedTag) const { + if (myInsertedElements.size() < 2) { + // currently we're finding parent additional in the additional XML root + WRITE_WARNING("A " + toString(myInsertedElements.back().tag) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else { + if (myInsertedElements.size() < 2) { + // additional was hierarchically bad loaded, then return nullptr + return nullptr; + } else if ((myInsertedElements.end() - 2)->additional == nullptr) { + WRITE_WARNING(toString(expectedTag) + " parent of " + toString((myInsertedElements.end() - 1)->tag) + " was not loaded sucesfully."); + // parent additional wasn't sucesfully loaded, then return nullptr + return nullptr; + } + GNEAdditional* retrievedAdditional = net->retrieveAdditional((myInsertedElements.end() - 2)->tag, (myInsertedElements.end() - 2)->additional->getID(), false); + if (retrievedAdditional == nullptr) { + // additional doesn't exist + WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->tag) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else if (retrievedAdditional->getTagProperty().getTag() != expectedTag) { + // invalid parent additional + WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->tag) + " cannot be declared within the definition of a " + retrievedAdditional->getTagStr() + "."); + return nullptr; + } else { + return retrievedAdditional; + } + } +} + + + +GNEShape* +GNEAdditionalHandler::LastInsertedElement::getShapeParent(GNENet* net, SumoXMLTag expectedTag) const { + if (myInsertedElements.size() < 2) { + // currently we're finding parent shape in the shape XML root + WRITE_WARNING("A " + toString(myInsertedElements.back().tag) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else { + if (myInsertedElements.size() < 2) { + // shape was hierarchically bad loaded, then return nullptr + return nullptr; + } else if ((myInsertedElements.end() - 2)->shape == nullptr) { + WRITE_WARNING(toString(expectedTag) + " parent of " + toString((myInsertedElements.end() - 1)->tag) + " was not loaded sucesfully."); + // parent shape wasn't sucesfully loaded, then return nullptr + return nullptr; + } + GNEShape* retrievedShape = net->retrieveShape((myInsertedElements.end() - 2)->tag, (myInsertedElements.end() - 2)->shape->getID(), false); + if (retrievedShape == nullptr) { + // shape doesn't exist + WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->tag) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else if (retrievedShape->getTagProperty().getTag() != expectedTag) { + // invalid parent shape + WRITE_WARNING("A " + toString((myInsertedElements.end() - 1)->tag) + " cannot be declared within the definition of a " + retrievedShape->getTagStr() + "."); + return nullptr; + } else { + return retrievedShape; + } + } +} + +GNEAdditional* +GNEAdditionalHandler::LastInsertedElement::getLastInsertedAdditional() const { + // ierate in reverse mode over myInsertedElements to obtain last inserted additional + for (std::vector::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) { + // we need to avoid Tag Param because isn't an additional + if (i->tag != SUMO_TAG_PARAM) { + return i->additional; + } + } + return nullptr; +} + + +GNEShape* +GNEAdditionalHandler::LastInsertedElement::getLastInsertedShape() const { + // ierate in reverse mode over myInsertedElements to obtain last inserted shape + for (std::vector::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) { + // we need to avoid Tag Param because isn't a shape + if (i->tag != SUMO_TAG_PARAM) { + return i->shape; + } + } + return nullptr; +} + + +GNEAdditionalHandler::LastInsertedElement::StackElement::StackElement(SumoXMLTag _tag) : + tag(_tag), + additional(nullptr), + shape(nullptr) { +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEAdditionalHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,776 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditionalHandler.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// Builds additional objects for netedit +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNENet; +class GNEEdge; +class GNELane; +class GNEAdditional; +class GNEShape; +class GNEDemandElement; + +// =========================================================================== +// class definitions +// =========================================================================== + +/// @class GNEAdditionalHandler +/// @brief Builds additional objects for GNENet (busStops, chargingStations, detectors, etc..) +class GNEAdditionalHandler : public ShapeHandler { +public: + + /// @brief Stack used to save the last inserted element + class LastInsertedElement { + + public: + /// @brief insert new element (called only in function myStartElement) + void insertElement(SumoXMLTag tag); + + /// @brief commit additional element insertion (used to save last correct created element) + void commitAdditionalInsertion(GNEAdditional* additionalCreated); + + /// @brief commit shape element insertion (used to save last correct created element) + void commitShapeInsertion(GNEShape* shapeCreated); + + /// @brief pop last inserted element (used only in function myEndElement) + void popElement(); + + /// @brief retrieve parent additional correspond to current status of myInsertedElements + GNEAdditional* getAdditionalParent(GNENet* net, SumoXMLTag expectedTag) const; + + /// @brief retrieve parent shape correspond to current status of myInsertedElements + GNEShape* getShapeParent(GNENet* net, SumoXMLTag expectedTag) const; + + /// @brief return last inserted additional + GNEAdditional* getLastInsertedAdditional() const; + + /// @brief return last inserted shape + GNEShape* getLastInsertedShape() const; + + private: + /// @brief stack element + struct StackElement { + /// @brief constructor + StackElement(SumoXMLTag _tag); + + /// @brief tag + SumoXMLTag tag; + + /// @brief additional + GNEAdditional* additional; + + /// @brief shape + GNEShape* shape; + }; + + /// @brief vector used as stack + std::vector myInsertedElements; + }; + + /// @brief Constructor + GNEAdditionalHandler(const std::string& file, GNENet* net, GNEAdditional* additionalParent = nullptr); + + /// @brief Destructor + ~GNEAdditionalHandler(); + + /// @name inherited from ShapeHandler + /// @{ + /**@brief Called on the opening of a tag; + * @param[in] element ID of the currently opened element + * @param[in] attrs Attributes within the currently opened element + * @exception ProcessError If something fails + * @see GenericSAXHandler::myStartElement + */ + void myStartElement(int element, const SUMOSAXAttributes& attrs); + + /** @brief Called when a closing tag occurs + * @param[in] element ID of the currently opened element + * @exception ProcessError If something fails + * @see GenericSAXHandler::myEndElement + */ + void myEndElement(int element); + + /**@brief get lane position + * @param[in] poi poi ID + * @param[in] laneID lane ID + * @param[in] SlanePos position in the lane + */ + Position getLanePos(const std::string& poiID, const std::string& laneID, double lanePos, double lanePosLat); + /// @} + + /// @name building methods + /// + /// Called with parsed values, these methods build the additional. + /// @{ + /**@brief Build additionals + * @param[in] net pointer to net in wich additional will be created + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] tag tag of the additiona lto create + * @param[in] attrs SUMOSAXAttributes with attributes + * @param[in] LastInsertedElement pointer to LastInsertedElement (can be null) + * @return true if was sucesfully created, false in other case + */ + static bool buildAdditional(GNENet* net, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Builds a bus stop + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the bus stop + * @param[in] lane The lane the bus stop is placed on + * @param[in] startPos Begin position of the bus stop on the lane + * @param[in] endPos End position of the bus stop on the lane + * @param[in] name Name of busStop + * @param[in] lines Names of the bus lines that halt on this bus stop + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the bus stop can not be added to the net (is duplicate) + */ + static GNEAdditional* buildBusStop(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, + const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, int personCapacity, double parkingLength, + bool friendlyPosition, bool blockMovement); + + /**@brief Builds an Access + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] busStop GNEAdditional of this Access belongs + * @param[in] lane The lane the Access is placed on + * @param[in] pos position of the Access on the lane + * @param[in[ length length of the Access + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildAccess(GNENet* net, bool allowUndoRedo, GNEAdditional* busStop, GNELane* lane, double pos, const std::string& length, bool friendlyPos, bool blockMovement); + + /**@brief Builds a container stop + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the container stop + * @param[in] lane The lane the container stop is placed on + * @param[in] startPos Begin position of the container stop on the lane + * @param[in] endPos End position of the container stop on the lane + * @param[in] name Name of container stop + * @param[in] lines Names of the bus lines that halt on this container stop + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the container stop can not be added to the net (is duplicate) + */ + static GNEAdditional* buildContainerStop(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement); + + /**@brief Builds a charging Station + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the charging Station + * @param[in] lane The lane the charging Station is placed on + * @param[in] startPos Begin position of the charging Station on the lane + * @param[in] endPos End position of the charging Station on the lane + * @param[in] name Name of charging station + * @param[in] chargingPower power charged in every timeStep + * @param[in] efficiency efficiency of the charge + * @param[in] chargeInTransit enable or disable charge in transit + * @param[in] chargeDelay delay in the charge + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) + */ + static GNEAdditional* buildChargingStation(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement); + + /**@brief Builds a Parking Area + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the Parking >Area + * @param[in] lane The lane the Parking Area is placed on + * @param[in] startPos Begin position of the Parking Area on the lane + * @param[in] endPos End position of the Parking Area on the lane + * @param[in] name Name of Parking Area + * @param[in] friendlyPos enable or disable friendly position + * @param[in] roadSideCapacity road side capacity of ParkingArea + * @param[in] width ParkingArea's length + * @param[in] length ParkingArea's length + * @param[in] angle ParkingArea's angle + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) + */ + static GNEAdditional* buildParkingArea(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, const double startPos, const double endPos, const int parametersSet, + const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement); + + /**@brief Builds a Parking Space + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] parkingAreaParent Pointer to Parking Area Parent + * @param[in] pos ParkingSpace's X-Y position + * @param[in] width ParkingArea's width + * @param[in] length ParkingArea's length + * @param[in] angle ParkingArea's angle + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the charging Station can not be added to the net (is duplicate) + */ + static GNEAdditional* buildParkingSpace(GNENet* net, bool allowUndoRedo, GNEAdditional* parkingAreaParent, Position pos, double width, double length, double angle, bool blockMovement); + + /**@brief Builds a induction loop detector (E1) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the detector + * @param[in] lane The lane the detector is placed on + * @param[in] pos position of the detector on the lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vtypes list of vehicle types to be reported + * @param[in] name E2 detector name + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildDetectorE1(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); + + /**@brief Builds a single-lane Area Detector (E2) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the detector + * @param[in] lane The lane the detector is placed on + * @param[in] pos position of the detector on the lane + * @param[in[ length length of the detector + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vtypes list of vehicle types to be reported + * @param[in] name E2 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildSingleLaneDetectorE2(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, double length, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); + + /**@brief Builds a multi-lane Area Detector (E2) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the detector + * @param[in] lanes The lanes the detector is placed on + * @param[in] pos position of the detector on the first lane + * @param[in] endPos position of the detector on the last lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vtypes list of vehicle types to be reported + * @param[in] name E2 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildMultiLaneDetectorE2(GNENet* net, bool allowUndoRedo, const std::string& id, const std::vector& lanes, double pos, double endPos, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); + + /**@brief Builds a multi entry exit detector (E3) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the detector + * @param[in] pos position of the detector in the map + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vtypes list of vehicle types to be reported + * @param[in] name E2 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildDetectorE3(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement); + + /**@brief Builds a entry detector (E3) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] E3Parent pointer to E3 detector parent + * @param[in] lane The lane in which the entry detector is placed on + * @param[in] pos position of the entry detector on the lane + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the entry detector can not be added to the net (invalid parent or lane) + */ + static GNEAdditional* buildDetectorEntry(GNENet* net, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); + + /**@brief Builds a exit detector (E3) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] E3Parent pointer to E3 detector parent + * @param[in] lane The lane in which the exit detector is placed on + * @param[in] pos position of the exit detector on the lane + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the exit detector can not be added to the net (invalid parent or lane + */ + static GNEAdditional* buildDetectorExit(GNENet* net, bool allowUndoRedo, GNEAdditional* E3Parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); + + /**@brief Builds a Instant Induction Loop Detector (E1Instant) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the detector + * @param[in] lane The lane the detector is placed on + * @param[in] pos position of the detector on the lane + * @param[in] filename The path to the output file. + * @param[in] name E2 detector name + * @param[in] vtypes list of vehicle types to be reported + * @param[in] friendlyPos enable or disable friendly position + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildDetectorE1Instant(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); + + /**@brief builds a microscopic calibrator over a lane + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the calibrator + * @param[in] lane The lane the calibrator is placed at + * @param[in] pos The position on the edge the calibrator lies at + * @param[in] name Calibrator name + * @param[in] outfile te file in which write results + * @param[in] centerAfterCreation center camera after creation + * @return true if was sucesfully created, false in other case + * @todo Is the position correct/needed + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the entry detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildCalibrator(GNENet* net, bool allowUndoRedo, const std::string& id, GNELane* lane, double pos, const std::string& name, const std::string& outfile, SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation); + + /**@brief builds a microscopic calibrator over an edge + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the calibrator + * @param[in] edge The edge the calibrator is placed at + * @param[in] pos The position on the edge the calibrator lies at + * @param[in] name Calibrator name + * @param[in] outfile te file in which write results + * @param[in] centerAfterCreation center camera after creation + * @param[in] routeProbe route probe vinculated with this calibrator + * @return true if was sucesfully created, false in other case + * @todo Is the position correct/needed + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the entry detector can not be added to the net (is duplicate) + */ + static GNEAdditional* buildCalibrator(GNENet* net, bool allowUndoRedo, const std::string& id, GNEEdge* edge, double pos, const std::string& name, const std::string& outfile, SUMOTime freq, const std::string& routeprobe, bool centerAfterCreation); + + /**@brief builds a calibrator flow + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] type The id of the vehicle's flow type to use for this vehicle's flow. + * @param[in] route The id of the route the vehicle's flow shall drive along + * @param[in] vehsPerHour number of vehicles per hour, equally spaced (not together with period or probability) + * @param[in] speed The speed with which the vehicles shall enter the network. NOTE: this attribute is exclusive of CalibratorFlows! + * @param[in] color This vehicle's flow's color + * @param[in] departLane The lane on which the vehicle's flow shall be inserted; see #departLane. default: "first" + * @param[in] departPos The position at which the vehicle's flow shall enter the net; see #departPos. default: "base" + * @param[in] departSpeed The speed with which the vehicle's flow shall enter the network; see #departSpeed. default: 0 + * @param[in] arrivalLane The lane at which the vehicle's flow shall leave the network; see #arrivalLane. default: "current" + * @param[in] arrivalPos The position at which the vehicle's flow shall leave the network; see #arrivalPos. default: "max" + * @param[in] arrivalSpeed The speed with which the vehicle's flow shall leave the network; see #arrivalSpeed. default: "current" + * @param[in] line A string specifying the id of a public transport line which can be used when specifying person rides + * @param[in] personNumber The number of occupied seats when the vehicle's flow is inserted. default: 0 + * @param[in] containerNumber The number of occupied container places when the vehicle's flow is inserted. default: 0 + * @param[in] reroute List of intermediate edges that shall be passed on rerouting. + * @param[in] via List of intermediate edges that shall be passed on rerouting. + * @param[in] departPosLat The lateral position on the departure lane at which the vehicle's flow shall enter the net; see Simulation/SublaneModel. default: "center" + * @param[in] arrivalPosLat The lateral position on the arrival lane at which the vehicle's flow shall arrive; see Simulation/SublaneModel. by default the vehicle's flow does not care about lateral arrival position + * @param[in] begin first vehicle's flow departure time + * @param[in] end end of departure interval (if undefined, defaults to 24 hours) + * @return true if was sucesfully created, false in other case + */ + static GNEAdditional* buildCalibratorFlow(GNENet* net, bool allowUndoRedo, GNEAdditional* calibratorParent, GNEDemandElement* route, GNEDemandElement* vType, + const std::string& vehsPerHour, const std::string& speed, const RGBColor& color, const std::string& departLane, const std::string& departPos, + const std::string& departSpeed, const std::string& arrivalLane, const std::string& arrivalPos, const std::string& arrivalSpeed, + const std::string& line, int personNumber, int containerNumber, bool reroute, const std::string& departPosLat, + const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end); + + /**@brief builds a rerouter + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the rerouter + * @param[in] pos position of the rerouter in the map + * @param[in] edges The edges the rerouter is placed at + * @param[in] prob The probability the rerouter reoutes vehicles with + * @param[in] name Calibrator name + * @param[in] file The file to read the reroute definitions from + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + */ + static GNEAdditional* buildRerouter(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& edges, double prob, const std::string& name, const std::string& file, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement); + + /**@brief builds a rerouter interval + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] rerouterParent rerouter in which interval is placed + * @param[in] begin begin of interval + * @param[in] end end of interval + * @return true if was sucesfully created, false in other case + */ + static GNEAdditional* buildRerouterInterval(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end); + + /** + DOCUMENTAR + */ + static GNEAdditional* buildClosingLaneReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions); + + /** + DOCUMENTAR + */ + static GNEAdditional* buildClosingReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions); + + /** + DOCUMENTAR + */ + static GNEAdditional* builDestProbReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability); + + /** + DOCUMENTAR + */ + static GNEAdditional* builParkingAreaReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkignArea, double probability, bool visible); + + /** + DOCUMENTAR + */ + static GNEAdditional* buildRouteProbReroute(GNENet* net, bool allowUndoRedo, GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability); + + /**@brief builds a Route probe + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the routeprobe + * @param[in] edge The edges the routeprobe is placed at + * @param[in] freq the aggregation period the values the routeprobe collects shall be summed up. + * @param[in] name Calibrator name + * @param[in] file The file to read the routeprobe definitions from + * @param[in] begin The time at which to start generating output + * @param[in] centerAfterCreation center camera after creation + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the Route Probe can not be added to the net (is duplicate) + */ + static GNEAdditional* buildRouteProbe(GNENet* net, bool allowUndoRedo, const std::string& id, GNEEdge* edge, const std::string& freq, const std::string& name, const std::string& file, SUMOTime begin, bool centerAfterCreation); + + /**@brief Builds a VariableSpeedSign (lane speed additional) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id The id of the lane speed additional + * @param[in] destLanes List of lanes affected by this speed additional + * @param[in] name Calibrator name + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the VariableSpeedSign can not be added to the net (is duplicate) + */ + static GNEAdditional* buildVariableSpeedSign(GNENet* net, bool allowUndoRedo, const std::string& id, Position pos, const std::vector& destLanes, const std::string& name, bool blockMovement); + + /**@brief Builds a VariableSpeedSign Step + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] VSSParent Variable Speed Sign parent + * @param[in] time step's time + * @param[in] speed step's speed + * @return true if was sucesfully created, false in other case + * @exception InvalidArgument If the Variable Speed Sign Step can not be added to the net (is duplicate) + */ + static GNEAdditional* buildVariableSpeedSignStep(GNENet* net, bool allowUndoRedo, GNEAdditional* VSSParent, double time, double speed); + + /**@brief Builds a vaporizer (lane speed additional) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] edge edge in which this vaporizer is placed + * @param[in] startTime time in which this vaporizer start + * @param[in] endTime time in which this vaporizer ends + * @param[in] name Vaporizer name + * @param[in] centerAfterCreation center camera after creation + * @return true if was sucesfully created, false in other case + * @exception ProcessError If the XML definition file is errornous + */ + static GNEAdditional* buildVaporizer(GNENet* net, bool allowUndoRedo, GNEEdge* edge, SUMOTime start, SUMOTime endTime, const std::string& name, bool centerAfterCreation); + + /**@brief Builds a TAZ (Traffic Assignment Zone) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] id TAZ ID + * @param[in] shape TAZ shape + * @param[in] edges list of edges (note: This will create GNETAZSourceSinks/Sinks with default values) + * @param[in] blockMovemet enable or disable block movement + * @return true if was sucesfully created, false in other case + * @exception ProcessError If the XML definition file is errornous + */ + static GNEAdditional* buildTAZ(GNENet* net, bool allowUndoRedo, const std::string& id, const PositionVector& shape, const RGBColor& color, const std::vector& edges, bool blockMovement); + + /**@brief Builds a TAZSource (Traffic Assignment Zone) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] TAZ Traffic Assignment Zone in which this TAZSource is palced + * @param[in] ege edge in which TAZSource is placed + * @param[in] departWeight depart weight of TAZSource + * @return true if was sucesfully created, false in other case + * @exception ProcessError If the XML definition file is errornous + */ + static GNEAdditional* buildTAZSource(GNENet* net, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double departWeight); + + /**@brief Builds a TAZSink (Traffic Assignment Zone) + * @param[in] net net in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y + * @param[in] TAZ Traffic Assignment Zone in which this TAZSink is palced + * @param[in] ege edge in which TAZSink is placed + * @param[in] arrivalWeight arrival weight of TAZSink + * @return true if was sucesfully created, false in other case + * @exception ProcessError If the XML definition file is errornous + */ + static GNEAdditional* buildTAZSink(GNENet* net, bool allowUndoRedo, GNEAdditional* TAZ, GNEEdge* edge, double arrivalWeight); + + /**@brief extracts the position, checks whether it shall be mirrored and checks whether it is within the lane. + * @param[in] pos position of additional over lane + * @param[in] lane The lane the position shall be valid for + * @param[in] friendlyPos flag to indicate if friendlyPos is enabled + * @param[in] additionalID ID of additional + * @return The position on the lane + */ + double getPosition(double pos, GNELane& lane, bool friendlyPos, const std::string& additionalID); + + /**@brief check if the position of a detector over a lane is valid + * @param[in] pos pos position of detector + * @param[in] laneLength Length of the lane + * @param[in] friendlyPos Attribute of detector + * @return true if the detector position is valid, false in otherweise + */ + static bool checkAndFixDetectorPosition(double& pos, const double laneLength, const bool friendlyPos); + + /**@brief check if the position of a detector over a lane is valid + * @param[in] startPos Start position of detector + * @param[in] length length of detector + * @param[in] laneLength Length of the lane + * @param[in] friendlyPos Attribute of detector + * @return true if the detector position is valid, false in otherweise + */ + static bool fixE2DetectorPosition(double& pos, double& length, const double laneLength, const bool friendlyPos); + + /// @brief check if a GNEAccess can be created in a certain Edge + static bool accessCanBeCreated(GNEAdditional* busStopParent, GNEEdge* edge); + + /// @brief check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted + static bool checkOverlappingRerouterIntervals(GNEAdditional* rerouter, SUMOTime newBegin, SUMOTime newEnd); + +protected: + /// @name parsing methods + /// + /// These methods parse the attributes for each of the described additional + /// and call the according methods to build the additional + /// @{ + /**@brief Builds a Vaporizer + * @param[in] attrs SAX-attributes which define the vaporizer + */ + static bool parseAndBuildVaporizer(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Builds a TAZ + * @param[in] attrs SAX-attributes which define the vaporizer + */ + static bool parseAndBuildTAZ(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Builds a TAZ Source + * @param[in] attrs SAX-attributes which define the vaporizer + */ + static bool parseAndBuildTAZSource(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Builds a TAZ Sink + * @param[in] attrs SAX-attributes which define the vaporizer + */ + static bool parseAndBuildTAZSink(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Variable Speed Signal (GNENet *net, bool allowUndoRedo, lane speed additional) + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildVariableSpeedSign(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Variable Speed Signal Step + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildVariableSpeedSignStep(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a rerouter + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouter(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Rerouter Interval + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterInterval(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Closing Lane reroute + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterClosingLaneReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Closing Reroute + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterClosingReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Destiny Prob Reroute + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterDestProbReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a parkingAreaReroute + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterParkingAreaReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Route Prob Reroute + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRerouterRouteProbReroute(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a bus stop + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildBusStop(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses values and adds access to the current bus stop + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildAccess(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a container stop + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildContainerStop(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a charging station + * @param[in] attrs SAXattributes which define the additional + */ + static bool parseAndBuildChargingStation(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a parking area + * @param[in] attrs SAXattributes which define the additional + */ + static bool parseAndBuildParkingArea(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a parking space + * @param[in] attrs SAXattributes which define the additional + * @param[in] tag of the additional + */ + static bool parseAndBuildParkingSpace(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a mesoscopic or microscopic calibrator + * @param[in] attrs SAX-attributes which define the additional + * @param[in] tag of the additional + */ + static bool parseAndBuildCalibrator(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a induction loop detector (GNENet *net, bool allowUndoRedo, E1) + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorE1(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a lane area detector (GNENet *net, bool allowUndoRedo, E2) + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorE2(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a multi entry exit detector (GNENet *net, bool allowUndoRedo, E3) + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorE3(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Entry detector + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorEntry(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Exit detector + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorExit(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds a Instant induction loop detector (GNENet *net, bool allowUndoRedo, E1Instant) + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildDetectorE1Instant(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses his values and builds routeProbe + * @param[in] attrs SAX-attributes which define the additional + */ + static bool parseAndBuildRouteProbe(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /**@brief Parses flow values of Calibrators + * @param[in] attrs SAX-attributes which define the flows + */ + static bool parseAndBuildCalibratorFlow(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, LastInsertedElement* insertedAdditionals); + + /// @} + +private: + /**@brief Parses his values and builds a Poly + * @param[in] attrs SAX-attributes which define the Poly + */ + void parseAndBuildPoly(const SUMOSAXAttributes& attrs); + + /**@brief Parses his values and builds a POI + * @param[in] attrs SAX-attributes which define the shape + */ + void parseAndBuildPOI(const SUMOSAXAttributes& attrs); + + /**@brief Parse parameter and insert it in the last created additional + * @param[in] attrs SAX-attributes which define the parameter + */ + void parseParameter(const SUMOSAXAttributes& attrs); + + /// @brief pointer to net + GNENet* myNet; + + /// @brief LastInsertedElement used for insert children + LastInsertedElement* myLastInsertedElement; + + /// @brief invalidate copy constructor + GNEAdditionalHandler(const GNEAdditionalHandler& s) = delete; + + /// @brief invalidate assignment operator + GNEAdditionalHandler& operator=(const GNEAdditionalHandler& s) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEBusStop.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEBusStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEBusStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEBusStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,423 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEBusStop.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A lane area vehicles can halt at (GNE version) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEBusStop.h" + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEBusStop::GNEBusStop(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, int personCapacity, double parkingLength, bool friendlyPosition, bool blockMovement) : + GNEStoppingPlace(id, net, GLO_BUS_STOP, SUMO_TAG_BUS_STOP, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), + myLines(lines), + myPersonCapacity(personCapacity), + myParkingLength(parkingLength) +{ } + + +GNEBusStop::~GNEBusStop() {} + + +void +GNEBusStop::updateGeometry() { + // Get value of option "lefthand" + 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 shape to side + tmpShape.move2side(myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); + + // Get position of the sign + mySignPos = tmpShape.getLineCenter(); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set block icon rotation, and using their rotation for sign + myBlockIcon.setRotation(getParentLanes().front()); + + // obtain parent edge + const GNEEdge* edge = getParentLanes().front()->getParentEdge(); + + // update child demand elements geometry + for (const auto& i : getChildDemandElements()) { + // special case for person trips + if (i->getTagProperty().isPersonTrip()) { + // update previous and next person plan + GNEDemandElement* previousDemandElement = i->getParentDemandElements().front()->getPreviousChildDemandElement(i); + if (previousDemandElement) { + previousDemandElement->updatePartialGeometry(edge); + } + GNEDemandElement* nextDemandElement = i->getParentDemandElements().front()->getNextChildDemandElement(i); + if (nextDemandElement) { + nextDemandElement->updatePartialGeometry(edge); + } + } + i->updatePartialGeometry(edge); + } + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEBusStop::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getShape(), + myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.busStopWidth); +} + + +Boundary +GNEBusStop::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNEBusStop::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double busStopExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(busStopExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, getType()); + // Set color of the base + if (mySpecialColor) { + GLHelper::setColor(*mySpecialColor); + } else if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); + } + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GNEGeometry::drawGeometry(myNet->getViewNet(), myAdditionalGeometry, s.stoppingPlaceSettings.busStopWidth * busStopExaggeration); + // Check if the distance is enought to draw details and if is being drawn for selecting + if (s.drawForRectangleSelection) { + // only draw circle depending of distance between sign and mouse cursor + if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { + // Add a draw matrix for details + glPushMatrix(); + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(busStopExaggeration, busStopExaggeration, 1); + // set color + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // pop draw matrix + glPopMatrix(); + } + } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, busStopExaggeration)) { + // draw lines between BusStops and Acces + for (auto i : getChildAdditionals()) { + GLHelper::drawBoxLine(i->getAdditionalGeometry().getPosition(), + RAD2DEG(mySignPos.angleTo2D(i->getAdditionalGeometry().getPosition())) - 90, mySignPos.distanceTo2D(i->getAdditionalGeometry().getPosition()), .05); + } + // Add a draw matrix for details + glPushMatrix(); + // draw lines depending of detailSettings + if (s.drawDetail(s.detailSettings.stoppingPlaceText, busStopExaggeration) && !s.drawForPositionSelection) { + // Iterate over every line + for (int i = 0; i < (int)myLines.size(); ++i) { + // push a new matrix for every line + glPushMatrix(); + // Rotate and traslaste + glTranslated(mySignPos.x(), mySignPos.y(), 0); + glRotated(-1 * myBlockIcon.rotation, 0, 0, 1); + // draw line with a color depending of the selection status + if (drawUsingSelectColor()) { + GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT); + } else { + GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.stoppingPlaceSettings.busStopColor, 0, FONS_ALIGN_LEFT); + } + // pop matrix for every line + glPopMatrix(); + } + } + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(busStopExaggeration, busStopExaggeration, 1); + // Set color of the externe circle + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); + } + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // Traslate to front + glTranslated(0, 0, .1); + // Set color of the interne circle + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.busStopColorSign); + } + // draw another circle in the same position, but a little bit more small + GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); + // draw H depending of detailSettings + if (s.drawDetail(s.detailSettings.stoppingPlaceText, busStopExaggeration) && !s.drawForPositionSelection) { + if (drawUsingSelectColor()) { + GLHelper::drawText("H", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); + } else { + GLHelper::drawText("H", Position(), .1, myCircleInText, s.stoppingPlaceSettings.busStopColor, myBlockIcon.rotation); + } + } + // pop draw matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, busStopExaggeration); + } + // pop draw matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + drawName(getPositionInView(), s.scale, s.addName); + if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), busStopExaggeration, myDottedGeometry); + } + // Pop name + glPopName(); + // draw child demand elements + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPlacedInRTree()) { + i->drawGL(s); + } + } + } +} + + +std::string +GNEBusStop::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_STARTPOS: + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return toString(myStartPosition); + } else { + return ""; + } + case SUMO_ATTR_ENDPOS: + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return toString(myEndPosition); + } else { + return ""; + } + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case SUMO_ATTR_LINES: + return joinToString(myLines, " "); + case SUMO_ATTR_PERSON_CAPACITY: + return toString(myPersonCapacity); + case SUMO_ATTR_PARKING_LENGTH: + return toString(myParkingLength); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEBusStop::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: { + // change ID of BusStop + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Acces children + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_ACCESS), undoList); + } + break; + } + case SUMO_ATTR_LANE: + case SUMO_ATTR_STARTPOS: + case SUMO_ATTR_ENDPOS: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FRIENDLY_POS: + case SUMO_ATTR_LINES: + case SUMO_ATTR_PERSON_CAPACITY: + case SUMO_ATTR_PARKING_LENGTH: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEBusStop::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case SUMO_ATTR_LINES: + return canParse >(value); + case SUMO_ATTR_PERSON_CAPACITY: + return canParse(value) && (parse(value) > 0 || parse(value) == -1); + case SUMO_ATTR_PARKING_LENGTH: + return canParse(value) && (parse(value) >= 0); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEBusStop::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_STARTPOS: + if (!value.empty()) { + myStartPosition = parse(value); + myParametersSet |= STOPPINGPLACE_STARTPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; + } + break; + case SUMO_ATTR_ENDPOS: + if (!value.empty()) { + myEndPosition = parse(value); + myParametersSet |= STOPPINGPLACE_ENDPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; + } + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case SUMO_ATTR_LINES: + myLines = GNEAttributeCarrier::parse >(value); + break; + case SUMO_ATTR_PERSON_CAPACITY: + myPersonCapacity = GNEAttributeCarrier::parse(value); + break; + case SUMO_ATTR_PARKING_LENGTH: + myParkingLength = GNEAttributeCarrier::parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEBusStop.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEBusStop.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEBusStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEBusStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,118 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEBusStop.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A class for visualizing busStop geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include "GNEStoppingPlace.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEBusStop + * @brief A lane area vehicles can halt at (netedit-version) + */ +class GNEBusStop : public GNEStoppingPlace { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] startPos Start position of the StoppingPlace + * @param[in] endPos End position of the StoppingPlace + * @param[in] name Name of busStop + * @param[in] lines lines of the busStop + * @param[in] friendlyPos enable or disable friendly position + * @param[in] block movement enable or disable additional movement + */ + GNEBusStop(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, int personCapacity, double parkingLength, bool friendlyPosition, bool blockMovement); + + /// @brief Destructor + ~GNEBusStop(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /// @} + +protected: + /// @brief The list of lines that are assigned to this stop + std::vector myLines; + + /// @brief maximum number of persons that can wait at this stop + int myPersonCapacity; + + /// @brief custom space for vehicles that park at this stop + double myParkingLength; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEBusStop(const GNEBusStop&) = delete; + + /// @brief Invalidated assignment operator. + GNEBusStop& operator=(const GNEBusStop&) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibrator.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibrator.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibrator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,401 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECalibrator.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNECalibrator.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, GNEEdge* edge, double pos, SUMOTime frequency, + const std::string& name, const std::string& output, const std::string& routeprobe) : + GNEAdditional(id, net, GLO_CALIBRATOR, SUMO_TAG_CALIBRATOR, name, false, +{}, {edge}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPositionOverLane(pos), +myFrequency(frequency), +myOutput(output), +myRouteProbe(routeprobe) { +} + + +GNECalibrator::GNECalibrator(const std::string& id, GNENet* net, GNELane* lane, double pos, SUMOTime frequency, + const std::string& name, const std::string& output, const std::string& routeprobe) : + GNEAdditional(id, net, GLO_CALIBRATOR, SUMO_TAG_LANECALIBRATOR, name, false, +{}, {}, {lane}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPositionOverLane(pos), +myFrequency(frequency), +myOutput(output), +myRouteProbe(routeprobe) { +} + + +GNECalibrator::~GNECalibrator() {} + + +void +GNECalibrator::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNECalibrator::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNECalibrator::updateGeometry() { + // get shape depending of we have a edge or a lane + if (getParentLanes().size() > 0) { + // update geometry + myAdditionalGeometry.updateGeometry(getParentLanes().front(), myPositionOverLane); + } else if (getParentEdges().size() > 0) { + // update geometry of first edge + myAdditionalGeometry.updateGeometry(getParentEdges().front()->getLanes().front(), myPositionOverLane); + // clear extra geometries + myEdgeCalibratorGeometries.clear(); + // iterate over every lane and get point + for (int i = 1; i < (int)getParentEdges().front()->getLanes().size(); i++) { + // add new calibrator geometry + GNEGeometry::Geometry calibratorGeometry; + calibratorGeometry.updateGeometry(getParentEdges().front()->getLanes().at(i), myPositionOverLane); + myEdgeCalibratorGeometries.push_back(calibratorGeometry); + } + } else { + throw ProcessError("Both edges and lanes aren't defined"); + } + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void GNECalibrator::updateDottedContour() { + //GLHelper::drawShapeDottedContourRectangle(s, getType(), pos, 2.8, 6, rot, 0, 3); +} + + +Position +GNECalibrator::getPositionInView() const { + PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getLanes().at(0)->getLaneShape(); + if (myPositionOverLane < 0) { + return shape.front(); + } else if (myPositionOverLane > shape.length()) { + return shape.back(); + } else { + return shape.positionAtOffset(myPositionOverLane); + } +} + + +Boundary +GNECalibrator::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNECalibrator::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) { + if (splitPosition < myPositionOverLane) { + // change lane or edge + if (newElement->getTagProperty().getTag() == SUMO_TAG_LANE) { + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + } else { + setAttribute(SUMO_ATTR_EDGE, newElement->getID(), undoList); + } + // now adjust start position + setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); + } +} + + +std::string +GNECalibrator::getParentName() const { + // get parent name depending of we have a edge or a lane + if (getParentLanes().size() > 0) { + return getParentLanes().front()->getID(); + } else if (getParentEdges().size() > 0) { + return getParentEdges().front()->getLanes().at(0)->getID(); + } else { + throw ProcessError("Both myEdge and myLane aren't defined"); + } +} + + +void +GNECalibrator::drawGL(const GUIVisualizationSettings& s) const { + // get values + const double exaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // begin draw + glPushName(getGlID()); + glLineWidth(1.0); + // draw first symbol + drawCalibratorSymbol(s, exaggeration, myAdditionalGeometry.getPosition(), myAdditionalGeometry.getRotation()); + // continue with the other symbols + for (const auto& edgeCalibratorGeometry : myEdgeCalibratorGeometries) { + drawCalibratorSymbol(s, exaggeration, edgeCalibratorGeometry.getPosition(), edgeCalibratorGeometry.getRotation()); + } + // draw name + drawName(getPositionInView(), s.scale, s.addName); + // pop name + glPopName(); + } +} + + +void +GNECalibrator::openAdditionalDialog() { + // Open calibrator dialog + GNECalibratorDialog calibratorDialog(this); +} + + +std::string +GNECalibrator::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGE: + return getParentEdges().front()->getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_FREQUENCY: + return time2string(myFrequency); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_OUTPUT: + return myOutput; + case SUMO_ATTR_ROUTEPROBE: + return myRouteProbe; + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNECalibrator::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNECalibrator::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: + case SUMO_ATTR_EDGE: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_FREQUENCY: + case SUMO_ATTR_NAME: + case SUMO_ATTR_OUTPUT: + case SUMO_ATTR_ROUTEPROBE: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + +} + + +bool +GNECalibrator::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_EDGE: + if (myNet->retrieveEdge(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_POSITION: + if (canParse(value)) { + // obtain position and check if is valid + double newPosition = parse(value); + PositionVector shape = (getParentLanes().size() > 0) ? getParentLanes().front()->getLaneShape() : getParentEdges().front()->getLanes().at(0)->getLaneShape(); + if ((newPosition < 0) || (newPosition > shape.length())) { + return false; + } else { + return true; + } + } else { + return false; + } + case SUMO_ATTR_FREQUENCY: + return canParse(value); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_OUTPUT: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_ROUTEPROBE: + return SUMOXMLDefinitions::isValidAdditionalID(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNECalibrator::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNECalibrator::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNECalibrator::getHierarchyName() const { + return getTagStr(); +} + +// =========================================================================== +// private +// =========================================================================== + +void GNECalibrator::drawCalibratorSymbol(const GUIVisualizationSettings& s, const double exaggeration, const Position& pos, const double rot) const { + glPushMatrix(); + glTranslated(pos.x(), pos.y(), getType()); + glRotated(rot, 0, 0, 1); + glTranslated(0, 0, getType()); + glScaled(exaggeration, exaggeration, 1); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.additionalSettings.calibratorColor); + } + // base + glBegin(GL_TRIANGLES); + glVertex2d(0 - s.additionalSettings.calibratorWidth, 0); + glVertex2d(0 - s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); + glVertex2d(0 + s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); + glVertex2d(0 + s.additionalSettings.calibratorWidth, 0); + glVertex2d(0 - s.additionalSettings.calibratorWidth, 0); + glVertex2d(0 + s.additionalSettings.calibratorWidth, s.additionalSettings.calibratorHeight); + glEnd(); + // draw text if isn't being drawn for selecting + if (!s.drawForRectangleSelection && !s.drawForPositionSelection && s.drawDetail(s.detailSettings.calibratorText, exaggeration)) { + // set color depending of selection status + RGBColor textColor = drawUsingSelectColor() ? s.colorSettings.selectionColor : RGBColor::BLACK; + // draw "C" + GLHelper::drawText("C", Position(0, 1.5), 0.1, 3, textColor, 180); + // draw "edge" or "lane " + if (getParentLanes().size() > 0) { + GLHelper::drawText("lane", Position(0, 3), .1, 1, textColor, 180); + } else if (getParentEdges().size() > 0) { + GLHelper::drawText("edge", Position(0, 3), .1, 1, textColor, 180); + } else { + throw ProcessError("Both myEdge and myLane aren't defined"); + } + } + glPopMatrix(); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), exaggeration, myDottedGeometry); + } +} + +void +GNECalibrator::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGE: + replaceParentEdges(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_FREQUENCY: + myFrequency = parse(value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_OUTPUT: + myOutput = value; + break; + case SUMO_ATTR_ROUTEPROBE: + myRouteProbe = value; + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,420 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECalibratorFlow.cpp +/// @author Pablo Alvarez Lopez +/// @date March 2016 +/// +// +/****************************************************************************/ +#include +#include +#include +#include + +#include "GNECalibratorFlow.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + + +GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent) : + GNEAdditional(calibratorParent, calibratorParent->getNet(), GLO_CALIBRATOR, SUMO_TAG_FLOW_CALIBRATOR, "", false, +{}, {}, {}, {}, {calibratorParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myVehicleType(calibratorParent->getNet()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)), +myRoute(calibratorParent->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).begin()->second) { + // fill calibrator flows with default values + setDefaultValues(); +} + + +GNECalibratorFlow::GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed, + const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane, + const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute, + const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end) : + GNEAdditional(calibratorParent, calibratorParent->getNet(), GLO_CALIBRATOR, SUMO_TAG_FLOW_CALIBRATOR, "", false, +{}, {}, {}, {}, {calibratorParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myVehicleType(vehicleType), +myRoute(route), +myVehsPerHour(vehsPerHour), +mySpeed(speed), +myColor(color), +myDepartLane(departLane), +myDepartPos(departPos), +myDepartSpeed(departSpeed), +myArrivalLane(arrivalLane), +myArrivalPos(arrivalPos), +myArrivalSpeed(arrivalSpeed), +myLine(line), +myPersonNumber(personNumber), +myContainerNumber(containerNumber), +myReroute(reroute), +myDepartPosLat(departPosLat), +myArrivalPosLat(arrivalPosLat), +myBegin(begin), +myEnd(end) { +} + + +GNECalibratorFlow::~GNECalibratorFlow() {} + + +void +GNECalibratorFlow::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNECalibratorFlow::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNECalibratorFlow::updateGeometry() { + // This additional doesn't own a geometry +} + + +void GNECalibratorFlow::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNECalibratorFlow::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNECalibratorFlow::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNECalibratorFlow::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNECalibratorFlow::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNECalibratorFlow::drawGL(const GUIVisualizationSettings& /* s */) const { + // Currently This additional isn't drawn +} + + +std::string +GNECalibratorFlow::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_TYPE: + return myVehicleType->getID(); + case SUMO_ATTR_ROUTE: + return myRoute->getID(); + case SUMO_ATTR_VEHSPERHOUR: + return myVehsPerHour; + case SUMO_ATTR_SPEED: + return mySpeed; + case SUMO_ATTR_COLOR: + return toString(myColor); + case SUMO_ATTR_BEGIN: + return time2string(myBegin); + case SUMO_ATTR_END: + return time2string(myEnd); + case SUMO_ATTR_DEPARTLANE: + return myDepartLane; + case SUMO_ATTR_DEPARTPOS: + return myDepartPos; + case SUMO_ATTR_DEPARTSPEED: + return myDepartSpeed; + case SUMO_ATTR_ARRIVALLANE: + return myArrivalLane; + case SUMO_ATTR_ARRIVALPOS: + return myArrivalPos; + case SUMO_ATTR_ARRIVALSPEED: + return myArrivalSpeed; + case SUMO_ATTR_LINE: + return myLine; + case SUMO_ATTR_PERSON_NUMBER: + return toString(myPersonNumber); + case SUMO_ATTR_CONTAINER_NUMBER: + return toString(myContainerNumber); + case SUMO_ATTR_REROUTE: + return toString(myReroute); + case SUMO_ATTR_DEPARTPOS_LAT: + return myDepartPosLat; + case SUMO_ATTR_ARRIVALPOS_LAT: + return myArrivalPosLat; + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNECalibratorFlow::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_BEGIN: + return STEPS2TIME(myBegin); + case SUMO_ATTR_END: + return STEPS2TIME(myEnd); + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNECalibratorFlow::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: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_ROUTE: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_VEHSPERHOUR: + case SUMO_ATTR_SPEED: + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + case SUMO_ATTR_DEPARTLANE: + case SUMO_ATTR_DEPARTPOS: + case SUMO_ATTR_DEPARTSPEED: + case SUMO_ATTR_ARRIVALLANE: + case SUMO_ATTR_ARRIVALPOS: + case SUMO_ATTR_ARRIVALSPEED: + case SUMO_ATTR_LINE: + case SUMO_ATTR_PERSON_NUMBER: + case SUMO_ATTR_CONTAINER_NUMBER: + case SUMO_ATTR_REROUTE: + case SUMO_ATTR_DEPARTPOS_LAT: + case SUMO_ATTR_ARRIVALPOS_LAT: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNECalibratorFlow::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_TYPE: + return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); + case SUMO_ATTR_ROUTE: + return SUMOXMLDefinitions::isValidVehicleID(value) && (myNet->retrieveAdditional(SUMO_TAG_ROUTE, value, false) != nullptr); + case SUMO_ATTR_VEHSPERHOUR: + if (value.empty()) { + // speed and vehsPerHour cannot be empty at the same time + if (mySpeed.empty()) { + return false; + } else { + return true; + } + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_SPEED: + if (value.empty()) { + // speed and vehsPerHour cannot be empty at the same time + if (myVehsPerHour.empty()) { + return false; + } else { + return true; + } + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_BEGIN: + return canParse(value); + case SUMO_ATTR_END: + return canParse(value); + case SUMO_ATTR_DEPARTLANE: + if ((value == "random") || (value == "free") || (value == "allowed") || (value == "best") || (value == "first")) { + return true; + } else { + return (myNet->retrieveLane(value, false) != nullptr); + } + case SUMO_ATTR_DEPARTPOS: + if ((value == "random") || (value == "free") || (value == "random_free") || (value == "base") || (value == "last")) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_DEPARTSPEED: + if ((value == "random") || (value == "max")) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_ARRIVALLANE: + if (value == "current") { + return true; + } else { + return (myNet->retrieveLane(value, false) != nullptr); + } + case SUMO_ATTR_ARRIVALPOS: + if ((value == "random") || (value == "max")) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_ARRIVALSPEED: + if (value == "current") { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_LINE: + return true; + case SUMO_ATTR_PERSON_NUMBER: + return canParse(value) && parse(value) >= 0; + case SUMO_ATTR_CONTAINER_NUMBER: + return canParse(value) && parse(value) >= 0; + case SUMO_ATTR_REROUTE: + return canParse(value); + case SUMO_ATTR_DEPARTPOS_LAT: + return SUMOXMLDefinitions::LateralAlignments.hasString(value); + case SUMO_ATTR_ARRIVALPOS_LAT: + return SUMOXMLDefinitions::LateralAlignments.hasString(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNECalibratorFlow::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNECalibratorFlow::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNECalibratorFlow::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNECalibratorFlow::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_TYPE: + myVehicleType = myNet->retrieveDemandElement(SUMO_TAG_VTYPE, value); + break; + case SUMO_ATTR_ROUTE: + myRoute = myNet->retrieveDemandElement(SUMO_TAG_ROUTE, value); + break; + case SUMO_ATTR_VEHSPERHOUR: + myVehsPerHour = value; + break; + case SUMO_ATTR_SPEED: + mySpeed = value; + break; + case SUMO_ATTR_COLOR: + myColor = parse(value); + break; + case SUMO_ATTR_BEGIN: + myBegin = parse(value); + break; + case SUMO_ATTR_END: + myEnd = parse(value); + break; + case SUMO_ATTR_DEPARTLANE: + myDepartLane = value; + break; + case SUMO_ATTR_DEPARTPOS: + myDepartPos = value; + break; + case SUMO_ATTR_DEPARTSPEED: + myDepartSpeed = value; + break; + case SUMO_ATTR_ARRIVALLANE: + myArrivalLane = value; + break; + case SUMO_ATTR_ARRIVALPOS: + myArrivalPos = value; + break; + case SUMO_ATTR_ARRIVALSPEED: + myArrivalSpeed = value; + break; + case SUMO_ATTR_LINE: + myLine = value; + break; + case SUMO_ATTR_PERSON_NUMBER: + myPersonNumber = parse(value); + break; + case SUMO_ATTR_CONTAINER_NUMBER: + myContainerNumber = parse(value); + break; + case SUMO_ATTR_REROUTE: + myReroute = parse(value); + break; + case SUMO_ATTR_DEPARTPOS_LAT: + myDepartPosLat = value; + break; + case SUMO_ATTR_ARRIVALPOS_LAT: + myArrivalPosLat = value; + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibratorFlow.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,205 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECalibratorFlow.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// Flow used by GNECalibrators +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declaration +// =========================================================================== + +class GNECalibrator; +class GNECalibratorDialog; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNECalibratorFlow + * flow flow used by GNECalibrators + */ +class GNECalibratorFlow : public GNEAdditional { + +public: + /// @brief default constructor (used only in GNECalibratorDialog) + GNECalibratorFlow(GNEAdditional* calibratorParent); + + /// @brief parameter constructor + GNECalibratorFlow(GNEAdditional* calibratorParent, GNEDemandElement* vehicleType, GNEDemandElement* route, const std::string& vehsPerHour, const std::string& speed, + const RGBColor& color, const std::string& departLane, const std::string& departPos, const std::string& departSpeed, const std::string& arrivalLane, + const std::string& arrivalPos, const std::string& arrivalSpeed, const std::string& line, int personNumber, int containerNumber, bool reroute, + const std::string& departPosLat, const std::string& arrivalPosLat, SUMOTime begin, SUMOTime end); + + /// @brief destructor + ~GNECalibratorFlow(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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; + /// @} + + /// @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 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 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; + /// @} + +protected: + /// @brief type of flow + GNEDemandElement* myVehicleType; + + /// @brief route in which this flow is used + GNEDemandElement* myRoute; + + /// @brief flows per hour (String instead float because can be empty) + std::string myVehsPerHour; + + /// @brief flow speed (String instead float because can be empty) + std::string mySpeed; + + /// @brief color of flow + RGBColor myColor; + + /// @brief depart lane + std::string myDepartLane; + + /// @brief depart position + std::string myDepartPos; + + /// @brief depart speed + std::string myDepartSpeed; + + /// @brief arrival lane + std::string myArrivalLane; + + /// @brief arrival pos + std::string myArrivalPos; + + /// @brief arrival speed + std::string myArrivalSpeed; + + /// @brief line of bus/container stop + std::string myLine; + + /// @brief number of person + int myPersonNumber; + + /// @brief number of container + int myContainerNumber; + + /// @brief reroute + bool myReroute; + + /// @brief departPosLat + std::string myDepartPosLat; + + //// @brief arrivalPosLat + std::string myArrivalPosLat; + + /// @name specific of flows + /// @{ + /// @brief time step begin + SUMOTime myBegin; + + /// @brief time step end + SUMOTime myEnd; + /// @} + +private: + /// @brief method for setting the attribute and nothing else + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNECalibratorFlow(const GNECalibratorFlow&) = delete; + + /// @brief Invalidated assignment operator + GNECalibratorFlow& operator=(const GNECalibratorFlow&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibrator.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibrator.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNECalibrator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNECalibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,186 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECalibrator.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declaration +// =========================================================================== + +class GNERouteProbe; +class GNECalibratorFlow; +class GNERoute; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNECalibrator + * class for represent Calibratos in netedit + */ +class GNECalibrator : public GNEAdditional { + +public: + + /**@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 + * @param[in] edge Edge of this calibrator belongs + * @param[in] pos position of the calibrator on the edge (Currently not used) + * @param[in] frequency the aggregation interval in which to calibrate the flows + * @param[in] name Calibrator name + * @param[in] output The output file for writing calibrator information + * @param[in] routeprobe route probe vinculated with this calibrator + * @param[in] calibratorRoutes vector with the calibratorRoutes of calibrator + * @param[in] calibratorFlows vector with the calibratorFlows of calibrator + */ + GNECalibrator(const std::string& id, GNENet* net, GNEEdge* edge, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe); + + /**@brief Constructor using lane + * @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 + * @param[in] lane Lane of this calibrator belongs + * @param[in] pos position of the calibrator on the edge (Currently not used) + * @param[in] frequency the aggregation interval in which to calibrate the flows + * @param[in] name Calibrator name + * @param[in] routeprobe route probe vinculated with this calibrator + * @param[in] output The output file for writing calibrator information + * @param[in] calibratorRoutes vector with the calibratorRoutes of calibrator + * @param[in] calibratorFlows vector with the calibratorFlows of calibrator + */ + GNECalibrator(const std::string& id, GNENet* net, GNELane* lane, double pos, SUMOTime frequency, const std::string& name, const std::string& output, const std::string& routeprobe); + + /// @brief Destructor + ~GNECalibrator(); + + /// @brief open Calibrator Dialog + void openAdditionalDialog(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief position over Lane + double myPositionOverLane; + + /// @brief Frequency of calibrator + SUMOTime myFrequency; + + /// @brief output of calibrator + std::string myOutput; + + /// @brief ID to current RouteProbe + std::string myRouteProbe; + + /// @brief extra calibrator geometries + std::vector myEdgeCalibratorGeometries; + +private: + /// @brief draw calibrator symbol + void drawCalibratorSymbol(const GUIVisualizationSettings& s, const double exaggeration, const Position& pos, const double rot) const; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNECalibrator(const GNECalibrator&) = delete; + + /// @brief Invalidated assignment operator. + GNECalibrator& operator=(const GNECalibrator&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,391 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEChargingStation.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEChargingStation.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEChargingStation::GNEChargingStation(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, bool friendlyPosition, bool blockMovement) : + GNEStoppingPlace(id, net, GLO_CHARGING_STATION, SUMO_TAG_CHARGING_STATION, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), + myChargingPower(chargingPower), + myEfficiency(efficiency), + myChargeInTransit(chargeInTransit), + myChargeDelay(chargeDelay) { +} + + +GNEChargingStation::~GNEChargingStation() {} + + +void +GNEChargingStation::updateGeometry() { + // Get value of option "lefthand" + const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; + + // Update common geometry of stopping place + setStoppingPlaceGeometry(0); + + // Obtain a copy of the shape + PositionVector tmpShape = myAdditionalGeometry.getShape(); + + // Move shape to side + tmpShape.move2side(myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); + + // Get position of the sign + mySignPos = tmpShape.getLineCenter(); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set block icon rotation, and using their rotation for sign + myBlockIcon.setRotation(getParentLanes().front()); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEChargingStation::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getShape(), + myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.chargingStationWidth); +} + + +Boundary +GNEChargingStation::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNEChargingStation::drawGL(const GUIVisualizationSettings& s) const { + // Get exaggeration + const double chargingStationExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(chargingStationExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Push name + glPushName(getGlID()); + // Push base matrix + glPushMatrix(); + // Traslate matrix + glTranslated(0, 0, getType()); + // Set Color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); + } + // Draw base + GNEGeometry::drawGeometry(myNet->getViewNet(), myAdditionalGeometry, s.stoppingPlaceSettings.chargingStationWidth * chargingStationExaggeration); + // Check if the distance is enought to draw details and if is being drawn for selecting + if (s.drawForRectangleSelection) { + // only draw circle depending of distance between sign and mouse cursor + if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { + // Add a draw matrix for details + glPushMatrix(); + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(chargingStationExaggeration, chargingStationExaggeration, 1); + // set color + GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // pop draw matrix + glPopMatrix(); + } + } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, chargingStationExaggeration)) { + // Push matrix for details + glPushMatrix(); + // draw power depending of detailSettings + if (s.drawDetail(s.detailSettings.stoppingPlaceText, chargingStationExaggeration) && !s.drawForPositionSelection) { + // push a new matrix for charging power + glPushMatrix(); + // draw line with a color depending of the selection status + if (drawUsingSelectColor()) { + GLHelper::drawText((toString(myChargingPower) + " W").c_str(), mySignPos + Position(1.2, 0), .1, 1.f, s.colorSettings.selectionColor, myBlockIcon.rotation, FONS_ALIGN_LEFT); + } else { + GLHelper::drawText((toString(myChargingPower) + " W").c_str(), mySignPos + Position(1.2, 0), .1, 1.f, s.stoppingPlaceSettings.chargingStationColor, myBlockIcon.rotation, FONS_ALIGN_LEFT); + } + // pop matrix for charging power + glPopMatrix(); + } + // Set position over sign + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // Scale matrix + glScaled(chargingStationExaggeration, chargingStationExaggeration, 1); + // Set base color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColor); + } + // Draw extern + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // Move to top + glTranslated(0, 0, .1); + // Set sign color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.chargingStationColorSign); + } + // Draw internt sign + GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); + // Draw sign 'C' depending of detail settings + if (s.drawDetail(s.detailSettings.stoppingPlaceText, chargingStationExaggeration) && !s.drawForPositionSelection) { + if (drawUsingSelectColor()) { + GLHelper::drawText("C", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); + } else { + GLHelper::drawText("C", Position(), .1, myCircleInText, s.stoppingPlaceSettings.chargingStationColor, myBlockIcon.rotation); + } + } + // Pop sign matrix + glPopMatrix(); + // Draw icon + myBlockIcon.drawIcon(s, chargingStationExaggeration); + } + // Pop base matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + drawName(getPositionInView(), s.scale, s.addName); + if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), chargingStationExaggeration, myDottedGeometry); + } + // Pop name matrix + glPopName(); + // draw child demand elements + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPlacedInRTree()) { + i->drawGL(s); + } + } + } +} + + +std::string +GNEChargingStation::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_STARTPOS: + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return toString(myStartPosition); + } else { + return ""; + } + case SUMO_ATTR_ENDPOS: + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return toString(myEndPosition); + } else { + return ""; + } + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case SUMO_ATTR_CHARGINGPOWER: + return toString(myChargingPower); + case SUMO_ATTR_EFFICIENCY: + return toString(myEfficiency); + case SUMO_ATTR_CHARGEINTRANSIT: + return toString(myChargeInTransit); + case SUMO_ATTR_CHARGEDELAY: + return time2string(myChargeDelay); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEChargingStation::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_STARTPOS: + case SUMO_ATTR_ENDPOS: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FRIENDLY_POS: + case SUMO_ATTR_CHARGINGPOWER: + case SUMO_ATTR_EFFICIENCY: + case SUMO_ATTR_CHARGEINTRANSIT: + case SUMO_ATTR_CHARGEDELAY: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEChargingStation::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case SUMO_ATTR_CHARGINGPOWER: + return (canParse(value) && parse(value) >= 0); + case SUMO_ATTR_EFFICIENCY: + return (canParse(value) && parse(value) >= 0 && parse(value) <= 1); + case SUMO_ATTR_CHARGEINTRANSIT: + return canParse(value); + case SUMO_ATTR_CHARGEDELAY: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEChargingStation::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_STARTPOS: + if (!value.empty()) { + myStartPosition = parse(value); + myParametersSet |= STOPPINGPLACE_STARTPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; + } + break; + case SUMO_ATTR_ENDPOS: + if (!value.empty()) { + myEndPosition = parse(value); + myParametersSet |= STOPPINGPLACE_ENDPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; + } + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case SUMO_ATTR_CHARGINGPOWER: + myChargingPower = parse(value); + break; + case SUMO_ATTR_EFFICIENCY: + myEfficiency = parse(value); + break; + case SUMO_ATTR_CHARGEINTRANSIT: + myChargeInTransit = parse(value); + break; + case SUMO_ATTR_CHARGEDELAY: + myChargeDelay = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + "attribute '" + toString(key) + "' not allowed"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEChargingStation.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,121 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEChargingStation.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A class for visualizing chargingStation geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include "GNEStoppingPlace.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEChargingStation : public GNEStoppingPlace { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] startPos Start position of the StoppingPlace + * @param[in] endPos End position of the StoppingPlace + * @param[in] name Name of busStop + * @param[in] chargingPower charging power of the charging station + * @param[in] efficiency efficiency of the charge [0,1] + * @param[in] chargeInTransit enable or disable charge in transit + * @param[in] chargeDelay delay in timeSteps in the charge + * @param[in] friendlyPos enable or disable friendly position + * @param[in] block movement enable or disable additional movement + */ + GNEChargingStation(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, + bool friendlyPosition, bool blockMovement); + + /// @brief Destructor + ~GNEChargingStation(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /// @} + +protected: + /// @brief Charging power pro timestep + double myChargingPower; + + /// @brief efficiency of the charge + double myEfficiency; + + /// @brief enable or disable charge in transit + bool myChargeInTransit; + + /// @brief delay in the starting of charge + SUMOTime myChargeDelay; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEChargingStation(const GNEChargingStation&) = delete; + + /// @brief Invalidated assignment operator. + GNEChargingStation& operator=(const GNEChargingStation&) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,221 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEClosingLaneReroute.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#include + +#include "GNEClosingLaneReroute.h" +#include +#include +#include +#include + +#include +#include + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEClosingLaneReroute::GNEClosingLaneReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : + GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet(), GLO_REROUTER, SUMO_TAG_CLOSING_LANE_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myClosedLane(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)->getLanes().at(0)) { + // fill closing lane reroute interval with default values + setDefaultValues(); +} + + +GNEClosingLaneReroute::GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions) : + GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getNet(), GLO_REROUTER, SUMO_TAG_CLOSING_LANE_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myClosedLane(closedLane), +myPermissions(permissions) { +} + + +GNEClosingLaneReroute::~GNEClosingLaneReroute() {} + + +void +GNEClosingLaneReroute::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEClosingLaneReroute::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNEClosingLaneReroute::updateGeometry() { + // This additional doesn't own a geometry +} + + +void +GNEClosingLaneReroute::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNEClosingLaneReroute::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNEClosingLaneReroute::getCenteringBoundary() const { + return myClosedLane->getCenteringBoundary(); +} + + +void +GNEClosingLaneReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEClosingLaneReroute::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEClosingLaneReroute::drawGL(const GUIVisualizationSettings& /* s */) const { + // Currently this additional isn't drawn +} + + +std::string +GNEClosingLaneReroute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return myClosedLane->getID(); + case SUMO_ATTR_ALLOW: + return getVehicleClassNames(myPermissions); + case SUMO_ATTR_DISALLOW: + return getVehicleClassNames(invertPermissions(myPermissions)); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEClosingLaneReroute::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEClosingLaneReroute::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEClosingLaneReroute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + return (myNet->retrieveLane(value, false) != nullptr); + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + return canParseVehicleClasses(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEClosingLaneReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEClosingLaneReroute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEClosingLaneReroute::getHierarchyName() const { + return getTagStr() + ": " + myClosedLane->getID(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEClosingLaneReroute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + myClosedLane = myNet->retrieveLane(value); + break; + case SUMO_ATTR_ALLOW: + myPermissions = parseVehicleClasses(value); + break; + case SUMO_ATTR_DISALLOW: + myPermissions = invertPermissions(parseVehicleClasses(value)); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingLaneReroute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,148 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEClosingLaneReroute.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNELane; +class GNERerouterInterval; +class GNERerouterIntervalDialog; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEClosingLaneReroute + * forces the rerouter to close the lane + */ +class GNEClosingLaneReroute : public GNEAdditional { + +public: + /// @brief constructor (Used in GNERerouterIntervalDialog) + GNEClosingLaneReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); + + /// @brief parameter constructor + GNEClosingLaneReroute(GNEAdditional* rerouterIntervalParent, GNELane* closedLane, SVCPermissions permissions); + + /// @brief destructor + ~GNEClosingLaneReroute(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief closed lane + GNELane* myClosedLane; + + // @brief Permissions of This Closing Lane Reroute + SVCPermissions myPermissions; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEClosingLaneReroute(const GNEClosingLaneReroute&) = delete; + + /// @brief Invalidated assignment operator. + GNEClosingLaneReroute& operator=(const GNEClosingLaneReroute&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,220 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEClosingReroute.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#include + +#include "GNEClosingReroute.h" +#include +#include +#include + +#include +#include + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEClosingReroute::GNEClosingReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : + GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet(), GLO_CALIBRATOR, SUMO_TAG_CLOSING_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myClosedEdge(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)) { + // fill closing reroute interval with default values + setDefaultValues(); +} + + +GNEClosingReroute::GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions) : + GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getNet(), GLO_CALIBRATOR, SUMO_TAG_CLOSING_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myClosedEdge(closedEdge), +myPermissions(permissions) { +} + + +GNEClosingReroute::~GNEClosingReroute() {} + + +void +GNEClosingReroute::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEClosingReroute::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNEClosingReroute::updateGeometry() { + // This additional doesn't own a geometry +} + + +void GNEClosingReroute::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNEClosingReroute::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNEClosingReroute::getCenteringBoundary() const { + return myClosedEdge->getCenteringBoundary(); +} + + +void +GNEClosingReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEClosingReroute::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEClosingReroute::drawGL(const GUIVisualizationSettings& /* s */) const { + // Currently this additional isn't drawn +} + + +std::string +GNEClosingReroute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGE: + return myClosedEdge->getID(); + case SUMO_ATTR_ALLOW: + return getVehicleClassNames(myPermissions); + case SUMO_ATTR_DISALLOW: + return getVehicleClassNames(invertPermissions(myPermissions)); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEClosingReroute::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEClosingReroute::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: + case SUMO_ATTR_EDGE: + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEClosingReroute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_EDGE: + return (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_ALLOW: + return canParseVehicleClasses(value); + case SUMO_ATTR_DISALLOW: + return canParseVehicleClasses(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEClosingReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEClosingReroute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEClosingReroute::getHierarchyName() const { + return getTagStr() + ": " + myClosedEdge->getID(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEClosingReroute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGE: + myClosedEdge = myNet->retrieveEdge(value); + break; + case SUMO_ATTR_ALLOW: + myPermissions = parseVehicleClasses(value); + break; + case SUMO_ATTR_DISALLOW: + myPermissions = invertPermissions(parseVehicleClasses(value)); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEClosingReroute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,147 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEClosingReroute.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNERerouterInterval; +class GNERerouterIntervalDialog; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEClosingReroute + * the rerouter to close the street (edge) + */ +class GNEClosingReroute : public GNEAdditional { + +public: + /// @brief constructor (Used in GNERerouterIntervalDialog) + GNEClosingReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); + + /// @brief parameter constructor + GNEClosingReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* closedEdge, SVCPermissions permissions); + + /// @brief destructor + ~GNEClosingReroute(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief closed edge + GNEEdge* myClosedEdge; + + // @brief permissions of this Closing Reroute + SVCPermissions myPermissions; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEClosingReroute(const GNEClosingReroute&) = delete; + + /// @brief Invalidated assignment operator. + GNEClosingReroute& operator=(const GNEClosingReroute&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,369 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEContainerStop.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A lane area vehicles can halt at (GNE version) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEContainerStop.h" + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEContainerStop::GNEContainerStop(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement) : + GNEStoppingPlace(id, net, GLO_CONTAINER_STOP, SUMO_TAG_CONTAINER_STOP, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), + myLines(lines) { +} + + +GNEContainerStop::~GNEContainerStop() {} + + +void +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 shape to side + tmpShape.move2side(myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.stoppingPlaceSignOffset * offsetSign); + + // Get position of the sign + mySignPos = tmpShape.getLineCenter(); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set block icon rotation, and using their rotation for sign + myBlockIcon.setRotation(getParentLanes().front()); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEContainerStop::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getShape(), + myNet->getViewNet()->getVisualisationSettings().stoppingPlaceSettings.containerStopWidth); +} + + +Boundary +GNEContainerStop::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNEContainerStop::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double containerStopExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(containerStopExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, getType()); + // Set color of the base + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); + } + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GNEGeometry::drawGeometry(myNet->getViewNet(), myAdditionalGeometry, s.stoppingPlaceSettings.containerStopWidth * containerStopExaggeration); + // Check if the distance is enought to draw details and if is being drawn for selecting + if (s.drawForRectangleSelection) { + // only draw circle depending of distance between sign and mouse cursor + if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { + // Add a draw matrix for details + glPushMatrix(); + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(containerStopExaggeration, containerStopExaggeration, 1); + // set color + GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // pop draw matrix + glPopMatrix(); + } + } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, containerStopExaggeration)) { + // Add a draw matrix for details + glPushMatrix(); + // only draw lines if we aren't in draw for position selection + if (!s.drawForPositionSelection) { + // Iterate over every line + for (int i = 0; i < (int)myLines.size(); ++i) { + // push a new matrix for every line + glPushMatrix(); + // Rotate and traslaste + glTranslated(mySignPos.x(), mySignPos.y(), 0); + glRotated(-1 * myBlockIcon.rotation, 0, 0, 1); + // draw line with a color depending of the selection status + if (drawUsingSelectColor()) { + GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.colorSettings.selectionColor, 0, FONS_ALIGN_LEFT); + } else { + GLHelper::drawText(myLines[i].c_str(), Position(1.2, (double)i), .1, 1.f, s.stoppingPlaceSettings.containerStopColor, 0, FONS_ALIGN_LEFT); + } + // pop matrix for every line + glPopMatrix(); + } + } + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(containerStopExaggeration, containerStopExaggeration, 1); + // Set color of the externe circle + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.containerStopColor); + } + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // Traslate to front + glTranslated(0, 0, .1); + // Set color of the inner circle + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.containerStopColorSign); + } + // draw another circle in the same position, but a little bit more small + GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); + // draw text depending of detail settings + if (s.drawDetail(s.detailSettings.stoppingPlaceText, containerStopExaggeration) && !s.drawForPositionSelection) { + if (drawUsingSelectColor()) { + GLHelper::drawText("C", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); + } else { + GLHelper::drawText("C", Position(), .1, myCircleInText, s.stoppingPlaceSettings.containerStopColor, myBlockIcon.rotation); + } + } + // pop draw matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, containerStopExaggeration); + } + // pop draw matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), containerStopExaggeration, myDottedGeometry); + } + // Pop name + glPopName(); + // draw child demand elements + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPlacedInRTree()) { + i->drawGL(s); + } + } + } +} + + +std::string +GNEContainerStop::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_STARTPOS: + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return toString(myStartPosition); + } else { + return ""; + } + case SUMO_ATTR_ENDPOS: + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return toString(myEndPosition); + } else { + return ""; + } + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case SUMO_ATTR_LINES: + return joinToString(myLines, " "); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEContainerStop::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_STARTPOS: + case SUMO_ATTR_ENDPOS: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FRIENDLY_POS: + case SUMO_ATTR_LINES: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEContainerStop::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case SUMO_ATTR_LINES: + return canParse >(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEContainerStop::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_STARTPOS: + if (!value.empty()) { + myStartPosition = parse(value); + myParametersSet |= STOPPINGPLACE_STARTPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; + } + break; + case SUMO_ATTR_ENDPOS: + if (!value.empty()) { + myEndPosition = parse(value); + myParametersSet |= STOPPINGPLACE_ENDPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; + } + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case SUMO_ATTR_LINES: + myLines = GNEAttributeCarrier::parse >(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEContainerStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,112 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEContainerStop.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A class for visualizing busStop geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include "GNEStoppingPlace.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEContainerStop + * @brief A lane area vehicles can halt at (netedit-version) + */ +class GNEContainerStop : public GNEStoppingPlace { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] startPos Start position of the StoppingPlace + * @param[in] endPos End position of the StoppingPlace + * @param[in] name Name of busStop + * @param[in] lines lines of the busStop + * @param[in] friendlyPos enable or disable friendly position + * @param[in] block movement enable or disable additional movement + */ + GNEContainerStop(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, const std::vector& lines, bool friendlyPosition, bool blockMovement); + + /// @brief Destructor + ~GNEContainerStop(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /// @} + +protected: + /// @brief The list of lines that are assigned to this stop + std::vector myLines; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEContainerStop(const GNEContainerStop&) = delete; + + /// @brief Invalidated assignment operator. + GNEContainerStop& operator=(const GNEContainerStop&) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,211 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDestProbReroute.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include + +#include "GNEDestProbReroute.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDestProbReroute::GNEDestProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : + GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet(), GLO_REROUTER, SUMO_TAG_DEST_PROB_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myNewEdgeDestination(rerouterIntervalDialog->getEditedAdditional()->getParentAdditionals().at(0)->getChildEdges().at(0)) { + // fill dest prob reroute interval with default values + setDefaultValues(); +} + + +GNEDestProbReroute::GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability): + GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getNet(), GLO_REROUTER, SUMO_TAG_DEST_PROB_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myNewEdgeDestination(newEdgeDestination), +myProbability(probability) { +} + + +GNEDestProbReroute::~GNEDestProbReroute() {} + + +void +GNEDestProbReroute::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEDestProbReroute::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + +void +GNEDestProbReroute::updateGeometry() { + // This additional doesn't own a geometry +} + + +void +GNEDestProbReroute::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNEDestProbReroute::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNEDestProbReroute::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNEDestProbReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEDestProbReroute::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEDestProbReroute::drawGL(const GUIVisualizationSettings&) const { + // Currently This additional isn't drawn +} + + +std::string +GNEDestProbReroute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGE: + return myNewEdgeDestination->getID(); + case SUMO_ATTR_PROB: + return toString(myProbability); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEDestProbReroute::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEDestProbReroute::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: + case SUMO_ATTR_EDGE: + case SUMO_ATTR_PROB: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDestProbReroute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_EDGE: + return (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_PROB: + return canParse(value) && parse(value) >= 0 && parse(value) <= 1; + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDestProbReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEDestProbReroute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEDestProbReroute::getHierarchyName() const { + return getTagStr() + ": " + myNewEdgeDestination->getID(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEDestProbReroute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGE: + myNewEdgeDestination = myNet->retrieveEdge(value); + break; + case SUMO_ATTR_PROB: + myProbability = parse(value); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDestProbReroute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,148 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDestProbReroute.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEEdge; +class GNERerouterInterval; +class GNERerouterIntervalDialog; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDestProbReroute + * forces the rerouter to assign a new route + */ +class GNEDestProbReroute : public GNEAdditional { + +public: + /// @brief constructor (Used in GNERerouterIntervalDialog) + GNEDestProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); + + /// @brief constructor + GNEDestProbReroute(GNEAdditional* rerouterIntervalParent, GNEEdge* newEdgeDestination, double probability); + + /// @brief destructor + ~GNEDestProbReroute(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief id of new edge destination + GNEEdge* myNewEdgeDestination; + + /// @brief probability with which a vehicle will use the given edge as destination + double myProbability; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDestProbReroute(const GNEDestProbReroute&) = delete; + + /// @brief Invalidated assignment operator. + GNEDestProbReroute& operator=(const GNEDestProbReroute&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetector.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetector.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetector.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,149 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetector.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include + +#include "GNEDetector.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetector::GNEDetector(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes) : + GNEAdditional(id, net, type, tag, name, blockMovement, +{}, {}, parentLanes, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPositionOverLane(pos), +myFreq(freq), +myFilename(filename), +myVehicleTypes(vehicleTypes), +myFriendlyPosition(friendlyPos) { +} + + +GNEDetector::GNEDetector(GNEAdditional* additionalParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + double pos, SUMOTime freq, const std::string& filename, const std::string& name, bool friendlyPos, + bool blockMovement, const std::vector& parentLanes) : + GNEAdditional(additionalParent, net, type, tag, name, blockMovement, +{}, {}, parentLanes, {}, {additionalParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPositionOverLane(pos), +myFreq(freq), +myFilename(filename), +myFriendlyPosition(friendlyPos) { +} + + +GNEDetector::~GNEDetector() {} + + +double +GNEDetector::getPositionOverLane() const { + return myPositionOverLane; +} + + +GNELane* +GNEDetector::getLane() const { + return getParentLanes().front(); +} + + +Position +GNEDetector::getPositionInView() const { + return getLane()->getLaneShape().positionAtOffset(getGeometryPositionOverLane()); +} + + +Boundary +GNEDetector::getCenteringBoundary() const { + if (getParentLanes().size() > 1) { + return mySegmentGeometry.getBoxBoundary().grow(10); + } else { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); + } +} + + +void +GNEDetector::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) { + // only split geometry of E2 multilane detectors + if (myTagProperty.getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && + (originalElement->getTagProperty().getTag() == SUMO_TAG_LANE)) { + // obtain new list of E2 lanes + std::string newE2Lanes = getNewListOfParents(originalElement, newElement); + // update E2 Lanes + if (newE2Lanes.size() > 0) { + setAttribute(SUMO_ATTR_LANES, newE2Lanes, undoList); + } + } + } else if (splitPosition < myPositionOverLane) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust start position + setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList); + } +} + + +double +GNEDetector::getGeometryPositionOverLane() const { + double fixedPos = myPositionOverLane; + const double len = getLane()->getParentEdge()->getNBEdge()->getFinalLength(); + if (fixedPos < 0) { + fixedPos += len; + } + GNEAdditionalHandler::checkAndFixDetectorPosition(fixedPos, len, true); + return fixedPos * getLane()->getLengthGeometryFactor(); +} + + +double +GNEDetector::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +std::string +GNEDetector::getParentName() const { + return getLane()->getID(); +} + + +std::string +GNEDetector::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNEDetector::getHierarchyName() const { + return getTagStr(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,396 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE1.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDetectorE1.h" +#include "GNEAdditionalHandler.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetectorE1::GNEDetectorE1(const std::string& id, GNELane* lane, GNENet* net, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) : + GNEDetector(id, net, GLO_E1DETECTOR, SUMO_TAG_E1DETECTOR, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, { + lane +}) { +} + + +GNEDetectorE1::~GNEDetectorE1() { +} + + +bool +GNEDetectorE1::isAdditionalValid() const { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } +} + + +std::string +GNEDetectorE1::getAdditionalProblem() const { + // declare variable for error position + std::string errorPosition; + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + // check positions over lane + if (myPositionOverLane < -len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); + } + if (myPositionOverLane > len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); + } + return errorPosition; +} + + +void +GNEDetectorE1::fixAdditionalProblem() { + // declare new position + double newPositionOverLane = myPositionOverLane; + // fix pos and length checkAndFixDetectorPosition + GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position + setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList()); +} + + +void +GNEDetectorE1::moveGeometry(const Position& offset) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + const bool storeNegative = myPositionOverLane < 0; + myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); + if (storeNegative) { + myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } + // Update geometry + updateGeometry(); +} + + +void +GNEDetectorE1::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_end(); +} + + +void +GNEDetectorE1::updateGeometry() { + // update geometry + myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set offset of the block icon + myBlockIcon.offset = Position(-1, 0); + + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(getParentLanes().front()); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEDetectorE1::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getPosition(), + myAdditionalGeometry.getRotation(), + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E1Width, + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E1Height); +} + + +void +GNEDetectorE1::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double E1Exaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(E1Exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // obtain scaledSize + const double scaledWidth = s.detectorSettings.E1Width * 0.5 * s.scale; + // start drawing + glPushName(getGlID()); + glLineWidth(1.0); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.detectorSettings.E1Color); + } + // draw shape + glPushMatrix(); + glTranslated(0, 0, getType()); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glScaled(E1Exaggeration, E1Exaggeration, 1); + glBegin(GL_QUADS); + glVertex2d(-1.0, 2); + glVertex2d(-1.0, -2); + glVertex2d(1.0, -2); + glVertex2d(1.0, 2); + glEnd(); + glTranslated(0, 0, .01); + glBegin(GL_LINES); + glVertex2d(0, 2 - .1); + glVertex2d(0, -2 + .1); + glEnd(); + // outline if isn't being drawn for selecting + if ((scaledWidth * E1Exaggeration > 1) && !s.drawForRectangleSelection) { + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glBegin(GL_QUADS); + glVertex2f(-1.0, 2); + glVertex2f(-1.0, -2); + glVertex2f(1.0, -2); + glVertex2f(1.0, 2); + glEnd(); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + // position indicator if isn't being drawn for selecting + if ((scaledWidth * E1Exaggeration > 1) && !s.drawForRectangleSelection) { + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glRotated(90, 0, 0, -1); + glBegin(GL_LINES); + glVertex2d(0, 1.7); + glVertex2d(0, -1.7); + glEnd(); + } + // Pop shape matrix + glPopMatrix(); + // Check if the distance is enought to draw details and isn't being drawn for selecting + if ((s.drawDetail(s.detailSettings.detectorDetails, E1Exaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); + // Rotate depending of myBlockIcon.rotation + glRotated(myBlockIcon.rotation, 0, 0, -1); + //move to logo position + glTranslated(-1, 0, 0); + // scale text + glScaled(E1Exaggeration, E1Exaggeration, 1); + // draw E1 logo + if (drawUsingSelectColor()) { + GLHelper::drawText("E1", Position(), .1, 1.5, s.colorSettings.selectionColor); + } else { + GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK); + } + // pop matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, E1Exaggeration); + } + // Finish draw if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), E1Exaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +std::string +GNEDetectorE1::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_FREQUENCY: + return time2string(myFreq); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_VTYPES: + return myVehicleTypes; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDetectorE1::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_FREQUENCY: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_FRIENDLY_POS: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + +} + + +bool +GNEDetectorE1::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidDetectorID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_POSITION: + return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + case SUMO_ATTR_FREQUENCY: + return (canParse(value) && (parse(value) >= 0)); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_VTYPES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE1::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEDetectorE1::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_FREQUENCY: + myFreq = parse(value); + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_VTYPES: + myVehicleTypes = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,128 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE1.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEDetector.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDetectorE1 + * Class for detector of type E1 + */ +class GNEDetectorE1 : public GNEDetector { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] pos position of the detector on the lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] name E1 detector name + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorE1(const std::string& id, GNELane* lane, GNENet* net, double pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); + + /// @brief Destructor + ~GNEDetectorE1(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML + bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem + std::string getAdditionalProblem() const; + + /// @brief fix additional problem + void fixAdditionalProblem(); + /// @} + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDetectorE1(const GNEDetectorE1&) = delete; + + /// @brief Invalidated assignment operator. + GNEDetectorE1& operator=(const GNEDetectorE1&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,386 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE1Instant.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2018 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDetectorE1Instant.h" +#include "GNEAdditionalHandler.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetectorE1Instant::GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNENet* net, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement) : + GNEDetector(id, net, GLO_E1DETECTOR_INSTANT, SUMO_TAG_INSTANT_INDUCTION_LOOP, pos, 0, filename, vehicleTypes, name, friendlyPos, blockMovement, { + lane +}) { +} + + +GNEDetectorE1Instant::~GNEDetectorE1Instant() { +} + + +bool +GNEDetectorE1Instant::isAdditionalValid() const { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } +} + + +std::string +GNEDetectorE1Instant::getAdditionalProblem() const { + // declare variable for error position + std::string errorPosition; + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + // check positions over lane + if (myPositionOverLane < -len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); + } + if (myPositionOverLane > len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); + } + return errorPosition; +} + + +void +GNEDetectorE1Instant::fixAdditionalProblem() { + // declare new position + double newPositionOverLane = myPositionOverLane; + // fix pos and length checkAndFixDetectorPosition + GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position + setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList()); +} + + +void +GNEDetectorE1Instant::moveGeometry(const Position& offset) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + const bool storeNegative = myPositionOverLane < 0; + myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); + if (storeNegative) { + myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } + // Update geometry + updateGeometry(); +} + + +void +GNEDetectorE1Instant::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_end(); +} + + +void +GNEDetectorE1Instant::updateGeometry() { + // update geometry + myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set offset of the block icon + myBlockIcon.offset = Position(-1, 0); + + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(getParentLanes().front()); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void GNEDetectorE1Instant::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getPosition(), + myAdditionalGeometry.getRotation(), + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E1InstantWidth, + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E1InstantHeight); +} + + +void +GNEDetectorE1Instant::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double E1InstantExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(E1InstantExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // obtain scaledSize + const double scaledWidth = s.detectorSettings.E1InstantWidth * 0.5 * s.scale; + // start drawing + glPushName(getGlID()); + glLineWidth(1.0); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.detectorSettings.E1InstantColor); + } + // draw shape + glPushMatrix(); + glTranslated(0, 0, getType()); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glScaled(E1InstantExaggeration, E1InstantExaggeration, 1); + glBegin(GL_QUADS); + glVertex2d(-1.0, 2); + glVertex2d(-1.0, -2); + glVertex2d(1.0, -2); + glVertex2d(1.0, 2); + glEnd(); + glTranslated(0, 0, .01); + glBegin(GL_LINES); + glVertex2d(0, 2 - .1); + glVertex2d(0, -2 + .1); + glEnd(); + // outline if isn't being drawn for selecting + if ((scaledWidth * E1InstantExaggeration > 1) && !s.drawForRectangleSelection) { + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glBegin(GL_QUADS); + glVertex2f(-1.0, 2); + glVertex2f(-1.0, -2); + glVertex2f(1.0, -2); + glVertex2f(1.0, 2); + glEnd(); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + // position indicator if isn't being drawn for selecting + if ((scaledWidth * E1InstantExaggeration > 1) && !s.drawForRectangleSelection) { + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glRotated(90, 0, 0, -1); + glBegin(GL_LINES); + glVertex2d(0, 1.7); + glVertex2d(0, -1.7); + glEnd(); + } + // Pop shape matrix + glPopMatrix(); + // Check if the distance is enought to draw details and isn't being drawn for selecting + if ((s.drawDetail(s.detailSettings.detectorDetails, E1InstantExaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); + // Rotate depending of myBlockIcon.rotation + glRotated(myBlockIcon.rotation, 0, 0, -1); + //move to logo position + glTranslated(-1, 0, 0); + // scale text + glScaled(E1InstantExaggeration, E1InstantExaggeration, 1); + // draw E1 logo + if (drawUsingSelectColor()) { + GLHelper::drawText("E1", Position(), .1, 1.5, s.colorSettings.selectionColor); + } else { + GLHelper::drawText("E1", Position(), .1, 1.5, RGBColor::BLACK); + } + // pop matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, E1InstantExaggeration); + } + // Finish draw if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), E1InstantExaggeration, myDottedGeometry); + } + glPopName(); + } +} + + +std::string +GNEDetectorE1Instant::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_VTYPES: + return myVehicleTypes; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDetectorE1Instant::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_FRIENDLY_POS: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + +} + + +bool +GNEDetectorE1Instant::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidDetectorID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_POSITION: + return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_VTYPES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE1Instant::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEDetectorE1Instant::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_VTYPES: + myVehicleTypes = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE1Instant.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,136 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE1Instant.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2018 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEDetector.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDetectorE1Instant + * Class for detector of type E1 + */ +class GNEDetectorE1Instant : public GNEDetector { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] pos position of the detector on the lane + * @param[in] filename The path to the output file. + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] name E1 Instant detector name + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorE1Instant(const std::string& id, GNELane* lane, GNENet* net, double pos, const std::string& filename, const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement); + + /// @brief Destructor + ~GNEDetectorE1Instant(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML + bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem + std::string getAdditionalProblem() const; + + /// @brief fix additional problem + void fixAdditionalProblem(); + /// @} + + /// @name inherited from GNEDetector + /// @{ + /// @brief check if Position of detector is fixed + bool isDetectorPositionFixed() const; + + /// @brief get lane + GNELane* getLane() const; + /// @} + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDetectorE1Instant(const GNEDetectorE1Instant&) = delete; + + /// @brief Invalidated assignment operator. + GNEDetectorE1Instant& operator=(const GNEDetectorE1Instant&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,637 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE2.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDetectorE2.h" +#include "GNEAdditionalHandler.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetectorE2::GNEDetectorE2(const std::string& id, GNELane* lane, GNENet* net, double pos, double length, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) : + GNEDetector(id, net, GLO_E2DETECTOR, SUMO_TAG_E2DETECTOR, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, { + lane +}), +myLength(length), +myEndPositionOverLane(0.), +myTimeThreshold(timeThreshold), +mySpeedThreshold(speedThreshold), +myJamThreshold(jamThreshold), +myE2valid(true) { +} + + +GNEDetectorE2::GNEDetectorE2(const std::string& id, std::vector lanes, GNENet* net, double pos, double endPos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement) : + GNEDetector(id, net, GLO_E2DETECTOR, SUMO_TAG_E2DETECTOR_MULTILANE, pos, freq, filename, vehicleTypes, name, friendlyPos, blockMovement, lanes), + myLength(0), + myEndPositionOverLane(endPos), + myTimeThreshold(timeThreshold), + mySpeedThreshold(speedThreshold), + myJamThreshold(jamThreshold), + myE2valid(true) { +} + + +GNEDetectorE2::~GNEDetectorE2() { +} + + +bool +GNEDetectorE2::isAdditionalValid() const { + if (getParentLanes().size() == 1) { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + return (myPositionOverLane >= 0) && ((myPositionOverLane + myLength) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + } + } else { + // first check if there is connection between all consecutive lanes + if (myE2valid) { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + return (myPositionOverLane >= 0) && ((myPositionOverLane) <= getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength() && + myEndPositionOverLane >= 0) && ((myEndPositionOverLane) <= getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()); + } + } else { + return false; + } + } +} + + +std::string +GNEDetectorE2::getAdditionalProblem() const { + // declare variable for error position + std::string errorFirstLanePosition, separator, errorLastLanePosition; + if (getParentLanes().size() == 1) { + // check positions over lane + if (myPositionOverLane < 0) { + errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " < 0"); + } + if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); + } + if ((myPositionOverLane + myLength) > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " + " + toString(SUMO_ATTR_LENGTH) + " > lanes's length"); + } + } else { + if (myE2valid) { + // check positions over first lane + if (myPositionOverLane < 0) { + errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " < 0"); + } + if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorFirstLanePosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); + } + // check positions over last lane + if (myEndPositionOverLane < 0) { + errorLastLanePosition = (toString(SUMO_ATTR_ENDPOS) + " < 0"); + } + if (myEndPositionOverLane > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorLastLanePosition = (toString(SUMO_ATTR_ENDPOS) + " > lanes's length"); + } + } else { + errorFirstLanePosition = "lanes aren't consecutives"; + } + } + // check separator + if ((errorFirstLanePosition.size() > 0) && (errorLastLanePosition.size() > 0)) { + separator = " and "; + } + // return error message + return errorFirstLanePosition + separator + errorLastLanePosition; +} + + +void +GNEDetectorE2::fixAdditionalProblem() { + if (getParentLanes().size() == 1) { + // obtain position and length + double newPositionOverLane = myPositionOverLane; + double newLength = myLength; + // fix pos and length using fixE2DetectorPosition + GNEAdditionalHandler::fixE2DetectorPosition(newPositionOverLane, newLength, getParentLanes().at(0)->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position and length + setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList()); + setAttribute(SUMO_ATTR_LENGTH, toString(myLength), myNet->getViewNet()->getUndoList()); + } else { + if (!myE2valid) { + // build connections between all consecutive lanes + bool foundConnection = true; + int i = 0; + // iterate over all lanes, and stop if myE2valid is false + while (i < ((int)getParentLanes().size() - 1)) { + // change foundConnection to false + foundConnection = false; + // if a connection betwen "from" lane and "to" lane of connection is found, change myE2valid to true again + for (auto j : getParentLanes().at(i)->getParentEdge()->getGNEConnections()) { + if (j->getLaneFrom() == getParentLanes().at(i) && j->getLaneTo() == getParentLanes().at(i + 1)) { + foundConnection = true; + } + } + // if connection wasn't found + if (!foundConnection) { + // create new connection manually + NBEdge::Connection newCon(getParentLanes().at(i)->getIndex(), getParentLanes().at(i + 1)->getParentEdge()->getNBEdge(), getParentLanes().at(i + 1)->getIndex()); + // allow to undo creation of new lane + myNet->getViewNet()->getUndoList()->add(new GNEChange_Connection(getParentLanes().at(i)->getParentEdge(), newCon, false, true), true); + } + // update lane iterator + i++; + } + } else { + // declare new position + double newPositionOverLane = myPositionOverLane; + // fix pos and length checkAndFixDetectorPosition + GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position + setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList()); + // declare new end position + double newEndPositionOverLane = myEndPositionOverLane; + // fix pos and length checkAndFixDetectorPosition + GNEAdditionalHandler::checkAndFixDetectorPosition(newEndPositionOverLane, getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position + setAttribute(SUMO_ATTR_ENDPOS, toString(newEndPositionOverLane), myNet->getViewNet()->getUndoList()); + } + } +} + + +void +GNEDetectorE2::moveGeometry(const Position& offset) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myMove.originalViewPosition, false); + // move geometry depending of number of lanes + if (getParentLanes().size() == 1) { + // calculate new position over lane + double newPositionOverLane = parse(myMove.firstOriginalLanePosition) + offsetLane; + // obtain lane length + double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getLane()->getLengthGeometryFactor(); + if (newPositionOverLane < 0) { + myPositionOverLane = 0; + } else if (newPositionOverLane + myLength > laneLength) { + myPositionOverLane = laneLength - myLength; + } else { + myPositionOverLane = newPositionOverLane; + } + } else { + // calculate new start and end positions + double newStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; + double newEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; + // change start and end position of E2 detector ONLY if both extremes aren't overpassed + if ((newStartPosition >= 0) && (newStartPosition <= getParentLanes().front()->getLaneShapeLength()) && + (newEndPosition >= 0) && (newEndPosition <= getParentLanes().back()->getLaneShapeLength())) { + myPositionOverLane = newStartPosition; + myEndPositionOverLane = newEndPosition; + } + } + // Update geometry + updateGeometry(); +} + + +void +GNEDetectorE2::commitGeometryMoving(GNEUndoList* undoList) { + // commit geometry moving depending of number of lanes + if (getParentLanes().size() == 1) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_end(); + } else { + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(myEndPositionOverLane), myMove.secondOriginalPosition)); + undoList->p_end(); + } +} + + +void +GNEDetectorE2::updateGeometry() { + // declare variables for start and end positions + double startPosFixed, endPosFixed; + + // calculate start and end positions dependin of number of lanes + if (getParentLanes().size() == 1) { + + // set start position + if (myPositionOverLane < 0) { + startPosFixed = 0; + } else if (myPositionOverLane > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { + startPosFixed = getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(); + } else { + startPosFixed = myPositionOverLane; + } + + // set end position + if ((myPositionOverLane + myLength) < 0) { + endPosFixed = 0; + } else if ((myPositionOverLane + myLength) > getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength()) { + endPosFixed = getParentLanes().back()->getParentEdge()->getNBEdge()->getFinalLength(); + } else { + endPosFixed = (myPositionOverLane + myLength); + } + + // Cut shape using as delimitators fixed start position and fixed end position + myAdditionalGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), startPosFixed * getParentLanes().front()->getLengthGeometryFactor(), endPosFixed * getParentLanes().back()->getLengthGeometryFactor()); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + } else if (getParentLanes().size() > 1) { + GNEGeometry::calculateLaneGeometricPath(this, mySegmentGeometry, getParentLanes(), myPositionOverLane, myEndPositionOverLane); + /* + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.multiShape.front().getLineCenter(); + + // check integrity + checkE2MultilaneIntegrity(); + */ + } + + // Set offset of the block icon + myBlockIcon.offset = Position(-0.75, 0); + + // Set block icon rotation, and using their rotation for draw logo + myBlockIcon.setRotation(getParentLanes().front()); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEDetectorE2::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getShape(), + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E2Width); +} + + +double +GNEDetectorE2::getLength() const { + return myLength; +} + + +void +GNEDetectorE2::checkE2MultilaneIntegrity() { + // we assume that E2 is valid + myE2valid = true; + int i = 0; + // iterate over all lanes, and stop if myE2valid is false + while (i < ((int)getParentLanes().size() - 1) && myE2valid) { + // set myE2valid to false + myE2valid = false; + // if a connection betwen "from" lane and "to" lane of connection is found, change myE2valid to true again + for (auto j : getParentLanes().at(i)->getParentEdge()->getGNEConnections()) { + if (j->getLaneFrom() == getParentLanes().at(i) && j->getLaneTo() == getParentLanes().at(i + 1)) { + myE2valid = true; + } + } + // update iterator + i++; + } +} + + +void +GNEDetectorE2::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double E2Exaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if ((myTagProperty.getTag() == SUMO_TAG_E2DETECTOR) && s.drawAdditionals(E2Exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, getType()); + // Set color of the base + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + // set color depending if is or isn't valid + if (myE2valid) { + GLHelper::setColor(s.detectorSettings.E2Color); + } else { + GLHelper::setColor(RGBColor::RED); + } + } + // check if we have to drawn a E2 single lane or a E2 multiLane + if (myAdditionalGeometry.getShape().size() > 0) { + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GNEGeometry::drawGeometry(myNet->getViewNet(), myAdditionalGeometry, s.detectorSettings.E2Width * E2Exaggeration); + } + // Pop last matrix + glPopMatrix(); + // Check if the distance is enougth to draw details and isn't being drawn for selecting + if ((s.drawDetail(s.detailSettings.detectorDetails, E2Exaggeration)) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + // draw logo depending if this is an Multilane E2 detector + if (myTagProperty.getTag() == SUMO_TAG_E2DETECTOR) { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); + // Rotate depending of myBlockIcon.rotation + glRotated(myBlockIcon.rotation, 0, 0, -1); + // move to logo position + glTranslated(-0.75, 0, 0); + // scale text + glScaled(E2Exaggeration, E2Exaggeration, 1); + // draw E2 logo + if (drawUsingSelectColor()) { + GLHelper::drawText("E2", Position(), .1, 1.5, s.colorSettings.selectionColor); + } else { + GLHelper::drawText("E2", Position(), .1, 1.5, RGBColor::BLACK); + } + } else { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(myBlockIcon.position.x(), myBlockIcon.position.y(), getType() + 0.1); + // Rotate depending of myBlockIcon.rotation + glRotated(myBlockIcon.rotation, 0, 0, -1); + //move to logo position + glTranslated(-1.5, 0, 0); + // scale text + glScaled(E2Exaggeration, E2Exaggeration, 1); + // draw E2 logo + if (drawUsingSelectColor()) { + GLHelper::drawText("E2", Position(), .1, 1.5, s.colorSettings.selectionColor); + } else { + GLHelper::drawText("E2", Position(), .1, 1.5, RGBColor::BLACK); + } + //move to logo position + glTranslated(1.2, 0, 0); + // Rotate depending of myBlockIcon.rotation + glRotated(90, 0, 0, 1); + if (drawUsingSelectColor()) { + GLHelper::drawText("multi", Position(), .1, 0.9, s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::drawText("multi", Position(), .1, 0.9, RGBColor::BLACK); + } + } + // pop matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, E2Exaggeration); + } + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + if (myAdditionalGeometry.getShape().size() > 0) { + GNEGeometry::drawShapeDottedContour(s, getType(), E2Exaggeration, myDottedGeometry); + } + } + // Pop name + glPopName(); + } +} + + +std::string +GNEDetectorE2::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + case SUMO_ATTR_LANES: + return parseIDs(getParentLanes()); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_ENDPOS: + return toString(myEndPositionOverLane); + case SUMO_ATTR_FREQUENCY: + return time2string(myFreq); + case SUMO_ATTR_LENGTH: + return toString(myLength); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_VTYPES: + return myVehicleTypes; + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return time2string(myTimeThreshold); + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + return toString(mySpeedThreshold); + case SUMO_ATTR_JAM_DIST_THRESHOLD: + return toString(myJamThreshold); + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDetectorE2::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_LANES: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_ENDPOS: + case SUMO_ATTR_FREQUENCY: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + case SUMO_ATTR_JAM_DIST_THRESHOLD: + case SUMO_ATTR_FRIENDLY_POS: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE2::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidDetectorID(value); + case SUMO_ATTR_LANE: + if (value.empty()) { + return false; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_LANES: + if (value.empty()) { + return false; + } else if (canParse >(myNet, value, false)) { + // check if lanes are consecutives + return lanesConsecutives(parse >(myNet, value)); + } else { + return false; + } + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_ENDPOS: + return canParse(value); + case SUMO_ATTR_FREQUENCY: + return (canParse(value) && (parse(value) >= 0)); + case SUMO_ATTR_LENGTH: + return (canParse(value) && (parse(value) >= 0)); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_VTYPES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return canParse(value); + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + return (canParse(value) && (parse(value) >= 0)); + case SUMO_ATTR_JAM_DIST_THRESHOLD: + return (canParse(value) && (parse(value) >= 0)); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE2::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEDetectorE2::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + case SUMO_ATTR_LANES: + replaceParentLanes(this, value); + checkE2MultilaneIntegrity(); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_ENDPOS: + myEndPositionOverLane = parse(value); + break; + case SUMO_ATTR_FREQUENCY: + myFreq = parse(value); + break; + case SUMO_ATTR_LENGTH: + myLength = parse(value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_VTYPES: + myVehicleTypes = value; + break; + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + myTimeThreshold = parse(value); + break; + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + mySpeedThreshold = parse(value); + break; + case SUMO_ATTR_JAM_DIST_THRESHOLD: + myJamThreshold = parse(value); + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE2.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,177 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE2.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEDetector.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDetectorE2 + * class for detector of type E2 + */ +class GNEDetectorE2 : public GNEDetector { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] pos position of the detector on the lane + * @param[in] length The length of the detector in meters. + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] name E2 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] speedThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorE2(const std::string& id, GNELane* lane, GNENet* net, double pos, double length, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); + + /**@brief Constructor for Multi-Lane detectors + * @param[in] id The storage of gl-ids to get the one for this lane representation from + * @param[in] lanes vector of lanes Lane of this StoppingPlace belongs + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] pos position of the detector on the first lane + * @param[in] endPos position of the detector on the last lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] name E2 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] speedThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorE2(const std::string& id, std::vector lanes, GNENet* net, double pos, double endPos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, + const std::string& name, SUMOTime timeThreshold, double speedThreshold, double jamThreshold, bool friendlyPos, bool blockMovement); + + /// @brief Destructor + ~GNEDetectorE2(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML + bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem + std::string getAdditionalProblem() const; + + /// @brief fix additional problem + void fixAdditionalProblem(); + /// @} + + /// @brief get length of E2 Detector + double getLength() const; + + /// @brief check if E2 is valid (all of their lanes are connected, it must called after every operation which involves lane's connections) + void checkE2MultilaneIntegrity(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +protected: + /// @brief E2 detector length + double myLength; + + /// @brief end position over lane (only for Multilane E2 detectors) + double myEndPositionOverLane; + + /// @brief The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + SUMOTime myTimeThreshold; + + /// @brief The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + double mySpeedThreshold; + + /// @brief The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam + double myJamThreshold; + + /// @brief flag to check if E2 multilane is valid or invalid + bool myE2valid; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDetectorE2(const GNEDetectorE2&) = delete; + + /// @brief Invalidated assignment operator. + GNEDetectorE2& operator=(const GNEDetectorE2&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,390 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE3.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDetectorE3.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetectorE3::GNEDetectorE3(const std::string& id, GNENet* net, Position pos, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement) : + GNEAdditional(id, net, GLO_E3DETECTOR, SUMO_TAG_E3DETECTOR, name, blockMovement, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPosition(pos), +myFreq(freq), +myFilename(filename), +myVehicleTypes(vehicleTypes), +myTimeThreshold(timeThreshold), +mySpeedThreshold(speedThreshold) { +} + + +GNEDetectorE3::~GNEDetectorE3() {} + + +void +GNEDetectorE3::updateGeometry() { + // Set block icon position + myBlockIcon.position = myPosition; + + // Set block icon offset + myBlockIcon.offset = Position(-0.5, -0.5); + + // Set block icon rotation, and using their rotation for draw logo + myBlockIcon.setRotation(); + + // Update connection's geometry + myChildConnections.update(); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEDetectorE3::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myPosition, 0, + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E3Size, + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E3Size); +} + + +Position +GNEDetectorE3::getPositionInView() const { + return myPosition; +} + + +Boundary +GNEDetectorE3::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else { + Boundary b; + b.add(myPosition); + b.grow(5); + return b; + } +} + + +void +GNEDetectorE3::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEDetectorE3::moveGeometry(const Position& offset) { + // restore old position, apply offset and update Geometry + myPosition = myMove.originalViewPosition; + myPosition.add(offset); + // filtern position using snap to active grid + // filtern position using snap to active grid + myPosition = myNet->getViewNet()->snapToActiveGrid(myPosition); + updateGeometry(); +} + + +void +GNEDetectorE3::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), toString(myMove.originalViewPosition))); + undoList->p_end(); +} + + +std::string +GNEDetectorE3::getParentName() const { + return myNet->getMicrosimID(); +} + + +void +GNEDetectorE3::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double E3Exaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(E3Exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(myPosition.x(), myPosition.y(), getType()); + // scale + glScaled(E3Exaggeration, E3Exaggeration, 1); + // Draw icon depending of detector is selected and if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, E3Exaggeration)) { + glColor3d(1, 1, 1); + glRotated(180, 0, 0, 1); + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_E3SELECTED), s.detectorSettings.E3Size); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_E3), s.detectorSettings.E3Size); + } + } else { + GLHelper::setColor(RGBColor::GREY); + GLHelper::drawBoxLine(Position(0, s.detectorSettings.E3Size), 0, 2 * s.detectorSettings.E3Size, s.detectorSettings.E3Size); + } + // Pop logo matrix + glPopMatrix(); + // Show Lock icon depending + myBlockIcon.drawIcon(s, E3Exaggeration, 0.4); + // Draw child connections + drawChildConnections(s, getType()); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), E3Exaggeration, myDottedGeometry); + // draw shape dotte contour aroud alld connections between child and parents + for (auto i : myChildConnections.connectionPositions) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); + } + } + // Pop name + glPopName(); + } +} + + +std::string +GNEDetectorE3::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_POSITION: + return toString(myPosition); + case SUMO_ATTR_FREQUENCY: + return time2string(myFreq); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_VTYPES: + return myVehicleTypes; + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return time2string(myTimeThreshold); + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + return toString(mySpeedThreshold); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEDetectorE3::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEDetectorE3::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: { + // change ID of Entry + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Entry/Exits children + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(i->getTagProperty().getTag()), undoList); + } + break; + } + case SUMO_ATTR_FREQUENCY: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE3::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidDetectorID(value); + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_FREQUENCY: + return canParse(value); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_VTYPES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return canParse(value); + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + return canParse(value) && (parse(value) >= 0); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorE3::checkChildAdditionalRestriction() const { + int numEntrys = 0; + int numExits = 0; + // iterate over additional chidls and obtain number of entrys and exits + for (auto i : getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_DET_ENTRY) { + numEntrys++; + } else if (i->getTagProperty().getTag() == SUMO_TAG_DET_EXIT) { + numExits++; + } + } + // write warnings + if (numEntrys == 0) { + WRITE_WARNING("An " + toString(SUMO_TAG_E3DETECTOR) + " need at least one " + toString(SUMO_TAG_DET_ENTRY) + " detector"); + } + if (numExits == 0) { + WRITE_WARNING("An " + toString(SUMO_TAG_E3DETECTOR) + " need at least one " + toString(SUMO_TAG_DET_EXIT) + " detector"); + } + // return false depending of number of Entrys and Exits + return ((numEntrys != 0) && (numExits != 0)); +} + + +bool +GNEDetectorE3::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEDetectorE3::getPopUpID() const { + return getTagStr() + ":" + getID(); +} + + +std::string +GNEDetectorE3::getHierarchyName() const { + return getTagStr(); +} + + +void +GNEDetectorE3::updateParentAdditional() { + myChildConnections.update(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEDetectorE3::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_POSITION: + myNet->removeGLObjectFromGrid(this); + myPosition = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_FREQUENCY: + myFreq = parse(value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_VTYPES: + myVehicleTypes = value; + break; + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + myTimeThreshold = parse(value); + break; + case SUMO_ATTR_HALTING_SPEED_THRESHOLD: + mySpeedThreshold = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorE3.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,169 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorE3.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDetectorE3 + * Class for multy Entry/multy Exits detectors + */ +class GNEDetectorE3 : public GNEAdditional { + +public: + /**@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 + * @param[in] pos position (center) of the detector in the map + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] name E3 detector name + * @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + * @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorE3(const std::string& id, GNENet* net, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement); + + /// @brief GNEDetectorE3 Destructor + ~GNEDetectorE3(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + + /// @name inherited from GNEHierarchicalChildElements + /// @{ + /// @brief update parent after add or remove a child + void updateParentAdditional(); + /// @} + +protected: + /// @brief position of E3 in view + Position myPosition; + + /// @brief frequency of E3 detector + SUMOTime myFreq; + + /// @brief fielname of E3 detector + std::string myFilename; + + /// @brief attribute vehicle types + std::string myVehicleTypes; + + /// @brief The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting + SUMOTime myTimeThreshold; + + /// @brief The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting + double mySpeedThreshold; + +private: + /// @brief check restriction with the number of children + bool checkChildAdditionalRestriction() const; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDetectorE3(const GNEDetectorE3&) = delete; + + /// @brief Invalidated assignment operator. + GNEDetectorE3& operator=(const GNEDetectorE3&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,384 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorEntryExit.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDetectorEntryExit.h" +#include "GNEAdditionalHandler.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDetectorEntryExit::GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement) : + GNEDetector(parent, net, GLO_DET_ENTRY, entryExitTag, pos, 0, "", "", friendlyPos, blockMovement, { + lane +}) { + //check that this is a TAZ Source OR a TAZ Sink + if ((entryExitTag != SUMO_TAG_DET_ENTRY) && (entryExitTag != SUMO_TAG_DET_EXIT)) { + throw InvalidArgument("Invalid E3 Child Tag"); + } +} + + +GNEDetectorEntryExit::~GNEDetectorEntryExit() {} + + +bool +GNEDetectorEntryExit::isAdditionalValid() const { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } +} + + +std::string +GNEDetectorEntryExit::getAdditionalProblem() const { + // declare variable for error position + std::string errorPosition; + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + // check positions over lane + if (myPositionOverLane < -len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0"); + } + if (myPositionOverLane > len) { + errorPosition = (toString(SUMO_ATTR_POSITION) + " > lanes's length"); + } + return errorPosition; +} + + +void +GNEDetectorEntryExit::fixAdditionalProblem() { + // declare new position + double newPositionOverLane = myPositionOverLane; + // fix pos and length checkAndFixDetectorPosition + GNEAdditionalHandler::checkAndFixDetectorPosition(newPositionOverLane, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), true); + // set new position + setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList()); +} + + +void +GNEDetectorEntryExit::moveGeometry(const Position& offset) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + const bool storeNegative = myPositionOverLane < 0; + myPositionOverLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false); + if (storeNegative) { + myPositionOverLane -= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } + // Update geometry + updateGeometry(); +} + + +void +GNEDetectorEntryExit::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPositionOverLane), myMove.firstOriginalLanePosition)); + undoList->p_end(); +} + + +void +GNEDetectorEntryExit::updateGeometry() { + // update geometry + myAdditionalGeometry.updateGeometry(getParentLanes().front(), getGeometryPositionOverLane()); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set offset of the block icon + myBlockIcon.offset = Position(-1, 0); + + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(getParentLanes().front()); + + // update E3 parent children + getParentAdditionals().at(0)->updateChildConnections(); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEDetectorEntryExit::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getPosition(), + myAdditionalGeometry.getRotation(), + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E3EntryExitWidth, + myNet->getViewNet()->getVisualisationSettings().detectorSettings.E3EntryExitHeight); +} + + +void +GNEDetectorEntryExit::drawGL(const GUIVisualizationSettings& s) const { + // Set initial values + const double entryExitExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(entryExitExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding gl identificator + glPushName(getGlID()); + // Push detector matrix + glPushMatrix(); + glTranslated(0, 0, getType()); + // Set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { + GLHelper::setColor(s.detectorSettings.E3EntryColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { + GLHelper::setColor(s.detectorSettings.E3ExitColor); + } + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + // Push polygon matrix + glPushMatrix(); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glScaled(entryExitExaggeration, entryExitExaggeration, 1); + // draw details if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + // Draw polygon + glBegin(GL_LINES); + glVertex2d(1.7, 0); + glVertex2d(-1.7, 0); + glEnd(); + glBegin(GL_QUADS); + glVertex2d(-1.7, .5); + glVertex2d(-1.7, -.5); + glVertex2d(1.7, -.5); + glVertex2d(1.7, .5); + glEnd(); + // first Arrow + glTranslated(1.5, 0, 0); + GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); + GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); + // second Arrow + glTranslated(-3, 0, 0); + GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); + GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); + } else { + // Draw square in drawy for selecting mode + glBegin(GL_QUADS); + glVertex2d(-1.7, 4.3); + glVertex2d(-1.7, -.5); + glVertex2d(1.7, -.5); + glVertex2d(1.7, 4.3); + glEnd(); + } + // Pop polygon matrix + glPopMatrix(); + // Pop detector matrix + glPopMatrix(); + // Check if the distance is enought to draw details + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.detectorDetails, entryExitExaggeration)) { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(myAdditionalGeometry.getShape().getLineCenter().x(), myAdditionalGeometry.getShape().getLineCenter().y(), getType() + 0.1); + // Rotate depending of myBlockIcon.rotation + glRotated(myBlockIcon.rotation, 0, 0, -1); + //move to logo position + glTranslated(1.9, 0, 0); + // scale + glScaled(entryExitExaggeration, entryExitExaggeration, 1); + // draw Entry or Exit logo if isn't being drawn for selecting + if (s.drawForRectangleSelection || s.drawForPositionSelection) { + GLHelper::setColor(s.detectorSettings.E3EntryColor); + GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); + } else if (drawUsingSelectColor()) { + GLHelper::drawText("E3", Position(), .1, 2.8, s.colorSettings.selectedAdditionalColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { + GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3EntryColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { + GLHelper::drawText("E3", Position(), .1, 2.8, s.detectorSettings.E3ExitColor); + } + //move to logo position + glTranslated(1.7, 0, 0); + // Rotate depending of myBlockIcon.rotation + glRotated(90, 0, 0, 1); + // draw Entry or Exit text if isn't being drawn for selecting + if (s.drawForRectangleSelection || s.drawForPositionSelection) { + GLHelper::setColor(s.detectorSettings.E3EntryColor); + GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); + } else if (drawUsingSelectColor()) { + if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { + GLHelper::drawText("Entry", Position(), .1, 1, s.colorSettings.selectedAdditionalColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { + GLHelper::drawText("Exit", Position(), .1, 1, s.colorSettings.selectedAdditionalColor); + } + } else { + if (myTagProperty.getTag() == SUMO_TAG_DET_ENTRY) { + GLHelper::drawText("Entry", Position(), .1, 1, s.detectorSettings.E3EntryColor); + } else if (myTagProperty.getTag() == SUMO_TAG_DET_EXIT) { + GLHelper::drawText("Exit", Position(), .1, 1, s.detectorSettings.E3ExitColor); + } + } + // pop matrix + glPopMatrix(); + // draw lock icon + myBlockIcon.drawIcon(s, entryExitExaggeration, 0.4); + } + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), entryExitExaggeration, myDottedGeometry); + } + // pop gl identificator + glPopName(); + } +} + + +std::string +GNEDetectorEntryExit::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_POSITION: + return toString(myPositionOverLane); + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDetectorEntryExit::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: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_FRIENDLY_POS: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_PARENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorEntryExit::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + return (myNet->retrieveLane(value, false) != nullptr); + case SUMO_ATTR_POSITION: + return canParse(value) && fabs(parse(value)) < getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_PARENT: + return (myNet->retrieveAdditional(SUMO_TAG_E3DETECTOR, value, false) != nullptr); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDetectorEntryExit::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +void +GNEDetectorEntryExit::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myPositionOverLane = parse(value); + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_PARENT: + replaceParentAdditional(this, value, 0); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetectorEntryExit.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,129 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetectorEntryExit.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEDetector.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEDetectorE3; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDetectorEntryExit + * Class for detector of type Entry + */ +class GNEDetectorEntryExit : public GNEDetector { + +public: + /**@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 + * @param[in] parent pointer to GNEDetectorE3 of this GNEDetectorEntryExit belongs + * @param[in] lane Lane of this detector is placed + * @param[in] pos position of the detector on the lane + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + */ + GNEDetectorEntryExit(SumoXMLTag entryExitTag, GNENet* net, GNEAdditional* parent, GNELane* lane, double pos, bool friendlyPos, bool blockMovement); + + /// @brief destructor + ~GNEDetectorEntryExit(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML + bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem + std::string getAdditionalProblem() const; + + /// @brief fix additional problem + void fixAdditionalProblem(); + /// @} + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEDetectorEntryExit(const GNEDetectorEntryExit&) = delete; + + /// @brief Invalidated assignment operator. + GNEDetectorEntryExit& operator=(const GNEDetectorEntryExit&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetector.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetector.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEDetector.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEDetector.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,197 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDetector.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// A abstract class to define common parameters of detectors placed over lanes +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEdetector + * @briefA abstract class to define common parameters and functions of detectors + */ +class GNEDetector : public GNEAdditional { + +public: + /**@brief Constructor. + * @param[in] id Gl-id of the detector (Must be unique) + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] type GUIGlObjectType of detector + * @param[in] tag Type of xml tag that define the detector (SUMO_TAG_E1DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, etc...) + * @param[in] pos position of the detector on the lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] vehicleTypes space separated list of vehicle type ids to consider + * @param[in] filename The path to the output file. + * @param[in] name detector name + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + * @param[in] parentLanes vector of parent lanes + */ + GNEDetector(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, double pos, SUMOTime freq, const std::string& filename, + const std::string& vehicleTypes, const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes); + + /**@brief Constructor. + * @param[in] additionalParent parent additional of this detector (ID will be generated automatically) + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] type GUIGlObjectType of detector + * @param[in] tag Type of xml tag that define the detector (SUMO_TAG_E1DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, etc...) + * @param[in] pos position of the detector on the lane + * @param[in] freq the aggregation period the values the detector collects shall be summed up. + * @param[in] filename The path to the output file. + * @param[in] name detector name + * @param[in] friendlyPos enable or disable friendly positions + * @param[in] block movement enable or disable additional movement + * @param[in] parentLanes vector of parent lanes + */ + GNEDetector(GNEAdditional* additionalParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, double pos, SUMOTime freq, const std::string& filename, + const std::string& name, bool friendlyPos, bool blockMovement, const std::vector& parentLanes); + + /// @brief Destructor + ~GNEDetector(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML (must be reimplemented in all detector children) + virtual bool isAdditionalValid() const = 0; + + /// @brief return a string with the current additional problem (must be reimplemented in all detector children) + virtual std::string getAdditionalProblem() const = 0; + + /// @brief fix additional problem (must be reimplemented in all detector children) + virtual void fixAdditionalProblem() = 0; + /// @} + + /// @brief get lane + GNELane* getLane() const; + + /// @brief get position over lane + double getPositionOverLane() const; + + /// @brief get position over lane that is applicable to the shape + double getGeometryPositionOverLane() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + virtual void moveGeometry(const Position& offset) = 0; + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGLObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /* @brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + /// @} + +protected: + /// @brief position of detector over Lane + double myPositionOverLane; + + /// @brief The aggregation period the values the detector collects shall be summed up. + SUMOTime myFreq; + + /// @brief The path to the output file + std::string myFilename; + + /// @brief attribute vehicle types + std::string myVehicleTypes; + + /// @brief Flag for friendly position + bool myFriendlyPosition; + +private: + /// @brief set attribute after validation + virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; + + /// @brief Invalidate return position of additional + const Position& getPosition() const = delete; + + /// @brief Invalidate set new position in the view + void setPosition(const Position& pos) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,432 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingArea.cpp +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// A lane area vehicles can park at (GNE version) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEParkingArea.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEParkingArea::GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, double angle, bool blockMovement) : + GNEStoppingPlace(id, net, GLO_PARKING_AREA, SUMO_TAG_PARKING_AREA, lane, startPos, endPos, parametersSet, name, friendlyPosition, blockMovement), + myRoadSideCapacity(roadSideCapacity), + myOnRoad(onRoad), + myWidth(width), + myLength(length), + myAngle(angle) { +} + + +GNEParkingArea::~GNEParkingArea() {} + + +void +GNEParkingArea::updateGeometry() { + // first check if object has to be removed from grid (SUMOTree) + if (!myMove.movingGeometryBoundary.isInitialised()) { + myNet->removeGLObjectFromGrid(this); + } + + // Get value of option "lefthand" + double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; + + // Update common geometry of stopping place + setStoppingPlaceGeometry(getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) / 2 + myWidth); + + // Obtain a copy of the shape + PositionVector tmpShape = myAdditionalGeometry.getShape(); + + // Move shape to side + tmpShape.move2side(1.5 * offsetSign); + + // Get position of the sign + mySignPos = tmpShape.getLineCenter(); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set block icon rotation, and using their rotation for sign + myBlockIcon.setRotation(getParentLanes().front()); + + // last step is to check if object has to be added into grid (SUMOTree) again + if (!myMove.movingGeometryBoundary.isInitialised()) { + myNet->addGLObjectIntoGrid(this); + } + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEParkingArea::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myAdditionalGeometry.getShape(), myWidth); +} + + +Boundary +GNEParkingArea::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else if (myAdditionalGeometry.getShape().size() > 0) { + Boundary b = myAdditionalGeometry.getShape().getBoxBoundary(); + b.grow(myWidth + 1); + return b; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNEParkingArea::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEParkingArea::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double parkingAreaExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(parkingAreaExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // Push name + glPushName(getGlID()); + // Push base matrix + glPushMatrix(); + // Traslate matrix + glTranslated(0, 0, getType()); + // Set Color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColor); + } + // Draw base + GNEGeometry::drawGeometry(myNet->getViewNet(), myAdditionalGeometry, myWidth * parkingAreaExaggeration); + // Check if the distance is enought to draw details and if is being drawn for selecting + if (s.drawForRectangleSelection) { + // only draw circle depending of distance between sign and mouse cursor + if (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(mySignPos) <= (myCircleWidthSquared + 2)) { + // Add a draw matrix for details + glPushMatrix(); + // Start drawing sign traslating matrix to signal position + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // scale matrix depending of the exaggeration + glScaled(parkingAreaExaggeration, parkingAreaExaggeration, 1); + // set color + GLHelper::setColor(s.stoppingPlaceSettings.busStopColor); + // Draw circle + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // pop draw matrix + glPopMatrix(); + } + } else if (s.drawDetail(s.detailSettings.stoppingPlaceDetails, parkingAreaExaggeration)) { + // Push matrix for details + glPushMatrix(); + // Set position over sign + glTranslated(mySignPos.x(), mySignPos.y(), 0); + // Scale matrix + glScaled(parkingAreaExaggeration, parkingAreaExaggeration, 1); + // Set base color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColor); + } + // Draw extern + GLHelper::drawFilledCircle(myCircleWidth, s.getCircleResolution()); + // Move to top + glTranslated(0, 0, .1); + // Set sign color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.parkingAreaColorSign); + } + // Draw internt sign + GLHelper::drawFilledCircle(myCircleInWidth, s.getCircleResolution()); + // Draw sign 'C' + if (s.drawDetail(s.detailSettings.stoppingPlaceText, parkingAreaExaggeration) && !s.drawForPositionSelection) { + if (drawUsingSelectColor()) { + GLHelper::drawText("P", Position(), .1, myCircleInText, s.colorSettings.selectedAdditionalColor, myBlockIcon.rotation); + } else { + GLHelper::drawText("P", Position(), .1, myCircleInText, s.stoppingPlaceSettings.parkingAreaColor, myBlockIcon.rotation); + } + } + // Pop sign matrix + glPopMatrix(); + // Draw icon + myBlockIcon.drawIcon(s, parkingAreaExaggeration); + } + // Pop base matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + drawName(getPositionInView(), s.scale, s.addName); + if (s.addFullName.show && (myAdditionalName != "") && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + GLHelper::drawText(myAdditionalName, mySignPos, GLO_MAX - getType(), s.addFullName.scaledSize(s.scale), s.addFullName.color, myBlockIcon.rotation); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), parkingAreaExaggeration, myDottedGeometry); + } + // Pop name matrix + glPopName(); + // draw child demand elements + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPlacedInRTree()) { + i->drawGL(s); + } + } + } +} + + +std::string +GNEParkingArea::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_STARTPOS: + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return toString(myStartPosition); + } else { + return ""; + } + case SUMO_ATTR_ENDPOS: + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return toString(myEndPosition); + } else { + return ""; + } + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FRIENDLY_POS: + return toString(myFriendlyPosition); + case SUMO_ATTR_ROADSIDE_CAPACITY: + return toString(myRoadSideCapacity); + case SUMO_ATTR_ONROAD: + return toString(myOnRoad); + case SUMO_ATTR_WIDTH: + return toString(myWidth); + case SUMO_ATTR_LENGTH: + return myLength; + case SUMO_ATTR_ANGLE: + return toString(myAngle); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEParkingArea::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: { + // change ID of Entry + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Parking Spaces + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_PARKING_SPACE), undoList); + } + break; + } + case SUMO_ATTR_LANE: + case SUMO_ATTR_STARTPOS: + case SUMO_ATTR_ENDPOS: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FRIENDLY_POS: + case SUMO_ATTR_ROADSIDE_CAPACITY: + case SUMO_ATTR_ONROAD: + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_ANGLE: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEParkingArea::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(parse(value), myEndPosition, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(myStartPosition, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, myFriendlyPosition); + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FRIENDLY_POS: + return canParse(value); + case SUMO_ATTR_ROADSIDE_CAPACITY: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_ONROAD: + return canParse(value); + case SUMO_ATTR_WIDTH: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_LENGTH: + if (value.empty()) { + return true; + } else { + return canParse(value) && (parse(value) > 0); + } + case SUMO_ATTR_ANGLE: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEParkingArea::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + break; + case SUMO_ATTR_STARTPOS: + myNet->removeGLObjectFromGrid(this); + if (!value.empty()) { + myStartPosition = parse(value); + myParametersSet |= STOPPINGPLACE_STARTPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_STARTPOS_SET; + } + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_ENDPOS: + myNet->removeGLObjectFromGrid(this); + if (!value.empty()) { + myEndPosition = parse(value); + myParametersSet |= STOPPINGPLACE_ENDPOS_SET; + } else { + myParametersSet &= ~STOPPINGPLACE_ENDPOS_SET; + } + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FRIENDLY_POS: + myFriendlyPosition = parse(value); + break; + case SUMO_ATTR_ROADSIDE_CAPACITY: + myRoadSideCapacity = parse(value); + break; + case SUMO_ATTR_ONROAD: + myOnRoad = parse(value); + break; + case SUMO_ATTR_WIDTH: + myNet->removeGLObjectFromGrid(this); + myWidth = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_LENGTH: + myLength = value; + break; + case SUMO_ATTR_ANGLE: + myAngle = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,131 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingArea.h +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// A class for visualizing ParkingArea geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include "GNEStoppingPlace.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEParkingArea + * @brief A lane area vehicles can park at (netedit-version) + */ +class GNEParkingArea : public GNEStoppingPlace { + +public: + /**@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 + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] startPos Start position of the StoppingPlace + * @param[in] endPos End position of the StoppingPlace + * @param[in] name Name of ParkingArea + * @param[in] friendlyPos enable or disable friendly position + * @param[in] roadSideCapacity road side capacity of ParkingArea + * @param[in] width ParkingArea's length + * @param[in] length ParkingArea's length + * @param[in] angle ParkingArea's angle + * @param[in] block movement enable or disable additional movement + */ + GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const int parametersSet, + const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length, + double angle, bool blockMovement); + + /// @brief Destructor + ~GNEParkingArea(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /// @} + +protected: + /// @brief roadside capacity of Parking Area + int myRoadSideCapacity; + + /// @brief Whether vehicles stay on the road + bool myOnRoad; + + /// @brief width of Parking Area + double myWidth; + + /// @brief Length of Parking Area (by default (endPos - startPos) / roadsideCapacity + std::string myLength; + + /// @brief Angle of Parking Area + double myAngle; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEParkingArea(const GNEParkingArea&) = delete; + + /// @brief Invalidated assignment operator. + GNEParkingArea& operator=(const GNEParkingArea&) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,221 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingAreaReroute.cpp +/// @author Jakob Erdmann +/// @date May 2018 +/// +// +/****************************************************************************/ +#include + +#include +#include + +#include "GNEParkingAreaReroute.h" +#include +#include + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEParkingAreaReroute::GNEParkingAreaReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : + GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet(), GLO_REROUTER, SUMO_TAG_PARKING_ZONE_REROUTE, "", false, +{}, {}, {}, {}, // Parents +{rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet()->getAttributeCarriers()->getAdditionals().at(SUMO_TAG_PARKING_AREA).begin()->second}, +{}, {}, +{}, {}, {}, {}, {}, {}, {}) { + // Children + // fill route type with default values + setDefaultValues(); +} + + +GNEParkingAreaReroute::GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible): + GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getNet(), GLO_REROUTER, SUMO_TAG_PARKING_ZONE_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalParent, newParkingArea}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myProbability(probability), +myVisible(visible) { +} + + +GNEParkingAreaReroute::~GNEParkingAreaReroute() {} + + +void +GNEParkingAreaReroute::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEParkingAreaReroute::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNEParkingAreaReroute::updateGeometry() { + // This additional doesn't own a geometry +} + + +void +GNEParkingAreaReroute::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNEParkingAreaReroute::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNEParkingAreaReroute::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNEParkingAreaReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEParkingAreaReroute::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEParkingAreaReroute::drawGL(const GUIVisualizationSettings& /* s */) const { + // Currently this additional isn't drawn +} + + +std::string +GNEParkingAreaReroute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_PARKING: + return getParentAdditionals().at(1)->getID(); + case SUMO_ATTR_PROB: + return toString(myProbability); + case SUMO_ATTR_VISIBLE: + return toString(myVisible); + case GNE_ATTR_PARENT: + return toString(getParentAdditionals().at(0)->getID()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEParkingAreaReroute::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEParkingAreaReroute::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: + case SUMO_ATTR_PARKING: + case SUMO_ATTR_PROB: + case SUMO_ATTR_VISIBLE: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEParkingAreaReroute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_PARKING: + return isValidAdditionalID(value) && (myNet->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); + case SUMO_ATTR_PROB: + return canParse(value) && parse(value) >= 0 && parse(value) <= 1; + case SUMO_ATTR_VISIBLE: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEParkingAreaReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEParkingAreaReroute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEParkingAreaReroute::getHierarchyName() const { + return getTagStr() + ": " + getParentAdditionals().at(1)->getID(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEParkingAreaReroute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_PARKING: + replaceParentAdditional(this, value, 1); + break; + case SUMO_ATTR_PROB: + myProbability = parse(value); + break; + case SUMO_ATTR_VISIBLE: + myVisible = parse(value); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingAreaReroute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,149 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingAreaReroute.h +/// @author Jakob Erdmann +/// @date May 2018 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEEdge; +class GNERerouterInterval; +class GNERerouterIntervalDialog; +class GNEParkingArea; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEParkingAreaReroute + * forces the rerouter to assign a new route + */ +class GNEParkingAreaReroute : public GNEAdditional { + +public: + /// @brief constructor (Used in GNERerouterIntervalDialog) + GNEParkingAreaReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); + + /// @brief constructor + GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea, double probability, bool visible); + + /// @brief destructor + ~GNEParkingAreaReroute(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief probability with which a vehicle will use the given edge as destination + double myProbability; + + /// @brief enable or disable visibility of Parking Area Reroute + bool myVisible; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEParkingAreaReroute(const GNEParkingAreaReroute&) = delete; + + /// @brief Invalidated assignment operator. + GNEParkingAreaReroute& operator=(const GNEParkingAreaReroute&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,339 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingSpace.cpp +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// A lane area vehicles can halt at (GNE version) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include + +#include "GNEParkingSpace.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEParkingSpace::GNEParkingSpace(GNENet* net, GNEAdditional* parkingAreaParent, const Position& pos, double width, double length, double angle, bool blockMovement) : + GNEAdditional(parkingAreaParent, net, GLO_PARKING_SPACE, SUMO_TAG_PARKING_SPACE, "", blockMovement, +{}, {}, {}, {}, {parkingAreaParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myPosition(pos), +myWidth(width), +myLength(length), +myAngle(angle) { +} + + +GNEParkingSpace::~GNEParkingSpace() {} + + +void +GNEParkingSpace::moveGeometry(const Position& offset) { + // restore old position, apply offset and update Geometry + myPosition = myMove.originalViewPosition; + myPosition.add(offset); + // filtern position using snap to active grid + myPosition = myNet->getViewNet()->snapToActiveGrid(myPosition); + updateGeometry(); +} + + +void +GNEParkingSpace::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), toString(myMove.originalViewPosition))); + undoList->p_end(); +} + + +void +GNEParkingSpace::updateGeometry() { + // Nothing to update +} + + +void +GNEParkingSpace::updateDottedContour() { + // calculate shape using a Position vector as reference + PositionVector shape({ + {-(myWidth / 2), 0}, + { (myWidth / 2), 0}, + { (myWidth / 2), myLength}, + {-(myWidth / 2), myLength}, + }); + // close shape + shape.closePolygon(); + // rotate position vector (note: convert from degree to rads + shape.rotate2D(myAngle * PI / 180.0); + // move to space position + shape.add(myPosition); + // set dotted geometry + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), shape); +} + + +Position +GNEParkingSpace::getPositionInView() const { + return myPosition; +} + + +Boundary +GNEParkingSpace::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else { + // calculate shape using a Position vector as reference + PositionVector boundaryShape({ + {-(myWidth / 2), 0}, + { (myWidth / 2), 0}, + { (myWidth / 2), myLength}, + {-(myWidth / 2), myLength}, + }); + // rotate position vector (note: convert from degree to rads + boundaryShape.rotate2D(myAngle * PI / 180.0); + // move to space position + boundaryShape.add(myPosition); + // return boundary associated to boundaryShape + return boundaryShape.getBoxBoundary().grow(5); + } +} + + +void +GNEParkingSpace::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEParkingSpace::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEParkingSpace::drawGL(const GUIVisualizationSettings& s) const { + // Set initial values + const double parkingAreaExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(parkingAreaExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // push name and matrix + glPushName(getGlID()); + glPushMatrix(); + // Traslate matrix and draw green contour + glTranslated(myPosition.x(), myPosition.y(), getType() + 0.1); + glRotated(myAngle, 0, 0, 1); + // only drawn small box if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + // Set Color depending of selection + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.parkingSpaceColorContour); + } + GLHelper::drawBoxLine(Position(0, myLength + 0.05), 0, myLength + 0.1, (myWidth / 2) + 0.05); + } + // Traslate matrix and draw blue innen + glTranslated(0, 0, 0.1); + // Set Color depending of selection + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.stoppingPlaceSettings.parkingSpaceColor); + } + GLHelper::drawBoxLine(Position(0, myLength), 0, myLength, myWidth / 2); + // Traslate matrix and draw lock icon if isn't being drawn for selecting + glTranslated(0, myLength / 2, 0.1); + myBlockIcon.drawIcon(s, parkingAreaExaggeration); + // pop draw matrix + glPopMatrix(); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), parkingAreaExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +std::string +GNEParkingSpace::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_POSITION: + return toString(myPosition); + case SUMO_ATTR_WIDTH: + return toString(myWidth); + case SUMO_ATTR_LENGTH: + return toString(myLength); + case SUMO_ATTR_ANGLE: + return toString(myAngle); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEParkingSpace::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEParkingSpace::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: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_ANGLE: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_PARENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEParkingSpace::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_WIDTH: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_LENGTH: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_ANGLE: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_PARENT: + return (myNet->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEParkingSpace::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEParkingSpace::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEParkingSpace::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_POSITION); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEParkingSpace::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_POSITION: + myNet->removeGLObjectFromGrid(this); + myPosition = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_WIDTH: + myNet->removeGLObjectFromGrid(this); + myWidth = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_LENGTH: + myNet->removeGLObjectFromGrid(this); + myLength = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_ANGLE: + myNet->removeGLObjectFromGrid(this); + myAngle = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_PARENT: + replaceParentAdditional(this, value, 0); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEParkingSpace.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,158 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEParkingSpace.h +/// @author Pablo Alvarez Lopez +/// @date Feb 2018 +/// +// A class for visualizing ParkingSpace geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEParkingArea; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEParkingSpace + * @brief vehicle space used by GNEParkingAreas + */ +class GNEParkingSpace : public GNEAdditional { + +public: + /**@brief Constructor + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] parkingAreaParent pointer to Parking Area parent + * @param[in] pos ParkingSpace's X-Y position + * @param[in] width ParkingArea's width + * @param[in] length ParkingArea's length + * @param[in] angle ParkingArea's angle + * @param[in] block movement enable or disable additional movement + */ + GNEParkingSpace(GNENet* net, GNEAdditional* parkingAreaParent, const Position& pos, double width, double length, double angle, bool blockMovement); + + /// @brief Destructor + ~GNEParkingSpace(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief position of Parking Space in view + Position myPosition; + + /// @brief width of Parking Space + double myWidth; + + /// @brief Length of Parking Space + double myLength; + + /// @brief Angle of Parking Space + double myAngle; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEParkingSpace(const GNEParkingSpace&) = delete; + + /// @brief Invalidated assignment operator. + GNEParkingSpace& operator=(const GNEParkingSpace&) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPOI.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPOI.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPOI.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPOI.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,564 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPOI.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// A class for visualizing and editing POIS in netedit (adapted from +// GUIPointOfInterest and NLHandler) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPOI.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEPOI::GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, + const Position& pos, bool geo, double layer, double angle, const std::string& imgFile, + bool relativePath, double width, double height, bool movementBlocked) : + GUIPointOfInterest(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, width, height), + GNEShape(net, SUMO_TAG_POI, movementBlocked, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}) { + // Children + // set GEO Position + myGEOPosition = pos; + GeoConvHelper::getFinal().cartesian2geo(myGEOPosition); +} + + +GNEPOI::GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, + double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane, double posLat, + double width, double height, bool movementBlocked) : + GUIPointOfInterest(id, type, color, Position(), false, lane->getID(), posOverLane, posLat, layer, angle, imgFile, relativePath, width, height), + GNEShape(net, SUMO_TAG_POILANE, movementBlocked, +{}, {}, {lane}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}) { + // Children +} + + +GNEPOI::~GNEPOI() {} + + +const std::string& +GNEPOI::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNEPOI::getGUIGlObject() { + return this; +} + + +std::string +GNEPOI::generateChildID(SumoXMLTag childTag) { + int counter = (int)myNet->getAttributeCarriers()->getShapes().at(SUMO_TAG_POI).size(); + while ((myNet->retrieveShape(SUMO_TAG_POI, getID() + toString(childTag) + toString(counter), false) != nullptr) && + (myNet->retrieveShape(SUMO_TAG_POILANE, getID() + toString(childTag) + toString(counter), false) != nullptr)) { + counter++; + } + return (getID() + toString(childTag) + toString(counter)); +} + + +void +GNEPOI::setParameter(const std::string& key, const std::string& value) { + Parameterised::setParameter(key, value); +} + + +void +GNEPOI::startPOIGeometryMoving() { + myPositionBeforeMoving = *this; +} + + +void +GNEPOI::endPOIGeometryMoving() { +} + + +void +GNEPOI::writeShape(OutputDevice& device) { + if (getParentLanes().size() > 0) { + // obtain fixed position over lane + double fixedPositionOverLane = myPosOverLane > getParentLanes().at(0)->getLaneShape().length() ? getParentLanes().at(0)->getLaneShape().length() : myPosOverLane < 0 ? 0 : myPosOverLane; + // write POILane using POI::writeXML + writeXML(device, false, 0, getParentLanes().at(0)->getID(), fixedPositionOverLane, myPosLat); + } else { + writeXML(device, myGeo); + } +} + + +void +GNEPOI::movePOIGeometry(const Position& offset) { + if (!myBlockMovement) { + // Calculate new position using old position + Position newPosition = myPositionBeforeMoving; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + // set position depending of POI Type + if (getParentLanes().size() > 0) { + myPosOverLane = getParentLanes().at(0)->getLaneShape().nearest_offset_to_point2D(newPosition, false); + } else { + set(newPosition); + } + // Update geometry + updateGeometry(); + } +} + + +void +GNEPOI::commitPOIGeometryMoving(GNEUndoList* undoList) { + if (!myBlockMovement) { + // restore original Position before moving (to avoid problems in GL Tree) + Position myNewPosition(*this); + set(myPositionBeforeMoving); + // commit new position allowing undo/redo + if (getParentLanes().size() > 0) { + // restore old position before commit new position + double originalPosOverLane = getParentLanes().at(0)->getLaneShape().nearest_offset_to_point2D(myPositionBeforeMoving, false); + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosOverLane), toString(originalPosOverLane))); + undoList->p_end(); + } else { + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myNewPosition), toString(myPositionBeforeMoving))); + undoList->p_end(); + } + } +} + + +void +GNEPOI::updateGeometry() { + if (getParentLanes().size() > 0) { + // obtain fixed position over lane + double fixedPositionOverLane = myPosOverLane > getParentLanes().at(0)->getLaneShapeLength() ? getParentLanes().at(0)->getLaneShapeLength() : myPosOverLane < 0 ? 0 : myPosOverLane; + // set new position regarding to lane + set(getParentLanes().at(0)->getLaneShape().positionAtOffset(fixedPositionOverLane * getParentLanes().at(0)->getLengthGeometryFactor(), -myPosLat)); + } + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEPOI::updateDottedContour() { + // check if we have to calculate buuble or shape + if (getShapeImgFile() != DEFAULT_IMG_FILE) { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), *this, getShapeNaviDegree(), getWidth(), getHeight()); + } else { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), GNEGeometry::getVertexCircleAroundPosition(*this, 1.5, 32)); + } +} + + +Position +GNEPOI::getPositionInView() const { + return Position(x(), y()); +} + + +Boundary +GNEPOI::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMovingGeometryBoundary.isInitialised()) { + return myMovingGeometryBoundary; + } else { + return GUIPointOfInterest::getCenteringBoundary(); + } +} + + +GUIGlID +GNEPOI::getGlID() const { + return GUIPointOfInterest::getGlID(); +} + + +std::string +GNEPOI::getParentName() const { + if (getParentLanes().size() > 0) { + return getParentLanes().front()->getID(); + } else { + return myNet->getMicrosimID(); + } +} + + +GUIGLObjectPopupMenu* +GNEPOI::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + if (getParentLanes().size() > 0) { + // build shape header + buildShapePopupOptions(app, ret, getShapeType()); + // add option for convert to GNEPOI + new FXMenuCommand(ret, ("Release from " + toString(SUMO_TAG_LANE)).c_str(), GUIIconSubSys::getIcon(GUIIcon::LANE), &parent, MID_GNE_POI_TRANSFORM); + return ret; + } else { + // build shape header + buildShapePopupOptions(app, ret, getShapeType()); + // add option for convert to GNEPOI + new FXMenuCommand(ret, ("Attach to nearest " + toString(SUMO_TAG_LANE)).c_str(), GUIIconSubSys::getIcon(GUIIcon::LANE), &parent, MID_GNE_POI_TRANSFORM); + } + return ret; +} + + +GUIParameterTableWindow* +GNEPOI::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) { + return GUIPointOfInterest::getParameterWindow(app, parent); +} + + +void +GNEPOI::drawGL(const GUIVisualizationSettings& s) const { + // first check if POI can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showShapes() && myNet->getViewNet()->getDataViewOptions().showShapes()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // check if POI can be drawn + if (checkDraw(s)) { + // obtain POIExaggeration + const double POIExaggeration = s.poiSize.getExaggeration(s, this); + // push name (needed for getGUIGlObjectsUnderCursor(...) + glPushName(getGlID()); + // draw inner polygon + drawInnerPOI(s, drawUsingSelectColor()); + // draw an orange square mode if there is an image(see #4036) + if (!getShapeImgFile().empty() && myNet->getViewNet()->getTestingMode().isTestingEnabled()) { + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(x(), y(), getType() + 0.01); + GLHelper::setColor(RGBColor::ORANGE); + GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); + glPopMatrix(); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), POIExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } + } +} + + +std::string +GNEPOI::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return myID; + case SUMO_ATTR_COLOR: + return toString(getShapeColor()); + case SUMO_ATTR_LANE: + return myLane; + case SUMO_ATTR_POSITION: + if (getParentLanes().size() > 0) { + return toString(myPosOverLane); + } else { + return toString(*this); + } + case SUMO_ATTR_POSITION_LAT: + return toString(myPosLat); + case SUMO_ATTR_GEOPOSITION: + return toString(myGEOPosition, gPrecisionGeo); + case SUMO_ATTR_GEO: + return toString(myGeo); + case SUMO_ATTR_TYPE: + return getShapeType(); + case SUMO_ATTR_LAYER: + if (getShapeLayer() == Shape::DEFAULT_LAYER_POI) { + return "default"; + } else { + return toString(getShapeLayer()); + } + case SUMO_ATTR_IMGFILE: + return getShapeImgFile(); + case SUMO_ATTR_RELATIVEPATH: + return toString(getShapeRelativePath()); + case SUMO_ATTR_WIDTH: + return toString(getWidth()); + case SUMO_ATTR_HEIGHT: + return toString(getHeight()); + case SUMO_ATTR_ANGLE: + return toString(getShapeNaviDegree()); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " attribute '" + toString(key) + "' not allowed"); + } +} + + +void +GNEPOI::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: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_LANE: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_POSITION_LAT: + case SUMO_ATTR_GEOPOSITION: + case SUMO_ATTR_GEO: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_LAYER: + case SUMO_ATTR_IMGFILE: + case SUMO_ATTR_RELATIVEPATH: + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_HEIGHT: + case SUMO_ATTR_ANGLE: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEPOI::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return SUMOXMLDefinitions::isValidTypeID(value) && + (myNet->retrieveShape(SUMO_TAG_POI, value, false) == nullptr) && + (myNet->retrieveShape(SUMO_TAG_POILANE, value, false) == nullptr); + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_LANE: + return (myNet->retrieveLane(value, false) != nullptr); + case SUMO_ATTR_POSITION: + if (getParentLanes().size() > 0) { + return canParse(value); + } else { + return canParse(value); + } + case SUMO_ATTR_POSITION_LAT: + return canParse(value); + case SUMO_ATTR_GEOPOSITION: { + return canParse(value); + } + case SUMO_ATTR_GEO: + return canParse(value); + case SUMO_ATTR_TYPE: + return true; + case SUMO_ATTR_LAYER: + if (value == "default") { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_IMGFILE: + if (value == "") { + return true; + } else { + // check that image can be loaded + return GUITexturesHelper::getTextureID(value) != -1; + } + case SUMO_ATTR_RELATIVEPATH: + return canParse(value); + case SUMO_ATTR_WIDTH: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_HEIGHT: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_ANGLE: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEPOI::isAttributeEnabled(SumoXMLAttr /* key */) const { + // check if we're in supermode Network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + return true; + } else { + return false; + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEPOI::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: { + // note: getAttributeCarriers().updateID doesn't change Microsim ID in GNEShapes + myNet->getAttributeCarriers()->updateID(this, value); + // set named ID + myID = value; + break; + } + case SUMO_ATTR_COLOR: + setShapeColor(parse(value)); + break; + case SUMO_ATTR_LANE: + myLane = value; + replaceParentLanes(this, value); + break; + case SUMO_ATTR_POSITION: { + if (getParentLanes().size() > 0) { + myPosOverLane = parse(value); + } else { + // first remove object from grid due position is used for boundary + myNet->removeGLObjectFromGrid(this); + // set position + set(parse(value)); + // set GEO Position + myGEOPosition.setx(this->x()); + myGEOPosition.sety(this->y()); + myGEOPosition.setz(this->z()); + GeoConvHelper::getFinal().cartesian2geo(myGEOPosition); + // add object into grid again + myNet->addGLObjectIntoGrid(this); + } + break; + } + case SUMO_ATTR_POSITION_LAT: + myPosLat = parse(value); + break; + case SUMO_ATTR_GEOPOSITION: { + // first remove object from grid due position is used for boundary + myNet->removeGLObjectFromGrid(this); + // set new position + myGEOPosition = parse(value); + // set cartesian Position + set(myGEOPosition); + GeoConvHelper::getFinal().x2cartesian_const(*this); + // add object into grid again + myNet->addGLObjectIntoGrid(this); + break; + } + case SUMO_ATTR_GEO: + myGeo = parse(value); + break; + case SUMO_ATTR_TYPE: + setShapeType(value); + break; + case SUMO_ATTR_LAYER: + if (value == "default") { + setShapeLayer(Shape::DEFAULT_LAYER_POI); + } else { + setShapeLayer(parse(value)); + } + break; + case SUMO_ATTR_IMGFILE: + // first remove object from grid due img file affect to boundary + myNet->removeGLObjectFromGrid(this); + setShapeImgFile(value); + // all textures must be refresh + GUITexturesHelper::clearTextures(); + // add object into grid again + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_RELATIVEPATH: + setShapeRelativePath(parse(value)); + break; + case SUMO_ATTR_WIDTH: + if (getParentLanes().size() > 0) { + // set new width + setWidth(parse(value)); + } else { + // first remove object from grid due position is used for boundary + myNet->removeGLObjectFromGrid(this); + // set new width + setWidth(parse(value)); + // add object into grid again + myNet->addGLObjectIntoGrid(this); + } + break; + case SUMO_ATTR_HEIGHT: + if (getParentLanes().size() > 0) { + // set new height + setHeight(parse(value)); + } else { + // first remove object from grid due position is used for boundary + myNet->removeGLObjectFromGrid(this); + // set new height + setHeight(parse(value)); + // add object into grid again + myNet->addGLObjectIntoGrid(this); + } + break; + case SUMO_ATTR_ANGLE: + setShapeNaviDegree(parse(value)); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " attribute '" + toString(key) + "' not allowed"); + } +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPOI.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPOI.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPOI.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPOI.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,224 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPOI.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// A class for visualizing and editing POIS in netedit (adapted from +// GUIPointOfInterest and NLHandler) +/****************************************************************************/ +#pragma once +#include +#include + +#include "GNEShape.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GNELane; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEPOI + * + * In the case the represented junction's shape is empty, the boundary + * is computed using the junction's position to which an offset of 1m to each + * side is added. + */ +class GNEPOI : public GUIPointOfInterest, public GNEShape { + +public: + /// @brief needed to avoid diamond Problem between GUIPointOfInterest and GNEShape + using GNEShape::getID; + + /** @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 + * @param[in] color The color of the POI + * @param[in] pos The position of the POI + * @param[in[ geo use GEO coordinates (lon/lat) + * @param[in] layer The layer of the POI + * @param[in] angle The rotation of the POI + * @param[in] imgFile The raster image of the shape + * @param[in] relativePath set image file as relative path + * @param[in] width The width of the POI image + * @param[in] height The height of the POI image + * @param[in] movementBlocked if movement of POI is blocked + */ + GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, + double layer, double angle, const std::string& imgFile, bool relativePath, double width, double height, bool movementBlocked); + + /** @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 + * @param[in] color The color of the POI + * @param[in] layer The layer of the POI + * @param[in] angle The rotation of the POI + * @param[in] imgFile The raster image of the shape + * @param[in] relativePath set image file as relative path + * @param[in] lane lane in which this POILane is placed + * @param[in] posOverLane Position over lane in which this POILane is placed + * @param[in] posLat Lateral position over lane + * @param[in] width The width of the POI image + * @param[in] height The height of the POI image + * @param[in] movementBlocked if movement of POI is blocked + */ + GNEPOI(GNENet* net, const std::string& id, const std::string& type, const RGBColor& color, + double layer, double angle, const std::string& imgFile, bool relativePath, GNELane* lane, double posOverLane, + double posLat, double width, double height, bool movementBlocked); + + /// @brief Destructor + ~GNEPOI(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /**@brief Sets a parameter + * @param[in] key The parameter's name + * @param[in] value The parameter's value + */ + void setParameter(const std::string& key, const std::string& value); + + /// @name functions for edit geometry + /// @{ + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startPOIGeometryMoving(); + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void endPOIGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] newPosition new position of geometry + * @note should't be called in drawGL(...) functions to avoid smoothness issues + */ + void movePOIGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitPOIGeometryMoving(GNEUndoList* undoList); + /// @} + + /// @name inherited from GNEShape + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /**@brief writte shape element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeShape(OutputDevice& device); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the numerical id of the object + GUIGlID getGlID() const; + + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +protected: + /// @brief Position of POI in GEO coordinates (Only used by POIs that aren't placed over lanes) + Position myGEOPosition; + +private: + /// @brief position used for move Lanes + Position myPositionBeforeMoving; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEPOI(const GNEPOI&) = delete; + + /// @brief Invalidated assignment operator. + GNEPOI& operator=(const GNEPOI&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPoly.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPoly.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPoly.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPoly.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,928 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPoly.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// A class for visualizing and editing POIS in netedit (adapted from +// GUIPolygon and NLHandler) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPoly.h" + + +// =========================================================================== +// static members +// =========================================================================== + +const double GNEPoly::myHintSize = 0.8; + +// =========================================================================== +// method definitions +// =========================================================================== +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, bool movementBlocked, bool shapeBlocked) : + GUIPolygon(id, type, color, shape, geo, fill, lineWidth, layer, angle, imgFile, relativePath), + GNEShape(net, SUMO_TAG_POLY, movementBlocked, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +myNetworkElementShapeEdited(nullptr), +myBlockShape(shapeBlocked), +myClosedShape(shape.front() == shape.back()), +mySimplifiedShape(false), +myCurrentMovingVertexIndex(-1) { + // check if imgFile is valid + if (!imgFile.empty() && GUITexturesHelper::getTextureID(imgFile) == -1) { + setShapeImgFile(""); + } + // set GEO shape + myGeoShape = myShape; + for (int i = 0; i < (int) myGeoShape.size(); i++) { + GeoConvHelper::getFinal().cartesian2geo(myGeoShape[i]); + } +} + + +GNEPoly::~GNEPoly() {} + + +const std::string& +GNEPoly::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNEPoly::getGUIGlObject() { + return this; +} + + +std::string +GNEPoly::generateChildID(SumoXMLTag childTag) { + int counter = (int)myNet->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY).size(); + while (myNet->retrieveShape(SUMO_TAG_POLY, getID() + toString(childTag) + toString(counter), false) != nullptr) { + counter++; + } + return (getID() + toString(childTag) + toString(counter)); +} + + +void +GNEPoly::setParameter(const std::string& key, const std::string& value) { + Parameterised::setParameter(key, value); +} + + +void +GNEPoly::startPolyShapeGeometryMoving(const double shapeOffset) { + // save current centering boundary + myMovingGeometryBoundary = getCenteringBoundary(); + // start move shape depending of block shape + if (myBlockShape) { + startMoveShape(myShape, -1, myHintSize); + } else { + startMoveShape(myShape, shapeOffset, myHintSize); + } +} + + +void +GNEPoly::endPolyShapeGeometryMoving() { + // check that endGeometryMoving was called only once + if (myMovingGeometryBoundary.isInitialised()) { + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // reset myMovingGeometryBoundary + myMovingGeometryBoundary.reset(); + // add object into grid again (using the new centering boundary) + myNet->addGLObjectIntoGrid(this); + } +} + + +int +GNEPoly::getPolyVertexIndex(Position pos, const bool snapToGrid) const { + // check if position has to be snapped to grid + if (snapToGrid) { + pos = myNet->getViewNet()->snapToActiveGrid(pos); + } + const double offset = myShape.nearest_offset_to_point2D(pos, true); + if (offset == GeomHelper::INVALID_OFFSET) { + return -1; + } + Position newPos = myShape.positionAtOffset2D(offset); + // first check if vertex already exists in the inner geometry + for (int i = 0; i < (int)myShape.size(); i++) { + if (myShape[i].distanceTo2D(newPos) < myHintSize) { + // index refers to inner geometry + if (i == 0 || i == (int)(myShape.size() - 1)) { + return -1; + } + return i; + } + } + return -1; +} + + +void +GNEPoly::movePolyShape(const Position& offset) { + // first obtain a copy of shapeBeforeMoving + PositionVector newShape = getShapeBeforeMoving(); + if (moveEntireShape()) { + // move entire shape + newShape.add(offset); + } else { + int geometryPointIndex = getGeometryPointIndex(); + // if geometryPoint is -1, then we have to create a new geometry point + if (geometryPointIndex == -1) { + geometryPointIndex = newShape.insertAtClosest(getPosOverShapeBeforeMoving(), true); + } + // get last index + const int lastIndex = (int)newShape.size() - 1; + // check if we have to move first and last postion + if ((newShape.size() > 2) && (newShape.front() == newShape.back()) && + ((geometryPointIndex == 0) || (geometryPointIndex == lastIndex))) { + // move first and last position in newShape + newShape[0].add(offset); + newShape[lastIndex] = newShape[0]; + } else { + // move geometry point within newShape + newShape[geometryPointIndex].add(offset); + } + } + // set new poly shape + myShape = newShape; +} + + +void +GNEPoly::commitPolyShapeChange(GNEUndoList* undoList) { + // restore original shape into shapeToCommit + PositionVector shapeToCommit = myShape; + // get geometryPoint radius + const double geometryPointRadius = myHintSize * myNet->getViewNet()->getVisualisationSettings().junctionSize.exaggeration; + // remove double points + shapeToCommit.removeDoublePoints(geometryPointRadius); + // check if we have to merge start and end points + if ((shapeToCommit.front() != shapeToCommit.back()) && (shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < geometryPointRadius)) { + shapeToCommit[0] = shapeToCommit.back(); + } + // update geometry + updateGeometry(); + // restore old geometry to allow change attribute (And restore shape if during movement a new point was created + myShape = getShapeBeforeMoving(); + // finish geometry moving + endPolyShapeGeometryMoving(); + // commit new shape + undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_SHAPE, toString(shapeToCommit))); + undoList->p_end(); +} + + +void +GNEPoly::updateGeometry() { + // Nothing to update +} + + +void +GNEPoly::updateDottedContour() { + if (myShape.isClosed()) { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myShape); + } else { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myShape, 0); + } +} + + +void +GNEPoly::writeShape(OutputDevice& device) { + writeXML(device, myGEO); +} + + +Position +GNEPoly::getPositionInView() const { + return myShape.getPolygonCenter(); +} + + +Boundary +GNEPoly::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMovingGeometryBoundary.isInitialised()) { + return myMovingGeometryBoundary; + } else { + return GUIPolygon::getCenteringBoundary(); + } +} + + +GUIGlID +GNEPoly::getGlID() const { + return GUIPolygon::getGlID(); +} + + +std::string +GNEPoly::getParentName() const { + if (myNetworkElementShapeEdited != nullptr) { + return myNetworkElementShapeEdited->getID(); + } else { + return myNet->getMicrosimID(); + } +} + + +GUIGLObjectPopupMenu* +GNEPoly::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + FXMenuCommand* simplifyShape = new FXMenuCommand(ret, "Simplify Shape\t\tReplace current shape with a rectangle", nullptr, &parent, MID_GNE_POLYGON_SIMPLIFY_SHAPE); + // disable simplify shape if polygon was already simplified + if (mySimplifiedShape || myShape.size() <= 2) { + simplifyShape->disable(); + } + // create open or close polygon's shape only if myNetworkElementShapeEdited is nullptr + if (myNetworkElementShapeEdited == nullptr) { + if (myClosedShape) { + new FXMenuCommand(ret, "Open shape\t\tOpen polygon's shape", nullptr, &parent, MID_GNE_POLYGON_OPEN); + } else { + new FXMenuCommand(ret, "Close shape\t\tClose polygon's shape", nullptr, &parent, MID_GNE_POLYGON_CLOSE); + } + } + // create a extra FXMenuCommand if mouse is over a vertex + int index = getVertexIndex(myNet->getViewNet()->getPositionInformation(), false); + if (index != -1) { + FXMenuCommand* removeGeometryPoint = new FXMenuCommand(ret, "Remove geometry point\t\tRemove geometry point under mouse", nullptr, &parent, MID_GNE_POLYGON_DELETE_GEOMETRY_POINT); + FXMenuCommand* setFirstPoint = new FXMenuCommand(ret, "Set first geometry point\t\tSet", nullptr, &parent, MID_GNE_POLYGON_SET_FIRST_POINT); + // disable setFirstPoint if shape only have three points + if ((myClosedShape && (myShape.size() <= 4)) || (!myClosedShape && (myShape.size() <= 2))) { + removeGeometryPoint->disable(); + } + // disable setFirstPoint if mouse is over first point + if (index == 0) { + setFirstPoint->disable(); + } + } + return ret; +} + + +GUIParameterTableWindow* +GNEPoly::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) { + return GUIPolygon::getParameterWindow(app, parent); +} + + +void +GNEPoly::drawGL(const GUIVisualizationSettings& s) const { + // first obtain poly exaggeration + const double polyExaggeration = s.polySize.getExaggeration(s, this); + // first check if poly can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showShapes() && myNet->getViewNet()->getDataViewOptions().showShapes() && (polyExaggeration > 0)) { + // Obtain constants + const Position mousePosition = myNet->getViewNet()->getPositionInformation(); + const double vertexWidth = myHintSize * MIN2((double)1, s.polySize.getExaggeration(s, this)); + const double vertexWidthSquared = (vertexWidth * vertexWidth); + const double contourWidth = (myHintSize / 4.0) * polyExaggeration; + const bool moveMode = (myNet->getViewNet()->getEditModes().networkEditMode != NetworkEditMode::NETWORK_MOVE); + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // push name (needed for getGUIGlObjectsUnderCursor(...) + glPushName(getGlID()); + // first check if inner polygon can be drawn + if (s.drawForPositionSelection && getFill()) { + if ((moveMode || myBlockShape) && myShape.around(mousePosition)) { + // push matrix + glPushMatrix(); + glTranslated(mousePosition.x(), mousePosition.y(), GLO_POLYGON + 0.04); + setColor(s, false); + GLHelper::drawFilledCircle(1, s.getCircleResolution()); + glPopMatrix(); + } + } else if (checkDraw(s)) { + // draw inner polygon + drawInnerPolygon(s, drawUsingSelectColor()); + } + // draw geometry details hints if is not too small and isn't in selecting mode + if (s.scale * vertexWidth > 1.) { + // obtain values relative to mouse position regarding to shape + bool mouseOverVertex = false; + const double distanceToShape = myShape.distance2D(mousePosition); + const Position positionOverLane = myShape.positionAtOffset2D(myShape.nearest_offset_to_point2D(mousePosition)); + // set colors + RGBColor invertedColor, darkerColor; + if (drawUsingSelectColor()) { + invertedColor = s.colorSettings.selectionColor.invertedColor(); + darkerColor = s.colorSettings.selectionColor.changedBrightness(-32); + } else { + invertedColor = GLHelper::getColor().invertedColor(); + darkerColor = GLHelper::getColor().changedBrightness(-32); + } + // Draw geometry hints if polygon's shape isn't blocked + if (myBlockShape == false) { + // draw a boundary for moving using darkerColor + glPushMatrix(); + glTranslated(0, 0, GLO_POLYGON + 0.01); + GLHelper::setColor(darkerColor); + if (s.drawForPositionSelection) { + if (positionOverLane.distanceSquaredTo2D(mousePosition) <= (contourWidth * contourWidth)) { + // push matrix + glPushMatrix(); + // translate to position over lane + glTranslated(positionOverLane.x(), positionOverLane.y(), 0); + // Draw circle + GLHelper::drawFilledCircle(contourWidth, myNet->getViewNet()->getVisualisationSettings().getCircleResolution()); + // pop draw matrix + glPopMatrix(); + } + } else if (!s.drawForPositionSelection) { + GLHelper::drawBoxLines(myShape, (myHintSize / 4) * s.polySize.getExaggeration(s, this)); + } + glPopMatrix(); + // draw shape points only in Network supemode + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + for (const auto& vertex : myShape) { + if (!s.drawForRectangleSelection || (mousePosition.distanceSquaredTo2D(vertex) <= (vertexWidthSquared + 2))) { + glPushMatrix(); + glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.02); + // Change color of vertex and flag mouseOverVertex if mouse is over vertex + if ((myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE) && (vertex.distanceSquaredTo2D(mousePosition) < vertexWidthSquared)) { + mouseOverVertex = true; + GLHelper::setColor(invertedColor); + } else { + GLHelper::setColor(darkerColor); + } + GLHelper::drawFilledCircle(vertexWidth, s.getCircleResolution()); + glPopMatrix(); + // draw elevation or special symbols (Start, End and Block) + if (!s.drawForRectangleSelection && !s.drawForPositionSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { + // Push matrix + glPushMatrix(); + // Traslate to center of detector + glTranslated(vertex.x(), vertex.y(), getType() + 1); + // draw Z + GLHelper::drawText(toString(vertex.z()), Position(), .1, 0.7, RGBColor::BLUE); + // pop matrix + glPopMatrix(); + } else if ((vertex == myShape.front()) && !s.drawForRectangleSelection && + s.drawDetail(s.detailSettings.geometryPointsText, polyExaggeration)) { + // draw a "s" over first point + glPushMatrix(); + glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.03); + GLHelper::drawText("S", Position(), .1, 2 * vertexWidth, invertedColor); + glPopMatrix(); + } else if ((vertex == myShape.back()) && (myClosedShape == false) && !s.drawForRectangleSelection && + s.drawDetail(s.detailSettings.geometryPointsText, polyExaggeration)) { + // draw a "e" over last point if polygon isn't closed + glPushMatrix(); + glTranslated(vertex.x(), vertex.y(), GLO_POLYGON + 0.03); + GLHelper::drawText("E", Position(), .1, 2 * vertexWidth, invertedColor); + glPopMatrix(); + } + } + } + // check if draw moving hint has to be drawed + if ((myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE) && (distanceToShape < vertexWidth) && + (mouseOverVertex == false) && (myBlockMovement == false)) { + // push matrix + glPushMatrix(); + const Position hintPos = myShape.size() > 1 ? positionOverLane : myShape[0]; + glTranslated(hintPos.x(), hintPos.y(), GLO_POLYGON + 0.04); + GLHelper::setColor(invertedColor); + GLHelper:: drawFilledCircle(vertexWidth, s.getCircleResolution()); + glPopMatrix(); + } + } + } + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), polyExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +int +GNEPoly::getVertexIndex(Position pos, bool snapToGrid) { + // check if position has to be snapped to grid + if (snapToGrid) { + pos = myNet->getViewNet()->snapToActiveGrid(pos); + } + // first check if vertex already exists + for (auto i : myShape) { + if (i.distanceTo2D(pos) < myHintSize) { + return myShape.indexOfClosest(i); + } + } + return -1; +} + + +void +GNEPoly::deleteGeometryPoint(const Position& pos, bool allowUndo) { + if (myShape.size() > 1) { + // obtain index + PositionVector modifiedShape = myShape; + int index = modifiedShape.indexOfClosest(pos); + // remove point dependending of + if (myClosedShape && (index == 0 || index == (int)modifiedShape.size() - 1) && (myShape.size() > 2)) { + modifiedShape.erase(modifiedShape.begin()); + modifiedShape.erase(modifiedShape.end() - 1); + modifiedShape.push_back(modifiedShape.front()); + } else { + modifiedShape.erase(modifiedShape.begin() + index); + } + // set new shape depending of allowUndo + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("delete geometry point"); + setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // first remove object from grid due shape is used for boundary + myNet->removeGLObjectFromGrid(this); + // set new shape + myShape = modifiedShape; + // Check if new shape is closed + myClosedShape = (myShape.front() == myShape.back()); + // disable simplified shape flag + mySimplifiedShape = false; + // add object into grid again + myNet->addGLObjectIntoGrid(this); + } + } else { + WRITE_WARNING("Number of remaining points insufficient") + } +} + + +bool +GNEPoly::isPolygonBlocked() const { + return myBlockShape; +} + + +bool +GNEPoly::isPolygonClosed() const { + return myClosedShape; +} + + +void +GNEPoly::setShapeEditedElement(GNENetworkElement* element) { + if (element) { + myNetworkElementShapeEdited = element; + } else { + throw InvalidArgument("Junction cannot be nullptr"); + } +} + + +GNENetworkElement* +GNEPoly::getShapeEditedElement() const { + return myNetworkElementShapeEdited; +} + + +void +GNEPoly::openPolygon(bool allowUndo) { + // only open if shape is closed + if (myClosedShape) { + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("open polygon"); + setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + myClosedShape = false; + myShape.pop_back(); + // disable simplified shape flag + mySimplifiedShape = false; + // update geometry to avoid grabbing Problems + updateGeometry(); + } + } else { + WRITE_WARNING("Polygon already opened") + } +} + + +void +GNEPoly::closePolygon(bool allowUndo) { + // only close if shape is opened + if (myClosedShape == false) { + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("close shape"); + setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + myClosedShape = true; + myShape.closePolygon(); + // disable simplified shape flag + mySimplifiedShape = false; + // update geometry to avoid grabbing Problems + updateGeometry(); + } + } else { + WRITE_WARNING("Polygon already closed") + } +} + + +void +GNEPoly::changeFirstGeometryPoint(int oldIndex, bool allowUndo) { + // check that old index is correct + if (oldIndex >= (int)myShape.size()) { + throw InvalidArgument("Invalid old Index"); + } else if (oldIndex == 0) { + WRITE_WARNING("Selected point must be different of the first point") + } else { + // Configure new shape + PositionVector newShape; + for (int i = oldIndex; i < (int)myShape.size(); i++) { + newShape.push_back(myShape[i]); + } + if (myClosedShape) { + for (int i = 1; i < oldIndex; i++) { + newShape.push_back(myShape[i]); + } + newShape.push_back(newShape.front()); + } else { + for (int i = 0; i < oldIndex; i++) { + newShape.push_back(myShape[i]); + } + } + // set new rotated shape + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("change first geometry point"); + setAttribute(SUMO_ATTR_SHAPE, toString(newShape), myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // set new shape + myShape = newShape; + // Check if new shape is closed + myClosedShape = (myShape.front() == myShape.back()); + // disable simplified shape flag + mySimplifiedShape = false; + // update geometry to avoid grabbing Problems + updateGeometry(); + } + } +} + + +void +GNEPoly::simplifyShape(bool allowUndo) { + if (!mySimplifiedShape && myShape.size() > 2) { + const Boundary b = myShape.getBoxBoundary(); + PositionVector simplifiedShape; + if (myShape.isClosed()) { + // create a square as simplified shape + simplifiedShape.push_back(Position(b.xmin(), b.ymin())); + simplifiedShape.push_back(Position(b.xmin(), b.ymax())); + simplifiedShape.push_back(Position(b.xmax(), b.ymax())); + simplifiedShape.push_back(Position(b.xmax(), b.ymin())); + simplifiedShape.push_back(simplifiedShape[0]); + } else { + // create a line as simplified shape + simplifiedShape.push_back(myShape.front()); + simplifiedShape.push_back(myShape.back()); + } + // set new shape depending of allowUndo + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("simplify shape"); + setAttribute(SUMO_ATTR_SHAPE, toString(simplifiedShape), myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // set new shape + myShape = simplifiedShape; + // Check if new shape is closed + myClosedShape = (myShape.front() == myShape.back()); + // update geometry to avoid grabbing Problems + updateGeometry(); + } + // change flag after setting simplified shape + mySimplifiedShape = true; + } else { + WRITE_WARNING("Polygon already simplified") + } +} + + +std::string +GNEPoly::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return myID; + case SUMO_ATTR_SHAPE: + return toString(myShape); + case SUMO_ATTR_GEOSHAPE: + return toString(myGeoShape, gPrecisionGeo); + case SUMO_ATTR_COLOR: + return toString(getShapeColor()); + case SUMO_ATTR_FILL: + return toString(myFill); + case SUMO_ATTR_LINEWIDTH: + return toString(myLineWidth); + case SUMO_ATTR_LAYER: + if (getShapeLayer() == Shape::DEFAULT_LAYER) { + return "default"; + } else { + return toString(getShapeLayer()); + } + case SUMO_ATTR_TYPE: + return getShapeType(); + case SUMO_ATTR_IMGFILE: + return getShapeImgFile(); + case SUMO_ATTR_RELATIVEPATH: + return toString(getShapeRelativePath()); + case SUMO_ATTR_ANGLE: + return toString(getShapeNaviDegree()); + case SUMO_ATTR_GEO: + return toString(myGEO); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_BLOCK_SHAPE: + return toString(myBlockShape); + case GNE_ATTR_CLOSE_SHAPE: + return toString(myClosedShape); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPoly::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: + case SUMO_ATTR_SHAPE: + case SUMO_ATTR_GEOSHAPE: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_FILL: + case SUMO_ATTR_LINEWIDTH: + case SUMO_ATTR_LAYER: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_IMGFILE: + case SUMO_ATTR_RELATIVEPATH: + case SUMO_ATTR_ANGLE: + case SUMO_ATTR_GEO: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_BLOCK_SHAPE: + case GNE_ATTR_CLOSE_SHAPE: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEPoly::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrieveShape(SUMO_TAG_POLY, value, false) == nullptr); + case SUMO_ATTR_SHAPE: + case SUMO_ATTR_GEOSHAPE: + // empty shapes AREN'T allowed + if (value.empty()) { + return false; + } else { + return canParse(value); + } + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_FILL: + return canParse(value); + case SUMO_ATTR_LINEWIDTH: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_LAYER: + if (value == "default") { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_TYPE: + return true; + case SUMO_ATTR_IMGFILE: + if (value == "") { + return true; + } else { + // check that image can be loaded + return GUITexturesHelper::getTextureID(value) != -1; + } + case SUMO_ATTR_RELATIVEPATH: + return canParse(value); + case SUMO_ATTR_ANGLE: + return canParse(value); + case SUMO_ATTR_GEO: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_BLOCK_SHAPE: + return canParse(value); + case GNE_ATTR_CLOSE_SHAPE: + if (canParse(value)) { + bool closePolygon = parse(value); + if (closePolygon && (myShape.begin() == myShape.end())) { + // Polygon already closed, then invalid value + return false; + } else if (!closePolygon && (myShape.begin() != myShape.end())) { + // Polygon already open, then invalid value + return false; + } else { + return true; + } + } else { + return false; + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +bool +GNEPoly::isAttributeEnabled(SumoXMLAttr /* key */) const { + // check if we're in supermode Network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + return true; + } else { + return false; + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEPoly::setAttribute(SumoXMLAttr key, const std::string& value) { + // first remove object from grid due almost modificactions affects to boundary (but avoided for certain attributes) + if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { + myNet->removeGLObjectFromGrid(this); + } + switch (key) { + case SUMO_ATTR_ID: { + // note: getAttributeCarriers().updateID doesn't change Microsim ID in GNEShapes + myNet->getAttributeCarriers()->updateID(this, value); + // set named ID + myID = value; + break; + } + case SUMO_ATTR_SHAPE: { + // set new shape + myShape = parse(value); + // set GEO shape + myGeoShape = myShape; + for (int i = 0; i < (int) myGeoShape.size(); i++) { + GeoConvHelper::getFinal().cartesian2geo(myGeoShape[i]); + } + // Check if new shape is closed + myClosedShape = (myShape.front() == myShape.back()); + // disable simplified shape flag + mySimplifiedShape = false; + // update geometry of shape edited element + if (myNetworkElementShapeEdited) { + myNetworkElementShapeEdited->updateGeometry(); + } + break; + } + case SUMO_ATTR_GEOSHAPE: { + // set new GEO shape + myGeoShape = parse(value); + // set shape + myShape = myGeoShape ; + for (int i = 0; i < (int) myShape.size(); i++) { + GeoConvHelper::getFinal().x2cartesian_const(myShape[i]); + } + // Check if new shape is closed + myClosedShape = (myShape.front() == myShape.back()); + // disable simplified shape flag + mySimplifiedShape = false; + // update geometry of shape edited element + if (myNetworkElementShapeEdited) { + myNetworkElementShapeEdited->updateGeometry(); + } + break; + } + case SUMO_ATTR_COLOR: + setShapeColor(parse(value)); + break; + case SUMO_ATTR_FILL: + myFill = parse(value); + break; + case SUMO_ATTR_LINEWIDTH: + myLineWidth = parse(value); + break; + case SUMO_ATTR_LAYER: + if (value == "default") { + setShapeLayer(Shape::DEFAULT_LAYER); + } else { + setShapeLayer(parse(value)); + } + break; + case SUMO_ATTR_TYPE: + setShapeType(value); + break; + case SUMO_ATTR_IMGFILE: + setShapeImgFile(value); + // all textures must be refresh + GUITexturesHelper::clearTextures(); + break; + case SUMO_ATTR_RELATIVEPATH: + setShapeRelativePath(parse(value)); + break; + case SUMO_ATTR_ANGLE: + setShapeNaviDegree(parse(value)); + break; + case SUMO_ATTR_GEO: + myGEO = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_BLOCK_SHAPE: + myBlockShape = parse(value); + break; + case GNE_ATTR_CLOSE_SHAPE: + myClosedShape = parse(value); + if (myClosedShape) { + myShape.closePolygon(); + myGeoShape.closePolygon(); + } else { + myShape.pop_back(); + myGeoShape.pop_back(); + } + // disable simplified shape flag + mySimplifiedShape = false; + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + // add object into grid again (but avoided for certain attributes) + if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { + myNet->addGLObjectIntoGrid(this); + } + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPoly.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPoly.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEPoly.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEPoly.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,261 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPoly.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// A class for visualizing and editing POIS in netedit (adapted from +// GUIPolygon and NLHandler) +/****************************************************************************/ +#pragma once +#include +#include + +#include "GNEShape.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GeoConvHelper; +class GNENetworkElement; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEPoly + * + * In the case the represented junction's shape is empty, the boundary + * is computed using the junction's position to which an offset of 1m to each + * side is added. + */ +class GNEPoly : public GUIPolygon, public GNEShape, protected GNEMoveShape { + +public: + /// @brief needed to avoid diamond Problem between GUIPolygon and GNEShape + using GNEShape::getID; + + /** @brief Constructor + * @param[in] net net in which this polygon is placed + * @param[in] id The name of the polygon + * @param[in] type The (abstract) type of the polygon + * @param[in] shape The shape of the polygon + * @param[in] geo specifiy if shape was loaded as GEO + * @param[in] color The color of the polygon + * @param[in] layer The layer of the polygon + * @param[in] angle The rotation of the polygon + * @param[in] imgFile The raster image of the polygon + * @param[in] relativePath set image file as relative path + * @param[in] fill Whether the polygon shall be filled + * @param[in] lineWidth Line width when drawing unfilled polygon + * @param[in] movementBlocked if movement of POI is blocked + * @param[in] shapeBlocked if shape of POI is blocked + */ + 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, bool movementBlocked, bool shapeBlocked); + + /// @brief Destructor + ~GNEPoly(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /**@brief Sets a parameter + * @param[in] key The parameter's name + * @param[in] value The parameter's value + */ + void setParameter(const std::string& key, const std::string& value); + + /// @name functions for edit geometry + /// @{ + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startPolyShapeGeometryMoving(const double shapeOffset); + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void endPolyShapeGeometryMoving(); + + /**@brief return index of geometry point placed in given position, or -1 if no exist + * @param pos position of new/existent vertex + * @param snapToGrid enable or disable snapToActiveGrid + * @return index of position vector + */ + int getPolyVertexIndex(Position pos, const bool snapToGrid) const; + + /**@brief move shape + * @param[in] offset the offset of movement + */ + void movePolyShape(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitPolyShapeChange(GNEUndoList* undoList); + /// @} + + /// @name inherited from GNEShape + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /**@brief writte shape element into a xml file + * @param[in] device device in which write parameters of additional element + */ + void writeShape(OutputDevice& device); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the numerical id of the object + GUIGlID getGlID() const; + + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@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 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 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + + /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge + * @param pos position of new/existent vertex + * @param snapToGrid enable or disable snapToActiveGrid + * @return index of position vector + */ + int getVertexIndex(Position pos, bool snapToGrid); + + /// @brief delete the geometry point closest to the given pos + void deleteGeometryPoint(const Position& pos, bool allowUndo = true); + + /// @brief return true if polygon is blocked + bool isPolygonBlocked() const; + + /// @brief check if polygon is closed + bool isPolygonClosed() const; + + /// @brief retrieve the networkElement of which the shape is being edited + void setShapeEditedElement(GNENetworkElement* element); + + /// @brief retrieve the junction of which the shape is being edited + GNENetworkElement* getShapeEditedElement() const; + + /// @brief open polygon + void openPolygon(bool allowUndo = true); + + /// @brief close polygon + void closePolygon(bool allowUndo = true); + + /// @brief change first geometry point + void changeFirstGeometryPoint(int oldIndex, bool allowUndo = true); + + /// @brief replace the current shape with a rectangle + void simplifyShape(bool allowUndo = true); + +protected: + /// @brief junction of which the shape is being edited (optional) + GNENetworkElement* myNetworkElementShapeEdited; + + /// @brief Latitude of Polygon + PositionVector myGeoShape; + + /// @brief flag for block shape + bool myBlockShape; + + /// @brief flag to indicate if polygon is open or closed + bool myClosedShape; + + /// @brief flag to indicate if polygon is simplified + bool mySimplifiedShape; + + /// @brief index of vertex that is been moved (-1 means that none vertex is been moved) + int myCurrentMovingVertexIndex; + +private: + /// @brief hint size of vertex + static const double myHintSize; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEPoly(const GNEPoly&) = delete; + + /// @brief Invalidated assignment operator. + GNEPoly& operator=(const GNEPoly&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouter.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouter.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,379 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERerouter.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNERerouter.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNERerouter::GNERerouter(const std::string& id, GNENet* net, const Position& pos, + const std::vector& edges, const std::string& name, const std::string& filename, + double probability, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement) : + GNEAdditional(id, net, GLO_REROUTER, SUMO_TAG_REROUTER, name, blockMovement, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, edges, {}, {}, {}, {}, {}), // Children +myPosition(pos), +myFilename(filename), +myProbability(probability), +myOff(off), +myTimeThreshold(timeThreshold), +myVTypes(vTypes) { +} + + +GNERerouter::~GNERerouter() { +} + + +void +GNERerouter::updateGeometry() { + // Set block icon position + myBlockIcon.position = myPosition; + + // Set block icon offset + myBlockIcon.offset = Position(-0.5, -0.5); + + // Set block icon rotation, and using their rotation for draw logo + myBlockIcon.setRotation(); + + // update connection positions + myChildConnections.update(); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNERerouter::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myPosition, 0, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.rerouterSize, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.rerouterSize); +} + + +Position +GNERerouter::getPositionInView() const { + return myPosition; +} + + +Boundary +GNERerouter::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else { + Boundary b; + b.add(myPosition); + b.grow(5); + return b; + } +} + + +void +GNERerouter::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNERerouter::openAdditionalDialog() { + // Open rerouter dialog + GNERerouterDialog(this); +} + + +void +GNERerouter::moveGeometry(const Position& offset) { + // restore old position, apply offset and update Geometry + myPosition = myMove.originalViewPosition; + myPosition.add(offset); + // filtern position using snap to active grid + myPosition = myNet->getViewNet()->snapToActiveGrid(myPosition); + updateGeometry(); +} + + +void +GNERerouter::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), toString(myMove.originalViewPosition))); + undoList->p_end(); +} + + +std::string +GNERerouter::getParentName() const { + return myNet->getMicrosimID(); +} + + +void +GNERerouter::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double rerouterExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(rerouterExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(myPosition.x(), myPosition.y(), getType()); + // scale + glScaled(rerouterExaggeration, rerouterExaggeration, 1); + // Draw icon depending of detector is selected and if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, rerouterExaggeration)) { + glColor3d(1, 1, 1); + glRotated(180, 0, 0, 1); + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_REROUTERSELECTED), s.additionalSettings.rerouterSize); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_REROUTER), s.additionalSettings.rerouterSize); + } + } else { + GLHelper::setColor(RGBColor::RED); + GLHelper::drawBoxLine(Position(0, s.additionalSettings.rerouterSize), 0, 2 * s.additionalSettings.rerouterSize, s.additionalSettings.rerouterSize); + } + // Pop draw matrix + glPopMatrix(); + // Show Lock icon + myBlockIcon.drawIcon(s, rerouterExaggeration, 0.4); + // Draw child connections + drawChildConnections(s, getType()); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), rerouterExaggeration, myDottedGeometry); + // draw shape dotte contour aroud alld connections between child and parents + for (auto i : myChildConnections.connectionPositions) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); + } + } + // Draw name + drawName(getPositionInView(), s.scale, s.addName); + // Pop name + glPopName(); + } +} + + +std::string +GNERerouter::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGES: + return parseIDs(getChildEdges()); + case SUMO_ATTR_POSITION: + return toString(myPosition); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_PROB: + return toString(myProbability); + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return time2string(myTimeThreshold); + case SUMO_ATTR_VTYPES: + return myVTypes; + case SUMO_ATTR_OFF: + return toString(myOff); + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERerouter::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNERerouter::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: { + // change ID of Rerouter Interval + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Rerouter interval children + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_INTERVAL), undoList); + } + break; + } + case SUMO_ATTR_EDGES: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_PROB: + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_OFF: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERerouter::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_EDGES: + if (value.empty()) { + return false; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_PROB: + return canParse(value) && (parse(value) >= 0) && (parse(value) <= 1); + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + return canParse(value); + case SUMO_ATTR_VTYPES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case SUMO_ATTR_OFF: + return canParse(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERerouter::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNERerouter::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNERerouter::getHierarchyName() const { + return getTagStr(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNERerouter::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGES: + changeChildEdges(this, value); + break; + case SUMO_ATTR_POSITION: + myNet->removeGLObjectFromGrid(this); + myPosition = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_PROB: + myProbability = parse(value); + break; + case SUMO_ATTR_HALTING_TIME_THRESHOLD: + myTimeThreshold = parse(value); + break; + case SUMO_ATTR_VTYPES: + myVTypes = value; + break; + case SUMO_ATTR_OFF: + myOff = parse(value); + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouter.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouter.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,168 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERerouter.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEEdge; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNERerouter + * Rerouter changes the route of a vehicle as soon as the vehicle moves onto a specified edge. + */ +class GNERerouter : public GNEAdditional { + +public: + /**@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 + * @param[in] pos position (center) of the rerouter in the map + * @param[in] edges vector with the edges of rerotuer + * @param[in] name Rerouter name + * @param[in] filename The path to the definition file + * @param[in] probability The probability for vehicle rerouting + * @param[in] off Whether the router should be inactive initially + * @param[in] block movement enable or disable additional movement + */ + GNERerouter(const std::string& id, GNENet* net, const Position& pos, const std::vector& edges, const std::string& name, + const std::string& filename, double probability, bool off, SUMOTime timeThreshold, const std::string& vTypes, bool blockMovement); + + /// @brief Destructor + ~GNERerouter(); + + /// @brief open GNERerouterDialog + void openAdditionalDialog(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief position of rerouter in view + Position myPosition; + + /// @brief filename of rerouter + std::string myFilename; + + /// @brief probability of rerouter + double myProbability; + + /// @brief attribute to enable or disable inactive initially + bool myOff; + + /// @brief attribute to configure activation time threshold + SUMOTime myTimeThreshold; + + /// @brief optional vehicle types for restricting the rerouter + std::string myVTypes; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNERerouter(const GNERerouter&) = delete; + + /// @brief Invalidated assignment operator. + GNERerouter& operator=(const GNERerouter&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,226 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERerouterInterval.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include + +#include "GNERerouterInterval.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNERerouterInterval::GNERerouterInterval(GNERerouterDialog* rerouterDialog) : + GNEAdditional(rerouterDialog->getEditedAdditional(), rerouterDialog->getEditedAdditional()->getNet(), GLO_REROUTER, SUMO_TAG_INTERVAL, "", false, +{}, {}, {}, {}, {rerouterDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myBegin(0), +myEnd(0) { + // fill reroute interval with default values + setDefaultValues(); +} + + +GNERerouterInterval::GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end) : + GNEAdditional(rerouterParent, rerouterParent->getNet(), GLO_REROUTER, SUMO_TAG_INTERVAL, "", false, +{}, {}, {}, {}, {rerouterParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myBegin(begin), +myEnd(end) { +} + + +GNERerouterInterval::~GNERerouterInterval() {} + +void +GNERerouterInterval::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNERerouterInterval::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNERerouterInterval::updateGeometry() { + // This additional doesn't own a geometry +} + + +void GNERerouterInterval::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNERerouterInterval::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNERerouterInterval::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNERerouterInterval::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNERerouterInterval::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNERerouterInterval::drawGL(const GUIVisualizationSettings&) const { + // Currently This additional isn't drawn +} + + +std::string +GNERerouterInterval::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_BEGIN: + return time2string(myBegin); + case SUMO_ATTR_END: + return time2string(myEnd); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERerouterInterval::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_BEGIN: + return STEPS2TIME(myBegin); + case SUMO_ATTR_END: + return STEPS2TIME(myEnd); + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERerouterInterval::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: { + // change ID of Rerouter Interval + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Rerouter children + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(i->getTagProperty().getTag()), undoList); + } + break; + } + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERerouterInterval::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_BEGIN: + return canParse(value) && (parse(value) < myEnd); + case SUMO_ATTR_END: + return canParse(value) && (parse(value) > myBegin); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERerouterInterval::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNERerouterInterval::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNERerouterInterval::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNERerouterInterval::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_BEGIN: + myBegin = parse(value); + break; + case SUMO_ATTR_END: + myEnd = parse(value); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERerouterInterval.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,152 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERerouterInterval.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNERerouter; +class GNERerouterDialog; +class GNEClosingLaneReroute; +class GNEClosingReroute; +class GNEDestProbReroute; +class GNERouteProbReroute; +class GNEParkingAreaReroute; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNERerouterInterval + * class used to represent a interval used in rerouters + */ +class GNERerouterInterval : public GNEAdditional { + +public: + /// @brief constructor (Used in GNERerouterDialog) + GNERerouterInterval(GNERerouterDialog* rerouterDialog); + + /// @brief constructor + GNERerouterInterval(GNEAdditional* rerouterParent, SUMOTime begin, SUMOTime end); + + /// @brief destructor + ~GNERerouterInterval(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief begin timeStep + SUMOTime myBegin; + + /// @brief end timeStep + SUMOTime myEnd; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNERerouterInterval(GNERerouterInterval*) = delete; + + /// @brief Invalidated assignment operator. + GNERerouterInterval& operator=(GNERerouterInterval*) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,370 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteProbe.cpp +/// @author Pablo Alvarez Lopez +/// @date May 2016 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNERouteProbe.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNERouteProbe::GNERouteProbe(const std::string& id, GNENet* net, GNEEdge* edge, const std::string& frequency, + const std::string& name, const std::string& filename, SUMOTime begin) : + GNEAdditional(id, net, GLO_ROUTEPROBE, SUMO_TAG_ROUTEPROBE, name, false, +{}, {edge}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myFrequency(frequency), +myFilename(filename), +myBegin(begin), +myRelativePositionY(0) { +} + + +GNERouteProbe::~GNERouteProbe() { +} + + +void +GNERouteProbe::updateGeometry() { + // obtain relative position of routeProbe in edge + myRelativePositionY = 2 * getParentEdges().front()->getRouteProbeRelativePosition(this); + + // get lanes of edge + GNELane* firstLane = getParentEdges().front()->getLanes().at(0); + + // Get shape of parent lane + const double offset = firstLane->getLaneShape().length() < 0.5 ? firstLane->getLaneShape().length() : 0.5; + + // update geometry + myAdditionalGeometry.updateGeometry(firstLane, offset); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set offset of the block icon + myBlockIcon.offset = Position(1.1, (-3.06) - myRelativePositionY); + + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(firstLane); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNERouteProbe::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getPosition(), + myAdditionalGeometry.getRotation(), + myNet->getViewNet()->getVisualisationSettings().additionalSettings.routeProbeSize, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.routeProbeSize); +} + + +Position +GNERouteProbe::getPositionInView() const { + if (getParentEdges().front()->getLanes().front()->getLaneShape().length() < 0.5) { + return getParentEdges().front()->getLanes().front()->getLaneShape().front(); + } else { + Position A = getParentEdges().front()->getLanes().front()->getLaneShape().positionAtOffset(0.5); + Position B = getParentEdges().front()->getLanes().back()->getLaneShape().positionAtOffset(0.5); + // return Middle point + return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); + } +} + + +Boundary +GNERouteProbe::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNERouteProbe::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNERouteProbe::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNERouteProbe::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +std::string +GNERouteProbe::getParentName() const { + return getParentEdges().front()->getID(); +} + + +void +GNERouteProbe::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double routeProbeExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(routeProbeExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // get values + const double width = (double) 2.0 * s.scale; + const int numberOfLanes = int(getParentEdges().front()->getLanes().size()); + // start drawing + glPushName(getGlID()); + glLineWidth(1.0); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.additionalSettings.routeProbeColor); + } + // draw shape + glPushMatrix(); + glTranslated(0, 0, getType()); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glScaled(routeProbeExaggeration, routeProbeExaggeration, 1); + glTranslated(-1.6, -1.6, 0); + glBegin(GL_QUADS); + glVertex2d(0, 0.25); + glVertex2d(0, -0.25); + glVertex2d((numberOfLanes * 3.3), -0.25); + glVertex2d((numberOfLanes * 3.3), 0.25); + glEnd(); + glTranslated(0, 0, .01); + glBegin(GL_LINES); + glVertex2d(0, 0.25 - .1); + glVertex2d(0, -0.25 + .1); + glEnd(); + // position indicator (White) + if ((width * routeProbeExaggeration > 1) && !s.drawForRectangleSelection) { + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glRotated(90, 0, 0, -1); + glBegin(GL_LINES); + glVertex2d(0, 0); + glVertex2d(0, (numberOfLanes * 3.3)); + glEnd(); + } + // Pop shape matrix + glPopMatrix(); + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), getType()); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glTranslated((-2.56) - myRelativePositionY, (-1.6), 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, routeProbeExaggeration)) { + glColor3d(1, 1, 1); + glRotated(-90, 0, 0, 1); + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_ROUTEPROBESELECTED), s.additionalSettings.routeProbeSize); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_ROUTEPROBE), s.additionalSettings.routeProbeSize); + } + } else { + GLHelper::setColor(s.additionalSettings.routeProbeColor); + GLHelper::drawBoxLine(Position(0, s.additionalSettings.routeProbeSize), 0, 2 * s.additionalSettings.routeProbeSize, s.additionalSettings.routeProbeSize); + } + // Pop logo matrix + glPopMatrix(); + // Show Lock icon depending of the Edit mode + myBlockIcon.drawIcon(s, routeProbeExaggeration, 0.4); + // draw name + drawName(getPositionInView(), s.scale, s.addName); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), routeProbeExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +std::string +GNERouteProbe::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGE: + return getParentEdges().front()->getID(); + case SUMO_ATTR_NAME: + return myAdditionalName; + case SUMO_ATTR_FILE: + return myFilename; + case SUMO_ATTR_FREQUENCY: + return toString(myFrequency); + case SUMO_ATTR_BEGIN: + return time2string(myBegin); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERouteProbe::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_BEGIN: + return STEPS2TIME(myBegin); + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERouteProbe::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: + case SUMO_ATTR_EDGE: + case SUMO_ATTR_NAME: + case SUMO_ATTR_FILE: + case SUMO_ATTR_FREQUENCY: + case SUMO_ATTR_BEGIN: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERouteProbe::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNERouteProbe::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNERouteProbe::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN); +} + +// =========================================================================== +// private +// =========================================================================== + +bool +GNERouteProbe::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_EDGE: + if (myNet->retrieveEdge(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case SUMO_ATTR_FILE: + return SUMOXMLDefinitions::isValidFilename(value); + case SUMO_ATTR_FREQUENCY: + if (value.empty()) { + return true; + } else { + return canParse(value); + } + case SUMO_ATTR_BEGIN: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERouteProbe::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGE: + replaceParentEdges(this, value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case SUMO_ATTR_FILE: + myFilename = value; + break; + case SUMO_ATTR_FREQUENCY: + myFrequency = value; + break; + case SUMO_ATTR_BEGIN: + myBegin = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbe.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,154 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteProbe.h +/// @author Pablo Alvarez Lopez +/// @date May 2016 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNERouteProbe + * @brief Representation of a RouteProbe in netedit + */ +class GNERouteProbe : public GNEAdditional { + +public: + /**@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 + * @param[in] edge edge in which this routeProbe is placed + * @param[in] frequency The frequency in which to report the distribution + * @oaran[in] name Route Probe Name + * @param[in] filename The file for generated output + * @param[in] begin The time at which to start generating output + */ + GNERouteProbe(const std::string& id, GNENet* net, GNEEdge* edge, const std::string& frequency, const std::string& name, const std::string& filename, SUMOTime begin); + + /// @brief Destructor + ~GNERouteProbe(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief Frequency of RouteProbe + std::string myFrequency; + + /// @brief filename of RouteProbe + std::string myFilename; + + /// @brief begin of rerouter + SUMOTime myBegin; + + /// @brief route probe logo offset + Position myRouteProbeLogoOffset; + + /// @brief relative position regarding to other route probes + int myRelativePositionY; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNERouteProbe(const GNERouteProbe&) = delete; + + /// @brief Invalidated assignment operator. + GNERouteProbe& operator=(const GNERouteProbe&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,215 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteProbReroute.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include + +#include "GNERouteProbReroute.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNERouteProbReroute::GNERouteProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog) : + GNEAdditional(rerouterIntervalDialog->getEditedAdditional(), rerouterIntervalDialog->getEditedAdditional()->getNet(), GLO_REROUTER, SUMO_TAG_ROUTE_PROB_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}) { + // Childrens + // if exist a reroute, set newRoute ID + if (rerouterIntervalDialog->getEditedAdditional()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size() > 0) { + myNewRouteId = rerouterIntervalDialog->getEditedAdditional()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).begin()->first; + } + // fill route prob reroute interval with default values + setDefaultValues(); +} + + +GNERouteProbReroute::GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability) : + GNEAdditional(rerouterIntervalParent, rerouterIntervalParent->getNet(), GLO_REROUTER, SUMO_TAG_ROUTE_PROB_REROUTE, "", false, +{}, {}, {}, {}, {rerouterIntervalParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myNewRouteId(newRouteId), +myProbability(probability) { +} + + +GNERouteProbReroute::~GNERouteProbReroute() {} + + +void +GNERouteProbReroute::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNERouteProbReroute::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNERouteProbReroute::updateGeometry() { + // This additional doesn't own a geometry +} + + +void +GNERouteProbReroute::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNERouteProbReroute::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNERouteProbReroute::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNERouteProbReroute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNERouteProbReroute::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNERouteProbReroute::drawGL(const GUIVisualizationSettings&) const { + // Currently This additional isn't drawn +} + + +std::string +GNERouteProbReroute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_ROUTE: + return myNewRouteId; + case SUMO_ATTR_PROB: + return toString(myProbability); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERouteProbReroute::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNERouteProbReroute::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: + case SUMO_ATTR_ROUTE: + case SUMO_ATTR_PROB: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERouteProbReroute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_ROUTE: + return SUMOXMLDefinitions::isValidVehicleID(value); + case SUMO_ATTR_PROB: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERouteProbReroute::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNERouteProbReroute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNERouteProbReroute::getHierarchyName() const { + return getTagStr() + ": " + myNewRouteId; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNERouteProbReroute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_ROUTE: + myNewRouteId = value; + break; + case SUMO_ATTR_PROB: + myProbability = parse(value); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNERouteProbReroute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,148 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteProbReroute.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEEdge; +class GNERerouterInterval; +class GNERerouterIntervalDialog; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNERerouter + * GNERouteProbReroute + */ +class GNERouteProbReroute : public GNEAdditional { +public: + /// @brief constructor (Used in GNERerouterIntervalDialog) + GNERouteProbReroute(GNERerouterIntervalDialog* rerouterIntervalDialog); + + /// @brief constructor + GNERouteProbReroute(GNEAdditional* rerouterIntervalParent, const std::string& newRouteId, double probability); + + /// @brief destructor + ~GNERouteProbReroute(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief id of new route + std::string myNewRouteId; + + /// @brief probability with which a vehicle will use the given edge as destination + double myProbability; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNERouteProbReroute(const GNERouteProbReroute&) = delete; + + /// @brief Invalidated assignment operator. + GNERouteProbReroute& operator=(const GNERouteProbReroute&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEShape.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEShape.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEShape.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEShape.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,130 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEShape.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// Abstract class for Shapes uses in netedit +/****************************************************************************/ +#include + +#include +#include +#include +#include + +#include "GNEShape.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEShape::GNEShape(GNENet* net, SumoXMLTag tag, bool movementBlocked, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GNEAttributeCarrier(tag, net), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myBlockMovement(movementBlocked) { +} + + +GNEShape::~GNEShape() {} + + +bool +GNEShape::isMovementBlocked() const { + return myBlockMovement; +} + + +void +GNEShape::draw(const Position& pos, double layer, double size) const { + if (myNet->getViewNet()->showLockIcon()) { + // Start pushing matrix + glPushMatrix(); + // Traslate to middle of shape + glTranslated(pos.x(), pos.y(), layer + 0.1); + // Rotate 180 degrees + glRotated(180, 0, 0, 1); + // Set draw color + glColor3d(1, 1, 1); + // Draw icon depending of the selection status + if (mySelected) { + if (myBlockMovement) { + // Draw lock texture if shape is movable, is blocked and is selected + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCKSELECTED), size); + } else { + // Draw empty texture if shape is movable, isn't blocked and is selected + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTYSELECTED), size); + } + } else { + if (myBlockMovement) { + // Draw lock texture if shape is movable and is blocked + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LOCK), size); + } else { + // Draw empty texture if shape is movable and isn't blocked + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_EMPTY), size); + } + } + // Pop matrix + glPopMatrix(); + } +} + + +void +GNEShape::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNEShape::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +std::string +GNEShape::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNEShape::getHierarchyName() const { + return getTagStr(); +} + + +void +GNEShape::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEShape.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEShape.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEShape.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEShape.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,215 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEShape.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2017 +/// +// Abstract class for Shapes uses in netedit +/****************************************************************************/ +#pragma once +#include + +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEShape : public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { + +public: + /**@brief Constructor. + * @param[in] net The net to inform about gui updates + * @param[in] tag sumo xml tag of the element + * @param[in] movementBlocked if movement of POI is blocked + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEShape(GNENet* net, SumoXMLTag tag, bool movementBlocked, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /// @brief Destructor + virtual ~GNEShape(); + + /// @brief get ID (all shapes have one) + virtual const std::string& getID() const = 0; + + /// @brief get GUIGlObject associated with this AttributeCarrier + virtual GUIGlObject* getGUIGlObject() = 0; + + /// @brief gererate a new ID for an element child + virtual std::string generateChildID(SumoXMLTag childTag) = 0; + + /**@brief Sets a parameter + * @param[in] key The parameter's name + * @param[in] value The parameter's value + */ + virtual void setParameter(const std::string& key, const std::string& value) = 0; + + /**@brief writte shape element into a xml file + * @param[in] device device in which write parameters of additional element + */ + virtual void writeShape(OutputDevice& device) = 0; + + /// @brief Returns the numerical id of the object + virtual GUIGlID getGlID() const = 0; + + /// @brief return true if movement is blocked + bool isMovementBlocked() const; + + /// @brief draw lock icon + void draw(const Position& pos, double layer, double size = 0.5) const; + + /// @name functions for edit geometry + /// @{ + + /**@brief update pre-computed geometry information + * @note: must be called when geometry changes (i.e. lane moved) and implemented in ALL childrens + */ + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Returns position of additional in view + virtual Position getPositionInView() const = 0; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + virtual Boundary getCenteringBoundary() const = 0; + + /// @} + + /// @name inherited from GUIPolygon/GUIPointOfInterest + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + virtual GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /* @brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 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 disableAttribute(SumoXMLAttr key, GNEUndoList* undoList); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + /// @} + +protected: + /// @brief boundary used during moving of elements + Boundary myMovingGeometryBoundary; + + /// @brief flag to block movement + bool myBlockMovement; + +private: + /// @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 Invalidated copy constructor. + GNEShape(const GNEShape&) = delete; + + /// @brief Invalidated assignment operator. + GNEShape& operator=(const GNEShape&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,372 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStoppingPlace.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// A abstract class to define common parameters of lane area in which vehicles can halt (GNE version) +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEStoppingPlace.h" + +// =========================================================================== +// static members +// =========================================================================== + +const double GNEStoppingPlace::myCircleWidth = 1.1; +const double GNEStoppingPlace::myCircleWidthSquared = 1.21; +const double GNEStoppingPlace::myCircleInWidth = 0.9; +const double GNEStoppingPlace::myCircleInText = 1.6; + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEStoppingPlace::GNEStoppingPlace(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + GNELane* lane, double startPos, double endPos, int parametersSet, const std::string& name, + bool friendlyPosition, bool blockMovement) : + GNEAdditional(id, net, type, tag, name, blockMovement, +{}, {}, {lane}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myStartPosition(startPos), +myEndPosition(endPos), +myParametersSet(parametersSet), +myFriendlyPosition(friendlyPosition) { +} + + +GNEStoppingPlace::~GNEStoppingPlace() {} + + +bool +GNEStoppingPlace::isAdditionalValid() const { + // with friendly position enabled position are "always fixed" + if (myFriendlyPosition) { + return true; + } else { + // obtain lane length + double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); + // calculate start and end positions + double startPos = (myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0; + double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : laneLength; + // check if position has to be fixed + if (startPos < 0) { + startPos += laneLength; + } + if (endPos < 0) { + endPos += laneLength; + } + // check values + if (myParametersSet == 0) { + return true; + } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) == 0) { + return (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) == 0) { + return (startPos >= 0); + } else { + return ((startPos >= 0) && (endPos <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) && ((endPos - startPos) >= POSITION_EPS)); + } + } +} + + +std::string +GNEStoppingPlace::getAdditionalProblem() const { + // calculate start and end positions + double startPos = (myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0; + double endPos = (myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + // obtain lane length + double laneLength = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + // check if position has to be fixed + if (startPos < 0) { + startPos += laneLength; + } + if (endPos < 0) { + endPos += laneLength; + } + // declare variables + std::string errorStart, separator, errorEnd; + // check positions over lane + if (startPos < 0) { + errorStart = (toString(SUMO_ATTR_STARTPOS) + " < 0"); + } else if (startPos > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) { + errorStart = (toString(SUMO_ATTR_STARTPOS) + " > lanes's length"); + } + if (endPos < 0) { + errorEnd = (toString(SUMO_ATTR_ENDPOS) + " < 0"); + } else if (endPos > 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; +} + + +void +GNEStoppingPlace::fixAdditionalProblem() { + // declare new start and end position + double newStartPos = myStartPosition; + double newEndPos = myEndPosition; + // fix start and end positions using fixStoppingPlacePosition + SUMORouteHandler::checkStopPos(newStartPos, newEndPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, true); + // set new start and end positions + setAttribute(SUMO_ATTR_STARTPOS, toString(newStartPos), myNet->getViewNet()->getUndoList()); + setAttribute(SUMO_ATTR_ENDPOS, toString(newEndPos), myNet->getViewNet()->getUndoList()); +} + + +Position +GNEStoppingPlace::getPositionInView() const { + // calculate start and end positions as absolute values + double startPos = fabs((myParametersSet & STOPPINGPLACE_STARTPOS_SET) ? myStartPosition : 0); + double endPos = fabs((myParametersSet & STOPPINGPLACE_ENDPOS_SET) ? myEndPosition : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + // obtain position in view depending if both positions are defined + if (myParametersSet == 0) { + return getParentLanes().front()->getLaneShape().positionAtOffset(getParentLanes().front()->getLaneShape().length() / 2); + } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) == 0) { + return getParentLanes().front()->getLaneShape().positionAtOffset(endPos); + } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) == 0) { + return getParentLanes().front()->getLaneShape().positionAtOffset(startPos); + } else { + return getParentLanes().front()->getLaneShape().positionAtOffset((startPos + endPos) / 2.0); + } +} + + +void +GNEStoppingPlace::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) { + // first check tat both network elements are lanes and originalElement correspond to stoppingPlace lane + if ((originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && + (originalElement->getTagProperty().getTag() == SUMO_TAG_LANE) && + (getParentLanes().front() == originalElement)) { + // check if we have to change additional lane depending of split position + if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (myParametersSet & STOPPINGPLACE_ENDPOS_SET)) { + // calculate middle position + const double middlePosition = ((myEndPosition - myStartPosition) / 2.0) + myStartPosition; + // four cases: + if (splitPosition < myStartPosition) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust start and end position + setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList); + setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); + } else if ((splitPosition > myStartPosition) && (splitPosition < middlePosition)) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust start and end position + setAttribute(SUMO_ATTR_STARTPOS, "0", undoList); + setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); + } else if ((splitPosition > middlePosition) && (splitPosition < myEndPosition)) { + // only adjust end position + setAttribute(SUMO_ATTR_ENDPOS, toString(splitPosition), undoList); + } else if ((splitPosition > myEndPosition)) { + // nothing to do + } + } else if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (splitPosition < myStartPosition)) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust start position + setAttribute(SUMO_ATTR_STARTPOS, toString(myStartPosition - splitPosition), undoList); + } else if ((myParametersSet & STOPPINGPLACE_ENDPOS_SET) && (splitPosition < myEndPosition)) { + // change lane + setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList); + // now adjust end position + setAttribute(SUMO_ATTR_ENDPOS, toString(myEndPosition - splitPosition), undoList); + } + } +} + + +void +GNEStoppingPlace::moveGeometry(const Position& offset) { + // only move if at leats start or end positions is defined + if (myParametersSet > 0) { + // Calculate new position using old position + Position newPosition = myMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myMove.originalViewPosition, false); + // check if both position has to be moved + if ((myParametersSet & STOPPINGPLACE_STARTPOS_SET) && (myParametersSet & STOPPINGPLACE_ENDPOS_SET)) { + // calculate stoppingPlace length and lane length (After apply geometry factor) + double stoppingPlaceLength = fabs(parse(myMove.secondOriginalPosition) - parse(myMove.firstOriginalLanePosition)); + double laneLengt = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); + // avoid changing stopping place's length + if ((parse(myMove.firstOriginalLanePosition) + offsetLane) < 0) { + myStartPosition = 0; + myEndPosition = stoppingPlaceLength; + } else if ((parse(myMove.secondOriginalPosition) + offsetLane) > laneLengt) { + myStartPosition = laneLengt - stoppingPlaceLength; + myEndPosition = laneLengt; + } else { + myStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; + myEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; + } + } else { + // check if start position must be moved + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + myStartPosition = parse(myMove.firstOriginalLanePosition) + offsetLane; + } + // check if start position must be moved + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + myEndPosition = parse(myMove.secondOriginalPosition) + offsetLane; + } + } + // Update geometry + updateGeometry(); + } +} + + +void +GNEStoppingPlace::commitGeometryMoving(GNEUndoList* undoList) { + // only commit geometry moving if at leats start or end positions is defined + if (myParametersSet > 0) { + undoList->p_begin("position of " + getTagStr()); + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(myStartPosition), myMove.firstOriginalLanePosition)); + } + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(myEndPosition), myMove.secondOriginalPosition)); + } + undoList->p_end(); + } +} + + +double +GNEStoppingPlace::getStartPosition() const { + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return myStartPosition; + } else { + return 0; + } +} + + +double +GNEStoppingPlace::getEndPosition() const { + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return myEndPosition; + } else { + return getParentLanes().front()->getLaneShapeLength(); + } +} + + +std::string +GNEStoppingPlace::getParentName() const { + return getParentLanes().front()->getID(); +} + + +void +GNEStoppingPlace::setStoppingPlaceGeometry(double movingToSide) { + // Get value of option "lefthand" + const double offsetSign = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; + + // obtain laneShape + PositionVector laneShape = getParentLanes().front()->getLaneShape(); + + // Move shape to side + laneShape.move2side(movingToSide * offsetSign); + + // Cut shape using as delimitators fixed start position and fixed end position + myAdditionalGeometry.updateGeometry(laneShape, getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); +} + + +double +GNEStoppingPlace::getStartGeometryPositionOverLane() const { + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + double fixedPos = myStartPosition; + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + if (fixedPos < 0) { + fixedPos += len; + } + return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); + } else { + return 0; + } +} + + +double +GNEStoppingPlace::getEndGeometryPositionOverLane() const { + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + double fixedPos = myEndPosition; + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + if (fixedPos < 0) { + fixedPos += len; + } + return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); + } else { + return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } +} + + +double +GNEStoppingPlace::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_STARTPOS: + if (myParametersSet & STOPPINGPLACE_STARTPOS_SET) { + return myStartPosition; + } else { + return -1; + } + case SUMO_ATTR_ENDPOS: + if (myParametersSet & STOPPINGPLACE_ENDPOS_SET) { + return myEndPosition; + } else { + return -1; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEStoppingPlace::isAttributeEnabled(SumoXMLAttr /*key*/) const { + // all stopping place attributes are always enabled + return true; +} + + +std::string +GNEStoppingPlace::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNEStoppingPlace::getHierarchyName() const { + return getTagStr(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEStoppingPlace.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,202 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStoppingPlace.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// A abstract class to define common parameters of lane area in which vehicles can halt (GNE version) +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// value definitions +// =========================================================================== +const int STOPPINGPLACE_STARTPOS_SET = 1; +const int STOPPINGPLACE_ENDPOS_SET = 2; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEStoppingPlace + * @briefA abstract class to define common parameters and functions of stopping places + */ +class GNEStoppingPlace : public GNEAdditional { + +public: + /**@brief Constructor. + * @param[in] id Gl-id of the stopping place (Must be unique) + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] type GUIGlObjectType of stoppingPlace + * @param[in] tag Type of xml tag that define the StoppingPlace (SUMO_TAG_BUS_STOP, SUMO_TAG_CHARGING_STATION, etc...) + * @param[in] lane Lane of this StoppingPlace belongs + * @param[in] startPos Start position of the StoppingPlace + * @param[in] endPos End position of the StoppingPlace + * @param[in] parametersSet Variable used to save flags STOPPINGPLACE_STARTPOS_SET and STOPPINGPLACE_ENDPOS_SET + * @param[in] name Name of stoppingPlace + * @param[in] friendlyPos enable or disable friendly position + * @param[in] block movement enable or disable additional movement + */ + GNEStoppingPlace(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, GNELane* lane, double startPos, double endPos, + int parametersSet, const std::string& name, bool friendlyPosition, bool blockMovement); + + /// @brief Destructor + ~GNEStoppingPlace(); + + /// @name members and functions relative to write additionals into XML + /// @{ + /// @brief check if current additional is valid to be writed into XML + bool isAdditionalValid() const; + + /// @brief return a string with the current additional problem + std::string getAdditionalProblem() const; + + /// @brief fix additional problem + void fixAdditionalProblem(); + /// @} + + /// @brief get start Position + double getStartPosition() const; + + /// @brief get end Position + double getEndPosition() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + virtual Boundary getCenteringBoundary() const = 0; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GNEAdditional + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /* @brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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; + /// @} + +protected: + /// @brief The relative start position this stopping place is located at (optional, if empty takes 0) + double myStartPosition; + + /// @brief The position this stopping place is located at (optional, if empty takes the lane length) + double myEndPosition; + + /// @brief Variable used for set/unset start/endPositions + int myParametersSet; + + /// @brief Flag for friendly position + bool myFriendlyPosition; + + /// @brief The position of the sign + Position mySignPos; + + /// @brief circle width resolution for all stopping places + static const double myCircleWidth; + + /// @brief squared circle width resolution for all stopping places + static const double myCircleWidthSquared; + + /// @brief inner circle width resolution for all stopping places + static const double myCircleInWidth; + + /// @brief text inner circle width resolution for all stopping places + static const double myCircleInText; + + /// @brief set geometry common to all stopping places + void setStoppingPlaceGeometry(double movingToSide); + + /// @brief get start position over lane that is applicable to the shape + double getStartGeometryPositionOverLane() const; + + /// @brief get end position over lane that is applicable to the shape + double getEndGeometryPositionOverLane() const; + +private: + /// @brief set attribute after validation + virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; + + /// @brief Invalidate set new position in the view + void setPosition(const Position& pos) = delete; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZ.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZ.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZ.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZ.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,689 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZ.cpp +/// @author Pablo Alvarez Lopez +/// @date Oct 2018 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNETAZ.h" + + +// =========================================================================== +// callbacks definitions +// =========================================================================== + +void APIENTRY beginTAZCallback(GLenum which) { + glBegin(which); +} + + +void APIENTRY endTAZCallback(void) { + glEnd(); +} + + +void APIENTRY combineTAZCallback(GLdouble coords[3], + GLdouble* vertex_data[4], + GLfloat weight[4], GLdouble** dataOut) { + UNUSED_PARAMETER(weight); + UNUSED_PARAMETER(*vertex_data); + GLdouble* vertex; + + vertex = (GLdouble*) malloc(7 * sizeof(GLdouble)); + + vertex[0] = coords[0]; + vertex[1] = coords[1]; + vertex[2] = coords[2]; + *dataOut = vertex; +} + +// =========================================================================== +// static members +// =========================================================================== +const double GNETAZ::myHintSize = 0.8; +const double GNETAZ::myHintSizeSquared = 0.64; + + +// =========================================================================== +// member method definitions +// =========================================================================== +GNETAZ::GNETAZ(const std::string& id, GNENet* net, PositionVector shape, RGBColor color, bool blockMovement) : + GNEAdditional(id, net, GLO_TAZ, SUMO_TAG_TAZ, "", blockMovement, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myColor(color), +myTAZShape(shape), +myBlockShape(false), +myDrawFill(false), +myCurrentMovingVertexIndex(-1), +myMaxWeightSource(0), +myMinWeightSource(0), +myAverageWeightSource(0), +myMaxWeightSink(0), +myMinWeightSink(0), +myAverageWeightSink(0) { +} + + +GNETAZ::~GNETAZ() {} + + +const PositionVector& +GNETAZ::getTAZShape() const { + return myTAZShape; +} + + +void +GNETAZ::updateGeometry() { + // Nothing to do +} + + +void +GNETAZ::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myTAZShape); +} + + +Position +GNETAZ::getPositionInView() const { + return myTAZShape.getCentroid(); +} + + +Boundary +GNETAZ::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else if (myTAZShape.size() > 0) { + Boundary b = myTAZShape.getBoxBoundary(); + b.grow(20); + return b; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNETAZ::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNETAZ::moveGeometry(const Position& offset) { + // restore old position, apply offset and update Geometry + myTAZShape[0] = myMove.originalViewPosition; + myTAZShape[0].add(offset); + // filtern position using snap to active grid + myTAZShape[0] = myNet->getViewNet()->snapToActiveGrid(myTAZShape[0]); +} + + +void +GNETAZ::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_SHAPE, toString(myTAZShape[0]), toString(myMove.originalViewPosition))); + undoList->p_end(); +} + + +void +GNETAZ::startTAZGeometryMoving(const double shapeOffset) { + // save current centering boundary + myMove.movingGeometryBoundary = getCenteringBoundary(); + // start move shape depending of block shape + if (myBlockShape) { + startMoveShape(myTAZShape, -1, myHintSize); + } else { + startMoveShape(myTAZShape, shapeOffset, myHintSize); + } +} + + +void +GNETAZ::endTAZGeometryMoving() { + // check that endGeometryMoving was called only once + if (myMove.movingGeometryBoundary.isInitialised()) { + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // reset myMovingGeometryBoundary + myMove.movingGeometryBoundary.reset(); + // add object into grid again (using the new centering boundary) + myNet->addGLObjectIntoGrid(this); + } +} + + +int +GNETAZ::getTAZVertexIndex(Position pos, const bool snapToGrid) const { + // check if position has to be snapped to grid + if (snapToGrid) { + pos = myNet->getViewNet()->snapToActiveGrid(pos); + } + const double offset = myTAZShape.nearest_offset_to_point2D(pos, true); + if (offset == GeomHelper::INVALID_OFFSET) { + return -1; + } + Position newPos = myTAZShape.positionAtOffset2D(offset); + // first check if vertex already exists in the inner geometry + for (int i = 0; i < (int)myTAZShape.size(); i++) { + if (myTAZShape[i].distanceTo2D(newPos) < myHintSize) { + // index refers to inner geometry + if (i == 0 || i == (int)(myTAZShape.size() - 1)) { + return -1; + } + return i; + } + } + return -1; +} + + +void +GNETAZ::moveTAZShape(const Position& offset) { + // first obtain a copy of shapeBeforeMoving + PositionVector newShape = getShapeBeforeMoving(); + if (moveEntireShape()) { + // move entire shape + newShape.add(offset); + } else { + int geometryPointIndex = getGeometryPointIndex(); + // if geometryPoint is -1, then we have to create a new geometry point + if (geometryPointIndex == -1) { + geometryPointIndex = newShape.insertAtClosest(getPosOverShapeBeforeMoving(), true); + } + // get last index + const int lastIndex = (int)newShape.size() - 1; + // check if we have to move first and last postion + if ((newShape.size() > 2) && + ((geometryPointIndex == 0) || (geometryPointIndex == lastIndex))) { + // move first and last position in newShape + newShape[0].add(offset); + newShape[lastIndex].add(offset); + } else { + // move geometry point within newShape + newShape[geometryPointIndex].add(offset); + } + } + // set new TAZ shape + myTAZShape = newShape; +} + + +void +GNETAZ::commitTAZShapeChange(GNEUndoList* undoList) { + // restore original shape into shapeToCommit + PositionVector shapeToCommit = myTAZShape; + // get geometryPoint radius + const double geometryPointRadius = myHintSize * myNet->getViewNet()->getVisualisationSettings().junctionSize.exaggeration; + // remove double points + shapeToCommit.removeDoublePoints(geometryPointRadius); + // check if we have to merge start and end points + if ((shapeToCommit.front() != shapeToCommit.back()) && (shapeToCommit.front().distanceTo2D(shapeToCommit.back()) < geometryPointRadius)) { + shapeToCommit[0] = shapeToCommit.back(); + } + // update geometry + updateGeometry(); + // restore old geometry to allow change attribute (And restore shape if during movement a new point was created + myTAZShape = getShapeBeforeMoving(); + // finish geometry moving + endTAZGeometryMoving(); + // commit new shape + undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_SHAPE, toString(shapeToCommit))); + undoList->p_end(); +} + + +int +GNETAZ::getVertexIndex(Position pos, bool snapToGrid) { + // check if position has to be snapped to grid + if (snapToGrid) { + pos = myNet->getViewNet()->snapToActiveGrid(pos); + } + // first check if vertex already exists + for (auto i : myTAZShape) { + if (i.distanceTo2D(pos) < myHintSize) { + return myTAZShape.indexOfClosest(i); + } + } + return -1; +} + + +void +GNETAZ::deleteGeometryPoint(const Position& pos, bool allowUndo) { + if (myTAZShape.size() > 2) { + // obtain index + PositionVector modifiedShape = myTAZShape; + int index = modifiedShape.indexOfClosest(pos); + // remove point dependending of + if ((index == 0 || index == (int)modifiedShape.size() - 1)) { + modifiedShape.erase(modifiedShape.begin()); + modifiedShape.erase(modifiedShape.end() - 1); + modifiedShape.push_back(modifiedShape.front()); + } else { + modifiedShape.erase(modifiedShape.begin() + index); + } + // set new shape depending of allowUndo + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("delete geometry point"); + setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // first remove object from grid due shape is used for boundary + myNet->removeGLObjectFromGrid(this); + // set new shape + myTAZShape = modifiedShape; + // add object into grid again + myNet->addGLObjectIntoGrid(this); + } + } else { + WRITE_WARNING("Number of remaining points insufficient") + } +} + + +bool +GNETAZ::isShapeBlocked() const { + return myBlockShape; +} + + +std::string +GNETAZ::getParentName() const { + return myNet->getMicrosimID(); +} + + +void +GNETAZ::drawGL(const GUIVisualizationSettings& s) const { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // obtain Exaggeration + const double TAZExaggeration = s.polySize.getExaggeration(s, this); + const Boundary TAZBoundary = myTAZShape.getBoxBoundary(); + // check if TAZ can be drawn + if ((TAZExaggeration > 0) && myNet->getViewNet()->getDataViewOptions().showAdditionals() && + (s.scale * MAX2(TAZBoundary.getWidth(), TAZBoundary.getHeight())) >= s.polySize.minSize) { + // push name + glPushName(getGlID()); + // check TAZ ssize + if (myTAZShape.size() > 1) { + // push line matrix + glPushMatrix(); + // translate to 0 (GLO_NETWORK) + glTranslated(0, 0, GLO_NETWORK); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(myColor); + } + // recall tesselation + performTesselation(s, 1); + // pop tesselation matrix + glPopMatrix(); + // draw name + drawName(myTAZShape.getPolygonCenter(), s.scale, s.polyName, s.angle); + } + // draw geometry details hints if is not too small and isn't in selecting mode + if (s.scale * myHintSize > 1.) { + // set values relative to mouse position regarding to shape + bool mouseOverVertex = false; + bool modeMove = myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE; + Position mousePosition = myNet->getViewNet()->getPositionInformation(); + double distanceToShape = myTAZShape.distance2D(mousePosition); + // set colors + RGBColor invertedColor, darkerColor; + if (drawUsingSelectColor()) { + invertedColor = s.colorSettings.selectionColor.invertedColor(); + darkerColor = s.colorSettings.selectionColor.changedBrightness(-32); + } else { + invertedColor = GLHelper::getColor().invertedColor(); + darkerColor = GLHelper::getColor().changedBrightness(-32); + } + // Draw geometry hints if polygon's shape isn't blocked + if (myBlockShape == false) { + // draw a boundary for moving using darkerColor + glPushMatrix(); + glTranslated(0, 0, GLO_TAZ); + GLHelper::setColor(darkerColor); + GLHelper::drawBoxLines(myTAZShape, (myHintSize / 4) * s.polySize.getExaggeration(s, this)); + glPopMatrix(); + // draw shape points only in Network supemode + if (!myNet->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + for (const auto& TAZVertex : myTAZShape) { + if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(TAZVertex) <= (myHintSizeSquared + 2))) { + glPushMatrix(); + glTranslated(TAZVertex.x(), TAZVertex.y(), GLO_TAZ + 0.01); + // Change color of vertex and flag mouseOverVertex if mouse is over vertex + if (modeMove && (TAZVertex.distanceTo2D(mousePosition) < myHintSize)) { + mouseOverVertex = true; + GLHelper::setColor(invertedColor); + } else { + GLHelper::setColor(darkerColor); + } + GLHelper::drawFilledCircle(myHintSize, s.getCircleResolution()); + glPopMatrix(); + } + } + // check if draw moving hint has to be drawed + if (modeMove && (mouseOverVertex == false) && (myBlockMovement == false) && (distanceToShape < myHintSize)) { + // push matrix + glPushMatrix(); + Position hintPos = myTAZShape.size() > 1 ? myTAZShape.positionAtOffset2D(myTAZShape.nearest_offset_to_point2D(mousePosition)) : myTAZShape[0]; + glTranslated(hintPos.x(), hintPos.y(), GLO_TAZ + 0.02); + GLHelper::setColor(invertedColor); + GLHelper:: drawFilledCircle(myHintSize, s.getCircleResolution()); + glPopMatrix(); + } + } + } + } + // check if dotted contour has to be drawn + if ((myNet->getViewNet()->getDottedAC() == this) || (myNet->getViewNet()->getViewParent()->getTAZFrame()->getTAZCurrentModul()->getTAZ() == this)) { + GNEGeometry::drawShapeDottedContour(s, GLO_TAZ + 1, TAZExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +std::string +GNETAZ::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_SHAPE: + return toString(myTAZShape); + case SUMO_ATTR_COLOR: + return toString(myColor); + case SUMO_ATTR_FILL: + return toString(myDrawFill); + case SUMO_ATTR_EDGES: { + std::vector edgeIDs; + for (auto i : getChildAdditionals()) { + edgeIDs.push_back(i->getAttribute(SUMO_ATTR_EDGE)); + } + return toString(edgeIDs); + } + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_BLOCK_SHAPE: + return toString(myBlockShape); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + case GNE_ATTR_MIN_SOURCE: + return toString(myMinWeightSource); + case GNE_ATTR_MIN_SINK: + return toString(myMinWeightSink); + case GNE_ATTR_MAX_SOURCE: + return toString(myMaxWeightSource); + case GNE_ATTR_MAX_SINK: + return toString(myMaxWeightSink); + case GNE_ATTR_AVERAGE_SOURCE: + return toString(myAverageWeightSource); + case GNE_ATTR_AVERAGE_SINK: + return toString(myAverageWeightSink); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNETAZ::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case GNE_ATTR_MIN_SOURCE: + return myMinWeightSource; + case GNE_ATTR_MIN_SINK: + return myMinWeightSink; + case GNE_ATTR_MAX_SOURCE: + return myMaxWeightSource; + case GNE_ATTR_MAX_SINK: + return myMaxWeightSink; + case GNE_ATTR_AVERAGE_SOURCE: + return myAverageWeightSource; + case GNE_ATTR_AVERAGE_SINK: + return myAverageWeightSink; + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNETAZ::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: + case SUMO_ATTR_SHAPE: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_FILL: + case SUMO_ATTR_EDGES: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_BLOCK_SHAPE: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNETAZ::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_SHAPE: + return canParse(value); + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_FILL: + return canParse(value); + case SUMO_ATTR_EDGES: + if (value.empty()) { + return true; + } else { + return SUMOXMLDefinitions::isValidListOfTypeID(value); + } + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_BLOCK_SHAPE: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNETAZ::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNETAZ::getPopUpID() const { + return getTagStr() + ":" + getID(); +} + + +std::string +GNETAZ::getHierarchyName() const { + return getTagStr(); +} + + +void +GNETAZ::updateParentAdditional() { + // reset all stadistic variables + myMaxWeightSource = 0; + myMinWeightSource = -1; + myAverageWeightSource = 0; + myMaxWeightSink = 0; + myMinWeightSink = -1; + myAverageWeightSink = 0; + // declare an extra variables for saving number of children + int numberOfSources = 0; + int numberOfSinks = 0; + // iterate over child additional + for (const auto& additional : getChildAdditionals()) { + if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { + double weight = additional->getAttributeDouble(SUMO_ATTR_WEIGHT); + // check max Weight + if (myMaxWeightSource < weight) { + myMaxWeightSource = weight; + } + // check min Weight + if ((myMinWeightSource == -1) || (weight < myMinWeightSource)) { + myMinWeightSource = weight; + } + // update Average + myAverageWeightSource += weight; + // update number of sources + numberOfSources++; + } else if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { + double weight = additional->getAttributeDouble(SUMO_ATTR_WEIGHT); + // check max Weight + if (myMaxWeightSink < weight) { + myMaxWeightSink = weight; + } + // check min Weight + if ((myMinWeightSink == -1) || (weight < myMinWeightSink)) { + myMinWeightSink = weight; + } + // update Average + myAverageWeightSink += weight; + // update number of sinks + numberOfSinks++; + } + } + // calculate average + myAverageWeightSource /= numberOfSources; + myAverageWeightSink /= numberOfSinks; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNETAZ::performTesselation(const GUIVisualizationSettings& s, double /*lineWidth*/) const { + const bool moveMode = (myNet->getViewNet()->getEditModes().networkEditMode != NetworkEditMode::NETWORK_MOVE); + if (myDrawFill && (!s.drawForPositionSelection || moveMode || myBlockShape)) { + // draw the tesselated shape + double* points = new double[myTAZShape.size() * 3]; + GLUtesselator* tobj = gluNewTess(); + gluTessCallback(tobj, GLU_TESS_VERTEX, (GLvoid(APIENTRY*)()) &glVertex3dv); + gluTessCallback(tobj, GLU_TESS_BEGIN, (GLvoid(APIENTRY*)()) &beginTAZCallback); + gluTessCallback(tobj, GLU_TESS_END, (GLvoid(APIENTRY*)()) &endTAZCallback); + //gluTessCallback(tobj, GLU_TESS_ERROR, (GLvoid (APIENTRY*) ()) &errorCallback); + gluTessCallback(tobj, GLU_TESS_COMBINE, (GLvoid(APIENTRY*)()) &combineTAZCallback); + gluTessProperty(tobj, GLU_TESS_WINDING_RULE, GLU_TESS_WINDING_ODD); + gluTessBeginPolygon(tobj, nullptr); + gluTessBeginContour(tobj); + for (int i = 0; i != (int)myTAZShape.size(); ++i) { + points[3 * i] = myTAZShape[(int) i].x(); + points[3 * i + 1] = myTAZShape[(int) i].y(); + points[3 * i + 2] = 0; + gluTessVertex(tobj, points + 3 * i, points + 3 * i); + } + gluTessEndContour(tobj); + + gluTessEndPolygon(tobj); + gluDeleteTess(tobj); + delete[] points; + } else { + // draw line around TAZ + GLHelper::drawBoxLines(myTAZShape, 1); + } + +} + + +void +GNETAZ::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_SHAPE: + myNet->removeGLObjectFromGrid(this); + myTAZShape = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_COLOR: + myColor = parse(value); + break; + case SUMO_ATTR_FILL: + myDrawFill = parse(value); + break; + case SUMO_ATTR_EDGES: + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_BLOCK_SHAPE: + myBlockShape = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZ.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZ.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZ.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZ.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,223 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZ.h +/// @author Pablo Alvarez Lopez +/// @date Oct 2018 +/// +// +/****************************************************************************/ +#pragma once +#include + +#include "GNEAdditional.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNETAZ + * Class for Traffic Assign Zones (TAZs) + */ +class GNETAZ : public GNEAdditional, protected GNEMoveShape { + +public: + /**@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 + * @param[in] block movement enable or disable additional movement + */ + GNETAZ(const std::string& id, GNENet* net, PositionVector shape, RGBColor color, bool blockMovement); + + /// @brief GNETAZ Destructor + ~GNETAZ(); + + /// @brief get TAZ shape + const PositionVector& getTAZShape() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name Functions related with shape of element + /// @{ + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startTAZGeometryMoving(const double shapeOffset); + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void endTAZGeometryMoving(); + + /**@brief return index of geometry point placed in given position, or -1 if no exist + * @param pos position of new/existent vertex + * @param snapToGrid enable or disable snapToActiveGrid + * @return index of position vector + */ + int getTAZVertexIndex(Position pos, const bool snapToGrid) const; + + /**@brief move shape + * @param[in] offset the offset of movement + */ + void moveTAZShape(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitTAZShapeChange(GNEUndoList* undoList); + + /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge + * @param pos position of new/existent vertex + * @param snapToGrid enable or disable snapToActiveGrid + * @return index of position vector + */ + int getVertexIndex(Position pos, bool snapToGrid); + + /// @brief delete the geometry point closest to the given pos + void deleteGeometryPoint(const Position& pos, bool allowUndo = true); + + /// @brief return true if Shape TAZ is blocked + bool isShapeBlocked() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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 update TAZ after add or remove a Source/sink, or change their weight + void updateParentAdditional(); + +protected: + /// @brief TAZ Color + RGBColor myColor; + + /// @brief TAZ shape + PositionVector myTAZShape; + + /// @brief flag for block shape + bool myBlockShape; + + /// @brief flag for draw TAZ filled + bool myDrawFill; + + /// @brief index of vertex that is been moved (-1 means that none vertex is been moved) + int myCurrentMovingVertexIndex; + +private: + /// @brief hint size of vertex + static const double myHintSize; + + /// @brief squaredhint size of vertex + static const double myHintSizeSquared; + + /// @brief Max source weight + double myMaxWeightSource; + + /// @brief Min source weight + double myMinWeightSource; + + /// @brief Average source weight + double myAverageWeightSource; + + /// @brief Max Sink weight + double myMaxWeightSink; + + /// @brief Min Sink weight + double myMinWeightSink; + + /// @brief Average Sink weight + double myAverageWeightSink; + + // @brief perform the tesselation / drawing + void performTesselation(const GUIVisualizationSettings& s, double lineWidth) const; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNETAZ(const GNETAZ&) = delete; + + /// @brief Invalidated assignment operator. + GNETAZ& operator=(const GNETAZ&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,241 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZSourceSink.cpp +/// @author Pablo Alvarez Lopez +/// @date Apr 2017 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include + +#include "GNETAZSourceSink.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNETAZSourceSink::GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight) : + GNEAdditional(TAZParent, TAZParent->getNet(), GLO_TAZ, sourceSinkTag, "", false, +{}, {edge}, {}, {}, {TAZParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myDepartWeight(departWeight) { + //check that this is a TAZ Source OR a TAZ Sink + if ((sourceSinkTag != SUMO_TAG_TAZSOURCE) && (sourceSinkTag != SUMO_TAG_TAZSINK)) { + throw InvalidArgument("Invalid TAZ Child Tag"); + } +} + + +GNETAZSourceSink::~GNETAZSourceSink() {} + + +double +GNETAZSourceSink::getDepartWeight() const { + return myDepartWeight; +} + + +void +GNETAZSourceSink::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNETAZSourceSink::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNETAZSourceSink::updateGeometry() { + // This additional doesn't own a geometry +} + +void +GNETAZSourceSink::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNETAZSourceSink::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNETAZSourceSink::getCenteringBoundary() const { + return getParentEdges().front()->getCenteringBoundary(); +} + + +void +GNETAZSourceSink::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNETAZSourceSink::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNETAZSourceSink::drawGL(const GUIVisualizationSettings&) const { + // Currently This additional isn't drawn +} + + +std::string +GNETAZSourceSink::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGE: + return getParentEdges().front()->getID(); + case SUMO_ATTR_WEIGHT: + return toString(myDepartWeight); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + case GNE_ATTR_TAZCOLOR: { + // obtain max and min weight source + double maxWeightSource = getParentAdditionals().at(0)->getAttributeDouble(GNE_ATTR_MAX_SOURCE); + double minWeightSource = getParentAdditionals().at(0)->getAttributeDouble(GNE_ATTR_MIN_SOURCE); + // avoid division between zero + if ((maxWeightSource - minWeightSource) == 0) { + return "0"; + } else { + // calculate percentage relative to the max and min weight + double percentage = (myDepartWeight - minWeightSource) / (maxWeightSource - minWeightSource); + // convert percentage to a value between [0-9] (because we have only 10 colors) + if (percentage >= 1) { + return "9"; + } else if (percentage < 0) { + return "0"; + } else { + return toString((int)(percentage * 10)); + } + } + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +double +GNETAZSourceSink::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_WEIGHT: + return myDepartWeight; + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNETAZSourceSink::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + // this additional is the only that can edit a variable directly, see GNEAdditionalHandler::buildTAZEdge(...) + if (undoList == nullptr) { + setAttribute(key, value); + } else { + if (value == getAttribute(key)) { + return; //avoid needless changes, later logic relies on the fact that attributes have changed + } + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_WEIGHT: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + } +} + + +bool +GNETAZSourceSink::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_WEIGHT: + return canParse(value) && (parse(value) >= 0); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + + +bool +GNETAZSourceSink::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_EDGE: + return false; + default: + return true; + } +} + + +std::string +GNETAZSourceSink::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNETAZSourceSink::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_WEIGHT); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNETAZSourceSink::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_WEIGHT: + myDepartWeight = parse(value); + // update statictis of TAZ parent + getParentAdditionals().at(0)->updateParentAdditional(); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNETAZSourceSink.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,151 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZSourceSink.h +/// @author Pablo Alvarez Lopez +/// @date Apr 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNETAZ; +class GNETAZSink; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNETAZSourceSink + * class used to represent a interval used in Traffic Assignment Zones + */ +class GNETAZSourceSink : public GNEAdditional { + +public: + /**@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 + * @param[in] edge Edge of this TAZ Child belongs + * @param[in] departWeight depart weight of this TAZ child + */ + GNETAZSourceSink(SumoXMLTag sourceSinkTag, GNEAdditional* TAZParent, GNEEdge* edge, double departWeight); + + /// @brief destructor + ~GNETAZSourceSink(); + + /// @brief get depart weight + double getDepartWeight() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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; + /// @} + + /// @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 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 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; + + /// @} + +protected: + /// @brief depart Weight + double myDepartWeight; + +private: + /// @brief method for setting the attribute and nothing else + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNETAZSourceSink(const GNETAZSourceSink&) = delete; + + /// @brief Invalidated assignment operator + GNETAZSourceSink& operator=(const GNETAZSourceSink&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,358 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVaporizer.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEVaporizer.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVaporizer::GNEVaporizer(GNENet* net, GNEEdge* edge, SUMOTime begin, SUMOTime end, const std::string& name) : + GNEAdditional(edge->getID(), net, GLO_VAPORIZER, SUMO_TAG_VAPORIZER, name, false, +{}, {edge}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myBegin(begin), +myEnd(end) { +} + + +GNEVaporizer::~GNEVaporizer() { +} + + +void +GNEVaporizer::updateGeometry() { + // get lanes of edge + GNELane* firstLane = getParentEdges().front()->getLanes().at(0); + + // Get shape of parent lane + const double offset = firstLane->getLaneShape().length() < 2.5 ? firstLane->getLaneShape().length() : 2.5; + + // update geometry + myAdditionalGeometry.updateGeometry(firstLane, offset); + + // Set block icon position + myBlockIcon.position = myAdditionalGeometry.getShape().getLineCenter(); + + // Set offset of the block icon + myBlockIcon.offset = Position(1.1, (-3.06)); + + // Set block icon rotation, and using their rotation for logo + myBlockIcon.setRotation(firstLane); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEVaporizer::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), + myAdditionalGeometry.getPosition(), + myAdditionalGeometry.getRotation(), + myNet->getViewNet()->getVisualisationSettings().additionalSettings.vaporizerSize, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.vaporizerSize); +} + + +Position +GNEVaporizer::getPositionInView() const { + if (getParentEdges().front()->getLanes().front()->getLaneShape().length() < 2.5) { + return getParentEdges().front()->getLanes().front()->getLaneShape().front(); + } else { + Position A = getParentEdges().front()->getLanes().front()->getLaneShape().positionAtOffset(2.5); + Position B = getParentEdges().front()->getLanes().back()->getLaneShape().positionAtOffset(2.5); + + // return Middle point + return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); + } +} + + +Boundary +GNEVaporizer::getCenteringBoundary() const { + return myAdditionalGeometry.getShape().getBoxBoundary().grow(10); +} + + +void +GNEVaporizer::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEVaporizer::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEVaporizer::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +std::string +GNEVaporizer::getParentName() const { + return getParentEdges().front()->getID(); +} + + +void +GNEVaporizer::drawGL(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double vaporizerExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(vaporizerExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // get values + const int numberOfLanes = int(getParentEdges().front()->getLanes().size()); + const double width = (double) 2.0 * s.scale; + // begin draw + glPushName(getGlID()); + glLineWidth(1.0); + // set color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedAdditionalColor); + } else { + GLHelper::setColor(s.additionalSettings.vaporizerColor); + } + // draw shape + glPushMatrix(); + glTranslated(0, 0, getType()); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), 0); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glScaled(vaporizerExaggeration, vaporizerExaggeration, 1); + glTranslated(-1.6, -1.6, 0); + glBegin(GL_QUADS); + glVertex2d(0, 0.25); + glVertex2d(0, -0.25); + glVertex2d((numberOfLanes * 3.3), -0.25); + glVertex2d((numberOfLanes * 3.3), 0.25); + glEnd(); + glTranslated(0, 0, .01); + glBegin(GL_LINES); + glVertex2d(0, 0.25 - .1); + glVertex2d(0, -0.25 + .1); + glEnd(); + // draw position indicator (White) if isn't being drawn for selecting + if ((width * vaporizerExaggeration > 1) && !s.drawForRectangleSelection) { + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectionColor); + } else { + GLHelper::setColor(RGBColor::WHITE); + } + glRotated(90, 0, 0, -1); + glBegin(GL_LINES); + glVertex2d(0, 0); + glVertex2d(0, (numberOfLanes * 3.3)); + glEnd(); + } + // Pop shape matrix + glPopMatrix(); + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(myAdditionalGeometry.getPosition().x(), myAdditionalGeometry.getPosition().y(), getType()); + glRotated(myAdditionalGeometry.getRotation(), 0, 0, 1); + glTranslated((-2.56), (-1.6), 0); + // Draw icon depending of Vaporizer is selected and if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, vaporizerExaggeration)) { + glColor3d(1, 1, 1); + glRotated(-90, 0, 0, 1); + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VAPORIZERSELECTED), s.additionalSettings.vaporizerSize); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VAPORIZER), s.additionalSettings.vaporizerSize); + } + } else { + GLHelper::setColor(s.additionalSettings.vaporizerColor); + GLHelper::drawBoxLine(Position(0, s.additionalSettings.vaporizerSize), 0, 2 * s.additionalSettings.vaporizerSize, s.additionalSettings.vaporizerSize); + } + // Pop logo matrix + glPopMatrix(); + // Show Lock icon + myBlockIcon.drawIcon(s, vaporizerExaggeration, 0.4); + // draw name + drawName(getPositionInView(), s.scale, s.addName); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), vaporizerExaggeration, myDottedGeometry); + } + // pop name + glPopName(); + } +} + + +std::string +GNEVaporizer::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_EDGE: + return getID(); + case SUMO_ATTR_BEGIN: + return time2string(myBegin); + case SUMO_ATTR_END: + return time2string(myEnd); + case SUMO_ATTR_NAME: + return myAdditionalName; + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVaporizer::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_BEGIN: + return STEPS2TIME(myBegin); + case SUMO_ATTR_END: + return STEPS2TIME(myEnd); + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVaporizer::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: + case SUMO_ATTR_EDGE: + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + case SUMO_ATTR_NAME: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVaporizer::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_EDGE: + if (myNet->retrieveEdge(value, false) != nullptr) { + return isValidAdditionalID(value); + } else { + return false; + } + case SUMO_ATTR_BEGIN: + if (canParse(value)) { + return (parse(value) <= myEnd); + } else { + return false; + } + case SUMO_ATTR_END: + if (canParse(value)) { + return (myBegin <= parse(value)); + } else { + return false; + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVaporizer::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEVaporizer::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEVaporizer::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVaporizer::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_EDGE: + myNet->getAttributeCarriers()->updateID(this, value); + replaceParentEdges(this, value); + break; + case SUMO_ATTR_BEGIN: + myBegin = parse(value); + break; + case SUMO_ATTR_END: + myEnd = parse(value); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVaporizer.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,143 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVaporizer.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEVaporizer + * @brief Representation of a vaporizer in netedit + */ +class GNEVaporizer : public GNEAdditional { + +public: + /**@brief Constructor + * @param[in] net pointer to GNENet of this additional element belongs + * @param[in] edge edge in which this vaporizer is placed + * @param[in] begin start time of vaporizer + * @param[in] end end time of vaporizer + * @param[in] name Vaporizer name + */ + GNEVaporizer(GNENet* net, GNEEdge* edge, SUMOTime begin, SUMOTime end, const std::string& name); + + /// @brief Destructor + ~GNEVaporizer(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /// @brief Returns the name of the parent object + /// @return This object's parent id + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief begin time of vaporizer + SUMOTime myBegin; + + /// @brief end time in which this vaporizer is placed + SUMOTime myEnd; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEVaporizer(const GNEVaporizer&) = delete; + + /// @brief Invalidated assignment operator. + GNEVaporizer& operator=(const GNEVaporizer&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,333 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVariableSpeedSign.cpp +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEVariableSpeedSign.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVariableSpeedSign::GNEVariableSpeedSign(const std::string& id, GNENet* net, const Position& pos, const std::vector& lanes, const std::string& name, bool blockMovement) : + GNEAdditional(id, net, GLO_VSS, SUMO_TAG_VSS, name, blockMovement, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, lanes, {}, {}, {}, {}), // Children +myPosition(pos) { +} + + +GNEVariableSpeedSign::~GNEVariableSpeedSign() { +} + + +void +GNEVariableSpeedSign::updateGeometry() { + // Set block icon position + myBlockIcon.position = myPosition; + + // Set block icon offset + myBlockIcon.offset = Position(-0.5, -0.5); + + // Set block icon rotation, and using their rotation for draw logo + myBlockIcon.setRotation(); + + // update child connections + myChildConnections.update(); + + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEVariableSpeedSign::updateDottedContour() { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), myPosition, 0, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.VSSSize, + myNet->getViewNet()->getVisualisationSettings().additionalSettings.VSSSize); +} + + +Position +GNEVariableSpeedSign::getPositionInView() const { + return myPosition; +} + + +Boundary +GNEVariableSpeedSign::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMove.movingGeometryBoundary.isInitialised()) { + return myMove.movingGeometryBoundary; + } else { + Boundary b; + b.add(myPosition); + b.grow(5); + return b; + } +} + + +void +GNEVariableSpeedSign::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEVariableSpeedSign::openAdditionalDialog() { + // Open VSS dialog + GNEVariableSpeedSignDialog(this); +} + + +void +GNEVariableSpeedSign::moveGeometry(const Position& offset) { + // restore old position, apply offset and update Geometry + myPosition = myMove.originalViewPosition; + myPosition.add(offset); + // filtern position using snap to active grid + myPosition = myNet->getViewNet()->snapToActiveGrid(myPosition); + updateGeometry(); +} + + +void +GNEVariableSpeedSign::commitGeometryMoving(GNEUndoList* undoList) { + // commit new position allowing undo/redo + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myPosition), toString(myMove.originalViewPosition))); + undoList->p_end(); +} + + +std::string +GNEVariableSpeedSign::getParentName() const { + return myNet->getMicrosimID(); +} + + +void +GNEVariableSpeedSign::drawGL(const GUIVisualizationSettings& s) const { + // obtain exaggeration + const double VSSExaggeration = s.addSize.getExaggeration(s, this); + // first check if additional has to be drawn + if (s.drawAdditionals(VSSExaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix for drawing logo + glPushMatrix(); + glTranslated(myPosition.x(), myPosition.y(), getType()); + // scale + glScaled(VSSExaggeration, VSSExaggeration, 1); + // Draw icon depending of variable speed sign is or if isn't being drawn for selecting + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.laneTextures, VSSExaggeration)) { + glColor3d(1, 1, 1); + glRotated(180, 0, 0, 1); + if (drawUsingSelectColor()) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VARIABLESPEEDSIGNSELECTED), s.additionalSettings.VSSSize); + } else { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_VARIABLESPEEDSIGN), s.additionalSettings.VSSSize); + } + } else { + GLHelper::setColor(RGBColor::WHITE); + GLHelper::drawBoxLine(Position(0, s.additionalSettings.VSSSize), 0, 2 * s.additionalSettings.VSSSize, s.additionalSettings.VSSSize); + + } + // Pop draw icon matrix + glPopMatrix(); + // Show Lock icon + myBlockIcon.drawIcon(s, VSSExaggeration, 0.4); + // Draw child connections + drawChildConnections(s, getType()); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getPositionInView(), s.scale, s.addName); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), VSSExaggeration, myDottedGeometry); + // draw shape dotte contour aroud alld connections between child and parents + for (auto i : myChildConnections.connectionPositions) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), i, 0); + } + } + // Pop name + glPopName(); + } +} + + +std::string +GNEVariableSpeedSign::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_LANES: + return parseIDs(getChildLanes()); + case SUMO_ATTR_POSITION: + return toString(myPosition); + case SUMO_ATTR_NAME: + return myAdditionalName; + case GNE_ATTR_BLOCK_MOVEMENT: + return toString(myBlockMovement); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVariableSpeedSign::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEVariableSpeedSign::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: { + // change ID of Rerouter Interval + undoList->p_add(new GNEChange_Attribute(this, key, value)); + // Change Ids of all Variable Speed Sign + for (auto i : getChildAdditionals()) { + i->setAttribute(SUMO_ATTR_ID, generateChildID(SUMO_TAG_STEP), undoList); + } + break; + } + case SUMO_ATTR_LANES: + case SUMO_ATTR_POSITION: + case SUMO_ATTR_NAME: + case GNE_ATTR_BLOCK_MOVEMENT: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVariableSpeedSign::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_LANES: + if (value.empty()) { + return false; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_NAME: + return SUMOXMLDefinitions::isValidAttribute(value); + case GNE_ATTR_BLOCK_MOVEMENT: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVariableSpeedSign::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEVariableSpeedSign::getPopUpID() const { + return getTagStr() + ": " + getID(); +} + + +std::string +GNEVariableSpeedSign::getHierarchyName() const { + return getTagStr(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVariableSpeedSign::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_LANES: + changeChildLanes(this, value); + break; + case SUMO_ATTR_POSITION: + myNet->removeGLObjectFromGrid(this); + myPosition = parse(value); + myNet->addGLObjectIntoGrid(this); + break; + case SUMO_ATTR_NAME: + myAdditionalName = value; + break; + case GNE_ATTR_BLOCK_MOVEMENT: + myBlockMovement = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSign.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,151 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVariableSpeedSign.h +/// @author Pablo Alvarez Lopez +/// @date Nov 2015 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEVariableSpeedSignStep; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEVariableSpeedSign + * allows the simulation of variable speed signs + */ +class GNEVariableSpeedSign : public GNEAdditional { + +public: + + /**@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 + * @param[in] pos position (center) of the variable speed sign in the map + * @param[in] lanes vector with the lanes of variable speed signal + * @param[in] name VSS name + * @param[in] block movement enable or disable additional movement + */ + GNEVariableSpeedSign(const std::string& id, GNENet* net, const Position& pos, const std::vector& lanes, const std::string& name, bool blockMovement); + + /// @brief Destructor + ~GNEVariableSpeedSign(); + + /// @brief open GNEVariableSpeedSignDialog + void openAdditionalDialog(); + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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; + /// @} + +protected: + /// @brief position of VSS in view + Position myPosition; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEVariableSpeedSign(const GNEVariableSpeedSign&) = delete; + + /// @brief Invalidated assignment operator. + GNEVariableSpeedSign& operator=(const GNEVariableSpeedSign&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,247 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVariableSpeedSignStep.cpp +/// @author Pablo Alvarez Lopez +/// @date Apr 2017 +/// +// +/****************************************************************************/ +#include + +#include +#include +#include +#include + +#include "GNEVariableSpeedSignStep.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog) : + GNEAdditional(variableSpeedSignDialog->getEditedAdditional(), variableSpeedSignDialog->getEditedAdditional()->getNet(), GLO_VSS, SUMO_TAG_STEP, "", false, +{}, {}, {}, {}, {variableSpeedSignDialog->getEditedAdditional()}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myTime(0), +mySpeed(0) { + // fill VSS Step with default values + setDefaultValues(); + // set time Attribute manually + if (getParentAdditionals().at(0)->getChildAdditionals().size() > 0) { + myTime = getParentAdditionals().at(0)->getChildAdditionals().back()->getAttributeDouble(SUMO_ATTR_TIME) + 1; + } else { + myTime = 0; + } +} + + +GNEVariableSpeedSignStep::GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed) : + GNEAdditional(variableSpeedSignParent, variableSpeedSignParent->getNet(), GLO_VSS, SUMO_TAG_STEP, "", false, +{}, {}, {}, {}, {variableSpeedSignParent}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myTime(time), +mySpeed(speed) { +} + + +GNEVariableSpeedSignStep::~GNEVariableSpeedSignStep() {} + + +double +GNEVariableSpeedSignStep::getTime() const { + return myTime; +} + + +void +GNEVariableSpeedSignStep::moveGeometry(const Position&) { + // This additional cannot be moved +} + + +void +GNEVariableSpeedSignStep::commitGeometryMoving(GNEUndoList*) { + // This additional cannot be moved +} + + +void +GNEVariableSpeedSignStep::updateGeometry() { + // This additional doesn't own a geometry +} + + +void +GNEVariableSpeedSignStep::updateDottedContour() { + // This additional doesn't own a dotted contour +} + + +Position +GNEVariableSpeedSignStep::getPositionInView() const { + return getParentAdditionals().at(0)->getPositionInView(); +} + + +Boundary +GNEVariableSpeedSignStep::getCenteringBoundary() const { + return getParentAdditionals().at(0)->getCenteringBoundary(); +} + + +void +GNEVariableSpeedSignStep::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +std::string +GNEVariableSpeedSignStep::getParentName() const { + return getParentAdditionals().at(0)->getID(); +} + + +void +GNEVariableSpeedSignStep::drawGL(const GUIVisualizationSettings&) const { + // Currently This additional isn't drawn +} + + +std::string +GNEVariableSpeedSignStep::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_TIME: + return toString(myTime); + case SUMO_ATTR_SPEED: + return toString(mySpeed); + case GNE_ATTR_PARENT: + return getParentAdditionals().at(0)->getID(); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVariableSpeedSignStep::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_TIME: + return myTime; + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVariableSpeedSignStep::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: + case SUMO_ATTR_TIME: + case SUMO_ATTR_SPEED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVariableSpeedSignStep::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidAdditionalID(value); + case SUMO_ATTR_TIME: + if (canParse(value)) { + // Check that + double newTime = parse(value); + // Only allowed positiv times + if (newTime < 0) { + return false; + } + // check that there isn't duplicate times + int counter = 0; + for (auto i : getParentAdditionals().at(0)->getChildAdditionals()) { + if (i->getAttributeDouble(SUMO_ATTR_TIME) == newTime) { + counter++; + } + } + return (counter <= 1); + } else { + return false; + } + case SUMO_ATTR_SPEED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVariableSpeedSignStep::isAttributeEnabled(SumoXMLAttr /* key */) const { + return true; +} + + +std::string +GNEVariableSpeedSignStep::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEVariableSpeedSignStep::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_TIME); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVariableSpeedSignStep::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_TIME: + myTime = parse(value); + break; + case SUMO_ATTR_SPEED: + mySpeed = parse(value); + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.h sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.h --- sumo-1.5.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/additional/GNEVariableSpeedSignStep.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,151 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVariableSpeedSignStep.h +/// @author Pablo Alvarez Lopez +/// @date Apr 2017 +/// +// +/****************************************************************************/ +#pragma once +#include "GNEAdditional.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEVariableSpeedSign; +class GNEVariableSpeedSignDialog; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEVariableSpeedSignStep + * class used to represent a interval used in variable speed sign + */ +class GNEVariableSpeedSignStep : public GNEAdditional { + +public: + /// @brief default constructor + GNEVariableSpeedSignStep(GNEVariableSpeedSignDialog* variableSpeedSignDialog); + + /// @brief constructor + GNEVariableSpeedSignStep(GNEAdditional* variableSpeedSignParent, double time, double speed); + + /// @brief destructor + ~GNEVariableSpeedSignStep(); + + /// @brief get time + double getTime() const; + + /// @name Functions related with geometry of element + /// @{ + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @brief split geometry + void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() const; + + /**@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; + /// @} + + /// @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 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 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; + /// @} + +protected: + /// @brief timeStep + double myTime; + + /// @brief speed in this timeStep + double mySpeed; + +private: + /// @brief method for setting the attribute and nothing else + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief Invalidated copy constructor. + GNEVariableSpeedSignStep(const GNEVariableSpeedSignStep&) = delete; + + /// @brief Invalidated assignment operator + GNEVariableSpeedSignStep& operator=(const GNEVariableSpeedSignStep&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/elements/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/elements/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,20 @@ +add_subdirectory(network) +add_subdirectory(additional) +add_subdirectory(demand) +add_subdirectory(data) + +set(netedit_elements_SRCS + GNEAttributeProperties.h + GNEAttributeProperties.cpp + GNETagProperties.h + GNETagProperties.cpp + GNEAttributeCarrier.h + GNEAttributeCarrier.cpp + GNEHierarchicalParentElements.h + GNEHierarchicalParentElements.cpp + GNEHierarchicalChildElements.h + GNEHierarchicalChildElements.cpp + ) + +add_library(netedit_elements STATIC ${netedit_elements_SRCS}) +set_property(TARGET netedit_elements PROPERTY PROJECT_LABEL "z_netedit_elements") diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/elements/data/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/elements/data/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,17 @@ +set(netedit_elements_data_SRCS + GNEDataHandler.h + GNEDataHandler.cpp + GNEDataSet.h + GNEDataSet.cpp + GNEDataInterval.h + GNEDataInterval.cpp + GNEGenericData.h + GNEGenericData.cpp + GNEEdgeData.h + GNEEdgeData.cpp + GNEEdgeRelData.h + GNEEdgeRelData.cpp + ) + +add_library(netedit_elements_data STATIC ${netedit_elements_data_SRCS}) +set_property(TARGET netedit_elements_data PROPERTY PROJECT_LABEL "z_netedit_elements_data") diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataHandler.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataHandler.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,429 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataHandler.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Builds data objects for netedit +/****************************************************************************/ + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDataHandler.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEAdditionalHandler::HierarchyInsertedDatas method definitions +// --------------------------------------------------------------------------- + +void +GNEDataHandler::HierarchyInsertedDatas::insertElement(SumoXMLTag tag) { + myInsertedElements.push_back(std::make_pair(tag, std::make_pair(nullptr, nullptr))); +} + + + +void +GNEDataHandler::HierarchyInsertedDatas::commitDataIntervalInsertion(GNEDataInterval* dataIntervalCreated) { + myInsertedElements.back().second.first = dataIntervalCreated; +} + + +void +GNEDataHandler::HierarchyInsertedDatas::commitGenericDataInsertion(GNEGenericData* genericDataCreated) { + myInsertedElements.back().second.second = genericDataCreated; +} + + +void +GNEDataHandler::HierarchyInsertedDatas::popElement() { + if (!myInsertedElements.empty()) { + myInsertedElements.pop_back(); + } +} + + +GNEDataInterval* +GNEDataHandler::HierarchyInsertedDatas::retrieveParentDataInterval(SumoXMLTag expectedTag) const { + if (myInsertedElements.size() < 2) { + // currently we're finding parent additional in the additional XML root + WRITE_WARNING("A " + toString(myInsertedElements.back().first) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else { + if (myInsertedElements.size() < 2) { + // additional was hierarchically bad loaded, then return nullptr + return nullptr; + } else if ((myInsertedElements.end() - 2)->second.first == nullptr) { + WRITE_WARNING(toString(expectedTag) + " parent of " + toString((myInsertedElements.end() - 1)->first) + " was not loaded sucesfully."); + // parent additional wasn't sucesfully loaded, then return nullptr + return nullptr; + } + return nullptr; + } +} + + +GNEDataInterval* +GNEDataHandler::HierarchyInsertedDatas::getLastInsertedDataInterval() const { + // ierate in reverse mode over myInsertedElements to obtain last inserted additional + for (std::vector > >::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) { + // we need to avoid Tag Param because isn't a data element + if ((i->first != SUMO_TAG_PARAM) && (i->first == SUMO_TAG_INTERVAL)) { + return i->second.first; + } + } + return nullptr; +} + + +GNEGenericData* +GNEDataHandler::HierarchyInsertedDatas::retrieveParentGenericData(SumoXMLTag expectedTag) const { + if (myInsertedElements.size() < 2) { + // currently we're finding parent additional in the additional XML root + WRITE_WARNING("A " + toString(myInsertedElements.back().first) + " must be declared within the definition of a " + toString(expectedTag) + "."); + return nullptr; + } else { + if (myInsertedElements.size() < 2) { + // additional was hierarchically bad loaded, then return nullptr + return nullptr; + } else if ((myInsertedElements.end() - 2)->second.second == nullptr) { + WRITE_WARNING(toString(expectedTag) + " parent of " + toString((myInsertedElements.end() - 1)->first) + " was not loaded sucesfully."); + // parent additional wasn't sucesfully loaded, then return nullptr + return nullptr; + } + return nullptr; + } +} + + +GNEGenericData* +GNEDataHandler::HierarchyInsertedDatas::getLastInsertedGenericData() const { + // ierate in reverse mode over myInsertedElements to obtain last inserted additional + for (std::vector > >::const_reverse_iterator i = myInsertedElements.rbegin(); i != myInsertedElements.rend(); i++) { + // we need to avoid Tag Param because isn't a data element + if ((i->first != SUMO_TAG_PARAM) && (i->first != SUMO_TAG_INTERVAL)) { + return i->second.second; + } + } + return nullptr; +} + +// --------------------------------------------------------------------------- +// GNEAdditionalHandler::HierarchyInsertedDatas method definitions +// --------------------------------------------------------------------------- + +GNEDataHandler::GNEDataHandler(const std::string& file, GNENet* net) : + SUMOSAXHandler(file), + myNet(net) { +} + + +GNEDataHandler::~GNEDataHandler() {} + + +void +GNEDataHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { + // Obtain tag of element + SumoXMLTag tag = static_cast(element); + // check if we're parsing a parameter + if (tag == SUMO_TAG_PARAM) { + // push element int stack + myHierarchyInsertedGenericDatas.insertElement(tag); + // parse parameter + parseParameter(attrs); + } else if (tag != SUMO_TAG_NOTHING) { + // push element int stack + myHierarchyInsertedGenericDatas.insertElement(tag); + // build data + buildData(myNet, true, tag, attrs, &myHierarchyInsertedGenericDatas); + } +} + + +void +GNEDataHandler::myEndElement(int /*element*/) { + // pop last inserted element + myHierarchyInsertedGenericDatas.popElement(); +} + + +bool +GNEDataHandler::buildData(GNENet* net, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas) { + // Call parse and build depending of tag + switch (tag) { + case SUMO_TAG_INTERVAL: + return parseAndBuildInterval(net, allowUndoRedo, attrs, insertedDatas); + case SUMO_TAG_EDGE: + return parseAndBuildEdgeData(net, allowUndoRedo, attrs, insertedDatas); + case SUMO_TAG_EDGEREL: + return parseAndBuildEdgeRelationData(net, allowUndoRedo, attrs, insertedDatas); + default: + return false; + } +} + + +GNEDataSet* +GNEDataHandler::buildDataSet(GNENet* net, bool allowUndoRedo, const std::string& dataSetID) { + GNEDataSet* dataSet = new GNEDataSet(net, dataSetID); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_DATASET)); + net->getViewNet()->getUndoList()->add(new GNEChange_DataSet(dataSet, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + dataSet->incRef("buildDataSet"); + } + return dataSet; +} + + +GNEDataInterval* +GNEDataHandler::buildDataInterval(GNENet* net, bool allowUndoRedo, GNEDataSet* dataSetParent, const double begin, const double end) { + GNEDataInterval* dataInterval = new GNEDataInterval(dataSetParent, begin, end); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_DATAINTERVAL)); + net->getViewNet()->getUndoList()->add(new GNEChange_DataInterval(dataInterval, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + dataSetParent->addDataIntervalChild(dataInterval); + dataInterval->incRef("buildDataInterval"); + } + return dataInterval; +} + + +GNEEdgeData* +GNEDataHandler::buildEdgeData(GNENet* net, bool allowUndoRedo, GNEDataInterval* dataIntervalParent, GNEEdge* edge, + const std::map& parameters) { + GNEEdgeData* edgeData = new GNEEdgeData(dataIntervalParent, edge, parameters); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_MEANDATA_EDGE)); + net->getViewNet()->getUndoList()->add(new GNEChange_GenericData(edgeData, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + dataIntervalParent->addGenericDataChild(edgeData); + edge->addChildGenericDataElement(edgeData); + edgeData->incRef("buildEdgeData"); + } + return edgeData; +} + + +GNEEdgeRelData* +GNEDataHandler::buildEdgeRelationData(GNENet* net, bool allowUndoRedo, GNEDataInterval* dataIntervalParent, + GNEEdge* fromEdge, GNEEdge* toEdge, const std::map& parameters) { + GNEEdgeRelData* edgeRelationData = new GNEEdgeRelData(dataIntervalParent, fromEdge, toEdge, parameters); + if (allowUndoRedo) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_EDGEREL)); + net->getViewNet()->getUndoList()->add(new GNEChange_GenericData(edgeRelationData, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + dataIntervalParent->addGenericDataChild(edgeRelationData); + fromEdge->addChildGenericDataElement(edgeRelationData); + toEdge->addChildGenericDataElement(edgeRelationData); + edgeRelationData->incRef("buildEdgeRelationData"); + } + return edgeRelationData; +} + + +bool +GNEDataHandler::parseAndBuildInterval(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas) { + bool abort = false; + // parse edgeData attributes + const std::string id = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DATAINTERVAL, SUMO_ATTR_ID, abort); + const double begin = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DATAINTERVAL, SUMO_ATTR_BEGIN, abort); + const double end = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_DATAINTERVAL, SUMO_ATTR_END, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // retrieve data set parent + GNEDataSet* dataSet = net->retrieveDataSet(id, false); + // check if we need to create a new data set + if (dataSet == nullptr) { + dataSet = buildDataSet(net, true, id); + } + // save ID of last created element + GNEDataInterval* dataInterval = buildDataInterval(net, allowUndoRedo, dataSet, begin, end); + // check if insertion has to be commited + if (insertedDatas) { + insertedDatas->commitDataIntervalInsertion(dataInterval); + } + return true; + } + return false; +} + + +bool +GNEDataHandler::parseAndBuildEdgeData(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas) { + bool abort = false; + // parse edgeData attributes + std::string edgeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_MEANDATA_EDGE, SUMO_ATTR_ID, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointer to edge + GNEEdge* edge = net->retrieveEdge(edgeID, false); + // check that edge is valid + if (edge == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The edge '" + edgeID + "' to use within the " + toString(SUMO_TAG_MEANDATA_EDGE) + " '" + edgeID + "' is not known."); + } else if (insertedDatas->getLastInsertedDataInterval() == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING(toString(SUMO_TAG_MEANDATA_EDGE) + " '" + edgeID + "' must be created within a data interval."); + } else { + // check if there is already a edge data for the given edge in the interval + for (const auto& genericData : insertedDatas->getLastInsertedDataInterval()->getGenericDataChildren()) { + if ((genericData->getTagProperty().getTag() == SUMO_TAG_MEANDATA_EDGE) && (genericData->getParentEdges().front() == edge)) { + WRITE_WARNING("There is already a " + genericData->getTagStr() + " in edge '" + edge->getID() + "'"); + return false; + } + } + // declare parameter map + std::map parameters; + // obtain all attribute + const std::vector attributes = attrs.getAttributeNames(); + // iterate over attributes and fill parameters map + for (const auto& attribute : attributes) { + if (attribute != toString(SUMO_ATTR_ID)) { + parameters[attribute] = attrs.getStringSecure(attribute, ""); + } + } + // save ID of last created element + GNEGenericData* dataCreated = buildEdgeData(net, allowUndoRedo, insertedDatas->getLastInsertedDataInterval(), edge, parameters); + // check if insertion has to be commited + if (insertedDatas) { + insertedDatas->commitGenericDataInsertion(dataCreated); + } + return true; + } + } + return false; +} + + +bool +GNEDataHandler::parseAndBuildEdgeRelationData(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas) { + bool abort = false; + // parse edgeRelationData attributes + std::string fromEdgeStr = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_EDGEREL, SUMO_ATTR_FROM, abort); + std::string toEdgeStr = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_EDGEREL, SUMO_ATTR_TO, abort); + // Continue if all parameters were sucesfully loaded + if (!abort) { + // get pointers to edges + GNEEdge* fromEdge = net->retrieveEdge(fromEdgeStr, false); + GNEEdge* toEdge = net->retrieveEdge(toEdgeStr, false); + // check that edge is valid + if (fromEdge == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The from edge '" + fromEdgeStr + "' to use within " + toString(SUMO_TAG_EDGEREL) + " is not known."); + } else if (toEdge == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING("The to edge '" + toEdgeStr + "' to use within " + toString(SUMO_TAG_EDGEREL) + " is not known."); + } else if (insertedDatas->getLastInsertedDataInterval() == nullptr) { + // Write error if lane isn't valid + WRITE_WARNING(toString(SUMO_TAG_EDGEREL) + " must be created within a data interval."); + } else { + // declare parameter map + std::map parameters; + // obtain all attribute + const std::vector attributes = attrs.getAttributeNames(); + // iterate over attributes and fill parameters map + for (const auto& attribute : attributes) { + if ((attribute != toString(SUMO_ATTR_ID)) && (attribute != toString(SUMO_ATTR_FROM)) && (attribute != toString(SUMO_ATTR_TO))) { + parameters[attribute] = attrs.getStringSecure(attribute, ""); + } + } + // save ID of last created element + GNEGenericData* dataCreated = buildEdgeRelationData(net, allowUndoRedo, insertedDatas->getLastInsertedDataInterval(), + fromEdge, toEdge, parameters); + // check if insertion has to be commited + if (insertedDatas) { + insertedDatas->commitGenericDataInsertion(dataCreated); + } + return true; + } + } + return false; +} + +// =========================================================================== +// private method definitions +// =========================================================================== + +void +GNEDataHandler::parseParameter(const SUMOSAXAttributes& attrs) { + if (myHierarchyInsertedGenericDatas.getLastInsertedGenericData()) { + // first check if given data supports parameters + if (myHierarchyInsertedGenericDatas.getLastInsertedGenericData()->getTagProperty().hasParameters()) { + bool ok = true; + std::string key; + if (attrs.hasAttribute(SUMO_ATTR_KEY)) { + // obtain key + key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); + if (key.empty()) { + WRITE_WARNING("Error parsing key from data parameter. Key cannot be empty"); + ok = false; + } + if (!SUMOXMLDefinitions::isValidTypeID(key)) { + WRITE_WARNING("Error parsing key from data parameter. Key contains invalid characters"); + ok = false; + } + } else { + WRITE_WARNING("Error parsing key from data parameter. Key doesn't exist"); + ok = false; + } + // circumventing empty string test + const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; + if (!SUMOXMLDefinitions::isValidAttribute(val)) { + WRITE_WARNING("Error parsing value from data parameter. Value contains invalid characters"); + ok = false; + } + // check double values + if (myHierarchyInsertedGenericDatas.getLastInsertedGenericData()->getTagProperty().hasParameters() && !GNEAttributeCarrier::canParse(val)) { + WRITE_WARNING("Error parsing value from data float parameter. Value cannot be parsed to float"); + ok = false; + } + // set parameter in last inserted data + if (ok) { + WRITE_DEBUG("Inserting parameter '" + key + "|" + val + "' into data " + myHierarchyInsertedGenericDatas.getLastInsertedGenericData()->getTagStr() + "."); + myHierarchyInsertedGenericDatas.getLastInsertedGenericData()->setParameter(key, val); + } + } else { + WRITE_WARNING("Datas of type '" + myHierarchyInsertedGenericDatas.getLastInsertedGenericData()->getTagStr() + "' doesn't support parameters"); + } + } else { + WRITE_WARNING("Parameters has to be declared within the definition of an data"); + } +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataHandler.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataHandler.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,210 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataHandler.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Builds data objects for netedit +/****************************************************************************/ +#pragma once + +// =========================================================================== +// included modules +// =========================================================================== + +#include + +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNENet; +class GNEEdge; +class GNEEdgeData; +class GNEEdgeRelData; +class GNEGenericData; +class GNEDataSet; +class GNEDataInterval; +class GNEDataSet; +class GNEUndoList; + +// =========================================================================== +// class definitions +// =========================================================================== + +/// @class GNEDataHandler +/// @brief Builds data objects for GNENet (busStops, chargingStations, detectors, etc..) +class GNEDataHandler : public SUMOSAXHandler { +public: + + /// @brief Stack used to save the last inserted element + struct HierarchyInsertedDatas { + + /// @brief insert new element (called only in function myStartElement) + void insertElement(SumoXMLTag tag); + + /// @brief commit element insertion (used to save last correct data interval element) + void commitDataIntervalInsertion(GNEDataInterval* dataIntervalCreated); + + /// @brief commit element insertion (used to save last correct generic data element) + void commitGenericDataInsertion(GNEGenericData* dataElementCreated); + + /// @brief pop last inserted element (used only in function myEndElement) + void popElement(); + + /// @brief retrieve parent generic data correspond to current status of myInsertedElements + GNEDataInterval* retrieveParentDataInterval(SumoXMLTag expectedTag) const; + + /// @brief return last generic data inserted + GNEDataInterval* getLastInsertedDataInterval() const; + + /// @brief retrieve parent generic data correspond to current status of myInsertedElements + GNEGenericData* retrieveParentGenericData(SumoXMLTag expectedTag) const; + + /// @brief return last generic data inserted + GNEGenericData* getLastInsertedGenericData() const; + + private: + /// @brief vector used as stack + std::vector > > myInsertedElements; + }; + + /// @brief Constructor + GNEDataHandler(const std::string& file, GNENet* net); + + /// @brief Destructor + ~GNEDataHandler(); + + /// @name inherited from ShapeHandler + /// @{ + /**@brief Called on the opening of a tag; + * @param[in] element ID of the currently opened element + * @param[in] attrs Attributes within the currently opened element + * @exception ProcessError If something fails + * @see GenericSAXHandler::myStartElement + */ + void myStartElement(int element, const SUMOSAXAttributes& attrs); + + /** @brief Called when a closing tag occurs + * @param[in] element ID of the currently opened element + * @exception ProcessError If something fails + * @see GenericSAXHandler::myEndElement + */ + void myEndElement(int element); + + /// @} + + /// @name building methods + /// + /// Called with parsed values, these methods build the data. + /// @{ + /**@brief Build datas + * @param[in] viewNet pointer to viewNet in wich data will be created + * @param[in] allowUndoRedo enable or disable remove created data with ctrl + Z / ctrl + Y + * @param[in] tag tag of the data to create + * @param[in] attrs SUMOSAXAttributes with attributes + * @param[in] HierarchyInsertedDatas pointer to HierarchyInsertedDatas (can be null) + * @return true if was sucesfully created, false in other case + */ + static bool buildData(GNENet* net, bool allowUndoRedo, SumoXMLTag tag, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas); + + /**@brief Builds DataSet + * @param[in] net GNENet in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created data with ctrl + Z / ctrl + Y + * @param[in] dataSetID data set interval + * @exception InvalidArgument If the DataSet can not be added to the net + */ + static GNEDataSet* buildDataSet(GNENet* net, bool allowUndoRedo, const std::string& dataSetID); + + /**@brief Builds DataInterval + * @param[in] net GNENet in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created data with ctrl + Z / ctrl + Y + * @param[in] dataSet GNEDataInterval in which this DataInterval is saved + * @param[in] begin interval begin + * @param[in] end interval end + * @exception InvalidArgument If the DataInterval can not be added to the net + */ + static GNEDataInterval* buildDataInterval(GNENet* net, bool allowUndoRedo, GNEDataSet* dataSetParent, + const double begin, const double end); + + /**@brief Builds edgeData + * @param[in] net GNENet in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created data with ctrl + Z / ctrl + Y + * @param[in] dataIntervalParent GNEDataInterval in which this edgeData is saved + * @param[in] edge GNEEdge parent + * @param[in] parameters parameters map + * @exception InvalidArgument If the edgeData can not be added to the net + */ + static GNEEdgeData* buildEdgeData(GNENet* net, bool allowUndoRedo, GNEDataInterval* dataIntervalParent, + GNEEdge* edge, const std::map& parameters); + + /**@brief Builds edgeRelationData + * @param[in] net GNENet in which element will be inserted + * @param[in] allowUndoRedo enable or disable remove created data with ctrl + Z / ctrl + Y + * @param[in] dataIntervalParent GNEDataInterval in which this edgeRelationData is saved + * @param[in] fromEdge GNEEdge from + * @param[in] toEdge GNEEdge to + * @param[in] parameters parameters map + * @exception InvalidArgument If the edgeRelationData can not be added to the net + */ + static GNEEdgeRelData* buildEdgeRelationData(GNENet* net, bool allowUndoRedo, GNEDataInterval* dataIntervalParent, + GNEEdge* fromEdge, GNEEdge* toEdge, const std::map& parameters); + +protected: + /// @name parsing methods + /// + /// These methods parse the attributes for each of the described data + /// and call the according methods to build the data + /// @{ + + /**@brief Parses his values and builds a interval + * @param[in] attrs SAX-attributes which define the data + */ + static bool parseAndBuildInterval(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas); + + /**@brief Parses his values and builds a edge data + * @param[in] attrs SAX-attributes which define the data + */ + static bool parseAndBuildEdgeData(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas); + + /**@brief Parses his values and builds a edge relation data + * @param[in] attrs SAX-attributes which define the data + */ + static bool parseAndBuildEdgeRelationData(GNENet* net, bool allowUndoRedo, const SUMOSAXAttributes& attrs, HierarchyInsertedDatas* insertedDatas); + + /// @} + +private: + /**@brief Parse parameter and insert it in the last created data + * @param[in] attrs SAX-attributes which define the parameter + */ + void parseParameter(const SUMOSAXAttributes& attrs); + + /// @brief pointer to net + GNENet* myNet; + + /// @brief HierarchyInsertedDatas used for insert children + HierarchyInsertedDatas myHierarchyInsertedGenericDatas; + + /// @brief invalidate copy constructor + GNEDataHandler(const GNEDataHandler& s) = delete; + + /// @brief invalidate assignment operator + GNEDataHandler& operator=(const GNEDataHandler& s) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataInterval.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataInterval.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataInterval.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataInterval.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,342 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataInterval.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data sets +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDataInterval.h" +#include "GNEDataSet.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEDataInterval - methods +// --------------------------------------------------------------------------- + +GNEDataInterval::GNEDataInterval(GNEDataSet* dataSetParent, const double begin, const double end) : + GNEAttributeCarrier(SUMO_TAG_DATAINTERVAL, dataSetParent->getNet()), + myDataSetParent(dataSetParent), + myBegin(begin), + myEnd(end) { +} + + +GNEDataInterval::~GNEDataInterval() {} + + +void +GNEDataInterval::updateGenericDataIDs() { + // iterate over generic data childrens + for (const auto& genericData : myGenericDataChildren) { + if (genericData->getTagProperty().getTag() == SUMO_TAG_MEANDATA_EDGE) { + // {dataset}[{begin}m{end}]{edge} + genericData->setMicrosimID(myDataSetParent->getID() + "[" + toString(myBegin) + "," + toString(myEnd) + "]" + + genericData->getParentEdges().front()->getID()); + } else if (genericData->getTagProperty().getTag() == SUMO_TAG_EDGEREL) { + // {dataset}[{begin}m{end}]{from}->{to} + genericData->setMicrosimID(myDataSetParent->getID() + "[" + toString(myBegin) + "," + toString(myEnd) + "]" + + genericData->getParentEdges().front()->getID() + "->" + genericData->getParentEdges().back()->getID()); + } + } +} + + +const std::string& +GNEDataInterval::getID() const { + return myDataSetParent->getID(); +} + + +GUIGlObject* +GNEDataInterval::getGUIGlObject() { + return nullptr; +} + + +void +GNEDataInterval::updateGeometry() { + // nothing to update +} + + +void +GNEDataInterval::updateDottedContour() { + // nothing to update +} + + +Position +GNEDataInterval::getPositionInView() const { + return Position(); +} + + +bool +GNEDataInterval::isDataIntervalValid() const { + return true; +} + + +std::string +GNEDataInterval::getDataIntervalProblem() const { + return ""; +} + + +void +GNEDataInterval::fixDataIntervalProblem() { + throw InvalidArgument(getTagStr() + " cannot fix any problem"); +} + + +GNEDataSet* +GNEDataInterval::getDataSetParent() const { + return myDataSetParent; +} + + +void +GNEDataInterval::addGenericDataChild(GNEGenericData* genericData) { + // check that GenericData wasn't previously inserted + if (!hasGenericDataChild(genericData)) { + myGenericDataChildren.push_back(genericData); + // update generic data IDs + updateGenericDataIDs(); + } else { + throw ProcessError("GenericData was already inserted"); + } +} + + +void +GNEDataInterval::removeGenericDataChild(GNEGenericData* genericData) { + auto it = std::find(myGenericDataChildren.begin(), myGenericDataChildren.end(), genericData); + // check that GenericData was previously inserted + if (it != myGenericDataChildren.end()) { + // remove generic data child + myGenericDataChildren.erase(it); + // remove it from Inspector Frame and AttributeCarrierHierarchy + myDataSetParent->getNet()->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(genericData); + myDataSetParent->getNet()->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(genericData); + } else { + throw ProcessError("GenericData wasn't previously inserted"); + } +} + + +bool +GNEDataInterval::hasGenericDataChild(GNEGenericData* genericData) const { + return std::find(myGenericDataChildren.begin(), myGenericDataChildren.end(), genericData) != myGenericDataChildren.end(); +} + + +const std::vector& +GNEDataInterval::getGenericDataChildren() const { + return myGenericDataChildren; +} + + +double +GNEDataInterval::getMinimumGenericDataChildAttribute(const std::string& paramStr) const { + double result = INVALID_DOUBLE; + // iterate over generic data children + for (const auto& genericData : myGenericDataChildren) { + // iterate over generic data params + for (const auto& param : genericData->getParametersMap()) { + // check paramStr and if attribute can be parsed to double + if ((param.first == paramStr) && canParse(param.second)) { + // parse param value + const double paramDouble = parse(param.second); + // update result + if (result == INVALID_DOUBLE) { + result = paramDouble; + } else if (paramDouble < result) { + result = paramDouble; + } + } + } + } + // return solution depending of result + if (result == INVALID_DOUBLE) { + return 0; + } else { + return result; + } +} + + +double +GNEDataInterval::getMaximunGenericDataChildAttribute(const std::string& paramStr) const { + double result = INVALID_DOUBLE; + // iterate over generic data children + for (const auto& genericData : myGenericDataChildren) { + // iterate over generic data params + for (const auto& param : genericData->getParametersMap()) { + // check paramStr and if attribute can be parsed to double + if ((param.first == paramStr) && canParse(param.second)) { + // parse param value + const double paramDouble = parse(param.second); + // update result + if (result == INVALID_DOUBLE) { + result = paramDouble; + } else if (paramDouble > result) { + result = paramDouble; + } + } + } + } + // return solution depending of result + if (result == INVALID_DOUBLE) { + return 0; + } else { + return result; + } +} + + +std::string +GNEDataInterval::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return myDataSetParent->getAttribute(SUMO_ATTR_ID); + case SUMO_ATTR_BEGIN: + return toString(myBegin); + case SUMO_ATTR_END: + return toString(myEnd); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEDataInterval::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_BEGIN: + return myBegin; + case SUMO_ATTR_END: + return myEnd; + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDataInterval::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + switch (key) { + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDataInterval::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_BEGIN: + return canParse(value); + case SUMO_ATTR_END: + return canParse(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDataInterval::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to enable +} + + +void +GNEDataInterval::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to disable +} + + +bool +GNEDataInterval::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return false; + default: + return true; + } +} + + +std::string +GNEDataInterval::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEDataInterval::getHierarchyName() const { + return "interval: " + getAttribute(SUMO_ATTR_BEGIN) + " -> " + getAttribute(SUMO_ATTR_END); +} + + +void +GNEDataInterval::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_BEGIN: + myBegin = parse(value); + // update Generic Data IDs + updateGenericDataIDs(); + break; + case SUMO_ATTR_END: + myEnd = parse(value); + // update Generic Data IDs + updateGenericDataIDs(); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDataInterval::setEnabledAttribute(const int /*enabledAttributes*/) { + throw InvalidArgument("Nothing to enable"); +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataInterval.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataInterval.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataInterval.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataInterval.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,195 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataInterval.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data elements +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEDataSet; +class GNEGenericData; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEDataInterval + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEDataInterval : public GNEAttributeCarrier { + +public: + /**@brief Constructor + * @param[in] dataSetParent GNEDataSet to which this data interval belongs. + * @param[in] begin interval begin + * @param[in] end interval end + */ + GNEDataInterval(GNEDataSet* dataSetParent, const double begin, const double end); + + /// @brief Destructor + ~GNEDataInterval(); + + /// @brief update generic data child IDs + void updateGenericDataIDs(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns element position in view + Position getPositionInView() const; + + /// @name members and functions relative to write data elements into XML + /// @{ + /// @brief check if current data element is valid to be writed into XML (by default true, can be reimplemented in children) + bool isDataIntervalValid() const; + + /// @brief return a string with the current data element problem (by default empty, can be reimplemented in children) + std::string getDataIntervalProblem() const; + + /// @brief fix data element problem (by default throw an exception, has to be reimplemented in children) + void fixDataIntervalProblem(); + /// @} + + /// @brief Returns a pointer to GNEDataSet parent + GNEDataSet* getDataSetParent() const; + + /// @name generic data children + /// @{ + + /// @brief add generic data child + void addGenericDataChild(GNEGenericData* genericData); + + /// @brief add generic data child + void removeGenericDataChild(GNEGenericData* genericData); + + /// @brief check if given generic data is child of this data interval + bool hasGenericDataChild(GNEGenericData* genericData) const; + + /// @brief get generic data children + const std::vector& getGenericDataChildren() const; + + /// @brief get minimun genericData child attribute value + double getMinimumGenericDataChildAttribute(const std::string& paramStr) const; + + /// @brief get maximun genericData child attribute value + double getMaximunGenericDataChildAttribute(const std::string& paramStr) const; + + /// @} + /// @name 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 setting the attribute and letting the object perform data element 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + 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; + /// @} + +protected: + /// @brief GNEDataSet parent to which this data interval belongs. + GNEDataSet* myDataSetParent; + + /// @brief begin interval + double myBegin; + + /// @brief end interval + double myEnd; + + /// @brief vector with generic data children + std::vector myGenericDataChildren; + +private: + /// @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 Invalidated copy constructor. + GNEDataInterval(const GNEDataInterval&) = delete; + + /// @brief Invalidated assignment operator. + GNEDataInterval& operator=(const GNEDataInterval&) = delete; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataSet.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataSet.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataSet.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataSet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,330 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataSet.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data sets +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include + +#include "GNEDataSet.h" +#include "GNEDataInterval.h" +#include "GNEGenericData.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEDataSet::GNEDataSet(GNENet* net, const std::string dataSetID) : + GNEAttributeCarrier(SUMO_TAG_DATASET, net), + myDataSetID(dataSetID) { +} + + +GNEDataSet::~GNEDataSet() {} + + +const std::string& +GNEDataSet::getID() const { + return myDataSetID; +} + + +GUIGlObject* +GNEDataSet::getGUIGlObject() { + return nullptr; +} + + +void +GNEDataSet::setDataSetID(const std::string& newID) { + // update ID + myDataSetID = newID; + // iterate over all intervals + for (const auto& interval : myDataIntervalChildren) { + interval.second->updateGenericDataIDs(); + } +} + +void +GNEDataSet::updateGeometry() { + // nothing to update +} + + +void +GNEDataSet::updateDottedContour() { + // nothing to update +} + + +Position +GNEDataSet::getPositionInView() const { + return Position(0, 0); +} + + +void +GNEDataSet::writeDataSet(OutputDevice& device) const { + // iterate over intervals + for (const auto& interval : myDataIntervalChildren) { + // open device + device.openTag(SUMO_TAG_INTERVAL); + // write ID + device.writeAttr(SUMO_ATTR_ID, getID()); + // write begin + device.writeAttr(SUMO_ATTR_BEGIN, interval.second->getAttribute(SUMO_ATTR_BEGIN)); + // write end + device.writeAttr(SUMO_ATTR_END, interval.second->getAttribute(SUMO_ATTR_END)); + // iterate over interval generic datas + for (const auto& genericData : interval.second->getGenericDataChildren()) { + // write generic data + genericData->writeGenericData(device); + } + // close device + device.closeTag(); + } +} + + +void +GNEDataSet::addDataIntervalChild(GNEDataInterval* dataInterval) { + // check that dataInterval wasn't previously inserted + if (myDataIntervalChildren.count(dataInterval->getAttributeDouble(SUMO_ATTR_BEGIN)) == 0) { + // add data interval child + myDataIntervalChildren[dataInterval->getAttributeDouble(SUMO_ATTR_BEGIN)] = dataInterval; + } else { + throw ProcessError("DataInterval was already inserted"); + } +} + + +void +GNEDataSet::removeDataIntervalChild(GNEDataInterval* dataInterval) { + // check that dataInterval was previously inserted + if (myDataIntervalChildren.count(dataInterval->getAttributeDouble(SUMO_ATTR_BEGIN)) == 1) { + // remove data interval child + myDataIntervalChildren.erase(dataInterval->getAttributeDouble(SUMO_ATTR_BEGIN)); + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(dataInterval); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(dataInterval); + } else { + throw ProcessError("DataInterval wasn't previously inserted"); + } +} + + +bool +GNEDataSet::dataIntervalChildrenExist(GNEDataInterval* dataInterval) const { + for (const auto& interval : myDataIntervalChildren) { + if (interval.second == dataInterval) { + return true; + } + } + return false; +} + +void +GNEDataSet::updateDataIntervalBegin(const double oldBegin) { + // check that dataInterval was previously inserted + if (myDataIntervalChildren.count(oldBegin) == 1) { + // get data interval + GNEDataInterval* dataInterval = myDataIntervalChildren.at(oldBegin); + // insert again using new begin + myDataIntervalChildren[dataInterval->getAttributeDouble(SUMO_ATTR_BEGIN)] = dataInterval; + } else { + throw ProcessError("DataInterval wasn't previously inserted"); + } +} + + +bool +GNEDataSet::checkNewInterval(const double newBegin, const double newEnd) { + return checkNewInterval(myDataIntervalChildren, newBegin, newEnd); +} + + +bool +GNEDataSet::checkNewBeginEnd(const GNEDataInterval* dataInterval, const double newBegin, const double newEnd) { + // make a copy of myDataIntervalChildren without dataInterval, and check checkNewInterval + std::map copyOfDataIntervalMap; + for (const auto& element : myDataIntervalChildren) { + if (element.second != dataInterval) { + copyOfDataIntervalMap.insert(element); + } + } + return checkNewInterval(copyOfDataIntervalMap, newBegin, newEnd); +} + + +GNEDataInterval* +GNEDataSet::retrieveInterval(const double begin, const double end) const { + if (myDataIntervalChildren.count(begin) == 0) { + return nullptr; + } else if (myDataIntervalChildren.at(begin)->getAttributeDouble(SUMO_ATTR_END) != end) { + return nullptr; + } else { + return myDataIntervalChildren.at(begin); + } +} + + +const std::map& +GNEDataSet::getDataIntervalChildren() const { + return myDataIntervalChildren; +} + + +std::string +GNEDataSet::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return myDataSetID; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEDataSet::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEDataSet::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + switch (key) { + case SUMO_ATTR_ID: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEDataSet::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + if (SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveDataSet(value, false) == nullptr)) { + return true; + } else { + return false; + } + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDataSet::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to enable +} + + +void +GNEDataSet::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to disable +} + + +bool +GNEDataSet::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNEDataSet::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEDataSet::getHierarchyName() const { + return getTagStr() + ": " + myDataSetID; +} + + +void +GNEDataSet::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEDataSet::setEnabledAttribute(const int /*enabledAttributes*/) { + throw InvalidArgument("Nothing to enable"); +} + + +bool +GNEDataSet::checkNewInterval(const std::map& dataIntervalMap, const double newBegin, const double newEnd) { + if (dataIntervalMap.empty()) { + return true; + } else { + // declare first and last element + const auto itFirstElement = dataIntervalMap.begin(); + const auto itLastElement = dataIntervalMap.rbegin(); + if (newBegin > newEnd) { + return false; + } else if (dataIntervalMap.count(newBegin) == 1) { + return false; + } else if (newBegin < itFirstElement->first) { + return (newEnd <= itFirstElement->first); + } else if (newBegin > itLastElement->first) { + return (newBegin >= itLastElement->second->getAttributeDouble(SUMO_ATTR_END)); + } else { + // iterate over myDataIntervalChildren + for (auto it = itFirstElement; it != dataIntervalMap.end(); it++) { + if (newBegin < it->first) { + // obtain previous edge + auto itPrevious = it; + itPrevious--; + // check overlapping with end + if (itPrevious->second->getAttributeDouble(SUMO_ATTR_END) < newBegin) { + return true; + } + } + } + } + return false; + } +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataSet.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataSet.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEDataSet.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEDataSet.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,181 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDataSet.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data elements +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNENet; +class GNEDataInterval; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEDataSet : public GNEAttributeCarrier { + +public: + /**@brief Constructor + * @param[in] net pointer to GNEViewNet of this data element element belongs + */ + GNEDataSet(GNENet* net, const std::string dataSetID); + + /// @brief Destructor + ~GNEDataSet(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief set new ID in dataSet + void setDataSetID(const std::string& newID); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns element position in view + Position getPositionInView() const; + + /// @brief write data set + void writeDataSet(OutputDevice& device) const; + + /// @name data interval children + /// @{ + + /// @brief add data interval child + void addDataIntervalChild(GNEDataInterval* dataInterval); + + /// @brief add data interval child + void removeDataIntervalChild(GNEDataInterval* dataInterval); + + /// @brief check if given data interval exist + bool dataIntervalChildrenExist(GNEDataInterval* dataInterval) const; + + /// @brief update data interval begin + void updateDataIntervalBegin(const double oldBegin); + + /// @brief check if a new GNEDataInterval with the given begin and end can be inserted in current GNEDataSet + bool checkNewInterval(const double newBegin, const double newEnd); + + /// @brief check if new begin or end for given GNEDataInterval is given + bool checkNewBeginEnd(const GNEDataInterval* dataInterval, const double newBegin, const double newEnd); + + /// @brief return interval + GNEDataInterval* retrieveInterval(const double begin, const double end) const; + + /// @brief get data interval children + const std::map& getDataIntervalChildren() const; + + /// @} + + /// @name 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 setting the attribute and letting the object perform data element 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + 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; + /// @} + +protected: + /// @brief dataSet ID + std::string myDataSetID; + + /// @brief map with dataIntervals children sorted by begin + std::map myDataIntervalChildren; + +private: + /// @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 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); + + /// @brief Invalidated copy constructor. + GNEDataSet(const GNEDataSet&) = delete; + + /// @brief Invalidated assignment operator. + GNEDataSet& operator=(const GNEDataSet&) = delete; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeData.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeData.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,261 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeData.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// class for edge data +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEEdgeData.h" +#include "GNEDataInterval.h" +#include "GNEDataSet.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEEdgeData - methods +// --------------------------------------------------------------------------- + +GNEEdgeData::GNEEdgeData(GNEDataInterval* dataIntervalParent, GNEEdge* edgeParent, const std::map& parameters) : + GNEGenericData(SUMO_TAG_MEANDATA_EDGE, GLO_EDGEDATA, dataIntervalParent, parameters, +{}, {edgeParent}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}) { + // Children +} + + +GNEEdgeData::~GNEEdgeData() {} + + +void +GNEEdgeData::updateGeometry() { + // nothing to update +} + + +void +GNEEdgeData::updateDottedContour() { + // just update geometry of parent edge + if (getParentEdges().front()->getDottedGeometry().isGeometryDeprecated()) { + getParentEdges().front()->updateDottedContour(); + } +} + + +Position +GNEEdgeData::getPositionInView() const { + return getParentEdges().front()->getPositionInView(); +} + + +void +GNEEdgeData::writeGenericData(OutputDevice& device) const { + // open device (don't use SUMO_TAG_MEANDATA_EDGE) + device.openTag(SUMO_TAG_EDGE); + // write edge ID + device.writeAttr(SUMO_ATTR_ID, getParentEdges().front()->getID()); + // iterate over attributes + for (const auto& attribute : getParametersMap()) { + // write attribute (don't use writeParams) + device.writeAttr(attribute.first, attribute.second); + } + // close device + device.closeTag(); +} + + +bool +GNEEdgeData::isGenericDataValid() const { + return true; +} + + +std::string +GNEEdgeData::getGenericDataProblem() const { + return ""; +} + + +void +GNEEdgeData::fixGenericDataProblem() { + throw InvalidArgument(getTagStr() + " cannot fix any problem"); +} + + +Boundary +GNEEdgeData::getCenteringBoundary() const { + return getParentEdges().front()->getCenteringBoundary(); +} + + +std::string +GNEEdgeData::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getParentEdges().front()->getID(); + case GNE_ATTR_DATASET: + return myDataIntervalParent->getDataSetParent()->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEEdgeData::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEEdgeData::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 GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEEdgeData::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEEdgeData::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to enable +} + + +void +GNEEdgeData::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to disable enable +} + + +bool GNEEdgeData::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return false; + default: + return true; + } +} + + +std::string +GNEEdgeData::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEEdgeData::getHierarchyName() const { + return getTagStr() + ": " + getParentEdges().front()->getID(); +} + + +void +GNEEdgeData::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEEdgeData::setEnabledAttribute(const int /*enabledAttributes*/) { + throw InvalidArgument("Nothing to enable"); +} + + +bool +GNEEdgeData::isVisible() const { + // obtain pointer to edge data frame (only for code legibly) + const GNEEdgeDataFrame* edgeDataFrame = myDataIntervalParent->getNet()->getViewNet()->getViewParent()->getEdgeDataFrame(); + // check if we have to filter generic data + if (edgeDataFrame->shown()) { + // check interval + if ((edgeDataFrame->getIntervalSelector()->getDataInterval() != nullptr) && + (edgeDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) { + return false; + } + // check attribute + if ((edgeDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) && + (getParametersMap().count(edgeDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) { + return false; + } + // all checks ok, then return true + return true; + } else { + // GNEEdgeDataFrame hidden, then return false + return false; + } +} + + +const RGBColor& +GNEEdgeData::getSpecificColor() const { + return RGBColor::RED; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeData.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeData.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,159 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeData.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// class for edge data +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== + +#include "GNEGenericData.h" + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEEdgeData + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEEdgeData : public GNEGenericData { + +public: + /**@brief Constructor + * @param[in] dataIntervalParent pointer to data interval parent + * @param[in] edgeParent poinetr to Edge parent + * @param[in] parameters parameters map + */ + GNEEdgeData(GNEDataInterval* dataIntervalParent, GNEEdge* edgeParent, const std::map& parameters); + + /// @brief Destructor + ~GNEEdgeData(); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns element position in view + Position getPositionInView() const; + + /// @name members and functions relative to write data sets into XML + /// @{ + /**@brief writte data set element into a xml file + * @param[in] device device in which write parameters of data set element + */ + void writeGenericData(OutputDevice& device) const; + + /// @brief check if current data set is valid to be writed into XML (by default true, can be reimplemented in children) + bool isGenericDataValid() const; + + /// @brief return a string with the current data set problem (by default empty, can be reimplemented in children) + std::string getGenericDataProblem() const; + + /// @brief fix data set problem (by default throw an exception, has to be reimplemented in children) + void fixGenericDataProblem(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + //// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @} + + /// @name 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 setting the attribute and letting the object perform data set 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + 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; + /// @} + +private: + /// @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 check if current generic data is visible + bool isVisible() const; + + /// @brief get specific generic data color + const RGBColor& getSpecificColor() const; + + /// @brief Invalidated copy constructor. + GNEEdgeData(const GNEEdgeData&) = delete; + + /// @brief Invalidated assignment operator. + GNEEdgeData& operator=(const GNEEdgeData&) = delete; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,285 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeRelData.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// class for edge relation data +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEEdgeRelData.h" +#include "GNEDataInterval.h" +#include "GNEDataSet.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEEdgeRelData - methods +// --------------------------------------------------------------------------- + +GNEEdgeRelData::GNEEdgeRelData(GNEDataInterval* dataIntervalParent, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::map& parameters) : + GNEGenericData(SUMO_TAG_EDGEREL, GLO_EDGERELDATA, dataIntervalParent, parameters, +{}, {fromEdge, toEdge}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}) { + // Children +} + + +GNEEdgeRelData::~GNEEdgeRelData() {} + + +void +GNEEdgeRelData::updateGeometry() { + // nothing to update +} + + +void +GNEEdgeRelData::updateDottedContour() { + // just update geometry of parent edges + for (const auto& edge : getParentEdges()) { + if (edge->getDottedGeometry().isGeometryDeprecated()) { + edge->updateDottedContour(); + } + } +} + + +Position +GNEEdgeRelData::getPositionInView() const { + return getParentEdges().front()->getPositionInView(); +} + + +void +GNEEdgeRelData::writeGenericData(OutputDevice& device) const { + // open device + device.openTag(SUMO_TAG_EDGEREL); + // write from + device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + // write to + device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + // iterate over attributes + for (const auto& attribute : getParametersMap()) { + // write attribute (don't use writeParams) + device.writeAttr(attribute.first, attribute.second); + } + // close device + device.closeTag(); +} + + +bool +GNEEdgeRelData::isGenericDataValid() const { + return true; +} + + +std::string +GNEEdgeRelData::getGenericDataProblem() const { + return ""; +} + + +void +GNEEdgeRelData::fixGenericDataProblem() { + throw InvalidArgument(getTagStr() + " cannot fix any problem"); +} + + +Boundary +GNEEdgeRelData::getCenteringBoundary() const { + return getParentEdges().front()->getCenteringBoundary(); +} + + +std::string +GNEEdgeRelData::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getParentEdges().front()->getID(); + case SUMO_ATTR_FROM: + return getParentEdges().front()->getID(); + case SUMO_ATTR_TO: + return getParentEdges().back()->getID(); + case GNE_ATTR_DATASET: + return myDataIntervalParent->getDataSetParent()->getID(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEEdgeRelData::getAttributeDouble(SumoXMLAttr key) const { + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); +} + + +void +GNEEdgeRelData::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_FROM: + case SUMO_ATTR_TO: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEEdgeRelData::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEEdgeRelData::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to enable +} + + +void +GNEEdgeRelData::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // Nothing to disable enable +} + + +bool GNEEdgeRelData::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return false; + default: + return true; + } +} + + +std::string +GNEEdgeRelData::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEEdgeRelData::getHierarchyName() const { + return getTagStr() + ": " + getParentEdges().front()->getID() + "->" + getParentEdges().back()->getID(); +} + + +void +GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_FROM: { + // change first edge + replaceFirstParentEdge(this, myNet->retrieveEdge(value)); + break; + } + case SUMO_ATTR_TO: { + // change last edge + replaceLastParentEdge(this, myNet->retrieveEdge(value)); + break; + } + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEEdgeRelData::setEnabledAttribute(const int /*enabledAttributes*/) { + throw InvalidArgument("Nothing to enable"); +} + + +bool +GNEEdgeRelData::isVisible() const { + // obtain pointer to edge data frame (only for code legibly) + const GNEEdgeRelDataFrame* edgeRelDataFrame = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame(); + // check if we have to filter generic data + if (edgeRelDataFrame->shown()) { + // check interval + if ((edgeRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) && + (edgeRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) { + return false; + } + // check attribute + if ((edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) && + (getParametersMap().count(edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) { + return false; + } + // all checks ok, then return true + return true; + } else { + // GNEEdgeRelDataFrame hidden, then return false + return false; + } +} + + +const RGBColor& +GNEEdgeRelData::getSpecificColor() const { + return RGBColor::GREEN; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEEdgeRelData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,161 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeRelData.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// class for edge relation data +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== + +#include "GNEGenericData.h" + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEEdgeRelData + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEEdgeRelData : public GNEGenericData { + +public: + /**@brief Constructor + * @param[in] dataIntervalParent pointer to data interval parent + * @param[in] fromEdge pointer to from edge + * @param[in] toEdge pointer to to edge + * @param[in] parameters parameters map + */ + GNEEdgeRelData(GNEDataInterval* dataIntervalParent, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::map& parameters); + + /// @brief Destructor + ~GNEEdgeRelData(); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief Returns element position in view + Position getPositionInView() const; + + /// @name members and functions relative to write data sets into XML + /// @{ + /**@brief writte data set element into a xml file + * @param[in] device device in which write parameters of data set element + */ + void writeGenericData(OutputDevice& device) const; + + /// @brief check if current data set is valid to be writed into XML (by default true, can be reimplemented in children) + bool isGenericDataValid() const; + + /// @brief return a string with the current data set problem (by default empty, can be reimplemented in children) + std::string getGenericDataProblem() const; + + /// @brief fix data set problem (by default throw an exception, has to be reimplemented in children) + void fixGenericDataProblem(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + //// @brief Returns the boundary to which the view shall be centered in order to show the object + Boundary getCenteringBoundary() const; + + /// @} + + /// @name 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 setting the attribute and letting the object perform data set 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + 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; + /// @} + +private: + /// @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 check if current generic data is visible + bool isVisible() const; + + /// @brief get specific generic data color + const RGBColor& getSpecificColor() const; + + /// @brief Invalidated copy constructor. + GNEEdgeRelData(const GNEEdgeRelData&) = delete; + + /// @brief Invalidated assignment operator. + GNEEdgeRelData& operator=(const GNEEdgeRelData&) = delete; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEGenericData.cpp sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEGenericData.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEGenericData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEGenericData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,290 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEGenericData.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data sets +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEGenericData.h" +#include "GNEDataInterval.h" +#include "GNEDataSet.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEGenericData - methods +// --------------------------------------------------------------------------- + +GNEGenericData::GNEGenericData(const SumoXMLTag tag, const GUIGlObjectType type, GNEDataInterval* dataIntervalParent, + const std::map& parameters, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, dataIntervalParent->getID()), + GNEAttributeCarrier(tag, dataIntervalParent->getNet()), + Parameterised(ParameterisedAttrType::DOUBLE, parameters), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myDataIntervalParent(dataIntervalParent) { +} + + +GNEGenericData::~GNEGenericData() {} + + +const std::string& +GNEGenericData::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNEGenericData::getGUIGlObject() { + return this; +} + + +GNEDataInterval* +GNEGenericData::getDataIntervalParent() const { + return myDataIntervalParent; +} + + +const RGBColor& +GNEGenericData::getColor() const { + // first check if we're in supermode demand + if (myDataIntervalParent->getNet()->getViewNet()->getEditModes().isCurrentSupermodeData()) { + // case for edgeDatas + if (myTagProperty.getTag() == SUMO_TAG_MEANDATA_EDGE) { + // obtain pointer to edge data frame (only for code legibly) + const GNEEdgeDataFrame* edgeDataFrame = myDataIntervalParent->getNet()->getViewNet()->getViewParent()->getEdgeDataFrame(); + // check if we have to filter generic data + if (edgeDataFrame->shown()) { + // get interval + const GNEDataInterval* dataInterval = edgeDataFrame->getIntervalSelector()->getDataInterval(); + // get filtered attribute (can be empty) + const std::string filteredAttribute = edgeDataFrame->getAttributeSelector()->getFilteredAttribute(); + // check interval + if (dataInterval && (dataInterval == myDataIntervalParent) && (filteredAttribute.size() > 0)) { + // get maximum and minimum value + const double minimumValue = dataInterval->getMinimumGenericDataChildAttribute(filteredAttribute); + const double maximumValue = dataInterval->getMaximunGenericDataChildAttribute(filteredAttribute); + const double colorValue = getParametersMap().count(filteredAttribute) > 0 ? parse(getParametersMap().at(filteredAttribute)) : 0; + // return scaled color + return edgeDataFrame->getAttributeSelector()->getScaledColor(minimumValue, maximumValue, colorValue); + } + } + } else if (myTagProperty.getTag() == SUMO_TAG_EDGEREL) { + // obtain pointer to edge data frame (only for code legibly) + const GNEEdgeRelDataFrame* edgeRelDataFrame = myDataIntervalParent->getNet()->getViewNet()->getViewParent()->getEdgeRelDataFrame(); + // check if we have to filter generic data + if (edgeRelDataFrame->shown()) { + // get interval + const GNEDataInterval* dataInterval = edgeRelDataFrame->getIntervalSelector()->getDataInterval(); + // get filtered attribute (can be empty) + const std::string filteredAttribute = edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute(); + // check interval + if (dataInterval && (dataInterval == myDataIntervalParent) && (filteredAttribute.size() > 0)) { + // get maximum and minimum value + const double minimumValue = dataInterval->getMinimumGenericDataChildAttribute(filteredAttribute); + const double maximumValue = dataInterval->getMaximunGenericDataChildAttribute(filteredAttribute); + const double colorValue = getParametersMap().count(filteredAttribute) > 0 ? parse(getParametersMap().at(filteredAttribute)) : 0; + // return scaled color + return edgeRelDataFrame->getAttributeSelector()->getScaledColor(minimumValue, maximumValue, colorValue); + } + } + } + } + // return specific color + return getSpecificColor(); +} + + +bool +GNEGenericData::isGenericDataVisible() const { + // get pointer to ViewNet + GNEViewNet* viewNet = myDataIntervalParent->getNet()->getViewNet(); + // first check if we're in supermode demand + if (viewNet->getEditModes().isCurrentSupermodeData()) { + // check if we're in common mode + if ((viewNet->getEditModes().dataEditMode == DataEditMode::DATA_INSPECT) || + (viewNet->getEditModes().dataEditMode == DataEditMode::DATA_DELETE) || + (viewNet->getEditModes().dataEditMode == DataEditMode::DATA_SELECT)) { + // obtain dataset, begin, end and attribute + const std::string genericDataType = viewNet->getIntervalBar().getGenericDataTypeStr(); + const std::string dataSet = viewNet->getIntervalBar().getDataSetStr(); + const std::string begin = viewNet->getIntervalBar().getBeginStr(); + const std::string end = viewNet->getIntervalBar().getEndStr(); + const std::string attribute = viewNet->getIntervalBar().getAttributeStr(); + // chek genericData Type + if (!genericDataType.empty() && (myTagProperty.getTagStr() != genericDataType)) { + return false; + } + // chek data set + if (!dataSet.empty() && myDataIntervalParent->getDataSetParent()->getID() != dataSet) { + return false; + } + // chek begin + if (!begin.empty() && parse(begin) < myDataIntervalParent->getAttributeDouble(SUMO_ATTR_BEGIN)) { + return false; + } + // chek end + if (!end.empty() && parse(end) > myDataIntervalParent->getAttributeDouble(SUMO_ATTR_END)) { + return false; + } + // check attribute + if (!attribute.empty() && getParametersMap().count(attribute) == 0) { + return false; + } + // all checks ok, then return true + return true; + } else { + // return specific function output + return isVisible(); + } + } else { + // no supermode data + return false; + } +} + + +void +GNEGenericData::drawAttribute(const PositionVector& shape) const { + if ((myTagProperty.getTag() == SUMO_TAG_MEANDATA_EDGE) && (shape.length() > 0)) { + // obtain pointer to edge data frame (only for code legibly) + const GNEEdgeDataFrame* edgeDataFrame = myDataIntervalParent->getNet()->getViewNet()->getViewParent()->getEdgeDataFrame(); + // check if we have to filter generic data + if (edgeDataFrame->shown()) { + // check attribute + if ((edgeDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) && + (getParametersMap().count(edgeDataFrame->getAttributeSelector()->getFilteredAttribute()) > 0)) { + // get value + const std::string value = getParametersMap().at(edgeDataFrame->getAttributeSelector()->getFilteredAttribute()); + // calculate center position + const Position centerPosition = shape.positionAtOffset2D(shape.length2D() / 2); + // Add a draw matrix + glPushMatrix(); + GLHelper::drawText(value, centerPosition, GLO_MAX, 2, RGBColor::BLUE); + // pop draw matrix + glPopMatrix(); + } + } + } +} + + +bool +GNEGenericData::isGenericDataValid() const { + return true; +} + + +std::string +GNEGenericData::getGenericDataProblem() const { + return ""; +} + + +void +GNEGenericData::fixGenericDataProblem() { + throw InvalidArgument(getTagStr() + " cannot fix any problem"); +} + + +GUIGLObjectPopupMenu* +GNEGenericData::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myDataIntervalParent->getNet()->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open additional dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } else { + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + } + return ret; +} + + +GUIParameterTableWindow* +GNEGenericData::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& /* parent */) { + // Create table + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); + // Iterate over attributes + for (const auto& tagProperty : myTagProperty) { + // Add attribute and set it dynamic if aren't unique + if (tagProperty.isUnique()) { + ret->mkItem(tagProperty.getAttrStr().c_str(), false, getAttribute(tagProperty.getAttr())); + } else { + ret->mkItem(tagProperty.getAttrStr().c_str(), true, getAttribute(tagProperty.getAttr())); + } + } + // close building + ret->closeBuilding(); + return ret; +} + + +void +GNEGenericData::drawGL(const GUIVisualizationSettings& /*s*/) const { + // currently unused +} + + +std::string +GNEGenericData::generateChildID(SumoXMLTag /*childTag*/) { + return ""; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEGenericData.h sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEGenericData.h --- sumo-1.5.0+dfsg1/src/netedit/elements/data/GNEGenericData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/data/GNEGenericData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,252 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEGenericData.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// A abstract class for data sets +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEViewNet; +class GNEDataInterval; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEGenericData + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEGenericData : public GUIGlObject, public GNEAttributeCarrier, public Parameterised, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { + +public: + /**@brief Constructor + * @param[in] tag generic data Tag (edgeData, laneData, etc.) + * @param[in] GLType GUIGlObjectType associated to this Generic Data + * @param[in] dataIntervalParent pointer to data interval parent + * @param[in] parameters parameters map + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEGenericData(const SumoXMLTag tag, const GUIGlObjectType type, GNEDataInterval* dataIntervalParent, + const std::map& parameters, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /// @brief Destructor + virtual ~GNEGenericData(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief get data interval parent + GNEDataInterval* getDataIntervalParent() const; + + /// @brief get generic data color + const RGBColor& getColor() const; + + /// @brief check if current generic data is visible + bool isGenericDataVisible() const; + + // @brief draw attribute + void drawAttribute(const PositionVector& shape) const; + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Returns element position in view + virtual Position getPositionInView() const = 0; + + /// @name members and functions relative to write data sets into XML + /// @{ + /**@brief writte data set element into a xml file + * @param[in] device device in which write parameters of data set element + */ + virtual void writeGenericData(OutputDevice& device) const = 0; + + /// @brief check if current data set is valid to be writed into XML (by default true, can be reimplemented in children) + virtual bool isGenericDataValid() const; + + /// @brief return a string with the current data set problem (by default empty, can be reimplemented in children) + virtual std::string getGenericDataProblem() const; + + /// @brief fix data set problem (by default throw an exception, has to be reimplemented in children) + virtual void fixGenericDataProblem(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@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; + + //// @brief Returns the boundary to which the view shall be centered in order to show the object + virtual Boundary getCenteringBoundary() const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual double getAttributeDouble(SumoXMLAttr key) const = 0; + + /**@brief method for setting the attribute and letting the object perform data set changes + * @param[in] key The attribute key + * @param[in] value The new value + * @param[in] undoList The undoList on which to register changes + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /**@brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 + */ + virtual void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @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 + */ + virtual void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + virtual std::string getPopUpID() const = 0; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + virtual std::string getHierarchyName() const = 0; + /// @} + +protected: + /// @brief dataInterval Parent + GNEDataInterval* myDataIntervalParent; + +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 check if current generic data is visible (must be implemented in all generic data childs) + virtual bool isVisible() const = 0; + + /// @brief get specific generic data color + virtual const RGBColor& getSpecificColor() const = 0; + + /// @brief gererate a new ID for an element child (currently unused) + std::string generateChildID(SumoXMLTag childTag); + + /// @brief Invalidated copy constructor. + GNEGenericData(const GNEGenericData&) = delete; + + /// @brief Invalidated assignment operator. + GNEGenericData& operator=(const GNEGenericData&) = delete; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/elements/demand/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,25 @@ +set(netedit_elements_demand_SRCS + GNERouteHandler.h + GNERouteHandler.cpp + GNEDemandElement.h + GNEDemandElement.cpp + GNERoute.h + GNERoute.cpp + GNEVehicleType.h + GNEVehicleType.cpp + GNEVehicle.h + GNEVehicle.cpp + GNEStop.h + GNEStop.cpp + GNEWalk.h + GNEWalk.cpp + GNERide.h + GNERide.cpp + GNEPersonTrip.h + GNEPersonTrip.cpp + GNEPerson.h + GNEPerson.cpp + ) + +add_library(netedit_elements_demand STATIC ${netedit_elements_demand_SRCS}) +set_property(TARGET netedit_elements_demand PROPERTY PROJECT_LABEL "z_netedit_elements_demand") diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,398 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDemandElement.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2018 +/// +// A abstract class for demand elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + +#include "GNEDemandElement.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEDemandElement - methods +// --------------------------------------------------------------------------- + +GNEDemandElement::GNEDemandElement(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, id), + GNEAttributeCarrier(tag, net), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myStackedLabelNumber(0) { +} + + +GNEDemandElement::GNEDemandElement(GNEDemandElement* demandElementParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, demandElementParent->generateChildID(tag)), + GNEAttributeCarrier(tag, net), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myStackedLabelNumber(0) { +} + + +GNEDemandElement::~GNEDemandElement() {} + + +const std::string& +GNEDemandElement::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNEDemandElement::getGUIGlObject() { + return this; +} + + +std::string +GNEDemandElement::generateChildID(SumoXMLTag childTag) { + int counter = (int)getChildDemandElements().size(); + while (myNet->retrieveDemandElement(childTag, getID() + toString(childTag) + toString(counter), false) != nullptr) { + counter++; + } + return (getID() + toString(childTag) + toString(counter)); +} + + +const GNEGeometry::Geometry& +GNEDemandElement::getDemandElementGeometry() { + return myDemandElementGeometry; +} + + +const GNEGeometry::SegmentGeometry& +GNEDemandElement::getDemandElementSegmentGeometry() const { + return myDemandElementSegmentGeometry; +} + + +void +GNEDemandElement::updateDemandElementGeometry(const GNELane* lane, const double posOverLane) { + myDemandElementGeometry.updateGeometry(lane, posOverLane); +} + + +void +GNEDemandElement::updateDemandElementStackLabel(const int stack) { + myStackedLabelNumber = stack; +} + + +const GNEGeometry::SegmentGeometry& +GNEDemandElement::getDemandElementSegmentSpreadGeometry() const { + return mySpreadSegmentGeometry; +} + + +void +GNEDemandElement::updateDemandElementSpreadGeometry(const GNELane* lane, const double posOverLane) { + mySpreadGeometry.updateGeometry(lane, posOverLane); +} + + +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"); +} + + +std::string +GNEDemandElement::getBegin() const { + throw InvalidArgument(getTagStr() + " doesn't have an begin time"); +} + + +GUIGLObjectPopupMenu* +GNEDemandElement::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open demand element dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + return ret; +} + + +GUIParameterTableWindow* +GNEDemandElement::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { + // Create table + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); + // Iterate over attributes + for (const auto& i : myTagProperty) { + // Add attribute and set it dynamic if aren't unique + if (i.isUnique()) { + ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); + } else { + ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); + } + } + // close building + ret->closeBuilding(); + return ret; +} + + +bool +GNEDemandElement::isValidDemandElementID(const std::string& newID) const { + if (SUMOXMLDefinitions::isValidVehicleID(newID) && (myNet->retrieveDemandElement(myTagProperty.getTag(), newID, false) == nullptr)) { + return true; + } else { + return false; + } +} + + +GNELane* +GNEDemandElement::getFirstAllowedVehicleLane() const { + // first check if current demand element has parent edges + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + // use route edges + return getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); + } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + // check if vehicle use a embedded route + if (getParentDemandElements().size() == 2) { + return getParentDemandElements().at(1)->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); + } else if (getChildDemandElements().size() > 0) { + return getChildDemandElements().front()->getParentEdges().front()->getLaneByAllowedVClass(getVClass()); + } else { + return nullptr; + } + } else if (getParentEdges().size() > 0) { + // obtain Lane depending of attribute "departLane" + if (myTagProperty.hasAttribute(SUMO_ATTR_DEPARTLANE)) { + // obtain depart lane + std::string departLane = getAttribute(SUMO_ATTR_DEPARTLANE); + // check depart lane + if ((departLane == "random") || (departLane == "free") || (departLane == "allowed") || (departLane == "best") || (departLane == "first")) { + return getParentEdges().front()->getLaneByAllowedVClass(getVClass()); + } + // obtain index + const int departLaneIndex = parse(getAttribute(SUMO_ATTR_DEPARTLANE)); + // if index is correct, return lane. In other case, return nullptr; + if ((departLaneIndex >= 0) && (departLaneIndex < getParentEdges().front()->getNBEdge()->getNumLanes())) { + return getParentEdges().front()->getLanes().at(departLaneIndex); + } else { + return nullptr; + } + } else if (myTagProperty.isRide()) { + // special case for rides + return getParentEdges().front()->getLaneByDisallowedVClass(getVClass()); + } else { + // in other case, always return the first allowed + return getParentEdges().front()->getLaneByAllowedVClass(getVClass()); + } + } else { + return nullptr; + } +} + + +GNELane* +GNEDemandElement::getLastAllowedVehicleLane() const { + // first check if current demand element has parent edges + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + // use route edges + return getParentDemandElements().at(1)->getParentEdges().back()->getLaneByAllowedVClass(getVClass()); + } else if (getParentEdges().size() > 0) { + if ((myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) || + (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) || + (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP)) { + // return busStop lane + return getParentAdditionals().front()->getParentLanes().front(); + } else if (myTagProperty.hasAttribute(SUMO_ATTR_ARRIVALLANE)) { + // obtain Lane depending of attribute "arrivalLane" + std::string arrivalLane = getAttribute(SUMO_ATTR_ARRIVALLANE); + // check depart lane + if (arrivalLane == "current") { + return getParentEdges().back()->getLaneByAllowedVClass(getVClass()); + } + // obtain index + const int arrivalLaneIndex = parse(getAttribute(SUMO_ATTR_ARRIVALLANE)); + // if index is correct, return lane. In other case, return nullptr; + if ((arrivalLaneIndex >= 0) && (arrivalLaneIndex < getParentEdges().back()->getNBEdge()->getNumLanes())) { + return getParentEdges().back()->getLanes().at(arrivalLaneIndex); + } else { + return nullptr; + } + } else if (myTagProperty.isRide()) { + // special case for rides + return getParentEdges().back()->getLaneByDisallowedVClass(getVClass()); + } else { + // in other case, always return the first allowed + return getParentEdges().back()->getLaneByAllowedVClass(getVClass()); + } + } else { + return nullptr; + } +} + + +void +GNEDemandElement::calculatePersonPlanLaneStartEndPos(double& startPos, double& endPos) const { + // obtain pointer to current busStop + GNEAdditional* busStop = getParentAdditionals().size() > 0 ? getParentAdditionals().front() : nullptr; + // declare pointers for previous elements + GNEAdditional* previousBusStop = nullptr; + GNEDemandElement* previousPersonPlan = getParentDemandElements().at(0)->getPreviousChildDemandElement(this); + // declare pointer to next person plan + GNEDemandElement* nextPersonPlan = getParentDemandElements().at(0)->getNextChildDemandElement(this); + // obtain departlane throught previous element + if (previousPersonPlan && (previousPersonPlan->getParentAdditionals().size() > 0)) { + // set previous busStop + previousBusStop = previousPersonPlan->getParentAdditionals().front(); + } + // adjust startPos depending of previous busStop + if (previousBusStop) { + startPos = previousBusStop->getAttributeDouble(SUMO_ATTR_ENDPOS); + } else if (previousPersonPlan) { + // check if previous element is a stop or another person plan (walk, ride, trip...) + if (previousPersonPlan->getTagProperty().isPersonStop()) { + startPos = previousPersonPlan->getAttributeDouble(SUMO_ATTR_ENDPOS); + } else { + startPos = previousPersonPlan->getAttributeDouble(SUMO_ATTR_ARRIVALPOS); + } + } else { + // if this is the first person plan, use departPos of pedestrian + startPos = getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPARTPOS); + } + // adjust endPos depending of next busStop + if (busStop) { + endPos = busStop->getAttributeDouble(SUMO_ATTR_STARTPOS); + } else if (nextPersonPlan && nextPersonPlan->getTagProperty().isPersonStop()) { + endPos = nextPersonPlan->getAttributeDouble(SUMO_ATTR_STARTPOS); + } else { + // if this is the last element, simply use arrival position + endPos = getAttributeDouble(SUMO_ATTR_ARRIVALPOS); + } +} + + +void +GNEDemandElement::calculatePersonPlanPositionStartEndPos(Position& startPos, Position& endPos) const { + // obtain previous demand element + GNEDemandElement* previousDemandElmement = getParentDemandElements().front()->getPreviousChildDemandElement(this); + if (previousDemandElmement) { + // update startPos + if ((previousDemandElmement->getParentAdditionals().size() > 0) && + (previousDemandElmement->getParentAdditionals().front()->getAdditionalGeometry().getShape().size() > 0)) { + // Previous demand element ends in an busStop + startPos = previousDemandElmement->getParentAdditionals().front()->getAdditionalGeometry().getShape().back(); + } else if (previousDemandElmement->getTagProperty().isPersonStop() && (previousDemandElmement->getDemandElementGeometry().getShape().size() > 0)) { + // Previous demand element ends in an Stop + startPos = previousDemandElmement->getDemandElementGeometry().getShape().back(); + } else if ((previousDemandElmement->getDemandElementSegmentGeometry().size() > 0) && + (previousDemandElmement->getDemandElementSegmentGeometry().back().getShape().size() > 0)) { + // add last shape segment of previous segment geometry + startPos = previousDemandElmement->getDemandElementSegmentGeometry().back().getShape().back(); + } + } + // check if demand element ends in an busStop + if ((getParentAdditionals().size() > 0) && (getParentAdditionals().front()->getAdditionalGeometry().getShape().size() > 0)) { + endPos = getParentAdditionals().front()->getAdditionalGeometry().getShape().front(); + } else { + // obtain next demand element + GNEDemandElement* nextDemandElmement = getParentDemandElements().front()->getNextChildDemandElement(this); + if (nextDemandElmement) { + // update end pos + if (nextDemandElmement->getTagProperty().isPersonStop() && (nextDemandElmement->getDemandElementGeometry().getShape().size() > 0)) { + // previous demand element ends in an Stop + endPos = nextDemandElmement->getDemandElementGeometry().getShape().front(); + } + } + } +} + + +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"); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEDemandElement.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,398 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDemandElement.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2018 +/// +// A abstract class for demand elements +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNENet; +class GNEAdditional; +class GNEDemandElement; +class GNENetworkElement; +class GNEGenericData; +class GNEEdge; +class GNELane; +class GNEJunction; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEDemandElement + * @brief An Element which don't belongs to GNENet but has influency in the simulation + */ +class GNEDemandElement : public GUIGlObject, public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { + +public: + /// @brief struct for pack all variables related with Demand Element moving + struct DemandElementMove { + /// @brief boundary used during moving of elements (to avoid insertion in RTREE) + Boundary movingGeometryBoundary; + + /// @brief value for saving first original position over lane before moving + Position originalViewPosition; + + /// @brief value for saving first original position over lane before moving + std::string firstOriginalLanePosition; + + /// @brief value for saving second original position over lane before moving + std::string secondOriginalPosition; + }; + + /**@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 + * @param[in] type GUIGlObjectType of demand element + * @param[in] tag Type of xml tag that define the demand element element (SUMO_TAG_ROUTE, SUMO_TAG_VEHICLE, etc...) + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEDemandElement(const std::string& id, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /**@brief Constructor + * @param[in] demandElementParent pointer to parent demand element pointer (used to generate an ID) + * @param[in] net pointer to GNEViewNet of this demand element element belongs + * @param[in] type GUIGlObjectType of demand element + * @param[in] tag Type of xml tag that define the demand element element (SUMO_TAG_ROUTE, SUMO_TAG_VEHICLE, etc...) + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNEDemandElement(GNEDemandElement* demandElementParent, GNENet* net, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /// @brief Destructor + virtual ~GNEDemandElement(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name members and functions relative to demand element (stacked) geometries + /// @{ + /// @brief get demand element geometry (stacked) + const GNEGeometry::Geometry& getDemandElementGeometry(); + + /// @brief get demand element segment geometry (stacked) + const GNEGeometry::SegmentGeometry& getDemandElementSegmentGeometry() const; + + /// @brief update element stacked geometry (stacked) + void updateDemandElementGeometry(const GNELane* lane, const double posOverLane); + + /// @brief update stack label + void updateDemandElementStackLabel(const int stack); + /// @} + + /// @name members and functions relative to demand element spread geometries + /// @{ + /// @brief get demand element segment spread geometry + const GNEGeometry::SegmentGeometry& getDemandElementSegmentSpreadGeometry() const; + + /// @brief update element spread geometry + void updateDemandElementSpreadGeometry(const GNELane* lane, const double posOverLane); + /// @} + + /// @name members and functions relative to elements common to all demand elements + /// @{ + /// @brief obtain from edge of this demand element + virtual GNEEdge* getFromEdge() const = 0; + + /// @brief obtain to edge of this demand element + virtual GNEEdge* getToEdge() const = 0; + + /// @brief obtain VClass related with this demand element + virtual SUMOVehicleClass getVClass() const = 0; + + /// @brief get color + virtual const RGBColor& getColor() const = 0; + /// @} + + /// @name members and functions relative to write demand elements into XML + /// @{ + /**@brief writte demand element element into a xml file + * @param[in] device device in which write parameters of demand element element + */ + 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; + + /// @brief return a string with the current demand element problem (by default empty, can be reimplemented in children) + virtual std::string getDemandElementProblem() const; + + /// @brief fix demand element problem (by default throw an exception, has to be reimplemented in children) + virtual void fixDemandElementProblem(); + /// @} + + /**@brief open DemandElement Dialog + * @note: if demand element needs an demand element dialog, this function has to be implemented in childrens (see GNERerouter and GNEVariableSpeedSign) + * @throw invalid argument if demand element doesn't have an demand element Dialog + */ + virtual void openDemandElementDialog(); + + /**@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 + */ + virtual std::string getBegin() const; + + /// @name Functions related with geometry of element + /// @{ + /// @brief begin geometry movement + virtual void startGeometryMoving() = 0; + + /// @brief end geometry movement + virtual void endGeometryMoving() = 0; + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + virtual void moveGeometry(const Position& offset) = 0; + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + virtual void commitGeometryMoving(GNEUndoList* undoList) = 0; + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief partial update pre-computed geometry information + virtual void updatePartialGeometry(const GNEEdge* edge) = 0; + + /// @brief compute path + virtual void computePath() = 0; + + /// @brief invalidate path + virtual void invalidatePath() = 0; + + /// @brief Returns position of demand element in view + virtual Position getPositionInView() const = 0; + + /// @brief split geometry + virtual void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) = 0; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * @return The boundary the object is within + */ + virtual Boundary getCenteringBoundary() const = 0; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual double getAttributeDouble(SumoXMLAttr key) const = 0; + + /**@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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /**@brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 + */ + virtual void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @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 + */ + virtual void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + virtual std::string getPopUpID() const = 0; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + virtual std::string getHierarchyName() const = 0; + /// @} + + /// @brief get first allowed vehicle lane + GNELane* getFirstAllowedVehicleLane() const; + + /// @brief get first allowed vehicle lane + GNELane* getLastAllowedVehicleLane() const; + +protected: + /// @brief demand element geometry (also called "stacked geometry") + GNEGeometry::Geometry myDemandElementGeometry; + + /// @brief demand element segment geometry (also called "stacked geometry") + GNEGeometry::SegmentGeometry myDemandElementSegmentGeometry; + + /// @brief demand element spread geometry (Only used by vehicles and pedestrians) + GNEGeometry::Geometry mySpreadGeometry; + + /// @brief demand element spread segment geometry (Only used by vehicles and pedestrians) + GNEGeometry::SegmentGeometry mySpreadSegmentGeometry; + + /// @brief stacked label number + int myStackedLabelNumber; + + /// @name Functions relative to change values in setAttribute(...) + /// @{ + + /// @brief check if a new demand element ID is valid + bool isValidDemandElementID(const std::string& newID) const; + + /// @} + + /// @brief calculate personPlan start and end positions over lanes + void calculatePersonPlanLaneStartEndPos(double& startPos, double& endPos) const; + + /// @brief calculate personPlan start and end positions + void calculatePersonPlanPositionStartEndPos(Position& startPos, Position& endPos) const; + +private: + /**@brief check restriction with the number of children + * @throw ProcessError if itis called without be reimplemented in child class + */ + virtual bool checkChildDemandElementRestriction() const; + + /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) + virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0; + + /// @brief Invalidated copy constructor. + GNEDemandElement(const GNEDemandElement&) = delete; + + /// @brief Invalidated assignment operator. + GNEDemandElement& operator=(const GNEDemandElement&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPerson.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPerson.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPerson.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPerson.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,901 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPerson.cpp +/// @author Pablo Alvarez Lopez +/// @date May 2019 +/// +// Representation of persons in NETEDIT +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPerson.h" +#include "GNERouteHandler.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +FXDEFMAP(GNEPerson::GNEPersonPopupMenu) personPopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_PERSON_TRANSFORM, GNEPerson::GNEPersonPopupMenu::onCmdTransform), +}; + +FXDEFMAP(GNEPerson::GNESelectedPersonsPopupMenu) selectedPersonsPopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_PERSON_TRANSFORM, GNEPerson::GNESelectedPersonsPopupMenu::onCmdTransform), +}; + +// Object implementation +FXIMPLEMENT(GNEPerson::GNEPersonPopupMenu, GUIGLObjectPopupMenu, personPopupMenuMap, ARRAYNUMBER(personPopupMenuMap)) +FXIMPLEMENT(GNEPerson::GNESelectedPersonsPopupMenu, GUIGLObjectPopupMenu, selectedPersonsPopupMenuMap, ARRAYNUMBER(selectedPersonsPopupMenuMap)) + +// =========================================================================== +// GNEPerson::GNEPersonPopupMenu +// =========================================================================== + +GNEPerson::GNEPersonPopupMenu::GNEPersonPopupMenu(GNEPerson* person, GUIMainWindow& app, GUISUMOAbstractView& parent) : + GUIGLObjectPopupMenu(app, parent, *person), + myPerson(person), + myTransformToPerson(nullptr), + myTransformToPersonFlow(nullptr) { + // build header + myPerson->buildPopupHeader(this, app); + // build menu command for center button and copy cursor position to clipboard + myPerson->buildCenterPopupEntry(this); + myPerson->buildPositionCopyEntry(this, false); + // buld menu commands for names + new FXMenuCommand(this, ("Copy " + myPerson->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); + new FXMenuCommand(this, ("Copy " + myPerson->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); + new FXMenuSeparator(this); + // build selection and show parameters menu + myPerson->getNet()->getViewNet()->buildSelectionACPopupEntry(this, myPerson); + myPerson->buildShowParamsPopupEntry(this); + // add transform functions only in demand mode + if (myPerson->getNet()->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + // create menu pane for transform operations + FXMenuPane* transformOperation = new FXMenuPane(this); + this->insertMenuPaneChild(transformOperation); + new FXMenuCascade(this, "transform to", nullptr, transformOperation); + // Create menu comands for all transformations + myTransformToPerson = new FXMenuCommand(transformOperation, "Person", GUIIconSubSys::getIcon(GUIIcon::PERSON), this, MID_GNE_PERSON_TRANSFORM); + myTransformToPersonFlow = new FXMenuCommand(transformOperation, "Person (embedded route)", GUIIconSubSys::getIcon(GUIIcon::PERSONFLOW), this, MID_GNE_PERSON_TRANSFORM); + // check what menu command has to be disabled + if (myPerson->getTagProperty().getTag() == SUMO_TAG_PERSON) { + myTransformToPerson->disable(); + } else if (myPerson->getTagProperty().getTag() == SUMO_TAG_PERSONFLOW) { + myTransformToPersonFlow->disable(); + } + } +} + + +GNEPerson::GNEPersonPopupMenu::~GNEPersonPopupMenu() {} + + +long +GNEPerson::GNEPersonPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { + if (obj == myTransformToPerson) { + GNERouteHandler::transformToPerson(myPerson); + } else if (obj == myTransformToPersonFlow) { + GNERouteHandler::transformToPersonFlow(myPerson); + } + return 1; +} + + +// =========================================================================== +// GNEPerson::GNESelectedPersonsPopupMenu +// =========================================================================== + +GNEPerson::GNESelectedPersonsPopupMenu::GNESelectedPersonsPopupMenu(GNEPerson* person, const std::vector& selectedPerson, GUIMainWindow& app, GUISUMOAbstractView& parent) : + GUIGLObjectPopupMenu(app, parent, *person), + myPersonTag(person->getTagProperty().getTag()), + mySelectedPersons(selectedPerson), + myTransformToPerson(nullptr), + myTransformToPersonFlow(nullptr) { + // build header + person->buildPopupHeader(this, app); + // build menu command for center button and copy cursor position to clipboard + person->buildCenterPopupEntry(this); + person->buildPositionCopyEntry(this, false); + // buld menu commands for names + new FXMenuCommand(this, ("Copy " + person->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); + new FXMenuCommand(this, ("Copy " + person->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); + new FXMenuSeparator(this); + // build selection and show parameters menu + person->getNet()->getViewNet()->buildSelectionACPopupEntry(this, person); + person->buildShowParamsPopupEntry(this); + // add transform functions only in demand mode + if (person->getNet()->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + // create menu pane for transform operations + FXMenuPane* transformOperation = new FXMenuPane(this); + this->insertMenuPaneChild(transformOperation); + new FXMenuCascade(this, "transform to", nullptr, transformOperation); + // Create menu comands for all transformations + myTransformToPerson = new FXMenuCommand(transformOperation, "Person", GUIIconSubSys::getIcon(GUIIcon::PERSON), this, MID_GNE_PERSON_TRANSFORM); + myTransformToPersonFlow = new FXMenuCommand(transformOperation, "PersonFlow", GUIIconSubSys::getIcon(GUIIcon::PERSONFLOW), this, MID_GNE_PERSON_TRANSFORM); + } +} + + +GNEPerson::GNESelectedPersonsPopupMenu::~GNESelectedPersonsPopupMenu() {} + + +long +GNEPerson::GNESelectedPersonsPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { + // iterate over all selected persons + for (const auto& i : mySelectedPersons) { + if ((obj == myTransformToPerson) && + (i->getTagProperty().getTag() == myPersonTag)) { + GNERouteHandler::transformToPerson(i); + } else if ((obj == myTransformToPersonFlow) && + (i->getTagProperty().getTag() == myPersonTag)) { + GNERouteHandler::transformToPerson(i); + } + } + return 1; +} + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEPerson::GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters) : + GNEDemandElement(personparameters.id, net, (tag == SUMO_TAG_PERSONFLOW) ? GLO_PERSONFLOW : GLO_PERSON, tag, +{}, {}, {}, {}, {}, {pType}, {}, // parents +{}, {}, {}, {}, {}, {}, {}), // children +SUMOVehicleParameter(personparameters) { + // set manually vtypeID (needed for saving) + vtypeid = pType->getID(); +} + + +GNEPerson::~GNEPerson() {} + + +std::string +GNEPerson::getBegin() const { + // obtain depart depending if is a Person, trip or routeFlow + std::string departStr; + if (myTagProperty.getTag() == SUMO_TAG_PERSONFLOW) { + departStr = toString(depart); + } else { + departStr = getDepart(); + } + // we need to handle depart as a tuple of 20 numbers (format: 000000...00) + departStr.reserve(20 - departStr.size()); + // add 0s at the beginning of departStr until we have 20 numbers + for (int i = (int)departStr.size(); i < 20; i++) { + departStr.insert(departStr.begin(), '0'); + } + return departStr; +} + + +void +GNEPerson::writeDemandElement(OutputDevice& device) const { + // obtain tag depending if tagProperty has a synonym + SumoXMLTag synonymTag = myTagProperty.hasTagSynonym() ? myTagProperty.getTagSynonym() : myTagProperty.getTag(); + // attribute VType musn't be written if is DEFAULT_PEDTYPE_ID + if (getParentDemandElements().at(0)->getID() == DEFAULT_PEDTYPE_ID) { + // unset VType parameter + parametersSet &= ~VEHPARS_VTYPE_SET; + // write person attributes (VType will not be written) + write(device, OptionsCont::getOptions(), synonymTag); + // set VType parameter again + parametersSet |= VEHPARS_VTYPE_SET; + } else { + // write person attributes, including VType + write(device, OptionsCont::getOptions(), synonymTag, getParentDemandElements().at(0)->getID()); + } + // write specific flow attributes + if (myTagProperty.getTag() == SUMO_TAG_PERSONFLOW) { + // write routeFlow values depending if it was set + if (isAttributeEnabled(SUMO_ATTR_END)) { + device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); + } + if (isAttributeEnabled(SUMO_ATTR_NUMBER)) { + device.writeAttr(SUMO_ATTR_NUMBER, repetitionNumber); + } + if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { + device.writeAttr(SUMO_ATTR_VEHSPERHOUR, 3600. / STEPS2TIME(repetitionOffset)); + } + if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { + device.writeAttr(SUMO_ATTR_PERIOD, time2string(repetitionOffset)); + } + if (isAttributeEnabled(SUMO_ATTR_PROB)) { + device.writeAttr(SUMO_ATTR_PROB, repetitionProbability); + } + } + // write parameters + writeParams(device); + // write child demand elements associated to this person (Rides, Walks...) + for (const auto& i : getChildDemandElements()) { + i->writeDemandElement(device); + } + // close person tag + device.closeTag(); +} + + +bool +GNEPerson::isDemandElementValid() const { + // a single person is always valid + return true; +} + + +std::string +GNEPerson::getDemandElementProblem() const { + // A single person cannot habe problem (but their children) + return ""; +} + + +void +GNEPerson::fixDemandElementProblem() { + // nothing to fix +} + + +GNEEdge* +GNEPerson::getFromEdge() const { + return getChildDemandElements().front()->getFromEdge(); +} + + +GNEEdge* +GNEPerson::getToEdge() const { + return getChildDemandElements().front()->getToEdge(); +} + + +SUMOVehicleClass +GNEPerson::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNEPerson::getColor() const { + return color; +} + + +void +GNEPerson::startGeometryMoving() { + // Persons cannot be moved +} + + +void +GNEPerson::endGeometryMoving() { + // Persons cannot be moved +} + + +void +GNEPerson::moveGeometry(const Position&) { + // Persons cannot be moved +} + + +void +GNEPerson::commitGeometryMoving(GNEUndoList*) { + // Persons cannot be moved +} + + +void +GNEPerson::updateGeometry() { + // only update geometry of childrens + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + +void +GNEPerson::updateDottedContour() { + // +} + + +void +GNEPerson::updatePartialGeometry(const GNEEdge* edge) { + // only update partial geometry of childrens + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNEPerson::computePath() { + // nothing to compute +} + + +void +GNEPerson::invalidatePath() { + // nothing to invalidate +} + + +Position +GNEPerson::getPositionInView() const { + // Position in view depend of first child element + if (getChildDemandElements().size() > 0) { + if (getChildDemandElements().at(0)->getTagProperty().isPersonStop()) { + return getChildDemandElements().at(0)->getDemandElementGeometry().getShape().getLineCenter(); + } else { + // obtain lane (special case for rides) + SUMOVehicleClass vClassEdgeFrom = getChildDemandElements().front()->getTagProperty().isRide() ? SVC_PASSENGER : SVC_PEDESTRIAN; + GNELane* lane = getChildDemandElements().at(0)->getParentEdges().at(0)->getLaneByAllowedVClass(vClassEdgeFrom); + // return position in view depending of lane + if (lane->getLaneShape().length() < 2.5) { + return lane->getLaneShape().front(); + } else { + Position A = lane->getLaneShape().positionAtOffset(2.5); + Position B = lane->getLaneShape().positionAtOffset(2.5); + // return Middle point + return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); + } + } + } else { + return Position(0, 0); + } +} + + +GUIGLObjectPopupMenu* +GNEPerson::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + // return a GNEPersonPopupMenu + return new GNEPersonPopupMenu(this, app, parent); +} + + +std::string +GNEPerson::getParentName() const { + return getParentDemandElements().front()->getID(); +} + + +Boundary +GNEPerson::getCenteringBoundary() const { + Boundary personBoundary; + if (getChildDemandElements().size() > 0) { + if (getChildDemandElements().front()->getTagProperty().isPersonStop()) { + // use boundary of stop center + return getChildDemandElements().front()->getCenteringBoundary(); + } else { + // obtain boundary of first position over edge + personBoundary.add(getChildDemandElements().front()->getDemandElementSegmentGeometry().getFirstPosition()); + } + } else { + personBoundary = Boundary(-0.1, -0.1, 0.1, 0.1); + } + personBoundary.grow(20); + return personBoundary; +} + + +void +GNEPerson::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEPerson::drawGL(const GUIVisualizationSettings& s) const { + bool drawPerson = true; + // check if person can be drawn + if (!myNet->getViewNet()->getNetworkViewOptions().showDemandElements()) { + drawPerson = false; + } else if (!myNet->getViewNet()->getDataViewOptions().showDemandElements()) { + drawPerson = false; + } else if (!myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(this)) { + drawPerson = false; + } else if (getChildDemandElements().empty()) { + drawPerson = false; + } + // continue if person can be drawn + if (drawPerson) { + // obtain exaggeration (and add the special personExaggeration) + const double exaggeration = s.personSize.getExaggeration(s, this, 80) + s.detailSettings.personExaggeration; + // obtain width and length + const double length = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_LENGTH); + const double width = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_WIDTH); + // obtain diameter around person (used to calculate distance bewteen cursor and person) + const double distanceSquared = pow(exaggeration * std::max(length, width), 2); + // obtain img file + const std::string file = getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_IMGFILE); + Position personPosition; + // obtain position depending of first PersonPlan child + if (getChildDemandElements().front()->getTagProperty().isPersonStop()) { + // obtain position of stop center + personPosition = getChildDemandElements().front()->getPositionInView(); + } else { + // obtain position of first edge + personPosition = getChildDemandElements().front()->getDemandElementSegmentGeometry().getFirstPosition(); + } + // check that position is valid and person can be drawn + if ((personPosition != Position::INVALID) && + !(s.drawForPositionSelection && (personPosition.distanceSquaredTo(myNet->getViewNet()->getPositionInformation()) > distanceSquared))) { + // push GL ID + glPushName(getGlID()); + // push draw matrix + glPushMatrix(); + // translate and rotate + glTranslated(personPosition.x(), personPosition.y(), getType()); + glRotated(90, 0, 0, 1); + // set person color + setColor(s); + // set scale + 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); + } else if (s.drawDetail(s.detailSettings.personCircles, exaggeration)) { + GUIBasePersonHelper::drawAction_drawAsCircle(length, width); + } else if (s.drawDetail(s.detailSettings.personTriangles, exaggeration)) { + GUIBasePersonHelper::drawAction_drawAsTriangle(0, length, width); + } + // pop matrix + glPopMatrix(); + drawName(personPosition, s.scale, s.personName, s.angle); + if (s.personValue.show) { + 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()); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GLHelper::drawShapeDottedContourRectangle(s, getType(), personPosition, exaggeration, exaggeration); + } + // pop name + glPopName(); + } + } +} + + +std::string +GNEPerson::getAttribute(SumoXMLAttr key) const { + // declare string error + std::string error; + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_TYPE: + return getParentDemandElements().at(0)->getID(); + case SUMO_ATTR_COLOR: + if (wasSet(VEHPARS_COLOR_SET)) { + return toString(color); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_COLOR); + } + case SUMO_ATTR_DEPARTPOS: + if (wasSet(VEHPARS_DEPARTPOS_SET)) { + return getDepartPos(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS); + } + // Specific of persons + case SUMO_ATTR_DEPART: + return toString(depart); + // Specific of personFlows + case SUMO_ATTR_BEGIN: + return time2string(depart); + case SUMO_ATTR_END: + return time2string(repetitionEnd); + case SUMO_ATTR_VEHSPERHOUR: + return toString(3600 / STEPS2TIME(repetitionOffset)); + case SUMO_ATTR_PERIOD: + return time2string(repetitionOffset); + case SUMO_ATTR_PROB: + return toString(repetitionProbability); + case SUMO_ATTR_NUMBER: + return toString(repetitionNumber); + // + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEPerson::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_DEPARTPOS: + if (departPosProcedure == DEPART_POS_GIVEN) { + return departPos; + } else { + return 0; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPerson::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: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_DEPARTPOS: + // Specific of persons + case SUMO_ATTR_DEPART: + // Specific of personFlows + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + case SUMO_ATTR_VEHSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + // + case GNE_ATTR_PARAMETERS: + case GNE_ATTR_SELECTED: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEPerson::isValid(SumoXMLAttr key, const std::string& value) { + // declare string error + std::string error; + switch (key) { + case SUMO_ATTR_ID: + // Persons and personflows share namespace + if (SUMOXMLDefinitions::isValidVehicleID(value) && + (myNet->retrieveDemandElement(SUMO_TAG_PERSON, value, false) == nullptr) && + (myNet->retrieveDemandElement(SUMO_TAG_PERSONFLOW, value, false) == nullptr)) { + return true; + } else { + return false; + } + case SUMO_ATTR_TYPE: + return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_DEPARTPOS: { + double dummyDepartPos; + DepartPosDefinition dummyDepartPosProcedure; + parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPos, dummyDepartPosProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + // Specific of persons + case SUMO_ATTR_DEPART: { + if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + } + // Specific of personflows + case SUMO_ATTR_BEGIN: + if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_END: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_VEHSPERHOUR: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) > 0); + } else { + return false; + } + case SUMO_ATTR_PERIOD: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) > 0); + } else { + return false; + } + case SUMO_ATTR_PROB: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_NUMBER: + if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + // + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +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); +} + + +void +GNEPerson::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to disable +} + + +bool +GNEPerson::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_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; + default: + return true; + } +} + + +std::string +GNEPerson::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEPerson::getHierarchyName() const { + // special case for Trips and flow + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // check if we're inspecting a Edge + if (myNet->getViewNet()->getDottedAC() && + myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_EDGE) { + // check if edge correspond to a "from", "to" or "via" edge + if (getParentEdges().front() == myNet->getViewNet()->getDottedAC()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (from)"; + } else if (getParentEdges().front() == myNet->getViewNet()->getDottedAC()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (to)"; + } else { + // iterate over via + for (const auto& i : via) { + if (i == myNet->getViewNet()->getDottedAC()->getID()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (via)"; + } + } + } + } + } + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID); +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEPerson::setColor(const GUIVisualizationSettings& s) const { + const GUIColorer& c = s.personColorer; + if (!setFunctionalColor(c.getActive())) { + GLHelper::setColor(c.getScheme().getColor(getColorValue(s, c.getActive()))); + } +} + + +bool +GNEPerson::setFunctionalColor(int /* activeScheme */) const { + /* + switch (activeScheme) { + case 0: { + if (getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(getParameter().color); + return true; + } + if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(getVehicleType().getColor()); + return true; + } + return false; + } + case 2: { + if (getParameter().wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(getParameter().color); + return true; + } + return false; + } + case 3: { + if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) { + GLHelper::setColor(getVehicleType().getColor()); + return true; + } + return false; + } + case 8: { // color by angle + double hue = GeomHelper::naviDegree(getAngle()); + GLHelper::setColor(RGBColor::fromHSV(hue, 1., 1.)); + return true; + } + case 9: { // color randomly (by pointer) + const double hue = (long)this % 360; // [0-360] + const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1] + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + return true; + } + default: + return false; + } + */ + return false; +} + +// =========================================================================== +// private +// =========================================================================== + +GNEPerson::personPlanSegment::personPlanSegment(GNEDemandElement* _personPlan) : + personPlan(_personPlan), + edge(nullptr), + arrivalPos(-1) { +} + + +GNEPerson::personPlanSegment::personPlanSegment() : + personPlan(nullptr), + edge(nullptr), + arrivalPos(-1) { +} + + +void +GNEPerson::setAttribute(SumoXMLAttr key, const std::string& value) { + // declare string error + std::string error; + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_TYPE: + replaceParentDemandElement(this, value, 0); + // set manually vtypeID (needed for saving) + vtypeid = value; + break; + case SUMO_ATTR_COLOR: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + color = parse(value); + // mark parameter as set + parametersSet |= VEHPARS_COLOR_SET; + } else { + // set default value + color = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VEHPARS_COLOR_SET; + } + break; + case SUMO_ATTR_DEPARTPOS: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_DEPARTPOS_SET; + } else { + // set default value + parseDepartPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_DEPARTPOS_SET; + } + // compute person + updateGeometry(); + break; + // Specific of persons + case SUMO_ATTR_DEPART: { + std::string oldDepart = getBegin(); + parseDepart(value, toString(SUMO_TAG_VEHICLE), id, depart, departProcedure, error); + myNet->getAttributeCarriers()->updateDemandElementBegin(oldDepart, this); + break; + } + // Specific of personFlows + case SUMO_ATTR_BEGIN: { + std::string oldBegin = getBegin(); + depart = string2time(value); + myNet->getAttributeCarriers()->updateDemandElementBegin(oldBegin, this); + break; + } + case SUMO_ATTR_END: + repetitionEnd = string2time(value); + break; + case SUMO_ATTR_VEHSPERHOUR: + repetitionOffset = TIME2STEPS(3600 / parse(value)); + break; + case SUMO_ATTR_PERIOD: + repetitionOffset = string2time(value); + break; + case SUMO_ATTR_PROB: + repetitionProbability = parse(value); + break; + case SUMO_ATTR_NUMBER: + repetitionNumber = parse(value); + break; + // + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPerson::setEnabledAttribute(const int enabledAttributes) { + parametersSet = enabledAttributes; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPerson.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPerson.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPerson.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPerson.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,315 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPerson.h +/// @author Pablo Alvarez Lopez +/// @date May 2019 +/// +// Representation of persons in NETEDIT +/****************************************************************************/ +#pragma once +#include +#include + + +#include "GNEDemandElement.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEPerson + */ +class GNEPerson : public GNEDemandElement, public SUMOVehicleParameter { + +public: + /// @brief class used in GUIGLObjectPopupMenu for person transformations + class GNEPersonPopupMenu : public GUIGLObjectPopupMenu { + FXDECLARE(GNEPersonPopupMenu) + + public: + /** @brief Constructor + * @param[in] person GNEPerson to be transformed + * @param[in] app The main window for instantiation of other windows + * @param[in] parent The parent view for changing it + */ + GNEPersonPopupMenu(GNEPerson* person, GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief Destructor + ~GNEPersonPopupMenu(); + + /// @brief Called to transform the current person to another person type + long onCmdTransform(FXObject* obj, FXSelector, void*); + + protected: + /// @brief default constructor needed by FOX + GNEPersonPopupMenu() { } + + private: + /// @brief current person + GNEPerson* myPerson; + + /// @brief menu command for transform to person + FXMenuCommand* myTransformToPerson; + + /// @brief menu command for transform to personFlow + FXMenuCommand* myTransformToPersonFlow; + }; + + /// @brief class used in GUIGLObjectPopupMenu for single person transformations + class GNESelectedPersonsPopupMenu : public GUIGLObjectPopupMenu { + FXDECLARE(GNESelectedPersonsPopupMenu) + + public: + /** @brief Constructor + * @param[in] person clicked GNEPerson + * @param[in] selectedPerson vector with selected GNEPerson + * @param[in] app The main window for instantiation of other windows + * @param[in] parent The parent view for changing it + */ + GNESelectedPersonsPopupMenu(GNEPerson* person, const std::vector& selectedPerson, GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief Destructor + ~GNESelectedPersonsPopupMenu(); + + /// @brief Called to transform the current person to another person type + long onCmdTransform(FXObject* obj, FXSelector, void*); + + protected: + /// @brief default constructor needed by FOX + GNESelectedPersonsPopupMenu() { } + + private: + /// @brief tag of clicked person + SumoXMLTag myPersonTag; + + /// @brief current selected persons + std::vector mySelectedPersons; + + /// @brief menu command for transform to person + FXMenuCommand* myTransformToPerson; + + /// @brief menu command for transform to personFlow + FXMenuCommand* myTransformToPersonFlow; + }; + + /// @brief constructor for persons + GNEPerson(SumoXMLTag tag, GNENet* net, GNEDemandElement* pType, const SUMOVehicleParameter& personparameters); + + /// @brief destructor + ~GNEPerson(); + + /**@brief get begin time of demand element + * @note: used by demand elements of type "Person", 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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 start geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of demand element in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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; + /// @} + +protected: + /// @brief sets the color according to the currente settings + void setColor(const GUIVisualizationSettings& s) const; + + /// @brief sets the color according to the current scheme index and some vehicle function + bool setFunctionalColor(int activeScheme) const; + +private: + // @brief struct used for calculating person plan geometry segments + struct personPlanSegment { + /// @brief parameter constructor + personPlanSegment(GNEDemandElement* _personPlan); + + /// @brief person plan + const GNEDemandElement* personPlan; + + /// @brief edge + GNEEdge* edge; + + /// @brief busStops placed in this segment + std::vector busStops; + + /// @brief stops placed in this segment + std::vector stops; + + /// @brief arrival position + double arrivalPos; + + private: + /// @brief constructor + personPlanSegment(); + }; + + /// @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 Invalidated copy constructor. + GNEPerson(const GNEPerson&) = delete; + + /// @brief Invalidated assignment operator + GNEPerson& operator=(const GNEPerson&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,610 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonTrip.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing person trips in Netedit +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPersonTrip.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, + double arrivalPosition, const std::vector& types, const std::vector& modes) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_PERSONTRIP_FROMTO), net, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_FROMTO, +{}, {fromEdge, toEdge}, {}, {}, {}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myArrivalPosition(arrivalPosition), +myVTypes(types), +myModes(modes) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute person trip + computePath(); +} + + +GNEPersonTrip::GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via, + const std::vector& types, const std::vector& modes) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_PERSONTRIP_BUSSTOP), net, GLO_PERSONTRIP, SUMO_TAG_PERSONTRIP_BUSSTOP, +{}, {fromEdge}, {}, {}, {busStop}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myArrivalPosition(-1), +myVTypes(types), +myModes(modes) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute person trip + computePath(); +} + + +GNEPersonTrip::~GNEPersonTrip() {} + + +GUIGLObjectPopupMenu* +GNEPersonTrip::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open demand element dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + return ret; +} + + +void +GNEPersonTrip::writeDemandElement(OutputDevice& device) const { + // open tag + device.openTag(SUMO_TAG_PERSONTRIP); + // only write From attribute if this is the first Person Plan + if (getParentDemandElements().front()->getChildDemandElements().front() == this) { + device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + } + // check if write busStop or edge to + if (getParentAdditionals().size() > 0) { + device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); + } else { + device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + } + // write modes + if (myModes.size() > 0) { + device.writeAttr(SUMO_ATTR_MODES, myModes); + } + // write vTypes + if (myVTypes.size() > 0) { + device.writeAttr(SUMO_ATTR_VTYPES, myVTypes); + } + // only write arrivalPos if is different of -1 + if (myArrivalPosition != -1) { + device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); + } + // write parameters + writeParams(device); + // close tag + device.closeTag(); +} + + +bool +GNEPersonTrip::isDemandElementValid() const { + if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { + // from and to are the same edges + return true; + } else if (getPathEdges().size() > 0) { + // if path edges isn't empty, then there is a valid route + return true; + } else { + return false; + } +} + + +std::string +GNEPersonTrip::getDemandElementProblem() const { + if (getParentEdges().size() == 0) { + return ("A person trip need at least one edge"); + } else { + // check if exist at least a connection between every edge + for (int i = 1; i < (int)getParentEdges().size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { + return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } +} + + +void +GNEPersonTrip::fixDemandElementProblem() { + // currently the only solution is removing PersonTrip +} + + +GNEEdge* +GNEPersonTrip::getFromEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getFromEdge(); + } else { + return getParentEdges().front(); + } +} + + +GNEEdge* +GNEPersonTrip::getToEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getToEdge(); + } else { + return getParentEdges().back(); + } +} + + +SUMOVehicleClass +GNEPersonTrip::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNEPersonTrip::getColor() const { + return getParentDemandElements().front()->getColor(); +} + + +void +GNEPersonTrip::startGeometryMoving() { + // only start geometry moving if arrival position isn't -1 + if (myArrivalPosition != -1) { + // always save original position over view + myPersonTripMove.originalViewPosition = getPositionInView(); + // save arrival position + myPersonTripMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); + // save current centering boundary + myPersonTripMove.movingGeometryBoundary = getCenteringBoundary(); + } +} + + +void +GNEPersonTrip::endGeometryMoving() { + // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once + if ((myArrivalPosition != -1) && myPersonTripMove.movingGeometryBoundary.isInitialised()) { + // reset myMovingGeometryBoundary + myPersonTripMove.movingGeometryBoundary.reset(); + } +} + + +void +GNEPersonTrip::moveGeometry(const Position& offset) { + // only move if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + // Calculate new position using old position + Position newPosition = myPersonTripMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + // obtain lane shape (to improve code legibility) + const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); + // calculate offset lane + double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myPersonTripMove.originalViewPosition, false); + std::cout << offsetLane << std::endl; + // Update arrival Position + myArrivalPosition = parse(myPersonTripMove.firstOriginalLanePosition) + offsetLane; + // Update geometry + updateGeometry(); + } +} + + +void +GNEPersonTrip::commitGeometryMoving(GNEUndoList* undoList) { + // only commit geometry moving if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + undoList->p_begin("arrivalPos of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), myPersonTripMove.firstOriginalLanePosition)); + undoList->p_end(); + } +} + + +void +GNEPersonTrip::updateGeometry() { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // calculate geometry path + if (getPathEdges().size() > 0) { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } else { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + + +void +GNEPersonTrip::updateDottedContour() { + // +} + + +void +GNEPersonTrip::updatePartialGeometry(const GNEEdge* edge) { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // calculate geometry path + GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNEPersonTrip::computePath() { + if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) { + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentEdges())); + } else if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); + } + // update geometry + updateGeometry(); +} + + +void +GNEPersonTrip::invalidatePath() { + if ((myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) || (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP)) { + // calculate route and update routeEdges + replacePathEdges(this, getParentEdges()); + } else if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, fromViaBusStopEdges); + } + // update geometry + updateGeometry(); +} + + +Position +GNEPersonTrip::getPositionInView() const { + return Position(); +} + + +std::string +GNEPersonTrip::getParentName() const { + return getParentDemandElements().front()->getID(); +} + + +Boundary +GNEPersonTrip::getCenteringBoundary() const { + Boundary personTripBoundary; + // return the combination of all parent edges's boundaries + for (const auto& i : getParentEdges()) { + personTripBoundary.add(i->getCenteringBoundary()); + } + // check if is valid + if (personTripBoundary.isInitialised()) { + return personTripBoundary; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNEPersonTrip::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEPersonTrip::drawGL(const GUIVisualizationSettings& /*s*/) const { + // PersonTrips are drawn in GNEEdges +} + + +std::string +GNEPersonTrip::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_FROM: + return getParentEdges().front()->getID(); + case SUMO_ATTR_TO: + return getParentEdges().back()->getID(); + case SUMO_ATTR_VIA: + return toString(getMiddleParentEdges()); + case SUMO_ATTR_BUS_STOP: + return getParentAdditionals().front()->getID(); + case SUMO_ATTR_MODES: + return joinToString(myModes, " "); + case SUMO_ATTR_VTYPES: + return joinToString(myVTypes, " "); + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition == -1) { + return ""; + } else { + return toString(myArrivalPosition); + } + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + case GNE_ATTR_PARENT: + return getParentDemandElements().front()->getID(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEPersonTrip::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition != -1) { + return myArrivalPosition; + } else { + return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPersonTrip::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_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_VIA: + case SUMO_ATTR_BUS_STOP: + case SUMO_ATTR_MODES: + case SUMO_ATTR_VTYPES: + case SUMO_ATTR_ARRIVALPOS: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEPersonTrip::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_VIA: + if (value.empty()) { + return true; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_BUS_STOP: + return (myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); + case SUMO_ATTR_MODES: { + SVCPermissions dummyModeSet; + std::string dummyError; + return SUMOVehicleParameter::parsePersonModes(value, myTagProperty.getTagStr(), getID(), dummyModeSet, dummyError); + } + case SUMO_ATTR_VTYPES: + return canParse >(value); + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + const double parsedValue = canParse(value); + if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { + return false; + } else { + return true; + } + } else { + return false; + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPersonTrip::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNEPersonTrip::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +bool +GNEPersonTrip::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNEPersonTrip::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEPersonTrip::getHierarchyName() const { + if (myTagProperty.getTag() == SUMO_TAG_PERSONTRIP_FROMTO) { + return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); + } else { + return "personTrip: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEPersonTrip::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + // Specific of Trips and flow + case SUMO_ATTR_FROM: { + // change first edge + replaceFirstParentEdge(this, myNet->retrieveEdge(value)); + // compute person trip + computePath(); + break; + } + case SUMO_ATTR_TO: { + // change last edge + replaceLastParentEdge(this, myNet->retrieveEdge(value)); + // compute person trip + computePath(); + break; + } + case SUMO_ATTR_VIA: { + // update via + replaceMiddleParentEdges(this, parse >(myNet, value), true); + // compute person trip + computePath(); + break; + } + case SUMO_ATTR_BUS_STOP: + replaceParentAdditional(this, value, 0); + // compute person trip + computePath(); + break; + case SUMO_ATTR_MODES: + myModes = GNEAttributeCarrier::parse >(value); + break; + case SUMO_ATTR_VTYPES: + myVTypes = GNEAttributeCarrier::parse >(value); + break; + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + myArrivalPosition = -1; + } else { + myArrivalPosition = parse(value); + } + updateGeometry(); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEPersonTrip::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEPersonTrip.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,243 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonTrip.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing person trips in Netedit +/****************************************************************************/ +#pragma once +#include "GNEDemandElement.h" +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; +class GNEConnection; +class GNEVehicle; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEPersonTrip : public GNEDemandElement, public Parameterised { + +public: + /**@brief parameter constructor for person tripEdges + * @param[in] viewNet view in which this PersonTrip is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this person trip + * @param[in] arrivalPosition arrival position on the destination edge + * @param[in] types list of possible vehicle types to take + * @param[in] modes list of possible traffic modes + */ + GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::vector& via, double arrivalPosition, const std::vector& types, + const std::vector& modes); + + /**@brief parameter constructor for person tripBusStop + * @param[in] viewNet view in which this PersonTrip is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this person trip + * @param[in] busStop destination busStop + * @param[in] types list of possible vehicle types to take + * @param[in] modes list of possible traffic modes + */ + GNEPersonTrip(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, + const std::vector& via, const std::vector& types, const std::vector& modes); + + /// @brief destructor + ~GNEPersonTrip(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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; + /// @} + +protected: + /// @brief variable for move person trips + DemandElementMove myPersonTripMove; + + /// @brief arrival position + double myArrivalPosition; + + /// @brief valid line or vehicle types + std::vector myVTypes; + + /// @brief valid line or modes + std::vector myModes; + +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 Invalidated copy constructor. + GNEPersonTrip(GNEPersonTrip*) = delete; + + /// @brief Invalidated assignment operator. + GNEPersonTrip& operator=(GNEPersonTrip*) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERide.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERide.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERide.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERide.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,587 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERide.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing rides in Netedit +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNERide.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, + double arrivalPosition, const std::vector& lines) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_RIDE_FROMTO), net, GLO_RIDE, SUMO_TAG_RIDE_FROMTO, +{}, {fromEdge, toEdge}, {}, {}, {}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myArrivalPosition(arrivalPosition), +myLines(lines) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute ride + computePath(); +} + + +GNERide::GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via, + const std::vector& lines) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_RIDE_BUSSTOP), net, GLO_RIDE, SUMO_TAG_RIDE_BUSSTOP, +{}, {fromEdge}, {}, {}, {busStop}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myArrivalPosition(-1), +myLines(lines) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute ride + computePath(); +} + + +GNERide::~GNERide() {} + + +GUIGLObjectPopupMenu* +GNERide::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open demand element dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + return ret; +} + + +void +GNERide::writeDemandElement(OutputDevice& device) const { + // open tag + device.openTag(SUMO_TAG_RIDE); + // write attributes depending of ride type + if (getParentDemandElements().front()->getChildDemandElements().front() == this) { + device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + } + // check if write busStop or edge to + if (getParentAdditionals().size() > 0) { + device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); + } else { + device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + } + // only write arrivalPos if is different of -1 + if (myArrivalPosition != -1) { + device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); + } + // write parameters + writeParams(device); + // close tag + device.closeTag(); +} + + +bool +GNERide::isDemandElementValid() const { + if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { + // from and to are the same edges + return true; + } else if (getPathEdges().size() > 0) { + // if path edges isn't empty, then there is a valid route + return true; + } else { + return false; + } +} + + +std::string +GNERide::getDemandElementProblem() const { + if (getParentEdges().size() == 0) { + return ("A ride need at least one edge"); + } else { + // check if exist at least a connection between every edge + for (int i = 1; i < (int)getParentEdges().size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { + return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } +} + + +void +GNERide::fixDemandElementProblem() { + // currently the only solution is removing Ride +} + + +GNEEdge* +GNERide::getFromEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getFromEdge(); + } else { + return getParentEdges().front(); + } +} + + +GNEEdge* +GNERide::getToEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getToEdge(); + } else { + return getParentEdges().back(); + } +} + + +SUMOVehicleClass +GNERide::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNERide::getColor() const { + return getParentDemandElements().front()->getColor(); +} + + +void +GNERide::startGeometryMoving() { + // only start geometry moving if arrival position isn't -1 + if (myArrivalPosition != -1) { + // always save original position over view + myRideMove.originalViewPosition = getPositionInView(); + // save arrival position + myRideMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); + // save current centering boundary + myRideMove.movingGeometryBoundary = getCenteringBoundary(); + } +} + + +void +GNERide::endGeometryMoving() { + // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once + if ((myArrivalPosition != -1) && myRideMove.movingGeometryBoundary.isInitialised()) { + // reset myMovingGeometryBoundary + myRideMove.movingGeometryBoundary.reset(); + } +} + + +void +GNERide::moveGeometry(const Position& offset) { + // only move if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + // Calculate new position using old position + Position newPosition = myRideMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + // obtain lane shape (to improve code legibility) + const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); + // calculate offset lane + double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myRideMove.originalViewPosition, false); + std::cout << offsetLane << std::endl; + // Update arrival Position + myArrivalPosition = parse(myRideMove.firstOriginalLanePosition) + offsetLane; + // Update geometry + updateGeometry(); + } +} + + +void +GNERide::commitGeometryMoving(GNEUndoList* undoList) { + // only commit geometry moving if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + undoList->p_begin("arrivalPos of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), myRideMove.firstOriginalLanePosition)); + undoList->p_end(); + } +} + + +void +GNERide::updateGeometry() { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // calculate geometry path + if (getPathEdges().size() > 0) { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } else { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + +void +GNERide::updateDottedContour() { + // +} + + +void +GNERide::updatePartialGeometry(const GNEEdge* edge) { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // calculate geometry path + GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNERide::computePath() { + if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentEdges())); + } else if (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); + } + // update geometry + updateGeometry(); +} + + +void +GNERide::invalidatePath() { + if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { + // calculate route and update routeEdges + replacePathEdges(this, getParentEdges()); + } else if (myTagProperty.getTag() == SUMO_TAG_RIDE_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, fromViaBusStopEdges); + } + // update geometry + updateGeometry(); +} + + +Position +GNERide::getPositionInView() const { + return Position(); +} + + +std::string +GNERide::getParentName() const { + return getParentDemandElements().front()->getID(); +} + + +Boundary +GNERide::getCenteringBoundary() const { + Boundary rideBoundary; + // return the combination of all parent edges's boundaries + for (const auto& i : getParentEdges()) { + rideBoundary.add(i->getCenteringBoundary()); + } + // check if is valid + if (rideBoundary.isInitialised()) { + return rideBoundary; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNERide::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNERide::drawGL(const GUIVisualizationSettings& /*s*/) const { + // Rides are drawn in GNEEdges +} + + +std::string +GNERide::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_FROM: + return getParentEdges().front()->getID(); + case SUMO_ATTR_TO: + return getParentEdges().back()->getID(); + case SUMO_ATTR_VIA: + return toString(getMiddleParentEdges()); + case SUMO_ATTR_BUS_STOP: + return getParentAdditionals().front()->getID(); + case SUMO_ATTR_LINES: + return joinToString(myLines, " "); + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition == -1) { + return ""; + } else { + return toString(myArrivalPosition); + } + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + case GNE_ATTR_PARENT: + return getParentDemandElements().front()->getID(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERide::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition != -1) { + return myArrivalPosition; + } else { + return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERide::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_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_VIA: + case SUMO_ATTR_BUS_STOP: + case SUMO_ATTR_LINES: + case SUMO_ATTR_ARRIVALPOS: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERide::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_VIA: + if (value.empty()) { + return true; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_BUS_STOP: + return (myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); + case SUMO_ATTR_LINES: + return canParse >(value); + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + const double parsedValue = canParse(value); + if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { + return false; + } else { + return true; + } + } else { + return false; + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERide::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNERide::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +bool +GNERide::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNERide::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNERide::getHierarchyName() const { + if (myTagProperty.getTag() == SUMO_TAG_RIDE_FROMTO) { + return "ride: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); + } else { + return "ride: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNERide::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + // Specific of Trips and flow + case SUMO_ATTR_FROM: { + // change first edge + replaceFirstParentEdge(this, myNet->retrieveEdge(value)); + // compute ride + computePath(); + break; + } + case SUMO_ATTR_TO: { + // change last edge + replaceLastParentEdge(this, myNet->retrieveEdge(value)); + // compute ride + computePath(); + break; + } + case SUMO_ATTR_VIA: { + // update via + replaceMiddleParentEdges(this, parse >(myNet, value), true); + // compute ride + computePath(); + break; + } + case SUMO_ATTR_BUS_STOP: + replaceParentAdditional(this, value, 0); + // compute ride + computePath(); + break; + case SUMO_ATTR_LINES: + myLines = GNEAttributeCarrier::parse >(value); + break; + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + myArrivalPosition = -1; + } else { + myArrivalPosition = parse(value); + } + updateGeometry(); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERide::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERide.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERide.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERide.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERide.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,235 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERide.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing rides in Netedit +/****************************************************************************/ +#pragma once +#include "GNEDemandElement.h" +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; +class GNEConnection; +class GNEVehicle; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNERide : public GNEDemandElement, public Parameterised { + +public: + /**@brief parameter constructor for rideEdges + * @param[in] viewNet view in which this Ride is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this ride + * @param[in] arrivalPosition arrival position on the destination edge + */ + GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::vector& via, double arrivalPosition, const std::vector& lines); + + /**@brief parameter constructor for rideBusStop + * @param[in] viewNet view in which this Ride is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this ride + * @param[in] busStop destination busStop + */ + GNERide(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, + const std::vector& via, const std::vector& lines); + + /// @brief destructor + ~GNERide(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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; + /// @} + +protected: + /// @brief variable for move rides + DemandElementMove myRideMove; + + /// @brief arrival position + double myArrivalPosition; + + /// @brief valid line or vehicle ids or ANY + std::vector myLines; + +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 Invalidated copy constructor. + GNERide(GNERide*) = delete; + + /// @brief Invalidated assignment operator. + GNERide& operator=(GNERide*) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERoute.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERoute.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERoute.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERoute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,502 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERoute.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// A class for visualizing routes in Netedit +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNERoute.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +FXDEFMAP(GNERoute::GNERoutePopupMenu) GNERoutePopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTE_APPLY_DISTANCE, GNERoute::GNERoutePopupMenu::onCmdApplyDistance), +}; + +// Object implementation +FXIMPLEMENT(GNERoute::GNERoutePopupMenu, GUIGLObjectPopupMenu, GNERoutePopupMenuMap, ARRAYNUMBER(GNERoutePopupMenuMap)) + +// =========================================================================== +// GNERoute::GNERoutePopupMenu - methods +// =========================================================================== + +GNERoute::GNERoutePopupMenu::GNERoutePopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o) : + GUIGLObjectPopupMenu(app, parent, o) { +} + + +GNERoute::GNERoutePopupMenu::~GNERoutePopupMenu() {} + + +long +GNERoute::GNERoutePopupMenu::onCmdApplyDistance(FXObject*, FXSelector, void*) { + GNERoute* route = static_cast(myObject); + GNEUndoList* undoList = route->myNet->getViewNet()->getUndoList(); + undoList->p_begin("apply distance along route"); + double dist = (route->getParentEdges().size() > 0) ? route->getParentEdges().front()->getNBEdge()->getDistance() : 0; + for (GNEEdge* edge : route->getParentEdges()) { + undoList->p_add(new GNEChange_Attribute(edge, SUMO_ATTR_DISTANCE, toString(dist), edge->getAttribute(SUMO_ATTR_DISTANCE))); + dist += edge->getNBEdge()->getFinalLength(); + } + undoList->p_end(); + return 1; +} + +// =========================================================================== +// GNERoute - methods +// =========================================================================== + +GNERoute::GNERoute(GNENet* net) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_ROUTE), net, GLO_ROUTE, SUMO_TAG_ROUTE, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myColor(RGBColor::YELLOW), +myVClass(SVC_PASSENGER) { +} + + +GNERoute::GNERoute(GNENet* net, const GNERouteHandler::RouteParameter& routeParameters) : + GNEDemandElement(routeParameters.routeID, net, GLO_ROUTE, SUMO_TAG_ROUTE, +{}, routeParameters.edges, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(routeParameters.parameters), +myColor(routeParameters.color), +myVClass(routeParameters.vClass) { +} + + +GNERoute::GNERoute(GNENet* net, GNEDemandElement* vehicleParent, const GNERouteHandler::RouteParameter& routeParameters) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_EMBEDDEDROUTE), net, GLO_EMBEDDEDROUTE, SUMO_TAG_EMBEDDEDROUTE, +{}, routeParameters.edges, {}, {}, {}, {vehicleParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(routeParameters.parameters), +myColor(routeParameters.color), +myVClass(routeParameters.vClass) { +} + + +GNERoute::GNERoute(GNEDemandElement* route) : + GNEDemandElement(route->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE), route->getNet(), GLO_ROUTE, SUMO_TAG_ROUTE, +{}, route->getParentEdges(), {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +Parameterised(), +myColor(route->getColor()), +myVClass(route->getVClass()) { +} + + +GNERoute::~GNERoute() {} + + +GUIGLObjectPopupMenu* +GNERoute::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GNERoutePopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open demand element dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + new FXMenuSeparator(ret); + new FXMenuCommand(ret, "Apply distance along route", nullptr, ret, MID_GNE_ROUTE_APPLY_DISTANCE); + return ret; +} + + +void +GNERoute::writeDemandElement(OutputDevice& device) const { + device.openTag(SUMO_TAG_ROUTE); + device.writeAttr(SUMO_ATTR_EDGES, parseIDs(getParentEdges())); + device.writeAttr(SUMO_ATTR_COLOR, toString(myColor)); + // write extra attributes depending if is an embedded route + 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); + } + } + } + // write parameters + writeParams(device); + // close tag + device.closeTag(); +} + + +bool +GNERoute::isDemandElementValid() const { + if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { + // from and to are the same edges, then return true + return true; + } else if (getParentEdges().size() > 0) { + // check that exist a connection between every edge + return isRouteValid(getParentEdges()).empty(); + } else { + return false; + } +} + + +std::string +GNERoute::getDemandElementProblem() const { + // return string with the problem obtained from isRouteValid + return isRouteValid(getParentEdges()); +} + + +void +GNERoute::fixDemandElementProblem() { + // currently the only solution is removing Route +} + + +GNEEdge* +GNERoute::getFromEdge() const { + return getParentEdges().front(); +} + + +GNEEdge* +GNERoute::getToEdge() const { + return getParentEdges().back(); +} + + +SUMOVehicleClass +GNERoute::getVClass() const { + return myVClass; +} + + +const RGBColor& +GNERoute::getColor() const { + return myColor; +} + + +void +GNERoute::startGeometryMoving() { + // Routes cannot be moved +} + + +void +GNERoute::endGeometryMoving() { + // Routes cannot be moved +} + + +void +GNERoute::moveGeometry(const Position&) { + // Routes cannot be moved +} + + +void +GNERoute::commitGeometryMoving(GNEUndoList*) { + // Routes cannot be moved +} + + +void +GNERoute::updateGeometry() { + // calculate geometry path + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), + getVClass(), getFirstAllowedVehicleLane(), getLastAllowedVehicleLane()); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) { + i->updateGeometry(); + } + } +} + + +void +GNERoute::updateDottedContour() { + // +} + + +void +GNERoute::updatePartialGeometry(const GNEEdge* edge) { + // calculate geometry path + GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + if (!i->getTagProperty().isPersonStop() && !i->getTagProperty().isStop()) { + i->updatePartialGeometry(edge); + } + } +} + + +void +GNERoute::computePath() { + // nothing to compute +} + + +void +GNERoute::invalidatePath() { + // nothing to invalidate +} + + +Position +GNERoute::getPositionInView() const { + return Position(); +} + + +std::string +GNERoute::getParentName() const { + return getParentEdges().front()->getID(); +} + + +Boundary +GNERoute::getCenteringBoundary() const { + Boundary routeBoundary; + // return the combination of all parent edges's boundaries + for (const auto& i : getParentEdges()) { + routeBoundary.add(i->getCenteringBoundary()); + } + // check if is valid + if (routeBoundary.isInitialised()) { + return routeBoundary; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNERoute::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) { + // check that both network elementes are edges + if ((originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && + (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { + // obtain new list of route edges + std::string newRouteEdges = getNewListOfParents(originalElement, newElement); + // update route edges + if (newRouteEdges.size() > 0) { + setAttribute(SUMO_ATTR_EDGES, newRouteEdges, undoList); + } + } +} + + +void +GNERoute::drawGL(const GUIVisualizationSettings& /*s*/) const { + // Routes are drawn in GNEEdges +} + + +std::string +GNERoute::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_EDGES: + return parseIDs(getParentEdges()); + case SUMO_ATTR_COLOR: + return toString(myColor); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNERoute::getAttributeDouble(SumoXMLAttr /*key*/) const { + return 0; +} + + +void +GNERoute::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: + case SUMO_ATTR_EDGES: + case SUMO_ATTR_COLOR: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNERoute::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return isValidDemandElementID(value); + case SUMO_ATTR_EDGES: + if (canParse >(myNet, value, false)) { + // all edges exist, then check if compounds a valid route + return isRouteValid(parse >(myNet, value)).empty(); + } else { + return false; + } + case SUMO_ATTR_COLOR: + return canParse(value); + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERoute::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNERoute::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +bool +GNERoute::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNERoute::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNERoute::getHierarchyName() const { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) ; +} + + +std::string +GNERoute::isRouteValid(const std::vector& edges) { + if (edges.size() == 0) { + // routes cannot be empty + return ("list of route edges cannot be empty"); + } else if (edges.size() == 1) { + // routes with a single edge are valid, then return an empty string + return (""); + } else { + // iterate over edges to check that compounds a chain + auto it = edges.begin(); + while (it != edges.end() - 1) { + const GNEEdge* currentEdge = *it; + const GNEEdge* nextEdge = *(it + 1); + // same consecutive edges aren't allowed + if (currentEdge->getID() == nextEdge->getID()) { + return ("consecutive duplicated edges (" + currentEdge->getID() + ") aren't allowed in a route"); + } + // obtain outgoing edges of currentEdge + const std::vector& outgoingEdges = currentEdge->getGNEJunctionDestiny()->getGNEOutgoingEdges(); + // check if nextEdge is in outgoingEdges + if (std::find(outgoingEdges.begin(), outgoingEdges.end(), nextEdge) == outgoingEdges.end()) { + return ("Edges '" + currentEdge->getID() + "' and '" + nextEdge->getID() + "' aren't consecutives"); + } + it++; + } + // all edges consecutives, then return an empty string + return (""); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNERoute::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_EDGES: + replaceParentEdges(this, value); + // compute route + updateGeometry(); + break; + case SUMO_ATTR_COLOR: + myColor = parse(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNERoute::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERoute.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERoute.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERoute.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERoute.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,269 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERoute.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// A class for visualizing routes in Netedit +/****************************************************************************/ +#pragma once +#include + +#include "GNEDemandElement.h" +#include "GNERouteHandler.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; +class GNEConnection; +class GNEVehicle; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNERoute : public GNEDemandElement, public Parameterised { + +public: + + /// @brief class used in GUIGLObjectPopupMenu for routes + class GNERoutePopupMenu : public GUIGLObjectPopupMenu { + FXDECLARE(GNERoutePopupMenu) + + public: + /** @brief Constructor + * @param[in] app The main window for instantiation of other windows + * @param[in] parent The parent view for changing it + * @param[in] o The object of interest + * @param[in, out] additionalVisualizations Information which additional visualisations are enabled (per view) + */ + GNERoutePopupMenu(GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o); + + /// @brief Destructor + ~GNERoutePopupMenu(); + + /// @brief Called to modify edge distance values along the route + long onCmdApplyDistance(FXObject*, FXSelector, void*); + + protected: + /// @brief default constructor needed by FOX + GNERoutePopupMenu() {} + }; + + /**@brief default constructor + * @param[in] viewNet view in which this Route is placed + */ + GNERoute(GNENet* net); + + /**@brief parameter constructor + * @param[in] viewNet view in which this Route is placed + * @param[in] routeParameters route parameters + */ + GNERoute(GNENet* net, const GNERouteHandler::RouteParameter& routeParameters); + + /**@brief parameter constructor for embedded routes + * @param[in] viewNet view in which this Route is placed + * @param[in] vehicleParent vehicle parent of this embedded route + * @param[in] routeParameters route parameters + */ + GNERoute(GNENet* net, GNEDemandElement* vehicleParent, const GNERouteHandler::RouteParameter& routeParameters); + + /// @brief copy constructor (used to create a route based on the parameters of other GNERoute) + GNERoute(GNEDemandElement* route); + + /// @brief destructor + ~GNERoute(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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 check if a route is valid + * @param[in] edges vector with the route's edges + * @return an empty string if route is valid, or a string with the problem + */ + static std::string isRouteValid(const std::vector& edges); + +protected: + /// @brief route color + RGBColor myColor; + + /// @brief SUMOVehicleClass (Only used for drawing) + SUMOVehicleClass myVClass; + +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 Invalidated copy constructor. + GNERoute(GNERoute*) = delete; + + /// @brief Invalidated assignment operator. + GNERoute& operator=(GNERoute*) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,2013 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteHandler.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// Builds demand objects for netedit +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPerson.h" +#include "GNEPersonTrip.h" +#include "GNERide.h" +#include "GNERoute.h" +#include "GNERouteHandler.h" +#include "GNEStop.h" +#include "GNEVehicle.h" +#include "GNEVehicleType.h" +#include "GNEWalk.h" + + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNERouteHandler::RouteParameter - methods +// --------------------------------------------------------------------------- + +GNERouteHandler::RouteParameter::RouteParameter() : + loadedID(false), + vClass(SVC_PASSENGER), + color(RGBColor::BLACK) { +} + + +GNERouteHandler::RouteParameter::RouteParameter(GNEDemandElement* originalDemandElement) : + routeID(originalDemandElement->getTagProperty().isRoute() ? + originalDemandElement->getID() : + originalDemandElement->getNet()->generateDemandElementID(originalDemandElement->getID(), SUMO_TAG_ROUTE)), + loadedID(false), + edges(originalDemandElement->getParentEdges()), + vClass(originalDemandElement->getVClass()), + color(originalDemandElement->getColor()) { +} + + +void +GNERouteHandler::RouteParameter::setEdges(GNENet* net, const std::string& edgeIDs) { + // clear edges + edges.clear(); + // obtain edges (And show warnings if isn't valid) + if (GNEAttributeCarrier::canParse >(net, edgeIDs, true)) { + edges = GNEAttributeCarrier::parse >(net, edgeIDs); + } +} + + +void +GNERouteHandler::RouteParameter::setEdges(GNENet* net, const std::string& vehicleID, const std::string& fromID, const std::string& toID, const std::string& viaIDs) { + // clear edges + edges.clear(); + // only continue if at least one of the edges is defined + if (fromID.size() + toID.size() > 0) { + // obtain from and to edges + GNEEdge* from = net->retrieveEdge(fromID, false); + GNEEdge* to = net->retrieveEdge(toID, false); + // check if edges are valid + if (from == nullptr) { + WRITE_ERROR("Invalid from-edge '" + fromID + "' used in trip '" + vehicleID + "'."); + } else if (to == nullptr) { + WRITE_ERROR("Invalid to-edge '" + toID + "' used in trip '" + vehicleID + "'."); + } else if (!GNEAttributeCarrier::canParse >(net, viaIDs, false)) { + WRITE_ERROR("Invalid 'via' edges used in trip '" + vehicleID + "'."); + } else { + // obtain via + std::vector viaEdges = GNEAttributeCarrier::parse >(net, viaIDs); + // build edges (from - via - to) + edges.push_back(from); + for (const auto& i : viaEdges) { + edges.push_back(i); + } + // check that from and to edge are different + if (from != to) { + edges.push_back(to); + } + } + } +} + + +void +GNERouteHandler::RouteParameter::clearEdges() { + edges.clear(); +} + +// --------------------------------------------------------------------------- +// GNERouteHandler - methods +// --------------------------------------------------------------------------- + +GNERouteHandler::GNERouteHandler(const std::string& file, GNENet* net, bool undoDemandElements) : + SUMORouteHandler(file, "", false), + myNet(net), + myUndoDemandElements(undoDemandElements), + myLoadedVehicleWithEmbebbedRoute(nullptr), + myAbort(false) { +} + + +GNERouteHandler::~GNERouteHandler() {} + + +bool +GNERouteHandler::isVehicleIdDuplicated(GNENet* net, const std::string& id) { + for (SumoXMLTag vehicleTag : std::vector({SUMO_TAG_VEHICLE, SUMO_TAG_TRIP, SUMO_TAG_ROUTEFLOW, SUMO_TAG_FLOW})) { + if (net->retrieveDemandElement(vehicleTag, id, false) != nullptr) { + WRITE_ERROR("There is another " + toString(vehicleTag) + " with the same ID='" + id + "'."); + return true; + } + } + return false; +} + + +bool +GNERouteHandler::isPersonIdDuplicated(GNENet* net, const std::string& id) { + for (SumoXMLTag personTag : std::vector({SUMO_TAG_PERSON, SUMO_TAG_PERSONFLOW})) { + if (net->retrieveDemandElement(personTag, id, false) != nullptr) { + WRITE_ERROR("There is another " + toString(personTag) + " with the same ID='" + id + "'."); + return true; + } + } + return false; +} + + +void +GNERouteHandler::buildVehicleOverRoute(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters) { + // Check tag + assert(vehicleParameters.tag == SUMO_TAG_VEHICLE); + // first check if ID is duplicated + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain routes and vtypes + GNEDemandElement* vType = net->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); + GNEDemandElement* route = net->retrieveDemandElement(SUMO_TAG_ROUTE, vehicleParameters.routeid, false); + if (vType == nullptr) { + WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else if (route == nullptr) { + WRITE_ERROR("Invalid route '" + vehicleParameters.routeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)route->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // create vehicle using vehicleParameters + GNEVehicle* vehicle = new GNEVehicle(net, vType, route, vehicleParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + vehicle->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, true, i, vehicle); + } + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(vehicle); + // set vehicle as child of vType and Route + vType->addChildDemandElement(vehicle); + route->addChildDemandElement(vehicle); + vehicle->incRef("buildVehicleOverRoute"); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, false, i, vehicle); + } + } + } + } +} + + +void +GNERouteHandler::buildFlowOverRoute(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters) { + // Check tag + assert(vehicleParameters.tag == SUMO_TAG_ROUTEFLOW); + // first check if ID is duplicated + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain routes and vtypes + GNEDemandElement* vType = net->retrieveDemandElement(SUMO_TAG_VTYPE, vehicleParameters.vtypeid, false); + GNEDemandElement* route = net->retrieveDemandElement(SUMO_TAG_ROUTE, vehicleParameters.routeid, false); + if (vType == nullptr) { + WRITE_ERROR("Invalid vehicle type '" + vehicleParameters.vtypeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else if (route == nullptr) { + WRITE_ERROR("Invalid route '" + vehicleParameters.routeid + "' used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'."); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)route->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // create flow or trips using vehicleParameters + GNEVehicle* flow = new GNEVehicle(net, vType, route, vehicleParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + flow->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, true, i, flow); + } + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(flow); + // set flow as child of vType and Route + vType->addChildDemandElement(flow); + route->addChildDemandElement(flow); + flow->incRef("buildFlowOverRoute"); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, false, i, flow); + } + } + } + } +} + + +void +GNERouteHandler::buildVehicleWithEmbeddedRoute(GNENet* net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy) { + // Check tags + assert(vehicleParameters.tag == SUMO_TAG_VEHICLE); + // first check if ID is duplicated + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain vType + GNEDemandElement* vType = net->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)embeddedRouteCopy->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // generate a new route ID and add it to vehicleParameters + vehicleParameters.routeid = net->generateDemandElementID(vehicleParameters.id, SUMO_TAG_ROUTE); + // due vehicle was loaded without a route, change tag + vehicleParameters.tag = SUMO_TAG_VEHICLE; + // create vehicle or trips using myTemporalVehicleParameter without a route + GNEVehicle* vehicle = new GNEVehicle(net, vType, vehicleParameters); + // creaste embedded route + GNERoute* embeddedRoute = new GNERoute(net, vehicle, RouteParameter(embeddedRouteCopy)); + // add both to net depending of myUndoDemandElements + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); + // add both in net using undoList + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vehicle, true), true); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrRouteFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(vehicle); + // set vehicle as child of vType + vType->addChildDemandElement(vehicle); + vehicle->incRef("buildVehicleWithEmbeddedRoute"); + // add route manually in net, and in all of their edges and in vehicleOrRouteFlow + net->getAttributeCarriers()->insertDemandElement(embeddedRoute); + for (const auto& i : embeddedRouteCopy->getParentEdges()) { + i->addChildDemandElement(vehicle); + } + // set route as child of vehicle + vehicle->addChildDemandElement(embeddedRoute); + embeddedRoute->incRef("buildVehicleWithEmbeddedRoute"); + } + } + } +} + + +void +GNERouteHandler::buildFlowWithEmbeddedRoute(GNENet* net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy) { + // Check tags + assert(vehicleParameters.tag == SUMO_TAG_ROUTEFLOW); + // first check if ID is duplicated + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain vType + GNEDemandElement* vType = net->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)embeddedRouteCopy->getParentEdges().front()->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // generate a new route ID and add it to vehicleParameters + vehicleParameters.routeid = net->generateDemandElementID(vehicleParameters.id, SUMO_TAG_ROUTE); + // due vehicle was loaded without a route, change tag + vehicleParameters.tag = SUMO_TAG_ROUTEFLOW; + // create vehicle or trips using myTemporalVehicleParameter without a route + GNEVehicle* flow = new GNEVehicle(net, vType, vehicleParameters); + // creaste embedded route + GNERoute* embeddedRoute = new GNERoute(net, flow, RouteParameter(embeddedRouteCopy)); + // add both to net depending of myUndoDemandElements + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); + // add both in net using undoList + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrRouteFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(flow); + // set vehicle as child of vType + vType->addChildDemandElement(flow); + flow->incRef("buildFlowWithEmbeddedRoute"); + // add route manually in net, and in all of their edges and in vehicleOrRouteFlow + net->getAttributeCarriers()->insertDemandElement(embeddedRoute); + for (const auto& i : embeddedRouteCopy->getParentEdges()) { + i->addChildDemandElement(flow); + } + // set route as child of flow + flow->addChildDemandElement(embeddedRoute); + embeddedRoute->incRef("buildFlowWithEmbeddedRoute"); + } + } + } +} + + +void +GNERouteHandler::buildTrip(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via) { + // Check tag + assert(vehicleParameters.tag == SUMO_TAG_TRIP); + // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain vtypes + GNEDemandElement* vType = net->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && ((vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN)) && ((int)fromEdge->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // add "via" edges in vehicleParameters + for (const auto& viaEdge : via) { + vehicleParameters.via.push_back(viaEdge->getID()); + } + // create trip or flow using tripParameters + GNEVehicle* trip = new GNEVehicle(net, vType, fromEdge, toEdge, via, vehicleParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + trip->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(trip, true), true); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, true, i, trip); + } + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(trip); + // set vehicle as child of vType + vType->addChildDemandElement(trip); + trip->incRef("buildTrip"); + // add reference in all edges + fromEdge->addChildDemandElement(trip); + toEdge->addChildDemandElement(trip); + for (const auto& viaEdge : via) { + viaEdge->addChildDemandElement(trip); + } + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, false, i, trip); + } + } + } + } +} + + +void +GNERouteHandler::buildFlow(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via) { + // Check tag + assert(vehicleParameters.tag == SUMO_TAG_FLOW); + // check if exist another vehicle with the same ID (note: Vehicles, Flows and Trips share namespace) + if (!isVehicleIdDuplicated(net, vehicleParameters.id)) { + // obtain vtypes + GNEDemandElement* vType = net->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 if (vehicleParameters.wasSet(VEHPARS_DEPARTLANE_SET) && (vehicleParameters.departLaneProcedure == DEPART_LANE_GIVEN) && ((int)fromEdge->getLanes().size() < vehicleParameters.departLane)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTLANE) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departLane) + " is greater than number of lanes"); + } else if (vehicleParameters.wasSet(VEHPARS_DEPARTSPEED_SET) && (vehicleParameters.departSpeedProcedure == DEPART_SPEED_GIVEN) && (vType->getAttributeDouble(SUMO_ATTR_MAXSPEED) < vehicleParameters.departSpeed)) { + WRITE_ERROR("Invalid " + toString(SUMO_ATTR_DEPARTSPEED) + " used in " + toString(vehicleParameters.tag) + " '" + vehicleParameters.id + "'. " + toString(vehicleParameters.departSpeed) + " is greater than vType" + toString(SUMO_ATTR_MAXSPEED)); + } else { + // add "via" edges in vehicleParameters + for (const auto& viaEdge : via) { + vehicleParameters.via.push_back(viaEdge->getID()); + } + // create trip or flow using tripParameters + GNEVehicle* flow = new GNEVehicle(net, vType, fromEdge, toEdge, via, vehicleParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + flow->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(flow, true), true); + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, true, i, flow); + } + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(flow); + // set vehicle as child of vType + vType->addChildDemandElement(flow); + flow->incRef("buildFlow"); + // add reference in all edges + fromEdge->addChildDemandElement(flow); + toEdge->addChildDemandElement(flow); + for (const auto& viaEdge : via) { + viaEdge->addChildDemandElement(flow); + } + // iterate over stops of vehicleParameters and create stops associated with it + for (const auto& i : vehicleParameters.stops) { + buildStop(net, false, i, flow); + } + } + } + } +} + + +void +GNERouteHandler::buildStop(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter::Stop& stopParameters, GNEDemandElement* stopParent) { + // declare pointers to stopping place and lane and obtain it + GNEAdditional* stoppingPlace = nullptr; + GNELane* lane = nullptr; + SumoXMLTag stopTagType = SUMO_TAG_NOTHING; + bool validParentDemandElement = true; + if (stopParameters.busstop.size() > 0) { + stoppingPlace = net->retrieveAdditional(SUMO_TAG_BUS_STOP, stopParameters.busstop, false); + // distinguish between stop for vehicles and stops for persons + if (stopParent->getTagProperty().isPerson()) { + stopTagType = SUMO_TAG_PERSONSTOP_BUSSTOP; + } else { + stopTagType = SUMO_TAG_STOP_BUSSTOP; + } + } else if (stopParameters.containerstop.size() > 0) { + stoppingPlace = net->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, stopParameters.containerstop, false); + // distinguish between stop for vehicles and stops for persons + if (stopParent->getTagProperty().isPerson()) { + WRITE_ERROR("Persons doesn't support stops over container stops"); + validParentDemandElement = false; + } else { + stopTagType = SUMO_TAG_STOP_CONTAINERSTOP; + } + } else if (stopParameters.chargingStation.size() > 0) { + stoppingPlace = net->retrieveAdditional(SUMO_TAG_CHARGING_STATION, stopParameters.chargingStation, false); + // distinguish between stop for vehicles and stops for persons + if (stopParent->getTagProperty().isPerson()) { + WRITE_ERROR("Persons doesn't support stops over charging stations"); + validParentDemandElement = false; + } else { + stopTagType = SUMO_TAG_STOP_CHARGINGSTATION; + } + } else if (stopParameters.parkingarea.size() > 0) { + stoppingPlace = net->retrieveAdditional(SUMO_TAG_PARKING_AREA, stopParameters.parkingarea, false); + // distinguish between stop for vehicles and stops for persons + if (stopParent->getTagProperty().isPerson()) { + WRITE_ERROR("Persons doesn't support stops over parking areas"); + validParentDemandElement = false; + } else { + stopTagType = SUMO_TAG_STOP_PARKINGAREA; + } + } else if (stopParameters.lane.size() > 0) { + lane = net->retrieveLane(stopParameters.lane, false); + // distinguish between stop for vehicles and stops for persons + if (stopParent->getTagProperty().isPerson()) { + stopTagType = SUMO_TAG_PERSONSTOP_LANE; + } else { + stopTagType = SUMO_TAG_STOP_LANE; + } + } + // first check that parent is valid + if (validParentDemandElement) { + // check if values are correct + if (stoppingPlace && lane) { + WRITE_ERROR("A stop must be defined either over a stoppingPlace or over a lane"); + } else if (!stoppingPlace && !lane) { + WRITE_ERROR("A stop requires a stoppingPlace or a lane"); + } else if (stoppingPlace) { + // create stop using stopParameters and stoppingPlace + GNEStop* stop = new GNEStop(stopTagType, net, stopParameters, stoppingPlace, stopParent); + // add it depending of undoDemandElements + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + stop->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(stop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(stop); + stoppingPlace->addChildDemandElement(stop); + stopParent->addChildDemandElement(stop); + stop->incRef("buildStoppingPlaceStop"); + } + } else { + // create stop using stopParameters and lane + GNEStop* stop = new GNEStop(net, stopParameters, lane, stopParent); + // add it depending of undoDemandElements + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + stop->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(stop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(stop); + lane->addChildDemandElement(stop); + stopParent->addChildDemandElement(stop); + stop->incRef("buildLaneStop"); + } + } + } +} + + +void +GNERouteHandler::buildPerson(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& personParameters) { + // first check if ID is duplicated + if (!isPersonIdDuplicated(net, personParameters.id)) { + // obtain routes and vtypes + GNEDemandElement* pType = net->retrieveDemandElement(SUMO_TAG_PTYPE, personParameters.vtypeid, false); + if (pType == nullptr) { + WRITE_ERROR("Invalid person type '" + personParameters.vtypeid + "' used in " + toString(personParameters.tag) + " '" + personParameters.id + "'."); + } else { + // create person using personParameters + GNEPerson* person = new GNEPerson(SUMO_TAG_PERSON, net, pType, personParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + person->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(person, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(person); + // set person as child of pType and Route + pType->addChildDemandElement(person); + person->incRef("buildPerson"); + } + } + } +} + + +void +GNERouteHandler::buildPersonFlow(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& personFlowParameters) { + // first check if ID is duplicated + if (!isPersonIdDuplicated(net, personFlowParameters.id)) { + // obtain routes and vtypes + GNEDemandElement* pType = net->retrieveDemandElement(SUMO_TAG_PTYPE, personFlowParameters.vtypeid, false); + if (pType == nullptr) { + WRITE_ERROR("Invalid personFlow type '" + personFlowParameters.vtypeid + "' used in " + toString(personFlowParameters.tag) + " '" + personFlowParameters.id + "'."); + } else { + // create personFlow using personFlowParameters + GNEPerson* personFlow = new GNEPerson(SUMO_TAG_PERSONFLOW, net, pType, personFlowParameters); + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + personFlow->getTagStr()); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(personFlow, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + net->getAttributeCarriers()->insertDemandElement(personFlow); + // set personFlow as child of pType and Route + pType->addChildDemandElement(personFlow); + personFlow->incRef("buildPersonFlow"); + } + } + } +} + + +void +GNERouteHandler::buildPersonTripFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos, + const std::vector& types, const std::vector& modes) { + // create personTripFromTo + GNEPersonTrip* personTripFromTo = new GNEPersonTrip(net, personParent, fromEdge, toEdge, {}, arrivalPos, types, modes); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_PERSONTRIP_FROMTO) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(personTripFromTo, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrPersonTripFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(personTripFromTo); + personParent->addChildDemandElement(personTripFromTo); + personTripFromTo->incRef("buildPersonTripFromTo"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildPersonTripBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, + const std::vector& types, const std::vector& modes) { + // create personTripBusStop + GNEPersonTrip* personTripBusStop = new GNEPersonTrip(net, personParent, fromEdge, busStop, {}, types, modes); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_PERSONTRIP_BUSSTOP) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(personTripBusStop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrPersonTripFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(personTripBusStop); + personParent->addChildDemandElement(personTripBusStop); + busStop->addChildDemandElement(personTripBusStop); + fromEdge->addChildDemandElement(personTripBusStop); + personTripBusStop->incRef("buildPersonTripBusStop"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildWalkEdges(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, const std::vector& edges, double arrivalPos) { + // check that at least there is an edge + if (edges.size() == 0) { + WRITE_ERROR("A walk needs at least one edge. " + toString(SUMO_TAG_WALK_EDGES) + " within person with ID='" + personParent->getID() + "' cannot be created"); + } else { + // obtain path between edges + std::vector pathEdges = net->getPathCalculator()->calculatePath(personParent->getVClass(), edges); + // check if obtained path is valid + if (pathEdges.size() == 0) { + pathEdges = edges; + } + // create walkEdges + GNEWalk* walkEdges = new GNEWalk(net, personParent, pathEdges, arrivalPos); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_EDGES) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(walkEdges, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrWalkEdgesFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(walkEdges); + personParent->addChildDemandElement(walkEdges); + // add reference in all edges + for (const auto& i : edges) { + i->addChildDemandElement(walkEdges); + } + walkEdges->incRef("buildWalkEdges"); + } + // update geometry + personParent->updateGeometry(); + } +} + + +void +GNERouteHandler::buildWalkFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos) { + // create walkFromTo + GNEWalk* walkFromTo = new GNEWalk(net, personParent, fromEdge, toEdge, {}, arrivalPos); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_FROMTO) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(walkFromTo, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrWalkFromToFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(walkFromTo); + personParent->addChildDemandElement(walkFromTo); + // add reference in all edges + fromEdge->addChildDemandElement(walkFromTo); + toEdge->addChildDemandElement(walkFromTo); + walkFromTo->incRef("buildWalkFromTo"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildWalkBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop) { + // create walkBusStop + GNEWalk* walkBusStop = new GNEWalk(net, personParent, fromEdge, busStop, {}); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_BUSSTOP) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(walkBusStop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrWalkBusStopFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(walkBusStop); + personParent->addChildDemandElement(walkBusStop); + busStop->addChildDemandElement(walkBusStop); + fromEdge->addChildDemandElement(walkBusStop); + walkBusStop->incRef("buildWalkBusStop"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildWalkRoute(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEDemandElement* route, double arrivalPos) { + // create walkRoute + GNEWalk* walkRoute = new GNEWalk(net, personParent, route, arrivalPos); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_WALK_ROUTE) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(walkRoute, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrWalkBusStopFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(walkRoute); + personParent->addChildDemandElement(walkRoute); + route->addChildDemandElement(walkRoute); + walkRoute->incRef("buildWalkRoute"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildRideFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& lines, double arrivalPos) { + // create rideFromTo + GNERide* rideFromTo = new GNERide(net, personParent, fromEdge, toEdge, {}, arrivalPos, lines); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_RIDE_FROMTO) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(rideFromTo, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrRideFromToFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(rideFromTo); + personParent->addChildDemandElement(rideFromTo); + // add reference in all edges + fromEdge->addChildDemandElement(rideFromTo); + toEdge->addChildDemandElement(rideFromTo); + rideFromTo->incRef("buildRideFromTo"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::buildRideBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& lines) { + // create rideBusStop + GNERide* rideBusStop = new GNERide(net, personParent, fromEdge, busStop, {}, lines); + // add element using undo list or directly, depending of undoDemandElements flag + if (undoDemandElements) { + net->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_RIDE_BUSSTOP) + " within person '" + personParent->getID() + "'"); + net->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(rideBusStop, true), true); + net->getViewNet()->getUndoList()->p_end(); + } else { + // add vehicleOrRideBusStopFlow in net and in their vehicle type parent + net->getAttributeCarriers()->insertDemandElement(rideBusStop); + personParent->addChildDemandElement(rideBusStop); + busStop->addChildDemandElement(rideBusStop); + // add reference in first edge + fromEdge->addChildDemandElement(rideBusStop); + rideBusStop->incRef("buildRideBusStop"); + } + // update geometry + personParent->updateGeometry(); +} + + +void +GNERouteHandler::transformToVehicle(GNEVehicle* originalVehicle, bool createEmbeddedRoute) { + // first check that given vehicle isn't already a vehicle + if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_VEHICLE) { + // get pointer to undo list (due originalVehicle will be deleted) + GNEUndoList* undoList = originalVehicle->getNet()->getViewNet()->getUndoList(); + // begin undo-redo operation + undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_VEHICLE)); + // declare flag to save if vehicle is selected + bool selected = originalVehicle->isAttributeCarrierSelected(); + // first check if originalVehicle has an embedded route, and if true, separate it + if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && + (originalVehicle->getParentDemandElements().size() == 1)) { + originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); + } + // obtain VType of original vehicle + GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); + // extract vehicleParameters of originalVehicle + SUMOVehicleParameter newVehicleParameters = *originalVehicle; + // change tag in newVehicleParameters (needed for GNEVehicle constructor) + newVehicleParameters.tag = SUMO_TAG_VEHICLE; + // make transformation depending of vehicle tag + if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { + // obtain vehicle's route (it always exist due call to function separateEmbeddedRoute(...) + GNEDemandElement* route = originalVehicle->getParentDemandElements().at(1); + // create Vehicle using values of original vehicle + GNEVehicle* vehicle = new GNEVehicle(originalVehicle->getNet(), vType, route, newVehicleParameters); + // remove original vehicle (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new vehicle + undoList->add(new GNEChange_DemandElement(vehicle, true), true); + // as last step change vehicle's route to embedded route if createEmbeddedRoute is enabled + if (createEmbeddedRoute) { + embebbeRoute(vehicle, undoList); + } + // check if vehicle has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(vehicle, GNE_ATTR_SELECTED, "true")); + } + } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { + // create route using values of originalVehicle flow/trip + GNERoute* route = new GNERoute(originalVehicle->getNet(), RouteParameter(originalVehicle)); + // create Vehicle using values of original vehicle (including ID) + GNEVehicle* vehicle = new GNEVehicle(originalVehicle->getNet(), vType, route, newVehicleParameters); + // remove flow/trip (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add both new vehicle and route + undoList->add(new GNEChange_DemandElement(route, true), true); + undoList->add(new GNEChange_DemandElement(vehicle, true), true); + // check if vehicle has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(vehicle, GNE_ATTR_SELECTED, "true")); + } + } + // end undo-redo operation + undoList->p_end(); + } +} + + +void +GNERouteHandler::transformToRouteFlow(GNEVehicle* originalVehicle, bool createEmbeddedRoute) { + // first check that given vehicle isn't already a routeflow + if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_ROUTEFLOW) { + // get pointer to undo list (due originalVehicle will be deleted) + GNEUndoList* undoList = originalVehicle->getNet()->getViewNet()->getUndoList(); + // begin undo-redo operation + undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_ROUTEFLOW)); + // declare flag to save if vehicle is selected + bool selected = originalVehicle->isAttributeCarrierSelected(); + // first check if originalVehicle has an embedded route, and if true, separate it + if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && + (originalVehicle->getParentDemandElements().size() == 1)) { + originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); + } + // obtain VType of original vehicle + GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); + // extract vehicleParameters of originalVehicle + SUMOVehicleParameter newVehicleParameters = *originalVehicle; + // change tag in newVehicleParameters (needed for GNEVehicle constructor) + newVehicleParameters.tag = SUMO_TAG_ROUTEFLOW; + // make transformation depending of vehicle tag + if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { + // obtain vehicle's route (it always exist due call to function separateEmbeddedRoute(...) + GNEDemandElement* route = originalVehicle->getParentDemandElements().at(1); + // create flow using newVehicleParameters + GNEVehicle* flow = new GNEVehicle(originalVehicle->getNet(), vType, route, newVehicleParameters); + // remove original vehicle (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new vehicle + undoList->add(new GNEChange_DemandElement(flow, true), true); + // as last step change vehicle's route to embedded route if createEmbeddedRoute is enabled + if (createEmbeddedRoute) { + embebbeRoute(flow, undoList); + } + // check if flow has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(flow, GNE_ATTR_SELECTED, "true")); + } + } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { + // create route using values of originalVehicle flow/trip + GNERoute* route = new GNERoute(originalVehicle->getNet(), RouteParameter(originalVehicle)); + // create flow using values of original vehicle (including ID) + GNEVehicle* flow = new GNEVehicle(originalVehicle->getNet(), vType, route, newVehicleParameters); + // remove flow/trip (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add both new vehicle and route + undoList->add(new GNEChange_DemandElement(route, true), true); + undoList->add(new GNEChange_DemandElement(flow, true), true); + // check if flow has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(flow, GNE_ATTR_SELECTED, "true")); + } + } + // end undo-redo operation + undoList->p_end(); + } +} + + +void +GNERouteHandler::transformToTrip(GNEVehicle* originalVehicle) { + // first check that given vehicle isn't already a trip + if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_TRIP) { + // get pointer to undo list (due originalVehicle will be deleted) + GNEUndoList* undoList = originalVehicle->getNet()->getViewNet()->getUndoList(); + // begin undo-redo operation + undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_FLOW)); + // declare pointer to get embedded route if is created + GNEDemandElement* separatedEmbeddedRoute = nullptr; + // declare flag to save if vehicle is selected + bool selected = originalVehicle->isAttributeCarrierSelected(); + // first check if originalVehicle has an embedded route, and if true, separate it + if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && + (originalVehicle->getParentDemandElements().size() == 1)) { + originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); + } + // obtain VType of original vehicle + GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); + // extract vehicleParameters of originalVehicle + SUMOVehicleParameter newVehicleParameters = *originalVehicle; + // change tag in newVehicleParameters (needed for GNEVehicle constructor) + newVehicleParameters.tag = SUMO_TAG_TRIP; + // make transformation depending of vehicle tag + if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { + // create trip using values of original vehicle (including ID) and route's edges + GNEVehicle* trip = new GNEVehicle(originalVehicle->getNet(), vType, + originalVehicle->getParentDemandElements().at(1)->getParentEdges().front(), + originalVehicle->getParentDemandElements().at(1)->getParentEdges().back(), + originalVehicle->getParentDemandElements().at(1)->getMiddleParentEdges(), + newVehicleParameters); + // first remove vehicle (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new vehicle + undoList->add(new GNEChange_DemandElement(trip, true), true); + // check if trip has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(trip, GNE_ATTR_SELECTED, "true")); + } + } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { + // create trip using values of original vehicle (including ID) + GNEVehicle* trip = new GNEVehicle(originalVehicle->getNet(), vType, + originalVehicle->getParentEdges().front(), + originalVehicle->getParentEdges().back(), + originalVehicle->getMiddleParentEdges(), + newVehicleParameters); + // remove originalVehicle + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new trip + undoList->add(new GNEChange_DemandElement(trip, true), true); + // check if trip has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(trip, GNE_ATTR_SELECTED, "true")); + } + } + // check if separatedEmbeddedRoute has to be removed + if (separatedEmbeddedRoute) { + undoList->add(new GNEChange_DemandElement(separatedEmbeddedRoute, false), true); + } + // end undo-redo operation + undoList->p_end(); + } +} + + +void +GNERouteHandler::transformToFlow(GNEVehicle* originalVehicle) { + // first check that given vehicle isn't already a flow + if (originalVehicle->getTagProperty().getTag() != SUMO_TAG_FLOW) { + // get pointer to undo list (due originalVehicle will be deleted) + GNEUndoList* undoList = originalVehicle->getNet()->getViewNet()->getUndoList(); + // begin undo-redo operation + undoList->p_begin("transform " + originalVehicle->getTagStr() + " to " + toString(SUMO_TAG_FLOW)); + // declare pointer to get embedded route if is created + GNEDemandElement* separatedEmbeddedRoute = nullptr; + // declare flag to save if vehicle is selected + bool selected = originalVehicle->isAttributeCarrierSelected(); + // first check if originalVehicle has an embedded route, and if true, separate it + if (((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) && + (originalVehicle->getParentDemandElements().size() == 1)) { + originalVehicle = separateEmbeddedRoute(originalVehicle, undoList); + separatedEmbeddedRoute = originalVehicle->getParentDemandElements().at(1); + } + // obtain VType of original vehicle + GNEDemandElement* vType = originalVehicle->getParentDemandElements().at(0); + // extract vehicleParameters of originalVehicle + SUMOVehicleParameter newVehicleParameters = *originalVehicle; + // change tag in newVehicleParameters (needed for GNEVehicle constructor) + newVehicleParameters.tag = SUMO_TAG_FLOW; + // make transformation depending of vehicle tag + if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { + // create Vehicle using values of original vehicle (including ID) and route's edges + GNEVehicle* flow = new GNEVehicle(originalVehicle->getNet(), vType, + originalVehicle->getParentDemandElements().at(1)->getParentEdges().front(), + originalVehicle->getParentDemandElements().at(1)->getParentEdges().back(), + originalVehicle->getParentDemandElements().at(1)->getMiddleParentEdges(), + newVehicleParameters); + // first remove vehicle (to avoid problem with ID) + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new flow + undoList->add(new GNEChange_DemandElement(flow, true), true); + } else if ((originalVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) || (originalVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP)) { + // create flow using values of original vehicle (including ID) + GNEVehicle* flow = new GNEVehicle(originalVehicle->getNet(), vType, + originalVehicle->getParentEdges().front(), + originalVehicle->getParentEdges().back(), + originalVehicle->getMiddleParentEdges(), + newVehicleParameters); + // remove originalVehicle + undoList->add(new GNEChange_DemandElement(originalVehicle, false), true); + // add new flow + undoList->add(new GNEChange_DemandElement(flow, true), true); + // check if flow has to be selected + if (selected) { + undoList->p_add(new GNEChange_Attribute(flow, GNE_ATTR_SELECTED, "true")); + } + } + // check if separatedEmbeddedRoute has to be removed + if (separatedEmbeddedRoute) { + undoList->add(new GNEChange_DemandElement(separatedEmbeddedRoute, false), true); + } + // end undo-redo operation + undoList->p_end(); + } +} + + +void +GNERouteHandler::transformToPerson(GNEPerson* /*originalPerson*/) { + // +} + + +void +GNERouteHandler::transformToPersonFlow(GNEPerson* /*originalPerson*/) { + // +} + + +void +GNERouteHandler::setFlowParameters(const SumoXMLAttr attribute, int& parameters) { + // modify parametersSetCopy depending of given Flow attribute + switch (attribute) { + case SUMO_ATTR_END: { + // give more priority to end + parameters = VEHPARS_END_SET | VEHPARS_NUMBER_SET; + break; + } + case SUMO_ATTR_NUMBER: + parameters ^= VEHPARS_END_SET; + parameters |= VEHPARS_NUMBER_SET; + break; + case SUMO_ATTR_VEHSPERHOUR: { + // give more priority to end + if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_END_SET) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_NUMBER_SET) { + parameters = VEHPARS_NUMBER_SET; + } + // set VehsPerHour + parameters |= VEHPARS_VPH_SET; + break; + } + case SUMO_ATTR_PERIOD: { + // give more priority to end + if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_END_SET) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_NUMBER_SET) { + parameters = VEHPARS_NUMBER_SET; + } + // set period + parameters |= VEHPARS_PERIOD_SET; + break; + } + case SUMO_ATTR_PROB: { + // give more priority to end + if ((parameters & VEHPARS_END_SET) && (parameters & VEHPARS_NUMBER_SET)) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_END_SET) { + parameters = VEHPARS_END_SET; + } else if (parameters & VEHPARS_NUMBER_SET) { + parameters = VEHPARS_NUMBER_SET; + } + // set probability + parameters |= VEHPARS_PROB_SET; + break; + } + default: + break; + } +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNERouteHandler::embebbeRoute(GNEVehicle* vehicle, GNEUndoList* undoList) { + // create a copy of vehicle with the same attributes but without embedded route + GNEVehicle* vehicleWithEmbebbeRoute = new GNEVehicle(vehicle->getNet(), vehicle->getParentDemandElements().at(0), *vehicle); + // create a embeddedRoute based on parameters of vehicle's route + GNERoute* embeddedRoute = new GNERoute(vehicleWithEmbebbeRoute->getNet(), vehicleWithEmbebbeRoute, RouteParameter(vehicle->getParentDemandElements().at(1))); + // remove vehicle, but NOT route + undoList->add(new GNEChange_DemandElement(vehicle, false), true); + // now add bot vehicleWithEmbebbeRoute and embeddedRoute + undoList->add(new GNEChange_DemandElement(vehicleWithEmbebbeRoute, true), true); + undoList->add(new GNEChange_DemandElement(embeddedRoute, true), true); +} + + +GNEVehicle* +GNERouteHandler::separateEmbeddedRoute(GNEVehicle* vehicle, GNEUndoList* undoList) { + // first create a Route based on the parameters of vehicle's embedded route + GNERoute* nonEmbeddedRoute = new GNERoute(vehicle->getChildDemandElements().at(0)); + // create a copy of vehicle with the same attributes but with the nonEmbeddedRoute + GNEVehicle* vehicleWithoutEmbebbeRoute = new GNEVehicle(vehicle->getNet(), vehicle->getParentDemandElements().at(0), nonEmbeddedRoute, *vehicle); + // remove embedded route andvehicle (because a embebbbed route without vehicle cannot exist) + undoList->add(new GNEChange_DemandElement(vehicle->getChildDemandElements().at(0), false), true); + undoList->add(new GNEChange_DemandElement(vehicle, false), true); + // now add bot nonEmbeddedRoute and vehicleWithoutEmbebbeRoute + undoList->add(new GNEChange_DemandElement(nonEmbeddedRoute, true), true); + undoList->add(new GNEChange_DemandElement(vehicleWithoutEmbebbeRoute, true), true); + // return vehicleWithoutEmbebbeRoute + return vehicleWithoutEmbebbeRoute; +} + + +void +GNERouteHandler::openVehicleTypeDistribution(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void +GNERouteHandler::closeVehicleTypeDistribution() { + // currently unused +} + + +void +GNERouteHandler::openRoute(const SUMOSAXAttributes& attrs) { + // change abort flag + myAbort = false; + // check if route has ID (due embebbed routes) + if (attrs.hasAttribute(SUMO_ATTR_ID)) { + myRouteParameter.routeID = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", SUMO_TAG_ROUTE, SUMO_ATTR_ID, myAbort); + myRouteParameter.loadedID = true; + } else { + myRouteParameter.routeID.clear(); + myRouteParameter.loadedID = false; + } + // parse other attributes + myRouteParameter.setEdges(myNet, GNEAttributeCarrier::parseAttributeFromXML(attrs, myRouteParameter.routeID, SUMO_TAG_ROUTE, SUMO_ATTR_EDGES, myAbort)); + myRouteParameter.color = GNEAttributeCarrier::parseAttributeFromXML(attrs, myRouteParameter.routeID, SUMO_TAG_ROUTE, SUMO_ATTR_COLOR, myAbort); +} + + +void +GNERouteHandler::openFlow(const SUMOSAXAttributes& attrs) { + // change abort flag + myAbort = false; + // parse flow attributes + myRouteParameter.setEdges(myNet, myVehicleParameter->id, + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_FLOW, SUMO_ATTR_FROM, myAbort), + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_FLOW, SUMO_ATTR_TO, myAbort), + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_FLOW, SUMO_ATTR_VIA, myAbort)); +} + + +void +GNERouteHandler::openRouteFlow(const SUMOSAXAttributes& /*attrs*/) { + // clear edges + myRouteParameter.clearEdges(); +} + + +void +GNERouteHandler::openTrip(const SUMOSAXAttributes& attrs) { + // change abort flag + myAbort = false; + // parse trips attributes + myRouteParameter.setEdges(myNet, myVehicleParameter->id, + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_FROM, myAbort), + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_TO, myAbort), + GNEAttributeCarrier::parseAttributeFromXML(attrs, myVehicleParameter->id, SUMO_TAG_TRIP, SUMO_ATTR_VIA, myAbort)); +} + + +void +GNERouteHandler::closeRoute(const bool /* mayBeDisconnected */) { + // first copy parameters from SUMORouteHanlder to myRouteParameter + myRouteParameter.parameters = myLoadedParameterised; + // clear loaded parameters after set + myLoadedParameterised.clearParameter(); + // we have two possibilities: Either create a route with their own ID, or create a route within a vehicle + if (myVehicleParameter) { + // extra warning for embebbed routes + if (myRouteParameter.loadedID) { + WRITE_WARNING("Attribute ID ignored in embedded routes"); + } + // check edges + if (myRouteParameter.edges.size() == 0) { + WRITE_ERROR("A route needs at least one edge. Vehicle with ID='" + myVehicleParameter->id + "' cannot be created"); + } else { + // obtain vType + GNEDemandElement* vType = myNet->retrieveDemandElement(SUMO_TAG_VTYPE, myVehicleParameter->vtypeid, false); + if (vType == nullptr) { + WRITE_ERROR("Invalid vehicle type '" + myVehicleParameter->vtypeid + "' used in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->id + "'."); + } else { + // generate a new route ID and add it to myVehicleParameter + myVehicleParameter->routeid = myNet->generateDemandElementID(myVehicleParameter->id, SUMO_TAG_ROUTE); + // due vehicle was loaded without a route, change tag + myVehicleParameter->tag = (myVehicleParameter->tag == SUMO_TAG_FLOW) ? SUMO_TAG_ROUTEFLOW : SUMO_TAG_VEHICLE; + // create vehicle or trips using myTemporalVehicleParameter without a route + myLoadedVehicleWithEmbebbedRoute = new GNEVehicle(myNet, vType, *myVehicleParameter); + // creaste embedded route + GNERoute* embeddedRoute = new GNERoute(myNet, myLoadedVehicleWithEmbebbedRoute, myRouteParameter); + // add both to net depending of myUndoDemandElements + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->p_begin("add vehicle and " + embeddedRoute->getTagStr()); + // add both in net using undoList + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(myLoadedVehicleWithEmbebbedRoute, true), true); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(embeddedRoute, true), true); + // iterate over stops of myActiveRouteStops and create stops associated with it + for (const auto& i : myActiveRouteStops) { + buildStop(myNet, true, i, myLoadedVehicleWithEmbebbedRoute); + } + } else { + // add vehicleOrRouteFlow in net and in their vehicle type parent + myNet->getAttributeCarriers()->insertDemandElement(myLoadedVehicleWithEmbebbedRoute); + vType->addChildDemandElement(myLoadedVehicleWithEmbebbedRoute); + myLoadedVehicleWithEmbebbedRoute->incRef("buildVehicleAndRoute"); + // add route manually in net, and in all of their edges and in vehicleOrRouteFlow + myNet->getAttributeCarriers()->insertDemandElement(embeddedRoute); + for (const auto& i : myRouteParameter.edges) { + i->addChildDemandElement(myLoadedVehicleWithEmbebbedRoute); + } + myLoadedVehicleWithEmbebbedRoute->addChildDemandElement(embeddedRoute); + embeddedRoute->incRef("buildVehicleAndRoute"); + // iterate over stops of myActiveRouteStops and create stops associated with it + for (const auto& i : myActiveRouteStops) { + buildStop(myNet, false, i, myLoadedVehicleWithEmbebbedRoute); + } + } + } + } + } else if (myRouteParameter.loadedID == false) { + WRITE_ERROR(toString(SUMO_TAG_ROUTE) + " needs a valid ID."); + } else if (!SUMOXMLDefinitions::isValidVehicleID(myRouteParameter.routeID)) { + WRITE_ERROR(toString(SUMO_TAG_ROUTE) + " ID='" + myRouteParameter.routeID + "' contains invalid characters."); + } else if (myNet->retrieveDemandElement(SUMO_TAG_ROUTE, myRouteParameter.routeID, false) != nullptr) { + WRITE_ERROR("There is another " + toString(SUMO_TAG_ROUTE) + " with the same ID='" + myRouteParameter.routeID + "'."); + } else if (myRouteParameter.edges.size() == 0) { + WRITE_ERROR("A route needs at least one edge."); + } else { + // creaste GNERoute + GNERoute* route = new GNERoute(myNet, myRouteParameter); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->p_begin("add " + route->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); + // iterate over stops of myActiveRouteStops and create stops associated with it + for (const auto& i : myActiveRouteStops) { + buildStop(myNet, true, i, route); + } + myNet->getViewNet()->getUndoList()->p_end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(route); + for (const auto& i : myRouteParameter.edges) { + i->addChildDemandElement(route); + } + route->incRef("buildRoute"); + // iterate over stops of myActiveRouteStops and create stops associated with it + for (const auto& i : myActiveRouteStops) { + buildStop(myNet, false, i, route); + } + } + } +} + + +void +GNERouteHandler::openRouteDistribution(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void +GNERouteHandler::closeRouteDistribution() { + // currently unused +} + + +void +GNERouteHandler::closeVehicle() { + // first check if we're closing a vehicle with embebbed routes and stops + if (myLoadedVehicleWithEmbebbedRoute) { + myLoadedVehicleWithEmbebbedRoute = nullptr; + // check if current command group size has to be ended + if (myNet->getViewNet()->getUndoList()->currentCommandGroupSize() > 0) { + myNet->getViewNet()->getUndoList()->p_end(); + } + } else { + // now check if myVehicleParameter was sucesfully created + if (myVehicleParameter) { + // build vehicle over route + buildVehicleOverRoute(myNet, myUndoDemandElements, *myVehicleParameter); + } + } +} + + +void +GNERouteHandler::closeVType() { + // first check that VType was sucesfully created + if (myCurrentVType) { + // first check if we're creating a vType or a pType + SumoXMLTag vTypeTag = (myCurrentVType->vehicleClass == SVC_PEDESTRIAN) ? SUMO_TAG_PTYPE : SUMO_TAG_VTYPE; + // check if loaded vType/pType is a default vtype + if ((myCurrentVType->id == DEFAULT_VTYPE_ID) || (myCurrentVType->id == DEFAULT_PEDTYPE_ID) || (myCurrentVType->id == DEFAULT_BIKETYPE_ID)) { + // overwrite default vehicle type + GNEVehicleType::overwriteVType(myNet->retrieveDemandElement(vTypeTag, myCurrentVType->id, false), myCurrentVType, myNet->getViewNet()->getUndoList()); + } else if (myNet->retrieveDemandElement(vTypeTag, myCurrentVType->id, false) != nullptr) { + WRITE_ERROR("There is another " + toString(vTypeTag) + " with the same ID='" + myCurrentVType->id + "'."); + } else { + // create vType/pType using myCurrentVType + GNEVehicleType* vType = new GNEVehicleType(myNet, *myCurrentVType, vTypeTag); + if (myUndoDemandElements) { + myNet->getViewNet()->getUndoList()->p_begin("add " + vType->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(vType, true), true); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + myNet->getAttributeCarriers()->insertDemandElement(vType); + vType->incRef("buildVType"); + } + } + } +} + + +void +GNERouteHandler::closePerson() { + // first check if myVehicleParameter was sucesfully created + if (myVehicleParameter) { + // first check if ID is duplicated + if (!isPersonIdDuplicated(myNet, myVehicleParameter->id)) { + // obtain ptype + GNEDemandElement* pType = myNet->retrieveDemandElement(SUMO_TAG_PTYPE, myVehicleParameter->vtypeid, false); + if (pType == nullptr) { + WRITE_ERROR("Invalid person type '" + myVehicleParameter->vtypeid + "' used in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->vtypeid + "'."); + } else { + // declare flag to abort person plans creation + bool abortPersonPlans = false; + // create person using personParameters + GNEPerson* person = new GNEPerson(SUMO_TAG_PERSON, myNet, pType, *myVehicleParameter); + // begin undo-list creation + myNet->getViewNet()->getUndoList()->p_begin("add " + person->getTagStr()); + // add person + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(person, true), true); + // iterate over all personplan childs and add it + for (auto i = myPersonPlanValues.begin(); (i != myPersonPlanValues.end()) && !abortPersonPlans; i++) { + switch (i->tag) { + case SUMO_TAG_PERSONTRIP_FROMTO: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from && i->to) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myNet, person, i->from, i->to, {}, i->arrivalPos, i->vTypes, i->modes), true), true); + } else if ((i != myPersonPlanValues.begin()) && i->to) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myNet, person, i->from, i->to, {}, i->arrivalPos, i->vTypes, i->modes), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_PERSONTRIP_BUSSTOP: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myNet, person, i->from, i->busStop, {}, i->vTypes, i->modes), true), true); + } else if (i != myPersonPlanValues.begin()) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEPersonTrip(myNet, person, i->from, i->busStop, {}, i->vTypes, i->modes), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_RIDE_FROMTO: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from && i->to) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myNet, person, i->from, i->to, {}, i->arrivalPos, i->lines), true), true); + } else if ((i != myPersonPlanValues.begin()) && i->to) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myNet, person, i->from, i->to, {}, i->arrivalPos, i->lines), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_RIDE_BUSSTOP: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myNet, person, i->from, i->busStop, {}, i->lines), true), true); + } else if (i != myPersonPlanValues.begin()) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNERide(myNet, person, i->from, i->busStop, {}, i->lines), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_WALK_EDGES: + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->edges, i->arrivalPos), true), true); + break; + case SUMO_TAG_WALK_FROMTO: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from && i->to) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->from, i->to, {}, i->arrivalPos), true), true); + } else if ((i != myPersonPlanValues.begin()) && i->to) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->from, i->to, {}, i->arrivalPos), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_WALK_BUSSTOP: + // check if "from" attribute was loaded, or it must be taked fron previous personPlan values + if (i->from) { + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->from, i->busStop, {}), true), true); + } else if (i != myPersonPlanValues.begin()) { + // update 'from' edge using 'to' edge of last personPlan element + i->from = (i - 1)->getLastEdge(); + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->from, i->busStop, {}), true), true); + } else { + WRITE_ERROR("The first person plan of type '" + toString(i->tag) + "' needs a from edge. Person cannot be created."); + // abort last command group (to remove created person) + myNet->getViewNet()->getUndoList()->p_abortLastCommandGroup(); + // abort person plan creation + abortPersonPlans = true; + } + break; + case SUMO_TAG_WALK_ROUTE: + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEWalk(myNet, person, i->route, i->arrivalPos), true), true); + break; + case SUMO_TAG_PERSONSTOP_LANE: + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEStop(myNet, i->stopParameters, i->laneStop, person), true), true); + break; + case SUMO_TAG_PERSONSTOP_BUSSTOP: + myNet->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(new GNEStop(i->tag, myNet, i->stopParameters, i->busStop, person), true), true); + break; + default: + break; + } + } + // end undo-list depending of abortPersonPlans + if (!abortPersonPlans) { + myNet->getViewNet()->getUndoList()->p_end(); + } + } + } + + } + // clear person plan values clear + myPersonPlanValues.clear(); +} + +void +GNERouteHandler::closePersonFlow() { + // first check if myVehicleParameter was sucesfully created + if (myVehicleParameter) { + // build person flow + buildPersonFlow(myNet, myUndoDemandElements, *myVehicleParameter); + } +} + +void +GNERouteHandler::closeContainer() { + // currently unused +} + + +void +GNERouteHandler::closeFlow() { + // first check if we're closing a flow with embebbed routes and stops + if (myLoadedVehicleWithEmbebbedRoute) { + myLoadedVehicleWithEmbebbedRoute = nullptr; + // check if current command group size has to be ended + if (myNet->getViewNet()->getUndoList()->currentCommandGroupSize() > 0) { + myNet->getViewNet()->getUndoList()->p_end(); + } + } else if (myVehicleParameter) { + // check if we're creating a flow or a routeFlow over route + if (myVehicleParameter->tag == SUMO_TAG_ROUTEFLOW) { + // build flow over route + buildFlowOverRoute(myNet, myUndoDemandElements, *myVehicleParameter); + } else if (myVehicleParameter->routeid.empty() && (myRouteParameter.edges.size() > 1)) { + // extract via edges + std::vector viaEdges; + for (int i = 1; i < ((int)myRouteParameter.edges.size() - 1); i++) { + viaEdges.push_back(myRouteParameter.edges.at(i)); + } + // build flow + buildFlow(myNet, true, *myVehicleParameter, myRouteParameter.edges.front(), myRouteParameter.edges.back(), viaEdges); + } + } +} + + +void +GNERouteHandler::closeTrip() { + // first check if myVehicleParameter was sucesfully created + if (myVehicleParameter && (myRouteParameter.edges.size() > 1)) { + // force reroute + myVehicleParameter->parametersSet |= VEHPARS_FORCE_REROUTE; + // extract via edges + std::vector viaEdges; + for (int i = 1; i < ((int)myRouteParameter.edges.size() - 1); i++) { + viaEdges.push_back(myRouteParameter.edges.at(i)); + } + // build trip + buildTrip(myNet, true, *myVehicleParameter, myRouteParameter.edges.front(), myRouteParameter.edges.back(), viaEdges); + } +} + + +void +GNERouteHandler::addStop(const SUMOSAXAttributes& attrs) { + // declare a personStop + PersonPlansValues stop; + std::string errorSuffix; + if (myVehicleParameter != nullptr) { + errorSuffix = " in " + toString(myVehicleParameter->tag) + " '" + myVehicleParameter->id + "'."; + } else { + errorSuffix = " in route '" + myActiveRouteID + "'."; + } + // try to parse stop + myAbort = parseStop(stop.stopParameters, attrs, errorSuffix, MsgHandler::getErrorInstance()); + if (!myAbort) { + return; + } + // try to parse the assigned bus stop + if (stop.stopParameters.busstop != "") { + // ok, we have a busStop + GNEBusStop* bs = dynamic_cast(myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, stop.stopParameters.busstop, false)); + if (bs == nullptr) { + WRITE_ERROR(toString(SUMO_TAG_BUS_STOP) + " '" + stop.stopParameters.busstop + "' is not known" + errorSuffix); + return; + } + // save lane + stop.stopParameters.lane = bs->getAttribute(SUMO_ATTR_LANE); + // save stoping place in stop + stop.busStop = bs; + // set tag + stop.tag = SUMO_TAG_STOP_BUSSTOP; + // special case for persons + if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { + stop.tag = SUMO_TAG_PERSONSTOP_BUSSTOP; + } + } else if (stop.stopParameters.containerstop != "") { + // special case for persons + if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { + WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_CONTAINER_STOP) + "s"); + return; + } + // ok, we have a containerStop + GNEContainerStop* cs = dynamic_cast(myNet->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, stop.stopParameters.containerstop, false)); + if (cs == nullptr) { + WRITE_ERROR(toString(SUMO_TAG_CONTAINER_STOP) + " '" + stop.stopParameters.containerstop + "' is not known" + errorSuffix); + return; + } + // save lane + stop.stopParameters.lane = cs->getAttribute(SUMO_ATTR_LANE); + // save stoping place in stop + stop.containerStop = cs; + // set tag + stop.tag = SUMO_TAG_STOP_CONTAINERSTOP; + + } else if (stop.stopParameters.chargingStation != "") { + // special case for persons + if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { + WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_CHARGING_STATION) + "s"); + return; + } + // ok, we have a chargingStation + GNEChargingStation* cs = dynamic_cast(myNet->retrieveAdditional(SUMO_TAG_CHARGING_STATION, stop.stopParameters.chargingStation, false)); + if (cs == nullptr) { + WRITE_ERROR(toString(SUMO_TAG_CHARGING_STATION) + " '" + stop.stopParameters.chargingStation + "' is not known" + errorSuffix); + return; + } + // save lane + stop.stopParameters.lane = cs->getAttribute(SUMO_ATTR_LANE); + // save stoping place in stop + stop.chargingStation = cs; + // set tag + stop.tag = SUMO_TAG_STOP_CHARGINGSTATION; + } else if (stop.stopParameters.parkingarea != "") { + // special case for persons + if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { + WRITE_ERROR("Persons don't support " + toString(SUMO_TAG_PARKING_AREA) + "s"); + return; + } + // ok, we have a parkingArea + GNEParkingArea* pa = dynamic_cast(myNet->retrieveAdditional(SUMO_TAG_PARKING_AREA, stop.stopParameters.parkingarea, false)); + if (pa == nullptr) { + WRITE_ERROR(toString(SUMO_TAG_PARKING_AREA) + " '" + stop.stopParameters.parkingarea + "' is not known" + errorSuffix); + return; + } + // save lane + stop.stopParameters.lane = pa->getAttribute(SUMO_ATTR_LANE); + // save stoping place in stop + stop.parkingArea = pa; + // set tag + stop.tag = SUMO_TAG_STOP_PARKINGAREA; + } else { + // no, the lane and the position should be given + // get the lane + stop.stopParameters.lane = attrs.getOpt(SUMO_ATTR_LANE, nullptr, myAbort, ""); + stop.laneStop = myNet->retrieveLane(stop.stopParameters.lane, false); + // check if lane is valid + if (myAbort && stop.stopParameters.lane != "") { + if (stop.laneStop == nullptr) { + WRITE_ERROR("The lane '" + stop.stopParameters.lane + "' for a stop is not known" + errorSuffix); + return; + } + } else { + WRITE_ERROR("A stop must be placed over a " + toString(SUMO_TAG_BUS_STOP) + ", a " + toString(SUMO_TAG_CONTAINER_STOP) + + ", a " + toString(SUMO_TAG_CHARGING_STATION) + ", a " + toString(SUMO_TAG_PARKING_AREA) + " or a " + toString(SUMO_TAG_LANE) + errorSuffix); + return; + } + // calculate start and end position + stop.stopParameters.endPos = attrs.getOpt(SUMO_ATTR_ENDPOS, nullptr, myAbort, stop.laneStop->getLaneParametricLength()); + if (attrs.hasAttribute(SUMO_ATTR_POSITION)) { + WRITE_ERROR("Deprecated attribute 'pos' in description of stop" + errorSuffix); + stop.stopParameters.endPos = attrs.getOpt(SUMO_ATTR_POSITION, nullptr, myAbort, stop.stopParameters.endPos); + } + stop.stopParameters.startPos = attrs.getOpt(SUMO_ATTR_STARTPOS, nullptr, myAbort, MAX2(0., stop.stopParameters.endPos - 2 * POSITION_EPS)); + stop.stopParameters.friendlyPos = attrs.getOpt(SUMO_ATTR_FRIENDLY_POS, nullptr, myAbort, false); + if (!myAbort || (checkStopPos(stop.stopParameters.startPos, stop.stopParameters.endPos, stop.laneStop->getLaneParametricLength(), POSITION_EPS, stop.stopParameters.friendlyPos) != STOPPOS_VALID)) { + WRITE_ERROR("Invalid start or end position for stop on lane '" + stop.stopParameters.lane + "'" + errorSuffix); + return; + } + // set tag + stop.tag = SUMO_TAG_STOP_LANE; + // special case for persons + if ((myVehicleParameter != nullptr) && ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW))) { + stop.tag = SUMO_TAG_PERSONSTOP_LANE; + } + } + // now create or store stop + if (myLoadedVehicleWithEmbebbedRoute) { + buildStop(myNet, true, stop.stopParameters, myLoadedVehicleWithEmbebbedRoute); + } else if (myVehicleParameter != nullptr) { + if ((myVehicleParameter->tag == SUMO_TAG_PERSON) || (myVehicleParameter->tag == SUMO_TAG_PERSONFLOW)) { + myPersonPlanValues.push_back(stop); + } else { + myVehicleParameter->stops.push_back(stop.stopParameters); + } + } else { + myActiveRouteStops.push_back(stop.stopParameters); + } +} + + +void +GNERouteHandler::addPersonTrip(const SUMOSAXAttributes& attrs) { + // SUMORouteHandler handle certain walks configurations as PersonTrips, then it needs a manually call to addWalk(...) + if (attrs.getObjectType() == "walk") { + addWalk(attrs); + } else { + // change abort flag + myAbort = false; + // declare value for saving loaded values + PersonPlansValues personTripValuesLoaded; + // first set tag + if (attrs.hasAttribute(SUMO_ATTR_TO)) { + // set tag + personTripValuesLoaded.tag = SUMO_TAG_PERSONTRIP_FROMTO; + // declare a flag to check if values are valid + bool validValues = true; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + personTripValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (personTripValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + } + personTripValuesLoaded.to = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); + personTripValuesLoaded.vTypes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_VTYPES, myAbort); + personTripValuesLoaded.modes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_MODES, myAbort); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + personTripValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (personTripValuesLoaded.to == nullptr) { + WRITE_ERROR("Invalid edge to in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + // check modes + for (const auto& i : personTripValuesLoaded.modes) { + if ((i != "public") && (i != "car") && (i != "bicycle")) { + validValues = false; + } + } + if (validValues) { + // remove duplicated modes + std::sort(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()); + personTripValuesLoaded.modes.erase(unique(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()), personTripValuesLoaded.modes.end()); + } else { + WRITE_ERROR("A person trip mode can be only a combination of 'public', 'car' or 'bicycle'"); + } + for (const auto& i : personTripValuesLoaded.vTypes) { + if (!SUMOXMLDefinitions::isValidTypeID(i)) { + WRITE_ERROR("Invalid vehicle type '" + i + "' used in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + } + // save loaded values in container only if all parameters are valid + if (validValues) { + myPersonPlanValues.push_back(personTripValuesLoaded); + } + } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { + // set tag + personTripValuesLoaded.tag = SUMO_TAG_PERSONTRIP_BUSSTOP; + // declare a flag to check if values are valid + bool validValues = true; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + personTripValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (personTripValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + } + personTripValuesLoaded.busStop = myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); + personTripValuesLoaded.vTypes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_VTYPES, myAbort); + personTripValuesLoaded.modes = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_MODES, myAbort); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + personTripValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", personTripValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (personTripValuesLoaded.busStop == nullptr) { + WRITE_ERROR("Invalid busStop to in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + // check modes + for (const auto& i : personTripValuesLoaded.modes) { + if ((i != "public") && (i != "car") && (i != "bicycle")) { + validValues = false; + } + } + if (validValues) { + // remove duplicated modes + std::sort(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()); + personTripValuesLoaded.modes.erase(unique(personTripValuesLoaded.modes.begin(), personTripValuesLoaded.modes.end()), personTripValuesLoaded.modes.end()); + } else { + WRITE_ERROR("A person trip mode can be only a combination of 'public', 'car' or 'bicycle'"); + } + for (const auto& i : personTripValuesLoaded.vTypes) { + if (!SUMOXMLDefinitions::isValidTypeID(i)) { + WRITE_ERROR("Invalid vehicle type '" + i + "' used in " + toString(personTripValuesLoaded.tag)); + validValues = false; + } + } + // save loaded values in container only if all parameters are valid + if (validValues) { + myPersonPlanValues.push_back(personTripValuesLoaded); + } + } else { + WRITE_ERROR("A personTrip requires either a from-to edges or a from edge and a busStop"); + } + } +} + + +void +GNERouteHandler::addWalk(const SUMOSAXAttributes& attrs) { + // change abort flag + myAbort = false; + // declare value for saving loaded values + PersonPlansValues walkValuesLoaded; + // first set tag + if (attrs.hasAttribute(SUMO_ATTR_EDGES)) { + // set tag + walkValuesLoaded.tag = SUMO_TAG_WALK_EDGES; + // parse edges + std::string edgeIDs = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_EDGES, myAbort); + if (GNEAttributeCarrier::canParse >(myNet, edgeIDs, true)) { + walkValuesLoaded.edges = GNEAttributeCarrier::parse >(myNet, edgeIDs); + } + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (walkValuesLoaded.edges.empty()) { + WRITE_ERROR("Invalid edges of " + toString(walkValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(walkValuesLoaded); + } + } else if (attrs.hasAttribute(SUMO_ATTR_TO)) { + // set tag + walkValuesLoaded.tag = SUMO_TAG_WALK_FROMTO; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + walkValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (walkValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(walkValuesLoaded.tag)); + } + } + walkValuesLoaded.to = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (walkValuesLoaded.to == nullptr) { + WRITE_ERROR("Invalid edge to in " + toString(walkValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(walkValuesLoaded); + } + } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { + // set tag + walkValuesLoaded.tag = SUMO_TAG_WALK_BUSSTOP; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + walkValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (walkValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(walkValuesLoaded.tag)); + } + } + walkValuesLoaded.busStop = myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); + // use edge of busstop's lane as to edge + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (walkValuesLoaded.busStop == nullptr) { + WRITE_ERROR("Invalid busStop to in " + toString(walkValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(walkValuesLoaded); + } + } else if (attrs.hasAttribute(SUMO_ATTR_ROUTE)) { + // set tag + walkValuesLoaded.tag = SUMO_TAG_WALK_ROUTE; + // extract rest of parameters + walkValuesLoaded.route = myNet->retrieveDemandElement(SUMO_TAG_ROUTE, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ROUTE, myAbort), false); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + walkValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", walkValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check that all parameters are correct + if (walkValuesLoaded.route == nullptr) { + WRITE_ERROR("Invalid route from in " + toString(walkValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(walkValuesLoaded); + } + } else { + WRITE_ERROR("A walk requires either a from-to edges, a from edge and a busStop or a route"); + } +} + + +void +GNERouteHandler::addPerson(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void +GNERouteHandler::addContainer(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void +GNERouteHandler::addRide(const SUMOSAXAttributes& attrs) { + // change abort flag + myAbort = false; + // declare value for saving loaded values + PersonPlansValues rideValuesLoaded; + // first set tag + if (attrs.hasAttribute(SUMO_ATTR_TO)) { + // set tag + rideValuesLoaded.tag = SUMO_TAG_RIDE_FROMTO; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + rideValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (rideValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(rideValuesLoaded.tag)); + } + } + rideValuesLoaded.to = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_TO, myAbort), false); + rideValuesLoaded.lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_LINES, myAbort); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + rideValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check lines + if (rideValuesLoaded.lines.empty()) { + rideValuesLoaded.lines.push_back("ANY"); + } + // check that all parameters are correct + if (rideValuesLoaded.to == nullptr) { + WRITE_ERROR("Invalid edge to in " + toString(rideValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(rideValuesLoaded); + } + } else if (attrs.hasAttribute(SUMO_ATTR_BUS_STOP)) { + // set tag + rideValuesLoaded.tag = SUMO_TAG_RIDE_BUSSTOP; + // extract rest of parameters + if (attrs.hasAttribute(SUMO_ATTR_FROM)) { + rideValuesLoaded.from = myNet->retrieveEdge(GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_FROM, myAbort), false); + if (rideValuesLoaded.from == nullptr) { + WRITE_ERROR("Invalid edge from in " + toString(rideValuesLoaded.tag)); + } + } + rideValuesLoaded.busStop = myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_BUS_STOP, myAbort), false); + rideValuesLoaded.lines = GNEAttributeCarrier::parseAttributeFromXML >(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_LINES, myAbort); + if (attrs.hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + rideValuesLoaded.arrivalPos = GNEAttributeCarrier::parseAttributeFromXML(attrs, "", rideValuesLoaded.tag, SUMO_ATTR_ARRIVALPOS, myAbort); + } + // check lines + if (rideValuesLoaded.lines.empty()) { + rideValuesLoaded.lines.push_back("ANY"); + } + // check that all parameters are correct + if (rideValuesLoaded.busStop == nullptr) { + WRITE_ERROR("Invalid busStop to in " + toString(rideValuesLoaded.tag)); + } else { + // save loaded values in container + myPersonPlanValues.push_back(rideValuesLoaded); + } + } else { + WRITE_ERROR("A ride requires either a from-to edges or a from edge and a busStop"); + } +} + + +void +GNERouteHandler::addTransport(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void +GNERouteHandler::addTranship(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + +// =========================================================================== +// private members +// =========================================================================== + +GNERouteHandler::PersonPlansValues::PersonPlansValues() : + tag(SUMO_TAG_NOTHING), + from(nullptr), + to(nullptr), + busStop(nullptr), + containerStop(nullptr), + chargingStation(nullptr), + parkingArea(nullptr), + route(nullptr), + arrivalPos(-1), + laneStop(nullptr) { +} + + +GNEEdge* +GNERouteHandler::PersonPlansValues::getLastEdge() const { + if (edges.size() > 0) { + return edges.back(); + } else if (route) { + return route->getParentEdges().back(); + } else if (busStop) { + return busStop->getParentLanes().front()->getParentEdge(); + } else if (laneStop) { + return laneStop->getParentEdge(); + } else if (to) { + return to; + } else { + return nullptr; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNERouteHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,348 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteHandler.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// Builds demand objects for netedit +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEViewNet; +class GNEEdge; +class GNETAZ; +class GNEDemandElement; +class GNEVehicle; +class GNEPerson; +class GNEUndoList; + +// =========================================================================== +// class definitions +// =========================================================================== + +/// @class GNERouteHandler +/// @brief Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..) +class GNERouteHandler : public SUMORouteHandler { +public: + /// @brief struct for saving route parameters + struct RouteParameter { + + /// @brief constructor + RouteParameter(); + + /// @brief parameter constructor (use values of originalDemandElement) + RouteParameter(GNEDemandElement* originalDemandElement); + + /// @brief set edges (list of consecutive edges) + void setEdges(GNENet* net, const std::string& edgeIDs); + + /// @brief set edges (from, to and via edges) + void setEdges(GNENet* net, const std::string& vehicleID, const std::string& fromID, const std::string& toID, const std::string& viaIDs); + + /// @brief clear edges + void clearEdges(); + + /// @brief string for saving parsed Route ID + std::string routeID; + + /// @brief flag to check if route was loaded + bool loadedID; + + /// @brief edges + std::vector edges; + + /// @brief vClass used by this route + SUMOVehicleClass vClass; + + /// @brief string for saving parsed route colors + RGBColor color; + + /// @brief parameters + Parameterised parameters; + }; + + /// @brief Constructor + GNERouteHandler(const std::string& file, GNENet* net, bool undoDemandElements = true); + + /// @brief Destructor + ~GNERouteHandler(); + + /// @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); + + /// @brief check if there is already a person (Person or PersonFlow) with the given ID + static bool isPersonIdDuplicated(GNENet* net, const std::string& id); + + /// @brief build functions + /// @{ + /// @brief build a vehicle over an existent route + static void buildVehicleOverRoute(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters); + + /// @brief build a flow over an existent route + static void buildFlowOverRoute(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters); + + /// @brief build vehicle with a embedded route + static void buildVehicleWithEmbeddedRoute(GNENet* net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy); + + /// @brief build flow with a embedded route + static void buildFlowWithEmbeddedRoute(GNENet* net, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement* embeddedRouteCopy); + + /// @brief build trip + static void buildTrip(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); + + /// @brief build flow + static void buildFlow(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& vehicleParameters, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via); + + /// @brief build stop + static void buildStop(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter::Stop& stopParameters, GNEDemandElement* stopParent); + + /// @brief build person + static void buildPerson(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& personParameters); + + /// @brief build person flow + static void buildPersonFlow(GNENet* net, bool undoDemandElements, const SUMOVehicleParameter& personFlowParameters); + + /// @brief build trip using a from-to edges + static void buildPersonTripFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos, + const std::vector& types, const std::vector& modes); + + /// @brief build trip using a from edge and a busStop + static void buildPersonTripBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, + const std::vector& types, const std::vector& modes); + + /// @brief build walk using a list of consecutive edges + static void buildWalkEdges(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, const std::vector& edges, double arrivalPos); + + /// @brief build walk using a from-to edges + static void buildWalkFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, double arrivalPos); + + /// @brief build walk using a from edge an a busStop + static void buildWalkBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop); + + /// @brief build walk using a list of consecutive edges + static void buildWalkRoute(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEDemandElement* route, double arrivalPos); + + /// @brief build ride using a from-to edges + static void buildRideFromTo(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& lines, double arrivalPos); + + /// @brief build ride using a from edge and a busStop + static void buildRideBusStop(GNENet* net, bool undoDemandElements, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& lines); + + /// @} + + /// @brief transform vehicle functions + /// @{ + + /// @brief transform to vehicle over an existent route + static void transformToVehicle(GNEVehicle* originalVehicle, bool createEmbeddedRoute); + + /// @brief transform routeFlow over an existent route + static void transformToRouteFlow(GNEVehicle* originalVehicle, bool createEmbeddedRoute); + + /// @brief transform to trip + static void transformToTrip(GNEVehicle* originalVehicle); + + /// @brief transform to flow + static void transformToFlow(GNEVehicle* originalVehicle); + + /// @} + + /// @brief transform person functions + /// @{ + + /// @brief transform to vehicle over an existent route + static void transformToPerson(GNEPerson* originalPerson); + + /// @brief transform routeFlow over an existent route + static void transformToPersonFlow(GNEPerson* originalPerson); + + /// @} + + /// @brief configure flow parameters + static void setFlowParameters(const SumoXMLAttr attribute, int& parameters); + +protected: + /// @brief embebbe route within a vehicle + static void embebbeRoute(GNEVehicle* vehicle, GNEUndoList* undoList); + + /// @brief separate vehicle and embedded route + static GNEVehicle* separateEmbeddedRoute(GNEVehicle* vehicle, GNEUndoList* undoList); + + /// @brief opens a type distribution for reading + void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs); + + /// @brief closes (ends) the building of a distribution + void closeVehicleTypeDistribution(); + + /// @brief opens a route for reading + void openRoute(const SUMOSAXAttributes& attrs); + + /// @brief opens a routeFlow for reading + void openFlow(const SUMOSAXAttributes& attrs); + + /// @brief opens a routeFlow for reading + void openRouteFlow(const SUMOSAXAttributes& attrs); + + /// @brief opens a trip for reading + void openTrip(const SUMOSAXAttributes& attrs); + + /**closes (ends) the building of a route. + * Afterwards no edges may be added to it; + * this method may throw exceptions when + * a) the route is empty or + * b) another route with the same id already exists + */ + void closeRoute(const bool mayBeDisconnected = false); + + /// @brief opens a route distribution for reading + void openRouteDistribution(const SUMOSAXAttributes& attrs); + + /// @brief closes (ends) the building of a distribution + void closeRouteDistribution(); + + /// @brief Ends the processing of a vehicle + void closeVehicle(); + + /// @brief Ends the processing of a vehicle Type + void closeVType(); + + /// @brief Ends the processing of a person + void closePerson(); + + /// @brief Ends the processing of a personFlow + void closePersonFlow(); + + /// @brief Ends the processing of a container + void closeContainer(); + + /// @brief Ends the processing of a routeFlow + void closeFlow(); + + /// @brief Ends the processing of a trip + void closeTrip(); + + /// @brief Processing of a stop + void addStop(const SUMOSAXAttributes& attrs); + + /// @brief add a routing request for a walking or intermodal person + void addPersonTrip(const SUMOSAXAttributes& attrs); + + /// @brief add a fully specified walk + void addWalk(const SUMOSAXAttributes& attrs); + + /// @brief Processing of a person + void addPerson(const SUMOSAXAttributes& attrs); + + /// @brief Processing of a container + void addContainer(const SUMOSAXAttributes& attrs); + + /// @brief Processing of a ride + void addRide(const SUMOSAXAttributes& attrs); + + /// @brief Processing of a transport + void addTransport(const SUMOSAXAttributes& attrs); + + /// @brief Processing of a tranship + void addTranship(const SUMOSAXAttributes& attrs); + +private: + /// @brief struct used for load person plans (Rides, Walks, etc.) + struct PersonPlansValues { + /// @brief default constructor + PersonPlansValues(); + + /// @brief return last valid edge (used to create consecutive person plans) + GNEEdge* getLastEdge() const; + + /// @brief walk tag + SumoXMLTag tag; + + /// @brief from edge + GNEEdge* from; + + /// @brief to edge + GNEEdge* to; + + /// @brief via edges + std::vector via; + + /// @brief list of edges + std::vector edges; + + /// @brief busStop + GNEAdditional* busStop; + + /// @brief containerStop + GNEAdditional* containerStop; + + /// @brief chargingStation + GNEAdditional* chargingStation; + + /// @brief parkingArea + GNEAdditional* parkingArea; + + /// @brief arrival route + GNEDemandElement* route; + + /// @brief vehicle types + std::vector vTypes; + + /// @brief modes + std::vector modes; + + /// @brief lines + std::vector lines; + + /// @brief arrival pos + double arrivalPos; + + /// @brief laneStop + GNELane* laneStop; + + /// @brief stop parameters + SUMOVehicleParameter::Stop stopParameters; + }; + + /// @brief pointer to GNENet + GNENet* myNet; + + /// @brief container for person trips loaded values + std::vector myPersonPlanValues; + + /// @brief NETEDIT Route Parameters + RouteParameter myRouteParameter; + + /// @brief flag to check if created demand elements must be undo and redo + bool myUndoDemandElements; + + /// @brief Pointer to loaded vehicle with embebbed route (needed for GNEStops) + GNEDemandElement* myLoadedVehicleWithEmbebbedRoute; + + /// @brief flag used for parsing values + bool myAbort; +}; + + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEStop.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEStop.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1090 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStop.cpp +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// Representation of Stops in NETEDIT +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEStop.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEStop::GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent) : + GNEDemandElement(stopParent, net, stopParent->getTagProperty().isPerson() ? GLO_PERSONSTOP : GLO_STOP, tag, +{}, {}, {}, {}, {stoppingPlace}, {stopParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +SUMOVehicleParameter::Stop(stopParameter) { +} + + +GNEStop::GNEStop(GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent) : + GNEDemandElement(stopParent, net, stopParent->getTagProperty().isPerson() ? GLO_PERSONSTOP : GLO_STOP, + stopParent->getTagProperty().isPerson() ? SUMO_TAG_PERSONSTOP_LANE : SUMO_TAG_STOP_LANE, +{}, {}, {lane}, {}, {}, {stopParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Childrens +SUMOVehicleParameter::Stop(stopParameter) { +} + + +GNEStop::~GNEStop() {} + + +std::string +GNEStop::getBegin() const { + return ""; +} + + +void +GNEStop::writeDemandElement(OutputDevice& device) const { + write(device); +} + + +bool +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; + } 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 (!(parametersSet & STOP_START_SET) && !(parametersSet & STOP_END_SET)) { + return true; + } else if (!(parametersSet & STOP_START_SET)) { + return (endPosCopy <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + } else if (!(parametersSet & STOP_END_SET)) { + return (startPosCopy >= 0); + } else { + 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 "; + } + return errorStart + separator + errorEnd; +} + + +void +GNEStop::fixDemandElementProblem() { + // +} + + +GNEEdge* +GNEStop::getFromEdge() const { + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); + } else { + return getParentLanes().front()->getParentEdge(); + } +} + + +GNEEdge* +GNEStop::getToEdge() const { + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); + } else { + return getParentLanes().front()->getParentEdge(); + } +} + + +SUMOVehicleClass +GNEStop::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNEStop::getColor() const { + if (myTagProperty.isPersonStop()) { + return myNet->getViewNet()->getVisualisationSettings().colorSettings.personStops; + } else { + return myNet->getViewNet()->getVisualisationSettings().colorSettings.stops; + } +} + + +void +GNEStop::startGeometryMoving() { + // only start geometry moving if stop is placed over a lane + if (getParentLanes().size() > 0) { + // always save original position over view + myStopMove.originalViewPosition = getPositionInView(); + // save start and end position + myStopMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_STARTPOS); + myStopMove.secondOriginalPosition = getAttribute(SUMO_ATTR_ENDPOS); + // save current centering boundary + myStopMove.movingGeometryBoundary = getCenteringBoundary(); + } +} + + +void +GNEStop::endGeometryMoving() { + // check that stop is placed over a lane and endGeometryMoving was called only once + if ((getParentLanes().size() > 0) && myStopMove.movingGeometryBoundary.isInitialised()) { + // reset myMovingGeometryBoundary + myStopMove.movingGeometryBoundary.reset(); + } +} + + +void +GNEStop::moveGeometry(const Position& offset) { + // only move if at leats start or end positions is defined + if ((getParentLanes().size() > 0) && ((parametersSet & STOP_START_SET) || (parametersSet & STOP_END_SET))) { + // Calculate new position using old position + Position newPosition = myStopMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + double offsetLane = getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(newPosition, false) - getParentLanes().front()->getLaneShape().nearest_offset_to_point2D(myStopMove.originalViewPosition, false); + // check if both position has to be moved + if ((parametersSet & STOP_START_SET) && (parametersSet & STOP_END_SET)) { + // calculate stoppingPlace length and lane length (After apply geometry factor) + double stoppingPlaceLength = fabs(parse(myStopMove.secondOriginalPosition) - parse(myStopMove.firstOriginalLanePosition)); + double laneLengt = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() * getParentLanes().front()->getLengthGeometryFactor(); + // avoid changing stopping place's length + if ((parse(myStopMove.firstOriginalLanePosition) + offsetLane) < 0) { + startPos = 0; + endPos = stoppingPlaceLength; + } else if ((parse(myStopMove.secondOriginalPosition) + offsetLane) > laneLengt) { + startPos = laneLengt - stoppingPlaceLength; + endPos = laneLengt; + } else { + startPos = parse(myStopMove.firstOriginalLanePosition) + offsetLane; + endPos = parse(myStopMove.secondOriginalPosition) + offsetLane; + } + } else { + // check if start position must be moved + if ((parametersSet & STOP_START_SET)) { + startPos = parse(myStopMove.firstOriginalLanePosition) + offsetLane; + } + // check if start position must be moved + if ((parametersSet & STOP_END_SET)) { + endPos = parse(myStopMove.secondOriginalPosition) + offsetLane; + } + } + // update geometry + updateGeometry(); + } +} + + +void +GNEStop::commitGeometryMoving(GNEUndoList* undoList) { + // only commit geometry moving if at leats start or end positions is defined + if ((getParentLanes().size() > 0) && ((parametersSet & STOP_START_SET) || (parametersSet & STOP_END_SET))) { + undoList->p_begin("position of " + getTagStr()); + if (parametersSet & STOP_START_SET) { + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_STARTPOS, toString(startPos), myStopMove.firstOriginalLanePosition)); + } + if (parametersSet & STOP_END_SET) { + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ENDPOS, toString(endPos), myStopMove.secondOriginalPosition)); + } + undoList->p_end(); + } +} + + +void +GNEStop::updateGeometry() { + //only update Stops over lanes, because other uses the geometry of stopping place parent + if (getParentLanes().size() > 0) { + // Cut shape using as delimitators fixed start position and fixed end position + myDemandElementGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); + } else if (getParentAdditionals().size() > 0) { + // use geometry of additional (busStop) + myDemandElementGeometry.updateGeometry(getParentAdditionals().at(0)); + } + // recompute geometry of all Demand elements related with this this stop + if (getParentDemandElements().front()->getTagProperty().isRoute()) { + getParentDemandElements().front()->updateGeometry(); + } else if (getParentDemandElements().front()->getTagProperty().isPerson()) { + // compute previous and next person plan + GNEDemandElement* previousDemandElement = getParentDemandElements().front()->getPreviousChildDemandElement(this); + if (previousDemandElement) { + previousDemandElement->updateGeometry(); + } + GNEDemandElement* nextDemandElement = getParentDemandElements().front()->getNextChildDemandElement(this); + if (nextDemandElement) { + nextDemandElement->updateGeometry(); + } + } +} + + +void +GNEStop::updateDottedContour() { + // +} + + +void +GNEStop::updatePartialGeometry(const GNEEdge* edge) { + //only update Stops over lanes, because other uses the geometry of stopping place parent + if (getParentLanes().size() > 0) { + // Cut shape using as delimitators fixed start position and fixed end position + myDemandElementGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), getStartGeometryPositionOverLane(), getEndGeometryPositionOverLane()); + } else if (getParentAdditionals().size() > 0) { + // use geometry of additional (busStop) + myDemandElementGeometry.updateGeometry(getParentAdditionals().at(0)); + } + // recompute geometry of all Demand elements related with this this stop + if (getParentDemandElements().front()->getTagProperty().isRoute()) { + getParentDemandElements().front()->updatePartialGeometry(edge); + } else if (getParentDemandElements().front()->getTagProperty().isPerson()) { + // compute previous and next person plan + GNEDemandElement* previousDemandElement = getParentDemandElements().front()->getPreviousChildDemandElement(this); + if (previousDemandElement) { + previousDemandElement->updatePartialGeometry(edge); + } + GNEDemandElement* nextDemandElement = getParentDemandElements().front()->getNextChildDemandElement(this); + if (nextDemandElement) { + nextDemandElement->updatePartialGeometry(edge); + } + } +} + + +void +GNEStop::computePath() { + // nothing to compute +} + + +void +GNEStop::invalidatePath() { + // nothing to invalidate +} + + +Position +GNEStop::getPositionInView() const { + if (getParentLanes().size() > 0) { + // calculate start and end positions as absolute values + double start = fabs(parametersSet & STOP_START_SET ? startPos : 0); + double end = fabs(parametersSet & STOP_END_SET ? endPos : getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()); + // obtain position in view depending if both positions are defined + if (!(parametersSet & STOP_START_SET) && !(parametersSet & STOP_END_SET)) { + return getParentLanes().front()->getLaneShape().positionAtOffset(getParentLanes().front()->getLaneShape().length() / 2); + } else if (!(parametersSet & STOP_START_SET)) { + return getParentLanes().front()->getLaneShape().positionAtOffset(end); + } else if (!(parametersSet & STOP_END_SET)) { + return getParentLanes().front()->getLaneShape().positionAtOffset(start); + } else { + return getParentLanes().front()->getLaneShape().positionAtOffset((start + end) / 2.0); + } + } else if (getParentDemandElements().size() > 0) { + return getParentDemandElements().front()->getPositionInView(); + } else { + throw ProcessError("Invalid Stop parent"); + } +} + + +std::string +GNEStop::getParentName() const { + if (getParentDemandElements().size() > 0) { + return getParentDemandElements().front()->getID(); + } else if (getParentAdditionals().size() > 0) { + return getParentAdditionals().front()->getID(); + } else if (getParentLanes().size() > 0) { + return getParentLanes().front()->getID(); + } else { + throw ProcessError("Invalid parent"); + } +} + + +Boundary +GNEStop::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (getParentAdditionals().size() > 0) { + return getParentAdditionals().at(0)->getCenteringBoundary(); + } else if (myStopMove.movingGeometryBoundary.isInitialised()) { + return myStopMove.movingGeometryBoundary; + } else if (myDemandElementGeometry.getShape().size() > 0) { + Boundary b = myDemandElementGeometry.getShape().getBoxBoundary(); + b.grow(20); + return b; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNEStop::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEStop::drawGL(const GUIVisualizationSettings& s) const { + // declare flag to enable or disable draw person plan + bool drawPersonPlan = false; + if (myTagProperty.isStop() || myTagProperty.isPersonStop()) { + 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()->getDottedAC() == getParentDemandElements().front()) { + drawPersonPlan = true; + } else if (myNet->getViewNet()->getDemandViewOptions().getLockedPerson() == getParentDemandElements().front()) { + drawPersonPlan = true; + } else if (myNet->getViewNet()->getDottedAC() && myNet->getViewNet()->getDottedAC()->getTagProperty().isPersonPlan() && + (myNet->getViewNet()->getDottedAC()->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT))) { + drawPersonPlan = true; + } + // check if stop can be drawn + if (drawPersonPlan) { + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, this); + // declare value to save stop color + RGBColor stopColor; + // Set color + if (drawUsingSelectColor()) { + if (myTagProperty.isPersonStop()) { + stopColor = s.colorSettings.selectedPersonPlanColor; + } else { + stopColor = s.colorSettings.selectedRouteColor; + } + } else if (myTagProperty.isPersonStop()) { + stopColor = s.colorSettings.personStops; + } else { + stopColor = s.colorSettings.stops; + } + // Start drawing adding an gl identificator + glPushName(getGlID()); + // Add a draw matrix + glPushMatrix(); + // set Color + GLHelper::setColor(stopColor); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, getType()); + // draw depending of details + if (s.drawDetail(s.detailSettings.stopsDetails, exaggeration) && getParentLanes().size() > 0) { + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), myDemandElementGeometry.getShapeRotations(), myDemandElementGeometry.getShapeLengths(), exaggeration * 0.1, 0, + getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); + GLHelper::drawBoxLines(myDemandElementGeometry.getShape(), myDemandElementGeometry.getShapeRotations(), myDemandElementGeometry.getShapeLengths(), exaggeration * 0.1, 0, + getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * -0.5); + // pop draw matrix + glPopMatrix(); + // Add a draw matrix + glPushMatrix(); + // move to geometry front + glTranslated(myDemandElementGeometry.getShape().back().x(), myDemandElementGeometry.getShape().back().y(), getType()); + glRotated(myDemandElementGeometry.getShapeRotations().back(), 0, 0, 1); + // draw front of Stop depending if it's placed over a lane or over a stoppingPlace + if (getParentLanes().size() > 0) { + // draw front of Stop + GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, + getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); + } else { + // draw front of Stop + GLHelper::drawBoxLine(Position(0, 0), 0, exaggeration * 0.5, exaggeration); + } + // move to "S" position + glTranslated(0, 1, 0); + // 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 draw matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + // draw dooted contour depending if it's placed over a lane or over a stoppingPlace + if (getParentLanes().size() > 0) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), myDemandElementGeometry.getShape(), + getParentLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(getParentLanes().front()->getIndex()) * 0.5); + } else { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), myDemandElementGeometry.getShape(), exaggeration); + } + } + } else { + // Draw the area using shape, shapeRotations, shapeLengths and value of exaggeration + GNEGeometry::drawGeometry(myNet->getViewNet(), myDemandElementGeometry, exaggeration * 0.8); + // pop draw matrix + glPopMatrix(); + } + // Pop name + glPopName(); + // 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); + } + } +} + + +std::string +GNEStop::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return 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_EXTENSION: + if (parametersSet & STOP_EXTENSION_SET) { + return time2string(extension); + } else { + return ""; + } + case SUMO_ATTR_INDEX: + if (index == STOP_INDEX_END) { + return "end"; + } else if (index == STOP_INDEX_FIT) { + return "fit"; + } else { + return toString(index); + } + 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"; + } else { + return "0"; + } + case SUMO_ATTR_EXPECTED: + if (parametersSet & STOP_EXPECTED_SET) { + 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) { + return tripId; + } else { + return ""; + } + // 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: + return getParentAdditionals().front()->getID(); + // specific of stops over lanes + case SUMO_ATTR_LANE: + return getParentLanes().front()->getID(); + case SUMO_ATTR_STARTPOS: + if (parametersSet & STOP_START_SET) { + return toString(startPos); + } else { + return ""; + } + case SUMO_ATTR_ENDPOS: + if (parametersSet & STOP_END_SET) { + return toString(endPos); + } else { + return ""; + } + 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 an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEStop::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_STARTPOS: + if (parametersSet & STOP_START_SET) { + return startPos; + } else { + return 0; + } + case SUMO_ATTR_ENDPOS: + if (parametersSet & STOP_END_SET) { + return endPos; + } else { + return getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEStop::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: + case SUMO_ATTR_DURATION: + case SUMO_ATTR_UNTIL: + case SUMO_ATTR_EXTENSION: + case SUMO_ATTR_INDEX: + 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 GNE_ATTR_SELECTED: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEStop::isValid(SumoXMLAttr key, const std::string& value) { + // declare string error + std::string error; + switch (key) { + case SUMO_ATTR_ID: + return isValidDemandElementID(value); + 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_INDEX: + if ((value == "fit") || (value == "end")) { + return true; + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + 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 true; + } else { + std::vector IDs = parse>(value); + for (const auto& i : IDs) { + if (SUMOXMLDefinitions::isValidVehicleID(i) == false) { + return false; + } + } + return true; + } + case SUMO_ATTR_PARKING: + return canParse(value); + case SUMO_ATTR_ACTTYPE: + return true; + case SUMO_ATTR_TRIP_ID: + return SUMOXMLDefinitions::isValidVehicleID(value); + // specific of Stops over stoppingPlaces + case SUMO_ATTR_BUS_STOP: + return (myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); + case SUMO_ATTR_CONTAINER_STOP: + return (myNet->retrieveAdditional(SUMO_TAG_CONTAINER_STOP, value, false) != nullptr); + case SUMO_ATTR_CHARGING_STATION: + return (myNet->retrieveAdditional(SUMO_TAG_CHARGING_STATION, value, false) != nullptr); + case SUMO_ATTR_PARKING_AREA: + return (myNet->retrieveAdditional(SUMO_TAG_PARKING_AREA, value, false) != nullptr); + // specific of stops over lanes + case SUMO_ATTR_LANE: + if (myNet->retrieveLane(value, false) != nullptr) { + return true; + } else { + return false; + } + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(parse(value), endPos, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPos); + } else { + return false; + } + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return SUMORouteHandler::isStopPosValid(startPos, parse(value), getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(), POSITION_EPS, friendlyPos); + } else { + return false; + } + 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 +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_STARTPOS: + newParametersSet |= STOP_START_SET; + break; + case SUMO_ATTR_ENDPOS: + newParametersSet |= STOP_END_SET; + break; + 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; + 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_STARTPOS: + if (parametersSet & STOP_END_SET) { + undoList->p_add(new GNEChange_Attribute(this, key, toString(endPos - MIN_STOP_LENGTH))); + } else { + undoList->p_add(new GNEChange_Attribute(this, key, toString(getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() - MIN_STOP_LENGTH))); + } + break; + case SUMO_ATTR_ENDPOS: + undoList->p_add(new GNEChange_Attribute(this, key, toString(getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()))); + break; + case SUMO_ATTR_DURATION: + undoList->p_add(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); + break; + case SUMO_ATTR_UNTIL: + case SUMO_ATTR_EXTENSION: + undoList->p_add(new GNEChange_Attribute(this, key, myTagProperty.getAttributeProperties(key).getDefaultValue())); + break; + default: + break; + } +} + + +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_STARTPOS: + newParametersSet &= ~STOP_START_SET; + break; + case SUMO_ATTR_ENDPOS: + newParametersSet &= ~STOP_END_SET; + break; + 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; + break; + default: + break; + } + // add GNEChange_EnableAttribute + undoList->add(new GNEChange_EnableAttribute(this, parametersSet, newParametersSet), true); +} + + +bool +GNEStop::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + // Currently stops parents cannot be edited + case SUMO_ATTR_BUS_STOP: + case SUMO_ATTR_CONTAINER_STOP: + case SUMO_ATTR_CHARGING_STATION: + case SUMO_ATTR_PARKING_AREA: + return false; + case SUMO_ATTR_STARTPOS: + return (parametersSet & STOP_START_SET) != 0; + case SUMO_ATTR_ENDPOS: + return (parametersSet & STOP_END_SET) != 0; + case SUMO_ATTR_DURATION: + return (parametersSet & STOP_DURATION_SET) != 0; + case SUMO_ATTR_UNTIL: + return (parametersSet & STOP_UNTIL_SET) != 0; + case SUMO_ATTR_EXTENSION: + return (parametersSet & STOP_EXTENSION_SET) != 0; + case SUMO_ATTR_EXPECTED: + return (parametersSet & STOP_TRIGGER_SET) != 0; + case SUMO_ATTR_EXPECTED_CONTAINERS: + return (parametersSet & STOP_CONTAINER_TRIGGER_SET) != 0; + case SUMO_ATTR_PARKING: + return (parametersSet & STOP_PARKING_SET) != 0; + default: + return true; + } +} + + +std::string +GNEStop::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEStop::getHierarchyName() const { + std::string stopType; + // first distinguish between person stops and vehicles stops + if (getParentDemandElements().front()->getTagProperty().isPerson()) { + stopType = "person stop"; + } else { + stopType = "vehicle stop"; + } + if (getParentAdditionals().size() > 0) { + return stopType + ": " + getParentAdditionals().front()->getTagStr(); + } else { + return stopType + ": lane"; + } +} + + +double +GNEStop::getStartGeometryPositionOverLane() const { + double fixedPos = 0; + if (parametersSet & STOP_START_SET) { + fixedPos = startPos; + } else if (parametersSet & STOP_END_SET) { + fixedPos = endPos - MIN_STOP_LENGTH; + } else { + fixedPos = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength() - MIN_STOP_LENGTH; + } + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + if (fixedPos < 0) { + fixedPos += len; + } + return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); +} + + +double +GNEStop::getEndGeometryPositionOverLane() const { + double fixedPos = 0; + if (parametersSet & STOP_END_SET) { + fixedPos = endPos; + } else { + fixedPos = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + } + const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength(); + if (fixedPos < 0) { + fixedPos += len; + } + return fixedPos * getParentLanes().front()->getLengthGeometryFactor(); +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEStop::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + 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_EXTENSION: + if (value.empty()) { + parametersSet &= ~STOP_EXTENSION_SET; + } else { + extension = string2time(value); + parametersSet |= STOP_EXTENSION_SET; + } + break; + case SUMO_ATTR_INDEX: + if (value == "fit") { + index = STOP_INDEX_FIT; + } else if (value == "end") { + index = STOP_INDEX_END; + } else { + index = parse(value); + } + 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; + } 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; + } + 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; + } + break; + case SUMO_ATTR_PARKING: + parking = parse(value); + break; + case SUMO_ATTR_ACTTYPE: + actType = value; + break; + case SUMO_ATTR_TRIP_ID: + if (value.empty()) { + parametersSet &= ~STOP_TRIP_ID_SET; + } else { + tripId = value; + parametersSet |= STOP_TRIP_ID_SET; + } + break; + // 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: + replaceParentAdditional(this, value, 0); + updateGeometry(); + break; + // specific of Stops over lanes + case SUMO_ATTR_LANE: + replaceParentLanes(this, value); + updateGeometry(); + break; + case SUMO_ATTR_STARTPOS: + if (value.empty()) { + parametersSet &= ~STOP_START_SET; + } else { + startPos = parse(value); + parametersSet |= STOP_START_SET; + } + updateGeometry(); + break; + case SUMO_ATTR_ENDPOS: + if (value.empty()) { + parametersSet &= ~STOP_END_SET; + } else { + endPos = parse(value); + parametersSet |= STOP_END_SET; + } + 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 +GNEStop::setEnabledAttribute(const int enabledAttributes) { + parametersSet = enabledAttributes; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEStop.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEStop.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,215 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStop.h +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// Representation of Stops in NETEDIT +/****************************************************************************/ +#pragma once +#include + +#include "GNEDemandElement.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEStop + */ +class GNEStop : public GNEDemandElement, public SUMOVehicleParameter::Stop { + +public: + /// @brief constructor used for stops over stoppingPlaces + GNEStop(SumoXMLTag tag, GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNEAdditional* stoppingPlace, GNEDemandElement* stopParent); + + /// @brief constructor used for stops over lanes + GNEStop(GNENet* net, const SUMOVehicleParameter::Stop& stopParameter, GNELane* lane, GNEDemandElement* stopParent); + + /// @brief destructor + ~GNEStop(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @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 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; + /// @} + + /// @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 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 start position over lane that is applicable to the shape + double getStartGeometryPositionOverLane() const; + + /// @brief get end position over lane that is applicable to the shape + double getEndGeometryPositionOverLane() const; + +protected: + /// @brief variable demand element move + DemandElementMove myStopMove; + +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 Invalidated copy constructor. + GNEStop(const GNEStop&) = delete; + + /// @brief Invalidated assignment operator + GNEStop& operator=(const GNEStop&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicle.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicle.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicle.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1817 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVehicle.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// Representation of vehicles in NETEDIT +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEVehicle.h" +#include "GNERouteHandler.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +FXDEFMAP(GNEVehicle::GNESingleVehiclePopupMenu) GNESingleVehiclePopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_VEHICLE_TRANSFORM, GNEVehicle::GNESingleVehiclePopupMenu::onCmdTransform), +}; + +FXDEFMAP(GNEVehicle::GNESelectedVehiclesPopupMenu) GNESelectedVehiclesPopupMenuMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_VEHICLE_TRANSFORM, GNEVehicle::GNESelectedVehiclesPopupMenu::onCmdTransform), +}; + +// Object implementation +FXIMPLEMENT(GNEVehicle::GNESingleVehiclePopupMenu, GUIGLObjectPopupMenu, GNESingleVehiclePopupMenuMap, ARRAYNUMBER(GNESingleVehiclePopupMenuMap)) +FXIMPLEMENT(GNEVehicle::GNESelectedVehiclesPopupMenu, GUIGLObjectPopupMenu, GNESelectedVehiclesPopupMenuMap, ARRAYNUMBER(GNESelectedVehiclesPopupMenuMap)) + +// =========================================================================== +// GNEVehicle::GNESingleVehiclePopupMenu +// =========================================================================== + +GNEVehicle::GNESingleVehiclePopupMenu::GNESingleVehiclePopupMenu(GNEVehicle* vehicle, GUIMainWindow& app, GUISUMOAbstractView& parent) : + GUIGLObjectPopupMenu(app, parent, *vehicle), + myVehicle(vehicle), + myTransformToVehicle(nullptr), + myTransformToVehicleWithEmbeddedRoute(nullptr), + myTransformToRouteFlow(nullptr), + myTransformToRouteFlowWithEmbeddedRoute(nullptr), + myTransformToTrip(nullptr), + myTransformToFlow(nullptr) { + // build header + myVehicle->buildPopupHeader(this, app); + // build menu command for center button and copy cursor position to clipboard + myVehicle->buildCenterPopupEntry(this); + myVehicle->buildPositionCopyEntry(this, false); + // buld menu commands for names + new FXMenuCommand(this, ("Copy " + myVehicle->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); + new FXMenuCommand(this, ("Copy " + myVehicle->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); + new FXMenuSeparator(this); + // build selection and show parameters menu + myVehicle->getNet()->getViewNet()->buildSelectionACPopupEntry(this, myVehicle); + myVehicle->buildShowParamsPopupEntry(this); + // add transform functions only in demand mode + if (myVehicle->getNet()->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + // Get icons + FXIcon* vehicleIcon = GUIIconSubSys::getIcon(GUIIcon::VEHICLE); + FXIcon* tripIcon = GUIIconSubSys::getIcon(GUIIcon::TRIP); + FXIcon* routeFlowIcon = GUIIconSubSys::getIcon(GUIIcon::ROUTEFLOW); + FXIcon* flowIcon = GUIIconSubSys::getIcon(GUIIcon::FLOW); + // create menu pane for transform operations + FXMenuPane* transformOperation = new FXMenuPane(this); + this->insertMenuPaneChild(transformOperation); + new FXMenuCascade(this, "transform to", nullptr, transformOperation); + // Create menu comands for all transform + myTransformToVehicle = new FXMenuCommand(transformOperation, "Vehicle", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, "Vehicle (embedded route)", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToRouteFlow = new FXMenuCommand(transformOperation, "RouteFlow", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, "RouteFlow (embedded route)", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToTrip = new FXMenuCommand(transformOperation, "Trip", tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToFlow = new FXMenuCommand(transformOperation, "Flow", flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + // check what menu command has to be disabled + if (myVehicle->getTagProperty().getTag() == SUMO_TAG_VEHICLE) { + if (myVehicle->getParentDemandElements().size() > 1) { + myTransformToVehicle->disable(); + } else { + myTransformToVehicleWithEmbeddedRoute->disable(); + } + } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW) { + if (myVehicle->getParentDemandElements().size() > 1) { + myTransformToRouteFlow->disable(); + } else { + myTransformToRouteFlowWithEmbeddedRoute->disable(); + } + } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_TRIP) { + myTransformToTrip->disable(); + } else if (myVehicle->getTagProperty().getTag() == SUMO_TAG_FLOW) { + myTransformToFlow->disable(); + } + } +} + + +GNEVehicle::GNESingleVehiclePopupMenu::~GNESingleVehiclePopupMenu() {} + + +long +GNEVehicle::GNESingleVehiclePopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { + if (obj == myTransformToVehicle) { + GNERouteHandler::transformToVehicle(myVehicle, false); + } else if (obj == myTransformToVehicleWithEmbeddedRoute) { + GNERouteHandler::transformToVehicle(myVehicle, true); + } else if (obj == myTransformToRouteFlow) { + GNERouteHandler::transformToRouteFlow(myVehicle, false); + } else if (obj == myTransformToRouteFlowWithEmbeddedRoute) { + GNERouteHandler::transformToRouteFlow(myVehicle, true); + } else if (obj == myTransformToTrip) { + GNERouteHandler::transformToTrip(myVehicle); + } else if (obj == myTransformToFlow) { + GNERouteHandler::transformToFlow(myVehicle); + } + return 1; +} + +// =========================================================================== +// GNEVehicle::GNESelectedVehiclesPopupMenu +// =========================================================================== + +GNEVehicle::GNESelectedVehiclesPopupMenu::GNESelectedVehiclesPopupMenu(GNEVehicle* vehicle, const std::vector& selectedVehicle, GUIMainWindow& app, GUISUMOAbstractView& parent) : + GUIGLObjectPopupMenu(app, parent, *vehicle), + mySelectedVehicles(selectedVehicle), + myVehicleTag(vehicle->getTagProperty().getTag()), + myTransformToVehicle(nullptr), + myTransformToVehicleWithEmbeddedRoute(nullptr), + myTransformToRouteFlow(nullptr), + myTransformToRouteFlowWithEmbeddedRoute(nullptr), + myTransformToTrip(nullptr), + myTransformToFlow(nullptr), + myTransformAllVehiclesToVehicle(nullptr), + myTransformAllVehiclesToVehicleWithEmbeddedRoute(nullptr), + myTransformAllVehiclesToRouteFlow(nullptr), + myTransformAllVehiclesToRouteFlowWithEmbeddedRoute(nullptr), + myTransformAllVehiclesToTrip(nullptr), + myTransformAllVehiclesToFlow(nullptr) { + // build header + vehicle->buildPopupHeader(this, app); + // build menu command for center button and copy cursor position to clipboard + vehicle->buildCenterPopupEntry(this); + vehicle->buildPositionCopyEntry(this, false); + // buld menu commands for names + new FXMenuCommand(this, ("Copy " + vehicle->getTagStr() + " name to clipboard").c_str(), nullptr, this, MID_COPY_NAME); + new FXMenuCommand(this, ("Copy " + vehicle->getTagStr() + " typed name to clipboard").c_str(), nullptr, this, MID_COPY_TYPED_NAME); + new FXMenuSeparator(this); + // build selection and show parameters menu + vehicle->getNet()->getViewNet()->buildSelectionACPopupEntry(this, vehicle); + vehicle->buildShowParamsPopupEntry(this); + // add transform functions only in demand mode + if (vehicle->getNet()->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + // Get icons + FXIcon* vehicleIcon = GUIIconSubSys::getIcon(GUIIcon::VEHICLE); + FXIcon* tripIcon = GUIIconSubSys::getIcon(GUIIcon::TRIP); + FXIcon* routeFlowIcon = GUIIconSubSys::getIcon(GUIIcon::ROUTEFLOW); + FXIcon* flowIcon = GUIIconSubSys::getIcon(GUIIcon::FLOW); + // create menu pane for transform operations + FXMenuPane* transformOperation = new FXMenuPane(this); + this->insertMenuPaneChild(transformOperation); + new FXMenuCascade(this, "transform to", nullptr, transformOperation); + // Create menu comands for all transform + myTransformToVehicle = new FXMenuCommand(transformOperation, + ("Vehicles (Only " + vehicle->getTagStr() + ")").c_str(), vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, + ("Vehicles (embedded route, only " + vehicle->getTagStr() + ")").c_str(), vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToRouteFlow = new FXMenuCommand(transformOperation, + ("RouteFlows (Only " + vehicle->getTagStr() + ")").c_str(), routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, + ("RouteFlows (embedded route, only " + vehicle->getTagStr() + ")").c_str(), routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToTrip = new FXMenuCommand(transformOperation, + ("Trips (Only " + vehicle->getTagStr() + ")").c_str(), tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformToFlow = new FXMenuCommand(transformOperation, + ("Flows (Only " + vehicle->getTagStr() + ")").c_str(), flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + // create separator + new FXMenuSeparator(transformOperation); + // Create menu comands for all transform all vehicles + myTransformAllVehiclesToVehicle = new FXMenuCommand(transformOperation, "Vehicles", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformAllVehiclesToVehicleWithEmbeddedRoute = new FXMenuCommand(transformOperation, "Vehicles (embedded route)", vehicleIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformAllVehiclesToRouteFlow = new FXMenuCommand(transformOperation, "RouteFlows", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformAllVehiclesToRouteFlowWithEmbeddedRoute = new FXMenuCommand(transformOperation, "RouteFlows (embedded route)", routeFlowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformAllVehiclesToTrip = new FXMenuCommand(transformOperation, "Trips", tripIcon, this, MID_GNE_VEHICLE_TRANSFORM); + myTransformAllVehiclesToFlow = new FXMenuCommand(transformOperation, "Flows", flowIcon, this, MID_GNE_VEHICLE_TRANSFORM); + } +} + + +GNEVehicle::GNESelectedVehiclesPopupMenu::~GNESelectedVehiclesPopupMenu() {} + + +long +GNEVehicle::GNESelectedVehiclesPopupMenu::onCmdTransform(FXObject* obj, FXSelector, void*) { + // iterate over all selected vehicles + for (const auto& i : mySelectedVehicles) { + if ((obj == myTransformToVehicle) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToVehicle(i, false); + } else if ((obj == myTransformToVehicleWithEmbeddedRoute) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToVehicle(i, true); + } else if ((obj == myTransformToRouteFlow) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToRouteFlow(i, false); + } else if ((obj == myTransformToRouteFlowWithEmbeddedRoute) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToRouteFlow(i, true); + } else if ((obj == myTransformToTrip) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToTrip(i); + } else if ((obj == myTransformToFlow) && + (i->getTagProperty().getTag() == myVehicleTag)) { + GNERouteHandler::transformToFlow(i); + } else if (obj == myTransformAllVehiclesToVehicle) { + GNERouteHandler::transformToVehicle(i, false); + } else if (obj == myTransformAllVehiclesToVehicleWithEmbeddedRoute) { + GNERouteHandler::transformToVehicle(i, true); + } else if (obj == myTransformAllVehiclesToRouteFlow) { + GNERouteHandler::transformToRouteFlow(i, false); + } else if (obj == myTransformAllVehiclesToRouteFlowWithEmbeddedRoute) { + GNERouteHandler::transformToRouteFlow(i, true); + } else if (obj == myTransformAllVehiclesToTrip) { + GNERouteHandler::transformToTrip(i); + } else if (obj == myTransformAllVehiclesToFlow) { + GNERouteHandler::transformToFlow(i); + } + } + return 1; +} + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route) : + GNEDemandElement(vehicleID, net, (tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, tag, +{}, {}, {}, {}, {}, {vehicleType, route}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +SUMOVehicleParameter() { + // SUMOVehicleParameter ID has to be set manually + id = vehicleID; + // set manually vtypeID (needed for saving) + vtypeid = vehicleType->getID(); +} + + +GNEVehicle::GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters) : + GNEDemandElement(vehicleParameters.id, net, (vehicleParameters.tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, vehicleParameters.tag, +{}, {}, {}, {}, {}, {vehicleType, route}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +SUMOVehicleParameter(vehicleParameters) { + // SUMOVehicleParameter ID has to be set manually + id = vehicleParameters.id; + // set manually vtypeID (needed for saving) + vtypeid = vehicleType->getID(); +} + + +GNEVehicle::GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, const SUMOVehicleParameter& vehicleParameters) : + GNEDemandElement(vehicleParameters.id, net, (vehicleParameters.tag == SUMO_TAG_ROUTEFLOW) ? GLO_ROUTEFLOW : GLO_VEHICLE, vehicleParameters.tag, +{}, {}, {}, {}, {}, {vehicleType}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +SUMOVehicleParameter(vehicleParameters) { + // SUMOVehicleParameter ID has to be set manually + id = vehicleParameters.id; + // reset routeid + routeid.clear(); + // set manually vtypeID (needed for saving) + vtypeid = vehicleType->getID(); +} + + +GNEVehicle::GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::vector& via) : + GNEDemandElement(vehicleID, net, (tag == SUMO_TAG_FLOW) ? GLO_FLOW : GLO_TRIP, tag, +{}, {fromEdge, toEdge}, {}, {}, {}, {vehicleType}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +SUMOVehicleParameter() { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute vehicle + computePath(); +} + + +GNEVehicle::GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, + const SUMOVehicleParameter& vehicleParameters) : + GNEDemandElement(vehicleParameters.id, net, (vehicleParameters.tag == SUMO_TAG_FLOW) ? GLO_FLOW : GLO_TRIP, vehicleParameters.tag, +{}, {fromEdge, toEdge}, {}, {}, {}, {vehicleType}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +SUMOVehicleParameter(vehicleParameters) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute vehicle + computePath(); +} + + +GNEVehicle::~GNEVehicle() {} + + +std::string +GNEVehicle::getBegin() const { + // obtain depart depending if is a Vehicle, trip or routeFlow + std::string departStr; + if ((myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + departStr = toString(depart); + } else { + departStr = getDepart(); + } + // we need to handle depart as a tuple of 20 numbers (format: 000000...00) + departStr.reserve(20 - departStr.size()); + // add 0s at the beginning of departStr until we have 20 numbers + for (int i = (int)departStr.size(); i < 20; i++) { + departStr.insert(departStr.begin(), '0'); + } + return departStr; +} + + +void +GNEVehicle::writeDemandElement(OutputDevice& device) const { + // obtain tag depending if tagProperty has a synonym + SumoXMLTag synonymTag = myTagProperty.hasTagSynonym() ? myTagProperty.getTagSynonym() : myTagProperty.getTag(); + // 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(), synonymTag); + // set VType parameter again + parametersSet |= VEHPARS_VTYPE_SET; + } else { + // write vehicle attributes, including VType + write(device, OptionsCont::getOptions(), synonymTag, getParentDemandElements().at(0)->getID()); + } + // write specific attribute depeding of tag property + if ((getParentDemandElements().size() == 2) && (myTagProperty.getTag() == SUMO_TAG_VEHICLE || myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + // write manually route + device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); + } + // write from, to and edge vias + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // write manually from/to edges (it correspond to fron and back parent edges) + device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + // only write via if there isn't empty + if (via.size() > 0) { + device.writeAttr(SUMO_ATTR_VIA, via); + } + } + // write specific routeFlow/flow attributes + if ((myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // write routeFlow values depending if it was set + if (isAttributeEnabled(SUMO_ATTR_END)) { + device.writeAttr(SUMO_ATTR_END, time2string(repetitionEnd)); + } + if (isAttributeEnabled(SUMO_ATTR_NUMBER)) { + device.writeAttr(SUMO_ATTR_NUMBER, repetitionNumber); + } + if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { + device.writeAttr(SUMO_ATTR_VEHSPERHOUR, 3600. / STEPS2TIME(repetitionOffset)); + } + if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { + device.writeAttr(SUMO_ATTR_PERIOD, time2string(repetitionOffset)); + } + if (isAttributeEnabled(SUMO_ATTR_PROB)) { + device.writeAttr(SUMO_ATTR_PROB, repetitionProbability); + } + } + // write parameters + writeParams(device); + // write child demand elements associated to this vehicle + for (const auto& i : getChildDemandElements()) { + i->writeDemandElement(device); + } + // close vehicle tag + device.closeTag(); +} + + +bool +GNEVehicle::isDemandElementValid() const { + // only trips or flows can have problems + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // check if from and to are the same edges + if ((getParentEdges().size() == 2) && (getParentEdges().at(0) == getParentEdges().at(1))) { + return true; + } else if (getPathEdges().size() > 0) { + // if path edges isn't empty, then there is a valid route + return true; + } else { + return false; + } + } else if (getParentDemandElements().size() == 2) { + // check if exist a valid path using route parent edges + if (myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentDemandElements().at(1)->getParentEdges()).size() > 0) { + return true; + } else { + return false; + } + } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE)) { + // check if exist a valid path using embebbed route edges + if (myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getChildDemandElements().front()->getParentEdges()).size() > 0) { + return true; + } else { + return false; + } + } else { + return false; + } +} + + +std::string +GNEVehicle::getDemandElementProblem() const { + // only trips or flows can have problems + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // check if exist at least a connection between every edge + for (int i = 1; i < (int)getParentEdges().size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { + return ("There is no valid path between edges '" + getParentEdges().at((int)i - 1)->getID() + "' and '" + getParentEdges().at(i)->getID() + "'"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } else if (getParentDemandElements().size() == 2) { + // get route parent edges + const std::vector& routeEdges = getParentDemandElements().at(1)->getParentEdges(); + // check if exist at least a connection between every edge + for (int i = 1; i < (int)routeEdges.size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), routeEdges.at((int)i - 1), routeEdges.at(i)) == false) { + return ("There is no valid path between route edges '" + routeEdges.at((int)i - 1)->getID() + "' and '" + routeEdges.at(i)->getID() + "'"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } else if (getChildDemandElements().size() > 0 && (getChildDemandElements().front()->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE)) { + // get embebbed route edges + const std::vector& routeEdges = getChildDemandElements().front()->getParentEdges(); + // check if exist at least a connection between every edge + for (int i = 1; i < (int)routeEdges.size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().at(0)->getVClass(), routeEdges.at((int)i - 1), routeEdges.at(i)) == false) { + return ("There is no valid path between embebbed route edges '" + routeEdges.at((int)i - 1)->getID() + "' and '" + routeEdges.at(i)->getID() + "'"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } else { + return ""; + } +} + + +void +GNEVehicle::fixDemandElementProblem() { + +} + + +GNEEdge* +GNEVehicle::getFromEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain edge of route + return getParentDemandElements().at(1)->getFromEdge(); + } else if (getParentEdges().size() > 0) { + return getParentEdges().front(); + } else if (getChildDemandElements().size() > 0) { + // obtain edge of embedded route + return getChildDemandElements().at(0)->getFromEdge(); + } else { + throw ProcessError("Undefined from edge"); + } +} + + +GNEEdge* +GNEVehicle::getToEdge() const { + if (getParentDemandElements().size() == 2) { + // oobtain edge of route + return getParentDemandElements().at(1)->getToEdge(); + } else if (getParentEdges().size() > 0) { + return getParentEdges().back(); + } else if (getChildDemandElements().size() > 0) { + // obtain edge of embedded route + return getChildDemandElements().at(0)->getToEdge(); + } else { + throw ProcessError("Undefined to edge"); + } +} + + +SUMOVehicleClass +GNEVehicle::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNEVehicle::getColor() const { + return color; +} + + +void +GNEVehicle::startGeometryMoving() { + // Vehicles cannot be moved +} + + +void +GNEVehicle::endGeometryMoving() { + // Vehicles cannot be moved +} + + +void +GNEVehicle::moveGeometry(const Position&) { + // Vehicles cannot be moved +} + + +void +GNEVehicle::commitGeometryMoving(GNEUndoList*) { + // Vehicles cannot be moved +} + + +void +GNEVehicle::updateGeometry() { + // update spread geometry + updateSpreadGeometry(); + // update stacked geometry + updateStackedGeometry(); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + + +void +GNEVehicle::updateDottedContour() { + // +} + + +void +GNEVehicle::updatePartialGeometry(const GNEEdge* edge) { + // update partial spread geometry + updatePartialSpreadGeometry(edge); + // update partial stacked geometry + updatePartialStackedGeometry(edge); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNEVehicle::computePath() { + // calculate route and update routeEdges (only for flows and trips) + if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentEdges())); + } + // update geometry + updateGeometry(); +} + + +void +GNEVehicle::invalidatePath() { + // calculate route and update routeEdges (only for flows and trips) + if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_TRIP)) { + replacePathEdges(this, getParentEdges()); + } + // update geometry + updateGeometry(); +} + + +Position +GNEVehicle::getPositionInView() const { + // obtain lane + GNELane* lane = getFromEdge()->getLanes().front(); + // get position depending of lane's length + if (lane->getLaneShape().length() < 2.5) { + return lane->getLaneShape().front(); + } else { + Position A = lane->getLaneShape().positionAtOffset(2.5); + Position B = lane->getLaneShape().positionAtOffset(2.5); + // return Middle point + return Position((A.x() + B.x()) / 2, (A.y() + B.y()) / 2); + } +} + + +GUIGLObjectPopupMenu* +GNEVehicle::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + if (isAttributeCarrierSelected()) { + // obtain all selected vehicles + std::vector selectedDemandElements = myNet->retrieveDemandElements(true); + std::vector selectedVehicles; + selectedVehicles.reserve(selectedDemandElements.size()); + for (const auto& i : selectedDemandElements) { + if (i->getTagProperty().isVehicle()) { + selectedVehicles.push_back(dynamic_cast(i)); + } + } + // return a GNESelectedVehiclesPopupMenu + return new GNESelectedVehiclesPopupMenu(this, selectedVehicles, app, parent); + } else { + // return a GNESingleVehiclePopupMenu + return new GNESingleVehiclePopupMenu(this, app, parent); + } +} + + +std::string +GNEVehicle::getParentName() const { + if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + return getParentDemandElements().at(1)->getID(); + } else if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + return getParentEdges().front()->getID(); + } else { + throw ProcessError("Invalid vehicle tag"); + } +} + + +Boundary +GNEVehicle::getCenteringBoundary() const { + Boundary vehicleBoundary; + vehicleBoundary.add(getFromEdge()->getLanes().front()->getLaneShape().front()); + vehicleBoundary.grow(20); + return vehicleBoundary; +} + + +void +GNEVehicle::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* /*newElement*/, GNEUndoList* /*undoList*/) { + // geometry of this element cannot be splitted +} + + +void +GNEVehicle::drawGL(const GUIVisualizationSettings& s) const { + // only drawn in super mode demand + if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements() && myNet->getViewNet()->getDataViewOptions().showDemandElements() && + myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(this)) { + // declare common attributes + const bool drawSpreadVehicles = (myNet->getViewNet()->getNetworkViewOptions().drawSpreadVehicles() || myNet->getViewNet()->getDemandViewOptions().drawSpreadVehicles()); + const double exaggeration = s.vehicleSize.getExaggeration(s, this); + const double width = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_WIDTH); + const double length = getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_LENGTH); + const double vehicleSizeSquared = (width * width) * (length * length) * (exaggeration * exaggeration); + // obtain Position an rotation (depending of draw spread vehicles) + const Position vehiclePosition = drawSpreadVehicles ? mySpreadGeometry.getPosition() : myDemandElementGeometry.getPosition(); + const double vehicleRotation = drawSpreadVehicles ? mySpreadGeometry.getRotation() : myDemandElementGeometry.getRotation(); + // check that position is valid + if (vehiclePosition != Position::INVALID) { + // first push name + glPushName(getGlID()); + // first check if if mouse is enought near to this vehicle to draw it + if (s.drawForRectangleSelection && (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(vehiclePosition) >= (vehicleSizeSquared + 2))) { + // push draw matrix + glPushMatrix(); + // translate to drawing position + glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1); + glRotated(vehicleRotation, 0, 0, 1); + // extra translation needed to draw vehicle over edge (to avoid selecting problems) + glTranslated(0, (-1) * length, 0); + GLHelper::drawBoxLine(Position(0, 1), 0, 2, 1); + // Pop last matrix + glPopMatrix(); + } else { + SUMOVehicleShape shape = getVehicleShapeID(getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE)); + // push draw matrix + glPushMatrix(); + // translate to drawing position + glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1); + glRotated(vehicleRotation, 0, 0, 1); + // extra translation needed to draw vehicle over edge (to avoid selecting problems) + glTranslated(0, (-1) * length, 0); + // set lane color + setColor(s); + double upscaleLength = exaggeration; + if ((exaggeration > 1) && (length > 5)) { + // reduce the length/width ratio because this is not usefull at high zoom + upscaleLength = MAX2(1.0, upscaleLength * (5 + sqrt(length - 5)) / length); + } + glScaled(exaggeration, upscaleLength, 1); + // check if we're drawing in selecting mode + if (s.drawForRectangleSelection) { + // draw vehicle as a box and don't draw the rest of details + GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(width, length); + } else { + // draw the vehicle depending of detail level + if (s.drawDetail(s.detailSettings.vehicleShapes, exaggeration)) { + GUIBaseVehicleHelper::drawAction_drawVehicleAsPoly(s, shape, width, length); + } else if (s.drawDetail(s.detailSettings.vehicleBoxes, exaggeration)) { + GUIBaseVehicleHelper::drawAction_drawVehicleAsBoxPlus(width, length); + } 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); + glColor3d(0., 1., 0.); + glBegin(GL_LINES); + glVertex2d(0., 0); + glVertex2d(0., minGap); + glVertex2d(-.5, minGap); + glVertex2d(.5, minGap); + glEnd(); + } + // drawing name at GLO_MAX fails unless translating z + glTranslated(0, MIN2(length / 2, double(5)), -getType()); + glScaled(1 / exaggeration, 1 / upscaleLength, 1); + glRotated(-1 * 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 != "") { + glTranslated(0, 0.6 * s.vehicleName.scaledSize(s.scale), 0); + GLHelper::drawTextSettings(s.vehicleName, "line:" + line, Position(0, 0), s.scale, s.angle); + } + } + // pop draw matrix + glPopMatrix(); + // draw stack label + if ((myStackedLabelNumber > 0) && !drawSpreadVehicles) { + drawStackLabel(vehiclePosition, vehicleRotation, width, length); + } + // draw flow label + if ((myTagProperty.getTag() == SUMO_TAG_FLOW) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + drawFlowLabel(vehiclePosition, vehicleRotation, width, length); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GLHelper::drawShapeDottedContourRectangle(s, getType(), vehiclePosition, width, length, vehicleRotation, 0, length / (-2)); + } + } + // pop name + glPopName(); + } + } +} + + +std::string +GNEVehicle::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_TYPE: + return getParentDemandElements().at(0)->getID(); + case SUMO_ATTR_COLOR: + if (wasSet(VEHPARS_COLOR_SET)) { + return toString(color); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_COLOR); + } + case SUMO_ATTR_DEPARTLANE: + if (wasSet(VEHPARS_DEPARTLANE_SET)) { + return getDepartLane(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTLANE); + } + case SUMO_ATTR_DEPARTPOS: + if (wasSet(VEHPARS_DEPARTPOS_SET)) { + return getDepartPos(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS); + } + case SUMO_ATTR_DEPARTSPEED: + if (wasSet(VEHPARS_DEPARTSPEED_SET)) { + return getDepartSpeed(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTSPEED); + } + case SUMO_ATTR_ARRIVALLANE: + if (wasSet(VEHPARS_ARRIVALLANE_SET)) { + return getArrivalLane(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALLANE); + } + case SUMO_ATTR_ARRIVALPOS: + if (wasSet(VEHPARS_ARRIVALPOS_SET)) { + return getArrivalPos(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALPOS); + } + case SUMO_ATTR_ARRIVALSPEED: + if (wasSet(VEHPARS_ARRIVALSPEED_SET)) { + return getArrivalSpeed(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALSPEED); + } + case SUMO_ATTR_LINE: + if (wasSet(VEHPARS_LINE_SET)) { + return line; + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_LINE); + } + case SUMO_ATTR_PERSON_NUMBER: + if (wasSet(VEHPARS_PERSON_NUMBER_SET)) { + return toString(personNumber); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_PERSON_NUMBER); + } + case SUMO_ATTR_CONTAINER_NUMBER: + if (wasSet(VEHPARS_CONTAINER_NUMBER_SET)) { + return toString(containerNumber); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_CONTAINER_NUMBER); + } + case SUMO_ATTR_REROUTE: + if (wasSet(VEHPARS_CONTAINER_NUMBER_SET)) { + return "true"; + } else { + return "false"; + } + case SUMO_ATTR_DEPARTPOS_LAT: + if (wasSet(VEHPARS_DEPARTPOSLAT_SET)) { + return getDepartPosLat(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_DEPARTPOS_LAT); + } + case SUMO_ATTR_ARRIVALPOS_LAT: + if (wasSet(VEHPARS_ARRIVALPOSLAT_SET)) { + return getArrivalPosLat(); + } else { + return myTagProperty.getDefaultValue(SUMO_ATTR_ARRIVALPOS_LAT); + } + // Specific of vehicles + case SUMO_ATTR_DEPART: + return time2string(depart); + case SUMO_ATTR_ROUTE: + if (getParentDemandElements().size() == 2) { + return getParentDemandElements().at(1)->getID(); + } else { + return ""; + } + // Specific of Trips + case SUMO_ATTR_FROM: + return getParentEdges().front()->getID(); + case SUMO_ATTR_TO: + return getParentEdges().back()->getID(); + case SUMO_ATTR_VIA: + return toString(via); + // Specific of routeFlows + case SUMO_ATTR_BEGIN: + return time2string(depart); + case SUMO_ATTR_END: + return time2string(repetitionEnd); + case SUMO_ATTR_VEHSPERHOUR: + return toString(3600 / STEPS2TIME(repetitionOffset)); + case SUMO_ATTR_PERIOD: + return time2string(repetitionOffset); + case SUMO_ATTR_PROB: + return toString(repetitionProbability); + case SUMO_ATTR_NUMBER: + return toString(repetitionNumber); + // + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEVehicle::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_DEPART: + case SUMO_ATTR_BEGIN: + return STEPS2TIME(depart); + case SUMO_ATTR_DEPARTPOS: + // check if depart and arrival pos lanes are defined + if (departPosProcedure == DEPART_POS_GIVEN) { + return departPos; + } else { + return 0; + } + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_MINGAP: + return getParentDemandElements().at(0)->getAttributeDouble(key); + default: + throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEVehicle::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: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_COLOR: + case SUMO_ATTR_DEPARTLANE: + case SUMO_ATTR_DEPARTPOS: + case SUMO_ATTR_DEPARTSPEED: + case SUMO_ATTR_ARRIVALLANE: + case SUMO_ATTR_ARRIVALPOS: + case SUMO_ATTR_ARRIVALSPEED: + case SUMO_ATTR_LINE: + case SUMO_ATTR_PERSON_NUMBER: + case SUMO_ATTR_CONTAINER_NUMBER: + case SUMO_ATTR_REROUTE: + case SUMO_ATTR_DEPARTPOS_LAT: + case SUMO_ATTR_ARRIVALPOS_LAT: + // Specific of vehicles + case SUMO_ATTR_DEPART: + case SUMO_ATTR_ROUTE: + // Specific of Trips + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_VIA: + // + // Specific of routeFlows + case SUMO_ATTR_BEGIN: + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + case SUMO_ATTR_VEHSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + // + case GNE_ATTR_PARAMETERS: + case GNE_ATTR_SELECTED: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEVehicle::isValid(SumoXMLAttr key, const std::string& value) { + // declare string error + std::string error; + switch (key) { + case SUMO_ATTR_ID: + // Vehicles, Trips and Flows share namespace + if (SUMOXMLDefinitions::isValidVehicleID(value) && + (myNet->retrieveDemandElement(SUMO_TAG_VEHICLE, value, false) == nullptr) && + (myNet->retrieveDemandElement(SUMO_TAG_TRIP, value, false) == nullptr) && + (myNet->retrieveDemandElement(SUMO_TAG_ROUTEFLOW, value, false) == nullptr) && + (myNet->retrieveDemandElement(SUMO_TAG_FLOW, value, false) == nullptr)) { + return true; + } else { + return false; + } + case SUMO_ATTR_TYPE: + return SUMOXMLDefinitions::isValidTypeID(value) && (myNet->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) != nullptr); + case SUMO_ATTR_COLOR: + return canParse(value); + case SUMO_ATTR_DEPARTLANE: { + int dummyDepartLane; + DepartLaneDefinition dummyDepartLaneProcedure; + parseDepartLane(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartLane, dummyDepartLaneProcedure, error); + // if error is empty, check if depart lane is correct + if (error.empty()) { + if (dummyDepartLaneProcedure != DEPART_LANE_GIVEN) { + return true; + } else { + return dummyDepartLane < (int)getFromEdge()->getLanes().size(); + } + } else { + return false; + } + } + case SUMO_ATTR_DEPARTPOS: { + double dummyDepartPos; + DepartPosDefinition dummyDepartPosProcedure; + parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPos, dummyDepartPosProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_DEPARTSPEED: { + double dummyDepartSpeed; + DepartSpeedDefinition dummyDepartSpeedProcedure; + parseDepartSpeed(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartSpeed, dummyDepartSpeedProcedure, error); + // if error is empty, check if depart speed is correct + if (error.empty()) { + if (dummyDepartSpeedProcedure != DEPART_SPEED_GIVEN) { + return true; + } else { + return (dummyDepartSpeed <= getParentDemandElements().at(0)->getAttributeDouble(SUMO_ATTR_MAXSPEED)); + } + } else { + return false; + } + } + case SUMO_ATTR_ARRIVALLANE: { + int dummyArrivalLane; + ArrivalLaneDefinition dummyArrivalLaneProcedure; + parseArrivalLane(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalLane, dummyArrivalLaneProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_ARRIVALPOS: { + double dummyArrivalPos; + ArrivalPosDefinition dummyArrivalPosProcedure; + parseArrivalPos(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalPos, dummyArrivalPosProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_ARRIVALSPEED: { + double dummyArrivalSpeed; + ArrivalSpeedDefinition dummyArrivalSpeedProcedure; + parseArrivalSpeed(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalSpeed, dummyArrivalSpeedProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_LINE: + return true; + case SUMO_ATTR_PERSON_NUMBER: + return canParse(value) && parse(value) >= 0; + case SUMO_ATTR_CONTAINER_NUMBER: + return canParse(value) && parse(value) >= 0; + case SUMO_ATTR_REROUTE: + return true; // check + case SUMO_ATTR_DEPARTPOS_LAT: { + double dummyDepartPosLat; + DepartPosLatDefinition dummyDepartPosLatProcedure; + parseDepartPosLat(value, toString(SUMO_TAG_VEHICLE), id, dummyDepartPosLat, dummyDepartPosLatProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_ARRIVALPOS_LAT: { + double dummyArrivalPosLat; + ArrivalPosLatDefinition dummyArrivalPosLatProcedure; + parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, dummyArrivalPosLat, dummyArrivalPosLatProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + // Specific of vehicles + case SUMO_ATTR_DEPART: { + SUMOTime dummyDepart; + DepartDefinition dummyDepartProcedure; + parseDepart(value, toString(SUMO_TAG_VEHICLE), id, dummyDepart, dummyDepartProcedure, error); + // if error is empty, given value is valid + return error.empty(); + } + case SUMO_ATTR_ROUTE: + if (getParentDemandElements().size() == 2) { + return SUMOXMLDefinitions::isValidVehicleID(value) && (myNet->retrieveDemandElement(SUMO_TAG_ROUTE, value, false) != nullptr); + } else { + return true; + } + // Specific of Trips + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_VIA: + if (value.empty()) { + return true; + } else { + return canParse >(myNet, value, false); + } + // Specific of routeFlows + case SUMO_ATTR_BEGIN: + if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_END: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_VEHSPERHOUR: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) > 0); + } else { + return false; + } + case SUMO_ATTR_PERIOD: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) > 0); + } else { + return false; + } + case SUMO_ATTR_PROB: + if (value.empty()) { + return true; + } else if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + case SUMO_ATTR_NUMBER: + if (canParse(value)) { + return (parse(value) >= 0); + } else { + return false; + } + // + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +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); +} + + +void +GNEVehicle::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // nothing to disable +} + + +bool +GNEVehicle::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_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; + default: + return true; + } +} + + +std::string +GNEVehicle::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEVehicle::getHierarchyName() const { + // special case for Trips and flow + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // check if we're inspecting a Edge + if (myNet->getViewNet()->getDottedAC() && + myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_EDGE) { + // check if edge correspond to a "from", "to" or "via" edge + if (getParentEdges().front() == myNet->getViewNet()->getDottedAC()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (from)"; + } else if (getParentEdges().front() == myNet->getViewNet()->getDottedAC()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (to)"; + } else { + // iterate over via + for (const auto& i : via) { + if (i == myNet->getViewNet()->getDottedAC()->getID()) { + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID) + " (via)"; + } + } + } + } + } + return getTagStr() + ": " + getAttribute(SUMO_ATTR_ID); +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEVehicle::setColor(const GUIVisualizationSettings& s) const { + // change color + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedVehicleColor); + } else { + // obtain vehicle color + const GUIColorer& c = s.vehicleColorer; + // set color depending of vehicle color active + switch (c.getActive()) { + case 0: { + // test for emergency vehicle + if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "emergency") { + GLHelper::setColor(RGBColor::WHITE); + break; + } + // test for firebrigade + if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "firebrigade") { + GLHelper::setColor(RGBColor::RED); + break; + } + // test for police car + if (getParentDemandElements().at(0)->getAttribute(SUMO_ATTR_GUISHAPE) == "police") { + GLHelper::setColor(RGBColor::BLUE); + break; + } + // check if color was set + if (wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(color); + break; + } else { + // take their parent's color) + GLHelper::setColor(getParentDemandElements().at(0)->getColor()); + break; + } + break; + } + case 2: { + if (wasSet(VEHPARS_COLOR_SET)) { + GLHelper::setColor(color); + } else { + GLHelper::setColor(c.getScheme().getColor(0)); + } + break; + } + case 3: { + if (getParentDemandElements().at(0)->isAttributeEnabled(SUMO_ATTR_COLOR)) { + GLHelper::setColor(getParentDemandElements().at(0)->getColor()); + } else { + GLHelper::setColor(c.getScheme().getColor(0)); + } + break; + } + case 4: { + if (getParentDemandElements().at(1)->getColor() != RGBColor::DEFAULT_COLOR) { + GLHelper::setColor(getParentDemandElements().at(1)->getColor()); + } else { + GLHelper::setColor(c.getScheme().getColor(0)); + } + break; + } + case 5: { + Position p = getParentDemandElements().at(1)->getParentEdges().at(0)->getLanes().at(0)->getLaneShape()[0]; + const Boundary& b = myNet->getBoundary(); + Position center = b.getCenter(); + double hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / M_PI; + double sat = p.distanceTo(center) / center.distanceTo(Position(b.xmin(), b.ymin())); + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + break; + } + case 6: { + Position p = getParentDemandElements().at(1)->getParentEdges().back()->getLanes().at(0)->getLaneShape()[-1]; + const Boundary& b = myNet->getBoundary(); + Position center = b.getCenter(); + double hue = 180. + atan2(center.x() - p.x(), center.y() - p.y()) * 180. / M_PI; + double sat = p.distanceTo(center) / center.distanceTo(Position(b.xmin(), b.ymin())); + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + break; + } + case 7: { + Position pb = getParentDemandElements().at(1)->getParentEdges().at(0)->getLanes().at(0)->getLaneShape()[0]; + Position pe = getParentDemandElements().at(1)->getParentEdges().back()->getLanes().at(0)->getLaneShape()[-1]; + const Boundary& b = myNet->getBoundary(); + double hue = 180. + atan2(pb.x() - pe.x(), pb.y() - pe.y()) * 180. / M_PI; + Position minp(b.xmin(), b.ymin()); + Position maxp(b.xmax(), b.ymax()); + double sat = pb.distanceTo(pe) / minp.distanceTo(maxp); + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + break; + } + case 29: { // color randomly (by pointer hash) + std::hash ptr_hash; + const double hue = (double)(ptr_hash(this) % 360); // [0-360] + const double sat = ((ptr_hash(this) / 360) % 67) / 100.0 + 0.33; // [0.33-1] + GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.)); + break; + } + default: { + GLHelper::setColor(c.getScheme().getColor(0)); + } + } + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEVehicle::setAttribute(SumoXMLAttr key, const std::string& value) { + // declare string error + std::string error; + // flag to upate stack label + bool updateSpreadStackGeometry = false; + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + // set manually vehicle ID (needed for saving) + id = value; + break; + case SUMO_ATTR_TYPE: + replaceParentDemandElement(this, value, 0); + // set manually vtypeID (needed for saving) + vtypeid = value; + break; + case SUMO_ATTR_COLOR: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + color = parse(value); + // mark parameter as set + parametersSet |= VEHPARS_COLOR_SET; + } else { + // set default value + color = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VEHPARS_COLOR_SET; + } + break; + case SUMO_ATTR_DEPARTLANE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseDepartLane(value, toString(SUMO_TAG_VEHICLE), id, departLane, departLaneProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_DEPARTLANE_SET; + } else { + // set default value + parseDepartLane(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departLane, departLaneProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_DEPARTLANE_SET; + } + break; + case SUMO_ATTR_DEPARTPOS: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseDepartPos(value, toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_DEPARTPOS_SET; + } else { + // set default value + parseDepartPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPos, departPosProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_DEPARTPOS_SET; + } + updateGeometry(); + updateSpreadStackGeometry = true; + break; + case SUMO_ATTR_DEPARTSPEED: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseDepartSpeed(value, toString(SUMO_TAG_VEHICLE), id, departSpeed, departSpeedProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_DEPARTSPEED_SET; + } else { + // set default value + parseDepartSpeed(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departSpeed, departSpeedProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_DEPARTSPEED_SET; + } + break; + case SUMO_ATTR_ARRIVALLANE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseArrivalLane(value, toString(SUMO_TAG_VEHICLE), id, arrivalLane, arrivalLaneProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_ARRIVALLANE_SET; + } else { + // set default value + parseArrivalLane(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalLane, arrivalLaneProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_ARRIVALLANE_SET; + } + break; + case SUMO_ATTR_ARRIVALPOS: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseArrivalPos(value, toString(SUMO_TAG_VEHICLE), id, arrivalPos, arrivalPosProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_ARRIVALPOS_SET; + } else { + // set default value + parseArrivalPos(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalPos, arrivalPosProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_ARRIVALPOS_SET; + } + updateGeometry(); + updateSpreadStackGeometry = true; + break; + case SUMO_ATTR_ARRIVALSPEED: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseArrivalSpeed(value, toString(SUMO_TAG_VEHICLE), id, arrivalSpeed, arrivalSpeedProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_ARRIVALSPEED_SET; + } else { + // set default value + parseArrivalSpeed(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalSpeed, arrivalSpeedProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_ARRIVALSPEED_SET; + } + break; + case SUMO_ATTR_LINE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + line = value; + // mark parameter as set + parametersSet |= VEHPARS_LINE_SET; + } else { + // set default value + line = myTagProperty.getDefaultValue(key); + // unset parameter + parametersSet &= ~VEHPARS_LINE_SET; + } + break; + case SUMO_ATTR_PERSON_NUMBER: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + personNumber = parse(value); + // mark parameter as set + parametersSet |= VEHPARS_PERSON_NUMBER_SET; + } else { + // set default value + personNumber = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VEHPARS_PERSON_NUMBER_SET; + } + break; + case SUMO_ATTR_CONTAINER_NUMBER: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + containerNumber = parse(value); + // mark parameter as set + parametersSet |= VEHPARS_CONTAINER_NUMBER_SET; + } else { + // set default value + containerNumber = parse(myTagProperty.getDefaultValue(key)); + // unset parameter + parametersSet &= ~VEHPARS_CONTAINER_NUMBER_SET; + } + break; + case SUMO_ATTR_REROUTE: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + // mark parameter as set + parametersSet |= VEHPARS_ROUTE_SET; + } else { + // unset parameter + parametersSet &= ~VEHPARS_ROUTE_SET; + } + break; + case SUMO_ATTR_DEPARTPOS_LAT: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseDepartPosLat(value, toString(SUMO_TAG_VEHICLE), id, departPosLat, departPosLatProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_DEPARTPOSLAT_SET; + } else { + // set default value + parseDepartPosLat(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, departPosLat, departPosLatProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_DEPARTPOSLAT_SET; + } + break; + case SUMO_ATTR_ARRIVALPOS_LAT: + if (!value.empty() && (value != myTagProperty.getDefaultValue(key))) { + parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); + // mark parameter as set + parametersSet |= VEHPARS_ARRIVALPOSLAT_SET; + } else { + // set default value + parseArrivalPosLat(myTagProperty.getDefaultValue(key), toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); + // unset parameter + parametersSet &= ~VEHPARS_ARRIVALPOSLAT_SET; + } + parseArrivalPosLat(value, toString(SUMO_TAG_VEHICLE), id, arrivalPosLat, arrivalPosLatProcedure, error); + break; + // Specific of vehicles + case SUMO_ATTR_DEPART: { + std::string oldDepart = getBegin(); + parseDepart(value, toString(SUMO_TAG_VEHICLE), id, depart, departProcedure, error); + myNet->getAttributeCarriers()->updateDemandElementBegin(oldDepart, this); + break; + } + case SUMO_ATTR_ROUTE: + if (getParentDemandElements().size() == 2) { + replaceParentDemandElement(this, value, 1); + } + updateGeometry(); + updateSpreadStackGeometry = true; + break; + // Specific of Trips and flow + case SUMO_ATTR_FROM: { + // change first edge + replaceFirstParentEdge(this, myNet->retrieveEdge(value)); + // compute vehicle + computePath(); + updateSpreadStackGeometry = true; + break; + } + case SUMO_ATTR_TO: { + // change last edge + replaceLastParentEdge(this, myNet->retrieveEdge(value)); + // compute vehicle + computePath(); + updateSpreadStackGeometry = true; + break; + } + case SUMO_ATTR_VIA: { + if (!value.empty()) { + // set new via edges + via = parse< std::vector >(value); + // mark parameter as set + parametersSet |= VEHPARS_VIA_SET; + } else { + // clear via + via.clear(); + // unset parameter + parametersSet &= ~VEHPARS_VIA_SET; + } + // update via + replaceMiddleParentEdges(this, parse >(myNet, value), true); + // compute vehicle + computePath(); + updateSpreadStackGeometry = true; + break; + } + // Specific of routeFlows + case SUMO_ATTR_BEGIN: { + std::string oldBegin = getBegin(); + depart = string2time(value); + myNet->getAttributeCarriers()->updateDemandElementBegin(oldBegin, this); + break; + } + case SUMO_ATTR_END: + repetitionEnd = string2time(value); + break; + case SUMO_ATTR_VEHSPERHOUR: + repetitionOffset = TIME2STEPS(3600 / parse(value)); + break; + case SUMO_ATTR_PERIOD: + repetitionOffset = string2time(value); + break; + case SUMO_ATTR_PROB: + repetitionProbability = parse(value); + break; + case SUMO_ATTR_NUMBER: + repetitionNumber = parse(value); + break; + // + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + // check if stack label has to be updated + if (updateSpreadStackGeometry) { + if ((myTagProperty.getTag() == SUMO_TAG_TRIP) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + getParentEdges().front()->updateVehicleStackLabels(); + getParentEdges().front()->updateVehicleSpreadGeometries(); + } else if (getParentDemandElements().size() == 2) { + getParentDemandElements().at(1)->getParentEdges().front()->updateVehicleStackLabels(); + getParentDemandElements().at(1)->getParentEdges().front()->updateVehicleSpreadGeometries(); + } else if (getChildDemandElements().size() > 0) { + getChildDemandElements().front()->getParentEdges().front()->updateVehicleStackLabels(); + getChildDemandElements().front()->getParentEdges().front()->updateVehicleSpreadGeometries(); + } + } +} + + +void +GNEVehicle::setEnabledAttribute(const int enabledAttributes) { + parametersSet = enabledAttributes; +} + + +void +GNEVehicle::updateSpreadGeometry() { + // get vehicle lane + const GNELane* vehicleLane = getFirstAllowedVehicleLane(); + // update spread vehicle geometry depending of edgeParent + if (vehicleLane) { + vehicleLane->getParentEdge()->updateVehicleSpreadGeometries(); + } else { + mySpreadGeometry.updateGeometry(Position(), 0); + } + // declare two pointers for depart and arrival pos lanes + double departPosLane = -1; + double arrivalPosLane = -1; + // calculate departPosLane + if (vehicleLane && (mySpreadGeometry.getPosition() != Position::INVALID)) { + departPosLane = vehicleLane->getLaneShape().nearest_offset_to_point2D(mySpreadGeometry.getPosition()); + } + // check if arrival pos lane is defined + if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { + arrivalPosLane = arrivalPos; + } + // calculate depart pos geometry path starting at the lane begin + if (getPathEdges().size() > 0) { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getPathEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_FLOW)) { + // use route edges + if (getParentDemandElements().size() == 2) { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } else if (getChildDemandElements().size() > 0) { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getChildDemandElements().front()->getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } + } else { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, mySpreadSegmentGeometry, getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } +} + + +void +GNEVehicle::updatePartialSpreadGeometry(const GNEEdge* edge) { + // get vehicle lane + const GNELane* vehicleLane = getFirstAllowedVehicleLane(); + // declare two pointers for depart and arrival pos lanes + double departPosLane = -1; + double arrivalPosLane = -1; + // calculate departPosLane + if (vehicleLane && (mySpreadGeometry.getPosition() != Position::INVALID)) { + departPosLane = vehicleLane->getLaneShape().nearest_offset_to_point2D(mySpreadGeometry.getPosition()); + } + // check if arrival pos lane is defined + if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { + arrivalPosLane = arrivalPos; + } + // update geometry path for the given edge + GNEGeometry::updateGeometricPath(mySpreadSegmentGeometry, edge, departPosLane, arrivalPosLane); +} + + +void +GNEVehicle::updateStackedGeometry() { + // declare two pointers for depart and arrival pos lanes + double departPosLane = -1; + double arrivalPosLane = -1; + // check if depart and arrival pos lanes are defined + if (departPosProcedure == DEPART_POS_GIVEN) { + departPosLane = departPos; + } + if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { + arrivalPosLane = arrivalPos; + } + // get first allowed lane + GNELane* firstLane = getFirstAllowedVehicleLane(); + // check if first lane wasn't sucesfully obtained + if (!firstLane) { + if (getPathEdges().size() > 0) { + firstLane = getPathEdges().front()->getLanes().front(); + } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + // use route edges + if (getParentDemandElements().size() == 2) { + firstLane = getParentDemandElements().at(1)->getParentEdges().front()->getLanes().front(); + } else if (getChildDemandElements().size() > 0) { + firstLane = getChildDemandElements().front()->getParentEdges().front()->getLanes().front(); + } + } else { + firstLane = getParentEdges().front()->getLanes().front(); + } + } + // continue only if lane was sucesfully found + if (firstLane) { + // check if depart pos has to be adjusted + if ((departPosProcedure == DEPART_POS_GIVEN) && (departPosLane < 0)) { + departPosLane += firstLane->getLaneShape().length(); + } + // calculate spread geometry path + if (getPathEdges().size() > 0) { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), + firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } else if ((myTagProperty.getTag() == SUMO_TAG_VEHICLE) || (myTagProperty.getTag() == SUMO_TAG_ROUTEFLOW)) { + // use route edges + if (getParentDemandElements().size() == 2) { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), + firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } else if (getChildDemandElements().size() > 0) { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getChildDemandElements().front()->getParentEdges(), getVClass(), + firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } + } else { + // calculate edge geometry path + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), + firstLane, getLastAllowedVehicleLane(), departPosLane, arrivalPosLane); + } + // update start pos geometry + myDemandElementGeometry.updateGeometry(firstLane, departPosLane); + firstLane->getParentEdge()->updateVehicleStackLabels(); + } +} + + +void +GNEVehicle::updatePartialStackedGeometry(const GNEEdge* edge) { + // declare two pointers for depart and arrival pos lanes + double departPosLane = -1; + double arrivalPosLane = -1; + // check if depart and arrival pos lanes are defined + if (departPosProcedure == DEPART_POS_GIVEN) { + departPosLane = departPos; + } + if (arrivalPosProcedure == ARRIVAL_POS_GIVEN) { + arrivalPosLane = arrivalPos; + } + // update geometry path for the given edge + GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane); +} + + +void +GNEVehicle::drawStackLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const { + // declare contour width + const double contourWidth = 0.05; + // check if we have to mirror text + const bool mirrorText = (vehicleRotation < 0); + // Push matrix + glPushMatrix(); + // Traslate to vehicle top + glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW); + glRotated(vehicleRotation, 0, 0, 1); + glTranslated((width / 2.0) + 0.35, 0, 0); + // draw external box + GLHelper::setColor(RGBColor::GREY); + GLHelper::drawBoxLine(Position(), Position(), 0, length, 0.3); + // draw internal box + glTranslated(0, 0, 0.1); + GLHelper::setColor(RGBColor(0, 128, 0)); + GLHelper::drawBoxLine(Position(0, -contourWidth), Position(0, -contourWidth), 0, length - (contourWidth * 2), 0.3 - contourWidth); + // draw stack label + GLHelper::drawText("vehicles stacked: " + toString(myStackedLabelNumber), Position(0, length / -2.0), .1, 0.6, RGBColor::WHITE, 90, 0, -1, mirrorText); + // pop draw matrix + glPopMatrix(); +} + + +void +GNEVehicle::drawFlowLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const { + // declare contour width + const double contourWidth = 0.05; + // check if we have to mirror text + const bool mirrorText = (vehicleRotation < 0); + // Push matrix + glPushMatrix(); + // Traslate to vehicle bot + glTranslated(vehiclePosition.x(), vehiclePosition.y(), GLO_ROUTE + getType() + 0.1 + GLO_PERSONFLOW); + glRotated(vehicleRotation, 0, 0, 1); + glTranslated(-1 * ((width / 2.0) + 0.35), 0, 0); + // draw external box + GLHelper::setColor(RGBColor::GREY); + GLHelper::drawBoxLine(Position(), Position(), 0, length, 0.3); + // draw internal box + glTranslated(0, 0, 0.1); + GLHelper::setColor(RGBColor::CYAN); + GLHelper::drawBoxLine(Position(0, -contourWidth), Position(0, -contourWidth), 0, length - (contourWidth * 2), 0.3 - contourWidth); + // draw stack label + GLHelper::drawText("Flow", Position(0, length / -2.0), .1, 0.6, RGBColor::BLACK, 90, 0, -1, mirrorText); + // pop draw matrix + glPopMatrix(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicle.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicle.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicle.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,358 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVehicle.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2019 +/// +// Representation of vehicles in NETEDIT +/****************************************************************************/ +#pragma once +#include +#include + +#include "GNEDemandElement.h" + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEVehicle + */ +class GNEVehicle : public GNEDemandElement, public SUMOVehicleParameter { + +public: + /// @brief class used in GUIGLObjectPopupMenu for single vehicle transformations + class GNESingleVehiclePopupMenu : public GUIGLObjectPopupMenu { + FXDECLARE(GNESingleVehiclePopupMenu) + + public: + /** @brief Constructor + * @param[in] vehicle GNEVehicle to be transformed + * @param[in] app The main window for instantiation of other windows + * @param[in] parent The parent view for changing it + */ + GNESingleVehiclePopupMenu(GNEVehicle* vehicle, GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief Destructor + ~GNESingleVehiclePopupMenu(); + + /// @brief Called to transform the current vehicle to another vehicle type + long onCmdTransform(FXObject* obj, FXSelector, void*); + + protected: + /// @brief default constructor needed by FOX + FOX_CONSTRUCTOR(GNESingleVehiclePopupMenu); + + private: + /// @brief current vehicle + GNEVehicle* myVehicle; + + /// @brief menu command for transform to vehicle + FXMenuCommand* myTransformToVehicle; + + /// @brief menu command for transform to vehicle with an embedded route + FXMenuCommand* myTransformToVehicleWithEmbeddedRoute; + + /// @brief menu command for transform to route flow + FXMenuCommand* myTransformToRouteFlow; + + /// @brief menu command for transform to route flow with an embedded route + FXMenuCommand* myTransformToRouteFlowWithEmbeddedRoute; + + /// @brief menu command for transform to trip + FXMenuCommand* myTransformToTrip; + + /// @brief menu command for transform to flow + FXMenuCommand* myTransformToFlow; + }; + + /// @brief class used in GUIGLObjectPopupMenu for single vehicle transformations + class GNESelectedVehiclesPopupMenu : public GUIGLObjectPopupMenu { + FXDECLARE(GNESelectedVehiclesPopupMenu) + + public: + /** @brief Constructor + * @param[in] vehicle clicked GNEVehicle + * @param[in] selectedVehicle vector with selected GNEVehicle + * @param[in] app The main window for instantiation of other windows + * @param[in] parent The parent view for changing it + */ + GNESelectedVehiclesPopupMenu(GNEVehicle* vehicle, const std::vector& selectedVehicle, GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief Destructor + ~GNESelectedVehiclesPopupMenu(); + + /// @brief Called to transform the current vehicle to another vehicle type + long onCmdTransform(FXObject* obj, FXSelector, void*); + + protected: + /// @brief default constructor needed by FOX + FOX_CONSTRUCTOR(GNESelectedVehiclesPopupMenu); + + private: + /// @brief current selected vehicles + std::vector mySelectedVehicles; + + /// @brief tag of clicked vehicle + SumoXMLTag myVehicleTag; + + /// @brief menu command for transform to vehicle + FXMenuCommand* myTransformToVehicle; + + /// @brief menu command for transform to vehicle with an embedded route + FXMenuCommand* myTransformToVehicleWithEmbeddedRoute; + + /// @brief menu command for transform to route flow + FXMenuCommand* myTransformToRouteFlow; + + /// @brief menu command for transform to route flow with an embedded route + FXMenuCommand* myTransformToRouteFlowWithEmbeddedRoute; + + /// @brief menu command for transform to trip + FXMenuCommand* myTransformToTrip; + + /// @brief menu command for transform to flow + FXMenuCommand* myTransformToFlow; + + /// @brief menu command for transform all selected vehicles to vehicle + FXMenuCommand* myTransformAllVehiclesToVehicle; + + /// @brief menu command for transform all selected vehicles to vehicle with an embedded route + FXMenuCommand* myTransformAllVehiclesToVehicleWithEmbeddedRoute; + + /// @brief menu command for transform all selected vehicles to route flow + FXMenuCommand* myTransformAllVehiclesToRouteFlow; + + /// @brief menu command for transform all selected vehicles to route flow with an embedded route + FXMenuCommand* myTransformAllVehiclesToRouteFlowWithEmbeddedRoute; + + /// @brief menu command for transform all selected vehicles to trip + FXMenuCommand* myTransformAllVehiclesToTrip; + + /// @brief menu command for transform all selected vehicles to flow + FXMenuCommand* myTransformAllVehiclesToFlow; + }; + + /// @brief default constructor for vehicles and routeFlows without embedded routes + GNEVehicle(SumoXMLTag tag, GNENet* net, const std::string& vehicleID, GNEDemandElement* vehicleType, GNEDemandElement* route); + + /// @brief parameter constructor for vehicles and routeFlows without embedded routes + GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, GNEDemandElement* route, const SUMOVehicleParameter& vehicleParameters); + + /// @brief parameter constructor for vehicles and routeFlows with embedded routes (note: After creation create immediately a embedded route referencing this vehicle) + GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, const SUMOVehicleParameter& vehicleParameters); + + /// @brief default constructor for trips and Flows + 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 + GNEVehicle(GNENet* net, GNEDemandElement* vehicleType, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, const SUMOVehicleParameter& vehicleParameters); + + /// @brief destructor + ~GNEVehicle(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 start geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of demand element in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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; + /// @} + +protected: + /// @brief sets the color according to the currente settings + void setColor(const GUIVisualizationSettings& s) 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 update spread geometry + void updateSpreadGeometry(); + + /// @brief partial update pre-computed spread geometry information + void updatePartialSpreadGeometry(const GNEEdge* edge); + + /// @brief update stacked geometry + void updateStackedGeometry(); + + /// @brief partial update pre-computed departPosgeometry information + void updatePartialStackedGeometry(const GNEEdge* edge); + + /// @brief draw stack label + void drawStackLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const; + + /// @brief draw flow label + void drawFlowLabel(const Position& vehiclePosition, const double vehicleRotation, const double width, const double length) const; + + /// @brief Invalidated copy constructor. + GNEVehicle(const GNEVehicle&) = delete; + + /// @brief Invalidated assignment operator + GNEVehicle& operator=(const GNEVehicle&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1688 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +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, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +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(), +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +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() {} + + +void +GNEVehicleType::writeDemandElement(OutputDevice& device) const { + // only write default vehicle types if it was modified + if (myDefaultVehicleType) { + if (myDefaultVehicleTypeModified) { + write(device); + } + } else { + write(device); + } +} + + +GNEEdge* +GNEVehicleType::getFromEdge() const { + return nullptr; +} + + +GNEEdge* +GNEVehicleType::getToEdge() const { + return nullptr; +} + + +SUMOVehicleClass +GNEVehicleType::getVClass() const { + return vehicleClass; +} + + +const RGBColor& +GNEVehicleType::getColor() const { + return color; +} + + +void +GNEVehicleType::startGeometryMoving() { + // VTypes cannot be moved +} + + +void +GNEVehicleType::endGeometryMoving() { + // VTypes cannot be moved +} + + +void +GNEVehicleType::moveGeometry(const Position&) { + // VTypes cannot be moved +} + + +void +GNEVehicleType::commitGeometryMoving(GNEUndoList*) { + // VTypes cannot be moved +} + + +void +GNEVehicleType::updateGeometry() { + // update geometry of all childrens + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + + +void +GNEVehicleType::updateDottedContour() { + // +} + + +void +GNEVehicleType::updatePartialGeometry(const GNEEdge* edge) { + // update geometry of all childrens + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNEVehicleType::computePath() { + // nothing to compute +} + + +void +GNEVehicleType::invalidatePath() { + // nothing to invalidate +} + + +Position +GNEVehicleType::getPositionInView() const { + return Position(); +} + + +std::string +GNEVehicleType::getParentName() const { + return myNet->getMicrosimID(); +} + + +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 +} + + +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_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.getParameter()[0]); + } else { + return toString(defaultValues.speedFactor.getParameter()[0]); + } + case SUMO_ATTR_SPEEDDEV: + if (wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + return toString(speedFactor.getParameter()[1]); + } else { + return toString(defaultValues.speedFactor.getParameter()[1]); + } + 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)) { + return toString(latAlignment); + } 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) + "'"); + } +} + + +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->p_add(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_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_SPEEDDEV: + 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->p_add(vTypeChangeAttributeForced); + } + vTypeChangeAttributeForced = new GNEChange_Attribute(this, key, value); + // force change + vTypeChangeAttributeForced->forceChange(); + undoList->p_add(vTypeChangeAttributeForced); + break; + case GNE_ATTR_DEFAULT_VTYPE_MODIFIED: + vTypeChangeAttributeForced = new GNEChange_Attribute(this, GNE_ATTR_DEFAULT_VTYPE_MODIFIED, "true"); + // force change + vTypeChangeAttributeForced->forceChange(); + undoList->p_add(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->retrieveDemandElement(SUMO_TAG_VTYPE, value, false) == nullptr) && + (myNet->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_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 canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_SPEEDDEV: + return canParse(value) && (parse(value) >= 0); + 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 SUMOXMLDefinitions::LateralAlignments.hasString(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_SPEEDDEV: + 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) ; +} + + +void +GNEVehicleType::overwriteVType(GNEDemandElement* vType, SUMOVTypeParameter* newVTypeParameter, GNEUndoList* undoList) { + // open undo list and overwritte all values of default VType + undoList->p_begin("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_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.getParameter()[0]), undoList); + } + if (newVTypeParameter->wasSet(VTYPEPARS_SPEEDFACTOR_SET)) { + vType->setAttribute(SUMO_ATTR_SPEEDDEV, toString(newVTypeParameter->speedFactor.getParameter()[1]), 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)) { + vType->setAttribute(SUMO_ATTR_LATALIGNMENT, toString(newVTypeParameter->latAlignment), 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 (auto i : newVTypeParameter->getParametersMap()) { + parametersStr += i.first + "=" + i.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->p_end(); +} + + +void +GNEVehicleType::initRailVisualizationParameters() { + if (SUMOVTypeParameter::knowsParameter("carriageLength")) { + carriageLength = StringUtils::toDouble(SUMOVTypeParameter::getParameter("carriageLength")); + parametersSet |= VTYPEPARS_CARRIAGE_LENGTH_SET; + } else if (wasSet(VTYPEPARS_SHAPE_SET)) { + switch (shape) { + case SVS_BUS_FLEXIBLE: + carriageLength = 8.25; // 16.5 overall, 2 modules http://de.wikipedia.org/wiki/Ikarus_180 + carriageGap = 0; + break; + case SVS_RAIL: + carriageLength = 24.5; // http://de.wikipedia.org/wiki/UIC-Y-Wagen_%28DR%29 + break; + case SVS_RAIL_CAR: + carriageLength = 16.85; // 67.4m overall, 4 carriages http://de.wikipedia.org/wiki/DB-Baureihe_423 + break; + case SVS_RAIL_CARGO: + carriageLength = 13.86; // UIC 571-1 http://de.wikipedia.org/wiki/Flachwagen + break; + case SVS_TRUCK_SEMITRAILER: + carriageLength = 13.5; + locomotiveLength = 2.5; + carriageGap = 0.5; + break; + case SVS_TRUCK_1TRAILER: + carriageLength = 6.75; + locomotiveLength = 2.5 + 6.75; + carriageGap = 0.5; + break; + default: + break; + } + } + if (SUMOVTypeParameter::knowsParameter("locomotiveLength")) { + locomotiveLength = StringUtils::toDouble(SUMOVTypeParameter::getParameter("locomotiveLength")); + parametersSet |= VTYPEPARS_LOCOMOTIVE_LENGTH_SET; + } else if (locomotiveLength <= 0) { + locomotiveLength = carriageLength; + } + if (SUMOVTypeParameter::knowsParameter("carriageGap")) { + carriageGap = StringUtils::toDouble(SUMOVTypeParameter::getParameter("carriageGap")); + parametersSet |= VTYPEPARS_CARRIAGE_GAP_SET; + } +} + +// =========================================================================== +// 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: + myNet->getAttributeCarriers()->updateID(this, 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_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.getParameter()[0]))) { + speedFactor.getParameter()[0] = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; + } else { + // set default value + speedFactor.getParameter()[0] = defaultValues.speedFactor.getParameter()[0]; + // unset parameter + parametersSet &= ~VTYPEPARS_SPEEDFACTOR_SET; + } + break; + case SUMO_ATTR_SPEEDDEV: + if (!value.empty() && (value != toString(defaultValues.speedFactor.getParameter()[1]))) { + speedFactor.getParameter()[1] = parse(value); + // mark parameter as set + parametersSet |= VTYPEPARS_SPEEDFACTOR_SET; + } else { + // set default value + speedFactor.getParameter()[1] = defaultValues.speedFactor.getParameter()[1]; + // 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))) { + latAlignment = SUMOXMLDefinitions::LateralAlignments.get(value); + // mark parameter as set + parametersSet |= VTYPEPARS_LATALIGNMENT_SET; + } else { + // set default value + latAlignment = SUMOXMLDefinitions::LateralAlignments.get(myTagProperty.getDefaultValue(key)); + // 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::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.5.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEVehicleType.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,211 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 "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 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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @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 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; + /// @} + + /// @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 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 overwrite all values of GNEVehicleType with a SUMOVTypeParameter + static void overwriteVType(GNEDemandElement* vType, SUMOVTypeParameter* newVTypeParameter, GNEUndoList* undoList); + +protected: + /// @brief init Rail Visualization Parameters + void initRailVisualizationParameters(); + + /// @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 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.5.0+dfsg1/src/netedit/elements/demand/GNEWalk.cpp sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEWalk.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEWalk.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEWalk.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,651 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEWalk.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing walks in Netedit +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEWalk.h" +#include "GNERoute.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, const std::vector& edges, double arrivalPosition) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_WALK_EDGES), net, GLO_WALK, SUMO_TAG_WALK_EDGES, +{}, {edges}, {}, {}, {}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +Parameterised(), +myArrivalPosition(arrivalPosition) { +} + + +GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, const std::vector& via, double arrivalPosition) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_WALK_FROMTO), net, GLO_WALK, SUMO_TAG_WALK_FROMTO, +{}, {fromEdge, toEdge}, {}, {}, {}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +Parameterised(), +myArrivalPosition(arrivalPosition) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute walk + computePath(); +} + + +GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, const std::vector& via) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_WALK_BUSSTOP), net, GLO_WALK, SUMO_TAG_WALK_BUSSTOP, +{}, {fromEdge}, {}, {}, {busStop}, {personParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +Parameterised(), +myArrivalPosition(-1) { + // set via parameter without updating references + replaceMiddleParentEdges(this, via, false); + // compute walk + computePath(); +} + + +GNEWalk::GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEDemandElement* routeParent, double arrivalPosition) : + GNEDemandElement(net->generateDemandElementID("", SUMO_TAG_WALK_ROUTE), net, GLO_WALK, SUMO_TAG_WALK_ROUTE, +{}, {}, {}, {}, {}, {personParent, routeParent}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +Parameterised(), +myArrivalPosition(arrivalPosition) { +} + + +GNEWalk::~GNEWalk() {} + + +GUIGLObjectPopupMenu* +GNEWalk::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + // build header + buildPopupHeader(ret, app); + // build menu command for center button and copy cursor position to clipboard + buildCenterPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // buld menu commands for names + new FXMenuCommand(ret, ("Copy " + getTagStr() + " name to clipboard").c_str(), nullptr, ret, MID_COPY_NAME); + new FXMenuCommand(ret, ("Copy " + getTagStr() + " typed name to clipboard").c_str(), nullptr, ret, MID_COPY_TYPED_NAME); + new FXMenuSeparator(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // show option to open demand element dialog + if (myTagProperty.hasDialog()) { + new FXMenuCommand(ret, ("Open " + getTagStr() + " Dialog").c_str(), getIcon(), &parent, MID_OPEN_ADDITIONAL_DIALOG); + new FXMenuSeparator(ret); + } + new FXMenuCommand(ret, ("Cursor position in view: " + toString(getPositionInView().x()) + "," + toString(getPositionInView().y())).c_str(), nullptr, nullptr, 0); + return ret; +} + + +void +GNEWalk::writeDemandElement(OutputDevice& device) const { + // open tag + device.openTag(SUMO_TAG_WALK); + // write attributes depending of walk type + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + device.writeAttr(SUMO_ATTR_ROUTE, getParentDemandElements().at(1)->getID()); + } else if (myTagProperty.getTag() == SUMO_TAG_WALK_EDGES) { + device.writeAttr(SUMO_ATTR_EDGES, parseIDs(getParentEdges())); + } else { + // only write From attribute if this is the first Person Plan + if (getParentDemandElements().front()->getChildDemandElements().front() == this) { + device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID()); + } + // check if write busStop or edge to + if (getParentAdditionals().size() > 0) { + device.writeAttr(SUMO_ATTR_BUS_STOP, getParentAdditionals().front()->getID()); + } else { + device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID()); + } + } + // only write arrivalPos if is different of -1 + if (myArrivalPosition != -1) { + device.writeAttr(SUMO_ATTR_ARRIVALPOS, myArrivalPosition); + } + // write parameters + writeParams(device); + // close tag + device.closeTag(); +} + + +bool +GNEWalk::isDemandElementValid() const { + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + // check if route parent is valid + return getParentDemandElements().at(1)->isDemandElementValid(); + } else if (getParentEdges().size() == 2) { + if (getParentEdges().at(0) == getParentEdges().at(1)) { + // from and to are the same edges, then path is valid + return true; + } else { + // check if exist a route between parent edges + return (myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentEdges()).size() > 0); + } + } else if (getPathEdges().size() > 0) { + // if path edges isn't empty, then there is a valid route + return true; + } else { + return false; + } +} + + +std::string +GNEWalk::getDemandElementProblem() const { + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + return ""; + } else if (getParentEdges().size() == 0) { + return ("A walk need at least one edge"); + } else { + // check if exist at least a connection between every edge + for (int i = 1; i < (int)getParentEdges().size(); i++) { + if (myNet->getPathCalculator()->consecutiveEdgesConnected(getParentDemandElements().front()->getVClass(), getParentEdges().at((int)i - 1), getParentEdges().at(i)) == false) { + return ("Edge '" + getParentEdges().at((int)i - 1)->getID() + "' and edge '" + getParentEdges().at(i)->getID() + "' aren't consecutives"); + } + } + // there is connections bewteen all edges, then all ok + return ""; + } +} + + +void +GNEWalk::fixDemandElementProblem() { + // currently the only solution is removing Walk +} + + +GNEEdge* +GNEWalk::getFromEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getFromEdge(); + } else { + return getParentEdges().front(); + } +} + + +GNEEdge* +GNEWalk::getToEdge() const { + if (getParentDemandElements().size() == 2) { + // obtain position and rotation of first edge route + return getParentDemandElements().at(1)->getToEdge(); + } else { + return getParentEdges().back(); + } +} + + +SUMOVehicleClass +GNEWalk::getVClass() const { + return getParentDemandElements().front()->getVClass(); +} + + +const RGBColor& +GNEWalk::getColor() const { + return getParentDemandElements().front()->getColor(); +} + + +void +GNEWalk::startGeometryMoving() { + // only start geometry moving if arrival position isn't -1 + if (myArrivalPosition != -1) { + // always save original position over view + myWalkMove.originalViewPosition = getPositionInView(); + // save arrival position + myWalkMove.firstOriginalLanePosition = getAttribute(SUMO_ATTR_ARRIVALPOS); + // save current centering boundary + myWalkMove.movingGeometryBoundary = getCenteringBoundary(); + } +} + + +void +GNEWalk::endGeometryMoving() { + // check that myArrivalPosition isn't -1 and endGeometryMoving was called only once + if ((myArrivalPosition != -1) && myWalkMove.movingGeometryBoundary.isInitialised()) { + // reset myMovingGeometryBoundary + myWalkMove.movingGeometryBoundary.reset(); + } +} + + +void +GNEWalk::moveGeometry(const Position& offset) { + // only move if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + // Calculate new position using old position + Position newPosition = myWalkMove.originalViewPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition); + // obtain lane shape (to improve code legibility) + const PositionVector& laneShape = getParentEdges().back()->getLanes().front()->getLaneShape(); + // calculate offset lane + double offsetLane = laneShape.nearest_offset_to_point2D(newPosition, false) - laneShape.nearest_offset_to_point2D(myWalkMove.originalViewPosition, false); + std::cout << offsetLane << std::endl; + // Update arrival Position + myArrivalPosition = parse(myWalkMove.firstOriginalLanePosition) + offsetLane; + // Update geometry + updateGeometry(); + } +} + + +void +GNEWalk::commitGeometryMoving(GNEUndoList* undoList) { + // only commit geometry moving if myArrivalPosition isn't -1 + if (myArrivalPosition != -1) { + undoList->p_begin("arrivalPos of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_ARRIVALPOS, toString(myArrivalPosition), myWalkMove.firstOriginalLanePosition)); + undoList->p_end(); + } +} + + +void +GNEWalk::updateGeometry() { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // calculate geometry path depending if is a Walk over route + if (myTagProperty.getTag() == SUMO_TAG_WALK_ROUTE) { + // use edges of route parent + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentDemandElements().at(1)->getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } else if (getPathEdges().empty()) { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getParentEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } else { + GNEGeometry::calculateEdgeGeometricPath(this, myDemandElementSegmentGeometry, getPathEdges(), getVClass(), + getFirstAllowedVehicleLane(), getLastAllowedVehicleLane(), departPosLane, arrivalPosLane, startPos, endPos); + } + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updateGeometry(); + } +} + + +void +GNEWalk::updateDottedContour() { + // +} + + +void +GNEWalk::updatePartialGeometry(const GNEEdge* edge) { + // declare depart and arrival pos lane + double departPosLane = -1; + double arrivalPosLane = -1; + // declare start and end positions + Position startPos = Position::INVALID; + Position endPos = Position::INVALID; + // calculate person plan start and end lanepositions + calculatePersonPlanLaneStartEndPos(departPosLane, arrivalPosLane); + // calculate person plan start and end positions + calculatePersonPlanPositionStartEndPos(startPos, endPos); + // udpate geometry path + GNEGeometry::updateGeometricPath(myDemandElementSegmentGeometry, edge, departPosLane, arrivalPosLane, startPos, endPos); + // update child demand elementss + for (const auto& i : getChildDemandElements()) { + i->updatePartialGeometry(edge); + } +} + + +void +GNEWalk::computePath() { + if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO)) { + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), getParentEdges())); + } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, myNet->getPathCalculator()->calculatePath(getParentDemandElements().at(0)->getVClass(), fromViaBusStopEdges)); + } + // update geometry + updateGeometry(); +} + + +void +GNEWalk::invalidatePath() { + if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO)) { + // calculate route and update routeEdges + replacePathEdges(this, getParentEdges()); + } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { + // declare a from-via-busStop edges vector + std::vector fromViaBusStopEdges = getParentEdges(); + // add busStop edge + fromViaBusStopEdges.push_back(getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + // calculate route and update routeEdges + replacePathEdges(this, fromViaBusStopEdges); + } + // update geometry + updateGeometry(); +} + + +Position +GNEWalk::getPositionInView() const { + return Position(); +} + + +std::string +GNEWalk::getParentName() const { + return getParentDemandElements().front()->getID(); +} + + +Boundary +GNEWalk::getCenteringBoundary() const { + Boundary walkBoundary; + // return the combination of all parent edges's boundaries + for (const auto& i : getParentEdges()) { + walkBoundary.add(i->getCenteringBoundary()); + } + // check if is valid + if (walkBoundary.isInitialised()) { + return walkBoundary; + } else { + return Boundary(-0.1, -0.1, 0.1, 0.1); + } +} + + +void +GNEWalk::splitEdgeGeometry(const double /*splitPosition*/, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) { + // only split geometry of WalkEdges + if ((myTagProperty.getTag() == SUMO_TAG_WALK_EDGES) && + (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && + (originalElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { + // obtain new list of walk edges + std::string newWalkEdges = getNewListOfParents(originalElement, newElement); + // update walk edges + if (newWalkEdges.size() > 0) { + setAttribute(SUMO_ATTR_EDGES, newWalkEdges, undoList); + } + } +} + + +void +GNEWalk::drawGL(const GUIVisualizationSettings& /*s*/) const { + // Walks are drawn in GNEEdges +} + + +std::string +GNEWalk::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_FROM: + return getParentEdges().front()->getID(); + case SUMO_ATTR_TO: + return getParentEdges().back()->getID(); + case SUMO_ATTR_VIA: + return toString(getMiddleParentEdges()); + case SUMO_ATTR_EDGES: + return parseIDs(getParentEdges()); + case SUMO_ATTR_ROUTE: + return getParentDemandElements().at(1)->getID(); + case SUMO_ATTR_BUS_STOP: + return getParentAdditionals().front()->getID(); + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition == -1) { + return ""; + } else { + return toString(myArrivalPosition); + } + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return getParametersStr(); + case GNE_ATTR_PARENT: + return getParentDemandElements().front()->getID(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +double +GNEWalk::getAttributeDouble(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ARRIVALPOS: + if (myArrivalPosition != -1) { + return myArrivalPosition; + } else { + return (getLastAllowedVehicleLane()->getLaneShape().length() - POSITION_EPS); + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEWalk::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_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_VIA: + case SUMO_ATTR_EDGES: + case SUMO_ATTR_ROUTE: + case SUMO_ATTR_BUS_STOP: + case SUMO_ATTR_ARRIVALPOS: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEWalk::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr); + case SUMO_ATTR_VIA: + if (value.empty()) { + return true; + } else { + return canParse >(myNet, value, false); + } + case SUMO_ATTR_EDGES: + if (canParse >(myNet, value, false)) { + // all edges exist, then check if compounds a valid route + return GNERoute::isRouteValid(parse >(myNet, value)).empty(); + } else { + return false; + } + case SUMO_ATTR_BUS_STOP: + return (myNet->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr); + case SUMO_ATTR_ROUTE: + return (myNet->retrieveDemandElement(SUMO_TAG_ROUTE, value, false) != nullptr); + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + return true; + } else if (canParse(value)) { + const double parsedValue = canParse(value); + if ((parsedValue < 0) || (parsedValue > getLastAllowedVehicleLane()->getLaneShape().length())) { + return false; + } else { + return true; + } + } else { + return false; + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEWalk::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNEWalk::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +bool +GNEWalk::isAttributeEnabled(SumoXMLAttr /*key*/) const { + return true; +} + + +std::string +GNEWalk::getPopUpID() const { + return getTagStr(); +} + + +std::string +GNEWalk::getHierarchyName() const { + if ((myTagProperty.getTag() == SUMO_TAG_WALK_FROMTO) || (myTagProperty.getTag() == SUMO_TAG_WALK_EDGES)) { + return "walk: " + getParentEdges().front()->getID() + " -> " + getParentEdges().back()->getID(); + } else if (myTagProperty.getTag() == SUMO_TAG_WALK_BUSSTOP) { + return "walk: " + getParentEdges().front()->getID() + " -> " + getParentAdditionals().front()->getID(); + } else { + return "walk: " + getParentDemandElements().at(1)->getID(); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEWalk::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + // Specific of Trips and flow + case SUMO_ATTR_FROM: { + // update first edge + replaceFirstParentEdge(this, myNet->retrieveEdge(value)); + // compute walk + computePath(); + break; + } + case SUMO_ATTR_TO: { + // update last edge + replaceLastParentEdge(this, myNet->retrieveEdge(value)); + // compute walk + computePath(); + break; + } + case SUMO_ATTR_VIA: { + // update via + replaceMiddleParentEdges(this, parse >(myNet, value), true); + // compute walk + computePath(); + break; + } + case SUMO_ATTR_EDGES: + replaceParentEdges(this, value); + updateGeometry(); + break; + case SUMO_ATTR_ROUTE: + replaceParentDemandElement(this, value, 1); + updateGeometry(); + break; + case SUMO_ATTR_BUS_STOP: + replaceParentAdditional(this, value, 0); + // compute walk + computePath(); + break; + case SUMO_ATTR_ARRIVALPOS: + if (value.empty()) { + myArrivalPosition = -1; + } else { + myArrivalPosition = parse(value); + } + updateGeometry(); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEWalk::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEWalk.h sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEWalk.h --- sumo-1.5.0+dfsg1/src/netedit/elements/demand/GNEWalk.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/demand/GNEWalk.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,248 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEWalk.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// A class for visualizing walks in Netedit +/****************************************************************************/ +#pragma once +#include "GNEDemandElement.h" +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; +class GNEConnection; +class GNEVehicle; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEWalk : public GNEDemandElement, public Parameterised { + +public: + /**@brief parameter constructor for walkEdges + * @param[in] viewNet view in which this Walk is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this walk + * @param[in] arrivalPosition arrival position on the destination edge + */ + GNEWalk(GNENet* net, GNEDemandElement* personParent, const std::vector& edges, double arrivalPosition); + + /**@brief parameter constructor for walkEdges + * @param[in] viewNet view in which this Walk is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this walk + * @param[in] arrivalPosition arrival position on the destination edge + */ + GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEEdge* toEdge, + const std::vector& via, double arrivalPosition); + + /**@brief parameter constructor for walkBusStop + * @param[in] viewNet view in which this Walk is placed + * @param[in] personParent person parent + * @param[in] edges list of consecutive edges of this walk + * @param[in] busStop destination busStop + */ + GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEEdge* fromEdge, GNEAdditional* busStop, + const std::vector& via); + + /**@brief parameter constructor for walkRoute + * @param[in] viewNet view in which this Walk is placed + * @param[in] personParent person parent + * @param[in] personParent route parent + * @param[in] arrivalPosition arrival position on the last route's edge + */ + GNEWalk(GNENet* net, GNEDemandElement* personParent, GNEDemandElement* routeParent, double arrivalPosition); + + /// @brief destructor + ~GNEWalk(); + + /**@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 from edge of this demand element + GNEEdge* getFromEdge() const; + + /// @brief obtain to edge of this demand element + GNEEdge* getToEdge() const; + + /// @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 begin geometry movement + void startGeometryMoving(); + + /// @brief end geometry movement + void endGeometryMoving(); + + /**@brief change the position of the element geometry without saving in undoList + * @param[in] offset Position used for calculate new position of geometry without updating RTree + */ + void moveGeometry(const Position& offset); + + /**@brief commit geometry changes in the attributes of an element after use of moveGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitGeometryMoving(GNEUndoList* undoList); + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief partial update pre-computed geometry information + void updatePartialGeometry(const GNEEdge* edge); + + /// @brief compute path + void computePath(); + + /// @brief invalidate path + void invalidatePath(); + + /// @brief Returns position of additional in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the name of the parent object + * @return This object's parent id + */ + std::string getParentName() 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; + /// @} + + /// @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 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; + /// @} + +protected: + /// @brief variable for move walks + DemandElementMove myWalkMove; + + /// @brief arrival position + double myArrivalPosition; + +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 Invalidated copy constructor. + GNEWalk(GNEWalk*) = delete; + + /// @brief Invalidated assignment operator. + GNEWalk& operator=(GNEWalk*) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.cpp sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,4048 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAttributeCarrier.cpp +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// Abstract Base class for gui objects which carry attributes +/****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEAttributeCarrier.h" + + +// =========================================================================== +// static members +// =========================================================================== + +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); + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEAttributeCarrier::GNEAttributeCarrier(const SumoXMLTag tag, GNENet* net) : + myTagProperty(getTagProperties(tag)), + myNet(net), + mySelected(false) { +} + + +GNEAttributeCarrier::~GNEAttributeCarrier() {} + + +GNENet* +GNEAttributeCarrier::getNet() const { + return myNet; +} + + +void +GNEAttributeCarrier::selectAttributeCarrier(const bool changeFlag) { + if (getGUIGlObject() && myTagProperty.isSelectable()) { + gSelected.select(getGUIGlObject()->getGlID()); + // add object into list of selected objects + myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getGUIGlObject()->getType()); + if (changeFlag) { + mySelected = true; + } + } +} + + +void +GNEAttributeCarrier::unselectAttributeCarrier(const bool changeFlag) { + if (getGUIGlObject() && myTagProperty.isSelectable()) { + gSelected.deselect(getGUIGlObject()->getGlID()); + // remove object of list of selected objects + myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getGUIGlObject()->getType()); + if (changeFlag) { + mySelected = false; + } + } +} + + +bool +GNEAttributeCarrier::isAttributeCarrierSelected() const { + return mySelected; +} + + +bool +GNEAttributeCarrier::drawUsingSelectColor() const { + // get flag for network element + const bool networkElement = myTagProperty.isNetworkElement() || myTagProperty.isAdditionalElement() || myTagProperty.isShape() || myTagProperty.isTAZ(); + // check supermode network + if ((networkElement && myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) || + (myTagProperty.isDemandElement() && myNet->getViewNet()->getEditModes().isCurrentSupermodeDemand()) || + (myTagProperty.isGenericData() && myNet->getViewNet()->getEditModes().isCurrentSupermodeData())) { + return mySelected; + } else { + return false; + } +} + + +const GNEGeometry::DottedGeometry& +GNEAttributeCarrier::getDottedGeometry() const { + return myDottedGeometry; +} + + +template<> int +GNEAttributeCarrier::parse(const std::string& string) { + return StringUtils::toInt(string); +} + + +template<> double +GNEAttributeCarrier::parse(const std::string& string) { + return StringUtils::toDouble(string); +} + + +template<> SUMOTime +GNEAttributeCarrier::parse(const std::string& string) { + SUMOTime time = string2time(string); + if (time < 0) { + throw TimeFormatException("SUMOTIME cannot be negative"); + } else { + return time; + } +} + + +template<> bool +GNEAttributeCarrier::parse(const std::string& string) { + return StringUtils::toBool(string); +} + + +template<> std::string +GNEAttributeCarrier::parse(const std::string& string) { + return string; +} + + +template<> SUMOVehicleClass +GNEAttributeCarrier::parse(const std::string& string) { + if (string.size() == 0) { + throw EmptyData(); + } else if (!SumoVehicleClassStrings.hasString(string)) { + return SVC_IGNORING; + } else { + return SumoVehicleClassStrings.get(string); + } +} + + +template<> RGBColor +GNEAttributeCarrier::parse(const std::string& string) { + return RGBColor::parseColor(string); +} + + +template<> Position +GNEAttributeCarrier::parse(const std::string& string) { + if (string.size() == 0) { + throw EmptyData(); + } else { + bool ok = true; + PositionVector pos = GeomConvHelper::parseShapeReporting(string, "user-supplied position", 0, ok, false, false); + if (!ok || (pos.size() != 1)) { + throw NumberFormatException("(Position) " + string); + } else { + return pos[0]; + } + } +} + + +template<> PositionVector +GNEAttributeCarrier::parse(const std::string& string) { + PositionVector posVector; + // empty string are allowed (It means empty position vector) + if (string.empty()) { + return posVector; + } else { + bool ok = true; + posVector = GeomConvHelper::parseShapeReporting(string, "user-supplied shape", 0, ok, false, true); + if (!ok) { + throw NumberFormatException("(Position List) " + string); + } else { + return posVector; + } + } +} + + +template<> SUMOVehicleShape +GNEAttributeCarrier::parse(const std::string& string) { + if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) { + return SVS_UNKNOWN; + } else { + return SumoVehicleShapeStrings.get(string); + } +} + + +template<> std::vector +GNEAttributeCarrier::parse(const std::string& string) { + return StringTokenizer(string).getVector(); +} + + +template<> std::set +GNEAttributeCarrier::parse(const std::string& string) { + std::vector vectorString = StringTokenizer(string).getVector(); + std::set solution; + for (const auto& i : vectorString) { + solution.insert(i); + } + return solution; +} + + +template<> std::vector +GNEAttributeCarrier::parse(const std::string& string) { + std::vector parsedValues = parse >(string); + std::vector parsedIntValues; + for (const auto& i : parsedValues) { + parsedIntValues.push_back(parse(i)); + } + return parsedIntValues; +} + + +template<> std::vector +GNEAttributeCarrier::parse(const std::string& string) { + std::vector parsedValues = parse >(string); + std::vector parsedDoubleValues; + for (const auto& i : parsedValues) { + parsedDoubleValues.push_back(parse(i)); + } + return parsedDoubleValues; +} + + +template<> std::vector +GNEAttributeCarrier::parse(const std::string& string) { + std::vector parsedValues = parse >(string); + std::vector parsedBoolValues; + for (const auto& i : parsedValues) { + parsedBoolValues.push_back(parse(i)); + } + return parsedBoolValues; +} + + +template<> std::vector +GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { + // Declare string vector + std::vector edgeIds = GNEAttributeCarrier::parse > (value); + std::vector parsedEdges; + // Iterate over edges IDs, retrieve Edges and add it into parsedEdges + for (const auto& i : edgeIds) { + GNEEdge* retrievedEdge = net->retrieveEdge(i, false); + if (retrievedEdge) { + parsedEdges.push_back(net->retrieveEdge(i)); + } else { + throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist"); + } + } + return parsedEdges; +} + + +template<> std::vector +GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { + // Declare string vector + std::vector laneIds = GNEAttributeCarrier::parse > (value); + std::vector parsedLanes; + // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes + for (const auto& i : laneIds) { + GNELane* retrievedLane = net->retrieveLane(i, false); + if (retrievedLane) { + parsedLanes.push_back(net->retrieveLane(i)); + } else { + throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist"); + } + } + return parsedLanes; +} + + +template<> std::string +GNEAttributeCarrier::parseIDs(const std::vector& ACs) { + // obtain ID's of edges and return their join + std::vector edgeIDs; + for (const auto& i : ACs) { + edgeIDs.push_back(i->getID()); + } + return joinToString(edgeIDs, " "); +} + + +template<> std::string +GNEAttributeCarrier::parseIDs(const std::vector& ACs) { + // obtain ID's of lanes and return their join + std::vector laneIDs; + for (const auto& i : ACs) { + laneIDs.push_back(i->getID()); + } + return joinToString(laneIDs, " "); +} + + +bool +GNEAttributeCarrier::lanesConsecutives(const std::vector& lanes) { + // we need at least two lanes + if (lanes.size() > 1) { + // now check that lanes are consecutives (not neccesary connected) + int currentLane = 0; + while (currentLane < ((int)lanes.size() - 1)) { + int nextLane = -1; + // iterate over outgoing edges of destiny juntion of edge's lane + for (int i = 0; (i < (int)lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().size()) && (nextLane == -1); i++) { + // iterate over lanes of outgoing edges of destiny juntion of edge's lane + for (int j = 0; (j < (int)lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().size()) && (nextLane == -1); j++) { + // check if lane correspond to the next lane of "lanes" + if (lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().at(j) == lanes.at(currentLane + 1)) { + nextLane = currentLane; + } + } + } + if (nextLane == -1) { + return false; + } else { + currentLane++; + } + } + return true; + } else { + return false; + } +} + + +std::string +GNEAttributeCarrier::getAlternativeValueForDisabledAttributes(SumoXMLAttr key) const { + switch (key) { + // Crossings + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + return "No TLS"; + // connections + case SUMO_ATTR_DIR: { + // special case for connection directions + std::string direction = getAttribute(key); + if (direction == "s") { + return "Straight (s)"; + } else if (direction == "t") { + return "Turn (t))"; + } else if (direction == "l") { + return "Left (l)"; + } else if (direction == "r") { + return "Right (r)"; + } else if (direction == "L") { + return "Partially left (L)"; + } else if (direction == "R") { + return "Partially right (R)"; + } else if (direction == "invalid") { + return "No direction (Invalid))"; + } else { + return "undefined"; + } + } + case SUMO_ATTR_STATE: { + // special case for connection states + std::string state = getAttribute(key); + if (state == "-") { + return "Dead end (-)"; + } else if (state == "=") { + return "equal (=)"; + } else if (state == "m") { + return "Minor link (m)"; + } else if (state == "M") { + return "Major link (M)"; + } else if (state == "O") { + return "TLS controller off (O)"; + } else if (state == "o") { + return "TLS yellow flashing (o)"; + } else if (state == "y") { + return "TLS yellow minor link (y)"; + } else if (state == "Y") { + return "TLS yellow major link (Y)"; + } else if (state == "r") { + return "TLS red (r)"; + } else if (state == "g") { + return "TLS green minor (g)"; + } else if (state == "G") { + return "TLS green major (G)"; + } else { + return "undefined"; + } + } + // flows + case SUMO_ATTR_VEHSPERHOUR: + case SUMO_ATTR_PERIOD: + case SUMO_ATTR_PROB: + case SUMO_ATTR_END: + case SUMO_ATTR_NUMBER: + if (myTagProperty.hasAttribute(key) && myTagProperty.getAttributeProperties(key).isFlowDefinition()) { + if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { + if (isAttributeEnabled(SUMO_ATTR_END)) { + return "not together with number and period or probability"; + } else { + return "not together with end and period or probability"; + } + } else if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { + if (isAttributeEnabled(SUMO_ATTR_END)) { + return "not together with number and vehsPerHour or probability"; + } else { + return "not together with end and vehsPerHour or probability"; + } + } else if (isAttributeEnabled(SUMO_ATTR_PROB)) { + if (isAttributeEnabled(SUMO_ATTR_END)) { + return "not together with number and vehsPerHour or period"; + } else { + return "not together with end and vehsPerHour or period"; + } + } else if (isAttributeEnabled(SUMO_ATTR_END) && (isAttributeEnabled(SUMO_ATTR_NUMBER))) { + return "not together with end and number"; + } + } + FALLTHROUGH; + default: + return getAttribute(key); + } +} + + +std::string +GNEAttributeCarrier::getAttributeForSelection(SumoXMLAttr key) const { + return getAttribute(key); +} + + +const std::string& +GNEAttributeCarrier::getTagStr() const { + return myTagProperty.getTagStr(); +} + + +const GNETagProperties& +GNEAttributeCarrier::getTagProperty() const { + return myTagProperty; +} + + +FXIcon* +GNEAttributeCarrier::getIcon() const { + // define on first access + if (myTagProperties.size() == 0) { + fillAttributeCarriers(); + } + return GUIIconSubSys::getIcon(myTagProperty.getGUIIcon()); +} + +// =========================================================================== +// static methods +// =========================================================================== + +const GNETagProperties& +GNEAttributeCarrier::getTagProperties(SumoXMLTag tag) { + if (tag == SUMO_TAG_NOTHING) { + return dummyTagProperty; + } + // 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"); + } else { + return myTagProperties.at(tag); + } +} + + +std::vector +GNEAttributeCarrier::allowedTags(const bool onlyDrawables) { + std::vector allTags; + // define on first access + if (myTagProperties.size() == 0) { + fillAttributeCarriers(); + } + // fill all tags + for (const auto& i : myTagProperties) { + if (!onlyDrawables || i.second.isDrawable()) { + allTags.push_back(i.first); + } + } + return allTags; +} + + +std::vector +GNEAttributeCarrier::allowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables) { + std::vector allowedTags; + // define on first access + if (myTagProperties.size() == 0) { + fillAttributeCarriers(); + } + if (tagPropertyCategory & GNETagProperties::NETWORKELEMENT) { + // fill networkElements tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isNetworkElement() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::ADDITIONALELEMENT) { + // fill additional tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isAdditionalElement() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::SHAPE) { + // fill shape tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isShape() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::TAZ) { + // fill taz tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isTAZ() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::DEMANDELEMENT) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isDemandElement() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::ROUTE) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isRoute() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::VEHICLE) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isVehicle() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::STOP) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isStop() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::PERSON) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isPerson() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::PERSONPLAN) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isPersonPlan() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::PERSONTRIP) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isPersonTrip() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::WALK) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isWalk() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::RIDE) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isRide() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::PERSONSTOP) { + // fill demand tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isPersonStop() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + if (tagPropertyCategory & GNETagProperties::GENERICDATA) { + // fill generic data tags + for (const auto& tagProperty : myTagProperties) { + if (tagProperty.second.isGenericData() && (!onlyDrawables || tagProperty.second.isDrawable())) { + allowedTags.push_back(tagProperty.first); + } + } + } + return allowedTags; +} + + +std::vector +GNEAttributeCarrier::allowedTagsByCategoryStr(const int tagPropertyCategory, const bool onlyDrawables) { + std::vector solution; + // get tags + std::vector tags = allowedTagsByCategory(tagPropertyCategory, onlyDrawables); + // reserve + solution.reserve(tags.size()); + // iterate over tags + for (const auto& tag : tags) { + solution.push_back(toString(tag)); + } + return solution; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEAttributeCarrier::fillAttributeCarriers() { + // fill all groups of ACs + fillNetworkElements(); + fillAdditionals(); + fillShapes(); + fillDemandElements(); + fillVehicleElements(); + fillStopElements(); + fillPersonElements(); + fillPersonStopElements(); + fillDataElements(); + // check integrity of all Tags (function checkTagIntegrity() throw an exception if there is an inconsistency) + for (const auto& i : myTagProperties) { + i.second.checkTagIntegrity(); + } +} + + +void +GNEAttributeCarrier::fillNetworkElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // obtain Node Types except SumoXMLNodeType::DEAD_END_DEPRECATED + const OptionsCont& oc = OptionsCont::getOptions(); + std::vector nodeTypes = SUMOXMLDefinitions::NodeTypes.getStrings(); + nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::DEAD_END_DEPRECATED))); + nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::DEAD_END))); + nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::NOJUNCTION))); + nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(SumoXMLNodeType::INTERNAL))); + // fill networkElement ACs + SumoXMLTag currentTag = SUMO_TAG_EDGE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, + GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE, GUIIcon::EDGE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the edge"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of a node within the nodes-file the edge shall start at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of a node within the nodes-file the edge shall end at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "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, + "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, + "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, + "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, + "If the shape is given it should start and end with the positions of the from-node and to-node"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::UPDATEGEOMETRY, + "The length of the edge in meter"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPREADTYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Lane width for all lanes of this edge in meters (used for visualization)", + "right"); + attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneSpreadFunctions.getStrings()); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "Move the stop line back from the intersection by the given amount", + "0"); + 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 + "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 + "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) + "Show if edge is bidireccional", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DISTANCE, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UNIQUE, + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + currentTag = SUMO_TAG_JUNCTION; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, + GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE, GUIIcon::JUNCTION); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the node"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::POSITION | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y + "The x-y-z position of the node on the plane in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "A custom shape for that node"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_RADIUS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | 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, + "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, + "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, + "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, + "Optional name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TLTYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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_TLID, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC, + "An optional id for the traffic light program"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_LANE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, + GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "ID of lane (Automatic, non editable)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_INDEX, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The enumeration index of the lane (0 is the rightmost lane, -1 is the leftmost one)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "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, + "Width in meters (used for visualization)", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDOFFSET, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + "Move the stop line back from the intersection by the given amount", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ACCELERATION, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Enable or disable lane as acceleration lane", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CUSTOMSHAPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "If the shape is given it overrides the computation based on edge shape"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_CROSSING; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, + GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::CROSSING, SUMO_TAG_JUNCTION); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The ID of Crossing"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The (road) edges which are crossed"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PRIORITY, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "sets the tls-index for this crossing", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX2, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "Overrids default shape of pedestrian crossing"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_CONNECTION; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::NETWORKELEMENT, + GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::CONNECTION, SUMO_TAG_EDGE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the vehicles leave"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the vehicles may reach when leaving 'from'"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM_LANE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "the lane index of the incoming lane (numbers starting with 0)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO_LANE, + GNEAttributeProperties::INT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "the lane index of the outgoing lane (numbers starting with 0)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PASS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "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, + "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, + "Vision distance between vehicles", + toString(NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + "sets index of this connection within the controlling trafficlight", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TLLINKINDEX2, + GNEAttributeProperties::INT | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "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, + "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, + "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, + "sets custom shape for the connection"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DIR, + GNEAttributeProperties::STRING, + "turning direction for this connection (computed)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STATE, + GNEAttributeProperties::STRING, + "link state for this connection (computed)"); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +void +GNEAttributeCarrier::fillAdditionals() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill additional elements + SumoXMLTag currentTag = SUMO_TAG_BUS_STOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::STOPPINGPLACE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MASKSTARTENDPOS, GUIIcon::CONTAINERSTOP, SUMO_TAG_LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of bus stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the bus stop shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Optional space definition for vehicles that park at this stop", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + currentTag = SUMO_TAG_ACCESS; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::BLOCKMOVEMENT, GUIIcon::ACCESS, SUMO_TAG_BUS_STOP); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the stop access shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane (the lower position on the lane) in meters", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "The walking length of the access in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + + } + currentTag = SUMO_TAG_CONTAINER_STOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::STOPPINGPLACE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MASKSTARTENDPOS, GUIIcon::CONTAINERSTOP, SUMO_TAG_LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of container stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the container stop shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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); + } + currentTag = SUMO_TAG_CHARGING_STATION; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::STOPPINGPLACE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MASKSTARTENDPOS, GUIIcon::CHARGINGSTATION, SUMO_TAG_LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of charging station"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Lane of the charging station location"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "End position in the specified lane"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "Charging power in W", + "22000.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EFFICIENCY, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::RANGE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_PARKING_AREA; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::STOPPINGPLACE, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MASKSTARTENDPOS, GUIIcon::PARKINGAREA, SUMO_TAG_LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of ParkingArea"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the Parking Area shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROADSIDE_CAPACITY, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + " 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, + "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, + "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, + "The width of the road-side parking spaces", + "3.20"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + currentTag = SUMO_TAG_PARKING_SPACE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::MASKXYZPOSITION | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::REPARENT | GNETagProperties::BLOCKMOVEMENT, GUIIcon::PARKINGSPACE, SUMO_TAG_PARKING_AREA); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::POSITION | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y + "The x-y-z position of the parking vehicle on the plane"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_WIDTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The width of the road-side parking spaces", + "3.20"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The length of the road-side parking spaces", + "5.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ANGLE, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::ANGLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + currentTag = SUMO_TAG_E1DETECTOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E1, SUMO_TAG_LANE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of E1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters. The position must be a value between -1*lane's length and the lane's length"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The aggregation period the values the detector collects shall be summed up", + "900.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The path to the output file"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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); + } + currentTag = SUMO_TAG_E2DETECTOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E2, SUMO_TAG_LANE); + // set "file" as deprecated attribute + myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of E2"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + "The length of the detector in meters", + "10.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The aggregation period the values the detector collects shall be summed up", + "900.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The path to the output file"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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, + "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, + "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); + } + currentTag = SUMO_TAG_E2DETECTOR_MULTILANE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SYNONYM | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E2, SUMO_TAG_LANE, SUMO_TAG_E2DETECTOR); + // set "file" as deprecated attribute + myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Multilane E2"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::SECUENCIAL | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The list of secuencial lane ids in which the detector shall be laid on"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The end position on the lane the detector shall be laid on in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The aggregation period the values the detector collects shall be summed up", + "900.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The path to the output file"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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, + "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, + "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); + + } + currentTag = SUMO_TAG_E3DETECTOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MINIMUMCHILDREN | GNETagProperties::AUTOMATICSORTING, GUIIcon::E3); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "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, + "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, + "The aggregation period the values the detector collects shall be summed up", + "900.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The path to the output file"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + } + currentTag = SUMO_TAG_DET_ENTRY; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::REPARENT | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E3ENTRY, SUMO_TAG_E3DETECTOR); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + + } + currentTag = SUMO_TAG_DET_EXIT; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::REPARENT | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E3EXIT, SUMO_TAG_E3DETECTOR); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + + } + currentTag = SUMO_TAG_INSTANT_INDUCTION_LOOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT | GNETagProperties::DETECTOR, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT, GUIIcon::E1INSTANT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Instant Induction Loop (E1Instant)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the lane the detector shall be laid on in meters. The position must be a value between -1*lane's length and the lane's length"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The path to the output file"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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); + + } + currentTag = SUMO_TAG_VSS; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::DIALOG, GUIIcon::VARIABLESPEEDSIGN); + // set "file" as deprecated attribute + myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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, + "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, + "list of lanes of Variable Speed Sign"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_STEP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::VSSSTEP, SUMO_TAG_VSS); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_TIME, + GNEAttributeProperties::SUMOTIME, + "Time"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Speed", + "13.89"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_CALIBRATOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::DIALOG | GNETagProperties::CENTERAFTERCREATION, GUIIcon::CALIBRATOR); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Calibrator"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of edge in the simulation network"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + "The position of the calibrator on the specified lane", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTEPROBE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "The output file for writing calibrator information or NULL"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_LANECALIBRATOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::SYNONYM | GNETagProperties::DIALOG | GNETagProperties::CENTERAFTERCREATION, GUIIcon::CALIBRATOR, SUMO_TAG_NOTHING, SUMO_TAG_CALIBRATOR); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Calibrator"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of lane in the simulation network"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::UPDATEGEOMETRY, + "The position of the calibrator on the specified lane", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "The aggregation interval in which to calibrate the flows. Default is step-length", + "100.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTEPROBE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "The output file for writing calibrator information or NULL"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_FLOW_CALIBRATOR; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::FLOW, SUMO_TAG_CALIBRATOR); + // 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, + "First " + toString(currentTag) + " departure time", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_END, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "End of departure interval", + "3600.00"); + 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"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEED, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::ACTIVATABLE, + "Speed of " + toString(currentTag) + "s"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_REROUTER; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::DIALOG | GNETagProperties::WRITECHILDRENSEPARATE, GUIIcon::REROUTER); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Rerouter"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "An edge id or a list of edge ids where vehicles shall be rerouted"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "Whether the router should be inactive initially (and switched on in the gui)", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_INTERVAL; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::REROUTERINTERVAL, SUMO_TAG_REROUTER); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Begin", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_END, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "End", + "3600.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_CLOSING_REROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::CLOSINGREROUTE, SUMO_TAG_INTERVAL); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "Edge ID"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + "allowed vehicles"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + "disallowed vehicles"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_CLOSING_LANE_REROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::CLOSINGLANEREROUTE, SUMO_TAG_INTERVAL); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "Lane ID"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ALLOW, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + "allowed vehicles"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DISALLOW, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::VCLASSES | GNEAttributeProperties::XMLOPTIONAL, + "disallowed vehicles"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_DEST_PROB_REROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::DESTPROBREROUTE, SUMO_TAG_INTERVAL); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "Edge ID"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "SUMO Probability", + "1.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_PARKING_ZONE_REROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::PARKINGZONEREROUTE, SUMO_TAG_INTERVAL); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM, + "ParkingArea ID"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "SUMO Probability", + "1.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VISIBLE, + GNEAttributeProperties::BOOL | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Enable or disable visibility for parking area reroutes", + "1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_ROUTE_PROB_REROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::PARENT, GUIIcon::ROUTEPROBREROUTE, SUMO_TAG_INTERVAL); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "Route"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_PROB, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "SUMO Probability", + "1.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_ROUTEPROBE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::CENTERAFTERCREATION, GUIIcon::ROUTEPROBE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of RouteProbe"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of an edge in the simulation network"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FREQUENCY, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The frequency in which to report the distribution", + "3600"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The file for generated output"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "The time at which to start generating output", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_VAPORIZER; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::ADDITIONALELEMENT, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::CENTERAFTERCREATION, GUIIcon::VAPORIZER); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Edge in which vaporizer is placed"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Start Time", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_END, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "End Time", + "3600.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NAME, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Name of " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_TAZ; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::TAZ, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::BLOCKSHAPE | GNETagProperties::AUTOMATICSORTING, GUIIcon::TAZ); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "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, + "The shape of the TAZ"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "The RGBA color with which the TAZ shall be displayed", + "red"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FILL, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLIGNORED, + "An information whether the TAZ shall be filled", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_TAZSOURCE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::TAZ, GNETagProperties::PARENT, GUIIcon::TAZEDGE, SUMO_TAG_TAZ); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of edge in the simulation network"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_WEIGHT, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Depart weight associated to this Edge", + "1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_TAZSINK; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::TAZ, GNETagProperties::PARENT, GUIIcon::TAZEDGE, SUMO_TAG_TAZ); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::SYNONYM | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of edge in the simulation network"); + attrProperty.setSynonym(SUMO_ATTR_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_WEIGHT, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Arrival weight associated to this Edget", + "1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +void +GNEAttributeCarrier::fillShapes() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill shape ACs + SumoXMLTag currentTag = SUMO_TAG_POLY; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::SHAPE, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::BLOCKSHAPE | GNETagProperties::CLOSESHAPE | GNETagProperties::GEOSHAPE, GUIIcon::LOCATEPOLY /* temporal */); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the polygon"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SHAPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE, + "The shape of the polygon"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "The default line width for drawing an unfilled polygon", + "1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "A typename for the polygon", + toString(Shape::DEFAULT_TYPE)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_IMGFILE, + GNEAttributeProperties::STRING | GNEAttributeProperties::FILENAME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "Angle of rendered image in degree", + toString(Shape::DEFAULT_ANGLE)); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_POI; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::SHAPE, GNETagProperties::DRAWABLE | GNETagProperties::RTREE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT | GNETagProperties::MASKXYZPOSITION | GNETagProperties::GEOPOSITION, GUIIcon::LOCATEPOI /* temporal */); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::STRING | GNEAttributeProperties::POSITION | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y + "The position in view"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "A typename for the " + toString(currentTag), + toString(Shape::DEFAULT_TYPE)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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, + "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, + "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, + "Angle of rendered image in degree", + toString(Shape::DEFAULT_ANGLE)); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_POILANE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::SHAPE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::BLOCKMOVEMENT, GUIIcon::LOCATEPOI /* temporal */); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of the " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The name of the lane at which the " + toString(currentTag) + " is located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The position on the named lane or in the net in meters at which the " + toString(currentTag) + " is located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_POSITION_LAT, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "A typename for the " + toString(currentTag), + toString(Shape::DEFAULT_TYPE)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LAYER, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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, + "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, + "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, + "Angle of rendered image in degree", + toString(Shape::DEFAULT_ANGLE)); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +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; + + // fill demand elements + SumoXMLTag currentTag = SUMO_TAG_ROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::ROUTE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT, GUIIcon::ROUTE); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of Route"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The edges the vehicle shall drive along, given as their ids, separated using spaces"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "This route's color", + "yellow"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_EMBEDDEDROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::ROUTE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT, GUIIcon::ROUTE); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The edges the vehicle shall drive along, given as their ids, separated using spaces"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "This route's color", + "yellow"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_VTYPE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VTYPE, 0, GUIIcon::VTYPE); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of VehicleType"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VCLASS, + GNEAttributeProperties::VCLASS | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "An abstract vehicle class", + "passenger"); + attrProperty.setDiscreteValues(vClassesVehicles); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "This vehicle type's color", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "The vehicle's netto-length (length) [m]"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "Empty space after leader [m]"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXSPEED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "The vehicle's maximum velocity [m/s]"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEEDFACTOR, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "The vehicles expected multiplicator for lane speed limits"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_SPEEDDEV, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "The deviation of the speedFactor"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EMISSIONCLASS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "The number of containers the vehicle can transport"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BOARDING_DURATION, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "The preferred lateral alignment when using the sublane-model", + "center"); + attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings()); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP_LAT, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "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, + "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, + "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, + "Carriage lengths"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LOCOMOTIVE_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "Locomotive lengths"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CARRIAGE_GAP, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "GAP between carriages", + "1"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill VType Car Following Model Values (implemented in a separated function to improve code legibility) + fillCarFollowingModelAttributes(currentTag); + + // fill VType Junction Model Parameters (implemented in a separated function to improve code legibility) + fillJunctionModelAttributes(currentTag); + + // fill VType Lane Change Model Parameters (implemented in a separated function to improve code legibility) + fillLaneChangingModelAttributes(currentTag); + } + currentTag = SUMO_TAG_PTYPE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VTYPE, GNETagProperties::SYNONYM, GUIIcon::PTYPE, SUMO_TAG_NOTHING, SUMO_TAG_VTYPE); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The id of PersonType"); + 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); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "This person type's color", + ""); + 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)"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LENGTH, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "The person's netto-length (length) [m]"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MINGAP, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "Empty space after leader [m]"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MAXSPEED, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUEMUTABLE | GNEAttributeProperties::XMLOPTIONAL, + "The person's maximum velocity [m/s]"); + 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"); + 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)"); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +void +GNEAttributeCarrier::fillVehicleElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill vehicle ACs + SumoXMLTag currentTag = SUMO_TAG_VEHICLE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::VEHICLE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "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 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 " + toString(currentTag) + " shall drive along"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // add common attributes + fillCommonVehicleAttributes(currentTag); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The time step at which the " + toString(currentTag) + " shall enter the network", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_ROUTEFLOW; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::SYNONYM, GUIIcon::ROUTEFLOW, SUMO_TAG_NOTHING, SUMO_TAG_FLOW); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "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(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 " + toString(currentTag) + " shall drive along"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // add common attributes + fillCommonVehicleAttributes(currentTag); + + // add flow attributes + fillCommonFlowAttributes(currentTag); + } + currentTag = SUMO_TAG_TRIP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::TRIP); + // 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"); + 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(currentTag), + DEFAULT_VTYPE_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + 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_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_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)); + 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"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_FLOW; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::FLOW); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "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(currentTag), + DEFAULT_VTYPE_ID); + myTagProperties[currentTag].addAttribute(attrProperty); + + 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_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_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)); + myTagProperties[currentTag].addAttribute(attrProperty); + + // add common attributes + fillCommonVehicleAttributes(currentTag); + + // add flow attributes + fillCommonFlowAttributes(currentTag); + } + /* currently disabled. See #5259 + currentTag = SUMO_TAG_TRIP_TAZ; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::VEHICLE, GNETagProperties::DRAWABLE, GUIIcon::TRIP); + } + */ +} + + +void +GNEAttributeCarrier::fillStopElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill stops ACs + SumoXMLTag currentTag = SUMO_TAG_STOP_LANE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::STOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::MASKSTARTENDPOS | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the stop shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The begin position on the lane (the lower position on the lane) in meters", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ENDPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } + currentTag = SUMO_TAG_STOP_BUSSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::STOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_BUS_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "BusStop associated with this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } + currentTag = SUMO_TAG_STOP_CONTAINERSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::STOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_CONTAINER_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "ContainerStop associated with this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } + currentTag = SUMO_TAG_STOP_CHARGINGSTATION; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::STOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_CHARGING_STATION, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "ChargingStation associated with this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } + currentTag = SUMO_TAG_STOP_PARKINGAREA; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::STOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_PARKING_AREA, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "ParkingArea associated with this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } +} + + +void +GNEAttributeCarrier::fillPersonElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill vehicle ACs + SumoXMLTag currentTag = SUMO_TAG_PERSON; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSON, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::PERSON); + + // add flow attributes + fillCommonPersonAttributes(currentTag); + + // set specific attribute depart (note: Persons doesn't support triggered and containerTriggered values) + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPART, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The time step at which the " + toString(currentTag) + " shall enter the network", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + currentTag = SUMO_TAG_PERSONFLOW; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSON, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE, GUIIcon::PERSONFLOW); + + // add flow attributes + fillCommonPersonAttributes(currentTag); + + // add flow attributes + fillCommonFlowAttributes(currentTag); + } + currentTag = SUMO_TAG_PERSONTRIP_FROMTO; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::PERSONTRIP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::PERSONTRIP_FROMTO); + // set values of attributes + 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_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_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "List of possible vehicle types to take"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "List of possible traffic modes. Walking is always possible regardless of this value"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "arrival position on the destination edge", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_PERSONTRIP_BUSSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::PERSONTRIP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::PERSONTRIP_BUSSTOP); + // set values of attributes + 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_BUS_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VTYPES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "List of possible vehicle types to take"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_MODES, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "List of possible traffic modes. Walking is always possible regardless of this value"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_RIDE_FROMTO; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::RIDE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::RIDE_FROMTO); + // set values of attributes + 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_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_LINES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC, + "list of vehicle alternatives to take for the " + toString(currentTag), + "ANY"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "arrival position on the destination edge", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_RIDE_BUSSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::RIDE, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::RIDE_BUSSTOP); + // set values of attributes + 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_BUS_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LINES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC, + "list of vehicle alternatives to take for the ride", + "ANY"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_WALK_EDGES; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::WALK_EDGES); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_EDGES, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "id of the edges to walk"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Arrival position on the destination edge", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + + currentTag = SUMO_TAG_WALK_ROUTE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::WALK_ROUTE); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ROUTE, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The id of the route to walk"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Arrival position on the destination edge", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_WALK_FROMTO; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::WALK_FROMTO); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the start edge"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the destination edge"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VIA, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Ids of the intermediate edges"); + myTagProperties[currentTag].addAttribute(attrProperty); + + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALPOS, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Arrival position on the destination edge", + "-1"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + + currentTag = SUMO_TAG_WALK_BUSSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONPLAN | GNETagProperties::WALK, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::PARENT | GNETagProperties::SORTINGCHILDREN, GUIIcon::WALK_BUSSTOP); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_FROM, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the start edge"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BUS_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +void +GNEAttributeCarrier::fillPersonStopElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill vehicle ACs + SumoXMLTag currentTag = SUMO_TAG_PERSONSTOP_LANE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONSTOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::MASKSTARTENDPOS | GNETagProperties::SORTINGCHILDREN | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_LANE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the lane the stop shall be located at"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_STARTPOS, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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_FRIENDLY_POS, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } + currentTag = SUMO_TAG_PERSONSTOP_BUSSTOP; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DEMANDELEMENT | GNETagProperties::PERSONSTOP, GNETagProperties::DRAWABLE | GNETagProperties::SELECTABLE | GNETagProperties::SORTINGCHILDREN | GNETagProperties::NOPARAMETERS, GUIIcon::STOPELEMENT); + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_BUS_STOP, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "BusStop associated with this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // fill common stop attributes + fillCommonStopAttributes(currentTag); + } +} + + +void +GNEAttributeCarrier::fillCommonVehicleAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_COLOR, + GNEAttributeProperties::STRING | GNEAttributeProperties::COLOR | GNEAttributeProperties::DEFAULTVALUESTATIC, + "This " + toString(currentTag) + "'s color", + "yellow"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTLANE, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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) */, + "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) */, + "The speed with which the " + toString(currentTag) + " shall enter the network", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ARRIVALLANE, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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) */, + "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) */, + "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, + "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, + "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, + "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, + "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, + "The lateral position on the arrival lane at which the " + toString(currentTag) + " shall arrive", + "center"); + myTagProperties[currentTag].addAttribute(attrProperty); +} + + +void +GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "First " + toString(currentTag) + " departure time", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_END, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + "End of departure interval", + "3600.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_NUMBER, + GNEAttributeProperties::INT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::FLOWDEFINITION, + "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", + "1800"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_VEHSPERHOUR, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", + "0.5"); + myTagProperties[currentTag].addAttribute(attrProperty); +} + + +void +GNEAttributeCarrier::fillCarFollowingModelAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ACCEL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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, + "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, + "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, + "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, + "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, + "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, + "SKRAUSSX parameter 1", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP2, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "SKRAUSSX parameter 2", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP3, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "SKRAUSSX parameter 3", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP4, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "SKRAUSSX parameter 4", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TMP5, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "SKRAUSSX parameter 5", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_PWAGNER2009_TAULAST, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "IDMM parameter", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_TIME, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "Wiedemann parameter", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "MinGap factor parameter", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_K, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "Kerner Phi parameter", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_CF_IDM_DELTA, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "IDM Stepping parameter", + ""); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TRAIN_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::DISCRETE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::EXTENDED, + "Train Types", + "NGT400"); + attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrainTypes.getStrings()); + myTagProperties[currentTag].addAttribute(attrProperty); +} + + +void +GNEAttributeCarrier::fillJunctionModelAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + attrProperty = GNEAttributeProperties(SUMO_ATTR_JM_CROSSING_GAP, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "Willingess of drivers to impede vehicles with higher priority", + "0.0"); + myTagProperties[currentTag].addAttribute(attrProperty); +} + + +void +GNEAttributeCarrier::fillLaneChangingModelAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_LCA_STRATEGIC_PARAM, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | 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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "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, + "XXXXX", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + */ +} + + +void +GNEAttributeCarrier::fillCommonPersonAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "The name of the " + toString(currentTag)); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TYPE, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | 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, + "This " + toString(currentTag) + "'s color", + "yellow"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DEPARTPOS, + GNEAttributeProperties::COMPLEX | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL | GNEAttributeProperties::UPDATEGEOMETRY, + "The position at which the " + toString(currentTag) + " shall enter the net", + "base"); + myTagProperties[currentTag].addAttribute(attrProperty); +} + + +void +GNEAttributeCarrier::fillCommonStopAttributes(SumoXMLTag currentTag) { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + + attrProperty = GNEAttributeProperties(SUMO_ATTR_DURATION, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "Minimum duration for stopping", + "60"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_UNTIL, + GNEAttributeProperties::FLOAT | GNEAttributeProperties::POSITIVE | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "The time step at which the route continues", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EXTENSION, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::ACTIVATABLE | GNEAttributeProperties::DEFAULTVALUESTATIC, + "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_INDEX, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Where to insert the stop in the vehicle's list of stops", + "end"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_TRIGGERED, + GNEAttributeProperties::BOOL | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Whether a person may end the stop", + "0"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_EXPECTED, + GNEAttributeProperties::STRING | GNEAttributeProperties::LIST | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "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"); + 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); + + 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, + "Activity displayed for stopped person in GUI and output files ", + "waiting"); + myTagProperties[currentTag].addAttribute(attrProperty); + + /** Attribute currently disabled. It will be implemented in #6011 + attrProperty = GNEAttributeProperties(SUMO_ATTR_TRIP_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::DEFAULTVALUESTATIC | GNEAttributeProperties::XMLOPTIONAL, + "Value used for trips that uses this stop"); + myTagProperties[currentTag].addAttribute(attrProperty); + */ +} + + +void +GNEAttributeCarrier::fillDataElements() { + // declare empty GNEAttributeProperties + GNEAttributeProperties attrProperty; + // fill data set element + SumoXMLTag currentTag = SUMO_TAG_DATASET; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DATAELEMENT, GNETagProperties::AUTOMATICSORTING | GNETagProperties::NOPARAMETERS, GUIIcon::DATASET); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "Data set ID"); + myTagProperties[currentTag].addAttribute(attrProperty); + + } + // fill data interval element + currentTag = SUMO_TAG_DATAINTERVAL; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DATAELEMENT, GNETagProperties::PARENT | GNETagProperties::NOPARAMETERS, GUIIcon::DATAINTERVAL, SUMO_TAG_DATASET); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE, + "Interval ID"); + myTagProperties[currentTag].addAttribute(attrProperty); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_BEGIN, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "First " + toString(currentTag) + " departure time", + "0.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + + attrProperty = GNEAttributeProperties(SUMO_ATTR_END, + GNEAttributeProperties::SUMOTIME | GNEAttributeProperties::DEFAULTVALUESTATIC, + "End of departure interval", + "3600.00"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + // fill edge data element + currentTag = SUMO_TAG_MEANDATA_EDGE; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DATAELEMENT | GNETagProperties::GENERICDATA, GNETagProperties::DRAWABLE | GNETagProperties::PARAMETERSDOUBLE | GNETagProperties::SELECTABLE, GUIIcon::EDGEDATA, SUMO_TAG_DATAINTERVAL); + + // set values of attributes + attrProperty = GNEAttributeProperties(SUMO_ATTR_ID, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "edge ID"); + myTagProperties[currentTag].addAttribute(attrProperty); + } + currentTag = SUMO_TAG_EDGEREL; + { + // set values of tag + myTagProperties[currentTag] = GNETagProperties(currentTag, GNETagProperties::DATAELEMENT | GNETagProperties::GENERICDATA, GNETagProperties::DRAWABLE | GNETagProperties::PARAMETERSDOUBLE | GNETagProperties::SELECTABLE, GUIIcon::EDGERELDATA, SUMO_TAG_DATAINTERVAL); + + // set values of attributes + 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_TO, + GNEAttributeProperties::STRING | GNEAttributeProperties::UNIQUE | GNEAttributeProperties::UPDATEGEOMETRY, + "The name of the edge the " + toString(currentTag) + " ends at"); + myTagProperties[currentTag].addAttribute(attrProperty); + } +} + + +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 name values + if ((attribute == SUMO_ATTR_NAME) && !SUMOXMLDefinitions::isValidAttribute(parsedAttribute)) { + errorFormat = "name contains invalid characters; "; + } + // 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.5.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.h sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.h --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeCarrier.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,439 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAttributeCarrier.h +/// @author Jakob Erdmann +/// @date Mar 2011 +/// +// Abstract Base class for gui objects which carry attributes +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNETagProperties.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNENet; +class GNEUndoList; +class GNELane; +class GNEEdge; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEAttributeCarrier + * + * Abstract Base class for gui objects which carry attributes + * inherits from GNEReferenceCounter for convenience + */ +class GNEAttributeCarrier : public GNEReferenceCounter { + + /// @brief declare friend class + friend class GNEChange_Attribute; + friend class GNEChange_EnableAttribute; + +public: + + /**@brief Constructor + * @param[in] tag SUMO Tag assigned to this type of object + * @param[in] icon GUIIcon associated to the type of object + * @param[in] net GNENet in which this AttributeCarrier is stored + */ + GNEAttributeCarrier(const SumoXMLTag tag, GNENet* net); + + /// @brief Destructor + virtual ~GNEAttributeCarrier(); + + /// @brief get pointer to net + GNENet* getNet() const; + + /// @brief select attribute carrier using GUIGlobalSelection + void selectAttributeCarrier(const bool changeFlag = true); + + /// @brief unselect attribute carrier using GUIGlobalSelection + void unselectAttributeCarrier(const bool changeFlag = true); + + /// @brief check if attribute carrier is selected + bool isAttributeCarrierSelected() const; + + /// @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 ID (all Attribute Carriers have one) + virtual const std::string& getID() const = 0; + + /// @brief get GUIGlObject associated with this AttributeCarrier + virtual GUIGlObject* getGUIGlObject() = 0; + + /// @brief get dotted geometry + const GNEGeometry::DottedGeometry& getDottedGeometry() const; + + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @} + + /// @name Function related with get/set attributes (must be implemented in all childs) + /// @{ + /* @brief method for getting the Attribute of an XML key + * @param[in] key The attribute key + * @return string with the value associated to key + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /* @brief method for check if new value for certain attribute is valid + * @param[in] key The attribute key + * @param[in] value The new value + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 + */ + virtual void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @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 + */ + virtual void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + virtual std::string getPopUpID() const = 0; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + virtual std::string getHierarchyName() const = 0; + /// @} + + /* @brief method for return an alternative value for disabled attributes. Used only in GNEFrames + * @param[in] key The attribute key + */ + 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 get tags of all editable element types + static std::vector allowedTags(const bool onlyDrawables); + + /// @brief get tags of all editable element types using TagProperty Type (NetworkEditMode::NETWORKELEMENT, ADDITIONALELEMENT, etc.) + static std::vector allowedTagsByCategory(const int tagPropertyCategory, const bool onlyDrawables); + + /// @brief get tags of all editable element types in string format using TagProperty Type (NetworkEditMode::NETWORKELEMENT, ADDITIONALELEMENT, etc.) + static std::vector allowedTagsByCategoryStr(const int tagPropertyCategory, const bool onlyDrawables); + + /// @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 (NumberFormatException&) { + return false; + } catch (TimeFormatException&) { + return false; + } catch (EmptyData&) { + return false; + } catch (BoolFormatException&) { + return false; + } + return true; + } + + /// @brief parses a value of type T from string (used for basic types: int, double, bool, etc.) + template + static T parse(const std::string& string); + + /// @brief true if a value of type T can be parsed from string + template + static bool canParse(GNENet* net, const std::string& value, bool report) { + try { + parse(net, value); + } catch (FormatException& exception) { + if (report) { + WRITE_WARNING(exception.what()) + } + return false; + } + return true; + } + + /// @brief parses a complex value of type T from string (use for list of edges, list of lanes, etc.) + template + static T parse(GNENet* net, const std::string& value); + + /// @brief parses a list of specific Attribute Carriers into a string of IDs + template + static std::string parseIDs(const std::vector& ACs); + + /// @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(); + } + // check if we're parsing block movement + if (attribute == GNE_ATTR_BLOCK_MOVEMENT) { + // first check if we can parse + if (tagProperties.canBlockMovement()) { + // First check if attribute can be parsed to bool + parsedAttribute = attrs.get(attribute, objectID.c_str(), parsedOk, false); + // check that sucesfully parsed attribute can be converted to type double + if (!canParse(parsedAttribute)) { + abort = true; + // return default value + return parse("0"); + } else { + // return readed value + return parse(parsedAttribute); + } + } else { + throw ProcessError("Trying to parsing block movement attribute in an AC that cannot be moved"); + } + } + // now check if we're parsing a GEO Attribute + if (tagProperties.hasGEOPosition() && ((attribute == SUMO_ATTR_LON) || (attribute == SUMO_ATTR_LAT))) { + // first check if GEO Attribute is defined + if (attrs.hasAttribute(attribute)) { + // First check if attribute can be parsed to string + parsedAttribute = attrs.get(attribute, objectID.c_str(), parsedOk, false); + // check that sucesfully parsed attribute can be converted to type double + if (!canParse(parsedAttribute)) { + WRITE_WARNING("Format of GEO attribute '" + toString(attribute) + "' of " + + warningMessage + " is invalid; Cannot be parsed to float; " + tagProperties.getTagStr() + " cannot be created"); + // return default value + return parse("0"); + } else { + // return readed value + return parse(parsedAttribute); + } + } + parsedOk = false; + // return default value + return parse("0"); + } + // 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); + } + +protected: + /// @brief the xml tag to which this attribute carrier corresponds + const GNETagProperties& myTagProperty; + + /// @brief pointer to net + GNENet* myNet; + + /// @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 dotted geometry + GNEGeometry::DottedGeometry myDottedGeometry; + +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 fill Attribute Carriers + static void fillAttributeCarriers(); + + /// @brief fill network elements + static void fillNetworkElements(); + + /// @brief fill Additionals + static void fillAdditionals(); + + /// @brief fill Shapes + static void fillShapes(); + + /// @brief fill Demand Elements + static void fillDemandElements(); + + /// @brief fill vehicle elements + static void fillVehicleElements(); + + /// @brief fill Stop elements + static void fillStopElements(); + + /// @brief fill Person Elements + static void fillPersonElements(); + + /// @brief fill PersonStop elements + static void fillPersonStopElements(); + + /// @brief fill common vehicle attributes (used by vehicles, trips, routeFlows and flows) + static void fillCommonVehicleAttributes(SumoXMLTag currentTag); + + /// @brief fill common flow attributes (used by flows, routeFlows and personFlows) + static void fillCommonFlowAttributes(SumoXMLTag currentTag); + + /// @brief fill Car Following Model of Vehicle/Person Types + static void fillCarFollowingModelAttributes(SumoXMLTag currentTag); + + /// @brief fill Junction Model Attributes of Vehicle/Person Types + static void fillJunctionModelAttributes(SumoXMLTag currentTag); + + /// @brief fill Junction Model Attributes of Vehicle/Person Types + static void fillLaneChangingModelAttributes(SumoXMLTag currentTag); + + /// @brief fill common person attributes (used by person and personFlows) + static void fillCommonPersonAttributes(SumoXMLTag currentTag); + + /// @brief fill stop person attributes (used by stops and personStps) + 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; + + /// @brief Invalidated copy constructor. + GNEAttributeCarrier(const GNEAttributeCarrier&) = delete; + + /// @brief Invalidated assignment operator + GNEAttributeCarrier& operator=(const GNEAttributeCarrier& src) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeProperties.cpp sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeProperties.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeProperties.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeProperties.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,477 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAttributeProperties.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Abstract Base class for tag properties used in GNEAttributeCarrier +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== + +#include "GNEAttributeProperties.h" +#include "GNETagProperties.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEAttributeProperties::GNEAttributeProperties() : + myAttribute(SUMO_ATTR_NOTHING), + myTagPropertyParent(nullptr), + myAttrStr(toString(SUMO_ATTR_NOTHING)), + myAttributeProperty(STRING), + myDefinition(""), + myDefaultValue(""), + myAttrSynonym(SUMO_ATTR_NOTHING), + myMinimumRange(0), + myMaximumRange(0) {} + + +GNEAttributeProperties::GNEAttributeProperties(const SumoXMLAttr attribute, const int attributeProperty, const std::string& definition, std::string defaultValue) : + myAttribute(attribute), + myTagPropertyParent(nullptr), + myAttrStr(toString(attribute)), + myAttributeProperty(attributeProperty), + myDefinition(definition), + myDefaultValue(defaultValue), + myAttrSynonym(SUMO_ATTR_NOTHING), + myMinimumRange(0), + myMaximumRange(0) { + // empty definition aren't valid + if (definition.empty()) { + 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)) { + 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"); + } +} + + +GNEAttributeProperties::~GNEAttributeProperties() {} + + +void +GNEAttributeProperties::checkAttributeIntegrity() { + // check that positive attributes correspond only to a int, floats or SUMOTimes + if (isPositive() && !(isInt() || isFloat() || isSUMOTime())) { + throw FormatException("Only int, floats or SUMOTimes can be positive"); + } + // check that secuential attributes correspond to a list + if (isSecuential() && !isList()) { + throw FormatException("Secuential property only is compatible with list properties"); + } + // check that synonym attribute isn't nothing + if (hasAttrSynonym() && (myAttrSynonym == SUMO_ATTR_NOTHING)) { + throw FormatException("synonym attribute cannot be nothing"); + } + // check that ranges are valid + if (hasAttrRange()) { + if (myMinimumRange == myMaximumRange) { + throw FormatException("empty range"); + } else if ((myMinimumRange == 0) && (myMaximumRange == 0)) { + throw FormatException("non-defined range"); + } else if ((myMaximumRange - myMinimumRange) <= 0) { + 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"); + } +} + + +void +GNEAttributeProperties::setDiscreteValues(const std::vector& discreteValues) { + if (isDiscrete()) { + myDiscreteValues = discreteValues; + } else { + throw FormatException("AttributeProperty doesn't support discrete values values"); + } +} + + +void +GNEAttributeProperties::setSynonym(const SumoXMLAttr synonym) { + if (hasAttrSynonym()) { + myAttrSynonym = synonym; + } else { + throw FormatException("AttributeProperty doesn't support synonyms"); + } +} + + +void +GNEAttributeProperties::setRange(const double minimum, const double maximum) { + if (hasAttrRange()) { + myMinimumRange = minimum; + myMaximumRange = maximum; + // check that given range is valid + if (myMinimumRange == myMaximumRange) { + throw FormatException("empty range"); + } else if ((myMinimumRange == 0) && (myMaximumRange == 0)) { + throw FormatException("non-defined range"); + } else if ((myMaximumRange - myMinimumRange) <= 0) { + throw FormatException("invalid range"); + } + } else { + throw FormatException("AttributeProperty doesn't support ranges"); + } +} + + +void +GNEAttributeProperties::setTagPropertyParent(GNETagProperties* tagPropertyParent) { + myTagPropertyParent = tagPropertyParent; +} + + +SumoXMLAttr +GNEAttributeProperties::getAttr() const { + return myAttribute; +} + + +const std::string& +GNEAttributeProperties::getAttrStr() const { + return myAttrStr; +} + + +const GNETagProperties& +GNEAttributeProperties::getTagPropertyParent() const { + return *myTagPropertyParent; +} + + +int +GNEAttributeProperties::getPositionListed() const { + for (auto i = myTagPropertyParent->begin(); i != myTagPropertyParent->end(); i++) { + if (i->getAttr() == myAttribute) { + return (int)(i - myTagPropertyParent->begin()); + } + } + throw ProcessError("Attribute wasn't found in myTagPropertyParent"); +} + + +const std::string& +GNEAttributeProperties::getDefinition() const { + return myDefinition; +} + + +const std::string& +GNEAttributeProperties::getDefaultValue() const { + return myDefaultValue; +} + + +std::string +GNEAttributeProperties::getDescription() const { + std::string pre; + std::string type; + std::string plural; + std::string last; + // pre type + if ((myAttributeProperty & LIST) != 0) { + pre += "list of "; + if ((myAttributeProperty & VCLASS) != 0) { + plural = "es"; + } else { + plural = "s"; + } + } + if ((myAttributeProperty & POSITIVE) != 0) { + pre += "positive "; + } + if ((myAttributeProperty & DISCRETE) != 0) { + pre += "discrete "; + } + if ((myAttributeProperty & XMLOPTIONAL) != 0) { + pre += "optional "; + } + if ((myAttributeProperty & UNIQUE) != 0) { + pre += "unique "; + } + if ((myAttributeProperty & VCLASSES) != 0) { + pre += "vclasses "; + } + // type + if ((myAttributeProperty & INT) != 0) { + type = "integer"; + } + if ((myAttributeProperty & FLOAT) != 0) { + type = "float"; + } + if ((myAttributeProperty & SUMOTIME) != 0) { + type = "SUMOTime"; + } + if ((myAttributeProperty & BOOL) != 0) { + type = "boolean"; + } + if ((myAttributeProperty & STRING) != 0) { + type = "string"; + } + if ((myAttributeProperty & POSITION) != 0) { + type = "position"; + } + if ((myAttributeProperty & COLOR) != 0) { + type = "color"; + } + if ((myAttributeProperty & VCLASS) != 0) { + type = "VClass"; + } + if ((myAttributeProperty & FILENAME) != 0) { + type = "filename"; + } + if ((myAttributeProperty & PROBABILITY) != 0) { + type = "probability"; + last = "[0, 1]"; + } + if ((myAttributeProperty & ANGLE) != 0) { + type = "angle"; + last = "[0, 360]"; + } + return pre + type + plural + last; +} + + +const std::vector& +GNEAttributeProperties::getDiscreteValues() const { + return myDiscreteValues; +} + + +SumoXMLAttr +GNEAttributeProperties::getAttrSynonym() const { + if (hasAttrSynonym()) { + return myAttrSynonym; + } else { + throw ProcessError("Attr doesn't support synonym"); + } +} + + +double +GNEAttributeProperties::getMinimumRange() const { + if (hasAttrRange()) { + return myMinimumRange; + } else { + throw ProcessError("Attr doesn't support range"); + } +} + + +double +GNEAttributeProperties::getMaximumRange() const { + if (hasAttrRange()) { + return myMaximumRange; + } else { + throw ProcessError("Attr doesn't support range"); + } +} + + +bool +GNEAttributeProperties::hasStaticDefaultValue() const { + return (myAttributeProperty & DEFAULTVALUESTATIC) != 0; +} + + +bool +GNEAttributeProperties::hasMutableDefaultValue() const { + return (myAttributeProperty & DEFAULTVALUEMUTABLE) != 0; +} + + +bool +GNEAttributeProperties::hasAttrSynonym() const { + return (myAttributeProperty & SYNONYM) != 0; +} + +bool +GNEAttributeProperties::hasAttrRange() const { + return (myAttributeProperty & RANGE) != 0; +} + + +bool +GNEAttributeProperties::isInt() const { + return (myAttributeProperty & INT) != 0; +} + + +bool +GNEAttributeProperties::isFloat() const { + return (myAttributeProperty & FLOAT) != 0; +} + + +bool +GNEAttributeProperties::isSUMOTime() const { + return (myAttributeProperty & SUMOTIME) != 0; +} + + +bool +GNEAttributeProperties::isBool() const { + return (myAttributeProperty & BOOL) != 0; +} + + +bool +GNEAttributeProperties::isString() const { + return (myAttributeProperty & STRING) != 0; +} + + +bool +GNEAttributeProperties::isposition() const { + return (myAttributeProperty & POSITION) != 0; +} + + +bool +GNEAttributeProperties::isProbability() const { + return (myAttributeProperty & PROBABILITY) != 0; +} + + +bool +GNEAttributeProperties::isNumerical() const { + return (myAttributeProperty & (INT | FLOAT | SUMOTIME)) != 0; +} + + +bool +GNEAttributeProperties::isPositive() const { + return (myAttributeProperty & POSITIVE) != 0; +} + + +bool +GNEAttributeProperties::isColor() const { + return (myAttributeProperty & COLOR) != 0; +} + + +bool +GNEAttributeProperties::isFilename() const { + return (myAttributeProperty & FILENAME) != 0; +} + + +bool +GNEAttributeProperties::isVClass() const { + return (myAttributeProperty & VCLASS) != 0; +} + + +bool +GNEAttributeProperties::isSVCPermission() const { + return ((myAttributeProperty & LIST) != 0) && ((myAttributeProperty & VCLASS) != 0); +} + + +bool +GNEAttributeProperties::isList() const { + return (myAttributeProperty & LIST) != 0; +} + + +bool +GNEAttributeProperties::isSecuential() const { + return (myAttributeProperty & SECUENCIAL) != 0; +} + + +bool +GNEAttributeProperties::isUnique() const { + return (myAttributeProperty & UNIQUE) != 0; +} + + +bool +GNEAttributeProperties::isOptional() const { + return (myAttributeProperty & XMLOPTIONAL) != 0; +} + + +bool +GNEAttributeProperties::isIgnored() const { + return (myAttributeProperty & XMLIGNORED) != 0; +} + + +bool +GNEAttributeProperties::isDiscrete() const { + return (myAttributeProperty & DISCRETE) != 0; +} + + +bool +GNEAttributeProperties::isVClasses() const { + return (myAttributeProperty & VCLASSES) != 0; +} + + +bool +GNEAttributeProperties::isExtended() const { + return (myAttributeProperty & EXTENDED) != 0; +} + + +bool +GNEAttributeProperties::requireUpdateGeometry() const { + return (myAttributeProperty & UPDATEGEOMETRY) != 0; +} + + +bool +GNEAttributeProperties::isActivatable() const { + return (myAttributeProperty & ACTIVATABLE) != 0; +} + + +bool +GNEAttributeProperties::isComplex() const { + return (myAttributeProperty & COMPLEX) != 0; +} + + +bool +GNEAttributeProperties::isFlowDefinition() const { + return (myAttributeProperty & FLOWDEFINITION) != 0; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeProperties.h sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeProperties.h --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEAttributeProperties.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEAttributeProperties.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,254 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAttributeProperties.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Abstract Base class for attribute properties used in GNEAttributeCarrier +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== +#include + +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNETagProperties; + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEAttributeProperties { + +public: + + /// @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 + XMLIGNORED = 1 << 17, // Attribute will not be written in XML file + DEFAULTVALUESTATIC = 1 << 18, // Attribute owns a static default value + DEFAULTVALUEMUTABLE = 1 << 19, // Attribute owns a mutable default value (Default value depends of value of other attribute) + VCLASSES = 1 << 20, // Attribute is a combination of VClasses (allow/disallow) + SYNONYM = 1 << 21, // Attribute will be written with a different name in der XML + RANGE = 1 << 22, // Attribute only accept a range of elements (example: Probability [0,1]) + EXTENDED = 1 << 23, // Attribute is extended (in Frame will not be shown, but is editable in a Dialog, see VType attributes) + UPDATEGEOMETRY = 1 << 24, // Attribute require update geometry at the end of function setAttribute(...) + ACTIVATABLE = 1 << 25, // Attribute can be switch on/off using a checkbox in frame + COMPLEX = 1 << 26, // Attribute is complex: Requiere a special function to check if the given value is valid + FLOWDEFINITION = 1 << 27, // Attribute is part of a flow definition (Number, vehsPerHour...) + }; + + /// @brief default constructor + GNEAttributeProperties(); + + /// @brief parameter constructor + GNEAttributeProperties(const SumoXMLAttr attribute, const int attributeProperty, const std::string& definition, std::string defaultValue = ""); + + /// @brief destructor + ~GNEAttributeProperties(); + + /// @brief check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float) + void checkAttributeIntegrity(); + + /// @brief set discrete values + void setDiscreteValues(const std::vector& discreteValues); + + /// @brief set synonim + void setSynonym(const SumoXMLAttr synonym); + + /// @brief set range + void setRange(const double minimum, const double maximum); + + /// @brief set tag property parent + void setTagPropertyParent(GNETagProperties* tagPropertyParent); + + /// @brief get XML Attribute + SumoXMLAttr getAttr() const; + + /// @brief get XML Attribute + const std::string& getAttrStr() const; + + /// @brief get reference to tagProperty parent + const GNETagProperties& getTagPropertyParent() const; + + /// @brief get position in list (used in frames for listing attributes with certain sort) + int getPositionListed() const; + + /// @brief get default value + const std::string& getDefinition() const; + + /// @brief get default value + const std::string& getDefaultValue() const; + + /// @brief return a description of attribute + std::string getDescription() const; + + /// @brief get discrete values + const std::vector& getDiscreteValues() const; + + /// @brief get tag synonym + SumoXMLAttr getAttrSynonym() const; + + /// @brief get minimum range + double getMinimumRange() const; + + /// @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 Attr correspond to an element that will be written in XML with another name + bool hasAttrSynonym() const; + + /// @brief return true if Attr correspond to an element that only accept a range of values + bool hasAttrRange() const; + + /// @brief return true if atribute is an integer + bool isInt() const; + + /// @brief return true if atribute is a float + bool isFloat() const; + + /// @brief return true if atribute is a SUMOTime + bool isSUMOTime() const; + + /// @brief return true if atribute is boolean + bool isBool() const; + + /// @brief return true if atribute is a string + bool isString() const; + + /// @brief return true if atribute is a position + bool isposition() const; + + /// @brief return true if atribute is a probability + bool isProbability() const; + + /// @brief return true if atribute is numerical (int or float) + bool isNumerical() const; + + /// @brief return true if atribute is positive + bool isPositive() const; + + /// @brief return true if atribute is a color + bool isColor() const; + + /// @brief return true if atribute is a filename + bool isFilename() const; + + /// @brief return true if atribute is a VehicleClass + bool isVClass() const; + + /// @brief return true if atribute is a VehicleClass + bool isSVCPermission() const; + + /// @brief return true if atribute is a list + bool isList() const; + + /// @brief return true if atribute is sequential + bool isSecuential() const; + + /// @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 ignored + bool isIgnored() const; + + /// @brief return true if atribute is discrete + bool isDiscrete() const; + + /// @brief return true if atribute is a list of VClasses + bool isVClasses() const; + + /// @brief return true if atribute is extended + bool isExtended() const; + + /// @brief return true if atribute requires a update geometry in setAttribute(...) + bool requireUpdateGeometry() const; + + /// @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; + +private: + /// @brief XML Attribute + SumoXMLAttr myAttribute; + + /// @brief pointer to tagProperty parent + GNETagProperties* myTagPropertyParent; + + /// @brief string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls) + std::string myAttrStr; + + /// @brief Property of attribute + int myAttributeProperty; + + /// @brief text with a definition of attribute + std::string myDefinition; + + /// @brief default value (by default empty) + std::string myDefaultValue; + + /// @brief discrete values that can take this Attribute (by default empty) + std::vector myDiscreteValues; + + /// @brief Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) + SumoXMLAttr myAttrSynonym; + + /// @brief minimun Range + double myMinimumRange; + + /// @brief maxium Range + double myMaximumRange; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.cpp sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,686 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEHierarchicalChildElements.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// A abstract class for representation of additional elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEHierarchicalChildElements.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +GNEHierarchicalChildElements::GNEHierarchicalChildElements(const GNEAttributeCarrier* AC, + const std::vector& /* childJunctions */, + const std::vector& childEdges, + const std::vector& childLanes, + const std::vector& childShapes, + const std::vector& childAdditionals, + const std::vector& childDemandElements, + const std::vector& childGenericDataElements) : + myChildConnections(this), + myChildEdges(childEdges), + myChildLanes(childLanes), + myChildShapes(childShapes), + myChildAdditionals(childAdditionals), + myChildDemandElements(childDemandElements), + myChildGenericDataElements(childGenericDataElements), + myAC(AC) { + // fill SortedChildDemandElementsByType with all demand element tags (it's needed because getChildDemandElementsSortedByType(...) function is constant + auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::DEMANDELEMENT, false); + for (const auto& tag : listOfTags) { + myDemandElementsByType[tag] = {}; + } +} + + +GNEHierarchicalChildElements::~GNEHierarchicalChildElements() {} + + +const Position& +GNEHierarchicalChildElements::getChildPosition(const GNELane* lane) { + for (const auto& childConnection : myChildConnections.symbolsPositionAndRotation) { + if (childConnection.lane == lane) { + return childConnection.pos; + } + } + throw ProcessError("Lane doesn't exist"); +} + + +double +GNEHierarchicalChildElements::getChildRotation(const GNELane* lane) { + for (const auto& childConnection : myChildConnections.symbolsPositionAndRotation) { + if (childConnection.lane == lane) { + return childConnection.rot; + } + } + throw ProcessError("Lane doesn't exist"); +} + + +void +GNEHierarchicalChildElements::updateChildConnections() { + myChildConnections.update(); +} + + +void +GNEHierarchicalChildElements::drawChildConnections(const GUIVisualizationSettings& s, const GUIGlObjectType GLTypeParent) const { + myChildConnections.draw(s, GLTypeParent); +} + + +void +GNEHierarchicalChildElements::addChildAdditional(GNEAdditional* additional) { + // Check if additional is valid + if (additional == nullptr) { + throw InvalidArgument("Trying to add an empty child additional in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + // add it in child additional container + myChildAdditionals.push_back(additional); + // Check if children has to be sorted automatically + if (myAC->getTagProperty().canAutomaticSortChildren()) { + sortChildAdditionals(); + } + // update parent additional after add additional (note: by default non-implemented) + updateParentAdditional(); + } +} + + +void +GNEHierarchicalChildElements::removeChildAdditional(GNEAdditional* additional) { + // First check that additional was already inserted + auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); + if (it == myChildAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildAdditionals.erase(it); + // Check if children has to be sorted automatically + if (myAC->getTagProperty().canAutomaticSortChildren()) { + sortChildAdditionals(); + } + // update parent additional after add additional (note: by default non-implemented) + updateParentAdditional(); + } +} + + +const std::vector& +GNEHierarchicalChildElements::getChildAdditionals() const { + return myChildAdditionals; +} + + +size_t +GNEHierarchicalChildElements::getNumberOfChildAdditionals(GNETagProperties::TagType additionalType) const { + size_t number = 0; + // check additional type + if (additionalType == GNETagProperties::TagType::ADDITIONALELEMENT) { + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().isAdditionalElement()) { + number++; + } + } + } else if (additionalType == GNETagProperties::TagType::TAZ) { + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().isTAZ()) { + number++; + } + } + } else { + throw ProcessError("invalid additionalType"); + } + return number; +} + + +void +GNEHierarchicalChildElements::sortChildAdditionals() { + if (myAC->getTagProperty().getTag() == SUMO_TAG_E3DETECTOR) { + // we need to sort Entry/Exits due additional.xds model + std::vector sortedEntryExits; + // obtain all entrys + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().getTag() == SUMO_TAG_DET_ENTRY) { + sortedEntryExits.push_back(additional); + } + } + // obtain all exits + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().getTag() == SUMO_TAG_DET_EXIT) { + sortedEntryExits.push_back(additional); + } + } + // change myChildAdditionals for sortedEntryExits + if (sortedEntryExits.size() == myChildAdditionals.size()) { + myChildAdditionals = sortedEntryExits; + } else { + throw ProcessError("Some child additional were lost during sorting"); + } + } else if (myAC->getTagProperty().getTag() == SUMO_TAG_TAZ) { + // we need to sort Entry/Exits due additional.xds model + std::vector sortedTAZSourceSink; + // obtain all TAZSources + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { + sortedTAZSourceSink.push_back(additional); + } + } + // obtain all TAZSinks + for (const auto& additional : myChildAdditionals) { + if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { + sortedTAZSourceSink.push_back(additional); + } + } + // change myChildAdditionals for sortedEntryExits + if (sortedTAZSourceSink.size() == myChildAdditionals.size()) { + myChildAdditionals = sortedTAZSourceSink; + } else { + throw ProcessError("Some child additional were lost during sorting"); + } + } else { + // declare a vector to keep sorted children + std::vector, GNEAdditional*> > sortedChildren; + // iterate over child additional + for (const auto& additional : myChildAdditionals) { + sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional)); + // set begin/start attribute + if (additional->getTagProperty().hasAttribute(SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_TIME))) { + sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_TIME); + } else if (additional->getTagProperty().hasAttribute(SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_BEGIN))) { + sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_BEGIN); + } + // set end attribute + if (additional->getTagProperty().hasAttribute(SUMO_ATTR_END) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_END))) { + sortedChildren.back().first.second = additional->getAttributeDouble(SUMO_ATTR_END); + } else { + sortedChildren.back().first.second = sortedChildren.back().first.first; + } + } + // sort children + std::sort(sortedChildren.begin(), sortedChildren.end()); + // make sure that number of sorted children is the same as the child additional + if (sortedChildren.size() == myChildAdditionals.size()) { + myChildAdditionals.clear(); + for (auto i : sortedChildren) { + myChildAdditionals.push_back(i.second); + } + } else { + throw ProcessError("Some child additional were lost during sorting"); + } + } +} + + +bool +GNEHierarchicalChildElements::checkChildAdditionalsOverlapping() const { + // declare a vector to keep sorted children + std::vector, GNEAdditional*> > sortedChildren; + // iterate over child additional + for (const auto& additional : myChildAdditionals) { + sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional)); + // set begin/start attribute + if (additional->getTagProperty().hasAttribute(SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_TIME))) { + sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_TIME); + } else if (additional->getTagProperty().hasAttribute(SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_BEGIN))) { + sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_BEGIN); + } + // set end attribute + if (additional->getTagProperty().hasAttribute(SUMO_ATTR_END) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_END))) { + sortedChildren.back().first.second = additional->getAttributeDouble(SUMO_ATTR_END); + } else { + sortedChildren.back().first.second = sortedChildren.back().first.first; + } + } + // sort children + std::sort(sortedChildren.begin(), sortedChildren.end()); + // make sure that number of sorted children is the same as the child additional + if (sortedChildren.size() == myChildAdditionals.size()) { + if (sortedChildren.size() <= 1) { + return true; + } else { + // check overlapping + for (int i = 0; i < (int)sortedChildren.size() - 1; i++) { + if (sortedChildren.at(i).first.second > sortedChildren.at(i + 1).first.first) { + return false; + } + } + } + return true; + } else { + throw ProcessError("Some child additional were lost during sorting"); + } +} + + +void +GNEHierarchicalChildElements::addChildDemandElement(GNEDemandElement* demandElement) { + // Check if demand element is valid + if (demandElement == nullptr) { + throw InvalidArgument("Trying to add an empty child demand element in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + // add it in demandElement child container + myChildDemandElements.push_back(demandElement); + // add it also in SortedChildDemandElementsByType container + myDemandElementsByType.at(demandElement->getTagProperty().getTag()).push_back(demandElement); + // Check if children has to be sorted automatically + if (myAC->getTagProperty().canAutomaticSortChildren()) { + sortChildDemandElements(); + } + } +} + + +void +GNEHierarchicalChildElements::removeChildDemandElement(GNEDemandElement* demandElement) { + // First check that demandElement was already inserted + auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); + auto itByType = std::find(myDemandElementsByType.at(demandElement->getTagProperty().getTag()).begin(), myDemandElementsByType.at(demandElement->getTagProperty().getTag()).end(), demandElement); + if (it == myChildDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + // first check if element is duplicated in vector + bool singleElement = std::count(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement) == 1; + myChildDemandElements.erase(it); + // only remove it from mySortedChildDemandElementsByType if is a single element + if (singleElement && (itByType != myDemandElementsByType.at(demandElement->getTagProperty().getTag()).end())) { + myDemandElementsByType.at(demandElement->getTagProperty().getTag()).erase(itByType); + } + // Check if children has to be sorted automatically + if (myAC->getTagProperty().canAutomaticSortChildren()) { + sortChildDemandElements(); + } + } +} + + +const std::vector& +GNEHierarchicalChildElements::getChildDemandElements() const { + return myChildDemandElements; +} + + +const std::vector& +GNEHierarchicalChildElements::getChildDemandElementsByType(SumoXMLTag tag) const { + return myDemandElementsByType.at(tag); +} + + +void +GNEHierarchicalChildElements::sortChildDemandElements() { + // by default empty +} + + +bool +GNEHierarchicalChildElements::checkChildDemandElementsOverlapping() const { + return true; +} + + +GNEDemandElement* +GNEHierarchicalChildElements::getPreviousChildDemandElement(const GNEDemandElement* demandElement) const { + // find child demand element + auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); + // return element or null depending of iterator + if (it == myChildDemandElements.end()) { + return nullptr; + } else if (it == myChildDemandElements.begin()) { + return nullptr; + } else { + return *(it - 1); + } +} + + +GNEDemandElement* +GNEHierarchicalChildElements::getNextChildDemandElement(const GNEDemandElement* demandElement) const { + // find child demand element + auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); + // return element or null depending of iterator + if (it == myChildDemandElements.end()) { + return nullptr; + } else if (it == (myChildDemandElements.end() - 1)) { + return nullptr; + } else { + return *(it + 1); + } +} + + +void +GNEHierarchicalChildElements::addChildGenericDataElement(GNEGenericData* genericDataElement) { + // Check if demand element is valid + if (genericDataElement == nullptr) { + throw InvalidArgument("Trying to add an empty child generic data element in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + // add it in generic data element child container + myChildGenericDataElements.push_back(genericDataElement); + } +} + + +void +GNEHierarchicalChildElements::removeChildGenericDataElement(GNEGenericData* genericDataElement) { + // First check that genericDataElement was already inserted + auto it = std::find(myChildGenericDataElements.begin(), myChildGenericDataElements.end(), genericDataElement); + if (it == myChildGenericDataElements.end()) { + throw ProcessError(genericDataElement->getTagStr() + " with ID='" + genericDataElement->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + // remove it from child demand elements + myChildGenericDataElements.erase(it); + } +} + + +const std::vector& +GNEHierarchicalChildElements:: getChildGenericDataElements() const { + return myChildGenericDataElements; +} + + +void +GNEHierarchicalChildElements::addChildEdge(GNEEdge* edge) { + // Check that edge is valid and doesn't exist previously + if (edge == nullptr) { + throw InvalidArgument("Trying to add an empty child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildEdges.push_back(edge); + } +} + + +void +GNEHierarchicalChildElements::removeChildEdge(GNEEdge* edge) { + // Check that edge is valid and exist previously + if (edge == nullptr) { + throw InvalidArgument("Trying to remove an empty child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myChildEdges.begin(), myChildEdges.end(), edge) == myChildEdges.end()) { + throw InvalidArgument("Trying to remove a non previously inserted child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildEdges.erase(std::find(myChildEdges.begin(), myChildEdges.end(), edge)); + // update connections geometry + myChildConnections.update(); + } +} + + +const std::vector& +GNEHierarchicalChildElements::getChildEdges() const { + return myChildEdges; +} + + +void +GNEHierarchicalChildElements::addChildLane(GNELane* lane) { + // Check if lane is valid + if (lane == nullptr) { + throw InvalidArgument("Trying to add an empty child lane in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildLanes.push_back(lane); + // update connections geometry + myChildConnections.update(); + } +} + + +void +GNEHierarchicalChildElements::removeChildLane(GNELane* lane) { + // Check if lane is valid + if (lane == nullptr) { + throw InvalidArgument("Trying to remove an empty child lane in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildLanes.erase(std::find(myChildLanes.begin(), myChildLanes.end(), lane)); + // update connections geometry + myChildConnections.update(); + } +} + + +const std::vector& +GNEHierarchicalChildElements::getChildLanes() const { + return myChildLanes; +} + + +void +GNEHierarchicalChildElements::addChildShape(GNEShape* shape) { + // Check that shape is valid and doesn't exist previously + if (shape == nullptr) { + throw InvalidArgument("Trying to add an empty child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myChildShapes.begin(), myChildShapes.end(), shape) != myChildShapes.end()) { + throw InvalidArgument("Trying to add a duplicate child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildShapes.push_back(shape); + // update connections geometry + myChildConnections.update(); + } +} + + +void +GNEHierarchicalChildElements::removeChildShape(GNEShape* shape) { + // Check that shape is valid and exist previously + if (shape == nullptr) { + throw InvalidArgument("Trying to remove an empty child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myChildShapes.begin(), myChildShapes.end(), shape) == myChildShapes.end()) { + throw InvalidArgument("Trying to remove a non previously inserted child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myChildShapes.erase(std::find(myChildShapes.begin(), myChildShapes.end(), shape)); + // update connections geometry + myChildConnections.update(); + } +} + + +const std::vector& +GNEHierarchicalChildElements::getChildShapes() const { + return myChildShapes; +} + + +void +GNEHierarchicalChildElements::updateParentAdditional() { + // by default nothing to do +} + + +void +GNEHierarchicalChildElements::updateParentDemandElement() { + // by default nothing to do +} + + +void +GNEHierarchicalChildElements::changeChildEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs) { + // remove demandElement of child edges + for (const auto& edge : myChildEdges) { + edge->removeParentAdditional(elementChild); + } + // obtain new child edges (note: it can be empty) + myChildEdges = GNEAttributeCarrier::parse >(elementChild->getNet(), newEdgeIDs); + // add demandElement into parent edges + for (const auto& edge : myChildEdges) { + edge->addParentAdditional(elementChild); + } + // update connections geometry + myChildConnections.update(); +} + + +void +GNEHierarchicalChildElements::changeChildLanes(GNEAdditional* elementChild, const std::string& newLaneIDs) { + // remove demandElement of child lanes + for (const auto& lane : myChildLanes) { + lane->removeParentAdditional(elementChild); + } + // obtain new child lanes (note: it can be empty) + myChildLanes = GNEAttributeCarrier::parse >(elementChild->getNet(), newLaneIDs); + // add demandElement into parent lanes + for (const auto& lane : myChildLanes) { + lane->addParentAdditional(elementChild); + } + // update connections geometry + myChildConnections.update(); +} + +// --------------------------------------------------------------------------- +// GNEHierarchicalChildElements::ChildConnections - methods +// --------------------------------------------------------------------------- + +GNEHierarchicalChildElements::ChildConnections::ConnectionGeometry::ConnectionGeometry() : + lane(nullptr), + pos(Position::INVALID), + rot(0) { +} + + +GNEHierarchicalChildElements::ChildConnections::ConnectionGeometry::ConnectionGeometry(GNELane* _lane, Position _pos, double _rot) : + lane(_lane), + pos(_pos), + rot(_rot) { +} + + +GNEHierarchicalChildElements::ChildConnections::ChildConnections(GNEHierarchicalChildElements* hierarchicalElement) : + myHierarchicalElement(hierarchicalElement) {} + + +void +GNEHierarchicalChildElements::ChildConnections::update() { + // first clear connection positions + connectionPositions.clear(); + symbolsPositionAndRotation.clear(); + // calculate position and rotation of every simbol for every edge + for (const auto& edge : myHierarchicalElement->myChildEdges) { + for (const auto& lane : edge->getLanes()) { + Position pos; + double rot; + // set position and length depending of shape's lengt + if (lane->getLaneShape().length() - 6 > 0) { + pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length() - 6); + rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length() - 6); + } else { + pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length()); + rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length()); + } + symbolsPositionAndRotation.push_back(ConnectionGeometry(lane, pos, rot)); + } + } + // calculate position and rotation of every symbol for every lane + for (const auto& lane : myHierarchicalElement->myChildLanes) { + Position pos; + double rot; + // set position and length depending of shape's lengt + if (lane->getLaneShape().length() - 6 > 0) { + pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length() - 6); + rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length() - 6); + } else { + pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length()); + rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length()); + } + symbolsPositionAndRotation.push_back(ConnectionGeometry(lane, pos, rot)); + } + // calculate position for every child additional + for (const auto& additional : myHierarchicalElement->myChildAdditionals) { + // check that position is different of position + if (additional->getPositionInView() != myHierarchicalElement->getPositionInView()) { + std::vector posConnection; + double A = std::abs(additional->getPositionInView().x() - myHierarchicalElement->getPositionInView().x()); + double B = std::abs(additional->getPositionInView().y() - myHierarchicalElement->getPositionInView().y()); + // Set positions of connection's vertex. Connection is build from Entry to E3 + posConnection.push_back(additional->getPositionInView()); + if (myHierarchicalElement->getPositionInView().x() > additional->getPositionInView().x()) { + if (myHierarchicalElement->getPositionInView().y() > additional->getPositionInView().y()) { + posConnection.push_back(Position(additional->getPositionInView().x() + A, additional->getPositionInView().y())); + } else { + posConnection.push_back(Position(additional->getPositionInView().x(), additional->getPositionInView().y() - B)); + } + } else { + if (myHierarchicalElement->getPositionInView().y() > additional->getPositionInView().y()) { + posConnection.push_back(Position(additional->getPositionInView().x(), additional->getPositionInView().y() + B)); + } else { + posConnection.push_back(Position(additional->getPositionInView().x() - A, additional->getPositionInView().y())); + } + } + posConnection.push_back(myHierarchicalElement->getPositionInView()); + connectionPositions.push_back(posConnection); + } + } + // calculate geometry for connections between parent and children + for (const auto& symbol : symbolsPositionAndRotation) { + std::vector posConnection; + double A = std::abs(symbol.pos.x() - myHierarchicalElement->getPositionInView().x()); + double B = std::abs(symbol.pos.y() - myHierarchicalElement->getPositionInView().y()); + // Set positions of connection's vertex. Connection is build from Entry to E3 + posConnection.push_back(symbol.pos); + if (myHierarchicalElement->getPositionInView().x() > symbol.pos.x()) { + if (myHierarchicalElement->getPositionInView().y() > symbol.pos.y()) { + posConnection.push_back(Position(symbol.pos.x() + A, symbol.pos.y())); + } else { + posConnection.push_back(Position(symbol.pos.x(), symbol.pos.y() - B)); + } + } else { + if (myHierarchicalElement->getPositionInView().y() > symbol.pos.y()) { + posConnection.push_back(Position(symbol.pos.x(), symbol.pos.y() + B)); + } else { + posConnection.push_back(Position(symbol.pos.x() - A, symbol.pos.y())); + } + } + posConnection.push_back(myHierarchicalElement->getPositionInView()); + connectionPositions.push_back(posConnection); + } +} + + +void +GNEHierarchicalChildElements::ChildConnections::draw(const GUIVisualizationSettings& s, const GUIGlObjectType parentType) const { + // first check if connections can be drawn + if (!s.drawForRectangleSelection) { + // Iterate over myConnectionPositions + for (const auto& connection : connectionPositions) { + // Add a draw matrix + glPushMatrix(); + // traslate in the Z axis + glTranslated(0, 0, parentType - 0.01); + // Set color of the base + GLHelper::setColor(s.colorSettings.childConnections); + // iterate over connections + for (auto position = connection.begin(); (position + 1) != connection.end(); position++) { + // Draw Lines + GLHelper::drawLine((*position), (*(position + 1))); + } + // Pop draw matrix + glPopMatrix(); + } + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.h sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.h --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalChildElements.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,290 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEHierarchicalChildElements.h +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// A abstract class for representation of Hierarchical Elements +/****************************************************************************/ +#pragma once +#include + +#include + +#include "GNEAttributeCarrier.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEAdditional; +class GNEDemandElement; +class GNEShape; +class GNEGenericData; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEHierarchicalChildElements + * @brief An special type of Attribute carrier that owns hierarchical elements + */ +class GNEHierarchicalChildElements { + +public: + + /// @brief declare GNEChange_Children as friend class + friend class GNEChange_Children; + + /**@brief Parameter Constructor + * @param[in] AC Attribute carrier + * @param[in] childJunctions vector of child junctions + * @param[in] childEdges vector of child edges + * @param[in] childLanes vector of child lanes + * @param[in] childShapes vector of child shapes + * @param[in] childAdditionals vector of child additional + * @param[in] childDemandElements vector of child demand elements + * @param[in] childGenericDataElements vector of child generic data elements + */ + GNEHierarchicalChildElements(const GNEAttributeCarrier* AC, + const std::vector& childJunctions, + const std::vector& childEdges, + const std::vector& childLanes, + const std::vector& childShapes, + const std::vector& childAdditionals, + const std::vector& childDemandElements, + const std::vector& childGenericDataElements); + + /// @brief Destructor + ~GNEHierarchicalChildElements(); + + /// @brief get child position calculated in ChildConnections + const Position& getChildPosition(const GNELane* lane); + + /// @brief get child rotation calculated in ChildConnections + double getChildRotation(const GNELane* lane); + + /// @brief update child connections + void updateChildConnections(); + + // Draw connections between parent and children + void drawChildConnections(const GUIVisualizationSettings& s, const GUIGlObjectType GLTypeParent) const; + + /// @brief gererate a new ID for an element child + virtual std::string generateChildID(SumoXMLTag childTag) = 0; + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief Returns position of hierarchical element in view + virtual Position getPositionInView() const = 0; + /// @} + + /// @name members and functions related to child edges + /// @{ + /// @brief add child edge + void addChildEdge(GNEEdge* edge); + + /// @brief remove child edge + void removeChildEdge(GNEEdge* edge); + + /// @brief get child edges + const std::vector& getChildEdges() const; + + /// @} + + /// @name members and functions related to child lanes + /// @{ + /// @brief add child lane + void addChildLane(GNELane* lane); + + /// @brief remove child lane + void removeChildLane(GNELane* lane); + + /// @brief get child lanes + const std::vector& getChildLanes() const; + + /// @} + + /// @name members and functions related to child shapes + /// @{ + /// @brief add child shape + void addChildShape(GNEShape* shape); + + /// @brief remove child shape + void removeChildShape(GNEShape* shape); + + /// @brief get child shapes + const std::vector& getChildShapes() const; + + /// @} + + /// @name members and functions related to child additionals + /// @{ + /// @brief add child additional + void addChildAdditional(GNEAdditional* additional); + + /// @brief remove child additional + void removeChildAdditional(GNEAdditional* additional); + + /// @brief return child additionals + const std::vector& getChildAdditionals() const; + + /// @brief get number of child additionals + size_t getNumberOfChildAdditionals(GNETagProperties::TagType additionalType) const; + + /// @brief sort child additionals (used by Rerouters, VSS, TAZs...) + void sortChildAdditionals(); + + /// @brief check if children are overlapped (Used by Rerouters) + bool checkChildAdditionalsOverlapping() const; + + /// @} + + /// @name members and functions related to child demand elements + /// @{ + /// @brief add child demand element + void addChildDemandElement(GNEDemandElement* demandElement); + + /// @brief remove child demand element + void removeChildDemandElement(GNEDemandElement* demandElement); + + /// @brief return child demand elements + const std::vector& getChildDemandElements() const; + + /// @brief return child demand elements by type + const std::vector& getChildDemandElementsByType(SumoXMLTag tag) const; + + /// @brief sort child demand elements + void sortChildDemandElements(); + + /// @brief check if childs demand elements are overlapped + bool checkChildDemandElementsOverlapping() const; + + /// @brief get previous child demand element to the given demand element + GNEDemandElement* getPreviousChildDemandElement(const GNEDemandElement* demandElement) const; + + /// @brief get next child demand element to the given demand element + GNEDemandElement* getNextChildDemandElement(const GNEDemandElement* demandElement) const; + + /// @} + + /// @name members and functions related to child generic data elements + /// @{ + /// @brief add child generic data element + void addChildGenericDataElement(GNEGenericData* genericDataElement); + + /// @brief remove child generic data element + void removeChildGenericDataElement(GNEGenericData* genericDataElement); + + /// @brief return child generic data elements + const std::vector& getChildGenericDataElements() const; + + /// @} + + /// @brief update parent after add or remove a child (can be reimplemented, for example used for statistics) + virtual void updateParentAdditional(); + + /// @brief update parent after add or remove a child (can be reimplemented, for example used for statistics) + virtual void updateParentDemandElement(); + +protected: + + /// @brief struct for pack all variables and functions relative to connections between hierarchical element and their children + struct ChildConnections { + + private: + /// @brief connection geometry + struct ConnectionGeometry { + /// @brief default constructor + ConnectionGeometry(); + + /// @brief parameter constructor + ConnectionGeometry(GNELane* _lane, Position _pos, double _rot); + + /// @brief lane + GNELane* lane; + + /// @brief position + Position pos; + + /// @brief rotation + double rot; + }; + + public: + /// @brief constructor + ChildConnections(GNEHierarchicalChildElements* hierarchicalElement); + + /// @brief update Connection's geometry + void update(); + + /// @brief draw connections between Parent and childrens + void draw(const GUIVisualizationSettings& s, const GUIGlObjectType parentType) const; + + /// @brief position and rotation of every symbol over lane + std::vector symbolsPositionAndRotation; + + /// @brief Matrix with the Vertex's positions of connections between parents an their children + std::vector connectionPositions; + + private: + /// @brief pointer to hierarchical element parent + GNEHierarchicalChildElements* myHierarchicalElement; + }; + + /// @brief change child edges of an additional + void changeChildEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs); + + /// @brief change child edges of an additional + void changeChildLanes(GNEAdditional* elementChild, const std::string& newEdgeIDs); + + /// @brief variable ChildConnections + ChildConnections myChildConnections; + +private: + /// @brief vector with the child edges of this element + std::vector myChildEdges; + + /// @brief vector with the child lanes of this element + std::vector myChildLanes; + + /// @brief vector with the child lanes of this element + std::vector myChildShapes; + + /// @brief vector with the child additional + std::vector myChildAdditionals; + + /// @brief vector with the demand elements children + std::vector myChildDemandElements; + + /// @brief vector with the generic data elements children + std::vector myChildGenericDataElements; + + /// @brief vector with the demand elements children sorted by type and filtered (to avoid duplicated + std::map> myDemandElementsByType; + + /// @brief pointer to AC (needed to avoid diamond problem) + const GNEAttributeCarrier* myAC; + + /// @brief Invalidated copy constructor. + GNEHierarchicalChildElements(const GNEHierarchicalChildElements&) = delete; + + /// @brief Invalidated assignment operator. + GNEHierarchicalChildElements& operator=(const GNEHierarchicalChildElements&) = delete; +}; + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.cpp sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,699 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEHierarchicalParentElements.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// A abstract class for representation of additional elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEHierarchicalParentElements.h" + +// =========================================================================== +// member method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEHierarchicalParentElements - methods +// --------------------------------------------------------------------------- + +GNEHierarchicalParentElements::GNEHierarchicalParentElements(const GNEAttributeCarrier* AC, + const std::vector& /* parentJunctions */, + const std::vector& parentEdges, + const std::vector& parentLanes, + const std::vector& parentShapes, + const std::vector& parentAdditionals, + const std::vector& parentDemandElements, + const std::vector& parentGenericDatas) : + myParentConnections(this), + myParentEdges(parentEdges), + myParentLanes(parentLanes), + myParentShapes(parentShapes), + myParentAdditionals(parentAdditionals), + myParentDemandElements(parentDemandElements), + myParentGenericDatas(parentGenericDatas), + myAC(AC) { +} + + +GNEHierarchicalParentElements::~GNEHierarchicalParentElements() {} + + +void +GNEHierarchicalParentElements::addParentAdditional(GNEAdditional* additional) { + // First check that additional wasn't already inserted + if (std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional) != myParentAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' was already inserted in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentAdditionals.push_back(additional); + } +} + + +void +GNEHierarchicalParentElements::removeParentAdditional(GNEAdditional* additional) { + // First check that additional was already inserted + auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); + if (it == myParentAdditionals.end()) { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentAdditionals.erase(it); + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentAdditionals() const { + return myParentAdditionals; +} + + +size_t +GNEHierarchicalParentElements::getNumberOfParentAdditionals(GNETagProperties::TagType additionalType) const { + size_t number = 0; + // check additional type + if (additionalType == GNETagProperties::TagType::ADDITIONALELEMENT) { + for (const auto& additional : myParentAdditionals) { + if (additional->getTagProperty().isAdditionalElement()) { + number++; + } + } + } else if (additionalType == GNETagProperties::TagType::TAZ) { + for (const auto& additional : myParentAdditionals) { + if (additional->getTagProperty().isTAZ()) { + number++; + } + } + } else { + throw ProcessError("invalid additionalType"); + } + return number; +} + + +void +GNEHierarchicalParentElements::addParentDemandElement(GNEDemandElement* demandElement) { + // First check that demandElement wasn't already inserted + if (std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement) != myParentDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' was already inserted in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentDemandElements.push_back(demandElement); + } +} + + +void +GNEHierarchicalParentElements::removeParentDemandElement(GNEDemandElement* demandElement) { + // First check that demandElement was already inserted + auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); + if (it == myParentDemandElements.end()) { + throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentDemandElements.erase(it); + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentDemandElements() const { + return myParentDemandElements; +} + + +void +GNEHierarchicalParentElements::addParentGenericData(GNEGenericData* genericData) { + // First check that GenericData wasn't already inserted + if (std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData) != myParentGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' was already inserted in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentGenericDatas.push_back(genericData); + } +} + + +void +GNEHierarchicalParentElements::removeParentGenericData(GNEGenericData* genericData) { + // First check that GenericData was already inserted + auto it = std::find(myParentGenericDatas.begin(), myParentGenericDatas.end(), genericData); + if (it == myParentGenericDatas.end()) { + throw ProcessError(genericData->getTagStr() + " with ID='" + genericData->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentGenericDatas.erase(it); + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentGenericDatas() const { + return myParentGenericDatas; +} + + +std::string +GNEHierarchicalParentElements::getNewListOfParents(const GNENetworkElement* currentElement, const GNENetworkElement* newNextElement) const { + std::vector solution; + if ((currentElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && (newNextElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { + // reserve solution + solution.reserve(myParentEdges.size()); + // iterate over edges + for (const auto& edge : myParentEdges) { + // add edge ID + solution.push_back(edge->getID()); + // if current edge is the current element, then insert newNextElement ID + if (edge == currentElement) { + solution.push_back(newNextElement->getID()); + } + } + } else if ((currentElement->getTagProperty().getTag() == SUMO_TAG_LANE) && (newNextElement->getTagProperty().getTag() == SUMO_TAG_LANE)) { + // reserve solution + solution.reserve(myParentLanes.size()); + // iterate over lanes + for (const auto& lane : myParentLanes) { + // add lane ID + solution.push_back(lane->getID()); + // if current lane is the current element, then insert newNextElement ID + if (lane == currentElement) { + solution.push_back(newNextElement->getID()); + } + } + } + return toString(solution); +} + + +void +GNEHierarchicalParentElements::addParentEdge(GNEEdge* edge) { + // Check that edge is valid and doesn't exist previously + if (edge == nullptr) { + throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myParentEdges.begin(), myParentEdges.end(), edge) != myParentEdges.end()) { + throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentEdges.push_back(edge); + } +} + + +void +GNEHierarchicalParentElements::removeParentEdge(GNEEdge* edge) { + // Check that edge is valid and exist previously + if (edge == nullptr) { + throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); + if (it == myParentEdges.end()) { + throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentEdges.erase(it); + } + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentEdges() const { + return myParentEdges; +} + + +std::vector +GNEHierarchicalParentElements::getMiddleParentEdges() const { + std::vector middleEdges; + // there are only middle edges if there is more than two edges + if (middleEdges.size() > 2) { + // resize middleEdges + middleEdges.resize(myParentEdges.size() - 2); + // iterate over second and previous last parent edge + for (auto i = (myParentEdges.begin() + 1); i != (myParentEdges.end() - 1); i++) { + middleEdges.push_back(*i); + } + } + return middleEdges; +} + + +const std::vector& +GNEHierarchicalParentElements::getPathEdges() const { + return myRouteEdges; +} + + +void +GNEHierarchicalParentElements::addParentLane(GNELane* lane) { + // Check that lane is valid and doesn't exist previously + if (lane == nullptr) { + throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myParentLanes.begin(), myParentLanes.end(), lane) != myParentLanes.end()) { + throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentLanes.push_back(lane); + } +} + + +void +GNEHierarchicalParentElements::removeParentLane(GNELane* lane) { + // Check that lane is valid and exist previously + if (lane == nullptr) { + throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myParentLanes.begin(), myParentLanes.end(), lane) == myParentLanes.end()) { + throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentLanes.erase(std::find(myParentLanes.begin(), myParentLanes.end(), lane)); + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentLanes() const { + return myParentLanes; +} + + +void +GNEHierarchicalParentElements::addParentShape(GNEShape* shape) { + // Check that shape is valid and doesn't exist previously + if (shape == nullptr) { + throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myParentShapes.begin(), myParentShapes.end(), shape) != myParentShapes.end()) { + throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentShapes.push_back(shape); + } +} + + +void +GNEHierarchicalParentElements::removeParentShape(GNEShape* shape) { + // Check that shape is valid and exist previously + if (shape == nullptr) { + throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else if (std::find(myParentShapes.begin(), myParentShapes.end(), shape) == myParentShapes.end()) { + throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); + } else { + myParentShapes.erase(std::find(myParentShapes.begin(), myParentShapes.end(), shape)); + } +} + + +const std::vector& +GNEHierarchicalParentElements::getParentShapes() const { + return myParentShapes; +} + +// --------------------------------------------------------------------------- +// GNEHierarchicalParentElements - protected methods +// --------------------------------------------------------------------------- + +void +GNEHierarchicalParentElements::replaceParentEdges(GNEShape* elementChild, const std::string& newEdgeIDs) { + // remove additional of parent edges + for (const auto& edge : myParentEdges) { + edge->removeChildShape(elementChild); + } + // obtain new parent edges + myParentEdges = GNEAttributeCarrier::parse >(elementChild->getNet(), newEdgeIDs); + // check that lane parets aren't empty + if (myParentEdges.empty()) { + throw InvalidArgument("New list of parent edges cannot be empty"); + } else { + // add additional into parent edges + for (const auto& edge : myParentEdges) { + edge->addChildShape(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs) { + // remove additional of parent edges + for (const auto& edge : myParentEdges) { + edge->removeChildAdditional(elementChild); + } + // obtain new parent edges + myParentEdges = GNEAttributeCarrier::parse >(elementChild->getNet(), newEdgeIDs); + // check that lane parets aren't empty + if (myParentEdges.empty()) { + throw InvalidArgument("New list of parent edges cannot be empty"); + } else { + // add additional into parent edges + for (const auto& edge : myParentEdges) { + edge->addChildAdditional(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentEdges(GNEDemandElement* elementChild, const std::string& newEdgeIDs) { + // remove demandElement of parent edges + for (const auto& edge : myParentEdges) { + edge->removeChildDemandElement(elementChild); + } + // obtain new parent edges + myParentEdges = GNEAttributeCarrier::parse >(elementChild->getNet(), newEdgeIDs); + // check that lane parets aren't empty + if (myParentEdges.empty()) { + throw InvalidArgument("New list of parent edges cannot be empty"); + } else { + // add demandElement into parent edges + for (const auto& edge : myParentEdges) { + edge->addChildDemandElement(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentEdges(GNEDemandElement* elementChild, const std::vector& newEdges) { + // remove demandElement of parent edges + for (const auto& edge : myParentEdges) { + edge->removeChildDemandElement(elementChild); + } + // set new edges + myParentEdges = newEdges; + // check that lane parets aren't empty + if (myParentEdges.empty()) { + throw InvalidArgument("New list of parent edges cannot be empty"); + } else { + // add demandElement into parent edges + for (const auto& edge : myParentEdges) { + edge->addChildDemandElement(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentEdges(GNEGenericData* elementChild, const std::vector& newEdges) { + // remove genericData of parent edges + for (const auto& edge : myParentEdges) { + edge->removeChildGenericDataElement(elementChild); + } + // set new edges + myParentEdges = newEdges; + // check that lane parets aren't empty + if (myParentEdges.empty()) { + throw InvalidArgument("New list of parent edges cannot be empty"); + } else { + // add genericData into parent edges + for (const auto& edge : myParentEdges) { + edge->addChildGenericDataElement(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceFirstParentEdge(GNEDemandElement* elementChild, GNEEdge* newFirstEdge) { + // first check that at least there is two edges + if (myParentEdges.size() < 2) { + throw InvalidArgument("Invalid minimum number of edges"); + } else { + // remove demandElement of parent edges + myParentEdges.front()->removeChildDemandElement(elementChild); + // replace first edge + myParentEdges[0] = newFirstEdge; + // add demandElement into parent edges + myParentEdges.front()->addChildDemandElement(elementChild); + } +} + + +void +GNEHierarchicalParentElements::replaceFirstParentEdge(GNEGenericData* elementChild, GNEEdge* newFirstEdge) { + // first check that at least there is two edges + if (myParentEdges.size() < 2) { + throw InvalidArgument("Invalid minimum number of edges"); + } else { + // remove generic data of parent edges + myParentEdges.front()->removeChildGenericDataElement(elementChild); + // replace first edge + myParentEdges[0] = newFirstEdge; + // add generic data into parent edges + myParentEdges.front()->addChildGenericDataElement(elementChild); + } +} + + +void +GNEHierarchicalParentElements::replaceMiddleParentEdges(GNEDemandElement* elementChild, const std::vector& newMiddleEdges, const bool updateChildReferences) { + // declare a vector for new parent edges + std::vector newEdges; + // check if add first edge + if (myParentEdges.size() > 0) { + newEdges.push_back(myParentEdges.front()); + } + // add newMiddleEdges + for (const auto& edge : newMiddleEdges) { + newEdges.push_back(edge); + } + // check if add last edge + if (myParentEdges.size() > 1) { + newEdges.push_back(myParentEdges.back()); + } + // check if we have to update references in all childs, or simply update parent edges vector + if (updateChildReferences) { + replaceParentEdges(elementChild, newEdges); + } else { + myParentEdges = newEdges; + } +} + + +void +GNEHierarchicalParentElements::replaceLastParentEdge(GNEDemandElement* elementChild, GNEEdge* newLastEdge) { + // first check that at least there is two edges + if (myParentEdges.size() < 2) { + throw InvalidArgument("Invalid minimum number of edges"); + } else { + // remove demandElement of parent edges + myParentEdges.back()->removeChildDemandElement(elementChild); + // replace last edge + myParentEdges.pop_back(); + myParentEdges.push_back(newLastEdge); + // add demandElement into parent edges + myParentEdges.back()->addChildDemandElement(elementChild); + } +} + + +void +GNEHierarchicalParentElements::replaceLastParentEdge(GNEGenericData* elementChild, GNEEdge* newLastEdge) { + // first check that at least there is two edges + if (myParentEdges.size() < 2) { + throw InvalidArgument("Invalid minimum number of edges"); + } else { + // remove generic data of parent edges + myParentEdges.back()->removeChildGenericDataElement(elementChild); + // replace last edge + myParentEdges.pop_back(); + myParentEdges.push_back(newLastEdge); + // add generic data into parent edges + myParentEdges.back()->addChildGenericDataElement(elementChild); + } +} + + +void +GNEHierarchicalParentElements::replacePathEdges(GNEDemandElement* elementChild, const std::vector& routeEdges) { + // remove demandElement of parent edges + for (const auto& edge : myRouteEdges) { + edge->removePathElement(elementChild); + } + // set new route edges + myRouteEdges = routeEdges; + // add demandElement into parent edges + for (const auto& edge : myRouteEdges) { + edge->addPathElement(elementChild); + } +} + + +void +GNEHierarchicalParentElements::replaceParentLanes(GNEAdditional* elementChild, const std::string& newLaneIDs) { + // remove additional of parent edges + for (const auto& lane : myParentLanes) { + lane->removeChildAdditional(elementChild); + } + // obtain new parent edges + myParentLanes = GNEAttributeCarrier::parse >(elementChild->getNet(), newLaneIDs); + // check that lane parets aren't empty + if (myParentLanes.empty()) { + throw InvalidArgument("New list of parent lanes cannot be empty"); + } else { + // add additional into parent edges + for (const auto& lane : myParentLanes) { + lane->addChildAdditional(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentLanes(GNEDemandElement* elementChild, const std::string& newLaneIDs) { + // remove demandElement of parent edges + for (const auto& lane : myParentLanes) { + lane->removeChildDemandElement(elementChild); + } + // obtain new parent edges + myParentLanes = GNEAttributeCarrier::parse >(elementChild->getNet(), newLaneIDs); + // check that lane parets aren't empty + if (myParentLanes.empty()) { + throw InvalidArgument("New list of parent lanes cannot be empty"); + } else { + // add demandElement into parent edges + for (const auto& lane : myParentLanes) { + lane->addChildDemandElement(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentLanes(GNEShape* elementChild, const std::string& newLaneIDs) { + // remove demandElement of parent edges + for (const auto& lane : myParentLanes) { + lane->removeChildShape(elementChild); + } + // obtain new parent edges + myParentLanes = GNEAttributeCarrier::parse >(elementChild->getNet(), newLaneIDs); + // check that lane parets aren't empty + if (myParentLanes.empty()) { + throw InvalidArgument("New list of parent lanes cannot be empty"); + } else { + // add demandElement into parent edges + for (const auto& lane : myParentLanes) { + lane->addChildShape(elementChild); + } + } +} + + +void +GNEHierarchicalParentElements::replaceParentAdditional(GNEShape* shapeTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { + if ((int)myParentAdditionals.size() < additionalParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); + } else { + // remove additional of the children of parent additional + myParentAdditionals.at(additionalParentIndex)->removeChildShape(shapeTobeChanged); + // set new parent additional + myParentAdditionals.at(additionalParentIndex) = shapeTobeChanged->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); + // add additional int the children of parent additional + myParentAdditionals.at(additionalParentIndex)->addChildShape(shapeTobeChanged); + // update geometry after inserting + shapeTobeChanged->updateGeometry(); + } +} + + +void +GNEHierarchicalParentElements::replaceParentAdditional(GNEAdditional* additionalTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { + if ((int)myParentAdditionals.size() < additionalParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); + } else { + // remove additional of the children of parent additional + myParentAdditionals.at(additionalParentIndex)->removeChildAdditional(additionalTobeChanged); + // set new parent additional + myParentAdditionals.at(additionalParentIndex) = additionalTobeChanged->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); + // add additional int the children of parent additional + myParentAdditionals.at(additionalParentIndex)->addChildAdditional(additionalTobeChanged); + // update geometry after inserting + additionalTobeChanged->updateGeometry(); + } +} + + +void +GNEHierarchicalParentElements::replaceParentAdditional(GNEDemandElement* demandElementTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { + if ((int)myParentAdditionals.size() < additionalParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); + } else { + // remove demand element of the children of parent additional + myParentAdditionals.at(additionalParentIndex)->removeChildDemandElement(demandElementTobeChanged); + // set new parent demand element + myParentAdditionals.at(additionalParentIndex) = demandElementTobeChanged->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); + // add demand element int the children of parent additional + myParentAdditionals.at(additionalParentIndex)->removeChildDemandElement(demandElementTobeChanged); + // update geometry after inserting + demandElementTobeChanged->updateGeometry(); + } +} + + +void +GNEHierarchicalParentElements::replaceParentDemandElement(GNEShape* shapeTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { + if ((int)myParentDemandElements.size() < demandElementParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); + } else { + // remove demand element of the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->removeChildShape(shapeTobeChanged); + // set new parent demand element + myParentDemandElements.at(demandElementParentIndex) = shapeTobeChanged->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); + // add demand element int the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->addChildShape(shapeTobeChanged); + // update geometry after inserting + shapeTobeChanged->updateGeometry(); + } +} + + +void +GNEHierarchicalParentElements::replaceParentDemandElement(GNEAdditional* additionalTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { + if ((int)myParentDemandElements.size() < demandElementParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); + } else { + // remove demand element of the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->removeChildAdditional(additionalTobeChanged); + // set new parent demand element + myParentDemandElements.at(demandElementParentIndex) = additionalTobeChanged->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); + // add demand element int the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->addChildAdditional(additionalTobeChanged); + // update geometry after inserting + additionalTobeChanged->updateGeometry(); + } +} + + +void +GNEHierarchicalParentElements::replaceParentDemandElement(GNEDemandElement* demandElementTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { + if ((int)myParentDemandElements.size() < demandElementParentIndex) { + throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); + } else { + // remove additional of the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->removeChildDemandElement(demandElementTobeChanged); + // set new parent additional + myParentDemandElements.at(demandElementParentIndex) = demandElementTobeChanged->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); + // add additional int the children of parent additional + myParentDemandElements.at(demandElementParentIndex)->addChildDemandElement(demandElementTobeChanged); + // update geometry after inserting + demandElementTobeChanged->updateGeometry(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.h sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.h --- sumo-1.5.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNEHierarchicalParentElements.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,293 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEHierarchicalParentElements.h +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// A abstract class for representation of Hierarchical Elements +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include + +#include "GNEAttributeCarrier.h" + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEAdditional; +class GNENetworkElement; +class GNEDemandElement; +class GNEShape; +class GNEGenericData; + +// =========================================================================== +// class definitions +// =========================================================================== + +/** + * @class GNEHierarchicalParentElements + * @brief An special type of Attribute carrier that owns hierarchical elements + */ +class GNEHierarchicalParentElements { + +public: + + /// @brief declare GNEChange_Children as friend class + friend class GNEChange_Children; + + /**@brief Constructor used by elements that have another additionals as parent + * @param[in] AC Attribute carrier + * @param[in] parentJunctions vector of parent junctions + * @param[in] parentEdges vector of parent edges + * @param[in] parentLanes vector of parent lanes + * @param[in] parentShapes vector of parent shapes + * @param[in] parentAdditionals vector of parent additionals + * @param[in] parentDemandElements vector of parent demand elements + * @param[in] parentGenericData vector of parent generic data elements + */ + GNEHierarchicalParentElements(const GNEAttributeCarrier* AC, + const std::vector& parentJunctions, + const std::vector& parentEdges, + const std::vector& parentLanes, + const std::vector& parentShapes, + const std::vector& parentAdditionals, + const std::vector& parentDemandElements, + const std::vector& parentGenericDatas); + + /// @brief Destructor + ~GNEHierarchicalParentElements(); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief Returns position of hierarchical element in view + virtual Position getPositionInView() const = 0; + /// @} + + /// @name members and functions related to parent edges + /// @{ + /// @brief add parent edge + void addParentEdge(GNEEdge* edge); + + /// @brief remove parent edge + void removeParentEdge(GNEEdge* edge); + + /// @brief get parent edges + const std::vector& getParentEdges() const; + + /// @brief get middle (via) parent edges + std::vector getMiddleParentEdges() const; + + /// @brief get path edges + const std::vector& getPathEdges() const; + + /// @} + + /// @name members and functions related to parent lanes + /// @{ + /// @brief add parent lane + void addParentLane(GNELane* lane); + + /// @brief remove parent lane + void removeParentLane(GNELane* lane); + + /// @brief get parent lanes + const std::vector& getParentLanes() const; + + /// @} + + /// @name members and functions related to parent shapes + /// @{ + /// @brief add parent shape + void addParentShape(GNEShape* shape); + + /// @brief remove parent shape + void removeParentShape(GNEShape* shape); + + /// @brief get parent shapes + const std::vector& getParentShapes() const; + + /// @} + + /// @name members and functions related to parent additionals + /// @{ + /// @brief add parent additional + void addParentAdditional(GNEAdditional* additional); + + /// @brief remove parent additional + void removeParentAdditional(GNEAdditional* additional); + + /// @brief get parent additionals + const std::vector& getParentAdditionals() const; + + /// @brief get number of parent additionals + size_t getNumberOfParentAdditionals(GNETagProperties::TagType additionalType) const; + + /// @} + + /// @name members and functions related to parent demand elements + /// @{ + /// @brief add parent demand element + void addParentDemandElement(GNEDemandElement* demandElement); + + /// @brief remove parent demand element + void removeParentDemandElement(GNEDemandElement* demandElement); + + /// @brief get parent demand elements + const std::vector& getParentDemandElements() const; + + /// @} + + /// @name members and functions related to parent generic data elements + /// @{ + /// @brief add parent demand element + void addParentGenericData(GNEGenericData* genericData); + + /// @brief remove parent demand element + void removeParentGenericData(GNEGenericData* genericData); + + /// @brief get parent demand elements + const std::vector& getParentGenericDatas() const; + + /// @} + + /// @brief if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after insert a new element + std::string getNewListOfParents(const GNENetworkElement* currentElement, const GNENetworkElement* newNextElement) const; + +protected: + /// @name members and functions relative to changing parents + /// @{ + + /// @brief replace the parent edges of a shape + void replaceParentEdges(GNEShape* elementChild, const std::string& newEdgeIDs); + + /// @brief replace the parent edges of an additional + void replaceParentEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs); + + /// @brief replace the parent edges of a demandElement + void replaceParentEdges(GNEDemandElement* elementChild, const std::string& newEdgeIDs); + + /// @brief replace the parent edges of a demandElement (GNEEdge version) + void replaceParentEdges(GNEDemandElement* elementChild, const std::vector& newEdges); + + /// @brief replace the parent edges of a generic data (GNEEdge version) + void replaceParentEdges(GNEGenericData* elementChild, const std::vector& newEdges); + + /// @brief replace the first parent edge (used by demand elements) + void replaceFirstParentEdge(GNEDemandElement* elementChild, GNEEdge* newFirstEdge); + + /// @brief replace the first parent edge (used by generic data elements) + void replaceFirstParentEdge(GNEGenericData* elementChild, GNEEdge* newFirstEdge); + + /// @brief replace middle (via) parent edges + void replaceMiddleParentEdges(GNEDemandElement* elementChild, const std::vector& newMiddleEdges, const bool updateChildReferences); + + /// @brief replace the last parent edge (used by demand elements) + void replaceLastParentEdge(GNEDemandElement* elementChild, GNEEdge* newLastEdge); + + /// @brief replace the last parent edge (used by generic data elements) + void replaceLastParentEdge(GNEGenericData* elementChild, GNEEdge* newLastEdge); + + /// @brief replace edge route Parents + void replacePathEdges(GNEDemandElement* elementChild, const std::vector& routeEdges); + + /// @brief replace the parent edges of a shape + void replaceParentLanes(GNEShape* elementChild, const std::string& newLaneIDs); + + /// @brief replace the parent edges of an additional + void replaceParentLanes(GNEAdditional* elementChild, const std::string& newLaneIDs); + + /// @brief replace the parent edges of a demandElement + void replaceParentLanes(GNEDemandElement* elementChild, const std::string& newLaneIDs); + + /**@brief replace the parent additional of a shape + * @throw exception if this shape doesn't have previously a defined Additional parent + * @throw exception if shape with ID newParentAdditionalID doesn't exist + */ + void replaceParentAdditional(GNEShape* shapeTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); + + /**@brief replace the parent additional of an additional + * @throw exception if this additional doesn't have previously a defined Additional parent + * @throw exception if additional with ID newParentAdditionalID doesn't exist + */ + void replaceParentAdditional(GNEAdditional* additionalTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); + + /**@brief replace the parent additional of a demand element + * @throw exception if this additional doesn't have previously a defined Additional parent + * @throw exception if additional with ID newParentAdditionalID doesn't exist + */ + void replaceParentAdditional(GNEDemandElement* demandElementTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); + + /**@brief replace the parent demand element of a shape + * @throw exception if this demand element doesn't have previously a defined DemandElement parent + * @throw exception if demand element with ID newParentDemandElementID doesn't exist + */ + void replaceParentDemandElement(GNEShape* shapeTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); + + /**@brief replace the parent demand element of an additional + * @throw exception if this demand element doesn't have previously a defined DemandElement parent + * @throw exception if demand element with ID newParentDemandElementID doesn't exist + */ + void replaceParentDemandElement(GNEAdditional* additionalTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); + + /**@brief change first parent demand element of demandElement + * @throw exception if this demand element doesn't have previously a defined DemandElement parent + * @throw exception if demand element with ID newParentDemandElementID doesn't exist + */ + void replaceParentDemandElement(GNEDemandElement* demandElementTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); + + /// @} + + /// @brief variable ParentConnections + GNEGeometry::ParentConnections myParentConnections; + +private: + /// @brief vector of parent edges of this element + std::vector myParentEdges; + + /// @brief vector of edges used in Flow/Trips/PersonTrips + std::vector myRouteEdges; + + /// @brief vector of parent lanes of this element + std::vector myParentLanes; + + /// @brief vector of parent shapes of this element + std::vector myParentShapes; + + /// @brief vector of parent additionals of this element + std::vector myParentAdditionals; + + /// @brief vector of demand elements parents of this element + std::vector myParentDemandElements; + + /// @brief vector of generic datas parents of this element + std::vector myParentGenericDatas; + + /// @brief pointer to AC (needed to avoid diamond problem) + const GNEAttributeCarrier* myAC; + + /// @brief Invalidated copy constructor. + GNEHierarchicalParentElements(const GNEHierarchicalParentElements&) = delete; + + /// @brief Invalidated assignment operator. + GNEHierarchicalParentElements& operator=(const GNEHierarchicalParentElements&) = delete; +}; + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNETagProperties.cpp sumo-1.6.0+dfsg1/src/netedit/elements/GNETagProperties.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/GNETagProperties.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNETagProperties.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,476 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETagProperties.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Abstract Base class for tag properties used in GNEAttributeCarrier +/****************************************************************************/ + + +// =========================================================================== +// included modules +// =========================================================================== + +#include "GNETagProperties.h" + + +// =========================================================================== +// static members +// =========================================================================== + +const size_t GNETagProperties::MAXNUMBEROFATTRIBUTES = 128; + +// =========================================================================== +// method definitions +// =========================================================================== + +GNETagProperties::GNETagProperties() : + myTag(SUMO_TAG_NOTHING), + myTagType(0), + myTagProperty(0), + myIcon(GUIIcon::EMPTY), + myParentTag(SUMO_TAG_NOTHING), + myTagSynonym(SUMO_TAG_NOTHING) { +} + + +GNETagProperties::GNETagProperties(SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, SumoXMLTag parentTag, SumoXMLTag tagSynonym) : + myTag(tag), + myTagStr(toString(tag)), + myTagType(tagType), + myTagProperty(tagProperty), + myIcon(icon), + myParentTag(parentTag), + myTagSynonym(tagSynonym) { +} + + +GNETagProperties::~GNETagProperties() {} + + +SumoXMLTag +GNETagProperties::getTag() const { + return myTag; +} + + +const std::string& +GNETagProperties::getTagStr() const { + return myTagStr; +} + + +void +GNETagProperties::checkTagIntegrity() const { + // check that element must ist at least networkElement, Additional, or shape + if (!isNetworkElement() && !isAdditionalElement() && !isShape() && !isTAZ() && !isDemandElement() && !isDataElement()) { + throw ProcessError("element must be at leas networkElement, additional, TAZ, shape, demandElement or dataElement"); + } + // check that element only is networkElement, Additional, or shape at the same time + if ((isNetworkElement() + isAdditionalElement() + isShape() + isTAZ() + isDemandElement() + isDataElement()) > 1) { + throw ProcessError("element can be only a networkElement, additional, TAZ, shape, demandElement or dataElement at the same time"); + } + // if element can mask the start and end position, check that bot attributes exist + if (canMaskStartEndPos() && (!hasAttribute(SUMO_ATTR_STARTPOS) || !hasAttribute(SUMO_ATTR_ENDPOS))) { + throw ProcessError("If attribute mask the start and end position, bot attribute has to be defined"); + } + // check that synonym tag isn't nothing + if (hasTagSynonym() && (myTagSynonym == SUMO_TAG_NOTHING)) { + throw FormatException("Synonym tag cannot be nothing"); + } + // check that synonym was defined + if (!hasTagSynonym() && (myTagSynonym != SUMO_TAG_NOTHING)) { + throw FormatException("Tag doesn't support synonyms"); + } + // check integrity of all attributes + for (auto i : myAttributeProperties) { + i.checkAttributeIntegrity(); + // check that if attribute is vehicle classes, own a combination of Allow/disallow attibute + if (i.isVClasses()) { + if ((i.getAttr() != SUMO_ATTR_ALLOW) && (i.getAttr() != SUMO_ATTR_DISALLOW)) { + throw ProcessError("Attributes aren't combinables"); + } else if ((i.getAttr() == SUMO_ATTR_ALLOW) && !hasAttribute(SUMO_ATTR_DISALLOW)) { + throw ProcessError("allow need a disallow attribute in the same tag"); + } else if ((i.getAttr() == SUMO_ATTR_DISALLOW) && !hasAttribute(SUMO_ATTR_ALLOW)) { + throw ProcessError("disallow need an allow attribute in the same tag"); + } + } + } +} + + +const std::string& +GNETagProperties::getDefaultValue(SumoXMLAttr attr) const { + // iterate over attribute properties + for (const auto& i : myAttributeProperties) { + if (i.getAttr() == attr) { + if (!i.hasStaticDefaultValue()) { + throw ProcessError("attribute '" + i.getAttrStr() + "' doesn't have a default value"); + } else { + return i.getDefaultValue(); + } + } + } + throw ProcessError("Attribute '" + toString(attr) + "' not defined"); +} + + +void +GNETagProperties::addAttribute(const GNEAttributeProperties& attributeProperty) { + if (isAttributeDeprecated(attributeProperty.getAttr())) { + throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' is deprecated and cannot be inserted"); + } else if ((myAttributeProperties.size() + 1) >= MAXNUMBEROFATTRIBUTES) { + throw ProcessError("Maximum number of attributes for tag " + attributeProperty.getAttrStr() + " exceeded"); + } else { + // Check that attribute wasn't already inserted + for (auto i : myAttributeProperties) { + if (i.getAttr() == attributeProperty.getAttr()) { + throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' already inserted"); + } + } + // insert AttributeProperties in vector + myAttributeProperties.push_back(attributeProperty); + myAttributeProperties.back().setTagPropertyParent(this); + } +} + + +void +GNETagProperties::addDeprecatedAttribute(SumoXMLAttr attr) { + // Check that attribute wasn't already inserted + for (auto i : myAttributeProperties) { + if (i.getAttr() == attr) { + throw ProcessError("Attribute '" + toString(attr) + "' is deprecated but was inserted in list of attributes"); + } + } + // add it into myDeprecatedAttributes + myDeprecatedAttributes.push_back(attr); +} + + +const GNEAttributeProperties& +GNETagProperties::getAttributeProperties(SumoXMLAttr attr) const { + // iterate over attribute properties + for (const auto& i : myAttributeProperties) { + if ((i.getAttr() == attr) || (i.hasAttrSynonym() && (i.getAttrSynonym() == attr))) { + return i; + } + } + // throw error if these attribute doesn't exist + throw ProcessError("Attribute '" + toString(attr) + "' doesn't exist"); +} + + +std::vector::const_iterator +GNETagProperties::begin() const { + return myAttributeProperties.begin(); +} + + +std::vector::const_iterator +GNETagProperties::end() const { + return myAttributeProperties.end(); +} + + +int +GNETagProperties::getNumberOfAttributes() const { + return (int)myAttributeProperties.size(); +} + + +GUIIcon +GNETagProperties::getGUIIcon() const { + return myIcon; +} + + +SumoXMLTag +GNETagProperties::getParentTag() const { + if (hasParent()) { + return myParentTag; + } else { + throw ProcessError("Tag doesn't have parent"); + } +} + + +SumoXMLTag +GNETagProperties::getTagSynonym() const { + if (hasTagSynonym()) { + return myTagSynonym; + } else { + throw ProcessError("Tag doesn't have synonym"); + } +} + + +bool +GNETagProperties::hasAttribute(SumoXMLAttr attr) const { + // iterate over attribute properties + for (const auto& i : myAttributeProperties) { + if (i.getAttr() == attr) { + return true; + } + } + return false; +} + + +bool +GNETagProperties::isNetworkElement() const { + return (myTagType & NETWORKELEMENT) != 0; +} + + +bool +GNETagProperties::isAdditionalElement() const { + return (myTagType & ADDITIONALELEMENT) != 0; +} + +bool +GNETagProperties::isShape() const { + return (myTagType & SHAPE) != 0; +} + + +bool +GNETagProperties::isTAZ() const { + return (myTagType & TAZ) != 0; +} + + +bool +GNETagProperties::isDemandElement() const { + return (myTagType & DEMANDELEMENT) != 0; +} + + +bool +GNETagProperties::isDataElement() const { + return (myTagType & DATAELEMENT) != 0; +} + + +bool +GNETagProperties::isStoppingPlace() const { + return (myTagType & STOPPINGPLACE) != 0; +} + + +bool +GNETagProperties::isDetector() const { + return (myTagType & DETECTOR) != 0; +} + + +bool +GNETagProperties::isVehicleType() const { + return (myTagType & VTYPE) != 0; +} + + +bool +GNETagProperties::isVehicle() const { + return (myTagType & VEHICLE) != 0; +} + +bool +GNETagProperties::isRoute() const { + return (myTagType & ROUTE) != 0; +} + + +bool +GNETagProperties::isStop() const { + return (myTagType & STOP) != 0; +} + + +bool +GNETagProperties::isPerson() const { + return (myTagType & PERSON) != 0; +} + + +bool +GNETagProperties::isPersonPlan() const { + return (myTagType & PERSONPLAN) != 0; +} + + +bool +GNETagProperties::isPersonTrip() const { + return (myTagType & PERSONTRIP) != 0; +} + + +bool +GNETagProperties::isWalk() const { + return (myTagType & WALK) != 0; +} + + +bool +GNETagProperties::isRide() const { + return (myTagType & RIDE) != 0; +} + + +bool +GNETagProperties::isPersonStop() const { + return (myTagType & PERSONSTOP) != 0; +} + + +bool +GNETagProperties::isGenericData() const { + return (myTagType & GENERICDATA) != 0; +} + + +bool +GNETagProperties::isDrawable() const { + return (myTagProperty & DRAWABLE) != 0; +} + + +bool +GNETagProperties::isSelectable() const { + return (myTagProperty & SELECTABLE) != 0; +} + + +bool +GNETagProperties::canBlockMovement() const { + return (myTagProperty & BLOCKMOVEMENT) != 0; +} + + +bool +GNETagProperties::canBlockShape() const { + return (myTagProperty & BLOCKSHAPE) != 0; +} + + +bool +GNETagProperties::canCloseShape() const { + return (myTagProperty & CLOSESHAPE) != 0; +} + + +bool +GNETagProperties::hasGEOPosition() const { + return (myTagProperty & GEOPOSITION) != 0; +} + + +bool +GNETagProperties::hasGEOShape() const { + return (myTagProperty & GEOSHAPE) != 0; +} + + +bool +GNETagProperties::hasParent() const { + return (myTagProperty & PARENT) != 0; +} + + +bool +GNETagProperties::hasTagSynonym() const { + return (myTagProperty & SYNONYM) != 0; +} + + +bool +GNETagProperties::hasDialog() const { + return (myTagProperty & DIALOG) != 0; +} + + +bool +GNETagProperties::hasMinimumNumberOfChildren() const { + return (myTagProperty & MINIMUMCHILDREN) != 0; +} + + +bool +GNETagProperties::hasParameters() const { + // note: By default all Tags supports parameters, except Tags with "NOPARAMETERS" + return (myTagProperty & NOPARAMETERS) == 0; +} + + +bool +GNETagProperties::hasDoubleParameters() const { + return (myTagProperty & PARAMETERSDOUBLE) != 0; +} + + +bool +GNETagProperties::isPlacedInRTree() const { + return (myTagProperty & RTREE) != 0; +} + + +bool +GNETagProperties::canBeSortedManually() const { + return (myTagProperty & SORTINGCHILDREN) != 0; +} + + +bool +GNETagProperties::canBeReparent() const { + return (myTagProperty & REPARENT) != 0; +} + + +bool +GNETagProperties::canAutomaticSortChildren() const { + return (myTagProperty & AUTOMATICSORTING) != 0; +} + + +bool +GNETagProperties::canWriteChildrenSeparate() const { + return (myTagProperty & WRITECHILDRENSEPARATE) != 0; +} + + +bool +GNETagProperties::canMaskStartEndPos() const { + return (myTagProperty & MASKSTARTENDPOS) != 0; +} + + +bool +GNETagProperties::canMaskXYZPositions() const { + return (myTagProperty & MASKXYZPOSITION) != 0; +} + + +bool +GNETagProperties::canCenterCameraAfterCreation() const { + return (myTagProperty & CENTERAFTERCREATION) != 0; +} + + +bool +GNETagProperties::isAttributeDeprecated(SumoXMLAttr attr) const { + return (std::find(myDeprecatedAttributes.begin(), myDeprecatedAttributes.end(), attr) != myDeprecatedAttributes.end()); +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/GNETagProperties.h sumo-1.6.0+dfsg1/src/netedit/elements/GNETagProperties.h --- sumo-1.5.0+dfsg1/src/netedit/elements/GNETagProperties.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/GNETagProperties.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,297 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETagProperties.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// Abstract Base class for tag properties used in GNEAttributeCarrier +/****************************************************************************/ +#pragma once + + +// =========================================================================== +// included modules +// =========================================================================== + +#include + +#include "GNEAttributeProperties.h" + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNETagProperties { + +public: + + enum TagType { + // basic types + NETWORKELEMENT = 1 << 0, // Network elements (Edges, Junctions, Lanes...) + ADDITIONALELEMENT = 1 << 1, // Additional elements (Bus Stops, Charging Stations, Detectors...) + TAZ = 1 << 2, // Traffic Assignment Zones + SHAPE = 1 << 3, // Shapes (Polygons and POIs) + DEMANDELEMENT = 1 << 4, // Demand elements (Routes, Vehicles, Trips...) + DATAELEMENT = 1 << 5, // Data elements (DataSets, Data Intervals, EdgeData...) + // sub additional elements + 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) + ROUTE = 1 << 10, // Routes and embedded routes + STOP = 1 << 11, // Stops + PERSON = 1 << 12, // Persons (Persons and personFlows) + PERSONPLAN = 1 << 13, // Person plans (Walks, rides, personTrips and personStops) + PERSONTRIP = 1 << 14, // Person Trips + WALK = 1 << 15, // Walks + RIDE = 1 << 16, // Rides + PERSONSTOP = 1 << 17, // Person stops + // sub data elements + GENERICDATA = 1 << 18, // Generic data (GNEEdgeData, GNELaneData...) + }; + + enum TagProperty { + DRAWABLE = 1 << 0, // Element can be drawed in view + BLOCKMOVEMENT = 1 << 1, // Element can block their movement + BLOCKSHAPE = 1 << 2, // Element can block their shape + CLOSESHAPE = 1 << 3, // Element can close their shape + GEOPOSITION = 1 << 4, // Element's position can be defined using a GEO position + GEOSHAPE = 1 << 5, // Element's shape acn be defined using a GEO Shape + DIALOG = 1 << 6, // Element can be edited using a dialog (GNECalibratorDialog, GNERerouterDialog...) + PARENT = 1 << 7, // Element will be writed in XML as child of another element (E3Entry -> E3Detector...) + MINIMUMCHILDREN = 1 << 8, // Element will be only writed in XML if has a minimum number of children + REPARENT = 1 << 9, // Element can be reparent + SYNONYM = 1 << 10, // Element will be written with a different name in der XML + AUTOMATICSORTING = 1 << 11, // Element sort automatic their Children (used by Additionals) + SELECTABLE = 1 << 12, // Element is selectable + MASKSTARTENDPOS = 1 << 13, // Element mask attributes StartPos and EndPos as "length" (Only used in the appropiate GNEFrame) + MASKXYZPOSITION = 1 << 14, // Element mask attributes X, Y and Z as "Position" + WRITECHILDRENSEPARATE = 1 << 15, // Element writes their children in a separated filename + NOPARAMETERS = 1 << 16, // Element doesn't accept parameters "key1=value1|key2=value2|...|keyN=valueN" (by default all tags supports parameters) + PARAMETERSDOUBLE = 1 << 17, // Element only accept double parameters "key1=double1|key2=double1|...|keyN=doubleN" + RTREE = 1 << 18, // Element is placed in RTREE + SORTINGCHILDREN = 1 << 19, // Element can be sorted in their parent element manually (in ACHierarchy) + CENTERAFTERCREATION = 1 << 20, // Camera is moved after element creation + }; + + /// @brief default constructor + GNETagProperties(); + + /// @brief parameter constructor + GNETagProperties(SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, SumoXMLTag parentTag = SUMO_TAG_NOTHING, SumoXMLTag tagSynonym = SUMO_TAG_NOTHING); + + /// @brief destructor + ~GNETagProperties(); + + /// @brief get Tag vinculated with this attribute Property + SumoXMLTag getTag() const; + + /// @brief get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toString(...) + const std::string& getTagStr() const; + + /// @brief check Tag integrity (this include all their attributes) + void checkTagIntegrity() const; + + /// @brief add attribute (duplicated attributed aren't allowed) + void addAttribute(const GNEAttributeProperties& attributeProperty); + + /// @brief add deprecated Attribute + void addDeprecatedAttribute(SumoXMLAttr attr); + + /// @brief get attribute (throw error if doesn't exist) + const GNEAttributeProperties& getAttributeProperties(SumoXMLAttr attr) const; + + /// @brief get begin of attribute values (used for iterate) + std::vector::const_iterator begin() const; + + /// @brief get end of attribute values (used for iterate) + std::vector::const_iterator end() const; + + /// @brief get number of attributes + int getNumberOfAttributes() const; + + /// @brief return the default value of the attribute of an element + const std::string& getDefaultValue(SumoXMLAttr attr) const; + + /// @brief get GUI icon associated to this Tag + GUIIcon getGUIIcon() const; + + /// @brief if Tag owns a parent, return parent tag + SumoXMLTag getParentTag() const; + + /// @brief get tag synonym + SumoXMLTag getTagSynonym() const; + + /// @brief check if current TagProperties owns the attribute "attr" + bool hasAttribute(SumoXMLAttr attr) const; + + /// @brief return true if tag correspond to a network element + bool isNetworkElement() const; + + /// @brief return true if tag correspond to an additional element + bool isAdditionalElement() const; + + /// @brief return true if tag correspond to a shape + bool isShape() const; + + /// @brief return true if tag correspond to a TAZ + bool isTAZ() const; + + /// @brief return true if tag correspond to a demand element + bool isDemandElement() const; + + /// @brief return true if tag correspond to a data element + bool isDataElement() const; + + /// @brief return true if tag correspond to a detector (Only used to group all stoppingPlaces in the output XML) + bool isStoppingPlace() const; + + /// @brief return true if tag correspond to a shape (Only used to group all detectors in the XML) + bool isDetector() const; + + /// @brief return true if tag correspond to a vehicle type element + bool isVehicleType() const; + + /// @brief return true if tag correspond to a vehicle element + bool isVehicle() const; + + /// @brief return true if tag correspond to a route element + bool isRoute() const; + + /// @brief return true if tag correspond to a stop element + bool isStop() const; + + /// @brief return true if tag correspond to a person element + bool isPerson() const; + + /// @brief return true if tag correspond to a person plan + bool isPersonPlan() const; + + /// @brief return true if tag correspond to a person trip + bool isPersonTrip() const; + + /// @brief return true if tag correspond to a walk element + bool isWalk() const; + + /// @brief return true if tag correspond to a ride element + bool isRide() const; + + /// @brief return true if tag correspond to a person stop element + bool isPersonStop() const; + + /// @brief return true if tag correspond to a generic data element + bool isGenericData() 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; + + /// @brief return true if tag correspond to an element that can block their movement + bool canBlockMovement() const; + + /// @brief return true if tag correspond to an element that can block their shape + bool canBlockShape() const; + + /// @brief return true if tag correspond to an element that can close their shape + bool canCloseShape() const; + + /// @brief return true if tag correspond to an element that can use a geo position + bool hasGEOPosition() const; + + /// @brief return true if tag correspond to an element that can use a geo shape + bool hasGEOShape() const; + + /// @brief return true if tag correspond to an element that can had another element as parent + bool hasParent() const; + + /// @brief return true if tag correspond to an element that will be written in XML with another tag + bool hasTagSynonym() const; + + /// @brief return true if tag correspond to an element that can be edited using a dialog + bool hasDialog() const; + + /// @brief return true if tag correspond to an element that only have a limited number of children + bool hasMinimumNumberOfChildren() const; + + /// @brief return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|...|keyN=valueN" + bool hasParameters() const; + + /// @brief return true if Tag correspond to an element that supports double parameters "key1=double1|key2=double2|...|keyN=doubleN" + bool hasDoubleParameters() const; + + /// @brief return true if Tag correspond to an element that has has to be placed in RTREE + bool isPlacedInRTree() const; + + /// @brief return true if Tag correspond to an element that can be sorted within their parent + bool canBeSortedManually() const; + + /// @brief return true if tag correspond to an element that can be reparent + bool canBeReparent() const; + + /// @brief return true if tag correspond to an element that can sort their children automatic + bool canAutomaticSortChildren() const; + + /// @brief return true if tag correspond to an element that can sort their children automatic + bool canWriteChildrenSeparate() const; + + /// @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 attribute of this tag is deprecated + bool isAttributeDeprecated(SumoXMLAttr attr) const; + +private: + /// @brief Sumo XML Tag vinculated wit this tag Property + SumoXMLTag myTag; + + /// @brief Sumo XML Tag vinculated wit this tag Property in String format + std::string myTagStr; + + /// @brief Attribute Type + int myTagType; + + /// @brief Attribute properties + int myTagProperty; + + /// @brief vector with the attribute values vinculated with this Tag + std::vector myAttributeProperties; + + /// @brief icon associated to this Tag + GUIIcon myIcon; + + /// @brief parent tag + SumoXMLTag myParentTag; + + /// @brief Tag written in XML (If is SUMO_TAG_NOTHING), original Tag name will be written) + SumoXMLTag myTagSynonym; + + /// @brief List with the deprecated Attributes + std::vector myDeprecatedAttributes; + + /// @brief max number of attributes allowed for every tag + static const size_t MAXNUMBEROFATTRIBUTES; +}; + +/****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/elements/network/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/elements/network/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,21 @@ +set(netedit_elements_network_SRCS + GNENetworkElement.h + GNENetworkElement.cpp + GNEEdge.h + GNEEdge.cpp + GNELane.h + GNELane.cpp + GNEInternalLane.h + GNEInternalLane.cpp + GNEConnection.h + GNEConnection.cpp + GNECrossing.h + GNECrossing.cpp + GNEJunction.h + GNEJunction.cpp + GNEProhibition.h + GNEProhibition.cpp + ) + +add_library(netedit_elements_network STATIC ${netedit_elements_network_SRCS}) +set_property(TARGET netedit_elements_network PROPERTY PROJECT_LABEL "z_netedit_elements_network") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEConnection.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEConnection.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEConnection.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEConnection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,683 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEConnection.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A class for visualizing connections between lanes +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEConnection.h" +#include "GNEJunction.h" +#include "GNEEdge.h" +#include "GNELane.h" +#include "GNEInternalLane.h" + + +// =========================================================================== +// static member definitions +// =========================================================================== +int NUM_POINTS = 5; + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEConnection::GNEConnection(GNELane* from, GNELane* to) : + GNENetworkElement(from->getNet(), "from" + from->getID() + "to" + to->getID(), + GLO_CONNECTION, SUMO_TAG_CONNECTION, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myFromLane(from), +myToLane(to), +myLinkState(LINKSTATE_TL_OFF_NOSIGNAL), +mySpecialColor(nullptr), +myShapeDeprecated(true) { +} + + +GNEConnection::~GNEConnection() { +} + + +std::string +GNEConnection::generateChildID(SumoXMLTag /*childTag*/) { + // currently unused + return ""; +} + + +const PositionVector& +GNEConnection::getConnectionShape() const { + if (myConnectionGeometry.getShape().size() > 0) { + return myConnectionGeometry.getShape(); + } else { + return getNBEdgeConnection().customShape; + } +} + + +void +GNEConnection::updateGeometry() { + // Get shape of from and to lanes + NBEdge::Connection& nbCon = getNBEdgeConnection(); + if (myShapeDeprecated) { + // obtain lane shape from + PositionVector laneShapeFrom; + if ((int)getEdgeFrom()->getNBEdge()->getLanes().size() > nbCon.fromLane) { + laneShapeFrom = getEdgeFrom()->getNBEdge()->getLanes().at(nbCon.fromLane).shape; + } else { + return; + } + // obtain lane shape to + PositionVector laneShapeTo; + if ((int)nbCon.toEdge->getLanes().size() > nbCon.toLane) { + laneShapeTo = nbCon.toEdge->getLanes().at(nbCon.toLane).shape; + } else { + return; + } + // Calculate shape of connection depending of the size of Junction shape + // value obtanied from GNEJunction::drawgl + if (nbCon.customShape.size() != 0) { + myConnectionGeometry.updateGeometry(nbCon.customShape); + } else if (getEdgeFrom()->getNBEdge()->getToNode()->getShape().area() > 4) { + if (nbCon.shape.size() != 0) { + PositionVector connectionShape = nbCon.shape; + // only append via shape if it exists + if (nbCon.haveVia) { + connectionShape.append(nbCon.viaShape); + } + myConnectionGeometry.updateGeometry(connectionShape); + } else { + // Calculate shape so something can be drawn immidiately + myConnectionGeometry.updateGeometry(getEdgeFrom()->getNBEdge()->getToNode()->computeSmoothShape( + laneShapeFrom, laneShapeTo, NUM_POINTS, + getEdgeFrom()->getNBEdge()->getTurnDestination() == nbCon.toEdge, + (double) 5. * (double) getEdgeFrom()->getNBEdge()->getNumLanes(), + (double) 5. * (double) nbCon.toEdge->getNumLanes())); + } + } else { + myConnectionGeometry.updateGeometry({laneShapeFrom.positionAtOffset(MAX2(0.0, laneShapeFrom.length() - 1)), + laneShapeTo.positionAtOffset(MIN2(1.0, laneShapeFrom.length()))}); + } + // check if internal junction marker must be calculated + if (nbCon.haveVia && (nbCon.shape.size() != 0)) { + // create marker for interal junction waiting position (contPos) + const double orthoLength = 0.5; + Position pos = nbCon.shape.back(); + myInternalJunctionMarker = nbCon.shape.getOrthogonal(pos, 10, true, 0.1); + if (myInternalJunctionMarker.length() < orthoLength) { + myInternalJunctionMarker.extrapolate(orthoLength - myInternalJunctionMarker.length()); + } + } else { + myInternalJunctionMarker.clear(); + } + // mark connection as non-deprecated + myShapeDeprecated = false; + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); + } +} + + +Position +GNEConnection::getPositionInView() const { + // currently unused + return Position(0, 0); +} + + +Boundary +GNEConnection::getBoundary() const { + if (myConnectionGeometry.getShape().size() == 0) { + // we need to use the center of junction parent as boundary if shape is empty + Position junctionParentPosition = myFromLane->getParentEdge()->getGNEJunctionDestiny()->getPositionInView(); + return Boundary(junctionParentPosition.x() - 0.1, junctionParentPosition.y() - 0.1, + junctionParentPosition.x() + 0.1, junctionParentPosition.x() + 0.1); + } else { + return myConnectionGeometry.getShape().getBoxBoundary(); + } +} + + +GNEEdge* +GNEConnection::getEdgeFrom() const { + return myFromLane->getParentEdge(); +} + + +GNEEdge* +GNEConnection::getEdgeTo() const { + return myToLane->getParentEdge(); +} + + +GNELane* +GNEConnection::getLaneFrom() const { + return myFromLane; +} + + +GNELane* +GNEConnection::getLaneTo() const { + return myToLane; +} + + +int +GNEConnection::getFromLaneIndex() const { + return myFromLane->getIndex(); +} + + +int +GNEConnection::getToLaneIndex() const { + return myToLane->getIndex(); +} + + +NBEdge::Connection& +GNEConnection::getNBEdgeConnection() const { + return getEdgeFrom()->getNBEdge()->getConnectionRef(getFromLaneIndex(), getEdgeTo()->getNBEdge(), getToLaneIndex()); +} + + +NBConnection +GNEConnection::getNBConnection() const { + const NBEdge::Connection& c = getNBEdgeConnection(); + return NBConnection(getEdgeFrom()->getNBEdge(), getFromLaneIndex(), + getEdgeTo()->getNBEdge(), getToLaneIndex(), + (int)c.tlLinkIndex, (int)c.tlLinkIndex2); +} + + +void +GNEConnection::updateID() { + setMicrosimID(myFromLane->getID() + " -> " + myToLane->getID()); +} + + +LinkState +GNEConnection::getLinkState() const { + return myLinkState; +} + + +void +GNEConnection::markConnectionGeometryDeprecated() { + myShapeDeprecated = true; +} + + +void +GNEConnection::updateLinkState() { + NBEdge::Connection& nbCon = getNBEdgeConnection(); + myLinkState = getEdgeFrom()->getNBEdge()->getToNode()->getLinkState(getEdgeFrom()->getNBEdge(), + nbCon.toEdge, + nbCon.fromLane, + nbCon.toLane, + nbCon.mayDefinitelyPass, + nbCon.tlID); +} + + +GUIGLObjectPopupMenu* +GNEConnection::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // build position copy entry + buildPositionCopyEntry(ret, false); + // check if we're in supermode network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + // create menu commands + FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom connection shape", nullptr, &parent, MID_GNE_CONNECTION_EDIT_SHAPE); + // check if menu commands has to be disabled + NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; + // check if we're in the correct edit mode + if ((editMode == NetworkEditMode::NETWORK_CONNECT) || (editMode == NetworkEditMode::NETWORK_TLS) || (editMode == NetworkEditMode::NETWORK_CREATE_EDGE)) { + mcCustomShape->disable(); + } + } + return ret; +} + + +Boundary +GNEConnection::getCenteringBoundary() const { + Boundary b = getBoundary(); + b.grow(20); + return b; +} + + +void +GNEConnection::drawGL(const GUIVisualizationSettings& s) const { + // declare a flag to check if shape has to be draw + bool drawConnection = true; + if ((myNet->getViewNet()->getEditModes().isCurrentSupermodeDemand()) && + s.drawDetail(s.detailSettings.connectionsDemandMode, s.addSize.getExaggeration(s, this))) { + drawConnection = !myShapeDeprecated; + } else if ((myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) && + myNet->getViewNet()->getNetworkViewOptions().showConnections()) { + drawConnection = !myShapeDeprecated; + } else { + drawConnection = false; + } + // Check if connection must be drawed + if (drawConnection) { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getBoundary()); + } + // Push draw matrix 1 + glPushMatrix(); + // Push name + glPushName(getGlID()); + // Traslate matrix + glTranslated(0, 0, GLO_JUNCTION + 0.1); // must draw on top of junction + // Set color + if (drawUsingSelectColor()) { + // override with special colors (unless the color scheme is based on selection) + GLHelper::setColor(s.colorSettings.selectedConnectionColor); + } else if (mySpecialColor != nullptr) { + GLHelper::setColor(*mySpecialColor); + } else { + // Set color depending of the link state + GLHelper::setColor(GNEInternalLane::colorForLinksState(getLinkState())); + } + // draw connection checking whether it is not too small if isn't being drawn for selecting + const double selectionScale = isAttributeCarrierSelected() ? s.selectionScale : 1; + if ((s.scale * selectionScale < 5.) && !s.drawForRectangleSelection) { + // If it's small, draw a simple line + GLHelper::drawLine(myConnectionGeometry.getShape()); + } else { + // draw a list of lines + const bool spreadSuperposed = s.scale >= 1 && s.spreadSuperposed && myFromLane->drawAsRailway(s) && getEdgeFrom()->getNBEdge()->isBidiRail(); + PositionVector shapeSuperposed = myConnectionGeometry.getShape(); + if (spreadSuperposed) { + shapeSuperposed.move2side(0.5); + } + GLHelper::drawBoxLines(shapeSuperposed, myConnectionGeometry.getShapeRotations(), myConnectionGeometry.getShapeLengths(), 0.2 * selectionScale); + glTranslated(0, 0, 0.1); + GLHelper::setColor(GLHelper::getColor().changedBrightness(51)); + // check if internal junction marker has to be drawn + if (myInternalJunctionMarker.size() > 0) { + GLHelper::drawLine(myInternalJunctionMarker); + } + // check if dotted contour has to be drawn (not useful at high zoom) + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), 1, myDottedGeometry); + } + } + // Pop draw matrix 1 + glPopMatrix(); + + if (s.edgeValue.show) { + NBEdge::Connection& nbCon = getNBEdgeConnection(); + std::string value = nbCon.getParameter(s.edgeParam, ""); + if (value != "") { + int shapeIndex = (int)myConnectionGeometry.getShape().size() / 2; + Position p = (myConnectionGeometry.getShape().size() == 2 + ? (myConnectionGeometry.getShape().front() * 0.67 + myConnectionGeometry.getShape().back() * 0.33) + : myConnectionGeometry.getShape()[shapeIndex]); + GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, 0); + } + } + + // Pop name + glPopName(); + } +} + + +void +GNEConnection::setSpecialColor(const RGBColor* color) { + mySpecialColor = color; +} + +std::string +GNEConnection::getAttribute(SumoXMLAttr key) const { + if (key == SUMO_ATTR_ID) { + // used by GNEReferenceCounter + // @note: may be called for connections without a valid nbCon reference + return getID(); + } + NBEdge::Connection& nbCon = getNBEdgeConnection(); + switch (key) { + case SUMO_ATTR_FROM: + return getEdgeFrom()->getID(); + case SUMO_ATTR_TO: + return nbCon.toEdge->getID(); + case SUMO_ATTR_FROM_LANE: + return toString(nbCon.fromLane); + case SUMO_ATTR_TO_LANE: + return toString(nbCon.toLane); + case SUMO_ATTR_PASS: + return toString(nbCon.mayDefinitelyPass); + case SUMO_ATTR_KEEP_CLEAR: + return toString(nbCon.keepClear); + case SUMO_ATTR_CONTPOS: + return toString(nbCon.contPos); + case SUMO_ATTR_UNCONTROLLED: + return toString(nbCon.uncontrolled); + case SUMO_ATTR_VISIBILITY_DISTANCE: + return toString(nbCon.visibility); + case SUMO_ATTR_TLLINKINDEX: + return toString(nbCon.tlLinkIndex); + case SUMO_ATTR_TLLINKINDEX2: + return toString(nbCon.tlLinkIndex2); + case SUMO_ATTR_ALLOW: + if (nbCon.permissions == SVC_UNSPECIFIED) { + return getVehicleClassNames(nbCon.toEdge->getLanes()[nbCon.toLane].permissions); + } else { + return getVehicleClassNames(nbCon.permissions); + } + case SUMO_ATTR_DISALLOW: + if (nbCon.permissions == SVC_UNSPECIFIED) { + return getVehicleClassNames(invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions)); + } else { + return getVehicleClassNames(invertPermissions(nbCon.permissions)); + } + case SUMO_ATTR_SPEED: + return toString(nbCon.speed); + case SUMO_ATTR_LENGTH: + return toString(nbCon.customLength); + case SUMO_ATTR_DIR: + return toString(getEdgeFrom()->getNBEdge()->getToNode()->getDirection( + getEdgeFrom()->getNBEdge(), nbCon.toEdge, OptionsCont::getOptions().getBool("lefthand"))); + case SUMO_ATTR_STATE: + return toString(getEdgeFrom()->getNBEdge()->getToNode()->getLinkState( + getEdgeFrom()->getNBEdge(), nbCon.toEdge, nbCon.fromLane, nbCon.toLane, nbCon.mayDefinitelyPass, nbCon.tlID)); + case SUMO_ATTR_CUSTOMSHAPE: + return toString(nbCon.customShape); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return nbCon.getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + const NBEdge::Connection& c = getNBEdgeConnection(); + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_FROM_LANE: + case SUMO_ATTR_TO_LANE: + case SUMO_ATTR_PASS: + case SUMO_ATTR_KEEP_CLEAR: + case SUMO_ATTR_CONTPOS: + case SUMO_ATTR_UNCONTROLLED: + case SUMO_ATTR_VISIBILITY_DISTANCE: + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + case SUMO_ATTR_SPEED: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_CUSTOMSHAPE: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + // no special handling + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + case SUMO_ATTR_TLLINKINDEX: + if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) { + changeTLIndex(key, parse(value), c.tlLinkIndex2, undoList); + } + break; + case SUMO_ATTR_TLLINKINDEX2: + if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) { + changeTLIndex(key, c.tlLinkIndex, parse(value), undoList); + } + break; + case SUMO_ATTR_DIR: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + case SUMO_ATTR_STATE: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEConnection::changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList) { + // trigger GNEChange_TLS + undoList->p_begin("change tls linkIndex for connection"); + // make a copy + std::set defs = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS(); + for (NBTrafficLightDefinition* tlDef : defs) { + NBLoadedSUMOTLDef* sumoDef = dynamic_cast(tlDef); + NBTrafficLightLogic* tllogic = sumoDef ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions()); + if (tllogic != nullptr) { + NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*tlDef, *tllogic); + newDef->addConnection(getEdgeFrom()->getNBEdge(), getEdgeTo()->getNBEdge(), + getLaneFrom()->getIndex(), getLaneTo()->getIndex(), tlIndex, tlIndex2, false); + // iterate over NBNodes + for (NBNode* node : tlDef->getNodes()) { + GNEJunction* junction = getNet()->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(junction, tlDef, false), true); + undoList->add(new GNEChange_TLS(junction, newDef, true), true); + } + } else { + WRITE_ERROR("Could not set attribute '" + toString(key) + "' (tls is broken)"); + } + } + undoList->p_end(); +} + +bool +GNEConnection::isValid(SumoXMLAttr key, const std::string& value) { + // Currently ignored before implementation to avoid warnings + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_FROM_LANE: + case SUMO_ATTR_TO_LANE: + return false; + case SUMO_ATTR_PASS: + return canParse(value); + case SUMO_ATTR_KEEP_CLEAR: + return canParse(value); + case SUMO_ATTR_CONTPOS: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_UNCONTROLLED: + return canParse(value); + case SUMO_ATTR_VISIBILITY_DISTANCE: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && + (getNBEdgeConnection().uncontrolled == false) && + (getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) && + canParse(value) && + (parse(value) >= 0 || parse(value) == -1)) { + // obtan Traffic light definition + NBTrafficLightDefinition* def = *getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().begin(); + return def->getMaxValidIndex() >= parse(value); + } else { + return false; + } + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + return canParseVehicleClasses(value); + case SUMO_ATTR_SPEED: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_LENGTH: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_CUSTOMSHAPE: { + // empty custom shapes are allowed + return canParse(value); + } + case SUMO_ATTR_STATE: + return false; + case SUMO_ATTR_DIR: + return false; + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEConnection::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_FROM: + case SUMO_ATTR_TO: + case SUMO_ATTR_FROM_LANE: + case SUMO_ATTR_TO_LANE: + case SUMO_ATTR_DIR: + case SUMO_ATTR_STATE: + // this attributes cannot be edited + return false; + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + // get Traffic Light definitions + if (getEdgeFrom()->getNBEdge()->getToNode()->isTLControlled()) { + NBTrafficLightDefinition* tlDef = *getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().begin(); + NBLoadedSUMOTLDef* sumoDef = dynamic_cast(tlDef); + NBTrafficLightLogic* tllogic = sumoDef != nullptr ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions()); + if (tllogic != nullptr) { + return true; + } else { + return false; + } + } + return false; + default: + return true; + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value) { + NBEdge::Connection& nbCon = getNBEdgeConnection(); + switch (key) { + case SUMO_ATTR_PASS: + nbCon.mayDefinitelyPass = parse(value); + break; + case SUMO_ATTR_KEEP_CLEAR: + nbCon.keepClear = parse(value); + break; + case SUMO_ATTR_UNCONTROLLED: + nbCon.uncontrolled = parse(value); + break; + case SUMO_ATTR_CONTPOS: + nbCon.contPos = parse(value); + break; + case SUMO_ATTR_VISIBILITY_DISTANCE: + nbCon.visibility = parse(value); + break; + case SUMO_ATTR_SPEED: + nbCon.speed = parse(value); + break; + case SUMO_ATTR_LENGTH: + nbCon.customLength = parse(value); + break; + case SUMO_ATTR_ALLOW: { + const SVCPermissions successorAllows = nbCon.toEdge->getLanes()[nbCon.toLane].permissions; + SVCPermissions customPermissions = parseVehicleClasses(value); + if (successorAllows != customPermissions) { + nbCon.permissions = customPermissions; + } + break; + } + case SUMO_ATTR_DISALLOW: { + const SVCPermissions successorDisallows = invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions); + SVCPermissions customPermissions = invertPermissions(parseVehicleClasses(value)); + if (successorDisallows != customPermissions) { + nbCon.permissions = customPermissions; + } + break; + } + case SUMO_ATTR_STATE: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + case SUMO_ATTR_DIR: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + case SUMO_ATTR_CUSTOMSHAPE: { + nbCon.customShape = parse(value); + break; + } + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + nbCon.setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } + // Update Geometry after setting a new attribute (but avoided for certain attributes) + if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { + markConnectionGeometryDeprecated(); + updateGeometry(); + } +} + + +void +GNEConnection::updateDottedContour() { + // build contour using connection geometry + PositionVector contourFront = myConnectionGeometry.getShape(); + PositionVector contourback = contourFront; + // move both 0.25 to side + contourFront.move2side(0.25); + contourback.move2side(-0.25); + // reverse contourback + contourback = contourback.reverse(); + // add contour back to contourfront + for (const auto& position : contourback) { + contourFront.push_back(position); + } + // close contour front + contourFront.closePolygon(); + // set as dotted contour + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), contourFront); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEConnection.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEConnection.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEConnection.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEConnection.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,196 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEConnection.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A class for represent connections between Lanes +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" + +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEEdge; + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEConnection : public GNENetworkElement { +public: + /** Constructor + * @param[in] from The edge the vehicles leave + * @param[in] connection NBEdge::Connection in which the rest of parameters are defined + * @param[in] uncontrolled if set to true, This connection will not be TLS-controlled despite its node being controlled. + **/ + GNEConnection(GNELane* from, GNELane* to); + + /// @brief Destructor + ~GNEConnection(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name Functions related with geometry of element + /// @{ + /// @brief get connection shape + const PositionVector& getConnectionShape() const; + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of hierarchical element in view + Position getPositionInView() const; + + /// @} + + /// Returns the street's geometry + Boundary getBoundary() const; + + /// @brief get the name of the edge the vehicles leave + GNEEdge* getEdgeFrom() const; + + /// @brief get the name of the edge the vehicles may reach when leaving "from" + GNEEdge* getEdgeTo() const; + + /// @briefthe get lane of the incoming lane + GNELane* getLaneFrom() const; + + /// @briefthe get lane of the outgoing lane + GNELane* getLaneTo() const; + + /// @briefthe get lane index of the incoming lane + int getFromLaneIndex() const; + + /// @briefthe get lane index of the outgoing lane + int getToLaneIndex() const; + + /// @brief get Edge::Connection + NBEdge::Connection& getNBEdgeConnection() const; + + /// @brief get NBConnection + NBConnection getNBConnection() const; + + /// @brief get LinkState + LinkState getLinkState() const; + + /// @brief check that connection's Geometry has to be updated + void markConnectionGeometryDeprecated(); + + /// @brief update internal ID of Connection + void updateID(); + + /// @brief recompute cached myLinkState + void updateLinkState(); + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@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 Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + void drawGL(const GUIVisualizationSettings& s) const; + /// @} + + /* @brief method for setting the special color of the connection + * @param[in] color Pointer to new special color + */ + void setSpecialColor(const RGBColor* Color2); + + /// @name 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 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 checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + +protected: + /// @brief incoming lane of this connection + GNELane* myFromLane; + + /// @brief outgoing lane of this connection + GNELane* myToLane; + + /// @brief Linkstate. @note cached because after 'undo' the connection needs to be drawn while the node logic (NBRequest) has not been recomputed + LinkState myLinkState; + + /// @brief optional special color + const RGBColor* mySpecialColor; + + /// @brief connection geometry + GNEGeometry::Geometry myConnectionGeometry; + + /// @brief flag to indicate that connection's shape has to be updated + bool myShapeDeprecated; + + /// @brief waiting position for internal junction + PositionVector myInternalJunctionMarker; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief manage change of tlLinkindices + void changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList); + + /// @brief Invalidated copy constructor. + GNEConnection(const GNEConnection&) = delete; + + /// @brief Invalidated assignment operator. + GNEConnection& operator=(const GNEConnection&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNECrossing.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNECrossing.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNECrossing.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNECrossing.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,488 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECrossing.cpp +/// @author Jakob Erdmann +/// @date June 2011 +/// +// A class for visualizing Inner Lanes (used when editing traffic lights) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNECrossing.h" +#include "GNEJunction.h" +#include "GNEEdge.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +GNECrossing::GNECrossing(GNEJunction* parentJunction, std::vector crossingEdges) : + GNENetworkElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, + GLO_CROSSING, SUMO_TAG_CROSSING, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myParentJunction(parentJunction), +myCrossingEdges(crossingEdges) { +} + + +GNECrossing::~GNECrossing() {} + + +std::string +GNECrossing::generateChildID(SumoXMLTag /*childTag*/) { + // currently unused + return ""; +} + + +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"); + } +} + + +void +GNECrossing::updateGeometry() { + // rebuild crossing and walking areas form node parent + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + // obtain shape + myCrossingGeometry.updateGeometry(crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape); + /* + // only rebuild shape if junction's shape isn't in Buuble mode + if (myParentJunction->getNBNode()->getShape().size() > 0) { + myCrossingGeometry.calculateShapeRotationsAndLengths(); + } + */ + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +Position +GNECrossing::getPositionInView() const { + // currently unused + return Position(0, 0); +} + + +GNEJunction* +GNECrossing::getParentJunction() const { + return myParentJunction; +} + + +const std::vector& +GNECrossing::getCrossingEdges() const { + return myCrossingEdges; +} + + +NBNode::Crossing* +GNECrossing::getNBCrossing() const { + return myParentJunction->getNBNode()->getCrossing(myCrossingEdges); +} + + +void +GNECrossing::drawGL(const GUIVisualizationSettings& s) const { + // only draw if option drawCrossingsAndWalkingareas is enabled and size of shape is greather than 0 and zoom is close enough + if (s.drawCrossingsAndWalkingareas && + !myNet->getViewNet()->getEditModes().isCurrentSupermodeData() && + (myCrossingGeometry.getShapeRotations().size() > 0) && + (myCrossingGeometry.getShapeLengths().size() > 0) && + (s.scale > 3.0)) { + const auto NBCrossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + if (myNet->getViewNet()->getEditModes().networkEditMode != NetworkEditMode::NETWORK_TLS) { + // push draw matrix 1 + glPushMatrix(); + // push name + glPushName(getGlID()); + // must draw on top of junction + glTranslated(0, 0, GLO_CROSSING + 0.1); + // set color depending of selection and priority + if (drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedCrossingColor); + } else if (!NBCrossing->valid) { + GLHelper::setColor(s.colorSettings.crossingInvalid); + } else if (NBCrossing->priority) { + GLHelper::setColor(s.colorSettings.crossingPriority); + } else if (myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) { + GLHelper::setColor(s.laneColorer.getSchemes()[0].getColor(8)); + } else { + GLHelper::setColor(s.colorSettings.crossing); + } + // set default values + const double length = 0.5; + const double spacing = 1.0; + const double halfWidth = NBCrossing->width * 0.5; + // draw depending of selection + if (s.drawForRectangleSelection || s.drawForPositionSelection) { + // just drawn a box line + GLHelper::drawBoxLines(myCrossingGeometry.getShape(), halfWidth); + } else { + // push draw matrix 2 + glPushMatrix(); + // draw on top of of the white area between the rails + glTranslated(0, 0, 0.1); + for (int i = 0; i < (int)myCrossingGeometry.getShape().size() - 1; i++) { + // push draw matrix 3 + glPushMatrix(); + // translate and rotate + glTranslated(myCrossingGeometry.getShape()[i].x(), myCrossingGeometry.getShape()[i].y(), 0.0); + glRotated(myCrossingGeometry.getShapeRotations()[i], 0, 0, 1); + // draw crossing depending if isn't being drawn for selecting + for (double t = 0; t < myCrossingGeometry.getShapeLengths()[i]; t += spacing) { + glBegin(GL_QUADS); + glVertex2d(-halfWidth, -t); + glVertex2d(-halfWidth, -t - length); + glVertex2d(halfWidth, -t - length); + glVertex2d(halfWidth, -t); + glEnd(); + } + // pop draw matrix 3 + glPopMatrix(); + } + // pop draw matrix 2 + glPopMatrix(); + } + // pop name + glPopName(); + // pop draw matrix 1 + glPopMatrix(); + } + // link indices must be drawn in all edit modes if isn't being drawn for selecting + if (s.drawLinkTLIndex.show && !s.drawForRectangleSelection) { + drawTLSLinkNo(s); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), 1, myDottedGeometry); + } + } +} + + +void +GNECrossing::drawTLSLinkNo(const GUIVisualizationSettings& s) const { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + glPushMatrix(); + glTranslated(0, 0, GLO_CROSSING + 0.5); + PositionVector shape = crossing->shape; + shape.extrapolate(0.5); // draw on top of the walking area + int linkNo = crossing->tlLinkIndex; + int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo; + GLHelper::drawTextAtEnd(toString(linkNo2), shape, 0, s.drawLinkTLIndex, s.scale); + GLHelper::drawTextAtEnd(toString(linkNo), shape.reverse(), 0, s.drawLinkTLIndex, s.scale); + glPopMatrix(); +} + + +GUIGLObjectPopupMenu* +GNECrossing::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // build position copy entry + buildPositionCopyEntry(ret, false); + // check if we're in supermode network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + // create menu commands + FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom crossing shape", nullptr, &parent, MID_GNE_CROSSING_EDIT_SHAPE); + // check if menu commands has to be disabled + NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; + if ((editMode == NetworkEditMode::NETWORK_CONNECT) || (editMode == NetworkEditMode::NETWORK_TLS) || (editMode == NetworkEditMode::NETWORK_CREATE_EDGE)) { + mcCustomShape->disable(); + } + } + return ret; +} + + +Boundary +GNECrossing::getCenteringBoundary() const { + Boundary b; + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + if (crossing) { + if (crossing->customShape.size() > 0) { + b = crossing->customShape.getBoxBoundary(); + } else if (crossing->shape.size() > 0) { + b = crossing->shape.getBoxBoundary(); + } else { + return myParentJunction->getCenteringBoundary(); + } + b.grow(10); + return b; + } + // in other case return boundary of parent junction + return myParentJunction->getCenteringBoundary(); +} + + +std::string +GNECrossing::getAttribute(SumoXMLAttr key) const { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges, (key != SUMO_ATTR_ID)); + switch (key) { + case SUMO_ATTR_ID: + // get attribute requires a special case + if (crossing) { + return crossing->id; + } else { + return "Temporal Unreferenced"; + } + case SUMO_ATTR_WIDTH: + return toString(crossing->customWidth); + case SUMO_ATTR_PRIORITY: + return crossing->priority ? "true" : "false"; + case SUMO_ATTR_EDGES: + return toString(crossing->edges); + case SUMO_ATTR_TLLINKINDEX: + return toString(crossing->customTLIndex); + case SUMO_ATTR_TLLINKINDEX2: + return toString(crossing->customTLIndex2); + case SUMO_ATTR_CUSTOMSHAPE: + return toString(crossing->customShape); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return crossing->getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNECrossing::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: + throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); + case SUMO_ATTR_EDGES: + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_PRIORITY: + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + case SUMO_ATTR_CUSTOMSHAPE: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->add(new GNEChange_Attribute(this, key, value), true); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNECrossing::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + // id isn't editable + return false; + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + return (myParentJunction->getNBNode()->getCrossing(myCrossingEdges)->tlID != ""); + default: + return true; + } +} + + +bool +GNECrossing::isValid(SumoXMLAttr key, const std::string& value) { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + switch (key) { + case SUMO_ATTR_ID: + return false; + case SUMO_ATTR_EDGES: + if (canParse >(myNet, value, false)) { + // parse edges and save their IDs in a set + std::vector parsedEdges = parse >(myNet, value); + EdgeVector nbEdges; + for (auto i : parsedEdges) { + nbEdges.push_back(i->getNBEdge()); + } + std::sort(nbEdges.begin(), nbEdges.end()); + // + EdgeVector originalEdges = crossing->edges; + std::sort(originalEdges.begin(), originalEdges.end()); + // return true if we're setting the same edges + if (toString(nbEdges) == toString(originalEdges)) { + return true; + } else { + return !myParentJunction->getNBNode()->checkCrossingDuplicated(nbEdges); + } + } else { + return false; + } + case SUMO_ATTR_WIDTH: + return canParse(value) && ((parse(value) > 0) || (parse(value) == -1)); // kann NICHT 0 sein, oder -1 (bedeutet default) + case SUMO_ATTR_PRIORITY: + return canParse(value); + case SUMO_ATTR_TLLINKINDEX: + case SUMO_ATTR_TLLINKINDEX2: + // -1 means that tlLinkIndex2 takes on the same value as tlLinkIndex when setting idnices + return (isAttributeEnabled(key) && + canParse(value) + && ((parse(value) >= 0) || ((parse(value) == -1) && (key == SUMO_ATTR_TLLINKINDEX2))) + && myParentJunction->getNBNode()->getControllingTLS().size() > 0 + && (*myParentJunction->getNBNode()->getControllingTLS().begin())->getMaxValidIndex() >= parse(value)); + case SUMO_ATTR_CUSTOMSHAPE: { + // empty shapes are allowed + return canParse(value); + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNECrossing::checkEdgeBelong(GNEEdge* edge) const { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->getNBEdge()) != crossing->edges.end()) { + return true; + } else { + return false; + } +} + + +bool +GNECrossing::checkEdgeBelong(const std::vector& edges) const { + for (auto i : edges) { + if (checkEdgeBelong(i)) { + return true; + } + } + return false; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value) { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + switch (key) { + case SUMO_ATTR_ID: + throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); + case SUMO_ATTR_EDGES: { + // obtain GNEEdges + std::vector edges = parse >(myNet, value); + // remove NBEdges of crossing + crossing->edges.clear(); + // set NBEdge of every GNEEdge into Crossing Edges + for (auto i : edges) { + crossing->edges.push_back(i->getNBEdge()); + } + // sort new edges + std::sort(crossing->edges.begin(), crossing->edges.end()); + // change myCrossingEdges by the new edges + myCrossingEdges = crossing->edges; + // update geometry of parent junction + myParentJunction->updateGeometry(); + break; + } + case SUMO_ATTR_WIDTH: + // Change width an refresh element + crossing->customWidth = parse(value); + break; + case SUMO_ATTR_PRIORITY: + crossing->priority = parse(value); + break; + case SUMO_ATTR_TLLINKINDEX: + crossing->customTLIndex = parse(value); + // make new value visible immediately + crossing->tlLinkIndex = crossing->customTLIndex; + break; + case SUMO_ATTR_TLLINKINDEX2: + crossing->customTLIndex2 = parse(value); + // make new value visible immediately + crossing->tlLinkIndex2 = crossing->customTLIndex2; + break; + case SUMO_ATTR_CUSTOMSHAPE: { + // set custom shape + crossing->customShape = parse(value); + break; + } + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + crossing->setParametersStr(value); + break; + default: + 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)) { + myParentJunction->updateGeometry(); + } +} + + +void +GNECrossing::updateDottedContour() { + auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); + // build contour using connection geometry + PositionVector contourFront = myCrossingGeometry.getShape(); + PositionVector contourback = contourFront; + // move both to side + contourFront.move2side(crossing->width * 0.5); + contourback.move2side(crossing->width * -0.5); + // reverse contourback + contourback = contourback.reverse(); + // add contour back to contourfront + for (const auto& position : contourback) { + contourFront.push_back(position); + } + // close contour front + contourFront.closePolygon(); + // set as dotted contour + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), contourFront); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNECrossing.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNECrossing.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNECrossing.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNECrossing.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,161 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECrossing.h +/// @author Jakob Erdmann +/// @date June 2011 +/// +// A class for visualizing Inner Lanes (used when editing traffic lights) +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GUIGLObjectPopupMenu; +class PositionVector; +class GNEJunction; +class GNEEdge; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNECrossing + * @brief This object is responsible for drawing a shape and for supplying a + * a popup menu. Messages are routeted to an internal dataTarget and to the + * editor (hence inheritance from FXDelegator) + */ +class GNECrossing : public GNENetworkElement { +public: + + /**@brief Constructor + * @param[in] parentJunction GNEJunction in which this crossing is placed + * @param[in] crossing Node::Crossing + */ + GNECrossing(GNEJunction* parentJunction, std::vector edges); + + /// @brief Destructor + ~GNECrossing(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name Functions related with geometry of element + /// @{ + /// @brief get Crossing shape + const PositionVector& getCrossingShape() const; + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of hierarchical element in view + Position getPositionInView() const; + /// @} + + /// @brief get parent Junction + GNEJunction* getParentJunction() const; + + /// @brief get crossingEdges + const std::vector& getCrossingEdges() const; + + ///@brief get referente to NBode::Crossing + NBNode::Crossing* getNBCrossing() const; + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * + * @return The boundary the object is within + * @see GUIGlObject::getCenteringBoundary + */ + Boundary getCenteringBoundary() const; + + /**@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 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + + /// @brief return true if a edge belongs to crossing's edges + bool checkEdgeBelong(GNEEdge* edges) const; + + /// @brief return true if a edge of a vector of edges belongs to crossing's edges + bool checkEdgeBelong(const std::vector& edges) const; + +protected: + /// @brief the parent junction of this crossing + GNEJunction* myParentJunction; + + /// @brief Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges) + std::vector myCrossingEdges; + + /// @brief crossing geometry + GNEGeometry::Geometry myCrossingGeometry; + +private: + /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief draw TLS Link Number + void drawTLSLinkNo(const GUIVisualizationSettings& s) const; + + /// @brief Invalidated copy constructor. + GNECrossing(const GNECrossing&) = delete; + + /// @brief Invalidated assignment operator. + GNECrossing& operator=(const GNECrossing&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEEdge.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEEdge.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEEdge.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,2580 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdge.cpp +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A road/street connecting two junctions (netedit-version, adapted from GUIEdge) +// Basically a container for an NBEdge with drawing and editing capabilities +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEConnection.h" +#include "GNECrossing.h" +#include "GNEJunction.h" +#include "GNELane.h" +#include "GNEEdge.h" + +//#define DEBUG_SMOOTH_GEOM +//#define DEBUGCOND(obj) (true) +#define VEHICLE_GAP 1 + +// =========================================================================== +// static +// =========================================================================== +const double GNEEdge::SNAP_RADIUS = SUMO_const_halfLaneWidth; + +// =========================================================================== +// members methods +// =========================================================================== + +GNEEdge::GNEEdge(GNENet* net, NBEdge* nbe, bool wasSplit, bool loaded): + GNENetworkElement(net, nbe->getID(), GLO_EDGE, SUMO_TAG_EDGE, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myNBEdge(nbe), +myGNEJunctionSource(myNet->retrieveJunction(nbe->getFromNode()->getID())), +myGNEJunctionDestiny(myNet->retrieveJunction(nbe->getToNode()->getID())), +myLanes(0), +myAmResponsible(false), +myWasSplit(wasSplit), +myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED), +myUpdateGeometry(true) { + // Create lanes + int numLanes = myNBEdge->getNumLanes(); + myLanes.reserve(numLanes); + for (int i = 0; i < numLanes; i++) { + myLanes.push_back(new GNELane(this, i)); + myLanes.back()->incRef("GNEEdge::GNEEdge"); + } + // update Lane geometries + for (const auto& i : myLanes) { + i->updateGeometry(); + } +} + + +GNEEdge::~GNEEdge() { + // Delete references to this eddge in lanes + for (const auto& lane : myLanes) { + lane->decRef("GNEEdge::~GNEEdge"); + if (lane->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in GNEEdge destructor"); + delete lane; + } + } + // delete references to this eddge in connections + for (const auto& connection : myGNEConnections) { + connection->decRef("GNEEdge::~GNEEdge"); + if (connection->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in GNEEdge destructor"); + delete connection; + } + } + if (myAmResponsible) { + delete myNBEdge; + } +} + + +std::string +GNEEdge::generateChildID(SumoXMLTag /*childTag*/) { + // currently unused + return ""; +} + + +void +GNEEdge::updateGeometry() { + // first check if myUpdateGeometry flag is enabled + if (myUpdateGeometry) { + // Update geometry of lanes + for (const auto& lane : myLanes) { + lane->updateGeometry(); + } + // Update geometry of connections (Only if updateGrid is enabled, because in move mode connections are hidden + // (note: only the previous marked as deprecated will be updated) + if (!myMovingGeometryBoundary.isInitialised()) { + for (const auto& connection : myGNEConnections) { + connection->updateGeometry(); + } + } + // Update geometry of additionals children vinculated to this edge + for (const auto& childAdditionals : getChildAdditionals()) { + childAdditionals->updateGeometry(); + } + // Update geometry of parent additionals that have this edge as parent + for (const auto& additionalParent : getParentAdditionals()) { + additionalParent->updateGeometry(); + } + // Update partial geometry of demand elements parents that have this edge as parent + for (const auto& demandElementParent : getParentDemandElements()) { + demandElementParent->updatePartialGeometry(this); + } + // Update partial geometry of demand elements children vinculated to this edge + for (const auto& childDemandElements : getChildDemandElements()) { + childDemandElements->updatePartialGeometry(this); + } + // Update partial geometry of routes vinculated to this edge + for (const auto& pathElementChild : myPathDemandElementsElementChilds) { + pathElementChild->updatePartialGeometry(this); + } + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); + } + // update vehicle geometry + updateVehicleSpreadGeometries(); + // update vehicle stack labels + updateVehicleStackLabels(); +} + + +Position +GNEEdge::getPositionInView() const { + // currently unused + return Position(0, 0); +} + + +bool +GNEEdge::clickedOverShapeStart(const Position& pos) { + if (myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) { + return (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS); + } else { + return false; + } +} + + +bool +GNEEdge::clickedOverShapeEnd(const Position& pos) { + if (myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) { + return (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS); + } else { + return false; + } +} + + +void +GNEEdge::startShapeBegin() { + myPositionBeforeMoving = myNBEdge->getGeometry().front(); + // save current centering boundary + myMovingGeometryBoundary = getCenteringBoundary(); +} + + +void +GNEEdge::startShapeEnd() { + myPositionBeforeMoving = myNBEdge->getGeometry().back(); + // save current centering boundary + myMovingGeometryBoundary = getCenteringBoundary(); +} + + +void +GNEEdge::moveShapeBegin(const Position& offset) { + // change shape startPosition using oldPosition and offset + Position shapeStartEdited = myPositionBeforeMoving; + shapeStartEdited.add(offset); + // snap to active grid + shapeStartEdited = myNet->getViewNet()->snapToActiveGrid(shapeStartEdited, offset.z() == 0); + // make sure that start and end position are different + if (shapeStartEdited != myNBEdge->getGeometry().back()) { + // set shape start position without updating grid + setShapeStartPos(shapeStartEdited); + updateGeometry(); + } +} + + +void +GNEEdge::moveShapeEnd(const Position& offset) { + // change shape endPosition using oldPosition and offset + Position shapeEndEdited = myPositionBeforeMoving; + shapeEndEdited.add(offset); + // snap to active grid + shapeEndEdited = myNet->getViewNet()->snapToActiveGrid(shapeEndEdited, offset.z() == 0); + // make sure that start and end position are different + if (shapeEndEdited != myNBEdge->getGeometry().front()) { + // set shape end position without updating grid + setShapeEndPos(shapeEndEdited); + updateGeometry(); + } +} + + +void +GNEEdge::commitShapeChangeBegin(GNEUndoList* undoList) { + // first save current shape start position + Position modifiedShapeStartPos = myNBEdge->getGeometry().front(); + // restore old shape start position + setShapeStartPos(myPositionBeforeMoving); + // end geometry moving + endEdgeGeometryMoving(); + // set attribute using undolist + undoList->p_begin("shape start of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, GNE_ATTR_SHAPE_START, toString(modifiedShapeStartPos), toString(myPositionBeforeMoving))); + undoList->p_end(); +} + + +void +GNEEdge::commitShapeChangeEnd(GNEUndoList* undoList) { + // first save current shape end position + Position modifiedShapeEndPos = myNBEdge->getGeometry().back(); + // restore old shape end position + setShapeEndPos(myPositionBeforeMoving); + // end geometry moving + endEdgeGeometryMoving(); + // set attribute using undolist + undoList->p_begin("shape end of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, GNE_ATTR_SHAPE_END, toString(modifiedShapeEndPos), toString(myPositionBeforeMoving))); + undoList->p_end(); +} + + +int +GNEEdge::getEdgeVertexIndex(Position pos, const bool snapToGrid) const { + // check if position has to be snapped to grid + if (snapToGrid) { + pos = myNet->getViewNet()->snapToActiveGrid(pos); + } + const double offset = myNBEdge->getGeometry().nearest_offset_to_point2D(pos, true); + if (offset == GeomHelper::INVALID_OFFSET) { + return -1; + } + Position newPos = myNBEdge->getGeometry().positionAtOffset2D(offset); + // first check if vertex already exists in the inner geometry + for (int i = 0; i < (int)myNBEdge->getGeometry().size(); i++) { + if (myNBEdge->getGeometry()[i].distanceTo2D(newPos) < SNAP_RADIUS) { + // index refers to inner geometry + if (i == 0 || i == (int)(myNBEdge->getGeometry().size() - 1)) { + return -1; + } + return i; + } + } + return -1; +} + + +void +GNEEdge::startEdgeGeometryMoving(const double shapeOffset, const bool invertOffset) { + // save current centering boundary + myMovingGeometryBoundary = getCenteringBoundary(); + // start move shape + if (invertOffset) { + startMoveShape(myNBEdge->getGeometry(), myNBEdge->getGeometry().length() - shapeOffset, SNAP_RADIUS); + } else { + startMoveShape(myNBEdge->getGeometry(), shapeOffset, SNAP_RADIUS); + } + // Save current centering boundary of lanes (and their children) + for (const auto& lane : myLanes) { + lane->startGeometryMoving(); + } + // Save current centering boundary of additionals children vinculated to this edge + for (const auto& additional : getChildAdditionals()) { + additional->startGeometryMoving(); + } + // Save current centering boundary of parent additionals that have this edge as parent + for (const auto& additional : getParentAdditionals()) { + additional->startGeometryMoving(); + } + // Save current centering boundary of demand elements children vinculated to this edge + for (const auto& demandElement : getChildDemandElements()) { + demandElement->startGeometryMoving(); + } + // Save current centering boundary of demand elements parents that have this edge as parent + for (const auto& demandElement : getParentDemandElements()) { + demandElement->startGeometryMoving(); + } +} + + +void +GNEEdge::moveEdgeShape(const Position& offset) { + // first make a copy of myMovingShape + PositionVector newShape = getShapeBeforeMoving(); + // move entire shap if this edge and their junctions is selected + const bool allSelected = mySelected && myGNEJunctionSource->isAttributeCarrierSelected() && myGNEJunctionDestiny->isAttributeCarrierSelected(); + if (moveEntireShape() || allSelected) { + // move entire shape + newShape.add(offset); + } else { + int geometryPointIndex = getGeometryPointIndex(); + // if geometryPoint is -1, then we have to create a new geometry point + if (geometryPointIndex == -1) { + geometryPointIndex = newShape.insertAtClosest(getPosOverShapeBeforeMoving(), true); + } + // move geometry point within newShape + newShape[geometryPointIndex].add(offset); + // check if edge is selected + if (isAttributeCarrierSelected()) { + // move more geometry points, depending if junctions are selected + if (myGNEJunctionSource->isAttributeCarrierSelected()) { + for (int i = 1; i < geometryPointIndex; i++) { + newShape[i].add(offset); + } + } + if (myGNEJunctionDestiny->isAttributeCarrierSelected()) { + for (int i = (geometryPointIndex + 1); i < (int)newShape.size(); i++) { + newShape[i].add(offset); + } + } + } + } + // pop front and back + newShape.pop_front(); + newShape.pop_back(); + // set new inner shape + setGeometry(newShape, true); +} + + +void +GNEEdge::endEdgeGeometryMoving() { + // check that endGeometryMoving was called only once + if (myMovingGeometryBoundary.isInitialised()) { + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // reset myMovingGeometryBoundary + myMovingGeometryBoundary.reset(); + // Restore centering boundary of lanes (and their children) + for (const auto& lane : myLanes) { + lane->endGeometryMoving(); + } + // Restore centering boundary of additionals children vinculated to this edge + for (const auto& additional : getChildAdditionals()) { + additional->endGeometryMoving(); + } + // Restore centering boundary of parent additionals that have this edge as parent + for (const auto& additional : getParentAdditionals()) { + additional->endGeometryMoving(); + } + // Restore centering boundary of demand elements children vinculated to this edge + for (const auto& demandElement : getChildDemandElements()) { + demandElement->endGeometryMoving(); + } + // Restore centering boundary of demand elements parents that have this edge as parent + for (const auto& demandElement : getParentDemandElements()) { + demandElement->endGeometryMoving(); + } + // add object into grid again (using the new centering boundary) + myNet->addGLObjectIntoGrid(this); + } +} + + +void +GNEEdge::commitEdgeShapeChange(GNEUndoList* undoList) { + // restore original shape into shapeToCommit + PositionVector innerShapeToCommit = myNBEdge->getInnerGeometry(); + // first check if second and penultimate isn't in Junction's buubles + double buubleRadius = GNEJunction::BUBBLE_RADIUS * myNet->getViewNet()->getVisualisationSettings().junctionSize.exaggeration; + if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[0].distanceTo2D(myNBEdge->getGeometry()[1]) < buubleRadius) { + innerShapeToCommit.removeClosest(innerShapeToCommit[0]); + } + if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 2].distanceTo2D(myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 1]) < buubleRadius) { + innerShapeToCommit.removeClosest(innerShapeToCommit[(int)innerShapeToCommit.size() - 1]); + } + // second check if double points has to be removed + innerShapeToCommit.removeDoublePoints(SNAP_RADIUS); + // show warning if some of edge's shape was merged + if (innerShapeToCommit.size() != myNBEdge->getInnerGeometry().size()) { + WRITE_WARNING("Merged shape's point") + } + + updateGeometry(); + // restore old geometry to allow change attribute (And restore shape if during movement a new point was created + setGeometry(getShapeBeforeMoving(), false); + // finish geometry moving + endEdgeGeometryMoving(); + // commit new shape + undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_SHAPE, toString(innerShapeToCommit))); + undoList->p_end(); +} + + +void +GNEEdge::deleteEdgeGeometryPoint(const Position& pos, bool allowUndo) { + // obtain index and remove point + PositionVector modifiedShape = myNBEdge->getInnerGeometry(); + int index = modifiedShape.indexOfClosest(pos); + modifiedShape.erase(modifiedShape.begin() + index); + // set new shape depending of allowUndo + if (allowUndo) { + myNet->getViewNet()->getUndoList()->p_begin("delete geometry point"); + setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myNet->getViewNet()->getUndoList()); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // set new shape + setGeometry(modifiedShape, true); + } +} + + +void +GNEEdge::updateJunctionPosition(GNEJunction* junction, const Position& origPos) { + Position delta = junction->getNBNode()->getPosition() - origPos; + PositionVector geom = myNBEdge->getGeometry(); + // geometry endpoint need not equal junction position hence we modify it with delta + if (junction == myGNEJunctionSource) { + geom[0].add(delta); + } else { + geom[-1].add(delta); + } + setGeometry(geom, false); +} + + +Boundary +GNEEdge::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMovingGeometryBoundary.isInitialised()) { + return myMovingGeometryBoundary; + } else { + Boundary b; + for (const auto& i : myLanes) { + b.add(i->getCenteringBoundary()); + } + // ensure that geometry points are selectable even if the lane geometry is strange + for (const Position& pos : myNBEdge->getGeometry()) { + b.add(pos); + } + b.grow(10); + return b; + } +} + +const std::string +GNEEdge::getOptionalName() const { + return myNBEdge->getStreetName(); +} + +GUIGLObjectPopupMenu* +GNEEdge::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + // build position copy entry + buildPositionCopyEntry(ret, false); + return ret; +} + + +GNEJunction* +GNEEdge::getGNEJunctionSource() const { + return myGNEJunctionSource; +} + + +GNEJunction* +GNEEdge::getGNEJunctionDestiny() const { + return myGNEJunctionDestiny; +} + + +GNEEdge* +GNEEdge::getOppositeEdge() const { + return myNet->retrieveEdge(myGNEJunctionDestiny, myGNEJunctionSource, false); +} + + +void +GNEEdge::drawGL(const GUIVisualizationSettings& s) const { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // draw lanes + for (const auto& lane : myLanes) { + lane->drawGL(s); + } + // draw parent additionals + for (const auto& additional : getParentAdditionals()) { + if (additional->getTagProperty().getTag() == SUMO_TAG_REROUTER) { + // draw rerouter symbol + drawRerouterSymbol(s, additional); + } + } + // draw child additional + for (const auto& additional : getChildAdditionals()) { + additional->drawGL(s); + } + // draw child edge + if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements() && myNet->getViewNet()->getDataViewOptions().showDemandElements()) { + drawDemandElements(s); + } + // draw geometry points if isnt's too small and + if ((s.scale > 8.0) && !myNet->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + drawGeometryPoints(s); + } + // draw vehicles + const std::map > vehiclesMap = getVehiclesOverEdgeMap(); + for (const auto& vehicleMap : vehiclesMap) { + for (const auto& vehicle : vehicleMap.second) { + vehicle->drawGL(s); + } + } + // draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawEdgeName(s); + } + // draw dotted contour + if (myNet->getViewNet()->getDottedAC()) { + // get dotted (inspected) AC + const GNEAttributeCarrier* AC = myNet->getViewNet()->getDottedAC(); + // declare a flag for drawing dotted geometry + bool drawDottedGeometry = false; + if (AC == this) { + drawDottedGeometry = true; + } else if (AC->getTagProperty().isGenericData()) { + // iterate over generic data childs + for (const auto& genericData : getChildGenericDataElements()) { + // draw dotted contor around the first and last lane if isn't being drawn for selecting + if (genericData == AC) { + drawDottedGeometry = true; + } + } + } + if (drawDottedGeometry) { + GNEGeometry::drawShapeDottedContour(s, GLO_EDGEDATA, s.laneWidthExaggeration, myDottedGeometry); + } + } +} + + +NBEdge* +GNEEdge::getNBEdge() const { + return myNBEdge; +} + + +Position +GNEEdge::getSplitPos(const Position& clickPos) { + const PositionVector& geom = myNBEdge->getGeometry(); + int index = geom.indexOfClosest(clickPos); + if (geom[index].distanceTo2D(clickPos) < SNAP_RADIUS) { + // split at existing geometry point + return geom[index]; + } else { + // split straight between the next two points + return geom.positionAtOffset(geom.nearest_offset_to_point2D(clickPos)); + } +} + + +void +GNEEdge::editEndpoint(Position pos, GNEUndoList* undoList) { + if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) && (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS)) { + undoList->p_begin("remove endpoint"); + setAttribute(GNE_ATTR_SHAPE_START, "", undoList); + undoList->p_end(); + } else if ((myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) && (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS)) { + undoList->p_begin("remove endpoint"); + setAttribute(GNE_ATTR_SHAPE_END, "", undoList); + undoList->p_end(); + } else { + // we need to create new Start/End position over Edge shape, not over clicked position + double offset = myNBEdge->getGeometry().nearest_offset_to_point2D(myNet->getViewNet()->snapToActiveGrid(pos), true); + if (offset != GeomHelper::INVALID_OFFSET) { + PositionVector geom = myNBEdge->getGeometry(); + // calculate position over edge shape relative to clicked positino + Position newPos = geom.positionAtOffset2D(offset); + // snap new position to grid + newPos = myNet->getViewNet()->snapToActiveGrid(newPos); + undoList->p_begin("set endpoint"); + int index = geom.indexOfClosest(pos); + // check if snap to existing geometry + if (geom[index].distanceTo2D(pos) < SNAP_RADIUS) { + pos = geom[index]; + } + Position destPos = myGNEJunctionDestiny->getNBNode()->getPosition(); + Position sourcePos = myGNEJunctionSource->getNBNode()->getPosition(); + if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) { + setAttribute(GNE_ATTR_SHAPE_END, toString(newPos), undoList); + myGNEJunctionDestiny->invalidateShape(); + } else { + setAttribute(GNE_ATTR_SHAPE_START, toString(newPos), undoList); + myGNEJunctionSource->invalidateShape(); + } + // possibly existing inner point is no longer needed + if (myNBEdge->getInnerGeometry().size() > 0 && getEdgeVertexIndex(pos, false) != -1) { + deleteEdgeGeometryPoint(pos, false); + } + undoList->p_end(); + } + } +} + + +void +GNEEdge::resetEndpoint(const Position& pos, GNEUndoList* undoList) { + Position destPos = myGNEJunctionDestiny->getNBNode()->getPosition(); + Position sourcePos = myGNEJunctionSource->getNBNode()->getPosition(); + if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) { + setAttribute(GNE_ATTR_SHAPE_END, toString(destPos), undoList); + myGNEJunctionDestiny->invalidateShape(); + } else { + setAttribute(GNE_ATTR_SHAPE_START, toString(sourcePos), undoList); + myGNEJunctionSource->invalidateShape(); + } +} + + +void +GNEEdge::setGeometry(PositionVector geom, bool inner) { + // set new geometry + const bool lefthand = OptionsCont::getOptions().getBool("lefthand"); + if (lefthand) { + geom.mirrorX(); + myNBEdge->mirrorX(); + } + myNBEdge->setGeometry(geom, inner); + if (lefthand) { + myNBEdge->mirrorX(); + } + // update geometry + updateGeometry(); + // invalidate junction source shape + myGNEJunctionSource->invalidateShape(); + // iterate over GNEJunctionSource edges and update geometry + for (const auto& edge : myGNEJunctionSource->getGNEIncomingEdges()) { + edge->updateGeometry(); + } + for (const auto& edge : myGNEJunctionSource->getGNEOutgoingEdges()) { + edge->updateGeometry(); + } + // invalidate junction destiny shape + myGNEJunctionDestiny->invalidateShape(); + // iterate over GNEJunctionDestiny edges and update geometry + for (const auto& edge : myGNEJunctionDestiny->getGNEIncomingEdges()) { + edge->updateGeometry(); + } + for (const auto& edge : myGNEJunctionDestiny->getGNEOutgoingEdges()) { + edge->updateGeometry(); + } +} + + +const Position +GNEEdge::getFrontUpShapePosition() const { + PositionVector laneShape = myLanes.front()->getLaneShape(); + laneShape.move2side(myLanes.front()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.front()->getIndex()) / 2); + return laneShape.front(); +} + + +const Position +GNEEdge::getFrontDownShapePosition() const { + PositionVector laneShape = myLanes.back()->getLaneShape(); + laneShape.move2side(-1 * myLanes.back()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.back()->getIndex()) / 2); + return laneShape.front(); +} + + +const Position +GNEEdge::getBackUpShapePosition() const { + PositionVector laneShape = myLanes.front()->getLaneShape(); + laneShape.move2side(myLanes.front()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.front()->getIndex()) / 2); + return laneShape.back(); +} + + +const Position +GNEEdge::getBackDownShapePosition() const { + PositionVector laneShape = myLanes.back()->getLaneShape(); + laneShape.move2side(-1 * myLanes.back()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.back()->getIndex()) / 2); + return laneShape.back(); +} + +void +GNEEdge::remakeGNEConnections() { + // create new and removed unused GNEConnectinos + const std::vector& connections = myNBEdge->getConnections(); + // create a vector to keep retrieved and created connections + std::vector retrievedConnections; + // iterate over NBEdge::Connections of GNEEdge + for (const auto& connection : connections) { + // retrieve existent GNEConnection, or create it + GNEConnection* retrievedGNEConnection = retrieveGNEConnection(connection.fromLane, connection.toEdge, connection.toLane); + retrievedGNEConnection->updateLinkState(); + retrievedConnections.push_back(retrievedGNEConnection); + // check if previously this GNEConnections exists, and if true, remove it from myGNEConnections + std::vector::iterator retrievedExists = std::find(myGNEConnections.begin(), myGNEConnections.end(), retrievedGNEConnection); + if (retrievedExists != myGNEConnections.end()) { + myGNEConnections.erase(retrievedExists); + } else { + // include reference to created GNEConnection + retrievedGNEConnection->incRef("GNEEdge::remakeGNEConnections"); + } + // mark it as deprecated + retrievedGNEConnection->markConnectionGeometryDeprecated(); + } + // delete non retrieved GNEConnections + for (const auto& connection : myGNEConnections) { + // decrease reference + connection->decRef(); + // delete GNEConnection if is unreferenced + if (connection->unreferenced()) { + // remove it from network + myNet->addGLObjectIntoGrid(connection); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in rebuildGNEConnections()"); + delete connection; + } + } + // copy retrieved (existent and created) GNECrossigns to myGNEConnections + myGNEConnections = retrievedConnections; +} + + +void +GNEEdge::clearGNEConnections() { + // Drop all existents connections that aren't referenced anymore + for (auto i : myGNEConnections) { + // check if connection is selected + if (i->isAttributeCarrierSelected()) { + i->unselectAttributeCarrier(); + } + // Dec reference of connection + i->decRef("GNEEdge::clearGNEConnections"); + // Delete GNEConnectionToErase if is unreferenced + if (i->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + i->getTagStr() + " '" + i->getID() + "' in clearGNEConnections()"); + delete i; + } + } + myGNEConnections.clear(); +} + + +int +GNEEdge::getRouteProbeRelativePosition(GNERouteProbe* routeProbe) const { + std::vector routeProbes; + for (auto i : getChildAdditionals()) { + if (i->getTagProperty().getTag() == routeProbe->getTagProperty().getTag()) { + routeProbes.push_back(i); + } + } + // return index of routeProbe in routeProbes vector + auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe); + if (it == routeProbes.end()) { + return -1; + } else { + return (int)(it - routeProbes.begin()); + } +} + + +std::vector +GNEEdge::getGNECrossings() { + std::vector crossings; + for (auto i : myGNEJunctionSource->getGNECrossings()) { + if (i->checkEdgeBelong(this)) { + crossings.push_back(i); + } + } + for (auto i : myGNEJunctionDestiny->getGNECrossings()) { + if (i->checkEdgeBelong(this)) { + crossings.push_back(i); + } + } + return crossings; +} + + +void +GNEEdge::copyTemplate(GNEEdge* tpl, GNEUndoList* undoList) { + // begin undo list + undoList->p_begin("copy template"); + // copy edge-specific attributes + setAttribute(SUMO_ATTR_NUMLANES, tpl->getAttribute(SUMO_ATTR_NUMLANES), undoList); + setAttribute(SUMO_ATTR_TYPE, tpl->getAttribute(SUMO_ATTR_TYPE), undoList); + setAttribute(SUMO_ATTR_PRIORITY, tpl->getAttribute(SUMO_ATTR_PRIORITY), undoList); + setAttribute(SUMO_ATTR_SPREADTYPE, tpl->getAttribute(SUMO_ATTR_SPREADTYPE), undoList); + // copy raw values for lane-specific attributes + setAttribute(SUMO_ATTR_SPEED, toString(myNBEdge->getSpeed()), undoList); + setAttribute(SUMO_ATTR_WIDTH, toString(myNBEdge->getLaneWidth()), undoList); + setAttribute(SUMO_ATTR_ENDOFFSET, toString(myNBEdge->getEndOffset()), undoList); + // copy lane attributes as well + for (int i = 0; i < (int)myLanes.size(); i++) { + myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ALLOW), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_SPEED, tpl->myLanes[i]->getAttribute(SUMO_ATTR_SPEED), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, tpl->myLanes[i]->getAttribute(SUMO_ATTR_WIDTH), undoList); + myLanes[i]->setAttribute(SUMO_ATTR_ENDOFFSET, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ENDOFFSET), undoList); + } + // end undo list + undoList->p_end(); +} + + +std::set +GNEEdge::getLaneGlIDs() const { + std::set result; + for (auto i : myLanes) { + result.insert(i->getGlID()); + } + return result; +} + + +const std::vector& +GNEEdge::getLanes() const { + return myLanes; +} + + +const std::vector& +GNEEdge::getGNEConnections() const { + return myGNEConnections; +} + + +bool +GNEEdge::wasSplit() { + return myWasSplit; +} + + +std::string +GNEEdge::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_FROM: + return myGNEJunctionSource->getID(); + case SUMO_ATTR_TO: + return myGNEJunctionDestiny->getID(); + case SUMO_ATTR_NUMLANES: + return toString(myNBEdge->getNumLanes()); + case SUMO_ATTR_PRIORITY: + return toString(myNBEdge->getPriority()); + case SUMO_ATTR_LENGTH: + return toString(myNBEdge->getFinalLength()); + case SUMO_ATTR_TYPE: + return myNBEdge->getTypeID(); + case SUMO_ATTR_SHAPE: + return toString(myNBEdge->getInnerGeometry()); + case SUMO_ATTR_SPREADTYPE: + return toString(myNBEdge->getLaneSpreadFunction()); + case SUMO_ATTR_NAME: + return myNBEdge->getStreetName(); + case SUMO_ATTR_ALLOW: + return (getVehicleClassNames(myNBEdge->getPermissions()) + (myNBEdge->hasLaneSpecificPermissions() ? " (combined!)" : "")); + case SUMO_ATTR_DISALLOW: { + return (getVehicleClassNames(invertPermissions(myNBEdge->getPermissions())) + (myNBEdge->hasLaneSpecificPermissions() ? " (combined!)" : "")); + } + case SUMO_ATTR_SPEED: + if (myNBEdge->hasLaneSpecificSpeed()) { + return "lane specific"; + } else { + return toString(myNBEdge->getSpeed()); + } + case SUMO_ATTR_WIDTH: + if (myNBEdge->hasLaneSpecificWidth()) { + return "lane specific"; + } else { + return toString(myNBEdge->getLaneWidth()); + } + case SUMO_ATTR_ENDOFFSET: + if (myNBEdge->hasLaneSpecificEndOffset()) { + return "lane specific"; + } else { + return toString(myNBEdge->getEndOffset()); + } + case SUMO_ATTR_DISTANCE: + return toString(myNBEdge->getDistance()); + case GNE_ATTR_MODIFICATION_STATUS: + return myConnectionStatus; + case GNE_ATTR_SHAPE_START: + if (myNBEdge->getGeometry().front() == myGNEJunctionSource->getPositionInView()) { + return ""; + } else { + return toString(myNBEdge->getGeometry().front()); + } + case GNE_ATTR_SHAPE_END: + if (myNBEdge->getGeometry().back() == myGNEJunctionDestiny->getPositionInView()) { + return ""; + } else { + return toString(myNBEdge->getGeometry().back()); + } + case GNE_ATTR_BIDIR: + return toString(myNBEdge->isBidiRail()); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return myNBEdge->getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +std::string +GNEEdge::getAttributeForSelection(SumoXMLAttr key) const { + std::string result = getAttribute(key); + if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) { + result += " " + getVehicleClassNames(SVCAll, true); + } + return result; +} + + +void +GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { + switch (key) { + case SUMO_ATTR_WIDTH: + case SUMO_ATTR_ENDOFFSET: + case SUMO_ATTR_SPEED: + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: { + undoList->p_begin("change " + getTagStr() + " attribute"); + const std::string origValue = myLanes.at(0)->getAttribute(key); // will have intermediate value of "lane specific" + // lane specific attributes need to be changed via lanes to allow undo + for (auto it : myLanes) { + it->setAttribute(key, value, undoList); + } + // ensure that the edge value is also changed. Actually this sets the lane attributes again but it does not matter + undoList->p_add(new GNEChange_Attribute(this, key, value, origValue)); + undoList->p_end(); + break; + } + case SUMO_ATTR_FROM: { + undoList->p_begin("change " + getTagStr() + " attribute"); + // Remove edge from crossings of junction source + removeEdgeFromCrossings(myGNEJunctionSource, undoList); + // continue changing from junction + GNEJunction* oldGNEJunctionSource = myGNEJunctionSource; + myGNEJunctionSource->setLogicValid(false, undoList); + undoList->p_add(new GNEChange_Attribute(this, key, value)); + myGNEJunctionSource->setLogicValid(false, undoList); + myNet->retrieveJunction(value)->setLogicValid(false, undoList); + setAttribute(GNE_ATTR_SHAPE_START, toString(myGNEJunctionSource->getNBNode()->getPosition()), undoList); + myGNEJunctionSource->invalidateShape(); + undoList->p_end(); + // update geometries of all implicated junctions + oldGNEJunctionSource->updateGeometry(); + myGNEJunctionSource->updateGeometry(); + myGNEJunctionDestiny->updateGeometry(); + break; + } + case SUMO_ATTR_TO: { + undoList->p_begin("change " + getTagStr() + " attribute"); + // Remove edge from crossings of junction destiny + removeEdgeFromCrossings(myGNEJunctionDestiny, undoList); + // continue changing destiny junction + GNEJunction* oldGNEJunctionDestiny = myGNEJunctionDestiny; + myGNEJunctionDestiny->setLogicValid(false, undoList); + undoList->p_add(new GNEChange_Attribute(this, key, value)); + myGNEJunctionDestiny->setLogicValid(false, undoList); + myNet->retrieveJunction(value)->setLogicValid(false, undoList); + setAttribute(GNE_ATTR_SHAPE_END, toString(myGNEJunctionDestiny->getNBNode()->getPosition()), undoList); + myGNEJunctionDestiny->invalidateShape(); + undoList->p_end(); + // update geometries of all implicated junctions + oldGNEJunctionDestiny->updateGeometry(); + myGNEJunctionDestiny->updateGeometry(); + myGNEJunctionSource->updateGeometry(); + break; + } + case SUMO_ATTR_ID: + case SUMO_ATTR_PRIORITY: + case SUMO_ATTR_LENGTH: + case SUMO_ATTR_TYPE: + case SUMO_ATTR_SPREADTYPE: + case SUMO_ATTR_DISTANCE: + case GNE_ATTR_MODIFICATION_STATUS: + case GNE_ATTR_SHAPE_START: + case GNE_ATTR_SHAPE_END: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + case SUMO_ATTR_NAME: + // user cares about street names. Make sure they appear in the output + OptionsCont::getOptions().resetWritable(); + OptionsCont::getOptions().set("output.street-names", "true"); + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + case SUMO_ATTR_NUMLANES: + if (value != getAttribute(key)) { + // Remove edge from crossings of junction source + removeEdgeFromCrossings(myGNEJunctionSource, undoList); + // Remove edge from crossings of junction destiny + removeEdgeFromCrossings(myGNEJunctionDestiny, undoList); + // set num lanes + setNumLanes(parse(value), undoList); + } + break; + case SUMO_ATTR_SHAPE: + // @note: assumes value of inner geometry! + // actually the geometry is already updated (incrementally + // during mouse movement). We set the restore point to the end + // of the last change-set + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + case GNE_ATTR_BIDIR: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEEdge::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) == nullptr); + case SUMO_ATTR_FROM: { + // check that is a valid ID and is different of ID of junction destiny + if (SUMOXMLDefinitions::isValidNetID(value) && (value != myGNEJunctionDestiny->getID())) { + GNEJunction* junctionFrom = myNet->retrieveJunction(value, false); + // check that there isn't already another edge with the same From and To Edge + if ((junctionFrom != nullptr) && (myNet->retrieveEdge(junctionFrom, myGNEJunctionDestiny, false) == nullptr)) { + return true; + } else { + return false; + } + } else { + return false; + } + } + case SUMO_ATTR_TO: { + // check that is a valid ID and is different of ID of junction Source + if (SUMOXMLDefinitions::isValidNetID(value) && (value != myGNEJunctionSource->getID())) { + GNEJunction* junctionTo = myNet->retrieveJunction(value, false); + // check that there isn't already another edge with the same From and To Edge + if ((junctionTo != nullptr) && (myNet->retrieveEdge(myGNEJunctionSource, junctionTo, false) == nullptr)) { + return true; + } else { + return false; + } + } else { + return false; + } + } + case SUMO_ATTR_SPEED: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_NUMLANES: + return canParse(value) && (parse(value) > 0); + case SUMO_ATTR_PRIORITY: + return canParse(value); + case SUMO_ATTR_LENGTH: + return canParse(value) && ((parse(value) > 0) || (parse(value) == NBEdge::UNSPECIFIED_LOADED_LENGTH)); + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + return canParseVehicleClasses(value); + case SUMO_ATTR_TYPE: + return true; + case SUMO_ATTR_SHAPE: + // empty shapes are allowed + return canParse(value); + case SUMO_ATTR_SPREADTYPE: + return SUMOXMLDefinitions::LaneSpreadFunctions.hasString(value); + case SUMO_ATTR_NAME: + return true; + case SUMO_ATTR_WIDTH: + return canParse(value) && ((parse(value) >= -1) || (parse(value) == NBEdge::UNSPECIFIED_WIDTH)); + case SUMO_ATTR_ENDOFFSET: + return canParse(value) && parse(value) >= 0 && parse(value) < myNBEdge->getLoadedLength(); + case SUMO_ATTR_DISTANCE: + return canParse(value); + case GNE_ATTR_SHAPE_START: { + if (value.empty()) { + return true; + } else if (canParse(value)) { + Position shapeStart = parse(value); + return (shapeStart != myNBEdge->getGeometry()[-1]); + } else { + return false; + } + } + case GNE_ATTR_SHAPE_END: { + if (value.empty()) { + return true; + } else if (canParse(value)) { + Position shapeEnd = parse(value); + return (shapeEnd != myNBEdge->getGeometry()[0]); + } else { + return false; + } + } + case GNE_ATTR_BIDIR: + return false; + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEEdge::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case GNE_ATTR_BIDIR: + return false; + default: + return true; + } +} + + +void +GNEEdge::setResponsible(bool newVal) { + myAmResponsible = newVal; +} + + +GNELane* +GNEEdge::getLaneByAllowedVClass(const SUMOVehicleClass vClass) const { + // iterate over all NBEdge lanes + for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) { + // if given VClass is in permissions, return lane + if (myNBEdge->getLanes().at(i).permissions & vClass) { + // return GNELane + return myLanes.at(i); + } + } + // return first lane + return myLanes.front(); +} + + +GNELane* +GNEEdge::getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const { + // iterate over all NBEdge lanes + for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) { + // if given VClass isn't in permissions, return lane + if (~(myNBEdge->getLanes().at(i).permissions) & vClass) { + // return GNELane + return myLanes.at(i); + } + } + // return first lane + return myLanes.front(); +} + + +void +GNEEdge::drawPartialRoute(const GUIVisualizationSettings& s, const GNEDemandElement* route, const GNEJunction* junction) const { + // calculate route width + double routeWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.route; + // obtain color + RGBColor routeColor; + if (route->drawUsingSelectColor()) { + routeColor = s.colorSettings.selectedRouteColor; + } else { + routeColor = route->getColor(); + } + // Start drawing adding an gl identificator + glPushName(route->getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, route->getType()); + // draw route + if (junction) { + // iterate over segments + for (const auto& segment : route->getDemandElementSegmentGeometry()) { + // draw partial segment + if ((segment.junction == junction) && (segment.AC == route)) { + // Set route color (needed due drawShapeDottedContour) + GLHelper::setColor(routeColor); + // draw box lines + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == route) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth); + } + } + } + } else { + // iterate over segments + for (const auto& segment : route->getDemandElementSegmentGeometry()) { + // draw partial segment + if ((segment.edge == this) && (segment.AC == route)) { + // Set route color (needed due drawShapeDottedContour) + GLHelper::setColor(routeColor); + // draw box lines + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == route) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth); + } + } + } + } + // Pop last matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + } + // Pop name + glPopName(); + // draw route children + for (const auto& i : route->getChildDemandElements()) { + if (i->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) { + drawPartialPersonPlan(s, i, junction); + } + } +} + + +void +GNEEdge::drawPartialTripFromTo(const GUIVisualizationSettings& s, const GNEDemandElement* tripOrFromTo, const GNEJunction* junction) const { + // declare flag to draw spread vehicles + const bool drawSpreadVehicles = (myNet->getViewNet()->getNetworkViewOptions().drawSpreadVehicles() || myNet->getViewNet()->getDemandViewOptions().drawSpreadVehicles()); + // calculate tripOrFromTo width + double tripOrFromToWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.trip; + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, tripOrFromTo->getType()); + // Set color of the base + if (tripOrFromTo->drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedVehicleColor); + } else { + GLHelper::setColor(s.colorSettings.vehicleTrips); + } + // draw trip from to + if (junction) { + // iterate over segments + if (drawSpreadVehicles) { + for (const auto& segment : tripOrFromTo->getDemandElementSegmentSpreadGeometry()) { + // draw partial segment + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); + } + } else { + for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) { + // draw partial segment + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); + } + } + } else { + // iterate over segments + if (drawSpreadVehicles) { + for (const auto& segment : tripOrFromTo->getDemandElementSegmentSpreadGeometry()) { + // draw partial segment + if ((segment.edge == this) && (segment.AC == tripOrFromTo)) { + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); + } + } + } else { + for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) { + // draw partial segment + if ((segment.edge == this) && (segment.AC == tripOrFromTo)) { + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); + } + } + } + } + // Pop last matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + } +} + + +void +GNEEdge::drawPartialPersonPlan(const GUIVisualizationSettings& s, const GNEDemandElement* personPlan, const GNEJunction* junction) const { + // declare flag to enable or disable draw person plan + bool drawPersonPlan = false; + if (myNet->getViewNet()->getDemandViewOptions().showAllPersonPlans()) { + drawPersonPlan = true; + } else if (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) { + drawPersonPlan = true; + } else if (myNet->getViewNet()->getDemandViewOptions().getLockedPerson() == personPlan->getParentDemandElements().front()) { + drawPersonPlan = true; + } else if (myNet->getViewNet()->getDottedAC() && myNet->getViewNet()->getDottedAC()->getTagProperty().isPersonPlan() && + (myNet->getViewNet()->getDottedAC()->getAttribute(GNE_ATTR_PARENT) == personPlan->getAttribute(GNE_ATTR_PARENT))) { + drawPersonPlan = true; + } + // check if draw person plan elements can be drawn + if (drawPersonPlan) { + // calculate personPlan width + double personPlanWidth = 0; + // flag to check if width must be duplicated + bool duplicateWidth = (myNet->getViewNet()->getDottedAC() == personPlan) || (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) ? true : false; + // Set width depending of person plan type + if (personPlan->getTagProperty().isPersonTrip()) { + personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.personTrip; + } else if (personPlan->getTagProperty().isWalk()) { + personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.walk; + } else if (personPlan->getTagProperty().isRide()) { + personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.ride; + } + // check if width has to be duplicated + if (duplicateWidth) { + personPlanWidth *= 2; + } + // set personPlan color + RGBColor personPlanColor; + // Set color depending of person plan type + if (personPlan->drawUsingSelectColor()) { + personPlanColor = s.colorSettings.selectedPersonPlanColor; + } else if (personPlan->getTagProperty().isPersonTrip()) { + personPlanColor = s.colorSettings.personTrip; + } else if (personPlan->getTagProperty().isWalk()) { + personPlanColor = s.colorSettings.walk; + } else if (personPlan->getTagProperty().isRide()) { + personPlanColor = s.colorSettings.ride; + } + // Start drawing adding an gl identificator + glPushName(personPlan->getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, personPlan->getType()); + // draw person plan + if (junction) { + // iterate over segments + for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) { + // draw partial segment + if ((segment.junction == junction) && (segment.AC == personPlan)) { + // Set person plan color (needed due drawShapeDottedContour) + GLHelper::setColor(personPlanColor); + // draw box line + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == personPlan) { + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); + } + } + } + } else { + // iterate over segments + for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) { + // draw partial segment + if ((segment.edge == this) && (segment.AC == personPlan)) { + // Set person plan color (needed due drawShapeDottedContour) + GLHelper::setColor(personPlanColor); + // draw box line + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == personPlan) { + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); + } + } + } + } + // Pop last matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + } + // Pop name + glPopName(); + // check if person plan ArrivalPos attribute + if (personPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) { + // obtain arrival position using last segment + const Position& arrivalPos = personPlan->getDemandElementSegmentGeometry().getLastPosition(); + // only draw arrival position point if isn't -1 + if (arrivalPos != Position::INVALID) { + // obtain circle width + const double circleWidth = (duplicateWidth ? SNAP_RADIUS : (SNAP_RADIUS / 2.0)) * MIN2((double)0.5, s.laneWidthExaggeration); + const double circleWidthSquared = circleWidth * circleWidth; + if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(arrivalPos) <= (circleWidthSquared + 2))) { + glPushMatrix(); + // translate to pos and move to upper using GLO_PERSONTRIP (to avoid overlapping) + glTranslated(arrivalPos.x(), arrivalPos.y(), GLO_PERSONTRIP + 0.01); + // Set color depending of person plan type + if (personPlan->drawUsingSelectColor()) { + GLHelper::setColor(s.colorSettings.selectedPersonPlanColor); + } else if (personPlan->getTagProperty().isPersonTrip()) { + GLHelper::setColor(s.colorSettings.personTrip); + } else if (personPlan->getTagProperty().isWalk()) { + GLHelper::setColor(s.colorSettings.walk); + } else if (personPlan->getTagProperty().isRide()) { + GLHelper::setColor(s.colorSettings.ride); + } + // resolution of drawn circle depending of the zoom (To improve smothness) + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + glPopMatrix(); + } + } + } + } + // draw person if this edge correspond to the first edge of first Person's person plan + GNEEdge* firstEdge = nullptr; + const GNEDemandElement* firstPersonPlan = personPlan->getParentDemandElements().front()->getChildDemandElements().front(); + if (firstPersonPlan->getTagProperty().isPersonStop()) { + if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_PERSONSTOP_LANE) { + // obtain edge of parent lane + firstEdge = firstPersonPlan->getParentLanes().front()->getParentEdge(); + } else { + // obtain edge of busstop's parent lane + firstEdge = firstPersonPlan->getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); + } + } else if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) { + // obtain first rute edge + firstEdge = firstPersonPlan->getParentDemandElements().at(1)->getParentEdges().front(); + } else { + // obtain first parent edge + firstEdge = firstPersonPlan->getParentEdges().front(); + } + // draw person parent if this is the edge first edge and this is the first plan + if ((firstEdge == this) && (firstPersonPlan == personPlan)) { + personPlan->getParentDemandElements().front()->drawGL(s); + } +} + + +void +GNEEdge::addPathElement(GNEDemandElement* pathElementChild) { + // avoid insert duplicatd path element childs + if (std::find(myPathDemandElementsElementChilds.begin(), myPathDemandElementsElementChilds.end(), pathElementChild) == myPathDemandElementsElementChilds.end()) { + myPathDemandElementsElementChilds.push_back(pathElementChild); + } +} + + +void +GNEEdge::removePathElement(GNEDemandElement* pathElementChild) { + // search and remove pathElementChild + auto it = std::find(myPathDemandElementsElementChilds.begin(), myPathDemandElementsElementChilds.end(), pathElementChild); + if (it != myPathDemandElementsElementChilds.end()) { + myPathDemandElementsElementChilds.erase(it); + } +} + + +void +GNEEdge::invalidatePathChildElements() { + // make a copy of myPathDemandElementsElementChilds + auto copyOfPathDemandElementsElementChilds = myPathDemandElementsElementChilds; + for (const auto& pathElementChild : copyOfPathDemandElementsElementChilds) { + pathElementChild->invalidatePath(); + } +} + + +void +GNEEdge::updateVehicleSpreadGeometries() { + // get lane vehicles map + const std::map > laneVehiclesMap = getVehiclesOverEdgeMap(); + // iterate over every lane + for (const auto& laneVehicle : laneVehiclesMap) { + // obtain total lenght + double totalLength = 0; + for (const auto& vehicle : laneVehicle.second) { + totalLength += vehicle->getAttributeDouble(SUMO_ATTR_LENGTH) + VEHICLE_GAP; + } + // calculate multiplier for vehicle positions + double multiplier = 1; + const double laneShapeLenght = laneVehicle.first->getLaneShape().length(); + if (laneShapeLenght == 0) { + multiplier = 0; + } else if (totalLength > laneShapeLenght) { + multiplier = (laneShapeLenght / totalLength); + } + // declare current lenght + double lenght = 0; + // iterate over vehicles to calculate position and rotations + for (const auto& vehicle : laneVehicle.second) { + vehicle->updateDemandElementSpreadGeometry(laneVehicle.first, lenght * multiplier); + // update lenght + lenght += vehicle->getAttributeDouble(SUMO_ATTR_LENGTH) + VEHICLE_GAP; + } + } +} + + +void +GNEEdge::updateVehicleStackLabels() { + // get lane vehicles map + const std::map > laneVehiclesMap = getVehiclesOverEdgeMap(); + // iterate over laneVehiclesMap and obtain a vector with + for (const auto& vehicleMap : laneVehiclesMap) { + // declare map for sprt vehicles using their departpos+lenght position (StackPosition) + std::vector > departPosVehicles; + // declare vector of stack demand elements + std::vector stackedVehicles; + // iterate over vehicles + for (const auto& vehicle : vehicleMap.second) { + // get vehicle's depart pos and lenght + const double departPos = vehicle->getAttributeDouble(SUMO_ATTR_DEPARTPOS); + const double length = vehicle->getAttributeDouble(SUMO_ATTR_LENGTH); + double posOverLane = vehicle->getAttributeDouble(SUMO_ATTR_DEPARTPOS); + // check if we have to adapt posOverLane + if (posOverLane < 0) { + posOverLane += vehicleMap.first->getLaneShape().length(); + } + // make a stack position using departPos and length + departPosVehicles.push_back(std::make_pair(StackPosition(departPos, length), vehicle)); + // update depart element geometry + vehicle->updateDemandElementGeometry(vehicleMap.first, posOverLane); + // reset vehicle stack label + vehicle->updateDemandElementStackLabel(0); + } + + // sort departPosVehicles + std::sort(departPosVehicles.begin(), departPosVehicles.end()); + // iterate over departPosVehicles + for (const auto& departPosVehicle : departPosVehicles) { + // obtain stack position and vehicle + const GNEEdge::StackPosition& vehicleStackPosition = departPosVehicle.first; + GNEDemandElement* vehicle = departPosVehicle.second; + // if stackedVehicles is empty, add a new StackDemandElements + if (stackedVehicles.empty()) { + stackedVehicles.push_back(GNEEdge::StackDemandElements(vehicleStackPosition, vehicle)); + } else if (areStackPositionOverlapped(vehicleStackPosition, stackedVehicles.back().getStackPosition())) { + // add new vehicle to last inserted stackDemandElements + stackedVehicles[stackedVehicles.size() - 1].addDemandElements(vehicle); + } else { + // No overlapping, then add a new StackDemandElements + stackedVehicles.push_back(GNEEdge::StackDemandElements(vehicleStackPosition, vehicle)); + } + } + // iterate over stackedVehicles + for (const auto& vehicle : stackedVehicles) { + // only update vehicles with one or more stack + if (vehicle.getDemandElements().size() > 1) { + // set stack labels + vehicle.getDemandElements().front()->updateDemandElementStackLabel((int)vehicle.getDemandElements().size()); + } + } + } +} + + +void +GNEEdge::updateDottedContour() { + // obtain lanes + const GNELane* frontLane = myLanes.front(); + const GNELane* backLane = myLanes.back(); + // obtain visualization settings + const GUIVisualizationSettings& visualizationSetting = myNet->getViewNet()->getVisualisationSettings(); + // obtain lane widdths + const double myHalfLaneWidthFront = myNBEdge->getLaneWidth(frontLane->getIndex()) / 2; + const double myHalfLaneWidthBack = (visualizationSetting.spreadSuperposed && backLane->drawAsRailway(visualizationSetting) && + myNBEdge->isBidiRail()) ? 0 : myNBEdge->getLaneWidth(backLane->getIndex()) / 2; + // obtain shapes from NBEdge + PositionVector mainShape = frontLane->getParentEdge()->getNBEdge()->getLaneShape(frontLane->getIndex()); + PositionVector backShape = backLane->getParentEdge()->getNBEdge()->getLaneShape(backLane->getIndex()); + // move to side depending of lefthand + if (visualizationSetting.lefthand) { + mainShape.move2side(myHalfLaneWidthFront * -1); + backShape.move2side(myHalfLaneWidthBack); + } else { + mainShape.move2side(myHalfLaneWidthFront); + backShape.move2side(myHalfLaneWidthBack * -1); + } + // reverse back shape + backShape = backShape.reverse(); + // add back shape into mainShape + for (const auto& position : backShape) { + mainShape.push_back(position); + } + // close polygon + mainShape.closePolygon(); + // update edge dotted geometry + updateDottedGeometry(mainShape); +} + + +// =========================================================================== +// private +// =========================================================================== + +GNEEdge::StackPosition::StackPosition(const double departPos, const double length) : + tuple(departPos, departPos + length) { +} + + +double +GNEEdge::StackPosition::beginPosition() const { + return std::get<0>(*this); +} + + +double +GNEEdge::StackPosition::endPosition() const { + return std::get<1>(*this); +} + + +GNEEdge::StackDemandElements::StackDemandElements(const StackPosition stackedPosition, GNEDemandElement* demandElement) : + tuple(stackedPosition, { + demandElement +}) { +} + + +void +GNEEdge::StackDemandElements::addDemandElements(GNEDemandElement* demandElement) { + std::get<1>(*this).push_back(demandElement); +} + + +const GNEEdge::StackPosition& +GNEEdge::StackDemandElements::getStackPosition() const { + return std::get<0>(*this); +} + + +const std::vector& +GNEEdge::StackDemandElements::getDemandElements() const { + return std::get<1>(*this); +} + + +void +GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + myNet->getAttributeCarriers()->updateID(this, value); + break; + case SUMO_ATTR_FROM: + myNet->changeEdgeEndpoints(this, value, myGNEJunctionDestiny->getID()); + // update this edge of list of outgoings edges of the old GNEJunctionSource + myGNEJunctionSource->removeOutgoingGNEEdge(this); + // update GNEJunctionSource + myGNEJunctionSource = myNet->retrieveJunction(myNBEdge->getFromNode()->getID()); + // update this edge of list of outgoings edges of the new GNEJunctionSource + myGNEJunctionSource->addOutgoingGNEEdge(this); + break; + case SUMO_ATTR_TO: + myNet->changeEdgeEndpoints(this, myGNEJunctionSource->getID(), value); + // update this edge of list of incomings edges of the old GNEJunctionDestiny + myGNEJunctionDestiny->removeIncomingGNEEdge(this); + // update GNEJunctionDestiny + myGNEJunctionDestiny = myNet->retrieveJunction(myNBEdge->getToNode()->getID()); + // update this edge of list of incomings edges of the new GNEJunctionDestiny + myGNEJunctionDestiny->addIncomingGNEEdge(this); + break; + case SUMO_ATTR_NUMLANES: + throw InvalidArgument("GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen"); + break; + case SUMO_ATTR_PRIORITY: + myNBEdge->myPriority = parse(value); + break; + case SUMO_ATTR_LENGTH: + myNBEdge->setLoadedLength(parse(value)); + break; + case SUMO_ATTR_TYPE: + myNBEdge->myType = value; + break; + case SUMO_ATTR_SHAPE: + // start geometry moving (because a new shape affect all child edges) + startEdgeGeometryMoving(-1, false); + // set new geometry + setGeometry(parse(value), true); + // start geometry moving (because a new shape affect all child edges) + endEdgeGeometryMoving(); + break; + case SUMO_ATTR_SPREADTYPE: + myNBEdge->setLaneSpreadFunction(SUMOXMLDefinitions::LaneSpreadFunctions.get(value)); + break; + case SUMO_ATTR_NAME: + myNBEdge->setStreetName(value); + break; + case SUMO_ATTR_SPEED: + myNBEdge->setSpeed(-1, parse(value)); + break; + case SUMO_ATTR_WIDTH: + myNBEdge->setLaneWidth(-1, parse(value)); + break; + case SUMO_ATTR_ENDOFFSET: + myNBEdge->setEndOffset(-1, parse(value)); + break; + case SUMO_ATTR_ALLOW: + break; // no edge value + case SUMO_ATTR_DISALLOW: + break; // no edge value + case SUMO_ATTR_DISTANCE: + myNBEdge->setDistance(parse(value)); + break; + case GNE_ATTR_MODIFICATION_STATUS: + myConnectionStatus = value; + if (value == FEATURE_GUESSED) { + WRITE_DEBUG("invalidating (removing) connections of edge '" + getID() + "' due it were guessed"); + myNBEdge->invalidateConnections(true); + clearGNEConnections(); + } else if (value != FEATURE_GUESSED) { + WRITE_DEBUG("declaring connections of edge '" + getID() + "' as loaded (It will not be removed)"); + myNBEdge->declareConnectionsAsLoaded(); + } + break; + case GNE_ATTR_SHAPE_START: { + // get geometry of NBEdge, remove FIRST element with the new value (or with the Junction Source position) and set it back to edge + Position newShapeStart; + if (value == "") { + newShapeStart = myGNEJunctionSource->getPositionInView(); + } else { + newShapeStart = parse(value); + } + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // set shape start position + setShapeStartPos(newShapeStart); + // add object from net + myNet->addGLObjectIntoGrid(this); + break; + } + case GNE_ATTR_SHAPE_END: { + // get geometry of NBEdge, remove LAST element with the new value (or with the Junction Destiny position) and set it back to edge + Position newShapeEnd; + if (value == "") { + newShapeEnd = myGNEJunctionDestiny->getPositionInView(); + } else { + newShapeEnd = parse(value); + } + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // set shape end position + setShapeEndPos(newShapeEnd); + // add object from net + myNet->addGLObjectIntoGrid(this); + break; + } + case GNE_ATTR_BIDIR: + throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + myNBEdge->setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEEdge::setNumLanes(int numLanes, GNEUndoList* undoList) { + // begin undo list + undoList->p_begin("change number of " + toString(SUMO_TAG_LANE) + "s"); + // invalidate logic of source/destiny edges + myGNEJunctionSource->setLogicValid(false, undoList); + myGNEJunctionDestiny->setLogicValid(false, undoList); + // disable update geometry (see #6336) + myUpdateGeometry = false; + // remove edge of RTREE + myNet->removeGLObjectFromGrid(this); + const int oldNumLanes = (int)myLanes.size(); + for (int i = oldNumLanes; i < numLanes; i++) { + // since the GNELane does not exist yet, it cannot have yet been referenced so we only pass a zero-pointer + undoList->add(new GNEChange_Lane(this, myNBEdge->getLaneStruct(oldNumLanes - 1)), true); + } + for (int i = (oldNumLanes - 1); i > (numLanes - 1); i--) { + // delete leftmost lane + undoList->add(new GNEChange_Lane(this, myLanes[i], myNBEdge->getLaneStruct(i), false), true); + } + // enable updateGeometry again + myUpdateGeometry = true; + // insert edge in RTREE again + myNet->addGLObjectIntoGrid(this); + // update geometry of entire edge + updateGeometry(); + // end undo list + undoList->p_end(); +} + + +void +GNEEdge::addLane(GNELane* lane, const NBEdge::Lane& laneAttrs, bool recomputeConnections) { + // boundary of edge depends of number of lanes. We need to extract if before add or remove lane + if (myUpdateGeometry) { + myNet->removeGLObjectFromGrid(this); + } + const int index = lane ? lane->getIndex() : myNBEdge->getNumLanes(); + // the laneStruct must be created first to ensure we have some geometry + // unless the connections are fully recomputed, existing indices must be shifted + myNBEdge->addLane(index, true, recomputeConnections, !recomputeConnections); + if (lane) { + // restore a previously deleted lane + myLanes.insert(myLanes.begin() + index, lane); + + } else { + // create a new lane by copying leftmost lane + lane = new GNELane(this, index); + myLanes.push_back(lane); + } + lane->incRef("GNEEdge::addLane"); + // check if lane is selected + if (lane->isAttributeCarrierSelected()) { + lane->selectAttributeCarrier(); + } + // we copy all attributes except shape since this is recomputed from edge shape + myNBEdge->setSpeed(lane->getIndex(), laneAttrs.speed); + myNBEdge->setPermissions(laneAttrs.permissions, lane->getIndex()); + myNBEdge->setPreferredVehicleClass(laneAttrs.preferred, lane->getIndex()); + myNBEdge->setEndOffset(lane->getIndex(), laneAttrs.endOffset); + myNBEdge->setLaneWidth(lane->getIndex(), laneAttrs.width); + // udate indices + for (int i = 0; i < (int)myLanes.size(); ++i) { + myLanes[i]->setIndex(i); + } + /* while technically correct, this looks ugly + myGNEJunctionSource->invalidateShape(); + myGNEJunctionDestiny->invalidateShape(); + */ + // Remake connections for this edge and all edges that target this lane + remakeGNEConnections(); + // remake connections of all edges of junction source and destiny + for (auto i : myGNEJunctionSource->getGNEEdges()) { + i->remakeGNEConnections(); + } + // remake connections of all edges of junction source and destiny + for (auto i : myGNEJunctionDestiny->getGNEEdges()) { + i->remakeGNEConnections(); + } + // add object again + if (myUpdateGeometry) { + myNet->addGLObjectIntoGrid(this); + } + // Update geometry with the new lane + updateGeometry(); +} + + +void +GNEEdge::removeLane(GNELane* lane, bool recomputeConnections) { + // boundary of edge depends of number of lanes. We need to extract if before add or remove lane + if (myUpdateGeometry) { + myNet->removeGLObjectFromGrid(this); + } + if (myLanes.size() == 0) { + throw ProcessError("Should not remove the last " + toString(SUMO_TAG_LANE) + " from an " + getTagStr()); + } + if (lane == nullptr) { + lane = myLanes.back(); + } + // check if lane is selected + if (lane->isAttributeCarrierSelected()) { + lane->unselectAttributeCarrier(); + } + // Delete lane of edge's container + // unless the connections are fully recomputed, existing indices must be shifted + myNBEdge->deleteLane(lane->getIndex(), recomputeConnections, !recomputeConnections); + lane->decRef("GNEEdge::removeLane"); + myLanes.erase(myLanes.begin() + lane->getIndex()); + // Delete lane if is unreferenced + if (lane->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in removeLane()"); + delete lane; + } + // udate indices + for (int i = 0; i < (int)myLanes.size(); ++i) { + myLanes[i]->setIndex(i); + } + /* while technically correct, this looks ugly + myGNEJunctionSource->invalidateShape(); + myGNEJunctionDestiny->invalidateShape(); + */ + // Remake connections of this edge + remakeGNEConnections(); + // remake connections of all edges of junction source and destiny + for (auto i : myGNEJunctionSource->getGNEEdges()) { + i->remakeGNEConnections(); + } + // remake connections of all edges of junction source and destiny + for (auto i : myGNEJunctionDestiny->getGNEEdges()) { + i->remakeGNEConnections(); + } + // add object again + if (myUpdateGeometry) { + myNet->addGLObjectIntoGrid(this); + } + // Update element + updateGeometry(); +} + + +void +GNEEdge::addConnection(NBEdge::Connection nbCon, bool selectAfterCreation) { + // If a new connection was sucesfully created + if (myNBEdge->setConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, NBEdge::L2L_USER, true, nbCon.mayDefinitelyPass, + nbCon.keepClear, nbCon.contPos, nbCon.visibility, + nbCon.speed, nbCon.customLength, nbCon.customShape, nbCon.uncontrolled)) { + // Create or retrieve existent GNEConection + GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane); + // add it to GNEConnection container + myGNEConnections.push_back(con); + // Add reference + myGNEConnections.back()->incRef("GNEEdge::addConnection"); + // select GNEConnection if needed + if (selectAfterCreation) { + con->selectAttributeCarrier(); + } + // update geometry + con->updateGeometry(); + // iterate over all additionals from "from" lane and check E2 multilane integrity + for (auto i : con->getLaneFrom()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + // iterate over all additionals from "to" lane and check E2 multilane integrity + for (auto i : con->getLaneTo()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + } + // actually we only do this to force a redraw + updateGeometry(); +} + + +void +GNEEdge::removeConnection(NBEdge::Connection nbCon) { + // check if is a explicit turnaround + if (nbCon.toEdge == myNBEdge->getTurnDestination()) { + myNet->removeExplicitTurnaround(getID()); + } + // remove NBEdge::connection from NBEdge + myNBEdge->removeFromConnections(nbCon); + // remove their associated GNEConnection + GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, false); + if (con != nullptr) { + con->decRef("GNEEdge::removeConnection"); + myGNEConnections.erase(std::find(myGNEConnections.begin(), myGNEConnections.end(), con)); + // iterate over all additionals from "from" lane and check E2 multilane integrity + for (auto i : con->getLaneFrom()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + // iterate over all additionals from "to" lane and check E2 multilane integrity + for (auto i : con->getLaneTo()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + // check if connection is selected + if (con->isAttributeCarrierSelected()) { + con->unselectAttributeCarrier(); + } + if (con->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + con->getTagStr() + " '" + con->getID() + "' in removeConnection()"); + delete con; + // actually we only do this to force a redraw + updateGeometry(); + } + } +} + + +GNEConnection* +GNEEdge::retrieveGNEConnection(int fromLane, NBEdge* to, int toLane, bool createIfNoExist) { + for (auto i : myGNEConnections) { + if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) { + return i; + } + } + if (createIfNoExist) { + // create new connection. Will be added to the rTree on first geometry computation + GNEConnection* createdConnection = new GNEConnection(myLanes[fromLane], myNet->retrieveEdge(to->getID())->getLanes()[toLane]); + // show extra information for tests + WRITE_DEBUG("Created " + createdConnection->getTagStr() + " '" + createdConnection->getID() + "' in retrieveGNEConnection()"); + // iterate over all additionals from "from" lane and check E2 multilane integrity + for (auto i : createdConnection->getLaneFrom()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + // iterate over all additionals from "to" lane and check E2 multilane integrity + for (auto i : createdConnection->getLaneTo()->getChildAdditionals()) { + if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + dynamic_cast(i)->checkE2MultilaneIntegrity(); + } + } + // add it into network + myNet->addGLObjectIntoGrid(createdConnection); + return createdConnection; + } else { + return nullptr; + } +} + + + +void +GNEEdge::setMicrosimID(const std::string& newID) { + GUIGlObject::setMicrosimID(newID); + for (auto i : myLanes) { + i->setMicrosimID(getNBEdge()->getLaneID(i->getIndex())); + } +} + + +bool +GNEEdge::hasRestrictedLane(SUMOVehicleClass vclass) const { + for (auto i : myLanes) { + if (i->isRestricted(vclass)) { + return true; + } + } + return false; +} + + +void +GNEEdge::removeEdgeFromCrossings(GNEJunction* junction, GNEUndoList* undoList) { + // Remove all crossings that contain this edge in parameter "edges" + for (GNECrossing* const i : junction->getGNECrossings()) { + if (i->checkEdgeBelong(this)) { + myNet->deleteCrossing(i, undoList); + } + } +} + + +void +GNEEdge::straightenElevation(GNEUndoList* undoList) { + PositionVector modifiedShape = myNBEdge->getGeometry().interpolateZ( + myNBEdge->getFromNode()->getPosition().z(), + myNBEdge->getToNode()->getPosition().z()); + PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); + setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); +} + + +PositionVector +GNEEdge::smoothShape(const PositionVector& old, bool forElevation) { + const OptionsCont& oc = OptionsCont::getOptions(); + // distinguish 3 cases: + // a) if the edge has exactly 3 or 4 points, use these as control points + // b) if the edge has more than 4 points, use the first 2 and the last 2 as control points + // c) if the edge is straight and both nodes are geometry-like nodes, use geometry of the continuation edges as control points + PositionVector init; +#ifdef DEBUG_SMOOTH_GEOM + if (DEBUGCOND(this)) std::cout << getID() + << " forElevation=" << forElevation + << " fromGeometryLike=" << myNBEdge->getFromNode()->geometryLike() + << " toGeometryLike=" << myNBEdge->getToNode()->geometryLike() + << " smoothShape old=" << old << "\n"; +#endif + if (old.size() == 3 || old.size() == 4) { + init = old; + } else if (old.size() > 4 && !forElevation) { + // for elevation, the initial segments are not useful + init.push_back(old[0]); + init.push_back(old[1]); + init.push_back(old[-2]); + init.push_back(old[-1]); + } else if (myNBEdge->getFromNode()->geometryLike() && myNBEdge->getToNode()->geometryLike()) { + PositionVector begShape; + PositionVector endShape; + const EdgeVector& incoming = myNBEdge->getFromNode()->getIncomingEdges(); + const EdgeVector& outgoing = myNBEdge->getToNode()->getOutgoingEdges(); + if (incoming.size() == 1) { + begShape = incoming[0]->getGeometry(); + } else { + assert(incoming.size() == 2); + begShape = myNBEdge->isTurningDirectionAt(incoming[0]) ? incoming[1]->getGeometry() : incoming[0]->getGeometry(); + } + if (outgoing.size() == 1) { + endShape = outgoing[0]->getGeometry(); + } else { + assert(outgoing.size() == 2); + endShape = myNBEdge->isTurningDirectionAt(outgoing[0]) ? outgoing[1]->getGeometry() : outgoing[0]->getGeometry(); + } + const double dist = MIN2(old.length2D(), MAX2(old.length2D() / 8, fabs(old[0].z() - old[-1].z()) * OptionsCont::getOptions().getFloat("geometry.max-grade") / 3)); + if (forElevation) { + // initialize control point elevation for smooth continuation + init.push_back(old[0]); + init.push_back(old.positionAtOffset2D(dist)); + init.push_back(old.positionAtOffset2D(old.length2D() - dist)); + init.push_back(old[-1]); + double begZ = begShape.positionAtOffset2D(MAX2(0.0, begShape.length2D() - dist)).z(); + double endZ = endShape.positionAtOffset2D(MIN2(begShape.length2D(), dist)).z(); + // continue incline + init[1].setz(2 * init[0].z() - begZ); + init[2].setz(2 * init[-1].z() - endZ); + } else { + bool ok = true; + const double straightThresh = DEG2RAD(oc.getFloat("opendrive-output.straight-threshold")); + init = NBNode::bezierControlPoints(begShape, endShape, false, dist, dist, ok, nullptr, straightThresh); + } +#ifdef DEBUG_SMOOTH_GEOM + if (DEBUGCOND(this)) { + std::cout << " begShape=" << begShape << " endShape=" << endShape << " forElevation=" << forElevation << " dist=" << dist << " ok=" << ok << " init=" << init << "\n"; + } +#endif + } + if (init.size() == 0) { + return PositionVector::EMPTY; + } else { + const int numPoints = MAX2(oc.getInt("junctions.internal-link-detail"), + int(old.length2D() / oc.getFloat("opendrive.curve-resolution"))); + return init.bezier(numPoints); + } +} + + +void +GNEEdge::smooth(GNEUndoList* undoList) { + PositionVector modifiedShape = smoothShape(myNBEdge->getGeometry(), false); + if (modifiedShape.size() < 2) { + WRITE_WARNING("Could not compute smooth shape for edge '" + getID() + "'"); + } else { + PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); + setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); + } +} + + +void +GNEEdge::smoothElevation(GNEUndoList* undoList) { + PositionVector elevationBase; + for (const Position& pos : myNBEdge->getGeometry()) { + if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) { + elevationBase.push_back(pos); + } + } + PositionVector elevation = smoothShape(elevationBase, true); + if (elevation.size() <= 2) { + WRITE_WARNING("Could not compute smooth elevation for edge '" + getID() + "'"); + } else { + PositionVector modifiedShape = myNBEdge->getGeometry(); + if (modifiedShape.size() < 5) { + modifiedShape = modifiedShape.resample(OptionsCont::getOptions().getFloat("opendrive.curve-resolution")); + } + const double scale = elevation.length2D() / modifiedShape.length2D(); + //std::cout << " elevation=" << elevation << "\n mod1=" << modifiedShape << " scale=" << scale << "\n"; + double seen = 0; + for (int i = 1; i < (int)modifiedShape.size(); ++i) { + seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]); + modifiedShape[i].setz(elevation.positionAtOffset2D(seen * scale).z()); + } + //std::cout << " mod2=" << modifiedShape << "\n"; + PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); + setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); + } +} + + +void +GNEEdge::setShapeStartPos(const Position& pos) { + // remove start position and add it the new position + PositionVector geom = myNBEdge->getGeometry(); + geom.pop_front(); + geom.push_front(pos); + // restore modified shape + setGeometry(geom, false); +} + + +void +GNEEdge::setShapeEndPos(const Position& pos) { + // remove end position and add it the new position + PositionVector geom = myNBEdge->getGeometry(); + geom.pop_back(); + geom.push_back(pos); + // restore modified shape + setGeometry(geom, false); +} + + +const std::map > +GNEEdge::getVehiclesOverEdgeMap() const { + // declare vehicles over edge vector + std::vector vehiclesOverEdge; + // declare solution map + std::map > vehiclesOverEdgeMap; + // declare a set of vehicles (to avoid duplicates) + std::set > vehicles; + // first obtain all vehicles of this edge + for (const auto& edgeChild : getChildDemandElements()) { + if (((edgeChild->getTagProperty().getTag() == SUMO_TAG_TRIP) || (edgeChild->getTagProperty().getTag() == SUMO_TAG_FLOW)) && + (edgeChild->getParentEdges().front() == this)) { + vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild)); + vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild)); + } else if ((edgeChild->getTagProperty().getTag() == SUMO_TAG_ROUTE) && (edgeChild->getParentEdges().front() == this)) { + for (const auto& routeChild : edgeChild->getChildDemandElements()) { + if ((routeChild->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (routeChild->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { + vehicles.insert(std::make_pair(routeChild->getAttributeDouble(SUMO_ATTR_DEPART), routeChild)); + } + } + } else if ((edgeChild->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE) && (edgeChild->getParentEdges().front() == this)) { + vehicles.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild->getParentDemandElements().front())); + } + } + // reserve + vehiclesOverEdge.reserve(vehicles.size()); + // iterate over vehicles + for (const auto& vehicle : vehicles) { + // add it over vehiclesOverEdge; + vehiclesOverEdge.push_back(vehicle.second); + } + // now split vehicles by lanes + for (const auto& vehicle : vehiclesOverEdge) { + const GNELane* vehicleLane = vehicle->getFirstAllowedVehicleLane(); + if (vehicleLane) { + vehiclesOverEdgeMap[vehicleLane].push_back(vehicle); + } + } + return vehiclesOverEdgeMap; +} + + +void +GNEEdge::drawGeometryPoints(const GUIVisualizationSettings& s) const { + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, this); + // obtain circle width + bool drawBig = (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE || + myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_DELETE); + double circleWidth = drawBig ? SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration) : 0.5; + double circleWidthSquared = circleWidth * circleWidth; + // obtain color + RGBColor color = s.junctionColorer.getSchemes()[0].getColor(2); + if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { + // override with special colors (unless the color scheme is based on selection) + color = s.colorSettings.selectedEdgeColor.changedBrightness(-20); + } + GLHelper::setColor(color); + // recognize full transparency and simply don't draw + if (color.alpha() > 0) { + // push name + glPushName(getGlID()); + // draw geometry points expect initial and final + for (int i = 1; i < (int)myNBEdge->getGeometry().size() - 1; i++) { + Position pos = myNBEdge->getGeometry()[i]; + if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(pos) <= (circleWidthSquared + 2))) { + glPushMatrix(); + glTranslated(pos.x(), pos.y(), GLO_JUNCTION - 0.01); + // resolution of drawn circle depending of the zoom (To improve smothness) + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + glPopMatrix(); + // draw elevation or special symbols (Start, End and Block) + if (!s.drawForRectangleSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { + glPushMatrix(); + // Translate to geometry point + glTranslated(pos.x(), pos.y(), GLO_JUNCTION); + // draw Z value + GLHelper::drawText(toString(pos.z()), Position(), GLO_MAX - 5, s.edgeValue.scaledSize(s.scale) / 2, s.edgeValue.color); + glPopMatrix(); + } + } + } + // draw line geometry, start and end points if shapeStart or shape end is edited, and depending of drawForRectangleSelection + if (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_MOVE) { + if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) && + (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().front()) <= (circleWidthSquared + 2)))) { + glPushMatrix(); + glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.01); + // resolution of drawn circle depending of the zoom (To improve smothness) + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + glPopMatrix(); + // draw a "s" over last point depending of drawForRectangleSelection + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { + glPushMatrix(); + glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.02); + GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE); + glPopMatrix(); + // draw line between Junction and point + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION - 0.01); + glLineWidth(4); + GLHelper::drawLine(myNBEdge->getGeometry().front(), myGNEJunctionSource->getPositionInView()); + // draw line between begin point of last lane shape and the first edge shape point + GLHelper::drawLine(myNBEdge->getGeometry().front(), myNBEdge->getLanes().back().shape.front()); + glPopMatrix(); + } + } + if ((myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) && + (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().back()) <= (circleWidthSquared + 2)))) { + glPushMatrix(); + glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.01); + // resolution of drawn circle depending of the zoom (To improve smothness) + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + glPopMatrix(); + // draw a "e" over last point depending of drawForRectangleSelection + if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { + glPushMatrix(); + glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.02); + GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE); + glPopMatrix(); + // draw line between Junction and point + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION - 0.01); + glLineWidth(4); + GLHelper::drawLine(myNBEdge->getGeometry().back(), myGNEJunctionDestiny->getPositionInView()); + // draw line between last point of first lane shape and the last edge shape point + GLHelper::drawLine(myNBEdge->getGeometry().back(), myNBEdge->getLanes().back().shape.back()); + glPopMatrix(); + } + } + } + // pop name + glPopName(); + } +} + + +void +GNEEdge::drawEdgeName(const GUIVisualizationSettings& s) const { + // draw the name and/or the street name + const bool drawStreetName = s.streetName.show && (myNBEdge->getStreetName() != ""); + const bool spreadSuperposed = s.spreadSuperposed && myLanes.back()->drawAsRailway(s) && myNBEdge->isBidiRail(); + if (s.edgeName.show || drawStreetName || s.edgeValue.show) { + glPushName(getGlID()); + GNELane* lane1 = myLanes[0]; + GNELane* lane2 = myLanes[myLanes.size() - 1]; + Position p = lane1->getLaneShape().positionAtOffset(lane1->getLaneShape().length() / (double) 2.); + p.add(lane2->getLaneShape().positionAtOffset(lane2->getLaneShape().length() / (double) 2.)); + p.mul(.5); + if (spreadSuperposed) { + // move name to the right of the edge and towards its beginning + const double dist = 0.6 * s.edgeName.scaledSize(s.scale); + const double shiftA = lane1->getLaneShape().rotationAtOffset(lane1->getLaneShape().length() / (double) 2.) - DEG2RAD(135); + Position shift(dist * cos(shiftA), dist * sin(shiftA)); + p.add(shift); + } + double angle = lane1->getLaneShape().rotationDegreeAtOffset(lane1->getLaneShape().length() / (double) 2.); + angle += 90; + if (angle > 90 && angle < 270) { + angle -= 180; + } + if (s.edgeName.show) { + drawName(p, s.scale, s.edgeName, angle); + } + if (drawStreetName) { + GLHelper::drawTextSettings(s.streetName, myNBEdge->getStreetName(), p, s.scale, angle); + } + if (s.edgeValue.show) { + const int activeScheme = s.laneColorer.getActive(); + std::string value; + if (activeScheme == 12) { + // edge param, could be non-numerical + value = getNBEdge()->getParameter(s.edgeParam, ""); + } else if (activeScheme == 13) { + // lane param, could be non-numerical + value = getNBEdge()->getLaneStruct(lane2->getIndex()).getParameter(s.laneParam, ""); + } else { + // use numerical value value of leftmost lane to hopefully avoid sidewalks, bikelanes etc + const double doubleValue = lane2->getColorValue(s, activeScheme); + const RGBColor color = s.laneColorer.getScheme().getColor(doubleValue); + value = color.alpha() == 0 ? "" : toString(doubleValue); + } + if (value != "") { + GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, angle); + } + } + glPopName(); + } +} + + +void +GNEEdge::drawRerouterSymbol(const GUIVisualizationSettings& s, GNEAdditional* rerouter) const { + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, rerouter); + // first check if additional has to be drawn + if (s.drawAdditionals(exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // Start drawing adding an gl identificator + glPushName(rerouter->getGlID()); + // draw rerouter symbol over all lanes + for (const auto& j : myLanes) { + const Position& lanePos = rerouter->getChildPosition(j); + const double laneRot = rerouter->getChildRotation(j); + // draw rerouter symbol + glPushMatrix(); + glTranslated(lanePos.x(), lanePos.y(), rerouter->getType()); + glRotated(-1 * laneRot, 0, 0, 1); + glScaled(exaggeration, exaggeration, 1); + // mode + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + 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); + glEnd(); + // draw "U" + if (!s.drawForRectangleSelection) { + GLHelper::drawText("U", Position(0, 2), .1, 3, RGBColor::BLACK, 180); + double probability = parse(rerouter->getAttribute(SUMO_ATTR_PROB)) * 100; + // draw Probability + GLHelper::drawText((toString(probability) + "%").c_str(), Position(0, 4), .1, 0.7, RGBColor::BLACK, 180); + } + // finish draw + glPopMatrix(); + // draw contour if is selected + if (myNet->getViewNet()->getDottedAC() == rerouter) { + GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.8, 6, -1 * laneRot, 0, 3); + } + } + // Pop name + glPopName(); + // Draw connections + rerouter->drawChildConnections(s, getType()); + } +} + + +void +GNEEdge::drawDemandElements(const GUIVisualizationSettings& s) const { + // certain demand elements children can contain loops (for example, routes) and it causes overlapping problems. It's needed to filter it before drawing + if (s.drawForPositionSelection) { + // draw routes + for (const auto& route : getChildDemandElementsByType(SUMO_TAG_ROUTE)) { + // first check if route can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { + // draw partial route + drawPartialRoute(s, route, nullptr); + } + } + // draw embedded routes + for (const auto& embeddedRoute : getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE)) { + // first check if embedded route can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { + // draw partial route + drawPartialRoute(s, embeddedRoute, nullptr); + } + } + } else { + // if drawForPositionSelection is disabled, only draw the first element + if (getChildDemandElementsByType(SUMO_TAG_ROUTE).size() > 0) { + const auto& route = getChildDemandElementsByType(SUMO_TAG_ROUTE).front(); + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { + drawPartialRoute(s, route, nullptr); + } + } + if (getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).size() > 0) { + const auto& embeddedRoute = getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).front(); + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { + drawPartialRoute(s, embeddedRoute, nullptr); + } + } + } + // draw person plans + if (s.drawForPositionSelection) { + for (const auto& personTripFromTo : getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO)) { + drawPartialPersonPlan(s, personTripFromTo, nullptr); + } + for (const auto& personTripBusStop : getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP)) { + drawPartialPersonPlan(s, personTripBusStop, nullptr); + } + for (const auto& walkEdges : getChildDemandElementsByType(SUMO_TAG_WALK_EDGES)) { + drawPartialPersonPlan(s, walkEdges, nullptr); + } + for (const auto& walkFromTo : getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO)) { + drawPartialPersonPlan(s, walkFromTo, nullptr); + } + for (const auto& walkBusStop : getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP)) { + drawPartialPersonPlan(s, walkBusStop, nullptr); + } + for (const auto& walkRoute : getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE)) { + drawPartialPersonPlan(s, walkRoute, nullptr); + } + for (const auto& rideFromTo : getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO)) { + drawPartialPersonPlan(s, rideFromTo, nullptr); + } + for (const auto& rideBusStop : getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP)) { + drawPartialPersonPlan(s, rideBusStop, nullptr); + } + } else { + // if drawForPositionSelection is disabled, only draw the first element + if (getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).front(), nullptr); + } + if (getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).size() > 0) { + drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).front(), nullptr); + } + } + // draw path element childs + for (const auto& elementChild : myPathDemandElementsElementChilds) { + if (elementChild->getTagProperty().isVehicle()) { + // draw partial trip only if is being inspected or selected (and we aren't in draw for selecting mode) + if (!s.drawForRectangleSelection && ((myNet->getViewNet()->getDottedAC() == elementChild) || elementChild->isAttributeCarrierSelected())) { + drawPartialTripFromTo(s, elementChild, nullptr); + } + } else if (elementChild->getTagProperty().isPersonPlan()) { + drawPartialPersonPlan(s, elementChild, nullptr); + } + } +} + + +bool +GNEEdge::areStackPositionOverlapped(const GNEEdge::StackPosition& vehicleA, const GNEEdge::StackPosition& vehicleB) const { + if ((vehicleA.beginPosition() == vehicleB.beginPosition()) && (vehicleA.endPosition() == vehicleB.endPosition())) { + return true; + } else if ((vehicleA.beginPosition() < vehicleB.beginPosition()) && (vehicleA.endPosition() > vehicleB.endPosition())) { + return true; + } else if ((vehicleA.beginPosition() < vehicleB.beginPosition()) && (vehicleA.endPosition() > vehicleB.beginPosition())) { + return true; + } else if ((vehicleA.beginPosition() < vehicleB.endPosition()) && (vehicleA.endPosition() > vehicleB.endPosition())) { + return true; + } else { + return false; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEEdge.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEEdge.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEEdge.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,448 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdge.h +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A road/street connecting two junctions (netedit-version, adapted from GUIEdge) +// Basically a container for an NBEdge with drawing and editing capabilities +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" + +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNENet; +class GNEJunction; +class GNELane; +class GNEConnection; +class GNERouteProbe; +class GNECrossing; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEEdge + * @brief A road/street connecting two junctions (netedit-version) + * + * @see MSEdge + */ +class GNEEdge : public GNENetworkElement, protected GNEMoveShape { + + /// @brief Friend class + friend class GNEChange_Lane; + friend class GNEChange_Connection; + +public: + /// @brief Definition of the lane's vector + typedef std::vector LaneVector; + + /// @brief Definition of the connection's vector + typedef std::vector ConnectionVector; + + /**@brief Constructor + * @param[in] net The net to inform about gui updates + * @param[in] nbe The represented edge + * @param[in] loaded Whether the edge was loaded from a file + */ + GNEEdge(GNENet* net, NBEdge* nbe, bool wasSplit = false, bool loaded = false); + + /// @brief Destructor. + ~GNEEdge(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of hierarchical element in view + Position getPositionInView() const; + /// @} + + /// @name functions for edit start and end shape positions + /// @{ + /// @brief return true if user clicked over ShapeStart + bool clickedOverShapeStart(const Position& pos); + + /// @brief return true if user clicked over ShapeEnd + bool clickedOverShapeEnd(const Position& pos); + + /// @brief start move shape begin + void startShapeBegin(); + + /// @brief start move shape begin + void startShapeEnd(); + + /// @brief move position of shape start without commiting change + void moveShapeBegin(const Position& offset); + + /// @brief move position of shape end without commiting change + void moveShapeEnd(const Position& offset); + + /// @brief commit position changing in shape start + void commitShapeChangeBegin(GNEUndoList* undoList); + + /// @brief commit position changing in shape end + void commitShapeChangeEnd(GNEUndoList* undoList); + /// @} + + /// @name functions for edit geometry + /// @{ + /**@brief return index of geometry point placed in given position, or -1 if no exist + * @param pos position of new/existent vertex + * @param snapToGrid enable or disable snapToActiveGrid + * @return index of position vector + */ + int getEdgeVertexIndex(Position pos, const bool snapToGrid) const; + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startEdgeGeometryMoving(const double shapeOffset, const bool invertOffset); + + /**@brief move shape + * @param[in] offset the offset of movement + * @note always call before startEdgeGeometryMoving() and after endEdgeGeometryMoving() + */ + void moveEdgeShape(const Position& offset); + + /// @brief end movement + void endEdgeGeometryMoving(); + + /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) + * @param[in] undoList The undoList on which to register changes + */ + void commitEdgeShapeChange(GNEUndoList* undoList); + + /// @} + + /// @brief delete the geometry point closest to the given pos + void deleteEdgeGeometryPoint(const Position& pos, bool allowUndo = true); + + /// @brief update edge geometry after junction move + void updateJunctionPosition(GNEJunction* junction, const Position& origPos); + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * + * @return The boundary the object is within + * @see GUIGlObject::getCenteringBoundary + */ + Boundary getCenteringBoundary() const; + + /// @brief Returns the street name + const std::string getOptionalName() const; + + /**@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; + /// @} + + /// @brief returns the internal NBEdge + NBEdge* getNBEdge() const; + + /// @brief returns the source-junction + GNEJunction* getGNEJunctionSource() const; + + /// @brief returns the destination-junction + GNEJunction* getGNEJunctionDestiny() const; + + /// @brief get opposite edge + GNEEdge* getOppositeEdge() const; + + /// @brief makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint + void editEndpoint(Position pos, GNEUndoList* undoList); + + /// @brief restores the endpoint to the junction position at the appropriate end + void resetEndpoint(const Position& pos, GNEUndoList* undoList); + + /// @name 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; + std::string getAttributeForSelection(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 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 check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + + /// @brief set responsibility for deleting internal strctures + void setResponsible(bool newVal); + + /**@brief update edge geometry and inform the lanes + * @param[in] geom The new geometry + * @param[in] inner Whether geom is only the inner points + */ + void setGeometry(PositionVector geom, bool inner); + + /// @brief get front up shape position + const Position getFrontUpShapePosition() const; + + /// @brief get front down shape position + const Position getFrontDownShapePosition() const; + + /// @brief get back up shape position + const Position getBackUpShapePosition() const; + + /// @brief get back down shape position + const Position getBackDownShapePosition() const; + + /// @brief remake connections + void remakeGNEConnections(); + + /// @brief copy edge attributes from tpl + void copyTemplate(GNEEdge* tpl, GNEUndoList* undolist); + + /// @brief returns GLIDs of all lanes + std::set getLaneGlIDs() const; + + /// @brief returns a reference to the lane vector + const std::vector& getLanes() const; + + /// @brief returns a reference to the GNEConnection vector + const std::vector& getGNEConnections() const; + + /// @brief get GNEConnection if exist, and if not create it if create is enabled + GNEConnection* retrieveGNEConnection(int fromLane, NBEdge* to, int toLane, bool createIfNoExist = true); + + /// @brief whether this edge was created from a split + bool wasSplit(); + + /* @brief compute a splitting position which keeps the resulting edges + * straight unless the user clicked near a geometry point */ + Position getSplitPos(const Position& clickPos); + + /// @brief override to also set lane ids + void setMicrosimID(const std::string& newID); + + /// @brief check if edge has a restricted lane + bool hasRestrictedLane(SUMOVehicleClass vclass) const; + + // the radius in which to register clicks for geometry nodes + static const double SNAP_RADIUS; + + /// @brief clear current connections + void clearGNEConnections(); + + /// @brief obtain relative positions of RouteProbes + int getRouteProbeRelativePosition(GNERouteProbe* routeProbe) const; + + /// @brief get GNECrossings vinculated with this Edge + std::vector getGNECrossings(); + + /// @brief make geometry smooth + void smooth(GNEUndoList* undoList); + + /// @brief interpolate z values linear between junctions + void straightenElevation(GNEUndoList* undoList); + + /// @brief smooth elevation with regard to adjoining edges + void smoothElevation(GNEUndoList* undoList); + + /// @brief return smoothed shape + PositionVector smoothShape(const PositionVector& shape, bool forElevation); + + /// @brief return the first lane that allow a vehicle of type vClass (or the first lane, if none was found) + GNELane* getLaneByAllowedVClass(const SUMOVehicleClass vClass) const; + + /// @brief return the first lane that disallow a vehicle of type vClass (or the first lane, if none was found) + GNELane* getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const; + + /// @brief draw partial route + void drawPartialRoute(const GUIVisualizationSettings& s, const GNEDemandElement* route, const GNEJunction* junction) const; + + /// @brief draw partial trip and Flow + void drawPartialTripFromTo(const GUIVisualizationSettings& s, const GNEDemandElement* tripOrFromTo, const GNEJunction* junction) const; + + /// @brief draw partial person plan + void drawPartialPersonPlan(const GUIVisualizationSettings& s, const GNEDemandElement* personPlan, const GNEJunction* junction) const; + + /// @brief add path element (Only used by GNEHierarchicalParentElements::changeRouteEdges) + void addPathElement(GNEDemandElement* pathElementChild); + + /// @brief remove path element (Only used by GNEHierarchicalParentElements::changeRouteEdges) + void removePathElement(GNEDemandElement* pathElementChild); + + /// @brief invalidate path element childs + void invalidatePathChildElements(); + + // @brief update vehicle spread geometries + void updateVehicleSpreadGeometries(); + + // @brief update vehicle geometries + void updateVehicleStackLabels(); + + /// @brief update dotted contour (public due Generic datas) + void updateDottedContour(); + +protected: + /// @brief the underlying NBEdge + NBEdge* myNBEdge; + + /// @brief pointer to GNEJunction source + GNEJunction* myGNEJunctionSource; + + /// @brief pointer to GNEJunction destiny + GNEJunction* myGNEJunctionDestiny; + + /// @brief vector with the lanes of this edge + LaneVector myLanes; + + /// @brief vector with the connections of this edge + ConnectionVector myGNEConnections; + + /// @brief position used for move Lanes + Position myPositionBeforeMoving; + + /// @brief whether we are responsible for deleting myNBNode + bool myAmResponsible; + + /// @brief whether this edge was created from a split + bool myWasSplit; + + /// @brief modification status of the connections + std::string myConnectionStatus; + + /// @brief vector with references to path element childs + std::vector myPathDemandElementsElementChilds; + +private: + /// @brief Stack position (used to stack demand elements over edges) + class StackPosition : public std::tuple { + + public: + /// @brief constructor + StackPosition(const double departPos, const double length); + + /// @brief get begin position + double beginPosition() const; + + /// @brief get end position + double endPosition() const; + }; + + /// @brief Stack demand elements + class StackDemandElements : public std::tuple > { + + public: + /// @brief constructor + StackDemandElements(const StackPosition stackedPosition, GNEDemandElement* demandElement); + + /// @brief add demand elment to current StackDemandElements + void addDemandElements(GNEDemandElement* demandElement); + + /// @brief get stack position + const StackPosition& getStackPosition() const; + + /// @brief get demand elements + const std::vector& getDemandElements() const; + }; + + /// @brif flag to enable/disable update geomtetry of lanes (used mainly by setNumLanes) + bool myUpdateGeometry; + + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /**@brief changes the number of lanes. + * When reducing the number of lanes, higher-numbered lanes are removed first. + * When increasing the number of lanes, the last known attributes for a lane + * with this number are restored. If none are found the attributes for the + * leftmost lane are copied + */ + void setNumLanes(int numLanes, GNEUndoList* undoList); + + /// @brief@brief increase number of lanes by one use the given attributes and restore the GNELane + void addLane(GNELane* lane, const NBEdge::Lane& laneAttrs, bool recomputeConnections); + + /// @briefdecrease the number of lanes by one. argument is only used to increase robustness (assertions) + void removeLane(GNELane* lane, bool recomputeConnections); + + /// @brief adds a connection + void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation = false); + + /// @brief removes a connection + void removeConnection(NBEdge::Connection nbCon); + + /// @brief remove crossing of junction + void removeEdgeFromCrossings(GNEJunction* junction, GNEUndoList* undoList); + + /// @brief change Shape StartPos + void setShapeStartPos(const Position& pos); + + /// @brief change Shape EndPos + void setShapeEndPos(const Position& pos); + + /// @brief get vehicles a that start over this edge + const std::map > getVehiclesOverEdgeMap() const; + + /// @brief draw geometry points + void drawGeometryPoints(const GUIVisualizationSettings& s) const; + + /// @brief draw edge name + void drawEdgeName(const GUIVisualizationSettings& s) const; + + /// @brief draw Rerouter symbols + void drawRerouterSymbol(const GUIVisualizationSettings& s, GNEAdditional* rerouter) const; + + /// @brief draw demand elements + void drawDemandElements(const GUIVisualizationSettings& s) const; + + /// @brief check if given stacked positions are overlapped + bool areStackPositionOverlapped(const GNEEdge::StackPosition& vehicleA, const GNEEdge::StackPosition& vehicleB) const; + + /// @brief invalidated copy constructor + GNEEdge(const GNEEdge& s) = delete; + + /// @brief invalidated assignment operator + GNEEdge& operator=(const GNEEdge& s) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEInternalLane.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEInternalLane.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEInternalLane.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEInternalLane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,197 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEInternalLane.cpp +/// @author Jakob Erdmann +/// @date June 2011 +/// +// A class for visualizing Inner Lanes (used when editing traffic lights) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include + +#include "GNEInternalLane.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +/// @note: msvc10 does not approve of allocating empty arrays +/* +FXDEFMAP(GNEInternalLane) GNEInternalLaneMap[]= { + //FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_DURATION, GNETLSEditorFrame::onDefault), +}; +*/ + +// Object implementation +//FXIMPLEMENT(GNEInternalLane, FXDelegator, GNEInternalLaneMap, ARRAYNUMBER(GNEInternalLaneMap)) +FXIMPLEMENT(GNEInternalLane, FXDelegator, 0, 0) + +// =========================================================================== +// static member definitions +// =========================================================================== + +StringBijection::Entry GNEInternalLane::linkStateNamesValues[] = { + { "Green-Major", LINKSTATE_TL_GREEN_MAJOR }, + { "Green-Minor", LINKSTATE_TL_GREEN_MINOR }, + { "Yellow-Major", LINKSTATE_TL_YELLOW_MAJOR }, + { "Yellow-Minor", LINKSTATE_TL_YELLOW_MINOR }, + { "Red", LINKSTATE_TL_RED }, + { "Red-Yellow", LINKSTATE_TL_REDYELLOW }, + { "Stop", LINKSTATE_STOP }, + { "Off", LINKSTATE_TL_OFF_NOSIGNAL }, + { "Off-Blinking", LINKSTATE_TL_OFF_BLINKING }, +}; + +const StringBijection GNEInternalLane::LinkStateNames( + GNEInternalLane::linkStateNamesValues, LINKSTATE_TL_OFF_BLINKING); + +// =========================================================================== +// method definitions +// =========================================================================== +GNEInternalLane::GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state) : + GUIGlObject(editor == nullptr ? GLO_JUNCTION : GLO_TLLOGIC, id), + myState(state), + myStateTarget(myState), + myEditor(editor), + myTlIndex(tlIndex), + myPopup(nullptr) { + // calculate internal lane geometry + myInternalLaneGeometry.updateGeometry(shape); +} + + +GNEInternalLane::GNEInternalLane() : + GUIGlObject(GLO_TLLOGIC, "dummyInternalLane") { + assert(false); +} + + +GNEInternalLane::~GNEInternalLane() {} + + +long +GNEInternalLane::onDefault(FXObject* obj, FXSelector sel, void* data) { + if (myEditor != nullptr) { + FXuint before = myState; + myStateTarget.handle(obj, sel, data); + if (myState != before) { + myEditor->handleChange(this); + } + // let GUISUMOAbstractView know about clicks so that the popup is properly destroyed + if (FXSELTYPE(sel) == SEL_COMMAND) { + if (myPopup != nullptr) { + myPopup->getParentView()->destroyPopup(); + myPopup = nullptr; + } + } + } + return 1; +} + + +void +GNEInternalLane::drawGL(const GUIVisualizationSettings& s) const { + glPushMatrix(); + glPushName(getGlID()); + glTranslated(0, 0, GLO_JUNCTION + 0.1); // must draw on top of junction + GLHelper::setColor(colorForLinksState(myState)); + // draw lane + // check whether it is not too small + if (s.scale < 1.) { + GLHelper::drawLine(myInternalLaneGeometry.getShape()); + } else { + GNEGeometry::drawGeometry(myEditor->getViewNet(), myInternalLaneGeometry, 0.2); + } + glPopName(); + glPopMatrix(); +} + + +void +GNEInternalLane::setLinkState(LinkState state) { + myState = state; + myOrigState = state; +} + + +LinkState +GNEInternalLane::getLinkState() const { + return (LinkState)myState; +} + + +int +GNEInternalLane::getTLIndex() const { + return myTlIndex; +} + + +GUIGLObjectPopupMenu* +GNEInternalLane::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + myPopup = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(myPopup, app); + if ((myEditor != nullptr) && (myEditor->getViewNet()->getEditModes().isCurrentSupermodeNetwork())) { + const std::vector names = LinkStateNames.getStrings(); + for (std::vector::const_iterator it = names.begin(); it != names.end(); it++) { + FXuint state = LinkStateNames.get(*it); + std::string origHint = ((LinkState)state == myOrigState ? " (original)" : ""); + FXMenuRadio* mc = new FXMenuRadio(myPopup, (*it + origHint).c_str(), this, FXDataTarget::ID_OPTION + state); + mc->setSelBackColor(MFXUtils::getFXColor(colorForLinksState(state))); + mc->setBackColor(MFXUtils::getFXColor(colorForLinksState(state))); + } + } + return myPopup; +} + + +GUIParameterTableWindow* +GNEInternalLane::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { + // internal lanes don't have attributes + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); + // close building + ret->closeBuilding(); + return ret; +} + + +Boundary +GNEInternalLane::getCenteringBoundary() const { + Boundary b = myInternalLaneGeometry.getShape().getBoxBoundary(); + b.grow(10); + return b; +} + + +RGBColor +GNEInternalLane::colorForLinksState(FXuint state) { + if (state == LINKSTATE_TL_YELLOW_MINOR) { + // special case (default gui does not distinguish between yellow major/minor + return RGBColor(179, 179, 0, 255); + } else { + try { + return GUIVisualizationSettings::getLinkColor((LinkState)state); + } catch (ProcessError&) { + WRITE_WARNING("invalid link state='" + toString(state) + "'"); + return RGBColor::BLACK; + } + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEInternalLane.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEInternalLane.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEInternalLane.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEInternalLane.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,147 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEInternalLane.h +/// @author Jakob Erdmann +/// @date June 2011 +/// +// A class for visualizing Inner Lanes (used when editing traffic lights) +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GUIGLObjectPopupMenu; +class GNETLSEditorFrame; +class PositionVector; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEInternalLane + * @brief This object is responsible for drawing a shape and for supplying a + * a popup menu. Messages are routeted to an internal dataTarget and to the + * editor (hence inheritance from FXDelegator) + */ +class GNEInternalLane : public GUIGlObject, public FXDelegator { + /// @brief FOX-declaration + FXDECLARE(GNEInternalLane) + +public: + + /**@brief Constructor + * @param[in] editor The editor to notify about changes + * @param[in] id The id of this internal lane + * @param[in] shape The shape of the lane + * @param[in] tlIndex The tl-index of the lane + */ + GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND); + + /// @brief Destructor + virtual ~GNEInternalLane(); + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * + * @return The boundary the object is within + * @see GUIGlObject::getCenteringBoundary + */ + Boundary getCenteringBoundary() const; + + /**@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; + /// @} + + /// @brief set the linkState (controls drawing color) + void setLinkState(LinkState state); + + /// @brief whether link state has been modfied + LinkState getLinkState() const; + + /// @brief multiplexes message to two targets + long onDefault(FXObject*, FXSelector, void*); + + /// @brief get Traffic Light index + int getTLIndex() const; + + /// @brief long names for link states + static const StringBijection LinkStateNames; + + /// @brief return the color for each linkstate + static RGBColor colorForLinksState(FXuint state); + +protected: + /// @brief FOX needs this + GNEInternalLane(); + +private: + /// @brief internal lane geometry + GNEGeometry::Geometry myInternalLaneGeometry; + + /// @brief the state of the link (used for visualization) + FXuint myState; + FXDataTarget myStateTarget; + + /// @brief the original state of the link (used for tracking modification) + LinkState myOrigState; + + /// @brief data target for selection state + FXDataTarget stateTarget; + + /// @brief the editor to inform about changes + GNETLSEditorFrame* myEditor; + + /// @brief the tl-index of this lane + int myTlIndex; + + /// @brief the created popup + GUIGLObjectPopupMenu* myPopup; + + /// @brief linkstates names values + static StringBijection::Entry linkStateNamesValues[]; + +private: + /// @brief return the color for each linkstate + static const std::string& longNameForLinkState(FXuint state); + + /// @brief Invalidated copy constructor. + GNEInternalLane(const GNEInternalLane&); + + /// @brief Invalidated assignment operator. + GNEInternalLane& operator=(const GNEInternalLane&); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEJunction.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEJunction.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEJunction.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEJunction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1705 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEJunction.cpp +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A class for visualizing and editing junctions in netedit (adapted from +// GUIJunctionWrapper) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEEdge.h" +#include "GNELane.h" +#include "GNEConnection.h" +#include "GNEJunction.h" +#include "GNECrossing.h" + + +// =========================================================================== +// static members +// =========================================================================== + +const double GNEJunction::BUBBLE_RADIUS(4); + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEJunction::GNEJunction(GNENet* net, NBNode* nbn, bool loaded) : + GNENetworkElement(net, nbn->getID(), GLO_JUNCTION, SUMO_TAG_JUNCTION, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myNBNode(nbn), +myMaxSize(1), +myAmCreateEdgeSource(false), +myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED), +myAmResponsible(false), +myHasValidLogic(loaded), +myAmTLSSelected(false), +myColorForMissingConnections(false) { +} + + +GNEJunction::~GNEJunction() { + // delete all GNECrossing + for (const auto& crossing : myGNECrossings) { + crossing->decRef(); + if (crossing->unreferenced()) { + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + crossing->getTagStr() + " '" + crossing->getID() + "' in GNEJunction destructor"); + delete crossing; + } + } + + if (myAmResponsible) { + // show extra information for tests + WRITE_DEBUG("Deleting NBNode of '" + getID() + "' in GNEJunction destructor"); + delete myNBNode; + } +} + + +std::string +GNEJunction::generateChildID(SumoXMLTag childTag) { + int counter = 0; + while (myNet->retrieveJunction(getID() + toString(childTag) + toString(counter), false) != nullptr) { + counter++; + } + return (getID() + toString(childTag) + toString(counter)); +} + + +const PositionVector& +GNEJunction::getJunctionShape() const { + return myNBNode->getShape(); +} + + +void +GNEJunction::updateGeometry() { + updateGeometryAfterNetbuild(true); + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +void +GNEJunction::updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings) { + myMaxSize = MAX2(getCenteringBoundary().getWidth(), getCenteringBoundary().getHeight()); + rebuildGNECrossings(rebuildNBNodeCrossings); + checkMissingConnections(); + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +Position +GNEJunction::getPositionInView() const { + return myNBNode->getPosition(); +} + + +void +GNEJunction::rebuildGNECrossings(bool rebuildNBNodeCrossings) { + // rebuild GNECrossings only if create crossings and walkingAreas in net is enabled + if (myNet->getNetBuilder()->haveNetworkCrossings()) { + if (rebuildNBNodeCrossings) { + // build new NBNode::Crossings and walking areas + mirrorXLeftHand(); + myNBNode->buildCrossingsAndWalkingAreas(); + mirrorXLeftHand(); + } + // create a vector to keep retrieved and created crossings + std::vector retrievedCrossings; + // iterate over NBNode::Crossings of GNEJunction + for (const auto& crossing : myNBNode->getCrossingsIncludingInvalid()) { + // retrieve existent GNECrossing, or create it + GNECrossing* retrievedGNECrossing = retrieveGNECrossing(crossing.get()); + retrievedCrossings.push_back(retrievedGNECrossing); + // check if previously this GNECrossings exists, and if true, remove it from myGNECrossings and insert in tree again + std::vector::iterator retrievedExists = std::find(myGNECrossings.begin(), myGNECrossings.end(), retrievedGNECrossing); + if (retrievedExists != myGNECrossings.end()) { + myGNECrossings.erase(retrievedExists); + // update geometry of retrieved crossing + retrievedGNECrossing->updateGeometry(); + } else { + // include reference to created GNECrossing + retrievedGNECrossing->incRef(); + } + } + // delete non retrieved GNECrossings (we don't need to extract if from Tree two times) + for (const auto& crossing : myGNECrossings) { + crossing->decRef(); + // check if crossing is selected + if (crossing->isAttributeCarrierSelected()) { + crossing->unselectAttributeCarrier(); + } + if (crossing->unreferenced()) { + // remove it from net + myNet->removeGLObjectFromGrid(crossing); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + crossing->getTagStr() + " in rebuildGNECrossings()"); + delete crossing; + } + } + // copy retrieved (existent and created) GNECrossigns to myGNECrossings + myGNECrossings = retrievedCrossings; + } +} + +void +GNEJunction::mirrorXLeftHand() { + if (OptionsCont::getOptions().getBool("lefthand")) { + myNBNode->mirrorX(); + for (NBEdge* e : myNBNode->getEdges()) { + e->mirrorX(); + + } + } +} + + +GUIGLObjectPopupMenu* +GNEJunction::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + buildNameCopyPopupEntry(ret); + // build selection and show parameters menu + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + buildShowParamsPopupEntry(ret); + buildPositionCopyEntry(ret, false); + // check if we're in supermode network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + //if (parent.getVisualisationSettings()->editMode != GNE_MODE_CONNECT) { + // // XXX if joinable + // new FXMenuCommand(ret, "Join adjacent edges", 0, &parent, MID_GNE_JOIN_EDGES); + //} + const int numEndpoints = (int)myNBNode->getEndPoints().size(); + // check if we're handling a selection + bool handlingSelection = isAttributeCarrierSelected() && (myNet->retrieveJunctions(true).size() > 1); + // check if menu commands has to be disabled + const bool wrongMode = (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_CONNECT) || + (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_TLS) || + (myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_CREATE_EDGE); + // create menu commands + FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom junction shape", nullptr, &parent, MID_GNE_JUNCTION_EDIT_SHAPE); + FXMenuCommand* mcResetCustomShape = new FXMenuCommand(ret, "Reset junction shape", nullptr, &parent, MID_GNE_JUNCTION_RESET_SHAPE); + FXMenuCommand* mcReplace = new FXMenuCommand(ret, "Replace junction by geometry point", nullptr, &parent, MID_GNE_JUNCTION_REPLACE); + FXMenuCommand* mcSplit = new FXMenuCommand(ret, ("Split junction (" + toString(numEndpoints) + " end points)").c_str(), nullptr, &parent, MID_GNE_JUNCTION_SPLIT); + FXMenuCommand* mcSplitReconnect = new FXMenuCommand(ret, "Split junction and reconnect", nullptr, &parent, MID_GNE_JUNCTION_SPLIT_RECONNECT); + FXMenuCommand* mcClearConnections = new FXMenuCommand(ret, "Clear connections", nullptr, &parent, MID_GNE_JUNCTION_CLEAR_CONNECTIONS); + FXMenuCommand* mcResetConnections = new FXMenuCommand(ret, "Reset connections", nullptr, &parent, MID_GNE_JUNCTION_RESET_CONNECTIONS); + // check if current mode is correct + if (wrongMode) { + mcCustomShape->disable(); + mcClearConnections->disable(); + mcResetConnections->disable(); + } + // check if we're handling a selection + if (handlingSelection) { + mcResetCustomShape->setText("Reset junction shapes"); + } + // disable mcClearConnections if juction hasn't connections + if (getGNEConnections().empty()) { + mcClearConnections->disable(); + } + // disable mcResetCustomShape if junction doesn't have a custom shape + if (myNBNode->getShape().size() == 0) { + mcResetCustomShape->disable(); + } + // checkIsRemovable requiers turnarounds to be computed. This is ugly + if ((myNBNode->getIncomingEdges().size() == 2) && (myNBNode->getOutgoingEdges().size() == 2)) { + NBTurningDirectionsComputer::computeTurnDirectionsForNode(myNBNode, false); + } + std::string reason = "wrong edit mode"; + if (wrongMode || !myNBNode->checkIsRemovableReporting(reason)) { + mcReplace->setText(mcReplace->getText() + " (" + reason.c_str() + ")"); + mcReplace->disable(); + } + if (numEndpoints == 1) { + mcSplit->disable(); + mcSplitReconnect->disable(); + } + } + return ret; +} + + +Boundary +GNEJunction::getCenteringBoundary() const { + // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) + if (myMovingGeometryBoundary.isInitialised()) { + return myMovingGeometryBoundary; + } else if (myNBNode->getShape().size() > 0) { + Boundary b = myNBNode->getShape().getBoxBoundary(); + b.grow(10); + return b; + } else { + // calculate boundary using EXTENT as size + const double EXTENT = 2; + Boundary b(myNBNode->getPosition().x() - EXTENT, myNBNode->getPosition().y() - EXTENT, + myNBNode->getPosition().x() + EXTENT, myNBNode->getPosition().y() + EXTENT); + b.grow(10); + return b; + } +} + + +void +GNEJunction::drawGL(const GUIVisualizationSettings& s) const { + // check if boundary has to be drawn + if (s.drawBoundaries) { + GLHelper::drawBoundary(getCenteringBoundary()); + } + // declare variable for exaggeration + double junctionExaggeration = isAttributeCarrierSelected() ? s.selectionScale : 1; + junctionExaggeration *= s.junctionSize.getExaggeration(s, this, 4); + // only continue if exaggeration is greather than 0 + if (junctionExaggeration > 0) { + // declare values for circles + const double circleWidth = BUBBLE_RADIUS * junctionExaggeration; + const double circleWidthSquared = circleWidth * circleWidth; + // declare variable for mouse position + const Position mousePosition = myNet->getViewNet()->getPositionInformation(); + // push name + if (s.scale * junctionExaggeration * myMaxSize < 1.) { + // draw something simple so that selection still works + glPushName(getGlID()); + GLHelper::drawBoxLine(myNBNode->getPosition(), 0, 1, 1); + glPopName(); + } else { + // node shape has been computed and is valid for drawing + glPushName(getGlID()); + // declare flag for drawing junction shape + const bool drawShape = (myNBNode->getShape().size() > 0) && s.drawJunctionShape; + // declare flag for drawing junction as bubbles + bool drawBubble = (!drawShape || (myNBNode->getShape().area() < 4)) && s.drawJunctionShape; + // check if show junctions as bubbles checkbox is enabled + if (myNet->getViewNet()->showJunctionAsBubbles()) { + drawBubble = true; + } + // in supermode demand Bubble musn't be drawn + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeDemand()) { + drawBubble = false; + } + // check if shape has to be drawn + if (drawShape) { + // set shape color + RGBColor junctionShapeColor = setColor(s, false); + // recognize full transparency and simply don't draw + if (junctionShapeColor.alpha() != 0) { + glPushMatrix(); + glTranslated(0, 0, getType()); + // obtain junction Shape + PositionVector junctionShape = myNBNode->getShape(); + // close junction shape + junctionShape.closePolygon(); + // adjust shape to exaggeration + if (junctionExaggeration > 1) { + junctionShape.scaleRelative(junctionExaggeration); + } + // first check if inner junction polygon can be drawn + if (s.drawForPositionSelection) { + // only draw a point if mouse is around shape + if (junctionShape.around(mousePosition)) { + // push matrix + glPushMatrix(); + glTranslated(mousePosition.x(), mousePosition.y(), GLO_JUNCTION); + GLHelper::drawFilledCircle(1, s.getCircleResolution()); + glPopMatrix(); + } + } else if ((s.scale * junctionExaggeration * myMaxSize) < 40.) { + GLHelper::drawFilledPoly(junctionShape, true); + } else { + GLHelper::drawFilledPolyTesselated(junctionShape, true); + } + glPopMatrix(); + } + // draw edgeRelDatas + drawPathGenericDataElementChilds(s); + } + // check if bubble has to be drawn + if (drawBubble) { + // set bubble color + RGBColor bubbleColor = setColor(s, true); + // recognize full transparency and simply don't draw + if (bubbleColor.alpha() != 0) { + glPushMatrix(); + // move matrix to + glTranslated(myNBNode->getPosition().x(), myNBNode->getPosition().y(), getType() + 0.05); + // only draw filled circle if we aren't in draw for selecting mode, or if distance to center is enough) + if (!s.drawForPositionSelection || (mousePosition.distanceSquaredTo2D(myNBNode->getPosition()) <= (circleWidthSquared + 2))) { + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + } + glPopMatrix(); + } + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GNEGeometry::drawShapeDottedContour(s, getType(), junctionExaggeration, myDottedGeometry); + } + // draw TLS + drawTLSIcon(s); + // (optional) draw name @todo expose this setting if isn't drawed if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(myNBNode->getPosition(), s.scale, s.junctionID); + if (s.junctionName.show && myNBNode->getName() != "") { + GLHelper::drawTextSettings(s.junctionName, myNBNode->getName(), myNBNode->getPosition(), s.scale, s.angle); + } + } + // draw elevation + if (!s.drawForRectangleSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { + glPushMatrix(); + // Translate to center of junction + glTranslated(myNBNode->getPosition().x(), myNBNode->getPosition().y(), getType() + 1); + // draw Z value + GLHelper::drawText(toString(myNBNode->getPosition().z()), Position(), GLO_MAX - 5, s.junctionID.scaledSize(s.scale), s.junctionID.color); + glPopMatrix(); + } + // name must be removed from selection stack before drawing crossings + glPopName(); + // draw crossings only if junction isn't being moved + if (!myMovingGeometryBoundary.isInitialised()) { + for (const auto& i : myGNECrossings) { + i->drawGL(s); + } + } + // draw Junction childs + drawJunctionChilds(s); + } + } +} + + +NBNode* +GNEJunction::getNBNode() const { + return myNBNode; +} + + +std::vector +GNEJunction::getJunctionNeighbours() const { + // use set to avoid duplicates junctions + std::set junctions; + for (const auto& i : myGNEIncomingEdges) { + junctions.insert(i->getGNEJunctionSource()); + } + for (const auto& i : myGNEOutgoingEdges) { + junctions.insert(i->getGNEJunctionDestiny()); + } + return std::vector(junctions.begin(), junctions.end()); +} + + +void +GNEJunction::addIncomingGNEEdge(GNEEdge* edge) { + // Check if incoming edge was already inserted + std::vector::iterator i = std::find(myGNEIncomingEdges.begin(), myGNEIncomingEdges.end(), edge); + if (i != myGNEIncomingEdges.end()) { + throw InvalidArgument("Incoming " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' was already inserted into " + getTagStr() + " with ID " + getID() + "'"); + } else { + // Add edge into containers + myGNEIncomingEdges.push_back(edge); + myGNEEdges.push_back(edge); + } +} + + + +void +GNEJunction::addOutgoingGNEEdge(GNEEdge* edge) { + // Check if outgoing edge was already inserted + std::vector::iterator i = std::find(myGNEOutgoingEdges.begin(), myGNEOutgoingEdges.end(), edge); + if (i != myGNEOutgoingEdges.end()) { + throw InvalidArgument("Outgoing " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' was already inserted into " + getTagStr() + " with ID " + getID() + "'"); + } else { + // Add edge into containers + myGNEOutgoingEdges.push_back(edge); + myGNEEdges.push_back(edge); + } +} + + +void +GNEJunction::removeIncomingGNEEdge(GNEEdge* edge) { + // Check if incoming edge was already inserted + std::vector::iterator i = std::find(myGNEIncomingEdges.begin(), myGNEIncomingEdges.end(), edge); + if (i == myGNEIncomingEdges.end()) { + throw InvalidArgument("Incoming " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' doesn't found into " + getTagStr() + " with ID " + getID() + "'"); + } else { + // remove edge from containers + myGNEIncomingEdges.erase(i); + myGNEEdges.erase(std::find(myGNEEdges.begin(), myGNEEdges.end(), edge)); + } +} + + +void +GNEJunction::removeOutgoingGNEEdge(GNEEdge* edge) { + // Check if outgoing edge was already inserted + std::vector::iterator i = std::find(myGNEOutgoingEdges.begin(), myGNEOutgoingEdges.end(), edge); + if (i == myGNEOutgoingEdges.end()) { + throw InvalidArgument("Outgoing " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' doesn't found into " + getTagStr() + " with ID " + getID() + "'"); + } else { + // remove edge from containers + myGNEOutgoingEdges.erase(i); + myGNEEdges.erase(std::find(myGNEEdges.begin(), myGNEEdges.end(), edge)); + } +} + + +const std::vector& +GNEJunction::getGNEEdges() const { + return myGNEEdges; +} + + +const std::vector& +GNEJunction::getGNEIncomingEdges() const { + return myGNEIncomingEdges; +} + + +const std::vector& +GNEJunction::getGNEOutgoingEdges() const { + return myGNEOutgoingEdges; +} + + +const std::vector& +GNEJunction::getGNECrossings() const { + return myGNECrossings; +} + + +std::vector +GNEJunction::getGNEConnections() const { + std::vector connections; + for (const auto& i : myGNEIncomingEdges) { + for (const auto& j : i->getGNEConnections()) { + connections.push_back(j); + } + } + return connections; +} + + +void +GNEJunction::markAsCreateEdgeSource() { + myAmCreateEdgeSource = true; +} + + +void +GNEJunction::unMarkAsCreateEdgeSource() { + myAmCreateEdgeSource = false; +} + + +void +GNEJunction::selectTLS(bool selected) { + myAmTLSSelected = selected; +} + + +void +GNEJunction::startGeometryMoving(bool extendToNeighbors) { + // save current centering boundary + myMovingGeometryBoundary = getCenteringBoundary(); + // save position + myMovingPosition = myNBNode->getPosition(); + // First declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections + std::set affectedJunctions; + std::set affectedEdges; + // Iterate over GNEEdges + for (const auto& edge : myGNEEdges) { + // Add source and destiny junctions + affectedJunctions.insert(edge->getGNEJunctionSource()); + affectedJunctions.insert(edge->getGNEJunctionDestiny()); + // Obtain neighbors of Junction source + for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { + affectedEdges.insert(junctionSourceEdge); + } + // Obtain neighbors of Junction destiny + for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { + affectedEdges.insert(junctionDestinyEdge); + } + } + // Iterate over affected Junctions only if extendToNeighbors is enabled + if (extendToNeighbors) { + for (const auto& affectedJunction : affectedJunctions) { + // don't include this junction (to avoid start more than one times) + if (affectedJunction != this) { + // start geometry moving in edges + affectedJunction->startGeometryMoving(false); + } + } + } + // Iterate over affected Edges + for (const auto& edge : affectedEdges) { + // start geometry moving in edges + edge->startEdgeGeometryMoving(-1, false); + } +} + + +void +GNEJunction::endGeometryMoving(bool extendToNeighbors) { + // check that endGeometryMoving was called only once + if (myMovingGeometryBoundary.isInitialised()) { + // Remove object from net + myNet->removeGLObjectFromGrid(this); + // reset myMovingGeometryBoundary + myMovingGeometryBoundary.reset(); + // First declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections + std::set affectedJunctions; + std::set affectedEdges; + // Iterate over GNEEdges + for (const auto& edge : myGNEEdges) { + // Add source and destiny junctions + affectedJunctions.insert(edge->getGNEJunctionSource()); + affectedJunctions.insert(edge->getGNEJunctionDestiny()); + // Obtain neighbors of Junction source + for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { + affectedEdges.insert(junctionSourceEdge); + } + // Obtain neighbors of Junction destiny + for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { + affectedEdges.insert(junctionDestinyEdge); + } + } + // Iterate over affected Junctions + if (extendToNeighbors) { + for (const auto& junction : affectedJunctions) { + // don't include this junction (to avoid end it more than one times) + if (junction != this) { + // end geometry moving in edges + junction->endGeometryMoving(false); + } + } + } + // Iterate over affected Edges + for (const auto& affectedEdge : affectedEdges) { + // end geometry moving in edges + affectedEdge->endEdgeGeometryMoving(); + } + // add object into grid again (using the new centering boundary) + myNet->addGLObjectIntoGrid(this); + // update geometry of affected junctions + if (extendToNeighbors) { + for (const auto& junction : affectedJunctions) { + junction->updateGeometry(); + } + } + } +} + + +void +GNEJunction::moveGeometry(const Position& offset) { + // calculate new position + Position newPosition = myMovingPosition; + newPosition.add(offset); + // filtern position using snap to active grid + newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition, offset.z() == 0); + // move junction geometry without updating grid + moveJunctionGeometry(newPosition); +} + + +void +GNEJunction::commitGeometryMoving(GNEUndoList* undoList) { + // first end geometry point + endGeometryMoving(); + if (isValid(SUMO_ATTR_POSITION, toString(myNBNode->getPosition()))) { + undoList->p_begin("position of " + getTagStr()); + undoList->p_add(new GNEChange_Attribute(this, SUMO_ATTR_POSITION, toString(myNBNode->getPosition()), toString(myMovingPosition))); + undoList->p_end(); + } else { + // tried to set an invalid position, revert back to the previous one + moveJunctionGeometry(myMovingPosition); + } +} + + +void +GNEJunction::invalidateShape() { + if (!myNBNode->hasCustomShape()) { + if (myNBNode->myPoly.size() > 0) { + // write GL Debug + WRITE_GLDEBUG("<-- Invalidating shape of junction '" + getID() + "' -->"); + // remove Juntion from grid + myNet->removeGLObjectFromGrid(this); + // clear poly + myNBNode->myPoly.clear(); + // add Juntion into grid + myNet->addGLObjectIntoGrid(this); + } + myNet->requireRecompute(); + } +} + + +void +GNEJunction::setLogicValid(bool valid, GNEUndoList* undoList, const std::string& status) { + myHasValidLogic = valid; + if (!valid) { + assert(undoList != 0); + assert(undoList->hasCommandGroup()); + NBTurningDirectionsComputer::computeTurnDirectionsForNode(myNBNode, false); + EdgeVector incoming = myNBNode->getIncomingEdges(); + for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) { + GNEEdge* srcEdge = myNet->retrieveEdge((*it)->getID()); + removeConnectionsFrom(srcEdge, undoList, false); // false, because the whole tls will be invalidated at the end + undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, status), true); + } + undoList->add(new GNEChange_Attribute(this, GNE_ATTR_MODIFICATION_STATUS, status), true); + invalidateTLS(undoList); + } else { + // logic valed, then rebuild GNECrossings to adapt it to the new logic + // (but don't rebuild the crossings in NBNode because they are already finished) + rebuildGNECrossings(false); + } +} + + +void +GNEJunction::removeConnectionsFrom(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane) { + NBEdge* srcNBE = edge->getNBEdge(); + NBEdge* turnEdge = srcNBE->getTurnDestination(); + // Make a copy of connections + std::vector connections = srcNBE->getConnections(); + // delete in reverse so that undoing will add connections in the original order + for (std::vector::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) { + if (lane >= 0 && (*con_it).fromLane != lane) { + continue; + } + bool hasTurn = con_it->toEdge == turnEdge; + undoList->add(new GNEChange_Connection(edge, *con_it, false, false), true); + // needs to come after GNEChange_Connection + // XXX bug: this code path will not be used on a redo! + if (hasTurn) { + myNet->addExplicitTurnaround(srcNBE->getID()); + } + } + if (updateTLS) { + std::vector removeConnections; + for (NBEdge::Connection con : connections) { + removeConnections.push_back(NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane)); + } + removeTLSConnections(removeConnections, undoList); + } +} + + +void +GNEJunction::removeConnectionsTo(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane) { + NBEdge* destNBE = edge->getNBEdge(); + std::vector removeConnections; + for (NBEdge* srcNBE : myNBNode->getIncomingEdges()) { + GNEEdge* srcEdge = myNet->retrieveEdge(srcNBE->getID()); + std::vector connections = srcNBE->getConnections(); + for (std::vector::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) { + if ((*con_it).toEdge == destNBE) { + if (lane >= 0 && (*con_it).toLane != lane) { + continue; + } + bool hasTurn = srcNBE->getTurnDestination() == destNBE; + undoList->add(new GNEChange_Connection(srcEdge, *con_it, false, false), true); + // needs to come after GNEChange_Connection + // XXX bug: this code path will not be used on a redo! + if (hasTurn) { + myNet->addExplicitTurnaround(srcNBE->getID()); + } + removeConnections.push_back(NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane)); + } + } + } + if (updateTLS) { + removeTLSConnections(removeConnections, undoList); + } +} + + +void +GNEJunction::removeTLSConnections(std::vector& connections, GNEUndoList* undoList) { + if (connections.size() > 0) { + const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! + for (const auto& TLS : coypOfTls) { + NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); + // guessed TLS (NBOwnTLDef) do not need to be updated + if (tlDef != nullptr) { + std::string newID = tlDef->getID(); + // create replacement before deleting the original because deletion will mess up saving original nodes + NBLoadedSUMOTLDef* replacementDef = new NBLoadedSUMOTLDef(*tlDef, *tlDef->getLogic()); + for (NBConnection& con : connections) { + replacementDef->removeConnection(con); + } + undoList->add(new GNEChange_TLS(this, tlDef, false), true); + undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); + // the removed traffic light may have controlled more than one junction. These too have become invalid now + const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! + for (const auto& node : copyOfNodes) { + GNEJunction* sharing = myNet->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); + undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); + } + } + } + } +} + + +void +GNEJunction::replaceIncomingConnections(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList) { + // remap connections of the edge + assert(which->getLanes().size() == by->getLanes().size()); + std::vector connections = which->getNBEdge()->getConnections(); + for (NBEdge::Connection& c : connections) { + undoList->add(new GNEChange_Connection(which, c, false, false), true); + undoList->add(new GNEChange_Connection(by, c, false, true), true); + } + // also remap tls connections + const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! + for (const auto& TLS : coypOfTls) { + NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); + // guessed TLS (NBOwnTLDef) do not need to be updated + if (tlDef != nullptr) { + std::string newID = tlDef->getID(); + // create replacement before deleting the original because deletion will mess up saving original nodes + NBLoadedSUMOTLDef* replacementDef = new NBLoadedSUMOTLDef(*tlDef, *tlDef->getLogic()); + for (int i = 0; i < (int)which->getLanes().size(); ++i) { + replacementDef->replaceRemoved(which->getNBEdge(), i, by->getNBEdge(), i); + } + undoList->add(new GNEChange_TLS(this, tlDef, false), true); + undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); + // the removed traffic light may have controlled more than one junction. These too have become invalid now + const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! + for (const auto& node : copyOfNodes) { + GNEJunction* sharing = myNet->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); + undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); + } + } + } +} + + +void +GNEJunction::markAsModified(GNEUndoList* undoList) { + EdgeVector incoming = myNBNode->getIncomingEdges(); + for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) { + NBEdge* srcNBE = *it; + GNEEdge* srcEdge = myNet->retrieveEdge(srcNBE->getID()); + undoList->add(new GNEChange_Attribute(srcEdge, GNE_ATTR_MODIFICATION_STATUS, FEATURE_MODIFIED), true); + } +} + + +void +GNEJunction::invalidateTLS(GNEUndoList* undoList, const NBConnection& deletedConnection, const NBConnection& addedConnection) { + assert(undoList->hasCommandGroup()); + // NBLoadedSUMOTLDef becomes invalid, replace with NBOwnTLDef which will be dynamically recomputed + const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! + for (const auto& TLS : coypOfTls) { + NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); + if (tlDef != nullptr) { + NBTrafficLightDefinition* replacementDef = nullptr; + std::string newID = tlDef->getID(); // + "_reguessed"; // changes due to reguessing will be visible in diff + if (deletedConnection != NBConnection::InvalidConnection) { + // create replacement before deleting the original because deletion will mess up saving original nodes + NBLoadedSUMOTLDef* repl = new NBLoadedSUMOTLDef(*tlDef, *tlDef->getLogic()); + repl->removeConnection(deletedConnection); + replacementDef = repl; + } else if (addedConnection != NBConnection::InvalidConnection) { + if (addedConnection.getTLIndex() == NBConnection::InvalidTlIndex) { + // custom tl indices of crossings might become invalid upon recomputation so we must save them + // however, the could remain valud so we register a change but keep them at their old value + for (GNECrossing* c : myGNECrossings) { + const std::string oldValue = c->getAttribute(SUMO_ATTR_TLLINKINDEX); + undoList->add(new GNEChange_Attribute(c, SUMO_ATTR_TLLINKINDEX, toString(NBConnection::InvalidTlIndex)), true); + undoList->add(new GNEChange_Attribute(c, SUMO_ATTR_TLLINKINDEX, oldValue), true); + const std::string oldValue2 = c->getAttribute(SUMO_ATTR_TLLINKINDEX); + undoList->add(new GNEChange_Attribute(c, SUMO_ATTR_TLLINKINDEX2, toString(NBConnection::InvalidTlIndex)), true); + undoList->add(new GNEChange_Attribute(c, SUMO_ATTR_TLLINKINDEX2, oldValue2), true); + } + } + NBLoadedSUMOTLDef* repl = new NBLoadedSUMOTLDef(*tlDef, *tlDef->getLogic()); + repl->addConnection(addedConnection.getFrom(), addedConnection.getTo(), + addedConnection.getFromLane(), addedConnection.getToLane(), addedConnection.getTLIndex(), addedConnection.getTLIndex2()); + replacementDef = repl; + } else { + replacementDef = new NBOwnTLDef(newID, tlDef->getOffset(), tlDef->getType()); + replacementDef->setProgramID(tlDef->getProgramID()); + } + undoList->add(new GNEChange_TLS(this, tlDef, false), true); + undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); + // the removed traffic light may have controlled more than one junction. These too have become invalid now + const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! + for (const auto& node : copyOfNodes) { + GNEJunction* sharing = myNet->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); + undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); + } + } + } +} + +void +GNEJunction::removeEdgeFromCrossings(GNEEdge* edge, GNEUndoList* undoList) { + // obtain a copy of GNECrossing of junctions + auto copyOfGNECrossings = myGNECrossings; + // iterate over copy of GNECrossings + for (int i = 0; i < (int)myGNECrossings.size(); i++) { + auto c = myGNECrossings.at(i); + // obtain the set of edges vinculated with the crossing (due it works as ID) + EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end()); + // If this edge is part of the set of edges of crossing + if (edgeSet.count(edge->getNBEdge()) == 1) { + // delete crossing if this is their last edge + if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->getNBEdge())) { + myNet->deleteCrossing(c, undoList); + i = 0; + } else { + // remove this edge of the edge's attribute of crossing (note: This can invalidate the crossing) + std::vector edges = GNEAttributeCarrier::parse>(c->getAttribute(SUMO_ATTR_EDGES)); + edges.erase(std::find(edges.begin(), edges.end(), edge->getID())); + c->setAttribute(SUMO_ATTR_EDGES, joinToString(edges, " "), undoList); + } + } + } +} + + +bool +GNEJunction::isLogicValid() { + return myHasValidLogic; +} + + +GNECrossing* +GNEJunction::retrieveGNECrossing(NBNode::Crossing* NBNodeCrossing, bool createIfNoExist) { + // iterate over all crossing + for (const auto& crossing : myGNECrossings) { + // if found, return it + if (crossing->getCrossingEdges() == NBNodeCrossing->edges) { + return crossing; + } + } + if (createIfNoExist) { + // create new GNECrossing + GNECrossing* createdGNECrossing = new GNECrossing(this, NBNodeCrossing->edges); + // show extra information for tests + WRITE_DEBUG("Created " + createdGNECrossing->getTagStr() + " '" + createdGNECrossing->getID() + "' in retrieveGNECrossing()"); + // update geometry after creating + createdGNECrossing->updateGeometry(); + // add it in Network + myNet->addGLObjectIntoGrid(createdGNECrossing); + return createdGNECrossing; + } else { + return nullptr; + } +} + + +void +GNEJunction::markConnectionsDeprecated(bool includingNeighbours) { + // only it's needed to mark the connections of incoming edges + for (const auto& i : myGNEIncomingEdges) { + for (const auto& j : i->getGNEConnections()) { + j->markConnectionGeometryDeprecated(); + } + if (includingNeighbours) { + i->getGNEJunctionSource()->markConnectionsDeprecated(false); + } + } +} + + +std::string +GNEJunction::getAttribute(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_POSITION: + return toString(myNBNode->getPosition()); + case SUMO_ATTR_TYPE: + return toString(myNBNode->getType()); + case GNE_ATTR_MODIFICATION_STATUS: + return myLogicStatus; + case SUMO_ATTR_SHAPE: + return toString(myNBNode->getShape()); + case SUMO_ATTR_RADIUS: + return toString(myNBNode->getRadius()); + case SUMO_ATTR_TLTYPE: + if (isAttributeEnabled(SUMO_ATTR_TLTYPE)) { + // @todo this causes problems if the node were to have multiple programs of different type (plausible) + return toString((*myNBNode->getControllingTLS().begin())->getType()); + } else { + return "No TLS"; + } + case SUMO_ATTR_TLID: + if (isAttributeEnabled(SUMO_ATTR_TLID)) { + return toString((*myNBNode->getControllingTLS().begin())->getID()); + } else { + return "No TLS"; + } + case SUMO_ATTR_KEEP_CLEAR: + // keep clear is only used as a convenience feature in plain xml + // input. When saving to .net.xml the status is saved only for the connections + // to show the correct state we must check all connections + for (const auto& i : myGNEIncomingEdges) { + for (const auto& j : i->getGNEConnections()) { + if (j->getNBEdgeConnection().keepClear) { + return toString(true); + } + } + } + return toString(false); + case SUMO_ATTR_RIGHT_OF_WAY: + return SUMOXMLDefinitions::RightOfWayValues.getString(myNBNode->getRightOfWay()); + case SUMO_ATTR_FRINGE: + return SUMOXMLDefinitions::FringeTypeValues.getString(myNBNode->getFringeType()); + case SUMO_ATTR_NAME: + return myNBNode->getName(); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return myNBNode->getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEJunction::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: + case SUMO_ATTR_POSITION: + case GNE_ATTR_MODIFICATION_STATUS: + case SUMO_ATTR_SHAPE: + case SUMO_ATTR_RADIUS: + case SUMO_ATTR_RIGHT_OF_WAY: + case SUMO_ATTR_FRINGE: + case SUMO_ATTR_NAME: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + undoList->add(new GNEChange_Attribute(this, key, value), true); + break; + case SUMO_ATTR_KEEP_CLEAR: + // change Keep Clear attribute in all connections + undoList->p_begin("change keepClear for whole junction"); + for (const auto& i : myGNEIncomingEdges) { + for (const auto& j : i->getGNEConnections()) { + undoList->add(new GNEChange_Attribute(j, key, value), true); + } + } + undoList->p_end(); + break; + case SUMO_ATTR_TYPE: { + undoList->p_begin("change " + getTagStr() + " type"); + if (NBNode::isTrafficLight(SUMOXMLDefinitions::NodeTypes.get(value))) { + if (getNBNode()->isTLControlled() && + // if switching changing from or to traffic_light_right_on_red we need to remove the old plan + (getNBNode()->getType() == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED + || SUMOXMLDefinitions::NodeTypes.get(value) == SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) + ) { + // make a copy because we will modify the original + const std::set copyOfTls = myNBNode->getControllingTLS(); + for (const auto& TLS : copyOfTls) { + undoList->add(new GNEChange_TLS(this, TLS, false), true); + } + } + if (!getNBNode()->isTLControlled()) { + // create new traffic light + undoList->add(new GNEChange_TLS(this, nullptr, true), true); + } + } else if (getNBNode()->isTLControlled()) { + // delete old traffic light + // make a copy because we will modify the original + const std::set copyOfTls = myNBNode->getControllingTLS(); + for (const auto& TLS : copyOfTls) { + undoList->add(new GNEChange_TLS(this, TLS, false, false), true); + } + } + // must be the final step, otherwise we do not know which traffic lights to remove via GNEChange_TLS + undoList->add(new GNEChange_Attribute(this, key, value), true); + for (const auto& crossing : myGNECrossings) { + undoList->add(new GNEChange_Attribute(crossing, SUMO_ATTR_TLLINKINDEX, "-1"), true); + undoList->add(new GNEChange_Attribute(crossing, SUMO_ATTR_TLLINKINDEX2, "-1"), true); + } + undoList->p_end(); + break; + } + case SUMO_ATTR_TLTYPE: { + undoList->p_begin("change " + getTagStr() + " tl-type"); + // make a copy because we will modify the original + const std::set copyOfTls = myNBNode->getControllingTLS(); + for (const auto& TLS : copyOfTls) { + NBLoadedSUMOTLDef* oldLoaded = dynamic_cast(TLS); + if (oldLoaded != nullptr) { + NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*oldLoaded, *oldLoaded->getLogic()); + newDef->guessMinMaxDuration(); + std::vector nodes = TLS->getNodes(); + for (const auto& node : nodes) { + GNEJunction* junction = myNet->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(junction, TLS, false), true); + undoList->add(new GNEChange_TLS(junction, TLS, true), true); + } + } + } + undoList->add(new GNEChange_Attribute(this, key, value), true); + undoList->p_end(); + break; + } + case SUMO_ATTR_TLID: { + undoList->p_begin("change " + toString(SUMO_TAG_TRAFFIC_LIGHT) + " id"); + const std::set copyOfTls = myNBNode->getControllingTLS(); + assert(copyOfTls.size() > 0); + NBTrafficLightDefinition* currentTLS = *copyOfTls.begin(); + NBTrafficLightDefinition* currentTLSCopy = nullptr; + const bool currentIsSingle = currentTLS->getNodes().size() == 1; + const bool currentIsLoaded = dynamic_cast(currentTLS) != nullptr; + if (currentIsLoaded) { + currentTLSCopy = new NBLoadedSUMOTLDef(*currentTLS, + *dynamic_cast(currentTLS)->getLogic()); + } + // remove from previous tls + for (const auto& TLS : copyOfTls) { + undoList->add(new GNEChange_TLS(this, TLS, false), true); + } + NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); + // programs to which the current node shall be added + const std::map programs = tlCont.getPrograms(value); + if (programs.size() > 0) { + for (const auto& TLSProgram : programs) { + NBTrafficLightDefinition* oldTLS = TLSProgram.second; + if (dynamic_cast(oldTLS) != nullptr) { + undoList->add(new GNEChange_TLS(this, oldTLS, true), true); + } else { + // delete and re-create the definition because the loaded phases are now invalid + if (dynamic_cast(oldTLS) != nullptr && + dynamic_cast(oldTLS)->usingSignalGroups()) { + // keep the old program and add all-red state for the added links + NBLoadedSUMOTLDef* newTLSJoined = new NBLoadedSUMOTLDef(*oldTLS, *dynamic_cast(oldTLS)->getLogic()); + newTLSJoined->joinLogic(currentTLSCopy); + undoList->add(new GNEChange_TLS(this, newTLSJoined, true, true), true); + } else { + undoList->add(new GNEChange_TLS(this, nullptr, true, false, value), true); + } + NBTrafficLightDefinition* newTLS = *myNBNode->getControllingTLS().begin(); + // switch from old to new definition + std::vector copyOfNodes = oldTLS->getNodes(); + for (const auto& node : copyOfNodes) { + GNEJunction* oldJunction = myNet->retrieveJunction(node->getID()); + undoList->add(new GNEChange_TLS(oldJunction, oldTLS, false), true); + undoList->add(new GNEChange_TLS(oldJunction, newTLS, true), true); + } + } + } + } else { + if (currentIsSingle && currentIsLoaded) { + // rename the traffic light but keep everything else + NBTrafficLightLogic* renamedLogic = dynamic_cast(currentTLSCopy)->getLogic(); + renamedLogic->setID(value); + NBLoadedSUMOTLDef* renamedTLS = new NBLoadedSUMOTLDef(*currentTLSCopy, *renamedLogic); + renamedTLS->setID(value); + undoList->add(new GNEChange_TLS(this, renamedTLS, true, true), true); + } else { + // create new traffic light + undoList->add(new GNEChange_TLS(this, nullptr, true, false, value), true); + } + } + delete currentTLSCopy; + undoList->p_end(); + break; + } + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEJunction::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveJunction(value, false) == nullptr); + case SUMO_ATTR_TYPE: + return SUMOXMLDefinitions::NodeTypes.hasString(value); + case SUMO_ATTR_POSITION: + return canParse(value); + case SUMO_ATTR_SHAPE: + // empty shapes are allowed + return canParse(value); + case SUMO_ATTR_RADIUS: + return canParse(value) && (parse(value) >= -1); + case SUMO_ATTR_TLTYPE: + return myNBNode->isTLControlled() && SUMOXMLDefinitions::TrafficLightTypes.hasString(value); + case SUMO_ATTR_TLID: + return myNBNode->isTLControlled() && (value != ""); + case SUMO_ATTR_KEEP_CLEAR: + return canParse(value); + case SUMO_ATTR_RIGHT_OF_WAY: + return SUMOXMLDefinitions::RightOfWayValues.hasString(value); + case SUMO_ATTR_FRINGE: + return SUMOXMLDefinitions::FringeTypeValues.hasString(value); + case SUMO_ATTR_NAME: + return true; + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNEJunction::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_TLTYPE: + case SUMO_ATTR_TLID: + return myNBNode->isTLControlled(); + case SUMO_ATTR_KEEP_CLEAR: { + // check if at least there is an incoming connection + for (const auto& i : myGNEIncomingEdges) { + if (i->getGNEConnections().size() > 0) { + return true; + } + } + return false; + } + default: + return true; + } +} + + +void +GNEJunction::setResponsible(bool newVal) { + myAmResponsible = newVal; +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNEJunction::drawTLSIcon(const GUIVisualizationSettings& s) const { + // draw TLS icon if isn't being drawn for selecting + if ((myNet->getViewNet()->getEditModes().networkEditMode == NetworkEditMode::NETWORK_TLS) && + (myNBNode->isTLControlled()) && !myAmTLSSelected && !s.drawForRectangleSelection) { + glPushMatrix(); + Position pos = myNBNode->getPosition(); + glTranslated(pos.x(), pos.y(), getType() + 0.1); + glColor3d(1, 1, 1); + const double halfWidth = 32 / s.scale; + const double halfHeight = 64 / s.scale; + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_TLS), -halfWidth, -halfHeight, halfWidth, halfHeight); + glPopMatrix(); + } +} + + +void +GNEJunction::drawJunctionChilds(const GUIVisualizationSettings& s) const { + // draw connections and route elements connections (Only for incoming edges) + for (const auto& incomingEdge : myGNEIncomingEdges) { + // first draw connections + for (const auto& connection : incomingEdge->getGNEConnections()) { + connection->drawGL(s); + } + // then draw E2 multilane detectors + for (const auto& lane : incomingEdge->getLanes()) { + for (const auto& additional : lane->getChildAdditionals()) { + if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + lane->drawPartialE2DetectorPlan(s, additional, this); + } + } + } + // first check if Demand elements can be shown + if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements() && + myNet->getViewNet()->getDataViewOptions().showDemandElements()) { + // draw demand elements + drawDemandElements(s, incomingEdge); + } + } +} + + +void +GNEJunction::drawDemandElements(const GUIVisualizationSettings& s, const GNEEdge* edge) const { + // certain demand elements children can contain loops (for example, routes) and it causes overlapping problems. It's needed to filter it before drawing + if (s.drawForPositionSelection) { + for (const auto& route : edge->getChildDemandElementsByType(SUMO_TAG_ROUTE)) { + // first check if route can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { + // draw partial route + edge->drawPartialRoute(s, route, this); + } + } + for (const auto& embeddedRoute : edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE)) { + // first check if embedded route can be drawn + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { + // draw partial route + edge->drawPartialRoute(s, embeddedRoute, this); + } + } + } else { + // if drawForPositionSelection is disabled, only draw the first element + if (edge->getChildDemandElementsByType(SUMO_TAG_ROUTE).size() > 0) { + const auto& route = edge->getChildDemandElementsByType(SUMO_TAG_ROUTE).front(); + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { + edge->drawPartialRoute(s, route, this); + } + } + if (edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).size() > 0) { + const auto& embeddedRoute = edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).front(); + if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { + edge->drawPartialRoute(s, embeddedRoute, this); + } + } + } + for (const auto& trip : edge->getChildDemandElementsByType(SUMO_TAG_TRIP)) { + // Start drawing adding an gl identificator + glPushName(trip->getGlID()); + // draw partial trip only if is being inspected or selected + if ((myNet->getViewNet()->getDottedAC() == trip) || trip->isAttributeCarrierSelected()) { + edge->drawPartialTripFromTo(s, trip, this); + } + // only draw trip in the first edge + if (trip->getAttribute(SUMO_ATTR_FROM) == getID()) { + trip->drawGL(s); + } + // Pop name + glPopName(); + } + for (const auto& flow : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) { + // Start drawing adding an gl identificator + glPushName(flow->getGlID()); + // draw partial trip only if is being inspected or selected + if ((myNet->getViewNet()->getDottedAC() == flow) || flow->isAttributeCarrierSelected()) { + edge->drawPartialTripFromTo(s, flow, this); + } + // only draw flow in the first edge + if (flow->getAttribute(SUMO_ATTR_FROM) == getID()) { + flow->drawGL(s); + } + // Pop name + glPopName(); + } + // draw partial person plan elements + if (s.drawForPositionSelection) { + for (const auto& personTripFromTo : edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO)) { + edge->drawPartialPersonPlan(s, personTripFromTo, this); + } + for (const auto& personTripBusStop : edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP)) { + edge->drawPartialPersonPlan(s, personTripBusStop, this); + } + for (const auto& walkEdges : edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES)) { + edge->drawPartialPersonPlan(s, walkEdges, this); + } + for (const auto& walkFromTo : edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO)) { + edge->drawPartialPersonPlan(s, walkFromTo, this); + } + for (const auto& walkBusStop : edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP)) { + edge->drawPartialPersonPlan(s, walkBusStop, this); + } + for (const auto& walkRoute : edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE)) { + edge->drawPartialPersonPlan(s, walkRoute, this); + } + for (const auto& rideFromTo : edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO)) { + edge->drawPartialPersonPlan(s, rideFromTo, this); + } + for (const auto& rideBusStop : edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP)) { + edge->drawPartialPersonPlan(s, rideBusStop, this); + } + } else { + // if drawForPositionSelection is disabled, only draw the first element + if (edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).front(), nullptr); + } + if (edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).size() > 0) { + edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).front(), nullptr); + } + } +} + + +void +GNEJunction::drawPathGenericDataElementChilds(const GUIVisualizationSettings& s) const { + // iterate over incoming edges + for (const auto& incomingEdge : myGNEIncomingEdges) { + for (const auto& genericData : incomingEdge->getChildGenericDataElements()) { + // check if incomingEdge correspond to edgeRel from edge + if ((genericData->getTagProperty().getTag() == SUMO_TAG_EDGEREL) && + (genericData->getAttribute(SUMO_ATTR_FROM) == incomingEdge->getID()) && + genericData->isGenericDataVisible()) { + // get To edge + const GNEEdge* edgeTo = genericData->getParentEdges().back(); + // get the four points + const Position positionA = incomingEdge->getBackDownShapePosition(); + const Position positionB = incomingEdge->getBackUpShapePosition(); + const Position positionC = edgeTo->getFrontUpShapePosition(); + const Position positionD = edgeTo->getFrontDownShapePosition(); + // push name + glPushName(genericData->getGlID()); + // push matrix + glPushMatrix(); + // set color + if (genericData->isAttributeCarrierSelected()) { + GLHelper::setColor(s.colorSettings.selectedEdgeDataColor); + } else { + GLHelper::setColor(genericData->getColor()); + } + // draw shape + glPushMatrix(); + glTranslated(0, 0, genericData->getType()); + glBegin(GL_QUADS); + glVertex2d(positionA.x(), positionA.y()); + glVertex2d(positionB.x(), positionB.y()); + glVertex2d(positionC.x(), positionC.y()); + glVertex2d(positionD.x(), positionD.y()); + glEnd(); + // pop matrix + glPopMatrix(); + // pop name + glPopName(); + /* + // iterate over edges + for (int i = 0; i < (genericData->getPathEdges().size()-1); i++) { + if (genericData->isGenericDataVisible() && (genericData->getPathEdges().at(i) == this)) { + // obtain lanes edge + PositionVector laneShapeFromA = myLanes.front()->getLaneShape(); + laneShapeFromA.move2side(myLanes.front()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.front()->getIndex()) / 2); + PositionVector laneShapeFromB = myLanes.back()->getLaneShape(); + laneShapeFromB.move2side(-1*myLanes.back()->getParentEdge()->getNBEdge()->getLaneWidth(myLanes.back()->getIndex()) / 2); + PositionVector laneShapeToA = genericData->getPathEdges().at(i + 1)->getLanes().front()->getLaneShape(); + laneShapeToA.move2side(genericData->getPathEdges().at(i + 1)->getLanes().front()->getParentEdge()->getNBEdge()->getLaneWidth(genericData->getPathEdges().at(i + 1)->getLanes().front()->getIndex()) / 2); + PositionVector laneShapeToB = genericData->getPathEdges().at(i + 1)->getLanes().back()->getLaneShape(); + laneShapeToB.move2side(-1 * genericData->getPathEdges().at(i + 1)->getLanes().back()->getParentEdge()->getNBEdge()->getLaneWidth(genericData->getPathEdges().at(i + 1)->getLanes().back()->getIndex()) / 2); + + } + */ + } + } + } +} + + +void +GNEJunction::setAttribute(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_KEEP_CLEAR: { + throw InvalidArgument(toString(key) + " cannot be edited"); + } + case SUMO_ATTR_ID: { + myNet->getAttributeCarriers()->updateID(this, value); + break; + } + case SUMO_ATTR_TYPE: { + SumoXMLNodeType type = SUMOXMLDefinitions::NodeTypes.get(value); + if (myNBNode->getType() == SumoXMLNodeType::PRIORITY && type == SumoXMLNodeType::RIGHT_BEFORE_LEFT) { + myNet->getNetBuilder()->getEdgeCont().removeRoundabout(myNBNode); + } + myNBNode->reinit(myNBNode->getPosition(), type); + break; + } + case SUMO_ATTR_POSITION: { + // start geometry moving (because new position affect all junction children) + startGeometryMoving(); + // set new position in NBNode without updating grid + moveJunctionGeometry(parse(value)); + // end geometry moving + endGeometryMoving(); + // mark this connections and all of the junction's Neighbours as deprecated + markConnectionsDeprecated(true); + break; + } + case GNE_ATTR_MODIFICATION_STATUS: + if (myLogicStatus == FEATURE_GUESSED && value != FEATURE_GUESSED) { + // clear guessed connections. previous connections will be restored + myNBNode->invalidateIncomingConnections(); + // Clear GNEConnections of incoming edges + for (const auto& i : myGNEIncomingEdges) { + i->clearGNEConnections(); + } + } + myLogicStatus = value; + break; + case SUMO_ATTR_SHAPE: { + // start geometry moving (because new position affect all junction children) + startGeometryMoving(); + // set new shape (without updating grid) + const PositionVector shape = parse(value); + myNBNode->setCustomShape(shape); + // end geometry moving + endGeometryMoving(); + // mark this connections and all of the junction's Neighbours as deprecated + markConnectionsDeprecated(true); + break; + } + case SUMO_ATTR_RADIUS: { + myNBNode->setRadius(parse(value)); + break; + } + case SUMO_ATTR_TLTYPE: { + // we need to make a copy of controlling TLS (because original will be updated) + const std::set copyOfTls = myNBNode->getControllingTLS(); + for (const auto& TLS : copyOfTls) { + TLS->setType(SUMOXMLDefinitions::TrafficLightTypes.get(value)); + } + break; + } + case SUMO_ATTR_RIGHT_OF_WAY: + myNBNode->setRightOfWay(SUMOXMLDefinitions::RightOfWayValues.get(value)); + break; + case SUMO_ATTR_FRINGE: + myNBNode->setFringeType(SUMOXMLDefinitions::FringeTypeValues.get(value)); + break; + case SUMO_ATTR_NAME: + myNBNode->setName(value); + break; + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + myNBNode->setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNEJunction::updateDottedContour() { + // obtain junction shape + PositionVector shape = myNBNode->getShape(); + // check if we have to calculate buuble or shape + if (shape.area() < 4) { + updateDottedGeometry(GNEGeometry::getVertexCircleAroundPosition(myNBNode->getPosition(), 4, 32)); + } else { + // close polygon + shape.closePolygon(); + updateDottedGeometry(shape); + } +} + + +double +GNEJunction::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const { + switch (activeScheme) { + case 0: + if (myColorForMissingConnections) { + return 3; + } else { + return 0; + } + case 1: + return isAttributeCarrierSelected(); + case 2: + switch (myNBNode->getType()) { + case SumoXMLNodeType::TRAFFIC_LIGHT: + return 0; + case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: + return 1; + case SumoXMLNodeType::PRIORITY: + return 2; + case SumoXMLNodeType::PRIORITY_STOP: + return 3; + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: + return 4; + case SumoXMLNodeType::ALLWAY_STOP: + return 5; + case SumoXMLNodeType::DISTRICT: + return 6; + case SumoXMLNodeType::NOJUNCTION: + return 7; + case SumoXMLNodeType::DEAD_END: + case SumoXMLNodeType::DEAD_END_DEPRECATED: + return 8; + case SumoXMLNodeType::UNKNOWN: + return 8; // may happen before first network computation + case SumoXMLNodeType::INTERNAL: + assert(false); + return 8; + case SumoXMLNodeType::RAIL_SIGNAL: + return 9; + case SumoXMLNodeType::ZIPPER: + return 10; + case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: + return 11; + case SumoXMLNodeType::RAIL_CROSSING: + return 12; + } + case 3: + return myNBNode->getPosition().z(); + default: + assert(false); + return 0; + } +} + +void +GNEJunction::checkMissingConnections() { + for (auto edge : myGNEIncomingEdges) { + if (edge->getGNEConnections().size() > 0) { + myColorForMissingConnections = false; + return; + } + } + // no connections. Use normal color for border edges and cul-de-sac + if (myGNEIncomingEdges.size() == 0 || myGNEOutgoingEdges.size() == 0) { + myColorForMissingConnections = false; + return; + } else if (myGNEIncomingEdges.size() == 1 && myGNEOutgoingEdges.size() == 1) { + NBEdge* in = myGNEIncomingEdges[0]->getNBEdge(); + NBEdge* out = myGNEOutgoingEdges[0]->getNBEdge(); + if (in->isTurningDirectionAt(out)) { + myColorForMissingConnections = false; + return; + } + } + myColorForMissingConnections = true; +} + + +void +GNEJunction::moveJunctionGeometry(const Position& pos) { + // obtain NBNode position + const Position orig = myNBNode->getPosition(); + // reinit NBNode + myNBNode->reinit(pos, myNBNode->getType()); + // set new position of adjacent edges + for (const auto& edge : getNBNode()->getEdges()) { + myNet->retrieveEdge(edge->getID())->updateJunctionPosition(this, orig); + } + // declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections + std::set affectedJunctions; + std::set affectedEdges; + // Iterate over GNEEdges + for (const auto& edge : myGNEEdges) { + // Add source and destiny junctions + affectedJunctions.insert(edge->getGNEJunctionSource()); + affectedJunctions.insert(edge->getGNEJunctionDestiny()); + // Obtain neighbors of Junction source + for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { + affectedEdges.insert(junctionSourceEdge); + } + // Obtain neighbors of Junction destiny + for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { + affectedEdges.insert(junctionDestinyEdge); + } + } + // Iterate over affected Edges + for (const auto& affectedEdge : affectedEdges) { + // Update edge geometry + affectedEdge->updateGeometry(); + } +} + + +RGBColor +GNEJunction::setColor(const GUIVisualizationSettings& s, bool bubble) const { + const int scheme = s.junctionColorer.getActive(); + RGBColor color = s.junctionColorer.getScheme().getColor(getColorValue(s, scheme)); + if (bubble && scheme == 0 && !myColorForMissingConnections) { + color = s.junctionColorer.getScheme().getColor(1); + } + // override with special colors (unless the color scheme is based on selection) + if (drawUsingSelectColor() && scheme != 1) { + color = s.colorSettings.selectionColor; + } + if (myAmCreateEdgeSource) { + color = RGBColor(0, 255, 0); + } + // overwritte color if we're in data mode + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) { + color = s.junctionColorer.getScheme().getColor(6); + } + GLHelper::setColor(color); + return color; +} + + +void +GNEJunction::addTrafficLight(NBTrafficLightDefinition* tlDef, bool forceInsert) { + NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); + tlCont.insert(tlDef, forceInsert); // may return false for tlDef which controls multiple junctions + tlDef->addNode(myNBNode); +} + + +void +GNEJunction::removeTrafficLight(NBTrafficLightDefinition* tlDef) { + NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); + if (tlDef->getNodes().size() == 1) { + tlCont.extract(tlDef); + } + myNBNode->removeTrafficLight(tlDef); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEJunction.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEJunction.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEJunction.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEJunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,335 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEJunction.h +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A class for visualizing and editing junctions in netedit (adapted from +// GUIJunctionWrapper) +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNENet; +class GNEEdge; +class GNECrossing; +class NBTrafficLightDefinition; +class GNEConnection; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEJunction + * + * In the case the represented junction's shape is empty, the boundary + * is computed using the junction's position to which an offset of 1m to each + * side is added. + */ +class GNEJunction : public GNENetworkElement { + + /// @brief Declare friend class + friend class GNEChange_TLS; + friend class GNEChange_Crossing; + +public: + /// @brief constant values for drawing buubles + static const double BUBBLE_RADIUS; + + /**@brief Constructor + * @param[in] net The net to inform about gui updates + * @param[in] nbn The represented node + * @param[in] loaded Whether the junction was loaded from a file + */ + GNEJunction(GNENet* net, NBNode* nbn, bool loaded = false); + + /// @brief Destructor + ~GNEJunction(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name Functions related with geometry of element + /// @{ + /// @brief get junction shape + const PositionVector& getJunctionShape() const; + + /// @brief update pre-computed geometry information (including crossings) + void updateGeometry(); + + /// @brief update pre-computed geometry information without modifying netbuild structures + // @note: using an extra function because updateGeometry overrides an abstract virtual function + void updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings = false); + + /// @brief Returns position of hierarchical element in view + Position getPositionInView() const; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * + * @return The boundary the object is within + * @see GUIGlObject::getCenteringBoundary + */ + Boundary getCenteringBoundary() const; + + /**@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; + /// @} + + /// @brief Return net build node + NBNode* getNBNode() const; + + /// @brief return GNEJunction neighbours + std::vector getJunctionNeighbours() const; + + /// @brief add incoming GNEEdge + void addIncomingGNEEdge(GNEEdge* edge); + + /// @brief add outgoing GNEEdge + void addOutgoingGNEEdge(GNEEdge* edge); + + /// @brief remove incoming GNEEdge + void removeIncomingGNEEdge(GNEEdge* edge); + + /// @brief remove outgoing GNEEdge + void removeOutgoingGNEEdge(GNEEdge* edge); + + /// @brief Returns all GNEEdges vinculated with this Junction + const std::vector& getGNEEdges() const; + + /// @brief Returns incoming GNEEdges + const std::vector& getGNEIncomingEdges() const; + + /// @brief Returns incoming GNEEdges + const std::vector& getGNEOutgoingEdges() const; + + /// @brief Returns GNECrossings + const std::vector& getGNECrossings() const; + + /// @brief Returns all GNEConnections vinculated with this junction + std::vector getGNEConnections() const; + + /// @brief marks as first junction in createEdge-mode + void markAsCreateEdgeSource(); + + /// @brief removes mark as first junction in createEdge-mode + void unMarkAsCreateEdgeSource(); + + /// @brief notify the junction of being selected in tls-mode. (used to control drawing) + void selectTLS(bool selected); + + /// @name functions related with geometry movement + /// @{ + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startGeometryMoving(bool extendToNeighbors = true); + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void endGeometryMoving(bool extendToNeighbors = true); + + /// @brief change the position of the element geometry without saving in undoList + void moveGeometry(const Position& offset); + + /// @brief registers completed movement with the undoList + void commitGeometryMoving(GNEUndoList* undoList); + + /// @} + + /// @name 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 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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @brief method for check if the value for certain attribute is set + * @param[in] key The attribute key + */ + bool isAttributeEnabled(SumoXMLAttr key) const; + /// @} + + /// @brief set responsibility for deleting internal strctures + void setResponsible(bool newVal); + + /* @brief notify junction that one of its edges has changed its shape, and + * therefore the junction shape is no longer valid */ + void invalidateShape(); + + /* @brief update validity of this junctions logic + * if the logic is invalidated, existing connections are removed via undo-list + * so that the previous state can be restored + * also calls invalidateTLS + * @param[in] valid The new validity of the junction + * @note: this should always be called with an active command group + */ + void setLogicValid(bool valid, GNEUndoList* undoList, const std::string& status = FEATURE_GUESSED); + + /// @brief remove all connections from the given edge + void removeConnectionsFrom(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane = -1); + + /// @brief remove all connections to the given edge + void removeConnectionsTo(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane = -1); + + /// @brief prevent re-guessing connections at this junction + void markAsModified(GNEUndoList* undoList); + + /* @brief invalidates loaded or edited TLS + * @param[in] deletedConnection If a valid connection is given a replacement def with this connection removed + * but all other information intact will be computed instead of guessing a new tlDef + * @note: this should always be called with an active command group + */ + void invalidateTLS(GNEUndoList* undoList, + const NBConnection& deletedConnection = NBConnection::InvalidConnection, + const NBConnection& addedConnection = NBConnection::InvalidConnection); + + /// @brief replace one edge by another in all tls connections + void replaceIncomingConnections(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList); + + /// @brief removes the given edge from all pedestrian crossings + void removeEdgeFromCrossings(GNEEdge* edge, GNEUndoList* undoList); + + /// @brief whether this junction has a valid logic + bool isLogicValid(); + + /// @brief get GNECrossing if exist, and if not create it if create is enabled + GNECrossing* retrieveGNECrossing(NBNode::Crossing* NBNodeCrossing, bool createIfNoExist = true); + + /// @brief mark connections as deprecated + void markConnectionsDeprecated(bool includingNeighbours); + +private: + /// @brief A reference to the represented junction + NBNode* myNBNode; + + /// @brief vector with the GNEEdges vinculated with this junction + std::vector myGNEEdges; + + /// @brief vector with the incomings GNEEdges vinculated with this junction + std::vector myGNEIncomingEdges; + + /// @brief vector with the outgoings GNEEdges vinculated with this junction + std::vector myGNEOutgoingEdges; + + /// @brief the built crossing objects + std::vector myGNECrossings; + + /// @brief The maximum size (in either x-, or y-dimension) for determining whether to draw or not + double myMaxSize; + + /// @brief whether this junction is the first junction for a newly creatededge + /// @see GNEApplicationWindow::createEdgeSource) + bool myAmCreateEdgeSource; + + /// @brief modification status of the junction logic (all connections across this junction) + std::string myLogicStatus; + + /// @brief whether we are responsible for deleting myNBNode + bool myAmResponsible; + + /// @brief whether this junctions logic is valid + bool myHasValidLogic; + + /// @brief whether this junction is selected in tls-mode + bool myAmTLSSelected; + + /// @brief whether this junction probably should have some connections but doesn't + bool myColorForMissingConnections; + + /// @brief draw TLS icon + void drawTLSIcon(const GUIVisualizationSettings& s) const; + + /// @brief draw junction childs + void drawJunctionChilds(const GUIVisualizationSettings& s) const; + + /// @brief draw demand elements childs + void drawDemandElements(const GUIVisualizationSettings& s, const GNEEdge* edge) const; + + /// @brief draw generic data between two edges + void drawPathGenericDataElementChilds(const GUIVisualizationSettings& s) const; + + /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief update dotted contour + void updateDottedContour(); + + /**@brief reposition the node at pos without updating GRID and informs the edges + * @param[in] pos The new position + * @note: those operations are not added to the undoList. + */ + void moveJunctionGeometry(const Position& pos); + + /// @brief sets junction color depending on circumstances + RGBColor setColor(const GUIVisualizationSettings& s, bool bubble) const; + + /// @brief determines color value + double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const; + + /// @brief compute whether this junction probably should have some connections but doesn't + void checkMissingConnections(); + + /// @brief adds a traffic light + void addTrafficLight(NBTrafficLightDefinition* tlDef, bool forceInsert); + + /// @brief removes a traffic light + void removeTrafficLight(NBTrafficLightDefinition* tlDef); + + /// @brief rebuilds crossing objects for this junction + void rebuildGNECrossings(bool rebuildNBNodeCrossings = true); + + /// @brief remove the given connections from all traffic light definitions of this junction + void removeTLSConnections(std::vector& connections, GNEUndoList* undoList); + + /// @brief temporarily mirror coordinates in lefthand network to compute correct crossing geometries + void mirrorXLeftHand(); + + /// @brief Invalidated copy constructor. + GNEJunction(const GNEJunction&) = delete; + + /// @brief Invalidated assignment operator. + GNEJunction& operator=(const GNEJunction&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNELane.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNELane.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNELane.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNELane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1554 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNELane.cpp +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A class for visualizing Lane geometry (adapted from GNELaneWrapper) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNELane.h" +#include "GNEEdge.h" +#include "GNEJunction.h" +#include "GNEInternalLane.h" +#include "GNEConnection.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +// Object implementation +FXIMPLEMENT(GNELane, FXDelegator, 0, 0) + +// =========================================================================== +// method definitions +// =========================================================================== + +GNELane::GNELane(GNEEdge* edge, const int index) : + GNENetworkElement(edge->getNet(), edge->getNBEdge()->getLaneID(index), GLO_LANE, SUMO_TAG_LANE, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myParentEdge(edge), +myIndex(index), +mySpecialColor(nullptr), +mySpecialColorValue(-1), +myLane2laneConnections(this) { +} + +GNELane::GNELane() : + GNENetworkElement(nullptr, "dummyConstructorGNELane", GLO_LANE, SUMO_TAG_LANE, +{}, {}, {}, {}, {}, {}, {}, // Parents +{}, {}, {}, {}, {}, {}, {}), // Children +myParentEdge(nullptr), +myIndex(-1), +mySpecialColor(nullptr), +mySpecialColorValue(-1), +myLane2laneConnections(this) { +} + + +GNELane::~GNELane() {} + +std::string +GNELane::generateChildID(SumoXMLTag /*childTag*/) { + // currently unused + return ""; +} + + +const PositionVector& +GNELane::getLaneShape() const { + return myParentEdge->getNBEdge()->getLaneShape(myIndex); +} + + +const std::vector& +GNELane::getShapeRotations() const { + return myLaneGeometry.getShapeRotations(); +} + + +const std::vector& +GNELane::getShapeLengths() const { + return myLaneGeometry.getShapeLengths(); +} + + +void +GNELane::updateGeometry() { + // Clear texture containers + myLaneRestrictedTexturePositions.clear(); + myLaneRestrictedTextureRotations.clear(); + //double length = myParentEdge->getLength(); // @todo see ticket #448 + // may be different from length + // Obtain lane shape of NBEdge + myLaneGeometry.updateGeometry(myParentEdge->getNBEdge()->getLaneShape(myIndex)); + // update connections + myLane2laneConnections.updateLane2laneConnection(); + // update shapes parents associated with this lane + for (auto i : getParentShapes()) { + i->updateGeometry(); + } + // update child shapes associated with this lane + for (auto i : getChildShapes()) { + i->updateGeometry(); + } + // update additionals children associated with this lane + for (auto i : getParentAdditionals()) { + i->updateGeometry(); + } + // update additionals parents associated with this lane + for (auto i : getChildAdditionals()) { + i->updateGeometry(); + } + // partial update demand elements parents associated with this lane + for (auto i : getParentDemandElements()) { + i->updatePartialGeometry(myParentEdge); + } + // partial update demand elements children associated with this lane + for (auto i : getChildDemandElements()) { + i->updatePartialGeometry(myParentEdge); + } + // In Move mode, connections aren't updated + if (myNet->getViewNet() && myNet->getViewNet()->getEditModes().networkEditMode != NetworkEditMode::NETWORK_MOVE) { + // Update incoming connections of this lane + auto incomingConnections = getGNEIncomingConnections(); + for (auto i : incomingConnections) { + i->updateGeometry(); + } + // Update outgoings connections of this lane + auto outGoingConnections = getGNEOutcomingConnections(); + for (auto i : outGoingConnections) { + i->updateGeometry(); + } + } + // If lane has enought length for show textures of restricted lanes + if ((getLaneShapeLength() > 4)) { + // if lane is restricted + if (isRestricted(SVC_PEDESTRIAN) || isRestricted(SVC_BICYCLE) || isRestricted(SVC_BUS)) { + // get values for position and rotation of icons + for (int i = 2; i < getLaneShapeLength() - 1; i += 15) { + myLaneRestrictedTexturePositions.push_back(myLaneGeometry.getShape().positionAtOffset(i)); + myLaneRestrictedTextureRotations.push_back(myLaneGeometry.getShape().rotationDegreeAtOffset(i)); + } + } + } + // mark dotted geometry deprecated + myDottedGeometry.markDottedGeometryDeprecated(); +} + + +Position +GNELane::getPositionInView() const { + // currently unused + return Position(0, 0); +} + + +void +GNELane::drawLinkNo(const GUIVisualizationSettings& s) const { + const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); + int noLinks = (int)cons.size(); + if (noLinks == 0) { + return; + } + // draw all links + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION + 0.5); + double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks; + double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; + for (int i = noLinks; --i >= 0;) { + double x2 = x1 - (double)(w / 2.); + const int linkIndex = myParentEdge->getNBEdge()->getToNode()->getConnectionIndex(myParentEdge->getNBEdge(), + cons[s.lefthand ? noLinks - 1 - i : i]); + GLHelper::drawTextAtEnd(toString(linkIndex), myLaneGeometry.getShape(), x2, s.drawLinkJunctionIndex, s.scale); + x1 -= w; + } + glPopMatrix(); +} + + +void +GNELane::drawTLSLinkNo(const GUIVisualizationSettings& s) const { + const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); + int noLinks = (int)cons.size(); + if (noLinks == 0) { + return; + } + // draw all links + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION + 0.5); + double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks; + double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; + for (int i = noLinks; --i >= 0;) { + double x2 = x1 - (double)(w / 2.); + int linkNo = cons[s.lefthand ? noLinks - 1 - i : i].tlLinkIndex; + GLHelper::drawTextAtEnd(toString(linkNo), myLaneGeometry.getShape(), x2, s.drawLinkTLIndex, s.scale); + x1 -= w; + } + glPopMatrix(); +} + + +void +GNELane::drawLinkRules(const GUIVisualizationSettings& /*s*/) const { + // currently unused +} + + +void +GNELane::drawArrows(const GUIVisualizationSettings& s) const { + const Position& begin = myLaneGeometry.getShape()[-2]; + const Position& end = myLaneGeometry.getShape().back(); + const double rot = GNEGeometry::calculateRotation(begin, end); + glPushMatrix(); + glPushName(0); + glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape + glColor3d(1, 1, 1); + glTranslated(end.x(), end.y(), 0); + glRotated(rot, 0, 0, 1); + // draw all links + const std::vector& edgeCons = myParentEdge->getNBEdge()->myConnections; + NBNode* dest = myParentEdge->getNBEdge()->myTo; + for (auto i : edgeCons) { + if (i.fromLane == myIndex) { + LinkDirection dir = dest->getDirection(myParentEdge->getNBEdge(), i.toEdge, s.lefthand); + switch (dir) { + case LinkDirection::STRAIGHT: + GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); + GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); + break; + case LinkDirection::LEFT: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05); + GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (double) 1, (double) .25); + break; + case LinkDirection::RIGHT: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); + GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (double) 1, (double) .25); + break; + case LinkDirection::TURN: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05); + GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05); + GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (double) 1, (double) .25); + break; + case LinkDirection::TURN_LEFTHAND: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); + GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05); + GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (double) 1, (double) .25); + break; + case LinkDirection::PARTLEFT: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05); + GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (double) 1, (double) .25); + break; + case LinkDirection::PARTRIGHT: + GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); + GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05); + GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (double) 1, (double) .25); + break; + case LinkDirection::NODIR: + GLHelper::drawBoxLine(Position(1, 5.8), 245, 2, .05); + GLHelper::drawBoxLine(Position(-1, 5.8), 115, 2, .05); + glTranslated(0, 5, 0); + GLHelper::drawOutlineCircle(0.9, 0.8, 32); + glTranslated(0, -5, 0); + break; + } + } + } + glPopName(); + glPopMatrix(); +} + + +void +GNELane::drawLane2LaneConnections() const { + glPushMatrix(); + glPushName(0); + glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape + std::vector connections = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); + NBNode* node = myParentEdge->getNBEdge()->getToNode(); + const Position& startPos = myLaneGeometry.getShape()[-1]; + for (auto it : connections) { + const LinkState state = node->getLinkState(myParentEdge->getNBEdge(), it.toEdge, it.fromLane, it.toLane, it.mayDefinitelyPass, it.tlID); + switch (state) { + case LINKSTATE_TL_OFF_NOSIGNAL: + glColor3d(1, 1, 0); + break; + case LINKSTATE_TL_OFF_BLINKING: + glColor3d(0, 1, 1); + break; + case LINKSTATE_MAJOR: + glColor3d(1, 1, 1); + break; + case LINKSTATE_MINOR: + glColor3d(.4, .4, .4); + break; + case LINKSTATE_STOP: + glColor3d(.7, .4, .4); + break; + case LINKSTATE_EQUAL: + glColor3d(.7, .7, .7); + break; + case LINKSTATE_ALLWAY_STOP: + glColor3d(.7, .7, 1); + break; + case LINKSTATE_ZIPPER: + glColor3d(.75, .5, 0.25); + break; + default: + throw ProcessError("Unexpected LinkState '" + toString(state) + "'"); + } + const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0]; + glBegin(GL_LINES); + glVertex2d(startPos.x(), startPos.y()); + glVertex2d(endPos.x(), endPos.y()); + glEnd(); + GLHelper::drawTriangleAtEnd(startPos, endPos, (double) 1.5, (double) .2); + } + glPopName(); + glPopMatrix(); +} + + +void +GNELane::drawGL(const GUIVisualizationSettings& s) const { + // Push draw matrix 1 + glPushMatrix(); + // Push name + glPushName(getGlID()); + // push GL Name of genericData + for (const auto& genericData : myParentEdge->getChildGenericDataElements()) { + if (genericData->isGenericDataVisible()) { + glPushName(genericData->getGlID()); + } + } + // Traslate to front + glTranslated(0, 0, myParentEdge->getNBEdge()->getLength() < 1 ? GLO_JUNCTION + 1 : getType()); + const RGBColor color = setLaneColor(s); + // start drawing lane checking whether it is not too small + const double selectionScale = isAttributeCarrierSelected() || myParentEdge->isAttributeCarrierSelected() ? s.selectionScale : 1; + const double exaggeration = selectionScale * s.laneWidthExaggeration; // * s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); + // XXX apply usefull scale values + //exaggeration *= s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); + // recognize full transparency and simply don't draw + if ((color.alpha() == 0) || ((s.scale * exaggeration) < s.laneMinSize)) { + // Pop draw matrix 1 + glPopMatrix(); + // Pop Lane Name + glPopName(); + // pop GL Name of generic datas + for (const auto& genericData : myParentEdge->getChildGenericDataElements()) { + if (genericData->isGenericDataVisible()) { + glPopName(); + } + } + } else if ((s.scale * exaggeration) < 1.) { + // draw as lines, depending of myShapeColors + if (myShapeColors.size() > 0) { + GLHelper::drawLine(myLaneGeometry.getShape(), myShapeColors); + } else { + GLHelper::drawLine(myLaneGeometry.getShape()); + } + // Pop draw matrix 1 + glPopMatrix(); + // Pop Lane Name + glPopName(); + // pop GL Name of generic datas + for (const auto& genericData : myParentEdge->getChildGenericDataElements()) { + if (genericData->isGenericDataVisible()) { + glPopName(); + if (myIndex == 0) { + // draw attribute in first lane + genericData->drawAttribute(myLaneGeometry.getShape()); + } + } + } + // draw parents + for (const auto& additionalParent : getParentAdditionals()) { + if (additionalParent->getTagProperty().getTag() == SUMO_TAG_VSS) { + // draw VSS Symbol + drawVSSSymbol(s, additionalParent); + } + } + // draw child shapes + for (const auto& POILane : getChildShapes()) { + POILane->drawGL(s); + } + // draw child additional + for (const auto& additional : getChildAdditionals()) { + //draw partial E2 detectors + if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + drawPartialE2DetectorPlan(s, additional, nullptr); + } else if (!additional->getTagProperty().isPlacedInRTree()) { + // check that ParkingAreas aren't draw two times + additional->drawGL(s); + } + } + // draw child demand elements + for (const auto& demandElement : getChildDemandElements()) { + if (!demandElement->getTagProperty().isPlacedInRTree()) { + demandElement->drawGL(s); + } + } + } else { + // we draw the lanes with reduced width so that the lane markings below are visible + // (this avoids artifacts at geometry corners without having to + // compute lane-marking intersection points) + const double halfWidth2 = exaggeration * (myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2 - SUMO_const_laneMarkWidth / 2); + // Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen + const double halfWidth = drawUsingSelectColor() ? halfWidth2 - exaggeration * 0.3 : halfWidth2; + const bool spreadSuperposed = s.spreadSuperposed && drawAsRailway(s) && myParentEdge->getNBEdge()->isBidiRail(); + // Check if lane has to be draw as railway and if isn't being drawn for selecting + if (drawAsRailway(s) && (!s.drawForRectangleSelection || spreadSuperposed)) { + PositionVector shape = myLaneGeometry.getShape(); + const double width = myParentEdge->getNBEdge()->getLaneWidth(myIndex); + // draw as railway: assume standard gauge of 1435mm when lane width is not set + // draw foot width 150mm, assume that distance between rail feet inner sides is reduced on both sides by 39mm with regard to the gauge + // assume crosstie length of 181% gauge (2600mm for standard gauge) + double halfGauge = 0.5 * (width == SUMO_const_laneWidth ? 1.4350 : width) * exaggeration; + if (spreadSuperposed) { + shape.move2side(halfGauge * 0.8); + halfGauge *= 0.4; + //std::cout << "spreadSuperposed " << getID() << " old=" << myLaneGeometry.getShape() << " new=" << shape << "\n"; + } + const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration; + const double halfRailWidth = halfInnerFeetWidth + 0.15 * exaggeration; + const double halfCrossTieWidth = halfGauge * 1.81; + // Draw lane geometry + GNEGeometry::drawLaneGeometry(myNet->getViewNet(), shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), myShapeColors, halfRailWidth); + // Save current color + RGBColor current = GLHelper::getColor(); + // Draw gray on top with reduced width (the area between the two tracks) + glColor3d(0.8, 0.8, 0.8); + glTranslated(0, 0, .1); + GNEGeometry::drawLaneGeometry(myNet->getViewNet(), shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), {}, halfInnerFeetWidth); + // Set current color back + GLHelper::setColor(current); + // Draw crossties + GLHelper::drawCrossTies(shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), 0.26 * exaggeration, 0.6 * exaggeration, halfCrossTieWidth, s.drawForRectangleSelection); + } else { + GNEGeometry::drawLaneGeometry(myNet->getViewNet(), myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), myShapeColors, halfWidth); + } + if (halfWidth != halfWidth2 && !spreadSuperposed) { + // draw again to show the selected edge + GLHelper::setColor(s.colorSettings.selectedEdgeColor); + glTranslated(0, 0, -.1); + GNEGeometry::drawLaneGeometry(myNet->getViewNet(), myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), {}, halfWidth2); + } + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == this) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape, halfWidth); + } + // Pop draw matrix 1 + glPopMatrix(); + // only draw details depending of the scale and if isn't being drawn for selecting + if ((s.scale >= 10) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { + // if exaggeration is 1, draw drawMarkings + if (s.laneShowBorders && exaggeration == 1 && !drawAsRailway(s)) { + drawMarkings(s, exaggeration); + } + // draw ROWs only if target junction has a valid logic) + if (s.showLinkDecals && myParentEdge->getGNEJunctionDestiny()->isLogicValid() && s.scale > 3) { + drawArrows(s); + } + // Draw direction indicators if the correspondient option is enabled + if (s.showLaneDirection) { + if (drawAsRailway(s)) { + // improve visibility of superposed rail edges + setLaneColor(s); + } else { + glColor3d(0.3, 0.3, 0.3); + } + drawDirectionIndicators(exaggeration, spreadSuperposed); + } + if (s.drawLinkJunctionIndex.show) { + drawLinkNo(s); + } + if (s.drawLinkTLIndex.show) { + drawTLSLinkNo(s); + } + } + // If there are texture of restricted lanes to draw, check if icons can be drawn + if (!s.drawForRectangleSelection && !s.drawForPositionSelection && !s.disableLaneIcons && + (myLaneRestrictedTexturePositions.size() > 0) && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { + // Declare default width of icon (3) + double iconWidth = 1; + // Obtain width of icon, if width of lane is different + if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).width != -1) { + iconWidth = myParentEdge->getNBEdge()->getLaneStruct(myIndex).width / 3; + } + // Draw list of icons + for (int i = 0; i < (int)myLaneRestrictedTexturePositions.size(); i++) { + // Push draw matrix 2 + glPushMatrix(); + // Set white color + glColor3d(1, 1, 1); + // Traslate matrix 2 + glTranslated(myLaneRestrictedTexturePositions.at(i).x(), myLaneRestrictedTexturePositions.at(i).y(), getType() + 0.1); + // Rotate matrix 2 + glRotated(myLaneRestrictedTextureRotations.at(i), 0, 0, -1); + glRotated(90, 0, 0, 1); + // draw texture box depending of type of restriction + if (isRestricted(SVC_PEDESTRIAN)) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEPEDESTRIAN), iconWidth); + } else if (isRestricted(SVC_BICYCLE)) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEBIKE), iconWidth); + } else if (isRestricted(SVC_BUS)) { + GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEBUS), iconWidth); + } + // Pop draw matrix 2 + glPopMatrix(); + } + } + // draw a Start/endPoints if lane has a custom shape + if (!s.drawForRectangleSelection && (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() > 1)) { + drawStartEndShapePoints(s); + } + // Pop Lane Name + glPopName(); + // pop GL Name of generic datas + for (const auto& genericData : myParentEdge->getChildGenericDataElements()) { + if (genericData->isGenericDataVisible()) { + glPopName(); + if (myIndex == 0) { + // draw attribute in first lane + genericData->drawAttribute(myLaneGeometry.getShape()); + } + } + } + // draw parents + for (const auto& VSS : getParentAdditionals()) { + if (VSS->getTagProperty().getTag() == SUMO_TAG_VSS) { + // draw VSS Symbol + drawVSSSymbol(s, VSS); + } + } + // draw child shapes + for (const auto& POILane : getChildShapes()) { + POILane->drawGL(s); + } + // draw child additional + for (const auto& additional : getChildAdditionals()) { + //draw partial E2 detectors + if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + drawPartialE2DetectorPlan(s, additional, nullptr); + } else if (!additional->getTagProperty().isPlacedInRTree()) { + // check that ParkingAreas aren't draw two times + additional->drawGL(s); + } + } + // draw child demand elements + for (const auto& demandElement : getChildDemandElements()) { + if (!demandElement->getTagProperty().isPlacedInRTree()) { + demandElement->drawGL(s); + } + } + } +} + + +void +GNELane::drawMarkings(const GUIVisualizationSettings& s, double scale) const { + glPushMatrix(); + glTranslated(0, 0, GLO_EDGE); + const double myHalfLaneWidth = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; + // optionally draw inverse markings + if (myIndex > 0 && (myParentEdge->getNBEdge()->getPermissions(myIndex - 1) & myParentEdge->getNBEdge()->getPermissions(myIndex)) != 0) { + double mw = (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale; + double mw2 = (myHalfLaneWidth - SUMO_const_laneMarkWidth) * scale; + if (s.lefthand) { + mw *= -1; + mw2 *= -1; + } + int e = (int) myLaneGeometry.getShape().size() - 1; + for (int i = 0; i < e; ++i) { + glPushMatrix(); + glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 2.1); + glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1); + for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += 6) { + const double length = MIN2((double)3, myLaneGeometry.getShapeLengths()[i] - t); + glBegin(GL_QUADS); + glVertex2d(-mw, -t); + glVertex2d(-mw, -t - length); + glVertex2d(-mw2, -t - length); + glVertex2d(-mw2, -t); + glEnd(); + } + glPopMatrix(); + } + } + // draw white boundings and white markings + glColor3d(1, 1, 1); + GNEGeometry::drawGeometry(myNet->getViewNet(), myLaneGeometry, (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale); + glPopMatrix(); +} + + +GUIGLObjectPopupMenu* +GNELane::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { + // first obtain edit mode (needed because certain Commands depend of current edit mode) + const NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; + GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); + buildPopupHeader(ret, app); + buildCenterPopupEntry(ret); + // build copy names entry + if (editMode != NetworkEditMode::NETWORK_TLS) { + new FXMenuCommand(ret, "Copy parent edge name to clipboard", nullptr, ret, MID_COPY_EDGE_NAME); + buildNameCopyPopupEntry(ret); + } + // build selection + myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); + if (editMode != NetworkEditMode::NETWORK_TLS) { + // build show parameters menu + buildShowParamsPopupEntry(ret); + // build position copy entry + buildPositionCopyEntry(ret, false); + } + // check if we're in supermode network + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork()) { + if (editMode != NetworkEditMode::NETWORK_CONNECT && editMode != NetworkEditMode::NETWORK_TLS && editMode != NetworkEditMode::NETWORK_CREATE_EDGE) { + // Get icons + FXIcon* pedestrianIcon = GUIIconSubSys::getIcon(GUIIcon::LANEPEDESTRIAN); + FXIcon* bikeIcon = GUIIconSubSys::getIcon(GUIIcon::LANEBIKE); + FXIcon* busIcon = GUIIconSubSys::getIcon(GUIIcon::LANEBUS); + FXIcon* greenVergeIcon = GUIIconSubSys::getIcon(GUIIcon::LANEGREENVERGE); + // Create basic commands + std::string edgeDescPossibleMulti = toString(SUMO_TAG_EDGE); + const int edgeSelSize = (int)myNet->retrieveEdges(true).size(); + if (edgeSelSize && myParentEdge->isAttributeCarrierSelected() && (edgeSelSize > 1)) { + edgeDescPossibleMulti = toString(edgeSelSize) + " " + toString(SUMO_TAG_EDGE) + "s"; + } + // if lane is selected, calculate number of restricted lanes + bool edgeHasSidewalk = false; + bool edgeHasBikelane = false; + bool edgeHasBuslane = false; + bool edgeHasGreenVerge = false; + bool differentLaneShapes = false; + if (isAttributeCarrierSelected()) { + auto selectedLanes = myNet->retrieveLanes(true); + for (auto i : selectedLanes) { + if (i->getParentEdge()->hasRestrictedLane(SVC_PEDESTRIAN)) { + edgeHasSidewalk = true; + } + if (i->getParentEdge()->hasRestrictedLane(SVC_BICYCLE)) { + edgeHasBikelane = true; + } + if (i->getParentEdge()->hasRestrictedLane(SVC_BUS)) { + edgeHasBuslane = true; + } + if (i->getParentEdge()->hasRestrictedLane(SVC_IGNORING)) { + edgeHasGreenVerge = true; + } + if (i->getParentEdge()->getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) { + differentLaneShapes = true; + } + } + } else { + edgeHasSidewalk = myParentEdge->hasRestrictedLane(SVC_PEDESTRIAN); + edgeHasBikelane = myParentEdge->hasRestrictedLane(SVC_BICYCLE); + edgeHasBuslane = myParentEdge->hasRestrictedLane(SVC_BUS); + edgeHasGreenVerge = myParentEdge->hasRestrictedLane(SVC_IGNORING); + differentLaneShapes = myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() != 0; + } + // create menu pane for edge operations + FXMenuPane* edgeOperations = new FXMenuPane(ret); + ret->insertMenuPaneChild(edgeOperations); + new FXMenuCascade(ret, "edge operations", nullptr, edgeOperations); + // create menu commands for all edge oeprations + new FXMenuCommand(edgeOperations, "Split edge here", nullptr, &parent, MID_GNE_EDGE_SPLIT); + new FXMenuCommand(edgeOperations, "Split edge in both directions here", nullptr, &parent, MID_GNE_EDGE_SPLIT_BIDI); + new FXMenuCommand(edgeOperations, "Set geometry endpoint here (shift-click)", nullptr, &parent, MID_GNE_EDGE_EDIT_ENDPOINT); + new FXMenuCommand(edgeOperations, "Restore geometry endpoint (shift-click)", nullptr, &parent, MID_GNE_EDGE_RESET_ENDPOINT); + new FXMenuCommand(edgeOperations, ("Reverse " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_REVERSE); + new FXMenuCommand(edgeOperations, ("Add reverse direction for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_ADD_REVERSE); + new FXMenuCommand(edgeOperations, ("Reset lengths for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_RESET_LENGTH); + new FXMenuCommand(edgeOperations, ("Straighten " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN); + new FXMenuCommand(edgeOperations, ("Smooth " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH); + new FXMenuCommand(edgeOperations, ("Straighten elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN_ELEVATION); + new FXMenuCommand(edgeOperations, ("Smooth elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH_ELEVATION); + // create menu pane for lane operations + FXMenuPane* laneOperations = new FXMenuPane(ret); + ret->insertMenuPaneChild(laneOperations); + new FXMenuCascade(ret, "lane operations", nullptr, laneOperations); + new FXMenuCommand(laneOperations, "Duplicate lane", nullptr, &parent, MID_GNE_LANE_DUPLICATE); + if (differentLaneShapes) { + new FXMenuCommand(laneOperations, "reset custom shape", nullptr, &parent, MID_GNE_LANE_RESET_CUSTOMSHAPE); + } + // Create panel for lane operations and insert it in ret + FXMenuPane* addSpecialLanes = new FXMenuPane(laneOperations); + ret->insertMenuPaneChild(addSpecialLanes); + FXMenuPane* removeSpecialLanes = new FXMenuPane(laneOperations); + ret->insertMenuPaneChild(removeSpecialLanes); + FXMenuPane* transformSlanes = new FXMenuPane(laneOperations); + ret->insertMenuPaneChild(transformSlanes); + // Create menu comands for all add special lanes + FXMenuCommand* addSidewalk = new FXMenuCommand(addSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_ADD_SIDEWALK); + FXMenuCommand* addBikelane = new FXMenuCommand(addSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_ADD_BIKE); + FXMenuCommand* addBuslane = new FXMenuCommand(addSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_ADD_BUS); + FXMenuCommand* addGreenVerge = new FXMenuCommand(addSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_ADD_GREENVERGE); + // Create menu comands for all remove special lanes and disable it + FXMenuCommand* removeSidewalk = new FXMenuCommand(removeSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_REMOVE_SIDEWALK); + removeSidewalk->disable(); + FXMenuCommand* removeBikelane = new FXMenuCommand(removeSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_REMOVE_BIKE); + removeBikelane->disable(); + FXMenuCommand* removeBuslane = new FXMenuCommand(removeSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_REMOVE_BUS); + removeBuslane->disable(); + FXMenuCommand* removeGreenVerge = new FXMenuCommand(removeSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_REMOVE_GREENVERGE); + removeGreenVerge->disable(); + // Create menu comands for all trasform special lanes and disable it + FXMenuCommand* transformLaneToSidewalk = new FXMenuCommand(transformSlanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_TRANSFORM_SIDEWALK); + FXMenuCommand* transformLaneToBikelane = new FXMenuCommand(transformSlanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_TRANSFORM_BIKE); + FXMenuCommand* transformLaneToBuslane = new FXMenuCommand(transformSlanes, "Buslane", busIcon, &parent, MID_GNE_LANE_TRANSFORM_BUS); + FXMenuCommand* transformLaneToGreenVerge = new FXMenuCommand(transformSlanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_TRANSFORM_GREENVERGE); + // add menuCascade for lane operations + FXMenuCascade* cascadeAddSpecialLane = new FXMenuCascade(laneOperations, ("add restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, addSpecialLanes); + FXMenuCascade* cascadeRemoveSpecialLane = new FXMenuCascade(laneOperations, ("remove restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, removeSpecialLanes); + new FXMenuCascade(laneOperations, ("transform to restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, transformSlanes); + // Enable and disable options depending of current transform of the lane + if (edgeHasSidewalk) { + transformLaneToSidewalk->disable(); + addSidewalk->disable(); + removeSidewalk->enable(); + } + if (edgeHasBikelane) { + transformLaneToBikelane->disable(); + addBikelane->disable(); + removeBikelane->enable(); + } + if (edgeHasBuslane) { + transformLaneToBuslane->disable(); + addBuslane->disable(); + removeBuslane->enable(); + } + if (edgeHasGreenVerge) { + transformLaneToGreenVerge->disable(); + addGreenVerge->disable(); + removeGreenVerge->enable(); + } + // Check if cascade menus must be disabled + if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) { + cascadeAddSpecialLane->disable(); + } + if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) { + cascadeRemoveSpecialLane->disable(); + } + } else if (editMode == NetworkEditMode::NETWORK_TLS) { + if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->controlsEdge(myParentEdge)) { + new FXMenuCommand(ret, "Select state for all links from this edge:", nullptr, nullptr, 0); + const std::vector names = GNEInternalLane::LinkStateNames.getStrings(); + for (auto it : names) { + FXuint state = GNEInternalLane::LinkStateNames.get(it); + FXMenuRadio* mc = new FXMenuRadio(ret, it.c_str(), this, FXDataTarget::ID_OPTION + state); + mc->setSelBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state))); + mc->setBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state))); + } + } + } else { + FXMenuCommand* mc = new FXMenuCommand(ret, "Additional options available in 'Inspect Mode'", nullptr, nullptr, 0); + mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), nullptr); + } + // buildShowParamsPopupEntry(ret, false); + // build shape positions menu + if (editMode != NetworkEditMode::NETWORK_TLS) { + new FXMenuSeparator(ret); + const double pos = myLaneGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); + const double height = myLaneGeometry.getShape().positionAtOffset2D(myLaneGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation())).z(); + new FXMenuCommand(ret, ("Shape pos: " + toString(pos)).c_str(), nullptr, nullptr, 0); + new FXMenuCommand(ret, ("Length pos: " + toString(pos * getLaneParametricLength() / getLaneShapeLength())).c_str(), nullptr, nullptr, 0); + new FXMenuCommand(ret, ("Height: " + toString(height)).c_str(), nullptr, nullptr, 0); + } + // new FXMenuSeparator(ret); + // buildPositionCopyEntry(ret, false); + } + return ret; +} + + +Boundary +GNELane::getCenteringBoundary() const { + if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() == 0) { + return myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape.getBoxBoundary(); + } else { + return myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.getBoxBoundary(); + } +} + + +int +GNELane::getIndex() const { + return myIndex; +} + +void +GNELane::setIndex(int index) { + myIndex = index; + setMicrosimID(myParentEdge->getNBEdge()->getLaneID(index)); +} + + +double +GNELane::getSpeed() const { + return myParentEdge->getNBEdge()->getLaneSpeed(myIndex); +} + + +double +GNELane::getLaneParametricLength() const { + double laneParametricLength = myParentEdge->getNBEdge()->getLoadedLength(); + if (laneParametricLength > 0) { + return laneParametricLength; + } else { + throw ProcessError("Lane Parametric Length cannot be never 0"); + } +} + + +double +GNELane::getLaneShapeLength() const { + return myLaneGeometry.getShape().length(); +} + + +bool +GNELane::isRestricted(SUMOVehicleClass vclass) const { + return myParentEdge->getNBEdge()->getPermissions(myIndex) == vclass; +} + + +const GNEGeometry::Lane2laneConnection& +GNELane::getLane2laneConnections() const { + return myLane2laneConnections; +} + + +std::string +GNELane::getAttribute(SumoXMLAttr key) const { + const NBEdge* edge = myParentEdge->getNBEdge(); + switch (key) { + case SUMO_ATTR_ID: + return getID(); + case SUMO_ATTR_SPEED: + return toString(edge->getLaneSpeed(myIndex)); + case SUMO_ATTR_ALLOW: + return getVehicleClassNames(edge->getPermissions(myIndex)); + case SUMO_ATTR_DISALLOW: + return getVehicleClassNames(invertPermissions(edge->getPermissions(myIndex))); + case SUMO_ATTR_WIDTH: + return toString(edge->getLaneStruct(myIndex).width); + case SUMO_ATTR_ENDOFFSET: + return toString(edge->getLaneStruct(myIndex).endOffset); + case SUMO_ATTR_ACCELERATION: + return toString(edge->getLaneStruct(myIndex).accelRamp); + case SUMO_ATTR_CUSTOMSHAPE: + return toString(edge->getLaneStruct(myIndex).customShape); + case SUMO_ATTR_INDEX: + return toString(myIndex); + case GNE_ATTR_SELECTED: + return toString(isAttributeCarrierSelected()); + case GNE_ATTR_PARAMETERS: + return myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParametersStr(); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + +std::string +GNELane::getAttributeForSelection(SumoXMLAttr key) const { + std::string result = getAttribute(key); + if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) { + result += " " + getVehicleClassNames(SVCAll, true); + } + return result; +} + + +void +GNELane::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 SUMO_ATTR_ENDOFFSET: + case SUMO_ATTR_ACCELERATION: + case SUMO_ATTR_CUSTOMSHAPE: + case SUMO_ATTR_INDEX: + case GNE_ATTR_SELECTED: + case GNE_ATTR_PARAMETERS: + // no special handling + undoList->p_add(new GNEChange_Attribute(this, key, value)); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNELane::isValid(SumoXMLAttr key, const std::string& value) { + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_INDEX: + return false; + case SUMO_ATTR_SPEED: + return canParse(value); + case SUMO_ATTR_ALLOW: + case SUMO_ATTR_DISALLOW: + return canParseVehicleClasses(value); + case SUMO_ATTR_WIDTH: + return canParse(value) && ((parse(value) > 0) || (parse(value) == NBEdge::UNSPECIFIED_WIDTH)); + case SUMO_ATTR_ENDOFFSET: + return canParse(value) && (parse(value) >= 0); + case SUMO_ATTR_ACCELERATION: + return canParse(value); + case SUMO_ATTR_CUSTOMSHAPE: { + // A lane shape can either be empty or have more than 1 element + if (value.empty()) { + return true; + } else if (canParse(value)) { + return parse(value).size() > 1; + } + return false; + } + case GNE_ATTR_SELECTED: + return canParse(value); + case GNE_ATTR_PARAMETERS: + return Parameterised::areParametersValid(value); + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +bool +GNELane::isAttributeEnabled(SumoXMLAttr key) const { + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_INDEX: + return false; + default: + return true; + } +} + + +void +GNELane::setSpecialColor(const RGBColor* color, double colorValue) { + mySpecialColor = color; + mySpecialColorValue = colorValue; +} + + +void +GNELane::drawPartialE2DetectorPlan(const GUIVisualizationSettings& s, const GNEAdditional* E2Detector, const GNEJunction* junction) const { + // calculate E2Detector width + const double E2DetectorWidth = s.addSize.getExaggeration(s, E2Detector); + // check if E2 can be drawn + if (s.drawAdditionals(E2DetectorWidth) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // obtain color + RGBColor E2DetectorColor; + if (E2Detector->drawUsingSelectColor()) { + E2DetectorColor = s.colorSettings.selectedRouteColor; + } else { + E2DetectorColor = s.detectorSettings.E2Color; + } + // Start drawing adding an gl identificator + glPushName(E2Detector->getGlID()); + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, E2Detector->getType()); + // draw E2Detector + if (junction) { + // iterate over segments + for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) { + // draw partial segment + if ((segment.junction == junction) && (segment.AC == E2Detector)) { + // Set E2Detector color (needed due drawShapeDottedContour) + GLHelper::setColor(E2DetectorColor); + // draw box lines + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == E2Detector) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth); + } + } + } + } else { + // iterate over segments + for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) { + // draw partial segment + if ((segment.lane == this) && (segment.AC == E2Detector)) { + // Set E2Detector color (needed due drawShapeDottedContour) + GLHelper::setColor(E2DetectorColor); + // draw box lines + GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth); + // check if shape dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == E2Detector) { + GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth); + } + } + } + } + // Pop last matrix + glPopMatrix(); + // Draw name if isn't being drawn for selecting + if (!s.drawForRectangleSelection) { + drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); + } + // Pop name + glPopName(); + } +} + +// =========================================================================== +// private +// =========================================================================== + +void +GNELane::setAttribute(SumoXMLAttr key, const std::string& value) { + NBEdge* edge = myParentEdge->getNBEdge(); + switch (key) { + case SUMO_ATTR_ID: + case SUMO_ATTR_INDEX: + throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); + case SUMO_ATTR_SPEED: + edge->setSpeed(myIndex, parse(value)); + break; + case SUMO_ATTR_ALLOW: + edge->setPermissions(parseVehicleClasses(value), myIndex); + break; + case SUMO_ATTR_DISALLOW: + edge->setPermissions(invertPermissions(parseVehicleClasses(value)), myIndex); + break; + case SUMO_ATTR_WIDTH: + edge->setLaneWidth(myIndex, parse(value)); + break; + case SUMO_ATTR_ENDOFFSET: + edge->setEndOffset(myIndex, parse(value)); + break; + case SUMO_ATTR_ACCELERATION: + edge->setAcceleration(myIndex, parse(value)); + break; + case SUMO_ATTR_CUSTOMSHAPE: { + // first remove parent edge from net + myNet->removeGLObjectFromGrid(myParentEdge); + // set new shape + edge->setLaneShape(myIndex, parse(value)); + // add parent edge into net again + myNet->addGLObjectIntoGrid(myParentEdge); + break; + } + case GNE_ATTR_SELECTED: + if (parse(value)) { + selectAttributeCarrier(); + } else { + unselectAttributeCarrier(); + } + break; + case GNE_ATTR_PARAMETERS: + myParentEdge->getNBEdge()->getLaneStruct(myIndex).setParametersStr(value); + break; + default: + throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); + } +} + + +void +GNELane::updateDottedContour() { + // +} + + +RGBColor +GNELane::setLaneColor(const GUIVisualizationSettings& s) const { + // we need to draw lanes with a special color if we're inspecting a Trip or Flow and this lane belongs to a via's edge. + if (myNet->getViewNet()->getDottedAC() && (myNet->getViewNet()->getDottedAC()->isAttributeCarrierSelected() == false) && + ((myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_TRIP) || + (myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_FLOW))) { + // obtain attribute "via" + std::vector viaEdges = parse >(myNet->getViewNet()->getDottedAC()->getAttribute(SUMO_ATTR_VIA)); + // iterate over viaEdges + for (const auto& i : viaEdges) { + // check if parent edge is in the via edges + if (myParentEdge->getID() == i) { + // set green color in GLHelper and return it + GLHelper::setColor(RGBColor::GREEN); + return RGBColor::GREEN; + } + } + } + // declare a RGBColor variable + RGBColor color; + if (mySpecialColor != nullptr) { + // If special color is enabled, set it + color = *mySpecialColor; + } else if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { + // override with special colors (unless the color scheme is based on selection) + color = s.colorSettings.selectedLaneColor; + } else if (myParentEdge->drawUsingSelectColor() && s.laneColorer.getActive() != 1) { + // override with special colors (unless the color scheme is based on selection) + color = s.colorSettings.selectedEdgeColor; + } else { + // Get normal lane color + const GUIColorer& c = s.laneColorer; + if (!setFunctionalColor(c.getActive(), color) && !setMultiColor(s, c, color)) { + color = c.getScheme().getColor(getColorValue(s, c.getActive())); + } + } + // check if we're in data mode + if (myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) { + color = s.laneColorer.getSchemes()[0].getColor(11); + } + // check if we have to change color if parent edge has generic data elements + for (const auto& genericData : myParentEdge->getChildGenericDataElements()) { + if (genericData->isGenericDataVisible()) { + if (genericData->isAttributeCarrierSelected()) { + color = s.colorSettings.selectedEdgeDataColor; + } else { + color = genericData->getColor(); + } + } + } + // set color in GLHelper + GLHelper::setColor(color); + return color; +} + +bool +GNELane::setFunctionalColor(int activeScheme, RGBColor& col) const { + switch (activeScheme) { + case 6: { + double hue = GeomHelper::naviDegree(myLaneGeometry.getShape().beginEndAngle()); // [0-360] + col = RGBColor::fromHSV(hue, 1., 1.); + return true; + } + default: + return false; + } +} + + +bool +GNELane::setMultiColor(const GUIVisualizationSettings& s, const GUIColorer& c, RGBColor& col) const { + const int activeScheme = c.getActive(); + myShapeColors.clear(); + switch (activeScheme) { + case 9: // color by height at segment start + for (PositionVector::const_iterator ii = myLaneGeometry.getShape().begin(); ii != myLaneGeometry.getShape().end() - 1; ++ii) { + myShapeColors.push_back(c.getScheme().getColor(ii->z())); + } + col = c.getScheme().getColor(getColorValue(s, 8)); + return true; + case 11: // color by inclination at segment start + for (int ii = 1; ii < (int)myLaneGeometry.getShape().size(); ++ii) { + const double inc = (myLaneGeometry.getShape()[ii].z() - myLaneGeometry.getShape()[ii - 1].z()) / MAX2(POSITION_EPS, myLaneGeometry.getShape()[ii].distanceTo2D(myLaneGeometry.getShape()[ii - 1])); + myShapeColors.push_back(c.getScheme().getColor(inc)); + } + col = c.getScheme().getColor(getColorValue(s, 10)); + return true; + default: + return false; + } +} + + +double +GNELane::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const { + const SVCPermissions myPermissions = myParentEdge->getNBEdge()->getPermissions(myIndex); + if (mySpecialColor != nullptr && mySpecialColorValue != std::numeric_limits::max()) { + return mySpecialColorValue; + } + switch (activeScheme) { + case 0: + switch (myPermissions) { + case SVC_PEDESTRIAN: + return 1; + case SVC_BICYCLE: + return 2; + case 0: + // forbidden road or green verge + return myParentEdge->getNBEdge()->getPermissions() == 0 ? 10 : 3; + case SVC_SHIP: + return 4; + case SVC_AUTHORITY: + return 8; + default: + break; + } + if (myParentEdge->getNBEdge()->isMacroscopicConnector()) { + return 9; + } else if (isRailway(myPermissions)) { + return 5; + } else if ((myPermissions & SVC_PASSENGER) != 0) { + if ((myPermissions & (SVC_RAIL_CLASSES & ~SVC_RAIL_FAST)) != 0 && (myPermissions & SVC_SHIP) == 0) { + return 6; + } else { + return 0; + } + } else { + return 7; + } + case 1: + return isAttributeCarrierSelected() || myParentEdge->isAttributeCarrierSelected(); + case 2: + return (double)myPermissions; + case 3: + return myParentEdge->getNBEdge()->getLaneSpeed(myIndex); + case 4: + return myParentEdge->getNBEdge()->getNumLanes(); + case 5: { + return myParentEdge->getNBEdge()->getLoadedLength() / myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape.length(); + } + // case 6: by angle (functional) + case 7: { + return myParentEdge->getNBEdge()->getPriority(); + } + case 8: { + // color by z of first shape point + return myLaneGeometry.getShape()[0].z(); + } + // case 9: by segment height + case 10: { + // color by incline + return (myLaneGeometry.getShape()[-1].z() - myLaneGeometry.getShape()[0].z()) / myParentEdge->getNBEdge()->getLength(); + } + // case 11: by segment incline + + case 12: { + // by numerical edge param value + try { + return StringUtils::toDouble(myParentEdge->getNBEdge()->getParameter(s.edgeParam, "0")); + } catch (NumberFormatException&) { + try { + return StringUtils::toBool(myParentEdge->getNBEdge()->getParameter(s.edgeParam, "0")); + } catch (BoolFormatException&) { + return -1; + } + } + } + case 13: { + // by numerical lane param value + try { + return StringUtils::toDouble(myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParameter(s.laneParam, "0")); + } catch (NumberFormatException&) { + try { + return StringUtils::toBool(myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParameter(s.laneParam, "0")); + } catch (BoolFormatException&) { + return -1; + } + } + } + case 14: { + return myParentEdge->getNBEdge()->getDistance(); + } + case 15: { + return fabs(myParentEdge->getNBEdge()->getDistance()); + } + } + return 0; +} + + +bool +GNELane::drawAsRailway(const GUIVisualizationSettings& s) const { + return isRailway(myParentEdge->getNBEdge()->getPermissions(myIndex)) && s.showRails && (!s.drawForRectangleSelection || s.spreadSuperposed); +} + + +bool +GNELane::drawAsWaterway(const GUIVisualizationSettings& s) const { + return isWaterway(myParentEdge->getNBEdge()->getPermissions(myIndex)) && s.showRails && !s.drawForRectangleSelection; // reusing the showRails setting +} + + +void +GNELane::drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const { + const double width = MAX2(NUMERICAL_EPS, (myParentEdge->getNBEdge()->getLaneWidth(myIndex) * exaggeration + * (spreadSuperposed ? 0.4 : 1))); + const double sideOffset = spreadSuperposed ? width * -0.5 : 0; + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION + 0.1); + int e = (int) myLaneGeometry.getShape().size() - 1; + for (int i = 0; i < e; ++i) { + glPushMatrix(); + glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 0.1); + glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1); + for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += width) { + const double length = MIN2(width * 0.5, myLaneGeometry.getShapeLengths()[i] - t); + glBegin(GL_TRIANGLES); + glVertex2d(sideOffset, -t - length); + glVertex2d(sideOffset - width * 0.25, -t); + glVertex2d(sideOffset + width * 0.25, -t); + glEnd(); + } + glPopMatrix(); + } + glPopMatrix(); +} + + +void +GNELane::drawVSSSymbol(const GUIVisualizationSettings& s, GNEAdditional* vss) const { + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, vss); + // first check if additional has to be drawn + if (s.drawAdditionals(exaggeration) && myNet->getViewNet()->getDataViewOptions().showAdditionals()) { + // obtain lanePos and route + const Position& lanePos = vss->getChildPosition(this); + const double laneRot = vss->getChildRotation(this); + // Start drawing adding an VSS gl identificator (used to identify element after clicking) + glPushName(vss->getGlID()); + // start drawing symbol + glPushMatrix(); + glTranslated(lanePos.x(), lanePos.y(), vss->getType()); + glRotated(-1 * laneRot, 0, 0, 1); + glTranslated(0, -1.5, 0); + glScaled(exaggeration, exaggeration, 1); + // draw circle + int noPoints = 9; + if (s.scale > 25) { + noPoints = (int)(9.0 + s.scale / 10.0); + if (noPoints > 36) { + noPoints = 36; + } + } + glColor3d(1, 0, 0); + GLHelper::drawFilledCircle((double) 1.3, noPoints); + if (!s.drawForRectangleSelection && (s.scale >= 5)) { + glTranslated(0, 0, .1); + glColor3d(0, 0, 0); + GLHelper::drawFilledCircle((double) 1.1, noPoints); + // draw the speed string + glColor3d(1, 1, 0); + glTranslated(0, 0, .1); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + // draw last value string + GLHelper::drawText("S", Position(0, 0), .1, 1.2, RGBColor(255, 255, 0), 180); + } + // Pop symbol matrix + glPopMatrix(); + // Pop VSS name + glPopName(); + // check if dotted contour has to be drawn + if (myNet->getViewNet()->getDottedAC() == vss) { + GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.6, 2.6, -1 * laneRot, 0, -1.5); + } + // Draw connections + vss->drawChildConnections(s, getType()); + } +} + + +void +GNELane::drawStartEndShapePoints(const GUIVisualizationSettings& s) const { + GLHelper::setColor(s.junctionColorer.getSchemes()[0].getColor(2)); + if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { + // override with special colors (unless the color scheme is based on selection) + GLHelper::setColor(s.colorSettings.selectedEdgeColor.changedBrightness(-20)); + } + // obtain circle width and resolution + double circleWidth = GNEEdge::SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration) / 2; + // Obtain exaggeration of the draw + const double exaggeration = s.addSize.getExaggeration(s, this); + // obtain custom shape + const PositionVector& customShape = myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape; + // draw s depending of detail + if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { + glPushMatrix(); + glTranslated(customShape.front().x(), customShape.front().y(), GLO_JUNCTION + 0.01); + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + if (!s.drawForPositionSelection) { + glTranslated(0, 0, 0.01); + GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE); + } + glPopMatrix(); + } + // draw line between Junction and point + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION - 0.01); + glLineWidth(4); + GLHelper::drawLine(customShape.front(), myParentEdge->getGNEJunctionSource()->getPositionInView()); + glPopMatrix(); + // draw "e" depending of detail + if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { + glPushMatrix(); + glTranslated(customShape.back().x(), customShape.back().y(), GLO_JUNCTION + 0.01); + GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); + if (!s.drawForPositionSelection) { + glTranslated(0, 0, 0.01); + GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE); + } + glPopMatrix(); + } + // draw line between Junction and point + glPushMatrix(); + glTranslated(0, 0, GLO_JUNCTION - 0.01); + glLineWidth(4); + GLHelper::drawLine(customShape.back(), myParentEdge->getGNEJunctionDestiny()->getPositionInView()); + glPopMatrix(); +} + + +std::string +GNELane::getParentName() const { + return myParentEdge->getID(); +} + + +long +GNELane::onDefault(FXObject* obj, FXSelector sel, void* data) { + myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->handleMultiChange(this, obj, sel, data); + return 1; +} + + +GNEEdge* +GNELane::getParentEdge() const { + return myParentEdge; +} + + +std::vector +GNELane::getGNEIncomingConnections() { + // Declare a vector to save incoming connections + std::vector incomingConnections; + // Obtain incoming edges if junction source was already created + GNEJunction* junctionSource = myParentEdge->getGNEJunctionSource(); + if (junctionSource) { + // Iterate over incoming GNEEdges of junction + for (auto i : junctionSource->getGNEIncomingEdges()) { + // Iterate over connection of incoming edges + for (auto j : i->getGNEConnections()) { + if (j->getNBEdgeConnection().fromLane == getIndex()) { + incomingConnections.push_back(j); + } + } + } + } + return incomingConnections; +} + + +std::vector +GNELane::getGNEOutcomingConnections() { + // Obtain GNEConnection of parent edge + const std::vector& edgeConnections = myParentEdge->getGNEConnections(); + std::vector outcomingConnections; + // Obtain outgoing connections + for (auto i : edgeConnections) { + if (i->getNBEdgeConnection().fromLane == getIndex()) { + outcomingConnections.push_back(i); + } + } + return outcomingConnections; +} + + +void +GNELane::updateConnectionIDs() { + // update incoming connections of lane + std::vector incomingConnections = getGNEIncomingConnections(); + for (auto i : incomingConnections) { + i->updateID(); + } + // update outocming connections of lane + std::vector outcomingConnections = getGNEOutcomingConnections(); + for (auto i : outcomingConnections) { + i->updateID(); + } +} + + +double +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())); + } else { + return POSITION_EPS; + }; +} + + +void +GNELane::startGeometryMoving() { + // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge + // Save current centering boundary of child additional + for (auto i : getChildAdditionals()) { + i->startGeometryMoving(); + } + // Save current centering boundary of additionals with this lane as chid + for (auto i : getParentAdditionals()) { + i->startGeometryMoving(); + } + // Save current centering boundary of child demand elements + for (auto i : getChildDemandElements()) { + i->startGeometryMoving(); + } + // Save current centering boundary of demand element with this lane as chid + for (auto i : getParentDemandElements()) { + i->startGeometryMoving(); + } +} + + +void +GNELane::endGeometryMoving() { + // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge + // Restore centering boundary of additionals with this lane as chid + for (auto i : getChildAdditionals()) { + i->endGeometryMoving(); + } + // Restore centering boundary of additionals with this lane as chid + for (auto i : getParentAdditionals()) { + i->endGeometryMoving(); + } + // Restore centering boundary of demand elements with this lane as chid + for (auto i : getChildDemandElements()) { + i->endGeometryMoving(); + } + // Restore centering boundary of demand elements with this lane as chid + for (auto i : getParentDemandElements()) { + i->endGeometryMoving(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNELane.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNELane.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNELane.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNELane.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,289 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNELane.h +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// A class for visualizing Lane geometry (adapted from GUILaneWrapper) +/****************************************************************************/ +#pragma once +#include + +#include "GNENetworkElement.h" + +// =========================================================================== +// class declarations +// =========================================================================== +class GUIGLObjectPopupMenu; +class PositionVector; +class GNETLSEditorFrame; +class GNEEdge; +class GNENet; +class GNEConnection; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNELane + * @brief This lane is powered by an underlying GNEEdge and basically knows how + * to draw itself + */ +class GNELane : public GNENetworkElement, public FXDelegator { + /// @brief FOX-declaration + FXDECLARE(GNELane) + +public: + /**@brief Constructor + * @param[in] idStorage The storage of gl-ids to get the one for this lane representation from + * @param[in] the edge this lane belongs to + * @param[in] the index of this lane + */ + GNELane(GNEEdge* edge, const int index); + + /// @brief Destructor + ~GNELane(); + + /// @brief gererate a new ID for an element child + std::string generateChildID(SumoXMLTag childTag); + + /// @name Functions related with geometry of element + /// @{ + /// @brief get elements shape + const PositionVector& getLaneShape() const; + + /// @brief get rotations of the single shape parts + const std::vector& getShapeRotations() const; + + /// @brief get lengths of the single shape parts + const std::vector& getShapeLengths() const; + + /// @brief update pre-computed geometry information + void updateGeometry(); + + /// @brief Returns position of hierarchical element in view + Position getPositionInView() const; + /// @} + + /// @brief Returns underlying parent edge + GNEEdge* getParentEdge() const; + + /// @brief returns a vector with the incoming GNEConnections of this lane + std::vector getGNEIncomingConnections(); + + /// @brief returns a vector with the outgoing GNEConnections of this lane + std::vector getGNEOutcomingConnections(); + + /// @brief update IDs of incoming connections of this lane + void updateConnectionIDs(); + + /// @brief get length geometry factor + double getLengthGeometryFactor() const; + + /// @name functions for edit geometry + /// @{ + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void startGeometryMoving(); + + /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) + void endGeometryMoving(); + /// @} + + /// @name inherited from GUIGlObject + /// @{ + // @brief Returns the name of the parent object (if any) + // @return This object's parent id + std::string getParentName() const; + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /// @brief multiplexes message to two targets + long onDefault(FXObject*, FXSelector, void*); + + /**@brief Returns the boundary to which the view shall be centered in order to show the object + * + * @return The boundary the object is within + * @see GUIGlObject::getCenteringBoundary + */ + Boundary getCenteringBoundary() const; + + /**@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; + /// @} + + /// @brief returns the index of the lane + int getIndex() const; + + /// @brief returns the current speed of lane + double getSpeed() const; + + /* @brief method for setting the index of the lane + * @param[in] index The new index of lane + */ + void setIndex(int index); + + /** @brief returns the parameteric length of the lane + * @note is the same as their Edge parent, and cannot be never nullptr + */ + double getLaneParametricLength() const; + + /// @brief returns the length of the lane's shape + double getLaneShapeLength() const; + + /// @brief check if this lane is restricted + bool isRestricted(SUMOVehicleClass vclass) const; + + /// @brief get Lane2laneConnection struct + const GNEGeometry::Lane2laneConnection& getLane2laneConnections() const; + + /// @name 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; + std::string getAttributeForSelection(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 checking if the key and their correspond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + bool isValid(SumoXMLAttr key, const std::string& value); + + /* @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 setting the special color of the lane + * @param[in] color Pointer to new special color + */ + void setSpecialColor(const RGBColor* Color2, double colorValue = std::numeric_limits::max()); + + /// @brief return value for lane coloring according to the given scheme + double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const; + + /// @brief whether to draw this lane as a railway + bool drawAsRailway(const GUIVisualizationSettings& s) const; + + /// @brief draw partial E2 detector plan + void drawPartialE2DetectorPlan(const GUIVisualizationSettings& s, const GNEAdditional* E2Detector, const GNEJunction* junction) const; + +protected: + /// @brief FOX needs this + GNELane(); + + /// @brief The Edge that to which this lane belongs + GNEEdge* myParentEdge; + + /// @brief The index of this lane + int myIndex; + + /// @brief lane geometry + GNEGeometry::Geometry myLaneGeometry; + + /// @name computed only once (for performance) in updateGeometry() + /// @{ + + /// @brief Position of textures of restricted lanes + std::vector myLaneRestrictedTexturePositions; + + /// @brief Rotations of textures of restricted lanes + std::vector myLaneRestrictedTextureRotations; + /// @} + + /// @brief optional special color + const RGBColor* mySpecialColor = nullptr; + + /// @brief optional value that corresponds to which the special color corresponds + double mySpecialColorValue = -1; + + /// @brief The color of the shape parts (cached) + mutable std::vector myShapeColors; + + /// @brief lane2lane connections + GNEGeometry::Lane2laneConnection myLane2laneConnections; + +private: + /// @brief set attribute after validation + void setAttribute(SumoXMLAttr key, const std::string& value); + + /// @brief update dotted contour + void updateDottedContour(); + + /// @brief draw lane markings + void drawMarkings(const GUIVisualizationSettings& s, double scale) const; + + /// @brief draw link Number + void drawLinkNo(const GUIVisualizationSettings& s) const; + + /// @brief draw TLS Link Number + void drawTLSLinkNo(const GUIVisualizationSettings& s) const; + + /// @brief draw link rules + void drawLinkRules(const GUIVisualizationSettings& s) const; + + /// @brief draw arrows + void drawArrows(const GUIVisualizationSettings& s) const; + + /// @brief draw lane to lane connections + void drawLane2LaneConnections() const; + + /// @brief sets the color according to the current scheme index and some lane function + bool setFunctionalColor(int activeScheme, RGBColor& col) const; + + /// @brief sets multiple colors according to the current scheme index and some lane function + bool setMultiColor(const GUIVisualizationSettings& s, const GUIColorer& c, RGBColor& col) const; + + /// @brief whether to draw this lane as a waterways + bool drawAsWaterway(const GUIVisualizationSettings& s) const; + + /// @brief direction indicators for lanes + void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const; + + /// @brief draw VSS symbol + void drawVSSSymbol(const GUIVisualizationSettings& s, GNEAdditional* vss) const; + + /// @brief draw start and end shape points + void drawStartEndShapePoints(const GUIVisualizationSettings& s) const; + + /// @brief set color according to edit mode and visualisation settings + RGBColor setLaneColor(const GUIVisualizationSettings& s) const; + + /// @brief Invalidated copy constructor. + GNELane(const GNELane&) = delete; + + /// @brief Invalidated assignment operator. + GNELane& operator=(const GNELane&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNENetworkElement.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNENetworkElement.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNENetworkElement.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNENetworkElement.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,144 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNENetworkElement.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A abstract class for networkElements +/****************************************************************************/ +#include + +#include +#include +#include + +#include "GNENetworkElement.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNENetworkElement::GNENetworkElement(GNENet* net, const std::string& id, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren) : + GUIGlObject(type, id), + GNEAttributeCarrier(tag, net), + GNEHierarchicalParentElements(this, junctionParents, edgeParents, laneParents, shapeParents, additionalParents, demandElementParents, genericDataParents), + GNEHierarchicalChildElements(this, junctionChildren, edgeChildren, laneChildren, shapeChildren, additionalChildren, demandElementChildren, genericDataChildren), + myMovingGeometryBoundary() { +} + + +GNENetworkElement::~GNENetworkElement() {} + + +const std::string& +GNENetworkElement::getID() const { + return getMicrosimID(); +} + + +GUIGlObject* +GNENetworkElement::getGUIGlObject() { + return this; +} + + +void +GNENetworkElement::updateDottedGeometry(const PositionVector& shape) { + myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), shape); +} + + +std::string +GNENetworkElement::generateChildID(SumoXMLTag /*childTag*/) { + return ""; +} + + +GUIParameterTableWindow* +GNENetworkElement::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { + // Create table + GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); + // Iterate over attributes + for (const auto& i : myTagProperty) { + // Add attribute and set it dynamic if aren't unique + if (i.isUnique()) { + ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); + } else { + ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); + } + } + // close building + ret->closeBuilding(); + return ret; +} + + +void +GNENetworkElement::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +void +GNENetworkElement::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { + // +} + + +std::string +GNENetworkElement::getPopUpID() const { + if (myTagProperty.getTag() == SUMO_TAG_CONNECTION) { + return getAttribute(SUMO_ATTR_FROM) + "_" + getAttribute(SUMO_ATTR_FROM_LANE) + " -> " + getAttribute(SUMO_ATTR_TO) + "_" + getAttribute(SUMO_ATTR_TO_LANE); + } else { + return getTagStr() + ": " + getID(); + } +} + + +std::string +GNENetworkElement::getHierarchyName() const { + if (myTagProperty.getTag() == SUMO_TAG_LANE) { + return toString(SUMO_TAG_LANE) + " " + getAttribute(SUMO_ATTR_INDEX); + } else if (myTagProperty.getTag() == SUMO_TAG_CONNECTION) { + return getAttribute(SUMO_ATTR_FROM_LANE) + " -> " + getAttribute(SUMO_ATTR_TO_LANE); + } else if ((myTagProperty.getTag() == SUMO_TAG_EDGE) || (myTagProperty.getTag() == SUMO_TAG_CROSSING)) { + return getPopUpID(); + } else { + return getTagStr(); + } +} + + +void +GNENetworkElement::setEnabledAttribute(const int /*enabledAttributes*/) { + // +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNENetworkElement.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNENetworkElement.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNENetworkElement.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNENetworkElement.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,205 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNENetworkElement.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A abstract class for network elements +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== + +class GNEAdditional; +class GNEDemandElement; + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNENetworkElement : public GUIGlObject, public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { + +public: + /**@brief Constructor. + * @param[in] net The net to inform about gui updates + * @param[in] id of the element + * @param[in] type type of GL object + * @param[in] tag sumo xml tag of the element + * @param[in] junctionParents vector of junction parents + * @param[in] edgeParents vector of edge parents + * @param[in] laneParents vector of lane parents + * @param[in] shapeParents vector of shape parents + * @param[in] additionalParents vector of additional parents + * @param[in] demandElementParents vector of demand element parents + * @param[in] genericDataParents vector of generic data parents + * @param[in] junctionChildren vector of junction children + * @param[in] edgeChildren vector of edge children + * @param[in] laneChildren vector of lane children + * @param[in] shapeChildren vector of shape children + * @param[in] additionalChildren vector of additional children + * @param[in] demandElementChildren vector of demandElement children + * @param[in] genericDataChildren vector of genericData children + */ + GNENetworkElement(GNENet* net, const std::string& id, GUIGlObjectType type, SumoXMLTag tag, + const std::vector& junctionParents, + const std::vector& edgeParents, + const std::vector& laneParents, + const std::vector& shapeParents, + const std::vector& additionalParents, + const std::vector& demandElementParents, + const std::vector& genericDataParents, + const std::vector& junctionChildren, + const std::vector& edgeChildren, + const std::vector& laneChildren, + const std::vector& shapeChildren, + const std::vector& additionalChildren, + const std::vector& demandElementChildren, + const std::vector& genericDataChildren); + + /// @brief Destructor + virtual ~GNENetworkElement(); + + /// @brief get ID + const std::string& getID() const; + + /// @brief get GUIGlObject associated with this AttributeCarrier + GUIGlObject* getGUIGlObject(); + + /// @brief updated dotted geometry + void updateDottedGeometry(const PositionVector& shape); + + /// @brief gererate a new ID for an element child + virtual std::string generateChildID(SumoXMLTag childTag) = 0; + + /// @name Functions related with geometry of element + /// @{ + /// @brief update pre-computed geometry information + virtual void updateGeometry() = 0; + + /// @brief update dotted contour + virtual void updateDottedContour() = 0; + + /// @brief Returns position of hierarchical element in view + virtual Position getPositionInView() const = 0; + /// @} + + /// @name inherited from GUIGlObject + /// @{ + + /**@brief Returns an own parameter window + * + * @param[in] app The application needed to build the parameter window + * @param[in] parent The parent window needed to build the parameter window + * @return The built parameter window + * @see GUIGlObject::getParameterWindow + */ + GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); + + /**@brief Returns an own popup-menu + * + * @param[in] app The application needed to build the popup-menu + * @param[in] parent The parent window needed to build the popup-menu + * @return The built popup-menu + * @see GUIGlObject::getPopUpMenu + */ + virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; + + /// @brief Returns the boundary to which the view shall be centered in order to show the object + virtual Boundary getCenteringBoundary() const = 0; + + /**@brief Draws the object + * @param[in] s The settings for the current view (may influence drawing) + * @see GUIGlObject::drawGL + */ + virtual void drawGL(const GUIVisualizationSettings& s) const = 0; + /// @} + + /// @name 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 + */ + virtual std::string getAttribute(SumoXMLAttr key) const = 0; + + /* @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 + */ + virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; + + /* @brief method for checking if the key and their conrrespond attribute are valids + * @param[in] key The attribute key + * @param[in] value The value asociated to key key + * @return true if the value is valid, false in other case + */ + virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; + + /* @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 + */ + virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; + + /// @brief get PopPup ID (Used in AC Hierarchy) + std::string getPopUpID() const; + + /// @brief get Hierarchy Name (Used in AC Hierarchy) + std::string getHierarchyName() const; + /// @} + +protected: + /// @brief boundary used during moving of elements + Boundary myMovingGeometryBoundary; + + /// @brief position used during moving + Position myMovingPosition; + +private: + /// @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 Invalidated copy constructor. + GNENetworkElement(const GNENetworkElement&) = delete; + + /// @brief Invalidated assignment operator. + GNENetworkElement& operator=(const GNENetworkElement&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEProhibition.cpp sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEProhibition.cpp --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEProhibition.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEProhibition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,34 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEProhibition.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A class for visualizing prohibitions between edges +/****************************************************************************/ +#include "GNEProhibition.h" + + + +// =========================================================================== +// static member definitions +// =========================================================================== + + +// =========================================================================== +// method definitions +// =========================================================================== + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEProhibition.h sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEProhibition.h --- sumo-1.5.0+dfsg1/src/netedit/elements/network/GNEProhibition.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/elements/network/GNEProhibition.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,30 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEProhibition.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2016 +/// +// A class for represent prohibitions between edges +/****************************************************************************/ +#pragma once +#include "GNENetworkElement.h" + +// =========================================================================== +// class declarations +// =========================================================================== + + +// =========================================================================== +// class definitions +// =========================================================================== diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/frames/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/frames/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -1,3 +1,8 @@ +add_subdirectory(common) +add_subdirectory(network) +add_subdirectory(demand) +add_subdirectory(data) + set(netedit_frames_SRCS GNEFrame.h GNEFrame.cpp @@ -5,42 +10,6 @@ GNEFrameModuls.cpp GNEFrameAttributesModuls.h GNEFrameAttributesModuls.cpp - GNEInspectorFrame.h - GNEInspectorFrame.cpp - GNESelectorFrame.h - GNESelectorFrame.cpp - GNEConnectorFrame.h - GNEConnectorFrame.cpp - GNETLSEditorFrame.h - GNETLSEditorFrame.cpp - GNEAdditionalFrame.h - GNEAdditionalFrame.cpp - GNECrossingFrame.h - GNECrossingFrame.cpp - GNETAZFrame.h - GNETAZFrame.cpp - GNEDeleteFrame.h - GNEDeleteFrame.cpp - GNEPolygonFrame.h - GNEPolygonFrame.cpp - GNECreateEdgeFrame.h - GNECreateEdgeFrame.cpp - GNERouteFrame.h - GNERouteFrame.cpp - GNEStopFrame.h - GNEStopFrame.cpp - GNEPersonFrame.h - GNEPersonFrame.cpp - GNEPersonPlanFrame.h - GNEPersonPlanFrame.cpp - GNEVehicleFrame.h - GNEVehicleFrame.cpp - GNEVehicleTypeFrame.h - GNEVehicleTypeFrame.cpp - GNEPersonTypeFrame.h - GNEPersonTypeFrame.cpp - GNEProhibitionFrame.h - GNEProhibitionFrame.cpp ) add_library(netedit_frames STATIC ${netedit_frames_SRCS}) diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/frames/common/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/frames/common/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,11 @@ +set(netedit_frames_common_SRCS + GNEInspectorFrame.h + GNEInspectorFrame.cpp + GNESelectorFrame.h + GNESelectorFrame.cpp + GNEDeleteFrame.h + GNEDeleteFrame.cpp + ) + +add_library(netedit_frames_common STATIC ${netedit_frames_common_SRCS}) +set_property(TARGET netedit_frames_common PROPERTY PROJECT_LABEL "z_netedit_frames_common") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,536 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDeleteFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2016 +/// +// The Widget for remove network-elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEDeleteFrame.h" + + +// --------------------------------------------------------------------------- +// GNEDeleteFrame::DeleteOptions - methods +// --------------------------------------------------------------------------- + +GNEDeleteFrame::DeleteOptions::DeleteOptions(GNEDeleteFrame* deleteFrameParent) : + FXGroupBox(deleteFrameParent->myContentFrame, "Options", GUIDesignGroupBoxFrame) { + + // Create checkbox for enable/disable delete only geomtery point(by default, disabled) + myDeleteOnlyGeometryPoints = new FXCheckButton(this, "Delete only geometryPoints", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + myDeleteOnlyGeometryPoints->setCheck(FALSE); + + // 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->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->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->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->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->setCheck(TRUE); +} + + +GNEDeleteFrame::DeleteOptions::~DeleteOptions() {} + + +bool +GNEDeleteFrame::DeleteOptions::deleteOnlyGeometryPoints() const { + return (myDeleteOnlyGeometryPoints->getCheck() == TRUE); +} + + +bool +GNEDeleteFrame::DeleteOptions::protectAdditionals() const { + return (myProtectAdditionals->getCheck() == TRUE); +} + + +bool +GNEDeleteFrame::DeleteOptions::protectTAZs() const { + return (myProtectTAZs->getCheck() == TRUE); +} + + +bool +GNEDeleteFrame::DeleteOptions::protectShapes() const { + return (myProtectShapes->getCheck() == TRUE); +} + + +bool +GNEDeleteFrame::DeleteOptions::protectDemandElements() const { + return (myProtectDemandElements->getCheck() == TRUE); +} + + +bool +GNEDeleteFrame::DeleteOptions::protectGenericDatas() const { + return (myProtectGenericDatas->getCheck() == TRUE); +} + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Delete") { + // create delete options modul + myDeleteOptions = new DeleteOptions(this); +} + + +GNEDeleteFrame::~GNEDeleteFrame() {} + + +void +GNEDeleteFrame::show() { + GNEFrame::show(); +} + + +void +GNEDeleteFrame::hide() { + GNEFrame::hide(); +} + + +void +GNEDeleteFrame::removeSelectedAttributeCarriers() { + // first check if there is additional to remove + if (selectedACsToDelete()) { + // remove all selected attribute carrier susing the following parent-child sequence + myViewNet->getUndoList()->p_begin("remove selected items"); + // disable update geometry + myViewNet->getNet()->disableUpdateGeometry(); + // delete selected attribute carriers depending of current supermode + if (myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + //junctions + auto selectedJunctions = myViewNet->getNet()->retrieveJunctions(true); + for (const auto& selectedJunction : selectedJunctions) { + myViewNet->getNet()->deleteJunction(selectedJunction, myViewNet->getUndoList()); + } + // edges + auto selectedEdges = myViewNet->getNet()->retrieveEdges(true); + for (const auto& selectedEdge : selectedEdges) { + myViewNet->getNet()->deleteEdge(selectedEdge, myViewNet->getUndoList(), false); + } + // lanes + auto selectedLanes = myViewNet->getNet()->retrieveLanes(true); + for (const auto& selectedLane : selectedLanes) { + myViewNet->getNet()->deleteLane(selectedLane, myViewNet->getUndoList(), false); + } + // connections + auto selectedConnections = myViewNet->getNet()->retrieveConnections(true); + for (const auto& selectedConnection : selectedConnections) { + myViewNet->getNet()->deleteConnection(selectedConnection, myViewNet->getUndoList()); + } + // crossings + auto selectedCrossings = myViewNet->getNet()->retrieveCrossings(true); + for (const auto& selectedCrossing : selectedCrossings) { + myViewNet->getNet()->deleteCrossing(selectedCrossing, myViewNet->getUndoList()); + } + // shapes + auto selectedShapes = myViewNet->getNet()->retrieveShapes(true); + for (const auto& selectedShape : selectedShapes) { + myViewNet->getNet()->deleteShape(selectedShape, myViewNet->getUndoList()); + } + // additionals (note: We need to use while (...) because there is a + while (myViewNet->getNet()->retrieveAdditionals(true).size() > 0) { + myViewNet->getNet()->deleteAdditional(myViewNet->getNet()->retrieveAdditionals(true).front(), myViewNet->getUndoList()); + } + } else if (myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // demand elements + while (myViewNet->getNet()->retrieveDemandElements(true).size() > 0) { + myViewNet->getNet()->deleteDemandElement(myViewNet->getNet()->retrieveDemandElements(true).front(), myViewNet->getUndoList()); + } + } else if (myViewNet->getEditModes().isCurrentSupermodeData()) { + // generic datas + auto selectedGenericDatas = myViewNet->getNet()->retrieveGenericDatas(true); + for (const auto& selectedGenericData : selectedGenericDatas) { + myViewNet->getNet()->deleteGenericData(selectedGenericData, myViewNet->getUndoList()); + } + } + // enable update geometry + myViewNet->getNet()->enableUpdateGeometry(); + // finish deletion + myViewNet->getUndoList()->p_end(); + } +} + + +void +GNEDeleteFrame::removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions) { + // first check if there is at leas an AC under cursor) + if (objectsUnderCursor.getAttributeCarrierFront()) { + // disable update geometry + myViewNet->getNet()->disableUpdateGeometry(); + // obtain clicked position + Position clickedPosition = myViewNet->getPositionInformation(); + // first check if we'll only delete a geometry point + if (myDeleteOptions->deleteOnlyGeometryPoints() && !ignoreOptions) { + // check type of of object under cursor object with geometry points + if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) { + if (objectsUnderCursor.getEdgeFront()->getEdgeVertexIndex(clickedPosition, false) != -1) { + objectsUnderCursor.getEdgeFront()->deleteEdgeGeometryPoint(clickedPosition); + } + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) { + if (objectsUnderCursor.getPolyFront()->getVertexIndex(clickedPosition, false) != -1) { + objectsUnderCursor.getPolyFront()->deleteGeometryPoint(clickedPosition); + } + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) { + if (objectsUnderCursor.getTAZFront()->getVertexIndex(clickedPosition, false) != -1) { + objectsUnderCursor.getTAZFront()->deleteGeometryPoint(clickedPosition); + } + } + } else { + // check type of of object under cursor object + if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { + // Check if junction can be deleted + if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getJunctionFront()).checkElements(myDeleteOptions)) { + myViewNet->getNet()->deleteJunction(objectsUnderCursor.getJunctionFront(), myViewNet->getUndoList()); + } + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) { + // check if click was over a geometry point or over a shape's edge + if (objectsUnderCursor.getEdgeFront()->getEdgeVertexIndex(clickedPosition, false) != -1) { + objectsUnderCursor.getEdgeFront()->deleteEdgeGeometryPoint(clickedPosition); + } else if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getEdgeFront()).checkElements(myDeleteOptions)) { + // if all ok, then delete edge + myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false); + } + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) { + // Check if edge can be deleted + if (ignoreOptions || SubordinatedElements(objectsUnderCursor.getLaneFront()).checkElements(myDeleteOptions)) { + // if all ok, then delete lane + myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false); + } + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CROSSING) { + myViewNet->getNet()->deleteCrossing(objectsUnderCursor.getCrossingFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) { + myViewNet->getNet()->deleteConnection(objectsUnderCursor.getConnectionFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) { + myViewNet->getNet()->deleteAdditional(objectsUnderCursor.getTAZFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getAttributeCarrierFront() && (objectsUnderCursor.getAdditionalFront() == objectsUnderCursor.getAttributeCarrierFront())) { + myViewNet->getNet()->deleteAdditional(objectsUnderCursor.getAdditionalFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getShapeFront() && (objectsUnderCursor.getShapeFront() == objectsUnderCursor.getAttributeCarrierFront())) { + myViewNet->getNet()->deleteShape(objectsUnderCursor.getShapeFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront() == objectsUnderCursor.getAttributeCarrierFront())) { + myViewNet->getNet()->deleteDemandElement(objectsUnderCursor.getDemandElementFront(), myViewNet->getUndoList()); + } else if (objectsUnderCursor.getGenericDataElementFront() && (objectsUnderCursor.getGenericDataElementFront() == objectsUnderCursor.getAttributeCarrierFront())) { + myViewNet->getNet()->deleteGenericData(objectsUnderCursor.getGenericDataElementFront(), myViewNet->getUndoList()); + } + } + // enable update geometry + myViewNet->getNet()->enableUpdateGeometry(); + // update view to show changes + myViewNet->updateViewNet(); + } +} + + +GNEDeleteFrame::DeleteOptions* +GNEDeleteFrame::getDeleteOptions() const { + return myDeleteOptions; +} + +// --------------------------------------------------------------------------- +// GNEDeleteFrame::SubordinatedElements - methods +// --------------------------------------------------------------------------- + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEJunction* junction) : + SubordinatedElements(junction, junction->getNet()->getViewNet(), junction, junction) { + // add the number of subodinated elements of child edges + for (const auto& edge : junction->getGNEEdges()) { + addValuesFromSubordinatedElements(this, edge); + } +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEEdge* edge) : + SubordinatedElements(edge, edge->getNet()->getViewNet(), edge, edge) { + // add the number of subodinated elements of child lanes + for (const auto& lane : edge->getLanes()) { + addValuesFromSubordinatedElements(this, lane); + } +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNELane* lane) : + SubordinatedElements(lane, lane->getNet()->getViewNet(), lane, lane) { +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEAdditional* additional) : + SubordinatedElements(additional, additional->getNet()->getViewNet()) { +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEShape* shape) : + SubordinatedElements(shape, shape->getNet()->getViewNet()) { +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEDemandElement* demandElement) : + SubordinatedElements(demandElement, demandElement->getNet()->getViewNet()) { +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEGenericData* genericData) : + SubordinatedElements(genericData, genericData->getNet()->getViewNet()) { +} + + +GNEDeleteFrame::SubordinatedElements::~SubordinatedElements() {} + + +bool +GNEDeleteFrame::SubordinatedElements::checkElements(const DeleteOptions* deleteOptions) { + // check every parent/child + if ((myAdditionalParents > 0) && deleteOptions->protectAdditionals()) { + openWarningDialog("additional", myAdditionalParents, false); + } else if ((myAdditionalChilds > 0) && deleteOptions->protectAdditionals()) { + openWarningDialog("additional", myAdditionalChilds, true); + } else if ((myTAZParents > 0) && deleteOptions->protectTAZs()) { + openWarningDialog("TAZ", myTAZParents, false); + } else if ((myTAZChilds > 0) && deleteOptions->protectTAZs()) { + openWarningDialog("TAZ", myTAZChilds, true); + } else if ((myShapeParents > 0) && deleteOptions->protectShapes()) { + openWarningDialog("shape", myShapeParents, false); + } else if ((myShapeChilds > 0) && deleteOptions->protectShapes()) { + openWarningDialog("shape", myShapeChilds, true); + } else if ((myDemandElementParents > 0) && deleteOptions->protectDemandElements()) { + openWarningDialog("demand", myDemandElementParents, false); + } else if ((myDemandElementChilds > 0) && deleteOptions->protectDemandElements()) { + openWarningDialog("demand", myDemandElementChilds, true); + } else if ((myGenericDataParents > 0) && deleteOptions->protectGenericDatas()) { + openWarningDialog("data", myGenericDataParents, false); + } else if ((myGenericDataChilds > 0) && deleteOptions->protectGenericDatas()) { + openWarningDialog("data", myGenericDataChilds, true); + } else { + // all checks ok, then return true, to remove element + return true; + } + return false; +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet) : + myAttributeCarrier(attributeCarrier), + myViewNet(viewNet), + myAdditionalParents(0), + myAdditionalChilds(0), + myTAZParents(0), + myTAZChilds(0), + myShapeParents(0), + myShapeChilds(0), + myDemandElementParents(0), + myDemandElementChilds(0), + myGenericDataParents(0), + myGenericDataChilds(0) { +} + + +GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet, + const GNEHierarchicalParentElements* hierarchicalParent, + const GNEHierarchicalChildElements* hierarchicalChild) : + myAttributeCarrier(attributeCarrier), + myViewNet(viewNet), + myAdditionalParents(hierarchicalParent->getNumberOfParentAdditionals(GNETagProperties::TagType::ADDITIONALELEMENT)), + myAdditionalChilds(hierarchicalChild->getNumberOfChildAdditionals(GNETagProperties::TagType::ADDITIONALELEMENT)), + myTAZParents(hierarchicalParent->getNumberOfParentAdditionals(GNETagProperties::TagType::TAZ)), + myTAZChilds(hierarchicalChild->getNumberOfChildAdditionals(GNETagProperties::TagType::TAZ)), + myShapeParents(hierarchicalParent->getParentShapes().size()), + myShapeChilds(hierarchicalChild->getChildShapes().size()), + myDemandElementParents(hierarchicalParent->getParentDemandElements().size()), + myDemandElementChilds(hierarchicalChild->getChildDemandElements().size()), + myGenericDataParents(hierarchicalParent->getParentGenericDatas().size()), + myGenericDataChilds(hierarchicalChild->getChildGenericDataElements().size()) { + // add the number of subodinated elements of additionals, shapes, demand elements and generic datas + for (const auto& additional : hierarchicalParent->getParentAdditionals()) { + addValuesFromSubordinatedElements(this, additional); + } + for (const auto& shape : hierarchicalParent->getParentShapes()) { + addValuesFromSubordinatedElements(this, shape); + } + for (const auto& demandElement : hierarchicalParent->getParentDemandElements()) { + addValuesFromSubordinatedElements(this, demandElement); + } + for (const auto& genericData : hierarchicalParent->getParentGenericDatas()) { + addValuesFromSubordinatedElements(this, genericData); + } + for (const auto& additional : hierarchicalChild->getChildAdditionals()) { + addValuesFromSubordinatedElements(this, additional); + } + for (const auto& shape : hierarchicalChild->getChildShapes()) { + addValuesFromSubordinatedElements(this, shape); + } + for (const auto& additional : hierarchicalChild->getChildDemandElements()) { + addValuesFromSubordinatedElements(this, additional); + } + for (const auto& genericData : hierarchicalChild->getChildGenericDataElements()) { + addValuesFromSubordinatedElements(this, genericData); + } +} + + +void +GNEDeleteFrame::SubordinatedElements::addValuesFromSubordinatedElements(SubordinatedElements* originalSE, const SubordinatedElements& newSE) { + originalSE->myAdditionalParents += newSE.myAdditionalParents; + originalSE->myAdditionalChilds += newSE.myAdditionalChilds; + originalSE->myTAZParents += newSE.myTAZParents; + originalSE->myTAZChilds += newSE.myTAZChilds; + originalSE->myShapeParents += newSE.myShapeParents; + originalSE->myShapeChilds += newSE.myShapeChilds; + originalSE->myDemandElementParents += newSE.myDemandElementParents; + originalSE->myDemandElementChilds += newSE.myDemandElementChilds; + originalSE->myGenericDataParents += newSE.myGenericDataParents; + originalSE->myGenericDataChilds += newSE.myGenericDataChilds; +} + + +void +GNEDeleteFrame::SubordinatedElements::openWarningDialog(const std::string& type, const size_t number, const bool isChild) { + // declare plural depending of "number" + const std::string plural = (number > 1) ? "s" : ""; + // declare header + const std::string header = "Problem deleting " + myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + "'"; + // declare message + std::string message; + // set message depending of isChild + if (isChild) { + message = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + + "' cannot be deleted because it has " + toString(number) + " " + type + " element" + plural + ".\n" + + "To delete it, uncheck 'protect " + type + " elements'."; + } else { + message = myAttributeCarrier->getTagProperty().getTagStr() + " '" + myAttributeCarrier->getID() + + "' cannot be deleted because it is part of " + toString(number) + " " + type + " element" + plural + ".\n" + + "To delete it, uncheck 'protect " + type + " elements'."; + } + // write warning + WRITE_DEBUG("Opened FXMessageBox " + header); + // open message box + FXMessageBox::warning(myViewNet->getApp(), MBOX_OK, header.c_str(), "%s", message.c_str()); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox " + header); +} + +// --------------------------------------------------------------------------- +// GNEAdditionalFrame - protected methods +// --------------------------------------------------------------------------- + +bool +GNEDeleteFrame::selectedACsToDelete() const { + // invert selection of elements depending of current supermode + if (myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + // iterate over junctions + for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + if (junction.second->isAttributeCarrierSelected()) { + return true; + } + // due we iterate over all junctions, only it's neccesary iterate over incoming edges + for (const auto& edge : junction.second->getGNEIncomingEdges()) { + if (edge->isAttributeCarrierSelected()) { + return true; + } + // check lanes + for (const auto& lane : edge->getLanes()) { + if (lane->isAttributeCarrierSelected()) { + return true; + } + } + // check connections + for (const auto& connection : edge->getGNEConnections()) { + if (connection->isAttributeCarrierSelected()) { + return true; + } + } + } + // check crossings + for (const auto& crossing : junction.second->getGNECrossings()) { + if (crossing->isAttributeCarrierSelected()) { + return true; + } + } + } + // check shapes + for (const auto& shapeTag : myViewNet->getNet()->getAttributeCarriers()->getShapes()) { + for (const auto& shape : shapeTag.second) { + if (shape.second->isAttributeCarrierSelected()) { + return true; + } + } + } + // check additionals + for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) { + for (const auto& additional : additionalTag.second) { + if (additional.second->isAttributeCarrierSelected()) { + return true; + } + } + } + } else if (myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // check demand elements + for (const auto& demandElementTag : myViewNet->getNet()->getAttributeCarriers()->getDemandElements()) { + for (const auto& demandElement : demandElementTag.second) { + if (demandElement.second->isAttributeCarrierSelected()) { + return true; + } + } + } + } else if (myViewNet->getEditModes().isCurrentSupermodeData()) { + // iterate over all generic datas + for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + if (genericData->isAttributeCarrierSelected()) { + return true; + } + } + } + } + } + return false; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEDeleteFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,211 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEDeleteFrame.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2016 +/// +// The Widget for remove network-elements +/****************************************************************************/ +#pragma once + +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEDeleteFrame + * The Widget for deleting elements + */ +class GNEDeleteFrame : public GNEFrame { + +public: + + // =========================================================================== + // class DeleteOptions + // =========================================================================== + + class DeleteOptions : protected FXGroupBox { + + public: + /// @brief constructor + DeleteOptions(GNEDeleteFrame* deleteFrameParent); + + /// @brief destructor + ~DeleteOptions(); + + /// @brief check if only delete geometry points checkbox is enabled + bool deleteOnlyGeometryPoints() const; + + /// @brief check if protect additional elements checkbox is enabled + bool protectAdditionals() const; + + /// @brief check if protect TAZ elements checkbox is enabled + bool protectTAZs() const; + + /// @brief check if protect shapes elements checkbox is enabled + bool protectShapes() const; + + /// @brief check if protect demand elements checkbox is enabled + bool protectDemandElements() const; + + /// @brief check if protect generic datas checkbox is enabled + bool protectGenericDatas() const; + + private: + /// @brief checkbox for enable/disable delete only geometry points + FXCheckButton* myDeleteOnlyGeometryPoints; + + /// @brief checkbox for enable/disable protect additionals + FXCheckButton* myProtectAdditionals; + + /// @brief checkbox for enable/disable protect TAZs + FXCheckButton* myProtectTAZs; + + /// @brief checkbox for enable/disable protect shapes + FXCheckButton* myProtectShapes; + + /// @brief checkbox for enable/disable protect demand elements + FXCheckButton* myProtectDemandElements; + + /// @brief checkbox for enable/disable protect generic datas + FXCheckButton* myProtectGenericDatas; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEDeleteFrame(); + + /// @brief show delete frame + void show(); + + /// @brief hide delete frame + void hide(); + + /// @brief remove selected attribute carriers (element) + void removeSelectedAttributeCarriers(); + + /**@brief remove attribute carrier (element) + * @param objectsUnderCursor objects under cursors + * @param ignoreOptions ignore delete options and ALWAYS remove AC + */ + void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions = false); + + /// @brief get delete options + DeleteOptions* getDeleteOptions() const; + +protected: + + /// @brief struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement) + class SubordinatedElements { + + public: + /// @brief constructor (for junctions) + SubordinatedElements(const GNEJunction* junction); + + /// @brief constructor (for edges) + SubordinatedElements(const GNEEdge* edge); + + /// @brief constructor (for lanes) + SubordinatedElements(const GNELane* lane); + + /// @brief constructor (for additionals) + SubordinatedElements(const GNEAdditional* additional); + + /// @brief constructor (for shapes) + SubordinatedElements(const GNEShape* shape); + + /// @brief constructor (for demandElements) + SubordinatedElements(const GNEDemandElement* demandElement); + + /// @brief constructor (for shapes) + SubordinatedElements(const GNEGenericData* genericData); + + /// @brief destructor + ~SubordinatedElements(); + + /// @brief if element can be removed + bool checkElements(const DeleteOptions* deleteOptions); + + protected: + /// @brief parent of SubordinatedElements + const GNEAttributeCarrier* myAttributeCarrier; + + /// @brief pointer to view net + GNEViewNet* myViewNet; + + /// @brief parent additionals (except TAZs) + size_t myAdditionalParents; + + /// @brief child additional (except TAZs) + size_t myAdditionalChilds; + + /// @brief parent TAZs + size_t myTAZParents; + + /// @brief child TAZ + size_t myTAZChilds; + + /// @brief parent shapes + size_t myShapeParents; + + /// @brief child shape + size_t myShapeChilds; + + /// @brief parent demand elements + size_t myDemandElementParents; + + /// @brief child demand elements + size_t myDemandElementChilds; + + /// @brief parent demand elements + size_t myGenericDataParents; + + /// @brief child demand elements + size_t myGenericDataChilds; + + private: + // default constructor for non-net elements + SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet); + + // default constructor for Net Elements + SubordinatedElements(const GNEAttributeCarrier* attributeCarrier, GNEViewNet* viewNet, + const GNEHierarchicalParentElements* hierarchicalParent, + const GNEHierarchicalChildElements* hierarchicalChild); + + /// @brief add in originalSE the values of newSE + void addValuesFromSubordinatedElements(SubordinatedElements* originalSE, const SubordinatedElements& newSE); + + // @brief open warning dialog + void openWarningDialog(const std::string& elementType, const size_t number, const bool isChild); + + /// @brief Invalidated copy constructor. + SubordinatedElements(const SubordinatedElements&) = delete; + + /// @brief Invalidated assignment operator. + SubordinatedElements& operator=(const SubordinatedElements&) = delete; + }; + + /// @brief check if there is selected ACs to delete + bool selectedACsToDelete() const; + +private: + /// @brief modul for delete options + DeleteOptions* myDeleteOptions; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1083 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEInspectorFrame.cpp +/// @author Jakob Erdmann +/// @author Pablo Alvarez Lopez +/// @date Mar 2011 +/// +// The Widget for modifying network-element attributes (i.e. lane speed) +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEInspectorFrame.h" +#include "GNEDeleteFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_INSPECTORFRAME_GOBACK, GNEInspectorFrame::onCmdGoBack) +}; + +FXDEFMAP(GNEInspectorFrame::NeteditAttributesEditor) NeteditAttributesEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp) +}; + +FXDEFMAP(GNEInspectorFrame::GEOAttributesEditor) GEOAttributesEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp) +}; + +FXDEFMAP(GNEInspectorFrame::TemplateEditor) TemplateEditorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GNEInspectorFrame::TemplateEditor::onCmdSetTemplate), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate), +}; + +// 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)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEInspectorFrame::GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): + GNEFrame(horizontalFrameParent, viewNet, "Inspector"), + myPreviousElementInspect(nullptr), + myPreviousElementDelete(nullptr) { + + // Create back button + myBackButton = new FXButton(myHeaderLeftFrame, "", GUIIconSubSys::getIcon(GUIIcon::BIGARROWLEFT), this, MID_GNE_INSPECTORFRAME_GOBACK, GUIDesignButtonIconRectangular); + myHeaderLeftFrame->hide(); + myBackButton->hide(); + + // Create Overlapped Inspection modul + myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this); + + // Create Attributes Editor modul + myAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this); + + // Create GEO Parameters Editor modul + myGEOAttributesEditor = new GEOAttributesEditor(this); + + // create parameters Editor modul + myParametersEditor = new GNEFrameAttributesModuls::ParametersEditor(this, "Parameters"); + + // Create Netedit Attributes Editor modul + myNeteditAttributesEditor = new NeteditAttributesEditor(this); + + // Create Template editor modul + myTemplateEditor = new TemplateEditor(this); + + // Create AttributeCarrierHierarchy modul + myAttributeCarrierHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this); +} + + +GNEInspectorFrame::~GNEInspectorFrame() {} + + +void +GNEInspectorFrame::show() { + // inspect a null element to reset inspector frame + inspectSingleElement(nullptr); + GNEFrame::show(); +} + + +void +GNEInspectorFrame::hide() { + myViewNet->setDottedAC(nullptr); + GNEFrame::hide(); +} + + +bool +GNEInspectorFrame::processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if we have clicked over an Attribute Carrier + if (objectsUnderCursor.getAttributeCarrierFront()) { + // if Control key is Pressed, select instead inspect element + if (myViewNet->getKeyPressed().controlKeyPressed()) { + // Check if this GLobject type is locked + if (!myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(objectsUnderCursor.getGlTypeFront())) { + // toogle networkElement selection + if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { + objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); + } else { + objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); + } + } + } else { + // first check if we clicked over a OverlappedInspection point + if (myViewNet->getKeyPressed().shiftKeyPressed()) { + if (!myOverlappedInspection->previousElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + } else if (!myOverlappedInspection->nextElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + // focus upper element of inspector frame + focusUpperElement(); + } + return true; + } else { + return false; + } +} + + +bool +GNEInspectorFrame::processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if we have clicked over a demand element + if (objectsUnderCursor.getDemandElementFront()) { + // if Control key is Pressed, select instead inspect element + if (myViewNet->getKeyPressed().controlKeyPressed()) { + // Check if this GLobject type is locked + if (!myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(objectsUnderCursor.getGlTypeFront())) { + // toogle networkElement selection + if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { + objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); + } else { + objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); + } + } + } else { + // first check if we clicked over a OverlappedInspection point + if (myViewNet->getKeyPressed().shiftKeyPressed()) { + if (!myOverlappedInspection->previousElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + } else if (!myOverlappedInspection->nextElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + // focus upper element of inspector frame + focusUpperElement(); + } + return true; + } else { + return false; + } +} + + +bool +GNEInspectorFrame::processDataSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if we have clicked over a data element + if (objectsUnderCursor.getGenericDataElementFront()) { + // if Control key is Pressed, select instead inspect element + if (myViewNet->getKeyPressed().controlKeyPressed()) { + // Check if this GLobject type is locked + if (!myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(objectsUnderCursor.getGlTypeFront())) { + // toogle networkElement selection + if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { + objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); + } else { + objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); + } + } + } else { + // first check if we clicked over a OverlappedInspection point + if (myViewNet->getKeyPressed().shiftKeyPressed()) { + if (!myOverlappedInspection->previousElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + } else if (!myOverlappedInspection->nextElement(clickedPosition)) { + // inspect attribute carrier, (or multiselection if AC is selected) + inspectClickedElement(objectsUnderCursor, clickedPosition); + } + // focus upper element of inspector frame + focusUpperElement(); + } + return true; + } else { + return false; + } +} + + +void +GNEInspectorFrame::inspectSingleElement(GNEAttributeCarrier* AC) { + // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code + std::vector itemsToInspect; + if (AC != nullptr) { + myViewNet->setDottedAC(AC); + if (AC->isAttributeCarrierSelected()) { + // obtain selected ACs depending of current supermode + std::vector selectedACs = myViewNet->getNet()->getSelectedAttributeCarriers(false); + // iterate over selected ACs + for (const auto& i : selectedACs) { + // filter ACs to inspect using Tag as criterium + if (i->getTagProperty().getTag() == AC->getTagProperty().getTag()) { + itemsToInspect.push_back(i); + } + } + } else { + itemsToInspect.push_back(AC); + } + } + inspectMultisection(itemsToInspect); +} + + +void +GNEInspectorFrame::inspectMultisection(const std::vector& ACs) { + // hide back button + myHeaderLeftFrame->hide(); + myBackButton->hide(); + // Hide all elements + myAttributesEditor->hideAttributesEditorModul(); + myNeteditAttributesEditor->hideNeteditAttributesEditor(); + myGEOAttributesEditor->hideGEOAttributesEditor(); + myParametersEditor->hideParametersEditor(); + myTemplateEditor->hideTemplateEditor(); + myAttributeCarrierHierarchy->hideAttributeCarrierHierarchy(); + myOverlappedInspection->hideOverlappedInspection(); + // If vector of attribute Carriers contain data + if (ACs.size() > 0) { + // Set header + std::string headerString; + if (ACs.front()->getTagProperty().isNetworkElement()) { + headerString = "Net: "; + } else if (ACs.front()->getTagProperty().isAdditionalElement()) { + headerString = "Additional: "; + } else if (ACs.front()->getTagProperty().isShape()) { + headerString = "Shape: "; + } + if (ACs.size() > 1) { + headerString += toString(ACs.size()) + " "; + } + headerString += ACs.front()->getTagStr(); + if (ACs.size() > 1) { + headerString += "s"; + } + // Set headerString into header label + getFrameHeaderLabel()->setText(headerString.c_str()); + + // Show attributes editor + myAttributesEditor->showAttributeEditorModul(ACs, true, false); + + // show netedit attributes editor if we're inspecting elements with Netedit Attributes + myNeteditAttributesEditor->showNeteditAttributesEditor(); + + // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes + myGEOAttributesEditor->showGEOAttributesEditor(); + + // show parameters editor + if (ACs.size() == 1) { + myParametersEditor->showParametersEditor(ACs.front(), "parameters"); + } else { + myParametersEditor->showParametersEditor(ACs, "parameters"); + } + + // If attributes correspond to an Edge and we aren't in demand mode, show template editor + myTemplateEditor->showTemplateEditor(); + + // if we inspect a single Attribute carrier vector, show their children + if (ACs.size() == 1) { + myAttributeCarrierHierarchy->showAttributeCarrierHierarchy(ACs.front()); + } + } else { + getFrameHeaderLabel()->setText("Inspect"); + myContentFrame->recalc(); + } +} + + +void +GNEInspectorFrame::inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement) { + // Show back button if myPreviousElementInspect was defined + myPreviousElementInspect = previousElement; + if (myPreviousElementInspect != nullptr) { + // disable myPreviousElementDelete to avoid inconsistences + myPreviousElementDelete = nullptr; + inspectSingleElement(AC); + myHeaderLeftFrame->show(); + myBackButton->show(); + } +} + + +void +GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) { + myPreviousElementDelete = previousElement; + myPreviousElementDeleteWasMarked = previousElementWasMarked; + // Show back button if myPreviousElementDelete is valid + if (myPreviousElementDelete != nullptr) { + // disable myPreviousElementInspect to avoid inconsistences + myPreviousElementInspect = nullptr; + inspectSingleElement(AC); + myHeaderLeftFrame->show(); + myBackButton->show(); + } +} + + +void +GNEInspectorFrame::clearInspectedAC() { + // Only remove if there is inspected ACs + if (myAttributesEditor->getEditedACs().size() > 0) { + myViewNet->setDottedAC(nullptr); + // Inspect empty selection (to hide all Editors) + inspectMultisection({}); + } +} + + +GNEFrameAttributesModuls::AttributesEditor* +GNEInspectorFrame::getAttributesEditor() const { + return myAttributesEditor; +} + + +GNEInspectorFrame::TemplateEditor* +GNEInspectorFrame::getTemplateEditor() const { + return myTemplateEditor; +} + + +GNEFrameModuls::OverlappedInspection* +GNEInspectorFrame::getOverlappedInspection() const { + return myOverlappedInspection; +} + + +GNEFrameModuls::AttributeCarrierHierarchy* +GNEInspectorFrame::getAttributeCarrierHierarchy() const { + return myAttributeCarrierHierarchy; +} + + +long +GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) { + // Inspect previous element or go back to Delete Frame + if (myPreviousElementInspect) { + inspectSingleElement(myPreviousElementInspect); + myPreviousElementInspect = nullptr; + } else if (myPreviousElementDelete != nullptr) { + myPreviousElementDelete = nullptr; + // Hide inspect frame and show delete frame + hide(); + myViewNet->getViewParent()->getDeleteFrame()->show(); + } + return 1; +} + + +void +GNEInspectorFrame::updateFrameAfterUndoRedo() { + // refresh Attribute Editor + myAttributesEditor->refreshAttributeEditor(false, false); + // refresh parametersEditor + myParametersEditor->refreshParametersEditor(); + // refresh AC Hierarchy + myAttributeCarrierHierarchy->refreshAttributeCarrierHierarchy(); +} + + +void +GNEInspectorFrame::selectedOverlappedElement(GNEAttributeCarrier* AC) { + // if AC is a lane but selectEdges checkBox is enabled, then inspect their parent edge + if (AC->getTagProperty().getTag() == SUMO_TAG_LANE && myViewNet->getNetworkViewOptions().selectEdges()) { + inspectSingleElement(dynamic_cast(AC)->getParentEdge()); + } else { + inspectSingleElement(AC); + } + // update view (due dotted contour) + myViewNet->updateViewNet(); +} + + +void +GNEInspectorFrame::inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition) { + if (objectsUnderCursor.getAttributeCarrierFront()) { + // inspect front element + inspectSingleElement(objectsUnderCursor.getAttributeCarrierFront()); + // if element has overlapped elements, show Overlapped Inspection modul + if (objectsUnderCursor.getClickedAttributeCarriers().size() > 1) { + myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition); + } else { + myOverlappedInspection->hideOverlappedInspection(); + } + } +} + + +void +GNEInspectorFrame::attributeUpdated() { + myAttributesEditor->refreshAttributeEditor(false, false); + myNeteditAttributesEditor->refreshNeteditAttributesEditor(true); + myGEOAttributesEditor->refreshGEOAttributesEditor(true); +} + +// --------------------------------------------------------------------------- +// GNEInspectorFrame::NeteditAttributesEditor - methods +// --------------------------------------------------------------------------- + +GNEInspectorFrame::NeteditAttributesEditor::NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : + FXGroupBox(inspectorFrameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame), + myInspectorFrameParent(inspectorFrameParent) { + + // Create elements for parent additional + myHorizontalFrameParentAdditional = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myLabelParentAdditional = new FXLabel(myHorizontalFrameParentAdditional, "Block move", nullptr, GUIDesignLabelAttribute); + myTextFieldParentAdditional = new FXTextField(myHorizontalFrameParentAdditional, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + + // Create elements for block movement + myHorizontalFrameBlockMovement = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myLabelBlockMovement = new FXLabel(myHorizontalFrameBlockMovement, "Block move", nullptr, GUIDesignLabelAttribute); + myCheckBoxBlockMovement = new FXCheckButton(myHorizontalFrameBlockMovement, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + + // Create elements for block shape + myHorizontalFrameBlockShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myLabelBlockShape = new FXLabel(myHorizontalFrameBlockShape, "Block shape", nullptr, GUIDesignLabelAttribute); + myCheckBoxBlockShape = new FXCheckButton(myHorizontalFrameBlockShape, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + + // Create elements for close shape + myHorizontalFrameCloseShape = new FXHorizontalFrame(this, 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); +} + + +GNEInspectorFrame::NeteditAttributesEditor::~NeteditAttributesEditor() {} + + +void +GNEInspectorFrame::NeteditAttributesEditor::showNeteditAttributesEditor() { + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { + // enable all editable elements + myTextFieldParentAdditional->enable(); + myCheckBoxBlockMovement->enable(); + myCheckBoxBlockShape->enable(); + myCheckBoxCloseShape->enable(); + // obtain tag property (only for improve code legibility) + const auto& tagValue = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); + // Check if item can be moved + if (tagValue.canBlockMovement()) { + // show NeteditAttributesEditor + show(); + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT)); + } + // show block movement frame + myHorizontalFrameBlockMovement->show(); + // set check box value and update label + if (value) { + myCheckBoxBlockMovement->setCheck(true); + myCheckBoxBlockMovement->setText("true"); + } else { + myCheckBoxBlockMovement->setCheck(false); + myCheckBoxBlockMovement->setText("false"); + } + } + // check if item can block their shape + if (tagValue.canBlockShape()) { + // show NeteditAttributesEditor + show(); + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_SHAPE)); + } + // show block shape frame + myHorizontalFrameBlockShape->show(); + // set check box value and update label + if (value) { + myCheckBoxBlockShape->setCheck(true); + myCheckBoxBlockShape->setText("true"); + } else { + myCheckBoxBlockShape->setCheck(false); + myCheckBoxBlockShape->setText("false"); + } + } + // check if item can block their shape + if (tagValue.canCloseShape()) { + // show NeteditAttributesEditor + show(); + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_CLOSE_SHAPE)); + } + // show close shape frame + myHorizontalFrameCloseShape->show(); + // set check box value and update label + if (value) { + myCheckBoxCloseShape->setCheck(true); + myCheckBoxCloseShape->setText("true"); + } else { + myCheckBoxCloseShape->setCheck(false); + myCheckBoxCloseShape->setText("false"); + } + } + // Check if item has another item as parent and can be reparemt + if (tagValue.hasParent() && tagValue.canBeReparent()) { + // show NeteditAttributesEditor + show(); + // obtain additional Parent + std::set parents; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + parents.insert(i->getAttribute(GNE_ATTR_PARENT)); + } + // show parent additional frame + myHorizontalFrameParentAdditional->show(); + // set Label and TextField with the Tag and ID of parent + myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str()); + 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->myAttributesEditor->getEditedACs().front()) == false) { + myTextFieldParentAdditional->disable(); + myCheckBoxBlockMovement->disable(); + myCheckBoxBlockShape->disable(); + myCheckBoxCloseShape->disable(); + } + } +} + + +void +GNEInspectorFrame::NeteditAttributesEditor::hideNeteditAttributesEditor() { + // hide all elements of GroupBox + myHorizontalFrameParentAdditional->hide(); + myHorizontalFrameBlockMovement->hide(); + myHorizontalFrameBlockShape->hide(); + myHorizontalFrameCloseShape->hide(); + // hide groupbox + hide(); +} + + +void +GNEInspectorFrame::NeteditAttributesEditor::refreshNeteditAttributesEditor(bool forceRefresh) { + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { + // refresh block movement + if (myHorizontalFrameBlockMovement->shown()) { + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT)); + } + // set check box value and update label + if (value) { + myCheckBoxBlockMovement->setCheck(true); + myCheckBoxBlockMovement->setText("true"); + } else { + myCheckBoxBlockMovement->setCheck(false); + myCheckBoxBlockMovement->setText("false"); + } + } + // refresh block shape + if (myHorizontalFrameBlockShape->shown()) { + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_SHAPE)); + } + // set check box value and update label + if (value) { + myCheckBoxBlockShape->setCheck(true); + myCheckBoxBlockShape->setText("true"); + } else { + myCheckBoxBlockShape->setCheck(false); + myCheckBoxBlockShape->setText("false"); + } + } + // refresh close shape + if (myHorizontalFrameCloseShape->shown()) { + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_CLOSE_SHAPE)); + } + // set check box value and update label + if (value) { + myCheckBoxCloseShape->setCheck(true); + myCheckBoxCloseShape->setText("true"); + } else { + myCheckBoxCloseShape->setCheck(false); + myCheckBoxCloseShape->setText("false"); + } + } + // Check if item has another item as parent (Currently only for single Additionals) + if (myHorizontalFrameParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) { + // set Label and TextField with the Tag and ID of parent + myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str()); + myTextFieldParentAdditional->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(GNE_ATTR_PARENT).c_str()); + } + } +} + + +long +GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(FXObject* obj, FXSelector, void*) { + // make sure that ACs has elements + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { + // check if we're changing multiple attributes + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) { + myInspectorFrameParent->myViewNet->getUndoList()->p_begin("Change multiple attributes"); + } + if (obj == myCheckBoxBlockMovement) { + // set new values in all inspected Attribute Carriers + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + if (myCheckBoxBlockMovement->getCheck() == 1) { + i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "true", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxBlockMovement->setText("true"); + } else { + i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "false", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxBlockMovement->setText("false"); + } + } + } else if (obj == myCheckBoxBlockShape) { + // set new values in all inspected Attribute Carriers + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + if (myCheckBoxBlockShape->getCheck() == 1) { + i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxBlockShape->setText("true"); + } else { + i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxBlockShape->setText("false"); + } + } + } else if (obj == myCheckBoxCloseShape) { + // set new values in all inspected Attribute Carriers + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + if (myCheckBoxCloseShape->getCheck() == 1) { + i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxCloseShape->setText("true"); + } else { + i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList()); + myCheckBoxCloseShape->setText("false"); + } + } + } else if (obj == myTextFieldParentAdditional) { + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) { + // replace the parent of all inspected elements + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + i->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); + } + myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0)); + myTextFieldParentAdditional->killFocus(); + } else { + myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0)); + } + } + // finish change multiple attributes + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) { + myInspectorFrameParent->myViewNet->getUndoList()->p_end(); + } + // force refresh values of AttributesEditor and GEOAttributesEditor + myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); + myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true); + } + return 1; +} + + +long +GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*) { + return 0; +} + +// --------------------------------------------------------------------------- +// GNEInspectorFrame::GEOAttributesEditor - methods +// --------------------------------------------------------------------------- + +GNEInspectorFrame::GEOAttributesEditor::GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : + FXGroupBox(inspectorFrameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame), + myInspectorFrameParent(inspectorFrameParent) { + + // Create Frame for GEOAttribute + myGEOAttributeFrame = new FXHorizontalFrame(this, 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); + 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); +} + + +GNEInspectorFrame::GEOAttributesEditor::~GEOAttributesEditor() {} + + +void +GNEInspectorFrame::GEOAttributesEditor::showGEOAttributesEditor() { + // make sure that ACs has elements + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { + // enable all editable elements + myGEOAttributeTextField->enable(); + myUseGEOCheckButton->enable(); + // obtain tag property (only for improve code legibility) + const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); + // check if item can use a geo position + if (tagProperty.hasGEOPosition() || tagProperty.hasGEOShape()) { + // show GEOAttributesEditor + show(); + // Iterate over AC to obtain values + bool value = true; + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + value &= GNEAttributeCarrier::parse(i->getAttribute(SUMO_ATTR_GEO)); + } + // show use geo frame + myUseGEOFrame->show(); + // set UseGEOCheckButton value of and update label (only if geo conversion is defined) + if (GeoConvHelper::getFinal().getProjString() != "!") { + myUseGEOCheckButton->enable(); + if (value) { + myUseGEOCheckButton->setCheck(true); + myUseGEOCheckButton->setText("true"); + } else { + myUseGEOCheckButton->setCheck(false); + myUseGEOCheckButton->setText("false"); + } + } else { + myUseGEOCheckButton->disable(); + } + // now specify if a single position or an entire shape must be shown (note: cannot be shown both at the same time, and GEO Shape/Position only works for single selections) + if (tagProperty.hasGEOPosition() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { + myGEOAttributeFrame->show(); + myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOPOSITION).c_str()); + myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); + // only allow edit if geo conversion is defined + if (GeoConvHelper::getFinal().getProjString() != "!") { + myGEOAttributeTextField->enable(); + myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str()); + } else { + myGEOAttributeTextField->disable(); + myGEOAttributeTextField->setText("No geo-conversion defined"); + } + } else if (tagProperty.hasGEOShape() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { + myGEOAttributeFrame->show(); + myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOSHAPE).c_str()); + myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); + // only allow edit if geo conversion is defined + if (GeoConvHelper::getFinal().getProjString() != "!") { + myGEOAttributeTextField->enable(); + myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str()); + } else { + myGEOAttributeTextField->disable(); + myGEOAttributeTextField->setText("No geo-conversion defined"); + } + } + } + // 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->getEditedACs().front()) == false) { + myGEOAttributeTextField->disable(); + myUseGEOCheckButton->disable(); + } + } +} + + +void +GNEInspectorFrame::GEOAttributesEditor::hideGEOAttributesEditor() { + // hide all elements of GroupBox + myGEOAttributeFrame->hide(); + myUseGEOFrame->hide(); + // hide groupbox + hide(); +} + + +void +GNEInspectorFrame::GEOAttributesEditor::refreshGEOAttributesEditor(bool forceRefresh) { + // obtain tag property (only for improve code legibility) + const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); + // Check that myGEOAttributeFrame is shown + if ((GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) { + if (tagProperty.hasGEOPosition()) { + myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str()); + } else if (tagProperty.hasGEOShape()) { + myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str()); + } + myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); + } +} + + +long +GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute(FXObject* obj, FXSelector, void*) { + // make sure that ACs has elements + if ((GeoConvHelper::getFinal().getProjString() != "!") && (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0)) { + if (obj == myGEOAttributeTextField) { + // obtain tag property (only for improve code legibility) + const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); + // Change GEO Attribute depending of type (Position or shape) + if (tagProperty.hasGEOPosition()) { + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text())) { + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); + myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); + myGEOAttributeTextField->killFocus(); + } else { + myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0)); + } + } else if (tagProperty.hasGEOShape()) { + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) { + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); + myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); + myGEOAttributeTextField->killFocus(); + } else { + myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0)); + } + } else { + throw ProcessError("myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit"); + } + } else if (obj == myUseGEOCheckButton) { + // update GEO Attribute of entire selection + for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + if (myUseGEOCheckButton->getCheck() == 1) { + i->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList()); + myUseGEOCheckButton->setText("true"); + } else { + i->setAttribute(SUMO_ATTR_GEO, "false", myInspectorFrameParent->myViewNet->getUndoList()); + myUseGEOCheckButton->setText("false"); + } + } + } + // force refresh values of Attributes editor and NeteditAttributesEditor + myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); + myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true); + } + return 1; +} + + +long +GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp(FXObject*, FXSelector, void*) { + FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox); + std::ostringstream help; + help + << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n" + << " For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n" + << " in decimal degrees without extra symbols. (N,W..)\n" + << " - Longitude: East-west position of a point on the Earth's surface.\n" + << " - Latitude: North-south position of a point on the Earth's surface.\n" + << " - CheckBox 'geo' enables or disables saving position in GEO coordinates\n"; + 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; +} + +// --------------------------------------------------------------------------- +// GNEInspectorFrame::TemplateEditor - methods +// --------------------------------------------------------------------------- + +GNEInspectorFrame::TemplateEditor::TemplateEditor(GNEInspectorFrame* inspectorFrameParent) : + FXGroupBox(inspectorFrameParent->myContentFrame, "Templates", GUIDesignGroupBoxFrame), + myInspectorFrameParent(inspectorFrameParent), + myEdgeTemplate(nullptr) { + // Create set template button + mySetTemplateButton = new FXButton(this, "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); + // Create copy template button + myClearTemplateButton = new FXButton(this, "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton); +} + + +GNEInspectorFrame::TemplateEditor::~TemplateEditor() { + // before destroy template editor, we need to check if there is an active edge template + if (myEdgeTemplate) { + // decrease reference + myEdgeTemplate->decRef("GNEInspectorFrame::~GNEInspectorFrame"); + // delete edge template if is unreferenced + if (myEdgeTemplate->unreferenced()) { + delete myEdgeTemplate; + } + } +} + + +void +GNEInspectorFrame::TemplateEditor::showTemplateEditor() { + // show template editor only if we're editing an edge in Network mode + if ((myInspectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) && + (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getTag() == SUMO_TAG_EDGE)) { + // show "Set As Template" + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { + mySetTemplateButton->show(); + mySetTemplateButton->setText(("Set edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "' as Template").c_str()); + } + // update buttons + updateButtons(); + // show modul + show(); + } +} + + +void +GNEInspectorFrame::TemplateEditor::hideTemplateEditor() { + // hide template editor + hide(); +} + + +GNEEdge* +GNEInspectorFrame::TemplateEditor::getEdgeTemplate() const { + return myEdgeTemplate; +} + + +void +GNEInspectorFrame::TemplateEditor::setTemplate() { + // check if template editor AND mySetTemplateButton is enabled + if (shown() && mySetTemplateButton->isEnabled()) { + onCmdSetTemplate(nullptr, 0, nullptr); + } +} + + +void +GNEInspectorFrame::TemplateEditor::copyTemplate() { + // check if template editor AND myCopyTemplateButton is enabled + if (shown() && myCopyTemplateButton->isEnabled()) { + onCmdCopyTemplate(nullptr, 0, nullptr); + } +} + + +void +GNEInspectorFrame::TemplateEditor::clearTemplate() { + // check if template editor AND myClearTemplateButton is enabled + if (shown() && myClearTemplateButton->isEnabled()) { + onCmdClearTemplate(nullptr, 0, nullptr); + } +} + + +long +GNEInspectorFrame::TemplateEditor::onCmdSetTemplate(FXObject*, FXSelector, void*) { + // first check that there is exactly an inspected edge + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() != 1) { + throw ProcessError("Only one edge must be inspected"); + } + // retrieve edge ID (and throw exception if edge doesn't exist) + GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID()); + // set template + setEdgeTemplate(edge); + // update buttons + updateButtons(); + return 1; +} + + +long +GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate(FXObject*, FXSelector, void*) { + for (const auto& it : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { + // retrieve edge ID (and throw exception if edge doesn't exist) + GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(it->getID()); + // copy template + edge->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList()); + // refresh inspector parent + myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); + } + // update view (to see visual changes) + myInspectorFrameParent->myViewNet->updateViewNet(); + return 1; +} + + +long +GNEInspectorFrame::TemplateEditor::onCmdClearTemplate(FXObject*, FXSelector, void*) { + setEdgeTemplate(nullptr); + // update buttons + updateButtons(); + return 1; +} + + +void +GNEInspectorFrame::TemplateEditor::setEdgeTemplate(GNEEdge* tpl) { + // before change edge template, we need to check if there is another active edge template + if (myEdgeTemplate) { + // decrease reference + myEdgeTemplate->decRef("GNEInspectorFrame::setEdgeTemplate"); + // delete edge template if is unreferenced + if (myEdgeTemplate->unreferenced()) { + delete myEdgeTemplate; + } + } + // check if we're setting a new edge template or removing it + if (tpl) { + // set new edge template + myEdgeTemplate = tpl; + // increase reference + myEdgeTemplate->incRef("GNEInspectorFrame::setEdgeTemplate"); + } else { + // clear edge template + myEdgeTemplate = nullptr; + } +} + + +void +GNEInspectorFrame::TemplateEditor::updateButtons() { + // enable or disable clear buttons depending of myEdgeTemplate + if (myEdgeTemplate) { + // update caption of copy button + if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { + myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "'").c_str()); + } else { + myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into " + toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().size()) + " selected edges").c_str()); + } + // enable set and clear buttons + myCopyTemplateButton->enable(); + myClearTemplateButton->enable(); + } else { + // update caption of copy button + myCopyTemplateButton->setText("No edge Template Set"); + // disable set and clear buttons + myCopyTemplateButton->disable(); + myClearTemplateButton->disable(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNEInspectorFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,370 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEInspectorFrame.h +/// @author Jakob Erdmann +/// @author Pablo Alvarez Lopez +/// @date Mar 2011 +/// +// The Widget for modifying network-element attributes (i.e. lane speed) +/****************************************************************************/ +#pragma once + +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEInspectorFrame + * The Widget for modifying network-element attributes (i.e. lane speed) + */ +class GNEInspectorFrame : public GNEFrame { + /// @brief FOX-declaration + FXDECLARE(GNEInspectorFrame) + +public: + // =========================================================================== + // class NeteditAttributesEditor + // =========================================================================== + + class NeteditAttributesEditor : private FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEInspectorFrame::NeteditAttributesEditor) + + public: + /// @brief constructor + NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent); + + /// @brief destructor + ~NeteditAttributesEditor(); + + /// @brief show netedit attributes editor + void showNeteditAttributesEditor(); + + /// @brief hide netedit attributes editor + void hideNeteditAttributesEditor(); + + /// @brief refresh netedit attributes + void refreshNeteditAttributesEditor(bool forceRefresh); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when user change the current GEO Attribute + long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when user press the help button + long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(NeteditAttributesEditor) + + private: + /// @brief pointer to inspector frame parent + GNEInspectorFrame* myInspectorFrameParent; + + /// @frame horizontal frame for replace the parent additional + FXHorizontalFrame* myHorizontalFrameParentAdditional; + + /// @brief Label for parent additional + FXLabel* myLabelParentAdditional; + + /// @brief pointer for replace the parent additional + FXTextField* myTextFieldParentAdditional; + + /// @frame horizontal frame for block movement + FXHorizontalFrame* myHorizontalFrameBlockMovement; + + /// @brief Label for Check blocked movement + FXLabel* myLabelBlockMovement; + + /// @brief pointer to check box "Block movement" + FXCheckButton* myCheckBoxBlockMovement; + + /// @frame horizontal frame for block shape + FXHorizontalFrame* myHorizontalFrameBlockShape; + + /// @brief Label for Check blocked shape + FXLabel* myLabelBlockShape; + + /// @brief pointer to check box "Block Shape" + FXCheckButton* myCheckBoxBlockShape; + + /// @frame horizontal frame for close shape + FXHorizontalFrame* myHorizontalFrameCloseShape; + + /// @brief Label for close shape + FXLabel* myLabelCloseShape; + + /// @brief pointer to check box "Block movement" + FXCheckButton* myCheckBoxCloseShape; + + /// @brief button for help + FXButton* myHelpButton; + }; + + // =========================================================================== + // class GEOAttributesEditor + // =========================================================================== + + class GEOAttributesEditor : private FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEInspectorFrame::GEOAttributesEditor) + + public: + /// @brief constructor + GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent); + + /// @brief destructor + ~GEOAttributesEditor(); + + /// @brief show GEO attributes editor + void showGEOAttributesEditor(); + + /// @brief hide GEO attributes editor + void hideGEOAttributesEditor(); + + /// @brief refresh GEO attributes editor + void refreshGEOAttributesEditor(bool forceRefresh); + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when user change the current GEO Attribute + long onCmdSetGEOAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when user press the help button + long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(GEOAttributesEditor) + + private: + /// @brief current GNEInspectorFrame parent + GNEInspectorFrame* myInspectorFrameParent; + + /// @brief horizontal frame for GEOAttribute + FXHorizontalFrame* myGEOAttributeFrame; + + /// @brief Label for GEOAttribute + FXLabel* myGEOAttributeLabel; + + /// @brief textField for GEOAttribute + FXTextField* myGEOAttributeTextField; + + /// @brief horizontal frame for use GEO + FXHorizontalFrame* myUseGEOFrame; + + /// @brief Label for use GEO + FXLabel* myUseGEOLabel; + + /// @brief checkBox for use GEO + FXCheckButton* myUseGEOCheckButton; + + /// @brief button for help + FXButton* myHelpButton; + }; + + // =========================================================================== + // class TemplateEditor + // =========================================================================== + + class TemplateEditor : private FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEInspectorFrame::TemplateEditor) + + public: + /// @brief constructor + TemplateEditor(GNEInspectorFrame* inspectorFrameParent); + + /// @brief destructor + ~TemplateEditor(); + + /// @brief show template editor + void showTemplateEditor(); + + /// @brief hide template editor + void hideTemplateEditor(); + + /// @brief get the template edge (to copy attributes from) + GNEEdge* getEdgeTemplate() const; + + /// @brief set template (used by shortcut) + void setTemplate(); + + /// @brief copy template (used by shortcut) + void copyTemplate(); + + /// @brief clear template (used by shortcut) + void clearTemplate(); + + /// @name FOX-callbacks + /// @{ + + /// @brief set current edge as new template + long onCmdSetTemplate(FXObject*, FXSelector, void*); + + /// @brief copy edge attributes from edge template + long onCmdCopyTemplate(FXObject*, FXSelector, void*); + + /// @brief clear current edge template + long onCmdClearTemplate(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TemplateEditor) + + /// @brief seh the template edge (we assume shared responsibility via reference counting) + void setEdgeTemplate(GNEEdge* tpl); + + /// @brief update buttons + void updateButtons(); + + private: + /// @brief current GNEInspectorFrame parent + GNEInspectorFrame* myInspectorFrameParent; + + /// @brief set template button + FXButton* mySetTemplateButton; + + /// @brief copy template button + FXButton* myCopyTemplateButton; + + /// @brief clear template button + FXButton* myClearTemplateButton; + + /// @brief pointer to edge template + GNEEdge* myEdgeTemplate; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief net net that uses this GNEFrame + */ + GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEInspectorFrame(); + + /// @brief show inspector frame + void show(); + + /// @brief hide inspector frame + void hide(); + + /**@brief process click over Viewnet in Supermode Network + * @param[in] clickedPosition clicked position over ViewNet + * @param[in] objectsUnderCursor objects under cursors + * @return true if something was sucefully done + */ + bool processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /**@brief process click over Viewnet in Supermode Demand + * @param[in] clickedPosition clicked position over ViewNet + * @param[in] objectsUnderCursor objects under cursors + * @return true if something was sucefully done + */ + bool processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /**@brief process click over Viewnet in Supermode Data + * @param[in] clickedPosition clicked position over ViewNet + * @param[in] objectsUnderCursor objects under cursors + * @return true if something was sucefully done + */ + bool processDataSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief Inspect a single element + void inspectSingleElement(GNEAttributeCarrier* AC); + + /// @brief Inspect the given multi-selection + void inspectMultisection(const std::vector& ACs); + + /// @brief inspect child of already inspected element + void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement); + + /// @brief inspect called from DeleteFrame + void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked); + + /// @brief Clear all current inspected ACs + void clearInspectedAC(); + + /// @brief get AttributesEditor + GNEFrameAttributesModuls::AttributesEditor* getAttributesEditor() const; + + /// @brief get template editor + TemplateEditor* getTemplateEditor() const; + + /// @brief get OverlappedInspection modul + GNEFrameModuls::OverlappedInspection* getOverlappedInspection() const; + + /// @brief get AttributeCarrierHierarchy modul + GNEFrameModuls::AttributeCarrierHierarchy* getAttributeCarrierHierarchy() const; + + /// @name FOX-callbacks + /// @{ + + /// @brief called when user toogle the go back button + long onCmdGoBack(FXObject*, FXSelector, void*); + /// @} + + /// @brief function called after undo/redo in the current frame (can be reimplemented in frame children) + void updateFrameAfterUndoRedo(); + + /// @brief open AttributesCreator extended dialog (can be reimplemented in frame children) + void selectedOverlappedElement(GNEAttributeCarrier* AC); + +protected: + FOX_CONSTRUCTOR(GNEInspectorFrame) + + /// @brief Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor + void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition); + + /// @brief function called after set a valid attribute in AttributeEditor + void attributeUpdated(); + +private: + /// @brief Overlapped Inspection + GNEFrameModuls::OverlappedInspection* myOverlappedInspection; + + /// @brief Attribute editor + GNEFrameAttributesModuls::AttributesEditor* myAttributesEditor; + + /// @brief Netedit Attributes editor + NeteditAttributesEditor* myNeteditAttributesEditor; + + /// @brief GEO Attributes editor + GEOAttributesEditor* myGEOAttributesEditor; + + /// @brief parameters editor + GNEFrameAttributesModuls::ParametersEditor* myParametersEditor; + + /// @brief Template editor + TemplateEditor* myTemplateEditor; + + /// @brief Attribute Carrier Hierarchy + GNEFrameModuls::AttributeCarrierHierarchy* myAttributeCarrierHierarchy; + + /// @brief back Button + FXButton* myBackButton; + + /// @brief pointer to previous element called by Inspector Frame + GNEAttributeCarrier* myPreviousElementInspect; + + /// @brief pointer to previous element called by Delete Frame + GNEAttributeCarrier* myPreviousElementDelete; + + /// @brief flag to ckec if myPreviousElementDelete was marked in Delete Frame + bool myPreviousElementDeleteWasMarked; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,2261 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNESelectorFrame.cpp +/// @author Jakob Erdmann +/// @date Mar 2011 +/// +// The Widget for modifying selections of network-elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNESelectorFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +FXDEFMAP(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) ObjectTypeEntryMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::onCmdSetCheckBox) +}; + +FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNESelectorFrame::ModificationMode::onCmdSelectModificationMode) +}; + +FXDEFMAP(GNESelectorFrame::ElementSet) ElementSetMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_ELEMENTS, GNESelectorFrame::ElementSet::onCmdSelectElementSet) +}; + +FXDEFMAP(GNESelectorFrame::MatchAttribute) MatchAttributeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTTAG, GNESelectorFrame::MatchAttribute::onCmdSelMBTag), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GNESelectorFrame::MatchAttribute::onCmdSelMBAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_PROCESSSTRING, GNESelectorFrame::MatchAttribute::onCmdSelMBString), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNESelectorFrame::MatchAttribute::onCmdHelp) +}; + +FXDEFMAP(GNESelectorFrame::MatchGenericDataAttribute) MatchGenericDataAttributeMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SETINTERVAL, GNESelectorFrame::MatchGenericDataAttribute::onCmdSetInterval), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SETBEGIN, GNESelectorFrame::MatchGenericDataAttribute::onCmdSetBegin), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SETEND, GNESelectorFrame::MatchGenericDataAttribute::onCmdSetEnd), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTTAG, GNESelectorFrame::MatchGenericDataAttribute::onCmdSelectTag), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GNESelectorFrame::MatchGenericDataAttribute::onCmdSelectAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_PROCESSSTRING, GNESelectorFrame::MatchGenericDataAttribute::onCmdProcessString), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNESelectorFrame::MatchGenericDataAttribute::onCmdHelp) +}; + +FXDEFMAP(GNESelectorFrame::VisualScaling) VisualScalingMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTSCALE, GNESelectorFrame::VisualScaling::onCmdScaleSelection) +}; + +FXDEFMAP(GNESelectorFrame::SelectionOperation) SelectionOperationMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_LOAD, GNESelectorFrame::SelectionOperation::onCmdLoad), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_SAVE, GNESelectorFrame::SelectionOperation::onCmdSave), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_INVERT, GNESelectorFrame::SelectionOperation::onCmdInvert), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_CLEAR, GNESelectorFrame::SelectionOperation::onCmdClear) +}; + +// Object implementation +FXIMPLEMENT(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry, FXObject, ObjectTypeEntryMap, ARRAYNUMBER(ObjectTypeEntryMap)) +FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBox, ModificationModeMap, ARRAYNUMBER(ModificationModeMap)) +FXIMPLEMENT(GNESelectorFrame::ElementSet, FXGroupBox, ElementSetMap, ARRAYNUMBER(ElementSetMap)) +FXIMPLEMENT(GNESelectorFrame::MatchAttribute, FXGroupBox, MatchAttributeMap, ARRAYNUMBER(MatchAttributeMap)) +FXIMPLEMENT(GNESelectorFrame::MatchGenericDataAttribute, FXGroupBox, MatchGenericDataAttributeMap, ARRAYNUMBER(MatchGenericDataAttributeMap)) +FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBox, VisualScalingMap, ARRAYNUMBER(VisualScalingMap)) +FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBox, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap)) + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// ModificationMode::LockGLObjectTypes - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::LockGLObjectTypes::LockGLObjectTypes(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Locked selected items", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent) { + // create a matrix for TypeEntries + FXMatrix* matrixLockGLObjectTypes = new FXMatrix(this, 3, GUIDesignMatrixLockGLTypes); + // create typeEntries for Network elements + myTypeEntries[GLO_JUNCTION] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Junctions"); + myTypeEntries[GLO_EDGE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Edges"); + myTypeEntries[GLO_LANE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Lanes"); + myTypeEntries[GLO_CONNECTION] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Connections"); + myTypeEntries[GLO_ADDITIONALELEMENT] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Additionals"); + myTypeEntries[GLO_CROSSING] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Crossings"); + myTypeEntries[GLO_POLYGON] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "Polygons"); + myTypeEntries[GLO_POI] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::NETWORK, "POIs"); + // create typeEntries for Demand elements + myTypeEntries[GLO_ROUTE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Routes"); + myTypeEntries[GLO_EMBEDDEDROUTE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Emb.Routes"); + myTypeEntries[GLO_VEHICLE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Vehicles"); + myTypeEntries[GLO_ROUTEFLOW] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Flows"); + myTypeEntries[GLO_TRIP] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Trips"); + myTypeEntries[GLO_FLOW] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Flow"); + myTypeEntries[GLO_STOP] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Stops"); + myTypeEntries[GLO_PERSON] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Persons"); + myTypeEntries[GLO_PERSONFLOW] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "PersonFlows"); + myTypeEntries[GLO_PERSONTRIP] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "PersonTrips"); + myTypeEntries[GLO_RIDE] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Rides"); + myTypeEntries[GLO_WALK] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "Walks"); + myTypeEntries[GLO_PERSONSTOP] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DEMAND, "PersonStops"); + // create typeEntries for Data elements + myTypeEntries[GLO_EDGEDATA] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DATA, "EdgeDatas"); + myTypeEntries[GLO_EDGERELDATA] = new ObjectTypeEntry(matrixLockGLObjectTypes, Supermode::DATA, "EdgeRelDatas"); +} + + +GNESelectorFrame::LockGLObjectTypes::~LockGLObjectTypes() { + // remove all type entries + for (const auto& typeEntry : myTypeEntries) { + delete typeEntry.second; + } +} + + +void +GNESelectorFrame::LockGLObjectTypes::addedLockedObject(const GUIGlObjectType type) { + if (((type >= 100) && (type < 199)) || (type == GLO_TAZ)) { + myTypeEntries.at(GLO_ADDITIONALELEMENT)->counterUp(); + } else { + myTypeEntries.at(type)->counterUp(); + } +} + + +void +GNESelectorFrame::LockGLObjectTypes::removeLockedObject(const GUIGlObjectType type) { + if (((type >= 100) && (type < 199)) || (type == GLO_TAZ)) { + myTypeEntries.at(GLO_ADDITIONALELEMENT)->counterDown(); + } else { + myTypeEntries.at(type)->counterDown(); + } +} + + +bool +GNESelectorFrame::LockGLObjectTypes::IsObjectTypeLocked(const GUIGlObjectType type) const { + if (((type >= 100) && (type < 199)) || (type == GLO_TAZ)) { + return myTypeEntries.at(GLO_ADDITIONALELEMENT)->isGLTypeLocked(); + } else { + return myTypeEntries.at(type)->isGLTypeLocked(); + } +} + + +void +GNESelectorFrame::LockGLObjectTypes::showTypeEntries() { + for (const auto& typeEntry : myTypeEntries) { + // show or hidde type entries depending of current supermode + if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork() && (typeEntry.second->getSupermode() == Supermode::NETWORK)) { + typeEntry.second->showObjectTypeEntry(); + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeDemand() && (typeEntry.second->getSupermode() == Supermode::DEMAND)) { + typeEntry.second->showObjectTypeEntry(); + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeData() && (typeEntry.second->getSupermode() == Supermode::DATA)) { + typeEntry.second->showObjectTypeEntry(); + } else { + typeEntry.second->hideObjectTypeEntry(); + } + } + // recalc frame parent + recalc(); +} + + +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry(FXMatrix* matrixParent, const Supermode supermode, const std::string& label) : + FXObject(), + mySupermode(supermode), + myLabelCounter(nullptr), + myLabelTypeName(nullptr), + myCheckBoxLocked(nullptr), + myCounter(0) { + // create elements + myLabelCounter = new FXLabel(matrixParent, "0", nullptr, GUIDesignLabelLeft); + myLabelTypeName = new FXLabel(matrixParent, (label + " ").c_str(), nullptr, GUIDesignLabelLeft); + myCheckBoxLocked = new FXCheckButton(matrixParent, "unlocked", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); +} + + +Supermode +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::getSupermode() const { + return mySupermode; +} + + +void +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::showObjectTypeEntry() { + myLabelCounter->show(); + myLabelTypeName->show(); + myCheckBoxLocked->show(); +} + + +void +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::hideObjectTypeEntry() { + myLabelCounter->hide(); + myLabelTypeName->hide(); + myCheckBoxLocked->hide(); +} + + +void +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterUp() { + myCounter++; + myLabelCounter->setText(toString(myCounter).c_str()); +} + + +void +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterDown() { + myCounter--; + myLabelCounter->setText(toString(myCounter).c_str()); +} + + +bool +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::isGLTypeLocked() const { + return (myCheckBoxLocked->getCheck() == TRUE); +} + + +long +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::onCmdSetCheckBox(FXObject*, FXSelector, void*) { + if (myCheckBoxLocked->getCheck() == TRUE) { + myCheckBoxLocked->setText("locked"); + } else { + myCheckBoxLocked->setText("unlocked"); + } + return 1; +} + + +GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry() : + FXObject(), + mySupermode(Supermode::NETWORK), + myLabelCounter(nullptr), + myLabelTypeName(nullptr), + myCheckBoxLocked(nullptr), + myCounter(0) { +} + +// --------------------------------------------------------------------------- +// ModificationMode::ModificationMode - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::ModificationMode::ModificationMode(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Modification Mode", GUIDesignGroupBoxFrame), + myModificationModeType(Operation::ADD) { + // Create all options buttons + myAddRadioButton = new FXRadioButton(this, "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", + this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myKeepRadioButton = new FXRadioButton(this, "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", + this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); + myAddRadioButton->setCheck(true); +} + + +GNESelectorFrame::ModificationMode::~ModificationMode() {} + + +GNESelectorFrame::ModificationMode::Operation +GNESelectorFrame::ModificationMode::getModificationMode() const { + return myModificationModeType; +} + + +long +GNESelectorFrame::ModificationMode::onCmdSelectModificationMode(FXObject* obj, FXSelector, void*) { + if (obj == myAddRadioButton) { + myModificationModeType = Operation::ADD; + myAddRadioButton->setCheck(true); + myRemoveRadioButton->setCheck(false); + myKeepRadioButton->setCheck(false); + myReplaceRadioButton->setCheck(false); + return 1; + } else if (obj == myRemoveRadioButton) { + myModificationModeType = Operation::SUB; + myAddRadioButton->setCheck(false); + myRemoveRadioButton->setCheck(true); + myKeepRadioButton->setCheck(false); + myReplaceRadioButton->setCheck(false); + return 1; + } else if (obj == myKeepRadioButton) { + myModificationModeType = Operation::RESTRICT; + myAddRadioButton->setCheck(false); + myRemoveRadioButton->setCheck(false); + myKeepRadioButton->setCheck(true); + myReplaceRadioButton->setCheck(false); + return 1; + } else if (obj == myReplaceRadioButton) { + myModificationModeType = Operation::REPLACE; + myAddRadioButton->setCheck(false); + myRemoveRadioButton->setCheck(false); + myKeepRadioButton->setCheck(false); + myReplaceRadioButton->setCheck(true); + return 1; + } else { + return 0; + } +} + +// --------------------------------------------------------------------------- +// ModificationMode::ElementSet - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::ElementSet::ElementSet(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Element Set", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent), + myCurrentElementSet(Type::NETWORKELEMENT) { + // Create MatchTagBox for tags and fill it + mySetComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_CHOOSEN_ELEMENTS, GUIDesignComboBox); +} + + +GNESelectorFrame::ElementSet::~ElementSet() {} + + +GNESelectorFrame::ElementSet::Type +GNESelectorFrame::ElementSet::getElementSet() const { + return myCurrentElementSet; +} + + +void +GNESelectorFrame::ElementSet::refreshElementSet() { + // first clear item + mySetComboBox->clearItems(); + // now fill elements depending of supermode + if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + mySetComboBox->appendItem("network element"); + mySetComboBox->appendItem("Additional"); + mySetComboBox->appendItem("Shape"); + // show Modul + show(); + // set num items + mySetComboBox->setNumVisible(mySetComboBox->getNumItems()); + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeDemand()) { + mySetComboBox->appendItem("Demand Element"); + // hide Modul (because there is only an element) + hide(); + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeData()) { + mySetComboBox->appendItem("Data Element"); + // hide Modul (because there is only an element) + hide(); + } + // update rest of elements + onCmdSelectElementSet(0, 0, 0); +} + + +long +GNESelectorFrame::ElementSet::onCmdSelectElementSet(FXObject*, FXSelector, void*) { + // check depending of current supermode + if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + // enable moduls + mySelectorFrameParent->myMatchAttribute->showMatchAttribute(); + mySelectorFrameParent->myMatchGenericDataAttribute->hideMatchGenericDataAttribute(); + if (mySetComboBox->getText() == "network element") { + myCurrentElementSet = Type::NETWORKELEMENT; + mySetComboBox->setTextColor(FXRGB(0, 0, 0)); + // enable match attribute + mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); + } else if (mySetComboBox->getText() == "Additional") { + myCurrentElementSet = Type::ADDITIONALELEMENT; + mySetComboBox->setTextColor(FXRGB(0, 0, 0)); + // enable match attribute + mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); + } else if (mySetComboBox->getText() == "Shape") { + myCurrentElementSet = Type::SHAPE; + mySetComboBox->setTextColor(FXRGB(0, 0, 0)); + // enable match attribute + mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); + } else { + myCurrentElementSet = Type::INVALID; + mySetComboBox->setTextColor(FXRGB(255, 0, 0)); + // disable match attribute + mySelectorFrameParent->myMatchAttribute->disableMatchAttribute(); + } + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // enable moduls + mySelectorFrameParent->myMatchAttribute->showMatchAttribute(); + mySelectorFrameParent->myMatchGenericDataAttribute->hideMatchGenericDataAttribute(); + if (mySetComboBox->getText() == "Demand Element") { + myCurrentElementSet = Type::DEMANDELEMENT; + mySetComboBox->setTextColor(FXRGB(0, 0, 0)); + // enable match attribute + mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); + } else { + myCurrentElementSet = Type::INVALID; + mySetComboBox->setTextColor(FXRGB(255, 0, 0)); + // disable match attribute + mySelectorFrameParent->myMatchAttribute->disableMatchAttribute(); + } + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeData()) { + // enable moduls + mySelectorFrameParent->myMatchAttribute->hideMatchAttribute(); + mySelectorFrameParent->myMatchGenericDataAttribute->showMatchGenericDataAttribute(); + if (mySetComboBox->getText() == "Data Element") { + myCurrentElementSet = Type::DATA; + mySetComboBox->setTextColor(FXRGB(0, 0, 0)); + // enable match attribute + mySelectorFrameParent->myMatchGenericDataAttribute->enableMatchGenericDataAttribute(); + } else { + myCurrentElementSet = Type::INVALID; + mySetComboBox->setTextColor(FXRGB(255, 0, 0)); + // disable match attribute + mySelectorFrameParent->myMatchGenericDataAttribute->enableMatchGenericDataAttribute(); + } + } + return 1; +} + +// --------------------------------------------------------------------------- +// ModificationMode::MatchAttribute - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::MatchAttribute::MatchAttribute(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Match Attribute", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent), + myCurrentTag(SUMO_TAG_EDGE), + myCurrentAttribute(SUMO_ATTR_ID) { + // Create MatchTagBox for tags + myMatchTagComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); + // Create listBox for Attributes + myMatchAttrComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); + // Create TextField for Match string + myMatchString = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); + // Create help button + new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + // Fill list of sub-items (first element will be "edge") + enableMatchAttribute(); + // Set speed of edge as default attribute + myMatchAttrComboBox->setText("speed"); + myCurrentAttribute = SUMO_ATTR_SPEED; + // Set default value for Match string + myMatchString->setText(">10.0"); +} + + +GNESelectorFrame::MatchAttribute::~MatchAttribute() {} + + +void +GNESelectorFrame::MatchAttribute::enableMatchAttribute() { + // enable comboboxes and text field + myMatchTagComboBox->enable(); + myMatchAttrComboBox->enable(); + myMatchString->enable(); + // Clear items of myMatchTagComboBox + myMatchTagComboBox->clearItems(); + // Set items depending of current item set + std::vector ACTags; + if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::NETWORKELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategoryStr(GNETagProperties::TagType::NETWORKELEMENT, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::ADDITIONALELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategoryStr(GNETagProperties::TagType::ADDITIONALELEMENT | GNETagProperties::TagType::TAZ, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::SHAPE) { + ACTags = GNEAttributeCarrier::allowedTagsByCategoryStr(GNETagProperties::TagType::SHAPE, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::DEMANDELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategoryStr(GNETagProperties::TagType::DEMANDELEMENT | GNETagProperties::TagType::STOP, true); + } else { + throw ProcessError("Invalid element set"); + } + // fill combo box + for (const auto& ACTag : ACTags) { + myMatchTagComboBox->appendItem(ACTag.c_str()); + } + // set first item as current item + myMatchTagComboBox->setCurrentItem(0); + myMatchTagComboBox->setNumVisible(myMatchTagComboBox->getNumItems()); + // Fill attributes with the current element type + onCmdSelMBTag(nullptr, 0, nullptr); +} + + +void +GNESelectorFrame::MatchAttribute::disableMatchAttribute() { + // disable comboboxes and text field + myMatchTagComboBox->disable(); + myMatchAttrComboBox->disable(); + myMatchString->disable(); + // change colors to black (even if there are invalid values) + myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchString->setTextColor(FXRGB(0, 0, 0)); +} + + +void +GNESelectorFrame::MatchAttribute::showMatchAttribute() { + show(); +} + + +void +GNESelectorFrame::MatchAttribute::hideMatchAttribute() { + hide(); +} + + +long +GNESelectorFrame::MatchAttribute::onCmdSelMBTag(FXObject*, FXSelector, void*) { + // First check what type of elementes is being selected + myCurrentTag = SUMO_TAG_NOTHING; + // find current element tag + std::vector ACTags; + if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::NETWORKELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::NETWORKELEMENT, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::ADDITIONALELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::ADDITIONALELEMENT | GNETagProperties::TagType::TAZ, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::SHAPE) { + ACTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::SHAPE, true); + } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::Type::DEMANDELEMENT) { + ACTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::DEMANDELEMENT | GNETagProperties::TagType::STOP, true); + } else { + throw ProcessError("Unkown set"); + } + // fill myMatchTagComboBox + for (const auto& ACTag : ACTags) { + if (toString(ACTag) == myMatchTagComboBox->getText().text()) { + myCurrentTag = ACTag; + } + } + // check that typed-by-user value is correct + if (myCurrentTag != SUMO_TAG_NOTHING) { + // obtain tag property (only for improve code legibility) + const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); + // set color and enable items + myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchAttrComboBox->enable(); + myMatchString->enable(); + myMatchAttrComboBox->clearItems(); + // fill attribute combo box + for (const auto& attribute : tagValue) { + myMatchAttrComboBox->appendItem(attribute.getAttrStr().c_str()); + } + // Add extra attribute "Parameter" + myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARAMETERS).c_str()); + // check if item can block movement + if (tagValue.canBlockMovement()) { + myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_MOVEMENT).c_str()); + } + // check if item can block shape + if (tagValue.canBlockShape()) { + myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_SHAPE).c_str()); + } + // check if item can close shape + if (tagValue.canCloseShape()) { + myMatchAttrComboBox->appendItem(toString(GNE_ATTR_CLOSE_SHAPE).c_str()); + } + // check if item can have parent + if (tagValue.hasParent()) { + myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARENT).c_str()); + } + // @ToDo: Here can be placed a button to set the default value + myMatchAttrComboBox->setNumVisible(myMatchAttrComboBox->getNumItems()); + // check if we have to update attribute + if (tagValue.hasAttribute(myCurrentAttribute)) { + myMatchAttrComboBox->setText(toString(myCurrentAttribute).c_str()); + } else { + onCmdSelMBAttribute(nullptr, 0, nullptr); + } + } else { + // change color to red and disable items + myMatchTagComboBox->setTextColor(FXRGB(255, 0, 0)); + myMatchAttrComboBox->disable(); + myMatchString->disable(); + } + update(); + return 1; +} + + +long +GNESelectorFrame::MatchAttribute::onCmdSelMBAttribute(FXObject*, FXSelector, void*) { + // first obtain a copy of item attributes vinculated with current tag + auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperties(myCurrentTag); + // obtain tag property (only for improve code legibility) + const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); + // add an extra AttributeValues to allow select ACs using as criterium "parameters" + GNEAttributeProperties extraAttrProperty; + extraAttrProperty = GNEAttributeProperties(GNE_ATTR_PARAMETERS, + GNEAttributeProperties::AttrProperty::STRING, + "Parameters"); + tagPropertiesCopy.addAttribute(extraAttrProperty); + // add extra attribute if item can block movement + if (tagValue.canBlockMovement()) { + // add an extra AttributeValues to allow select ACs using as criterium "block movement" + extraAttrProperty = GNEAttributeProperties(GNE_ATTR_BLOCK_MOVEMENT, + GNEAttributeProperties::AttrProperty::BOOL | GNEAttributeProperties::AttrProperty::DEFAULTVALUESTATIC, + "Block movement", + "false"); + tagPropertiesCopy.addAttribute(extraAttrProperty); + } + // add extra attribute if item can block shape + if (tagValue.canBlockShape()) { + // add an extra AttributeValues to allow select ACs using as criterium "block shape" + extraAttrProperty = GNEAttributeProperties(GNE_ATTR_BLOCK_SHAPE, + GNEAttributeProperties::AttrProperty::BOOL | GNEAttributeProperties::AttrProperty::DEFAULTVALUESTATIC, + "Block shape", + "false"); + tagPropertiesCopy.addAttribute(extraAttrProperty); + } + // add extra attribute if item can close shape + 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, + "Close shape", + "true"); + tagPropertiesCopy.addAttribute(extraAttrProperty); + } + // add extra attribute if item can have parent + if (tagValue.hasParent()) { + // add an extra AttributeValues to allow select ACs using as criterium "parent" + extraAttrProperty = GNEAttributeProperties(GNE_ATTR_PARENT, + GNEAttributeProperties::AttrProperty::STRING, + "Parent element"); + tagPropertiesCopy.addAttribute(extraAttrProperty); + } + // set current selected attribute + myCurrentAttribute = SUMO_ATTR_NOTHING; + for (const auto& attribute : tagPropertiesCopy) { + if (attribute.getAttrStr() == myMatchAttrComboBox->getText().text()) { + myCurrentAttribute = attribute.getAttr(); + } + } + // check if selected attribute is valid + if (myCurrentAttribute != SUMO_ATTR_NOTHING) { + myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchString->enable(); + } else { + myMatchAttrComboBox->setTextColor(FXRGB(255, 0, 0)); + myMatchString->disable(); + } + return 1; +} + + +long +GNESelectorFrame::MatchAttribute::onCmdSelMBString(FXObject*, FXSelector, void*) { + // obtain expresion + std::string expr(myMatchString->getText().text()); + const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); + bool valid = true; + if (expr == "") { + // the empty expression matches all objects + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, '@', 0, expr)); + } else if (tagValue.hasAttribute(myCurrentAttribute) && tagValue.getAttributeProperties(myCurrentAttribute).isNumerical()) { + // The expression must have the form + // val matches if attr > val + // =val matches if attr = val + // val matches if attr = val + char compOp = expr[0]; + if (compOp == '<' || compOp == '>' || compOp == '=') { + expr = expr.substr(1); + } else { + compOp = '='; + } + // check if value can be parsed to double + if (GNEAttributeCarrier::canParse(expr.c_str())) { + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, GNEAttributeCarrier::parse(expr.c_str()), expr)); + } else { + valid = false; + } + } else { + // The expression must have the form + // =str: matches if is an exact match + // !str: matches if is not a substring + // ^str: matches if is not an exact match + // str: matches if is a substring (sends compOp '@') + // Alternatively, if the expression is empty it matches all objects + char compOp = expr[0]; + if (compOp == '=' || compOp == '!' || compOp == '^') { + expr = expr.substr(1); + } else { + compOp = '@'; + } + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, 0, expr)); + } + if (valid) { + myMatchString->setTextColor(FXRGB(0, 0, 0)); + myMatchString->killFocus(); + } else { + myMatchString->setTextColor(FXRGB(255, 0, 0)); + } + return 1; +} + + +long +GNESelectorFrame::MatchAttribute::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 + << "- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n" + << " according to the current 'Modification Mode'.\n" + << " 1. Select an object type from the first input box\n" + << " 2. Select an attribute from the second input box\n" + << " 3. Enter a 'match expression' in the third input box and press \n" + << "\n" + << "- The empty expression matches all objects\n" + << "- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n" + << "- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n" + << "\n" + << "- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n" + << " '' (no operator) matches if string is a substring of that object'ts attribute.\n" + << " '=' matches if string is an exact match.\n" + << " '!' matches if string is not a substring.\n" + << " '^' matches if string is not an exact match.\n" + << "\n" + << "- Examples:\n" + << " junction; id; 'foo' -> match all junctions that have 'foo' in their id\n" + << " junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n" + << " edge; speed; '>10' -> match all edges with a speed above 10\n"; + // Create label with the help text + new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, 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 help dialog of selector frame"); + // 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("Close help dialog of selector frame"); + return 1; +} + +// --------------------------------------------------------------------------- +// ModificationMode::MatchGenericDataAttribute - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::MatchGenericDataAttribute::MatchGenericDataAttribute(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Match GenericData Attribute", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent), + myIntervalSelector(nullptr), + myBegin(nullptr), + myEnd(nullptr), + myMatchGenericDataTagComboBox(nullptr), + myMatchGenericDataAttrComboBox(nullptr), + myCurrentTag(SUMO_TAG_EDGE), + myMatchGenericDataString(nullptr) { + // Create MatchGenericDataTagBox for tags + new FXLabel(this, "Interval [begin, end]", nullptr, GUIDesignLabelThick); + myIntervalSelector = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SETINTERVAL, GUIDesignComboBoxStaticExtended); + // Create textfield for begin and end + FXHorizontalFrame* myHorizontalFrameBeginEnd = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myBegin = new FXTextField(myHorizontalFrameBeginEnd, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETBEGIN, GUIDesignTextField); + myEnd = new FXTextField(myHorizontalFrameBeginEnd, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_SETEND, GUIDesignTextField); + // Create MatchGenericDataTagBox myHorizontalFrameEnd tags + myMatchGenericDataTagComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); + // Create listBox for Attributes + myMatchGenericDataAttrComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); + // Create TextField for MatchGenericData string + myMatchGenericDataString = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); + // Create help button + new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); + // Fill list of sub-items (first element will be "edge") + enableMatchGenericDataAttribute(); + // Set speed of edge as default attribute + myMatchGenericDataAttrComboBox->setText("speed"); + myCurrentAttribute = SUMO_ATTR_SPEED; + // Set default value for MatchGenericData string + myMatchGenericDataString->setText(">10.0"); +} + + +GNESelectorFrame::MatchGenericDataAttribute::~MatchGenericDataAttribute() {} + + +void +GNESelectorFrame::MatchGenericDataAttribute::enableMatchGenericDataAttribute() { + // first drop intervals + myIntervals.clear(); + // iterate over all data sets + for (const auto& dataSet : mySelectorFrameParent->getViewNet()->getNet()->retrieveDataSets()) { + for (const auto& dataInterval : dataSet->getDataIntervalChildren()) { + myIntervals[std::make_pair(dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN), dataInterval.second->getAttributeDouble(SUMO_ATTR_END))] = -1; + } + } + // disable modul if there isn't intervals + if (myIntervals.size() == 0) { + disableMatchGenericDataAttribute(); + } else { + // enable comboboxes and text field + myIntervalSelector->enable(); + myBegin->enable(); + myEnd->enable(); + myMatchGenericDataTagComboBox->enable(); + myMatchGenericDataAttrComboBox->enable(); + myMatchGenericDataString->enable(); + // clear combo box interval selector + myIntervalSelector->clearItems(); + // fill combo Box + for (auto& interval : myIntervals) { + interval.second = myIntervalSelector->appendItem((" [" + toString(interval.first.first) + "," + toString(interval.first.second) + "]").c_str()); + } + // set number of visible items + if (myIntervalSelector->getNumItems() < 10) { + myIntervalSelector->setNumVisible(myIntervalSelector->getNumItems()); + } else { + myIntervalSelector->setNumVisible(10); + } + // Clear items of myMatchGenericDataTagComboBox + myMatchGenericDataTagComboBox->clearItems(); + // update begin and end + myBegin->setText(toString(myIntervals.begin()->first.first).c_str()); + myBegin->setTextColor(FXRGB(0, 0, 0)); + myEnd->setText(toString(myIntervals.begin()->first.second).c_str()); + myEnd->setTextColor(FXRGB(0, 0, 0)); + // get generic datas + std::vector genericDataTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::GENERICDATA, true); + // fill combo box + for (const auto& genericDataTag : genericDataTags) { + myMatchGenericDataTagComboBox->appendItem(toString(genericDataTag).c_str()); + } + // set first item as current item + myMatchGenericDataTagComboBox->setCurrentItem(0); + myMatchGenericDataTagComboBox->setNumVisible(myMatchGenericDataTagComboBox->getNumItems()); + // call select tag + onCmdSelectTag(nullptr, 0, nullptr); + } +} + + +void +GNESelectorFrame::MatchGenericDataAttribute::disableMatchGenericDataAttribute() { + // disable comboboxes and text field + myIntervalSelector->disable(); + myBegin->disable(); + myEnd->disable(); + myMatchGenericDataTagComboBox->disable(); + myMatchGenericDataAttrComboBox->disable(); + myMatchGenericDataString->disable(); + // change colors to black (even if there are invalid values) + myMatchGenericDataTagComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchGenericDataAttrComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0)); +} + + +void +GNESelectorFrame::MatchGenericDataAttribute::showMatchGenericDataAttribute() { + // just show Modul + show(); +} + + +void +GNESelectorFrame::MatchGenericDataAttribute::hideMatchGenericDataAttribute() { + // just hide modul + hide(); +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdSetInterval(FXObject*, FXSelector, void*) { + // iterate over interval and update begin and end + for (auto& interval : myIntervals) { + if (interval.second == myIntervalSelector->getCurrentItem()) { + // update begin + myBegin->setTextColor(FXRGB(0, 0, 0)); + myBegin->setText(toString(interval.first.first).c_str()); + // update end + myEnd->setTextColor(FXRGB(0, 0, 0)); + myEnd->setText(toString(interval.first.second).c_str()); + } + } + // call onCmdSelectTag + onCmdSelectTag(0, 0, 0); + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdSetBegin(FXObject*, FXSelector, void*) { + // check if can be parsed to double + if (GNEAttributeCarrier::canParse(myBegin->getText().text()) && + GNEAttributeCarrier::canParse(myEnd->getText().text())) { + // set valid color text and kill focus + myBegin->setTextColor(FXRGB(0, 0, 0)); + myBegin->killFocus(); + // enable elements + myMatchGenericDataTagComboBox->enable(); + myMatchGenericDataAttrComboBox->enable(); + myMatchGenericDataString->enable(); + // call onCmdSelectTag + onCmdSelectTag(0, 0, 0); + } else { + // set invalid color text + myBegin->setTextColor(FXRGB(255, 0, 0)); + // disable elements + myMatchGenericDataTagComboBox->disable(); + myMatchGenericDataAttrComboBox->disable(); + myMatchGenericDataString->disable(); + } + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdSetEnd(FXObject*, FXSelector, void*) { + // check if can be parsed to double + if (GNEAttributeCarrier::canParse(myBegin->getText().text()) && + GNEAttributeCarrier::canParse(myEnd->getText().text())) { + // set valid color text and kill focus + myEnd->setTextColor(FXRGB(0, 0, 0)); + myEnd->killFocus(); + // enable elements + myMatchGenericDataTagComboBox->enable(); + myMatchGenericDataAttrComboBox->enable(); + myMatchGenericDataString->enable(); + // call onCmdSelectTag + onCmdSelectTag(0, 0, 0); + } else { + // set invalid color text + myEnd->setTextColor(FXRGB(255, 0, 0)); + // disable elements + myMatchGenericDataTagComboBox->disable(); + myMatchGenericDataAttrComboBox->disable(); + myMatchGenericDataString->disable(); + } + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdSelectTag(FXObject*, FXSelector, void*) { + // First check what type of elementes is being selected + myCurrentTag = SUMO_TAG_NOTHING; + // get generic data tags + std::vector listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::GENERICDATA, true); + // fill myMatchGenericDataTagComboBox + for (const auto& tag : listOfTags) { + if (toString(tag) == myMatchGenericDataTagComboBox->getText().text()) { + myCurrentTag = tag; + } + } + // check that typed-by-user value is correct + if (myCurrentTag != SUMO_TAG_NOTHING) { + // obtain begin and end + const double begin = GNEAttributeCarrier::parse(myBegin->getText().text()); + const double end = GNEAttributeCarrier::parse(myEnd->getText().text()); + // obtain all Generic Data attributes for current generic tag + auto attributes = mySelectorFrameParent->getViewNet()->getNet()->retrieveGenericDataParameters(toString(myCurrentTag), begin, end); + // set color and enable items + myMatchGenericDataTagComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchGenericDataAttrComboBox->enable(); + myMatchGenericDataString->enable(); + myMatchGenericDataAttrComboBox->clearItems(); + // add data set parent + myMatchGenericDataAttrComboBox->appendItem(toString(GNE_ATTR_DATASET).c_str()); + // fill attribute combo box + for (const auto& attribute : attributes) { + myMatchGenericDataAttrComboBox->appendItem(attribute.c_str()); + } + myMatchGenericDataAttrComboBox->setNumVisible(myMatchGenericDataAttrComboBox->getNumItems()); + onCmdSelectAttribute(nullptr, 0, nullptr); + } else { + // change color to red and disable items + myMatchGenericDataTagComboBox->setTextColor(FXRGB(255, 0, 0)); + myMatchGenericDataAttrComboBox->disable(); + myMatchGenericDataString->disable(); + } + update(); + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdSelectAttribute(FXObject*, FXSelector, void*) { + // obtain all Generic Data attributes for current generic tag + std::set attributes = mySelectorFrameParent->getViewNet()->getNet()->retrieveGenericDataParameters( + toString(myCurrentTag), + GNEAttributeCarrier::parse(myBegin->getText().text()), + GNEAttributeCarrier::parse(myEnd->getText().text())); + // add extra data set parent attribute + attributes.insert(toString(GNE_ATTR_DATASET)); + // clear current attribute + myCurrentAttribute.clear(); + // set current selected attribute + for (const auto& attribute : attributes) { + if (attribute == myMatchGenericDataAttrComboBox->getText().text()) { + myCurrentAttribute = attribute; + } + } + // check if selected attribute is valid + if (myCurrentAttribute.empty()) { + myMatchGenericDataAttrComboBox->setTextColor(FXRGB(255, 0, 0)); + myMatchGenericDataString->disable(); + } else { + myMatchGenericDataAttrComboBox->setTextColor(FXRGB(0, 0, 0)); + myMatchGenericDataString->enable(); + } + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::onCmdProcessString(FXObject*, FXSelector, void*) { + // obtain expression and tag value + std::string expression = myMatchGenericDataString->getText().text(); + bool valid = true; + // get all Generic datas + const auto genericDatas = mySelectorFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveGenericDatas(myCurrentTag, + GNEAttributeCarrier::parse(myBegin->getText().text()), + GNEAttributeCarrier::parse(myEnd->getText().text())); + if (expression == "") { + // the empty expression matches all objects + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getGenericMatches(genericDatas, myCurrentAttribute, '@', 0, expression)); + } else if (myCurrentAttribute != toString(GNE_ATTR_DATASET)) { + // The expression must have the form + // val matches if attr > val + // =val matches if attr = val + // val matches if attr = val + char compOp = expression[0]; + if ((compOp == '<') || (compOp == '>') || (compOp == '=')) { + expression = expression.substr(1); + } else { + compOp = '='; + } + // check if value can be parsed to double + if (GNEAttributeCarrier::canParse(expression.c_str())) { + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getGenericMatches(genericDatas, myCurrentAttribute, compOp, GNEAttributeCarrier::parse(expression.c_str()), expression)); + } else { + valid = false; + } + } else { + // The expression must have the form + // =str: matches if is an exact match + // !str: matches if is not a substring + // ^str: matches if is not an exact match + // str: matches if is a substring (sends compOp '@') + // Alternatively, if the expression is empty it matches all objects + char compOp = expression[0]; + if ((compOp == '=') || (compOp == '!') || (compOp == '^')) { + expression = expression.substr(1); + } else { + compOp = '@'; + } + mySelectorFrameParent->handleIDs(mySelectorFrameParent->getGenericMatches(genericDatas, myCurrentAttribute, compOp, 0, expression)); + } + // change color depending of flag "valid" + if (valid) { + myMatchGenericDataString->setTextColor(FXRGB(0, 0, 0)); + myMatchGenericDataString->killFocus(); + } else { + myMatchGenericDataString->setTextColor(FXRGB(255, 0, 0)); + } + return 1; +} + + +long +GNESelectorFrame::MatchGenericDataAttribute::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 + << "- The 'MatchGenericData Attribute' controls allow to specify a set of objects which are then applied to the current selection\n" + << " according to the current 'Modification Mode'.\n" + << " 1. Select an object type from the first input box\n" + << " 2. Select an attribute from the second input box\n" + << " 3. Enter a 'match expression' in the third input box and press \n" + << "\n" + << "- The empty expression matches all objects\n" + << "- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n" + << "- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n" + << "\n" + << "- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n" + << " '' (no operator) matches if string is a substring of that object'ts attribute.\n" + << " '=' matches if string is an exact match.\n" + << " '!' matches if string is not a substring.\n" + << " '^' matches if string is not an exact match.\n" + << "\n" + << "- Examples:\n" + << " junction; id; 'foo' -> match all junctions that have 'foo' in their id\n" + << " junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n" + << " edge; speed; '>10' -> match all edges with a speed above 10\n"; + // Create label with the help text + new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, 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 help dialog of selector frame"); + // 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("Close help dialog of selector frame"); + return 1; +} + +// --------------------------------------------------------------------------- +// ModificationMode::VisualScaling - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::VisualScaling::VisualScaling(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Visual Scaling", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent) { + // Create spin button and configure it + mySelectionScaling = new FXRealSpinner(this, 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial); + //mySelectionScaling->setNumberFormat(1); + //mySelectionScaling->setIncrements(0.1, .5, 1); + mySelectionScaling->setIncrement(0.5); + mySelectionScaling->setRange(1, 100000); + mySelectionScaling->setValue(1); + mySelectionScaling->setHelpText("Enlarge selected objects"); +} + + +GNESelectorFrame::VisualScaling::~VisualScaling() {} + + +long +GNESelectorFrame::VisualScaling::onCmdScaleSelection(FXObject*, FXSelector, void*) { + // set scale in viewnet + mySelectorFrameParent->myViewNet->setSelectionScaling(mySelectionScaling->getValue()); + mySelectorFrameParent->myViewNet->updateViewNet(); + return 1; +} + +// --------------------------------------------------------------------------- +// ModificationMode::SelectionOperation - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::SelectionOperation::SelectionOperation(GNESelectorFrame* selectorFrameParent) : + FXGroupBox(selectorFrameParent->myContentFrame, "Operations for selections", GUIDesignGroupBoxFrame), + mySelectorFrameParent(selectorFrameParent) { + // Create "Clear List" Button + new FXButton(this, "Clear\t\t", nullptr, this, MID_CHOOSEN_CLEAR, GUIDesignButton); + // Create "Invert" Button + new FXButton(this, "Invert\t\t", nullptr, this, MID_CHOOSEN_INVERT, GUIDesignButton); + // Create "Save" Button + new FXButton(this, "Save\t\tSave ids of currently selected objects to a file.", nullptr, this, MID_CHOOSEN_SAVE, GUIDesignButton); + // Create "Load" Button + new FXButton(this, "Load\t\tLoad ids from a file according to the current modfication mode.", nullptr, this, MID_CHOOSEN_LOAD, GUIDesignButton); +} + + +GNESelectorFrame::SelectionOperation::~SelectionOperation() {} + + +long +GNESelectorFrame::SelectionOperation::onCmdLoad(FXObject*, FXSelector, void*) { + // get the new file name + FXFileDialog opendialog(this, "Open List of Selected Items"); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); + opendialog.setSelectMode(SELECTFILE_EXISTING); + opendialog.setPatternList("Selection files (*.txt)\nAll files (*)"); + if (gCurrentFolder.length() != 0) { + opendialog.setDirectory(gCurrentFolder); + } + if (opendialog.execute()) { + std::vector loadedACs; + gCurrentFolder = opendialog.getDirectory(); + std::string file = opendialog.getFilename().text(); + std::ostringstream msg; + std::ifstream strm(file.c_str()); + // check if file can be opened + if (!strm.good()) { + WRITE_ERROR("Could not open '" + file + "'."); + return 0; + } + while (strm.good()) { + std::string line; + strm >> line; + // check if line isn't empty + if (line.length() != 0) { + // obtain GLObject + GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(line); + // check if GUIGlObject exist and their their GL type isn't blocked + if ((object != nullptr) && !mySelectorFrameParent->myLockGLObjectTypes->IsObjectTypeLocked(object->getType())) { + // obtain GNEAttributeCarrier + GNEAttributeCarrier* AC = mySelectorFrameParent->myViewNet->getNet()->retrieveAttributeCarrier(object->getGlID(), false); + // check if AC exist and if is selectable + if (AC && AC->getTagProperty().isSelectable()) + // now check if we're in the correct supermode to load this element + if (((mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) && !AC->getTagProperty().isDemandElement()) || + ((mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeDemand()) && AC->getTagProperty().isDemandElement())) { + loadedACs.push_back(AC); + } + } + } + } + // change selected attribute in loaded ACs allowing undo/redo + if (loadedACs.size() > 0) { + mySelectorFrameParent->myViewNet->getUndoList()->p_begin("load selection"); + mySelectorFrameParent->handleIDs(loadedACs); + mySelectorFrameParent->myViewNet->getUndoList()->p_end(); + } + } + mySelectorFrameParent->myViewNet->updateViewNet(); + return 1; +} + + +long +GNESelectorFrame::SelectionOperation::onCmdSave(FXObject*, FXSelector, void*) { + FXString file = MFXUtils::getFilename2Write(this, + "Save List of selected Items", ".txt", + GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); + if (file == "") { + return 1; + } + try { + OutputDevice& dev = OutputDevice::getDevice(file.text()); + // get selected attribute carriers + const auto selectedACs = mySelectorFrameParent->myViewNet->getNet()->getSelectedAttributeCarriers(false); + for (const auto& selectedAC : selectedACs) { + GUIGlObject* object = dynamic_cast(selectedAC); + if (object) { + dev << GUIGlObject::TypeNames.getString(object->getType()) << ":" << selectedAC->getID() << "\n"; + } + } + dev.close(); + } catch (IOError& e) { + // 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()); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'error storing selection' with 'OK'"); + } + return 1; +} + + +long +GNESelectorFrame::SelectionOperation::onCmdClear(FXObject*, FXSelector, void*) { + // clear current selection + mySelectorFrameParent->clearCurrentSelection(); + return 1; +} + + +long +GNESelectorFrame::SelectionOperation::onCmdInvert(FXObject*, FXSelector, void*) { + // only continue if there is element for selecting + if (mySelectorFrameParent->ACsToSelected()) { + // obtan locks (only for improve code legibly) + LockGLObjectTypes* locks = mySelectorFrameParent->getLockGLObjectTypes(); + // for invert selection, first clean current selection and next select elements of set "unselectedElements" + mySelectorFrameParent->myViewNet->getUndoList()->p_begin("invert selection"); + // invert selection of elements depending of current supermode + if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + // iterate over junctions + for (const auto& junction : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + // check if junction selection is locked + if (!locks->IsObjectTypeLocked(GLO_JUNCTION)) { + if (junction.second->isAttributeCarrierSelected()) { + junction.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + junction.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + // due we iterate over all junctions, only it's neccesary iterate over incoming edges + for (const auto& incomingEdge : junction.second->getGNEIncomingEdges()) { + // only select edges if "select edges" flag is enabled. In other case, select only lanes + if (mySelectorFrameParent->myViewNet->getNetworkViewOptions().selectEdges()) { + // check if edge selection is locked + if (!locks->IsObjectTypeLocked(GLO_EDGE)) { + if (incomingEdge->isAttributeCarrierSelected()) { + incomingEdge->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + incomingEdge->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } else { + // check if lane selection is locked + if (!locks->IsObjectTypeLocked(GLO_LANE)) { + for (const auto& lane : incomingEdge->getLanes()) { + if (lane->isAttributeCarrierSelected()) { + lane->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + lane->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } + // check if connection selection is locked + if (!locks->IsObjectTypeLocked(GLO_CONNECTION)) { + for (const auto& connection : incomingEdge->getGNEConnections()) { + if (connection->isAttributeCarrierSelected()) { + connection->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + connection->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } + // check if crossing selection is locked + if (!locks->IsObjectTypeLocked(GLO_CROSSING)) { + for (const auto& crossing : junction.second->getGNECrossings()) { + if (crossing->isAttributeCarrierSelected()) { + crossing->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + crossing->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } + // check if additionals selection is locked + if (!locks->IsObjectTypeLocked(GLO_ADDITIONALELEMENT)) { + for (const auto& additionals : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) { + // first check if additional is selectable + if (GNEAttributeCarrier::getTagProperties(additionals.first).isSelectable()) { + for (const auto& additional : additionals.second) { + if (additional.second->isAttributeCarrierSelected()) { + additional.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + additional.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } + } + // select polygons + if (!locks->IsObjectTypeLocked(GLO_POLYGON)) { + for (const auto& polygon : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY)) { + if (polygon.second->isAttributeCarrierSelected()) { + polygon.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + polygon.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select POIs and POILanes + if (!locks->IsObjectTypeLocked(GLO_POI)) { + for (const auto& POI : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POI)) { + if (POI.second->isAttributeCarrierSelected()) { + POI.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + POI.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& POILane : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POILANE)) { + if (POILane.second->isAttributeCarrierSelected()) { + POILane.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + POILane.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // select routes + if (!locks->IsObjectTypeLocked(GLO_ROUTE)) { + for (const auto& route : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE)) { + if (route.second->isAttributeCarrierSelected()) { + route.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + route.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select embedded routes + if (!locks->IsObjectTypeLocked(GLO_EMBEDDEDROUTE)) { + for (const auto& embeddedRoute : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_EMBEDDEDROUTE)) { + if (embeddedRoute.second->isAttributeCarrierSelected()) { + embeddedRoute.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + embeddedRoute.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select vehicles + if (!locks->IsObjectTypeLocked(GLO_VEHICLE)) { + for (const auto& vehicle : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) { + if (vehicle.second->isAttributeCarrierSelected()) { + vehicle.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + vehicle.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select trips + if (!locks->IsObjectTypeLocked(GLO_TRIP)) { + for (const auto& trip : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) { + if (trip.second->isAttributeCarrierSelected()) { + trip.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + trip.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select flows + if (!locks->IsObjectTypeLocked(GLO_FLOW)) { + for (const auto& flow : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) { + if (flow.second->isAttributeCarrierSelected()) { + flow.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + flow.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select route flows + if (!locks->IsObjectTypeLocked(GLO_ROUTEFLOW)) { + for (const auto& routeFlow : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW)) { + if (routeFlow.second->isAttributeCarrierSelected()) { + routeFlow.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + routeFlow.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select stops + if (!locks->IsObjectTypeLocked(GLO_STOP)) { + for (const auto& stopLane : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_LANE)) { + if (stopLane.second->isAttributeCarrierSelected()) { + stopLane.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + stopLane.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& stopBusStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_BUSSTOP)) { + if (stopBusStop.second->isAttributeCarrierSelected()) { + stopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + stopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& stopContainerStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CONTAINERSTOP)) { + if (stopContainerStop.second->isAttributeCarrierSelected()) { + stopContainerStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + stopContainerStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& stopChargingStation : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CHARGINGSTATION)) { + if (stopChargingStation.second->isAttributeCarrierSelected()) { + stopChargingStation.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + stopChargingStation.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& stopParkingArea : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_PARKINGAREA)) { + if (stopParkingArea.second->isAttributeCarrierSelected()) { + stopParkingArea.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + stopParkingArea.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select person + if (!locks->IsObjectTypeLocked(GLO_PERSON)) { + for (const auto& person : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON)) { + if (person.second->isAttributeCarrierSelected()) { + person.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + person.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select person flow + if (!locks->IsObjectTypeLocked(GLO_PERSONFLOW)) { + for (const auto& personFlow : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW)) { + if (personFlow.second->isAttributeCarrierSelected()) { + personFlow.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + personFlow.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select person trip + if (!locks->IsObjectTypeLocked(GLO_PERSONTRIP)) { + for (const auto& personTripFromTo : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_FROMTO)) { + if (personTripFromTo.second->isAttributeCarrierSelected()) { + personTripFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + personTripFromTo.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& personTripBusStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_BUSSTOP)) { + if (personTripBusStop.second->isAttributeCarrierSelected()) { + personTripBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + personTripBusStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select ride + if (!locks->IsObjectTypeLocked(GLO_RIDE)) { + for (const auto& rideFromTo : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_FROMTO)) { + if (rideFromTo.second->isAttributeCarrierSelected()) { + rideFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + rideFromTo.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& rideBusStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_BUSSTOP)) { + if (rideBusStop.second->isAttributeCarrierSelected()) { + rideBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + rideBusStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select walks + if (!locks->IsObjectTypeLocked(GLO_WALK)) { + for (const auto& walkFromTo : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_FROMTO)) { + if (walkFromTo.second->isAttributeCarrierSelected()) { + walkFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + walkFromTo.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& walkBusStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_BUSSTOP)) { + if (walkBusStop.second->isAttributeCarrierSelected()) { + walkBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + walkBusStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& walkRoute : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_ROUTE)) { + if (walkRoute.second->isAttributeCarrierSelected()) { + walkRoute.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + walkRoute.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + // select person stops + if (!locks->IsObjectTypeLocked(GLO_PERSONSTOP)) { + for (const auto& personStopLane : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_LANE)) { + if (personStopLane.second->isAttributeCarrierSelected()) { + personStopLane.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + personStopLane.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + for (const auto& personStopBusStop : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_BUSSTOP)) { + if (personStopBusStop.second->isAttributeCarrierSelected()) { + personStopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + personStopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } else if (mySelectorFrameParent->myViewNet->getEditModes().isCurrentSupermodeData()) { + // select dataSets + for (const auto& dataSet : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers()->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + if ((!locks->IsObjectTypeLocked(GLO_EDGEDATA) && (genericData->getType() == GLO_EDGEDATA)) || + (!locks->IsObjectTypeLocked(GLO_EDGERELDATA) && (genericData->getType() == GLO_EDGERELDATA))) { + if (genericData->isAttributeCarrierSelected()) { + genericData->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); + } else { + genericData->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); + } + } + } + } + } + } + // finish selection operation + mySelectorFrameParent->myViewNet->getUndoList()->p_end(); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNESelectorFrame - methods +// --------------------------------------------------------------------------- + +GNESelectorFrame::GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Selection") { + // create selectedItems modul + myLockGLObjectTypes = new LockGLObjectTypes(this); + // create Modification Mode modul + myModificationMode = new ModificationMode(this); + // create ElementSet modul + myElementSet = new ElementSet(this); + // create MatchAttribute modul + myMatchAttribute = new MatchAttribute(this); + // create MatchGenericDataAttribute modul + myMatchGenericDataAttribute = new MatchGenericDataAttribute(this); + // create VisualScaling modul + 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 items.", nullptr, GUIDesignLabelFrameInformation); + +} + + +GNESelectorFrame::~GNESelectorFrame() {} + + +void +GNESelectorFrame::show() { + // show Type Entries depending of current supermode + myLockGLObjectTypes->showTypeEntries(); + // refresh element set + myElementSet->refreshElementSet(); + // Show frame + GNEFrame::show(); +} + + +void +GNESelectorFrame::hide() { + // hide frame + GNEFrame::hide(); +} + + +void +GNESelectorFrame::clearCurrentSelection() const { + // only continue if there is element for selecting + if (ACsToSelected()) { + // for invert selection, first clean current selection and next select elements of set "unselectedElements" + myViewNet->getUndoList()->p_begin("invert selection"); + // invert selection of elements depending of current supermode + if (myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + // iterate over junctions + for (const auto& junction : myViewNet->getNet()->getAttributeCarriers()->getJunctions()) { + // check if junction selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION)) { + if (junction.second->isAttributeCarrierSelected()) { + junction.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + // due we iterate over all junctions, only it's neccesary iterate over incoming edges + for (const auto& edge : junction.second->getGNEIncomingEdges()) { + // check if edge selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGE)) { + if (edge->isAttributeCarrierSelected()) { + edge->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + // check if lane selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_LANE)) { + for (const auto& lane : edge->getLanes()) { + if (lane->isAttributeCarrierSelected()) { + lane->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // check if connection selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_CONNECTION)) { + for (const auto& connection : edge->getGNEConnections()) { + if (connection->isAttributeCarrierSelected()) { + connection->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } + // check if crossing selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_CROSSING)) { + for (const auto& crossing : junction.second->getGNECrossings()) { + if (crossing->isAttributeCarrierSelected()) { + crossing->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } + // check if additionals selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ADDITIONALELEMENT)) { + for (const auto& additionals : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) { + // first check if additional is selectable + if (GNEAttributeCarrier::getTagProperties(additionals.first).isSelectable()) { + for (const auto& additional : additionals.second) { + if (additional.second->isAttributeCarrierSelected()) { + additional.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } + } + // select polygons + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POLYGON)) { + for (const auto& polygon : myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY)) { + if (polygon.second->isAttributeCarrierSelected()) { + polygon.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select POIs and POILanes + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POI)) { + for (const auto& POI : myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POI)) { + if (POI.second->isAttributeCarrierSelected()) { + POI.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& POILane : myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POILANE)) { + if (POILane.second->isAttributeCarrierSelected()) { + POILane.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } else if (myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // select routes + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTE)) { + for (const auto& route : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE)) { + if (route.second->isAttributeCarrierSelected()) { + route.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select embedded route + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EMBEDDEDROUTE)) { + for (const auto& embeddedRoute : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_EMBEDDEDROUTE)) { + if (embeddedRoute.second->isAttributeCarrierSelected()) { + embeddedRoute.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select vehicles + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_VEHICLE)) { + for (const auto& vehicle : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) { + if (vehicle.second->isAttributeCarrierSelected()) { + vehicle.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select trips + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_TRIP)) { + for (const auto& trip : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) { + if (trip.second->isAttributeCarrierSelected()) { + trip.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_FLOW)) { + for (const auto& flow : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) { + if (flow.second->isAttributeCarrierSelected()) { + flow.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select route flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTEFLOW)) { + for (const auto& routeFlow : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW)) { + if (routeFlow.second->isAttributeCarrierSelected()) { + routeFlow.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select stops + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_STOP)) { + for (const auto& stopLane : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_LANE)) { + if (stopLane.second->isAttributeCarrierSelected()) { + stopLane.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& stopBusStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_BUSSTOP)) { + if (stopBusStop.second->isAttributeCarrierSelected()) { + stopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& stopContainerStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CONTAINERSTOP)) { + if (stopContainerStop.second->isAttributeCarrierSelected()) { + stopContainerStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& stopChargingStation : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CHARGINGSTATION)) { + if (stopChargingStation.second->isAttributeCarrierSelected()) { + stopChargingStation.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& stopParkingArea : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_PARKINGAREA)) { + if (stopParkingArea.second->isAttributeCarrierSelected()) { + stopParkingArea.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select person + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSON)) { + for (const auto& person : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON)) { + if (person.second->isAttributeCarrierSelected()) { + person.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select person flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONFLOW)) { + for (const auto& personFlow : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW)) { + if (personFlow.second->isAttributeCarrierSelected()) { + personFlow.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select person trips + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONTRIP)) { + for (const auto& personTripFromTo : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_FROMTO)) { + if (personTripFromTo.second->isAttributeCarrierSelected()) { + personTripFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& personTripBusStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_BUSSTOP)) { + if (personTripBusStop.second->isAttributeCarrierSelected()) { + personTripBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select ride + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_RIDE)) { + for (const auto& rideFromTo : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_FROMTO)) { + if (rideFromTo.second->isAttributeCarrierSelected()) { + rideFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& rideBusStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_BUSSTOP)) { + if (rideBusStop.second->isAttributeCarrierSelected()) { + rideBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select walks + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_WALK)) { + for (const auto& walkFromTo : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_FROMTO)) { + if (walkFromTo.second->isAttributeCarrierSelected()) { + walkFromTo.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& walkBusStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_BUSSTOP)) { + if (walkBusStop.second->isAttributeCarrierSelected()) { + walkBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& walkRoute : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_ROUTE)) { + if (walkRoute.second->isAttributeCarrierSelected()) { + walkRoute.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + // select person stops + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONSTOP)) { + for (const auto& personStopLane : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_LANE)) { + if (personStopLane.second->isAttributeCarrierSelected()) { + personStopLane.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& personStopBusStop : myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_BUSSTOP)) { + if (personStopBusStop.second->isAttributeCarrierSelected()) { + personStopBusStop.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } else if (myViewNet->getEditModes().isCurrentSupermodeData()) { + for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + if ((!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGEDATA) && (genericData->getType() == GLO_EDGEDATA)) || + (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGERELDATA) && (genericData->getType() == GLO_EDGERELDATA))) { + if (genericData->isAttributeCarrierSelected()) { + genericData->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + } + } + } + } + // finish selection operation + myViewNet->getUndoList()->p_end(); + } +} + + +void +GNESelectorFrame::handleIDs(const std::vector& ACs, const ModificationMode::Operation setop) { + // declare set operation + const ModificationMode::Operation setOperation = ((setop == ModificationMode::Operation::DEFAULT) ? myModificationMode->getModificationMode() : setop); + // declare two sets of attribute carriers, one for select and another for unselect + std::set > ACsToSelect, ACsToUnselect; + // in restrict AND replace mode all current selected attribute carriers will be unselected + if ((setOperation == ModificationMode::Operation::REPLACE) || (setOperation == ModificationMode::Operation::RESTRICT)) { + // obtain selected ACs depending of current supermode + std::vector selectedACs = myViewNet->getNet()->getSelectedAttributeCarriers(false); + // add id into ACs to unselect + for (const auto& selectedAC : selectedACs) { + ACsToUnselect.insert(std::make_pair(selectedAC->getID(), selectedAC)); + } + } + // handle ids + for (const auto& AC : ACs) { + // iterate over AtributeCarriers an place it in ACsToSelect or ACsToUnselect + switch (setOperation) { + case GNESelectorFrame::ModificationMode::Operation::SUB: + ACsToUnselect.insert(std::make_pair(AC->getID(), AC)); + break; + case GNESelectorFrame::ModificationMode::Operation::RESTRICT: + if (ACsToUnselect.find(std::make_pair(AC->getID(), AC)) != ACsToUnselect.end()) { + ACsToSelect.insert(std::make_pair(AC->getID(), AC)); + } + break; + default: + ACsToSelect.insert(std::make_pair(AC->getID(), AC)); + break; + } + } + // select junctions and their connections if Auto select junctions is enabled (note: only for "add mode") + if (myViewNet->autoSelectNodes() && (setop == ModificationMode::Operation::ADD)) { + std::vector edgesToSelect; + // iterate over ACsToSelect and extract edges + for (const auto& AC : ACsToSelect) { + if (AC.second->getTagProperty().getTag() == SUMO_TAG_EDGE) { + edgesToSelect.push_back(myViewNet->getNet()->retrieveEdge(AC.second->getID())); + } + } + // iterate over extracted edges + for (const auto& edgeToSelect : edgesToSelect) { + // select junction source and all connections and crossings + ACsToSelect.insert(std::make_pair(edgeToSelect->getGNEJunctionSource()->getID(), edgeToSelect->getGNEJunctionSource())); + for (const auto& connectionToSelect : edgeToSelect->getGNEJunctionSource()->getGNEConnections()) { + ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect)); + } + for (const auto& crossingToSelect : edgeToSelect->getGNEJunctionSource()->getGNECrossings()) { + ACsToSelect.insert(std::make_pair(crossingToSelect->getID(), crossingToSelect)); + } + // select junction destiny and all connections and crossings + ACsToSelect.insert(std::make_pair(edgeToSelect->getGNEJunctionDestiny()->getID(), edgeToSelect->getGNEJunctionDestiny())); + for (const auto& connectionToSelect : edgeToSelect->getGNEJunctionDestiny()->getGNEConnections()) { + ACsToSelect.insert(std::make_pair(connectionToSelect->getID(), connectionToSelect)); + } + for (const auto& crossingToSelect : edgeToSelect->getGNEJunctionDestiny()->getGNECrossings()) { + ACsToSelect.insert(std::make_pair(crossingToSelect->getID(), crossingToSelect)); + } + } + } + // only continue if there is ACs to select or unselect + if ((ACsToSelect.size() + ACsToUnselect.size()) > 0) { + // first unselect AC of ACsToUnselect and then selects AC of ACsToSelect + myViewNet->getUndoList()->p_begin("selection"); + for (const auto& ACToUnselect : ACsToUnselect) { + if (ACToUnselect.second->getTagProperty().isSelectable()) { + ACToUnselect.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); + } + } + for (const auto& ACToSelect : ACsToSelect) { + if (ACToSelect.second->getTagProperty().isSelectable()) { + ACToSelect.second->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); + } + } + // finish operation + myViewNet->getUndoList()->p_end(); + } +} + + +GNESelectorFrame::ModificationMode* +GNESelectorFrame::getModificationModeModul() const { + return myModificationMode; +} + + +GNESelectorFrame::LockGLObjectTypes* +GNESelectorFrame::getLockGLObjectTypes() const { + return myLockGLObjectTypes; +} + + +bool +GNESelectorFrame::ACsToSelected() const { + if (myViewNet->getEditModes().isCurrentSupermodeNetwork()) { + // check if exist junction and edges + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION) && (myViewNet->getNet()->getAttributeCarriers()->getJunctions().size() > 0)) { + return true; + } + if ((!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGE) || !myLockGLObjectTypes->IsObjectTypeLocked(GLO_LANE)) && (myViewNet->getNet()->getAttributeCarriers()->getEdges().size() > 0)) { + return true; + } + // check if additionals selection is locked + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ADDITIONALELEMENT)) { + for (const auto& additionalTag : myViewNet->getNet()->getAttributeCarriers()->getAdditionals()) { + // first check if additional is selectable + if (GNEAttributeCarrier::getTagProperties(additionalTag.first).isSelectable() && + (myViewNet->getNet()->getAttributeCarriers()->getAdditionals().at(additionalTag.first).size() > 0)) { + return true; + } + } + } + // check polygons + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POLYGON) && + (myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY).size() > 0)) { + return true; + } + // check POIs + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POI) && + ((myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POI).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POILANE).size() > 0))) { + return true; + } + } else if (myViewNet->getEditModes().isCurrentSupermodeDemand()) { + // check routes + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTE) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size() > 0)) { + return true; + } + // check embedded routes + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EMBEDDEDROUTE) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_EMBEDDEDROUTE).size() > 0)) { + return true; + } + // check vehicles + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_VEHICLE) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE).size() > 0)) { + return true; + } + // check trips + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_TRIP) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP).size() > 0)) { + return true; + } + // check flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_FLOW) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW).size() > 0)) { + return true; + } + // check route flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTEFLOW) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW).size() > 0)) { + return true; + } + // check stops + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_STOP)) { + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_LANE).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_BUSSTOP).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CONTAINERSTOP).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CHARGINGSTATION).size() > 0)) { + return true; + } + } + // check person + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSON) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON).size() > 0)) { + return true; + } + // check person flows + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONFLOW) && (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW).size() > 0)) { + return true; + } + // check persontrips + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONTRIP)) { + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0)) { + return true; + } + } + // check ride + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_RIDE)) { + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_FROMTO).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_RIDE_BUSSTOP).size() > 0)) { + return true; + } + } + // check walks + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_WALK)) { + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_FROMTO).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_BUSSTOP).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_WALK_ROUTE).size() > 0)) { + return true; + } + } + // check person stops + if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONSTOP)) { + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_LANE).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONSTOP_BUSSTOP).size() > 0)) { + return true; + } + } + } else if (myViewNet->getEditModes().isCurrentSupermodeData()) { + for (const auto& dataSet : myViewNet->getNet()->getAttributeCarriers()->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + if ((!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGEDATA) && (genericData->getType() == GLO_EDGEDATA)) || + (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGERELDATA) && (genericData->getType() == GLO_EDGERELDATA))) { + return true; + } + } + } + } + } + // nothing to select + return false; +} + + +std::vector +GNESelectorFrame::getMatches(const SumoXMLTag ACTag, const SumoXMLAttr ACAttr, const char compOp, const double val, const std::string& expr) { + std::vector result; + // first retrieve all ACs using ACTag + std::vector allACbyTag = myViewNet->getNet()->retrieveAttributeCarriers(ACTag); + // get Tag value + const auto& tagValue = GNEAttributeCarrier::getTagProperties(ACTag); + // iterate over all ACs + for (const auto& AC : allACbyTag) { + if (expr == "") { + result.push_back(AC); + } else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttributeProperties(ACAttr).isNumerical()) { + double acVal; + std::istringstream buf(AC->getAttribute(ACAttr)); + buf >> acVal; + switch (compOp) { + case '<': + if (acVal < val) { + result.push_back(AC); + } + break; + case '>': + if (acVal > val) { + result.push_back(AC); + } + break; + case '=': + if (acVal == val) { + result.push_back(AC); + } + break; + } + } else { + // string match + std::string acVal = AC->getAttributeForSelection(ACAttr); + switch (compOp) { + case '@': + if (acVal.find(expr) != std::string::npos) { + result.push_back(AC); + } + break; + case '!': + if (acVal.find(expr) == std::string::npos) { + result.push_back(AC); + } + break; + case '=': + if (acVal == expr) { + result.push_back(AC); + } + break; + case '^': + if (acVal != expr) { + result.push_back(AC); + } + break; + } + } + } + return result; +} + + +std::vector +GNESelectorFrame::getGenericMatches(const std::vector& genericDatas, const std::string& attr, const char compOp, const double val, const std::string& expr) { + std::vector result; + // iterate over generic datas + for (const auto& genericData : genericDatas) { + if (expr == "") { + result.push_back(genericData); + } else if (attr != toString(GNE_ATTR_PARENT)) { + double acVal; + std::istringstream buf(genericData->getParameter(attr, "0")); + buf >> acVal; + switch (compOp) { + case '<': + if (acVal < val) { + result.push_back(genericData); + } + break; + case '>': + if (acVal > val) { + result.push_back(genericData); + } + break; + case '=': + if (acVal == val) { + result.push_back(genericData); + } + break; + } + } else { + // string match + std::string acVal = genericData->getAttributeForSelection(GNE_ATTR_PARENT); + switch (compOp) { + case '@': + if (acVal.find(expr) != std::string::npos) { + result.push_back(genericData); + } + break; + case '!': + if (acVal.find(expr) == std::string::npos) { + result.push_back(genericData); + } + break; + case '=': + if (acVal == expr) { + result.push_back(genericData); + } + break; + case '^': + if (acVal != expr) { + result.push_back(genericData); + } + break; + } + } + } + return result; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/common/GNESelectorFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,553 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNESelectorFrame.h +/// @author Jakob Erdmann +/// @date Mar 2011 +/// +// The Widget for modifying selections of network-elements +// (some elements adapted from GUIDialog_GLChosenEditor) +/****************************************************************************/ +#pragma once + +#include +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNESelectorFrame + * The Widget for modifying selections of network-elements + */ +class GNESelectorFrame : public GNEFrame { + +public: + + // =========================================================================== + // class LockGLObjectTypes + // =========================================================================== + + class LockGLObjectTypes : protected FXGroupBox { + + public: + /// @brief class for object types entries + class ObjectTypeEntry : protected FXObject { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) + + public: + /// @brief constructor + ObjectTypeEntry(FXMatrix* matrixParent, const Supermode supermode, const std::string& label); + + /// @brief get supermode associated to this ObjectTypeEntry + Supermode getSupermode() const; + + /// @brief show ObjectTypeEntry + void showObjectTypeEntry(); + + /// @brief hide ObjectTypeEntry + void hideObjectTypeEntry(); + + /// @brief up count + void counterUp(); + + /// @brief down count + void counterDown(); + + /// @brief check if current GLType is blocked + bool isGLTypeLocked() const; + + /// @name FOX-callbacks + /// @{ + + /// @brief called when user change the CheckBox + long onCmdSetCheckBox(FXObject*, FXSelector, void*); + + /// @} + + protected: + ObjectTypeEntry(); + + private: + /// @brief supermode associated to this ObjectTypeEntry + const Supermode mySupermode; + + /// @brief label counter + FXLabel* myLabelCounter; + + /// @brief label type nane + FXLabel* myLabelTypeName; + + /// @brief check box to check if GLObject type is blocked + FXCheckButton* myCheckBoxLocked; + + /// @brief counter + int myCounter; + + private: + /// @brief Invalidated assignment operator. + ObjectTypeEntry& operator=(const ObjectTypeEntry&) = delete; + + }; + + /// @brief constructor + LockGLObjectTypes(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~LockGLObjectTypes(); + + /// @brief set object selected + void addedLockedObject(const GUIGlObjectType type); + + /// @brief set object unselected + void removeLockedObject(const GUIGlObjectType type); + + /// @brief check if an object is locked + bool IsObjectTypeLocked(const GUIGlObjectType type) const; + + /// @brief show type Entries (depending if we're in Network or demand supermode) + void showTypeEntries(); + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief check boxes for type-based selection locking and selected object counts + std::map myTypeEntries; + }; + + // =========================================================================== + // class ModificationMode + // =========================================================================== + + class ModificationMode : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::ModificationMode) + + public: + /// @brief operations of selector + enum class Operation { + ADD, + SUB, + RESTRICT, + REPLACE, + DEFAULT + }; + + /// @brief constructor + ModificationMode(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~ModificationMode(); + + /// @brief get current modification mode + Operation getModificationMode() const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user change type of selction operation + long onCmdSelectModificationMode(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(ModificationMode) + + private: + /// @brief add radio button + FXRadioButton* myAddRadioButton; + + /// @brief remove radio button + FXRadioButton* myRemoveRadioButton; + + /// @brief keep button + FXRadioButton* myKeepRadioButton; + + /// @brief replace radio button + FXRadioButton* myReplaceRadioButton; + + /// @brief how to modify selection + Operation myModificationModeType; + }; + + // =========================================================================== + // class ElementSet + // =========================================================================== + + class ElementSet : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::ElementSet) + + public: + /// @brief Element Set Type + enum class Type { + NETWORKELEMENT, + ADDITIONALELEMENT, + SHAPE, + DEMANDELEMENT, + DATA, + INVALID, + }; + + /// @brief constructor + ElementSet(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~ElementSet(); + + /// @brief get current selected element set + Type getElementSet() const; + + /// @brief refresh element set + void refreshElementSet(); + + /// @brief update current element set (called after + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user change the set of element to search (networkElement, Additional or shape) + long onCmdSelectElementSet(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(ElementSet) + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief Combo Box with the element sets + FXComboBox* mySetComboBox; + + /// @brief current element set selected + Type myCurrentElementSet; + }; + + // =========================================================================== + // class MatchAttribute + // =========================================================================== + + class MatchAttribute : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::MatchAttribute) + + public: + /// @brief constructor + MatchAttribute(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~MatchAttribute(); + + /// @brief enable match attributes + void enableMatchAttribute(); + + /// @brief disable match attributes + void disableMatchAttribute(); + + /// @brief show match attributes + void showMatchAttribute(); + + /// @brief hide match attributes + void hideMatchAttribute(); + + /// @name FOX-callbacks + /// @{ + + /**@brief Called when the user selectes a tag in the match box + * @note updates the attr listbox and repaints itself + */ + long onCmdSelMBTag(FXObject*, FXSelector, void*); + + /**@brief Called when the user selectes a tag in the match box + * @note updates the attr listbox and repaints itself + */ + long onCmdSelMBAttribute(FXObject*, FXSelector, void*); + + /**@brief Called when the user enters a new selection expression + * @note validates expression and modifies current selection + */ + long onCmdSelMBString(FXObject*, FXSelector, void*); + + /**@brief Called when the user clicks the help button + * @note pop up help window + */ + long onCmdHelp(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(MatchAttribute) + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief tag of the match box + FXComboBox* myMatchTagComboBox; + + /// @brief attributes of the match box + FXComboBox* myMatchAttrComboBox; + + /// @brief current SumoXMLTag tag + SumoXMLTag myCurrentTag; + + /// @brief current SumoXMLTag Attribute + SumoXMLAttr myCurrentAttribute; + + /// @brief string of the match + FXTextField* myMatchString; + }; + + // =========================================================================== + // class MatchGenericDataAttribute + // =========================================================================== + + class MatchGenericDataAttribute : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::MatchGenericDataAttribute) + + public: + /// @brief constructor + MatchGenericDataAttribute(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~MatchGenericDataAttribute(); + + /// @brief enable match attributes + void enableMatchGenericDataAttribute(); + + /// @brief disable match attributes + void disableMatchGenericDataAttribute(); + + /// @brief show match attributes + void showMatchGenericDataAttribute(); + + /// @brief hide match attributes + void hideMatchGenericDataAttribute(); + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user selects an interval + long onCmdSetInterval(FXObject*, FXSelector, void*); + + /// @brief Called when the user change begin text field + long onCmdSetBegin(FXObject*, FXSelector, void*); + + /// @brief Called when the user change end text field + long onCmdSetEnd(FXObject*, FXSelector, void*); + + /// @brief Called when the user selects a tag in the match box + long onCmdSelectTag(FXObject*, FXSelector, void*); + + /// @brief Called when the user selects an attribute in the match box + long onCmdSelectAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when the user enters a new selection expression + long onCmdProcessString(FXObject*, FXSelector, void*); + + /// @brief Called when the user clicks the help button + long onCmdHelp(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(MatchGenericDataAttribute) + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief tag of the match box + FXComboBox* myIntervalSelector; + + /// @brief TextField for begin + FXTextField* myBegin; + + /// @brief TextField for end + FXTextField* myEnd; + + /// @brief tag of the match box + FXComboBox* myMatchGenericDataTagComboBox; + + /// @brief attributes of the match box + FXComboBox* myMatchGenericDataAttrComboBox; + + /// @brief current SumoXMLTag tag + SumoXMLTag myCurrentTag; + + /// @brief current string Attribute + std::string myCurrentAttribute; + + /// @brief string of the match + FXTextField* myMatchGenericDataString; + + // declare a set and fill it with all intervals + std::map, int> myIntervals; + }; + + // =========================================================================== + // class VisualScaling + // =========================================================================== + + class VisualScaling : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::VisualScaling) + + public: + /// @brief constructor + VisualScaling(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~VisualScaling(); + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user changes visual scaling + long onCmdScaleSelection(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(VisualScaling) + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + + /// @brief Spinner for selection scaling + FXRealSpinner* mySelectionScaling; + }; + + // =========================================================================== + // class SelectionOperation + // =========================================================================== + + class SelectionOperation : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNESelectorFrame::SelectionOperation) + + public: + /// @brief constructor + SelectionOperation(GNESelectorFrame* selectorFrameParent); + + /// @brief destructor + ~SelectionOperation(); + + /// @name FOX-callbacks + /// @{ + + /**@brief Called when the user presses the Load-button + * @note Opens a file dialog and forces the parent to load the list of selected + * objects when a file was chosen. Rebuilds the list, then, and redraws itself. + */ + long onCmdLoad(FXObject*, FXSelector, void*); + + /** @brief Called when the user presses the Save-button + * @note Opens a file dialog and forces the selection container to save the list + of selected objects when a file was chosen. If the saveing failed, a message window is shown. + */ + long onCmdSave(FXObject*, FXSelector, void*); + + /**@brief Called when the user presses the Clear-button + * @note Clear the internal list and calls GUISelectedStorage::clear and repaints itself + */ + long onCmdClear(FXObject*, FXSelector, void*); + + /**@brief Called when the user presses the Invert-button + * @note invert the selection and repaints itself + */ + long onCmdInvert(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(SelectionOperation) + + private: + /// @brief pointer to Selector Frame Parent + GNESelectorFrame* mySelectorFrameParent; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNESelectorFrame(); + + /// @brief show Frame + void show(); + + /// @brief hide Frame + void hide(); + + /// @brief clear current selection with possibility of undo/redo + void clearCurrentSelection() const; + + /**@brief apply list of ids to the current selection according to Operation, + * @note if setop==DEFAULT than the currently set mode (myOperation) is used + */ + void handleIDs(const std::vector& ACs, const ModificationMode::Operation setop = ModificationMode::Operation::DEFAULT); + + /// @brief get selected items Modul + LockGLObjectTypes* getLockGLObjectTypes() const; + + /// @brief get modification mode modul + ModificationMode* getModificationModeModul() const; + +private: + /// @brief modul for lock selected items + LockGLObjectTypes* myLockGLObjectTypes; + + /// @brief modul for change modification mode + ModificationMode* myModificationMode; + + /// @brief modul for select element set + ElementSet* myElementSet; + + /// @brief modul for match attribute + MatchAttribute* myMatchAttribute; + + /// @brief modul for match generic data attribute + MatchGenericDataAttribute* myMatchGenericDataAttribute; + + /// @brief modul for visual scaling + VisualScaling* myVisualScaling; + + /// @brief modul for selection operations + SelectionOperation* mySelectionOperation; + + /// @brief check if there is ACs to select/unselect + bool ACsToSelected() const; + + /**@brief return ACs of the given type with matching attrs + * @param[in] ACTag XML Tag of AttributeCarrier + * @param[in] ACAttr XML Attribute of AttributeCarrier + * @param[in] compOp One of {<,>,=} for matching against val or '@' for matching against expr + */ + std::vector getMatches(const SumoXMLTag ACTag, const SumoXMLAttr ACAttr, const char compOp, const double val, const std::string& expr); + + /**@brief return GenericDatas of the given type with matching attrs + * @param[in] genericDatas list of filter generic datas + * @param[in] attr XML Attribute used to filter + * @param[in] compOp One of {<,>,=} for matching against val or '@' for matching against expr + */ + std::vector getGenericMatches(const std::vector& genericDatas, const std::string& attr, const char compOp, const double val, const std::string& expr); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/frames/data/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/frames/data/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,11 @@ +set(netedit_frames_data_SRCS + GNEGenericDataFrame.h + GNEGenericDataFrame.cpp + GNEEdgeDataFrame.h + GNEEdgeDataFrame.cpp + GNEEdgeRelDataFrame.h + GNEEdgeRelDataFrame.cpp + ) + +add_library(netedit_frames_data STATIC ${netedit_frames_data_SRCS}) +set_property(TARGET netedit_frames_data PROPERTY PROJECT_LABEL "z_netedit_frames_data") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,67 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeDataFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// The Widget for add edgeData elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include + +#include "GNEEdgeDataFrame.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEEdgeDataFrame::GNEEdgeDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEGenericDataFrame(horizontalFrameParent, viewNet, SUMO_TAG_MEANDATA_EDGE) { +} + + +GNEEdgeDataFrame::~GNEEdgeDataFrame() {} + + +bool +GNEEdgeDataFrame::addEdgeData(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if we clicked over an edge + if (objectsUnderCursor.getEdgeFront() && myDataSetSelector->getDataSet() && myIntervalSelector->getDataInterval()) { + // first check if the given interval there is already a EdgeData for the given ID + for (const auto& genericData : myIntervalSelector->getDataInterval()->getGenericDataChildren()) { + if ((genericData->getTagProperty().getTag() == SUMO_TAG_MEANDATA_EDGE) && (genericData->getParentEdges().front() == objectsUnderCursor.getEdgeFront())) { + // write warning + WRITE_WARNING("There is already a " + genericData->getTagStr() + " in edge '" + objectsUnderCursor.getEdgeFront()->getID() + "'"); + // abort edge data creation + return false; + } + } + // finally create edgeData + GNEDataHandler::buildEdgeData(myViewNet->getNet(), true, myIntervalSelector->getDataInterval(), objectsUnderCursor.getEdgeFront(), myParametersEditor->getParametersMap()); + // edgeData created, then return true + return true; + } else { + // invalid parent parameters + return false; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeDataFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,59 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeDataFrame.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// The Widget for add edgeData elements +/****************************************************************************/ +#pragma once +#include + +#include "GNEGenericDataFrame.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEEdgeDataFrame + * The Widget for setting internal attributes of additional elements + */ +class GNEEdgeDataFrame : public GNEGenericDataFrame { + +public: + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEEdgeDataFrame + */ + GNEEdgeDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEEdgeDataFrame(); + + /**@brief add additional element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if additional was sucesfully added + */ + bool addEdgeData(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + +private: + /// @brief Invalidated copy constructor. + GNEEdgeDataFrame(const GNEEdgeDataFrame&) = delete; + + /// @brief Invalidated assignment operator. + GNEEdgeDataFrame& operator=(const GNEEdgeDataFrame&) = delete; +}; + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,62 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeRelDataFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// The Widget for add EdgeRelationData elements +/****************************************************************************/ +#include + +#include +#include + +#include "GNEEdgeRelDataFrame.h" + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEEdgeRelDataFrame::GNEEdgeRelDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEGenericDataFrame(horizontalFrameParent, viewNet, SUMO_TAG_EDGEREL) { +} + + +GNEEdgeRelDataFrame::~GNEEdgeRelDataFrame() {} + + +bool +GNEEdgeRelDataFrame::addEdgeRelationData(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if we clicked over an edge + if (objectsUnderCursor.getEdgeFront() && myDataSetSelector->getDataSet() && myIntervalSelector->getDataInterval()) { + return myEdgePathCreator->addPathEdge(objectsUnderCursor.getEdgeFront()); + } else { + // invalid parent parameters + return false; + } +} + + +void +GNEEdgeRelDataFrame::edgePathCreated() { + // first check that we have at least two edges + if (myEdgePathCreator->getClickedEdges().size() > 1) { + // just create EdgeRelationData + GNEDataHandler::buildEdgeRelationData(myViewNet->getNet(), true, myIntervalSelector->getDataInterval(), myEdgePathCreator->getClickedEdges().front(), + myEdgePathCreator->getClickedEdges().back(), myParametersEditor->getParametersMap()); + } +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEEdgeRelDataFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,63 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEEdgeRelDataFrame.h +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// The Widget for add EdgeRelationData elements +/****************************************************************************/ +#pragma once +#include + +#include "GNEGenericDataFrame.h" + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEEdgeRelDataFrame + * The Widget for setting internal attributes of additional elements + */ +class GNEEdgeRelDataFrame : public GNEGenericDataFrame { + +public: + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEEdgeRelDataFrame + */ + GNEEdgeRelDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEEdgeRelDataFrame(); + + /**@brief add additional element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if additional was sucesfully added + */ + bool addEdgeRelationData(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + +protected: + /// @brief finish edge path creation + void edgePathCreated(); + +private: + /// @brief Invalidated copy constructor. + GNEEdgeRelDataFrame(const GNEEdgeRelDataFrame&) = delete; + + /// @brief Invalidated assignment operator. + GNEEdgeRelDataFrame& operator=(const GNEEdgeRelDataFrame&) = delete; +}; + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,582 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEGenericDataFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// The Widget for add genericData elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEGenericDataFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEGenericDataFrame::DataSetSelector) DataSetSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEGenericDataFrame::DataSetSelector::onCmdCreateDataSet), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATASET_NEW, GNEGenericDataFrame::DataSetSelector::onCmdSetNewDataSetID), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATASET_SELECTED, GNEGenericDataFrame::DataSetSelector::onCmdSelectDataSet), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNEGenericDataFrame::DataSetSelector::onCmdSelectCheckButton) + +}; + +FXDEFMAP(GNEGenericDataFrame::IntervalSelector) IntervalSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEGenericDataFrame::IntervalSelector::onCmdCreateInterval), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATAINTERVAL_SELECTED, GNEGenericDataFrame::IntervalSelector::onCmdSelectInterval), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEGenericDataFrame::IntervalSelector::onCmdSetIntervalAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNEGenericDataFrame::IntervalSelector::onCmdSelectCheckButton) +}; + +FXDEFMAP(GNEGenericDataFrame::AttributeSelector) AttributeSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNEGenericDataFrame::AttributeSelector::onCmdSelectAttribute) +}; + +// Object implementation +FXIMPLEMENT(GNEGenericDataFrame::DataSetSelector, FXGroupBox, DataSetSelectorMap, ARRAYNUMBER(DataSetSelectorMap)) +FXIMPLEMENT(GNEGenericDataFrame::IntervalSelector, FXGroupBox, IntervalSelectorMap, ARRAYNUMBER(IntervalSelectorMap)) +FXIMPLEMENT(GNEGenericDataFrame::AttributeSelector, FXGroupBox, AttributeSelectorMap, ARRAYNUMBER(AttributeSelectorMap)) + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEGenericDataFrame::DataSetSelector - methods +// --------------------------------------------------------------------------- + +GNEGenericDataFrame::DataSetSelector::DataSetSelector(GNEGenericDataFrame* genericDataFrameParent) : + FXGroupBox(genericDataFrameParent->myContentFrame, "DataSet", GUIDesignGroupBoxFrame), + myGenericDataFrameParent(genericDataFrameParent) { + // create check button for new data set + myNewDataSetCheckButton = new FXCheckButton(this, "Create new dataSet", this, MID_GNE_SELECT, GUIDesignCheckButton); + // Create FXComboBox + myDataSetsComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_DATASET_SELECTED, GUIDesignComboBox); + // create new id label + myHorizontalFrameNewID = new FXHorizontalFrame(this, 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->hide(); + // refresh interval selector + refreshDataSetSelector(nullptr); + // DataSetSelector is always shown + show(); +} + + +GNEGenericDataFrame::DataSetSelector::~DataSetSelector() {} + + +void +GNEGenericDataFrame::DataSetSelector::refreshDataSetSelector(const GNEDataSet* currentDataSet) { + // clear items + myDataSetsComboBox->clearItems(); + // declare item index + int currentItemIndex = -1; + // fill myDataSetsComboBox with all DataSets + auto dataSetCopy = myGenericDataFrameParent->getViewNet()->getNet()->retrieveDataSets(); + for (const auto& dataSet : dataSetCopy) { + // check if we have to set currentItemIndex + if ((currentItemIndex == -1) && (dataSet == currentDataSet)) { + currentItemIndex = myDataSetsComboBox->getNumItems(); + } + myDataSetsComboBox->appendItem(dataSet->getID().c_str()); + } + // Set visible items + myDataSetsComboBox->setNumVisible((int)myDataSetsComboBox->getNumItems()); + // check if we have to set current element + if (currentItemIndex != -1) { + myDataSetsComboBox->setCurrentItem(currentItemIndex, FALSE); + } + // recalc frame + recalc(); + // refresh interval selector + if (myGenericDataFrameParent->myIntervalSelector) { + myGenericDataFrameParent->myIntervalSelector->refreshIntervalSelector(); + } +} + + +GNEDataSet* +GNEGenericDataFrame::DataSetSelector::getDataSet() const { + if ((myNewDataSetCheckButton->getCheck() == TRUE) || (myDataSetsComboBox->getNumItems() == 0)) { + return nullptr; + } else { + return myGenericDataFrameParent->getViewNet()->getNet()->retrieveDataSet(myDataSetsComboBox->getItem(myDataSetsComboBox->getCurrentItem()).text(), false); + } +} + + +long +GNEGenericDataFrame::DataSetSelector::onCmdCreateDataSet(FXObject*, FXSelector, void*) { + // get string + const std::string dataSetID = myNewDataSetIDTextField->getText().text(); + // check conditions + if (myNewDataSetIDTextField->getTextColor() == FXRGB(255, 0, 0)) { + WRITE_WARNING("Invalid dataSet ID"); + } else if (dataSetID.empty()) { + WRITE_WARNING("Invalid empty dataSet ID"); + } else if (myGenericDataFrameParent->getViewNet()->getNet()->retrieveDataSet(dataSetID, false) != nullptr) { + WRITE_WARNING("Invalid duplicated dataSet ID"); + } else { + // build data set + const GNEDataSet* dataSet = GNEDataHandler::buildDataSet(myGenericDataFrameParent->getViewNet()->getNet(), true, dataSetID); + // refresh tag selector + refreshDataSetSelector(dataSet); + // change check button + myNewDataSetCheckButton->setCheck(FALSE, TRUE); + } + return 1; +} + + +long +GNEGenericDataFrame::DataSetSelector::onCmdSetNewDataSetID(FXObject*, FXSelector, void*) { + // + return 1; +} + + +long +GNEGenericDataFrame::DataSetSelector::onCmdSelectDataSet(FXObject*, FXSelector, void*) { + // update interval modul + myGenericDataFrameParent->myIntervalSelector->refreshIntervalSelector(); + return 1; +} + + +long +GNEGenericDataFrame::DataSetSelector::onCmdSelectCheckButton(FXObject*, FXSelector, void*) { + if (myNewDataSetCheckButton->getCheck() == TRUE) { + // enable textfield and label + myHorizontalFrameNewID->show(); + myCreateDataSetButton->show(); + // disable comboBox + myDataSetsComboBox->hide(); + } else { + // disable textfield and label + myHorizontalFrameNewID->hide(); + myCreateDataSetButton->hide(); + // enable comboBox + myDataSetsComboBox->show(); + } + // update interval modul + myGenericDataFrameParent->myIntervalSelector->refreshIntervalSelector(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEGenericDataFrame::IntervalSelector - methods +// --------------------------------------------------------------------------- + +GNEGenericDataFrame::IntervalSelector::IntervalSelector(GNEGenericDataFrame* genericDataFrameParent) : + FXGroupBox(genericDataFrameParent->myContentFrame, "Interval", GUIDesignGroupBoxFrame), + myGenericDataFrameParent(genericDataFrameParent) { + // create check button for new interval + myNewIntervalCheckButton = new FXCheckButton(this, "Create new interval", this, MID_GNE_SELECT, GUIDesignCheckButton); + // create begin label + myHorizontalFrameBegin = new FXHorizontalFrame(this, 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); + myBeginTextField->setText("0"); + // hide horizontal frame begin + myHorizontalFrameBegin->hide(); + // create end label + myHorizontalFrameEnd = new FXHorizontalFrame(this, 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); + myEndTextField->setText("3600"); + // 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->hide(); + // Create three list + myIntervalsTreelist = new FXTreeList(this, this, MID_GNE_DATAINTERVAL_SELECTED, GUIDesignTreeListFrame); + // refresh interval selector + refreshIntervalSelector(); + // IntervalSelector is always shown + show(); +} + + +GNEGenericDataFrame::IntervalSelector::~IntervalSelector() {} + + +void +GNEGenericDataFrame::IntervalSelector::refreshIntervalSelector() { + // first clear items from tree and intervalMap + myIntervalsTreelist->clearItems(); + myTreeItemIntervalMap.clear(); + // obtain data set + const GNEDataSet* dataSet = myGenericDataFrameParent->myDataSetSelector->getDataSet(); + // add intervals + if (dataSet) { + // insert dataSetItem in Tree list + FXTreeItem* dataSetItem = myIntervalsTreelist->insertItem( + nullptr, nullptr, + dataSet->getHierarchyName().c_str(), + dataSet->getIcon(), + dataSet->getIcon()); + // by default item is expanded + dataSetItem->setExpanded(true); + // iterate over intevals + for (const auto& interval : dataSet->getDataIntervalChildren()) { + addIntervalItem(interval.second, dataSetItem); + } + } + // refresh attribute selector + if (myGenericDataFrameParent->myAttributeSelector) { + myGenericDataFrameParent->myAttributeSelector->refreshAttributeSelector(); + } + // recalc frame + recalc(); +} + + +GNEDataInterval* +GNEGenericDataFrame::IntervalSelector::getDataInterval() const { + // first check if there is elements in interval tree + if (myIntervalsTreelist->getNumItems() > 0) { + for (const auto& treeItem : myTreeItemIntervalMap) { + if (treeItem.first->isSelected()) { + return treeItem.second; + } + } + } + // no GNEDataInterval found, then return nullptr + return nullptr; +} + + +long +GNEGenericDataFrame::IntervalSelector::onCmdCreateInterval(FXObject*, FXSelector, void*) { + // first check that begin and end are valid + if (GNEAttributeCarrier::canParse(myBeginTextField->getText().text()) && + GNEAttributeCarrier::canParse(myEndTextField->getText().text())) { + // obtain begin and end + const double begin = GNEAttributeCarrier::parse(myBeginTextField->getText().text()); + const double end = GNEAttributeCarrier::parse(myEndTextField->getText().text()); + // get data set parent + GNEDataSet* dataSet = myGenericDataFrameParent->myDataSetSelector->getDataSet(); + if (dataSet && dataSet->checkNewInterval(begin, end)) { + GNEDataHandler::buildDataInterval(myGenericDataFrameParent->getViewNet()->getNet(), true, dataSet, begin, end); + } + // disable select interval check button + myNewIntervalCheckButton->setCheck(FALSE, TRUE); + } + return 1; +} + + +long +GNEGenericDataFrame::IntervalSelector::onCmdSelectInterval(FXObject*, FXSelector, void*) { + // refresh attribute selector + myGenericDataFrameParent->myAttributeSelector->refreshAttributeSelector(); + return 1; +} + + +long +GNEGenericDataFrame::IntervalSelector::onCmdSetIntervalAttribute(FXObject* obj, FXSelector, void*) { + if (obj == myBeginTextField) { + // check if begin value can be parsed to double + if (GNEAttributeCarrier::canParse(myBeginTextField->getText().text())) { + myBeginTextField->setTextColor(FXRGB(0, 0, 0)); + myBeginTextField->killFocus(); + } else { + myBeginTextField->setTextColor(FXRGB(255, 0, 0)); + } + } else if (obj == myEndTextField) { + // check if end value can be parsed to double + if (GNEAttributeCarrier::canParse(myEndTextField->getText().text())) { + myEndTextField->setTextColor(FXRGB(0, 0, 0)); + myEndTextField->killFocus(); + } else { + myEndTextField->setTextColor(FXRGB(255, 0, 0)); + } + } + return 1; +} + + +long +GNEGenericDataFrame::IntervalSelector::onCmdSelectCheckButton(FXObject*, FXSelector, void*) { + if (myNewIntervalCheckButton->getCheck() == TRUE) { + // enable begin and end elements + myHorizontalFrameBegin->show(); + myHorizontalFrameEnd->show(); + myCreateIntervalButton->show(); + // refresh begin and end text fields + const GNEDataSet* dataSet = myGenericDataFrameParent->myDataSetSelector->getDataSet(); + if (dataSet) { + if (dataSet->getDataIntervalChildren().empty()) { + // set default interval (1 hour) + myBeginTextField->setText("0"); + myEndTextField->setText("3600"); + } else { + // obtain last data interval + const GNEDataInterval* lastDataInterval = dataSet->getDataIntervalChildren().rbegin()->second; + const double intervalDuration = lastDataInterval->getAttributeDouble(SUMO_ATTR_END) - lastDataInterval->getAttributeDouble(SUMO_ATTR_BEGIN); + // set new begin end + myBeginTextField->setText(toString(lastDataInterval->getAttributeDouble(SUMO_ATTR_END)).c_str()); + myEndTextField->setText(toString(lastDataInterval->getAttributeDouble(SUMO_ATTR_END) + intervalDuration).c_str()); + } + } + } else { + // disable begin and end elements + myHorizontalFrameBegin->hide(); + myHorizontalFrameEnd->hide(); + myCreateIntervalButton->hide(); + } + // refresh interval seletor + refreshIntervalSelector(); + return 1; +} + + +FXTreeItem* +GNEGenericDataFrame::IntervalSelector::addIntervalItem(GNEDataInterval* dataInterval, FXTreeItem* itemParent) { + // insert item in Tree list + FXTreeItem* item = myIntervalsTreelist->insertItem(nullptr, itemParent, + dataInterval->getHierarchyName().c_str(), + dataInterval->getIcon(), + dataInterval->getIcon()); + // insert item in map + myTreeItemIntervalMap[item] = dataInterval; + // by default item is expanded + item->setExpanded(true); + // select first item + if (myTreeItemIntervalMap.size() == 1) { + item->setSelected(TRUE); + } + // return created FXTreeItem + return item; +} + +// --------------------------------------------------------------------------- +// GNEGenericDataFrame::AttributeSelector - methods +// --------------------------------------------------------------------------- + +GNEGenericDataFrame::AttributeSelector::AttributeSelector(GNEGenericDataFrame* genericDataFrameParent, SumoXMLTag tag) : + FXGroupBox(genericDataFrameParent->myContentFrame, "Data attributes", GUIDesignGroupBoxFrame), + myGenericDataFrameParent(genericDataFrameParent), + myMinMaxLabel(nullptr), + myGenericDataTag(tag) { + // Create FXComboBox + myAttributesComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECT, GUIDesignComboBox); + // build rainbow + myMinMaxLabel = GNEFrameModuls::buildRainbow(this, myScaleColors); + // refresh interval selector + refreshAttributeSelector(); + // AttributeSelector is always shown + show(); +} + + +GNEGenericDataFrame::AttributeSelector::~AttributeSelector() {} + + +void +GNEGenericDataFrame::AttributeSelector::refreshAttributeSelector() { + // first clear items + myAttributesComboBox->clearItems(); + // restore myMinMaxLabel + myMinMaxLabel->setText("Scale: Min -> Max"); + // fill myAttributesComboBox depending of data sets + if (myGenericDataFrameParent->myDataSetSelector->getDataSet() == nullptr) { + myAttributesComboBox->appendItem(""); + myAttributesComboBox->disable(); + } else { + // add all item + myAttributesComboBox->appendItem(""); + // add attributes depending of interval + if (myGenericDataFrameParent->myIntervalSelector->getDataInterval() == nullptr) { + const auto parameters = myGenericDataFrameParent->getViewNet()->getNet()->retrieveGenericDataParameters( + myGenericDataFrameParent->myDataSetSelector->getDataSet()->getID(), toString(myGenericDataTag), "", ""); + // add all parameters + for (const auto& attribute : parameters) { + myAttributesComboBox->appendItem(attribute.c_str()); + } + } else { + // retrieve all parameters within begin and end + const auto parameters = myGenericDataFrameParent->getViewNet()->getNet()->retrieveGenericDataParameters( + myGenericDataFrameParent->myDataSetSelector->getDataSet()->getID(), toString(myGenericDataTag), + myGenericDataFrameParent->myIntervalSelector->getDataInterval()->getAttribute(SUMO_ATTR_BEGIN), + myGenericDataFrameParent->myIntervalSelector->getDataInterval()->getAttribute(SUMO_ATTR_END)); + // add all parameters + for (const auto& attribute : parameters) { + myAttributesComboBox->appendItem(attribute.c_str()); + } + } + // enable combo Box + myAttributesComboBox->enable(); + // adjust visible items + if (myAttributesComboBox->getNumItems() < 10) { + myAttributesComboBox->setNumVisible(myAttributesComboBox->getNumItems()); + } else { + myAttributesComboBox->setNumVisible(10); + } + } + // recalc frame + recalc(); + // update view net + myGenericDataFrameParent->getViewNet()->updateViewNet(); +} + + +std::string +GNEGenericDataFrame::AttributeSelector::getFilteredAttribute() const { + if (myAttributesComboBox->getNumItems() == 0) { + return ""; + } else if (myAttributesComboBox->getText() == "") { + return ""; + } else { + return myAttributesComboBox->getText().text(); + } +} + + +const RGBColor& +GNEGenericDataFrame::AttributeSelector::getScaledColor(const double min, const double max, const double value) const { + // update myMinMaxLabel + myMinMaxLabel->setText(("Min: " + toString(min) + " -> Max: " + toString(max)).c_str()); + // check extremes + if (value <= min) { + return myScaleColors.front(); + } else if (value >= max) { + return myScaleColors.back(); + } else { + // calculate value procent between [min, max] + const double procent = ((value - min) * 100) / (max - min); + // check if is valid + if (procent <= 0) { + return myScaleColors.front(); + } else if (procent >= 100) { + return myScaleColors.back(); + } else { + // return scaled color + return myScaleColors.at((int)(procent / 10.0)); + } + } +} + + +long +GNEGenericDataFrame::AttributeSelector::onCmdSelectAttribute(FXObject*, FXSelector, void*) { + // empty attribute means + if (myAttributesComboBox->getText().empty()) { + myAttributesComboBox->setText(""); + } + if (myAttributesComboBox->getText() == "") { + myMinMaxLabel->setText("Scale: Min -> Max"); + } + // update view + myGenericDataFrameParent->getViewNet()->updateViewNet(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEGenericDataFrame - methods +// --------------------------------------------------------------------------- + +const GNEGenericDataFrame::DataSetSelector* +GNEGenericDataFrame::getDataSetSelector() const { + return myDataSetSelector; +} + + +const GNEGenericDataFrame::IntervalSelector* +GNEGenericDataFrame::getIntervalSelector() const { + return myIntervalSelector; +} + + +const GNEGenericDataFrame::AttributeSelector* +GNEGenericDataFrame::getAttributeSelector() const { + return myAttributeSelector; +} + + +GNEFrameModuls::EdgePathCreator* +GNEGenericDataFrame::getEdgePathCreator() const { + return myEdgePathCreator; +} + + +void +GNEGenericDataFrame::show() { + // first refresh data set selector + myDataSetSelector->refreshDataSetSelector(nullptr); + // check if there is an edge path creator + if (myEdgePathCreator) { + myEdgePathCreator->showEdgePathCreator(); + } + // show frame + GNEFrame::show(); +} + + +GNEGenericDataFrame::GNEGenericDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, SumoXMLTag tag) : + GNEFrame(horizontalFrameParent, viewNet, toString(tag)), + myDataSetSelector(nullptr), + myIntervalSelector(nullptr), + myAttributeSelector(nullptr), + myParametersEditor(nullptr), + myEdgePathCreator(nullptr) { + // create DataSetSelector + myDataSetSelector = new DataSetSelector(this); + // create IntervalSelector modul + myIntervalSelector = new IntervalSelector(this); + // create AttributeSelector modul + myAttributeSelector = new AttributeSelector(this, tag); + // create parameter editor modul + myParametersEditor = new GNEFrameAttributesModuls::ParametersEditor(this, "Attributes"); + // create EdgePathCreator modul + myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); +} + + +GNEGenericDataFrame::~GNEGenericDataFrame() {} + + +void +GNEGenericDataFrame::intervalSelected() { + // +} + + +void +GNEGenericDataFrame::edgePathCreated() { + // this function has to be reimplemente in all child frames that uses a EdgePathCreator +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/data/GNEGenericDataFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,280 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEGenericDataFrame.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2020 +/// +// The Widget for add genericData elements +/****************************************************************************/ +#pragma once +#include + +#include + + +// =========================================================================== +// class declaration +// =========================================================================== +class GNEDataInterval; +class GNEDataSet; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEGenericDataFrame + * The Widget for setting internal attributes of additional elements + */ +class GNEGenericDataFrame : public GNEFrame { + +public: + // =========================================================================== + // class DataSetSelector + // =========================================================================== + + class DataSetSelector : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEGenericDataFrame::DataSetSelector) + + public: + /// @brief constructor + DataSetSelector(GNEGenericDataFrame* genericDataFrameParent); + + /// @brief destructor + ~DataSetSelector(); + + /// @brief refresh interval selector + void refreshDataSetSelector(const GNEDataSet* currentDataSet); + + /// @brief get current select data set ID + GNEDataSet* getDataSet() const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user press button "create dataSet" + long onCmdCreateDataSet(FXObject*, FXSelector, void*); + + /// @brief Called when the user set a new data set ID + long onCmdSetNewDataSetID(FXObject*, FXSelector, void*); + + /// @brief Called when the user select an existent data set + long onCmdSelectDataSet(FXObject* obj, FXSelector, void*); + + /// @brief Called when the user select check button + long onCmdSelectCheckButton(FXObject* obj, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(DataSetSelector) + + private: + /// @brief pointer to genericData frame Parent + GNEGenericDataFrame* myGenericDataFrameParent; + + /// @brief check button to create a new dataSet + FXCheckButton* myNewDataSetCheckButton; + + /// @brief horizontal frame new id + FXHorizontalFrame* myHorizontalFrameNewID; + + /// @brief interval new id + FXTextField* myNewDataSetIDTextField; + + /// @brief create dataSet button + FXButton* myCreateDataSetButton; + + /// @brief comboBox with intervals + FXComboBox* myDataSetsComboBox; + }; + + // =========================================================================== + // class IntervalSelector + // =========================================================================== + + class IntervalSelector : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEGenericDataFrame::IntervalSelector) + + public: + /// @brief constructor + IntervalSelector(GNEGenericDataFrame* genericDataFrameParent); + + /// @brief destructor + ~IntervalSelector(); + + /// @brief refresh interval selector + void refreshIntervalSelector(); + + /// @brief get current select data set ID + GNEDataInterval* getDataInterval() const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user press button "create interval" + long onCmdCreateInterval(FXObject*, FXSelector, void*); + + /// @brief Called when the user select an interval in the list + long onCmdSelectInterval(FXObject*, FXSelector, void*); + + /// @brief Called when the user changes begin or end + long onCmdSetIntervalAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when the user select check button + long onCmdSelectCheckButton(FXObject* obj, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(IntervalSelector) + + private: + /// @brief add interval item into list + FXTreeItem* addIntervalItem(GNEDataInterval* dataInterval, FXTreeItem* itemParent = nullptr); + + /// @brief pointer to genericData frame Parent + GNEGenericDataFrame* myGenericDataFrameParent; + + /// @brief check button to create a new interval + FXCheckButton* myNewIntervalCheckButton; + + /// @brief interval begin horizontal frame + FXHorizontalFrame* myHorizontalFrameBegin; + + /// @brief interval begin text field + FXTextField* myBeginTextField; + + /// @brief interval end horizontal frame + FXHorizontalFrame* myHorizontalFrameEnd; + + /// @brief interval end + FXTextField* myEndTextField; + + /// @brief create interval button + FXButton* myCreateIntervalButton; + + /// @brief tree list to show the interval list + FXTreeList* myIntervalsTreelist; + + /// @brief map used to save the Tree items with their GNEDataInterval + std::map myTreeItemIntervalMap; + }; + + // =========================================================================== + // class AttributeSelector + // =========================================================================== + + class AttributeSelector : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEGenericDataFrame::AttributeSelector) + + public: + /// @brief constructor + AttributeSelector(GNEGenericDataFrame* genericDataFrameParent, SumoXMLTag tag); + + /// @brief destructor + ~AttributeSelector(); + + /// @brief refresh interval selector + void refreshAttributeSelector(); + + /// @brief get filtered attribute + std::string getFilteredAttribute() const; + + /// @brief get color for the given value + const RGBColor& getScaledColor(const double min, const double max, const double value) const; + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user select a attribute in the combo boz + long onCmdSelectAttribute(FXObject*, FXSelector, void*); + + /// @} + + protected: + FOX_CONSTRUCTOR(AttributeSelector) + + private: + /// @brief pointer to genericData frame Parent + GNEGenericDataFrame* myGenericDataFrameParent; + + /// @brief combo box for attributes + FXComboBox* myAttributesComboBox; + + /// @brief label for min/max attribute + FXLabel* myMinMaxLabel; + + /// @brief generic data tag + SumoXMLTag myGenericDataTag; + + /// @brief vector with the scale colors + std::vector myScaleColors; + }; + + /// @brief get dataSet selector modul + const DataSetSelector* getDataSetSelector() const; + + /// @brief get interval selector modul + const IntervalSelector* getIntervalSelector() const; + + /// @brief getattribute selector modul + const AttributeSelector* getAttributeSelector() const; + + /// @brief get EdgePathCreator modul + GNEFrameModuls::EdgePathCreator* getEdgePathCreator() const; + + /// @brief show Frame + void show(); + +protected: + /**@brief Constructor (protected due GNEGenericDataFrame is abtract) + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet GNEViewNet that uses this GNEFrame + * @brief tag generic data tag + */ + GNEGenericDataFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet, SumoXMLTag tag); + + /// @brief Destructor + ~GNEGenericDataFrame(); + + /// @brief interval selected + void intervalSelected(); + + /// @brief finish edge path creation + virtual void edgePathCreated(); + + /// @brief dataSet selector modul + DataSetSelector* myDataSetSelector; + + /// @brief interval selector modul + IntervalSelector* myIntervalSelector; + + /// @brief attribute selector modul + AttributeSelector* myAttributeSelector; + + /// @brief parameters editor + GNEFrameAttributesModuls::ParametersEditor* myParametersEditor; + + /// @brief edge path creator (used for Walks, rides and trips) + GNEFrameModuls::EdgePathCreator* myEdgePathCreator; + +private: + /// @brief Invalidated copy constructor. + GNEGenericDataFrame(const GNEGenericDataFrame&) = delete; + + /// @brief Invalidated assignment operator. + GNEGenericDataFrame& operator=(const GNEGenericDataFrame&) = delete; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/frames/demand/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,19 @@ +set(netedit_frames_demand_SRCS + GNERouteFrame.h + GNERouteFrame.cpp + GNEStopFrame.h + GNEStopFrame.cpp + GNEPersonFrame.h + GNEPersonFrame.cpp + GNEPersonPlanFrame.h + GNEPersonPlanFrame.cpp + GNEVehicleFrame.h + GNEVehicleFrame.cpp + GNEVehicleTypeFrame.h + GNEVehicleTypeFrame.cpp + GNEPersonTypeFrame.h + GNEPersonTypeFrame.cpp + ) + +add_library(netedit_frames_demand STATIC ${netedit_frames_demand_SRCS}) +set_property(TARGET netedit_frames_demand PROPERTY PROJECT_LABEL "z_netedit_frames_demand") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,611 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date May 2019 +/// +// The Widget for add Person elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPersonFrame.h" +#include "GNEStopFrame.h" + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEPersonFrame::HelpCreation - methods +// --------------------------------------------------------------------------- + +GNEPersonFrame::HelpCreation::HelpCreation(GNEPersonFrame* vehicleFrameParent) : + FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + myPersonFrameParent(vehicleFrameParent) { + myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); +} + + +GNEPersonFrame::HelpCreation::~HelpCreation() {} + + +void +GNEPersonFrame::HelpCreation::showHelpCreation() { + // first update help cration + updateHelpCreation(); + // show modul + show(); +} + + +void +GNEPersonFrame::HelpCreation::hideHelpCreation() { + hide(); +} + + +void +GNEPersonFrame::HelpCreation::updateHelpCreation() { + // create information label + std::ostringstream information; + // set text depending of selected person plan + switch (myPersonFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { + case SUMO_TAG_PERSONTRIP_FROMTO: + information + << "- Click over edges to\n" + << " create a trip."; + break; + case SUMO_TAG_PERSONTRIP_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a trip."; + break; + case SUMO_TAG_WALK_EDGES: + information + << "- Click over a sequence of\n" + << " consecutive edges to\n" + << " create a walk."; + break; + case SUMO_TAG_WALK_FROMTO: + information + << "- Click over edges to\n" + << " create a walk."; + break; + case SUMO_TAG_WALK_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a walk."; + break; + case SUMO_TAG_WALK_ROUTE: + information + << "- Click over a route"; + break; + case SUMO_TAG_RIDE_FROMTO: + information + << "- Click over edges to\n" + << " create a ride."; + break; + case SUMO_TAG_RIDE_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a ride"; + break; + case SUMO_TAG_PERSONSTOP_BUSSTOP: + information + << "- Click over a busStop\n" + << " to create a stop"; + break; + case SUMO_TAG_PERSONSTOP_LANE: + information + << "- Click over a lane\n" + << " to create a stop"; + break; + default: + throw ProcessError("Invalid person plan tag"); + } + // set information label + myInformationLabel->setText(information.str().c_str()); +} + +// --------------------------------------------------------------------------- +// GNEPersonFrame - methods +// --------------------------------------------------------------------------- + +GNEPersonFrame::GNEPersonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Persons") { + + // create tag Selector modul for persons + myPersonTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSON); + + // create person types selector modul + myPTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_PTYPE); + + // create person attributes + myPersonAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // create tag Selector modul for person plans + myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSONPLAN); + + // create person plan attributes + myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // Create Netedit parameter + myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + + // create EdgePathCreator Modul + myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); + + // create Help Creation Modul + myHelpCreation = new HelpCreation(this); + + // limit path creator to pedestrians + myEdgePathCreator->setVClass(SVC_PEDESTRIAN); + + // set Person as default vehicle + myPersonTagSelector->setCurrentTag(SUMO_TAG_PERSON); +} + + +GNEPersonFrame::~GNEPersonFrame() {} + + +void +GNEPersonFrame::show() { + // refresh item selector + myPersonTagSelector->refreshTagProperties(); + myPTypeSelector->refreshDemandElementSelector(); + myPersonPlanTagSelector->refreshTagProperties(); + // update VClass of myEdgePathCreator + if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myEdgePathCreator->setVClass(SVC_PASSENGER); + } else { + myEdgePathCreator->setVClass(SVC_PEDESTRIAN); + } + // show frame + GNEFrame::show(); +} + + +bool +GNEPersonFrame::addPerson(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // obtain tag (only for improve code legibility) + SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); + // first check that current selected person is valid + if (personTag == SUMO_TAG_NOTHING) { + myViewNet->setStatusBarText("Current selected person isn't valid."); + return false; + } + // now check that pType is valid + if (myPTypeSelector->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) { + myViewNet->setStatusBarText("Current selected person plan isn't valid."); + return false; + } + // check if walk routes can be created + if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE)) { + return buildPersonOverRoute(objectsUnderCursor.getDemandElementFront()); + } else if ((myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { + return buildPersonOverStop(objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront()); + } else if (objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) { + return myEdgePathCreator->addBusStop(objectsUnderCursor.getAdditionalFront()); + } else if (objectsUnderCursor.getEdgeFront()) { + return myEdgePathCreator->addPathEdge(objectsUnderCursor.getEdgeFront()); + } else { + return false; + } +} + + +GNEFrameModuls::EdgePathCreator* +GNEPersonFrame::getEdgePathCreator() const { + return myEdgePathCreator; +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEPersonFrame::tagSelected() { + // first check if person is valid + if (myPersonTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // show PType selector and person plan selector + myPTypeSelector->showDemandElementSelector(); + // check if current person type selected is valid + if (myPTypeSelector->getCurrentDemandElement()) { + // show person attributes depending of myPersonPlanTagSelector + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop()) { + myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + } else { + myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); + } + // show person plan tag selector + myPersonPlanTagSelector->showTagSelector(); + // now check if person plan selected is valid + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // check if person plan attributes has to be shown + if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP)) { + // hide person plan attributes + myPersonPlanAttributes->hideAttributesCreatorModul(); + } else { + // show person plan attributes + myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + } + // check if myEdgePathCreator has to be show + if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE) || + (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { + // hide edge path creator modul + myEdgePathCreator->hideEdgePathCreator(); + // show Netedit attributes modul + myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); + } else { + // set edge path creator name + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { + myEdgePathCreator->edgePathCreatorName("person trip"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { + myEdgePathCreator->edgePathCreatorName("walk"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myEdgePathCreator->edgePathCreatorName("ride"); + } + // update VClass of myEdgePathCreator + if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myEdgePathCreator->setVClass(SVC_PASSENGER); + } else { + myEdgePathCreator->setVClass(SVC_PEDESTRIAN); + } + // show edge path creator modul + myEdgePathCreator->showEdgePathCreator(); + // hide Netedit attributes modul + myNeteditAttributes->hideNeteditAttributesModul(); + } + // show help modul + myHelpCreation->showHelpCreation(); + } else { + // hide modules + myPersonPlanAttributes->hideAttributesCreatorModul(); + myEdgePathCreator->hideEdgePathCreator(); + myHelpCreation->hideHelpCreation(); + } + } else { + // hide modules + myPersonPlanTagSelector->hideTagSelector(); + myPersonAttributes->hideAttributesCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myEdgePathCreator->hideEdgePathCreator(); + myHelpCreation->hideHelpCreation(); + } + } else { + // hide all moduls if person isn't valid + myPTypeSelector->hideDemandElementSelector(); + myPersonPlanTagSelector->hideTagSelector(); + myPersonAttributes->hideAttributesCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myEdgePathCreator->hideEdgePathCreator(); + myHelpCreation->hideHelpCreation(); + } +} + + +void +GNEPersonFrame::demandElementSelected() { + if (myPTypeSelector->getCurrentDemandElement()) { + // show person attributes depending of myPersonPlanTagSelector + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop()) { + myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); + } else { + myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); + } + // show person plan tag selector + myPersonPlanTagSelector->showTagSelector(); + // now check if person plan selected is valid + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // check if person plan attributes has to be shown + if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP)) { + // hide person plan attributes + myPersonPlanAttributes->hideAttributesCreatorModul(); + } else { + // show person plan attributes + myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + } + // check if myEdgePathCreator has to be show + if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE) || + (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { + // hide edge path creator modul + myEdgePathCreator->hideEdgePathCreator(); + // show Netedit attributes modul + myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); + } else { + // set edge path creator name + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { + myEdgePathCreator->edgePathCreatorName("person trip"); + // set mode in path creator + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::TO_BUSSTOP); + } else { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); + } + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { + myEdgePathCreator->edgePathCreatorName("walk"); + // set mode in path creator + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP) { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::TO_BUSSTOP); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_EDGES) { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::CONSECUTIVE); + } else { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); + } + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myEdgePathCreator->edgePathCreatorName("ride"); + // set mode in path creator + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_RIDE_BUSSTOP) { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::TO_BUSSTOP); + } else { + myEdgePathCreator->setModes(GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); + } + } + // update VClass of myEdgePathCreator + if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myEdgePathCreator->setVClass(SVC_PASSENGER); + } else { + myEdgePathCreator->setVClass(SVC_PEDESTRIAN); + } + // show edge path creator modul + myEdgePathCreator->showEdgePathCreator(); + // hide Netedit attributes modul + myNeteditAttributes->hideNeteditAttributesModul(); + } + // show help modul + myHelpCreation->showHelpCreation(); + } else { + // hide modules + myPersonPlanAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myEdgePathCreator->hideEdgePathCreator(); + myHelpCreation->hideHelpCreation(); + } + } else { + // hide modules + myPersonPlanTagSelector->hideTagSelector(); + myPersonAttributes->hideAttributesCreatorModul(); + myPersonPlanAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myEdgePathCreator->hideEdgePathCreator(); + myHelpCreation->hideHelpCreation(); + } +} + + +void +GNEPersonFrame::edgePathCreated() { + // first check that all attributes are valid + if (!myPersonAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid person parameters."); + } else if (!myPersonPlanAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + } else { + // build person + GNEDemandElement* createdPerson = buildPerson(); + // Declare map to keep attributes from myPersonPlanAttributes + std::map valuesMap = myPersonPlanAttributes->getAttributesAndValues(true); + // check what PersonPlan we're creating + switch (myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { + case SUMO_TAG_PERSONTRIP_FROMTO: { + // obtain attributes + std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); + std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // now check that number of selected edges are correct + if (myEdgePathCreator->getClickedEdges().size() > 1) { + GNERouteHandler::buildPersonTripFromTo(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos, types, modes); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + } else { + myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge."); + // abort person creation + myViewNet->getUndoList()->p_abort(); + } + break; + } + case SUMO_TAG_PERSONTRIP_BUSSTOP: { + // obtain attributes + std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); + std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); + // now check that number of selected edges are correct + if ((myEdgePathCreator->getClickedEdges().size() > 0) && myEdgePathCreator->getClickedBusStop()) { + GNERouteHandler::buildPersonTripBusStop(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop(), types, modes); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + } else { + myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge."); + // abort person creation + myViewNet->getUndoList()->p_abort(); + } + break; + } + case SUMO_TAG_WALK_EDGES: { + // obtain attributes + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + GNERouteHandler::buildWalkEdges(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges(), arrivalPos); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + break; + } + case SUMO_TAG_WALK_FROMTO: { + // obtain attributes + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + GNERouteHandler::buildWalkFromTo(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + break; + } + case SUMO_TAG_WALK_BUSSTOP: { + // obtain attributes + GNERouteHandler::buildWalkBusStop(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop()); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + break; + } + case SUMO_TAG_RIDE_FROMTO: { + // obtain attributes + std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + GNERouteHandler::buildRideFromTo(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), lines, arrivalPos); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + break; + } + case SUMO_TAG_RIDE_BUSSTOP: { + // obtain attributes + std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); + GNERouteHandler::buildRideBusStop(myViewNet->getNet(), true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop(), lines); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + break; + } + default: + throw InvalidArgument("Invalid person plan tag"); + } + // refresh person and personPlan attributes + myPersonAttributes->refreshRows(); + myPersonPlanAttributes->refreshRows(); + } +} + +// --------------------------------------------------------------------------- +// GNEPersonFrame - private methods +// --------------------------------------------------------------------------- + + +bool +GNEPersonFrame::buildPersonOverRoute(GNEDemandElement* route) { + if (route && (route->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { + // first check that all attributes are valid + if (!myPersonAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid person parameters."); + } else if (!myPersonPlanAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + } else { + // build person and walk over route + GNERouteHandler::buildWalkRoute(myViewNet->getNet(), true, buildPerson(), route, 0); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + return true; + } + return false; + } else { + myViewNet->setStatusBarText("Click over a " + toString(SUMO_TAG_ROUTE) + " to create a " + myPersonTagSelector->getCurrentTagProperties().getTagStr()); + return false; + } +} + + +bool +GNEPersonFrame::buildPersonOverStop(GNELane* lane, GNEAdditional* busStop) { + // first check that all attributes are valid + if (!myPersonAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid person parameters."); + return false; + } else if (!myPersonPlanAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + return false; + } else { + // declare stop parameters and friendly position + SUMOVehicleParameter::Stop stopParameter; + if (GNEStopFrame::getStopParameter(stopParameter, myPersonPlanTagSelector->getCurrentTagProperties().getTag(), + myViewNet, myPersonPlanAttributes, myNeteditAttributes, lane, busStop)) { + // create it in RouteFrame + GNERouteHandler::buildStop(myViewNet->getNet(), true, stopParameter, buildPerson()); + // end undo-redo operation + myViewNet->getUndoList()->p_end(); + // stop sucesfully created, then return true + return true; + } else { + return false; + } + } +} + + +GNEDemandElement* +GNEPersonFrame::buildPerson() { + // obtain person tag (only for improve code legibility) + SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); + // obtain person plan tag (only for improve code legibility) + SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTagProperties().getTag(); + // begin undo-redo operation + myViewNet->getUndoList()->p_begin("create " + toString(personTag) + " and " + toString(personPlanTag)); + // Declare map to keep attributes from myPersonAttributes + std::map valuesMap = myPersonAttributes->getAttributesAndValues(false); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", personTag); + } + // add pType parameter + valuesMap[SUMO_ATTR_TYPE] = myPTypeSelector->getCurrentDemandElement()->getID(); + // check if we're creating a person or personFlow + if (personTag == SUMO_TAG_PERSON) { + // Add parameter departure + if (valuesMap[SUMO_ATTR_DEPART].empty()) { + valuesMap[SUMO_ATTR_DEPART] = "0"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag)); + // obtain person parameters + SUMOVehicleParameter* personParameters = SUMOVehicleParserHelper::parseVehicleAttributes(SUMO_TAG_PERSON, SUMOSAXAttrs, false, false, false); + // build person in GNERouteHandler + GNERouteHandler::buildPerson(myViewNet->getNet(), true, *personParameters); + // delete personParameters + delete personParameters; + } else { + // set begin and end attributes + if (valuesMap[SUMO_ATTR_BEGIN].empty()) { + valuesMap[SUMO_ATTR_BEGIN] = "0"; + } + if (valuesMap[SUMO_ATTR_END].empty()) { + valuesMap[SUMO_ATTR_END] = "3600"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag)); + // obtain personFlow parameters + SUMOVehicleParameter* personFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX, true); + // build personFlow in GNERouteHandler + GNERouteHandler::buildPersonFlow(myViewNet->getNet(), true, *personFlowParameters); + // delete personFlowParameters + delete personFlowParameters; + } + // refresh person and personPlan attributes + myPersonAttributes->refreshRows(); + myPersonPlanAttributes->refreshRows(); + // return created person + return myViewNet->getNet()->retrieveDemandElement(personTag, valuesMap[SUMO_ATTR_ID]); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,128 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonFrame.h +/// @author Pablo Alvarez Lopez +/// @date May 2019 +/// +// The Widget for add person elements +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEPersonFrame + */ +class GNEPersonFrame : public GNEFrame { + +public: + // =========================================================================== + // class HelpCreation + // =========================================================================== + + class HelpCreation : protected FXGroupBox { + + public: + /// @brief constructor + HelpCreation(GNEPersonFrame* vehicleFrameParent); + + /// @brief destructor + ~HelpCreation(); + + /// @brief show HelpCreation + void showHelpCreation(); + + /// @brief hide HelpCreation + void hideHelpCreation(); + + /// @brief update HelpCreation + void updateHelpCreation(); + + private: + /// @brief pointer to Person Frame Parent + GNEPersonFrame* myPersonFrameParent; + + /// @brief Label with creation information + FXLabel* myInformationLabel; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEPersonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEPersonFrame(); + + /// @brief show Frame + void show(); + + /**@brief add vehicle element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if vehicle was sucesfully added + */ + bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief get EdgePathCreator modul + GNEFrameModuls::EdgePathCreator* getEdgePathCreator() const; + +protected: + /// @brief Tag selected in TagSelector + void tagSelected(); + + /// @brief selected demand element in DemandElementSelector + void demandElementSelected(); + + /// @brief finish edge path creation + void edgePathCreated(); + +private: + /// @brief person tag selector (used to select diffent kind of persons) + GNEFrameModuls::TagSelector* myPersonTagSelector; + + /// @brief Person Type selectors + GNEFrameModuls::DemandElementSelector* myPTypeSelector; + + /// @brief person plan selector (used to select diffent kind of person plan) + GNEFrameModuls::TagSelector* myPersonPlanTagSelector; + + /// @brief internal vehicle attributes + GNEFrameAttributesModuls::AttributesCreator* myPersonAttributes; + + /// @brief internal person plan attributes + GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; + + /// @brief Netedit parameter + GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + + /// @brief edge path creator (used for Walks, rides and trips) + GNEFrameModuls::EdgePathCreator* myEdgePathCreator; + + /// @brief Help creation + HelpCreation* myHelpCreation; + + /// @brief build person over route + bool buildPersonOverRoute(GNEDemandElement* route); + + /// @brief build person over stop + bool buildPersonOverStop(GNELane* lane, GNEAdditional* busStop); + + /// @brief build person and return it (note: function includes a call to p_begin(...), but NOT a call to p_end(...)) + GNEDemandElement* buildPerson(); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,724 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonPlanFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// The Widget for add PersonPlan elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPersonPlanFrame.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEPersonPlanFrame::PersonPlanCreator) PersonPlanCreatorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNEPersonPlanFrame::PersonPlanCreator::onCmdAbortPersonPlanCreation), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNEPersonPlanFrame::PersonPlanCreator::onCmdFinishPersonPlanCreation), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNEPersonPlanFrame::PersonPlanCreator::onCmdRemoveLastElement) +}; + +// Object implementation +FXIMPLEMENT(GNEPersonPlanFrame::PersonPlanCreator, FXGroupBox, PersonPlanCreatorMap, ARRAYNUMBER(PersonPlanCreatorMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEPersonPlanFrame::HelpCreation - methods +// --------------------------------------------------------------------------- + +GNEPersonPlanFrame::HelpCreation::HelpCreation(GNEPersonPlanFrame* vehicleFrameParent) : + FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + myPersonPlanFrameParent(vehicleFrameParent) { + myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); +} + + +GNEPersonPlanFrame::HelpCreation::~HelpCreation() {} + + +void +GNEPersonPlanFrame::HelpCreation::showHelpCreation() { + // first update help cration + updateHelpCreation(); + // show modul + show(); +} + + +void +GNEPersonPlanFrame::HelpCreation::hideHelpCreation() { + hide(); +} + +void +GNEPersonPlanFrame::HelpCreation::updateHelpCreation() { + // create information label + std::ostringstream information; + // first check if Person Plan selector is shown + if (myPersonPlanFrameParent->myPersonSelector->isDemandElementSelectorShown()) { + // set text depending of selected person plan + switch (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { + case SUMO_TAG_PERSONTRIP_FROMTO: + information + << "- Click over edges to\n" + << " create a trip."; + break; + case SUMO_TAG_PERSONTRIP_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a trip."; + break; + case SUMO_TAG_WALK_EDGES: + information + << "- Click over a sequence of\n" + << " consecutive edges to\n" + << " create a walk."; + break; + case SUMO_TAG_WALK_FROMTO: + information + << "- Click over edges to\n" + << " create a walk."; + break; + case SUMO_TAG_WALK_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a walk."; + break; + case SUMO_TAG_WALK_ROUTE: + information + << "- Click over a route"; + break; + case SUMO_TAG_RIDE_FROMTO: + information + << "- Click over edges to\n" + << " create a ride."; + break; + case SUMO_TAG_RIDE_BUSSTOP: + information + << "- Click over an edge and\n" + << " a busStop to create a ride"; + break; + default: + break; + } + } else { + information << "- There aren't persons or\n" + << " personFlows in network."; + } + // set information label + myInformationLabel->setText(information.str().c_str()); +} + +// --------------------------------------------------------------------------- +// GNEPersonPlanFrame::PersonPlanCreator - methods +// --------------------------------------------------------------------------- + +GNEPersonPlanFrame::PersonPlanCreator::PersonPlanCreator(GNEPersonPlanFrame* frameParent) : + FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), + myPersonPlanFrameParent(frameParent) { + // create label for curren begin element + new FXLabel(this, "Current from edge:", 0, GUIDesignLabelCenterThick); + myCurrentBeginElementLabel = new FXLabel(this, "", 0, GUIDesignLabelCenterThick); + + // create button for finish person plan creation + myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); + myFinishCreationButton->disable(); + + // create button for abort person plan creation + myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); + myAbortCreationButton->disable(); + + // create button for remove last element + myRemoveLastEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); + myRemoveLastEdge->disable(); +} + + +GNEPersonPlanFrame::PersonPlanCreator::~PersonPlanCreator() {} + + +void +GNEPersonPlanFrame::PersonPlanCreator::edgePathCreatorName(const std::string& name) { + // header needs the first capitalized letter + std::string nameWithFirstCapitalizedLetter = name; + nameWithFirstCapitalizedLetter[0] = (char)toupper(nameWithFirstCapitalizedLetter.at(0)); + setText((nameWithFirstCapitalizedLetter + " creator").c_str()); + myFinishCreationButton->setText(("Finish " + name + " creation").c_str()); + myAbortCreationButton->setText(("Abort " + name + " creation").c_str()); +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::showPersonPlanCreator() { + // simply refresh person plan creator + refreshPersonPlanCreator(); + // show + show(); +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::hidePersonPlanCreator() { + // disable buttons + myAbortCreationButton->disable(); + myFinishCreationButton->disable(); + myRemoveLastEdge->disable(); + // restore colors + for (const auto& i : myClickedEdges) { + for (const auto& j : i->getLanes()) { + j->setSpecialColor(nullptr); + } + } + // clear edges + myClickedEdges.clear(); + // clear myTemporalEdgePath + myTemporalEdgePath.clear(); + // hide + hide(); +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::refreshPersonPlanCreator() { + // disable buttons + myFinishCreationButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastEdge->disable(); + // restore colors + for (const auto& i : myClickedEdges) { + for (const auto& j : i->getLanes()) { + j->setSpecialColor(nullptr); + } + } + // clear edges + myClickedEdges.clear(); + myTemporalEdgePath.clear(); + // first check if person has already child demand elements + if (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement() && + (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().size() > 0)) { + // obtain last person plan element tag and pointer (to improve code legibliy) + SumoXMLTag lastPersonPlanElementTag = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back()->getTagProperty().getTag(); + GNEDemandElement* lastPersonPlanElement = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back(); + // add edge of last person plan of current edited person + if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_LANE) { + // obtan edge's lane of stop lane + addEdge(lastPersonPlanElement->getParentLanes().front()->getParentEdge()); + } else if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_BUSSTOP) { + // obtan edge's lane of stop stopping place + addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + } else if ((lastPersonPlanElementTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_WALK_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_RIDE_BUSSTOP)) { + // obtan edge's lane of Person Plans placed over stopping places + addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); + } else if (lastPersonPlanElementTag == SUMO_TAG_WALK_ROUTE) { + // obtan edge's lane of Person Plans placed over stopping places + addEdge(lastPersonPlanElement->getParentDemandElements().back()->getParentEdges().back()); + } else { + // all rest of person plans have parent edges + addEdge(lastPersonPlanElement->getParentEdges().back()); + } + // set current begin element information + myCurrentBeginElementLabel->setText((myClickedEdges.front()->getID()).c_str()); + // show label + show(); + } else { + hide(); + } +} + + +std::vector +GNEPersonPlanFrame::PersonPlanCreator::getClickedEdges() const { + return myClickedEdges; +} + + +const std::vector& +GNEPersonPlanFrame::PersonPlanCreator::getEdgePath() const { + return myTemporalEdgePath; +} + + +bool +GNEPersonPlanFrame::PersonPlanCreator::addEdge(GNEEdge* edge) { + // if a certain BusStop was already defined, a new edge cannot be added + if (myClickedEdges.empty() || ((myClickedEdges.size() > 0) && (myClickedEdges.back() != edge))) { + myClickedEdges.push_back(edge); + // enable abort route button + myAbortCreationButton->enable(); + // disable undo/redo + myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("trip creation"); + // set special color + for (auto i : edge->getLanes()) { + i->setSpecialColor(&myPersonPlanFrameParent->getEdgeCandidateSelectedColor()); + } + // calculate route if there is more than two edges + if (myClickedEdges.size() > 1) { + // enable remove last edge button + myRemoveLastEdge->enable(); + // enable finish button + myFinishCreationButton->enable(); + // calculate temporal route + if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myTemporalEdgePath = myPersonPlanFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(SVC_PASSENGER, myClickedEdges); + } else { + myTemporalEdgePath = myPersonPlanFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(SVC_PEDESTRIAN, myClickedEdges); + } + } + return true; + } else { + return false; + } +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::drawTemporalRoute() const { + // only draw if there is at least two edges + if (myTemporalEdgePath.size() > 1) { + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, GLO_MAX); + // set orange color + GLHelper::setColor(RGBColor::ORANGE); + // set line width + glLineWidth(5); + // draw first line + GLHelper::drawLine(myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.front(), + myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.back()); + // draw rest of lines + for (int i = 1; i < (int)myTemporalEdgePath.size(); i++) { + GLHelper::drawLine(myTemporalEdgePath.at(i - 1)->getNBEdge()->getLanes().front().shape.back(), + myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front()); + GLHelper::drawLine(myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front(), + myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.back()); + } + // Pop last matrix + glPopMatrix(); + } +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::abortPersonPlanCreation() { + if (myAbortCreationButton->isEnabled()) { + onCmdAbortPersonPlanCreation(nullptr, 0, nullptr); + } +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::finishPersonPlanCreation() { + if (myFinishCreationButton->isEnabled()) { + onCmdFinishPersonPlanCreation(nullptr, 0, nullptr); + } +} + + +void +GNEPersonPlanFrame::PersonPlanCreator::removeLastAddedElement() { + if (myRemoveLastEdge->isEnabled()) { + onCmdRemoveLastElement(nullptr, 0, nullptr); + } +} + + +long +GNEPersonPlanFrame::PersonPlanCreator::onCmdAbortPersonPlanCreation(FXObject*, FXSelector, void*) { + // refresh person plan creator + refreshPersonPlanCreator(); + // enable undo/redo + myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); + return 1; +} + + +long +GNEPersonPlanFrame::PersonPlanCreator::onCmdFinishPersonPlanCreation(FXObject*, FXSelector, void*) { + // only create route if there is more than two edges + if (myClickedEdges.size() > 1) { + // call edgePathCreated + myPersonPlanFrameParent->personPlanCreated(nullptr, nullptr); + // update view + myPersonPlanFrameParent->myViewNet->updateViewNet(); + // refresh person plan creator + refreshPersonPlanCreator(); + // enable undo/redo + myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); + } + return 1; +} + + +long +GNEPersonPlanFrame::PersonPlanCreator::onCmdRemoveLastElement(FXObject*, FXSelector, void*) { + if (myClickedEdges.size() > 1) { + // remove last edge + myClickedEdges.pop_back(); + // calculate temporal route + if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myTemporalEdgePath = myPersonPlanFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(SVC_PASSENGER, myClickedEdges); + } else { + myTemporalEdgePath = myPersonPlanFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(SVC_PEDESTRIAN, myClickedEdges); + } + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNEPersonPlanFrame - methods +// --------------------------------------------------------------------------- + +GNEPersonPlanFrame::GNEPersonPlanFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "PersonPlans") { + + // create person types selector modul + myPersonSelector = new GNEFrameModuls::DemandElementSelector(this, {GNETagProperties::TagType::PERSON}); + + // Create tag selector for person plan + myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::PERSONPLAN); + + // Create person parameters + myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // create PersonPlanCreator Modul + myPersonPlanCreator = new PersonPlanCreator(this); + + // Create Help Creation Modul + myHelpCreation = new HelpCreation(this); + + // Create AttributeCarrierHierarchy modul + myPersonHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this); + + // set PersonPlan tag type in tag selector + myPersonPlanTagSelector->setCurrentTagType(GNETagProperties::TagType::PERSONPLAN); +} + + +GNEPersonPlanFrame::~GNEPersonPlanFrame() {} + + +void +GNEPersonPlanFrame::show() { + // Only show moduls if there is at least one person + if ((myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON).size() > 0) || + (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW).size() > 0)) { + // refresh demand element selector + myPersonSelector->refreshDemandElementSelector(); + // refresh item selector + myPersonPlanTagSelector->refreshTagProperties(); + // show myPersonPlanCreator + myPersonPlanCreator->showPersonPlanCreator(); + // set first person as demand element + if (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON).size() > 0) { + myPersonSelector->setDemandElement(myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON).begin()->second); + } else { + myPersonSelector->setDemandElement(myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW).begin()->second); + } + } else { + // hide all moduls except helpCreation + myPersonSelector->hideDemandElementSelector(); + myPersonPlanTagSelector->hideTagSelector(); + myPersonPlanAttributes->hideAttributesCreatorModul(); + myPersonPlanCreator->hidePersonPlanCreator(); + myPersonHierarchy->hideAttributeCarrierHierarchy(); + myHelpCreation->showHelpCreation(); + } + // show frame + GNEFrame::show(); +} + + +void +GNEPersonPlanFrame::hide() { + // abort plan creation + myPersonPlanCreator->hidePersonPlanCreator(); + // hide frame + GNEFrame::hide(); +} + + +bool +GNEPersonPlanFrame::addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if person selected is valid + if (myPersonSelector->getCurrentDemandElement() == nullptr) { + myViewNet->setStatusBarText("Current selected person isn't valid."); + return false; + } + // finally check that person plan selected is valid + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + 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(); + // declare flags to check required elements + /*SUMO_TAG_PERSONSTOP_LANE;*/ + bool requireRoute = (personPlanTag == SUMO_TAG_WALK_ROUTE); + bool requireBusStop = ((personPlanTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (personPlanTag == SUMO_TAG_WALK_BUSSTOP) || + (personPlanTag == SUMO_TAG_RIDE_BUSSTOP) || (personPlanTag == SUMO_TAG_PERSONSTOP_BUSSTOP)); + bool requireEdge = ((personPlanTag == SUMO_TAG_PERSONTRIP_FROMTO) || (personPlanTag == SUMO_TAG_WALK_EDGES) || + (personPlanTag == SUMO_TAG_WALK_FROMTO) || (personPlanTag == SUMO_TAG_RIDE_FROMTO)); + // process personPlanCreated(...) depending of required element + if (requireBusStop && objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) { + return personPlanCreated(objectsUnderCursor.getAdditionalFront(), nullptr); + } else if (requireRoute && objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { + return personPlanCreated(nullptr, objectsUnderCursor.getDemandElementFront()); + } else if (requireEdge && objectsUnderCursor.getEdgeFront()) { + return myPersonPlanCreator->addEdge(objectsUnderCursor.getEdgeFront()); + } else { + return false; + } +} + + +GNEPersonPlanFrame::PersonPlanCreator* +GNEPersonPlanFrame::getPersonPlanCreator() const { + return myPersonPlanCreator; +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEPersonPlanFrame::tagSelected() { + // first check if person is valid + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // set edge path creator name + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { + myPersonPlanCreator->edgePathCreatorName("person trip"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { + myPersonPlanCreator->edgePathCreatorName("walk"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myPersonPlanCreator->edgePathCreatorName("ride"); + } + // show person attributes + myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + // show edge path creator + myPersonPlanCreator->showPersonPlanCreator(); + // show help creation + myHelpCreation->showHelpCreation(); + // show person hierarchy + myPersonHierarchy->showAttributeCarrierHierarchy(myPersonSelector->getCurrentDemandElement()); + } else { + // hide moduls if tag selecte isn't valid + myPersonPlanAttributes->hideAttributesCreatorModul(); + myPersonPlanCreator->hidePersonPlanCreator(); + myHelpCreation->hideHelpCreation(); + myPersonHierarchy->hideAttributeCarrierHierarchy(); + } +} + + +void +GNEPersonPlanFrame::demandElementSelected() { + // check if a valid person was selected + if (myPersonSelector->getCurrentDemandElement()) { + // show person plan tag selector + myPersonPlanTagSelector->showTagSelector(); + // now check if person plan selected is valid + if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // set edge path creator name + if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { + myPersonPlanCreator->edgePathCreatorName("person trip"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { + myPersonPlanCreator->edgePathCreatorName("walk"); + } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { + myPersonPlanCreator->edgePathCreatorName("ride"); + } + // show person plan attributes + myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); + // show edge path creator + myPersonPlanCreator->showPersonPlanCreator(); + // show help creation + myHelpCreation->showHelpCreation(); + // Show the person's children + myPersonHierarchy->showAttributeCarrierHierarchy(myPersonSelector->getCurrentDemandElement()); + } else { + myPersonPlanAttributes->hideAttributesCreatorModul(); + myPersonPlanCreator->hidePersonPlanCreator(); + myHelpCreation->hideHelpCreation(); + myPersonHierarchy->hideAttributeCarrierHierarchy(); + } + } else { + // hide moduls if person selected isn't valid + myPersonPlanTagSelector->hideTagSelector(); + myPersonPlanAttributes->hideAttributesCreatorModul(); + myPersonPlanCreator->hidePersonPlanCreator(); + myHelpCreation->hideHelpCreation(); + myPersonHierarchy->hideAttributeCarrierHierarchy(); + } +} + + +bool +GNEPersonPlanFrame::personPlanCreated(GNEAdditional* busStop, GNEDemandElement* route) { + // first check that all attributes are valid + if (!myPersonPlanAttributes->areValuesValid()) { + myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); + return false; + } else { + // Declare map to keep attributes from myPersonPlanAttributes + std::map valuesMap = myPersonPlanAttributes->getAttributesAndValues(true); + // check what PersonPlan we're creating + switch (myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { + case SUMO_TAG_PERSONTRIP_FROMTO: { + std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); + std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // check if person trip fromto can be created + if (myPersonPlanCreator->getEdgePath().size() > 1) { + GNERouteHandler::buildPersonTripFromTo(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), arrivalPos, types, modes); + } else { + myViewNet->setStatusBarText("A person trip with from-to attributes needs at least two edge."); + return false; + } + break; + } + case SUMO_TAG_PERSONTRIP_BUSSTOP: { + std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); + std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); + // check if person trip busstop can be created + if (busStop == nullptr) { + myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop"); + return false; + } else { + // add busstop's edge to personPlan creator (To calculate a temporal route) + myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); + if (myPersonPlanCreator->getEdgePath().size() > 0) { + GNERouteHandler::buildPersonTripBusStop(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop, types, modes); + } else { + myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop"); + return false; + } + } + break; + } + case SUMO_TAG_WALK_EDGES: { + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // check if walk edges can be created + if (myPersonPlanCreator->getEdgePath().size() > 0) { + GNERouteHandler::buildWalkEdges(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath(), arrivalPos); + } else if ((myPersonPlanCreator->getClickedEdges().size() == 1) || (myPersonPlanCreator->getClickedEdges().size() == 2)) { + GNERouteHandler::buildWalkEdges(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getClickedEdges(), arrivalPos); + } else { + myViewNet->setStatusBarText("A walk with edges attribute needs a list of edges"); + return false; + } + break; + } + case SUMO_TAG_WALK_FROMTO: { + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // check if walk fromto can be created + if (myPersonPlanCreator->getEdgePath().size() > 1) { + GNERouteHandler::buildWalkFromTo(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), arrivalPos); + } else { + myViewNet->setStatusBarText("A walk with from-to attributes needs at least two edges."); + return false; + } + break; + } + case SUMO_TAG_WALK_BUSSTOP: { + // check if walk busstop can be created + if (busStop == nullptr) { + myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop"); + } else { + // add busstop's edge to personPlan creator (To calculate a temporal route) + myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); + if (myPersonPlanCreator->getEdgePath().size() > 0) { + GNERouteHandler::buildWalkBusStop(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop); + } else { + myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop"); + return false; + } + } + break; + } + case SUMO_TAG_WALK_ROUTE: { + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // check if walk route can be created + if (route != nullptr) { + GNERouteHandler::buildWalkRoute(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), route, arrivalPos); + } else { + myViewNet->setStatusBarText("A ride with route attributes needs one route"); + return false; + } + break; + } + case SUMO_TAG_RIDE_FROMTO: { + std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); + double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); + // check if ride fromto can be created + if (myPersonPlanCreator->getEdgePath().size() > 2) { + GNERouteHandler::buildRideFromTo(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), lines, arrivalPos); + } else { + myViewNet->setStatusBarText("A ride with from-to attributes needs at least two edge."); + return false; + } + break; + } + case SUMO_TAG_RIDE_BUSSTOP: { + std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); + // check if ride busstop can be created + if (busStop == nullptr) { + myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop"); + } else { + // add busstop's edge to personPlan creator (To calculate a temporal route) + myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); + if (myPersonPlanCreator->getEdgePath().size() > 0) { + GNERouteHandler::buildRideBusStop(myViewNet->getNet(), true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop, lines); + } else { + myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop"); + return false; + } + } + break; + } + default: + throw InvalidArgument("Invalid person plan tag"); + } + // refresh AttributeCarrierHierarchy + myPersonHierarchy->refreshAttributeCarrierHierarchy(); + // refresh also Person Plan creator + myPersonPlanCreator->refreshPersonPlanCreator(); + // refresh personPlan attributes + myPersonPlanAttributes->refreshRows(); + // person plan element created, then return true + return true; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonPlanFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,203 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPersonPlanFrame.h +/// @author Pablo Alvarez Lopez +/// @date Jun 2019 +/// +// The Widget for add PersonPlan elements +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEPersonPlanFrame + */ +class GNEPersonPlanFrame : public GNEFrame { + +public: + + // =========================================================================== + // class HelpCreation + // =========================================================================== + + class HelpCreation : protected FXGroupBox { + + public: + /// @brief constructor + HelpCreation(GNEPersonPlanFrame* vehicleFrameParent); + + /// @brief destructor + ~HelpCreation(); + + /// @brief show HelpCreation + void showHelpCreation(); + + /// @brief hide HelpCreation + void hideHelpCreation(); + + /// @brief update HelpCreation + void updateHelpCreation(); + + private: + /// @brief pointer to PersonPlan Frame Parent + GNEPersonPlanFrame* myPersonPlanFrameParent; + + /// @brief Label with creation information + FXLabel* myInformationLabel; + }; + + // =========================================================================== + // class PersonPlanCreator + // =========================================================================== + + class PersonPlanCreator : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEPersonPlanFrame::PersonPlanCreator) + + public: + /// @brief default constructor + PersonPlanCreator(GNEPersonPlanFrame* frameParent); + + /// @brief destructor + ~PersonPlanCreator(); + + /// @brief update PersonPlanCreator name + void edgePathCreatorName(const std::string& name); + + /// @brief show PersonPlanCreator + void showPersonPlanCreator(); + + /// @brief show PersonPlanCreator + void hidePersonPlanCreator(); + + /// @brief show PersonPlanCreator + void refreshPersonPlanCreator(); + + /// @brief get clicked edges + std::vector getClickedEdges() const; + + /// @brief get current edge path + const std::vector& getEdgePath() const; + + /// @brief add edge to route + bool addEdge(GNEEdge* edge); + + /// @brief draw temporal route + void drawTemporalRoute() const; + + /// @brief abort person plan creation + void abortPersonPlanCreation(); + + /// @brief finish person plan creation + void finishPersonPlanCreation(); + + /// @brief remove last added element + void removeLastAddedElement(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user click over button "Abort route creation" + long onCmdAbortPersonPlanCreation(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Finish route creation" + long onCmdFinishPersonPlanCreation(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Remove last inserted edge" + long onCmdRemoveLastElement(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(PersonPlanCreator) + + private: + /// @brief pointer to Person Plan Frame Parent + GNEPersonPlanFrame* myPersonPlanFrameParent; + + /// @brief Label with current begin element + FXLabel* myCurrentBeginElementLabel; + + /// @brief button for finish route creation + FXButton* myFinishCreationButton; + + /// @brief button for abort route creation + FXButton* myAbortCreationButton; + + /// @brief button for removing last edge + FXButton* myRemoveLastEdge; + + /// @brief current clicked edges + std::vector myClickedEdges; + + /// @brief vector with temporal edge path + std::vector myTemporalEdgePath; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEPersonPlanFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEPersonPlanFrame(); + + /// @brief show Frame + void show(); + + /// @brief hide Frame + void hide(); + + /**@brief add vehicle element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if vehicle was sucesfully added + */ + bool addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief get PersonPlanCreator modul + PersonPlanCreator* getPersonPlanCreator() const; + +protected: + /// @brief Tag selected in TagSelector + void tagSelected(); + + /// @brief selected demand element in DemandElementSelector + void demandElementSelected(); + + /// @brief finish person plan creation + bool personPlanCreated(GNEAdditional* busStop, GNEDemandElement* route); + +private: + /// @brief Person selectors + GNEFrameModuls::DemandElementSelector* myPersonSelector; + + /// @brief personPlan selector + GNEFrameModuls::TagSelector* myPersonPlanTagSelector; + + /// @brief internal vehicle attributes + GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; + + /// @brief Person Plan Creator + PersonPlanCreator* myPersonPlanCreator; + + /// @brief Person Hierarchy + GNEFrameModuls::AttributeCarrierHierarchy* myPersonHierarchy; + + /// @brief Help creation + HelpCreation* myHelpCreation; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,393 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { + myTypeMatchBox->appendItem(i.first.c_str()); + } + // set DEFAULT_PEDTYPE_ID as default pType + myCurrentPersonType = myPersonTypeFrameParent->getViewNet()->getNet()->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& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { + myTypeMatchBox->appendItem(i.first.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()->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({myCurrentPersonType}, false, true); +} + + +long +GNEPersonTypeFrame::PersonTypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) { + // Check if value of myTypeMatchBox correspond of an allowed additional tags + for (const auto& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE)) { + if (i.first == myTypeMatchBox->getText().text()) { + // set pointer + myCurrentPersonType = i.second; + // 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({myCurrentPersonType}, 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 + std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->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()->p_begin("create person type"); + myPersonTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(personType, true), true); + myPersonTypeFrameParent->myViewNet->getUndoList()->p_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()->p_begin("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()->p_end(); + } + } else { + // begin undo list operation + myPersonTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_end(); + } + return 1; +} + + +long +GNEPersonTypeFrame::PersonTypeEditor::onCmdResetPersonType(FXObject*, FXSelector, void*) { + // begin reset default person type values + myPersonTypeFrameParent->getViewNet()->getUndoList()->p_begin("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()->p_end(); + // refresh PersonTypeSelector + myPersonTypeFrameParent->myPersonTypeSelector->refreshPersonTypeSelector(); + return 1; +} + + +long +GNEPersonTypeFrame::PersonTypeEditor::onCmdCopyPersonType(FXObject*, FXSelector, void*) { + // obtain a new valid person Type ID + std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->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()->p_begin("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()->p_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()->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({myPersonTypeSelector->getCurrentPersonType()}, false, true); + // show frame + GNEFrame::show(); +} + + +GNEPersonTypeFrame::PersonTypeSelector* +GNEPersonTypeFrame::getPersonTypeSelector() const { + return myPersonTypeSelector; +} + + +void +GNEPersonTypeFrame::attributeUpdated() { + myPersonTypeSelector->refreshPersonTypeSelector(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEPersonTypeFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,171 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 + +// =========================================================================== +// 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 elements type + 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.5.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,904 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2018 +/// +// The Widget for remove network-elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNERouteFrame.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNERouteFrame::RouteModeSelector) RouteModeSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTEFRAME_ROUTEMODE, GNERouteFrame::RouteModeSelector::onCmdSelectRouteMode), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTEFRAME_VCLASS, GNERouteFrame::RouteModeSelector::onCmdSelectVClass), +}; + +FXDEFMAP(GNERouteFrame::ConsecutiveEdges) ConsecutiveEdgesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNERouteFrame::ConsecutiveEdges::onCmdAbortRoute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNERouteFrame::ConsecutiveEdges::onCmdCreateRoute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNERouteFrame::ConsecutiveEdges::onCmdRemoveLastRouteEdge) +}; + +FXDEFMAP(GNERouteFrame::NonConsecutiveEdges) NonConsecutiveEdgesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNERouteFrame::NonConsecutiveEdges::onCmdAbortRoute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNERouteFrame::NonConsecutiveEdges::onCmdCreateRoute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNERouteFrame::NonConsecutiveEdges::onCmdRemoveLastRouteEdge) +}; + +// Object implementation +FXIMPLEMENT(GNERouteFrame::RouteModeSelector, FXGroupBox, RouteModeSelectorMap, ARRAYNUMBER(RouteModeSelectorMap)) +FXIMPLEMENT(GNERouteFrame::ConsecutiveEdges, FXGroupBox, ConsecutiveEdgesMap, ARRAYNUMBER(ConsecutiveEdgesMap)) +FXIMPLEMENT(GNERouteFrame::NonConsecutiveEdges, FXGroupBox, NonConsecutiveEdgesMap, ARRAYNUMBER(NonConsecutiveEdgesMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNERouteFrame::RouteModeSelector - methods +// --------------------------------------------------------------------------- + +GNERouteFrame::RouteModeSelector::RouteModeSelector(GNERouteFrame* routeFrameParent) : + FXGroupBox(routeFrameParent->myContentFrame, "Route mode", GUIDesignGroupBoxFrame), + myRouteFrameParent(routeFrameParent), + myCurrentRouteMode(RouteMode::NONCONSECUTIVE_EDGES), + myCurrentVehicleClass(SVC_PASSENGER), + myValidVClass(true) { + // 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); + // fill myRouteModeMatchBox with route modes + for (const auto& i : myRouteModesStrings) { + myRouteModeMatchBox->appendItem(i.second.c_str()); + } + // Set visible items + myRouteModeMatchBox->setNumVisible((int)myRouteModeMatchBox->getNumItems()); + // Create FXComboBox for VClass + myVClassMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_VCLASS, GUIDesignComboBox); + // fill myVClassMatchBox with all VCLass + for (const auto& i : SumoVehicleClassStrings.getStrings()) { + myVClassMatchBox->appendItem(i.c_str()); + } + // set Passenger als default VCLass + myVClassMatchBox->setCurrentItem(7); + // Set visible items + myVClassMatchBox->setNumVisible((int)myVClassMatchBox->getNumItems()); + // RouteModeSelector is always shown + show(); +} + + +GNERouteFrame::RouteModeSelector::~RouteModeSelector() {} + + +const GNERouteFrame::RouteMode& +GNERouteFrame::RouteModeSelector::getCurrentRouteMode() const { + return myCurrentRouteMode; +} + + +SUMOVehicleClass +GNERouteFrame::RouteModeSelector::getCurrentVehicleClass() const { + return myCurrentVehicleClass; +} + + +bool +GNERouteFrame::RouteModeSelector::isValidVehicleClass() const { + return myValidVClass; +} + + +void +GNERouteFrame::RouteModeSelector::setCurrentRouteMode(RouteMode routemode) { + // make sure that route isn't invalid + if (routemode != RouteMode::INVALID) { + // restore color + myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0)); + // set current route mode + myCurrentRouteMode = routemode; + // set item in myTypeMatchBox + for (int i = 0; i < (int)myRouteModesStrings.size(); i++) { + if (myRouteModesStrings.at(i).first == myCurrentRouteMode) { + myRouteModeMatchBox->setCurrentItem(i); + } + } + // show route attributes modul + myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); + // show modes moduls + if ((routemode == RouteMode::CONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { + myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + } else if ((routemode == RouteMode::NONCONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); + } + } else { + // hide all moduls if route mode isnt' valid + myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + } +} + + +long +GNERouteFrame::RouteModeSelector::onCmdSelectRouteMode(FXObject*, FXSelector, void*) { + // first abort all current operations in moduls + myRouteFrameParent->myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + myRouteFrameParent->myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + // Check if value of myTypeMatchBox correspond of an allowed additional tags + for (const auto& i : myRouteModesStrings) { + if (i.second == myRouteModeMatchBox->getText().text()) { + // set color of myTypeMatchBox to black (valid) + myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0)); + // Set new current type + myCurrentRouteMode = i.first; + // show route attributes modul + myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); + // show modes moduls + if ((myCurrentRouteMode == RouteMode::CONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { + myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + } else if ((myCurrentRouteMode == RouteMode::NONCONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); + } + // Write Warning in console if we're in testing mode + WRITE_DEBUG(("Selected RouteMode '" + myRouteModeMatchBox->getText() + "' in RouteModeSelector").text()); + return 1; + } + } + // if Route mode isn't correct, set RouteMode::INVALID as current route mde + myCurrentRouteMode = RouteMode::INVALID; + // hide all moduls if route mode isn't valid + myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + // set color of myTypeMatchBox to red (invalid) + myRouteModeMatchBox->setTextColor(FXRGB(255, 0, 0)); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Selected invalid RouteMode in RouteModeSelector"); + return 1; +} + + +long +GNERouteFrame::RouteModeSelector::onCmdSelectVClass(FXObject*, FXSelector, void*) { + // first abort all current operations in moduls + myRouteFrameParent->myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + myRouteFrameParent->myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + // Check if value of myTypeMatchBox correspond of an allowed additional tags + for (const auto& i : SumoVehicleClassStrings.getStrings()) { + if (i == myVClassMatchBox->getText().text()) { + // set color of myTypeMatchBox to black (valid) + myVClassMatchBox->setTextColor(FXRGB(0, 0, 0)); + // Set new current type + myCurrentVehicleClass = SumoVehicleClassStrings.get(i); + // change flag + myValidVClass = true; + // show route attributes modul + myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); + // enable moduls if current route is valid + if (myCurrentRouteMode == RouteMode::CONSECUTIVE_EDGES) { + myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + } else if (myCurrentRouteMode == RouteMode::NONCONSECUTIVE_EDGES) { + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); + } + // Write Warning in console if we're in testing mode + WRITE_DEBUG(("Selected VClass '" + myVClassMatchBox->getText() + "' in RouteModeSelector").text()); + return 1; + } + } + // if VClass name isn't correct, set SVC_IGNORING as current type + myCurrentVehicleClass = SVC_IGNORING; + // change flag + myValidVClass = false; + // hide all moduls if route mode isnt' valid + myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); + myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); + myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); + // set color of myTypeMatchBox to red (invalid) + myVClassMatchBox->setTextColor(FXRGB(255, 0, 0)); + // Write Warning in console if we're in testing mode + WRITE_DEBUG("Selected invalid VClass in RouteModeSelector"); + return 1; +} + +// --------------------------------------------------------------------------- +// GNERouteFrame::ConsecutiveEdges - methods +// --------------------------------------------------------------------------- + +GNERouteFrame::ConsecutiveEdges::ConsecutiveEdges(GNERouteFrame* routeFrameParent) : + FXGroupBox(routeFrameParent->myContentFrame, "Consecutive edges", GUIDesignGroupBoxFrame), + myRouteFrameParent(routeFrameParent) { + // create label for route info + myInfoRouteLabel = new FXLabel(this, "No edges selected", 0, GUIDesignLabelFrameInformation); + // Create button for create routes + myCreateRouteButton = new FXButton(this, "Create route", 0, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); + myCreateRouteButton->disable(); + // Create button for create routes + myAbortCreationButton = new FXButton(this, "Abort creation", 0, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); + myAbortCreationButton->disable(); + // create button for remove last inserted edge + myRemoveLastInsertedEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); + myRemoveLastInsertedEdge->disable(); + // ConsecutiveEdges is by default shown + show(); +} + + +GNERouteFrame::ConsecutiveEdges::~ConsecutiveEdges() {} + + +void +GNERouteFrame::ConsecutiveEdges::showConsecutiveEdgesModul() { + // recalc before show (to avoid graphic problems) + recalc(); + // show modul + show(); +} + + +void +GNERouteFrame::ConsecutiveEdges::hideConsecutiveEdgesModul() { + // first abort route creation + onCmdAbortRoute(0, 0, 0); + // now hide modul + hide(); +} + + +bool +GNERouteFrame::ConsecutiveEdges::addEdge(GNEEdge* edge) { + // check if currently we're creating a new route + if (myRouteEdges.empty()) { + // block undo/redo + myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); + // add edge into list + myRouteEdges.push_back(edge); + // refresh edge candidates + refreshEdgeCandidates(); + // enable create route and abort edge route + myCreateRouteButton->enable(); + myAbortCreationButton->enable(); + // edge added, then return true + return true; + } else { + // check if clicked edge is in the candidate edges + for (const auto& i : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + if ((i == edge) && myRouteFrameParent->myViewNet->getNet()->getPathCalculator()->consecutiveEdgesConnected(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), myRouteEdges.back(), edge)) { + // restore colors of outgoing edges + for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(nullptr); + } + } + // add new edge in the list of route edges + myRouteEdges.push_back(edge); + // enable remove last inserted edge + myRemoveLastInsertedEdge->enable(); + // refresh edge candidates + refreshEdgeCandidates(); + // edge added, then return true + return true; + } + } + // edge isn't a candidate edge, then return false + return false; + } +} + + +void +GNERouteFrame::ConsecutiveEdges::refreshEdgeCandidates() { + // first check that at least there is a candidate edge + if (myRouteEdges.size() > 0) { + // set selected color in all edges + for (const auto& j : myRouteEdges) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateColor()); + } + } + // set new candidate colors + for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + // check if exist a connection between both edges + if (myRouteFrameParent->myViewNet->getNet()->getPathCalculator()->consecutiveEdgesConnected(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), myRouteEdges.back(), j)) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); + } + } + } + // update route label + updateInfoRouteLabel(); + // update view + myRouteFrameParent->getViewNet()->updateViewNet(); + } +} + + +void +GNERouteFrame::ConsecutiveEdges::clearEdges() { + // disable special color in candidate edges + for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(nullptr); + } + } + // disable special color in current route edges + for (const auto& j : myRouteEdges) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(nullptr); + } + } + // clear route edges + myRouteEdges.clear(); +} + + +const std::vector& +GNERouteFrame::ConsecutiveEdges::getRouteEdges() const { + return myRouteEdges; +} + + +long +GNERouteFrame::ConsecutiveEdges::onCmdCreateRoute(FXObject*, FXSelector, void*) { + // check that route attributes are valid + if (!myRouteFrameParent->myRouteAttributes->areValuesValid()) { + myRouteFrameParent->myRouteAttributes->showWarningMessage(); + } else if (myRouteEdges.size() > 0) { + // obtain attributes + std::map valuesMap = myRouteFrameParent->myRouteAttributes->getAttributesAndValues(true); + // declare a route parameter + GNERouteHandler::RouteParameter routeParameters; + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + routeParameters.routeID = myRouteFrameParent->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE); + } else { + routeParameters.routeID = valuesMap[SUMO_ATTR_ID]; + } + // fill rest of elements + routeParameters.color = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_COLOR)); + routeParameters.edges = myRouteEdges; + routeParameters.vClass = myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(); + // create route + GNERoute* route = new GNERoute(myRouteFrameParent->getViewNet()->getNet(), routeParameters); + // add it into GNENet using GNEChange_DemandElement (to allow undo-redo) + myRouteFrameParent->getViewNet()->getUndoList()->p_begin("add " + route->getTagStr()); + myRouteFrameParent->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); + myRouteFrameParent->getViewNet()->getUndoList()->p_end(); + // abort route creation (because route was already created and vector/colors has to be cleaned) + onCmdAbortRoute(0, 0, 0); + // refresh route attributes + myRouteFrameParent->myRouteAttributes->refreshRows(); + } + return 1; +} + + +long +GNERouteFrame::ConsecutiveEdges::onCmdAbortRoute(FXObject*, FXSelector, void*) { + // first check that there is route edges selected + if (myRouteEdges.size() > 0) { + // unblock undo/redo + myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); + // clear edges + clearEdges(); + // disable buttons + myCreateRouteButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastInsertedEdge->disable(); + // update route label + updateInfoRouteLabel(); + // update view + myRouteFrameParent->getViewNet()->updateViewNet(); + } + return 1; +} + + +long +GNERouteFrame::ConsecutiveEdges::onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*) { + if (myRouteEdges.size() > 1) { + // restore colors of last inserted edge edges + for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(nullptr); + } + } + // add new edge in the list of route edges + myRouteEdges.pop_back(); + // set selected color in all edges + for (const auto& j : myRouteEdges) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateColor()); + } + } + // set new candidate colors + for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { + if (j != myRouteEdges.back()) { + for (const auto& k : j->getLanes()) { + k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); + } + } + } + // disable remove last edge button if there is only one edge + if (myRouteEdges.size() == 1) { + myRemoveLastInsertedEdge->disable(); + } + // update route label + updateInfoRouteLabel(); + // update view + myRouteFrameParent->getViewNet()->updateViewNet(); + // edge added, then return true + return true; + } else { + return false; + } +} + +void +GNERouteFrame::ConsecutiveEdges::updateInfoRouteLabel() { + if (myRouteEdges.size() > 0) { + // declare variables for route info + double length = 0; + double speed = 0; + for (const auto& i : myRouteEdges) { + length += i->getNBEdge()->getLength(); + speed += i->getNBEdge()->getSpeed(); + } + // declare ostringstream for label and fill it + std::ostringstream information; + information + << "- Number of Edges: " << toString(myRouteEdges.size()) << "\n" + << "- Length: " << toString(length) << "\n" + << "- Average speed: " << toString(speed / myRouteEdges.size()); + // set new label + myInfoRouteLabel->setText(information.str().c_str()); + } else { + myInfoRouteLabel->setText("No edges selected"); + } +} + +// --------------------------------------------------------------------------- +// GNERouteFrame::NonConsecutiveEdges - methods +// --------------------------------------------------------------------------- + +GNERouteFrame::NonConsecutiveEdges::NonConsecutiveEdges(GNERouteFrame* routeFrameParent) : + FXGroupBox(routeFrameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), + myRouteFrameParent(routeFrameParent) { + // create label for route info + myInfoRouteLabel = new FXLabel(this, "No edges selected", 0, GUIDesignLabelFrameInformation); + // 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 + myRemoveLastInsertedEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); + myRemoveLastInsertedEdge->disable(); +} + + +GNERouteFrame::NonConsecutiveEdges::~NonConsecutiveEdges() { +} + + +void +GNERouteFrame::NonConsecutiveEdges::showNonConsecutiveEdgesModul() { + // disable buttons + myFinishCreationButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastInsertedEdge->disable(); + // recalc before show (to avoid graphic problems) + recalc(); + // show modul + show(); +} + + +void +GNERouteFrame::NonConsecutiveEdges::hideNonConsecutiveEdgesModul() { + hide(); +} + + +std::vector +GNERouteFrame::NonConsecutiveEdges::getSelectedEdges() const { + return mySelectedEdges; +} + + +bool +GNERouteFrame::NonConsecutiveEdges::addEdge(GNEEdge* edge) { + if (mySelectedEdges.empty() || ((mySelectedEdges.size() > 0) && (mySelectedEdges.back() != edge))) { + mySelectedEdges.push_back(edge); + // enable abort route button + myAbortCreationButton->enable(); + // enable finish button + myFinishCreationButton->enable(); + // disable undo/redo + myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); + // set special color + for (auto i : edge->getLanes()) { + i->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); + } + // calculate route if there is more than two edges + if (mySelectedEdges.size() > 1) { + // enable remove last edge button + myRemoveLastInsertedEdge->enable(); + // calculate temporal route + myTemporalRoute = myRouteFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), mySelectedEdges); + } else { + // Routes with only one edge are allowed + myTemporalRoute.clear(); + myTemporalRoute.push_back(mySelectedEdges.front()); + } + // update info route label + updateInfoRouteLabel(); + return true; + } else { + return false; + } +} + + +void +GNERouteFrame::NonConsecutiveEdges::clearEdges() { + // restore colors + for (const auto& i : mySelectedEdges) { + for (const auto& j : i->getLanes()) { + j->setSpecialColor(nullptr); + } + } + // clear edges + mySelectedEdges.clear(); + myTemporalRoute.clear(); +} + + +const std::vector& +GNERouteFrame::NonConsecutiveEdges::getTemporalRoute() const { + return myTemporalRoute; +} + + +bool +GNERouteFrame::NonConsecutiveEdges::isValid(SUMOVehicleClass /* vehicleClass */) const { + return mySelectedEdges.size() > 0; +} + + +long +GNERouteFrame::NonConsecutiveEdges::onCmdCreateRoute(FXObject*, FXSelector, void*) { + // check that route attributes are valid + if (!myRouteFrameParent->myRouteAttributes->areValuesValid()) { + myRouteFrameParent->myRouteAttributes->showWarningMessage(); + } else if (mySelectedEdges.size() > 0) { + // obtain attributes + std::map valuesMap = myRouteFrameParent->myRouteAttributes->getAttributesAndValues(true); + // declare a route parameter + GNERouteHandler::RouteParameter routeParameters; + routeParameters.edges.reserve(myTemporalRoute.size()); + for (const auto& i : myTemporalRoute) { + routeParameters.edges.push_back(myRouteFrameParent->myViewNet->getNet()->retrieveEdge(i->getID())); + } + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + routeParameters.routeID = myRouteFrameParent->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE); + } else { + routeParameters.routeID = valuesMap[SUMO_ATTR_ID]; + } + // fill rest of elements + routeParameters.color = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_COLOR)); + routeParameters.vClass = myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(); + // create route + GNERoute* route = new GNERoute(myRouteFrameParent->getViewNet()->getNet(), routeParameters); + // add it into GNENet using GNEChange_DemandElement (to allow undo-redo) + myRouteFrameParent->getViewNet()->getUndoList()->p_begin("add " + route->getTagStr()); + myRouteFrameParent->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); + myRouteFrameParent->getViewNet()->getUndoList()->p_end(); + // abort route creation (because route was already created and vector/colors has to be cleaned) + onCmdAbortRoute(0, 0, 0); + // refresh route attributes + myRouteFrameParent->myRouteAttributes->refreshRows(); + } + return 1; +} + + +long +GNERouteFrame::NonConsecutiveEdges::onCmdAbortRoute(FXObject*, FXSelector, void*) { + // first check that there is route edges selected + if (mySelectedEdges.size() > 0) { + // unblock undo/redo + myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); + // clear edges + clearEdges(); + // disable buttons + myFinishCreationButton->disable(); + myAbortCreationButton->disable(); + myRemoveLastInsertedEdge->disable(); + // update info route label + updateInfoRouteLabel(); + // update view (to see the new route) + myRouteFrameParent->getViewNet()->updateViewNet(); + } + return 1; +} + + +long +GNERouteFrame::NonConsecutiveEdges::onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*) { + if (mySelectedEdges.size() > 1) { + // remove special color of last selected edge + for (auto i : mySelectedEdges.back()->getLanes()) { + i->setSpecialColor(0); + } + // remove last edge + mySelectedEdges.pop_back(); + // check if remove last route edge button has to be disabled + if (mySelectedEdges.size() == 1) { + // avoid remove last edge + myRemoveLastInsertedEdge->disable(); + // Routes with only one edge are allowed + myTemporalRoute.clear(); + myTemporalRoute.push_back(mySelectedEdges.front()); + } else { + // calculate temporal route + myTemporalRoute = myRouteFrameParent->myViewNet->getNet()->getPathCalculator()->calculatePath(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), mySelectedEdges); + } + // update info route label + updateInfoRouteLabel(); + // update view + myRouteFrameParent->myViewNet->updateViewNet(); + return true; + } else { + return false; + } +} + +void +GNERouteFrame::NonConsecutiveEdges::updateInfoRouteLabel() { + if (myTemporalRoute.size() > 0) { + // declare variables for route info + double length = 0; + double speed = 0; + for (const auto& i : myTemporalRoute) { + length += i->getNBEdge()->getLength(); + speed += i->getNBEdge()->getSpeed(); + } + // declare ostringstream for label and fill it + std::ostringstream information; + information + << "- Number of Edges: " << toString(myTemporalRoute.size()) << "\n" + << "- Length: " << toString(length) << "\n" + << "- Average speed: " << toString(speed / myTemporalRoute.size()); + // set new label + myInfoRouteLabel->setText(information.str().c_str()); + } else { + myInfoRouteLabel->setText("No edges selected"); + } +} + +// --------------------------------------------------------------------------- +// GNERouteFrame - methods +// --------------------------------------------------------------------------- + +GNERouteFrame::GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Routes") { + + // create route mode Selector modul + myRouteModeSelector = new RouteModeSelector(this); + + // Create route parameters + myRouteAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // create consecutive edges modul + myConsecutiveEdges = new ConsecutiveEdges(this); + + // create non consecutive edges modul + myNonConsecutiveEdges = new NonConsecutiveEdges(this); + + // set RouteMode::NONCONSECUTIVE_EDGES as default mode + myRouteModeSelector->setCurrentRouteMode(RouteMode::NONCONSECUTIVE_EDGES); +} + + +GNERouteFrame::~GNERouteFrame() {} + + +void +GNERouteFrame::show() { + // refresh myRouteModeSelector + myRouteModeSelector->setCurrentRouteMode(myRouteModeSelector->getCurrentRouteMode()); + // show route frame + GNEFrame::show(); +} + + +void +GNERouteFrame::hide() { + GNEFrame::hide(); +} + + +void +GNERouteFrame::handleEdgeClick(GNEEdge* clickedEdge) { + // first check if current vClass is valid and edge exist + if (myRouteModeSelector->isValidVehicleClass() && clickedEdge) { + // continue dependig of current mode + switch (myRouteModeSelector->getCurrentRouteMode()) { + case RouteMode::CONSECUTIVE_EDGES: + // check if edge can be inserted in consecutive edges modul modul + if (myConsecutiveEdges->addEdge(clickedEdge)) { + WRITE_DEBUG("Edge added in ConsecutiveEdges mode"); + } else { + WRITE_DEBUG("Edge wasn't added in ConsecutiveEdges mode"); + } + break; + case RouteMode::NONCONSECUTIVE_EDGES: + // check if edge can be inserted in non consecutive edges modul modul + if (myNonConsecutiveEdges->addEdge(clickedEdge)) { + WRITE_DEBUG("Edge added in NonConsecutiveEdges mode"); + } else { + WRITE_DEBUG("Edge wasn't added in NonConsecutiveEdges mode"); + } + break; + default: + break; + } + // update view + myViewNet->updateViewNet(); + } +} + + +void +GNERouteFrame::hotkeyEnter() { + // first check if current vClass is valid + if (myRouteModeSelector->isValidVehicleClass()) { + // continue dependig of current mode + switch (myRouteModeSelector->getCurrentRouteMode()) { + case RouteMode::CONSECUTIVE_EDGES: + myConsecutiveEdges->onCmdCreateRoute(0, 0, 0); + break; + case RouteMode::NONCONSECUTIVE_EDGES: + myNonConsecutiveEdges->onCmdCreateRoute(0, 0, 0); + break; + default: + break; + } + // update view + myViewNet->updateViewNet(); + } +} + + +void +GNERouteFrame::hotkeyBackSpace() { + // first check if current vClass is valid + if (myRouteModeSelector->isValidVehicleClass()) { + // continue dependig of current mode + switch (myRouteModeSelector->getCurrentRouteMode()) { + case RouteMode::CONSECUTIVE_EDGES: + myConsecutiveEdges->onCmdRemoveLastRouteEdge(0, 0, 0); + break; + case RouteMode::NONCONSECUTIVE_EDGES: + myNonConsecutiveEdges->onCmdRemoveLastRouteEdge(0, 0, 0); + break; + default: + break; + } + // update view + myViewNet->updateViewNet(); + } +} + + +void +GNERouteFrame::hotkeyEsc() { + // first check if current vClass is valid + if (myRouteModeSelector->isValidVehicleClass()) { + // continue dependig of current mode + switch (myRouteModeSelector->getCurrentRouteMode()) { + case RouteMode::CONSECUTIVE_EDGES: + myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + break; + case RouteMode::NONCONSECUTIVE_EDGES: + myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); + break; + default: + break; + } + // update view + myViewNet->updateViewNet(); + } +} + + +void +GNERouteFrame::drawTemporalRoute() const { + // declare a vector with temporal route edges + std::vector temporalRoute; + // obtain temporal route depending of current route mode + switch (myRouteModeSelector->getCurrentRouteMode()) { + case RouteMode::CONSECUTIVE_EDGES: + // convert GNEEdges to NBEdges + temporalRoute.reserve(myConsecutiveEdges->getRouteEdges().size()); + for (const auto& i : myConsecutiveEdges->getRouteEdges()) { + temporalRoute.push_back(i); + } + break; + case RouteMode::NONCONSECUTIVE_EDGES: + temporalRoute = myNonConsecutiveEdges->getTemporalRoute(); + break; + default: + break; + } + // only draw if there is at least two edges + if (temporalRoute.size() > 1) { + // Add a draw matrix + glPushMatrix(); + // Start with the drawing of the area traslating matrix to origin + glTranslated(0, 0, GLO_MAX); + // set orange color + GLHelper::setColor(RGBColor::ORANGE); + // set line width + glLineWidth(5); + // draw first line + GLHelper::drawLine(temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.front(), + temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.back()); + // draw rest of lines + for (int i = 1; i < (int)temporalRoute.size(); i++) { + GLHelper::drawLine(temporalRoute.at(i - 1)->getNBEdge()->getLanes().front().shape.back(), + temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front()); + GLHelper::drawLine(temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front(), + temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.back()); + } + // Pop last matrix + glPopMatrix(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNERouteFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,294 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNERouteFrame.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2016 +/// +// The Widget for create route elements +/****************************************************************************/ +#pragma once + +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNERouteFrame + * The Widget for create route elements + */ +class GNERouteFrame : public GNEFrame { + +public: + + /// @brief route creation modes + enum class RouteMode { + INVALID, // invalid RouteMode + NONCONSECUTIVE_EDGES, // Create route clicking over non consecutive edges + CONSECUTIVE_EDGES // Create route clicking over consecutive edges + }; + + // =========================================================================== + // class RouteModeSelector + // =========================================================================== + + class RouteModeSelector : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNERouteFrame::RouteModeSelector) + + public: + /// @brief constructor + RouteModeSelector(GNERouteFrame* routeFrameParent); + + /// @brief destructor + ~RouteModeSelector(); + + /// @brief get current route mode + const RouteMode& getCurrentRouteMode() const; + + /// @brief get current selected VClass + SUMOVehicleClass getCurrentVehicleClass() const; + + /// @brief check if current VClass is Valid + bool isValidVehicleClass() const; + + /// @brief set current route mode type manually + void setCurrentRouteMode(RouteMode routemode); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user select another route mode in ComboBox + long onCmdSelectRouteMode(FXObject*, FXSelector, void*); + + /// @brief Called when the user select another VClass + long onCmdSelectVClass(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(RouteModeSelector) + + private: + /// @brief pointer to Frame Parent + GNERouteFrame* myRouteFrameParent; + + /// @brief comboBox with the list of route modes + FXComboBox* myRouteModeMatchBox; + + /// @brief comboBox with the list of VClass + FXComboBox* myVClassMatchBox; + + /// @brief current selected route mode + RouteMode myCurrentRouteMode; + + /// @brief current selected VClass + SUMOVehicleClass myCurrentVehicleClass; + + /// @brief flag to check if VClass is Valid + bool myValidVClass; + + /// @brief list of Route modes that will be shown in Match Box + std::vector > myRouteModesStrings; + }; + + // =========================================================================== + // class ConsecutiveEdges + // =========================================================================== + + class ConsecutiveEdges : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNERouteFrame::ConsecutiveEdges) + + public: + /// @brief constructor + ConsecutiveEdges(GNERouteFrame* routeFrameParent); + + /// @brief destructor + ~ConsecutiveEdges(); + + /// @brief show ConsecutiveEdges modul + void showConsecutiveEdgesModul(); + + /// @brief hide ConsecutiveEdges modul + void hideConsecutiveEdgesModul(); + + /// @brief add edge to current route (note: edge must be included in set of candidate edges + bool addEdge(GNEEdge* edge); + + /// @brief refresh edge candidates + void refreshEdgeCandidates(); + + /// @brief clear edges (and restore colors) + void clearEdges(); + + /// @brief get temporal route + const std::vector& getRouteEdges() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press create route button + long onCmdCreateRoute(FXObject*, FXSelector, void*); + + /// @brief Called when the user press create route button + long onCmdAbortRoute(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Remove las inserted edge" + long onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(ConsecutiveEdges) + + /// @brief update InfoRouteLabel + void updateInfoRouteLabel(); + + private: + /// @brief pointer to Frame Parent + GNERouteFrame* myRouteFrameParent; + + /// @brief label with route info + FXLabel* myInfoRouteLabel; + + /// @brief FXButton for create routes + FXButton* myCreateRouteButton; + + /// @bief FXButton for abort creating route + FXButton* myAbortCreationButton; + + /// @brief button for removing last inserted edge + FXButton* myRemoveLastInsertedEdge; + + /// @brief vector with current route edges + std::vector myRouteEdges; + }; + + // =========================================================================== + // class NonConsecutiveEdges + // =========================================================================== + + class NonConsecutiveEdges : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNERouteFrame::NonConsecutiveEdges) + + public: + /// @brief default constructor + NonConsecutiveEdges(GNERouteFrame* routeFrameParent); + + /// @brief destructor + ~NonConsecutiveEdges(); + + /// @brief show NonConsecutiveEdges + void showNonConsecutiveEdgesModul(); + + /// @brief show NonConsecutiveEdges + void hideNonConsecutiveEdgesModul(); + + /// @brief check if from and to edges create a valid route + bool isValid(SUMOVehicleClass vehicleClass) const; + + /// @brief get current selected edgesm + std::vector getSelectedEdges() const; + + /// @brief set edge from (and change color) + bool addEdge(GNEEdge* edge); + + /// @brief clear edges (and restore colors) + void clearEdges(); + + /// @brief get temporal route + const std::vector& getTemporalRoute() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user click over button "Finish route creation" + long onCmdCreateRoute(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Abort route creation" + long onCmdAbortRoute(FXObject*, FXSelector, void*); + + /// @brief Called when the user click over button "Remove las inserted edge" + long onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(NonConsecutiveEdges) + + /// @brief update InfoRouteLabel + void updateInfoRouteLabel(); + + private: + /// @brief pointer to Vehicle Frame Parent + GNERouteFrame* myRouteFrameParent; + + /// @brief label with route info + FXLabel* myInfoRouteLabel; + + /// @brief current selected edges + std::vector mySelectedEdges; + + /// @brief vector with temporal route edges + std::vector myTemporalRoute; + + /// @brief button for finish route creation + FXButton* myFinishCreationButton; + + /// @brief button for abort route creation + FXButton* myAbortCreationButton; + + /// @brief button for removing last inserted edge + FXButton* myRemoveLastInsertedEdge; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNERouteFrame(); + + /// @brief show delete frame + void show(); + + /// @brief hide delete frame + void hide(); + + /// @brief handle edge click + void handleEdgeClick(GNEEdge* clickedEdge); + + /// @brief function called when user press ENTER key + void hotkeyEnter(); + + /// @brief function called when user press BACKSPACE key + void hotkeyBackSpace(); + + /// @brief function called when user press ESC key + void hotkeyEsc(); + + /// @brief draw temporal route + void drawTemporalRoute() const; + +private: + /// @brief route mode selector + RouteModeSelector* myRouteModeSelector; + + /// @brief internal additional attributes + GNEFrameAttributesModuls::AttributesCreator* myRouteAttributes; + + /// @brief Create routes using consecutive edges modul + ConsecutiveEdges* myConsecutiveEdges; + + /// @brief Create routes using non consecutive edges modul + NonConsecutiveEdges* myNonConsecutiveEdges; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,408 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStopFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// The Widget for add Stops elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEStopFrame.h" + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEStopFrame::HelpCreation - methods +// --------------------------------------------------------------------------- + +GNEStopFrame::HelpCreation::HelpCreation(GNEStopFrame* StopFrameParent) : + FXGroupBox(StopFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + myStopFrameParent(StopFrameParent) { + myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); +} + + +GNEStopFrame::HelpCreation::~HelpCreation() {} + + +void +GNEStopFrame::HelpCreation::showHelpCreation() { + // first update help cration + updateHelpCreation(); + // show modul + show(); +} + + +void +GNEStopFrame::HelpCreation::hideHelpCreation() { + hide(); +} + + +void +GNEStopFrame::HelpCreation::updateHelpCreation() { + // 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; + } + // set information label + myInformationLabel->setText(information.str().c_str()); +} + +// --------------------------------------------------------------------------- +// GNEStopFrame - methods +// --------------------------------------------------------------------------- + +GNEStopFrame::GNEStopFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Stops") { + + // Create Stop parent selector + myStopParentSelector = new GNEFrameModuls::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); + + // Create Stop parameters + myStopAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // Create Netedit parameter + myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + + // Create Help Creation Modul + myHelpCreation = new HelpCreation(this); + + // refresh myStopParentMatchBox + myStopParentSelector->refreshDemandElementSelector(); +} + + +GNEStopFrame::~GNEStopFrame() {} + + +void +GNEStopFrame::show() { + // first check if stop frame moduls can be shown + bool validStopParent = false; + // check if at least there an item that supports an stop + for (auto i = myStopParentSelector->getAllowedTags().begin(); (i != myStopParentSelector->getAllowedTags().end()) && (validStopParent == false); i++) { + if (myViewNet->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) { + validStopParent = true; + } + } + // show or hidde moduls depending of validStopParent + if (validStopParent) { + myStopParentSelector->showDemandElementSelector(); + myStopTagSelector->showTagSelector(); + // refresh vType selector + myStopParentSelector->refreshDemandElementSelector(); + // refresh item selector + myStopTagSelector->refreshTagProperties(); + } else { + // hide moduls (except help creation) + myStopParentSelector->hideDemandElementSelector(); + myStopTagSelector->hideTagSelector(); + myStopAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + // show help creation modul + myHelpCreation->showHelpCreation(); + } + // show frame + GNEFrame::show(); +} + + +bool +GNEStopFrame::addStop(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool shiftPressed) { + // check if we're selecting a new stop parent + if (shiftPressed) { + if (objectsUnderCursor.getDemandElementFront() && + (objectsUnderCursor.getDemandElementFront()->getTagProperty().isVehicle() || objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { + myStopParentSelector->setDemandElement(objectsUnderCursor.getDemandElementFront()); + WRITE_WARNING("Selected " + objectsUnderCursor.getDemandElementFront()->getTagStr() + " '" + objectsUnderCursor.getDemandElementFront()->getID() + "' as stop parent."); + return true; + } else { + WRITE_WARNING("Selected Stop parent isn't valid."); + return false; + } + + } else { + // now check if stop parent selector is valid + if (myStopParentSelector->getCurrentDemandElement() == nullptr) { + WRITE_WARNING("Current selected Stop parent isn't valid."); + return false; + } + // declare a Stop + SUMOVehicleParameter::Stop stopParameter; + // check if stop parameters was sucesfully obtained + if (getStopParameter(stopParameter, myStopTagSelector->getCurrentTagProperties().getTag(), + myViewNet, myStopAttributes, myNeteditAttributes, + objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront())) { + // create it in RouteFrame + GNERouteHandler::buildStop(myViewNet->getNet(), true, stopParameter, myStopParentSelector->getCurrentDemandElement()); + // stop sucesfully created, then return true + return true; + } else { + return false; + } + } +} + +bool +GNEStopFrame::getStopParameter(SUMOVehicleParameter::Stop& stop, const SumoXMLTag stopTag, GNEViewNet* viewNet, + GNEFrameAttributesModuls::AttributesCreator* stopAttributes, + const GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes, + const GNELane* lane, const GNEAdditional* stoppingPlace) { + // first check that current selected Stop is valid + if (stopTag == SUMO_TAG_NOTHING) { + WRITE_WARNING("Current selected Stop type isn't valid."); + return false; + } else if ((stopTag == SUMO_TAG_STOP_LANE) || (stopTag == SUMO_TAG_PERSONSTOP_LANE)) { + if (lane) { + stop.lane = lane->getID(); + } else { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_LANE) + " to create a stop placed in a " + toString(SUMO_TAG_LANE)); + return false; + } + } else if (stoppingPlace) { + if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) { + if ((stopTag != SUMO_TAG_STOP_BUSSTOP) && (stopTag != SUMO_TAG_PERSONSTOP_BUSSTOP)) { + WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); + return false; + } else { + stop.busstop = stoppingPlace->getID(); + stop.startPos = 0; + stop.endPos = 0; + } + } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CONTAINER_STOP) { + if (stopTag != SUMO_TAG_STOP_CONTAINERSTOP) { + WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); + return false; + } else { + stop.containerstop = stoppingPlace->getID(); + stop.startPos = 0; + stop.endPos = 0; + } + } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CHARGING_STATION) { + if (stopTag != SUMO_TAG_STOP_CHARGINGSTATION) { + WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); + return false; + } else { + stop.chargingStation = stoppingPlace->getID(); + stop.startPos = 0; + stop.endPos = 0; + } + } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) { + if (stopTag != SUMO_TAG_STOP_PARKINGAREA) { + WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); + return false; + } else { + stop.parkingarea = stoppingPlace->getID(); + stop.startPos = 0; + stop.endPos = 0; + } + } + } else { + if (stopTag == SUMO_TAG_STOP_BUSSTOP) { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_STOP_BUSSTOP) + " to create a stop placed in a " + toString(SUMO_TAG_STOP_BUSSTOP)); + } else if (stopTag == SUMO_TAG_STOP_CONTAINERSTOP) { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_CONTAINER_STOP) + " to create a stop placed in a " + toString(SUMO_TAG_CONTAINER_STOP)); + } else if (stopTag == SUMO_TAG_CHARGING_STATION) { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_CHARGING_STATION) + " to create a stop placed in a " + toString(SUMO_TAG_CHARGING_STATION)); + } else if (stopTag == SUMO_TAG_STOP_PARKINGAREA) { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_PARKING_AREA) + " to create a stop placed in a " + toString(SUMO_TAG_PARKING_AREA)); + } else if (stopTag == SUMO_TAG_PERSONTRIP_BUSSTOP) { + WRITE_WARNING("Click over a " + toString(SUMO_TAG_STOP_BUSSTOP) + " to create a person stop placed in a " + toString(SUMO_TAG_STOP_BUSSTOP)); + } + return false; + } + // check if stop attributes are valid + if (!stopAttributes->areValuesValid()) { + stopAttributes->showWarningMessage(); + return false; + } + // declare map to keep attributes from Frames from Frame + std::map valuesMap = stopAttributes->getAttributesAndValues(false); + // generate ID + valuesMap[SUMO_ATTR_ID] = viewNet->getNet()->generateDemandElementID("", stopTag); + // add netedit values + if (!stop.lane.empty()) { + myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, lane); + // check if start position can be parsed + if (GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_STARTPOS])) { + stop.startPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_STARTPOS]); + stop.parametersSet |= STOP_START_SET; + } + // check if end position can be parsed + if (GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_ENDPOS])) { + stop.endPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ENDPOS]); + stop.parametersSet |= STOP_END_SET; + } + } + // obtain friendly position + if (valuesMap.count(SUMO_ATTR_FRIENDLY_POS) > 0) { + stop.friendlyPos = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_FRIENDLY_POS)); + } + // obtain actType + if (valuesMap.count(SUMO_ATTR_ACTTYPE) > 0) { + stop.actType = valuesMap.at(SUMO_ATTR_ACTTYPE); + } + // fill rest of parameters depending if it was edited + if (valuesMap.count(SUMO_ATTR_DURATION) > 0) { + stop.duration = string2time(valuesMap.at(SUMO_ATTR_DURATION)); + stop.parametersSet |= STOP_DURATION_SET; + } else { + stop.duration = -1; + stop.parametersSet &= ~STOP_DURATION_SET; + } + if (valuesMap.count(SUMO_ATTR_UNTIL) > 0) { + stop.until = string2time(valuesMap[SUMO_ATTR_UNTIL]); + stop.parametersSet |= STOP_UNTIL_SET; + } else { + stop.until = -1; + stop.parametersSet &= ~STOP_UNTIL_SET; + } + if (valuesMap.count(SUMO_ATTR_EXTENSION) > 0) { + stop.extension = string2time(valuesMap.at(SUMO_ATTR_EXTENSION)); + stop.parametersSet |= STOP_EXTENSION_SET; + } + if (valuesMap.count(SUMO_ATTR_TRIGGERED) > 0) { + stop.triggered = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_TRIGGERED)); + stop.parametersSet |= STOP_TRIGGER_SET; + } + if (valuesMap.count(SUMO_ATTR_CONTAINER_TRIGGERED) > 0) { + stop.containerTriggered = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_CONTAINER_TRIGGERED)); + stop.parametersSet |= STOP_CONTAINER_TRIGGER_SET; + } + if (valuesMap.count(SUMO_ATTR_PARKING) > 0) { + stop.parking = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_PARKING)); + stop.parametersSet |= STOP_PARKING_SET; + } + if (valuesMap.count(SUMO_ATTR_EXPECTED) > 0) { + stop.awaitedPersons = GNEAttributeCarrier::parse >(valuesMap.at(SUMO_ATTR_EXPECTED)); + stop.parametersSet |= STOP_EXPECTED_SET; + } + if (valuesMap.count(SUMO_ATTR_EXPECTED_CONTAINERS) > 0) { + stop.awaitedContainers = GNEAttributeCarrier::parse >(valuesMap.at(SUMO_ATTR_EXPECTED_CONTAINERS)); + stop.parametersSet |= STOP_EXPECTED_CONTAINERS_SET; + } + if (valuesMap.count(SUMO_ATTR_TRIP_ID) > 0) { + stop.tripId = valuesMap.at(SUMO_ATTR_TRIP_ID); + stop.parametersSet |= STOP_TRIP_ID_SET; + } + if (valuesMap.count(SUMO_ATTR_INDEX) > 0) { + if (valuesMap[SUMO_ATTR_INDEX] == "fit") { + stop.index = STOP_INDEX_FIT; + } else if (valuesMap[SUMO_ATTR_INDEX] == "end") { + stop.index = STOP_INDEX_END; + } else { + stop.index = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_INDEX]); + } + } else { + stop.index = STOP_INDEX_END; + } + // refresh stop attributes + stopAttributes->refreshRows(); + // all ok, then return true + return true; +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEStopFrame::tagSelected() { + if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // show Stop type selector modul + myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); + myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); + myHelpCreation->showHelpCreation(); + } else { + // hide all moduls if stop parent isn't valid + myStopAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myHelpCreation->hideHelpCreation(); + } +} + + +void +GNEStopFrame::demandElementSelected() { + // show or hidde moduls depending if current selected stop parent is valid + if (myStopParentSelector->getCurrentDemandElement()) { + myStopTagSelector->showTagSelector(); + if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // show moduls + myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); + myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); + myHelpCreation->showHelpCreation(); + } else { + myStopAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myHelpCreation->hideHelpCreation(); + } + } else { + // hide moduls + myStopTagSelector->hideTagSelector(); + myStopAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myHelpCreation->hideHelpCreation(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEStopFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,112 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEStopFrame.h +/// @author Pablo Alvarez Lopez +/// @date March 2019 +/// +// The Widget for add Stops elements +/****************************************************************************/ +#pragma once + +#include +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEStopFrame + */ +class GNEStopFrame : public GNEFrame { + +public: + + // =========================================================================== + // class HelpCreation + // =========================================================================== + + class HelpCreation : protected FXGroupBox { + + public: + /// @brief constructor + HelpCreation(GNEStopFrame* StopFrameParent); + + /// @brief destructor + ~HelpCreation(); + + /// @brief show HelpCreation + void showHelpCreation(); + + /// @brief hide HelpCreation + void hideHelpCreation(); + + /// @brief update HelpCreation + void updateHelpCreation(); + + private: + /// @brief pointer to Stop Frame Parent + GNEStopFrame* myStopFrameParent; + + /// @brief Label with creation information + FXLabel* myInformationLabel; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEStopFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEStopFrame(); + + /// @brief show Frame + void show(); + + /**@brief add Stop element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @param shiftPressed flag to check if during clicking shift key was pressed + * @return true if Stop was sucesfully added + */ + bool addStop(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool shiftPressed); + + /// @brief get stop parameters + static bool getStopParameter(SUMOVehicleParameter::Stop& stop, const SumoXMLTag stopTag, GNEViewNet* viewNet, + GNEFrameAttributesModuls::AttributesCreator* stopAttributes, + const GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes, + const GNELane* lane, const GNEAdditional* stoppingPlace); + +protected: + /// @brief Tag selected in TagSelector + void tagSelected(); + + /// @brief selected demand element in DemandElementSelector + void demandElementSelected(); + +private: + /// @brief Stop parent selectors + GNEFrameModuls::DemandElementSelector* myStopParentSelector; + + /// @brief stop tag selector selector (used to select diffent kind of Stops) + GNEFrameModuls::TagSelector* myStopTagSelector; + + /// @brief internal Stop attributes + GNEFrameAttributesModuls::AttributesCreator* myStopAttributes; + + /// @brief Netedit parameter + GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + + /// @brief Help creation + HelpCreation* myHelpCreation; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,350 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVehicleFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Jan 2018 +/// +// The Widget for add Vehicles/Flows/Trips/etc. elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEVehicleFrame.h" + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEVehicleFrame::HelpCreation - methods +// --------------------------------------------------------------------------- + +GNEVehicleFrame::HelpCreation::HelpCreation(GNEVehicleFrame* vehicleFrameParent) : + FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), + myVehicleFrameParent(vehicleFrameParent) { + myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); +} + + +GNEVehicleFrame::HelpCreation::~HelpCreation() {} + + +void +GNEVehicleFrame::HelpCreation::showHelpCreation() { + // first update help cration + updateHelpCreation(); + // show modul + show(); +} + + +void +GNEVehicleFrame::HelpCreation::hideHelpCreation() { + hide(); +} + +void +GNEVehicleFrame::HelpCreation::updateHelpCreation() { + // create information label + std::ostringstream information; + // set text depending of selected vehicle type + switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTagProperties().getTag()) { + case SUMO_TAG_VEHICLE: + information + << "- Click over a route to\n" + << " create a vehicle."; + break; + case SUMO_TAG_TRIP: + information + << "- Select two edges to\n" + << " create a Trip."; + break; + case SUMO_TAG_ROUTEFLOW: + information + << "- Click over a route to\n" + << " create a routeFlow."; + break; + case SUMO_TAG_FLOW: + information + << "- Select two edges to\n" + << " create a flow."; + break; + default: + break; + } + // set information label + myInformationLabel->setText(information.str().c_str()); +} + +// --------------------------------------------------------------------------- +// GNEVehicleFrame - methods +// --------------------------------------------------------------------------- + +GNEVehicleFrame::GNEVehicleFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Vehicles") { + + // Create item Selector modul for vehicles + myVehicleTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::VEHICLE); + + // Create vehicle type selector + myVTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_VTYPE); + + // Create vehicle parameters + myVehicleAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // create EdgePathCreator Modul + myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::Modes::FROM_TO_VIA); + + // Create Help Creation Modul + myHelpCreation = new HelpCreation(this); + + // set Vehicle as default vehicle + myVehicleTagSelector->setCurrentTag(SUMO_TAG_VEHICLE); +} + + +GNEVehicleFrame::~GNEVehicleFrame() {} + + +void +GNEVehicleFrame::show() { + // refresh item selector + myVehicleTagSelector->refreshTagProperties(); + // show frame + GNEFrame::show(); +} + + +bool +GNEVehicleFrame::addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // obtain tag (only for improve code legibility) + SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); + // 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) { + myViewNet->setStatusBarText("Current selected vehicle type isn't valid."); + return false; + } + // now check if parameters are valid + if (!myVehicleAttributes->areValuesValid()) { + myVehicleAttributes->showWarningMessage(); + return false; + } + // Declare map to keep attributes from Frames from Frame + std::map valuesMap = myVehicleAttributes->getAttributesAndValues(false); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", vehicleTag); + } + // add VType + valuesMap[SUMO_ATTR_TYPE] = myVTypeSelector->getCurrentDemandElement()->getID(); + // set route or edges depending of vehicle type + if ((vehicleTag == SUMO_TAG_VEHICLE) || (vehicleTag == SUMO_TAG_ROUTEFLOW)) { + if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront()->getTagProperty().isRoute())) { + // obtain route + valuesMap[SUMO_ATTR_ROUTE] = (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) ? objectsUnderCursor.getDemandElementFront()->getID() : "embedded"; + // check if departLane is valid + if ((objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) && + (valuesMap.count(SUMO_ATTR_DEPARTLANE) > 0) && GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_DEPARTLANE])) { + double departLane = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_DEPARTLANE]); + if (departLane >= objectsUnderCursor.getDemandElementFront()->getParentEdges().front()->getLanes().size()) { + myViewNet->setStatusBarText("Invalid " + toString(SUMO_ATTR_DEPARTLANE)); + return false; + } + } + // check if departSpeed is valid + if ((valuesMap.count(SUMO_ATTR_DEPARTSPEED) > 0) && GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_DEPARTSPEED])) { + double departSpeed = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_DEPARTSPEED]); + if (departSpeed >= myVTypeSelector->getCurrentDemandElement()->getAttributeDouble(SUMO_ATTR_MAXSPEED)) { + myViewNet->setStatusBarText("Invalid " + toString(SUMO_ATTR_DEPARTSPEED)); + return false; + } + } + // check if we're creating a vehicle or a flow + if (vehicleTag == SUMO_TAG_VEHICLE) { + // Add parameter departure + if (valuesMap[SUMO_ATTR_DEPART].empty()) { + valuesMap[SUMO_ATTR_DEPART] = "0"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); + // obtain vehicle parameters in vehicleParameters + SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false); + // check if vehicle was sucesfully created) + if (vehicleParameters) { + // check if we're creating a vehicle over a existent route or over a embedded route + if (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) { + GNERouteHandler::buildVehicleOverRoute(myViewNet->getNet(), true, *vehicleParameters); + } else { + GNERouteHandler::buildVehicleWithEmbeddedRoute(myViewNet->getNet(), true, *vehicleParameters, objectsUnderCursor.getDemandElementFront()); + } + // delete vehicleParameters + delete vehicleParameters; + } + } else { + // set begin and end attributes + if (valuesMap[SUMO_ATTR_BEGIN].empty()) { + valuesMap[SUMO_ATTR_BEGIN] = "0"; + } + if (valuesMap[SUMO_ATTR_END].empty()) { + valuesMap[SUMO_ATTR_END] = "3600"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); + // obtain routeFlow parameters in routeFlowParameters + SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX); + // check if flow was sucesfully created) + if (routeFlowParameters) { + // check if we're creating a vehicle over a existent route or over a embedded route + if (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) { + GNERouteHandler::buildFlowOverRoute(myViewNet->getNet(), true, *routeFlowParameters); + } else { + GNERouteHandler::buildFlowWithEmbeddedRoute(myViewNet->getNet(), true, *routeFlowParameters, objectsUnderCursor.getDemandElementFront()); + } + // delete routeFlowParameters + delete routeFlowParameters; + } + } + // refresh myVehicleAttributes + myVehicleAttributes->refreshRows(); + // all ok, then return true; + return true; + } else { + myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route."); + return false; + } + } else if (((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == SUMO_TAG_FLOW)) && objectsUnderCursor.getEdgeFront()) { + // add clicked edge in EdgePathCreator + return myEdgePathCreator->addPathEdge(objectsUnderCursor.getEdgeFront()); + } else { + return false; + } +} + + +GNEFrameModuls::EdgePathCreator* +GNEVehicleFrame::getEdgePathCreator() const { + return myEdgePathCreator; +} + +// =========================================================================== +// protected +// =========================================================================== + +void +GNEVehicleFrame::tagSelected() { + if (myVehicleTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // show vehicle type selector modul + myVTypeSelector->showDemandElementSelector(); + // show AutoRute creator if we're editing a trip + if ((myVehicleTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_TRIP) || + (myVehicleTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_FLOW)) { + myEdgePathCreator->showEdgePathCreator(); + } else { + myEdgePathCreator->hideEdgePathCreator(); + } + } else { + // hide all moduls if vehicle isn't valid + myVTypeSelector->hideDemandElementSelector(); + myVehicleAttributes->hideAttributesCreatorModul(); + myHelpCreation->hideHelpCreation(); + } +} + + +void +GNEVehicleFrame::demandElementSelected() { + if (myVTypeSelector->getCurrentDemandElement()) { + // show vehicle attributes modul + myVehicleAttributes->showAttributesCreatorModul(myVehicleTagSelector->getCurrentTagProperties(), {}); + // set current VTypeClass in TripCreator + myEdgePathCreator->setVClass(myVTypeSelector->getCurrentDemandElement()->getVClass()); + // show help creation + myHelpCreation->showHelpCreation(); + } else { + // hide all moduls if selected item isn't valid + myVehicleAttributes->hideAttributesCreatorModul(); + // hide help creation + myHelpCreation->hideHelpCreation(); + + } +} + + +void +GNEVehicleFrame::edgePathCreated() { + // first check that we have at least two edges + if (myEdgePathCreator->getClickedEdges().size() > 1) { + // obtain tag (only for improve code legibility) + SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); + // Declare map to keep attributes from Frames from Frame + std::map valuesMap = myVehicleAttributes->getAttributesAndValues(false); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", vehicleTag); + } + // add VType + valuesMap[SUMO_ATTR_TYPE] = myVTypeSelector->getCurrentDemandElement()->getID(); + // extract via attribute + std::vector viaEdges; + for (int i = 1; i < ((int)myEdgePathCreator->getClickedEdges().size() - 1); i++) { + viaEdges.push_back(myEdgePathCreator->getClickedEdges().at(i)); + } + // check if we're creating a trip or flow + if (vehicleTag == SUMO_TAG_TRIP) { + // Add parameter departure + if (valuesMap[SUMO_ATTR_DEPART].empty()) { + valuesMap[SUMO_ATTR_DEPART] = "0"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); + // obtain trip parameters + SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false); + // build trip in GNERouteHandler + GNERouteHandler::buildTrip(myViewNet->getNet(), true, *tripParameters, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), viaEdges); + // delete tripParameters + delete tripParameters; + } else { + // set begin and end attributes + if (valuesMap[SUMO_ATTR_BEGIN].empty()) { + valuesMap[SUMO_ATTR_BEGIN] = "0"; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); + // obtain flow parameters + SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX); + // build flow in GNERouteHandler + GNERouteHandler::buildFlow(myViewNet->getNet(), true, *flowParameters, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), viaEdges); + // delete flowParameters + delete flowParameters; + } + // refresh myVehicleAttributes + myVehicleAttributes->refreshRows(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,111 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEVehicleFrame.h +/// @author Pablo Alvarez Lopez +/// @date Jan 2018 +/// +// The Widget for add Vehicles/Flows/Trips/etc. elements +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEVehicleFrame + */ +class GNEVehicleFrame : public GNEFrame { + +public: + + // =========================================================================== + // class HelpCreation + // =========================================================================== + + class HelpCreation : protected FXGroupBox { + + public: + /// @brief constructor + HelpCreation(GNEVehicleFrame* vehicleFrameParent); + + /// @brief destructor + ~HelpCreation(); + + /// @brief show HelpCreation + void showHelpCreation(); + + /// @brief hide HelpCreation + void hideHelpCreation(); + + /// @brief update HelpCreation + void updateHelpCreation(); + + private: + /// @brief pointer to Vehicle Frame Parent + GNEVehicleFrame* myVehicleFrameParent; + + /// @brief Label with creation information + FXLabel* myInformationLabel; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEVehicleFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEVehicleFrame(); + + /// @brief show Frame + void show(); + + /**@brief add vehicle element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if vehicle was sucesfully added + */ + bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief get EdgePathCreator modul + GNEFrameModuls::EdgePathCreator* getEdgePathCreator() const; + +protected: + /// @brief Tag selected in TagSelector + void tagSelected(); + + /// @brief selected vehicle type in DemandElementSelector + void demandElementSelected(); + + /// @brief finish edge path creation + void edgePathCreated(); + +private: + /// @brief vehicle tag selector (used to select diffent kind of vehicles) + GNEFrameModuls::TagSelector* myVehicleTagSelector; + + /// @brief Vehicle Type selectors + GNEFrameModuls::DemandElementSelector* myVTypeSelector; + + /// @brief internal vehicle attributes + GNEFrameAttributesModuls::AttributesCreator* myVehicleAttributes; + + /// @brief edge path creator (used for trips and flows) + GNEFrameModuls::EdgePathCreator* myEdgePathCreator; + + /// @brief Help creation + HelpCreation* myHelpCreation; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,430 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if ((i.first != DEFAULT_VTYPE_ID) && (i.first != DEFAULT_BIKETYPE_ID)) { + myTypeMatchBox->appendItem(i.first.c_str()); + } + } + // set DEFAULT_VEHTYPE as default VType + myCurrentVehicleType = myVehicleTypeFrameParent->getViewNet()->getNet()->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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if ((i.first != DEFAULT_VTYPE_ID) && (i.first != DEFAULT_BIKETYPE_ID)) { + myTypeMatchBox->appendItem(i.first.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() == 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()->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(); + // show Attribute Editor modul if selected item is valid + myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul({myCurrentVehicleType}, 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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE)) { + if (i.first == myTypeMatchBox->getText().text()) { + // set pointer + myCurrentVehicleType = i.second; + // set color of myTypeMatchBox to black (valid) + myTypeMatchBox->setTextColor(FXRGB(0, 0, 0)); + // refresh vehicle type editor modul + myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); + // show moduls if selected item is valid + myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul({myCurrentVehicleType}, 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 + std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->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()->p_begin("create vehicle type"); + myVehicleTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(vehicleType, true), true); + myVehicleTypeFrameParent->myViewNet->getUndoList()->p_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()->p_begin("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()->p_end(); + } + } else { + // begin undo list operation + myVehicleTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_end(); + } + return 1; +} + + +long +GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType(FXObject*, FXSelector, void*) { + // begin reset default vehicle type values + myVehicleTypeFrameParent->getViewNet()->getUndoList()->p_begin("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()->p_end(); + // refresh VehicleTypeSelector + myVehicleTypeFrameParent->myVehicleTypeSelector->refreshVehicleTypeSelector(); + return 1; +} + + +long +GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCopyVehicleType(FXObject*, FXSelector, void*) { + // obtain a new valid Vehicle Type ID + std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->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()->p_begin("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()->p_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()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)); +} + + +GNEVehicleTypeFrame::~GNEVehicleTypeFrame() {} + + +void +GNEVehicleTypeFrame::show() { + // refresh vehicle type and Attribute Editor + myVehicleTypeSelector->refreshVehicleTypeSelector(); + // show vehicle type attributes editor (except extended attributes) + myVehicleTypeAttributesEditor->showAttributeEditorModul({myVehicleTypeSelector->getCurrentVehicleType()}, 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); + // call "showAttributeEditorModul" to refresh attribute list + myVehicleTypeAttributesEditor->showAttributeEditorModul({myVehicleTypeSelector->getCurrentVehicleType()}, false, true); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/demand/GNEVehicleTypeFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,180 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 + +// =========================================================================== +// 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 elements type + 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.5.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1021 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditionalFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// The Widget for add additional elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEAdditionalFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEAdditionalFrame::SelectorParentLanes) ConsecutiveLaneSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_STOPSELECTION, GNEAdditionalFrame::SelectorParentLanes::onCmdStopSelection), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_ABORTSELECTION, GNEAdditionalFrame::SelectorParentLanes::onCmdAbortSelection), -}; - -FXDEFMAP(GNEAdditionalFrame::SelectorChildEdges) SelectorParentEdgesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNEAdditionalFrame::SelectorChildEdges::onCmdUseSelectedEdges), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNEAdditionalFrame::SelectorChildEdges::onCmdClearSelection), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNEAdditionalFrame::SelectorChildEdges::onCmdInvertSelection), - FXMAPFUNC(SEL_CHANGED, MID_GNE_ADDITIONALFRAME_SEARCH, GNEAdditionalFrame::SelectorChildEdges::onCmdTypeInSearchBox), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_SELECT, GNEAdditionalFrame::SelectorChildEdges::onCmdSelectEdge), -}; - -FXDEFMAP(GNEAdditionalFrame::SelectorChildLanes) SelectorParentLanesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNEAdditionalFrame::SelectorChildLanes::onCmdUseSelectedLanes), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNEAdditionalFrame::SelectorChildLanes::onCmdClearSelection), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNEAdditionalFrame::SelectorChildLanes::onCmdInvertSelection), - FXMAPFUNC(SEL_CHANGED, MID_GNE_ADDITIONALFRAME_SEARCH, GNEAdditionalFrame::SelectorChildLanes::onCmdTypeInSearchBox), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_SELECT, GNEAdditionalFrame::SelectorChildLanes::onCmdSelectLane), -}; - -// Object implementation -FXIMPLEMENT(GNEAdditionalFrame::SelectorParentLanes, FXGroupBox, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap)) -FXIMPLEMENT(GNEAdditionalFrame::SelectorChildEdges, FXGroupBox, SelectorParentEdgesMap, ARRAYNUMBER(SelectorParentEdgesMap)) -FXIMPLEMENT(GNEAdditionalFrame::SelectorChildLanes, FXGroupBox, SelectorParentLanesMap, ARRAYNUMBER(SelectorParentLanesMap)) - - -// --------------------------------------------------------------------------- -// GNEAdditionalFrame::SelectorParentLanes - methods -// --------------------------------------------------------------------------- - -GNEAdditionalFrame::SelectorParentLanes::SelectorParentLanes(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Lane Selector", GUIDesignGroupBoxFrame), - 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); - // disable stop and abort functions as init - myStopSelectingButton->disable(); - myAbortSelectingButton->disable(); - // define colors - myCandidateLaneColor = RGBColor(0, 64, 0, 255); - mySelectedLaneColor = RGBColor::GREEN; -} - - -GNEAdditionalFrame::SelectorParentLanes::~SelectorParentLanes() {} - - -void -GNEAdditionalFrame::SelectorParentLanes::showSelectorParentLanesModul() { - // abort current selection before show - abortConsecutiveLaneSelector(); - // show FXGroupBox - FXGroupBox::show(); -} - - -void -GNEAdditionalFrame::SelectorParentLanes::hideSelectorParentLanesModul() { - // abort current selection before hide - abortConsecutiveLaneSelector(); - // hide FXGroupBox - FXGroupBox::hide(); -} - - -void -GNEAdditionalFrame::SelectorParentLanes::startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition) { - // Only start selection if SelectorParentLanes modul is shown - if (shown()) { - // change buttons - myStopSelectingButton->enable(); - myAbortSelectingButton->enable(); - // add lane - addSelectedLane(lane, clickedPosition); - } -} - - -bool -GNEAdditionalFrame::SelectorParentLanes::stopConsecutiveLaneSelector() { - // obtain tagproperty (only for improve code legibility) - const auto& tagValues = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties(); - // abort if there isn't at least two lanes - if (mySelectedLanes.size() < 2) { - WRITE_WARNING(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + " requires at least two lanes."); - // abort consecutive lane selector - abortConsecutiveLaneSelector(); - return false; - } - // Declare map to keep attributes from Frames from Frame - std::map valuesMap = myAdditionalFrameParent->myAdditionalAttributes->getAttributesAndValues(true); - // fill valuesOfElement with Netedit attributes from Frame - myAdditionalFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myAdditionalFrameParent->generateID(nullptr); - } - // obtain lane IDs - std::vector laneIDs; - for (auto i : mySelectedLanes) { - laneIDs.push_back(i.first->getID()); - } - valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " "); - // Obtain clicked position over first lane - valuesMap[SUMO_ATTR_POSITION] = toString(mySelectedLanes.front().second); - // Obtain clicked position over last lane - valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectedLanes.back().second); - // parse common attributes - if (!myAdditionalFrameParent->buildAdditionalCommonAttributes(valuesMap, tagValues)) { - return false; - } - // show warning dialogbox and stop check if input parameters are valid - if (myAdditionalFrameParent->myAdditionalAttributes->areValuesValid() == false) { - myAdditionalFrameParent->myAdditionalAttributes->showWarningMessage(); - return false; - } else { - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, myAdditionalFrameParent->getPredefinedTagsMML(), toString(tagValues.getTag())); - // try to build additional - if (GNEAdditionalHandler::buildAdditional(myAdditionalFrameParent->myViewNet, true, myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { - // abort consecutive lane selector - abortConsecutiveLaneSelector(); - // refresh additional attributes - myAdditionalFrameParent->myAdditionalAttributes->refreshRows(); - return true; - } else { - return false; - } - } -} - - -void -GNEAdditionalFrame::SelectorParentLanes::abortConsecutiveLaneSelector() { - // reset color of all candidate lanes - for (auto i : myCandidateLanes) { - i->setSpecialColor(nullptr); - } - // clear candidate colors - myCandidateLanes.clear(); - // reset color of all selected lanes - for (auto i : mySelectedLanes) { - i.first->setSpecialColor(nullptr); - } - // clear selected lanes - mySelectedLanes.clear(); - // disable buttons - myStopSelectingButton->disable(); - myAbortSelectingButton->disable(); - // update view (due colors) - myAdditionalFrameParent->getViewNet()->update(); -} - - -bool -GNEAdditionalFrame::SelectorParentLanes::addSelectedLane(GNELane* lane, const Position& clickedPosition) { - // first check that lane exist - if (lane == nullptr) { - return false; - } - // check that lane wasn't already selected - for (auto i : mySelectedLanes) { - if (i.first == lane) { - WRITE_WARNING("Duplicated lanes aren't allowed"); - return false; - } - } - // check that there is candidate lanes - if (mySelectedLanes.size() > 0) { - if (myCandidateLanes.empty()) { - WRITE_WARNING("Only candidate lanes are allowed"); - return false; - } else if ((myCandidateLanes.size() > 0) && (std::find(myCandidateLanes.begin(), myCandidateLanes.end(), lane) == myCandidateLanes.end())) { - WRITE_WARNING("Only consecutive lanes are allowed"); - return false; - } - } - // select lane and save the clicked position - mySelectedLanes.push_back(std::make_pair(lane, lane->getLaneShape().nearest_offset_to_point2D(clickedPosition) / lane->getLengthGeometryFactor())); - // change color of selected lane - lane->setSpecialColor(&mySelectedLaneColor); - // restore original color of candidates (except already selected) - for (auto i : myCandidateLanes) { - if (!isLaneSelected(i)) { - i->setSpecialColor(nullptr); - } - } - // clear candidate lanes - myCandidateLanes.clear(); - // fill candidate lanes - for (auto i : lane->getParentEdge()->getGNEConnections()) { - // check that possible candidate lane isn't already selected - if ((lane == i->getLaneFrom()) && (!isLaneSelected(i->getLaneTo()))) { - // set candidate lane - i->getLaneTo()->setSpecialColor(&myCandidateLaneColor); - myCandidateLanes.push_back(i->getLaneTo()); - } - } - // update view (due colors) - myAdditionalFrameParent->getViewNet()->update(); - return true; -} - - -void -GNEAdditionalFrame::SelectorParentLanes::removeLastSelectedLane() { - if (mySelectedLanes.size() > 1) { - mySelectedLanes.pop_back(); - } else { - WRITE_WARNING("First lane cannot be removed"); - } -} - - -bool -GNEAdditionalFrame::SelectorParentLanes::isSelectingLanes() const { - return myStopSelectingButton->isEnabled(); -} - - -bool -GNEAdditionalFrame::SelectorParentLanes::isShown() const { - return shown(); -} - - -const RGBColor& -GNEAdditionalFrame::SelectorParentLanes::getSelectedLaneColor() const { - return mySelectedLaneColor; -} - - -const std::vector >& -GNEAdditionalFrame::SelectorParentLanes::getSelectedLanes() const { - return mySelectedLanes; -} - - -long -GNEAdditionalFrame::SelectorParentLanes::onCmdStopSelection(FXObject*, FXSelector, void*) { - stopConsecutiveLaneSelector(); - return 0; -} - - -long -GNEAdditionalFrame::SelectorParentLanes::onCmdAbortSelection(FXObject*, FXSelector, void*) { - abortConsecutiveLaneSelector(); - return 0; -} - - -bool -GNEAdditionalFrame::SelectorParentLanes::isLaneSelected(GNELane* lane) const { - for (auto i : mySelectedLanes) { - if (i.first == lane) { - return true; - } - } - return false; -} - -// --------------------------------------------------------------------------- -// GNEAdditionalFrame::SelectorChildEdges - methods -// --------------------------------------------------------------------------- - -GNEAdditionalFrame::SelectorChildEdges::SelectorChildEdges(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), - 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); - - // Create search box - myEdgesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); - - // Create list - myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); - - // Create horizontal frame - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - - // Create button for clear selection - myClearEdgesSelection = new FXButton(buttonsFrame, "Clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); - - // Create button for invert selection - myInvertEdgesSelection = new FXButton(buttonsFrame, "Invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); - - // Hide List - hideSelectorChildEdgesModul(); -} - - -GNEAdditionalFrame::SelectorChildEdges::~SelectorChildEdges() {} - - -std::string -GNEAdditionalFrame::SelectorChildEdges::getEdgeIdsSelected() const { - std::vector vectorOfIds; - if (myUseSelectedEdgesCheckButton->getCheck()) { - // get Selected edges - std::vector selectedEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true); - // Iterate over selectedEdges and getId - for (auto i : selectedEdges) { - vectorOfIds.push_back(i->getID()); - } - } else { - // Obtain Id's of list - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->isItemSelected(i)) { - vectorOfIds.push_back(myList->getItem(i)->getText().text()); - } - } - } - return joinToString(vectorOfIds, " "); -} - - -void -GNEAdditionalFrame::SelectorChildEdges::showSelectorChildEdgesModul(std::string search) { - // clear list of egdge ids - myList->clearItems(); - // get all edges of net - /// @todo this function must be improved. - std::vector vectorOfEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(false); - // iterate over edges of net - for (auto i : vectorOfEdges) { - // If search criterium is correct, then append ittem - if (i->getID().find(search) != std::string::npos) { - myList->appendItem(i->getID().c_str()); - } - } - // By default, CheckBox for useSelectedEdges isn't checked - myUseSelectedEdgesCheckButton->setCheck(false); - // Recalc Frame - recalc(); - // Update Frame - update(); - // Show dialog - show(); -} - - -void -GNEAdditionalFrame::SelectorChildEdges::hideSelectorChildEdgesModul() { - FXGroupBox::hide(); -} - - -void -GNEAdditionalFrame::SelectorChildEdges::updateUseSelectedEdges() { - // Enable or disable use selected edges - if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true).size() > 0) { - myUseSelectedEdgesCheckButton->enable(); - } else { - myUseSelectedEdgesCheckButton->disable(); - } -} - - -long -GNEAdditionalFrame::SelectorChildEdges::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { - if (myUseSelectedEdgesCheckButton->getCheck()) { - myEdgesSearch->hide(); - myList->hide(); - myClearEdgesSelection->hide(); - myInvertEdgesSelection->hide(); - } else { - myEdgesSearch->show(); - myList->show(); - myClearEdgesSelection->show(); - myInvertEdgesSelection->show(); - } - // Recalc Frame - recalc(); - // Update Frame - update(); - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildEdges::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { - // Show only Id's of SelectorChildEdges that contains the searched string - showSelectorChildEdgesModul(myEdgesSearch->getText().text()); - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildEdges::onCmdSelectEdge(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildEdges::onCmdClearSelection(FXObject*, FXSelector, void*) { - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->getItem(i)->isSelected()) { - myList->deselectItem(i); - } - } - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildEdges::onCmdInvertSelection(FXObject*, FXSelector, void*) { - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->getItem(i)->isSelected()) { - myList->deselectItem(i); - } else { - myList->selectItem(i); - } - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEAdditionalFrame::SelectorChildLanes - methods -// --------------------------------------------------------------------------- - -GNEAdditionalFrame::SelectorChildLanes::SelectorChildLanes(GNEAdditionalFrame* additionalFrameParent) : - FXGroupBox(additionalFrameParent->myContentFrame, "Lanes", GUIDesignGroupBoxFrame), - 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); - - // Create search box - myLanesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); - - // Create list - myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); - - // Create horizontal frame - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - - // Create button for clear selection - clearLanesSelection = new FXButton(buttonsFrame, "clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); - - // Create button for invert selection - invertLanesSelection = new FXButton(buttonsFrame, "invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); - - // Hide List - hideSelectorChildLanesModul(); -} - - -GNEAdditionalFrame::SelectorChildLanes::~SelectorChildLanes() {} - - -std::string -GNEAdditionalFrame::SelectorChildLanes::getLaneIdsSelected() const { - std::vector vectorOfIds; - if (myUseSelectedLanesCheckButton->getCheck()) { - // get Selected lanes - std::vector selectedLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true); - // Iterate over selectedLanes and getId - for (auto i : selectedLanes) { - vectorOfIds.push_back(i->getID()); - } - } else { - // Obtain Id's of list - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->isItemSelected(i)) { - vectorOfIds.push_back(myList->getItem(i)->getText().text()); - } - } - } - return joinToString(vectorOfIds, " "); -} - - -void -GNEAdditionalFrame::SelectorChildLanes::showSelectorChildLanesModul(std::string search) { - myList->clearItems(); - std::vector vectorOfLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(false); - for (auto i : vectorOfLanes) { - if (i->getID().find(search) != std::string::npos) { - myList->appendItem(i->getID().c_str()); - } - } - // By default, CheckBox for useSelectedLanes isn't checked - myUseSelectedLanesCheckButton->setCheck(false); - // Show list - show(); -} - - -void -GNEAdditionalFrame::SelectorChildLanes::hideSelectorChildLanesModul() { - FXGroupBox::hide(); -} - - -void -GNEAdditionalFrame::SelectorChildLanes::updateUseSelectedLanes() { - // Enable or disable use selected Lanes - if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true).size() > 0) { - myUseSelectedLanesCheckButton->enable(); - } else { - myUseSelectedLanesCheckButton->disable(); - } -} - - -long -GNEAdditionalFrame::SelectorChildLanes::onCmdUseSelectedLanes(FXObject*, FXSelector, void*) { - if (myUseSelectedLanesCheckButton->getCheck()) { - myLanesSearch->hide(); - myList->hide(); - clearLanesSelection->hide(); - invertLanesSelection->hide(); - } else { - myLanesSearch->show(); - myList->show(); - clearLanesSelection->show(); - invertLanesSelection->show(); - } - // Recalc Frame - recalc(); - // Update Frame - update(); - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildLanes::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { - // Show only Id's of SelectorChildLanes that contains the searched string - showSelectorChildLanesModul(myLanesSearch->getText().text()); - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildLanes::onCmdSelectLane(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildLanes::onCmdClearSelection(FXObject*, FXSelector, void*) { - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->getItem(i)->isSelected()) { - myList->deselectItem(i); - } - } - return 1; -} - - -long -GNEAdditionalFrame::SelectorChildLanes::onCmdInvertSelection(FXObject*, FXSelector, void*) { - for (int i = 0; i < myList->getNumItems(); i++) { - if (myList->getItem(i)->isSelected()) { - myList->deselectItem(i); - } else { - myList->selectItem(i); - } - } - return 1; -} - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEAdditionalFrame::GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Additionals") { - - // create item Selector modul for additionals - myAdditionalTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL); - - // Create additional parameters - myAdditionalAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); - - // Create consecutive Lane Selector - mySelectorParentLanes = new SelectorParentLanes(this); - - // Create selector parent - myParentAdditional = new GNEFrameModuls::SelectorParent(this); - - /// Create list for SelectorChildEdges - mySelectorChildEdges = new SelectorChildEdges(this); - - /// Create list for SelectorChildLanes - mySelectorChildLanes = new SelectorChildLanes(this); - - // set BusStop as default additional - myAdditionalTagSelector->setCurrentTag(SUMO_TAG_BUS_STOP); -} - - -GNEAdditionalFrame::~GNEAdditionalFrame() {} - - -void -GNEAdditionalFrame::show() { - // refresh item selector - myAdditionalTagSelector->refreshTagProperties(); - // show frame - GNEFrame::show(); -} - - -bool -GNEAdditionalFrame::addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // first check that current selected additional is valid - if (myAdditionalTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { - myViewNet->setStatusBarText("Current selected additional isn't valid."); - return false; - } - // obtain tagproperty (only for improve code legibility) - const auto& tagValues = myAdditionalTagSelector->getCurrentTagProperties(); - // Declare map to keep attributes obtained in frame - std::map valuesMap = myAdditionalAttributes->getAttributesAndValues(true); - // fill netedit attributes - if (!myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront())) { - return false; - } - // If element owns an parent additional, get id of parent from ParentAdditionalSelector - if (tagValues.hasParent() && !buildAdditionalWithParent(valuesMap, objectsUnderCursor.getAdditionalFront(), tagValues)) { - return false; - } - // If consecutive Lane Selector is enabled, it means that either we're selecting lanes or we're finished or we'rent started - if (tagValues.hasAttribute(SUMO_ATTR_EDGE) || (tagValues.getTag() == SUMO_TAG_VAPORIZER)) { - return buildAdditionalOverEdge(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); - } else if (tagValues.hasAttribute(SUMO_ATTR_LANE)) { - return buildAdditionalOverLane(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); - } else if (tagValues.getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - return buildAdditionalOverLanes(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); - } else { - return buildAdditionalOverView(valuesMap, tagValues); - } -} - - -void -GNEAdditionalFrame::showSelectorChildLanesModul() { - // Show frame - GNEFrame::show(); - // Update UseSelectedLane CheckBox - mySelectorChildEdges->updateUseSelectedEdges(); - // Update UseSelectedLane CheckBox - mySelectorChildLanes->updateUseSelectedLanes(); -} - - -GNEAdditionalFrame::SelectorParentLanes* -GNEAdditionalFrame::getConsecutiveLaneSelector() const { - return mySelectorParentLanes; -} - - -void -GNEAdditionalFrame::tagSelected() { - if (myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // show additional attributes modul - myAdditionalAttributes->showAttributesCreatorModul(myAdditionalTagSelector->getCurrentTagProperties(), {}); - // show netedit attributes - myNeteditAttributes->showNeteditAttributesModul(myAdditionalTagSelector->getCurrentTagProperties()); - // Show myAdditionalFrameParent if we're adding a additional with parent - if (myAdditionalTagSelector->getCurrentTagProperties().hasParent()) { - myParentAdditional->showSelectorParentModul(myAdditionalTagSelector->getCurrentTagProperties().getParentTag()); - } else { - myParentAdditional->hideSelectorParentModul(); - } - // Show SelectorChildEdges if we're adding an additional that own the attribute SUMO_ATTR_EDGES - if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_EDGES)) { - mySelectorChildEdges->showSelectorChildEdgesModul(); - } else { - mySelectorChildEdges->hideSelectorChildEdgesModul(); - } - // Show SelectorChildLanes or consecutive lane selector if we're adding an additional that own the attribute SUMO_ATTR_LANES - if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_LANES)) { - if (myAdditionalTagSelector->getCurrentTagProperties().hasParent() && - (myAdditionalTagSelector->getCurrentTagProperties().getParentTag() == SUMO_TAG_LANE)) { - // show selector parent lane and hide selector child lane - mySelectorParentLanes->showSelectorParentLanesModul(); - mySelectorChildLanes->hideSelectorChildLanesModul(); - } else { - // show selector child lane and hide selector parent lane - mySelectorChildLanes->showSelectorChildLanesModul(); - mySelectorParentLanes->hideSelectorParentLanesModul(); - } - } else { - mySelectorChildLanes->hideSelectorChildLanesModul(); - mySelectorParentLanes->hideSelectorParentLanesModul(); - } - } else { - // hide all moduls if additional isn't valid - myAdditionalAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myParentAdditional->hideSelectorParentModul(); - mySelectorChildEdges->hideSelectorChildEdgesModul(); - mySelectorChildLanes->hideSelectorChildLanesModul(); - mySelectorParentLanes->hideSelectorParentLanesModul(); - } -} - - -std::string -GNEAdditionalFrame::generateID(GNENetElement* netElement) const { - // obtain current number of additionals to generate a new index faster - int additionalIndex = myViewNet->getNet()->getNumberOfAdditionals(myAdditionalTagSelector->getCurrentTagProperties().getTag()); - // obtain tag Properties (only for improve code legilibility - const auto& tagProperties = myAdditionalTagSelector->getCurrentTagProperties(); - if (netElement) { - // special case for vaporizers - if (tagProperties.getTag() == SUMO_TAG_VAPORIZER) { - return netElement->getID(); - } else { - // generate ID using netElement - while (myViewNet->getNet()->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + netElement->getID() + "_" + toString(additionalIndex), false) != nullptr) { - additionalIndex++; - } - return tagProperties.getTagStr() + "_" + netElement->getID() + "_" + toString(additionalIndex); - } - } else { - // generate ID without netElement - while (myViewNet->getNet()->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + toString(additionalIndex), false) != nullptr) { - additionalIndex++; - } - return tagProperties.getTagStr() + "_" + toString(additionalIndex); - } -} - - -bool -GNEAdditionalFrame::buildAdditionalWithParent(std::map& valuesMap, GNEAdditional* additionalParent, const GNEAttributeCarrier::TagProperties& tagValues) { - // if user click over an additional element parent, mark int in ParentAdditionalSelector - if (additionalParent && (additionalParent->getTagProperty().getTag() == tagValues.getParentTag())) { - valuesMap[GNE_ATTR_PARENT] = additionalParent->getID(); - myParentAdditional->setIDSelected(additionalParent->getID()); - } - // stop if currently there isn't a valid selected parent - if (myParentAdditional->getIdSelected() != "") { - valuesMap[GNE_ATTR_PARENT] = myParentAdditional->getIdSelected(); - } else { - myAdditionalAttributes->showWarningMessage("A " + toString(tagValues.getParentTag()) + " must be selected before insertion of " + myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + "."); - return false; - } - return true; -} - - -bool -GNEAdditionalFrame::buildAdditionalCommonAttributes(std::map& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues) { - // If additional has a interval defined by a begin or end, check that is valid - if (tagValues.hasAttribute(SUMO_ATTR_STARTTIME) && tagValues.hasAttribute(SUMO_ATTR_END)) { - double begin = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_STARTTIME]); - double end = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_END]); - if (begin > end) { - myAdditionalAttributes->showWarningMessage("Attribute '" + toString(SUMO_ATTR_STARTTIME) + "' cannot be greater than attribute '" + toString(SUMO_ATTR_END) + "'."); - return false; - } - } - // If additional own the attribute SUMO_ATTR_FILE but was't defined, will defined as .xml - if (tagValues.hasAttribute(SUMO_ATTR_FILE) && valuesMap[SUMO_ATTR_FILE] == "") { - if ((myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_CALIBRATOR) && (myAdditionalTagSelector->getCurrentTagProperties().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) - valuesMap[SUMO_ATTR_FILE] = (valuesMap[SUMO_ATTR_ID] + ".xml"); - } - } - // If element own a list of SelectorChildEdges as attribute - if (tagValues.hasAttribute(SUMO_ATTR_EDGES) && valuesMap[SUMO_ATTR_EDGES].empty()) { - // obtain edge IDs - valuesMap[SUMO_ATTR_EDGES] = mySelectorChildEdges->getEdgeIdsSelected(); - // check if attribute has at least one edge - if (valuesMap[SUMO_ATTR_EDGES] == "") { - myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_EDGE) + "s cannot be empty"); - return false; - } - } - // get values of mySelectorChildLanes, if tag correspond to an element that has lanes as children - if (tagValues.hasAttribute(SUMO_ATTR_LANES) && valuesMap[SUMO_ATTR_LANES].empty()) { - // obtain lane IDs - valuesMap[SUMO_ATTR_LANES] = mySelectorChildLanes->getLaneIdsSelected(); - // check if attribute has at least a lane - if (valuesMap[SUMO_ATTR_LANES] == "") { - myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_LANE) + "s cannot be empty"); - return false; - } - } - // all ok, continue building additionals - return true; -} - - -bool -GNEAdditionalFrame::buildAdditionalOverEdge(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) { - // check that edge exist - if (lane) { - // Get attribute lane's edge - valuesMap[SUMO_ATTR_EDGE] = lane->getParentEdge()->getID(); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = generateID(lane->getParentEdge()); - } - } else { - return false; - } - // parse common attributes - if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { - return false; - } - // show warning dialogbox and stop check if input parameters are valid - if (!myAdditionalAttributes->areValuesValid()) { - myAdditionalAttributes->showWarningMessage(); - return false; - } else { - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); - // try to build additional - if (GNEAdditionalHandler::buildAdditional(myViewNet, true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { - // Refresh additional Parent Selector (For additionals that have a limited number of children) - myParentAdditional->refreshSelectorParentModul(); - // clear selected eddges and lanes - mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); - mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); - // refresh additional attributes - myAdditionalAttributes->refreshRows(); - return true; - } else { - return false; - } - } -} - - -bool -GNEAdditionalFrame::buildAdditionalOverLane(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) { - // check that lane exist - if (lane != nullptr) { - // Get attribute lane - valuesMap[SUMO_ATTR_LANE] = lane->getID(); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = generateID(lane); - } - } else { - return false; - } - // Obtain position of the mouse over lane (limited over grid) - double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myViewNet->snapToActiveGrid(myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor(); - // set attribute position as mouse position over lane - valuesMap[SUMO_ATTR_POSITION] = toString(mousePositionOverLane); - // parse common attributes - if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { - return false; - } - // show warning dialogbox and stop check if input parameters are valid - if (!myAdditionalAttributes->areValuesValid()) { - myAdditionalAttributes->showWarningMessage(); - return false; - } else { - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); - // try to build additional - if (GNEAdditionalHandler::buildAdditional(myViewNet, true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { - // Refresh additional Parent Selector (For additionals that have a limited number of children) - myParentAdditional->refreshSelectorParentModul(); - // clear selected eddges and lanes - mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); - mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); - // refresh additional attributes - myAdditionalAttributes->refreshRows(); - return true; - } else { - return false; - } - } -} - - -bool -GNEAdditionalFrame::buildAdditionalOverLanes(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues) { - // stop if lane isn't valid - if (lane == nullptr) { - return false; - } - if (mySelectorParentLanes->isSelectingLanes()) { - // select clicked lane, but don't build additional - mySelectorParentLanes->addSelectedLane(lane, myViewNet->getPositionInformation()); - return false; - } else if (mySelectorParentLanes->getSelectedLanes().empty()) { - // if there isn't selected lanes, that means that we will be start selecting lanes - mySelectorParentLanes->startConsecutiveLaneSelector(lane, myViewNet->getPositionInformation()); - return false; - } else { - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = generateID(mySelectorParentLanes->getSelectedLanes().front().first); - } - // obtain lane IDs - std::vector laneIDs; - for (auto i : mySelectorParentLanes->getSelectedLanes()) { - laneIDs.push_back(i.first->getID()); - } - valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " "); - // Check if clicked position over first lane has to be obtained - if (tagValues.hasAttribute(SUMO_ATTR_POSITION)) { - valuesMap[SUMO_ATTR_POSITION] = toString(mySelectorParentLanes->getSelectedLanes().front().second); - } - // Check if clicked position over last lane has to be obtained - if (tagValues.hasAttribute(SUMO_ATTR_ENDPOS)) { - valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectorParentLanes->getSelectedLanes().back().second); - } - // parse common attributes - if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { - return false; - } - // show warning dialogbox and stop check if input parameters are valid - if (myAdditionalAttributes->areValuesValid() == false) { - myAdditionalAttributes->showWarningMessage(); - return false; - } else { - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); - // try to build additional - if (GNEAdditionalHandler::buildAdditional(myViewNet, true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { - // Refresh additional Parent Selector (For additionals that have a limited number of children) - myParentAdditional->refreshSelectorParentModul(); - // abort lane selector - mySelectorParentLanes->abortConsecutiveLaneSelector(); - // refresh additional attributes - myAdditionalAttributes->refreshRows(); - return true; - } else { - // additional cannot be build - return false; - } - } - } -} - - -bool -GNEAdditionalFrame::buildAdditionalOverView(std::map& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues) { - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = generateID(nullptr); - } - // Obtain position as the clicked position over view - valuesMap[SUMO_ATTR_POSITION] = toString(myViewNet->snapToActiveGrid(myViewNet->getPositionInformation())); - // parse common attributes - if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { - return false; - } - // show warning dialogbox and stop check if input parameters are valid - if (myAdditionalAttributes->areValuesValid() == false) { - myAdditionalAttributes->showWarningMessage(); - return false; - } else { - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); - // try to build additional - if (GNEAdditionalHandler::buildAdditional(myViewNet, true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { - // Refresh additional Parent Selector (For additionals that have a limited number of children) - myParentAdditional->refreshSelectorParentModul(); - // clear selected eddges and lanes - mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); - mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); - // refresh additional attributes - myAdditionalAttributes->refreshRows(); - return true; - } else { - return false; - } - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEAdditionalFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,338 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAdditionalFrame.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// The Widget for add additional elements -/****************************************************************************/ -#ifndef GNEAdditionalFrame_h -#define GNEAdditionalFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEAdditionalFrame - * The Widget for setting internal attributes of additional elements - */ -class GNEAdditionalFrame : public GNEFrame { - -public: - - // =========================================================================== - // class SelectorParentLanes - // =========================================================================== - - class SelectorParentLanes : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEAdditionalFrame::SelectorParentLanes) - public: - /// @brief constructor - SelectorParentLanes(GNEAdditionalFrame* additionalFrameParent); - - /// @brief destructor - ~SelectorParentLanes(); - - /// @brief show SelectorParentLanes modul - void showSelectorParentLanesModul(); - - /// @brief hide SelectorParentLanes - void hideSelectorParentLanesModul(); - - /// @brief start selection of consecutive lanes - void startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition); - - /// @brief stop selection of consecutive lanes - bool stopConsecutiveLaneSelector(); - - /// @brief abort selection of consecutive lanes - void abortConsecutiveLaneSelector(); - - /// @brief return true if lane can be selected as consecutive lane - bool addSelectedLane(GNELane* lane, const Position& clickedPosition); - - /// @brief remove last added point - void removeLastSelectedLane(); - - /// @brief return true if modul is selecting lane - bool isSelectingLanes() const; - - /// @brief return true if modul is shown - bool isShown() const; - - /// @brief get selected lane color - const RGBColor& getSelectedLaneColor() const; - - /// @brief get current selected lanes - const std::vector >& getSelectedLanes() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press stop selection button - long onCmdStopSelection(FXObject*, FXSelector, void*); - - /// @brief Called when the user press abort selection button - long onCmdAbortSelection(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(SelectorParentLanes) - - private: - /// @brief pointer to additionalFrameParent - GNEAdditionalFrame* myAdditionalFrameParent; - - /// @brief button for stop selecting - FXButton* myStopSelectingButton; - - /// @brief button for abort selecting - FXButton* myAbortSelectingButton; - - /// @brief Vector with the selected lanes and the clicked position - std::vector > mySelectedLanes; - - /// @brief Vector with the colored lanes - std::vector myCandidateLanes; - - /// @brief color for candidate lanes - RGBColor myCandidateLaneColor; - - /// @brief color for selected lanes - RGBColor mySelectedLaneColor; - - /// @brief check if certain lane is selected - bool isLaneSelected(GNELane* lane) const; - }; - - // =========================================================================== - // class SelectorChildEdges - // =========================================================================== - - class SelectorChildEdges : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEAdditionalFrame::SelectorChildEdges) - - public: - /// @brief constructor - SelectorChildEdges(GNEAdditionalFrame* additionalFrameParent); - - /// @brief destructor - ~SelectorChildEdges(); - - /// @brief get list of selecte id's in string format - std::string getEdgeIdsSelected() const; - - /// @brief Show SelectorChildEdges Modul - void showSelectorChildEdgesModul(std::string search = ""); - - /// @brief hide SelectorChildEdges Modul - void hideSelectorChildEdgesModul(); - - /// @brief Update use selectedEdges - void updateUseSelectedEdges(); - - /// @name FOX-callbacks - /// @{ - /// @brief called when user trigger checkBox of useSelectedEdges - long onCmdUseSelectedEdges(FXObject*, FXSelector, void*); - - /// @brief called when user type in search box - long onCmdTypeInSearchBox(FXObject*, FXSelector, void*); - - /// @brief called when user select a edge of the list - long onCmdSelectEdge(FXObject*, FXSelector, void*); - - /// @brief called when clear selection button is pressed - long onCmdClearSelection(FXObject*, FXSelector, void*); - - /// @brief called when invert selection button is pressed - long onCmdInvertSelection(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(SelectorChildEdges) - - private: - /// @brief pointer to additional frame parent - GNEAdditionalFrame* myAdditionalFrameParent; - - /// @brief CheckBox for selected edges - FXCheckButton* myUseSelectedEdgesCheckButton; - - /// @brief List of SelectorChildEdges - FXList* myList; - - /// @brief text field for search edge IDs - FXTextField* myEdgesSearch; - - /// @brief button for clear selection - FXButton* myClearEdgesSelection; - - /// @brief button for invert selection - FXButton* myInvertEdgesSelection; - }; - - // =========================================================================== - // class SelectorChildLanes - // =========================================================================== - - class SelectorChildLanes : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEAdditionalFrame::SelectorChildLanes) - - public: - /// @brief constructor - SelectorChildLanes(GNEAdditionalFrame* additionalFrameParent); - - /// @brief destructor - ~SelectorChildLanes(); - - /// @brief get list of selecte lane ids in string format - std::string getLaneIdsSelected() const; - - /// @brief Show list of SelectorChildLanes Modul - void showSelectorChildLanesModul(std::string search = ""); - - /// @brief hide SelectorChildLanes Modul - void hideSelectorChildLanesModul(); - - // @brief Update use selectedLanes - void updateUseSelectedLanes(); - - /// @name FOX-callbacks - /// @{ - /// @brief called when user trigger checkBox of useSelectedLanes - long onCmdUseSelectedLanes(FXObject*, FXSelector, void*); - - /// @brief called when user type in search box - long onCmdTypeInSearchBox(FXObject*, FXSelector, void*); - - /// @brief called when user select a lane of the list - long onCmdSelectLane(FXObject*, FXSelector, void*); - - /// @brief called when clear selection button is pressed - long onCmdClearSelection(FXObject*, FXSelector, void*); - - /// @brief called when invert selection button is pressed - long onCmdInvertSelection(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(SelectorChildLanes) - - private: - /// @brief pointer to additional frame parent - GNEAdditionalFrame* myAdditionalFrameParent; - - /// @brief CheckBox for selected lanes - FXCheckButton* myUseSelectedLanesCheckButton; - - /// @brief List of SelectorChildLanes - FXList* myList; - - /// @brief text field for search lane IDs - FXTextField* myLanesSearch; - - /// @brief button for clear selection - FXButton* clearLanesSelection; - - /// @brief button for invert selection - FXButton* invertLanesSelection; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEAdditionalFrame(); - - /// @brief show Frame - void show(); - - /**@brief add additional element - * @param objectsUnderCursor collection of objects under cursor after click over view - * @return true if additional was sucesfully added - */ - bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief show selector child lane and update use selected edges/lanes - void showSelectorChildLanesModul(); - - /// @brief getConsecutive Lane Selector - GNEAdditionalFrame::SelectorParentLanes* getConsecutiveLaneSelector() const; - -protected: - /// @brief Tag selected in TagSelector - void tagSelected(); - -private: - /// @brief generate a ID for an additiona element - std::string generateID(GNENetElement* netElement) const; - - /// @brief build common additional attributes - bool buildAdditionalCommonAttributes(std::map& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief build additional with Parent - bool buildAdditionalWithParent(std::map& valuesMap, GNEAdditional* parent, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief build additional over an edge (parent of lane) - bool buildAdditionalOverEdge(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief build additional over a single lane - bool buildAdditionalOverLane(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief build additional over lanes - bool buildAdditionalOverLanes(std::map& valuesMap, GNELane* lane, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief build additional over view - bool buildAdditionalOverView(std::map& valuesMap, const GNEAttributeCarrier::TagProperties& tagValues); - - /// @brief item selector - GNEFrameModuls::TagSelector* myAdditionalTagSelector; - - /// @brief internal additional attributes - GNEFrameAttributesModuls::AttributesCreator* myAdditionalAttributes; - - /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; - - /// @brief Modul for select parent lanes (currently only consecutives) - SelectorParentLanes* mySelectorParentLanes; - - /// @brief Modul for select a single parent additional - GNEFrameModuls::SelectorParent* myParentAdditional; - - /// @brief Modul for select child edges - SelectorChildEdges* mySelectorChildEdges; - - /// @brief Modul for select child lanes - SelectorChildLanes* mySelectorChildLanes; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEConnectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEConnectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEConnectorFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEConnectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,590 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2011-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEConnectorFrame.cpp -/// @author Jakob Erdmann -/// @date May 2011 -/// -// The Widget for modifying lane-to-lane connections -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEConnectorFrame.h" -#include "GNESelectorFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEConnectorFrame::ConnectionModifications) ConnectionModificationsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEConnectorFrame::ConnectionModifications::onCmdCancelModifications), - FXMAPFUNC(SEL_COMMAND, MID_OK, GNEConnectorFrame::ConnectionModifications::onCmdSaveModifications), -}; - -FXDEFMAP(GNEConnectorFrame::ConnectionOperations) ConnectionOperationsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_CLEAR, GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections), - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_RESET, GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTDEADENDS, GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadEnds), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTDEADSTARTS, GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadStarts), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTCONFLICTS, GNEConnectorFrame::ConnectionOperations::onCmdSelectConflicts), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTPASS, GNEConnectorFrame::ConnectionOperations::onCmdSelectPass), -}; - -// Object implementation -FXIMPLEMENT(GNEConnectorFrame::ConnectionModifications, FXGroupBox, ConnectionModificationsMap, ARRAYNUMBER(ConnectionModificationsMap)) -FXIMPLEMENT(GNEConnectorFrame::ConnectionOperations, FXGroupBox, ConnectionOperationsMap, ARRAYNUMBER(ConnectionOperationsMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEConnectorFrame::CurrentLane - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::CurrentLane::CurrentLane(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Lane", GUIDesignGroupBoxFrame) { - // create lane label - myCurrentLaneLabel = new FXLabel(this, "No lane selected", 0, GUIDesignLabelLeft); -} - - -GNEConnectorFrame::CurrentLane::~CurrentLane() {} - - -void -GNEConnectorFrame::CurrentLane::updateCurrentLaneLabel(const std::string& laneID) { - if (laneID.empty()) { - myCurrentLaneLabel->setText("No lane selected"); - } else { - myCurrentLaneLabel->setText((std::string("Current Lane: ") + laneID).c_str()); - } -} - -// --------------------------------------------------------------------------- -// GNEConnectorFrame::ConnectionModifications - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::ConnectionModifications::ConnectionModifications(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), - myConnectorFrameParent(connectorFrameParent) { - - // Create "Cancel" button - myCancelButton = new FXButton(this, "Cancel\t\tDiscard connection modifications (Esc)", - GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_CANCEL, GUIDesignButton); - // Create "OK" button - mySaveButton = new FXButton(this, "OK\t\tSave connection modifications (Enter)", - GUIIconSubSys::getIcon(ICON_ACCEPT), this, MID_OK, GUIDesignButton); - - // Create checkbox for protect routes - myProtectRoutesCheckBox = new FXCheckButton(this, "Protect routes", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); -} - - -GNEConnectorFrame::ConnectionModifications::~ConnectionModifications() {} - - -long -GNEConnectorFrame::ConnectionModifications::onCmdCancelModifications(FXObject*, FXSelector, void*) { - if (myConnectorFrameParent->myCurrentEditedLane != 0) { - myConnectorFrameParent->getViewNet()->getUndoList()->p_abort(); - if (myConnectorFrameParent->myNumChanges) { - myConnectorFrameParent->getViewNet()->setStatusBarText("Changes reverted"); - } - myConnectorFrameParent->cleanup(); - myConnectorFrameParent->getViewNet()->update(); - } - return 1; -} - - -long -GNEConnectorFrame::ConnectionModifications::onCmdSaveModifications(FXObject*, FXSelector, void*) { - if (myConnectorFrameParent->myCurrentEditedLane != 0) { - // check if routes has to be protected - if (myProtectRoutesCheckBox->isEnabled() && (myProtectRoutesCheckBox->getCheck() == TRUE)) { - for (const auto& i : myConnectorFrameParent->myCurrentEditedLane->getParentEdge()->getChildDemandElements()) { - if (!i->isDemandElementValid()) { - FXMessageBox::warning(getApp(), MBOX_OK, - "Error saving connection operations", "%s", - ("Connection edition cannot be saved because route '" + i->getID() + "' is broken.").c_str()); - return 1; - } - } - } - // finish route editing - myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); - if (myConnectorFrameParent->myNumChanges) { - myConnectorFrameParent->getViewNet()->setStatusBarText("Changes accepted"); - } - myConnectorFrameParent->cleanup(); - myConnectorFrameParent->getViewNet()->update(); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEConnectorFrame::ConnectionOperations - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::ConnectionOperations::ConnectionOperations(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Operations", GUIDesignGroupBoxFrame), - 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)", - 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)", - 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)", - 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", - 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", - 0, this, MID_CHOOSEN_CLEAR, GUIDesignButton); - // Create "Reset Selected" button - myResetSelectedButton = new FXButton(this, "Reset Selected\t\tRecomputes connections at all selected junctions", - 0, this, MID_CHOOSEN_RESET, GUIDesignButton); -} - - -GNEConnectorFrame::ConnectionOperations::~ConnectionOperations() {} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadEnds(FXObject*, FXSelector, void*) { - // select all lanes that have no successor lane - std::vector deadEnds; - // every edge knows its outgoing connections so we can look at each edge in isolation - const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); - for (auto i : edges) { - for (auto j : i->getLanes()) { - if (i->getNBEdge()->getConnectionsFromLane(j->getIndex()).size() == 0) { - deadEnds.push_back(j); - } - } - } - myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(deadEnds, GNESelectorFrame::ModificationMode::SET_REPLACE); - return 1; -} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadStarts(FXObject*, FXSelector, void*) { - // select all lanes that have no predecessor lane - std::set deadStarts; - GNENet* net = myConnectorFrameParent->getViewNet()->getNet(); - // every edge knows only its outgoing connections so we look at whole junctions - const std::vector junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(); - for (auto i : junctions) { - // first collect all outgoing lanes - for (auto j : i->getNBNode()->getOutgoingEdges()) { - GNEEdge* edge = net->retrieveEdge(j->getID()); - for (auto k : edge->getLanes()) { - deadStarts.insert(k); - } - } - // then remove all approached lanes - for (auto j : i->getNBNode()->getIncomingEdges()) { - GNEEdge* edge = net->retrieveEdge(j->getID()); - for (auto k : edge->getNBEdge()->getConnections()) { - deadStarts.erase(net->retrieveEdge(k.toEdge->getID())->getLanes()[k.toLane]); - } - } - } - std::vector selectObjects(deadStarts.begin(), deadStarts.end()); - myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(selectObjects, GNESelectorFrame::ModificationMode::SET_REPLACE); - return 1; -} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdSelectConflicts(FXObject*, FXSelector, void*) { - std::vector conflicts; - // conflicts happen per edge so we can look at each edge in isolation - const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); - for (auto i : edges) { - const EdgeVector destinations = i->getNBEdge()->getConnectedEdges(); - for (auto j : destinations) { - GNEEdge* dest = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID()); - for (auto k : dest->getLanes()) { - const bool isConflicted = count_if(i->getNBEdge()->getConnections().begin(), i->getNBEdge()->getConnections().end(), - NBEdge::connections_toedgelane_finder(j, (int)(k)->getIndex(), -1)) > 1; - if (isConflicted) { - conflicts.push_back(k); - } - } - } - - } - myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(conflicts, GNESelectorFrame::ModificationMode::SET_REPLACE); - return 1; -} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdSelectPass(FXObject*, FXSelector, void*) { - std::vector pass; - const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); - for (auto i : edges) { - for (auto j : i->getNBEdge()->getConnections()) { - if (j.mayDefinitelyPass) { - pass.push_back(i->getLanes()[j.fromLane]); - } - } - } - myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(pass, GNESelectorFrame::ModificationMode::SET_REPLACE); - return 1; -} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections(FXObject*, FXSelector, void*) { - myConnectorFrameParent->myConnectionModifications->onCmdCancelModifications(0, 0, 0); - myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s"); - // clear junction's connection - auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true); - for (auto i : junctions) { - i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); // clear connections - i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList(), GNEAttributeCarrier::FEATURE_MODIFIED); // prevent re-guessing - } - // clear edge's connection - auto edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(true); - for (auto i : edges) { - for (auto j : i->getLanes()) { - myConnectorFrameParent->removeConnections(j); - } - } - // clear lane's connection - auto lanes = myConnectorFrameParent->getViewNet()->getNet()->retrieveLanes(true); - for (auto i : lanes) { - myConnectorFrameParent->removeConnections(dynamic_cast(i)); - } - myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); - return 1; -} - - -long -GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections(FXObject*, FXSelector, void*) { - myConnectorFrameParent->myConnectionModifications->onCmdCancelModifications(0, 0, 0); - myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("reset connections from selected lanes"); - auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true); - for (auto i : junctions) { - i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); - } - myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEConnectorFrame::ConnectionSelection - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::ConnectionSelection::ConnectionSelection(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Selection", GUIDesignGroupBoxFrame) { - // 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); -} - - -GNEConnectorFrame::ConnectionSelection::~ConnectionSelection() {} - -// --------------------------------------------------------------------------- -// GNEConnectorFrame::ConnectionLegend - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::ConnectionLegend::ConnectionLegend(GNEConnectorFrame* connectorFrameParent) : - FXGroupBox(connectorFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame), - mySourceColor(RGBColor::CYAN), - myTargetColor(RGBColor::GREEN), - myPotentialTargetColor(RGBColor(0, 64, 0, 255)), - myTargetPassColor(RGBColor::MAGENTA), - myConflictColor(RGBColor::YELLOW) { - - // create source label - mySourceLabel = new FXLabel(this, "Source lane", 0, GUIDesignLabelLeft); - mySourceLabel->setBackColor(MFXUtils::getFXColor(mySourceColor)); - - // create target label - myTargetLabel = new FXLabel(this, "Target lane", 0, GUIDesignLabelLeft); - myTargetLabel->setBackColor(MFXUtils::getFXColor(myTargetColor)); - - // create possible target label - myPossibleTargetLabel = new FXLabel(this, "Possible Target", 0, GUIDesignLabelLeft); - myPossibleTargetLabel->setBackColor(MFXUtils::getFXColor(myPotentialTargetColor)); - - // create target (pass) label - myTargetPassLabel = new FXLabel(this, "Target (pass)", 0, GUIDesignLabelLeft); - myTargetPassLabel->setBackColor(MFXUtils::getFXColor(myTargetPassColor)); - - // create conflict label - myConflictLabel = new FXLabel(this, "Conflict", 0, GUIDesignLabelLeft); - myConflictLabel->setBackColor(MFXUtils::getFXColor(myConflictColor)); -} - - -GNEConnectorFrame::ConnectionLegend::~ConnectionLegend() {} - - -const RGBColor& -GNEConnectorFrame::ConnectionLegend::getSourceColor() const { - return mySourceColor; -} - - -const RGBColor& -GNEConnectorFrame::ConnectionLegend::getTargetColor() const { - return myTargetColor; -} - - -const RGBColor& -GNEConnectorFrame::ConnectionLegend::getPotentialTargetColor() const { - return myPotentialTargetColor; -} - - -const RGBColor& -GNEConnectorFrame::ConnectionLegend::getTargetPassColor() const { - return myTargetPassColor; -} - - -const RGBColor& -GNEConnectorFrame::ConnectionLegend::getConflictColor() const { - return myConflictColor; -} - -// --------------------------------------------------------------------------- -// GNEConnectorFrame - methods -// --------------------------------------------------------------------------- - -GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): - GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"), - myCurrentEditedLane(0) { - // create current lane modul - myCurrentLane = new CurrentLane(this); - - // create connection modifications modul - myConnectionModifications = new ConnectionModifications(this); - - // create connection operations modul - myConnectionOperations = new ConnectionOperations(this); - - // create connection selection modul - myConnectionSelection = new ConnectionSelection(this); - - // create connection legend modul - myConnectionLegend = new ConnectionLegend(this); -} - - -GNEConnectorFrame::~GNEConnectorFrame() {} - - -void -GNEConnectorFrame::handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // build connection - buildConnection(objectsUnderCursor.getLaneFront(), myViewNet->getKeyPressed().shiftKeyPressed(), myViewNet->getKeyPressed().controlKeyPressed(), true); -} - - -GNEConnectorFrame::ConnectionModifications* -GNEConnectorFrame::getConnectionModifications() const { - return myConnectionModifications; -} - - -void -GNEConnectorFrame::removeConnections(GNELane* lane) { - // select lane as current lane - buildConnection(lane, false, false, true); // select as current lane - // iterate over all potential targets - for (auto i : myPotentialTargets) { - // remove connections using the apropiate parameters in function "buildConnection" - buildConnection(i, false, false, false); - } - // save modifications - myConnectionModifications->onCmdSaveModifications(0, 0, 0); -} - - -void -GNEConnectorFrame::buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) { - if (myCurrentEditedLane == 0) { - myCurrentEditedLane = lane; - myCurrentEditedLane->setSpecialColor(&myConnectionLegend->getSourceColor()); - initTargets(); - myNumChanges = 0; - myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s"); - } else if (myPotentialTargets.count(lane) - || (allowConflict && lane->getParentEdge()->getGNEJunctionSource() == myCurrentEditedLane->getParentEdge()->getGNEJunctionDestiny())) { - const int fromIndex = myCurrentEditedLane->getIndex(); - GNEEdge* srcEdge = myCurrentEditedLane->getParentEdge(); - GNEEdge* destEdge = lane->getParentEdge(); - std::vector connections = srcEdge->getNBEdge()->getConnectionsFromLane(fromIndex); - bool changed = false; - LaneStatus status = getLaneStatus(connections, lane); - if (status == CONFLICTED && allowConflict) { - status = UNCONNECTED; - } - switch (status) { - case UNCONNECTED: - if (toggle) { - // create new connection - NBEdge::Connection newCon(fromIndex, destEdge->getNBEdge(), lane->getIndex(), mayDefinitelyPass); - // if the connection was previously deleted (by clicking the same lane twice), restore all values - for (NBEdge::Connection& c : myDeletedConnections) { - // fromLane must be the same, only check toLane - if (c.toEdge == destEdge->getNBEdge() && c.toLane == lane->getIndex()) { - newCon = c; - newCon.mayDefinitelyPass = mayDefinitelyPass; - } - } - NBConnection newNBCon(srcEdge->getNBEdge(), fromIndex, destEdge->getNBEdge(), lane->getIndex(), newCon.tlLinkIndex); - myViewNet->getUndoList()->add(new GNEChange_Connection(srcEdge, newCon, false, true), true); - lane->setSpecialColor(mayDefinitelyPass ? &myConnectionLegend->getTargetPassColor() : &myConnectionLegend->getTargetColor()); - srcEdge->getGNEJunctionDestiny()->invalidateTLS(myViewNet->getUndoList(), NBConnection::InvalidConnection, newNBCon); - } - break; - case CONNECTED: - case CONNECTED_PASS: { - // remove connection - GNEConnection* con = srcEdge->retrieveGNEConnection(fromIndex, destEdge->getNBEdge(), lane->getIndex()); - myDeletedConnections.push_back(con->getNBEdgeConnection()); - myViewNet->getNet()->deleteConnection(con, myViewNet->getUndoList()); - lane->setSpecialColor(&myConnectionLegend->getPotentialTargetColor()); - changed = true; - break; - } - case CONFLICTED: - SVCPermissions fromPermissions = srcEdge->getNBEdge()->getPermissions(fromIndex); - SVCPermissions toPermissions = destEdge->getNBEdge()->getPermissions(lane->getIndex()); - if ((fromPermissions & toPermissions) == SVC_PEDESTRIAN) { - myViewNet->setStatusBarText("Pedestrian connections are generated automatically"); - } else if ((fromPermissions & toPermissions) == 0) { - myViewNet->setStatusBarText("Incompatible vehicle class permissions"); - } else { - myViewNet->setStatusBarText("Another lane from the same edge already connects to that lane"); - } - break; - } - if (changed) { - myNumChanges += 1; - } - } else { - myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION)); - } - myCurrentLane->updateCurrentLaneLabel(myCurrentEditedLane->getID()); -} - - -void -GNEConnectorFrame::initTargets() { - // gather potential targets - NBNode* nbn = myCurrentEditedLane->getParentEdge()->getGNEJunctionDestiny()->getNBNode(); - - for (auto it : nbn->getOutgoingEdges()) { - GNEEdge* edge = myViewNet->getNet()->retrieveEdge(it->getID()); - for (auto it_lane : edge->getLanes()) { - myPotentialTargets.insert(it_lane); - } - } - // set color for existing connections - std::vector connections = myCurrentEditedLane->getParentEdge()->getNBEdge()->getConnectionsFromLane(myCurrentEditedLane->getIndex()); - for (auto it : myPotentialTargets) { - switch (getLaneStatus(connections, it)) { - case CONNECTED: - it->setSpecialColor(&myConnectionLegend->getTargetColor()); - break; - case CONNECTED_PASS: - it->setSpecialColor(&myConnectionLegend->getTargetPassColor()); - break; - case CONFLICTED: - it->setSpecialColor(&myConnectionLegend->getConflictColor()); - break; - case UNCONNECTED: - it->setSpecialColor(&myConnectionLegend->getPotentialTargetColor()); - break; - } - } -} - - -void -GNEConnectorFrame::cleanup() { - // restore colors of potential targets - for (auto it : myPotentialTargets) { - it->setSpecialColor(0); - } - // clear attributes - myPotentialTargets.clear(); - myNumChanges = 0; - myCurrentEditedLane->setSpecialColor(0); - myCurrentEditedLane = nullptr; - myDeletedConnections.clear(); - myCurrentLane->updateCurrentLaneLabel(""); -} - - -GNEConnectorFrame::LaneStatus -GNEConnectorFrame::getLaneStatus(const std::vector& connections, GNELane* targetLane) { - NBEdge* srcEdge = myCurrentEditedLane->getParentEdge()->getNBEdge(); - const int fromIndex = myCurrentEditedLane->getIndex(); - NBEdge* destEdge = targetLane->getParentEdge()->getNBEdge(); - const int toIndex = targetLane->getIndex(); - std::vector::const_iterator con_it = find_if( - connections.begin(), connections.end(), - NBEdge::connections_finder(fromIndex, destEdge, toIndex)); - const bool isConnected = con_it != connections.end(); - if (isConnected) { - if (con_it->mayDefinitelyPass) { - return CONNECTED_PASS; - } else { - return CONNECTED; - } - } else if (srcEdge->hasConnectionTo(destEdge, toIndex) - || (srcEdge->getPermissions(fromIndex) & destEdge->getPermissions(toIndex) & ~SVC_PEDESTRIAN) == 0) { - return CONFLICTED; - } else { - return UNCONNECTED; - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEConnectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEConnectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEConnectorFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEConnectorFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,330 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEConnectorFrame.h -/// @author Jakob Erdmann -/// @date May 2011 -/// -// The Widget for modifying lane-to-lane connections -/****************************************************************************/ -#ifndef GNEConnectorFrame_h -#define GNEConnectorFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEConnectorFrame - * The Widget for modifying selections of network-elements - */ -class GNEConnectorFrame : public GNEFrame { - -public: - - // =========================================================================== - // class CurrentLane - // =========================================================================== - - class CurrentLane : protected FXGroupBox { - - public: - /// @brief constructor - CurrentLane(GNEConnectorFrame* connectorFrameParent); - - /// @brief destructor - ~CurrentLane(); - - /// @brief set current junction label - void updateCurrentLaneLabel(const std::string& laneID); - - private: - /// @brief Label for current Lane - FXLabel* myCurrentLaneLabel; - }; - - // =========================================================================== - // class ConnectionModifications - // =========================================================================== - - class ConnectionModifications : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEConnectorFrame::ConnectionModifications) - - public: - /// @brief constructor - ConnectionModifications(GNEConnectorFrame* connectorFrameParent); - - /// @brief destructor - ~ConnectionModifications(); - - /// @name FOX-callbacks - /// @{ - - /// @brief Called when the user presses the OK-Button saves any connection modifications - long onCmdSaveModifications(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the Cancel-button discards any connection modifications - long onCmdCancelModifications(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(ConnectionModifications) - - private: - /// @brief pointer to connectorFrame parent - GNEConnectorFrame* myConnectorFrameParent; - - /// @brief "Cancel" button - FXButton* myCancelButton; - - /// @brief "OK" button - FXButton* mySaveButton; - - /// @brief protect routes checkbox - FXCheckButton* myProtectRoutesCheckBox; - }; - - // =========================================================================== - // class ConnectionOperations - // =========================================================================== - - class ConnectionOperations : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEConnectorFrame::ConnectionOperations) - - public: - /// @brief constructor - ConnectionOperations(GNEConnectorFrame* connectorFrameParent); - - /// @brief destructor - ~ConnectionOperations(); - - /// @name FOX-callbacks - /// @{ - - /// @brief Called when the user presses the select dead ends button - long onCmdSelectDeadEnds(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the select dead starts button - long onCmdSelectDeadStarts(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the select conflicts button - long onCmdSelectConflicts(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the select pass button - long onCmdSelectPass(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the clear selected connections button - long onCmdClearSelectedConnections(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the reset selected connections button - long onCmdResetSelectedConnections(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(ConnectionOperations) - - private: - /// @brief pointer to connectorFrame parent - GNEConnectorFrame* myConnectorFrameParent; - - /// @brief "Select Dead Ends" button - FXButton* mySelectDeadEndsButton; - - /// @brief "Select Dead Starts" button - FXButton* mySelectDeadStartsButton; - - /// @brief "Select Conflicts" button - FXButton* mySelectConflictsButton; - - /// @brief "Select Edges which may always pass" - FXButton* mySelectPassingButton; - - /// @brief "Clear Selected" - FXButton* myClearSelectedButton; - - /// @brief "Reset Selected" - FXButton* myResetSelectedButton; - }; - - // =========================================================================== - // class ConnectionSelection - // =========================================================================== - - class ConnectionSelection : protected FXGroupBox { - - public: - /// @brief constructor - ConnectionSelection(GNEConnectorFrame* connectorFrameParent); - - /// @brief destructor - ~ConnectionSelection(); - - private: - /// @brief Selection Hint - FXLabel* myHoldShiftLabel; - - /// @brief hold control label - FXLabel* myHoldControlLabel; - }; - - // =========================================================================== - // class ConnectionLegend - // =========================================================================== - - class ConnectionLegend : protected FXGroupBox { - - public: - /// @brief constructor - ConnectionLegend(GNEConnectorFrame* connectorFrameParent); - - /// @brief destructor - ~ConnectionLegend(); - - /// @brief get color for the from-lane of a connection - const RGBColor& getSourceColor() const; - - /// @brief get color for the to-lane of a connection - const RGBColor& getTargetColor() const; - - /// @brief get color for potential to-lane targets (currently unconnected) - const RGBColor& getPotentialTargetColor() const; - - /// @brief get color for the to-lane of a connection with pass attribute - const RGBColor& getTargetPassColor() const; - - /// @brief get color for a to-lane that cannot be used because another connection conflicts - const RGBColor& getConflictColor() const; - - private: - /// @brief source label - FXLabel* mySourceLabel; - - /// @brief target label - FXLabel* myTargetLabel; - - /// @brief possible target label - FXLabel* myPossibleTargetLabel; - - /// @brief target pass label - FXLabel* myTargetPassLabel; - - /// @brief conflict label - FXLabel* myConflictLabel; - - /// @brief color for the from-lane of a connection - RGBColor mySourceColor; - - /// @brief color for the to-lane of a connection - RGBColor myTargetColor; - - /// @brief color for potential to-lane targets (currently unconnected) - RGBColor myPotentialTargetColor; - - /// @brief color for the to-lane of a connection with pass attribute - RGBColor myTargetPassColor; - - /// @brief color for a to-lane that cannot be used because another connection conflicts - RGBColor myConflictColor; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEConnectorFrame(); - - /**@brief either sets the current lane or toggles the connection of the - * @param objectsUnderCursor collection of objects under cursor after click over view - */ - void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief get pointer to ConnectionModifications modul - ConnectionModifications* getConnectionModifications() const; - -private: - /// @brief the status of a target lane - enum LaneStatus { - UNCONNECTED, - CONNECTED, - CONNECTED_PASS, - CONFLICTED - }; - - /**@brief either sets the current lane or toggles the connection of the - * current lane to this lane (if they share a junction) - * @param[in] lane Either the lane to set as current lane, or the destination from current lane - * @param[in] mayDefinitelyPass Whether new connections shall have the pass attribute set - * @param[in] toggle Whether non-existing connections shall be created - */ - void buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle); - - /// @brief init targets - void initTargets(); - - /// @brief clean up when deselecting current lane - void cleanup(); - - /// @brief remove connections - void removeConnections(GNELane* lane); - - /// @brief return the status of toLane - LaneStatus getLaneStatus(const std::vector& connections, GNELane* targetLane); - - /// @brief CurrentLane modul - CurrentLane* myCurrentLane; - - /// @brief ConnectionModifications modul - ConnectionModifications* myConnectionModifications; - - /// @brief ConnectionOperations modul - ConnectionOperations* myConnectionOperations; - - /// @brief ConnectionSelection modul - ConnectionSelection* myConnectionSelection; - - /// @brief ConnectionLegend modul - ConnectionLegend* myConnectionLegend; - - /// @brief the lane of which connections are to be modified - GNELane* myCurrentEditedLane; - - /// @brief the set of lanes to which the current lane may be connected - std::set myPotentialTargets; - - /// @brief number of changes - int myNumChanges; - - /// @brief the internal lanes belonging the the current junction indexed by their tl-index - std::map myInternalLanes; - - /// @brief vector of connections deleted in the current editing step - std::vector myDeletedConnections; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECreateEdgeFrame.cpp -/// @author Mirko Barthauer (Technische Universitaet Braunschweig) -/// @date May 2018 -/// -// The Widget for editing connection prohibits -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNECreateEdgeFrame.h" -#include "GNEInspectorFrame.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -FXDEFMAP(GNECreateEdgeFrame) GNECreateEdgeFrameMap[] = { - /** currently unused **/ - FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNECreateEdgeFrame::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_OK, GNECreateEdgeFrame::onCmdOK) - /** **/ -}; - -// Object implementation -FXIMPLEMENT(GNECreateEdgeFrame, FXVerticalFrame, GNECreateEdgeFrameMap, ARRAYNUMBER(GNECreateEdgeFrameMap)) - -// =========================================================================== -// static members -// =========================================================================== - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNECreateEdgeFrame::GNECreateEdgeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Create Edge"), - myCreateEdgeSource(nullptr) { -} - - -GNECreateEdgeFrame::~GNECreateEdgeFrame() {} - - -void -GNECreateEdgeFrame::processClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, - GNEViewNetHelper::ObjectsUnderCursor& objectsUnderGrippedCursor, const bool oppositeEdge, const bool chainEdge) { - // obtain junction depending of gridEnabled - GNEJunction* junction = nullptr; - if (objectsUnderCursor.getJunctionFront()) { - junction = objectsUnderCursor.getJunctionFront(); - } else if (objectsUnderGrippedCursor.getJunctionFront()) { - junction = objectsUnderGrippedCursor.getJunctionFront(); - } - // begin undo list - if (!myViewNet->getUndoList()->hasCommandGroup()) { - myViewNet->getUndoList()->p_begin("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, - myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); - // check if edge was sucesfully created - if (newEdge) { - // create another edge, if create opposite edge is enabled - if (oppositeEdge) { - myViewNet->getNet()->createEdge(junction, myCreateEdgeSource, myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), - myViewNet->getUndoList(), "-" + newEdge->getNBEdge()->getID()); - } - // edge created, then unmark as create edge source - myCreateEdgeSource->unMarkAsCreateEdgeSource(); - // end undo list - if (myViewNet->getUndoList()->hasCommandGroup()) { - myViewNet->getUndoList()->p_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()->p_begin("create new " + toString(SUMO_TAG_EDGE)); - } else { - myCreateEdgeSource = nullptr; - } - } else { - myViewNet->setStatusBarText("An " + toString(SUMO_TAG_EDGE) + " with the same geometry already exists!"); - } - } else { - myViewNet->setStatusBarText("Start- and endpoint for an " + toString(SUMO_TAG_EDGE) + " must be distinct!"); - } - update(); - } -} - - -void GNECreateEdgeFrame::abortEdgeCreation() { - // if myCreateEdgeSource exist, unmark ist as create edge source - if (myCreateEdgeSource != nullptr) { - // remove current created edge source - myCreateEdgeSource->unMarkAsCreateEdgeSource(); - myCreateEdgeSource = nullptr; - } -} - - -void -GNECreateEdgeFrame::show() { - GNEFrame::show(); -} - - -void -GNECreateEdgeFrame::hide() { - GNEFrame::hide(); -} - - -long -GNECreateEdgeFrame::onCmdCancel(FXObject*, FXSelector, void*) { - /** unused **/ - return 1; -} - - -long -GNECreateEdgeFrame::onCmdOK(FXObject*, FXSelector, void*) { - /** unused **/ - return 1; -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNECreateEdgeFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECreateEdgeFrame.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2018 -/// -// The Widget for create edges (and junctions) -/****************************************************************************/ -#ifndef GNECreateEdgeFrame_h -#define GNECreateEdgeFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNECreateEdgeFrame - * The Widget for create edges - */ -class GNECreateEdgeFrame : public GNEFrame { - /// @brief FOX-declaration - FXDECLARE(GNECreateEdgeFrame) - -public: - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNECreateEdgeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNECreateEdgeFrame(); - - /**@brief handle processClick and set the relative colouring - * @param[in] clickedPosition clicked position over ViewNet - * @param objectsUnderCursor collection of objects under cursor after click over view (note: in this case use non-constant reference due setCreatedJunction) - * @param objectsUnderGrippedCursor collection of objects under gripped cursor after click over view (note: in this case use non-constant reference due setCreatedJunction) - * @param oppositeEdge automatically create an opposite edge - * @param chainEdge create edges in chain mode - */ - void processClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, - GNEViewNetHelper::ObjectsUnderCursor& objectsUnderGrippedCursor, const bool oppositeEdge, const bool chainEdge); - - /// @brief abort current edge creation - void abortEdgeCreation(); - - /// @brief show prohibition frame - void show(); - - /// @brief hide prohibition frame - void hide(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user presses the OK-Button saves any edge modifications - long onCmdOK(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the Cancel-button discards any edge modifications - long onCmdCancel(FXObject*, FXSelector, void*); - -protected: - FOX_CONSTRUCTOR(GNECreateEdgeFrame) - -private: - /// @brief source junction for new edge - GNEJunction* myCreateEdgeSource; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNECrossingFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNECrossingFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNECrossingFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNECrossingFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,585 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECrossingFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Oct 2016 -/// -// The Widget for add Crossing elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNECrossingFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNECrossingFrame::EdgesSelector::onCmdClearSelection), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNECrossingFrame::EdgesSelector::onCmdInvertSelection), -}; - -FXDEFMAP(GNECrossingFrame::CrossingParameters) CrossingParametersMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECrossingFrame::CrossingParameters::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNECrossingFrame::CrossingParameters::onCmdHelp), -}; - -FXDEFMAP(GNECrossingFrame::CreateCrossing) CreateCrossingMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNECrossingFrame::CreateCrossing::onCmdCreateCrossing), -}; - -// Object implementation -FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBox, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap)) -FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBox, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap)) -FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBox, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNECrossingFrame::CurrentJunction - methods -// --------------------------------------------------------------------------- - -GNECrossingFrame::CurrentJunction::CurrentJunction(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame) { - // create junction label - myCurrentJunctionLabel = new FXLabel(this, "No junction selected", 0, GUIDesignLabelLeft); -} - - -GNECrossingFrame::CurrentJunction::~CurrentJunction() {} - - -void -GNECrossingFrame::CurrentJunction::updateCurrentJunctionLabel(const std::string& junctionID) { - if (junctionID.empty()) { - myCurrentJunctionLabel->setText("No junction selected"); - } else { - myCurrentJunctionLabel->setText((std::string("Current Junction: ") + junctionID).c_str()); - } -} - -// --------------------------------------------------------------------------- -// GNECrossingFrame::EdgesSelector - methods -// --------------------------------------------------------------------------- - -GNECrossingFrame::EdgesSelector::EdgesSelector(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame), - 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); - - // Create button for clear selection - myClearEdgesSelection = new FXButton(this, ("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); -} - - -GNECrossingFrame::EdgesSelector::~EdgesSelector() {} - - -GNEJunction* -GNECrossingFrame::EdgesSelector::getCurrentJunction() const { - return myCurrentJunction; -} - - -void -GNECrossingFrame::EdgesSelector::enableEdgeSelector(GNEJunction* currentJunction) { - // restore color of all lanes of edge candidates - restoreEdgeColors(); - // Set current junction - myCurrentJunction = currentJunction; - // Update view net to show the new colors - myCrossingFrameParent->getViewNet()->update(); - // check if use selected eges must be enabled - myUseSelectedEdges->disable(); - for (auto i : myCurrentJunction->getGNEEdges()) { - if (i->isAttributeCarrierSelected()) { - myUseSelectedEdges->enable(); - } - } - // Enable rest of elements - myClearEdgesSelection->enable(); - myInvertEdgesSelection->enable(); -} - - -void -GNECrossingFrame::EdgesSelector::disableEdgeSelector() { - // disable current junction - myCurrentJunction = nullptr; - // disable all elements of the EdgesSelector - myUseSelectedEdges->disable(); - myClearEdgesSelection->disable(); - myInvertEdgesSelection->disable(); - // Disable crossing parameters - myCrossingFrameParent->myCrossingParameters->disableCrossingParameters(); -} - - -void -GNECrossingFrame::EdgesSelector::restoreEdgeColors() { - if (myCurrentJunction != nullptr) { - // restore color of all lanes of edge candidates - for (auto i : myCurrentJunction->getGNEEdges()) { - for (auto j : i->getLanes()) { - j->setSpecialColor(nullptr); - } - } - // Update view net to show the new colors - myCrossingFrameParent->getViewNet()->update(); - myCurrentJunction = nullptr; - } -} - - -long -GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { - myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction); - return 1; -} - - -long -GNECrossingFrame::EdgesSelector::onCmdClearSelection(FXObject*, FXSelector, void*) { - myCrossingFrameParent->myCrossingParameters->clearEdges(); - return 1; -} - - -long -GNECrossingFrame::EdgesSelector::onCmdInvertSelection(FXObject*, FXSelector, void*) { - myCrossingFrameParent->myCrossingParameters->invertEdges(myCurrentJunction); - return 1; -} - -// --------------------------------------------------------------------------- -// GNECrossingFrame::NeteditAttributes- methods -// --------------------------------------------------------------------------- - -GNECrossingFrame::CrossingParameters::CrossingParameters(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame), - myCrossingFrameParent(crossingFrameParent), - myCurrentParametersValid(true) { - FXHorizontalFrame* crossingParameter = nullptr; - // create label and string textField for edges - crossingParameter = new FXHorizontalFrame(this, 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); - 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); - 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->disable(); -} - - -GNECrossingFrame::CrossingParameters::~CrossingParameters() {} - - -void -GNECrossingFrame::CrossingParameters::enableCrossingParameters(bool hasTLS) { - // obtain Tag Values - const auto& tagProperties = GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING); - // Enable all elements of the crossing frames - myCrossingEdgesLabel->enable(); - myCrossingEdges->enable(); - myCrossingPriorityLabel->enable(); - // only enable priority check button if junction's crossing doesn't have TLS - if (hasTLS) { - myCrossingPriorityCheckButton->disable(); - } else { - myCrossingPriorityCheckButton->enable(); - } - myCrossingWidthLabel->enable(); - myCrossingWidth->enable(); - myHelpCrossingAttribute->enable(); - // set values of parameters - onCmdSetAttribute(nullptr, 0, nullptr); - // Crossings placed in junctinos with TLS always has priority - if (hasTLS) { - myCrossingPriorityCheckButton->setCheck(TRUE); - } else { - myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::parse(tagProperties.getDefaultValue(SUMO_ATTR_PRIORITY))); - } - myCrossingWidth->setText(tagProperties.getDefaultValue(SUMO_ATTR_WIDTH).c_str()); - myCrossingWidth->setTextColor(FXRGB(0, 0, 0)); -} - - -void -GNECrossingFrame::CrossingParameters::disableCrossingParameters() { - // clear all values of parameters - myCrossingEdges->setText(""); - myCrossingPriorityCheckButton->setCheck(false); - myCrossingPriorityCheckButton->setText("false"); - myCrossingWidth->setText(""); - // Disable all elements of the crossing frames - myCrossingEdgesLabel->disable(); - myCrossingEdges->disable(); - myCrossingPriorityLabel->disable(); - myCrossingPriorityCheckButton->disable(); - myCrossingWidthLabel->disable(); - myCrossingWidth->disable(); - myHelpCrossingAttribute->disable(); - myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false); -} - - -bool -GNECrossingFrame::CrossingParameters::isCrossingParametersEnabled() const { - return myCrossingEdgesLabel->isEnabled(); -} - - -void -GNECrossingFrame::CrossingParameters::markEdge(GNEEdge* edge) { - GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction(); - if (currentJunction != nullptr) { - // Check if edge belongs to junction's edge - if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) { - // Update text field with the new edge - std::vector crossingEdges = GNEAttributeCarrier::parse > (myCrossingEdges->getText().text()); - // Check if new edge must be added or removed - std::vector::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID()); - if (itFinder == crossingEdges.end()) { - crossingEdges.push_back(edge->getID()); - } else { - crossingEdges.erase(itFinder); - } - myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); - } - // Update colors and attributes - onCmdSetAttribute(nullptr, 0, nullptr); - } -} - - -void -GNECrossingFrame::CrossingParameters::clearEdges() { - myCrossingEdges->setText(""); - // Update colors and attributes - onCmdSetAttribute(nullptr, 0, nullptr); -} - - -void -GNECrossingFrame::CrossingParameters::invertEdges(GNEJunction* parentJunction) { - std::vector crossingEdges; - for (auto i : parentJunction->getGNEEdges()) { - if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) { - crossingEdges.push_back(i->getID()); - } - } - myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); - // Update colors and attributes - onCmdSetAttribute(nullptr, 0, nullptr); -} - - -void -GNECrossingFrame::CrossingParameters::useSelectedEdges(GNEJunction* parentJunction) { - std::vector crossingEdges; - for (auto i : parentJunction->getGNEEdges()) { - if (i->isAttributeCarrierSelected()) { - crossingEdges.push_back(i->getID()); - } - } - myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); - // Update colors and attributes - onCmdSetAttribute(nullptr, 0, nullptr); -} - - -std::vector -GNECrossingFrame::CrossingParameters::getCrossingEdges() const { - std::vector NBEdgeVector; - // Iterate over myCurrentSelectedEdges - for (auto i : myCurrentSelectedEdges) { - NBEdgeVector.push_back(i->getNBEdge()); - } - return NBEdgeVector; -} - - -bool -GNECrossingFrame::CrossingParameters::getCrossingPriority() const { - if (myCrossingPriorityCheckButton->getCheck()) { - return true; - } else { - return false; - } -} - - -bool -GNECrossingFrame::CrossingParameters::isCurrentParametersValid() const { - return myCurrentParametersValid; -} - - -double -GNECrossingFrame::CrossingParameters::getCrossingWidth() const { - return GNEAttributeCarrier::parse(myCrossingWidth->getText().text()); -} - - -long -GNECrossingFrame::CrossingParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) { - myCurrentParametersValid = true; - // get string vector with the edges - std::vector crossingEdges = GNEAttributeCarrier::parse > (myCrossingEdges->getText().text()); - // Clear selected edges - myCurrentSelectedEdges.clear(); - // iterate over vector of edge IDs - for (auto i : crossingEdges) { - GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->retrieveEdge(i, false); - GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction(); - // Check that edge exists and belongs to Junction - if (edge == nullptr) { - myCurrentParametersValid = false; - } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) { - myCurrentParametersValid = false; - } else { - // select or unselected edge - auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge); - if (itFinder == myCurrentSelectedEdges.end()) { - myCurrentSelectedEdges.push_back(edge); - } else { - myCurrentSelectedEdges.erase(itFinder); - } - } - } - - // change color of textfield dependig of myCurrentParametersValid - if (myCurrentParametersValid) { - myCrossingEdges->setTextColor(FXRGB(0, 0, 0)); - myCrossingEdges->killFocus(); - } else { - myCrossingEdges->setTextColor(FXRGB(255, 0, 0)); - myCurrentParametersValid = false; - } - - // Update colors of edges - for (auto i : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getGNEEdges()) { - if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) != myCurrentSelectedEdges.end()) { - for (auto j : i->getLanes()) { - j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateSelectedColor()); - } - } else { - for (auto j : i->getLanes()) { - j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateColor()); - } - } - } - // Update view net - myCrossingFrameParent->getViewNet()->update(); - - // Check that at least there are a selected edge - if (crossingEdges.empty()) { - myCurrentParametersValid = false; - } - - // change label of crossing priority - if (myCrossingPriorityCheckButton->getCheck()) { - myCrossingPriorityCheckButton->setText("true"); - } else { - myCrossingPriorityCheckButton->setText("false"); - } - - // Check width - if (GNEAttributeCarrier::canParse(myCrossingWidth->getText().text()) && - GNEAttributeCarrier::parse(myCrossingWidth->getText().text()) > 0) { - myCrossingWidth->setTextColor(FXRGB(0, 0, 0)); - myCrossingWidth->killFocus(); - } else { - myCrossingWidth->setTextColor(FXRGB(255, 0, 0)); - myCurrentParametersValid = false; - } - - // Enable or disable create crossing button depending of the current parameters - myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid); - return 0; -} - - -long -GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) { - myCrossingFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING)); - return 1; -} - -// --------------------------------------------------------------------------- -// GNECrossingFrame::CreateCrossing - methods -// --------------------------------------------------------------------------- - -GNECrossingFrame::CreateCrossing::CreateCrossing(GNECrossingFrame* crossingFrameParent) : - FXGroupBox(crossingFrameParent->myContentFrame, "Create", GUIDesignGroupBoxFrame), - myCrossingFrameParent(crossingFrameParent) { - // Create groupbox for create crossings - myCreateCrossingButton = new FXButton(this, "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton); - myCreateCrossingButton->disable(); -} - - -GNECrossingFrame::CreateCrossing::~CreateCrossing() {} - - -long -GNECrossingFrame::CreateCrossing::onCmdCreateCrossing(FXObject*, FXSelector, void*) { - // First check that current parameters are valid - if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) { - // iterate over junction's crossing to find duplicated crossings - if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) { - // create new crossing - myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(), - myCrossingFrameParent->myCrossingParameters->getCrossingEdges(), - myCrossingFrameParent->myCrossingParameters->getCrossingWidth(), - myCrossingFrameParent->myCrossingParameters->getCrossingPriority(), - -1, -1, - PositionVector::EMPTY, - false, true), true); - // clear selected edges - myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0); - } else { - WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."); - } - } - return 1; -} - - -void -GNECrossingFrame::CreateCrossing::setCreateCrossingButton(bool value) { - if (value) { - myCreateCrossingButton->enable(); - } else { - myCreateCrossingButton->disable(); - } -} - -// --------------------------------------------------------------------------- -// GNECrossingFrame - methods -// --------------------------------------------------------------------------- - -GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Crossings") { - // create CurrentJunction modul - myCurrentJunction = new CurrentJunction(this); - - // Create edge Selector modul - myEdgeSelector = new EdgesSelector(this); - - // Create CrossingParameters modul - myCrossingParameters = new CrossingParameters(this); - - // create CreateCrossing modul - myCreateCrossing = new CreateCrossing(this); - - // Create groupbox and labels for legends - FXGroupBox* groupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame); - FXLabel* colorCandidateLabel = new FXLabel(groupBoxLegend, "Candidate", 0, GUIDesignLabelLeft); - colorCandidateLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateColor())); - FXLabel* colorSelectedLabel = new FXLabel(groupBoxLegend, "Selected", 0, GUIDesignLabelLeft); - colorSelectedLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateSelectedColor())); - - // disable edge selector - myEdgeSelector->disableEdgeSelector(); -} - - -GNECrossingFrame::~GNECrossingFrame() { -} - - -void -GNECrossingFrame::hide() { - // restore color of all lanes of edge candidates - myEdgeSelector->restoreEdgeColors(); - // hide frame - GNEFrame::hide(); -} - - -void -GNECrossingFrame::addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // If current element is a junction - if (objectsUnderCursor.getJunctionFront()) { - // change label - myCurrentJunction->updateCurrentJunctionLabel(objectsUnderCursor.getJunctionFront()->getID()); - // Enable edge selector and crossing parameters - myEdgeSelector->enableEdgeSelector(objectsUnderCursor.getJunctionFront()); - myCrossingParameters->enableCrossingParameters(objectsUnderCursor.getJunctionFront()->getNBNode()->isTLControlled()); - // clears selected edges - myCrossingParameters->clearEdges(); - } else if (objectsUnderCursor.getEdgeFront()) { - // mark edge - myCrossingParameters->markEdge(objectsUnderCursor.getEdgeFront()); - } else { - // set default label - myCurrentJunction->updateCurrentJunctionLabel(""); - // restore color of all lanes of edge candidates - myEdgeSelector->restoreEdgeColors(); - // Disable edge selector - myEdgeSelector->disableEdgeSelector(); - } - // always update view after an operation - myViewNet->update(); -} - - -void -GNECrossingFrame::createCrossingHotkey() { - if (myEdgeSelector->getCurrentJunction()) { - // simply call onCmdCreateCrossing of CreateCrossing modul - myCreateCrossing->onCmdCreateCrossing(0, 0, 0); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNECrossingFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNECrossingFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNECrossingFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNECrossingFrame.h 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) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECrossingFrame.h -/// @author Pablo Alvarez Lopez -/// @date Oct 2016 -/// -// The Widget for add Crossing elements -/****************************************************************************/ -#ifndef GNECrossingFrame_h -#define GNECrossingFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNECrossingFrame - * The Widget for setting internal attributes of Crossing elements - */ -class GNECrossingFrame : public GNEFrame { - -public: - - // =========================================================================== - // class CurrentJunction - // =========================================================================== - - class CurrentJunction : protected FXGroupBox { - - public: - /// @brief constructor - CurrentJunction(GNECrossingFrame* crossingFrameParent); - - /// @brief destructor - ~CurrentJunction(); - - /// @brief set current junction label - void updateCurrentJunctionLabel(const std::string& junctionID); - - private: - /// @brief Label for current Junction - FXLabel* myCurrentJunctionLabel; - - }; - - // =========================================================================== - // class EdgesSelector - // =========================================================================== - - class EdgesSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNECrossingFrame::EdgesSelector) - - public: - /// @brief constructor - EdgesSelector(GNECrossingFrame* crossingFrameParent); - - /// @brief destructor - ~EdgesSelector(); - - /// @brief get current junction - GNEJunction* getCurrentJunction() const; - - /// @brief enable edgeSelector - void enableEdgeSelector(GNEJunction* currentJunction); - - /// @brief disable edgeSelector - void disableEdgeSelector(); - - /// @brief restore colors of all edges - void restoreEdgeColors(); - - /// @name FOX-callbacks - /// @{ - /// @brief called when useSelectedEdges button edge is pressed - long onCmdUseSelectedEdges(FXObject*, FXSelector, void*); - - /// @brief called when clear selection button is pressed - long onCmdClearSelection(FXObject*, FXSelector, void*); - - /// @brief called when invert selection button is pressed - long onCmdInvertSelection(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(EdgesSelector) - - private: - /// @brief pointer to GNECrossingFrame parent - GNECrossingFrame* myCrossingFrameParent; - - /// @brief CheckBox for selected edges - FXButton* myUseSelectedEdges; - - /// @brief button for clear selection - FXButton* myClearEdgesSelection; - - /// @brief button for invert selection - FXButton* myInvertEdgesSelection; - - /// @brief current Junction - GNEJunction* myCurrentJunction; - }; - - // =========================================================================== - // class CrossingParameters - // =========================================================================== - - class CrossingParameters : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNECrossingFrame::CrossingParameters) - - public: - /// @brief constructor - CrossingParameters(GNECrossingFrame* crossingFrameParent); - - /// @brief destructor - ~CrossingParameters(); - - /// @brief enable crossing parameters and set the default value of parameters - void enableCrossingParameters(bool hasTLS); - - /// @brief disable crossing parameters and clear parameters - void disableCrossingParameters(); - - /// @brief check if currently the CrossingParameters is enabled - bool isCrossingParametersEnabled() const; - - /// @brief mark or dismark edge - void markEdge(GNEEdge* edge); - - /// @brief clear edges - void clearEdges(); - - /// @brief invert edges - void invertEdges(GNEJunction* parentJunction); - - /// @brief use selected eges - void useSelectedEdges(GNEJunction* parentJunction); - - /// @brief get crossing NBedges - std::vector getCrossingEdges() const; - - /// @brief get crossing priority - bool getCrossingPriority() const; - - /// @brief get crossing width - double getCrossingWidth() const; - - /// @brief check if current parameters are valid - bool isCurrentParametersValid() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when user set a value - long onCmdSetAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when help button is pressed - long onCmdHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(CrossingParameters) - - private: - /// @brief pointer to GNECrossingFrame parent - GNECrossingFrame* myCrossingFrameParent; - - /// @brief current selected edges - std::vector myCurrentSelectedEdges; - - /// @brief Label for edges - FXLabel* myCrossingEdgesLabel; - - /// @brief TextField for edges - FXTextField* myCrossingEdges; - - /// @brief Label for Priority - FXLabel* myCrossingPriorityLabel; - - /// @brief CheckBox for Priority - FXCheckButton* myCrossingPriorityCheckButton; - - /// @brief Label for width - FXLabel* myCrossingWidthLabel; - - /// @brief TextField for width - FXTextField* myCrossingWidth; - - /// @brief button for help - FXButton* myHelpCrossingAttribute; - - /// @brief flag to check if current parameters are valid - bool myCurrentParametersValid; - }; - - // =========================================================================== - // class CreateCrossing - // =========================================================================== - - class CreateCrossing : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNECrossingFrame::CreateCrossing) - - public: - /// @brief constructor - CreateCrossing(GNECrossingFrame* crossingFrameParent); - - /// @brief destructor - ~CreateCrossing(); - - /// @brief enable or disable button create crossing - void setCreateCrossingButton(bool value); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press the button create edge - long onCmdCreateCrossing(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(CreateCrossing) - - private: - /// @brief pointer to crossingFrame parent - GNECrossingFrame* myCrossingFrameParent; - - /// @field FXButton for create Crossing - FXButton* myCreateCrossingButton; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNECrossingFrame(); - - /// @brief hide crossing frame - void hide(); - - /**@brief add Crossing element - * @param objectsUnderCursor collection of objects under cursor after click over view - */ - void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief create crossing (used when user press ENTER key in Crossing mode) - void createCrossingHotkey(); - -protected: - FOX_CONSTRUCTOR(GNECrossingFrame) - -private: - /// @brief current junction modul - GNECrossingFrame::CurrentJunction* myCurrentJunction; - - /// @brief edge selector modul - GNECrossingFrame::EdgesSelector* myEdgeSelector; - - /// @brief crossing parameters modul - GNECrossingFrame::CrossingParameters* myCrossingParameters; - - /// @brief create crossing modul - GNECrossingFrame::CreateCrossing* myCreateCrossing; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEDeleteFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEDeleteFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEDeleteFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEDeleteFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,568 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDeleteFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2016 -/// -// The Widget for remove network-elements -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEDeleteFrame.h" - - -// --------------------------------------------------------------------------- -// GNEDeleteFrame::DeleteOptions - methods -// --------------------------------------------------------------------------- - -GNEDeleteFrame::DeleteOptions::DeleteOptions(GNEDeleteFrame* deleteFrameParent) : - FXGroupBox(deleteFrameParent->myContentFrame, "Options", GUIDesignGroupBoxFrame) { - - // Create checkbox for enable/disable automatic deletion of additionals children (by default, enabled) - myForceDeleteAdditionals = new FXCheckButton(this, "Force deletion of additionals", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - myForceDeleteAdditionals->setCheck(TRUE); - - // Create checkbox for enable/disable delete only geomtery point(by default, disabled) - myDeleteOnlyGeometryPoints = new FXCheckButton(this, "Delete only geometryPoints", deleteFrameParent, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - myDeleteOnlyGeometryPoints->setCheck(FALSE); - - // 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->setCheck(TRUE); -} - - -GNEDeleteFrame::DeleteOptions::~DeleteOptions() {} - - -bool -GNEDeleteFrame::DeleteOptions::forceDeleteAdditionals() const { - return (myForceDeleteAdditionals->getCheck() == TRUE); -} - - -bool -GNEDeleteFrame::DeleteOptions::deleteOnlyGeometryPoints() const { - return (myDeleteOnlyGeometryPoints->getCheck() == TRUE); -} - - -bool -GNEDeleteFrame::DeleteOptions::protectDemandElements() const { - return (myProtectDemandElements->getCheck() == TRUE); -} - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEDeleteFrame::GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Delete") { - // create delete options modul - myDeleteOptions = new DeleteOptions(this); - - // Create groupbox and tree list - myAttributeCarrierHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this); -} - - -GNEDeleteFrame::~GNEDeleteFrame() {} - - -void -GNEDeleteFrame::show() { - if (myViewNet->getNet()->getSelectedAttributeCarriers(false).size() == 1) { - myAttributeCarrierHierarchy->showAttributeCarrierHierarchy(*myViewNet->getNet()->getSelectedAttributeCarriers(false).begin()); - } else { - myAttributeCarrierHierarchy->hideAttributeCarrierHierarchy(); - } - GNEFrame::show(); -} - - -void -GNEDeleteFrame::hide() { - GNEFrame::hide(); -} - - -void -GNEDeleteFrame::removeSelectedAttributeCarriers() { - // first check if there is additional to remove - if (ACsToDelete()) { - // remove all selected attribute carrier susing the following parent-child sequence - myViewNet->getUndoList()->p_begin("remove selected items"); - // disable update geometry - myViewNet->getNet()->disableUpdateGeometry(); - // delete selected attribute carriers depending of current supermode - if (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - //junctions - while (myViewNet->getNet()->retrieveJunctions(true).size() > 0) { - myViewNet->getNet()->deleteJunction(myViewNet->getNet()->retrieveJunctions(true).front(), myViewNet->getUndoList()); - } - // edges - while (myViewNet->getNet()->retrieveEdges(true).size() > 0) { - myViewNet->getNet()->deleteEdge(myViewNet->getNet()->retrieveEdges(true).front(), myViewNet->getUndoList(), false); - } - // lanes - while (myViewNet->getNet()->retrieveLanes(true).size() > 0) { - myViewNet->getNet()->deleteLane(myViewNet->getNet()->retrieveLanes(true).front(), myViewNet->getUndoList(), false); - } - // connections - while (myViewNet->getNet()->retrieveConnections(true).size() > 0) { - myViewNet->getNet()->deleteConnection(myViewNet->getNet()->retrieveConnections(true).front(), myViewNet->getUndoList()); - } - // crossings - while (myViewNet->getNet()->retrieveCrossings(true).size() > 0) { - myViewNet->getNet()->deleteCrossing(myViewNet->getNet()->retrieveCrossings(true).front(), myViewNet->getUndoList()); - } - // shapes - while (myViewNet->getNet()->retrieveShapes(true).size() > 0) { - myViewNet->getNet()->deleteShape(myViewNet->getNet()->retrieveShapes(true).front(), myViewNet->getUndoList()); - } - // additionals - while (myViewNet->getNet()->retrieveAdditionals(true).size() > 0) { - myViewNet->getNet()->deleteAdditional(myViewNet->getNet()->retrieveAdditionals(true).front(), myViewNet->getUndoList()); - } - } else { - // demand elements - while (myViewNet->getNet()->retrieveDemandElements(true).size() > 0) { - myViewNet->getNet()->deleteDemandElement(myViewNet->getNet()->retrieveDemandElements(true).front(), myViewNet->getUndoList()); - } - } - // enable update geometry - myViewNet->getNet()->enableUpdateGeometry(); - // finish deletion - myViewNet->getUndoList()->p_end(); - } -} - - -void -GNEDeleteFrame::removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions) { - // first check if there is at leas an AC under cursor) - if (objectsUnderCursor.getAttributeCarrierFront()) { - // disable update geometry - myViewNet->getNet()->disableUpdateGeometry(); - // obtain clicked position - Position clickedPosition = myViewNet->getPositionInformation(); - // first check if we'll only delete a geometry point - if (myDeleteOptions->deleteOnlyGeometryPoints() && !ignoreOptions) { - // check type of of object under cursor object with geometry points - if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) { - if (objectsUnderCursor.getEdgeFront()->getVertexIndex(clickedPosition, false, false) != -1) { - objectsUnderCursor.getEdgeFront()->deleteGeometryPoint(clickedPosition); - } - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_POLY) { - if (objectsUnderCursor.getPolyFront()->getVertexIndex(clickedPosition, false, false) != -1) { - objectsUnderCursor.getPolyFront()->deleteGeometryPoint(clickedPosition); - } - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) { - if (objectsUnderCursor.getTAZFront()->getVertexIndex(clickedPosition, false, false) != -1) { - objectsUnderCursor.getTAZFront()->deleteGeometryPoint(clickedPosition); - } - } - } else { - // check type of of object under cursor object - if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { - // obtain number of subordinated elements - auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getJunctionFront()); - // Check if junction can be deleted - if (myDeleteOptions->forceDeleteAdditionals() || ignoreOptions) { - myViewNet->getNet()->deleteJunction(objectsUnderCursor.getJunctionFront(), myViewNet->getUndoList()); - } else { - if (subordinatedElements.childAdditionals > 0) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'"); - std::string plural = subordinatedElements.childAdditionals > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + objectsUnderCursor.getJunctionFront()->getTagStr()).c_str(), "%s", - (objectsUnderCursor.getJunctionFront()->getTagStr() + " '" + objectsUnderCursor.getJunctionFront()->getID() + "' cannot be deleted because owns " + - toString(subordinatedElements.childAdditionals) + " child additional" + plural + ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'"); - } else { - myViewNet->getNet()->deleteJunction(objectsUnderCursor.getJunctionFront(), myViewNet->getUndoList()); - } - } - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_EDGE) { - // check if click was over a geometry point or over a shape's edge - if (objectsUnderCursor.getEdgeFront()->getVertexIndex(clickedPosition, false, false) != -1) { - objectsUnderCursor.getEdgeFront()->deleteGeometryPoint(clickedPosition); - } else { - // obtain number of subordinated elements - auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getEdgeFront()); - // Check if edge can be deleted - if ((myDeleteOptions->forceDeleteAdditionals() && !myDeleteOptions->protectDemandElements()) || ignoreOptions) { - // when deleting a single edge, keep all unaffected connections as they were - myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false); - } else { - // declare strings to save certain messages used in FXMessageBox to improve code legilibly - std::string tagstr = objectsUnderCursor.getEdgeFront()->getTagStr(); - std::string id = objectsUnderCursor.getEdgeFront()->getID(); - // check number of child additional - if ((subordinatedElements.childAdditionals > 0) && !myDeleteOptions->forceDeleteAdditionals()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'"); - std::string plural = subordinatedElements.childAdditionals > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.childAdditionals) + " additional" + plural + - ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'"); - } else if ((subordinatedElements.childAdditionals > 0) && !myDeleteOptions->forceDeleteAdditionals()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'"); - std::string plural = subordinatedElements.parentAdditionals > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.parentAdditionals) + " additional" + plural + - ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'"); - } else if ((subordinatedElements.childDemandElements > 0) && myDeleteOptions->protectDemandElements()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'"); - std::string plural = subordinatedElements.childDemandElements > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.childDemandElements) + " demand element" + plural + - ".\n Uncheck 'Protect demand elements' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'"); - } else if ((subordinatedElements.parentDemandElements > 0) && myDeleteOptions->protectDemandElements()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'"); - std::string plural = subordinatedElements.parentDemandElements > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.parentDemandElements) + " demand element" + plural + - ".\n Uncheck 'Protect demand elements' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'"); - } else { - // if all ok, then delete edge - myViewNet->getNet()->deleteEdge(objectsUnderCursor.getEdgeFront(), myViewNet->getUndoList(), false); - } - } - } - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) { - // obtain number of subordinated elements - auto subordinatedElements = SubordinatedElements(objectsUnderCursor.getLaneFront()); - // Check if lane can be deleted - if ((myDeleteOptions->forceDeleteAdditionals() && !myDeleteOptions->protectDemandElements()) || ignoreOptions) { - // when deleting a single lane, keep all unaffected connections as they were - myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false); - } else { - // declare strings to save certain messages used in FXMessageBox to improve code legilibly - std::string tagstr = objectsUnderCursor.getLaneFront()->getTagStr(); - std::string id = objectsUnderCursor.getLaneFront()->getID(); - // check number of child additional - if ((subordinatedElements.childAdditionals > 0) && !myDeleteOptions->forceDeleteAdditionals()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'"); - std::string plural = subordinatedElements.childAdditionals > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.childAdditionals) + " additional" + plural + - ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'"); - } else if ((subordinatedElements.childAdditionals > 0) && !myDeleteOptions->forceDeleteAdditionals()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Force deletion needed'"); - std::string plural = subordinatedElements.parentAdditionals > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.parentAdditionals) + " additional" + plural + - ".\n Check 'Force deletion of additionals' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Force deletion needed' with 'OK'"); - } else if ((subordinatedElements.childDemandElements > 0) && myDeleteOptions->protectDemandElements()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'"); - std::string plural = subordinatedElements.childDemandElements > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because owns " + toString(subordinatedElements.childDemandElements) + " demand element" + plural + - ".\n Uncheck 'Protect demand elements' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'"); - } else if ((subordinatedElements.parentDemandElements > 0) && myDeleteOptions->protectDemandElements()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening FXMessageBox 'Unprotect demand elements'"); - std::string plural = subordinatedElements.parentDemandElements > 1 ? "s" : ""; - // Open warning DialogBox - FXMessageBox::warning(getViewNet()->getApp(), MBOX_OK, ("Problem deleting " + tagstr).c_str(), "%s", - (tagstr + " '" + id + "' cannot be deleted because is part of " + toString(subordinatedElements.parentDemandElements) + " demand element" + plural + - ".\n Uncheck 'Protect demand elements' to force deletion.").c_str()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'Unprotect demand elements' with 'OK'"); - } else { - // if all ok, then delete lane - myViewNet->getNet()->deleteLane(objectsUnderCursor.getLaneFront(), myViewNet->getUndoList(), false); - } - } - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CROSSING) { - myViewNet->getNet()->deleteCrossing(objectsUnderCursor.getCrossingFront(), myViewNet->getUndoList()); - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_CONNECTION) { - myViewNet->getNet()->deleteConnection(objectsUnderCursor.getConnectionFront(), myViewNet->getUndoList()); - } else if (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_TAZ) { - myViewNet->getNet()->deleteAdditional(objectsUnderCursor.getTAZFront(), myViewNet->getUndoList()); - } else if (objectsUnderCursor.getAttributeCarrierFront() && (objectsUnderCursor.getAdditionalFront() == objectsUnderCursor.getAttributeCarrierFront())) { - myViewNet->getNet()->deleteAdditional(objectsUnderCursor.getAdditionalFront(), myViewNet->getUndoList()); - } else if (objectsUnderCursor.getShapeFront() && (objectsUnderCursor.getShapeFront() == objectsUnderCursor.getAttributeCarrierFront())) { - myViewNet->getNet()->deleteShape(objectsUnderCursor.getShapeFront(), myViewNet->getUndoList()); - } else if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront() == objectsUnderCursor.getAttributeCarrierFront())) { - myViewNet->getNet()->deleteDemandElement(objectsUnderCursor.getDemandElementFront(), myViewNet->getUndoList()); - } - } - // enable update geometry - myViewNet->getNet()->enableUpdateGeometry(); - // update view to show changes - myViewNet->update(); - } -} - - -GNEDeleteFrame::DeleteOptions* -GNEDeleteFrame::getDeleteOptions() const { - return myDeleteOptions; -} - -// --------------------------------------------------------------------------- -// GNEDeleteFrame::SubordinatedElements - methods -// --------------------------------------------------------------------------- - -GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEJunction* junction) : - parentAdditionals(0), - childAdditionals(0), - parentDemandElements(0), - childDemandElements(0) { - // obtain number of additional and demand elements parents and children of junction - parentAdditionals = (int)junction->getParentAdditionals().size(); - childAdditionals = (int)junction->getChildAdditionals().size(); - parentDemandElements = (int)junction->getParentDemandElements().size(); - childDemandElements = (int)junction->getChildDemandElements().size(); - // add the number of subodinated elements of child edges - for (const auto& i : junction->getGNEEdges()) { - (*this) += SubordinatedElements(i); - } -} - - -GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEEdge* edge) : - parentAdditionals(0), - childAdditionals(0), - parentDemandElements(0), - childDemandElements(0) { - // obtain number of additional and demand elements parents and children of junction - parentAdditionals = (int)edge->getParentAdditionals().size(); - childAdditionals = (int)edge->getChildAdditionals().size(); - parentDemandElements = (int)edge->getParentDemandElements().size(); - childDemandElements = (int)edge->getChildDemandElements().size(); - // add the number of subodinated elements of child lanes - for (const auto& i : edge->getLanes()) { - (*this) += SubordinatedElements(i); - } -} - - -GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNELane* lane) : - parentAdditionals(0), - childAdditionals(0), - parentDemandElements(0), - childDemandElements(0) { - // obtain number of additional and demand elements parents and children of junction - parentAdditionals = (int)lane->getParentAdditionals().size(); - childAdditionals = (int)lane->getChildAdditionals().size(); - parentDemandElements = (int)lane->getParentDemandElements().size(); - childDemandElements = (int)lane->getChildDemandElements().size(); -} - - -GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEAdditional* /* additional */) : - parentAdditionals(0), - childAdditionals(0), - parentDemandElements(0), - childDemandElements(0) { -} - - -GNEDeleteFrame::SubordinatedElements::SubordinatedElements(const GNEDemandElement* /* demandElement */) : - parentAdditionals(0), - childAdditionals(0), - parentDemandElements(0), - childDemandElements(0) { -} - - -GNEDeleteFrame::SubordinatedElements& -GNEDeleteFrame::SubordinatedElements::operator+=(const SubordinatedElements& other) { - parentAdditionals += other.parentAdditionals; - childAdditionals += other.childAdditionals; - parentDemandElements += other.parentDemandElements; - childDemandElements += other.childDemandElements; - return *this; -} - -// --------------------------------------------------------------------------- -// GNEAdditionalFrame - protected methods -// --------------------------------------------------------------------------- - -bool -GNEDeleteFrame::ACsToDelete() const { - // invert selection of elements depending of current supermode - if (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // iterate over junctions - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().junctions) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - // due we iterate over all junctions, only it's neccesary iterate over incoming edges - for (const auto& j : i.second->getGNEIncomingEdges()) { - if (j->isAttributeCarrierSelected()) { - return true; - } - // check lanes - for (auto k : j->getLanes()) { - if (k->isAttributeCarrierSelected()) { - return true; - } - } - // check connections - for (const auto& k : j->getGNEConnections()) { - if (k->isAttributeCarrierSelected()) { - return true; - } - } - } - // check crossings - for (const auto& j : i.second->getGNECrossings()) { - if (j->isAttributeCarrierSelected()) { - return true; - } - } - } - // check additionals - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) { - // first check if additional is selectable - if (GNEAttributeCarrier::getTagProperties(i.first).isSelectable()) { - for (const auto& j : i.second) { - if (j.second->isAttributeCarrierSelected()) { - return true; - } - } - } - } - // check polygons - for (const auto& i : myViewNet->getNet()->getPolygons()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - return true; - } - } - // check POIs - for (const auto& i : myViewNet->getNet()->getPOIs()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - return true; - } - } - } else { - // check routes - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check vehicles - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check trips - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check flows - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check route flows - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check lane stops - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check bus stops - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check container stops - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check chargingstation stops - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - // check parkingarea stops - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA)) { - if (i.second->isAttributeCarrierSelected()) { - return true; - } - } - } - return false; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEDeleteFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEDeleteFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEDeleteFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEDeleteFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,151 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEDeleteFrame.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2016 -/// -// The Widget for remove network-elements -/****************************************************************************/ -#ifndef GNEDeleteFrame_h -#define GNEDeleteFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEDeleteFrame - * The Widget for deleting elements - */ -class GNEDeleteFrame : public GNEFrame { - -public: - - // =========================================================================== - // class DeleteOptions - // =========================================================================== - - class DeleteOptions : protected FXGroupBox { - - public: - /// @brief constructor - DeleteOptions(GNEDeleteFrame* deleteFrameParent); - - /// @brief destructor - ~DeleteOptions(); - - /// @brief check if force delete additionals checkbox is enabled - bool forceDeleteAdditionals() const; - - /// @brief check if only delete geometry points checkbox is enabled - bool deleteOnlyGeometryPoints() const; - - /// @brief check if protect demand elements checkbox is enabled - bool protectDemandElements() const; - - private: - /// @brief checkbox for enable/disable automatic deletion of additionals children - FXCheckButton* myForceDeleteAdditionals; - - /// @brief checkbox for enable/disable delete only geometry points - FXCheckButton* myDeleteOnlyGeometryPoints; - - /// @brief checkbox for enable/disable automatic deletion of demand children - FXCheckButton* myProtectDemandElements; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEDeleteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEDeleteFrame(); - - /// @brief show delete frame - void show(); - - /// @brief hide delete frame - void hide(); - - /// @brief remove selected attribute carriers (element) - void removeSelectedAttributeCarriers(); - - /**@brief remove attribute carrier (element) - * @param objectsUnderCursor objects under cursors - * @param ignoreOptions ignore delete options and ALWAYS remove AC - */ - void removeAttributeCarrier(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool ignoreOptions = false); - - /// @brief get delete options - DeleteOptions* getDeleteOptions() const; - -protected: - - /// @brief struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement) - struct SubordinatedElements { - - /// @brief constructor (for junctions) - SubordinatedElements(const GNEJunction* junction); - - /// @brief constructor (for edges) - SubordinatedElements(const GNEEdge* edge); - - /// @brief constructor (for lanes) - SubordinatedElements(const GNELane* lane); - - /// @brief constructor (for additionals) - SubordinatedElements(const GNEAdditional* additional); - - /// @brief constructor (for demandElements) - SubordinatedElements(const GNEDemandElement* demandElement); - - /// @brief parent additionals - int parentAdditionals; - - /// @brief child additional - int childAdditionals; - - /// @brief parent demand elements - int parentDemandElements; - - /// @brief child demand elements - int childDemandElements; - - private: - /// @brief add operator - SubordinatedElements& operator+=(const SubordinatedElements& other); - }; - - /// @brief check if there is ACs to delete - bool ACsToDelete() const; - -private: - /// @brief modul for delete options - DeleteOptions* myDeleteOptions; - - /// @brief modul for hierarchy - GNEFrameModuls::AttributeCarrierHierarchy* myAttributeCarrierHierarchy; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,20 +17,15 @@ /// // Auxiliar class for GNEFrame Moduls (only for attributes edition) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - #include #include #include #include -#include +#include #include #include -#include +#include #include #include #include @@ -117,7 +112,7 @@ // GNEFrameAttributesModuls::AttributesCreatorRow - methods // --------------------------------------------------------------------------- -GNEFrameAttributesModuls::AttributesCreatorRow::AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeCarrier::AttributeProperties& attrProperties) : +GNEFrameAttributesModuls::AttributesCreatorRow::AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties) : FXHorizontalFrame(AttributesCreatorParent, GUIDesignAuxiliarHorizontalFrame), myAttributesCreatorParent(AttributesCreatorParent), myAttrProperties(attrProperties) { @@ -217,7 +212,7 @@ } -const GNEAttributeCarrier::AttributeProperties& +const GNEAttributeProperties& GNEFrameAttributesModuls::AttributesCreatorRow::getAttrProperties() const { return myAttrProperties; } @@ -442,11 +437,11 @@ } } else if (myAttrProperties.getAttr() == SUMO_ATTR_ID) { // check ID depending of tag - if (myAttrProperties.getTagPropertyParent().isNetElement() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) { + 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().isAdditional() && !SUMOXMLDefinitions::isValidNetID(myValueTextField->getText().text())) { + } 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(); @@ -567,7 +562,7 @@ GNEFrameAttributesModuls::AttributesCreatorRow::generateID() const { if (myAttrProperties.getTagPropertyParent().isShape()) { return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateShapeID(myAttrProperties.getTagPropertyParent().getTag()); - } else if (myAttrProperties.getTagPropertyParent().isAdditional()) { + } else if (myAttrProperties.getTagPropertyParent().isAdditionalElement()) { return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateAdditionalID(myAttrProperties.getTagPropertyParent().getTag()); } else if (myAttrProperties.getTagPropertyParent().isDemandElement()) { return myAttributesCreatorParent->getFrameParent()->getViewNet()->getNet()->generateDemandElementID("", myAttrProperties.getTagPropertyParent().getTag()); @@ -604,7 +599,7 @@ void -GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties& tagProperties, const std::vector& hiddenAttributes) { +GNEFrameAttributesModuls::AttributesCreator::showAttributesCreatorModul(const GNETagProperties& tagProperties, const std::vector& hiddenAttributes) { // set current tag Properties myTagProperties = tagProperties; // first destroy all rows @@ -640,8 +635,8 @@ showAttribute = false; } // check special case for VType IDs in vehicle Frame - if ((i.getAttr() == SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && - (myFrameParent->getViewNet()->getEditModes().demandEditMode == GNE_DMODE_VEHICLE)) { + if ((i.getAttr() == SUMO_ATTR_TYPE) && (myFrameParent->getViewNet()->getEditModes().isCurrentSupermodeDemand()) && + (myFrameParent->getViewNet()->getEditModes().demandEditMode == DemandEditMode::DEMAND_VEHICLE)) { showAttribute = false; } // show attribute depending of showAttribute flag @@ -703,7 +698,7 @@ } -GNEAttributeCarrier::TagProperties +GNETagProperties GNEFrameAttributesModuls::AttributesCreator::getCurrentTagProperties() const { return myTagProperties; } @@ -1015,7 +1010,7 @@ // GNEFrameAttributesModuls::AttributesEditorRow - methods // --------------------------------------------------------------------------- -GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(GNEFrameAttributesModuls::AttributesEditor* attributeEditorParent, const GNEAttributeCarrier::AttributeProperties& ACAttr, const std::string& value, bool attributeEnabled) : +GNEFrameAttributesModuls::AttributesEditorRow::AttributesEditorRow(GNEFrameAttributesModuls::AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value, bool attributeEnabled) : FXHorizontalFrame(attributeEditorParent, GUIDesignAuxiliarHorizontalFrame), myAttributesEditorParent(attributeEditorParent), myACAttr(ACAttr), @@ -1057,18 +1052,17 @@ } // 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 (((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myACAttr.getTagPropertyParent().isDemandElement()) || - ((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myACAttr.getTagPropertyParent().isDemandElement())) { + 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(); - } else { - myAttributeButtonCombinableChoices->enable(); - myAttributeColorButton->enable(); - myAttributeCheckButton->enable(); } } // set left column @@ -1191,18 +1185,17 @@ } // 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 (((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myACAttr.getTagPropertyParent().isDemandElement()) || - ((myAttributesEditorParent->getFrameParent()->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myACAttr.getTagPropertyParent().isDemandElement())) { + 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(); - } else { - myAttributeButtonCombinableChoices->enable(); - myAttributeColorButton->enable(); - myAttributeCheckButton->enable(); } } // set check buton @@ -2082,13 +2075,16 @@ // GNEFrameAttributesModuls::ParametersEditor - methods // --------------------------------------------------------------------------- -GNEFrameAttributesModuls::ParametersEditor::ParametersEditor(GNEFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Parameters", GUIDesignGroupBoxFrame), +GNEFrameAttributesModuls::ParametersEditor::ParametersEditor(GNEFrame* inspectorFrameParent, std::string title) : + FXGroupBox(inspectorFrameParent->myContentFrame, title.c_str(), GUIDesignGroupBoxFrame), myFrameParent(inspectorFrameParent), - myAC(nullptr) { + myAC(nullptr), + myAttrType(Parameterised::ParameterisedAttrType::STRING) { + // set first letter upper + title[0] = (char)tolower(title[0]); // 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_SET_ATTRIBUTE_DIALOG, GUIDesignButton); + myButtonEditParameters = new FXButton(this, ("Edit " + title).c_str(), nullptr, this, MID_GNE_SET_ATTRIBUTE_DIALOG, GUIDesignButton); } @@ -2096,12 +2092,19 @@ void -GNEFrameAttributesModuls::ParametersEditor::showParametersEditor(GNEAttributeCarrier* AC) { - if ((AC != nullptr) && AC->getTagProperty().hasParameters()) { +GNEFrameAttributesModuls::ParametersEditor::showParametersEditor(GNEAttributeCarrier* AC, std::string title) { + if ((AC != nullptr) && AC->getTagProperty().hasParameters() && (title.size() > 0)) { + // set AC myAC = AC; myACs.clear(); // obtain a copy of AC parameters if (myAC) { + // update flag + if (myAC->getTagProperty().hasDoubleParameters()) { + myAttrType = Parameterised::ParameterisedAttrType::DOUBLE; + } else { + myAttrType = Parameterised::ParameterisedAttrType::STRING; + } // obtain string std::string parametersStr = myAC->getAttribute(GNE_ATTR_PARAMETERS); // clear parameters @@ -2117,6 +2120,12 @@ } } } + // set title and button + myButtonEditParameters->setText(("Edit " + title).c_str()); + // set first letter upper + title[0] = (char)toupper(title[0]); + // change + setText(title.c_str()); // refresh ParametersEditor refreshParametersEditor(); // show groupbox @@ -2128,7 +2137,7 @@ void -GNEFrameAttributesModuls::ParametersEditor::showParametersEditor(std::vector ACs) { +GNEFrameAttributesModuls::ParametersEditor::showParametersEditor(std::vector ACs, std::string title) { if ((ACs.size() > 0) && ACs.front()->getTagProperty().hasParameters()) { myAC = nullptr; myACs = ACs; @@ -2144,6 +2153,12 @@ if (differentsParameters) { myParameters.clear(); } else { + // update flag + if (myACs.front()->getTagProperty().hasDoubleParameters()) { + myAttrType = Parameterised::ParameterisedAttrType::DOUBLE; + } else { + myAttrType = Parameterised::ParameterisedAttrType::STRING; + } // obtain string std::string parametersStr = myACs.front()->getAttribute(GNE_ATTR_PARAMETERS); // clear parameters @@ -2157,6 +2172,12 @@ myParameters[keyValue.front()] = keyValue.back(); } } + // set title and button + myButtonEditParameters->setText(("Edit " + title).c_str()); + // set first letter upper + title[0] = (char)toupper(title[0]); + // change + setText(title.c_str()); // refresh ParametersEditor refreshParametersEditor(); // show groupbox @@ -2182,13 +2203,12 @@ myTextFieldParameters->setText(myAC->getAttribute(GNE_ATTR_PARAMETERS).c_str()); 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 (((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myAC->getTagProperty().isDemandElement()) || - ((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myAC->getTagProperty().isDemandElement())) { - myTextFieldParameters->disable(); - myButtonEditParameters->disable(); - } else { + if (isSupermodeValid(myFrameParent->myViewNet, myAC)) { myTextFieldParameters->enable(); myButtonEditParameters->enable(); + } else { + myTextFieldParameters->disable(); + myButtonEditParameters->disable(); } } else if (myACs.size() > 0) { // check if parameters of all inspected ACs are different @@ -2201,13 +2221,12 @@ myTextFieldParameters->setText(parameters.c_str()); myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); // disable myTextFieldParameters if we're in demand mode and inspected AC isn't a demand element (or viceversa) - if (((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myACs.front()->getTagProperty().isDemandElement()) || - ((myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myACs.front()->getTagProperty().isDemandElement())) { - myTextFieldParameters->disable(); - myButtonEditParameters->disable(); - } else { + if (isSupermodeValid(myFrameParent->myViewNet, myACs.front())) { myTextFieldParameters->enable(); myButtonEditParameters->enable(); + } else { + myTextFieldParameters->disable(); + myButtonEditParameters->disable(); } } } @@ -2267,6 +2286,12 @@ } +Parameterised::ParameterisedAttrType +GNEFrameAttributesModuls::ParametersEditor::getAttrType() const { + return myAttrType; +} + + long GNEFrameAttributesModuls::ParametersEditor::onCmdEditParameters(FXObject*, FXSelector, void*) { // write debug information @@ -2300,9 +2325,7 @@ long GNEFrameAttributesModuls::ParametersEditor::onCmdSetParameters(FXObject*, FXSelector, void*) { // check if current given string is valid - if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true) == false) { - myTextFieldParameters->setTextColor(FXRGB(255, 0, 0)); - } else { + if (Parameterised::areParametersValid(myTextFieldParameters->getText().text(), true, myAttrType)) { // parsed parameters ok, then set text field black and continue myTextFieldParameters->setTextColor(FXRGB(0, 0, 0)); myTextFieldParameters->killFocus(); @@ -2311,9 +2334,9 @@ // clear current existent parameters and set parsed parameters myParameters.clear(); // iterate over parameters - for (const auto& i : parameters) { + for (const auto& parameter : parameters) { // obtain key, value - std::vector keyParam = StringTokenizer(i, "=", true).getVector(); + std::vector keyParam = StringTokenizer(parameter, "=", true).getVector(); // save it in myParameters myParameters[keyParam.front()] = keyParam.back(); } @@ -2339,6 +2362,8 @@ // update frame parent after attribute sucesfully set myFrameParent->attributeUpdated(); } + } else { + myTextFieldParameters->setTextColor(FXRGB(255, 0, 0)); } return 1; } @@ -2410,7 +2435,7 @@ if (myFrameParent->shapeDrawed()) { // clear created points myTemporalShapeShape.clear(); - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // change buttons myStartDrawingButton->enable(); myStopDrawingButton->disable(); @@ -2426,7 +2451,7 @@ GNEFrameAttributesModuls::DrawingShape::abortDrawing() { // clear created points myTemporalShapeShape.clear(); - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // change buttons myStartDrawingButton->enable(); myStopDrawingButton->disable(); @@ -2543,7 +2568,7 @@ void -GNEFrameAttributesModuls::NeteditAttributes::showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties& tagProperty) { +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 @@ -2729,7 +2754,7 @@ GNEFrameAttributesModuls::NeteditAttributes::onCmdHelp(FXObject*, FXSelector, void*) { // Create dialog box FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox); - additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL)); + additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); // set help text std::ostringstream help; help @@ -2750,7 +2775,7 @@ 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(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + 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"); @@ -2809,4 +2834,39 @@ } } + +bool +GNEFrameAttributesModuls::isSupermodeValid(const GNEViewNet* viewNet, const GNEAttributeCarrier* AC) { + if (viewNet->getEditModes().isCurrentSupermodeNetwork() && ( + AC->getTagProperty().isNetworkElement() || + AC->getTagProperty().isAdditionalElement() || + AC->getTagProperty().isShape() || + AC->getTagProperty().isTAZ())) { + 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().isTAZ()) { + 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.5.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameAttributesModuls.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,10 @@ /// // Auxiliar class for GNEFrame Moduls (only for attributes edition) /****************************************************************************/ -#ifndef GNEFrameAttributesModuls_h -#define GNEFrameAttributesModuls_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include +#include #include // =========================================================================== @@ -60,13 +55,13 @@ public: /// @brief constructor - AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeCarrier::AttributeProperties& attrProperties); + AttributesCreatorRow(AttributesCreator* AttributesCreatorParent, const GNEAttributeProperties& attrProperties); /// @brief destroy AttributesCreatorRow (but don't delete) void destroy(); /// @brief return Attr - const GNEAttributeCarrier::AttributeProperties& getAttrProperties() const; + const GNEAttributeProperties& getAttrProperties() const; /// @brief return value std::string getValue() const; @@ -124,7 +119,7 @@ AttributesCreator* myAttributesCreatorParent = nullptr; /// @brief attribute properties - const GNEAttributeCarrier::AttributeProperties myAttrProperties; + const GNEAttributeProperties myAttrProperties; /// @brief string which indicates the reason due current value is invalid std::string myInvalidValue; @@ -164,10 +159,10 @@ ~AttributesCreator(); /**@brief show AttributesCreator modul - * @param tagProperties GNEAttributeCarrier::TagProperties which contain all attributes + * @param tagProperties GNETagProperties which contain all attributes * @param hiddenAttributes list of attributes contained in tagProperties but not shown */ - void showAttributesCreatorModul(const GNEAttributeCarrier::TagProperties& tagProperties, const std::vector& hiddenAttributes); + void showAttributesCreatorModul(const GNETagProperties& tagProperties, const std::vector& hiddenAttributes); /// @brief hide group box void hideAttributesCreatorModul(); @@ -179,7 +174,7 @@ std::map getAttributesAndValues(bool includeAll) const; /// @brief get current edited Tag Properties - GNEAttributeCarrier::TagProperties getCurrentTagProperties() const; + GNETagProperties getCurrentTagProperties() const; /// @brief check if parameters of attributes are valid bool areValuesValid() const; @@ -207,7 +202,7 @@ AttributesCreatorFlow* myAttributesCreatorFlow = nullptr; /// @brief current edited Tag Properties - GNEAttributeCarrier::TagProperties myTagProperties; + GNETagProperties myTagProperties; /// @brief vector with the AttributesCreatorRow std::vector myAttributesCreatorRows; @@ -309,7 +304,7 @@ public: /// @brief constructor - AttributesEditorRow(AttributesEditor* attributeEditorParent, const GNEAttributeCarrier::AttributeProperties& ACAttr, const std::string& value, bool attributeEnabled); + AttributesEditorRow(AttributesEditor* attributeEditorParent, const GNEAttributeProperties& ACAttr, const std::string& value, bool attributeEnabled); /// @brief destroy AttributesCreatorRow (but don't delete) void destroy(); @@ -344,7 +339,7 @@ AttributesEditor* myAttributesEditorParent = nullptr; /// @brief current AC Attribute - const GNEAttributeCarrier::AttributeProperties myACAttr; + const GNEAttributeProperties myACAttr; /// @brief flag to check if input element contains multiple values const bool myMultiple; @@ -561,16 +556,16 @@ public: /// @brief constructor - ParametersEditor(GNEFrame* frameParent); + ParametersEditor(GNEFrame* frameParent, std::string title); /// @brief destructor ~ParametersEditor(); /// @brief show netedit attributes editor (used for edit parameters of an existent AC) - void showParametersEditor(GNEAttributeCarrier* AC); + void showParametersEditor(GNEAttributeCarrier* AC, std::string title); /// @brief show netedit attributes editor (used for edit parameters of an existent list of AC) - void showParametersEditor(std::vector ACs); + void showParametersEditor(std::vector ACs, std::string title); /// @brief hide netedit attributes editor void hideParametersEditor(); @@ -593,6 +588,9 @@ /// @brief pointer to frame parent GNEFrame* getFrameParent() const; + /// @brief get current parameter type + Parameterised::ParameterisedAttrType getAttrType() const; + /// @name FOX-callbacks /// @{ /// @brief Called when user clicks over add parameter @@ -612,6 +610,9 @@ /// @brief edited Attribute Carrier GNEAttributeCarrier* myAC = nullptr; + /// @brief flag for parameters type + Parameterised::ParameterisedAttrType myAttrType; + /// @brief list of edited ACs std::vector myACs; @@ -727,7 +728,7 @@ ~NeteditAttributes(); /// @brief show Netedit attributes modul - void showNeteditAttributesModul(const GNEAttributeCarrier::TagProperties& tagValue); + void showNeteditAttributesModul(const GNETagProperties& tagValue); /// @brief hide Netedit attributes modul void hideNeteditAttributesModul(); @@ -807,9 +808,10 @@ /// @brief actual additional reference point selected in the match Box AdditionalReferencePoint myActualAdditionalReferencePoint; }; -}; - -#endif + /// @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.5.0+dfsg1/src/netedit/frames/GNEFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The Widget for add additional elements /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - #include #include @@ -51,8 +46,12 @@ // fill myPredefinedTagsMML (to avoid repeating this fill during every element creation) int i = 0; while (SUMOXMLDefinitions::attrs[i].key != SUMO_ATTR_NOTHING) { - myPredefinedTagsMML[SUMOXMLDefinitions::attrs[i].key] = toString(SUMOXMLDefinitions::attrs[i].str); - myPredefinedTagsMML[SUMOXMLDefinitions::attrs[i].key] = SUMOXMLDefinitions::attrs[i].str; + int key = SUMOXMLDefinitions::attrs[i].key; + assert(key >= 0); + while (key >= (int)myPredefinedTagsMML.size()) { + myPredefinedTagsMML.push_back(""); + } + myPredefinedTagsMML[key] = SUMOXMLDefinitions::attrs[i].str; i++; } @@ -203,11 +202,11 @@ void -GNEFrame::openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties& tagProperties) const { +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); // Create FXTable FXTable* myTable = new FXTable(attributesHelpDialog, attributesHelpDialog, MID_TABLE, GUIDesignTableNotEditable); - attributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEINSPECT)); + attributesHelpDialog->setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT)); int sizeColumnDescription = 0; int sizeColumnDefinitions = 0; myTable->setVisibleRows((FXint)(tagProperties.getNumberOfAttributes())); @@ -252,7 +251,7 @@ FXHorizontalFrame* myHorizontalFrameOKButton = new FXHorizontalFrame(attributesHelpDialog, GUIDesignAuxiliarHorizontalFrame); // Create Button Close (And two more horizontal frames to center it) new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); - new FXButton(myHorizontalFrameOKButton, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), attributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + 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"); @@ -281,9 +280,10 @@ } -const std::map& +const std::vector& GNEFrame::getPredefinedTagsMML() const { return myPredefinedTagsMML; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Abstract class for lateral frames in NetEdit /****************************************************************************/ -#ifndef GNEFrame_h -#define GNEFrame_h - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include "GNEFrameModuls.h" #include "GNEFrameAttributesModuls.h" @@ -110,7 +104,7 @@ /// @} /// @brief Open help attributes dialog - void openHelpAttributesDialog(const GNEAttributeCarrier::TagProperties& tagProperties) const; + void openHelpAttributesDialog(const GNETagProperties& tagProperties) const; /// @brief get edge candidate color const RGBColor& getEdgeCandidateColor() const; @@ -119,7 +113,7 @@ const RGBColor& getEdgeCandidateSelectedColor() const; /// @brief get predefinedTagsMML - const std::map& getPredefinedTagsMML() const; + const std::vector& getPredefinedTagsMML() const; /// @brief View Net GNEViewNet* myViewNet = nullptr; @@ -153,7 +147,7 @@ RGBColor myEdgeCandidateSelectedColor; /// @brief Map of attribute ids to their (readable) string-representation (needed for SUMOSAXAttributesImpl_Cached) - std::map myPredefinedTagsMML; + std::vector myPredefinedTagsMML; /// @brief Invalidated copy constructor. GNEFrame(const GNEFrame&) = delete; @@ -161,8 +155,3 @@ /// @brief Invalidated assignment operator. GNEFrame& operator=(const GNEFrame&) = delete; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameModuls.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameModuls.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameModuls.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameModuls.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Auxiliar class for GNEFrame Moduls /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== - #include #include @@ -29,15 +24,19 @@ #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 @@ -45,7 +44,7 @@ #include #include "GNEFrameModuls.h" -#include "GNEInspectorFrame.h" + // =========================================================================== @@ -107,50 +106,50 @@ // GNEFrameModuls::TagSelector - methods // --------------------------------------------------------------------------- -GNEFrameModuls::TagSelector::TagSelector(GNEFrame* frameParent, GNEAttributeCarrier::TagType type, bool onlyDrawables) : +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 GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT: - setText("Net elements"); + case GNETagProperties::TagType::NETWORKELEMENT: + setText("network elements"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL: + case GNETagProperties::TagType::ADDITIONALELEMENT: setText("Additional elements"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_SHAPE: + case GNETagProperties::TagType::SHAPE: setText("Shape elements"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_TAZ: + case GNETagProperties::TagType::TAZ: setText("TAZ elements"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_VEHICLE: + case GNETagProperties::TagType::VEHICLE: setText("Vehicles"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_STOP: + case GNETagProperties::TagType::STOP: setText("Stops"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_PERSON: + case GNETagProperties::TagType::PERSON: setText("Persons"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN: + case GNETagProperties::TagType::PERSONPLAN: setText("Person plans"); // person plan type has four sub-groups - myListOfTagTypes.push_back(std::make_pair("person trips", GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP)); - myListOfTagTypes.push_back(std::make_pair("walks", GNEAttributeCarrier::TagType::TAGTYPE_WALK)); - myListOfTagTypes.push_back(std::make_pair("rides", GNEAttributeCarrier::TagType::TAGTYPE_RIDE)); - myListOfTagTypes.push_back(std::make_pair("stops", GNEAttributeCarrier::TagType::TAGTYPE_PERSONSTOP)); + myListOfTagTypes.push_back(std::make_pair("person trips", GNETagProperties::TagType::PERSONTRIP)); + myListOfTagTypes.push_back(std::make_pair("walks", GNETagProperties::TagType::WALK)); + myListOfTagTypes.push_back(std::make_pair("rides", GNETagProperties::TagType::RIDE)); + myListOfTagTypes.push_back(std::make_pair("stops", GNETagProperties::TagType::PERSONSTOP)); break; - case GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP: + case GNETagProperties::TagType::PERSONTRIP: setText("Person trips"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_WALK: + case GNETagProperties::TagType::WALK: setText("Walks"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_RIDE: + case GNETagProperties::TagType::RIDE: setText("Rides"); break; - case GNEAttributeCarrier::TagType::TAGTYPE_PERSONSTOP: + case GNETagProperties::TagType::PERSONSTOP: setText("Person stops"); break; default: @@ -170,12 +169,11 @@ // Set visible items myTagTypesMatchBox->setNumVisible((int)myTagTypesMatchBox->getNumItems()); // fill myListOfTags with personTrips (the first Tag Type) - myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP, onlyDrawables); + myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::PERSONTRIP, onlyDrawables); } else { myTagTypesMatchBox->hide(); // fill myListOfTags myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(type, onlyDrawables); - } // fill myTypeMatchBox with list of tags for (const auto& i : myListOfTags) { @@ -203,22 +201,22 @@ } -const GNEAttributeCarrier::TagProperties& +const GNETagProperties& GNEFrameModuls::TagSelector::getCurrentTagProperties() const { return myCurrentTagProperties; } void -GNEFrameModuls::TagSelector::setCurrentTagType(GNEAttributeCarrier::TagType tagType) { +GNEFrameModuls::TagSelector::setCurrentTagType(GNETagProperties::TagType tagType) { // set empty tag properties - myCurrentTagProperties = GNEAttributeCarrier::TagProperties(); + 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 myListOfTags with personTrips (the first Tag Type) - myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_PERSONTRIP, true); + myListOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::PERSONTRIP, true); // clear myTagsMatchBox myTagsMatchBox->clearItems(); // fill myTypeMatchBox with list of tags @@ -237,7 +235,7 @@ void GNEFrameModuls::TagSelector::setCurrentTag(SumoXMLTag newTag) { // set empty tag properties - myCurrentTagProperties = GNEAttributeCarrier::TagProperties(); + 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)) { @@ -340,7 +338,7 @@ } -GNEFrameModuls::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes) : +GNEFrameModuls::DemandElementSelector::DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes) : FXGroupBox(frameParent->myContentFrame, "Parent element", GUIDesignGroupBoxFrame), myFrameParent(frameParent), myCurrentDemandElement(nullptr) { @@ -429,7 +427,7 @@ myDemandElementsMatchBox->appendItem(DEFAULT_VTYPE_ID.c_str()); myDemandElementsMatchBox->appendItem(DEFAULT_BIKETYPE_ID.c_str()); // add rest of vTypes - for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) { + for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) { // avoid insert duplicated default vType if ((j.first != DEFAULT_VTYPE_ID) && (j.first != DEFAULT_BIKETYPE_ID)) { myDemandElementsMatchBox->appendItem(j.first.c_str()); @@ -439,7 +437,7 @@ // add default Person type in the firs myDemandElementsMatchBox->appendItem(DEFAULT_PEDTYPE_ID.c_str()); // add rest of pTypes - for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) { + for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) { // avoid insert duplicated default pType if (j.first != DEFAULT_PEDTYPE_ID) { myDemandElementsMatchBox->appendItem(j.first.c_str()); @@ -447,7 +445,7 @@ } } else { // insert all Ids - for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) { + for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) { myDemandElementsMatchBox->appendItem(j.first.c_str()); } } @@ -470,16 +468,16 @@ } 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().demandElements.at(SUMO_TAG_VTYPE).at(DEFAULT_VTYPE_ID); + myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VTYPE).at(DEFAULT_VTYPE_ID); } else if (myDemandElementsMatchBox->getItem(0).text() == DEFAULT_PEDTYPE_ID) { - myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PTYPE).at(DEFAULT_PEDTYPE_ID); + myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PTYPE).at(DEFAULT_PEDTYPE_ID); } else { // disable myCurrentDemandElement myCurrentDemandElement = nullptr; // update myCurrentDemandElement with the first allowed element for (auto i = myDemandElementTags.begin(); (i != myDemandElementTags.end()) && (myCurrentDemandElement == nullptr); i++) { - if (myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(*i).size() > 0) { - myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(*i).begin()->second; + if (myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(*i).size() > 0) { + myCurrentDemandElement = myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(*i).begin()->second; } } } @@ -491,7 +489,7 @@ GNEFrameModuls::DemandElementSelector::onCmdSelectDemandElement(FXObject*, FXSelector, void*) { // Check if value of myTypeMatchBox correspond to a demand element for (const auto& i : myDemandElementTags) { - for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(i)) { + for (const auto& j : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getDemandElements().at(i)) { if (j.first == myDemandElementsMatchBox->getText().text()) { // set color of myTypeMatchBox to black (valid) myDemandElementsMatchBox->setTextColor(FXRGB(0, 0, 0)); @@ -521,18 +519,18 @@ // --------------------------------------------------------------------------- GNEFrameModuls::EdgePathCreator::EdgePathCreator(GNEFrame* frameParent, int edgePathCreatorModes) : - FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), + FXGroupBox(frameParent->myContentFrame, "Path creator", GUIDesignGroupBoxFrame), myFrameParent(frameParent), myVClass(SVC_PASSENGER), mySelectedBusStop(nullptr), - myEdgePathCreatorModes(edgePathCreatorModes) { + myModes(edgePathCreatorModes) { // create button for create GEO POIs - myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); + myFinishCreationButton = new FXButton(this, "Finish path creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); myFinishCreationButton->disable(); // create button for create GEO POIs - myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); + myAbortCreationButton = new FXButton(this, "Abort path creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); myAbortCreationButton->disable(); // create button for create GEO POIs @@ -588,8 +586,8 @@ void -GNEFrameModuls::EdgePathCreator::setEdgePathCreatorModes(int edgePathCreatorModes) { - myEdgePathCreatorModes = edgePathCreatorModes; +GNEFrameModuls::EdgePathCreator::setModes(int edgePathCreatorModes) { + myModes = edgePathCreatorModes; } @@ -606,7 +604,7 @@ bool -GNEFrameModuls::EdgePathCreator::addEdge(GNEEdge* edge) { +GNEFrameModuls::EdgePathCreator::addPathEdge(GNEEdge* edge) { bool addEdge = true; // check if final busStop was selected if (mySelectedBusStop != nullptr) { @@ -657,7 +655,7 @@ // calculate route if there is more than two edges if (myClickedEdges.size() > 1) { // calculate temporal route - myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myVClass, myClickedEdges); + myTemporalRoute = myFrameParent->getViewNet()->getNet()->getPathCalculator()->calculatePath(myVClass, myClickedEdges); } else { // use single edge as temporal route myTemporalRoute = myClickedEdges; @@ -700,7 +698,7 @@ void -GNEFrameModuls::EdgePathCreator::drawTemporalRoute() const { +GNEFrameModuls::EdgePathCreator::drawTemporalPath() const { // draw depending of number of edges if (myClickedEdges.size() > 0) { // Add a draw matrix @@ -783,6 +781,8 @@ myAbortCreationButton->disable(); myFinishCreationButton->disable(); myRemoveLastInsertedEdge->disable(); + // update view + myFrameParent->myViewNet->updateViewNet(); return 1; } @@ -792,14 +792,14 @@ // only create route if there is more than two edges if (myClickedEdges.size() > 0) { // depending of tag, check if last element is a busStop - if ((myEdgePathCreatorModes == GNE_EDGEPATHCREATOR_TO_BUSSTOP) && (mySelectedBusStop == nullptr)) { + if ((myModes == TO_BUSSTOP) && (mySelectedBusStop == nullptr)) { WRITE_WARNING("Last clicked element must be a " + toString(SUMO_TAG_BUS_STOP)); return 1; } // call edgePathCreated myFrameParent->edgePathCreated(); // update view - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // clear edges after creation clearEdges(); // disable buttons @@ -819,9 +819,9 @@ // remove last edge myClickedEdges.pop_back(); // calculate temporal route - myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myVClass, myClickedEdges); + myTemporalRoute = myFrameParent->getViewNet()->getNet()->getPathCalculator()->calculatePath(myVClass, myClickedEdges); // update view (to see the new temporal route) - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // check if after pop edge, there is more than one edge if (myClickedEdges.size() == 1) { // disable remove last edge button @@ -856,7 +856,10 @@ myClickedConnection(nullptr), myClickedShape(nullptr), myClickedAdditional(nullptr), - myClickedDemandElement(nullptr) { + myClickedDemandElement(nullptr), + myClickedDataSet(nullptr), + myClickedDataInterval(nullptr), + myClickedGenericData(nullptr) { // Create three list myTreelist = new FXTreeList(this, this, MID_GNE_ACHIERARCHY_SHOWCHILDMENU, GUIDesignTreeListFrame); hide(); @@ -890,6 +893,9 @@ myClickedShape = nullptr; myClickedAdditional = nullptr; myClickedDemandElement = nullptr; + myClickedDataSet = nullptr; + myClickedDataInterval = nullptr; + myClickedGenericData = nullptr; // hide modul hide(); } @@ -908,6 +914,15 @@ } +void +GNEFrameModuls::AttributeCarrierHierarchy::removeCurrentEditedAttribute(const GNEAttributeCarrier* AC) { + // simply check if AC is the same of myAC + if (AC == myAC) { + myAC = nullptr; + } +} + + long GNEFrameModuls::AttributeCarrierHierarchy::onCmdShowChildMenu(FXObject*, FXSelector, void* eventData) { // Obtain event @@ -941,9 +956,11 @@ myFrameParent->myViewNet->centerTo(myClickedShape->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->update(); + myFrameParent->myViewNet->updateViewNet(); return 1; } @@ -987,9 +1004,30 @@ } 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 viewNet - myFrameParent->myViewNet->update(); + // update net + myFrameParent->myViewNet->updateViewNet(); // refresh AC Hierarchy refreshAttributeCarrierHierarchy(); // check if inspector frame has to be shown again @@ -1052,6 +1090,9 @@ myClickedShape = dynamic_cast(clickedAC); myClickedAdditional = dynamic_cast(clickedAC); myClickedDemandElement = dynamic_cast(clickedAC); + myClickedDataSet = dynamic_cast(clickedAC); + myClickedDataInterval = dynamic_cast(clickedAC); + myClickedGenericData = dynamic_cast(clickedAC); // create FXMenuPane FXMenuPane* pane = new FXMenuPane(myTreelist); // set item name and icon @@ -1059,17 +1100,17 @@ // insert separator new FXMenuSeparator(pane); // create center menu command - FXMenuCommand* centerMenuCommand = new FXMenuCommand(pane, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_GNE_CENTER); - // disable Centering for Vehicle Types - if (myClickedAC->getTagProperty().isVehicleType()) { + FXMenuCommand* centerMenuCommand = new FXMenuCommand(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 = new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(ICON_MODEINSPECT), this, MID_GNE_INSPECT); - FXMenuCommand* deleteMenuCommand = new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(ICON_MODEDELETE), this, MID_GNE_DELETE); + FXMenuCommand* inspectMenuCommand = new FXMenuCommand(pane, "Inspect", GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), this, MID_GNE_INSPECT); + FXMenuCommand* deleteMenuCommand = new FXMenuCommand(pane, "Delete", GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), this, MID_GNE_DELETE); // check if inspect and delete menu commands has to be disabled - if ((myClickedAC->getTagProperty().isNetElement() && (myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND)) || - (myClickedAC->getTagProperty().isDemandElement() && (myFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK))) { + if (GNEFrameAttributesModuls::isSupermodeValid(myFrameParent->myViewNet, myClickedAC) == false) { inspectMenuCommand->disable(); deleteMenuCommand->disable(); } @@ -1078,8 +1119,8 @@ // insert separator new FXMenuSeparator(pane); // create both moving menu commands - FXMenuCommand* moveUpMenuCommand = new FXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(ICON_ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP); - FXMenuCommand* moveDownMenuCommand = new FXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(ICON_ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN); + FXMenuCommand* moveUpMenuCommand = new FXMenuCommand(pane, "Move up", GUIIconSubSys::getIcon(GUIIcon::ARROW_UP), this, MID_GNE_ACHIERARCHY_MOVEUP); + FXMenuCommand* moveDownMenuCommand = new FXMenuCommand(pane, "Move down", GUIIconSubSys::getIcon(GUIIcon::ARROW_DOWN), this, MID_GNE_ACHIERARCHY_MOVEDOWN); // check if both commands has to be disabled if (myClickedDemandElement->getTagProperty().isPersonStop()) { moveUpMenuCommand->setText("Move up (Stops cannot be moved)"); @@ -1121,13 +1162,16 @@ myClickedShape = nullptr; myClickedAdditional = nullptr; myClickedDemandElement = nullptr; + myClickedDataSet = nullptr; + myClickedDataInterval = nullptr; + myClickedGenericData = nullptr; } } FXTreeItem* GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierParents() { - if (myAC->getTagProperty().isNetElement()) { + if (myAC->getTagProperty().isNetworkElement()) { // check demand element type switch (myAC->getTagProperty().getTag()) { case SUMO_TAG_EDGE: { @@ -1215,7 +1259,7 @@ } } else if (myAC->getTagProperty().getTag() == SUMO_TAG_POILANE) { // Obtain POILane - GNEPOI* POILane = myFrameParent->myViewNet->getNet()->retrievePOI(myAC->getID(), false); + GNEShape* POILane = myFrameParent->myViewNet->getNet()->retrieveShape(SUMO_TAG_POILANE, myAC->getID(), false); if (POILane) { // obtain parent lane GNELane* lane = myFrameParent->myViewNet->getNet()->retrieveLane(POILane->getParentLanes().at(0)->getID()); @@ -1241,7 +1285,7 @@ } else { return nullptr; } - } else if (myAC->getTagProperty().isAdditional() || myAC->getTagProperty().isTAZ()) { + } else if (myAC->getTagProperty().isAdditionalElement() || myAC->getTagProperty().isTAZ()) { // Obtain Additional GNEAdditional* additional = myFrameParent->myViewNet->getNet()->retrieveAdditional(myAC->getTagProperty().getTag(), myAC->getID(), false); if (additional) { @@ -1371,6 +1415,91 @@ // return last inserted list item return root; } + + } else if (myAC->getTagProperty().isDataElement()) { + // check if is a GNEDataInterval or a GNEGenericData + if (myAC->getTagProperty().getTag() == SUMO_TAG_DATASET) { + return nullptr; + } else if (myAC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { + return addListItem(myFrameParent->myViewNet->getNet()->retrieveDataSet(myAC->getID())); + } else { + // Obtain DataElement + GNEGenericData* dataElement = dynamic_cast(myAC); + 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; @@ -1379,7 +1508,7 @@ void GNEFrameModuls::AttributeCarrierHierarchy::showAttributeCarrierChildren(GNEAttributeCarrier* AC, FXTreeItem* itemParent) { - if (AC->getTagProperty().isNetElement()) { + if (AC->getTagProperty().isNetworkElement()) { // Switch gl type of ac switch (AC->getTagProperty().getTag()) { case SUMO_TAG_JUNCTION: { @@ -1427,6 +1556,10 @@ for (const auto& i : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) { showAttributeCarrierChildren(i, edgeItem); } + // show data elements + for (const auto& i : edge->getChildGenericDataElements()) { + showAttributeCarrierChildren(i, edgeItem); + } } break; } @@ -1483,7 +1616,7 @@ } else if (AC->getTagProperty().isShape()) { // insert shape item addListItem(AC, itemParent); - } else if (AC->getTagProperty().isAdditional() || AC->getTagProperty().isTAZ()) { + } else if (AC->getTagProperty().isAdditionalElement() || AC->getTagProperty().isTAZ()) { // retrieve additional GNEAdditional* additional = myFrameParent->myViewNet->getNet()->retrieveAdditional(AC->getTagProperty().getTag(), AC->getID(), false); if (additional) { @@ -1537,6 +1670,23 @@ showAttributeCarrierChildren(i, demandElementItem); } } + } else if (AC->getTagProperty().isDataElement()) { + // insert data item + FXTreeItem* dataElementItem = addListItem(AC, itemParent); + // insert intervals + if (AC->getTagProperty().getTag() == SUMO_TAG_DATASET) { + GNEDataSet* dataSet = myFrameParent->myViewNet->getNet()->retrieveDataSet(AC->getID()); + // iterate over intevals + for (const auto& interval : dataSet->getDataIntervalChildren()) { + showAttributeCarrierChildren(interval.second, dataElementItem); + } + } else if (AC->getTagProperty().getTag() == SUMO_TAG_DATAINTERVAL) { + GNEDataInterval* dataInterval = dynamic_cast(AC); + // iterate over generic datas + for (const auto& genericData : dataInterval->getGenericDataChildren()) { + showAttributeCarrierChildren(genericData, dataElementItem); + } + } } } @@ -1632,7 +1782,7 @@ if (myFrameParent->shapeDrawed()) { // clear created points myTemporalShapeShape.clear(); - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // change buttons myStartDrawingButton->enable(); myStopDrawingButton->disable(); @@ -1648,7 +1798,7 @@ GNEFrameModuls::DrawingShape::abortDrawing() { // clear created points myTemporalShapeShape.clear(); - myFrameParent->myViewNet->update(); + myFrameParent->myViewNet->updateViewNet(); // change buttons myStartDrawingButton->enable(); myStopDrawingButton->disable(); @@ -1767,7 +1917,7 @@ bool GNEFrameModuls::SelectorParent::showSelectorParentModul(SumoXMLTag additionalType) { // make sure that we're editing an additional tag - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL, false); + auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::ADDITIONALELEMENT, false); for (auto i : listOfTags) { if (i == additionalType) { myParentTag = additionalType; @@ -1793,7 +1943,7 @@ myParentsList->clearItems(); if (myParentTag != SUMO_TAG_NOTHING) { // fill list with IDs of additionals - for (const auto& i : myFrameParent->getViewNet()->getNet()->getAttributeCarriers().additionals.at(myParentTag)) { + for (const auto& i : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getAdditionals().at(myParentTag)) { myParentsList->appendItem(i.first.c_str()); } } @@ -1830,15 +1980,22 @@ GNEFrameModuls::OverlappedInspection::showOverlappedInspection(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition) { // first clear myOverlappedACs myOverlappedACs.clear(); - // check if we have to filter objects under cursor - if (myFilteredTag == SUMO_TAG_NOTHING) { - myOverlappedACs = objectsUnderCursor.getClickedAttributeCarriers(); - } else { - // filter objects under cursor - for (const auto& i : objectsUnderCursor.getClickedAttributeCarriers()) { - if (i->getTagProperty().getTag() == myFilteredTag) { - myOverlappedACs.push_back(i); - } + // reserve + myOverlappedACs.reserve(objectsUnderCursor.getClickedAttributeCarriers().size()); + // iterate over objects under cursor + for (const auto& AC : objectsUnderCursor.getClickedAttributeCarriers()) { + bool insert = true; + // special case for 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); } } mySavedClickedPosition = clickedPosition; @@ -2013,7 +2170,7 @@ << " previous element"; new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation); // "OK" - new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); + new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); helpDialog->create(); helpDialog->show(); return 1; @@ -2029,11 +2186,11 @@ GNEFrameModuls::OverlappedInspection::buildFXElements() { FXHorizontalFrame* frameButtons = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); // Create previous Item Button - myPreviousElement = new FXButton(frameButtons, "", GUIIconSubSys::getIcon(ICON_BIGARROWLEFT), this, MID_GNE_OVERLAPPED_PREVIOUS, GUIDesignButtonIconRectangular); + 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(ICON_BIGARROWRIGHT), this, MID_GNE_OVERLAPPED_NEXT, GUIDesignButtonIconRectangular); + 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, GUIDesignListSingleElement); // disable vertical scrolling @@ -2044,4 +2201,30 @@ myHelpButton = new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); } + +FXLabel* +GNEFrameModuls::buildRainbow(FXComposite* parent, std::vector& scaleColors) { + // create label for color information + FXLabel* label = new FXLabel(parent, "Scale: Min -> Max", nullptr, GUIDesignLabelCenterThick); + // fill scale colors (10) + scaleColors.push_back(RGBColor(232, 35, 0)); + scaleColors.push_back(RGBColor(255, 165, 0)); + scaleColors.push_back(RGBColor(255, 255, 0)); + scaleColors.push_back(RGBColor(28, 215, 0)); + scaleColors.push_back(RGBColor(0, 181, 100)); + scaleColors.push_back(RGBColor(0, 255, 191)); + scaleColors.push_back(RGBColor(178, 255, 255)); + scaleColors.push_back(RGBColor(0, 112, 184)); + scaleColors.push_back(RGBColor(56, 41, 131)); + scaleColors.push_back(RGBColor(127, 0, 255)); + // create frame for color scale + FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(parent, GUIDesignAuxiliarHorizontalFrame); + for (const auto& color : scaleColors) { + FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft); + colorLabel->setBackColor(MFXUtils::getFXColor(color)); + } + // return label + return label; +} + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameModuls.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameModuls.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEFrameModuls.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEFrameModuls.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,10 @@ /// // Auxiliar class for GNEFrame Moduls /****************************************************************************/ -#ifndef GNEFrameModuls_h -#define GNEFrameModuls_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include -#include +#include #include // =========================================================================== @@ -51,7 +46,7 @@ public: /// @brief constructor - TagSelector(GNEFrame* frameParent, GNEAttributeCarrier::TagType type, bool onlyDrawables = true); + TagSelector(GNEFrame* frameParent, GNETagProperties::TagType type, bool onlyDrawables = true); /// @brief destructor ~TagSelector(); @@ -63,10 +58,10 @@ void hideTagSelector(); /// @brief get current type tag - const GNEAttributeCarrier::TagProperties& getCurrentTagProperties() const; + const GNETagProperties& getCurrentTagProperties() const; /// @brief set current type manually - void setCurrentTagType(GNEAttributeCarrier::TagType tagType); + void setCurrentTagType(GNETagProperties::TagType tagType); /// @brief set current type manually void setCurrentTag(SumoXMLTag newTag); @@ -97,16 +92,16 @@ FXComboBox* myTagsMatchBox; /// @brief current tag properties - GNEAttributeCarrier::TagProperties myCurrentTagProperties; + GNETagProperties myCurrentTagProperties; /// @brief list of tags types that will be shown in Match Box - std::vector > myListOfTagTypes; + std::vector > myListOfTagTypes; /// @brief list of tags that will be shown in Match Box std::vector myListOfTags; /// @brief dummy tag properties used if user select an invalid tag - GNEAttributeCarrier::TagProperties myInvalidTagProperty; + GNETagProperties myInvalidTagProperty; }; // =========================================================================== @@ -122,7 +117,7 @@ DemandElementSelector(GNEFrame* frameParent, SumoXMLTag demandElementTag); /// @brief constructor with tag type - DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes); + DemandElementSelector(GNEFrame* frameParent, const std::vector& tagTypes); /// @brief destructor ~DemandElementSelector(); @@ -182,11 +177,12 @@ public: /// @brief list of the edge path creator modes - enum EdgePathCreatorModes { - GNE_EDGEPATHCREATOR_CONSECUTIVE = 1 << 0, // Path must be consecutive - GNE_EDGEPATHCREATOR_FROM_TO_VIA = 1 << 1, // Path requires a from-via-to edges - GNE_EDGEPATHCREATOR_FROM_BUSSTOP = 1 << 2, // Path start in a BusStop - GNE_EDGEPATHCREATOR_TO_BUSSTOP = 1 << 3, // Path ends in a BusStop + enum Modes { + CONSECUTIVE, // Path must be consecutive + FROM_TO, // Path requires only two from-to edges + FROM_TO_VIA, // Path requires a from-via-to edges + FROM_BUSSTOP, // Path start in a BusStop + TO_BUSSTOP // Path ends in a BusStop }; /// @brief default constructor @@ -207,8 +203,8 @@ /// @brief set SUMOVehicleClass void setVClass(SUMOVehicleClass vClass); - /// @brief set EdgePathCreatorModes - void setEdgePathCreatorModes(int edgePathCreatorModes); + /// @brief set Modes + void setModes(int edgePathCreatorModes); /// @brief get current clicked edges std::vector getClickedEdges() const; @@ -216,17 +212,17 @@ /// @brief get current clicked edges GNEAdditional* getClickedBusStop() const; - /// @brief add edge to route - bool addEdge(GNEEdge* edge); + /// @brief add edge in path + bool addPathEdge(GNEEdge* edge); - /// @brief add busStop to route + /// @brief add busStop to path bool addBusStop(GNEAdditional* busStop); - /// @brief clear edges (and restore colors) + /// @brief clear path edges (and restore colors) void clearEdges(); /// @brief draw temporal route - void drawTemporalRoute() const; + void drawTemporalPath() const; /// @brief abort edge path creation void abortEdgePathCreation(); @@ -278,7 +274,7 @@ std::vector myTemporalRoute; /// @brief current edge path creator modes - int myEdgePathCreatorModes; + int myModes; /// @brief restore colors of given edge void restoreEdgeColor(const GNEEdge* edge); @@ -308,6 +304,9 @@ /// @brief refresh AttributeCarrierHierarchy void refreshAttributeCarrierHierarchy(); + /// @brief if given AttributeCarrier is the same of myAC, disable it + void removeCurrentEditedAttribute(const GNEAttributeCarrier* AC); + /// @name FOX-callbacks /// @{ /// @brief called when user press right click over an item of list of children @@ -380,6 +379,15 @@ /// @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 to show the children of the element to erase FXTreeList* myTreelist; @@ -613,9 +621,7 @@ /// @brief saved clicked position Position mySavedClickedPosition; }; -}; - -#endif - -/****************************************************************************/ + /// @brief build rainbow in frame modul + static FXLabel* buildRainbow(FXComposite* parent, std::vector& scaleColors); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEInspectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEInspectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEInspectorFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEInspectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1052 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEInspectorFrame.cpp -/// @author Jakob Erdmann -/// @author Pablo Alvarez Lopez -/// @date Mar 2011 -/// -// The Widget for modifying network-element attributes (i.e. lane speed) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEInspectorFrame.h" -#include "GNEDeleteFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEInspectorFrame) GNEInspectorFrameMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_INSPECTORFRAME_GOBACK, GNEInspectorFrame::onCmdGoBack) -}; - -FXDEFMAP(GNEInspectorFrame::NeteditAttributesEditor) NeteditAttributesEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp) -}; - -FXDEFMAP(GNEInspectorFrame::GEOAttributesEditor) GEOAttributesEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp) -}; - -FXDEFMAP(GNEInspectorFrame::TemplateEditor) TemplateEditorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET, GNEInspectorFrame::TemplateEditor::onCmdSetTemplate), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY, GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate), - -}; - -// 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)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEInspectorFrame::GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): - GNEFrame(horizontalFrameParent, viewNet, "Inspector"), - myPreviousElementInspect(nullptr), - myPreviousElementDelete(nullptr) { - - // Create back button - myBackButton = new FXButton(myHeaderLeftFrame, "", GUIIconSubSys::getIcon(ICON_BIGARROWLEFT), this, MID_GNE_INSPECTORFRAME_GOBACK, GUIDesignButtonIconRectangular); - myHeaderLeftFrame->hide(); - myBackButton->hide(); - - // Create Overlapped Inspection modul - myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this); - - // Create Attributes Editor modul - myAttributesEditor = new GNEFrameAttributesModuls::AttributesEditor(this); - - // Create GEO Parameters Editor modul - myGEOAttributesEditor = new GEOAttributesEditor(this); - - // create parameters Editor modul - myParametersEditor = new GNEFrameAttributesModuls::ParametersEditor(this); - - // Create Netedit Attributes Editor modul - myNeteditAttributesEditor = new NeteditAttributesEditor(this); - - // Create Template editor modul - myTemplateEditor = new TemplateEditor(this); - - // Create AttributeCarrierHierarchy modul - myAttributeCarrierHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this); -} - - -GNEInspectorFrame::~GNEInspectorFrame() {} - - -void -GNEInspectorFrame::show() { - // inspect a null element to reset inspector frame - inspectSingleElement(nullptr); - GNEFrame::show(); -} - - -void -GNEInspectorFrame::hide() { - myViewNet->setDottedAC(nullptr); - GNEFrame::hide(); -} - - -bool -GNEInspectorFrame::processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // first check if we have clicked over an Attribute Carrier - if (objectsUnderCursor.getAttributeCarrierFront()) { - // change the selected attribute carrier if mySelectEdges is enabled and clicked element is a getLaneFront() and shift key isn't pressed - if (!myViewNet->getKeyPressed().shiftKeyPressed() && myViewNet->getNetworkViewOptions().selectEdges() && (objectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE)) { - objectsUnderCursor.swapLane2Edge(); - } - // if Control key is Pressed, select instead inspect element - if (myViewNet->getKeyPressed().controlKeyPressed()) { - // Check if this GLobject type is locked - if (!myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(objectsUnderCursor.getGlTypeFront())) { - // toogle netElement selection - if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { - objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); - } else { - objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); - } - } - } else { - // first check if we clicked over a OverlappedInspection point - if (myViewNet->getKeyPressed().shiftKeyPressed()) { - if (!myOverlappedInspection->previousElement(clickedPosition)) { - // inspect attribute carrier, (or multiselection if AC is selected) - inspectClickedElement(objectsUnderCursor, clickedPosition); - } - } else if (!myOverlappedInspection->nextElement(clickedPosition)) { - // inspect attribute carrier, (or multiselection if AC is selected) - inspectClickedElement(objectsUnderCursor, clickedPosition); - } - // focus upper element of inspector frame - focusUpperElement(); - } - return true; - } else { - return false; - } -} - - -bool -GNEInspectorFrame::processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // first check if we have clicked over a demand element - if (objectsUnderCursor.getDemandElementFront()) { - // if Control key is Pressed, select instead inspect element - if (myViewNet->getKeyPressed().controlKeyPressed()) { - // Check if this GLobject type is locked - if (!myViewNet->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(objectsUnderCursor.getGlTypeFront())) { - // toogle netElement selection - if (objectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { - objectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); - } else { - objectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); - } - } - } else { - // first check if we clicked over a OverlappedInspection point - if (myViewNet->getKeyPressed().shiftKeyPressed()) { - if (!myOverlappedInspection->previousElement(clickedPosition)) { - // inspect attribute carrier, (or multiselection if AC is selected) - inspectClickedElement(objectsUnderCursor, clickedPosition); - } - } else if (!myOverlappedInspection->nextElement(clickedPosition)) { - // inspect attribute carrier, (or multiselection if AC is selected) - inspectClickedElement(objectsUnderCursor, clickedPosition); - } - // focus upper element of inspector frame - focusUpperElement(); - } - return true; - } else { - return false; - } -} - - -void -GNEInspectorFrame::inspectSingleElement(GNEAttributeCarrier* AC) { - // Use the implementation of inspect for multiple AttributeCarriers to avoid repetition of code - std::vector itemsToInspect; - if (AC != nullptr) { - myViewNet->setDottedAC(AC); - if (AC->isAttributeCarrierSelected()) { - // obtain selected ACs depending of current supermode - std::vector selectedACs = myViewNet->getNet()->getSelectedAttributeCarriers(false); - // iterate over selected ACs - for (const auto& i : selectedACs) { - // filter ACs to inspect using Tag as criterium - if (i->getTagProperty().getTag() == AC->getTagProperty().getTag()) { - itemsToInspect.push_back(i); - } - } - } else { - itemsToInspect.push_back(AC); - } - } - inspectMultisection(itemsToInspect); -} - - -void -GNEInspectorFrame::inspectMultisection(const std::vector& ACs) { - // hide back button - myHeaderLeftFrame->hide(); - myBackButton->hide(); - // Hide all elements - myAttributesEditor->hideAttributesEditorModul(); - myNeteditAttributesEditor->hideNeteditAttributesEditor(); - myGEOAttributesEditor->hideGEOAttributesEditor(); - myParametersEditor->hideParametersEditor(); - myTemplateEditor->hideTemplateEditor(); - myAttributeCarrierHierarchy->hideAttributeCarrierHierarchy(); - myOverlappedInspection->hideOverlappedInspection(); - // If vector of attribute Carriers contain data - if (ACs.size() > 0) { - // Set header - std::string headerString; - if (ACs.front()->getTagProperty().isNetElement()) { - headerString = "Net: "; - } else if (ACs.front()->getTagProperty().isAdditional()) { - headerString = "Additional: "; - } else if (ACs.front()->getTagProperty().isShape()) { - headerString = "Shape: "; - } - if (ACs.size() > 1) { - headerString += toString(ACs.size()) + " "; - } - headerString += ACs.front()->getTagStr(); - if (ACs.size() > 1) { - headerString += "s"; - } - // Set headerString into header label - getFrameHeaderLabel()->setText(headerString.c_str()); - - // Show attributes editor - myAttributesEditor->showAttributeEditorModul(ACs, true, false); - - // show netedit attributes editor if we're inspecting elements with Netedit Attributes - myNeteditAttributesEditor->showNeteditAttributesEditor(); - - // Show GEO Attributes Editor if we're inspecting elements with GEO Attributes - myGEOAttributesEditor->showGEOAttributesEditor(); - - // show parameters editor - if (ACs.size() == 1) { - myParametersEditor->showParametersEditor(ACs.front()); - } else { - myParametersEditor->showParametersEditor(ACs); - } - - // If attributes correspond to an Edge and we aren't in demand mode, show template editor - myTemplateEditor->showTemplateEditor(); - - // if we inspect a single Attribute carrier vector, show their children - if (ACs.size() == 1) { - myAttributeCarrierHierarchy->showAttributeCarrierHierarchy(ACs.front()); - } - } else { - getFrameHeaderLabel()->setText("Inspect"); - myContentFrame->recalc(); - } -} - - -void -GNEInspectorFrame::inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement) { - // Show back button if myPreviousElementInspect was defined - myPreviousElementInspect = previousElement; - if (myPreviousElementInspect != nullptr) { - // disable myPreviousElementDelete to avoid inconsistences - myPreviousElementDelete = nullptr; - inspectSingleElement(AC); - myHeaderLeftFrame->show(); - myBackButton->show(); - } -} - - -void -GNEInspectorFrame::inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked) { - myPreviousElementDelete = previousElement; - myPreviousElementDeleteWasMarked = previousElementWasMarked; - // Show back button if myPreviousElementDelete is valid - if (myPreviousElementDelete != nullptr) { - // disable myPreviousElementInspect to avoid inconsistences - myPreviousElementInspect = nullptr; - inspectSingleElement(AC); - myHeaderLeftFrame->show(); - myBackButton->show(); - } -} - - -void -GNEInspectorFrame::clearInspectedAC() { - // Only remove if there is inspected ACs - if (myAttributesEditor->getEditedACs().size() > 0) { - myViewNet->setDottedAC(nullptr); - // Inspect empty selection (to hide all Editors) - inspectMultisection({}); - } -} - - -GNEFrameAttributesModuls::AttributesEditor* -GNEInspectorFrame::getAttributesEditor() const { - return myAttributesEditor; -} - - -GNEInspectorFrame::TemplateEditor* -GNEInspectorFrame::getTemplateEditor() const { - return myTemplateEditor; -} - - -GNEFrameModuls::OverlappedInspection* -GNEInspectorFrame::getOverlappedInspection() const { - return myOverlappedInspection; -} - - -long -GNEInspectorFrame::onCmdGoBack(FXObject*, FXSelector, void*) { - // Inspect previous element or go back to Delete Frame - if (myPreviousElementInspect) { - inspectSingleElement(myPreviousElementInspect); - myPreviousElementInspect = nullptr; - } else if (myPreviousElementDelete != nullptr) { - myPreviousElementDelete = nullptr; - // Hide inspect frame and show delete frame - hide(); - myViewNet->getViewParent()->getDeleteFrame()->show(); - } - return 1; -} - - -void -GNEInspectorFrame::updateFrameAfterUndoRedo() { - // refresh Attribute Editor - myAttributesEditor->refreshAttributeEditor(false, false); - // refresh parametersEditor - myParametersEditor->refreshParametersEditor(); - // refresh AC Hierarchy - myAttributeCarrierHierarchy->refreshAttributeCarrierHierarchy(); -} - - -void -GNEInspectorFrame::selectedOverlappedElement(GNEAttributeCarrier* AC) { - // if AC is a lane but selectEdges checkBox is enabled, then inspect their parent edge - if (AC->getTagProperty().getTag() == SUMO_TAG_LANE && myViewNet->getNetworkViewOptions().selectEdges()) { - inspectSingleElement(dynamic_cast(AC)->getParentEdge()); - } else { - inspectSingleElement(AC); - } - // update view (due dotted contour) - myViewNet->update(); -} - - -void -GNEInspectorFrame::inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition) { - if (objectsUnderCursor.getAttributeCarrierFront()) { - // inspect front element - inspectSingleElement(objectsUnderCursor.getAttributeCarrierFront()); - // if element has overlapped elements, show Overlapped Inspection modul - if (objectsUnderCursor.getClickedAttributeCarriers().size() > 1) { - myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition); - } else { - myOverlappedInspection->hideOverlappedInspection(); - } - } -} - - -void -GNEInspectorFrame::attributeUpdated() { - myAttributesEditor->refreshAttributeEditor(false, false); - myNeteditAttributesEditor->refreshNeteditAttributesEditor(true); - myGEOAttributesEditor->refreshGEOAttributesEditor(true); -} - -// --------------------------------------------------------------------------- -// GNEInspectorFrame::NeteditAttributesEditor - methods -// --------------------------------------------------------------------------- - -GNEInspectorFrame::NeteditAttributesEditor::NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Netedit attributes", GUIDesignGroupBoxFrame), - myInspectorFrameParent(inspectorFrameParent) { - - // Create elements for parent additional - myHorizontalFrameParentAdditional = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myLabelParentAdditional = new FXLabel(myHorizontalFrameParentAdditional, "Block move", nullptr, GUIDesignLabelAttribute); - myTextFieldParentAdditional = new FXTextField(myHorizontalFrameParentAdditional, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - - // Create elements for block movement - myHorizontalFrameBlockMovement = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myLabelBlockMovement = new FXLabel(myHorizontalFrameBlockMovement, "Block move", nullptr, GUIDesignLabelAttribute); - myCheckBoxBlockMovement = new FXCheckButton(myHorizontalFrameBlockMovement, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - - // Create elements for block shape - myHorizontalFrameBlockShape = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myLabelBlockShape = new FXLabel(myHorizontalFrameBlockShape, "Block shape", nullptr, GUIDesignLabelAttribute); - myCheckBoxBlockShape = new FXCheckButton(myHorizontalFrameBlockShape, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - - // Create elements for close shape - myHorizontalFrameCloseShape = new FXHorizontalFrame(this, 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); -} - - -GNEInspectorFrame::NeteditAttributesEditor::~NeteditAttributesEditor() {} - - -void -GNEInspectorFrame::NeteditAttributesEditor::showNeteditAttributesEditor() { - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { - // enable all editable elements - myTextFieldParentAdditional->enable(); - myCheckBoxBlockMovement->enable(); - myCheckBoxBlockShape->enable(); - myCheckBoxCloseShape->enable(); - // obtain tag property (only for improve code legibility) - const auto& tagValue = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); - // Check if item can be moved - if (tagValue.canBlockMovement()) { - // show NeteditAttributesEditor - show(); - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT)); - } - // show block movement frame - myHorizontalFrameBlockMovement->show(); - // set check box value and update label - if (value) { - myCheckBoxBlockMovement->setCheck(true); - myCheckBoxBlockMovement->setText("true"); - } else { - myCheckBoxBlockMovement->setCheck(false); - myCheckBoxBlockMovement->setText("false"); - } - } - // check if item can block their shape - if (tagValue.canBlockShape()) { - // show NeteditAttributesEditor - show(); - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_SHAPE)); - } - // show block shape frame - myHorizontalFrameBlockShape->show(); - // set check box value and update label - if (value) { - myCheckBoxBlockShape->setCheck(true); - myCheckBoxBlockShape->setText("true"); - } else { - myCheckBoxBlockShape->setCheck(false); - myCheckBoxBlockShape->setText("false"); - } - } - // check if item can block their shape - if (tagValue.canCloseShape()) { - // show NeteditAttributesEditor - show(); - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_CLOSE_SHAPE)); - } - // show close shape frame - myHorizontalFrameCloseShape->show(); - // set check box value and update label - if (value) { - myCheckBoxCloseShape->setCheck(true); - myCheckBoxCloseShape->setText("true"); - } else { - myCheckBoxCloseShape->setCheck(false); - myCheckBoxCloseShape->setText("false"); - } - } - // Check if item has another item as parent and can be reparemt - if (tagValue.hasParent() && tagValue.canBeReparent()) { - // show NeteditAttributesEditor - show(); - // obtain additional Parent - std::set parents; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - parents.insert(i->getAttribute(GNE_ATTR_PARENT)); - } - // show parent additional frame - myHorizontalFrameParentAdditional->show(); - // set Label and TextField with the Tag and ID of parent - myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str()); - 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 (((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement()) || - ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement())) { - myTextFieldParentAdditional->disable(); - myCheckBoxBlockMovement->disable(); - myCheckBoxBlockShape->disable(); - myCheckBoxCloseShape->disable(); - } - } -} - - -void -GNEInspectorFrame::NeteditAttributesEditor::hideNeteditAttributesEditor() { - // hide all elements of GroupBox - myHorizontalFrameParentAdditional->hide(); - myHorizontalFrameBlockMovement->hide(); - myHorizontalFrameBlockShape->hide(); - myHorizontalFrameCloseShape->hide(); - // hide groupbox - hide(); -} - - -void -GNEInspectorFrame::NeteditAttributesEditor::refreshNeteditAttributesEditor(bool forceRefresh) { - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { - // refresh block movement - if (myHorizontalFrameBlockMovement->shown()) { - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_MOVEMENT)); - } - // set check box value and update label - if (value) { - myCheckBoxBlockMovement->setCheck(true); - myCheckBoxBlockMovement->setText("true"); - } else { - myCheckBoxBlockMovement->setCheck(false); - myCheckBoxBlockMovement->setText("false"); - } - } - // refresh block shape - if (myHorizontalFrameBlockShape->shown()) { - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_BLOCK_SHAPE)); - } - // set check box value and update label - if (value) { - myCheckBoxBlockShape->setCheck(true); - myCheckBoxBlockShape->setText("true"); - } else { - myCheckBoxBlockShape->setCheck(false); - myCheckBoxBlockShape->setText("false"); - } - } - // refresh close shape - if (myHorizontalFrameCloseShape->shown()) { - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(GNE_ATTR_CLOSE_SHAPE)); - } - // set check box value and update label - if (value) { - myCheckBoxCloseShape->setCheck(true); - myCheckBoxCloseShape->setText("true"); - } else { - myCheckBoxCloseShape->setCheck(false); - myCheckBoxCloseShape->setText("false"); - } - } - // Check if item has another item as parent (Currently only for single Additionals) - if (myHorizontalFrameParentAdditional->shown() && ((myTextFieldParentAdditional->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) { - // set Label and TextField with the Tag and ID of parent - myLabelParentAdditional->setText((toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getParentTag()) + " parent").c_str()); - myTextFieldParentAdditional->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(GNE_ATTR_PARENT).c_str()); - } - } -} - - -long -GNEInspectorFrame::NeteditAttributesEditor::onCmdSetNeteditAttribute(FXObject* obj, FXSelector, void*) { - // make sure that ACs has elements - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { - // check if we're changing multiple attributes - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) { - myInspectorFrameParent->myViewNet->getUndoList()->p_begin("Change multiple attributes"); - } - if (obj == myCheckBoxBlockMovement) { - // set new values in all inspected Attribute Carriers - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - if (myCheckBoxBlockMovement->getCheck() == 1) { - i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "true", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxBlockMovement->setText("true"); - } else { - i->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, "false", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxBlockMovement->setText("false"); - } - } - } else if (obj == myCheckBoxBlockShape) { - // set new values in all inspected Attribute Carriers - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - if (myCheckBoxBlockShape->getCheck() == 1) { - i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxBlockShape->setText("true"); - } else { - i->setAttribute(GNE_ATTR_BLOCK_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxBlockShape->setText("false"); - } - } - } else if (obj == myCheckBoxCloseShape) { - // set new values in all inspected Attribute Carriers - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - if (myCheckBoxCloseShape->getCheck() == 1) { - i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "true", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxCloseShape->setText("true"); - } else { - i->setAttribute(GNE_ATTR_CLOSE_SHAPE, "false", myInspectorFrameParent->myViewNet->getUndoList()); - myCheckBoxCloseShape->setText("false"); - } - } - } else if (obj == myTextFieldParentAdditional) { - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text())) { - // replace the parent of all inspected elements - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - i->setAttribute(GNE_ATTR_PARENT, myTextFieldParentAdditional->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); - } - myTextFieldParentAdditional->setTextColor(FXRGB(0, 0, 0)); - myTextFieldParentAdditional->killFocus(); - } else { - myTextFieldParentAdditional->setTextColor(FXRGB(255, 0, 0)); - } - } - // finish change multiple attributes - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 1) { - myInspectorFrameParent->myViewNet->getUndoList()->p_end(); - } - // force refresh values of AttributesEditor and GEOAttributesEditor - myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); - myInspectorFrameParent->myGEOAttributesEditor->refreshGEOAttributesEditor(true); - } - return 1; -} - - -long -GNEInspectorFrame::NeteditAttributesEditor::onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*) { - return 0; -} - -// --------------------------------------------------------------------------- -// GNEInspectorFrame::GEOAttributesEditor - methods -// --------------------------------------------------------------------------- - -GNEInspectorFrame::GEOAttributesEditor::GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "GEO Attributes", GUIDesignGroupBoxFrame), - myInspectorFrameParent(inspectorFrameParent) { - - // Create Frame for GEOAttribute - myGEOAttributeFrame = new FXHorizontalFrame(this, 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); - 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); -} - - -GNEInspectorFrame::GEOAttributesEditor::~GEOAttributesEditor() {} - - -void -GNEInspectorFrame::GEOAttributesEditor::showGEOAttributesEditor() { - // make sure that ACs has elements - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0) { - // enable all editable elements - myGEOAttributeTextField->enable(); - myUseGEOCheckButton->enable(); - // obtain tag property (only for improve code legibility) - const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); - // check if item can use a geo position - if (tagProperty.hasGEOPosition() || tagProperty.hasGEOShape()) { - // show GEOAttributesEditor - show(); - // Iterate over AC to obtain values - bool value = true; - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - value &= GNEAttributeCarrier::parse(i->getAttribute(SUMO_ATTR_GEO)); - } - // show use geo frame - myUseGEOFrame->show(); - // set UseGEOCheckButton value of and update label (only if geo conversion is defined) - if (GeoConvHelper::getFinal().getProjString() != "!") { - myUseGEOCheckButton->enable(); - if (value) { - myUseGEOCheckButton->setCheck(true); - myUseGEOCheckButton->setText("true"); - } else { - myUseGEOCheckButton->setCheck(false); - myUseGEOCheckButton->setText("false"); - } - } else { - myUseGEOCheckButton->disable(); - } - // now specify if a single position or an entire shape must be shown (note: cannot be shown both at the same time, and GEO Shape/Position only works for single selections) - if (tagProperty.hasGEOPosition() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { - myGEOAttributeFrame->show(); - myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOPOSITION).c_str()); - myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); - // only allow edit if geo conversion is defined - if (GeoConvHelper::getFinal().getProjString() != "!") { - myGEOAttributeTextField->enable(); - myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str()); - } else { - myGEOAttributeTextField->disable(); - myGEOAttributeTextField->setText("No geo-conversion defined"); - } - } else if (tagProperty.hasGEOShape() && myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { - myGEOAttributeFrame->show(); - myGEOAttributeLabel->setText(toString(SUMO_ATTR_GEOSHAPE).c_str()); - myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); - // only allow edit if geo conversion is defined - if (GeoConvHelper::getFinal().getProjString() != "!") { - myGEOAttributeTextField->enable(); - myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str()); - } else { - myGEOAttributeTextField->disable(); - myGEOAttributeTextField->setText("No geo-conversion defined"); - } - } - } - // disable all editable elements if we're in demand mode and inspected AC isn't a demand element - if (((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement()) || - ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && !myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().isDemandElement())) { - myGEOAttributeTextField->disable(); - myUseGEOCheckButton->disable(); - } - } -} - - -void -GNEInspectorFrame::GEOAttributesEditor::hideGEOAttributesEditor() { - // hide all elements of GroupBox - myGEOAttributeFrame->hide(); - myUseGEOFrame->hide(); - // hide groupbox - hide(); -} - - -void -GNEInspectorFrame::GEOAttributesEditor::refreshGEOAttributesEditor(bool forceRefresh) { - // obtain tag property (only for improve code legibility) - const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); - // Check that myGEOAttributeFrame is shown - if ((GeoConvHelper::getFinal().getProjString() != "!") && myGEOAttributeFrame->shown() && ((myGEOAttributeTextField->getTextColor() == FXRGB(0, 0, 0)) || forceRefresh)) { - if (tagProperty.hasGEOPosition()) { - myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOPOSITION).c_str()); - } else if (tagProperty.hasGEOShape()) { - myGEOAttributeTextField->setText(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getAttribute(SUMO_ATTR_GEOSHAPE).c_str()); - } - myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); - } -} - - -long -GNEInspectorFrame::GEOAttributesEditor::onCmdSetGEOAttribute(FXObject* obj, FXSelector, void*) { - // make sure that ACs has elements - if ((GeoConvHelper::getFinal().getProjString() != "!") && (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() > 0)) { - if (obj == myGEOAttributeTextField) { - // obtain tag property (only for improve code legibility) - const auto& tagProperty = myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty(); - // Change GEO Attribute depending of type (Position or shape) - if (tagProperty.hasGEOPosition()) { - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text())) { - myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOPOSITION, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); - myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); - myGEOAttributeTextField->killFocus(); - } else { - myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0)); - } - } else if (tagProperty.hasGEOShape()) { - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->isValid(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text())) { - myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->setAttribute(SUMO_ATTR_GEOSHAPE, myGEOAttributeTextField->getText().text(), myInspectorFrameParent->myViewNet->getUndoList()); - myGEOAttributeTextField->setTextColor(FXRGB(0, 0, 0)); - myGEOAttributeTextField->killFocus(); - } else { - myGEOAttributeTextField->setTextColor(FXRGB(255, 0, 0)); - } - } else { - throw ProcessError("myGEOAttributeTextField must be hidden becaurse there isn't GEO Attribute to edit"); - } - } else if (obj == myUseGEOCheckButton) { - // update GEO Attribute of entire selection - for (const auto& i : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - if (myUseGEOCheckButton->getCheck() == 1) { - i->setAttribute(SUMO_ATTR_GEO, "true", myInspectorFrameParent->myViewNet->getUndoList()); - myUseGEOCheckButton->setText("true"); - } else { - i->setAttribute(SUMO_ATTR_GEO, "false", myInspectorFrameParent->myViewNet->getUndoList()); - myUseGEOCheckButton->setText("false"); - } - } - } - // force refresh values of Attributes editor and NeteditAttributesEditor - myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); - myInspectorFrameParent->myNeteditAttributesEditor->refreshNeteditAttributesEditor(true); - } - return 1; -} - - -long -GNEInspectorFrame::GEOAttributesEditor::onCmdGEOAttributeHelp(FXObject*, FXSelector, void*) { - FXDialogBox* helpDialog = new FXDialogBox(this, "GEO attributes Help", GUIDesignDialogBox); - std::ostringstream help; - help - << " SUMO uses the World Geodetic System 84 (WGS84/UTM).\n" - << " For a GEO-referenced network, geo coordinates are represented as pairs of Longitude and Latitude\n" - << " in decimal degrees without extra symbols. (N,W..)\n" - << " - Longitude: East-west position of a point on the Earth's surface.\n" - << " - Latitude: North-south position of a point on the Earth's surface.\n" - << " - CheckBox 'geo' enables or disables saving position in GEO coordinates\n"; - new FXLabel(helpDialog, help.str().c_str(), nullptr, GUIDesignLabelFrameInformation); - // "OK" - new FXButton(helpDialog, "OK\t\tclose", GUIIconSubSys::getIcon(ICON_ACCEPT), helpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); - helpDialog->create(); - helpDialog->show(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNEInspectorFrame::TemplateEditor - methods -// --------------------------------------------------------------------------- - -GNEInspectorFrame::TemplateEditor::TemplateEditor(GNEInspectorFrame* inspectorFrameParent) : - FXGroupBox(inspectorFrameParent->myContentFrame, "Templates", GUIDesignGroupBoxFrame), - myInspectorFrameParent(inspectorFrameParent), - myEdgeTemplate(nullptr) { - // Create set template button - mySetTemplateButton = new FXButton(this, "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); - // Create copy template button - myClearTemplateButton = new FXButton(this, "clear Edge Template", nullptr, this, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GUIDesignButton); -} - - -GNEInspectorFrame::TemplateEditor::~TemplateEditor() { - // before destroy template editor, we need to check if there is an active edge template - if (myEdgeTemplate) { - // decrease reference - myEdgeTemplate->decRef("GNEInspectorFrame::~GNEInspectorFrame"); - // delete edge template if is unreferenced - if (myEdgeTemplate->unreferenced()) { - delete myEdgeTemplate; - } - } -} - - -void -GNEInspectorFrame::TemplateEditor::showTemplateEditor() { - // show template editor only if we're editing an edge in Network mode - if ((myInspectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && - (myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getTagProperty().getTag() == SUMO_TAG_EDGE)) { - // show "Set As Template" - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { - mySetTemplateButton->show(); - mySetTemplateButton->setText(("Set edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "' as Template").c_str()); - } - // update buttons - updateButtons(); - // show modul - show(); - } -} - - -void -GNEInspectorFrame::TemplateEditor::hideTemplateEditor() { - // hide template editor - hide(); -} - - -GNEEdge* -GNEInspectorFrame::TemplateEditor::getEdgeTemplate() const { - return myEdgeTemplate; -} - - -void -GNEInspectorFrame::TemplateEditor::setTemplate() { - // check if template editor AND mySetTemplateButton is enabled - if (shown() && mySetTemplateButton->isEnabled()) { - onCmdSetTemplate(nullptr, 0, nullptr); - } -} - - -void -GNEInspectorFrame::TemplateEditor::copyTemplate() { - // check if template editor AND myCopyTemplateButton is enabled - if (shown() && myCopyTemplateButton->isEnabled()) { - onCmdCopyTemplate(nullptr, 0, nullptr); - } -} - - -void -GNEInspectorFrame::TemplateEditor::clearTemplate() { - // check if template editor AND myClearTemplateButton is enabled - if (shown() && myClearTemplateButton->isEnabled()) { - onCmdClearTemplate(nullptr, 0, nullptr); - } -} - - -long -GNEInspectorFrame::TemplateEditor::onCmdSetTemplate(FXObject*, FXSelector, void*) { - // first check that there is exactly an inspected edge - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() != 1) { - throw ProcessError("Only one edge must be inspected"); - } - // retrieve edge ID (and throw exception if edge doesn't exist) - GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID()); - // set template - setEdgeTemplate(edge); - // update buttons - updateButtons(); - return 1; -} - - -long -GNEInspectorFrame::TemplateEditor::onCmdCopyTemplate(FXObject*, FXSelector, void*) { - for (const auto& it : myInspectorFrameParent->myAttributesEditor->getEditedACs()) { - // retrieve edge ID (and throw exception if edge doesn't exist) - GNEEdge* edge = myInspectorFrameParent->myViewNet->getNet()->retrieveEdge(it->getID()); - // copy template - edge->copyTemplate(myEdgeTemplate, myInspectorFrameParent->myViewNet->getUndoList()); - // refresh inspector parent - myInspectorFrameParent->myAttributesEditor->refreshAttributeEditor(true, true); - } - // update view (to see visual changes) - myInspectorFrameParent->myViewNet->update(); - return 1; -} - - -long -GNEInspectorFrame::TemplateEditor::onCmdClearTemplate(FXObject*, FXSelector, void*) { - setEdgeTemplate(nullptr); - // update buttons - updateButtons(); - return 1; -} - - -void -GNEInspectorFrame::TemplateEditor::setEdgeTemplate(GNEEdge* tpl) { - // before change edge template, we need to check if there is another active edge template - if (myEdgeTemplate) { - // decrease reference - myEdgeTemplate->decRef("GNEInspectorFrame::setEdgeTemplate"); - // delete edge template if is unreferenced - if (myEdgeTemplate->unreferenced()) { - delete myEdgeTemplate; - } - } - // check if we're setting a new edge template or removing it - if (tpl) { - // set new edge template - myEdgeTemplate = tpl; - // increase reference - myEdgeTemplate->incRef("GNEInspectorFrame::setEdgeTemplate"); - } else { - // clear edge template - myEdgeTemplate = nullptr; - } -} - - -void -GNEInspectorFrame::TemplateEditor::updateButtons() { - // enable or disable clear buttons depending of myEdgeTemplate - if (myEdgeTemplate) { - // update caption of copy button - if (myInspectorFrameParent->myAttributesEditor->getEditedACs().size() == 1) { - myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into edge '" + myInspectorFrameParent->myAttributesEditor->getEditedACs().front()->getID() + "'").c_str()); - } else { - myCopyTemplateButton->setText(("Copy '" + myEdgeTemplate->getMicrosimID() + "' into " + toString(myInspectorFrameParent->myAttributesEditor->getEditedACs().size()) + " selected edges").c_str()); - } - // enable set and clear buttons - myCopyTemplateButton->enable(); - myClearTemplateButton->enable(); - } else { - // update caption of copy button - myCopyTemplateButton->setText("No edge Template Set"); - // disable set and clear buttons - myCopyTemplateButton->disable(); - myClearTemplateButton->disable(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEInspectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEInspectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEInspectorFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEInspectorFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,371 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEInspectorFrame.h -/// @author Jakob Erdmann -/// @author Pablo Alvarez Lopez -/// @date Mar 2011 -/// -// The Widget for modifying network-element attributes (i.e. lane speed) -/****************************************************************************/ -#ifndef GNEInspectorFrame_h -#define GNEInspectorFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEInspectorFrame - * The Widget for modifying network-element attributes (i.e. lane speed) - */ -class GNEInspectorFrame : public GNEFrame { - /// @brief FOX-declaration - FXDECLARE(GNEInspectorFrame) - -public: - // =========================================================================== - // class NeteditAttributesEditor - // =========================================================================== - - class NeteditAttributesEditor : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEInspectorFrame::NeteditAttributesEditor) - - public: - /// @brief constructor - NeteditAttributesEditor(GNEInspectorFrame* inspectorFrameParent); - - /// @brief destructor - ~NeteditAttributesEditor(); - - /// @brief show netedit attributes editor - void showNeteditAttributesEditor(); - - /// @brief hide netedit attributes editor - void hideNeteditAttributesEditor(); - - /// @brief refresh netedit attributes - void refreshNeteditAttributesEditor(bool forceRefresh); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when user change the current GEO Attribute - long onCmdSetNeteditAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when user press the help button - long onCmdNeteditAttributeHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(NeteditAttributesEditor) - - private: - /// @brief pointer to inspector frame parent - GNEInspectorFrame* myInspectorFrameParent; - - /// @frame horizontal frame for replace the parent additional - FXHorizontalFrame* myHorizontalFrameParentAdditional; - - /// @brief Label for parent additional - FXLabel* myLabelParentAdditional; - - /// @brief pointer for replace the parent additional - FXTextField* myTextFieldParentAdditional; - - /// @frame horizontal frame for block movement - FXHorizontalFrame* myHorizontalFrameBlockMovement; - - /// @brief Label for Check blocked movement - FXLabel* myLabelBlockMovement; - - /// @brief pointer to check box "Block movement" - FXCheckButton* myCheckBoxBlockMovement; - - /// @frame horizontal frame for block shape - FXHorizontalFrame* myHorizontalFrameBlockShape; - - /// @brief Label for Check blocked shape - FXLabel* myLabelBlockShape; - - /// @brief pointer to check box "Block Shape" - FXCheckButton* myCheckBoxBlockShape; - - /// @frame horizontal frame for close shape - FXHorizontalFrame* myHorizontalFrameCloseShape; - - /// @brief Label for close shape - FXLabel* myLabelCloseShape; - - /// @brief pointer to check box "Block movement" - FXCheckButton* myCheckBoxCloseShape; - - /// @brief button for help - FXButton* myHelpButton; - }; - - // =========================================================================== - // class GEOAttributesEditor - // =========================================================================== - - class GEOAttributesEditor : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEInspectorFrame::GEOAttributesEditor) - - public: - /// @brief constructor - GEOAttributesEditor(GNEInspectorFrame* inspectorFrameParent); - - /// @brief destructor - ~GEOAttributesEditor(); - - /// @brief show GEO attributes editor - void showGEOAttributesEditor(); - - /// @brief hide GEO attributes editor - void hideGEOAttributesEditor(); - - /// @brief refresh GEO attributes editor - void refreshGEOAttributesEditor(bool forceRefresh); - - /// @name FOX-callbacks - /// @{ - - /// @brief Called when user change the current GEO Attribute - long onCmdSetGEOAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when user press the help button - long onCmdGEOAttributeHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(GEOAttributesEditor) - - private: - /// @brief current GNEInspectorFrame parent - GNEInspectorFrame* myInspectorFrameParent; - - /// @brief horizontal frame for GEOAttribute - FXHorizontalFrame* myGEOAttributeFrame; - - /// @brief Label for GEOAttribute - FXLabel* myGEOAttributeLabel; - - /// @brief textField for GEOAttribute - FXTextField* myGEOAttributeTextField; - - /// @brief horizontal frame for use GEO - FXHorizontalFrame* myUseGEOFrame; - - /// @brief Label for use GEO - FXLabel* myUseGEOLabel; - - /// @brief checkBox for use GEO - FXCheckButton* myUseGEOCheckButton; - - /// @brief button for help - FXButton* myHelpButton; - }; - - // =========================================================================== - // class TemplateEditor - // =========================================================================== - - class TemplateEditor : private FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEInspectorFrame::TemplateEditor) - - public: - /// @brief constructor - TemplateEditor(GNEInspectorFrame* inspectorFrameParent); - - /// @brief destructor - ~TemplateEditor(); - - /// @brief show template editor - void showTemplateEditor(); - - /// @brief hide template editor - void hideTemplateEditor(); - - /// @brief get the template edge (to copy attributes from) - GNEEdge* getEdgeTemplate() const; - - /// @brief set template (used by shortcut) - void setTemplate(); - - /// @brief copy template (used by shortcut) - void copyTemplate(); - - /// @brief clear template (used by shortcut) - void clearTemplate(); - - /// @name FOX-callbacks - /// @{ - - /// @brief set current edge as new template - long onCmdSetTemplate(FXObject*, FXSelector, void*); - - /// @brief copy edge attributes from edge template - long onCmdCopyTemplate(FXObject*, FXSelector, void*); - - /// @brief clear current edge template - long onCmdClearTemplate(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TemplateEditor) - - /// @brief seh the template edge (we assume shared responsibility via reference counting) - void setEdgeTemplate(GNEEdge* tpl); - - /// @brief update buttons - void updateButtons(); - - private: - /// @brief current GNEInspectorFrame parent - GNEInspectorFrame* myInspectorFrameParent; - - /// @brief set template button - FXButton* mySetTemplateButton; - - /// @brief copy template button - FXButton* myCopyTemplateButton; - - /// @brief clear template button - FXButton* myClearTemplateButton; - - /// @brief pointer to edge template - GNEEdge* myEdgeTemplate; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEInspectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEInspectorFrame(); - - /// @brief show inspector frame - void show(); - - /// @brief hide inspector frame - void hide(); - - /**@brief process click over Viewnet in Supermode Network - * @param[in] clickedPosition clicked position over ViewNet - * @param[in] objectsUnderCursor objects under cursors - * @return true if something was sucefully done - */ - bool processNetworkSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /**@brief process click over Viewnet in Supermode Demand - * @param[in] clickedPosition clicked position over ViewNet - * @param[in] objectsUnderCursor objects under cursors - * @return true if something was sucefully done - */ - bool processDemandSupermodeClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief Inspect a single element - void inspectSingleElement(GNEAttributeCarrier* AC); - - /// @brief Inspect the given multi-selection - void inspectMultisection(const std::vector& ACs); - - /// @brief inspect child of already inspected element - void inspectChild(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement); - - /// @brief inspect called from DeleteFrame - void inspectFromDeleteFrame(GNEAttributeCarrier* AC, GNEAttributeCarrier* previousElement, bool previousElementWasMarked); - - /// @brief Clear all current inspected ACs - void clearInspectedAC(); - - /// @brief get AttributesEditor - GNEFrameAttributesModuls::AttributesEditor* getAttributesEditor() const; - - /// @brief get template editor - TemplateEditor* getTemplateEditor() const; - - /// @brief get OverlappedInspection modul - GNEFrameModuls::OverlappedInspection* getOverlappedInspection() const; - - /// @name FOX-callbacks - /// @{ - - /// @brief called when user toogle the go back button - long onCmdGoBack(FXObject*, FXSelector, void*); - /// @} - - /// @brief function called after undo/redo in the current frame (can be reimplemented in frame children) - void updateFrameAfterUndoRedo(); - - /// @brief open AttributesCreator extended dialog (can be reimplemented in frame children) - void selectedOverlappedElement(GNEAttributeCarrier* AC); - -protected: - FOX_CONSTRUCTOR(GNEInspectorFrame) - - /// @brief Inspect a singe element (the front of AC AttributeCarriers of ObjectUnderCursor - void inspectClickedElement(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, const Position& clickedPosition); - - /// @brief function called after set a valid attribute in AttributeEditor - void attributeUpdated(); - -private: - /// @brief Overlapped Inspection - GNEFrameModuls::OverlappedInspection* myOverlappedInspection; - - /// @brief Attribute editor - GNEFrameAttributesModuls::AttributesEditor* myAttributesEditor; - - /// @brief Netedit Attributes editor - NeteditAttributesEditor* myNeteditAttributesEditor; - - /// @brief GEO Attributes editor - GEOAttributesEditor* myGEOAttributesEditor; - - /// @brief parameters editor - GNEFrameAttributesModuls::ParametersEditor* myParametersEditor; - - /// @brief Template editor - TemplateEditor* myTemplateEditor; - - /// @brief Attribute Carrier Hierarchy - GNEFrameModuls::AttributeCarrierHierarchy* myAttributeCarrierHierarchy; - - /// @brief back Button - FXButton* myBackButton; - - /// @brief pointer to previous element called by Inspector Frame - GNEAttributeCarrier* myPreviousElementInspect; - - /// @brief pointer to previous element called by Delete Frame - GNEAttributeCarrier* myPreviousElementDelete; - - /// @brief flag to ckec if myPreviousElementDelete was marked in Delete Frame - bool myPreviousElementDeleteWasMarked; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,614 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date May 2019 -/// -// The Widget for add Person elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPersonFrame.h" -#include "GNEStopFrame.h" - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEPersonFrame::HelpCreation - methods -// --------------------------------------------------------------------------- - -GNEPersonFrame::HelpCreation::HelpCreation(GNEPersonFrame* vehicleFrameParent) : - FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), - myPersonFrameParent(vehicleFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); -} - - -GNEPersonFrame::HelpCreation::~HelpCreation() {} - - -void -GNEPersonFrame::HelpCreation::showHelpCreation() { - // first update help cration - updateHelpCreation(); - // show modul - show(); -} - - -void -GNEPersonFrame::HelpCreation::hideHelpCreation() { - hide(); -} - - -void -GNEPersonFrame::HelpCreation::updateHelpCreation() { - // create information label - std::ostringstream information; - // set text depending of selected person plan - switch (myPersonFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_PERSONTRIP_FROMTO: - information - << "- Click over edges to\n" - << " create a trip."; - break; - case SUMO_TAG_PERSONTRIP_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a trip."; - break; - case SUMO_TAG_WALK_EDGES: - information - << "- Click over a sequenz of\n" - << " consecutive edges to\n" - << " create a walk."; - break; - case SUMO_TAG_WALK_FROMTO: - information - << "- Click over edges to\n" - << " create a walk."; - break; - case SUMO_TAG_WALK_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a walk."; - break; - case SUMO_TAG_WALK_ROUTE: - information - << "- Click over a route"; - break; - case SUMO_TAG_RIDE_FROMTO: - information - << "- Click over edges to\n" - << " create a ride."; - break; - case SUMO_TAG_RIDE_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a ride"; - break; - case SUMO_TAG_PERSONSTOP_BUSSTOP: - information - << "- Click over a busStop\n" - << " to create a stop"; - break; - case SUMO_TAG_PERSONSTOP_LANE: - information - << "- Click over a lane\n" - << " to create a stop"; - break; - default: - throw ProcessError("Invalid person plan tag"); - } - // set information label - myInformationLabel->setText(information.str().c_str()); -} - -// --------------------------------------------------------------------------- -// GNEPersonFrame - methods -// --------------------------------------------------------------------------- - -GNEPersonFrame::GNEPersonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Persons") { - - // create tag Selector modul for persons - myPersonTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSON); - - // create person types selector modul - myPTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_PTYPE); - - // create person attributes - myPersonAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // create tag Selector modul for person plans - myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN); - - // create person plan attributes - myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); - - // create EdgePathCreator Modul - myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA); - - // create Help Creation Modul - myHelpCreation = new HelpCreation(this); - - // limit path creator to pedestrians - myEdgePathCreator->setVClass(SVC_PEDESTRIAN); - - // set Person as default vehicle - myPersonTagSelector->setCurrentTag(SUMO_TAG_PERSON); -} - - -GNEPersonFrame::~GNEPersonFrame() {} - - -void -GNEPersonFrame::show() { - // refresh item selector - myPersonTagSelector->refreshTagProperties(); - myPTypeSelector->refreshDemandElementSelector(); - myPersonPlanTagSelector->refreshTagProperties(); - // update VClass of myEdgePathCreator - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myEdgePathCreator->setVClass(SVC_PASSENGER); - } else { - myEdgePathCreator->setVClass(SVC_PEDESTRIAN); - } - // show frame - GNEFrame::show(); -} - - -bool -GNEPersonFrame::addPerson(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // obtain tag (only for improve code legibility) - SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); - // first check that current selected person is valid - if (personTag == SUMO_TAG_NOTHING) { - myViewNet->setStatusBarText("Current selected person isn't valid."); - return false; - } - // now check that pType is valid - if (myPTypeSelector->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) { - myViewNet->setStatusBarText("Current selected person plan isn't valid."); - return false; - } - // check if walk routes can be created - if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE)) { - return buildPersonOverRoute(objectsUnderCursor.getDemandElementFront()); - } else if ((myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { - return buildPersonOverStop(objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront()); - } else if (objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) { - return myEdgePathCreator->addBusStop(objectsUnderCursor.getAdditionalFront()); - } else if (objectsUnderCursor.getEdgeFront()) { - return myEdgePathCreator->addEdge(objectsUnderCursor.getEdgeFront()); - } else { - return false; - } -} - - -GNEFrameModuls::EdgePathCreator* -GNEPersonFrame::getEdgePathCreator() const { - return myEdgePathCreator; -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEPersonFrame::tagSelected() { - // first check if person is valid - if (myPersonTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // show PType selector and person plan selector - myPTypeSelector->showDemandElementSelector(); - // check if current person type selected is valid - if (myPTypeSelector->getCurrentDemandElement()) { - // show person attributes depending of myPersonPlanTagSelector - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop()) { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); - } else { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); - } - // show person plan tag selector - myPersonPlanTagSelector->showTagSelector(); - // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // check if person plan attributes has to be shown - if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP)) { - // hide person plan attributes - myPersonPlanAttributes->hideAttributesCreatorModul(); - } else { - // show person plan attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); - } - // check if myEdgePathCreator has to be show - if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE) || - (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { - // hide edge path creator modul - myEdgePathCreator->hideEdgePathCreator(); - // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); - } else { - // set edge path creator name - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { - myEdgePathCreator->edgePathCreatorName("person trip"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { - myEdgePathCreator->edgePathCreatorName("walk"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myEdgePathCreator->edgePathCreatorName("ride"); - } - // update VClass of myEdgePathCreator - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myEdgePathCreator->setVClass(SVC_PASSENGER); - } else { - myEdgePathCreator->setVClass(SVC_PEDESTRIAN); - } - // show edge path creator modul - myEdgePathCreator->showEdgePathCreator(); - // hide Netedit attributes modul - myNeteditAttributes->hideNeteditAttributesModul(); - } - // show help modul - myHelpCreation->showHelpCreation(); - } else { - // hide modules - myPersonPlanAttributes->hideAttributesCreatorModul(); - myEdgePathCreator->hideEdgePathCreator(); - myHelpCreation->hideHelpCreation(); - } - } else { - // hide modules - myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myEdgePathCreator->hideEdgePathCreator(); - myHelpCreation->hideHelpCreation(); - } - } else { - // hide all moduls if person isn't valid - myPTypeSelector->hideDemandElementSelector(); - myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myEdgePathCreator->hideEdgePathCreator(); - myHelpCreation->hideHelpCreation(); - } -} - - -void -GNEPersonFrame::demandElementSelected() { - if (myPTypeSelector->getCurrentDemandElement()) { - // show person attributes depending of myPersonPlanTagSelector - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop()) { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {SUMO_ATTR_DEPARTPOS}); - } else { - myPersonAttributes->showAttributesCreatorModul(myPersonTagSelector->getCurrentTagProperties(), {}); - } - // show person plan tag selector - myPersonPlanTagSelector->showTagSelector(); - // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // check if person plan attributes has to be shown - if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP)) { - // hide person plan attributes - myPersonPlanAttributes->hideAttributesCreatorModul(); - } else { - // show person plan attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); - } - // check if myEdgePathCreator has to be show - if ((myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_ROUTE) || - (myPersonPlanTagSelector->getCurrentTagProperties().isPersonStop())) { - // hide edge path creator modul - myEdgePathCreator->hideEdgePathCreator(); - // show Netedit attributes modul - myNeteditAttributes->showNeteditAttributesModul(myPersonPlanTagSelector->getCurrentTagProperties()); - } else { - // set edge path creator name - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { - myEdgePathCreator->edgePathCreatorName("person trip"); - // set mode in path creator - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_PERSONTRIP_BUSSTOP) { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP); - } else { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA); - } - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { - myEdgePathCreator->edgePathCreatorName("walk"); - // set mode in path creator - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_BUSSTOP) { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_WALK_EDGES) { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_CONSECUTIVE); - } else { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA); - } - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myEdgePathCreator->edgePathCreatorName("ride"); - // set mode in path creator - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_RIDE_BUSSTOP) { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_TO_BUSSTOP); - } else { - myEdgePathCreator->setEdgePathCreatorModes(GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA); - } - } - // update VClass of myEdgePathCreator - if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myEdgePathCreator->setVClass(SVC_PASSENGER); - } else { - myEdgePathCreator->setVClass(SVC_PEDESTRIAN); - } - // show edge path creator modul - myEdgePathCreator->showEdgePathCreator(); - // hide Netedit attributes modul - myNeteditAttributes->hideNeteditAttributesModul(); - } - // show help modul - myHelpCreation->showHelpCreation(); - } else { - // hide modules - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myEdgePathCreator->hideEdgePathCreator(); - myHelpCreation->hideHelpCreation(); - } - } else { - // hide modules - myPersonPlanTagSelector->hideTagSelector(); - myPersonAttributes->hideAttributesCreatorModul(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myEdgePathCreator->hideEdgePathCreator(); - myHelpCreation->hideHelpCreation(); - } -} - - -void -GNEPersonFrame::edgePathCreated() { - // first check that all attributes are valid - if (!myPersonAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid person parameters."); - } else if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); - } else { - // build person - GNEDemandElement* createdPerson = buildPerson(); - // Declare map to keep attributes from myPersonPlanAttributes - std::map valuesMap = myPersonPlanAttributes->getAttributesAndValues(true); - // check what PersonPlan we're creating - switch (myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_PERSONTRIP_FROMTO: { - // obtain attributes - std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); - std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // now check that number of selected edges are correct - if (myEdgePathCreator->getClickedEdges().size() > 1) { - GNERouteHandler::buildPersonTripFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos, types, modes); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - } else { - myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge."); - // abort person creation - myViewNet->getUndoList()->p_abort(); - } - break; - } - case SUMO_TAG_PERSONTRIP_BUSSTOP: { - // obtain attributes - std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); - std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); - // now check that number of selected edges are correct - if ((myEdgePathCreator->getClickedEdges().size() > 0) && myEdgePathCreator->getClickedBusStop()) { - GNERouteHandler::buildPersonTripBusStop(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop(), types, modes); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - } else { - myViewNet->setStatusBarText("A person trip with from-to attributes needs at least one edge."); - // abort person creation - myViewNet->getUndoList()->p_abort(); - } - break; - } - case SUMO_TAG_WALK_EDGES: { - // obtain attributes - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - GNERouteHandler::buildWalkEdges(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges(), arrivalPos); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - break; - } - case SUMO_TAG_WALK_FROMTO: { - // obtain attributes - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - GNERouteHandler::buildWalkFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), arrivalPos); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - break; - } - case SUMO_TAG_WALK_BUSSTOP: { - // obtain attributes - GNERouteHandler::buildWalkBusStop(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop()); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - break; - } - case SUMO_TAG_RIDE_FROMTO: { - // obtain attributes - std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - GNERouteHandler::buildRideFromTo(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), lines, arrivalPos); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - break; - } - case SUMO_TAG_RIDE_BUSSTOP: { - // obtain attributes - std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); - GNERouteHandler::buildRideBusStop(myViewNet, true, createdPerson, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedBusStop(), lines); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - break; - } - default: - throw InvalidArgument("Invalid person plan tag"); - } - // refresh person and personPlan attributes - myPersonAttributes->refreshRows(); - myPersonPlanAttributes->refreshRows(); - } -} - -// --------------------------------------------------------------------------- -// GNEPersonFrame - private methods -// --------------------------------------------------------------------------- - - -bool -GNEPersonFrame::buildPersonOverRoute(GNEDemandElement* route) { - if (route && (route->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { - // first check that all attributes are valid - if (!myPersonAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid person parameters."); - } else if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); - } else { - // build person and walk over route - GNERouteHandler::buildWalkRoute(myViewNet, true, buildPerson(), route, 0); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - return true; - } - return false; - } else { - myViewNet->setStatusBarText("Click over a " + toString(SUMO_TAG_ROUTE) + " to create a " + myPersonTagSelector->getCurrentTagProperties().getTagStr()); - return false; - } -} - - -bool -GNEPersonFrame::buildPersonOverStop(GNELane* lane, GNEAdditional* busStop) { - // first check that all attributes are valid - if (!myPersonAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid person parameters."); - return false; - } else if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); - return false; - } else { - // declare stop parameters and friendly position - SUMOVehicleParameter::Stop stopParameter; - if (GNEStopFrame::getStopParameter(stopParameter, myPersonPlanTagSelector->getCurrentTagProperties().getTag(), - myViewNet, myPersonPlanAttributes, myNeteditAttributes, lane, busStop)) { - // create it in RouteFrame - GNERouteHandler::buildStop(myViewNet, true, stopParameter, buildPerson()); - // end undo-redo operation - myViewNet->getUndoList()->p_end(); - // stop sucesfully created, then return true - return true; - } else { - return false; - } - } -} - - -GNEDemandElement* -GNEPersonFrame::buildPerson() { - // obtain person tag (only for improve code legibility) - SumoXMLTag personTag = myPersonTagSelector->getCurrentTagProperties().getTag(); - // obtain person plan tag (only for improve code legibility) - SumoXMLTag personPlanTag = myPersonPlanTagSelector->getCurrentTagProperties().getTag(); - // begin undo-redo operation - myViewNet->getUndoList()->p_begin("create " + toString(personTag) + " and " + toString(personPlanTag)); - // Declare map to keep attributes from myPersonAttributes - std::map valuesMap = myPersonAttributes->getAttributesAndValues(false); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", personTag); - } - // add pType parameter - valuesMap[SUMO_ATTR_TYPE] = myPTypeSelector->getCurrentDemandElement()->getID(); - // check if we're creating a person or personFlow - if (personTag == SUMO_TAG_PERSON) { - // Add parameter departure - if (valuesMap[SUMO_ATTR_DEPART].empty()) { - valuesMap[SUMO_ATTR_DEPART] = "0"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag)); - // obtain person parameters - SUMOVehicleParameter* personParameters = SUMOVehicleParserHelper::parseVehicleAttributes(SUMO_TAG_PERSON, SUMOSAXAttrs, false, false, false); - // build person in GNERouteHandler - GNERouteHandler::buildPerson(myViewNet, true, *personParameters); - // delete personParameters - delete personParameters; - } else { - // set begin and end attributes - if (valuesMap[SUMO_ATTR_BEGIN].empty()) { - valuesMap[SUMO_ATTR_BEGIN] = "0"; - } - if (valuesMap[SUMO_ATTR_END].empty()) { - valuesMap[SUMO_ATTR_END] = "3600"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(personTag)); - // obtain personFlow parameters - SUMOVehicleParameter* personFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX, true); - // build personFlow in GNERouteHandler - GNERouteHandler::buildPersonFlow(myViewNet, true, *personFlowParameters); - // delete personFlowParameters - delete personFlowParameters; - } - // refresh person and personPlan attributes - myPersonAttributes->refreshRows(); - myPersonPlanAttributes->refreshRows(); - // return created person - return myViewNet->getNet()->retrieveDemandElement(personTag, valuesMap[SUMO_ATTR_ID]); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonFrame.h -/// @author Pablo Alvarez Lopez -/// @date May 2019 -/// -// The Widget for add person elements -/****************************************************************************/ -#ifndef GNEPersonFrame_h -#define GNEPersonFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPersonFrame - */ -class GNEPersonFrame : public GNEFrame { - -public: - // =========================================================================== - // class HelpCreation - // =========================================================================== - - class HelpCreation : protected FXGroupBox { - - public: - /// @brief constructor - HelpCreation(GNEPersonFrame* vehicleFrameParent); - - /// @brief destructor - ~HelpCreation(); - - /// @brief show HelpCreation - void showHelpCreation(); - - /// @brief hide HelpCreation - void hideHelpCreation(); - - /// @brief update HelpCreation - void updateHelpCreation(); - - private: - /// @brief pointer to Person Frame Parent - GNEPersonFrame* myPersonFrameParent; - - /// @brief Label with creation information - FXLabel* myInformationLabel; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEPersonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEPersonFrame(); - - /// @brief show Frame - void show(); - - /**@brief add vehicle element - * @param objectsUnderCursor collection of objects under cursor after click over view - * @return true if vehicle was sucesfully added - */ - bool addPerson(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief get EdgePathCreator modul - GNEFrameModuls::EdgePathCreator* getEdgePathCreator() const; - -protected: - /// @brief Tag selected in TagSelector - void tagSelected(); - - /// @brief selected demand element in DemandElementSelector - void demandElementSelected(); - - /// @brief finish edge path creation - void edgePathCreated(); - -private: - /// @brief person tag selector (used to select diffent kind of persons) - GNEFrameModuls::TagSelector* myPersonTagSelector; - - /// @brief Person Type selectors - GNEFrameModuls::DemandElementSelector* myPTypeSelector; - - /// @brief person plan selector (used to select diffent kind of person plan) - GNEFrameModuls::TagSelector* myPersonPlanTagSelector; - - /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonAttributes; - - /// @brief internal person plan attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; - - /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; - - /// @brief edge path creator (used for Walks, rides and trips) - GNEFrameModuls::EdgePathCreator* myEdgePathCreator; - - /// @brief Help creation - HelpCreation* myHelpCreation; - - /// @brief build person over route - bool buildPersonOverRoute(GNEDemandElement* route); - - /// @brief build person over stop - bool buildPersonOverStop(GNELane* lane, GNEAdditional* busStop); - - /// @brief build person and return it (note: function includes a call to p_begin(...), but NOT a call to p_end(...)) - GNEDemandElement* buildPerson(); -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,728 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonPlanFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// The Widget for add PersonPlan elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPersonPlanFrame.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEPersonPlanFrame::PersonPlanCreator) PersonPlanCreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNEPersonPlanFrame::PersonPlanCreator::onCmdAbortPersonPlanCreation), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNEPersonPlanFrame::PersonPlanCreator::onCmdFinishPersonPlanCreation), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNEPersonPlanFrame::PersonPlanCreator::onCmdRemoveLastElement) -}; - -// Object implementation -FXIMPLEMENT(GNEPersonPlanFrame::PersonPlanCreator, FXGroupBox, PersonPlanCreatorMap, ARRAYNUMBER(PersonPlanCreatorMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEPersonPlanFrame::HelpCreation - methods -// --------------------------------------------------------------------------- - -GNEPersonPlanFrame::HelpCreation::HelpCreation(GNEPersonPlanFrame* vehicleFrameParent) : - FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), - myPersonPlanFrameParent(vehicleFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); -} - - -GNEPersonPlanFrame::HelpCreation::~HelpCreation() {} - - -void -GNEPersonPlanFrame::HelpCreation::showHelpCreation() { - // first update help cration - updateHelpCreation(); - // show modul - show(); -} - - -void -GNEPersonPlanFrame::HelpCreation::hideHelpCreation() { - hide(); -} - -void -GNEPersonPlanFrame::HelpCreation::updateHelpCreation() { - // create information label - std::ostringstream information; - // first check if Person Plan selector is shown - if (myPersonPlanFrameParent->myPersonSelector->isDemandElementSelectorShown()) { - // set text depending of selected person plan - switch (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_PERSONTRIP_FROMTO: - information - << "- Click over edges to\n" - << " create a trip."; - break; - case SUMO_TAG_PERSONTRIP_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a trip."; - break; - case SUMO_TAG_WALK_EDGES: - information - << "- Click over a sequenz of\n" - << " consecutive edges to\n" - << " create a walk."; - break; - case SUMO_TAG_WALK_FROMTO: - information - << "- Click over edges to\n" - << " create a walk."; - break; - case SUMO_TAG_WALK_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a walk."; - break; - case SUMO_TAG_WALK_ROUTE: - information - << "- Click over a route"; - break; - case SUMO_TAG_RIDE_FROMTO: - information - << "- Click over edges to\n" - << " create a ride."; - break; - case SUMO_TAG_RIDE_BUSSTOP: - information - << "- Click over an edge and\n" - << " a bus to create a ride"; - break; - default: - break; - } - } else { - information << "- There aren't persons or\n" - << " personFlows in network."; - } - // set information label - myInformationLabel->setText(information.str().c_str()); -} - -// --------------------------------------------------------------------------- -// GNEPersonPlanFrame::PersonPlanCreator - methods -// --------------------------------------------------------------------------- - -GNEPersonPlanFrame::PersonPlanCreator::PersonPlanCreator(GNEPersonPlanFrame* frameParent) : - FXGroupBox(frameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), - myPersonPlanFrameParent(frameParent) { - // create label for curren begin element - new FXLabel(this, "Current from edge:", 0, GUIDesignLabelCenterThick); - myCurrentBeginElementLabel = new FXLabel(this, "", 0, GUIDesignLabelCenterThick); - - // create button for finish person plan creation - myFinishCreationButton = new FXButton(this, "Finish route creation", nullptr, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); - myFinishCreationButton->disable(); - - // create button for abort person plan creation - myAbortCreationButton = new FXButton(this, "Abort route creation", nullptr, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); - myAbortCreationButton->disable(); - - // create button for remove last element - myRemoveLastEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); - myRemoveLastEdge->disable(); -} - - -GNEPersonPlanFrame::PersonPlanCreator::~PersonPlanCreator() {} - - -void -GNEPersonPlanFrame::PersonPlanCreator::edgePathCreatorName(const std::string& name) { - // header needs the first capitalized letter - std::string nameWithFirstCapitalizedLetter = name; - nameWithFirstCapitalizedLetter[0] = (char)toupper(nameWithFirstCapitalizedLetter.at(0)); - setText((nameWithFirstCapitalizedLetter + " creator").c_str()); - myFinishCreationButton->setText(("Finish " + name + " creation").c_str()); - myAbortCreationButton->setText(("Abort " + name + " creation").c_str()); -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::showPersonPlanCreator() { - // simply refresh person plan creator - refreshPersonPlanCreator(); - // show - show(); -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::hidePersonPlanCreator() { - // disable buttons - myAbortCreationButton->disable(); - myFinishCreationButton->disable(); - myRemoveLastEdge->disable(); - // restore colors - for (const auto& i : myClickedEdges) { - for (const auto& j : i->getLanes()) { - j->setSpecialColor(nullptr); - } - } - // clear edges - myClickedEdges.clear(); - // clear myTemporalEdgePath - myTemporalEdgePath.clear(); - // hide - hide(); -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::refreshPersonPlanCreator() { - // disable buttons - myFinishCreationButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastEdge->disable(); - // restore colors - for (const auto& i : myClickedEdges) { - for (const auto& j : i->getLanes()) { - j->setSpecialColor(nullptr); - } - } - // clear edges - myClickedEdges.clear(); - myTemporalEdgePath.clear(); - // first check if person has already child demand elements - if (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement() && - (myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().size() > 0)) { - // obtain last person plan element tag and pointer (to improve code legibliy) - SumoXMLTag lastPersonPlanElementTag = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back()->getTagProperty().getTag(); - GNEDemandElement* lastPersonPlanElement = myPersonPlanFrameParent->myPersonSelector->getCurrentDemandElement()->getChildDemandElements().back(); - // add edge of last person plan of current edited person - if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_LANE) { - // obtan edge's lane of stop lane - addEdge(lastPersonPlanElement->getParentLanes().front()->getParentEdge()); - } else if (lastPersonPlanElementTag == SUMO_TAG_PERSONSTOP_BUSSTOP) { - // obtan edge's lane of stop stopping place - addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - } else if ((lastPersonPlanElementTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_WALK_BUSSTOP) || (lastPersonPlanElementTag == SUMO_TAG_RIDE_BUSSTOP)) { - // obtan edge's lane of Person Plans placed over stopping places - addEdge(lastPersonPlanElement->getParentAdditionals().front()->getParentLanes().front()->getParentEdge()); - } else if (lastPersonPlanElementTag == SUMO_TAG_WALK_ROUTE) { - // obtan edge's lane of Person Plans placed over stopping places - addEdge(lastPersonPlanElement->getParentDemandElements().back()->getParentEdges().back()); - } else { - // all rest of person plans have parent edges - addEdge(lastPersonPlanElement->getParentEdges().back()); - } - // set current begin element information - myCurrentBeginElementLabel->setText((myClickedEdges.front()->getID()).c_str()); - // show label - show(); - } else { - hide(); - } -} - - -std::vector -GNEPersonPlanFrame::PersonPlanCreator::getClickedEdges() const { - return myClickedEdges; -} - - -const std::vector& -GNEPersonPlanFrame::PersonPlanCreator::getEdgePath() const { - return myTemporalEdgePath; -} - - -bool -GNEPersonPlanFrame::PersonPlanCreator::addEdge(GNEEdge* edge) { - // if a certain BusStop was already defined, a new edge cannot be added - if (myClickedEdges.empty() || ((myClickedEdges.size() > 0) && (myClickedEdges.back() != edge))) { - myClickedEdges.push_back(edge); - // enable abort route button - myAbortCreationButton->enable(); - // disable undo/redo - myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("trip creation"); - // set special color - for (auto i : edge->getLanes()) { - i->setSpecialColor(&myPersonPlanFrameParent->getEdgeCandidateSelectedColor()); - } - // calculate route if there is more than two edges - if (myClickedEdges.size() > 1) { - // enable remove last edge button - myRemoveLastEdge->enable(); - // enable finish button - myFinishCreationButton->enable(); - // calculate temporal route - if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myTemporalEdgePath = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(SVC_PASSENGER, myClickedEdges); - } else { - myTemporalEdgePath = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(SVC_PEDESTRIAN, myClickedEdges); - } - } - return true; - } else { - return false; - } -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::drawTemporalRoute() const { - // only draw if there is at least two edges - if (myTemporalEdgePath.size() > 1) { - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, GLO_MAX); - // set orange color - GLHelper::setColor(RGBColor::ORANGE); - // set line width - glLineWidth(5); - // draw first line - GLHelper::drawLine(myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.front(), - myTemporalEdgePath.at(0)->getNBEdge()->getLanes().front().shape.back()); - // draw rest of lines - for (int i = 1; i < (int)myTemporalEdgePath.size(); i++) { - GLHelper::drawLine(myTemporalEdgePath.at(i - 1)->getNBEdge()->getLanes().front().shape.back(), - myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front()); - GLHelper::drawLine(myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.front(), - myTemporalEdgePath.at(i)->getNBEdge()->getLanes().front().shape.back()); - } - // Pop last matrix - glPopMatrix(); - } -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::abortPersonPlanCreation() { - if (myAbortCreationButton->isEnabled()) { - onCmdAbortPersonPlanCreation(nullptr, 0, nullptr); - } -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::finishPersonPlanCreation() { - if (myFinishCreationButton->isEnabled()) { - onCmdFinishPersonPlanCreation(nullptr, 0, nullptr); - } -} - - -void -GNEPersonPlanFrame::PersonPlanCreator::removeLastAddedElement() { - if (myRemoveLastEdge->isEnabled()) { - onCmdRemoveLastElement(nullptr, 0, nullptr); - } -} - - -long -GNEPersonPlanFrame::PersonPlanCreator::onCmdAbortPersonPlanCreation(FXObject*, FXSelector, void*) { - // refresh person plan creator - refreshPersonPlanCreator(); - // enable undo/redo - myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); - return 1; -} - - -long -GNEPersonPlanFrame::PersonPlanCreator::onCmdFinishPersonPlanCreation(FXObject*, FXSelector, void*) { - // only create route if there is more than two edges - if (myClickedEdges.size() > 1) { - // call edgePathCreated - myPersonPlanFrameParent->personPlanCreated(nullptr, nullptr); - // update view - myPersonPlanFrameParent->myViewNet->update(); - // refresh person plan creator - refreshPersonPlanCreator(); - // enable undo/redo - myPersonPlanFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); - } - return 1; -} - - -long -GNEPersonPlanFrame::PersonPlanCreator::onCmdRemoveLastElement(FXObject*, FXSelector, void*) { - if (myClickedEdges.size() > 1) { - // remove last edge - myClickedEdges.pop_back(); - // calculate temporal route - if (myPersonPlanFrameParent->myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myTemporalEdgePath = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(SVC_PASSENGER, myClickedEdges); - } else { - myTemporalEdgePath = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(SVC_PEDESTRIAN, myClickedEdges); - } - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNEPersonPlanFrame - methods -// --------------------------------------------------------------------------- - -GNEPersonPlanFrame::GNEPersonPlanFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "PersonPlans") { - - // create person types selector modul - myPersonSelector = new GNEFrameModuls::DemandElementSelector(this, {GNEAttributeCarrier::TagType::TAGTYPE_PERSON}); - - // Create tag selector for person plan - myPersonPlanTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN); - - // Create person parameters - myPersonPlanAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // create PersonPlanCreator Modul - myPersonPlanCreator = new PersonPlanCreator(this); - - // Create Help Creation Modul - myHelpCreation = new HelpCreation(this); - - // Create AttributeCarrierHierarchy modul - myPersonHierarchy = new GNEFrameModuls::AttributeCarrierHierarchy(this); - - // set PersonPlan tag type in tag selector - myPersonPlanTagSelector->setCurrentTagType(GNEAttributeCarrier::TagType::TAGTYPE_PERSONPLAN); -} - - -GNEPersonPlanFrame::~GNEPersonPlanFrame() {} - - -void -GNEPersonPlanFrame::show() { - // Only show moduls if there is at least one person - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW).size() > 0)) { - // refresh demand element selector - myPersonSelector->refreshDemandElementSelector(); - // refresh item selector - myPersonPlanTagSelector->refreshTagProperties(); - // show myPersonPlanCreator - myPersonPlanCreator->showPersonPlanCreator(); - // set first person as demand element - if (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON).size() > 0) { - myPersonSelector->setDemandElement(myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON).begin()->second); - } else { - myPersonSelector->setDemandElement(myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW).begin()->second); - } - } else { - // hide all moduls except helpCreation - myPersonSelector->hideDemandElementSelector(); - myPersonPlanTagSelector->hideTagSelector(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPersonPlanCreator->hidePersonPlanCreator(); - myPersonHierarchy->hideAttributeCarrierHierarchy(); - myHelpCreation->showHelpCreation(); - } - // show frame - GNEFrame::show(); -} - - -void -GNEPersonPlanFrame::hide() { - // abort plan creation - myPersonPlanCreator->hidePersonPlanCreator(); - // hide frame - GNEFrame::hide(); -} - - -bool -GNEPersonPlanFrame::addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // first check if person selected is valid - if (myPersonSelector->getCurrentDemandElement() == nullptr) { - myViewNet->setStatusBarText("Current selected person isn't valid."); - return false; - } - // finally check that person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { - 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(); - // declare flags to check required elements - /*SUMO_TAG_PERSONSTOP_LANE;*/ - bool requireRoute = (personPlanTag == SUMO_TAG_WALK_ROUTE); - bool requireBusStop = ((personPlanTag == SUMO_TAG_PERSONTRIP_BUSSTOP) || (personPlanTag == SUMO_TAG_WALK_BUSSTOP) || - (personPlanTag == SUMO_TAG_RIDE_BUSSTOP) || (personPlanTag == SUMO_TAG_PERSONSTOP_BUSSTOP)); - bool requireEdge = ((personPlanTag == SUMO_TAG_PERSONTRIP_FROMTO) || (personPlanTag == SUMO_TAG_WALK_EDGES) || - (personPlanTag == SUMO_TAG_WALK_FROMTO) || (personPlanTag == SUMO_TAG_RIDE_FROMTO)); - // process personPlanCreated(...) depending of required element - if (requireBusStop && objectsUnderCursor.getAdditionalFront() && (objectsUnderCursor.getAdditionalFront()->getTagProperty().getTag() == SUMO_TAG_BUS_STOP)) { - return personPlanCreated(objectsUnderCursor.getAdditionalFront(), nullptr); - } else if (requireRoute && objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { - return personPlanCreated(nullptr, objectsUnderCursor.getDemandElementFront()); - } else if (requireEdge && objectsUnderCursor.getEdgeFront()) { - return myPersonPlanCreator->addEdge(objectsUnderCursor.getEdgeFront()); - } else { - return false; - } -} - - -GNEPersonPlanFrame::PersonPlanCreator* -GNEPersonPlanFrame::getPersonPlanCreator() const { - return myPersonPlanCreator; -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEPersonPlanFrame::tagSelected() { - // first check if person is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // set edge path creator name - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { - myPersonPlanCreator->edgePathCreatorName("person trip"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { - myPersonPlanCreator->edgePathCreatorName("walk"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myPersonPlanCreator->edgePathCreatorName("ride"); - } - // show person attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); - // show edge path creator - myPersonPlanCreator->showPersonPlanCreator(); - // show help creation - myHelpCreation->showHelpCreation(); - // show person hierarchy - myPersonHierarchy->showAttributeCarrierHierarchy(myPersonSelector->getCurrentDemandElement()); - } else { - // hide moduls if tag selecte isn't valid - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPersonPlanCreator->hidePersonPlanCreator(); - myHelpCreation->hideHelpCreation(); - myPersonHierarchy->hideAttributeCarrierHierarchy(); - } -} - - -void -GNEPersonPlanFrame::demandElementSelected() { - // check if a valid person was selected - if (myPersonSelector->getCurrentDemandElement()) { - // show person plan tag selector - myPersonPlanTagSelector->showTagSelector(); - // now check if person plan selected is valid - if (myPersonPlanTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // set edge path creator name - if (myPersonPlanTagSelector->getCurrentTagProperties().isPersonTrip()) { - myPersonPlanCreator->edgePathCreatorName("person trip"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isWalk()) { - myPersonPlanCreator->edgePathCreatorName("walk"); - } else if (myPersonPlanTagSelector->getCurrentTagProperties().isRide()) { - myPersonPlanCreator->edgePathCreatorName("ride"); - } - // show person plan attributes - myPersonPlanAttributes->showAttributesCreatorModul(myPersonPlanTagSelector->getCurrentTagProperties(), {}); - // show edge path creator - myPersonPlanCreator->showPersonPlanCreator(); - // show help creation - myHelpCreation->showHelpCreation(); - // Show the person's children - myPersonHierarchy->showAttributeCarrierHierarchy(myPersonSelector->getCurrentDemandElement()); - } else { - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPersonPlanCreator->hidePersonPlanCreator(); - myHelpCreation->hideHelpCreation(); - myPersonHierarchy->hideAttributeCarrierHierarchy(); - } - } else { - // hide moduls if person selected isn't valid - myPersonPlanTagSelector->hideTagSelector(); - myPersonPlanAttributes->hideAttributesCreatorModul(); - myPersonPlanCreator->hidePersonPlanCreator(); - myHelpCreation->hideHelpCreation(); - myPersonHierarchy->hideAttributeCarrierHierarchy(); - } -} - - -bool -GNEPersonPlanFrame::personPlanCreated(GNEAdditional* busStop, GNEDemandElement* route) { - // first check that all attributes are valid - if (!myPersonPlanAttributes->areValuesValid()) { - myViewNet->setStatusBarText("Invalid " + myPersonPlanTagSelector->getCurrentTagProperties().getTagStr() + " parameters."); - return false; - } else { - // Declare map to keep attributes from myPersonPlanAttributes - std::map valuesMap = myPersonPlanAttributes->getAttributesAndValues(true); - // check what PersonPlan we're creating - switch (myPersonPlanTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_PERSONTRIP_FROMTO: { - std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); - std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // check if person trip fromto can be created - if (myPersonPlanCreator->getEdgePath().size() > 1) { - GNERouteHandler::buildPersonTripFromTo(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), arrivalPos, types, modes); - } else { - myViewNet->setStatusBarText("A person trip with from-to attributes needs at least two edge."); - return false; - } - break; - } - case SUMO_TAG_PERSONTRIP_BUSSTOP: { - std::vector types = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_VTYPES]); - std::vector modes = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_MODES]); - // check if person trip busstop can be created - if (busStop == nullptr) { - myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop"); - return false; - } else { - // add busstop's edge to personPlan creator (To calculate a temporal route) - myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); - if (myPersonPlanCreator->getEdgePath().size() > 0) { - GNERouteHandler::buildPersonTripBusStop(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop, types, modes); - } else { - myViewNet->setStatusBarText("A person trip with from and busStop attributes needs one edge and one busStop"); - return false; - } - } - break; - } - case SUMO_TAG_WALK_EDGES: { - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // check if walk edges can be created - if (myPersonPlanCreator->getEdgePath().size() > 0) { - GNERouteHandler::buildWalkEdges(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath(), arrivalPos); - } else if ((myPersonPlanCreator->getClickedEdges().size() == 1) || (myPersonPlanCreator->getClickedEdges().size() == 2)) { - GNERouteHandler::buildWalkEdges(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getClickedEdges(), arrivalPos); - } else { - myViewNet->setStatusBarText("A walk with edges attribute needs a list of edges"); - return false; - } - break; - } - case SUMO_TAG_WALK_FROMTO: { - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // check if walk fromto can be created - if (myPersonPlanCreator->getEdgePath().size() > 1) { - GNERouteHandler::buildWalkFromTo(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), arrivalPos); - } else { - myViewNet->setStatusBarText("A walk with from-to attributes needs at least two edges."); - return false; - } - break; - } - case SUMO_TAG_WALK_BUSSTOP: { - // check if walk busstop can be created - if (busStop == nullptr) { - myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop"); - } else { - // add busstop's edge to personPlan creator (To calculate a temporal route) - myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); - if (myPersonPlanCreator->getEdgePath().size() > 0) { - GNERouteHandler::buildWalkBusStop(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop); - } else { - myViewNet->setStatusBarText("A walk with from and busStop attributes needs one edge and one busStop"); - return false; - } - } - break; - } - case SUMO_TAG_WALK_ROUTE: { - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // check if walk route can be created - if (route != nullptr) { - GNERouteHandler::buildWalkRoute(myViewNet, true, myPersonSelector->getCurrentDemandElement(), route, arrivalPos); - } else { - myViewNet->setStatusBarText("A ride with route attributes needs one route"); - return false; - } - break; - } - case SUMO_TAG_RIDE_FROMTO: { - std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); - double arrivalPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ARRIVALPOS]); - // check if ride fromto can be created - if (myPersonPlanCreator->getEdgePath().size() > 2) { - GNERouteHandler::buildRideFromTo(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), myPersonPlanCreator->getEdgePath().back(), lines, arrivalPos); - } else { - myViewNet->setStatusBarText("A ride with from-to attributes needs at least two edge."); - return false; - } - break; - } - case SUMO_TAG_RIDE_BUSSTOP: { - std::vector lines = GNEAttributeCarrier::parse >(valuesMap[SUMO_ATTR_LINES]); - // check if ride busstop can be created - if (busStop == nullptr) { - myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop"); - } else { - // add busstop's edge to personPlan creator (To calculate a temporal route) - myPersonPlanCreator->addEdge(busStop->getParentLanes().front()->getParentEdge()); - if (myPersonPlanCreator->getEdgePath().size() > 0) { - GNERouteHandler::buildRideBusStop(myViewNet, true, myPersonSelector->getCurrentDemandElement(), myPersonPlanCreator->getEdgePath().front(), busStop, lines); - } else { - myViewNet->setStatusBarText("A ride with from and busStop attributes needs one edge and one busStop"); - return false; - } - } - break; - } - default: - throw InvalidArgument("Invalid person plan tag"); - } - // refresh AttributeCarrierHierarchy - myPersonHierarchy->refreshAttributeCarrierHierarchy(); - // refresh also Person Plan creator - myPersonPlanCreator->refreshPersonPlanCreator(); - // refresh personPlan attributes - myPersonPlanAttributes->refreshRows(); - // person plan element created, then return true - return true; - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonPlanFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,213 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPersonPlanFrame.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2019 -/// -// The Widget for add PersonPlan elements -/****************************************************************************/ -#ifndef GNEPersonPlanFrame_h -#define GNEPersonPlanFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEPersonPlanFrame - */ -class GNEPersonPlanFrame : public GNEFrame { - -public: - - // =========================================================================== - // class HelpCreation - // =========================================================================== - - class HelpCreation : protected FXGroupBox { - - public: - /// @brief constructor - HelpCreation(GNEPersonPlanFrame* vehicleFrameParent); - - /// @brief destructor - ~HelpCreation(); - - /// @brief show HelpCreation - void showHelpCreation(); - - /// @brief hide HelpCreation - void hideHelpCreation(); - - /// @brief update HelpCreation - void updateHelpCreation(); - - private: - /// @brief pointer to PersonPlan Frame Parent - GNEPersonPlanFrame* myPersonPlanFrameParent; - - /// @brief Label with creation information - FXLabel* myInformationLabel; - }; - - // =========================================================================== - // class PersonPlanCreator - // =========================================================================== - - class PersonPlanCreator : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEPersonPlanFrame::PersonPlanCreator) - - public: - /// @brief default constructor - PersonPlanCreator(GNEPersonPlanFrame* frameParent); - - /// @brief destructor - ~PersonPlanCreator(); - - /// @brief update PersonPlanCreator name - void edgePathCreatorName(const std::string& name); - - /// @brief show PersonPlanCreator - void showPersonPlanCreator(); - - /// @brief show PersonPlanCreator - void hidePersonPlanCreator(); - - /// @brief show PersonPlanCreator - void refreshPersonPlanCreator(); - - /// @brief get clicked edges - std::vector getClickedEdges() const; - - /// @brief get current edge path - const std::vector& getEdgePath() const; - - /// @brief add edge to route - bool addEdge(GNEEdge* edge); - - /// @brief draw temporal route - void drawTemporalRoute() const; - - /// @brief abort person plan creation - void abortPersonPlanCreation(); - - /// @brief finish person plan creation - void finishPersonPlanCreation(); - - /// @brief remove last added element - void removeLastAddedElement(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user click over button "Abort route creation" - long onCmdAbortPersonPlanCreation(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Finish route creation" - long onCmdFinishPersonPlanCreation(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Remove last inserted edge" - long onCmdRemoveLastElement(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(PersonPlanCreator) - - private: - /// @brief pointer to Person Plan Frame Parent - GNEPersonPlanFrame* myPersonPlanFrameParent; - - /// @brief Label with current begin element - FXLabel* myCurrentBeginElementLabel; - - /// @brief button for finish route creation - FXButton* myFinishCreationButton; - - /// @brief button for abort route creation - FXButton* myAbortCreationButton; - - /// @brief button for removing last edge - FXButton* myRemoveLastEdge; - - /// @brief current clicked edges - std::vector myClickedEdges; - - /// @brief vector with temporal edge path - std::vector myTemporalEdgePath; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEPersonPlanFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEPersonPlanFrame(); - - /// @brief show Frame - void show(); - - /// @brief hide Frame - void hide(); - - /**@brief add vehicle element - * @param objectsUnderCursor collection of objects under cursor after click over view - * @return true if vehicle was sucesfully added - */ - bool addPersonPlan(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief get PersonPlanCreator modul - PersonPlanCreator* getPersonPlanCreator() const; - -protected: - /// @brief Tag selected in TagSelector - void tagSelected(); - - /// @brief selected demand element in DemandElementSelector - void demandElementSelected(); - - /// @brief finish person plan creation - bool personPlanCreated(GNEAdditional* busStop, GNEDemandElement* route); - -private: - /// @brief Person selectors - GNEFrameModuls::DemandElementSelector* myPersonSelector; - - /// @brief personPlan selector - GNEFrameModuls::TagSelector* myPersonPlanTagSelector; - - /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myPersonPlanAttributes; - - /// @brief Person Plan Creator - PersonPlanCreator* myPersonPlanCreator; - - /// @brief Person Hierarchy - GNEFrameModuls::AttributeCarrierHierarchy* myPersonHierarchy; - - /// @brief Help creation - HelpCreation* myHelpCreation; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,396 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#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& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PTYPE)) { - myTypeMatchBox->appendItem(i.first.c_str()); - } - // set DEFAULT_PEDTYPE_ID as default pType - myCurrentPersonType = myPersonTypeFrameParent->getViewNet()->getNet()->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& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PTYPE)) { - myTypeMatchBox->appendItem(i.first.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()->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({myCurrentPersonType}, false, true); -} - - -long -GNEPersonTypeFrame::PersonTypeSelector::onCmdSelectItem(FXObject*, FXSelector, void*) { - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& i : myPersonTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PTYPE)) { - if (i.first == myTypeMatchBox->getText().text()) { - // set pointer - myCurrentPersonType = i.second; - // 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({myCurrentPersonType}, 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 - std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->generateDemandElementID("", SUMO_TAG_PTYPE); - // create new person type - GNEDemandElement* personType = new GNEVehicleType(myPersonTypeFrameParent->myViewNet, personTypeID, SUMO_TAG_PTYPE); - // add it using undoList (to allow undo-redo) - myPersonTypeFrameParent->myViewNet->getUndoList()->p_begin("create person type"); - myPersonTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(personType, true), true); - myPersonTypeFrameParent->myViewNet->getUndoList()->p_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()->p_begin("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()->p_end(); - } - } else { - // begin undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_end(); - } - return 1; -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdResetPersonType(FXObject*, FXSelector, void*) { - // begin reset default person type values - myPersonTypeFrameParent->getViewNet()->getUndoList()->p_begin("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()->p_end(); - // refresh PersonTypeSelector - myPersonTypeFrameParent->myPersonTypeSelector->refreshPersonTypeSelector(); - return 1; -} - - -long -GNEPersonTypeFrame::PersonTypeEditor::onCmdCopyPersonType(FXObject*, FXSelector, void*) { - // obtain a new valid person Type ID - std::string personTypeID = myPersonTypeFrameParent->myViewNet->getNet()->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, personTypeID, vType); - // begin undo list operation - myPersonTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_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()->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({myPersonTypeSelector->getCurrentPersonType()}, false, true); - // show frame - GNEFrame::show(); -} - - -GNEPersonTypeFrame::PersonTypeSelector* -GNEPersonTypeFrame::getPersonTypeSelector() const { - return myPersonTypeSelector; -} - - -void -GNEPersonTypeFrame::attributeUpdated() { - myPersonTypeSelector->refreshPersonTypeSelector(); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPersonTypeFrame.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-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ -#ifndef GNEPersonTypeFrame_h -#define GNEPersonTypeFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// 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 elements type - 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; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPolygonFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEPolygonFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPolygonFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPolygonFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,523 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPolygonFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Aug 2017 -/// -// The Widget for add polygons -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEPolygonFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates), - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEPolygonFrame::GEOPOICreator::onCmdSetFormat), - FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI), -}; - -// Object implementation -FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBox, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEPolygonFrame::GEOPOICreator - methods -// --------------------------------------------------------------------------- - -GNEPolygonFrame::GEOPOICreator::GEOPOICreator(GNEPolygonFrame* polygonFrameParent) : - FXGroupBox(polygonFrameParent->myContentFrame, "GEO POI Creator", GUIDesignGroupBoxFrame), - 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); - // set lat-lon as default - myLatLonRadioButton->setCheck(TRUE); - // create text field for coordinates - myCoordinatesTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); - // create checkBox - myCenterViewAfterCreationCheckButton = new FXCheckButton(this, "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); - // create information label - myLabelCartesianPosition = new FXLabel(this, "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation); -} - - -GNEPolygonFrame::GEOPOICreator::~GEOPOICreator() {} - - -void -GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModul() { - // check if there is an GEO Proj string is defined - if (GeoConvHelper::getFinal().getProjString() != "!") { - myCoordinatesTextField->enable(); - myCoordinatesTextField->setText(""); - myCoordinatesTextField->enable(); - myCreateGEOPOIButton->enable(); - } else { - myCoordinatesTextField->setText("No geo-conversion defined"); - myCoordinatesTextField->disable(); - myCreateGEOPOIButton->disable(); - } - show(); -} - - -void -GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModul() { - hide(); -} - - -long -GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates(FXObject*, FXSelector, void*) { - // check if input contains spaces - std::string input = myCoordinatesTextField->getText().text(); - std::string inputWithoutSpaces; - for (const auto& i : input) { - if (i != ' ') { - inputWithoutSpaces.push_back(i); - } - } - // if input contains spaces, call this function again, and in other case set red text color - if (input.size() != inputWithoutSpaces.size()) { - myCoordinatesTextField->setText(inputWithoutSpaces.c_str()); - } - if (inputWithoutSpaces.size() > 0) { - myCreateGEOPOIButton->setText("Create GEO POI"); - } else { - myCreateGEOPOIButton->setText("Create GEO POI (clipboard)"); - } - // simply check if given value can be parsed to Position - if (GNEAttributeCarrier::canParse(myCoordinatesTextField->getText().text())) { - myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0)); - myCoordinatesTextField->killFocus(); - // convert coordinates into lon-lat - Position geoPos = GNEAttributeCarrier::parse(myCoordinatesTextField->getText().text()); - if (myLatLonRadioButton->getCheck() == TRUE) { - geoPos.swapXY(); - } - GeoConvHelper::getFinal().x2cartesian_const(geoPos); - // check if GEO Position has to be swapped - // update myLabelCartesianPosition - myLabelCartesianPosition->setText(("Cartesian equivalence:\n- X = " + toString(geoPos.x()) + "\n- Y = " + toString(geoPos.y())).c_str()); - } else { - myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0)); - myLabelCartesianPosition->setText("Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude"); - }; - return 1; -} - - -long -GNEPolygonFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) { - //disable other radio button depending of selected option - if (obj == myLonLatRadioButton) { - myLonLatRadioButton->setCheck(TRUE); - myLatLonRadioButton->setCheck(FALSE); - } else if (obj == myLatLonRadioButton) { - myLonLatRadioButton->setCheck(FALSE); - myLatLonRadioButton->setCheck(TRUE); - } - // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence - onCmdSetCoordinates(0, 0, 0); - return 1; -} - - -long -GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI(FXObject*, FXSelector, void*) { - // first check if current GEO Position is valid - if (myPolygonFrameParent->myShapeAttributes->areValuesValid()) { - std::string geoPosStr = myCoordinatesTextField->getText().text(); - if (geoPosStr.empty()) { - // use clipboard - WRITE_WARNING("Using clipboard"); - geoPosStr = GUIUserIO::copyFromClipboard(*getApp()); - myCoordinatesTextField->setText(geoPosStr.c_str()); - // remove spaces, update cartesian value - onCmdSetCoordinates(0, 0, 0); - geoPosStr = myCoordinatesTextField->getText().text(); - myCoordinatesTextField->setText(""); - myCreateGEOPOIButton->setText("Create GEO POI (clipboard)"); - } - if (GNEAttributeCarrier::canParse(geoPosStr)) { - // obtain shape attributes and values - auto valuesMap = myPolygonFrameParent->myShapeAttributes->getAttributesAndValues(true); - // obtain netedit attributes and values - myPolygonFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myPolygonFrameParent->myViewNet->getNet()->generateShapeID(myPolygonFrameParent->myShapeTagSelector->getCurrentTagProperties().getTag()); - } - // force GEO attribute to true and obain position - valuesMap[SUMO_ATTR_GEO] = "true"; - Position geoPos = GNEAttributeCarrier::parse(geoPosStr); - // convert coordinates into lon-lat - if (myLatLonRadioButton->getCheck() == TRUE) { - geoPos.swapXY(); - } - GeoConvHelper::getFinal().x2cartesian_const(geoPos); - valuesMap[SUMO_ATTR_POSITION] = toString(geoPos); - // return ADDSHAPE_SUCCESS if POI was sucesfully created - if (myPolygonFrameParent->addPOI(valuesMap)) { - // check if view has to be centered over created GEO POI - if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) { - // create a boundary over given GEO Position and center view over it - Boundary centerPosition; - centerPosition.add(geoPos); - centerPosition = centerPosition.grow(10); - myPolygonFrameParent->myViewNet->getViewParent()->getView()->centerTo(centerPosition); - } - } else { - WRITE_WARNING("Could not create GEO POI"); - } - } - // refresh shape attributes - myPolygonFrameParent->myShapeAttributes->refreshRows(); - } - return 1; -} - - -// --------------------------------------------------------------------------- -// GNEPolygonFrame - methods -// --------------------------------------------------------------------------- - -GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Shapes") { - - // create item Selector modul for shapes - myShapeTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_SHAPE); - - // Create shape parameters - myShapeAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); - - // Create drawing controls - myDrawingShape = new GNEFrameModuls::DrawingShape(this); - - /// @brief create GEOPOICreator - myGEOPOICreator = new GEOPOICreator(this); - - // set polygon as default shape - myShapeTagSelector->setCurrentTag(SUMO_TAG_POLY); -} - - -GNEPolygonFrame::~GNEPolygonFrame() { -} - - -void -GNEPolygonFrame::show() { - // refresh item selector - myShapeTagSelector->refreshTagProperties(); - // show frame - GNEFrame::show(); -} - - -GNEPolygonFrame::AddShapeResult -GNEPolygonFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // Declare map to keep values - std::map valuesMap; - // 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 ADDSHAPE_INVALID; - } - // obtain shape attributes and values - valuesMap = myShapeAttributes->getAttributesAndValues(true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront()); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(myShapeTagSelector->getCurrentTagProperties().getTag()); - } - // obtain position - valuesMap[SUMO_ATTR_POSITION] = toString(clickedPosition); - // set GEO Position as false (because we have created POI clicking over View - valuesMap[SUMO_ATTR_GEO] = "false"; - // return ADDSHAPE_SUCCESS if POI was sucesfully created - if (addPOI(valuesMap)) { - // refresh shape attributes - myShapeAttributes->refreshRows(); - return ADDSHAPE_SUCCESS; - } else { - return ADDSHAPE_INVALID; - } - } else if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POILANE) { - // abort if lane is nullptr - if (objectsUnderCursor.getLaneFront() == nullptr) { - WRITE_WARNING(toString(SUMO_TAG_POILANE) + " can be only placed over lanes"); - return ADDSHAPE_INVALID; - } - // show warning dialogbox and stop if input parameters are invalid - if (myShapeAttributes->areValuesValid() == false) { - myShapeAttributes->showWarningMessage(); - return ADDSHAPE_INVALID; - } - // obtain shape attributes and values - valuesMap = myShapeAttributes->getAttributesAndValues(true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront()); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(myShapeTagSelector->getCurrentTagProperties().getTag()); - } - // obtain Lane - valuesMap[SUMO_ATTR_LANE] = objectsUnderCursor.getLaneFront()->getID(); - // obtain position over lane - valuesMap[SUMO_ATTR_POSITION] = toString(objectsUnderCursor.getLaneFront()->getLaneShape().nearest_offset_to_point2D(clickedPosition)); - // return ADDSHAPE_SUCCESS if POI was sucesfully created - if (addPOILane(valuesMap)) { - // refresh shape attributes - myShapeAttributes->refreshRows(); - return ADDSHAPE_SUCCESS; - } else { - return ADDSHAPE_INVALID; - } - } 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); - } - return ADDSHAPE_UPDATEDTEMPORALSHAPE; - } else { - // return ADDSHAPE_NOTHING if is drawing isn't enabled - return ADDSHAPE_NOTHING; - } - } else { - myViewNet->setStatusBarText("Current selected shape isn't valid."); - return ADDSHAPE_INVALID; - } -} - - -std::string -GNEPolygonFrame::getIdsSelected(const FXList* list) { - // Obtain Id's of list - std::string vectorOfIds; - for (int i = 0; i < list->getNumItems(); i++) { - if (list->isItemSelected(i)) { - if (vectorOfIds.size() > 0) { - vectorOfIds += " "; - } - vectorOfIds += (list->getItem(i)->getText()).text(); - } - } - return vectorOfIds; -} - - -GNEFrameModuls::DrawingShape* -GNEPolygonFrame::getDrawingShapeModul() const { - return myDrawingShape; -} - - -bool -GNEPolygonFrame::shapeDrawed() { - // show warning dialogbox and stop check if input parameters are valid - if (!myShapeAttributes->areValuesValid()) { - myShapeAttributes->showWarningMessage(); - return false; - } else if (myDrawingShape->getTemporalShape().size() == 0) { - WRITE_WARNING("Polygon shape cannot be empty"); - return false; - } else { - // Declare map to keep values - std::map valuesMap = myShapeAttributes->getAttributesAndValues(true); - // obtain netedit attributes and values - myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(SUMO_TAG_POLY); - } - // obtain shape and check if has to be closed - PositionVector temporalShape = myDrawingShape->getTemporalShape(); - if (valuesMap[GNE_ATTR_CLOSE_SHAPE] == "true") { - temporalShape.closePolygon(); - } - valuesMap[SUMO_ATTR_SHAPE] = toString(temporalShape); - // obtain geo (by default false) - valuesMap[SUMO_ATTR_GEO] = "false"; - // return true if polygon was successfully created - if (addPolygon(valuesMap)) { - // refresh shape attributes - myShapeAttributes->refreshRows(); - return true; - } - } - return false; -} - - -void -GNEPolygonFrame::tagSelected() { - if (myShapeTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // if there are parmeters, show and Recalc groupBox - myShapeAttributes->showAttributesCreatorModul(myShapeTagSelector->getCurrentTagProperties(), {}); - // show netedit attributes - myNeteditAttributes->showNeteditAttributesModul(myShapeTagSelector->getCurrentTagProperties()); - // Check if drawing mode has to be shown - if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POLY) { - myDrawingShape->showDrawingShape(); - } else { - myDrawingShape->hideDrawingShape(); - } - // Check if GEO POI Creator has to be shown - if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POI) { - myGEOPOICreator->showGEOPOICreatorModul(); - } else { - myGEOPOICreator->hideGEOPOICreatorModul(); - } - } else { - // hide all widgets - myShapeAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myDrawingShape->hideDrawingShape(); - myGEOPOICreator->hideGEOPOICreatorModul(); - } -} - - -bool -GNEPolygonFrame::addPolygon(const std::map& polyValues) { - // parse attributes from polyValues - std::string id = polyValues.at(SUMO_ATTR_ID); - std::string type = polyValues.at(SUMO_ATTR_TYPE); - RGBColor color = RGBColor::parseColor(polyValues.at(SUMO_ATTR_COLOR)); - std::string layerStr = polyValues.at(SUMO_ATTR_LAYER); - double angle = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_ANGLE)); - std::string imgFile = polyValues.at(SUMO_ATTR_IMGFILE); - bool relativePath = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_RELATIVEPATH)); - PositionVector shape = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_SHAPE)); - bool fill = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_FILL)); - double lineWidth = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_LINEWIDTH)); - // parse layer - double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER; - // create new Polygon only if number of shape points is greather than 2 - myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POLY)); - if ((shape.size() > 0) && myViewNet->getNet()->addPolygon(id, type, color, layer, angle, imgFile, relativePath, shape, false, fill, lineWidth)) { - // set manually attributes use GEO, block movement and block shape - GNEPoly* polygon = myViewNet->getNet()->retrievePolygon(id); - polygon->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, polyValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); - polygon->setAttribute(GNE_ATTR_BLOCK_SHAPE, polyValues.at(GNE_ATTR_BLOCK_SHAPE), myViewNet->getUndoList()); - myViewNet->getUndoList()->p_end(); - return true; - } else { - // abort creation - myViewNet->getUndoList()->p_abort(); - return false; - } -} - - -bool -GNEPolygonFrame::addPOI(const std::map& POIValues) { - // parse attributes from POIValues - std::string id = POIValues.at(SUMO_ATTR_ID); - std::string type = POIValues.at(SUMO_ATTR_TYPE); - RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR)); - std::string layerStr = POIValues.at(SUMO_ATTR_LAYER); - Position pos = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION)); - double angle = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_ANGLE)); - std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE); - bool relativePath = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_RELATIVEPATH)); - double widthPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_WIDTH)); - double heightPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_HEIGHT)); - double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER_POI; - bool geo = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_GEO)); - // create new POI - myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POI)); - if (myViewNet->getNet()->addPOI(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) { - // Set manually the attribute block movement - GNEPOI* poi = myViewNet->getNet()->retrievePOI(id); - poi->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, POIValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); - myViewNet->getUndoList()->p_end(); - return true; - } else { - // abort creation - myViewNet->getUndoList()->p_abort(); - return false; - } -} - - -bool -GNEPolygonFrame::addPOILane(const std::map& POIValues) { - // parse attributes from POIValues - std::string id = POIValues.at(SUMO_ATTR_ID); - std::string type = POIValues.at(SUMO_ATTR_TYPE); - RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR)); - std::string layerStr = POIValues.at(SUMO_ATTR_LAYER); - double angle = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_ANGLE)); - std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE); - bool relativePath = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_RELATIVEPATH)); - GNELane* lane = myViewNet->getNet()->retrieveLane(POIValues.at(SUMO_ATTR_LANE)); - double posLane = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION)); - double posLat = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION_LAT)); - double widthPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_WIDTH)); - double heightPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_HEIGHT)); - // parse layer - double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER_POI; - // create new POILane - myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POILANE)); - if (myViewNet->getNet()->addPOI(id, type, color, Position(), false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) { - // Set manually the attribute block movement - GNEPOI* POI = myViewNet->getNet()->retrievePOI(id); - POI->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, POIValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); - myViewNet->getUndoList()->p_end(); - return true; - } else { - // abort creation - myViewNet->getUndoList()->p_abort(); - return false; - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEPolygonFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEPolygonFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEPolygonFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEPolygonFrame.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-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEPolygonFrame.h -/// @author Pablo Alvarez Lopez -/// @date Aug 2017 -/// -// The Widget for add polygons -/****************************************************************************/ -#ifndef GNEPolygonFrame_h -#define GNEPolygonFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** -* @class GNEPolygonFrame -* The Widget for setting internal attributes of shape elements -*/ -class GNEPolygonFrame : public GNEFrame { - -public: - - /// @brief enum with all possible values after try to create an shape using frame - enum AddShapeResult { - ADDSHAPE_SUCCESS, // Shape was successfully created - ADDSHAPE_UPDATEDTEMPORALSHAPE, // Added or removed a new point to temporal shape - ADDSHAPE_INVALID, // Shape wasn't created - ADDSHAPE_NOTHING // Nothing to do - }; - - // =========================================================================== - // class GEOPOICreator - // =========================================================================== - - class GEOPOICreator : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNEPolygonFrame::GEOPOICreator) - - public: - /// @brief constructor - GEOPOICreator(GNEPolygonFrame* polygonFrameParent); - - /// @brief destructor - ~GEOPOICreator(); - - /// @brief Show list of GEOPOICreator Modul - void showGEOPOICreatorModul(); - - /// @brief hide GEOPOICreator Modul - void hideGEOPOICreatorModul(); - - /// @name FOX-callbacks - /// @{ - /// @brief called when user change the coordinates TextField - long onCmdSetCoordinates(FXObject*, FXSelector, void*); - - /// @brief called when user select a format radio button - long onCmdSetFormat(FXObject*, FXSelector, void*); - - /// @brief called when user type in search box - long onCmdCreateGEOPOI(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(GEOPOICreator) - - private: - /// @brief pointer to Shape frame parent - GNEPolygonFrame* myPolygonFrameParent; - - /// @brief radio button for the configuration lon-lat - FXRadioButton* myLonLatRadioButton; - - /// @brief radio button for the configuration lat-lon - FXRadioButton* myLatLonRadioButton; - - /// @brief text field for given geo coordinates - FXTextField* myCoordinatesTextField; - - /// @brief button for enable or disable certer view after creation of GEO POI - FXCheckButton* myCenterViewAfterCreationCheckButton; - - /// @brief button for create GEO Coordinates - FXButton* myCreateGEOPOIButton; - - /// @brief FXLabel for the equivalent position of GEO Position in Cartesian Position - FXLabel* myLabelCartesianPosition; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEPolygonFrame(); - - /// @brief show Frame - void show(); - - /**@brief process click over Viewnet - * @param[in] clickedPosition clicked position over ViewNet - * @param[in] ObjectsUnderCursor objects under cursor after click over view - * @return AddShapeStatus with the result of operation - */ - AddShapeResult processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief get list of selecte id's in string format - static std::string getIdsSelected(const FXList* list); - - /// @brief get drawing mode editor - GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; - -protected: - /**@brief build a shaped element using the drawed shape - * return true if was successfully created - * @note called when user stop drawing polygon - */ - bool shapeDrawed(); - - /// @brief Tag selected in TagSelector - void tagSelected(); - - /// @brief add Polygon - bool addPolygon(const std::map& POIValues); - - /// @brief add POI - bool addPOI(const std::map& POIValues); - - /// @brief add POILane - bool addPOILane(const std::map& POIValues); - -private: - /// @brief shape tag selector - GNEFrameModuls::TagSelector* myShapeTagSelector; - - /// @brief shape internal attributes - GNEFrameAttributesModuls::AttributesCreator* myShapeAttributes; - - /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; - - /// @brief Drawing shape - GNEFrameModuls::DrawingShape* myDrawingShape; - - /// @brief GEOPOICreator - GEOPOICreator* myGEOPOICreator; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.cpp 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) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEProhibitionFrame.cpp -/// @author Mirko Barthauer (Technische Universitaet Braunschweig) -/// @date May 2018 -/// -// The Widget for editing connection prohibits -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEProhibitionFrame.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNEProhibitionFrame) GNEProhibitionFrameMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEProhibitionFrame::onCmdCancel), - FXMAPFUNC(SEL_COMMAND, MID_OK, GNEProhibitionFrame::onCmdOK) -}; - -// Object implementation -FXIMPLEMENT(GNEProhibitionFrame, FXVerticalFrame, GNEProhibitionFrameMap, ARRAYNUMBER(GNEProhibitionFrameMap)) - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEProhibitionFrame::RelativeToConnection - methods -// --------------------------------------------------------------------------- - -GNEProhibitionFrame::RelativeToConnection::RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Relative to connection", GUIDesignGroupBoxFrame), - myProhibitionFrameParent(prohibitionFrameParent) { - // Create label for current connection description and update it - myConnDescriptionLabel = new FXLabel(this, "", nullptr, GUIDesignLabelFrameInformation); - // update description - updateDescription(); -} - - -GNEProhibitionFrame::RelativeToConnection::~RelativeToConnection() {} - - -void -GNEProhibitionFrame::RelativeToConnection::updateDescription() const { - // update depending of myCurrentConn - if (myProhibitionFrameParent->myCurrentConn == nullptr) { - myConnDescriptionLabel->setText("No Connection selected\n"); - } else { - myConnDescriptionLabel->setText(("from lane " + myProhibitionFrameParent->myCurrentConn->getLaneFrom()->getMicrosimID() + - "\nto lane " + myProhibitionFrameParent->myCurrentConn->getLaneTo()->getMicrosimID()).c_str()); - } -} - -// --------------------------------------------------------------------------- -// GNEProhibitionFrame::ProhibitionLegend - methods -// --------------------------------------------------------------------------- - -GNEProhibitionFrame::ProhibitionLegend::ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame), - 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); - 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->setBackColor(MFXUtils::getFXColor(myUndefinedColor)); - // label for yields - legendLabel = new FXLabel(this, "Yields", nullptr, GUIDesignLabelFrameInformation); - legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitedColor)); - // label for right of way - legendLabel = new FXLabel(this, "Has right of way", nullptr, GUIDesignLabelFrameInformation); - legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitingColor)); - // label for unregulated conflict - legendLabel = new FXLabel(this, "Unregulated conflict", nullptr, GUIDesignLabelFrameInformation); - legendLabel->setBackColor(MFXUtils::getFXColor(myUnregulatedConflictColor)); - // label for mutual conflict - legendLabel = new FXLabel(this, "Mutual conflict", nullptr, GUIDesignLabelFrameInformation); - legendLabel->setBackColor(MFXUtils::getFXColor(myMutualConflictColor)); -} - - -GNEProhibitionFrame::ProhibitionLegend::~ProhibitionLegend() {} - - -const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getUndefinedColor() const { - return myUndefinedColor; -} - - -const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getProhibitedColor() const { - return myProhibitedColor; -} - - -const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getProhibitingColor() const { - return myProhibitingColor; -} - - -const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getUnregulatedConflictColor() const { - return myUnregulatedConflictColor; -} - - -const RGBColor& -GNEProhibitionFrame::ProhibitionLegend::getMutualConflictColor() const { - return myMutualConflictColor; -} - -// --------------------------------------------------------------------------- -// GNEProhibitionFrame::Modifications - methods -// --------------------------------------------------------------------------- - -GNEProhibitionFrame::Modifications::Modifications(GNEProhibitionFrame* prohibitionFrameParent) : - FXGroupBox(prohibitionFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame) { - - // Create "OK" button - mySaveButton = new FXButton(this, "OK\t\tSave prohibition modifications (Enter)", - GUIIconSubSys::getIcon(ICON_ACCEPT), prohibitionFrameParent, MID_OK, GUIDesignButton); - - // Create "Cancel" button - myCancelButton = new FXButton(this, "Cancel\t\tDiscard prohibition modifications (Esc)", - GUIIconSubSys::getIcon(ICON_CANCEL), prohibitionFrameParent, MID_CANCEL, GUIDesignButton); - - // Currently mySaveButton is disabled - mySaveButton->disable(); - mySaveButton->hide(); -} - - -GNEProhibitionFrame::Modifications::~Modifications() {} - -// --------------------------------------------------------------------------- -// GNEProhibitionFrame - methods -// --------------------------------------------------------------------------- - -GNEProhibitionFrame::GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Prohibits"), - myCurrentConn(nullptr) { - // set frame header label - getFrameHeaderLabel()->setText("Prohibitions"); - - // create RelativeToConnection - myRelativeToConnection = new RelativeToConnection(this); - - // create ProhibitionLegend - myProhibitionLegend = new ProhibitionLegend(this); - - // create Modifications - myModifications = new Modifications(this); -} - - -GNEProhibitionFrame::~GNEProhibitionFrame() {} - - -void -GNEProhibitionFrame::handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // build prohibition - buildProhibition(objectsUnderCursor.getConnectionFront(), myViewNet->getKeyPressed().shiftKeyPressed(), myViewNet->getKeyPressed().controlKeyPressed(), true); -} - - -void -GNEProhibitionFrame::show() { - GNEFrame::show(); -} - - -void -GNEProhibitionFrame::hide() { - GNEFrame::hide(); -} - - -long -GNEProhibitionFrame::onCmdCancel(FXObject*, FXSelector, void*) { - if (myCurrentConn != nullptr) { - for (auto conn : myConcernedConns) { - conn->setSpecialColor(nullptr); - } - myCurrentConn->setSpecialColor(nullptr); - myCurrentConn = nullptr; - myConcernedConns.clear(); - myRelativeToConnection->updateDescription(); - myViewNet->update(); - } - return 1; -} - - -long -GNEProhibitionFrame::onCmdOK(FXObject*, FXSelector, void*) { - return 1; -} - -// --------------------------------------------------------------------------- -// GNEProhibitionFrame - private methods -// --------------------------------------------------------------------------- - -void -GNEProhibitionFrame::buildProhibition(GNEConnection* conn, bool /* mayDefinitelyPass */, bool /* allowConflict */, bool /* toggle */) { - if (myCurrentConn == nullptr) { - myCurrentConn = conn; - myCurrentConn->setSpecialColor(&myViewNet->getVisualisationSettings().colorSettings.selectedProhibitionColor); - - // determine prohibition status of all other connections with respect to the selected one - GNEJunction* junction = myCurrentConn->getEdgeFrom()->getGNEJunctionDestiny(); - std::vector allConns = junction->getGNEConnections(); - NBNode* node = junction->getNBNode(); - NBEdge* currentConnFrom = myCurrentConn->getEdgeFrom()->getNBEdge(); - - const int currentLinkIndex = node->getConnectionIndex(currentConnFrom, myCurrentConn->getNBEdgeConnection()); - std::string currentFoesString = node->getFoes(currentLinkIndex); - std::string currentResponseString = node->getResponse(currentLinkIndex); - std::reverse(currentFoesString.begin(), currentFoesString.end()); - std::reverse(currentResponseString.begin(), currentResponseString.end()); - // iterate over all connections - for (const auto& i : allConns) { - if (i != myCurrentConn) { - NBEdge* otherConnFrom = i->getEdgeFrom()->getNBEdge(); - const int linkIndex = node->getConnectionIndex(otherConnFrom, i->getNBEdgeConnection()); - std::string responseString = node->getResponse(linkIndex); - std::reverse(responseString.begin(), responseString.end()); - // determine the prohibition status - bool foes = ((int)currentFoesString.size() > linkIndex) && (currentFoesString[linkIndex] == '1'); - bool forbids = ((int)responseString.size() > currentLinkIndex) && (responseString[currentLinkIndex] == '1'); - bool forbidden = ((int)currentResponseString.size() > linkIndex) && (currentResponseString[linkIndex] == '1'); - // insert in myConcernedConns - myConcernedConns.insert(i); - // change color depending of prohibition status - if (!foes) { - i->setSpecialColor(&myProhibitionLegend->getUndefinedColor()); - } else { - if (forbids && forbidden) { - i->setSpecialColor(&myProhibitionLegend->getMutualConflictColor()); - } else if (forbids) { - i->setSpecialColor(&myProhibitionLegend->getProhibitedColor()); - } else if (forbidden) { - i->setSpecialColor(&myProhibitionLegend->getProhibitingColor()); - } else { - i->setSpecialColor(&myProhibitionLegend->getUnregulatedConflictColor()); - } - } - } - } - // update description - myRelativeToConnection->updateDescription(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEProhibitionFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEProhibitionFrame.h -/// @author Mirko Barthauer (Technische Universitaet Braunschweig) -/// @date May 2018 -/// -// The Widget for remove network-elements -/****************************************************************************/ -#ifndef GNEProhibitionFrame_h -#define GNEProhibitionFrame_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEFrame.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEConnection; -class GNEAttributeCarrier; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEProhibitionFrame - * The Widget for editing connection foes - */ -class GNEProhibitionFrame : public GNEFrame { - /// @brief FOX-declaration - FXDECLARE(GNEProhibitionFrame) - -public: - - /// @brief the prohibition status of a connection - enum ConnStatus { - UNDEFINED, - PROHIBITED, - PROHIBITING - }; - - // =========================================================================== - // class RelativeToConnection - // =========================================================================== - - class RelativeToConnection : protected FXGroupBox { - - public: - /// @brief constructor - RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent); - - /// @brief destructor - ~RelativeToConnection(); - - /// @brief update description - void updateDescription() const; - - private: - /// @brief pointer to prohibition frame parent - GNEProhibitionFrame* myProhibitionFrameParent; - - /// @brief the label that shows the currently selected connection - FXLabel* myConnDescriptionLabel; - }; - - // =========================================================================== - // class ProhibitionLegend - // =========================================================================== - - class ProhibitionLegend : protected FXGroupBox { - - public: - /// @brief constructor - ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent); - - /// @brief destructor - ~ProhibitionLegend(); - - /// @brief get color for non-conflicting pairs of connections - const RGBColor& getUndefinedColor() const; - - /// @brief get color for waiting connections - const RGBColor& getProhibitedColor() const; - - /// @brief get color for connections with precedence - const RGBColor& getProhibitingColor() const; - - /// @brief get color for unregulated conflicts - const RGBColor& getUnregulatedConflictColor() const; - - /// @brief get color for mutual conflicts - const RGBColor& getMutualConflictColor() const; - - private: - /// @brief color for non-conflicting pairs of connections - RGBColor myUndefinedColor; - - /// @brief color for waiting connections - RGBColor myProhibitedColor; - - /// @brief color for connections with precedence - RGBColor myProhibitingColor; - - /// @brief color for unregulated conflicts - RGBColor myUnregulatedConflictColor; - - /// @brief color for mutual conflicts - RGBColor myMutualConflictColor; - }; - - // =========================================================================== - // class Modifications - // =========================================================================== - - class Modifications : protected FXGroupBox { - - public: - /// @brief constructor - Modifications(GNEProhibitionFrame* prohibitionFrameParent); - - /// @brief destructor - ~Modifications(); - - private: - /// @brief "Save" button - FXButton* mySaveButton; - - /// @brief "Cancel" button - FXButton* myCancelButton; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEProhibitionFrame(); - - /**@brief handle prohibitions and set the relative colouring - * @param objectsUnderCursor collection of objects under cursor after click over view - */ - void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief show prohibition frame - void show(); - - /// @brief hide prohibition frame - void hide(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user presses the OK-Button saves any prohibition modifications - long onCmdOK(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the Cancel-button discards any prohibition modifications - long onCmdCancel(FXObject*, FXSelector, void*); - - /// @} - -protected: - FOX_CONSTRUCTOR(GNEProhibitionFrame) - - /// @brief build prohibition - void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle); - -private: - /// @brief Relative To Connection - RelativeToConnection* myRelativeToConnection; - - /// @brief prohibition legend - ProhibitionLegend* myProhibitionLegend; - - /// @brief Modifications - Modifications* myModifications; - - /// @brief the connection which prohibits - GNEConnection* myCurrentConn; - - /// @brief the set of connections which - std::set myConcernedConns; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNERouteFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNERouteFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNERouteFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNERouteFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,906 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2018 -/// -// The Widget for remove network-elements -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNERouteFrame.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNERouteFrame::RouteModeSelector) RouteModeSelectorMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTEFRAME_ROUTEMODE, GNERouteFrame::RouteModeSelector::onCmdSelectRouteMode), - FXMAPFUNC(SEL_COMMAND, MID_GNE_ROUTEFRAME_VCLASS, GNERouteFrame::RouteModeSelector::onCmdSelectVClass), -}; - -FXDEFMAP(GNERouteFrame::ConsecutiveEdges) ConsecutiveEdgesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNERouteFrame::ConsecutiveEdges::onCmdAbortRoute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNERouteFrame::ConsecutiveEdges::onCmdCreateRoute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNERouteFrame::ConsecutiveEdges::onCmdRemoveLastRouteEdge) -}; - -FXDEFMAP(GNERouteFrame::NonConsecutiveEdges) NonConsecutiveEdgesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_ABORT, GNERouteFrame::NonConsecutiveEdges::onCmdAbortRoute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_FINISH, GNERouteFrame::NonConsecutiveEdges::onCmdCreateRoute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_EDGEPATH_REMOVELAST, GNERouteFrame::NonConsecutiveEdges::onCmdRemoveLastRouteEdge) -}; - -// Object implementation -FXIMPLEMENT(GNERouteFrame::RouteModeSelector, FXGroupBox, RouteModeSelectorMap, ARRAYNUMBER(RouteModeSelectorMap)) -FXIMPLEMENT(GNERouteFrame::ConsecutiveEdges, FXGroupBox, ConsecutiveEdgesMap, ARRAYNUMBER(ConsecutiveEdgesMap)) -FXIMPLEMENT(GNERouteFrame::NonConsecutiveEdges, FXGroupBox, NonConsecutiveEdgesMap, ARRAYNUMBER(NonConsecutiveEdgesMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNERouteFrame::RouteModeSelector - methods -// --------------------------------------------------------------------------- - -GNERouteFrame::RouteModeSelector::RouteModeSelector(GNERouteFrame* routeFrameParent) : - FXGroupBox(routeFrameParent->myContentFrame, "Route mode", GUIDesignGroupBoxFrame), - myRouteFrameParent(routeFrameParent), - myCurrentRouteMode(ROUTEMODE_CONSECUTIVE_EDGES), - myCurrentVehicleClass(SVC_PASSENGER), - myValidVClass(true) { - // first fill myRouteModesStrings - myRouteModesStrings.push_back(std::make_pair(ROUTEMODE_CONSECUTIVE_EDGES, "consecutive edges")); - myRouteModesStrings.push_back(std::make_pair(ROUTEMODE_NONCONSECUTIVE_EDGES, "non consecutive edges")); - // Create FXComboBox for Route mode - myRouteModeMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_ROUTEMODE, GUIDesignComboBox); - // fill myRouteModeMatchBox with route modes - for (const auto& i : myRouteModesStrings) { - myRouteModeMatchBox->appendItem(i.second.c_str()); - } - // Set visible items - myRouteModeMatchBox->setNumVisible((int)myRouteModeMatchBox->getNumItems()); - // Create FXComboBox for VClass - myVClassMatchBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_ROUTEFRAME_VCLASS, GUIDesignComboBox); - // fill myVClassMatchBox with all VCLass - for (const auto& i : SumoVehicleClassStrings.getStrings()) { - myVClassMatchBox->appendItem(i.c_str()); - } - // set Passenger als default VCLass - myVClassMatchBox->setCurrentItem(7); - // Set visible items - myVClassMatchBox->setNumVisible((int)myVClassMatchBox->getNumItems()); - // RouteModeSelector is always shown - show(); -} - - -GNERouteFrame::RouteModeSelector::~RouteModeSelector() {} - - -const GNERouteFrame::RouteMode& -GNERouteFrame::RouteModeSelector::getCurrentRouteMode() const { - return myCurrentRouteMode; -} - - -SUMOVehicleClass -GNERouteFrame::RouteModeSelector::getCurrentVehicleClass() const { - return myCurrentVehicleClass; -} - - -bool -GNERouteFrame::RouteModeSelector::isValidVehicleClass() const { - return myValidVClass; -} - - -void -GNERouteFrame::RouteModeSelector::setCurrentRouteMode(RouteMode routemode) { - // make sure that route isn't invalid - if (routemode != ROUTEMODE_INVALID) { - // restore color - myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0)); - // set current route mode - myCurrentRouteMode = routemode; - // set item in myTypeMatchBox - for (int i = 0; i < (int)myRouteModesStrings.size(); i++) { - if (myRouteModesStrings.at(i).first == myCurrentRouteMode) { - myRouteModeMatchBox->setCurrentItem(i); - } - } - // show route attributes modul - myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); - // show modes moduls - if ((routemode == ROUTEMODE_CONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { - myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - } else if ((routemode == ROUTEMODE_NONCONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); - } - } else { - // hide all moduls if route mode isnt' valid - myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - } -} - - -long -GNERouteFrame::RouteModeSelector::onCmdSelectRouteMode(FXObject*, FXSelector, void*) { - // first abort all current operations in moduls - myRouteFrameParent->myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - myRouteFrameParent->myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& i : myRouteModesStrings) { - if (i.second == myRouteModeMatchBox->getText().text()) { - // set color of myTypeMatchBox to black (valid) - myRouteModeMatchBox->setTextColor(FXRGB(0, 0, 0)); - // Set new current type - myCurrentRouteMode = i.first; - // show route attributes modul - myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); - // show modes moduls - if ((myCurrentRouteMode == ROUTEMODE_CONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { - myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - } else if ((myCurrentRouteMode == ROUTEMODE_NONCONSECUTIVE_EDGES) && (myCurrentVehicleClass != SVC_IGNORING)) { - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); - } - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected RouteMode '" + myRouteModeMatchBox->getText() + "' in RouteModeSelector").text()); - return 1; - } - } - // if Route mode isn't correct, set ROUTEMODE_INVALID as current route mde - myCurrentRouteMode = ROUTEMODE_INVALID; - // hide all moduls if route mode isn't valid - myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - // set color of myTypeMatchBox to red (invalid) - myRouteModeMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid RouteMode in RouteModeSelector"); - return 1; -} - - -long -GNERouteFrame::RouteModeSelector::onCmdSelectVClass(FXObject*, FXSelector, void*) { - // first abort all current operations in moduls - myRouteFrameParent->myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - myRouteFrameParent->myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - // Check if value of myTypeMatchBox correspond of an allowed additional tags - for (const auto& i : SumoVehicleClassStrings.getStrings()) { - if (i == myVClassMatchBox->getText().text()) { - // set color of myTypeMatchBox to black (valid) - myVClassMatchBox->setTextColor(FXRGB(0, 0, 0)); - // Set new current type - myCurrentVehicleClass = SumoVehicleClassStrings.get(i); - // change flag - myValidVClass = true; - // show route attributes modul - myRouteFrameParent->myRouteAttributes->showAttributesCreatorModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_ROUTE), {}); - // enable moduls if current route is valid - if (myCurrentRouteMode == ROUTEMODE_CONSECUTIVE_EDGES) { - myRouteFrameParent->myConsecutiveEdges->showConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - } else if (myCurrentRouteMode == ROUTEMODE_NONCONSECUTIVE_EDGES) { - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->showNonConsecutiveEdgesModul(); - } - // Write Warning in console if we're in testing mode - WRITE_DEBUG(("Selected VClass '" + myVClassMatchBox->getText() + "' in RouteModeSelector").text()); - return 1; - } - } - // if VClass name isn't correct, set SVC_IGNORING as current type - myCurrentVehicleClass = SVC_IGNORING; - // change flag - myValidVClass = false; - // hide all moduls if route mode isnt' valid - myRouteFrameParent->myRouteAttributes->hideAttributesCreatorModul(); - myRouteFrameParent->myConsecutiveEdges->hideConsecutiveEdgesModul(); - myRouteFrameParent->myNonConsecutiveEdges->hideNonConsecutiveEdgesModul(); - // set color of myTypeMatchBox to red (invalid) - myVClassMatchBox->setTextColor(FXRGB(255, 0, 0)); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Selected invalid VClass in RouteModeSelector"); - return 1; -} - -// --------------------------------------------------------------------------- -// GNERouteFrame::ConsecutiveEdges - methods -// --------------------------------------------------------------------------- - -GNERouteFrame::ConsecutiveEdges::ConsecutiveEdges(GNERouteFrame* routeFrameParent) : - FXGroupBox(routeFrameParent->myContentFrame, "Consecutive edges", GUIDesignGroupBoxFrame), - myRouteFrameParent(routeFrameParent) { - // create label for route info - myInfoRouteLabel = new FXLabel(this, "No edges selected", 0, GUIDesignLabelFrameInformation); - // Create button for create routes - myCreateRouteButton = new FXButton(this, "Create route", 0, this, MID_GNE_EDGEPATH_FINISH, GUIDesignButton); - myCreateRouteButton->disable(); - // Create button for create routes - myAbortCreationButton = new FXButton(this, "Abort creation", 0, this, MID_GNE_EDGEPATH_ABORT, GUIDesignButton); - myAbortCreationButton->disable(); - // create button for remove last inserted edge - myRemoveLastInsertedEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); - myRemoveLastInsertedEdge->disable(); - // ConsecutiveEdges is by default shown - show(); -} - - -GNERouteFrame::ConsecutiveEdges::~ConsecutiveEdges() {} - - -void -GNERouteFrame::ConsecutiveEdges::showConsecutiveEdgesModul() { - // recalc before show (to avoid graphic problems) - recalc(); - // show modul - show(); -} - - -void -GNERouteFrame::ConsecutiveEdges::hideConsecutiveEdgesModul() { - // first abort route creation - onCmdAbortRoute(0, 0, 0); - // now hide modul - hide(); -} - - -bool -GNERouteFrame::ConsecutiveEdges::addEdge(GNEEdge* edge) { - // check if currently we're creating a new route - if (myRouteEdges.empty()) { - // block undo/redo - myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); - // add edge into list - myRouteEdges.push_back(edge); - // refresh edge candidates - refreshEdgeCandidates(); - // enable create route and abort edge route - myCreateRouteButton->enable(); - myAbortCreationButton->enable(); - // edge added, then return true - return true; - } else { - // check if clicked edge is in the candidate edges - for (const auto& i : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - if ((i == edge) && GNEDemandElement::getRouteCalculatorInstance()->consecutiveEdgesConnected(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), myRouteEdges.back(), edge)) { - // restore colors of outgoing edges - for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(nullptr); - } - } - // add new edge in the list of route edges - myRouteEdges.push_back(edge); - // enable remove last inserted edge - myRemoveLastInsertedEdge->enable(); - // refresh edge candidates - refreshEdgeCandidates(); - // edge added, then return true - return true; - } - } - // edge isn't a candidate edge, then return false - return false; - } -} - - -void -GNERouteFrame::ConsecutiveEdges::refreshEdgeCandidates() { - // first check that at least there is a candidate edge - if (myRouteEdges.size() > 0) { - // set selected color in all edges - for (const auto& j : myRouteEdges) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateColor()); - } - } - // set new candidate colors - for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - // check if exist a connection between both edges - if (GNEDemandElement::getRouteCalculatorInstance()->consecutiveEdgesConnected(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), myRouteEdges.back(), j)) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); - } - } - } - // update route label - updateInfoRouteLabel(); - // update view - myRouteFrameParent->getViewNet()->update(); - } -} - - -void -GNERouteFrame::ConsecutiveEdges::clearEdges() { - // disable special color in candidate edges - for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(nullptr); - } - } - // disable special color in current route edges - for (const auto& j : myRouteEdges) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(nullptr); - } - } - // clear route edges - myRouteEdges.clear(); -} - - -const std::vector& -GNERouteFrame::ConsecutiveEdges::getRouteEdges() const { - return myRouteEdges; -} - - -long -GNERouteFrame::ConsecutiveEdges::onCmdCreateRoute(FXObject*, FXSelector, void*) { - // check that route attributes are valid - if (!myRouteFrameParent->myRouteAttributes->areValuesValid()) { - myRouteFrameParent->myRouteAttributes->showWarningMessage(); - } else if (myRouteEdges.size() > 0) { - // obtain attributes - std::map valuesMap = myRouteFrameParent->myRouteAttributes->getAttributesAndValues(true); - // declare a route parameter - GNERouteHandler::RouteParameter routeParameters; - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - routeParameters.routeID = myRouteFrameParent->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE); - } else { - routeParameters.routeID = valuesMap[SUMO_ATTR_ID]; - } - // fill rest of elements - routeParameters.color = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_COLOR)); - routeParameters.edges = myRouteEdges; - routeParameters.vClass = myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(); - // create route - GNERoute* route = new GNERoute(myRouteFrameParent->getViewNet(), routeParameters); - // add it into GNENet using GNEChange_DemandElement (to allow undo-redo) - myRouteFrameParent->getViewNet()->getUndoList()->p_begin("add " + route->getTagStr()); - myRouteFrameParent->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); - myRouteFrameParent->getViewNet()->getUndoList()->p_end(); - // abort route creation (because route was already created and vector/colors has to be cleaned) - onCmdAbortRoute(0, 0, 0); - // refresh route attributes - myRouteFrameParent->myRouteAttributes->refreshRows(); - } - return 1; -} - - -long -GNERouteFrame::ConsecutiveEdges::onCmdAbortRoute(FXObject*, FXSelector, void*) { - // first check that there is route edges selected - if (myRouteEdges.size() > 0) { - // unblock undo/redo - myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); - // clear edges - clearEdges(); - // disable buttons - myCreateRouteButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastInsertedEdge->disable(); - // update route label - updateInfoRouteLabel(); - // update view - myRouteFrameParent->getViewNet()->update(); - } - return 1; -} - - -long -GNERouteFrame::ConsecutiveEdges::onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*) { - if (myRouteEdges.size() > 1) { - // restore colors of last inserted edge edges - for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(nullptr); - } - } - // add new edge in the list of route edges - myRouteEdges.pop_back(); - // set selected color in all edges - for (const auto& j : myRouteEdges) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateColor()); - } - } - // set new candidate colors - for (const auto& j : myRouteEdges.back()->getGNEJunctionDestiny()->getGNEOutgoingEdges()) { - if (j != myRouteEdges.back()) { - for (const auto& k : j->getLanes()) { - k->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); - } - } - } - // disable remove last edge button if there is only one edge - if (myRouteEdges.size() == 1) { - myRemoveLastInsertedEdge->disable(); - } - // update route label - updateInfoRouteLabel(); - // update view - myRouteFrameParent->getViewNet()->update(); - // edge added, then return true - return true; - } else { - return false; - } -} - -void -GNERouteFrame::ConsecutiveEdges::updateInfoRouteLabel() { - if (myRouteEdges.size() > 0) { - // declare variables for route info - double length = 0; - double speed = 0; - for (const auto& i : myRouteEdges) { - length += i->getNBEdge()->getLength(); - speed += i->getNBEdge()->getSpeed(); - } - // declare ostringstream for label and fill it - std::ostringstream information; - information - << "- Number of Edges: " << toString(myRouteEdges.size()) << "\n" - << "- Length: " << toString(length) << "\n" - << "- Average speed: " << toString(speed / myRouteEdges.size()); - // set new label - myInfoRouteLabel->setText(information.str().c_str()); - } else { - myInfoRouteLabel->setText("No edges selected"); - } -} - -// --------------------------------------------------------------------------- -// GNERouteFrame::NonConsecutiveEdges - methods -// --------------------------------------------------------------------------- - -GNERouteFrame::NonConsecutiveEdges::NonConsecutiveEdges(GNERouteFrame* routeFrameParent) : - FXGroupBox(routeFrameParent->myContentFrame, "Route creator", GUIDesignGroupBoxFrame), - myRouteFrameParent(routeFrameParent) { - // create label for route info - myInfoRouteLabel = new FXLabel(this, "No edges selected", 0, GUIDesignLabelFrameInformation); - // 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 - myRemoveLastInsertedEdge = new FXButton(this, "Remove last inserted edge", nullptr, this, MID_GNE_EDGEPATH_REMOVELAST, GUIDesignButton); - myRemoveLastInsertedEdge->disable(); -} - - -GNERouteFrame::NonConsecutiveEdges::~NonConsecutiveEdges() { -} - - -void -GNERouteFrame::NonConsecutiveEdges::showNonConsecutiveEdgesModul() { - // disable buttons - myFinishCreationButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastInsertedEdge->disable(); - // recalc before show (to avoid graphic problems) - recalc(); - // show modul - show(); -} - - -void -GNERouteFrame::NonConsecutiveEdges::hideNonConsecutiveEdgesModul() { - hide(); -} - - -std::vector -GNERouteFrame::NonConsecutiveEdges::getSelectedEdges() const { - return mySelectedEdges; -} - - -bool -GNERouteFrame::NonConsecutiveEdges::addEdge(GNEEdge* edge) { - if (mySelectedEdges.empty() || ((mySelectedEdges.size() > 0) && (mySelectedEdges.back() != edge))) { - mySelectedEdges.push_back(edge); - // enable abort route button - myAbortCreationButton->enable(); - // enable finish button - myFinishCreationButton->enable(); - // disable undo/redo - myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->disableUndoRedo("route creation"); - // set special color - for (auto i : edge->getLanes()) { - i->setSpecialColor(&myRouteFrameParent->getEdgeCandidateSelectedColor()); - } - // calculate route if there is more than two edges - if (mySelectedEdges.size() > 1) { - // enable remove last edge button - myRemoveLastInsertedEdge->enable(); - // calculate temporal route - myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), mySelectedEdges); - } else { - // Routes with only one edge are allowed - myTemporalRoute.clear(); - myTemporalRoute.push_back(mySelectedEdges.front()); - } - // update info route label - updateInfoRouteLabel(); - return true; - } else { - return false; - } -} - - -void -GNERouteFrame::NonConsecutiveEdges::clearEdges() { - // restore colors - for (const auto& i : mySelectedEdges) { - for (const auto& j : i->getLanes()) { - j->setSpecialColor(nullptr); - } - } - // clear edges - mySelectedEdges.clear(); - myTemporalRoute.clear(); -} - - -const std::vector& -GNERouteFrame::NonConsecutiveEdges::getTemporalRoute() const { - return myTemporalRoute; -} - - -bool -GNERouteFrame::NonConsecutiveEdges::isValid(SUMOVehicleClass /* vehicleClass */) const { - return mySelectedEdges.size() > 0; -} - - -long -GNERouteFrame::NonConsecutiveEdges::onCmdCreateRoute(FXObject*, FXSelector, void*) { - // check that route attributes are valid - if (!myRouteFrameParent->myRouteAttributes->areValuesValid()) { - myRouteFrameParent->myRouteAttributes->showWarningMessage(); - } else if (mySelectedEdges.size() > 0) { - // declare a route parameter - GNERouteHandler::RouteParameter routeParameters; - routeParameters.edges.reserve(myTemporalRoute.size()); - for (const auto& i : myTemporalRoute) { - routeParameters.edges.push_back(myRouteFrameParent->myViewNet->getNet()->retrieveEdge(i->getID())); - } - // obtain attributes - std::map valuesMap = myRouteFrameParent->myRouteAttributes->getAttributesAndValues(true); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - routeParameters.routeID = myRouteFrameParent->getViewNet()->getNet()->generateDemandElementID("", SUMO_TAG_ROUTE); - } - // fill rest of elements - routeParameters.color = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_COLOR)); - routeParameters.vClass = myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(); - // create route - GNERoute* route = new GNERoute(myRouteFrameParent->getViewNet(), routeParameters); - // add it into GNENet using GNEChange_DemandElement (to allow undo-redo) - myRouteFrameParent->getViewNet()->getUndoList()->p_begin("add " + route->getTagStr()); - myRouteFrameParent->getViewNet()->getUndoList()->add(new GNEChange_DemandElement(route, true), true); - myRouteFrameParent->getViewNet()->getUndoList()->p_end(); - // abort route creation (because route was already created and vector/colors has to be cleaned) - onCmdAbortRoute(0, 0, 0); - // refresh route attributes - myRouteFrameParent->myRouteAttributes->refreshRows(); - } - return 1; -} - - -long -GNERouteFrame::NonConsecutiveEdges::onCmdAbortRoute(FXObject*, FXSelector, void*) { - // first check that there is route edges selected - if (mySelectedEdges.size() > 0) { - // unblock undo/redo - myRouteFrameParent->myViewNet->getViewParent()->getGNEAppWindows()->enableUndoRedo(); - // clear edges - clearEdges(); - // disable buttons - myFinishCreationButton->disable(); - myAbortCreationButton->disable(); - myRemoveLastInsertedEdge->disable(); - // update info route label - updateInfoRouteLabel(); - // update view (to see the new route) - myRouteFrameParent->getViewNet()->update(); - } - return 1; -} - - -long -GNERouteFrame::NonConsecutiveEdges::onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*) { - if (mySelectedEdges.size() > 1) { - // remove special color of last selected edge - for (auto i : mySelectedEdges.back()->getLanes()) { - i->setSpecialColor(0); - } - // remove last edge - mySelectedEdges.pop_back(); - // check if remove last route edge button has to be disabled - if (mySelectedEdges.size() == 1) { - // avoid remove last edge - myRemoveLastInsertedEdge->disable(); - // Routes with only one edge are allowed - myTemporalRoute.clear(); - myTemporalRoute.push_back(mySelectedEdges.front()); - } else { - // calculate temporal route - myTemporalRoute = GNEDemandElement::getRouteCalculatorInstance()->calculateDijkstraRoute(myRouteFrameParent->myRouteModeSelector->getCurrentVehicleClass(), mySelectedEdges); - } - // update info route label - updateInfoRouteLabel(); - // update view - myRouteFrameParent->myViewNet->update(); - return true; - } else { - return false; - } -} - -void -GNERouteFrame::NonConsecutiveEdges::updateInfoRouteLabel() { - if (myTemporalRoute.size() > 0) { - // declare variables for route info - double length = 0; - double speed = 0; - for (const auto& i : myTemporalRoute) { - length += i->getNBEdge()->getLength(); - speed += i->getNBEdge()->getSpeed(); - } - // declare ostringstream for label and fill it - std::ostringstream information; - information - << "- Number of Edges: " << toString(myTemporalRoute.size()) << "\n" - << "- Length: " << toString(length) << "\n" - << "- Average speed: " << toString(speed / myTemporalRoute.size()); - // set new label - myInfoRouteLabel->setText(information.str().c_str()); - } else { - myInfoRouteLabel->setText("No edges selected"); - } -} - -// --------------------------------------------------------------------------- -// GNERouteFrame - methods -// --------------------------------------------------------------------------- - -GNERouteFrame::GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Routes") { - - // create route mode Selector modul - myRouteModeSelector = new RouteModeSelector(this); - - // Create route parameters - myRouteAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // create consecutive edges modul - myConsecutiveEdges = new ConsecutiveEdges(this); - - // create non consecutive edges modul - myNonConsecutiveEdges = new NonConsecutiveEdges(this); - - // set ROUTEMODE_CONSECUTIVE_EDGES as default mode - myRouteModeSelector->setCurrentRouteMode(ROUTEMODE_CONSECUTIVE_EDGES); -} - - -GNERouteFrame::~GNERouteFrame() {} - - -void -GNERouteFrame::show() { - // refresh myRouteModeSelector - myRouteModeSelector->setCurrentRouteMode(myRouteModeSelector->getCurrentRouteMode()); - // show route frame - GNEFrame::show(); -} - - -void -GNERouteFrame::hide() { - GNEFrame::hide(); -} - - -void -GNERouteFrame::handleEdgeClick(GNEEdge* clickedEdge) { - // first check if current vClass is valid and edge exist - if (myRouteModeSelector->isValidVehicleClass() && clickedEdge) { - // continue dependig of current mode - switch (myRouteModeSelector->getCurrentRouteMode()) { - case ROUTEMODE_CONSECUTIVE_EDGES: - // check if edge can be inserted in consecutive edges modul modul - if (myConsecutiveEdges->addEdge(clickedEdge)) { - WRITE_DEBUG("Edge added in ConsecutiveEdges mode"); - } else { - WRITE_DEBUG("Edge wasn't added in ConsecutiveEdges mode"); - } - break; - case ROUTEMODE_NONCONSECUTIVE_EDGES: - // check if edge can be inserted in non consecutive edges modul modul - if (myNonConsecutiveEdges->addEdge(clickedEdge)) { - WRITE_DEBUG("Edge added in NonConsecutiveEdges mode"); - } else { - WRITE_DEBUG("Edge wasn't added in NonConsecutiveEdges mode"); - } - break; - default: - break; - } - // update view - myViewNet->update(); - } -} - - -void -GNERouteFrame::hotkeyEnter() { - // first check if current vClass is valid - if (myRouteModeSelector->isValidVehicleClass()) { - // continue dependig of current mode - switch (myRouteModeSelector->getCurrentRouteMode()) { - case ROUTEMODE_CONSECUTIVE_EDGES: - myConsecutiveEdges->onCmdCreateRoute(0, 0, 0); - break; - case ROUTEMODE_NONCONSECUTIVE_EDGES: - myNonConsecutiveEdges->onCmdCreateRoute(0, 0, 0); - break; - default: - break; - } - // update view - myViewNet->update(); - } -} - - -void -GNERouteFrame::hotkeyBackSpace() { - // first check if current vClass is valid - if (myRouteModeSelector->isValidVehicleClass()) { - // continue dependig of current mode - switch (myRouteModeSelector->getCurrentRouteMode()) { - case ROUTEMODE_CONSECUTIVE_EDGES: - myConsecutiveEdges->onCmdRemoveLastRouteEdge(0, 0, 0); - break; - case ROUTEMODE_NONCONSECUTIVE_EDGES: - myNonConsecutiveEdges->onCmdRemoveLastRouteEdge(0, 0, 0); - break; - default: - break; - } - // update view - myViewNet->update(); - } -} - - -void -GNERouteFrame::hotkeyEsc() { - // first check if current vClass is valid - if (myRouteModeSelector->isValidVehicleClass()) { - // continue dependig of current mode - switch (myRouteModeSelector->getCurrentRouteMode()) { - case ROUTEMODE_CONSECUTIVE_EDGES: - myConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - break; - case ROUTEMODE_NONCONSECUTIVE_EDGES: - myNonConsecutiveEdges->onCmdAbortRoute(0, 0, 0); - break; - default: - break; - } - // update view - myViewNet->update(); - } -} - - -void -GNERouteFrame::drawTemporalRoute() const { - // declare a vector with temporal route edges - std::vector temporalRoute; - // obtain temporal route depending of current route mode - switch (myRouteModeSelector->getCurrentRouteMode()) { - case ROUTEMODE_CONSECUTIVE_EDGES: - // convert GNEEdges to NBEdges - temporalRoute.reserve(myConsecutiveEdges->getRouteEdges().size()); - for (const auto& i : myConsecutiveEdges->getRouteEdges()) { - temporalRoute.push_back(i); - } - break; - case ROUTEMODE_NONCONSECUTIVE_EDGES: - temporalRoute = myNonConsecutiveEdges->getTemporalRoute(); - break; - default: - break; - } - // only draw if there is at least two edges - if (temporalRoute.size() > 1) { - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, GLO_MAX); - // set orange color - GLHelper::setColor(RGBColor::ORANGE); - // set line width - glLineWidth(5); - // draw first line - GLHelper::drawLine(temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.front(), - temporalRoute.at(0)->getNBEdge()->getLanes().front().shape.back()); - // draw rest of lines - for (int i = 1; i < (int)temporalRoute.size(); i++) { - GLHelper::drawLine(temporalRoute.at(i - 1)->getNBEdge()->getLanes().front().shape.back(), - temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front()); - GLHelper::drawLine(temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.front(), - temporalRoute.at(i)->getNBEdge()->getLanes().front().shape.back()); - } - // Pop last matrix - glPopMatrix(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNERouteFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNERouteFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNERouteFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNERouteFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,304 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNERouteFrame.h -/// @author Pablo Alvarez Lopez -/// @date Dec 2016 -/// -// The Widget for create route elements -/****************************************************************************/ -#ifndef GNERouteFrame_h -#define GNERouteFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNERouteFrame - * The Widget for create route elements - */ -class GNERouteFrame : public GNEFrame { - -public: - - /// @brief route creation modes - enum RouteMode { - ROUTEMODE_INVALID, // invalid RouteMode - ROUTEMODE_CONSECUTIVE_EDGES, // Create route clicking over consecutive edges - ROUTEMODE_NONCONSECUTIVE_EDGES // Create route clicking over non consecutive edges - }; - - // =========================================================================== - // class RouteModeSelector - // =========================================================================== - - class RouteModeSelector : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNERouteFrame::RouteModeSelector) - - public: - /// @brief constructor - RouteModeSelector(GNERouteFrame* routeFrameParent); - - /// @brief destructor - ~RouteModeSelector(); - - /// @brief get current route mode - const RouteMode& getCurrentRouteMode() const; - - /// @brief get current selected VClass - SUMOVehicleClass getCurrentVehicleClass() const; - - /// @brief check if current VClass is Valid - bool isValidVehicleClass() const; - - /// @brief set current route mode type manually - void setCurrentRouteMode(RouteMode routemode); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select another route mode in ComboBox - long onCmdSelectRouteMode(FXObject*, FXSelector, void*); - - /// @brief Called when the user select another VClass - long onCmdSelectVClass(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(RouteModeSelector) - - private: - /// @brief pointer to Frame Parent - GNERouteFrame* myRouteFrameParent; - - /// @brief comboBox with the list of route modes - FXComboBox* myRouteModeMatchBox; - - /// @brief comboBox with the list of VClass - FXComboBox* myVClassMatchBox; - - /// @brief current selected route mode - RouteMode myCurrentRouteMode; - - /// @brief current selected VClass - SUMOVehicleClass myCurrentVehicleClass; - - /// @brief flag to check if VClass is Valid - bool myValidVClass; - - /// @brief list of Route modes that will be shown in Match Box - std::vector > myRouteModesStrings; - }; - - // =========================================================================== - // class ConsecutiveEdges - // =========================================================================== - - class ConsecutiveEdges : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNERouteFrame::ConsecutiveEdges) - - public: - /// @brief constructor - ConsecutiveEdges(GNERouteFrame* routeFrameParent); - - /// @brief destructor - ~ConsecutiveEdges(); - - /// @brief show ConsecutiveEdges modul - void showConsecutiveEdgesModul(); - - /// @brief hide ConsecutiveEdges modul - void hideConsecutiveEdgesModul(); - - /// @brief add edge to current route (note: edge must be included in set of candidate edges - bool addEdge(GNEEdge* edge); - - /// @brief refresh edge candidates - void refreshEdgeCandidates(); - - /// @brief clear edges (and restore colors) - void clearEdges(); - - /// @brief get temporal route - const std::vector& getRouteEdges() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press create route button - long onCmdCreateRoute(FXObject*, FXSelector, void*); - - /// @brief Called when the user press create route button - long onCmdAbortRoute(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Remove las inserted edge" - long onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(ConsecutiveEdges) - - /// @brief update InfoRouteLabel - void updateInfoRouteLabel(); - - private: - /// @brief pointer to Frame Parent - GNERouteFrame* myRouteFrameParent; - - /// @brief label with route info - FXLabel* myInfoRouteLabel; - - /// @brief FXButton for create routes - FXButton* myCreateRouteButton; - - /// @bief FXButton for abort creating route - FXButton* myAbortCreationButton; - - /// @brief button for removing last inserted edge - FXButton* myRemoveLastInsertedEdge; - - /// @brief vector with current route edges - std::vector myRouteEdges; - }; - - // =========================================================================== - // class NonConsecutiveEdges - // =========================================================================== - - class NonConsecutiveEdges : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNERouteFrame::NonConsecutiveEdges) - - public: - /// @brief default constructor - NonConsecutiveEdges(GNERouteFrame* routeFrameParent); - - /// @brief destructor - ~NonConsecutiveEdges(); - - /// @brief show NonConsecutiveEdges - void showNonConsecutiveEdgesModul(); - - /// @brief show NonConsecutiveEdges - void hideNonConsecutiveEdgesModul(); - - /// @brief check if from and to edges create a valid route - bool isValid(SUMOVehicleClass vehicleClass) const; - - /// @brief get current selected edgesm - std::vector getSelectedEdges() const; - - /// @brief set edge from (and change color) - bool addEdge(GNEEdge* edge); - - /// @brief clear edges (and restore colors) - void clearEdges(); - - /// @brief get temporal route - const std::vector& getTemporalRoute() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user click over button "Finish route creation" - long onCmdCreateRoute(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Abort route creation" - long onCmdAbortRoute(FXObject*, FXSelector, void*); - - /// @brief Called when the user click over button "Remove las inserted edge" - long onCmdRemoveLastRouteEdge(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(NonConsecutiveEdges) - - /// @brief update InfoRouteLabel - void updateInfoRouteLabel(); - - private: - /// @brief pointer to Vehicle Frame Parent - GNERouteFrame* myRouteFrameParent; - - /// @brief label with route info - FXLabel* myInfoRouteLabel; - - /// @brief current selected edges - std::vector mySelectedEdges; - - /// @brief vector with temporal route edges - std::vector myTemporalRoute; - - /// @brief button for finish route creation - FXButton* myFinishCreationButton; - - /// @brief button for abort route creation - FXButton* myAbortCreationButton; - - /// @brief button for removing last inserted edge - FXButton* myRemoveLastInsertedEdge; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNERouteFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNERouteFrame(); - - /// @brief show delete frame - void show(); - - /// @brief hide delete frame - void hide(); - - /// @brief handle edge click - void handleEdgeClick(GNEEdge* clickedEdge); - - /// @brief function called when user press ENTER key - void hotkeyEnter(); - - /// @brief function called when user press BACKSPACE key - void hotkeyBackSpace(); - - /// @brief function called when user press ESC key - void hotkeyEsc(); - - /// @brief draw temporal route - void drawTemporalRoute() const; - -private: - /// @brief route mode selector - RouteModeSelector* myRouteModeSelector; - - /// @brief internal additional attributes - GNEFrameAttributesModuls::AttributesCreator* myRouteAttributes; - - /// @brief Create routes using consecutive edges modul - ConsecutiveEdges* myConsecutiveEdges; - - /// @brief Create routes using non consecutive edges modul - NonConsecutiveEdges* myNonConsecutiveEdges; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNESelectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNESelectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNESelectorFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNESelectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1679 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNESelectorFrame.cpp -/// @author Jakob Erdmann -/// @date Mar 2011 -/// -// The Widget for modifying selections of network-elements -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNESelectorFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -FXDEFMAP(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) ObjectTypeEntryMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::onCmdSetCheckBox) -}; - -FXDEFMAP(GNESelectorFrame::ModificationMode) ModificationModeMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNESelectorFrame::ModificationMode::onCmdSelectModificationMode) -}; - -FXDEFMAP(GNESelectorFrame::ElementSet) ElementSetMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_ELEMENTS, GNESelectorFrame::ElementSet::onCmdSelectElementSet) -}; - -FXDEFMAP(GNESelectorFrame::MatchAttribute) MatchAttributeMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTTAG, GNESelectorFrame::MatchAttribute::onCmdSelMBTag), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GNESelectorFrame::MatchAttribute::onCmdSelMBAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_PROCESSSTRING, GNESelectorFrame::MatchAttribute::onCmdSelMBString), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNESelectorFrame::MatchAttribute::onCmdHelp) -}; - -FXDEFMAP(GNESelectorFrame::VisualScaling) VisualScalingMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECTORFRAME_SELECTSCALE, GNESelectorFrame::VisualScaling::onCmdScaleSelection) -}; - -FXDEFMAP(GNESelectorFrame::SelectionOperation) SelectionOperationMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_LOAD, GNESelectorFrame::SelectionOperation::onCmdLoad), - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_SAVE, GNESelectorFrame::SelectionOperation::onCmdSave), - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_INVERT, GNESelectorFrame::SelectionOperation::onCmdInvert), - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_CLEAR, GNESelectorFrame::SelectionOperation::onCmdClear) -}; - -// Object implementation -FXIMPLEMENT(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry, FXObject, ObjectTypeEntryMap, ARRAYNUMBER(ObjectTypeEntryMap)) -FXIMPLEMENT(GNESelectorFrame::ModificationMode, FXGroupBox, ModificationModeMap, ARRAYNUMBER(ModificationModeMap)) -FXIMPLEMENT(GNESelectorFrame::ElementSet, FXGroupBox, ElementSetMap, ARRAYNUMBER(ElementSetMap)) -FXIMPLEMENT(GNESelectorFrame::MatchAttribute, FXGroupBox, MatchAttributeMap, ARRAYNUMBER(MatchAttributeMap)) -FXIMPLEMENT(GNESelectorFrame::VisualScaling, FXGroupBox, VisualScalingMap, ARRAYNUMBER(VisualScalingMap)) -FXIMPLEMENT(GNESelectorFrame::SelectionOperation, FXGroupBox, SelectionOperationMap, ARRAYNUMBER(SelectionOperationMap)) - -// =========================================================================== -// method definitions -// =========================================================================== - -GNESelectorFrame::GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): - GNEFrame(horizontalFrameParent, viewNet, "Selection") { - // create selectedItems modul - myLockGLObjectTypes = new LockGLObjectTypes(this); - // create Modification Mode modul - myModificationMode = new ModificationMode(this); - // create ElementSet modul - myElementSet = new ElementSet(this); - // create MatchAttribute modul - myMatchAttribute = new MatchAttribute(this); - // create VisualScaling modul - 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 items.", nullptr, GUIDesignLabelFrameInformation); - -} - - -GNESelectorFrame::~GNESelectorFrame() {} - - -void -GNESelectorFrame::show() { - // show Type Entries depending of current supermode - myLockGLObjectTypes->showTypeEntries(); - // refresh element set - myElementSet->refreshElementSet(); - // Show frame - GNEFrame::show(); -} - - -void -GNESelectorFrame::hide() { - // hide frame - GNEFrame::hide(); -} - - -void -GNESelectorFrame::clearCurrentSelection() const { - // only continue if there is element for selecting - if (ACsToSelected()) { - // for invert selection, first clean current selection and next select elements of set "unselectedElements" - myViewNet->getUndoList()->p_begin("invert selection"); - // invert selection of elements depending of current supermode - if (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // iterate over junctions - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().junctions) { - // check if junction selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - // due we iterate over all junctions, only it's neccesary iterate over incoming edges - for (const auto& j : i.second->getGNEIncomingEdges()) { - // check if edge selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EDGE)) { - if (j->isAttributeCarrierSelected()) { - j->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - // check if lane selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_LANE)) { - for (auto k : j->getLanes()) { - if (k->isAttributeCarrierSelected()) { - k->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // check if connection selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_CONNECTION)) { - for (const auto& k : j->getGNEConnections()) { - if (k->isAttributeCarrierSelected()) { - k->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - } - // check if crossing selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_CROSSING)) { - for (const auto& j : i.second->getGNECrossings()) { - if (j->isAttributeCarrierSelected()) { - j->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - } - // check if additionals selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ADDITIONAL)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) { - // first check if additional is selectable - if (GNEAttributeCarrier::getTagProperties(i.first).isSelectable()) { - for (const auto& j : i.second) { - if (j.second->isAttributeCarrierSelected()) { - j.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - } - } - // select polygons - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POLYGON)) { - for (const auto& i : myViewNet->getNet()->getPolygons()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - shape->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select POIs - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POI)) { - for (const auto& i : myViewNet->getNet()->getPOIs()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - shape->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - } else { - // select routes - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTE)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select embedded route - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EMBEDDEDROUTE)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_EMBEDDEDROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select vehicles - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_VEHICLE)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select trips - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_TRIP)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_FLOW)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select route flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTEFLOW)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select stops - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_STOP)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select person - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSON)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select person flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONFLOW)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select person trips - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONTRIP)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select ride - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_RIDE)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select walks - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_WALK)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_ROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - // select person stops - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONSTOP)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_LANE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - } - } - // finish selection operation - myViewNet->getUndoList()->p_end(); - // update view - myViewNet->update(); - } -} - - -void -GNESelectorFrame::handleIDs(const std::vector& ACs, ModificationMode::SetOperation setop) { - const ModificationMode::SetOperation setOperation = ((setop == ModificationMode::SET_DEFAULT) ? myModificationMode->getModificationMode() : setop); - // declare two sets of attribute carriers, one for select and another for unselect - std::set > ACToSelect; - std::set > ACToUnselect; - // in restrict AND replace mode all current selected attribute carriers will be unselected - if ((setOperation == ModificationMode::SET_REPLACE) || (setOperation == ModificationMode::SET_RESTRICT)) { - // obtain selected ACs depending of current supermode - std::vector selectedAC = myViewNet->getNet()->getSelectedAttributeCarriers(false); - // add id into ACs to unselect - for (auto i : selectedAC) { - ACToUnselect.insert(std::pair(i->getID(), i)); - } - } - // handle ids - for (auto i : ACs) { - // iterate over AtributeCarriers an place it in ACToSelect or ACToUnselect - switch (setOperation) { - case GNESelectorFrame::ModificationMode::SET_SUB: - ACToUnselect.insert(std::pair(i->getID(), i)); - break; - case GNESelectorFrame::ModificationMode::SET_RESTRICT: - if (ACToUnselect.find(std::pair(i->getID(), i)) != ACToUnselect.end()) { - ACToSelect.insert(std::pair(i->getID(), i)); - } - break; - default: - ACToSelect.insert(std::pair(i->getID(), i)); - break; - } - } - // select junctions and their connections if Auto select junctions is enabled (note: only for "add mode") - if (myViewNet->autoSelectNodes() && GNESelectorFrame::ModificationMode::SET_ADD) { - std::vector edgesToSelect; - // iterate over ACToSelect and extract edges - for (auto i : ACToSelect) { - if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) { - edgesToSelect.push_back(dynamic_cast(i.second)); - } - } - // iterate over extracted edges - for (auto i : edgesToSelect) { - // select junction source and all their connections and crossings - ACToSelect.insert(std::make_pair(i->getGNEJunctionSource()->getID(), i->getGNEJunctionSource())); - for (auto j : i->getGNEJunctionSource()->getGNEConnections()) { - ACToSelect.insert(std::make_pair(j->getID(), j)); - } - for (auto j : i->getGNEJunctionSource()->getGNECrossings()) { - ACToSelect.insert(std::make_pair(j->getID(), j)); - } - // select junction destiny and all their connections crossings - ACToSelect.insert(std::make_pair(i->getGNEJunctionDestiny()->getID(), i->getGNEJunctionDestiny())); - for (auto j : i->getGNEJunctionDestiny()->getGNEConnections()) { - ACToSelect.insert(std::make_pair(j->getID(), j)); - } - for (auto j : i->getGNEJunctionDestiny()->getGNECrossings()) { - ACToSelect.insert(std::make_pair(j->getID(), j)); - } - } - } - // only continue if there is ACs to select or unselect - if ((ACToSelect.size() + ACToUnselect.size()) > 0) { - // first unselect AC of ACToUnselect and then selects AC of ACToSelect - myViewNet->getUndoList()->p_begin("selection using rectangle"); - for (auto i : ACToUnselect) { - if (i.second->getTagProperty().isSelectable()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", myViewNet->getUndoList()); - } - } - for (auto i : ACToSelect) { - if (i.second->getTagProperty().isSelectable()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", myViewNet->getUndoList()); - } - } - // finish operation - myViewNet->getUndoList()->p_end(); - } - // update view - myViewNet->update(); -} - - -GNESelectorFrame::ModificationMode* -GNESelectorFrame::getModificationModeModul() const { - return myModificationMode; -} - - -GNESelectorFrame::LockGLObjectTypes* -GNESelectorFrame::getLockGLObjectTypes() const { - return myLockGLObjectTypes; -} - - -std::vector -GNESelectorFrame::getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string& expr) { - std::vector result; - std::vector allACbyTag = myViewNet->getNet()->retrieveAttributeCarriers(ACTag); - const auto& tagValue = GNEAttributeCarrier::getTagProperties(ACTag); - for (auto it : allACbyTag) { - if (expr == "") { - result.push_back(it); - } else if (tagValue.hasAttribute(ACAttr) && tagValue.getAttributeProperties(ACAttr).isNumerical()) { - double acVal; - std::istringstream buf(it->getAttribute(ACAttr)); - buf >> acVal; - switch (compOp) { - case '<': - if (acVal < val) { - result.push_back(it); - } - break; - case '>': - if (acVal > val) { - result.push_back(it); - } - break; - case '=': - if (acVal == val) { - result.push_back(it); - } - break; - } - } else { - // string match - std::string acVal = it->getAttributeForSelection(ACAttr); - switch (compOp) { - case '@': - if (acVal.find(expr) != std::string::npos) { - result.push_back(it); - } - break; - case '!': - if (acVal.find(expr) == std::string::npos) { - result.push_back(it); - } - break; - case '=': - if (acVal == expr) { - result.push_back(it); - } - break; - case '^': - if (acVal != expr) { - result.push_back(it); - } - break; - } - } - } - return result; -} - -// --------------------------------------------------------------------------- -// ModificationMode::LockGLObjectTypes - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::LockGLObjectTypes::LockGLObjectTypes(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Locked selected items", GUIDesignGroupBoxFrame), - mySelectorFrameParent(selectorFrameParent) { - // create a matrix for TypeEntries - FXMatrix* matrixLockGLObjectTypes = new FXMatrix(this, 3, GUIDesignMatrixLockGLTypes); - // create typeEntries for the different Network elements - myTypeEntries[GLO_JUNCTION] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Junctions")); - myTypeEntries[GLO_EDGE] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Edges")); - myTypeEntries[GLO_LANE] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Lanes")); - myTypeEntries[GLO_CONNECTION] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Connections")); - myTypeEntries[GLO_ADDITIONAL] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Additionals")); - myTypeEntries[GLO_CROSSING] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Crossings")); - myTypeEntries[GLO_POLYGON] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "Polygons")); - myTypeEntries[GLO_POI] = std::make_pair(Supermode::GNE_SUPERMODE_NETWORK, new ObjectTypeEntry(matrixLockGLObjectTypes, "POIs")); - // create typeEntries for the different Demand elements - myTypeEntries[GLO_ROUTE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Routes")); - myTypeEntries[GLO_EMBEDDEDROUTE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Emb.Routes")); - myTypeEntries[GLO_VEHICLE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Vehicles")); - myTypeEntries[GLO_ROUTEFLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Flows")); - myTypeEntries[GLO_TRIP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Trips")); - myTypeEntries[GLO_FLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Flow")); - myTypeEntries[GLO_STOP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Stops")); - myTypeEntries[GLO_PERSON] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Person")); - myTypeEntries[GLO_PERSONFLOW] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "PersonFlow")); - myTypeEntries[GLO_PERSONTRIP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "PersonTrip")); - myTypeEntries[GLO_RIDE] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Ride")); - myTypeEntries[GLO_WALK] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Walk")); - myTypeEntries[GLO_PERSONSTOP] = std::make_pair(Supermode::GNE_SUPERMODE_DEMAND, new ObjectTypeEntry(matrixLockGLObjectTypes, "Personstop")); -} - - -GNESelectorFrame::LockGLObjectTypes::~LockGLObjectTypes() { - // remove all type entries - for (const auto& i : myTypeEntries) { - delete i.second.second; - } -} - - -void -GNESelectorFrame::LockGLObjectTypes::addedLockedObject(const GUIGlObjectType type) { - myTypeEntries.at(type).second->counterUp(); -} - - -void -GNESelectorFrame::LockGLObjectTypes::removeLockedObject(const GUIGlObjectType type) { - myTypeEntries.at(type).second->counterDown(); -} - - -bool -GNESelectorFrame::LockGLObjectTypes::IsObjectTypeLocked(const GUIGlObjectType type) const { - if ((type >= 100) && (type < 199)) { - return myTypeEntries.at(GLO_ADDITIONAL).second->isGLTypeLocked(); - } else { - return myTypeEntries.at(type).second->isGLTypeLocked(); - } -} - - -void -GNESelectorFrame::LockGLObjectTypes::showTypeEntries() { - for (const auto& i : myTypeEntries) { - // showr or hidde type entries depending of current supermode - if (i.second.first == mySelectorFrameParent->myViewNet->getEditModes().currentSupermode) { - i.second.second->showObjectTypeEntry(); - } else { - i.second.second->hideObjectTypeEntry(); - } - } - // recalc frame parent - recalc(); -} - - -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::ObjectTypeEntry(FXMatrix* matrixParent, const std::string& label) : - FXObject(), - myCounter(0) { - // create elements - myLabelCounter = new FXLabel(matrixParent, "0", nullptr, GUIDesignLabelLeft); - myLabelTypeName = new FXLabel(matrixParent, (label + " ").c_str(), nullptr, GUIDesignLabelLeft); - myCheckBoxLocked = new FXCheckButton(matrixParent, "unlocked", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); -} - - -void -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::showObjectTypeEntry() { - myLabelCounter->show(); - myLabelTypeName->show(); - myCheckBoxLocked->show(); -} - - -void -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::hideObjectTypeEntry() { - myLabelCounter->hide(); - myLabelTypeName->hide(); - myCheckBoxLocked->hide(); -} - - -void -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterUp() { - myCounter++; - myLabelCounter->setText(toString(myCounter).c_str()); -} - - -void -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::counterDown() { - myCounter--; - myLabelCounter->setText(toString(myCounter).c_str()); -} - - -bool -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::isGLTypeLocked() const { - return (myCheckBoxLocked->getCheck() == TRUE); -} - - -long -GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry::onCmdSetCheckBox(FXObject*, FXSelector, void*) { - if (myCheckBoxLocked->getCheck() == TRUE) { - myCheckBoxLocked->setText("locked"); - } else { - myCheckBoxLocked->setText("unlocked"); - } - return 1; -} - -// --------------------------------------------------------------------------- -// ModificationMode::ModificationMode - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::ModificationMode::ModificationMode(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Modification Mode", GUIDesignGroupBoxFrame), - myModificationModeType(SET_ADD) { - // Create all options buttons - myAddRadioButton = new FXRadioButton(this, "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", - this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myKeepRadioButton = new FXRadioButton(this, "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", - this, MID_CHOOSEN_OPERATION, GUIDesignRadioButton); - myAddRadioButton->setCheck(true); -} - - -GNESelectorFrame::ModificationMode::~ModificationMode() {} - - -GNESelectorFrame::ModificationMode::SetOperation -GNESelectorFrame::ModificationMode::getModificationMode() const { - return myModificationModeType; -} - - -long -GNESelectorFrame::ModificationMode::onCmdSelectModificationMode(FXObject* obj, FXSelector, void*) { - if (obj == myAddRadioButton) { - myModificationModeType = SET_ADD; - myAddRadioButton->setCheck(true); - myRemoveRadioButton->setCheck(false); - myKeepRadioButton->setCheck(false); - myReplaceRadioButton->setCheck(false); - return 1; - } else if (obj == myRemoveRadioButton) { - myModificationModeType = SET_SUB; - myAddRadioButton->setCheck(false); - myRemoveRadioButton->setCheck(true); - myKeepRadioButton->setCheck(false); - myReplaceRadioButton->setCheck(false); - return 1; - } else if (obj == myKeepRadioButton) { - myModificationModeType = SET_RESTRICT; - myAddRadioButton->setCheck(false); - myRemoveRadioButton->setCheck(false); - myKeepRadioButton->setCheck(true); - myReplaceRadioButton->setCheck(false); - return 1; - } else if (obj == myReplaceRadioButton) { - myModificationModeType = SET_REPLACE; - myAddRadioButton->setCheck(false); - myRemoveRadioButton->setCheck(false); - myKeepRadioButton->setCheck(false); - myReplaceRadioButton->setCheck(true); - return 1; - } else { - return 0; - } -} - -// --------------------------------------------------------------------------- -// ModificationMode::ElementSet - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::ElementSet::ElementSet(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Element Set", GUIDesignGroupBoxFrame), - mySelectorFrameParent(selectorFrameParent), - myCurrentElementSet(ELEMENTSET_NETELEMENT) { - // Create MatchTagBox for tags and fill it - mySetComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_CHOOSEN_ELEMENTS, GUIDesignComboBox); -} - - -GNESelectorFrame::ElementSet::~ElementSet() {} - - -GNESelectorFrame::ElementSet::ElementSetType -GNESelectorFrame::ElementSet::getElementSet() const { - return myCurrentElementSet; -} - - -void -GNESelectorFrame::ElementSet::refreshElementSet() { - // first clear item - mySetComboBox->clearItems(); - // now fill elements depending of supermode - if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - mySetComboBox->appendItem("Net Element"); - mySetComboBox->appendItem("Additional"); - mySetComboBox->appendItem("Shape"); - } else { - mySetComboBox->appendItem("Demand Element"); - } - mySetComboBox->setNumVisible(mySetComboBox->getNumItems()); - // update rest of elements - onCmdSelectElementSet(0, 0, 0); -} - - -long -GNESelectorFrame::ElementSet::onCmdSelectElementSet(FXObject*, FXSelector, void*) { - // check depending of current supermode - if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - if (mySetComboBox->getText() == "Net Element") { - myCurrentElementSet = ELEMENTSET_NETELEMENT; - mySetComboBox->setTextColor(FXRGB(0, 0, 0)); - // enable match attribute - mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); - } else if (mySetComboBox->getText() == "Additional") { - myCurrentElementSet = ELEMENTSET_ADDITIONAL; - mySetComboBox->setTextColor(FXRGB(0, 0, 0)); - // enable match attribute - mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); - } else if (mySetComboBox->getText() == "Shape") { - myCurrentElementSet = ELEMENTSET_SHAPE; - mySetComboBox->setTextColor(FXRGB(0, 0, 0)); - // enable match attribute - mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); - } else { - myCurrentElementSet = ELEMENTSET_INVALID; - mySetComboBox->setTextColor(FXRGB(255, 0, 0)); - // disable match attribute - mySelectorFrameParent->myMatchAttribute->disableMatchAttribute(); - } - } else { - if (mySetComboBox->getText() == "Demand Element") { - myCurrentElementSet = ELEMENTSET_DEMANDELEMENT; - mySetComboBox->setTextColor(FXRGB(0, 0, 0)); - // enable match attribute - mySelectorFrameParent->myMatchAttribute->enableMatchAttribute(); - } else { - myCurrentElementSet = ELEMENTSET_INVALID; - mySetComboBox->setTextColor(FXRGB(255, 0, 0)); - // disable match attribute - mySelectorFrameParent->myMatchAttribute->disableMatchAttribute(); - } - } - return 1; -} - -// --------------------------------------------------------------------------- -// ModificationMode::MatchAttribute - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::MatchAttribute::MatchAttribute(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Match Attribute", GUIDesignGroupBoxFrame), - mySelectorFrameParent(selectorFrameParent), - myCurrentTag(SUMO_TAG_EDGE), - myCurrentAttribute(SUMO_ATTR_ID) { - // Create MatchTagBox for tags - myMatchTagComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTTAG, GUIDesignComboBox); - // Create listBox for Attributes - myMatchAttrComboBox = new FXComboBox(this, GUIDesignComboBoxNCol, this, MID_GNE_SELECTORFRAME_SELECTATTRIBUTE, GUIDesignComboBox); - // Create TextField for Match string - myMatchString = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SELECTORFRAME_PROCESSSTRING, GUIDesignTextField); - // Create help button - new FXButton(this, "Help", nullptr, this, MID_HELP, GUIDesignButtonRectangular); - // Fill list of sub-items (first element will be "edge") - enableMatchAttribute(); - // Set speed of edge as default attribute - myMatchAttrComboBox->setText("speed"); - myCurrentAttribute = SUMO_ATTR_SPEED; - // Set default value for Match string - myMatchString->setText(">10.0"); -} - - -GNESelectorFrame::MatchAttribute::~MatchAttribute() {} - - -void -GNESelectorFrame::MatchAttribute::enableMatchAttribute() { - // enable comboboxes and text field - myMatchTagComboBox->enable(); - myMatchAttrComboBox->enable(); - myMatchString->enable(); - // Clear items of myMatchTagComboBox - myMatchTagComboBox->clearItems(); - // Set items depending of current item set - std::vector listOfTags; - if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_NETELEMENT) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_ADDITIONAL) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL | GNEAttributeCarrier::TagType::TAGTYPE_TAZ, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_SHAPE) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_SHAPE, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_DEMANDELEMENT) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT | GNEAttributeCarrier::TagType::TAGTYPE_STOP, true); - } else { - throw ProcessError("Invalid element set"); - } - // fill combo box - for (auto i : listOfTags) { - myMatchTagComboBox->appendItem(toString(i).c_str()); - } - // set first item as current item - myMatchTagComboBox->setCurrentItem(0); - myMatchTagComboBox->setNumVisible(myMatchTagComboBox->getNumItems()); - // Fill attributes with the current element type - onCmdSelMBTag(nullptr, 0, nullptr); -} - - -void -GNESelectorFrame::MatchAttribute::disableMatchAttribute() { - // disable comboboxes and text field - myMatchTagComboBox->disable(); - myMatchAttrComboBox->disable(); - myMatchString->disable(); - // change colors to black (even if there are invalid values) - myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0)); - myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0)); - myMatchString->setTextColor(FXRGB(0, 0, 0)); -} - - -long -GNESelectorFrame::MatchAttribute::onCmdSelMBTag(FXObject*, FXSelector, void*) { - // First check what type of elementes is being selected - myCurrentTag = SUMO_TAG_NOTHING; - // find current element tag - std::vector listOfTags; - if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_NETELEMENT) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_NETELEMENT, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_ADDITIONAL) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL | GNEAttributeCarrier::TagType::TAGTYPE_TAZ, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_SHAPE) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_SHAPE, true); - } else if (mySelectorFrameParent->myElementSet->getElementSet() == ElementSet::ELEMENTSET_DEMANDELEMENT) { - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT | GNEAttributeCarrier::TagType::TAGTYPE_STOP, true); - } else { - throw ProcessError("Unkown set"); - } - // fill myMatchTagComboBox - for (auto i : listOfTags) { - if (toString(i) == myMatchTagComboBox->getText().text()) { - myCurrentTag = i; - } - } - // check that typed-by-user value is correct - if (myCurrentTag != SUMO_TAG_NOTHING) { - // obtain tag property (only for improve code legibility) - const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); - // set color and enable items - myMatchTagComboBox->setTextColor(FXRGB(0, 0, 0)); - myMatchAttrComboBox->enable(); - myMatchString->enable(); - myMatchAttrComboBox->clearItems(); - // fill attribute combo box - for (auto it : tagValue) { - myMatchAttrComboBox->appendItem(it.getAttrStr().c_str()); - } - // Add extra attribute "Parameter" - myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARAMETERS).c_str()); - // check if item can block movement - if (tagValue.canBlockMovement()) { - myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_MOVEMENT).c_str()); - } - // check if item can block shape - if (tagValue.canBlockShape()) { - myMatchAttrComboBox->appendItem(toString(GNE_ATTR_BLOCK_SHAPE).c_str()); - } - // check if item can close shape - if (tagValue.canCloseShape()) { - myMatchAttrComboBox->appendItem(toString(GNE_ATTR_CLOSE_SHAPE).c_str()); - } - // check if item can have parent - if (tagValue.hasParent()) { - myMatchAttrComboBox->appendItem(toString(GNE_ATTR_PARENT).c_str()); - } - // @ToDo: Here can be placed a button to set the default value - myMatchAttrComboBox->setNumVisible(myMatchAttrComboBox->getNumItems()); - // check if we have to update attribute - if (tagValue.hasAttribute(myCurrentAttribute)) { - myMatchAttrComboBox->setText(toString(myCurrentAttribute).c_str()); - } else { - onCmdSelMBAttribute(nullptr, 0, nullptr); - } - } else { - // change color to red and disable items - myMatchTagComboBox->setTextColor(FXRGB(255, 0, 0)); - myMatchAttrComboBox->disable(); - myMatchString->disable(); - } - update(); - return 1; -} - - -long -GNESelectorFrame::MatchAttribute::onCmdSelMBAttribute(FXObject*, FXSelector, void*) { - // first obtain a copy of item attributes vinculated with current tag - auto tagPropertiesCopy = GNEAttributeCarrier::getTagProperties(myCurrentTag); - // obtain tag property (only for improve code legibility) - const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); - // add an extra AttributeValues to allow select ACs using as criterium "parameters" - GNEAttributeCarrier::AttributeProperties extraAttrProperty; - extraAttrProperty = GNEAttributeCarrier::AttributeProperties(GNE_ATTR_PARAMETERS, - GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING, - "Parameters"); - tagPropertiesCopy.addAttribute(extraAttrProperty); - // add extra attribute if item can block movement - if (tagValue.canBlockMovement()) { - // add an extra AttributeValues to allow select ACs using as criterium "block movement" - extraAttrProperty = GNEAttributeCarrier::AttributeProperties(GNE_ATTR_BLOCK_MOVEMENT, - GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC, - "Block movement", - "false"); - tagPropertiesCopy.addAttribute(extraAttrProperty); - } - // add extra attribute if item can block shape - if (tagValue.canBlockShape()) { - // add an extra AttributeValues to allow select ACs using as criterium "block shape" - extraAttrProperty = GNEAttributeCarrier::AttributeProperties(GNE_ATTR_BLOCK_SHAPE, - GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC, - "Block shape", - "false"); - tagPropertiesCopy.addAttribute(extraAttrProperty); - } - // add extra attribute if item can close shape - if (tagValue.canCloseShape()) { - // add an extra AttributeValues to allow select ACs using as criterium "close shape" - extraAttrProperty = GNEAttributeCarrier::AttributeProperties(GNE_ATTR_CLOSE_SHAPE, - GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_BOOL | GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_DEFAULTVALUESTATIC, - "Close shape", - "true"); - tagPropertiesCopy.addAttribute(extraAttrProperty); - } - // add extra attribute if item can have parent - if (tagValue.hasParent()) { - // add an extra AttributeValues to allow select ACs using as criterium "parent" - extraAttrProperty = GNEAttributeCarrier::AttributeProperties(GNE_ATTR_PARENT, - GNEAttributeCarrier::AttrProperty::ATTRPROPERTY_STRING, - "Parent element"); - tagPropertiesCopy.addAttribute(extraAttrProperty); - } - // set current selected attribute - myCurrentAttribute = SUMO_ATTR_NOTHING; - for (const auto& i : tagPropertiesCopy) { - if (i.getAttrStr() == myMatchAttrComboBox->getText().text()) { - myCurrentAttribute = i.getAttr(); - } - } - // check if selected attribute is valid - if (myCurrentAttribute != SUMO_ATTR_NOTHING) { - myMatchAttrComboBox->setTextColor(FXRGB(0, 0, 0)); - myMatchString->enable(); - } else { - myMatchAttrComboBox->setTextColor(FXRGB(255, 0, 0)); - myMatchString->disable(); - } - return 1; -} - - -long -GNESelectorFrame::MatchAttribute::onCmdSelMBString(FXObject*, FXSelector, void*) { - // obtain expresion - std::string expr(myMatchString->getText().text()); - const auto& tagValue = GNEAttributeCarrier::getTagProperties(myCurrentTag); - bool valid = true; - if (expr == "") { - // the empty expression matches all objects - mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, '@', 0, expr)); - } else if (tagValue.hasAttribute(myCurrentAttribute) && tagValue.getAttributeProperties(myCurrentAttribute).isNumerical()) { - // The expression must have the form - // val matches if attr > val - // =val matches if attr = val - // val matches if attr = val - char compOp = expr[0]; - if (compOp == '<' || compOp == '>' || compOp == '=') { - expr = expr.substr(1); - } else { - compOp = '='; - } - // check if value can be parsed to double - if (GNEAttributeCarrier::canParse(expr.c_str())) { - mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, GNEAttributeCarrier::parse(expr.c_str()), expr)); - } else { - valid = false; - } - } else { - // The expression must have the form - // =str: matches if is an exact match - // !str: matches if is not a substring - // ^str: matches if is not an exact match - // str: matches if is a substring (sends compOp '@') - // Alternatively, if the expression is empty it matches all objects - char compOp = expr[0]; - if (compOp == '=' || compOp == '!' || compOp == '^') { - expr = expr.substr(1); - } else { - compOp = '@'; - } - mySelectorFrameParent->handleIDs(mySelectorFrameParent->getMatches(myCurrentTag, myCurrentAttribute, compOp, 0, expr)); - } - if (valid) { - myMatchString->setTextColor(FXRGB(0, 0, 0)); - myMatchString->killFocus(); - } else { - myMatchString->setTextColor(FXRGB(255, 0, 0)); - } - return 1; -} - - -long -GNESelectorFrame::MatchAttribute::onCmdHelp(FXObject*, FXSelector, void*) { - // Create dialog box - FXDialogBox* additionalNeteditAttributesHelpDialog = new FXDialogBox(this, "Netedit Parameters Help", GUIDesignDialogBox); - additionalNeteditAttributesHelpDialog->setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL)); - // set help text - std::ostringstream help; - help - << "- The 'Match Attribute' controls allow to specify a set of objects which are then applied to the current selection\n" - << " according to the current 'Modification Mode'.\n" - << " 1. Select an object type from the first input box\n" - << " 2. Select an attribute from the second input box\n" - << " 3. Enter a 'match expression' in the third input box and press \n" - << "\n" - << "- The empty expression matches all objects\n" - << "- For numerical attributes the match expression must consist of a comparison operator ('<', '>', '=') and a number.\n" - << "- An object matches if the comparison between its attribute and the given number by the given operator evaluates to 'true'\n" - << "\n" - << "- For string attributes the match expression must consist of a comparison operator ('', '=', '!', '^') and a string.\n" - << " '' (no operator) matches if string is a substring of that object'ts attribute.\n" - << " '=' matches if string is an exact match.\n" - << " '!' matches if string is not a substring.\n" - << " '^' matches if string is not an exact match.\n" - << "\n" - << "- Examples:\n" - << " junction; id; 'foo' -> match all junctions that have 'foo' in their id\n" - << " junction; type; '=priority' -> match all junctions of type 'priority', but not of type 'priority_stop'\n" - << " edge; speed; '>10' -> match all edges with a speed above 10\n"; - // Create label with the help text - new FXLabel(additionalNeteditAttributesHelpDialog, help.str().c_str(), nullptr, 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(ICON_ACCEPT), additionalNeteditAttributesHelpDialog, FXDialogBox::ID_ACCEPT, GUIDesignButtonOK); - new FXHorizontalFrame(myHorizontalFrameOKButton, GUIDesignAuxiliarHorizontalFrame); - // Write Warning in console if we're in testing mode - WRITE_DEBUG("Opening help dialog of selector frame"); - // 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("Close help dialog of selector frame"); - return 1; -} - -// --------------------------------------------------------------------------- -// ModificationMode::VisualScaling - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::VisualScaling::VisualScaling(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Visual Scaling", GUIDesignGroupBoxFrame), - mySelectorFrameParent(selectorFrameParent) { - // Create spin button and configure it - mySelectionScaling = new FXRealSpinner(this, 7, this, MID_GNE_SELECTORFRAME_SELECTSCALE, GUIDesignSpinDial); - //mySelectionScaling->setNumberFormat(1); - //mySelectionScaling->setIncrements(0.1, .5, 1); - mySelectionScaling->setIncrement(0.5); - mySelectionScaling->setRange(1, 100000); - mySelectionScaling->setValue(1); - mySelectionScaling->setHelpText("Enlarge selected objects"); -} - - -GNESelectorFrame::VisualScaling::~VisualScaling() {} - - -long -GNESelectorFrame::VisualScaling::onCmdScaleSelection(FXObject*, FXSelector, void*) { - // set scale in viewnet - mySelectorFrameParent->myViewNet->setSelectionScaling(mySelectionScaling->getValue()); - mySelectorFrameParent->myViewNet->update(); - return 1; -} - -// --------------------------------------------------------------------------- -// ModificationMode::SelectionOperation - methods -// --------------------------------------------------------------------------- - -GNESelectorFrame::SelectionOperation::SelectionOperation(GNESelectorFrame* selectorFrameParent) : - FXGroupBox(selectorFrameParent->myContentFrame, "Operations for selections", GUIDesignGroupBoxFrame), - mySelectorFrameParent(selectorFrameParent) { - // Create "Clear List" Button - new FXButton(this, "Clear\t\t", nullptr, this, MID_CHOOSEN_CLEAR, GUIDesignButton); - // Create "Invert" Button - new FXButton(this, "Invert\t\t", nullptr, this, MID_CHOOSEN_INVERT, GUIDesignButton); - // Create "Save" Button - new FXButton(this, "Save\t\tSave ids of currently selected objects to a file.", nullptr, this, MID_CHOOSEN_SAVE, GUIDesignButton); - // Create "Load" Button - new FXButton(this, "Load\t\tLoad ids from a file according to the current modfication mode.", nullptr, this, MID_CHOOSEN_LOAD, GUIDesignButton); -} - - -GNESelectorFrame::SelectionOperation::~SelectionOperation() {} - - -long -GNESelectorFrame::SelectionOperation::onCmdLoad(FXObject*, FXSelector, void*) { - // get the new file name - FXFileDialog opendialog(this, "Open List of Selected Items"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); - opendialog.setSelectMode(SELECTFILE_EXISTING); - opendialog.setPatternList("Selection files (*.txt)\nAll files (*)"); - if (gCurrentFolder.length() != 0) { - opendialog.setDirectory(gCurrentFolder); - } - if (opendialog.execute()) { - std::vector loadedACs; - gCurrentFolder = opendialog.getDirectory(); - std::string file = opendialog.getFilename().text(); - std::ostringstream msg; - std::ifstream strm(file.c_str()); - // check if file can be opened - if (!strm.good()) { - WRITE_ERROR("Could not open '" + file + "'."); - return 0; - } - while (strm.good()) { - std::string line; - strm >> line; - // check if line isn't empty - if (line.length() != 0) { - // obtain GLObject - GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(line); - // check if GUIGlObject exist and their their GL type isn't blocked - if ((object != nullptr) && !mySelectorFrameParent->myLockGLObjectTypes->IsObjectTypeLocked(object->getType())) { - // obtain GNEAttributeCarrier - GNEAttributeCarrier* AC = mySelectorFrameParent->myViewNet->getNet()->retrieveAttributeCarrier(object->getGlID(), false); - // check if AC exist and if is selectable - if (AC && AC->getTagProperty().isSelectable()) - // now check if we're in the correct supermode to load this element - if (((mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && !AC->getTagProperty().isDemandElement()) || - ((mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && AC->getTagProperty().isDemandElement())) { - loadedACs.push_back(AC); - } - } - } - } - // change selected attribute in loaded ACs allowing undo/redo - if (loadedACs.size() > 0) { - mySelectorFrameParent->myViewNet->getUndoList()->p_begin("load selection"); - mySelectorFrameParent->handleIDs(loadedACs); - mySelectorFrameParent->myViewNet->getUndoList()->p_end(); - } - } - mySelectorFrameParent->myViewNet->update(); - return 1; -} - - -long -GNESelectorFrame::SelectionOperation::onCmdSave(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write( - this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); - if (file == "") { - return 1; - } - try { - OutputDevice& dev = OutputDevice::getDevice(file.text()); - for (auto i : mySelectorFrameParent->myViewNet->getNet()->getSelectedAttributeCarriers(false)) { - GUIGlObject* object = dynamic_cast(i); - if (object) { - dev << GUIGlObject::TypeNames.getString(object->getType()) << ":" << i->getID() << "\n"; - } - } - dev.close(); - } catch (IOError& e) { - // 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()); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'error storing selection' with 'OK'"); - } - return 1; -} - - -long -GNESelectorFrame::SelectionOperation::onCmdClear(FXObject*, FXSelector, void*) { - // clear current selection - mySelectorFrameParent->clearCurrentSelection(); - return 1; -} - - -long -GNESelectorFrame::SelectionOperation::onCmdInvert(FXObject*, FXSelector, void*) { - // only continue if there is element for selecting - if (mySelectorFrameParent->ACsToSelected()) { - // obtan locks (only for improve code legibly) - LockGLObjectTypes* locks = mySelectorFrameParent->getLockGLObjectTypes(); - // for invert selection, first clean current selection and next select elements of set "unselectedElements" - mySelectorFrameParent->myViewNet->getUndoList()->p_begin("invert selection"); - // invert selection of elements depending of current supermode - if (mySelectorFrameParent->myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // iterate over junctions - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().junctions) { - // check if junction selection is locked - if (!locks->IsObjectTypeLocked(GLO_JUNCTION)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - // due we iterate over all junctions, only it's neccesary iterate over incoming edges - for (const auto& j : i.second->getGNEIncomingEdges()) { - // only select edges if "select edges" flag is enabled. In other case, select only lanes - if (mySelectorFrameParent->myViewNet->getNetworkViewOptions().selectEdges()) { - // check if edge selection is locked - if (!locks->IsObjectTypeLocked(GLO_EDGE)) { - if (j->isAttributeCarrierSelected()) { - j->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } else { - // check if lane selection is locked - if (!locks->IsObjectTypeLocked(GLO_LANE)) { - for (auto k : j->getLanes()) { - if (k->isAttributeCarrierSelected()) { - k->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } - // check if connection selection is locked - if (!locks->IsObjectTypeLocked(GLO_CONNECTION)) { - for (const auto& k : j->getGNEConnections()) { - if (k->isAttributeCarrierSelected()) { - k->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - k->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } - // check if crossing selection is locked - if (!locks->IsObjectTypeLocked(GLO_CROSSING)) { - for (const auto& j : i.second->getGNECrossings()) { - if (j->isAttributeCarrierSelected()) { - j->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - j->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } - // check if additionals selection is locked - if (!locks->IsObjectTypeLocked(GLO_ADDITIONAL)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().additionals) { - // first check if additional is selectable - if (GNEAttributeCarrier::getTagProperties(i.first).isSelectable()) { - for (const auto& j : i.second) { - if (j.second->isAttributeCarrierSelected()) { - j.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - j.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } - } - // select polygons - if (!locks->IsObjectTypeLocked(GLO_POLYGON)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getPolygons()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - shape->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - shape->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select POIs - if (!locks->IsObjectTypeLocked(GLO_POI)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getPOIs()) { - GNEShape* shape = dynamic_cast(i.second); - if (shape->isAttributeCarrierSelected()) { - shape->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - shape->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } else { - // select routes - if (!locks->IsObjectTypeLocked(GLO_ROUTE)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select embedded routes - if (!locks->IsObjectTypeLocked(GLO_EMBEDDEDROUTE)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_EMBEDDEDROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select vehicles - if (!locks->IsObjectTypeLocked(GLO_VEHICLE)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select trips - if (!locks->IsObjectTypeLocked(GLO_TRIP)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select flows - if (!locks->IsObjectTypeLocked(GLO_FLOW)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select route flows - if (!locks->IsObjectTypeLocked(GLO_ROUTEFLOW)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select stops - if (!locks->IsObjectTypeLocked(GLO_STOP)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select person - if (!locks->IsObjectTypeLocked(GLO_PERSON)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select person flow - if (!locks->IsObjectTypeLocked(GLO_PERSONFLOW)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select person trip - if (!locks->IsObjectTypeLocked(GLO_PERSONTRIP)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select ride - if (!locks->IsObjectTypeLocked(GLO_RIDE)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select walks - if (!locks->IsObjectTypeLocked(GLO_WALK)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_FROMTO)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_ROUTE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - // select person stops - if (!locks->IsObjectTypeLocked(GLO_PERSONSTOP)) { - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_LANE)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - - for (const auto& i : mySelectorFrameParent->myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_BUSSTOP)) { - if (i.second->isAttributeCarrierSelected()) { - i.second->setAttribute(GNE_ATTR_SELECTED, "false", mySelectorFrameParent->myViewNet->getUndoList()); - } else { - i.second->setAttribute(GNE_ATTR_SELECTED, "true", mySelectorFrameParent->myViewNet->getUndoList()); - } - } - } - } - // finish selection operation - mySelectorFrameParent->myViewNet->getUndoList()->p_end(); - // update view - mySelectorFrameParent->myViewNet->update(); - } - return 1; -} - - -bool -GNESelectorFrame::ACsToSelected() const { - if (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // check if exist junction and edges - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION) && (myViewNet->getNet()->getAttributeCarriers().junctions.size() > 0)) { - return true; - } - if ((!myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION) || !myLockGLObjectTypes->IsObjectTypeLocked(GLO_JUNCTION)) && (myViewNet->getNet()->getAttributeCarriers().edges.size() > 0)) { - return true; - } - // check if additionals selection is locked - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ADDITIONAL)) { - for (const auto& i : myViewNet->getNet()->getAttributeCarriers().additionals) { - // first check if additional is selectable - if (GNEAttributeCarrier::getTagProperties(i.first).isSelectable() && (myViewNet->getNet()->getAttributeCarriers().additionals.at(i.first).size() > 0)) { - return true; - } - } - } - // select polygons - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POLYGON) && (myViewNet->getNet()->getPolygons().size() > 0)) { - return true; - } - // select POIs - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_POI) && (myViewNet->getNet()->getPOIs().size() > 0)) { - return true; - } - } else { - // select routes - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTE) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size() > 0)) { - return true; - } - // select embedded routes - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_EMBEDDEDROUTE) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_EMBEDDEDROUTE).size() > 0)) { - return true; - } - // select vehicles - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_VEHICLE) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE).size() > 0)) { - return true; - } - // select trips - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_TRIP) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP).size() > 0)) { - return true; - } - // select flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_FLOW) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW).size() > 0)) { - return true; - } - // select route flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_ROUTEFLOW) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW).size() > 0)) { - return true; - } - // select stops - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_STOP)) { - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION).size() > 0)) { - return true; - } - } - // select person - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSON) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON).size() > 0)) { - return true; - } - // select person flows - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONFLOW) && (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW).size() > 0)) { - return true; - } - // select persontrips - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONTRIP)) { - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0)) { - return true; - } - } - // select ride - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_RIDE)) { - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_FROMTO).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_RIDE_BUSSTOP).size() > 0)) { - return true; - } - } - // select walks - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_WALK)) { - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_FROMTO).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_BUSSTOP).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_WALK_ROUTE).size() > 0)) { - return true; - } - } - // select person stops - if (!myLockGLObjectTypes->IsObjectTypeLocked(GLO_PERSONSTOP)) { - if ((myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_LANE).size() > 0) || - (myViewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONSTOP_BUSSTOP).size() > 0)) { - return true; - } - } - } - // nothing to select - return false; -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNESelectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNESelectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNESelectorFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNESelectorFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,446 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNESelectorFrame.h -/// @author Jakob Erdmann -/// @date Mar 2011 -/// -// The Widget for modifying selections of network-elements -// (some elements adapted from GUIDialog_GLChosenEditor) -/****************************************************************************/ -#ifndef GNESelectorFrame_h -#define GNESelectorFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNESelectorFrame - * The Widget for modifying selections of network-elements - */ -class GNESelectorFrame : public GNEFrame { - -public: - - // =========================================================================== - // class LockGLObjectTypes - // =========================================================================== - - class LockGLObjectTypes : protected FXGroupBox { - - public: - /// @brief class for object types entries - class ObjectTypeEntry : protected FXObject { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::LockGLObjectTypes::ObjectTypeEntry) - - public: - /// @brief constructor - ObjectTypeEntry(FXMatrix* matrixParent, const std::string& label); - - /// @brief show ObjectTypeEntry - void showObjectTypeEntry(); - - /// @brief hide ObjectTypeEntry - void hideObjectTypeEntry(); - - /// @brief up count - void counterUp(); - - /// @brief down count - void counterDown(); - - /// @brief check if current GLType is blocked - bool isGLTypeLocked() const; - - /// @name FOX-callbacks - /// @{ - /// @brief called when user change the CheckBox - long onCmdSetCheckBox(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(ObjectTypeEntry) - - private: - /// @brief label counter - FXLabel* myLabelCounter; - - /// @brief label type nane - FXLabel* myLabelTypeName; - - /// @brief check box to check if GLObject type is blocked - FXCheckButton* myCheckBoxLocked; - - /// @brief counter - int myCounter; - }; - - /// @brief constructor - LockGLObjectTypes(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~LockGLObjectTypes(); - - /// @brief set object selected - void addedLockedObject(const GUIGlObjectType type); - - /// @brief set object unselected - void removeLockedObject(const GUIGlObjectType type); - - /// @brief check if an object is locked - bool IsObjectTypeLocked(const GUIGlObjectType type) const; - - /// @brief show type Entries (depending if we're in Network or demand supermode) - void showTypeEntries(); - - private: - /// @brief pointer to Selector Frame Parent - GNESelectorFrame* mySelectorFrameParent; - - /// @brief check boxes for type-based selection locking and selected object counts - std::map > myTypeEntries; - }; - - // =========================================================================== - // class ModificationMode - // =========================================================================== - - class ModificationMode : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::ModificationMode) - - public: - /// @brief operations of selector - enum SetOperation { - SET_ADD = 1, - SET_SUB = 2, - SET_RESTRICT = 3, - SET_REPLACE = 4, - SET_DEFAULT = 5 // use mySetOperation instead of override - }; - - /// @brief constructor - ModificationMode(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~ModificationMode(); - - /// @brief get current modification mode - SetOperation getModificationMode() const; - - /// @name FOX-callbacks - /// @{ - /// @brief called when user change type of selction operation - long onCmdSelectModificationMode(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(ModificationMode) - - private: - /// @brief add radio button - FXRadioButton* myAddRadioButton; - - /// @brief remove radio button - FXRadioButton* myRemoveRadioButton; - - /// @brief keep button - FXRadioButton* myKeepRadioButton; - - /// @brief replace radio button - FXRadioButton* myReplaceRadioButton; - - /// @brief how to modify selection - SetOperation myModificationModeType; - }; - - // =========================================================================== - // class ElementSet - // =========================================================================== - - class ElementSet : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::ElementSet) - - public: - /// @brief type of Set - enum ElementSetType { - ELEMENTSET_NETELEMENT = 1, - ELEMENTSET_ADDITIONAL = 2, - ELEMENTSET_SHAPE = 3, - ELEMENTSET_DEMANDELEMENT = 4, - ELEMENTSET_INVALID = 5, - }; - - /// @brief constructor - ElementSet(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~ElementSet(); - - /// @brief get current selected element set - ElementSetType getElementSet() const; - - /// @brief refresh element set - void refreshElementSet(); - - /// @brief update current element set (called after - - /// @name FOX-callbacks - /// @{ - - /// @brief Called when the user change the set of element to search (netElement, Additional or shape) - long onCmdSelectElementSet(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(ElementSet) - - private: - /// @brief pointer to Selector Frame Parent - GNESelectorFrame* mySelectorFrameParent; - - /// @brief Combo Box with the element sets - FXComboBox* mySetComboBox; - - /// @brief current element set selected - ElementSetType myCurrentElementSet; - }; - - // =========================================================================== - // class MatchAttribute - // =========================================================================== - - class MatchAttribute : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::MatchAttribute) - - public: - /// @brief constructor - MatchAttribute(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~MatchAttribute(); - - /// @brief enable match attributes - void enableMatchAttribute(); - - /// @brief disable match attributes - void disableMatchAttribute(); - - /// @name FOX-callbacks - /// @{ - - /**@brief Called when the user selectes a tag in the match box - * @note updates the attr listbox and repaints itself - */ - long onCmdSelMBTag(FXObject*, FXSelector, void*); - - /**@brief Called when the user selectes a tag in the match box - * @note updates the attr listbox and repaints itself - */ - long onCmdSelMBAttribute(FXObject*, FXSelector, void*); - - /**@brief Called when the user enters a new selection expression - * @note validates expression and modifies current selection - */ - long onCmdSelMBString(FXObject*, FXSelector, void*); - - /**@brief Called when the user clicks the help button - * @note pop up help window - */ - long onCmdHelp(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(MatchAttribute) - - private: - /// @brief pointer to Selector Frame Parent - GNESelectorFrame* mySelectorFrameParent; - - /// @brief tag of the match box - FXComboBox* myMatchTagComboBox; - - /// @brief attributes of the match box - FXComboBox* myMatchAttrComboBox; - - /// @brief current SumoXMLTag tag - SumoXMLTag myCurrentTag; - - /// @brief current SumoXMLTag Attribute - SumoXMLAttr myCurrentAttribute; - - /// @brief string of the match - FXTextField* myMatchString; - }; - - // =========================================================================== - // class VisualScaling - // =========================================================================== - - class VisualScaling : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::VisualScaling) - - public: - /// @brief constructor - VisualScaling(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~VisualScaling(); - - /// @name FOX-callbacks - /// @{ - - /// @brief Called when the user changes visual scaling - long onCmdScaleSelection(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(VisualScaling) - - private: - /// @brief pointer to Selector Frame Parent - GNESelectorFrame* mySelectorFrameParent; - - /// @brief Spinner for selection scaling - FXRealSpinner* mySelectionScaling; - }; - - // =========================================================================== - // class SelectionOperation - // =========================================================================== - - class SelectionOperation : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNESelectorFrame::SelectionOperation) - - public: - /// @brief constructor - SelectionOperation(GNESelectorFrame* selectorFrameParent); - - /// @brief destructor - ~SelectionOperation(); - - /// @name FOX-callbacks - /// @{ - - /**@brief Called when the user presses the Load-button - * @note Opens a file dialog and forces the parent to load the list of selected - * objects when a file was chosen. Rebuilds the list, then, and redraws itself. - */ - long onCmdLoad(FXObject*, FXSelector, void*); - - /** @brief Called when the user presses the Save-button - * @note Opens a file dialog and forces the selection container to save the list - of selected objects when a file was chosen. If the saveing failed, a message window is shown. - */ - long onCmdSave(FXObject*, FXSelector, void*); - - /**@brief Called when the user presses the Clear-button - * @note Clear the internal list and calls GUISelectedStorage::clear and repaints itself - */ - long onCmdClear(FXObject*, FXSelector, void*); - - /**@brief Called when the user presses the Invert-button - * @note invert the selection and repaints itself - */ - long onCmdInvert(FXObject*, FXSelector, void*); - - /// @} - - protected: - FOX_CONSTRUCTOR(SelectionOperation) - - private: - /// @brief pointer to Selector Frame Parent - GNESelectorFrame* mySelectorFrameParent; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNESelectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNESelectorFrame(); - - /// @brief show Frame - void show(); - - /// @brief hide Frame - void hide(); - - /// @brief clear current selection with possibility of undo/redo - void clearCurrentSelection() const; - - /**@brief apply list of ids to the current selection according to SetOperation, - * @note if setop==SET_DEFAULT than the currently set mode (mySetOperation) is used - */ - void handleIDs(const std::vector& ACs, ModificationMode::SetOperation setop = ModificationMode::SET_DEFAULT); - - /// @brief get selected items Modul - LockGLObjectTypes* getLockGLObjectTypes() const; - - /// @brief get modification mode modul - ModificationMode* getModificationModeModul() const; - -private: - /// @brief modul for lock selected items - LockGLObjectTypes* myLockGLObjectTypes; - - /// @brief modul for change modification mode - ModificationMode* myModificationMode; - - /// @brief modul for select element set - ElementSet* myElementSet; - - /// @brief modul for matchA ttribute - MatchAttribute* myMatchAttribute; - - /// @brief modul for visual scaling - VisualScaling* myVisualScaling; - - /// @brief modul for selection operations - SelectionOperation* mySelectionOperation; - - /// @brief check if there is ACs to select/unselect - bool ACsToSelected() const; - -private: - /**@brief return ACs of the given type with matching attrs - * @param[in] ACTag XML Tag of AttributeCarrier - * @param[in] ACAttr XML Attribute of AttributeCarrier - * @param[in] compOp One of {<,>,=} for matching against val or '@' for matching against expr - */ - std::vector getMatches(SumoXMLTag ACTag, SumoXMLAttr ACAttr, char compOp, double val, const std::string& expr); -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEStopFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEStopFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEStopFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEStopFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,411 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStopFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// The Widget for add Stops elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEStopFrame.h" - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEStopFrame::HelpCreation - methods -// --------------------------------------------------------------------------- - -GNEStopFrame::HelpCreation::HelpCreation(GNEStopFrame* StopFrameParent) : - FXGroupBox(StopFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), - myStopFrameParent(StopFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); -} - - -GNEStopFrame::HelpCreation::~HelpCreation() {} - - -void -GNEStopFrame::HelpCreation::showHelpCreation() { - // first update help cration - updateHelpCreation(); - // show modul - show(); -} - - -void -GNEStopFrame::HelpCreation::hideHelpCreation() { - hide(); -} - - -void -GNEStopFrame::HelpCreation::updateHelpCreation() { - // 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; - } - // set information label - myInformationLabel->setText(information.str().c_str()); -} - -// --------------------------------------------------------------------------- -// GNEStopFrame - methods -// --------------------------------------------------------------------------- - -GNEStopFrame::GNEStopFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Stops") { - - // Create Stop parent selector - myStopParentSelector = new GNEFrameModuls::DemandElementSelector(this, {GNEAttributeCarrier::TagType::TAGTYPE_PERSON, GNEAttributeCarrier::TagType::TAGTYPE_VEHICLE, GNEAttributeCarrier::TagType::TAGTYPE_ROUTE}); - - // Create item Selector modul for Stops - myStopTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_STOP); - - // Create Stop parameters - myStopAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // Create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); - - // Create Help Creation Modul - myHelpCreation = new HelpCreation(this); - - // refresh myStopParentMatchBox - myStopParentSelector->refreshDemandElementSelector(); -} - - -GNEStopFrame::~GNEStopFrame() {} - - -void -GNEStopFrame::show() { - // first check if stop frame moduls can be shown - bool validStopParent = false; - // check if at least there an item that supports an stop - for (auto i = myStopParentSelector->getAllowedTags().begin(); (i != myStopParentSelector->getAllowedTags().end()) && (validStopParent == false); i++) { - if (myViewNet->getNet()->getAttributeCarriers().demandElements.at(*i).size() > 0) { - validStopParent = true; - } - } - // show or hidde moduls depending of validStopParent - if (validStopParent) { - myStopParentSelector->showDemandElementSelector(); - myStopTagSelector->showTagSelector(); - // refresh vType selector - myStopParentSelector->refreshDemandElementSelector(); - // refresh item selector - myStopTagSelector->refreshTagProperties(); - } else { - // hide moduls (except help creation) - myStopParentSelector->hideDemandElementSelector(); - myStopTagSelector->hideTagSelector(); - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - // show help creation modul - myHelpCreation->showHelpCreation(); - } - // show frame - GNEFrame::show(); -} - - -bool -GNEStopFrame::addStop(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool shiftPressed) { - // check if we're selecting a new stop parent - if (shiftPressed) { - if (objectsUnderCursor.getDemandElementFront() && - (objectsUnderCursor.getDemandElementFront()->getTagProperty().isVehicle() || objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE)) { - myStopParentSelector->setDemandElement(objectsUnderCursor.getDemandElementFront()); - WRITE_WARNING("Selected " + objectsUnderCursor.getDemandElementFront()->getTagStr() + " '" + objectsUnderCursor.getDemandElementFront()->getID() + "' as stop parent."); - return true; - } else { - WRITE_WARNING("Selected Stop parent isn't valid."); - return false; - } - - } else { - // now check if stop parent selector is valid - if (myStopParentSelector->getCurrentDemandElement() == nullptr) { - WRITE_WARNING("Current selected Stop parent isn't valid."); - return false; - } - // declare a Stop - SUMOVehicleParameter::Stop stopParameter; - // check if stop parameters was sucesfully obtained - if (getStopParameter(stopParameter, myStopTagSelector->getCurrentTagProperties().getTag(), - myViewNet, myStopAttributes, myNeteditAttributes, - objectsUnderCursor.getLaneFront(), objectsUnderCursor.getAdditionalFront())) { - // create it in RouteFrame - GNERouteHandler::buildStop(myViewNet, true, stopParameter, myStopParentSelector->getCurrentDemandElement()); - // stop sucesfully created, then return true - return true; - } else { - return false; - } - } -} - -bool -GNEStopFrame::getStopParameter(SUMOVehicleParameter::Stop& stop, const SumoXMLTag stopTag, GNEViewNet* viewNet, - GNEFrameAttributesModuls::AttributesCreator* stopAttributes, - const GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes, - const GNELane* lane, const GNEAdditional* stoppingPlace) { - // first check that current selected Stop is valid - if (stopTag == SUMO_TAG_NOTHING) { - WRITE_WARNING("Current selected Stop type isn't valid."); - return false; - } else if ((stopTag == SUMO_TAG_STOP_LANE) || (stopTag == SUMO_TAG_PERSONSTOP_LANE)) { - if (lane) { - stop.lane = lane->getID(); - } else { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_LANE) + " to create a stop placed in a " + toString(SUMO_TAG_LANE)); - return false; - } - } else if (stoppingPlace) { - if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_BUS_STOP) { - if ((stopTag != SUMO_TAG_STOP_BUSSTOP) && (stopTag != SUMO_TAG_PERSONSTOP_BUSSTOP)) { - WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); - return false; - } else { - stop.busstop = stoppingPlace->getID(); - stop.startPos = 0; - stop.endPos = 0; - } - } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CONTAINER_STOP) { - if (stopTag != SUMO_TAG_STOP_CONTAINERSTOP) { - WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); - return false; - } else { - stop.containerstop = stoppingPlace->getID(); - stop.startPos = 0; - stop.endPos = 0; - } - } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_CHARGING_STATION) { - if (stopTag != SUMO_TAG_STOP_CHARGINGSTATION) { - WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); - return false; - } else { - stop.chargingStation = stoppingPlace->getID(); - stop.startPos = 0; - stop.endPos = 0; - } - } else if (stoppingPlace->getTagProperty().getTag() == SUMO_TAG_PARKING_AREA) { - if (stopTag != SUMO_TAG_STOP_PARKINGAREA) { - WRITE_WARNING("Invalid clicked stopping place to create a stop placed in a " + stoppingPlace->getTagProperty().getTagStr()); - return false; - } else { - stop.parkingarea = stoppingPlace->getID(); - stop.startPos = 0; - stop.endPos = 0; - } - } - } else { - if (stopTag == SUMO_TAG_STOP_BUSSTOP) { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_STOP_BUSSTOP) + " to create a stop placed in a " + toString(SUMO_TAG_STOP_BUSSTOP)); - } else if (stopTag == SUMO_TAG_STOP_CONTAINERSTOP) { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_CONTAINER_STOP) + " to create a stop placed in a " + toString(SUMO_TAG_CONTAINER_STOP)); - } else if (stopTag == SUMO_TAG_CHARGING_STATION) { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_CHARGING_STATION) + " to create a stop placed in a " + toString(SUMO_TAG_CHARGING_STATION)); - } else if (stopTag == SUMO_TAG_STOP_PARKINGAREA) { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_PARKING_AREA) + " to create a stop placed in a " + toString(SUMO_TAG_PARKING_AREA)); - } else if (stopTag == SUMO_TAG_PERSONTRIP_BUSSTOP) { - WRITE_WARNING("Click over a " + toString(SUMO_TAG_STOP_BUSSTOP) + " to create a person stop placed in a " + toString(SUMO_TAG_STOP_BUSSTOP)); - } - return false; - } - // check if stop attributes are valid - if (!stopAttributes->areValuesValid()) { - stopAttributes->showWarningMessage(); - return false; - } - // declare map to keep attributes from Frames from Frame - std::map valuesMap = stopAttributes->getAttributesAndValues(false); - // generate ID - valuesMap[SUMO_ATTR_ID] = viewNet->getNet()->generateDemandElementID("", stopTag); - // add netedit values - if (!stop.lane.empty()) { - myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, lane); - // check if start position can be parsed - if (GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_STARTPOS])) { - stop.startPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_STARTPOS]); - stop.parametersSet |= STOP_START_SET; - } - // check if end position can be parsed - if (GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_ENDPOS])) { - stop.endPos = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_ENDPOS]); - stop.parametersSet |= STOP_END_SET; - } - } - // obtain friendly position - if (valuesMap.count(SUMO_ATTR_FRIENDLY_POS) > 0) { - stop.friendlyPos = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_FRIENDLY_POS)); - } - // obtain actType - if (valuesMap.count(SUMO_ATTR_ACTTYPE) > 0) { - stop.actType = valuesMap.at(SUMO_ATTR_ACTTYPE); - } - // fill rest of parameters depending if it was edited - if (valuesMap.count(SUMO_ATTR_DURATION) > 0) { - stop.duration = string2time(valuesMap.at(SUMO_ATTR_DURATION)); - stop.parametersSet |= STOP_DURATION_SET; - } else { - stop.duration = -1; - stop.parametersSet &= ~STOP_DURATION_SET; - } - if (valuesMap.count(SUMO_ATTR_UNTIL) > 0) { - stop.until = string2time(valuesMap[SUMO_ATTR_UNTIL]); - stop.parametersSet |= STOP_UNTIL_SET; - } else { - stop.until = -1; - stop.parametersSet &= ~STOP_UNTIL_SET; - } - if (valuesMap.count(SUMO_ATTR_EXTENSION) > 0) { - stop.extension = string2time(valuesMap.at(SUMO_ATTR_EXTENSION)); - stop.parametersSet |= STOP_EXTENSION_SET; - } - if (valuesMap.count(SUMO_ATTR_TRIGGERED) > 0) { - stop.triggered = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_TRIGGERED)); - stop.parametersSet |= STOP_TRIGGER_SET; - } - if (valuesMap.count(SUMO_ATTR_CONTAINER_TRIGGERED) > 0) { - stop.containerTriggered = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_CONTAINER_TRIGGERED)); - stop.parametersSet |= STOP_CONTAINER_TRIGGER_SET; - } - if (valuesMap.count(SUMO_ATTR_PARKING) > 0) { - stop.parking = GNEAttributeCarrier::parse(valuesMap.at(SUMO_ATTR_PARKING)); - stop.parametersSet |= STOP_PARKING_SET; - } - if (valuesMap.count(SUMO_ATTR_EXPECTED) > 0) { - stop.awaitedPersons = GNEAttributeCarrier::parse >(valuesMap.at(SUMO_ATTR_EXPECTED)); - stop.parametersSet |= STOP_EXPECTED_SET; - } - if (valuesMap.count(SUMO_ATTR_EXPECTED_CONTAINERS) > 0) { - stop.awaitedContainers = GNEAttributeCarrier::parse >(valuesMap.at(SUMO_ATTR_EXPECTED_CONTAINERS)); - stop.parametersSet |= STOP_EXPECTED_CONTAINERS_SET; - } - if (valuesMap.count(SUMO_ATTR_TRIP_ID) > 0) { - stop.tripId = valuesMap.at(SUMO_ATTR_TRIP_ID); - stop.parametersSet |= STOP_TRIP_ID_SET; - } - if (valuesMap.count(SUMO_ATTR_INDEX) > 0) { - if (valuesMap[SUMO_ATTR_INDEX] == "fit") { - stop.index = STOP_INDEX_FIT; - } else if (valuesMap[SUMO_ATTR_INDEX] == "end") { - stop.index = STOP_INDEX_END; - } else { - stop.index = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_INDEX]); - } - } else { - stop.index = STOP_INDEX_END; - } - // refresh stop attributes - stopAttributes->refreshRows(); - // all ok, then return true - return true; -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEStopFrame::tagSelected() { - if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // show Stop type selector modul - myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); - myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); - myHelpCreation->showHelpCreation(); - } else { - // hide all moduls if stop parent isn't valid - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myHelpCreation->hideHelpCreation(); - } -} - - -void -GNEStopFrame::demandElementSelected() { - // show or hidde moduls depending if current selected stop parent is valid - if (myStopParentSelector->getCurrentDemandElement()) { - myStopTagSelector->showTagSelector(); - if (myStopTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // show moduls - myStopAttributes->showAttributesCreatorModul(myStopTagSelector->getCurrentTagProperties(), {}); - myNeteditAttributes->showNeteditAttributesModul(myStopTagSelector->getCurrentTagProperties()); - myHelpCreation->showHelpCreation(); - } else { - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myHelpCreation->hideHelpCreation(); - } - } else { - // hide moduls - myStopTagSelector->hideTagSelector(); - myStopAttributes->hideAttributesCreatorModul(); - myNeteditAttributes->hideNeteditAttributesModul(); - myHelpCreation->hideHelpCreation(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEStopFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEStopFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEStopFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEStopFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEStopFrame.h -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// The Widget for add Stops elements -/****************************************************************************/ -#ifndef GNEStopFrame_h -#define GNEStopFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -#include - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEStopFrame - */ -class GNEStopFrame : public GNEFrame { - -public: - - // =========================================================================== - // class HelpCreation - // =========================================================================== - - class HelpCreation : protected FXGroupBox { - - public: - /// @brief constructor - HelpCreation(GNEStopFrame* StopFrameParent); - - /// @brief destructor - ~HelpCreation(); - - /// @brief show HelpCreation - void showHelpCreation(); - - /// @brief hide HelpCreation - void hideHelpCreation(); - - /// @brief update HelpCreation - void updateHelpCreation(); - - private: - /// @brief pointer to Stop Frame Parent - GNEStopFrame* myStopFrameParent; - - /// @brief Label with creation information - FXLabel* myInformationLabel; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEStopFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEStopFrame(); - - /// @brief show Frame - void show(); - - /**@brief add Stop element - * @param objectsUnderCursor collection of objects under cursor after click over view - * @param shiftPressed flag to check if during clicking shift key was pressed - * @return true if Stop was sucesfully added - */ - bool addStop(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, bool shiftPressed); - - /// @brief get stop parameters - static bool getStopParameter(SUMOVehicleParameter::Stop& stop, const SumoXMLTag stopTag, GNEViewNet* viewNet, - GNEFrameAttributesModuls::AttributesCreator* stopAttributes, - const GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes, - const GNELane* lane, const GNEAdditional* stoppingPlace); - -protected: - /// @brief Tag selected in TagSelector - void tagSelected(); - - /// @brief selected demand element in DemandElementSelector - void demandElementSelected(); - -private: - /// @brief Stop parent selectors - GNEFrameModuls::DemandElementSelector* myStopParentSelector; - - /// @brief stop tag selector selector (used to select diffent kind of Stops) - GNEFrameModuls::TagSelector* myStopTagSelector; - - /// @brief internal Stop attributes - GNEFrameAttributesModuls::AttributesCreator* myStopAttributes; - - /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; - - /// @brief Help creation - HelpCreation* myHelpCreation; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNETAZFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNETAZFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNETAZFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNETAZFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1570 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Oct 2018 -/// -// The Widget for add TAZ elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNETAZFrame.h" - - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNETAZFrame::TAZParameters) TAZParametersMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNETAZFrame::TAZParameters::onCmdSetColorAttribute), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZParameters::onCmdSetAttribute), - FXMAPFUNC(SEL_COMMAND, MID_HELP, GNETAZFrame::TAZParameters::onCmdHelp), -}; - -FXDEFMAP(GNETAZFrame::TAZSaveChanges) TAZSaveChangesMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_OK, GNETAZFrame::TAZSaveChanges::onCmdSaveChanges), - FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNETAZFrame::TAZSaveChanges::onCmdCancelChanges), -}; - -FXDEFMAP(GNETAZFrame::TAZChildDefaultParameters) TAZChildDefaultParametersMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZChildDefaultParameters::onCmdSetDefaultValues), - FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNETAZFrame::TAZChildDefaultParameters::onCmdUseSelectedEdges), -}; - -FXDEFMAP(GNETAZFrame::TAZSelectionStatistics) TAZSelectionStatisticsMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZSelectionStatistics::onCmdSetNewValues), -}; - -FXDEFMAP(GNETAZFrame::TAZEdgesGraphic) TAZEdgesGraphicMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNETAZFrame::TAZEdgesGraphic::onCmdChoosenBy), -}; - -// 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)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZCurrent - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZCurrent::TAZEdge::TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNETAZSourceSink* _TAZSource, GNETAZSourceSink* _TAZSink) : - edge(_edge), - TAZSource(_TAZSource), - TAZSink(_TAZSink), - sourceColor(0), - sinkColor(0), - sourcePlusSinkColor(0), - sourceMinusSinkColor(0), - myTAZCurrentParent(TAZCurrentParent) -{ } - - -GNETAZFrame::TAZCurrent::TAZEdge::~TAZEdge() {} - - -void -GNETAZFrame::TAZCurrent::TAZEdge::updateColors() { - sourceColor = GNEAttributeCarrier::parse(TAZSource->getAttribute(GNE_ATTR_TAZCOLOR)); - sinkColor = GNEAttributeCarrier::parse(TAZSink->getAttribute(GNE_ATTR_TAZCOLOR)); - // Obtain Source+Sink needs more steps. First obtain Source+Sink Weight - double sourcePlusSinkWeight = TAZSource->getDepartWeight() + TAZSink->getDepartWeight(); - // avoid division between zero - if ((myTAZCurrentParent->myMaxSourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight) == 0) { - sourcePlusSinkColor = 0; - } else { - // calculate percentage relative to the max and min Source+Sink weight - double percentage = (sourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight) / - (myTAZCurrentParent->myMaxSourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight); - // convert percentage to a value between [0-9] (because we have only 10 colors) - if (percentage >= 1) { - sourcePlusSinkColor = 9; - } else if (percentage < 0) { - sourcePlusSinkColor = 0; - } else { - sourcePlusSinkColor = (int)(percentage * 10); - } - } - // Obtain Source+Sink needs more steps. First obtain Source-Sink Weight - double sourceMinusSinkWeight = TAZSource->getDepartWeight() - TAZSink->getDepartWeight(); - // avoid division between zero - if ((myTAZCurrentParent->myMaxSourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight) == 0) { - sourceMinusSinkColor = 0; - } else { - // calculate percentage relative to the max and min Source-Sink weight - double percentage = (sourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight) / - (myTAZCurrentParent->myMaxSourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight); - // convert percentage to a value between [0-9] (because we have only 10 colors) - if (percentage >= 1) { - sourceMinusSinkColor = 9; - } else if (percentage < 0) { - sourceMinusSinkColor = 0; - } else { - sourceMinusSinkColor = (int)(percentage * 10); - } - } -} - - -GNETAZFrame::TAZCurrent::TAZCurrent(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent), - myEditedTAZ(nullptr), - myMaxSourcePlusSinkWeight(0), - myMinSourcePlusSinkWeight(-1), - myMaxSourceMinusSinkWeight(0), - myMinSourceMinusSinkWeight(-1) { - // create TAZ label - myTAZCurrentLabel = new FXLabel(this, "No TAZ selected", 0, GUIDesignLabelLeft); -} - - -GNETAZFrame::TAZCurrent::~TAZCurrent() {} - - -void -GNETAZFrame::TAZCurrent::setTAZ(GNETAZ* editedTAZ) { - // set new current TAZ - myEditedTAZ = editedTAZ; - // update label and moduls - if (myEditedTAZ != nullptr) { - myTAZCurrentLabel->setText(("Current TAZ: " + myEditedTAZ->getID()).c_str()); - // obtain a copy of all edges of the net (to avoid slowdown during manipulations) - myNetEdges = myTAZFrameParent->myViewNet->getNet()->retrieveEdges(); - // obtain a copy of all SELECTED edges of the net (to avoid slowdown during manipulations) - mySelectedEdges = myTAZFrameParent->myViewNet->getNet()->retrieveEdges(true); - // resfresh TAZ Edges - refreshTAZEdges(); - // hide TAZ parameters - myTAZFrameParent->myTAZParameters->hideTAZParametersModul(); - // hide Netedit parameters - myTAZFrameParent->myNeteditAttributes->hideNeteditAttributesModul(); - // hide drawing shape - myTAZFrameParent->myDrawingShape->hideDrawingShape(); - // show edge common parameters - myTAZFrameParent->myTAZCommonStatistics->showTAZCommonStatisticsModul(); - // show save TAZ Edges - myTAZFrameParent->myTAZSaveChanges->showTAZSaveChangesModul(); - // show edge common parameters - myTAZFrameParent->myTAZChildDefaultParameters->showTAZChildDefaultParametersModul(); - // show Edges graphics - myTAZFrameParent->myTAZEdgesGraphic->showTAZEdgesGraphicModul(); - } else { - // show TAZ parameters - myTAZFrameParent->myTAZParameters->showTAZParametersModul(); - // show Netedit parameters - myTAZFrameParent->myNeteditAttributes->showNeteditAttributesModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); - // show drawing shape - myTAZFrameParent->myDrawingShape->showDrawingShape(); - // hide edge common parameters - myTAZFrameParent->myTAZCommonStatistics->hideTAZCommonStatisticsModul(); - // hide edge common parameters - myTAZFrameParent->myTAZChildDefaultParameters->hideTAZChildDefaultParametersModul(); - // hide Edges graphics - myTAZFrameParent->myTAZEdgesGraphic->hideTAZEdgesGraphicModul(); - // hide save TAZ Edges - myTAZFrameParent->myTAZSaveChanges->hideTAZSaveChangesModul(); - // restore label - myTAZCurrentLabel->setText("No TAZ selected"); - // clear net edges (always the last step due hideTAZEdgesGraphicModul() function) - myNetEdges.clear(); - // clear selected edges - mySelectedEdges.clear(); - // reset all weight values - myMaxSourcePlusSinkWeight = 0; - myMinSourcePlusSinkWeight = -1; - myMaxSourceMinusSinkWeight = 0; - myMinSourceMinusSinkWeight = -1; - } -} - - -GNETAZ* -GNETAZFrame::TAZCurrent::getTAZ() const { - return myEditedTAZ; -} - - -bool -GNETAZFrame::TAZCurrent::isTAZEdge(GNEEdge* edge) const { - // simply iterate over edges and check edge parameter - for (const auto& i : myTAZEdges) { - if (i.edge == edge) { - return true; - } - } - // not found, then return false - return false; -} - - -const std::vector& -GNETAZFrame::TAZCurrent::getNetEdges() const { - return myNetEdges; -} - - -const std::vector& -GNETAZFrame::TAZCurrent::getSelectedEdges() const { - return mySelectedEdges; -} - - -const std::vector& -GNETAZFrame::TAZCurrent::getTAZEdges() const { - return myTAZEdges; -} - - -void -GNETAZFrame::TAZCurrent::refreshTAZEdges() { - // clear all curren TAZEdges - myTAZEdges.clear(); - // clear weight values - myMaxSourcePlusSinkWeight = 0; - myMinSourcePlusSinkWeight = -1; - myMaxSourceMinusSinkWeight = 0; - myMinSourceMinusSinkWeight = -1; - // only refresh if we're editing an TAZ - if (myEditedTAZ) { - // iterate over child additional and create TAZEdges - for (const auto& i : myEditedTAZ->getChildAdditionals()) { - addTAZChild(dynamic_cast(i)); - } - // update colors after add all edges - for (auto& i : myTAZEdges) { - i.updateColors(); - } - // update edge colors - myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); - } -} - - -void -GNETAZFrame::TAZCurrent::addTAZChild(GNETAZSourceSink* sourceSink) { - // first make sure that additional is an TAZ Source or Sink - if (sourceSink && ((sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) || (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSINK))) { - GNEEdge* edge = myTAZFrameParent->myViewNet->getNet()->retrieveEdge(sourceSink->getAttribute(SUMO_ATTR_EDGE)); - // first check if TAZEdge has to be created - bool createTAZEdge = true; - for (auto& i : myTAZEdges) { - if (i.edge == edge) { - createTAZEdge = false; - // update TAZ Source or Sink - if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { - i.TAZSource = sourceSink; - } else { - i.TAZSink = sourceSink; - } - } - } - // check if additional has to be created - if (createTAZEdge) { - if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { - myTAZEdges.push_back(TAZEdge(this, edge, sourceSink, nullptr)); - } else { - myTAZEdges.push_back(TAZEdge(this, edge, nullptr, sourceSink)); - } - } - // recalculate weights - myMaxSourcePlusSinkWeight = 0; - myMinSourcePlusSinkWeight = -1; - myMaxSourceMinusSinkWeight = 0; - myMinSourceMinusSinkWeight = -1; - for (const auto& i : myTAZEdges) { - // make sure that both TAZ Source and Sink exist - if (i.TAZSource && i.TAZSink) { - // obtain source plus sink - double sourcePlusSink = i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight(); - // check myMaxSourcePlusSinkWeight - if (sourcePlusSink > myMaxSourcePlusSinkWeight) { - myMaxSourcePlusSinkWeight = sourcePlusSink; - } - // check myMinSourcePlusSinkWeight - if ((myMinSourcePlusSinkWeight == -1) || (sourcePlusSink < myMinSourcePlusSinkWeight)) { - myMinSourcePlusSinkWeight = sourcePlusSink; - } - // obtain source minus sink - double sourceMinusSink = i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight(); - // use valor absolute - if (sourceMinusSink < 0) { - sourceMinusSink *= -1; - } - // check myMaxSourcePlusSinkWeight - if (sourceMinusSink > myMaxSourceMinusSinkWeight) { - myMaxSourceMinusSinkWeight = sourceMinusSink; - } - // check myMinSourcePlusSinkWeight - if ((myMinSourceMinusSinkWeight == -1) || (sourceMinusSink < myMinSourceMinusSinkWeight)) { - myMinSourceMinusSinkWeight = sourceMinusSink; - } - } - } - } else { - throw ProcessError("Invalid TAZ Child"); - } -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZCommonStatistics - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZCommonStatistics::TAZCommonStatistics(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Statistics", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent) { - // create label for statistics - myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation); -} - - -GNETAZFrame::TAZCommonStatistics::~TAZCommonStatistics() {} - - -void -GNETAZFrame::TAZCommonStatistics::showTAZCommonStatisticsModul() { - // always update statistics after show - updateStatistics(); - show(); -} - - -void -GNETAZFrame::TAZCommonStatistics::hideTAZCommonStatisticsModul() { - hide(); -} - - -void -GNETAZFrame::TAZCommonStatistics::updateStatistics() { - if (myTAZFrameParent->myTAZCurrent->getTAZ()) { - // declare ostringstream for statistics - std::ostringstream information; - information - << "- Number of Edges: " << toString(myTAZFrameParent->myTAZCurrent->getTAZ()->getChildAdditionals().size() / 2) << "\n" - << "- Min source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SOURCE) << "\n" - << "- Max source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SOURCE) << "\n" - << "- Average source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SOURCE) << "\n" - << "\n" - << "- Min sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SINK) << "\n" - << "- Max sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SINK) << "\n" - << "- Average sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SINK); - // set new label - myStatisticsLabel->setText(information.str().c_str()); - } else { - myStatisticsLabel->setText("No TAZ Selected"); - } -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZSaveChanges - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZSaveChanges::TAZSaveChanges(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent) { - // Create groupbox for save changes - mySaveChangesButton = new FXButton(this, "Save changes", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_OK, GUIDesignButton); - mySaveChangesButton->disable(); - // Create groupbox cancel changes - myCancelChangesButton = new FXButton(this, "Cancel changes", GUIIconSubSys::getIcon(ICON_CANCEL), this, MID_CANCEL, GUIDesignButton); - myCancelChangesButton->disable(); -} - - -GNETAZFrame::TAZSaveChanges::~TAZSaveChanges() {} - - -void -GNETAZFrame::TAZSaveChanges::showTAZSaveChangesModul() { - show(); -} - - -void -GNETAZFrame::TAZSaveChanges::hideTAZSaveChangesModul() { - // cancel changes before hidding modul - onCmdCancelChanges(0, 0, 0); - hide(); -} - - -void -GNETAZFrame::TAZSaveChanges::enableButtonsAndBeginUndoList() { - // check that save changes is disabled - if (!mySaveChangesButton->isEnabled()) { - // enable mySaveChangesButton and myCancelChangesButton - mySaveChangesButton->enable(); - myCancelChangesButton->enable(); - // start undo list set - myTAZFrameParent->myViewNet->getUndoList()->p_begin("TAZ attributes"); - } -} - - -bool -GNETAZFrame::TAZSaveChanges::isChangesPending() const { - // simply check if save Changes Button is enabled - return mySaveChangesButton->isEnabled(); -} - - -long -GNETAZFrame::TAZSaveChanges::onCmdSaveChanges(FXObject*, FXSelector, void*) { - // check that save changes is enabled - if (mySaveChangesButton->isEnabled()) { - // disable mySaveChangesButton and myCancelChangesButtonand - mySaveChangesButton->disable(); - myCancelChangesButton->disable(); - // finish undo list set - myTAZFrameParent->myViewNet->getUndoList()->p_end(); - } - return 1; -} - - -long -GNETAZFrame::TAZSaveChanges::onCmdCancelChanges(FXObject*, FXSelector, void*) { - // check that save changes is enabled - if (mySaveChangesButton->isEnabled()) { - // disable buttons - mySaveChangesButton->disable(); - myCancelChangesButton->disable(); - // abort undo list - myTAZFrameParent->myViewNet->getUndoList()->p_abort(); - // always refresh TAZ Edges after removing TAZSources/Sinks - myTAZFrameParent->myTAZCurrent->refreshTAZEdges(); - // update use edges button - myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); - } - return 1; -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZChildDefaultParameters - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZChildDefaultParameters::TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Sources/Sinks", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent), - myDefaultTAZSourceWeight(1), - myDefaultTAZSinkWeight(1) { - // create checkbox for toogle membership - FXHorizontalFrame* toogleMembershipFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - new FXLabel(toogleMembershipFrame, "Membership", 0, GUIDesignLabelAttribute); - myToggleMembership = new FXCheckButton(toogleMembershipFrame, "Toggle", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); - // by default enabled - myToggleMembership->setCheck(TRUE); - // create default TAZ Source weight - myDefaultTAZSourceFrame = new FXHorizontalFrame(this, 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); - 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); - // Create information label - std::ostringstream information; - information - << "- Toogle Membership:\n" - << " Create new Sources/Sinks\n" - << " with given weights."; - myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation); -} - - -GNETAZFrame::TAZChildDefaultParameters::~TAZChildDefaultParameters() {} - - -void -GNETAZFrame::TAZChildDefaultParameters::showTAZChildDefaultParametersModul() { - // check if TAZ selection Statistics Modul has to be shown - if (myToggleMembership->getCheck() == FALSE) { - myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); - } else { - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); - } - // update selected button - updateSelectEdgesButton(); - // show modul - show(); -} - - -void -GNETAZFrame::TAZChildDefaultParameters::hideTAZChildDefaultParametersModul() { - // hide TAZ Selection Statistics Modul - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); - // hide modul - hide(); -} - - -void -GNETAZFrame::TAZChildDefaultParameters::updateSelectEdgesButton() { - if (myToggleMembership->getCheck() == TRUE) { - // check if use selected edges has to be enabled - if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) { - myUseSelectedEdges->setText("Use selected edges"); - myUseSelectedEdges->enable(); - } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) { - myUseSelectedEdges->setText("Remove all edges"); - myUseSelectedEdges->enable(); - } else { - myUseSelectedEdges->setText("Use selected edges"); - myUseSelectedEdges->disable(); - } - } else if (myTAZFrameParent->getTAZCurrentModul()->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& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { - if (!i.edge->isAttributeCarrierSelected()) { - allSelected = false; - } - } - if (allSelected) { - myUseSelectedEdges->setText("Remove all edges from selection"); - } else { - myUseSelectedEdges->setText("Add all edges to selection"); - } - } else if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 1) { - if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().front().edge->isAttributeCarrierSelected()) { - myUseSelectedEdges->setText("Remove edge from selection"); - } else { - myUseSelectedEdges->setText("Add edge to selection"); - } - } else { - // check if all edges of TAZChildren selected are selected - bool allSelected = true; - for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { - if (!i.edge->isAttributeCarrierSelected()) { - allSelected = false; - } - } - if (allSelected) { - myUseSelectedEdges->setText(("Remove " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " from to selection").c_str()); - } else { - myUseSelectedEdges->setText(("Add " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " edges to selection").c_str()); - } - } - } else { - // TAZ doesn't have children, then disable button - myUseSelectedEdges->disable(); - } -} - - -double -GNETAZFrame::TAZChildDefaultParameters::getDefaultTAZSourceWeight() const { - return myDefaultTAZSourceWeight; -} - - -double -GNETAZFrame::TAZChildDefaultParameters::getDefaultTAZSinkWeight() const { - return myDefaultTAZSinkWeight; -} - - -bool -GNETAZFrame::TAZChildDefaultParameters::getToggleMembership() const { - return (myToggleMembership->getCheck() == TRUE); -} - - -long -GNETAZFrame::TAZChildDefaultParameters::onCmdSetDefaultValues(FXObject* obj, FXSelector, void*) { - // find edited object - if (obj == myToggleMembership) { - // first clear selected edges - myTAZFrameParent->myTAZSelectionStatistics->clearSelectedEdges(); - // set text of myToggleMembership - if (myToggleMembership->getCheck() == TRUE) { - myToggleMembership->setText("toogle"); - // show TAZSource/Sink Frames - myDefaultTAZSourceFrame->show(); - myDefaultTAZSinkFrame->show(); - // update information label - std::ostringstream information; - information - << "- Toogle Membership:\n" - << " Create new Sources/Sinks\n" - << " with given weights."; - myInformationLabel->setText(information.str().c_str()); - // hide TAZSelectionStatistics - myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); - // check if use selected edges has to be enabled - if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) { - myUseSelectedEdges->setText("Use selected edges"); - } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) { - myUseSelectedEdges->setText("Remove all edges"); - } else { - myUseSelectedEdges->setText("Use selected edges"); - myUseSelectedEdges->disable(); - } - } else { - myToggleMembership->setText("keep"); - // hide TAZSource/Sink Frames - myDefaultTAZSourceFrame->hide(); - myDefaultTAZSinkFrame->hide(); - // update information label - std::ostringstream information; - information - << "- Keep Membership:\n" - << " Select Sources/Sinks.\n" - << "- Press ESC to clear\n" - << " current selection."; - myInformationLabel->setText(information.str().c_str()); - // show TAZSelectionStatistics - myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); - } - // update button - updateSelectEdgesButton(); - } else if (obj == myTextFieldDefaultValueTAZSources) { - // check if given value is valid - if (GNEAttributeCarrier::canParse(myTextFieldDefaultValueTAZSources->getText().text())) { - myDefaultTAZSourceWeight = GNEAttributeCarrier::parse(myTextFieldDefaultValueTAZSources->getText().text()); - // check if myDefaultTAZSourceWeight is greather than 0 - if (myDefaultTAZSourceWeight >= 0) { - // set valid color - myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(0, 0, 0)); - } else { - // set invalid color - myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0)); - myDefaultTAZSourceWeight = 1; - } - } else { - // set invalid color - myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0)); - myDefaultTAZSourceWeight = 1; - } - } else if (obj == myTextFieldDefaultValueTAZSinks) { - // check if given value is valid - if (GNEAttributeCarrier::canParse(myTextFieldDefaultValueTAZSinks->getText().text())) { - myDefaultTAZSinkWeight = GNEAttributeCarrier::parse(myTextFieldDefaultValueTAZSinks->getText().text()); - // check if myDefaultTAZSinkWeight is greather than 0 - if (myDefaultTAZSinkWeight >= 0) { - // set valid color - myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(0, 0, 0)); - } else { - // set invalid color - myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0)); - myDefaultTAZSinkWeight = 1; - } - } else { - // set invalid color - myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0)); - myDefaultTAZSinkWeight = 1; - } - } - return 1; -} - - -long -GNETAZFrame::TAZChildDefaultParameters::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { - // select edge or create new TAZ Source/Child, depending of myToggleMembership - if (myToggleMembership->getCheck() == TRUE) { - // first drop all edges - myTAZFrameParent->dropTAZMembers(); - // iterate over selected edges and add it as TAZMember - for (const auto& i : myTAZFrameParent->myTAZCurrent->getSelectedEdges()) { - myTAZFrameParent->addOrRemoveTAZMember(i); - } - // update selected button - updateSelectEdgesButton(); - } else { - if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 0) { - // first check if all TAZEdges are selected - bool allSelected = true; - for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { - if (!i.edge->isAttributeCarrierSelected()) { - allSelected = false; - } - } - // select or unselect all depending of allSelected - if (allSelected) { - // remove form selection all TAZEdges - for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList()); - } - } else { - // add to selection all TAZEdges - for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); - } - } - } else { - // first check if all TAZEdges are selected - bool allSelected = true; - for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { - if (!i.edge->isAttributeCarrierSelected()) { - allSelected = false; - } - } - // select or unselect all depending of allSelected - if (allSelected) { - // only remove from selection selected TAZEdges - for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { - if (i.edge->isAttributeCarrierSelected()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList()); - } - } - } else { - // only add to selection selected TAZEdges - for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { - if (!i.edge->isAttributeCarrierSelected()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); - } - } - } - } - } - // update selection button - myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); - // update view net - myTAZFrameParent->myViewNet->update(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZSelectionStatistics - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZSelectionStatistics::TAZSelectionStatistics(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Selection Statistics", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent) { - // create default TAZ Source weight - myTAZSourceFrame = new FXHorizontalFrame(this, 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); - 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); -} - - -GNETAZFrame::TAZSelectionStatistics::~TAZSelectionStatistics() {} - - -void -GNETAZFrame::TAZSelectionStatistics::showTAZSelectionStatisticsModul() { - // update Statistics before show - updateStatistics(); - show(); -} - - -void -GNETAZFrame::TAZSelectionStatistics::hideTAZSelectionStatisticsModul() { - // clear children before hide - clearSelectedEdges(); - hide(); -} - - -bool -GNETAZFrame::TAZSelectionStatistics::selectEdge(const TAZCurrent::TAZEdge& TAZEdge) { - // find TAZEdge using edge as criterium wasn't previously selected - for (const auto& i : myEdgeAndTAZChildrenSelected) { - if (i.edge == TAZEdge.edge) { - throw ProcessError("TAZEdge already selected"); - } - } - // add edge and their TAZ Children into myTAZChildSelected - myEdgeAndTAZChildrenSelected.push_back(TAZEdge); - // always update statistics after insertion - updateStatistics(); - // update edge colors - myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); - // update selection button - myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); - return true; -} - - -bool -GNETAZFrame::TAZSelectionStatistics::unselectEdge(GNEEdge* edge) { - if (edge) { - // find TAZEdge using edge as criterium - for (auto i = myEdgeAndTAZChildrenSelected.begin(); i != myEdgeAndTAZChildrenSelected.end(); i++) { - if (i->edge == edge) { - myEdgeAndTAZChildrenSelected.erase(i); - // always update statistics after insertion - updateStatistics(); - // update edge colors - myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); - // update selection button - myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); - return true; - } - } - // throw exception if edge wasn't found - throw ProcessError("edge wasn't found"); - } else { - throw ProcessError("Invalid edge"); - } -} - - -bool -GNETAZFrame::TAZSelectionStatistics::isEdgeSelected(GNEEdge* edge) { - // find TAZEdge using edge as criterium - for (const auto& i : myEdgeAndTAZChildrenSelected) { - if (i.edge == edge) { - return true; - } - } - // edge wasn't found, then return false - return false; -} - - -void -GNETAZFrame::TAZSelectionStatistics::clearSelectedEdges() { - // clear all selected edges (and the TAZ Children) - myEdgeAndTAZChildrenSelected.clear(); - // always update statistics after clear edges - updateStatistics(); - // update edge colors - myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); - // update selection button - myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); -} - - -const std::vector& -GNETAZFrame::TAZSelectionStatistics::getEdgeAndTAZChildrenSelected() const { - return myEdgeAndTAZChildrenSelected; -} - - -long -GNETAZFrame::TAZSelectionStatistics::onCmdSetNewValues(FXObject* obj, FXSelector, void*) { - if (obj == myTextFieldTAZSourceWeight) { - // check if given value is valid - if (GNEAttributeCarrier::canParse(myTextFieldTAZSourceWeight->getText().text())) { - double newTAZSourceWeight = GNEAttributeCarrier::parse(myTextFieldTAZSourceWeight->getText().text()); - // check if myDefaultTAZSourceWeight is greather than 0 - if (newTAZSourceWeight >= 0) { - // set valid color in TextField - myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0)); - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // update weight of all TAZSources - for (const auto& i : myEdgeAndTAZChildrenSelected) { - i.TAZSource->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSourceWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); - } - // refresh TAZ Edges - myTAZFrameParent->getTAZCurrentModul()->refreshTAZEdges(); - } else { - // set invalid color - myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0)); - } - } else { - // set invalid color - myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0)); - } - } else if (obj == myTextFieldTAZSinkWeight) { - // check if given value is valid - if (GNEAttributeCarrier::canParse(myTextFieldTAZSinkWeight->getText().text())) { - double newTAZSinkWeight = GNEAttributeCarrier::parse(myTextFieldTAZSinkWeight->getText().text()); - // check if myDefaultTAZSinkWeight is greather than 0 - if (newTAZSinkWeight >= 0) { - // set valid color in TextField - myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0)); - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // update weight of all TAZSources - for (const auto& i : myEdgeAndTAZChildrenSelected) { - i.TAZSink->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSinkWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); - } - // refresh TAZ Edges - myTAZFrameParent->getTAZCurrentModul()->refreshTAZEdges(); - } else { - // set invalid color - myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0)); - } - } else { - // set invalid color - myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0)); - } - } - return 1; -} - - -long -GNETAZFrame::TAZSelectionStatistics::onCmdSelectEdges(FXObject*, FXSelector, void*) { - if (myEdgeAndTAZChildrenSelected.size() == 0) { - // add to selection all TAZEdges - for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { - // avoid empty undolists - if (!i.edge->isAttributeCarrierSelected()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); - } - } - } else { - // only add to selection selected TAZEdges - for (const auto& i : myEdgeAndTAZChildrenSelected) { - // avoid empty undolists - if (!i.edge->isAttributeCarrierSelected()) { - // enable save button - myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // change attribute selected - i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); - } - } - } - // update view net - myTAZFrameParent->myViewNet->update(); - return 1; -} - - -void -GNETAZFrame::TAZSelectionStatistics::updateStatistics() { - if (myEdgeAndTAZChildrenSelected.size() > 0) { - // show TAZSources/Sinks frames - myTAZSourceFrame->show(); - myTAZSinkFrame->show(); - // declare string sets for TextFields (to avoid duplicated values) - std::set weightSourceSet; - std::set weightSinkSet; - // declare stadistic variables - double weight = 0; - double maxWeightSource = 0; - double minWeightSource = -1; - double averageWeightSource = 0; - double maxWeightSink = 0; - double minWeightSink = -1; - double averageWeightSink = 0; - // iterate over child additional - for (const auto& i : myEdgeAndTAZChildrenSelected) { - //start with sources - weight = i.TAZSource->getDepartWeight(); - // insert source weight in weightSinkTextField - weightSourceSet.insert(toString(weight)); - // check max Weight - if (maxWeightSource < weight) { - maxWeightSource = weight; - } - // check min Weight - if (minWeightSource == -1 || (maxWeightSource < weight)) { - minWeightSource = weight; - } - // update Average - averageWeightSource += weight; - // continue with sinks - weight = i.TAZSink->getDepartWeight(); - // save sink weight in weightSinkTextField - weightSinkSet.insert(toString(weight)); - // check max Weight - if (maxWeightSink < weight) { - maxWeightSink = weight; - } - // check min Weight - if (minWeightSink == -1 || (maxWeightSink < weight)) { - minWeightSink = weight; - } - // update Average - averageWeightSink += weight; - } - // calculate average - averageWeightSource /= myEdgeAndTAZChildrenSelected.size(); - averageWeightSink /= myEdgeAndTAZChildrenSelected.size(); - // declare ostringstream for statistics - std::ostringstream information; - std::string edgeInformation; - // first fill edgeInformation - if (myEdgeAndTAZChildrenSelected.size() == 1) { - edgeInformation = "- Edge ID: " + myEdgeAndTAZChildrenSelected.begin()->edge->getID(); - } else { - edgeInformation = "- Number of edges: " + toString(myEdgeAndTAZChildrenSelected.size()); - } - // fill rest of information - information - << edgeInformation << "\n" - << "- Min source: " << toString(minWeightSource) << "\n" - << "- Max source: " << toString(maxWeightSource) << "\n" - << "- Average source: " << toString(averageWeightSource) << "\n" - << "\n" - << "- Min sink: " << toString(minWeightSink) << "\n" - << "- Max sink: " << toString(maxWeightSink) << "\n" - << "- Average sink: " << toString(averageWeightSink); - // set new label - myStatisticsLabel->setText(information.str().c_str()); - // set TextFields (Text and color) - myTextFieldTAZSourceWeight->setText(joinToString(weightSourceSet, " ").c_str()); - myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0)); - myTextFieldTAZSinkWeight->setText(joinToString(weightSinkSet, " ").c_str()); - myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0)); - } else { - // hide TAZSources/Sinks frames - myTAZSourceFrame->hide(); - myTAZSinkFrame->hide(); - // hide myStatisticsLabel - myStatisticsLabel->setText("No edges selected"); - } -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZParameters- methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZParameters::TAZParameters(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "TAZ parameters", GUIDesignGroupBoxFrame), - myTAZFrameParent(TAZFrameParent) { - // create Button and string textField for color and set blue as default color - FXHorizontalFrame* colorParameter = new FXHorizontalFrame(this, 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 Label and CheckButton for use innen edges with true as default value - FXHorizontalFrame* useInnenEdges = new FXHorizontalFrame(this, 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); -} - - -GNETAZFrame::TAZParameters::~TAZParameters() {} - - -void -GNETAZFrame::TAZParameters::showTAZParametersModul() { - FXGroupBox::show(); -} - - -void -GNETAZFrame::TAZParameters::hideTAZParametersModul() { - FXGroupBox::hide(); -} - - -bool -GNETAZFrame::TAZParameters::isCurrentParametersValid() const { - return GNEAttributeCarrier::canParse(myTextFieldColor->getText().text()); -} - - -bool -GNETAZFrame::TAZParameters::isAddEdgesWithinEnabled() const { - return (myAddEdgesWithinCheckButton->getCheck() == TRUE); -} - - -std::map -GNETAZFrame::TAZParameters::getAttributesAndValues() const { - std::map parametersAndValues; - // get color (currently the only editable attribute) - parametersAndValues[SUMO_ATTR_COLOR] = myTextFieldColor->getText().text(); - return parametersAndValues; -} - - -long -GNETAZFrame::TAZParameters::onCmdSetColorAttribute(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(myTextFieldColor->getText().text())) { - colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myTextFieldColor->getText().text()))); - } else { - colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor("blue"))); - } - // execute dialog to get a new color - if (colordialog.execute()) { - myTextFieldColor->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str()); - onCmdSetAttribute(0, 0, 0); - } - return 0; -} - - -long -GNETAZFrame::TAZParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) { - // only COLOR text field has to be checked - bool currentParametersValid = GNEAttributeCarrier::canParse(myTextFieldColor->getText().text()); - // change color of textfield dependig of myCurrentParametersValid - if (currentParametersValid) { - myTextFieldColor->setTextColor(FXRGB(0, 0, 0)); - myTextFieldColor->killFocus(); - } else { - myTextFieldColor->setTextColor(FXRGB(255, 0, 0)); - currentParametersValid = false; - } - // change useInnenEdgesCheckButton text - if (myAddEdgesWithinCheckButton->getCheck() == TRUE) { - myAddEdgesWithinCheckButton->setText("use"); - } else { - myAddEdgesWithinCheckButton->setText("not use"); - } - return 0; -} - - -long -GNETAZFrame::TAZParameters::onCmdHelp(FXObject*, FXSelector, void*) { - myTAZFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); - return 1; -} - -// --------------------------------------------------------------------------- -// GNETAZFrame::TAZEdgesGraphic - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::TAZEdgesGraphic::TAZEdgesGraphic(GNETAZFrame* TAZFrameParent) : - FXGroupBox(TAZFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), - 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); - NonTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeDefaultColor)); - NonTAZEdgeLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); - // create label for selected TAZEdge color information - FXLabel* selectedTAZEdgeLabel = new FXLabel(this, "Selected TAZ Edge", nullptr, GUIDesignLabelCenter); - selectedTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeSelectedColor)); - // create label for color information - new FXLabel(this, "Scala: Min -> Max", nullptr, GUIDesignLabelCenterThick); - // fill scale colors - myScaleColors.push_back(RGBColor(232, 35, 0)); - myScaleColors.push_back(RGBColor(255, 165, 0)); - myScaleColors.push_back(RGBColor(255, 255, 0)); - myScaleColors.push_back(RGBColor(28, 215, 0)); - myScaleColors.push_back(RGBColor(0, 181, 100)); - myScaleColors.push_back(RGBColor(0, 255, 191)); - myScaleColors.push_back(RGBColor(178, 255, 255)); - myScaleColors.push_back(RGBColor(0, 112, 184)); - myScaleColors.push_back(RGBColor(56, 41, 131)); - myScaleColors.push_back(RGBColor(127, 0, 255)); - // create frame for color scale - FXHorizontalFrame* horizontalFrameColors = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - for (const auto& i : myScaleColors) { - FXLabel* colorLabel = new FXLabel(horizontalFrameColors, "", nullptr, GUIDesignLabelLeft); - colorLabel->setBackColor(MFXUtils::getFXColor(i)); - } - // create Radio button for show edges by source weight - myColorBySourceWeight = new FXRadioButton(this, "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); - // create Radio button for show edges by source + sink weight - myColorBySourcePlusSinkWeight = new FXRadioButton(this, "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); - // show by source as default - myColorBySourceWeight->setCheck(true); -} - - -GNETAZFrame::TAZEdgesGraphic::~TAZEdgesGraphic() {} - - -void -GNETAZFrame::TAZEdgesGraphic::showTAZEdgesGraphicModul() { - // update edge colors - updateEdgeColors(); - show(); -} - - -void -GNETAZFrame::TAZEdgesGraphic::hideTAZEdgesGraphicModul() { - // iterate over all edges and restore color - for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) { - for (const auto j : i->getLanes()) { - j->setSpecialColor(nullptr); - } - } - hide(); -} - - -void -GNETAZFrame::TAZEdgesGraphic::updateEdgeColors() { - // start painting all edges in gray - for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) { - // set candidate color (in this case, gray) - for (const auto j : i->getLanes()) { - j->setSpecialColor(&myEdgeDefaultColor); - } - } - // now paint Source/sinks colors - for (const auto& i : myTAZFrameParent->myTAZCurrent->getTAZEdges()) { - // set candidate color (in this case, - for (const auto j : i.edge->getLanes()) { - // check what will be painted (source, sink or both) - if (myColorBySourceWeight->getCheck() == TRUE) { - j->setSpecialColor(&myScaleColors.at(i.sourceColor), i.TAZSource->getDepartWeight()); - } else if (myColorBySinkWeight->getCheck() == TRUE) { - j->setSpecialColor(&myScaleColors.at(i.sinkColor), i.TAZSink->getDepartWeight()); - } else if (myColorBySourcePlusSinkWeight->getCheck() == TRUE) { - j->setSpecialColor(&myScaleColors.at(i.sourcePlusSinkColor), i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight()); - } else { - j->setSpecialColor(&myScaleColors.at(i.sourceMinusSinkColor), i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight()); - } - } - } - // as last step paint candidate colors - for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { - // set candidate selected color - for (const auto& j : i.edge->getLanes()) { - j->setSpecialColor(&myEdgeSelectedColor); - } - } - // always update view after setting new colors - myTAZFrameParent->myViewNet->update(); -} - - -long -GNETAZFrame::TAZEdgesGraphic::onCmdChoosenBy(FXObject* obj, FXSelector, void*) { - // check what radio was pressed and disable the others - if (obj == myColorBySourceWeight) { - myColorBySinkWeight->setCheck(FALSE); - myColorBySourcePlusSinkWeight->setCheck(FALSE); - myColorBySourceMinusSinkWeight->setCheck(FALSE); - } else if (obj == myColorBySinkWeight) { - myColorBySourceWeight->setCheck(FALSE); - myColorBySourcePlusSinkWeight->setCheck(FALSE); - myColorBySourceMinusSinkWeight->setCheck(FALSE); - } else if (obj == myColorBySourcePlusSinkWeight) { - myColorBySourceWeight->setCheck(FALSE); - myColorBySinkWeight->setCheck(FALSE); - myColorBySourceMinusSinkWeight->setCheck(FALSE); - } else if (obj == myColorBySourceMinusSinkWeight) { - myColorBySourceWeight->setCheck(FALSE); - myColorBySinkWeight->setCheck(FALSE); - myColorBySourcePlusSinkWeight->setCheck(FALSE); - } - // update edge colors - updateEdgeColors(); - return 1; -} - -// --------------------------------------------------------------------------- -// GNETAZFrame - methods -// --------------------------------------------------------------------------- - -GNETAZFrame::GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "TAZs") { - - // create current TAZ modul - myTAZCurrent = new TAZCurrent(this); - - // Create TAZ Parameters modul - myTAZParameters = new TAZParameters(this); - - /// @brief create Netedit parameter - myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); - - // Create drawing controls modul - myDrawingShape = new GNEFrameModuls::DrawingShape(this); - - // Create TAZ Edges Common Statistics modul - myTAZCommonStatistics = new TAZCommonStatistics(this); - - // Create save TAZ Edges modul - myTAZSaveChanges = new TAZSaveChanges(this); - - // Create TAZ Edges Common Parameters modul - myTAZChildDefaultParameters = new TAZChildDefaultParameters(this); - - // Create TAZ Edges Selection Statistics modul - myTAZSelectionStatistics = new TAZSelectionStatistics(this); - - // Create TAZ Edges Common Parameters modul - myTAZEdgesGraphic = new TAZEdgesGraphic(this); - - // by default there isn't a TAZ - myTAZCurrent->setTAZ(nullptr); -} - - -GNETAZFrame::~GNETAZFrame() { -} - - -void -GNETAZFrame::hide() { - // hide frame - GNEFrame::hide(); -} - - -bool -GNETAZFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // Declare map to keep values - std::map valuesOfElement; - 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); - } - return true; - } else if ((myTAZCurrent->getTAZ() == nullptr) || (objectsUnderCursor.getTAZFront() && myTAZCurrent->getTAZ() && !myTAZSaveChanges->isChangesPending())) { - // if user click over an TAZ and there isn't changes pending, then select a new TAZ - if (objectsUnderCursor.getTAZFront()) { - // avoid reset of Frame if user doesn't click over an TAZ - myTAZCurrent->setTAZ(objectsUnderCursor.getTAZFront()); - return true; - } else { - return false; - } - } else if (objectsUnderCursor.getEdgeFront()) { - // if toogle Edge is enabled, select edge. In other case create two new TAZSource/Sinks - if (myTAZChildDefaultParameters->getToggleMembership()) { - // create new TAZSource/Sinks or delete it - return addOrRemoveTAZMember(objectsUnderCursor.getEdgeFront()); - } else { - // first check if clicked edge was previously selected - if (myTAZSelectionStatistics->isEdgeSelected(objectsUnderCursor.getEdgeFront())) { - // clear selected edges - myTAZSelectionStatistics->clearSelectedEdges(); - } else { - // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks) - for (const auto& i : myTAZCurrent->getTAZEdges()) { - if (i.edge == objectsUnderCursor.getEdgeFront()) { - // clear current selection (to avoid having two or more edges selected at the same time using mouse clicks) - myTAZSelectionStatistics->clearSelectedEdges(); - // now select edge - myTAZSelectionStatistics->selectEdge(i); - // edge selected, then return true - return true; - } - } - } - // edge wasn't selected, then return false - return false; - } - } else { - // nothing to do - return false; - } -} - - -void -GNETAZFrame::processEdgeSelection(const std::vector& edges) { - // first check that a TAZ is selected - if (myTAZCurrent->getTAZ()) { - // if "toogle Membership" is enabled, create new TAZSources/sinks. In other case simply select edges - if (myTAZChildDefaultParameters->getToggleMembership()) { - // iterate over edges - for (auto i : edges) { - // first check if edge owns a TAZEge - if (myTAZCurrent->isTAZEdge(i) == false) { - // create new TAZ Sources/Sinks - addOrRemoveTAZMember(i); - } - } - } else { - // iterate over edges - for (auto i : edges) { - // first check that selected edge isn't already selected - if (!myTAZSelectionStatistics->isEdgeSelected(i)) { - // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks) - for (const auto& j : myTAZCurrent->getTAZEdges()) { - if (j.edge == i) { - myTAZSelectionStatistics->selectEdge(j); - } - } - } - } - } - } -} - - -GNEFrameModuls::DrawingShape* -GNETAZFrame::getDrawingShapeModul() const { - return myDrawingShape; -} - - -GNETAZFrame::TAZCurrent* -GNETAZFrame::getTAZCurrentModul() const { - return myTAZCurrent; -} - - -GNETAZFrame::TAZSelectionStatistics* -GNETAZFrame::getTAZSelectionStatisticsModul() const { - return myTAZSelectionStatistics; -} - - -GNETAZFrame::TAZSaveChanges* -GNETAZFrame::getTAZSaveChangesModul() const { - return myTAZSaveChanges; -} - - -bool -GNETAZFrame::shapeDrawed() { - // show warning dialogbox and stop check if input parameters are valid - if (!myTAZParameters->isCurrentParametersValid()) { - return false; - } else if (myDrawingShape->getTemporalShape().size() == 0) { - WRITE_WARNING("TAZ shape cannot be empty"); - return false; - } else { - // Declare map to keep TAZ Parameters values - std::map valuesOfElement = myTAZParameters->getAttributesAndValues(); - - // obtain Netedit attributes - myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, nullptr); - - // generate new ID - valuesOfElement[SUMO_ATTR_ID] = myViewNet->getNet()->generateAdditionalID(SUMO_TAG_TAZ); - - // obtain shape and close it - PositionVector shape = myDrawingShape->getTemporalShape(); - shape.closePolygon(); - valuesOfElement[SUMO_ATTR_SHAPE] = toString(shape); - - // check if TAZ has to be created with edges - if (myTAZParameters->isAddEdgesWithinEnabled()) { - std::vector edgeIDs; - auto ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(shape.getBoxBoundary(), true); - for (auto i : ACsInBoundary) { - if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) { - edgeIDs.push_back(i.first); - } - } - valuesOfElement[SUMO_ATTR_EDGES] = toString(edgeIDs); - } else { - // TAZ is created without edges - valuesOfElement[SUMO_ATTR_EDGES] = ""; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesOfElement, getPredefinedTagsMML(), toString(SUMO_TAG_TAZ)); - // return true if TAZ was successfully created - return GNEAdditionalHandler::buildAdditional(myViewNet, true, SUMO_TAG_TAZ, SUMOSAXAttrs, nullptr); - } -} - - -bool -GNETAZFrame::addOrRemoveTAZMember(GNEEdge* edge) { - // first check if edge exist; - if (edge) { - // first check if already exist (in this case, remove it) - for (const auto& i : myTAZCurrent->getTAZEdges()) { - if (i.edge == edge) { - // enable save changes button - myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // remove Source and Sinks using GNEChange_Additional - myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true); - myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true); - // always refresh TAZ Edges after removing TAZSources/Sinks - myTAZCurrent->refreshTAZEdges(); - // update select edges button - myTAZChildDefaultParameters->updateSelectEdgesButton(); - return true; - } - } - // if wasn't found, then add it - myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters - GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, myTAZCurrent->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSourceWeight()); - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); - // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters - GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, myTAZCurrent->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSinkWeight()); - myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); - // always refresh TAZ Edges after adding TAZSources/Sinks - myTAZCurrent->refreshTAZEdges(); - // update selected button - myTAZChildDefaultParameters->updateSelectEdgesButton(); - return true; - } else { - throw ProcessError("Edge cannot be null"); - } -} - - -void -GNETAZFrame::dropTAZMembers() { - // iterate over all TAZEdges - for (const auto& i : myTAZCurrent->getTAZEdges()) { - // enable save changes button - myTAZSaveChanges->enableButtonsAndBeginUndoList(); - // remove Source and Sinks using GNEChange_Additional - myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true); - myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true); - } - // always refresh TAZ Edges after removing TAZSources/Sinks - myTAZCurrent->refreshTAZEdges(); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNETAZFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNETAZFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNETAZFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNETAZFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,586 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETAZFrame.h -/// @author Pablo Alvarez Lopez -/// @date Oct 2018 -/// -// The Widget for add TAZ elements -/****************************************************************************/ -#ifndef GNETAZFrame_h -#define GNETAZFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -class GNETAZSourceSink; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNETAZFrame - * The Widget for setting internal attributes of TAZ elements - */ -class GNETAZFrame : public GNEFrame { - -public: - // =========================================================================== - // class TAZCurrent - // =========================================================================== - - class TAZCurrent : protected FXGroupBox { - - public: - /// @brief struct for edges and the source/sink colors - struct TAZEdge { - /// @brief constructor - TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNETAZSourceSink* _TAZSource, GNETAZSourceSink* _TAZSink); - - /// @brief destructor (needed because RGBColors has to be deleted) - ~TAZEdge(); - - /// @brief update colors - void updateColors(); - - /// @brief TAZ edge - GNEEdge* edge; - - /// @brief source TAZ - GNETAZSourceSink* TAZSource; - - /// @brif sink TAZ - GNETAZSourceSink* TAZSink; - - /// @brief color by source [0-9] - int sourceColor; - - /// @brief color by sink [0-9] - int sinkColor; - - /// @brief color by source + sink [0-9] - int sourcePlusSinkColor; - - /// @brief color by source - sink [0-9] - int sourceMinusSinkColor; - - private: - /// @brief pointer to TAZCurrentParent - TAZCurrent* myTAZCurrentParent; - }; - - /// @brief constructor - TAZCurrent(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZCurrent(); - - /// @brief set current TAZ - void setTAZ(GNETAZ* editedTAZ); - - /// @brief get current TAZ - GNETAZ* getTAZ() const; - - /// @brief check if given edge belongs to current TAZ - bool isTAZEdge(GNEEdge* edge) const; - - /// @brief get current net edges - const std::vector& getNetEdges() const; - - /// @brief get current selected edges - const std::vector& getSelectedEdges() const; - - /// @brief get TAZEdges - const std::vector& getTAZEdges() const; - - /// @brief refresh TAZEdges - void refreshTAZEdges(); - - protected: - /// @brief add TAZChild - void addTAZChild(GNETAZSourceSink* additional); - - private: - /// @brief pointer to TAZ Frame - GNETAZFrame* myTAZFrameParent; - - /// @brief current edited TAZ - GNETAZ* myEditedTAZ; - - /// @brief vector with pointers to edges (it's used to avoid slowdowns during Source/Sinks manipulations) - std::vector myNetEdges; - - /// @brief vector with pointers to selected edges - std::vector mySelectedEdges; - - /// @brief vector with TAZ's edges - std::vector myTAZEdges; - - /// @brief Label for current TAZ - FXLabel* myTAZCurrentLabel; - - /// @brief maximum source plus sink value of current TAZ Edges - double myMaxSourcePlusSinkWeight; - - /// @brief minimum source plus sink value of current TAZ Edges - double myMinSourcePlusSinkWeight; - - /// @brief maximum source minus sink value of current TAZ Edges - double myMaxSourceMinusSinkWeight; - - /// @brief minimum source minus sink value of current TAZ Edges - double myMinSourceMinusSinkWeight; - }; - - // =========================================================================== - // class TAZCommonStatistics - // =========================================================================== - - class TAZCommonStatistics : protected FXGroupBox { - - public: - /// @brief constructor - TAZCommonStatistics(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZCommonStatistics(); - - /// @brief show TAZ Common Statistics Modul - void showTAZCommonStatisticsModul(); - - /// @brief hide TAZ Common Statistics Modul - void hideTAZCommonStatisticsModul(); - - protected: - /// @brief update Statistics label - void updateStatistics(); - - private: - /// @brief pointer to TAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @brief Statistics labels - FXLabel* myStatisticsLabel; - }; - - // =========================================================================== - // class TAZSaveChanges - // =========================================================================== - - class TAZSaveChanges : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETAZFrame::TAZSaveChanges) - - public: - /// @brief constructor - TAZSaveChanges(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZSaveChanges(); - - /// @brief show TAZ Save Changes Modul - void showTAZSaveChangesModul(); - - /// @brief hide TAZ Save Changes Modul - void hideTAZSaveChangesModul(); - - /// @brief enable buttons save and cancel changes (And begin Undo List) - void enableButtonsAndBeginUndoList(); - - /// @brief return true if there is changes to save - bool isChangesPending() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user press the button save changes - long onCmdSaveChanges(FXObject*, FXSelector, void*); - - /// @brief Called when the user press the button cancel changes - long onCmdCancelChanges(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TAZSaveChanges) - - private: - /// @brief pointer to TAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @field FXButton for save changes in TAZEdges - FXButton* mySaveChangesButton; - - /// @field FXButton for cancel changes in TAZEdges - FXButton* myCancelChangesButton; - }; - - // =========================================================================== - // class TAZChildDefaultParameters - // =========================================================================== - - class TAZChildDefaultParameters : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETAZFrame::TAZChildDefaultParameters) - - public: - /// @brief constructor - TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZChildDefaultParameters(); - - /// @brief show TAZ child default parameters Modul - void showTAZChildDefaultParametersModul(); - - /// @brief hide TAZ child default parameters Modul - void hideTAZChildDefaultParametersModul(); - - /// @brief update "select edges button" - void updateSelectEdgesButton(); - - /// @brief get default TAZSource weight - double getDefaultTAZSourceWeight() const; - - /// @brief default TAZSink weight - double getDefaultTAZSinkWeight() const; - - /// @brief check if toggle membership is enabled - bool getToggleMembership() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user changes default values - long onCmdSetDefaultValues(FXObject* obj, FXSelector, void*); - - /// @brief Called when the user press use selected edges - long onCmdUseSelectedEdges(FXObject* obj, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TAZChildDefaultParameters) - - private: - /// @brief pointer to TAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @brief CheckButton to enable or disable Toggle edge Membership - FXCheckButton* myToggleMembership; - - /// @brief Horizontal Frame for default TAZ Source Weight - FXHorizontalFrame* myDefaultTAZSourceFrame; - - /// @brief textField to set a default value for TAZ Sources - FXTextField* myTextFieldDefaultValueTAZSources; - - /// @brief Horizontal Frame for default TAZ Sink Weight - FXHorizontalFrame* myDefaultTAZSinkFrame; - - /// @brief textField to set a default value for TAZ Sinks - FXTextField* myTextFieldDefaultValueTAZSinks; - - /// @brief button for use selected edges - FXButton* myUseSelectedEdges; - - /// @brief information label - FXLabel* myInformationLabel; - - /// @brief default TAZSource weight - double myDefaultTAZSourceWeight; - - /// @brief default TAZSink weight - double myDefaultTAZSinkWeight; - }; - - // =========================================================================== - // class TAZSelectionStatistics - // =========================================================================== - - class TAZSelectionStatistics : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETAZFrame::TAZSelectionStatistics) - - public: - /// @brief constructor - TAZSelectionStatistics(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZSelectionStatistics(); - - /// @brief show TAZ Selection Statistics Modul - void showTAZSelectionStatisticsModul(); - - /// @brief hide TAZ Selection Statistics Modul - void hideTAZSelectionStatisticsModul(); - - /// @brief add an edge and their TAZ Children in the list of selected items - bool selectEdge(const TAZCurrent::TAZEdge& edge); - - /// @brief un select an edge (and their TAZ Children) - bool unselectEdge(GNEEdge* edge); - - /// @brief check if an edge is selected - bool isEdgeSelected(GNEEdge* edge); - - /// @brief clear current TAZ children - void clearSelectedEdges(); - - /// @brief get map with edge and TAZChildren - const std::vector& getEdgeAndTAZChildrenSelected() const; - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user set a new value - long onCmdSetNewValues(FXObject* obj, FXSelector, void*); - - /// @brief Called when the user press select edges - long onCmdSelectEdges(FXObject* obj, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TAZSelectionStatistics) - - /// @brief update TAZSelectionStatistics - void updateStatistics(); - - private: - /// @brief pointer to TAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @brief Horizontal Frame for default TAZ Source Weight - FXHorizontalFrame* myTAZSourceFrame; - - /// @brief textField for TAZ Source weight - FXTextField* myTextFieldTAZSourceWeight; - - /// @brief Horizontal Frame for default TAZ Sink Weight - FXHorizontalFrame* myTAZSinkFrame; - - /// @brief textField for TAZ Sink weight - FXTextField* myTextFieldTAZSinkWeight; - - /// @brief Statistics labels - FXLabel* myStatisticsLabel; - - /// @brief vector with the current selected edges and their associated children - std::vector myEdgeAndTAZChildrenSelected; - }; - - // =========================================================================== - // class TAZParameters - // =========================================================================== - - class TAZParameters : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETAZFrame::TAZParameters) - - public: - /// @brief constructor - TAZParameters(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZParameters(); - - /// @brief show TAZ parameters and set the default value of parameters - void showTAZParametersModul(); - - /// @brief hide TAZ parameters - void hideTAZParametersModul(); - - /// @brief check if current parameters are valid - bool isCurrentParametersValid() const; - - /// @brief check if edges within has to be used after TAZ Creation - bool isAddEdgesWithinEnabled() const; - - /// @brief get a map with attributes and their values - std::map getAttributesAndValues() const; - - /// @name FOX-callbacks - /// @{ - /// @brief called when user press the "Color" button - long onCmdSetColorAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when user set a value - long onCmdSetAttribute(FXObject*, FXSelector, void*); - - /// @brief Called when help button is pressed - long onCmdHelp(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TAZParameters) - - private: - /// @brief pointer to GNETAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @brief Button for open color editor - FXButton* myColorEditor; - - /// @brief textField to modify the default value of color parameter - FXTextField* myTextFieldColor; - - /// @brief CheckButton to enable or disable use edges within TAZ after creation - FXCheckButton* myAddEdgesWithinCheckButton; - - /// @brief button for help - FXButton* myHelpTAZAttribute; - }; - - // =========================================================================== - // class TAZEdgesGraphic - // =========================================================================== - - class TAZEdgesGraphic : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETAZFrame::TAZEdgesGraphic) - - public: - /// @brief constructor - TAZEdgesGraphic(GNETAZFrame* TAZFrameParent); - - /// @brief destructor - ~TAZEdgesGraphic(); - - /// @brief show TAZ Edges Graphic Modul - void showTAZEdgesGraphicModul(); - - /// @brief hide TAZ Edges Graphic Modul - void hideTAZEdgesGraphicModul(); - - /// @brief update edge colors; - void updateEdgeColors(); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user select one kind of representation - long onCmdChoosenBy(FXObject* obj, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TAZEdgesGraphic) - - private: - /// @brief pointer to TAZFrame parent - GNETAZFrame* myTAZFrameParent; - - /// @brief add radio button "color by source" - FXRadioButton* myColorBySourceWeight; - - /// @brief add radio button "color by sink" - FXRadioButton* myColorBySinkWeight; - - /// @brief add radio button "color source + sink" - FXRadioButton* myColorBySourcePlusSinkWeight; - - /// @brief add radio button "color source - Sink" - FXRadioButton* myColorBySourceMinusSinkWeight; - - /// @brief vector wit the scale colors - std::vector myScaleColors; - - /// @brief default RGBColor for all edges - RGBColor myEdgeDefaultColor; - - /// @brief RGBColor color for selected egdes - RGBColor myEdgeSelectedColor; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNETAZFrame(); - - /// @brief hide TAZ frame - void hide(); - - /**@brief process click over Viewnet - * @param[in] clickedPosition clicked position over ViewNet - * @param[in] objectsUnderCursor objects under cursors - * @return true if something (select TAZ or add edge) was sucefully done - */ - bool processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief process selection of edges in view net - void processEdgeSelection(const std::vector& edges); - - /// @brief get drawing mode modul - GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; - - /// @brief get Current TAZ modul - TAZCurrent* getTAZCurrentModul() const; - - /// @brief get TAZ Selection Statistics modul - TAZSelectionStatistics* getTAZSelectionStatisticsModul() const; - - /// @brief get TAZ Save Changes modul - TAZSaveChanges* getTAZSaveChangesModul() const; - -protected: - /**@brief build a shaped element using the drawed shape - * return true if was sucesfully created - * @note called when user stop drawing shape - */ - bool shapeDrawed(); - - /// @brief add or remove a TAZSource and a TAZSink, or remove it if edge is in the list of TAZ Children - bool addOrRemoveTAZMember(GNEEdge* edge); - - /// @brief drop all TAZSources and TAZ Sinks of current TAZ - void dropTAZMembers(); - -private: - /// @brief current TAZ - TAZCurrent* myTAZCurrent; - - /// @brief TAZ Edges common parameters - TAZCommonStatistics* myTAZCommonStatistics; - - /// @brief TAZ parameters - TAZParameters* myTAZParameters; - - /// @brief Netedit parameter - GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; - - /// @brief Drawing shape - GNEFrameModuls::DrawingShape* myDrawingShape; - - /// @brief save TAZ Edges - TAZSaveChanges* myTAZSaveChanges; - - /// @brief TAZ child defaults parameters - TAZChildDefaultParameters* myTAZChildDefaultParameters; - - /// @brief TAZ Edges selection parameters - TAZSelectionStatistics* myTAZSelectionStatistics; - - /// @brief TAZ Edges Graphic - TAZEdgesGraphic* myTAZEdgesGraphic; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1406 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETLSEditorFrame.cpp -/// @author Jakob Erdmann -/// @date May 2011 -/// -// The Widget for modifying traffic lights -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNETLSEditorFrame.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -FXDEFMAP(GNETLSEditorFrame) GNETLSEditorFrameMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNETLSEditorFrame::onCmdCancel), - FXMAPFUNC(SEL_UPDATE, MID_CANCEL, GNETLSEditorFrame::onUpdModified), - FXMAPFUNC(SEL_COMMAND, MID_OK, GNETLSEditorFrame::onCmdOK), - FXMAPFUNC(SEL_UPDATE, MID_OK, GNETLSEditorFrame::onUpdModified), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_CREATE, GNETLSEditorFrame::onCmdDefCreate), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_CREATE, GNETLSEditorFrame::onUpdDefCreate), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_DELETE, GNETLSEditorFrame::onCmdDefDelete), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_DELETE, GNETLSEditorFrame::onUpdDefSwitch), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SWITCH, GNETLSEditorFrame::onCmdDefSwitch), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_SWITCH, GNETLSEditorFrame::onUpdDefSwitch), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_OFFSET, GNETLSEditorFrame::onCmdDefOffset), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_OFFSET, GNETLSEditorFrame::onUpdNeedsDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_RENAME, GNETLSEditorFrame::onCmdDefRename), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SUBRENAME, GNETLSEditorFrame::onCmdDefSubRename), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_ADDOFF, GNETLSEditorFrame::onCmdDefAddOff), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_GUESSPROGRAM, GNETLSEditorFrame::onCmdGuess), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_CREATE, GNETLSEditorFrame::onCmdPhaseCreate), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_PHASE_CREATE, GNETLSEditorFrame::onUpdNeedsDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_DELETE, GNETLSEditorFrame::onCmdPhaseDelete), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_PHASE_DELETE, GNETLSEditorFrame::onUpdNeedsDefAndPhase), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_CLEANUP, GNETLSEditorFrame::onCmdCleanup), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_CLEANUP, GNETLSEditorFrame::onUpdNeedsSingleDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_ADDUNUSED, GNETLSEditorFrame::onCmdAddUnused), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_ADDUNUSED, GNETLSEditorFrame::onUpdNeedsDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_GROUP_STATES, GNETLSEditorFrame::onCmdGroupStates), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_GROUP_STATES, GNETLSEditorFrame::onUpdNeedsSingleDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_UNGROUP_STATES, GNETLSEditorFrame::onCmdUngroupStates), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_UNGROUP_STATES, GNETLSEditorFrame::onUpdUngroupStates), - FXMAPFUNC(SEL_SELECTED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), - FXMAPFUNC(SEL_DESELECTED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), - FXMAPFUNC(SEL_CHANGED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), - FXMAPFUNC(SEL_REPLACED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseEdit), -}; - -FXDEFMAP(GNETLSEditorFrame::TLSFile) TLSFileMap[] = { - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_LOAD_PROGRAM, GNETLSEditorFrame::TLSFile::onCmdLoadTLSProgram), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_LOAD_PROGRAM, GNETLSEditorFrame::TLSFile::onUpdNeedsDef), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SAVE_PROGRAM, GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_SAVE_PROGRAM, GNETLSEditorFrame::TLSFile::onUpdNeedsDef), -}; - -// Object implementation -FXIMPLEMENT(GNETLSEditorFrame, FXVerticalFrame, GNETLSEditorFrameMap, ARRAYNUMBER(GNETLSEditorFrameMap)) -FXIMPLEMENT(GNETLSEditorFrame::TLSFile, FXGroupBox, TLSFileMap, ARRAYNUMBER(TLSFileMap)) - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNETLSEditorFrame::GNETLSEditorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): - GNEFrame(horizontalFrameParent, viewNet, "Edit Traffic Light"), - myEditedDef(nullptr) { - - // Create Overlapped Inspection modul - myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this, SUMO_TAG_JUNCTION); - - // create TLSJunction modul - myTLSJunction = new GNETLSEditorFrame::TLSJunction(this); - - // create TLSDefinition modul - myTLSDefinition = new GNETLSEditorFrame::TLSDefinition(this); - - // create TLSAttributes modul - myTLSAttributes = new GNETLSEditorFrame::TLSAttributes(this); - - // create TLSModifications modul - myTLSModifications = new GNETLSEditorFrame::TLSModifications(this); - - // create TLSPhases modul - myTLSPhases = new GNETLSEditorFrame::TLSPhases(this); - - // create TLSFile modul - myTLSFile = new GNETLSEditorFrame::TLSFile(this); - - // "Add 'off' program" - /* - new FXButton(myContentFrame, "Add \"Off\"-Program\t\tAdds a program for switching off this traffic light", - 0, this, MID_GNE_TLSFRAME_ADDOFF, GUIDesignButton); - */ -} - - -GNETLSEditorFrame::~GNETLSEditorFrame() { - cleanup(); -} - - -void -GNETLSEditorFrame::show() { - // hide myOverlappedInspection - myOverlappedInspection->hideOverlappedInspection(); - GNEFrame::show(); -} - -void -GNETLSEditorFrame::editTLS(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // first check if in objectsUnderCursor there is a junction - if (objectsUnderCursor.getJunctionFront()) { - // show objects under cursor - myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition); - // hide if we inspect only one junction - if (myOverlappedInspection->getNumberOfOverlappedACs() == 1) { - myOverlappedInspection->hideOverlappedInspection(); - } - // set junction - editJunction(objectsUnderCursor.getJunctionFront()); - } else { - myViewNet->setStatusBarText("Click over a junction to edit a TLS"); - } -} - - -bool -GNETLSEditorFrame::isTLSSaved() { - if (myTLSModifications->checkHaveModifications()) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening question FXMessageBox 'save TLS'"); - // open question box - FXuint answer = FXMessageBox::question(this, MBOX_YES_NO_CANCEL, - "Save TLS Changes", "%s", - "There is unsaved changes in current edited traffic light.\nDo you want to save it before changing mode?"); - if (answer == MBOX_CLICKED_YES) { //1:yes, 2:no, 4:esc/cancel - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'YES'"); - // save modifications - onCmdOK(nullptr, 0, nullptr); - return true; - } else if (answer == MBOX_CLICKED_NO) { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'No'"); - // cancel modifications - onCmdCancel(nullptr, 0, nullptr); - return true; - } else { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'Cancel'"); - // abort changing mode - return false; - } - } else { - return true; - } -} - - -bool -GNETLSEditorFrame::parseTLSPrograms(const std::string& file) { - NBTrafficLightLogicCont& tllCont = myViewNet->getNet()->getTLLogicCont(); - NBTrafficLightLogicCont tmpTLLCont; - NIXMLTrafficLightsHandler tllHandler(tmpTLLCont, myViewNet->getNet()->getEdgeCont()); - // existing definitions must be available to update their programs - std::set origDefs; - for (NBTrafficLightDefinition* def : tllCont.getDefinitions()) { - // make a copy of every program - NBTrafficLightLogic* logic = tllCont.getLogic(def->getID(), def->getProgramID()); - if (logic != nullptr) { - NBTrafficLightDefinition* copy = new NBLoadedSUMOTLDef(def, logic); - std::vector nodes = def->getNodes(); - for (auto it_node : nodes) { - GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it_node->getID()); - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, def, false, false), true); - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, copy, true), true); - } - tmpTLLCont.insert(copy); - origDefs.insert(copy); - } else { - WRITE_WARNING("tlLogic '" + def->getID() + "', program '" + def->getProgramID() + "' could not be built"); - } - } - //std::cout << " initialized tmpCont with " << origDefs.size() << " defs\n"; - XMLSubSys::runParser(tllHandler, file); - - std::vector loadedTLS; - for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { - NBLoadedSUMOTLDef* sdef = dynamic_cast(def); - if (sdef != nullptr) { - loadedTLS.push_back(sdef); - } - } - myViewNet->setStatusBarText("Loaded " + toString(loadedTLS.size()) + " programs"); - for (auto def : loadedTLS) { - if (origDefs.count(def) != 0) { - // already add to undolist before - //std::cout << " skip " << def->getDescription() << "\n"; - continue; - } - std::vector nodes = def->getNodes(); - //std::cout << " add " << def->getDescription() << " for nodes=" << toString(nodes) << "\n"; - for (auto it_node : nodes) { - GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it_node->getID()); - //myViewNet->getUndoList()->add(new GNEChange_TLS(junction, myTLSEditorParent->myEditedDef, false), true); - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, def, true), true); - } - } - // clean up temporary container to avoid deletion of defs when it's destruct is called - for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { - tmpTLLCont.removeProgram(def->getID(), def->getProgramID(), false); - } - return true; -} - - -long -GNETLSEditorFrame::onCmdCancel(FXObject*, FXSelector, void*) { - if (myTLSJunction->getCurrentJunction() != nullptr) { - myViewNet->getUndoList()->p_abort(); - cleanup(); - myViewNet->update(); - } - return 1; -} - - -long -GNETLSEditorFrame::onCmdOK(FXObject*, FXSelector, void*) { - if (myTLSJunction->getCurrentJunction() != nullptr) { - if (myTLSModifications->checkHaveModifications()) { - NBTrafficLightDefinition* oldDefinition = myTLSAttributes->getCurrentTLSDefinition(); - std::vector nodes = oldDefinition->getNodes(); - for (auto it : nodes) { - GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it->getID()); - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, oldDefinition, false), true); - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, myEditedDef, true), true); - } - myEditedDef = nullptr; - myViewNet->getUndoList()->p_end(); - cleanup(); - myViewNet->update(); - } else { - onCmdCancel(nullptr, 0, nullptr); - } - } - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefCreate(FXObject*, FXSelector, void*) { - GNEJunction* junction = myTLSJunction->getCurrentJunction(); - // abort because we onCmdOk assumes we wish to save an edited definition - onCmdCancel(nullptr, 0, nullptr); - // check that current junction has two or more edges - if ((junction->getGNEIncomingEdges().size() > 0) && (junction->getGNEOutgoingEdges().size() > 0)) { - if (junction->getAttribute(SUMO_ATTR_TYPE) != toString(NODETYPE_TRAFFIC_LIGHT)) { - junction->setAttribute(SUMO_ATTR_TYPE, toString(NODETYPE_TRAFFIC_LIGHT), myViewNet->getUndoList()); - } else { - if (junction->getNBNode()->isTLControlled()) { - // use existing traffic light as template for type, signal groups, controlled nodes etc - NBTrafficLightDefinition* tpl = *junction->getNBNode()->getControllingTLS().begin(); - NBTrafficLightLogic* newLogic = tpl->compute(OptionsCont::getOptions()); - NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(tpl, newLogic); - delete newLogic; - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, newDef, true, true), true); - } else { - // for some reason the traffic light was not built, try again - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, nullptr, true, true), true); - } - } - editJunction(junction); - } else { - // write warning if netedit is running in testing mode - WRITE_DEBUG("Opening warning FXMessageBox 'invalid TLS'"); - // open question box - FXMessageBox::warning(this, MBOX_OK, - "TLS cannot be created", "%s", - "Traffic Light cannot be created because junction must have\n at least one incoming edge and one outgoing edge."); - // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'invalid TLS'"); - } - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefDelete(FXObject*, FXSelector, void*) { - GNEJunction* junction = myTLSJunction->getCurrentJunction(); - const bool changeType = myTLSAttributes->getNumberOfTLSDefinitions() == 1; - NBTrafficLightDefinition* tlDef = myTLSAttributes->getCurrentTLSDefinition(); - onCmdCancel(nullptr, 0, nullptr); // abort because onCmdOk assumes we wish to save an edited definition - if (changeType) { - junction->setAttribute(SUMO_ATTR_TYPE, toString(NODETYPE_PRIORITY), myViewNet->getUndoList()); - } else { - myViewNet->getUndoList()->add(new GNEChange_TLS(junction, tlDef, false), true); - } - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefSwitch(FXObject*, FXSelector, void*) { - assert(myTLSJunction->getCurrentJunction() != 0); - assert(myTLSAttributes->getNumberOfTLSDefinitions() == myTLSAttributes->getNumberOfPrograms()); - NBTrafficLightDefinition* tlDef = myTLSAttributes->getCurrentTLSDefinition(); - // logic may not have been recomputed yet. recompute to be sure - NBTrafficLightLogicCont& tllCont = myViewNet->getNet()->getTLLogicCont(); - myViewNet->getNet()->computeJunction(myTLSJunction->getCurrentJunction()); - NBTrafficLightLogic* tllogic = tllCont.getLogic(tlDef->getID(), tlDef->getProgramID()); - if (tllogic != nullptr) { - // now we can be sure that the tlDef is up to date (i.e. re-guessed) - buildIinternalLanes(tlDef); - // create working copy from original def - delete myEditedDef; - myEditedDef = new NBLoadedSUMOTLDef(tlDef, tllogic); - myTLSAttributes->setOffset(myEditedDef->getLogic()->getOffset()); - myTLSPhases->initPhaseTable(); - myTLSPhases->updateCycleDuration(); - myTLSPhases->showCycleDuration(); - } else { - // tlDef has no valid logic (probably because id does not control any links - onCmdCancel(nullptr, 0, nullptr); - myViewNet->setStatusBarText("Traffic light does not control any links"); - } - return 1; -} - - -long -GNETLSEditorFrame::onUpdDefSwitch(FXObject* o, FXSelector, void*) { - const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0 && !myTLSModifications->checkHaveModifications(); - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - - -long -GNETLSEditorFrame::onUpdNeedsDef(FXObject* o, FXSelector, void*) { - const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0; - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - - -long -GNETLSEditorFrame::onUpdNeedsDefAndPhase(FXObject* o, FXSelector, void*) { - // do not delete the last phase - const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0 && myTLSPhases->getPhaseTable()->getNumRows() > 1; - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - - -long -GNETLSEditorFrame::onUpdDefCreate(FXObject* o, FXSelector, void*) { - GNEJunction* junction = myTLSJunction->getCurrentJunction(); - const bool enable = junction != nullptr && !myTLSModifications->checkHaveModifications(); - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - const bool copy = junction != nullptr && junction->getNBNode()->isTLControlled(); - static_cast(o)->setText(copy ? "Copy" : "Create"); - return 1; -} - - -long -GNETLSEditorFrame::onUpdModified(FXObject* o, FXSelector, void*) { - bool enable = myTLSModifications->checkHaveModifications(); - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - - - -long -GNETLSEditorFrame::onCmdDefOffset(FXObject*, FXSelector, void*) { - myTLSModifications->setHaveModifications(true); - myEditedDef->setOffset(myTLSAttributes->getOffset()); - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefRename(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefSubRename(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNETLSEditorFrame::onCmdDefAddOff(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNETLSEditorFrame::onCmdGuess(FXObject*, FXSelector, void*) { - return 1; -} - - -long -GNETLSEditorFrame::onCmdPhaseSwitch(FXObject*, FXSelector, void*) { - const int index = myTLSPhases->getPhaseTable()->getCurrentRow(); - const NBTrafficLightLogic::PhaseDefinition& phase = getPhases()[index]; - myTLSPhases->getPhaseTable()->selectRow(index); - // need not hold since links could have been deleted somewhere else and indices may be reused - // assert(phase.state.size() == myInternalLanes.size()); - for (auto it : myInternalLanes) { - int tlIndex = it.first; - std::vector lanes = it.second; - LinkState state = LINKSTATE_DEADEND; - if (tlIndex >= 0 && tlIndex < (int)phase.state.size()) { - state = (LinkState)phase.state[tlIndex]; - } - for (auto it_lane : lanes) { - it_lane->setLinkState(state); - } - } - myViewNet->update(); - return 1; -} - - -bool -GNETLSEditorFrame::fixedDuration() const { - assert(myEditedDef != nullptr); - return myEditedDef->getType() == TLTYPE_STATIC; -} - - -void -GNETLSEditorFrame::selectedOverlappedElement(GNEAttributeCarrier* AC) { - editJunction(dynamic_cast(AC)); -} - - -long -GNETLSEditorFrame::onCmdPhaseCreate(FXObject*, FXSelector, void*) { - myTLSModifications->setHaveModifications(true); - // allows insertion at first position by deselecting via arrow keys - int newIndex = myTLSPhases->getPhaseTable()->getSelStartRow() + 1; - int oldIndex = MAX2(0, myTLSPhases->getPhaseTable()->getSelStartRow()); - // copy current row - SUMOTime duration = getSUMOTime(myTLSPhases->getPhaseTable()->getItemText(oldIndex, 0)); - std::string state = myTLSPhases->getPhaseTable()->getItemText(oldIndex, fixedDuration() ? 1 : 3).text(); - - std::set crossingIndices; - for (NBNode* n : myEditedDef->getNodes()) { - for (NBNode::Crossing* c : n->getCrossings()) { - crossingIndices.insert(c->tlLinkIndex); - crossingIndices.insert(c->tlLinkIndex2); - } - } - - // smart adapations for new state - bool haveGreen = false; - bool haveYellow = false; - for (char c : state) { - if (c == LINKSTATE_TL_GREEN_MAJOR || c == LINKSTATE_TL_GREEN_MINOR) { - haveGreen = true; - } else if (c == LINKSTATE_TL_YELLOW_MAJOR || c == LINKSTATE_TL_YELLOW_MINOR) { - haveYellow = true; - } - } - const OptionsCont& oc = OptionsCont::getOptions(); - if (haveGreen && haveYellow) { - // guess left-mover state - duration = TIME2STEPS(oc.getInt("tls.left-green.time")); - for (int i = 0; i < (int)state.size(); i++) { - if (state[i] == LINKSTATE_TL_YELLOW_MAJOR || state[i] == LINKSTATE_TL_YELLOW_MINOR) { - state[i] = LINKSTATE_TL_RED; - } else if (state[i] == LINKSTATE_TL_GREEN_MINOR) { - state[i] = LINKSTATE_TL_GREEN_MAJOR; - } - } - } else if (haveGreen) { - // guess yellow state - myEditedDef->setParticipantsInformation(); - duration = TIME2STEPS(myEditedDef->computeBrakingTime(oc.getFloat("tls.yellow.min-decel"))); - for (int i = 0; i < (int)state.size(); i++) { - if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { - if (crossingIndices.count(i) == 0) { - state[i] = LINKSTATE_TL_YELLOW_MINOR; - } else { - state[i] = LINKSTATE_TL_RED; - } - } - } - } else if (haveYellow) { - duration = TIME2STEPS(oc.isDefault("tls.allred.time") ? 2 : oc.getInt("tls.allred.time")); - // guess all-red state - for (int i = 0; i < (int)state.size(); i++) { - if (state[i] == LINKSTATE_TL_YELLOW_MAJOR || state[i] == LINKSTATE_TL_YELLOW_MINOR) { - state[i] = LINKSTATE_TL_RED; - } - } - } - - myEditedDef->getLogic()->addStep(duration, state, std::vector(), "", newIndex); - myTLSPhases->getPhaseTable()->setCurrentItem(newIndex, 0); - myTLSPhases->initPhaseTable(newIndex); - myTLSPhases->getPhaseTable()->setFocus(); - return 1; -} - - -long -GNETLSEditorFrame::onCmdPhaseDelete(FXObject*, FXSelector, void*) { - myTLSModifications->setHaveModifications(true); - const int newRow = MAX2((int)0, (int)myTLSPhases->getPhaseTable()->getCurrentRow() - 1); - myEditedDef->getLogic()->deletePhase(myTLSPhases->getPhaseTable()->getCurrentRow()); - myTLSPhases->initPhaseTable(newRow); - myTLSPhases->getPhaseTable()->setFocus(); - return 1; -} - - -long -GNETLSEditorFrame::onCmdCleanup(FXObject*, FXSelector, void*) { - myTLSModifications->setHaveModifications(myEditedDef->cleanupStates()); - buildIinternalLanes(myEditedDef); - myTLSPhases->initPhaseTable(0); - myTLSPhases->getPhaseTable()->setFocus(); - myTLSModifications->setHaveModifications(true); - return 1; -} - - -long -GNETLSEditorFrame::onCmdAddUnused(FXObject*, FXSelector, void*) { - myEditedDef->getLogic()->setStateLength( - myEditedDef->getLogic()->getNumLinks() + 1); - myTLSModifications->setHaveModifications(true); - myTLSPhases->initPhaseTable(0); - myTLSPhases->getPhaseTable()->setFocus(); - return 1; -} - - -long -GNETLSEditorFrame::onCmdGroupStates(FXObject*, FXSelector, void*) { - myEditedDef->groupSignals(); - myTLSModifications->setHaveModifications(true); - buildIinternalLanes(myEditedDef); - myTLSPhases->initPhaseTable(0); - myTLSPhases->getPhaseTable()->setFocus(); - return 1; -} - - -long -GNETLSEditorFrame::onCmdUngroupStates(FXObject*, FXSelector, void*) { - myEditedDef->setParticipantsInformation(); - myEditedDef->ungroupSignals(); - myTLSModifications->setHaveModifications(true); - buildIinternalLanes(myEditedDef); - myTLSPhases->initPhaseTable(0); - myTLSPhases->getPhaseTable()->setFocus(); - return 1; -} - - -long -GNETLSEditorFrame::onUpdNeedsSingleDef(FXObject* o, FXSelector, void*) { - const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() == 1; - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - -long -GNETLSEditorFrame::onUpdUngroupStates(FXObject* o, FXSelector, void*) { - const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() == 1 && myEditedDef != nullptr && myEditedDef->usingSignalGroups(); - o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); - return 1; -} - -long -GNETLSEditorFrame::onCmdPhaseEdit(FXObject*, FXSelector, void* ptr) { - /* @note: there is a bug when copying/pasting rows: when this handler is - * called the value of the cell is not yet updated. This means you have to - * click inside the cell and hit enter to actually update the value */ - FXTablePos* tp = (FXTablePos*)ptr; - FXString value = myTLSPhases->getPhaseTable()->getItemText(tp->row, tp->col); - const int colDuration = 0; - const int colMinDur = fixedDuration() ? -1 : 1; - const int colMaxDur = fixedDuration() ? -1 : 2; - const int colState = fixedDuration() ? 1 : 3; - const int colNext = fixedDuration() ? 2 : 4; - const int colName = fixedDuration() ? 3 : 5; - - if (tp->col == colDuration) { - // duration edited - if (GNEAttributeCarrier::canParse(value.text())) { - SUMOTime duration = getSUMOTime(value); - if (duration > 0) { - myEditedDef->getLogic()->setPhaseDuration(tp->row, duration); - myTLSModifications->setHaveModifications(true); - myTLSPhases->updateCycleDuration(); - return 1; - } - } - // input error, reset value - myTLSPhases->getPhaseTable()->setItemText(tp->row, colDuration, toString(STEPS2TIME(getPhases()[tp->row].duration)).c_str()); - } else if (tp->col == colMinDur) { - // minDur edited - if (GNEAttributeCarrier::canParse(value.text())) { - SUMOTime minDur = getSUMOTime(value); - if (minDur > 0) { - myEditedDef->getLogic()->setPhaseMinDuration(tp->row, minDur); - myTLSModifications->setHaveModifications(true); - return 1; - } - } else if (StringUtils::prune(value.text()).empty()) { - myEditedDef->getLogic()->setPhaseMinDuration(tp->row, NBTrafficLightDefinition::UNSPECIFIED_DURATION); - myTLSModifications->setHaveModifications(true); - return 1; - } - // input error, reset value - myTLSPhases->getPhaseTable()->setItemText(tp->row, colMinDur, varDurString(getPhases()[tp->row].minDur).c_str()); - } else if (tp->col == colMaxDur) { - // maxDur edited - if (GNEAttributeCarrier::canParse(value.text())) { - SUMOTime maxDur = getSUMOTime(value); - if (maxDur > 0) { - myEditedDef->getLogic()->setPhaseMaxDuration(tp->row, maxDur); - myTLSModifications->setHaveModifications(true); - return 1; - } - } else if (StringUtils::prune(value.text()).empty()) { - myEditedDef->getLogic()->setPhaseMaxDuration(tp->row, NBTrafficLightDefinition::UNSPECIFIED_DURATION); - myTLSModifications->setHaveModifications(true); - return 1; - } - // input error, reset value - myTLSPhases->getPhaseTable()->setItemText(tp->row, colMaxDur, varDurString(getPhases()[tp->row].maxDur).c_str()); - } else if (tp->col == colState) { - // state edited - try { - // insert phase with new step and delete the old phase - const NBTrafficLightLogic::PhaseDefinition& phase = getPhases()[tp->row]; - myEditedDef->getLogic()->addStep(phase.duration, value.text(), phase.next, phase.name, tp->row); - myEditedDef->getLogic()->deletePhase(tp->row + 1); - myTLSModifications->setHaveModifications(true); - onCmdPhaseSwitch(nullptr, 0, nullptr); - } catch (ProcessError&) { - // input error, reset value - myTLSPhases->getPhaseTable()->setItemText(tp->row, colState, getPhases()[tp->row].state.c_str()); - } - } else if (tp->col == colNext) { - // next edited - bool ok = true; - if (GNEAttributeCarrier::canParse >(value.text())) { - std::vector nextEdited = GNEAttributeCarrier::parse >(value.text()); - for (int n : nextEdited) { - if (n < 0 || n >= myTLSPhases->getPhaseTable()->getNumRows()) { - ok = false; - break; - } - } - if (ok) { - myEditedDef->getLogic()->setPhaseNext(tp->row, nextEdited); - myTLSModifications->setHaveModifications(true); - return 1; - } - } - // input error, reset value - myTLSPhases->getPhaseTable()->setItemText(tp->row, colNext, ""); - } else if (tp->col == colName) { - // name edited - myEditedDef->getLogic()->setPhaseName(tp->row, value.text()); - myTLSModifications->setHaveModifications(true); - return 1; - } - return 1; -} - - -void -GNETLSEditorFrame::cleanup() { - if (myTLSJunction->getCurrentJunction()) { - myTLSJunction->getCurrentJunction()->selectTLS(false); - if (myTLSAttributes->getNumberOfTLSDefinitions() > 0) { - for (NBNode* node : myTLSAttributes->getCurrentTLSDefinition()->getNodes()) { - myViewNet->getNet()->retrieveJunction(node->getID())->selectTLS(false); - } - } - } - // clean data structures - myTLSJunction->setCurrentJunction(nullptr); - myTLSModifications->setHaveModifications(false); - delete myEditedDef; - myEditedDef = nullptr; - buildIinternalLanes(nullptr); // only clears - // clean up controls - myTLSAttributes->clearTLSAttributes(); - myTLSPhases->initPhaseTable(); // only clears when there are no definitions - myTLSPhases->hideCycleDuration(); - myTLSJunction->updateJunctionDescription(); -} - - -void -GNETLSEditorFrame::buildIinternalLanes(NBTrafficLightDefinition* tlDef) { - SUMORTree& rtree = myViewNet->getNet()->getVisualisationSpeedUp(); - // clean up previous objects - for (auto it : myInternalLanes) { - for (auto it_intLanes : it.second) { - rtree.removeAdditionalGLObject(it_intLanes); - delete it_intLanes; - } - } - myInternalLanes.clear(); - // create new internal lanes - if (tlDef != nullptr) { - const int NUM_POINTS = 10; - assert(myTLSJunction->getCurrentJunction()); - NBNode* nbnCurrentJunction = myTLSJunction->getCurrentJunction()->getNBNode(); - std::string innerID = ":" + nbnCurrentJunction->getID(); // see NWWriter_SUMO::writeInternalEdges - const NBConnectionVector& links = tlDef->getControlledLinks(); - for (auto it : links) { - int tlIndex = it.getTLIndex(); - PositionVector shape = it.getFrom()->getToNode()->computeInternalLaneShape(it.getFrom(), NBEdge::Connection(it.getFromLane(), - it.getTo(), it.getToLane()), NUM_POINTS); - if (shape.length() < 2) { - // enlarge shape to ensure visibility - shape.clear(); - PositionVector laneShapeFrom = it.getFrom()->getLaneShape(it.getFromLane()); - PositionVector laneShapeTo = it.getTo()->getLaneShape(it.getToLane()); - shape.push_back(laneShapeFrom.positionAtOffset(MAX2(0.0, laneShapeFrom.length() - 1))); - shape.push_back(laneShapeTo.positionAtOffset(MIN2(1.0, laneShapeFrom.length()))); - } - GNEInternalLane* ilane = new GNEInternalLane(this, innerID + '_' + toString(tlIndex), shape, tlIndex); - rtree.addAdditionalGLObject(ilane); - myInternalLanes[tlIndex].push_back(ilane); - } - for (NBNode* nbn : tlDef->getNodes()) { - for (auto c : nbn->getCrossings()) { - if (c->tlLinkIndex2 > 0 && c->tlLinkIndex2 != c->tlLinkIndex) { - // draw both directions - PositionVector forward = c->shape; - forward.move2side(c->width / 4); - GNEInternalLane* ilane = new GNEInternalLane(this, c->id, forward, c->tlLinkIndex); - rtree.addAdditionalGLObject(ilane); - myInternalLanes[c->tlLinkIndex].push_back(ilane); - - PositionVector backward = c->shape.reverse(); - backward.move2side(c->width / 4); - GNEInternalLane* ilane2 = new GNEInternalLane(this, c->id + "_r", backward, c->tlLinkIndex2); - rtree.addAdditionalGLObject(ilane2); - myInternalLanes[c->tlLinkIndex2].push_back(ilane2); - } else { - // draw only one lane for both directions - GNEInternalLane* ilane = new GNEInternalLane(this, c->id, c->shape, c->tlLinkIndex); - rtree.addAdditionalGLObject(ilane); - myInternalLanes[c->tlLinkIndex].push_back(ilane); - } - } - } - } -} - - -std::string -GNETLSEditorFrame::varDurString(SUMOTime dur) { - return dur == NBTrafficLightDefinition::UNSPECIFIED_DURATION ? " " : toString(STEPS2TIME(dur)); -} - - -const std::vector& -GNETLSEditorFrame::getPhases() { - return myEditedDef->getLogic()->getPhases(); -} - - -void -GNETLSEditorFrame::handleChange(GNEInternalLane* lane) { - myTLSModifications->setHaveModifications(true); - if (myViewNet->changeAllPhases()) { - const std::vector& phases = getPhases(); - for (int row = 0; row < (int)phases.size(); row++) { - myEditedDef->getLogic()->setPhaseState(row, lane->getTLIndex(), lane->getLinkState()); - } - } else { - myEditedDef->getLogic()->setPhaseState(myTLSPhases->getPhaseTable()->getCurrentRow(), lane->getTLIndex(), lane->getLinkState()); - } - myTLSPhases->initPhaseTable(myTLSPhases->getPhaseTable()->getCurrentRow()); - myTLSPhases->getPhaseTable()->setFocus(); -} - - -void -GNETLSEditorFrame::handleMultiChange(GNELane* lane, FXObject* obj, FXSelector sel, void* eventData) { - if (myEditedDef != nullptr) { - myTLSModifications->setHaveModifications(true); - const NBConnectionVector& links = myEditedDef->getControlledLinks(); - std::set fromIDs; - fromIDs.insert(lane->getMicrosimID()); - // if neither the lane nor its edge are selected, apply changes to the whole edge - if (!lane->getParentEdge()->isAttributeCarrierSelected() && !lane->isAttributeCarrierSelected()) { - for (auto it_lane : lane->getParentEdge()->getLanes()) { - fromIDs.insert(it_lane->getMicrosimID()); - } - } else { - // if the edge is selected, apply changes to all lanes of all selected edges - if (lane->getParentEdge()->isAttributeCarrierSelected()) { - std::vector edges = myViewNet->getNet()->retrieveEdges(true); - for (auto it : edges) { - for (auto it_lane : it->getLanes()) { - fromIDs.insert(it_lane->getMicrosimID()); - } - } - } - // if the lane is selected, apply changes to all selected lanes - if (lane->isAttributeCarrierSelected()) { - std::vector lanes = myViewNet->getNet()->retrieveLanes(true); - for (auto it_lane : lanes) { - fromIDs.insert(it_lane->getMicrosimID()); - } - } - - } - // set new state for all connections from the chosen lane IDs - for (auto it : links) { - if (fromIDs.count(it.getFrom()->getLaneID(it.getFromLane())) > 0) { - std::vector lanes = myInternalLanes[it.getTLIndex()]; - for (auto it_lane : lanes) { - it_lane->onDefault(obj, sel, eventData); - } - } - } - } -} - - -bool -GNETLSEditorFrame::controlsEdge(GNEEdge* edge) const { - if (myEditedDef != nullptr) { - const NBConnectionVector& links = myEditedDef->getControlledLinks(); - for (auto it : links) { - if (it.getFrom()->getID() == edge->getMicrosimID()) { - return true; - } - } - } - return false; -} - - -void -GNETLSEditorFrame::editJunction(GNEJunction* junction) { - if ((myTLSJunction->getCurrentJunction() == nullptr) || (!myTLSModifications->checkHaveModifications() && (junction != myTLSJunction->getCurrentJunction()))) { - onCmdCancel(nullptr, 0, nullptr); - myViewNet->getUndoList()->p_begin("modifying traffic light definition"); - myTLSJunction->setCurrentJunction(junction); - myTLSAttributes->initTLSAttributes(myTLSJunction->getCurrentJunction()); - myTLSJunction->updateJunctionDescription(); - // only select TLS if getCurrentJunction exist - if (myTLSJunction->getCurrentJunction()) { - myTLSJunction->getCurrentJunction()->selectTLS(true); - } - if (myTLSAttributes->getNumberOfTLSDefinitions() > 0) { - for (NBNode* node : myTLSAttributes->getCurrentTLSDefinition()->getNodes()) { - myViewNet->getNet()->retrieveJunction(node->getID())->selectTLS(true); - } - } - } else { - myViewNet->setStatusBarText("Unsaved modifications. Abort or Save"); - } -} - - -SUMOTime -GNETLSEditorFrame::getSUMOTime(const FXString& string) { - return TIME2STEPS(GNEAttributeCarrier::parse(string.text())); -} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSAttributes - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSAttributes::TLSAttributes(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Traffic light Attributes", GUIDesignGroupBoxFrame), - myTLSEditorParent(TLSEditorParent) { - - // create frame, label and textfield for name (By default disabled) - FXHorizontalFrame* nameFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myNameLabel = new FXLabel(nameFrame, "ID", 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); - myProgramLabel = 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); - myOffsetLabel = new FXLabel(offsetFrame, "Offset", nullptr, GUIDesignLabelAttribute); - myOffsetTextField = new FXTextField(offsetFrame, GUIDesignTextFieldNCol, myTLSEditorParent, MID_GNE_TLSFRAME_OFFSET, GUIDesignTextField); - myOffsetTextField->disable(); -} - - -GNETLSEditorFrame::TLSAttributes::~TLSAttributes() {} - - -void -GNETLSEditorFrame::TLSAttributes::initTLSAttributes(GNEJunction* junction) { - assert(junction); - myTLSDefinitions.clear(); - // enable name TextField - myNameTextField->enable(); - // enable Offset - myOffsetTextField->enable(); - // obtain TLSs - for (auto it : junction->getNBNode()->getControllingTLS()) { - myTLSDefinitions.push_back(it); - myNameTextField->setText(it->getID().c_str()); - myNameTextField->enable(); - myProgramComboBox->appendItem(it->getProgramID().c_str()); - } - if (myTLSDefinitions.size() > 0) { - myProgramComboBox->enable(); - myProgramComboBox->setCurrentItem(0); - myProgramComboBox->setNumVisible(myProgramComboBox->getNumItems()); - myTLSEditorParent->onCmdDefSwitch(nullptr, 0, nullptr); - } -} - - -void -GNETLSEditorFrame::TLSAttributes::clearTLSAttributes() { - // clear definitions - myTLSDefinitions.clear(); - // clear and disable name TextField - myNameTextField->setText(""); - myNameTextField->disable(); - // clear and disable myProgramComboBox - myProgramComboBox->clearItems(); - myProgramComboBox->disable(); - // clear and disable Offset TextField - myOffsetTextField->setText(""); - myOffsetTextField->disable(); -} - - -NBTrafficLightDefinition* -GNETLSEditorFrame::TLSAttributes::getCurrentTLSDefinition() const { - return myTLSDefinitions.at(myProgramComboBox->getCurrentItem()); -} - - -int -GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions() const { - return (int)myTLSDefinitions.size(); -} - - -int -GNETLSEditorFrame::TLSAttributes::getNumberOfPrograms() const { - return myProgramComboBox->getNumItems(); -} - - -SUMOTime -GNETLSEditorFrame::TLSAttributes::getOffset() const { - return getSUMOTime(myOffsetTextField->getText()); -} - - -void -GNETLSEditorFrame::TLSAttributes::setOffset(SUMOTime offset) { - myOffsetTextField->setText(toString(STEPS2TIME(offset)).c_str()); -} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSJunction - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSJunction::TLSJunction(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame), - myTLSEditorParent(TLSEditorParent), - myCurrentJunction(nullptr) { - // Create frame for junction ID - FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - myLabelJunctionID = new FXLabel(junctionIDFrame, "Junction ID", nullptr, GUIDesignLabelAttribute); - myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_TLSFRAME_SELECT_JUNCTION, GUIDesignTextField); - myTextFieldJunctionID->setEditable(false); - // update junction description after creation - updateJunctionDescription(); - // show TLS Junction - show(); -} - - -GNETLSEditorFrame::TLSJunction::~TLSJunction() {} - - -GNEJunction* -GNETLSEditorFrame::TLSJunction::getCurrentJunction() const { - return myCurrentJunction; -} - - -void -GNETLSEditorFrame::TLSJunction::setCurrentJunction(GNEJunction* junction) { - myCurrentJunction = junction; -} - - -void -GNETLSEditorFrame::TLSJunction::updateJunctionDescription() const { - if (myCurrentJunction == nullptr) { - myTextFieldJunctionID->setText(""); - } else { - NBNode* nbn = myCurrentJunction->getNBNode(); - myTextFieldJunctionID->setText(nbn->getID().c_str()); - } -} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSDefinition - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSDefinition::TLSDefinition(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Traffic Light Programs", GUIDesignGroupBoxFrame) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - // create create tlDef button - myNewTLProgram = new FXButton(buttonsFrame, "Create\t\tCreate a new traffic light program", - GUIIconSubSys::getIcon(ICON_MODETLS), TLSEditorParent, MID_GNE_TLSFRAME_CREATE, GUIDesignButton); - // create delete tlDef button - myDeleteTLProgram = new FXButton(buttonsFrame, "Delete\t\tDelete a traffic light program. If all programs are deleted the junction turns into a priority junction.", - GUIIconSubSys::getIcon(ICON_REMOVE), TLSEditorParent, MID_GNE_TLSFRAME_DELETE, GUIDesignButton); - // show TLS TLSDefinition - show(); -} - - -GNETLSEditorFrame::TLSDefinition::~TLSDefinition() {} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSPhases - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSPhases::TLSPhases(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Phases", GUIDesignGroupBoxFrame), - myTLSEditorParent(TLSEditorParent), - myTableFont(new FXFont(getApp(), "Courier New", 9)) { - - // create and configure phase table - myTableScroll = new FXScrollWindow(this, 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); - myPhaseTable->setRowHeaderMode(LAYOUT_FIX_WIDTH); - myPhaseTable->setRowHeaderWidth(0); - myPhaseTable->hide(); - myPhaseTable->setFont(myTableFont); - myPhaseTable->setHelpText("phase duration in seconds | phase state"); - - // create total duration info label - myCycleDuration = new FXLabel(this, "", 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); - - FXHorizontalFrame* phaseButtons = new FXHorizontalFrame(this, 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 - - // create new phase button - myInsertDuplicateButton = new FXButton(col1, "Insert Phase\t\tInsert new phase after the selected phase. The new state is deduced from the selected phase.", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_PHASE_CREATE, GUIDesignButton); - // create delete phase button - myDeleteSelectedPhaseButton = new FXButton(col2, "Delete Phase\t\tDelete selected phase", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_PHASE_DELETE, GUIDesignButton); - - // create cleanup states button - new FXButton(col1, "Clean States\t\tClean unused states from all phase. (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_CLEANUP, GUIDesignButton); - - // add unused states button - new FXButton(col2, "Add States\t\tExtend the state vector for all phases by one entry (unused until a connection or crossing is assigned to the new index).", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_ADDUNUSED, GUIDesignButton); - - // group states button - new FXButton(col1, "Group Signals\t\tShorten state definition by letting connections with the same signal states use the same index. (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_GROUP_STATES, GUIDesignButton); - - // ungroup states button - new FXButton(col2, "Ungroup Signals\t\tLet every connection use a distinct index (reverse state grouping). (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_UNGROUP_STATES, GUIDesignButton); - // show TLSFile - show(); -} - - -GNETLSEditorFrame::TLSPhases::~TLSPhases() { - delete myTableFont; -} - - -FXTable* -GNETLSEditorFrame::TLSPhases::getPhaseTable() const { - return myPhaseTable; -} - - -void -GNETLSEditorFrame::TLSPhases::initPhaseTable(int index) { - myPhaseTable->setVisibleRows(1); - myPhaseTable->setVisibleColumns(2); - myPhaseTable->hide(); - if (myTLSEditorParent->myTLSAttributes->getNumberOfTLSDefinitions() > 0) { - const bool fixed = myTLSEditorParent->fixedDuration(); - const int cols = fixed ? 4 : 6; - const int colDuration = 0; - const int colMinDur = fixed ? -1 : 1; - const int colMaxDur = fixed ? -1 : 2; - const int colState = fixed ? 1 : 3; - const int colNext = fixed ? 2 : 4; - const int colName = fixed ? 3 : 5; - - const std::vector& phases = myTLSEditorParent->getPhases(); - myPhaseTable->setTableSize((int)phases.size(), cols); - myPhaseTable->setVisibleRows((int)phases.size()); - myPhaseTable->setVisibleColumns(cols); - for (int row = 0; row < (int)phases.size(); row++) { - myPhaseTable->setItemText(row, colDuration, toString(STEPS2TIME(phases[row].duration)).c_str()); - if (!fixed) { - myPhaseTable->setItemText(row, colMinDur, varDurString(phases[row].minDur).c_str()); - myPhaseTable->setItemText(row, colMaxDur, varDurString(phases[row].maxDur).c_str()); - } - myPhaseTable->setItemText(row, colState, phases[row].state.c_str()); - myPhaseTable->setItemText(row, colNext, phases[row].next.size() > 0 ? toString(phases[row].next).c_str() : " "); - myPhaseTable->setItemText(row, colName, phases[row].name.c_str()); - myPhaseTable->getItem(row, 1)->setJustify(FXTableItem::LEFT); - } - myPhaseTable->fitColumnsToContents(0, cols); - myPhaseTable->setColumnText(colDuration, "dur"); - if (colMinDur >= 0) { - myPhaseTable->setColumnText(colMinDur, "min"); - myPhaseTable->setColumnText(colMaxDur, "max"); - myPhaseTable->setColumnWidth(colMinDur, MAX2(myPhaseTable->getColumnWidth(colMinDur), 30)); - myPhaseTable->setColumnWidth(colMaxDur, MAX2(myPhaseTable->getColumnWidth(colMaxDur), 35)); - } - myPhaseTable->setColumnText(colState, "state"); - myPhaseTable->setColumnText(colNext, "nxt"); - myPhaseTable->setColumnText(colName, "name"); - myPhaseTable->setColumnWidth(colNext, MAX2(myPhaseTable->getColumnWidth(colNext), 30)); - myPhaseTable->setColumnWidth(colName, MAX2(myPhaseTable->getColumnWidth(colName), 45)); - - myPhaseTable->setHeight((int)phases.size() * 21 + 21); // experimental - myPhaseTable->setCurrentItem(index, 0); - myPhaseTable->selectRow(index, true); - myPhaseTable->show(); - myPhaseTable->setFocus(); - myTableScroll->setHeight(myPhaseTable->getHeight() + 15); - - // neither my myPhaseTable->getWidth nor getDefaultWidth return the sum of column widths - // however, the scroll pane uses getDefaultWidth to determine the - // horizontal scrolling area which can only be changed via - // getDefColumnWidth, hence the baroque work-around - - int neededWidth = 0; - for (int i = 0; i < cols; i++) { - neededWidth += myPhaseTable->getColumnWidth(i); - } - myPhaseTable->setDefColumnWidth(neededWidth / cols); - } - update(); -} - - -void -GNETLSEditorFrame::TLSPhases::showCycleDuration() { - myCycleDuration->show(); -} - - -void -GNETLSEditorFrame::TLSPhases::hideCycleDuration() { - myCycleDuration->hide(); -} - -void -GNETLSEditorFrame::TLSPhases::updateCycleDuration() { - SUMOTime cycleDuration = 0; - for (auto it : myTLSEditorParent->getPhases()) { - cycleDuration += it.duration; - } - std::string text = "Cycle time: " + toString(STEPS2TIME(cycleDuration)); - myCycleDuration->setText(text.c_str()); -} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSModifications - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSModifications::TLSModifications(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), - myTLSEditorParent(TLSEditorParent), - myHaveModifications(false) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - // create save modifications button - mySaveModificationsButtons = new FXButton(buttonsFrame, "Save\t\tSave program modifications (Enter)", - GUIIconSubSys::getIcon(ICON_OK), myTLSEditorParent, MID_OK, GUIDesignButton); - // create discard modifications buttons - myDiscardModificationsButtons = new FXButton(buttonsFrame, "Cancel\t\tDiscard program modifications (Esc)", - GUIIconSubSys::getIcon(ICON_CANCEL), myTLSEditorParent, MID_CANCEL, GUIDesignButton); - // show TLSModifications - show(); -} - - -GNETLSEditorFrame::TLSModifications::~TLSModifications() {} - - -bool -GNETLSEditorFrame::TLSModifications::checkHaveModifications() const { - return myHaveModifications; -} - - -void -GNETLSEditorFrame::TLSModifications::setHaveModifications(bool value) { - myHaveModifications = value; -} - -// --------------------------------------------------------------------------- -// GNETLSEditorFrame::TLSFile - methods -// --------------------------------------------------------------------------- - -GNETLSEditorFrame::TLSFile::TLSFile(GNETLSEditorFrame* TLSEditorParent) : - FXGroupBox(TLSEditorParent->myContentFrame, "TLS Program File", GUIDesignGroupBoxFrame), - myTLSEditorParent(TLSEditorParent) { - FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); - // create create tlDef button - myLoadTLSProgramButton = new FXButton(buttonsFrame, "Load\t\tLoad TLS program from additional file", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_GNE_TLSFRAME_LOAD_PROGRAM, GUIDesignButton); - // create create tlDef button - mySaveTLSProgramButton = new FXButton(buttonsFrame, "Save\t\tSave TLS program to additional file", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_GNE_TLSFRAME_SAVE_PROGRAM, GUIDesignButton); - // show TLSFile - show(); -} - - -GNETLSEditorFrame::TLSFile::~TLSFile() {} - - -long -GNETLSEditorFrame::TLSFile::onCmdLoadTLSProgram(FXObject*, FXSelector, void*) { - FXFileDialog opendialog(this, "Load TLS Program"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODETLS)); - opendialog.setSelectMode(SELECTFILE_EXISTING); - opendialog.setPatternList("*.xml"); - if (gCurrentFolder.length() != 0) { - opendialog.setDirectory(gCurrentFolder); - } - if (opendialog.execute()) { - // run parser - NBTrafficLightLogicCont tmpTLLCont; - NIXMLTrafficLightsHandler tllHandler(tmpTLLCont, myTLSEditorParent->myViewNet->getNet()->getEdgeCont(), true); - tmpTLLCont.insert(myTLSEditorParent->myEditedDef); - XMLSubSys::runParser(tllHandler, opendialog.getFilename().text()); - - NBLoadedSUMOTLDef* newDefSameProgram = nullptr; - std::set newDefsOtherProgram; - for (auto item : tmpTLLCont.getPrograms(myTLSEditorParent->myEditedDef->getID())) { - if (item.second != myTLSEditorParent->myEditedDef) { - NBLoadedSUMOTLDef* sdef = dynamic_cast(item.second); - if (item.first == myTLSEditorParent->myEditedDef->getProgramID()) { - newDefSameProgram = sdef; - } else { - newDefsOtherProgram.insert(sdef); - } - } - } - const int newPrograms = (int)newDefsOtherProgram.size(); - if (newPrograms > 0 || newDefSameProgram != nullptr) { - std::vector nodes = myTLSEditorParent->myEditedDef->getNodes(); - for (auto newProg : newDefsOtherProgram) { - for (auto it_node : nodes) { - GNEJunction* junction = myTLSEditorParent->getViewNet()->getNet()->retrieveJunction(it_node->getID()); - myTLSEditorParent->getViewNet()->getUndoList()->add(new GNEChange_TLS(junction, newProg, true), true); - } - } - if (newPrograms > 0) { - WRITE_MESSAGE("Loaded " + toString(newPrograms) + " new programs for tlLogic '" + myTLSEditorParent->myEditedDef->getID() + "'"); - } - if (newDefSameProgram != nullptr) { - // replace old program when loading the same program ID - myTLSEditorParent->myEditedDef = newDefSameProgram; - WRITE_MESSAGE("Updated program '" + newDefSameProgram->getProgramID() + "' for tlLogic '" + myTLSEditorParent->myEditedDef->getID() + "'"); - } - } else { - myTLSEditorParent->getViewNet()->setStatusBarText("No programs found for traffic light '" + myTLSEditorParent->myEditedDef->getID() + "'"); - } - - // clean up temporary container to avoid deletion of defs when it's destruct is called - for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { - tmpTLLCont.removeProgram(def->getID(), def->getProgramID(), false); - } - - myTLSEditorParent->myTLSPhases->initPhaseTable(); - myTLSEditorParent->myTLSModifications->setHaveModifications(true); - } - return 0; -} - - -long -GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write(this, - "Save TLS Program as", ".xml", - GUIIconSubSys::getIcon(ICON_MODETLS), - gCurrentFolder); - if (file == "") { - return 1; - } - OutputDevice& device = OutputDevice::getDevice(file.text()); - - // save program - device.writeXMLHeader("additional", "additional_file.xsd"); - device.openTag(SUMO_TAG_TLLOGIC); - device.writeAttr(SUMO_ATTR_ID, myTLSEditorParent->myEditedDef->getLogic()->getID()); - device.writeAttr(SUMO_ATTR_TYPE, myTLSEditorParent->myEditedDef->getLogic()->getType()); - device.writeAttr(SUMO_ATTR_PROGRAMID, myTLSEditorParent->myEditedDef->getLogic()->getProgramID()); - device.writeAttr(SUMO_ATTR_OFFSET, writeSUMOTime(myTLSEditorParent->myEditedDef->getLogic()->getOffset())); - // write the phases - const bool varPhaseLength = myTLSEditorParent->myEditedDef->getLogic()->getType() != TLTYPE_STATIC; - const std::vector& phases = myTLSEditorParent->myEditedDef->getLogic()->getPhases(); - for (auto j : phases) { - device.openTag(SUMO_TAG_PHASE); - device.writeAttr(SUMO_ATTR_DURATION, writeSUMOTime(j.duration)); - device.writeAttr(SUMO_ATTR_STATE, j.state); - if (varPhaseLength) { - if (j.minDur != NBTrafficLightDefinition::UNSPECIFIED_DURATION) { - device.writeAttr(SUMO_ATTR_MINDURATION, writeSUMOTime(j.minDur)); - } - if (j.maxDur != NBTrafficLightDefinition::UNSPECIFIED_DURATION) { - device.writeAttr(SUMO_ATTR_MAXDURATION, writeSUMOTime(j.maxDur)); - } - } - device.closeTag(); - } - device.close(); - return 1; -} - - -std::string -GNETLSEditorFrame::TLSFile::writeSUMOTime(SUMOTime steps) { - double time = STEPS2TIME(steps); - if (time == std::floor(time)) { - return toString(int(time)); - } else { - return toString(time); - } -} - -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); - return 1; -} -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNETLSEditorFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,483 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNETLSEditorFrame.h -/// @author Jakob Erdmann -/// @date May 2011 -/// -// The Widget for modifying traffic lights -/****************************************************************************/ -#ifndef GNETLSEditorFrame_h -#define GNETLSEditorFrame_h - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class NBTrafficLightDefinition; -class NBLoadedSUMOTLDef; -class NBOwnTLDef; -class GNEInternalLane; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNETLSEditorFrame - * The Widget for modifying Traffic Lights (TLS) - */ -class GNETLSEditorFrame : public GNEFrame { - /// @brief FOX-declaration - FXDECLARE(GNETLSEditorFrame) - -public: - - // =========================================================================== - // class TLSJunction - // =========================================================================== - - class TLSJunction : protected FXGroupBox { - - public: - /// @brief constructor - TLSJunction(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSJunction(); - - /// @brief get current modified junction - GNEJunction* getCurrentJunction() const; - - /// @brief set current junction - void setCurrentJunction(GNEJunction* junction); - - /// @brief update descrition - void updateJunctionDescription() const; - - private: - /// @brief pointer to TLSEditor Parent - GNETLSEditorFrame* myTLSEditorParent; - - /// @brief label for junction ID - FXLabel* myLabelJunctionID; - - /// @brief text field for junction ID - FXTextField* myTextFieldJunctionID; - - /// @brief the junction of the tls is being modified - GNEJunction* myCurrentJunction; - }; - - // =========================================================================== - // class TLSDefinition - // =========================================================================== - - class TLSDefinition : protected FXGroupBox { - - public: - /// @brief constructor - TLSDefinition(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSDefinition(); - - private: - /// @brief button for create new Traffic light program - FXButton* myNewTLProgram; - - /// @brief button for delete traffic light program - FXButton* myDeleteTLProgram; - }; - - // =========================================================================== - // class TLSAttributes - // =========================================================================== - - class TLSAttributes : protected FXGroupBox { - - public: - /// @brief constructor - TLSAttributes(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSAttributes(); - - /// @brief initializes the definitions and corresponding listbox - void initTLSAttributes(GNEJunction* junction); - - /// @brief clear TLS attributes - void clearTLSAttributes(); - - /// @brief get current definition - NBTrafficLightDefinition* getCurrentTLSDefinition() const; - - /// @brief get current offset in SUMOTIme - SUMOTime getOffset() const; - - /// @brief set new offset - void setOffset(SUMOTime offset); - - /// @brief get number of definitions - int getNumberOfTLSDefinitions() const; - - /// @brief get number of programs - int getNumberOfPrograms() const; - - private: - /// @brief pointer to TLSEditorParent - GNETLSEditorFrame* myTLSEditorParent; - - /// @brief the list of Definitions for the current junction - std::vector myTLSDefinitions; - - /// @brief name label - FXLabel* myNameLabel; - - /// @brief name text field - FXTextField* myNameTextField; - - /// @brief program label - FXLabel* myProgramLabel; - - /// @brief the comboBox for selecting the tl-definition to edit - FXComboBox* myProgramComboBox; - - /// @brief offset label - FXLabel* myOffsetLabel; - - /// @brief the control for modifying offset - FXTextField* myOffsetTextField; - }; - - // =========================================================================== - // class TLSPhases - // =========================================================================== - - class TLSPhases : protected FXGroupBox { - - public: - /// @brief constructor - TLSPhases(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSPhases(); - - /// @brief get phase table - FXTable* getPhaseTable() const; - - /**@brief initialies the phase table - * @param[in] index The index to select - */ - void initPhaseTable(int index = 0); - - /// @brief show cycle duration - void showCycleDuration(); - - /// @brief hide cycle duration - void hideCycleDuration(); - - /// @brief recomputes cycle duration and updates label - void updateCycleDuration(); - - private: - /// @brief pointer to TLSEditor Parent - GNETLSEditorFrame* myTLSEditorParent; - - /// @brief font for the phase table - FXFont* myTableFont; - - /// @brief window for oversized phase tables - FXScrollWindow* myTableScroll; - - /// @brief table for selecting and rearranging phases and for changing duration - FXTable* myPhaseTable; - - /// @brief label with the cycle duration - FXLabel* myCycleDuration; - - /// @brief insert new phase button - FXButton* myInsertDuplicateButton; - - /// @brief delete phase button - FXButton* myDeleteSelectedPhaseButton; - }; - - // =========================================================================== - // class TLSModifications - // =========================================================================== - - class TLSModifications : protected FXGroupBox { - - public: - /// @brief constructor - TLSModifications(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSModifications(); - - /// @brief check if current TLS was modified - bool checkHaveModifications() const; - - /// @brief set if current TLS was modified - void setHaveModifications(bool value); - - private: - /// @brief pointer to TLSEditor Parent - GNETLSEditorFrame* myTLSEditorParent; - - /// @brief button for cancel modifications - FXButton* myDiscardModificationsButtons; - - /// @brief button for save modifications - FXButton* mySaveModificationsButtons; - - /// @brief whether the current tls was modified - bool myHaveModifications; - }; - - // =========================================================================== - // class TLSFile - // =========================================================================== - - class TLSFile : protected FXGroupBox { - /// @brief FOX-declaration - FXDECLARE(GNETLSEditorFrame::TLSFile) - - public: - /// @brief constructor - TLSFile(GNETLSEditorFrame* TLSEditorParent); - - /// @brief destructor - ~TLSFile(); - - /// @name FOX-callbacks - /// @{ - /// @brief load TLS Program from an additional file - long onCmdLoadTLSProgram(FXObject*, FXSelector, void*); - - /// @brief save TLS Programm to an additional file - long onCmdSaveTLSProgram(FXObject*, FXSelector, void*); - - /// @brief enable buttons, only when a tlLogic is being edited - long onUpdNeedsDef(FXObject*, FXSelector, void*); - /// @} - - protected: - FOX_CONSTRUCTOR(TLSFile) - - private: - /// @brief pointer to TLSEditor Parent - GNETLSEditorFrame* myTLSEditorParent; - - /// @brief button for load TLS Programs - FXButton* myLoadTLSProgramButton; - - /// @brief button for save TLS Programs - FXButton* mySaveTLSProgramButton; - - /// @brief convert SUMOTime into string - std::string writeSUMOTime(SUMOTime steps); - }; - - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNETLSEditorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNETLSEditorFrame(); - - /// @brief show inspector frame - void show(); - - /**@brief edits the traffic light for the given clicked junction - * @param[in] clickedPosition clicked position - * @param[in] objectsUnderCursor The clicked objects under cursor - */ - void editTLS(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief check if modifications in TLS was saved - bool isTLSSaved(); - - /// @brief parse TLS Programs from a file - bool parseTLSPrograms(const std::string& file); - - /// @name FOX-callbacks - /// @{ - /// @brief Called when the user presses the OK-Button - /// @note saves any modifications - long onCmdOK(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the Cancel-button - /// @note discards any modifications - long onCmdCancel(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the button Toogle - long onCmdToggle(FXObject*, FXSelector, void*); - - /// @brief Called when the user presses the button Guess - long onCmdGuess(FXObject*, FXSelector, void*); - - /// @brief Called when the user creates a TLS - long onCmdDefCreate(FXObject*, FXSelector, void*); - - /// @brief Called when the user deletes a TLS - long onCmdDefDelete(FXObject*, FXSelector, void*); - - /// @brief Called when the user changes the offset of a TLS - long onCmdDefOffset(FXObject*, FXSelector, void*); - - /// @brief Called when the user switchs a TLS - long onCmdDefSwitch(FXObject*, FXSelector, void*); - - /// @brief Called when the user renames a TLS - long onCmdDefRename(FXObject*, FXSelector, void*); - - /// @brief Called when the user sub-renames a TLS - long onCmdDefSubRename(FXObject*, FXSelector, void*); - - /// @brief Called when the user adds a OFF - long onCmdDefAddOff(FXObject*, FXSelector, void*); - - /// @brief Called when the user switchs a Phase - long onCmdPhaseSwitch(FXObject*, FXSelector, void*); - - /// @brief Called when the user creates a Phase - long onCmdPhaseCreate(FXObject*, FXSelector, void*); - - /// @brief Called when the user deletes a Phase - long onCmdPhaseDelete(FXObject*, FXSelector, void*); - - /// @brief Called when the user cleans up states - long onCmdCleanup(FXObject*, FXSelector, void*); - - /// @brief Called when the user cleans up states - long onCmdAddUnused(FXObject*, FXSelector, void*); - - /// @brief Called when the user groups states - long onCmdGroupStates(FXObject*, FXSelector, void*); - - /// @brief Called when the user ungroups states - long onCmdUngroupStates(FXObject*, FXSelector, void*); - - /// @brief Called to update the ungroups states button - long onUpdUngroupStates(FXObject*, FXSelector, void*); - - /// @brief Called when the user edits a Phase - long onCmdPhaseEdit(FXObject*, FXSelector, void*); - - /// @brief Called when the user makes RILSA - long onCmdMakeRILSAConforming(FXObject*, FXSelector, void*); - - /// @brief Called when occurs an update of switch definition - long onUpdDefSwitch(FXObject*, FXSelector, void*); - - /// @brief Called when occurs an update of needs definition - long onUpdNeedsDef(FXObject*, FXSelector, void*); - - /// @brief Called to buttons that modify link indices - long onUpdNeedsSingleDef(FXObject*, FXSelector, void*); - - /// @brief Called when occurs an update of needs definition an dphase - long onUpdNeedsDefAndPhase(FXObject*, FXSelector, void*); - - /// @brief Called when occurs an update of create definition - long onUpdDefCreate(FXObject*, FXSelector, void*); - - /// @brief Called when occurs an update of modified - long onUpdModified(FXObject*, FXSelector, void*); - /// @} - - /// @brief update phase definition for the current traffic light and phase - void handleChange(GNEInternalLane* lane); - - /// @brief update phase definition for the current traffic light and phase - void handleMultiChange(GNELane* lane, FXObject* obj, FXSelector sel, void* data); - - /// @brief whether the given edge is controlled by the currently edited tlDef - bool controlsEdge(GNEEdge* edge) const; - - /// @brief whether the current traffic light uses fixed phase durations - bool fixedDuration() const; - - /// @brief open AttributesCreator extended dialog (can be reimplemented in frame children) - void selectedOverlappedElement(GNEAttributeCarrier* AC); - -protected: - FOX_CONSTRUCTOR(GNETLSEditorFrame) - - /**@brief edits the traffic light for the given junction - * @param[in] junction The junction of which the traffic light shall be edited - */ - void editJunction(GNEJunction* junction); - - /// @brief converts to SUMOTime - static SUMOTime getSUMOTime(const FXString& string); - -private: - /// @brief Overlapped Inspection - GNEFrameModuls::OverlappedInspection* myOverlappedInspection; - - /// @brief modul for TLS Junction - GNETLSEditorFrame::TLSJunction* myTLSJunction; - - /// @brief modul for TLS Definition - GNETLSEditorFrame::TLSDefinition* myTLSDefinition; - - /// @brief modul for TLS attributes - GNETLSEditorFrame::TLSAttributes* myTLSAttributes; - - /// @brief modul for load/Save TLS Modifications - GNETLSEditorFrame::TLSModifications* myTLSModifications; - - /// @brief modul for TLS Phases - GNETLSEditorFrame::TLSPhases* myTLSPhases; - - /// @brief modul for load/Save TLS Programs - GNETLSEditorFrame::TLSFile* myTLSFile; - - /// @brief the internal lanes belonging the the current junction indexed by their tl-index - typedef std::map > TLIndexMap; - TLIndexMap myInternalLanes; - - /// @brief the traffic light definition being edited - NBLoadedSUMOTLDef* myEditedDef; - - /// @brief index of the phase being shown - int myPhaseIndex; - - /// @brief cleans up previous lanes - void cleanup(); - - /// @brief builds internal lanes for the given tlDef - void buildIinternalLanes(NBTrafficLightDefinition* tlDef); - - /// @brief the phase of the current traffic light - const std::vector& getPhases(); - - /// @brief convert duration (potentially undefined) to string - static std::string varDurString(SUMOTime dur); -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,353 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVehicleFrame.cpp -/// @author Pablo Alvarez Lopez -/// @date Jan 2018 -/// -// The Widget for add Vehicles/Flows/Trips/etc. elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEVehicleFrame.h" - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEVehicleFrame::HelpCreation - methods -// --------------------------------------------------------------------------- - -GNEVehicleFrame::HelpCreation::HelpCreation(GNEVehicleFrame* vehicleFrameParent) : - FXGroupBox(vehicleFrameParent->myContentFrame, "Help", GUIDesignGroupBoxFrame), - myVehicleFrameParent(vehicleFrameParent) { - myInformationLabel = new FXLabel(this, "", 0, GUIDesignLabelFrameInformation); -} - - -GNEVehicleFrame::HelpCreation::~HelpCreation() {} - - -void -GNEVehicleFrame::HelpCreation::showHelpCreation() { - // first update help cration - updateHelpCreation(); - // show modul - show(); -} - - -void -GNEVehicleFrame::HelpCreation::hideHelpCreation() { - hide(); -} - -void -GNEVehicleFrame::HelpCreation::updateHelpCreation() { - // create information label - std::ostringstream information; - // set text depending of selected vehicle type - switch (myVehicleFrameParent->myVehicleTagSelector->getCurrentTagProperties().getTag()) { - case SUMO_TAG_VEHICLE: - information - << "- Click over a route to\n" - << " create a vehicle."; - break; - case SUMO_TAG_TRIP: - information - << "- Select two edges to\n" - << " create a Trip."; - break; - case SUMO_TAG_ROUTEFLOW: - information - << "- Click over a route to\n" - << " create a routeFlow."; - break; - case SUMO_TAG_FLOW: - information - << "- Select two edges to\n" - << " create a flow."; - break; - default: - break; - } - // set information label - myInformationLabel->setText(information.str().c_str()); -} - -// --------------------------------------------------------------------------- -// GNEVehicleFrame - methods -// --------------------------------------------------------------------------- - -GNEVehicleFrame::GNEVehicleFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : - GNEFrame(horizontalFrameParent, viewNet, "Vehicles") { - - // Create item Selector modul for vehicles - myVehicleTagSelector = new GNEFrameModuls::TagSelector(this, GNEAttributeCarrier::TagType::TAGTYPE_VEHICLE); - - // Create vehicle type selector - myVTypeSelector = new GNEFrameModuls::DemandElementSelector(this, SUMO_TAG_VTYPE); - - // Create vehicle parameters - myVehicleAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); - - // create EdgePathCreator Modul - myEdgePathCreator = new GNEFrameModuls::EdgePathCreator(this, GNEFrameModuls::EdgePathCreator::EdgePathCreatorModes::GNE_EDGEPATHCREATOR_FROM_TO_VIA); - - // Create Help Creation Modul - myHelpCreation = new HelpCreation(this); - - // set Vehicle as default vehicle - myVehicleTagSelector->setCurrentTag(SUMO_TAG_VEHICLE); -} - - -GNEVehicleFrame::~GNEVehicleFrame() {} - - -void -GNEVehicleFrame::show() { - // refresh item selector - myVehicleTagSelector->refreshTagProperties(); - // show frame - GNEFrame::show(); -} - - -bool -GNEVehicleFrame::addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { - // obtain tag (only for improve code legibility) - SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); - // 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) { - myViewNet->setStatusBarText("Current selected vehicle type isn't valid."); - return false; - } - // now check if parameters are valid - if (!myVehicleAttributes->areValuesValid()) { - myVehicleAttributes->showWarningMessage(); - return false; - } - // Declare map to keep attributes from Frames from Frame - std::map valuesMap = myVehicleAttributes->getAttributesAndValues(false); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", vehicleTag); - } - // add VType - valuesMap[SUMO_ATTR_TYPE] = myVTypeSelector->getCurrentDemandElement()->getID(); - // set route or edges depending of vehicle type - if ((vehicleTag == SUMO_TAG_VEHICLE) || (vehicleTag == SUMO_TAG_ROUTEFLOW)) { - if (objectsUnderCursor.getDemandElementFront() && (objectsUnderCursor.getDemandElementFront()->getTagProperty().isRoute())) { - // obtain route - valuesMap[SUMO_ATTR_ROUTE] = (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) ? objectsUnderCursor.getDemandElementFront()->getID() : "embedded"; - // check if departLane is valid - if ((objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) && - (valuesMap.count(SUMO_ATTR_DEPARTLANE) > 0) && GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_DEPARTLANE])) { - double departLane = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_DEPARTLANE]); - if (departLane >= objectsUnderCursor.getDemandElementFront()->getParentEdges().front()->getLanes().size()) { - myViewNet->setStatusBarText("Invalid " + toString(SUMO_ATTR_DEPARTLANE)); - return false; - } - } - // check if departSpeed is valid - if ((valuesMap.count(SUMO_ATTR_DEPARTSPEED) > 0) && GNEAttributeCarrier::canParse(valuesMap[SUMO_ATTR_DEPARTSPEED])) { - double departSpeed = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_DEPARTSPEED]); - if (departSpeed >= myVTypeSelector->getCurrentDemandElement()->getAttributeDouble(SUMO_ATTR_MAXSPEED)) { - myViewNet->setStatusBarText("Invalid " + toString(SUMO_ATTR_DEPARTSPEED)); - return false; - } - } - // check if we're creating a vehicle or a flow - if (vehicleTag == SUMO_TAG_VEHICLE) { - // Add parameter departure - if (valuesMap[SUMO_ATTR_DEPART].empty()) { - valuesMap[SUMO_ATTR_DEPART] = "0"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); - // obtain vehicle parameters in vehicleParameters - SUMOVehicleParameter* vehicleParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false); - // check if vehicle was sucesfully created) - if (vehicleParameters) { - // check if we're creating a vehicle over a existent route or over a embedded route - if (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) { - GNERouteHandler::buildVehicleOverRoute(myViewNet, true, *vehicleParameters); - } else { - GNERouteHandler::buildVehicleWithEmbeddedRoute(myViewNet, true, *vehicleParameters, objectsUnderCursor.getDemandElementFront()); - } - // delete vehicleParameters - delete vehicleParameters; - } - } else { - // set begin and end attributes - if (valuesMap[SUMO_ATTR_BEGIN].empty()) { - valuesMap[SUMO_ATTR_BEGIN] = "0"; - } - if (valuesMap[SUMO_ATTR_END].empty()) { - valuesMap[SUMO_ATTR_END] = "3600"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); - // obtain routeFlow parameters in routeFlowParameters - SUMOVehicleParameter* routeFlowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX); - // check if flow was sucesfully created) - if (routeFlowParameters) { - // check if we're creating a vehicle over a existent route or over a embedded route - if (objectsUnderCursor.getDemandElementFront()->getTagProperty().getTag() == SUMO_TAG_ROUTE) { - GNERouteHandler::buildFlowOverRoute(myViewNet, true, *routeFlowParameters); - } else { - GNERouteHandler::buildFlowWithEmbeddedRoute(myViewNet, true, *routeFlowParameters, objectsUnderCursor.getDemandElementFront()); - } - // delete routeFlowParameters - delete routeFlowParameters; - } - } - // refresh myVehicleAttributes - myVehicleAttributes->refreshRows(); - // all ok, then return true; - return true; - } else { - myViewNet->setStatusBarText(toString(vehicleTag) + " has to be placed within a route."); - return false; - } - } else if (((vehicleTag == SUMO_TAG_TRIP) || (vehicleTag == SUMO_TAG_FLOW)) && objectsUnderCursor.getEdgeFront()) { - // add clicked edge in EdgePathCreator - return myEdgePathCreator->addEdge(objectsUnderCursor.getEdgeFront()); - } else { - return false; - } -} - - -GNEFrameModuls::EdgePathCreator* -GNEVehicleFrame::getEdgePathCreator() const { - return myEdgePathCreator; -} - -// =========================================================================== -// protected -// =========================================================================== - -void -GNEVehicleFrame::tagSelected() { - if (myVehicleTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { - // show vehicle type selector modul - myVTypeSelector->showDemandElementSelector(); - // show AutoRute creator if we're editing a trip - if ((myVehicleTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_TRIP) || - (myVehicleTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_FLOW)) { - myEdgePathCreator->showEdgePathCreator(); - } else { - myEdgePathCreator->hideEdgePathCreator(); - } - } else { - // hide all moduls if vehicle isn't valid - myVTypeSelector->hideDemandElementSelector(); - myVehicleAttributes->hideAttributesCreatorModul(); - myHelpCreation->hideHelpCreation(); - } -} - - -void -GNEVehicleFrame::demandElementSelected() { - if (myVTypeSelector->getCurrentDemandElement()) { - // show vehicle attributes modul - myVehicleAttributes->showAttributesCreatorModul(myVehicleTagSelector->getCurrentTagProperties(), {}); - // set current VTypeClass in TripCreator - myEdgePathCreator->setVClass(myVTypeSelector->getCurrentDemandElement()->getVClass()); - // show help creation - myHelpCreation->showHelpCreation(); - } else { - // hide all moduls if selected item isn't valid - myVehicleAttributes->hideAttributesCreatorModul(); - // hide help creation - myHelpCreation->hideHelpCreation(); - - } -} - - -void -GNEVehicleFrame::edgePathCreated() { - // first check that we have at least two edges - if (myEdgePathCreator->getClickedEdges().size() > 1) { - // obtain tag (only for improve code legibility) - SumoXMLTag vehicleTag = myVehicleTagSelector->getCurrentTagProperties().getTag(); - // Declare map to keep attributes from Frames from Frame - std::map valuesMap = myVehicleAttributes->getAttributesAndValues(false); - // Check if ID has to be generated - if (valuesMap.count(SUMO_ATTR_ID) == 0) { - valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateDemandElementID("", vehicleTag); - } - // add VType - valuesMap[SUMO_ATTR_TYPE] = myVTypeSelector->getCurrentDemandElement()->getID(); - // extract via attribute - std::vector viaEdges; - for (int i = 1; i < ((int)myEdgePathCreator->getClickedEdges().size() - 1); i++) { - viaEdges.push_back(myEdgePathCreator->getClickedEdges().at(i)); - } - // check if we're creating a trip or flow - if (vehicleTag == SUMO_TAG_TRIP) { - // Add parameter departure - if (valuesMap[SUMO_ATTR_DEPART].empty()) { - valuesMap[SUMO_ATTR_DEPART] = "0"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); - // obtain trip parameters - SUMOVehicleParameter* tripParameters = SUMOVehicleParserHelper::parseVehicleAttributes(vehicleTag, SUMOSAXAttrs, false); - // build trip in GNERouteHandler - GNERouteHandler::buildTrip(myViewNet, true, *tripParameters, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), viaEdges); - // delete tripParameters - delete tripParameters; - } else { - // set begin and end attributes - if (valuesMap[SUMO_ATTR_BEGIN].empty()) { - valuesMap[SUMO_ATTR_BEGIN] = "0"; - } - // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes - SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(vehicleTag)); - // obtain flow parameters - SUMOVehicleParameter* flowParameters = SUMOVehicleParserHelper::parseFlowAttributes(SUMOSAXAttrs, false, 0, SUMOTime_MAX); - // build flow in GNERouteHandler - GNERouteHandler::buildFlow(myViewNet, true, *flowParameters, myEdgePathCreator->getClickedEdges().front(), myEdgePathCreator->getClickedEdges().back(), viaEdges); - // delete flowParameters - delete flowParameters; - } - // refresh myVehicleAttributes - myVehicleAttributes->refreshRows(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,121 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEVehicleFrame.h -/// @author Pablo Alvarez Lopez -/// @date Jan 2018 -/// -// The Widget for add Vehicles/Flows/Trips/etc. elements -/****************************************************************************/ -#ifndef GNEVehicleFrame_h -#define GNEVehicleFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEVehicleFrame - */ -class GNEVehicleFrame : public GNEFrame { - -public: - - // =========================================================================== - // class HelpCreation - // =========================================================================== - - class HelpCreation : protected FXGroupBox { - - public: - /// @brief constructor - HelpCreation(GNEVehicleFrame* vehicleFrameParent); - - /// @brief destructor - ~HelpCreation(); - - /// @brief show HelpCreation - void showHelpCreation(); - - /// @brief hide HelpCreation - void hideHelpCreation(); - - /// @brief update HelpCreation - void updateHelpCreation(); - - private: - /// @brief pointer to Vehicle Frame Parent - GNEVehicleFrame* myVehicleFrameParent; - - /// @brief Label with creation information - FXLabel* myInformationLabel; - }; - - /**@brief Constructor - * @brief parent FXHorizontalFrame in which this GNEFrame is placed - * @brief viewNet viewNet that uses this GNEFrame - */ - GNEVehicleFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); - - /// @brief Destructor - ~GNEVehicleFrame(); - - /// @brief show Frame - void show(); - - /**@brief add vehicle element - * @param objectsUnderCursor collection of objects under cursor after click over view - * @return true if vehicle was sucesfully added - */ - bool addVehicle(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); - - /// @brief get EdgePathCreator modul - GNEFrameModuls::EdgePathCreator* getEdgePathCreator() const; - -protected: - /// @brief Tag selected in TagSelector - void tagSelected(); - - /// @brief selected vehicle type in DemandElementSelector - void demandElementSelected(); - - /// @brief finish edge path creation - void edgePathCreated(); - -private: - /// @brief vehicle tag selector (used to select diffent kind of vehicles) - GNEFrameModuls::TagSelector* myVehicleTagSelector; - - /// @brief Vehicle Type selectors - GNEFrameModuls::DemandElementSelector* myVTypeSelector; - - /// @brief internal vehicle attributes - GNEFrameAttributesModuls::AttributesCreator* myVehicleAttributes; - - /// @brief edge path creator (used for trips and flows) - GNEFrameModuls::EdgePathCreator* myEdgePathCreator; - - /// @brief Help creation - HelpCreation* myHelpCreation; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,433 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE)) { - if ((i.first != DEFAULT_VTYPE_ID) && (i.first != DEFAULT_BIKETYPE_ID)) { - myTypeMatchBox->appendItem(i.first.c_str()); - } - } - // set DEFAULT_VEHTYPE as default VType - myCurrentVehicleType = myVehicleTypeFrameParent->getViewNet()->getNet()->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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE)) { - if ((i.first != DEFAULT_VTYPE_ID) && (i.first != DEFAULT_BIKETYPE_ID)) { - myTypeMatchBox->appendItem(i.first.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() == 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()->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(); - // show Attribute Editor modul if selected item is valid - myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul({myCurrentVehicleType}, 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& i : myVehicleTypeFrameParent->getViewNet()->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VTYPE)) { - if (i.first == myTypeMatchBox->getText().text()) { - // set pointer - myCurrentVehicleType = i.second; - // set color of myTypeMatchBox to black (valid) - myTypeMatchBox->setTextColor(FXRGB(0, 0, 0)); - // refresh vehicle type editor modul - myVehicleTypeFrameParent->myVehicleTypeEditor->refreshVehicleTypeEditorModul(); - // show moduls if selected item is valid - myVehicleTypeFrameParent->myVehicleTypeAttributesEditor->showAttributeEditorModul({myCurrentVehicleType}, 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 - std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->generateDemandElementID("", SUMO_TAG_VTYPE); - // create new vehicle type - GNEDemandElement* vehicleType = new GNEVehicleType(myVehicleTypeFrameParent->myViewNet, vehicleTypeID, SUMO_TAG_VTYPE); - // add it using undoList (to allow undo-redo) - myVehicleTypeFrameParent->myViewNet->getUndoList()->p_begin("create vehicle type"); - myVehicleTypeFrameParent->myViewNet->getUndoList()->add(new GNEChange_DemandElement(vehicleType, true), true); - myVehicleTypeFrameParent->myViewNet->getUndoList()->p_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()->p_begin("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()->p_end(); - } - } else { - // begin undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_end(); - } - return 1; -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdResetVehicleType(FXObject*, FXSelector, void*) { - // begin reset default vehicle type values - myVehicleTypeFrameParent->getViewNet()->getUndoList()->p_begin("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()->p_end(); - // refresh VehicleTypeSelector - myVehicleTypeFrameParent->myVehicleTypeSelector->refreshVehicleTypeSelector(); - return 1; -} - - -long -GNEVehicleTypeFrame::VehicleTypeEditor::onCmdCopyVehicleType(FXObject*, FXSelector, void*) { - // obtain a new valid Vehicle Type ID - std::string vehicleTypeID = myVehicleTypeFrameParent->myViewNet->getNet()->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, vehicleTypeID, vType); - // begin undo list operation - myVehicleTypeFrameParent->myViewNet->getUndoList()->p_begin("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()->p_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()->retrieveDemandElement(SUMO_TAG_VTYPE, DEFAULT_VTYPE_ID)); -} - - -GNEVehicleTypeFrame::~GNEVehicleTypeFrame() {} - - -void -GNEVehicleTypeFrame::show() { - // refresh vehicle type and Attribute Editor - myVehicleTypeSelector->refreshVehicleTypeSelector(); - // show vehicle type attributes editor (except extended attributes) - myVehicleTypeAttributesEditor->showAttributeEditorModul({myVehicleTypeSelector->getCurrentVehicleType()}, 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); - // call "showAttributeEditorModul" to refresh attribute list - myVehicleTypeAttributesEditor->showAttributeEditorModul({myVehicleTypeSelector->getCurrentVehicleType()}, false, true); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/GNEVehicleTypeFrame.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 -/****************************************************************************/ -#ifndef GNEVehicleTypeFrame_h -#define GNEVehicleTypeFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include "GNEFrame.h" - -// =========================================================================== -// 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 elements type - 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; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/frames/network/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/frames/network/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,21 @@ +set(netedit_frames_network_SRCS + GNEConnectorFrame.h + GNEConnectorFrame.cpp + GNETLSEditorFrame.h + GNETLSEditorFrame.cpp + GNEAdditionalFrame.h + GNEAdditionalFrame.cpp + GNECrossingFrame.h + GNECrossingFrame.cpp + GNETAZFrame.h + GNETAZFrame.cpp + GNEPolygonFrame.h + GNEPolygonFrame.cpp + GNECreateEdgeFrame.h + GNECreateEdgeFrame.cpp + GNEProhibitionFrame.h + GNEProhibitionFrame.cpp + ) + +add_library(netedit_frames_network STATIC ${netedit_frames_network_SRCS}) +set_property(TARGET netedit_frames_network PROPERTY PROJECT_LABEL "z_netedit_frames_network") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1018 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditionalFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// The Widget for add additional elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEAdditionalFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEAdditionalFrame::SelectorParentLanes) ConsecutiveLaneSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_STOPSELECTION, GNEAdditionalFrame::SelectorParentLanes::onCmdStopSelection), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_ABORTSELECTION, GNEAdditionalFrame::SelectorParentLanes::onCmdAbortSelection), +}; + +FXDEFMAP(GNEAdditionalFrame::SelectorChildEdges) SelectorParentEdgesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNEAdditionalFrame::SelectorChildEdges::onCmdUseSelectedEdges), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNEAdditionalFrame::SelectorChildEdges::onCmdClearSelection), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNEAdditionalFrame::SelectorChildEdges::onCmdInvertSelection), + FXMAPFUNC(SEL_CHANGED, MID_GNE_ADDITIONALFRAME_SEARCH, GNEAdditionalFrame::SelectorChildEdges::onCmdTypeInSearchBox), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_SELECT, GNEAdditionalFrame::SelectorChildEdges::onCmdSelectEdge), +}; + +FXDEFMAP(GNEAdditionalFrame::SelectorChildLanes) SelectorParentLanesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNEAdditionalFrame::SelectorChildLanes::onCmdUseSelectedLanes), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNEAdditionalFrame::SelectorChildLanes::onCmdClearSelection), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNEAdditionalFrame::SelectorChildLanes::onCmdInvertSelection), + FXMAPFUNC(SEL_CHANGED, MID_GNE_ADDITIONALFRAME_SEARCH, GNEAdditionalFrame::SelectorChildLanes::onCmdTypeInSearchBox), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_SELECT, GNEAdditionalFrame::SelectorChildLanes::onCmdSelectLane), +}; + +// Object implementation +FXIMPLEMENT(GNEAdditionalFrame::SelectorParentLanes, FXGroupBox, ConsecutiveLaneSelectorMap, ARRAYNUMBER(ConsecutiveLaneSelectorMap)) +FXIMPLEMENT(GNEAdditionalFrame::SelectorChildEdges, FXGroupBox, SelectorParentEdgesMap, ARRAYNUMBER(SelectorParentEdgesMap)) +FXIMPLEMENT(GNEAdditionalFrame::SelectorChildLanes, FXGroupBox, SelectorParentLanesMap, ARRAYNUMBER(SelectorParentLanesMap)) + + +// --------------------------------------------------------------------------- +// GNEAdditionalFrame::SelectorParentLanes - methods +// --------------------------------------------------------------------------- + +GNEAdditionalFrame::SelectorParentLanes::SelectorParentLanes(GNEAdditionalFrame* additionalFrameParent) : + FXGroupBox(additionalFrameParent->myContentFrame, "Lane Selector", GUIDesignGroupBoxFrame), + 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); + // disable stop and abort functions as init + myStopSelectingButton->disable(); + myAbortSelectingButton->disable(); + // define colors + myCandidateLaneColor = RGBColor(0, 64, 0, 255); + mySelectedLaneColor = RGBColor::GREEN; +} + + +GNEAdditionalFrame::SelectorParentLanes::~SelectorParentLanes() {} + + +void +GNEAdditionalFrame::SelectorParentLanes::showSelectorParentLanesModul() { + // abort current selection before show + abortConsecutiveLaneSelector(); + // show FXGroupBox + FXGroupBox::show(); +} + + +void +GNEAdditionalFrame::SelectorParentLanes::hideSelectorParentLanesModul() { + // abort current selection before hide + abortConsecutiveLaneSelector(); + // hide FXGroupBox + FXGroupBox::hide(); +} + + +void +GNEAdditionalFrame::SelectorParentLanes::startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition) { + // Only start selection if SelectorParentLanes modul is shown + if (shown()) { + // change buttons + myStopSelectingButton->enable(); + myAbortSelectingButton->enable(); + // add lane + addSelectedLane(lane, clickedPosition); + } +} + + +bool +GNEAdditionalFrame::SelectorParentLanes::stopConsecutiveLaneSelector() { + // obtain tagproperty (only for improve code legibility) + const auto& tagValues = myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties(); + // abort if there isn't at least two lanes + if (mySelectedLanes.size() < 2) { + WRITE_WARNING(myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + " requires at least two lanes."); + // abort consecutive lane selector + abortConsecutiveLaneSelector(); + return false; + } + // Declare map to keep attributes from Frames from Frame + std::map valuesMap = myAdditionalFrameParent->myAdditionalAttributes->getAttributesAndValues(true); + // fill valuesOfElement with Netedit attributes from Frame + myAdditionalFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myAdditionalFrameParent->generateID(nullptr); + } + // obtain lane IDs + std::vector laneIDs; + for (auto i : mySelectedLanes) { + laneIDs.push_back(i.first->getID()); + } + valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " "); + // Obtain clicked position over first lane + valuesMap[SUMO_ATTR_POSITION] = toString(mySelectedLanes.front().second); + // Obtain clicked position over last lane + valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectedLanes.back().second); + // parse common attributes + if (!myAdditionalFrameParent->buildAdditionalCommonAttributes(valuesMap, tagValues)) { + return false; + } + // show warning dialogbox and stop check if input parameters are valid + if (myAdditionalFrameParent->myAdditionalAttributes->areValuesValid() == false) { + myAdditionalFrameParent->myAdditionalAttributes->showWarningMessage(); + return false; + } else { + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, myAdditionalFrameParent->getPredefinedTagsMML(), toString(tagValues.getTag())); + // try to build additional + if (GNEAdditionalHandler::buildAdditional(myAdditionalFrameParent->getViewNet()->getNet(), true, myAdditionalFrameParent->myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { + // abort consecutive lane selector + abortConsecutiveLaneSelector(); + // refresh additional attributes + myAdditionalFrameParent->myAdditionalAttributes->refreshRows(); + return true; + } else { + return false; + } + } +} + + +void +GNEAdditionalFrame::SelectorParentLanes::abortConsecutiveLaneSelector() { + // reset color of all candidate lanes + for (auto i : myCandidateLanes) { + i->setSpecialColor(nullptr); + } + // clear candidate colors + myCandidateLanes.clear(); + // reset color of all selected lanes + for (auto i : mySelectedLanes) { + i.first->setSpecialColor(nullptr); + } + // clear selected lanes + mySelectedLanes.clear(); + // disable buttons + myStopSelectingButton->disable(); + myAbortSelectingButton->disable(); + // update view (due colors) + myAdditionalFrameParent->getViewNet()->updateViewNet(); +} + + +bool +GNEAdditionalFrame::SelectorParentLanes::addSelectedLane(GNELane* lane, const Position& clickedPosition) { + // first check that lane exist + if (lane == nullptr) { + return false; + } + // check that lane wasn't already selected + for (auto i : mySelectedLanes) { + if (i.first == lane) { + WRITE_WARNING("Duplicated lanes aren't allowed"); + return false; + } + } + // check that there is candidate lanes + if (mySelectedLanes.size() > 0) { + if (myCandidateLanes.empty()) { + WRITE_WARNING("Only candidate lanes are allowed"); + return false; + } else if ((myCandidateLanes.size() > 0) && (std::find(myCandidateLanes.begin(), myCandidateLanes.end(), lane) == myCandidateLanes.end())) { + WRITE_WARNING("Only consecutive lanes are allowed"); + return false; + } + } + // select lane and save the clicked position + mySelectedLanes.push_back(std::make_pair(lane, lane->getLaneShape().nearest_offset_to_point2D(clickedPosition) / lane->getLengthGeometryFactor())); + // change color of selected lane + lane->setSpecialColor(&mySelectedLaneColor); + // restore original color of candidates (except already selected) + for (auto i : myCandidateLanes) { + if (!isLaneSelected(i)) { + i->setSpecialColor(nullptr); + } + } + // clear candidate lanes + myCandidateLanes.clear(); + // fill candidate lanes + for (auto i : lane->getParentEdge()->getGNEConnections()) { + // check that possible candidate lane isn't already selected + if ((lane == i->getLaneFrom()) && (!isLaneSelected(i->getLaneTo()))) { + // set candidate lane + i->getLaneTo()->setSpecialColor(&myCandidateLaneColor); + myCandidateLanes.push_back(i->getLaneTo()); + } + } + // update view (due colors) + myAdditionalFrameParent->getViewNet()->updateViewNet(); + return true; +} + + +void +GNEAdditionalFrame::SelectorParentLanes::removeLastSelectedLane() { + if (mySelectedLanes.size() > 1) { + mySelectedLanes.pop_back(); + } else { + WRITE_WARNING("First lane cannot be removed"); + } +} + + +bool +GNEAdditionalFrame::SelectorParentLanes::isSelectingLanes() const { + return myStopSelectingButton->isEnabled(); +} + + +bool +GNEAdditionalFrame::SelectorParentLanes::isShown() const { + return shown(); +} + + +const RGBColor& +GNEAdditionalFrame::SelectorParentLanes::getSelectedLaneColor() const { + return mySelectedLaneColor; +} + + +const std::vector >& +GNEAdditionalFrame::SelectorParentLanes::getSelectedLanes() const { + return mySelectedLanes; +} + + +long +GNEAdditionalFrame::SelectorParentLanes::onCmdStopSelection(FXObject*, FXSelector, void*) { + stopConsecutiveLaneSelector(); + return 0; +} + + +long +GNEAdditionalFrame::SelectorParentLanes::onCmdAbortSelection(FXObject*, FXSelector, void*) { + abortConsecutiveLaneSelector(); + return 0; +} + + +bool +GNEAdditionalFrame::SelectorParentLanes::isLaneSelected(GNELane* lane) const { + for (auto i : mySelectedLanes) { + if (i.first == lane) { + return true; + } + } + return false; +} + +// --------------------------------------------------------------------------- +// GNEAdditionalFrame::SelectorChildEdges - methods +// --------------------------------------------------------------------------- + +GNEAdditionalFrame::SelectorChildEdges::SelectorChildEdges(GNEAdditionalFrame* additionalFrameParent) : + FXGroupBox(additionalFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), + 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); + + // Create search box + myEdgesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); + + // Create list + myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); + + // Create horizontal frame + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + + // Create button for clear selection + myClearEdgesSelection = new FXButton(buttonsFrame, "Clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); + + // Create button for invert selection + myInvertEdgesSelection = new FXButton(buttonsFrame, "Invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); + + // Hide List + hideSelectorChildEdgesModul(); +} + + +GNEAdditionalFrame::SelectorChildEdges::~SelectorChildEdges() {} + + +std::string +GNEAdditionalFrame::SelectorChildEdges::getEdgeIdsSelected() const { + std::vector vectorOfIds; + if (myUseSelectedEdgesCheckButton->getCheck()) { + // get Selected edges + std::vector selectedEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true); + // Iterate over selectedEdges and getId + for (auto i : selectedEdges) { + vectorOfIds.push_back(i->getID()); + } + } else { + // Obtain Id's of list + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->isItemSelected(i)) { + vectorOfIds.push_back(myList->getItem(i)->getText().text()); + } + } + } + return joinToString(vectorOfIds, " "); +} + + +void +GNEAdditionalFrame::SelectorChildEdges::showSelectorChildEdgesModul(std::string search) { + // clear list of egdge ids + myList->clearItems(); + // get all edges of net + /// @todo this function must be improved. + std::vector vectorOfEdges = myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(false); + // iterate over edges of net + for (auto i : vectorOfEdges) { + // If search criterium is correct, then append ittem + if (i->getID().find(search) != std::string::npos) { + myList->appendItem(i->getID().c_str()); + } + } + // By default, CheckBox for useSelectedEdges isn't checked + myUseSelectedEdgesCheckButton->setCheck(false); + // Recalc Frame + recalc(); + // Update Frame + update(); + // Show dialog + show(); +} + + +void +GNEAdditionalFrame::SelectorChildEdges::hideSelectorChildEdgesModul() { + FXGroupBox::hide(); +} + + +void +GNEAdditionalFrame::SelectorChildEdges::updateUseSelectedEdges() { + // Enable or disable use selected edges + if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveEdges(true).size() > 0) { + myUseSelectedEdgesCheckButton->enable(); + } else { + myUseSelectedEdgesCheckButton->disable(); + } +} + + +long +GNEAdditionalFrame::SelectorChildEdges::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { + if (myUseSelectedEdgesCheckButton->getCheck()) { + myEdgesSearch->hide(); + myList->hide(); + myClearEdgesSelection->hide(); + myInvertEdgesSelection->hide(); + } else { + myEdgesSearch->show(); + myList->show(); + myClearEdgesSelection->show(); + myInvertEdgesSelection->show(); + } + // Recalc Frame + recalc(); + // Update Frame + update(); + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildEdges::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { + // Show only Id's of SelectorChildEdges that contains the searched string + showSelectorChildEdgesModul(myEdgesSearch->getText().text()); + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildEdges::onCmdSelectEdge(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildEdges::onCmdClearSelection(FXObject*, FXSelector, void*) { + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->getItem(i)->isSelected()) { + myList->deselectItem(i); + } + } + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildEdges::onCmdInvertSelection(FXObject*, FXSelector, void*) { + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->getItem(i)->isSelected()) { + myList->deselectItem(i); + } else { + myList->selectItem(i); + } + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNEAdditionalFrame::SelectorChildLanes - methods +// --------------------------------------------------------------------------- + +GNEAdditionalFrame::SelectorChildLanes::SelectorChildLanes(GNEAdditionalFrame* additionalFrameParent) : + FXGroupBox(additionalFrameParent->myContentFrame, "Lanes", GUIDesignGroupBoxFrame), + 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); + + // Create search box + myLanesSearch = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_ADDITIONALFRAME_SEARCH, GUIDesignTextField); + + // Create list + myList = new FXList(this, this, MID_GNE_ADDITIONALFRAME_SELECT, GUIDesignListFixedHeight, 0, 0, 0, 100); + + // Create horizontal frame + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + + // Create button for clear selection + clearLanesSelection = new FXButton(buttonsFrame, "clear", nullptr, this, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GUIDesignButtonRectangular); + + // Create button for invert selection + invertLanesSelection = new FXButton(buttonsFrame, "invert", nullptr, this, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GUIDesignButtonRectangular); + + // Hide List + hideSelectorChildLanesModul(); +} + + +GNEAdditionalFrame::SelectorChildLanes::~SelectorChildLanes() {} + + +std::string +GNEAdditionalFrame::SelectorChildLanes::getLaneIdsSelected() const { + std::vector vectorOfIds; + if (myUseSelectedLanesCheckButton->getCheck()) { + // get Selected lanes + std::vector selectedLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true); + // Iterate over selectedLanes and getId + for (auto i : selectedLanes) { + vectorOfIds.push_back(i->getID()); + } + } else { + // Obtain Id's of list + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->isItemSelected(i)) { + vectorOfIds.push_back(myList->getItem(i)->getText().text()); + } + } + } + return joinToString(vectorOfIds, " "); +} + + +void +GNEAdditionalFrame::SelectorChildLanes::showSelectorChildLanesModul(std::string search) { + myList->clearItems(); + std::vector vectorOfLanes = myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(false); + for (auto i : vectorOfLanes) { + if (i->getID().find(search) != std::string::npos) { + myList->appendItem(i->getID().c_str()); + } + } + // By default, CheckBox for useSelectedLanes isn't checked + myUseSelectedLanesCheckButton->setCheck(false); + // Show list + show(); +} + + +void +GNEAdditionalFrame::SelectorChildLanes::hideSelectorChildLanesModul() { + FXGroupBox::hide(); +} + + +void +GNEAdditionalFrame::SelectorChildLanes::updateUseSelectedLanes() { + // Enable or disable use selected Lanes + if (myAdditionalFrameParent->getViewNet()->getNet()->retrieveLanes(true).size() > 0) { + myUseSelectedLanesCheckButton->enable(); + } else { + myUseSelectedLanesCheckButton->disable(); + } +} + + +long +GNEAdditionalFrame::SelectorChildLanes::onCmdUseSelectedLanes(FXObject*, FXSelector, void*) { + if (myUseSelectedLanesCheckButton->getCheck()) { + myLanesSearch->hide(); + myList->hide(); + clearLanesSelection->hide(); + invertLanesSelection->hide(); + } else { + myLanesSearch->show(); + myList->show(); + clearLanesSelection->show(); + invertLanesSelection->show(); + } + // Recalc Frame + recalc(); + // Update Frame + update(); + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildLanes::onCmdTypeInSearchBox(FXObject*, FXSelector, void*) { + // Show only Id's of SelectorChildLanes that contains the searched string + showSelectorChildLanesModul(myLanesSearch->getText().text()); + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildLanes::onCmdSelectLane(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildLanes::onCmdClearSelection(FXObject*, FXSelector, void*) { + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->getItem(i)->isSelected()) { + myList->deselectItem(i); + } + } + return 1; +} + + +long +GNEAdditionalFrame::SelectorChildLanes::onCmdInvertSelection(FXObject*, FXSelector, void*) { + for (int i = 0; i < myList->getNumItems(); i++) { + if (myList->getItem(i)->isSelected()) { + myList->deselectItem(i); + } else { + myList->selectItem(i); + } + } + return 1; +} + +// =========================================================================== +// method definitions +// =========================================================================== + +GNEAdditionalFrame::GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Additionals") { + + // create item Selector modul for additionals + myAdditionalTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::ADDITIONALELEMENT); + + // Create additional parameters + myAdditionalAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // Create Netedit parameter + myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + + // Create consecutive Lane Selector + mySelectorParentLanes = new SelectorParentLanes(this); + + // Create selector parent + myParentAdditional = new GNEFrameModuls::SelectorParent(this); + + /// Create list for SelectorChildEdges + mySelectorChildEdges = new SelectorChildEdges(this); + + /// Create list for SelectorChildLanes + mySelectorChildLanes = new SelectorChildLanes(this); + + // set BusStop as default additional + myAdditionalTagSelector->setCurrentTag(SUMO_TAG_BUS_STOP); +} + + +GNEAdditionalFrame::~GNEAdditionalFrame() {} + + +void +GNEAdditionalFrame::show() { + // refresh item selector + myAdditionalTagSelector->refreshTagProperties(); + // show frame + GNEFrame::show(); +} + + +bool +GNEAdditionalFrame::addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check that current selected additional is valid + if (myAdditionalTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_NOTHING) { + myViewNet->setStatusBarText("Current selected additional isn't valid."); + return false; + } + // obtain tagproperty (only for improve code legibility) + const auto& tagValues = myAdditionalTagSelector->getCurrentTagProperties(); + // Declare map to keep attributes obtained in frame + std::map valuesMap = myAdditionalAttributes->getAttributesAndValues(true); + // fill netedit attributes + if (!myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront())) { + return false; + } + // If element owns an parent additional, get id of parent from ParentAdditionalSelector + if (tagValues.hasParent() && !buildAdditionalWithParent(valuesMap, objectsUnderCursor.getAdditionalFront(), tagValues)) { + return false; + } + // If consecutive Lane Selector is enabled, it means that either we're selecting lanes or we're finished or we'rent started + if (tagValues.hasAttribute(SUMO_ATTR_EDGE) || (tagValues.getTag() == SUMO_TAG_VAPORIZER)) { + return buildAdditionalOverEdge(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); + } else if (tagValues.hasAttribute(SUMO_ATTR_LANE)) { + return buildAdditionalOverLane(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); + } else if (tagValues.getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { + return buildAdditionalOverLanes(valuesMap, objectsUnderCursor.getLaneFront(), tagValues); + } else { + return buildAdditionalOverView(valuesMap, tagValues); + } +} + + +void +GNEAdditionalFrame::showSelectorChildLanesModul() { + // Show frame + GNEFrame::show(); + // Update UseSelectedLane CheckBox + mySelectorChildEdges->updateUseSelectedEdges(); + // Update UseSelectedLane CheckBox + mySelectorChildLanes->updateUseSelectedLanes(); +} + + +GNEAdditionalFrame::SelectorParentLanes* +GNEAdditionalFrame::getConsecutiveLaneSelector() const { + return mySelectorParentLanes; +} + + +void +GNEAdditionalFrame::tagSelected() { + if (myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // show additional attributes modul + myAdditionalAttributes->showAttributesCreatorModul(myAdditionalTagSelector->getCurrentTagProperties(), {}); + // show netedit attributes + myNeteditAttributes->showNeteditAttributesModul(myAdditionalTagSelector->getCurrentTagProperties()); + // Show myAdditionalFrameParent if we're adding a additional with parent + if (myAdditionalTagSelector->getCurrentTagProperties().hasParent()) { + myParentAdditional->showSelectorParentModul(myAdditionalTagSelector->getCurrentTagProperties().getParentTag()); + } else { + myParentAdditional->hideSelectorParentModul(); + } + // Show SelectorChildEdges if we're adding an additional that own the attribute SUMO_ATTR_EDGES + if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_EDGES)) { + mySelectorChildEdges->showSelectorChildEdgesModul(); + } else { + mySelectorChildEdges->hideSelectorChildEdgesModul(); + } + // Show SelectorChildLanes or consecutive lane selector if we're adding an additional that own the attribute SUMO_ATTR_LANES + if (myAdditionalTagSelector->getCurrentTagProperties().hasAttribute(SUMO_ATTR_LANES)) { + if (myAdditionalTagSelector->getCurrentTagProperties().hasParent() && + (myAdditionalTagSelector->getCurrentTagProperties().getParentTag() == SUMO_TAG_LANE)) { + // show selector parent lane and hide selector child lane + mySelectorParentLanes->showSelectorParentLanesModul(); + mySelectorChildLanes->hideSelectorChildLanesModul(); + } else { + // show selector child lane and hide selector parent lane + mySelectorChildLanes->showSelectorChildLanesModul(); + mySelectorParentLanes->hideSelectorParentLanesModul(); + } + } else { + mySelectorChildLanes->hideSelectorChildLanesModul(); + mySelectorParentLanes->hideSelectorParentLanesModul(); + } + } else { + // hide all moduls if additional isn't valid + myAdditionalAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myParentAdditional->hideSelectorParentModul(); + mySelectorChildEdges->hideSelectorChildEdgesModul(); + mySelectorChildLanes->hideSelectorChildLanesModul(); + mySelectorParentLanes->hideSelectorParentLanesModul(); + } +} + + +std::string +GNEAdditionalFrame::generateID(GNENetworkElement* networkElement) const { + // obtain current number of additionals to generate a new index faster + int additionalIndex = myViewNet->getNet()->getNumberOfAdditionals(myAdditionalTagSelector->getCurrentTagProperties().getTag()); + // obtain tag Properties (only for improve code legilibility + const auto& tagProperties = myAdditionalTagSelector->getCurrentTagProperties(); + if (networkElement) { + // special case for vaporizers + if (tagProperties.getTag() == SUMO_TAG_VAPORIZER) { + return networkElement->getID(); + } else { + // generate ID using networkElement + while (myViewNet->getNet()->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 (myViewNet->getNet()->retrieveAdditional(tagProperties.getTag(), tagProperties.getTagStr() + "_" + toString(additionalIndex), false) != nullptr) { + additionalIndex++; + } + return tagProperties.getTagStr() + "_" + toString(additionalIndex); + } +} + + +bool +GNEAdditionalFrame::buildAdditionalWithParent(std::map& valuesMap, GNEAdditional* additionalParent, const GNETagProperties& tagValues) { + // if user click over an additional element parent, mark int in ParentAdditionalSelector + if (additionalParent && (additionalParent->getTagProperty().getTag() == tagValues.getParentTag())) { + valuesMap[GNE_ATTR_PARENT] = additionalParent->getID(); + myParentAdditional->setIDSelected(additionalParent->getID()); + } + // stop if currently there isn't a valid selected parent + if (myParentAdditional->getIdSelected() != "") { + valuesMap[GNE_ATTR_PARENT] = myParentAdditional->getIdSelected(); + } else { + myAdditionalAttributes->showWarningMessage("A " + toString(tagValues.getParentTag()) + " must be selected before insertion of " + myAdditionalTagSelector->getCurrentTagProperties().getTagStr() + "."); + return false; + } + return true; +} + + +bool +GNEAdditionalFrame::buildAdditionalCommonAttributes(std::map& valuesMap, const GNETagProperties& tagValues) { + // If additional has a interval defined by a begin or end, check that is valid + if (tagValues.hasAttribute(SUMO_ATTR_STARTTIME) && tagValues.hasAttribute(SUMO_ATTR_END)) { + double begin = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_STARTTIME]); + double end = GNEAttributeCarrier::parse(valuesMap[SUMO_ATTR_END]); + if (begin > end) { + myAdditionalAttributes->showWarningMessage("Attribute '" + toString(SUMO_ATTR_STARTTIME) + "' cannot be greater than attribute '" + toString(SUMO_ATTR_END) + "'."); + return false; + } + } + // If additional own the attribute SUMO_ATTR_FILE but was't defined, will defined as .xml + if (tagValues.hasAttribute(SUMO_ATTR_FILE) && valuesMap[SUMO_ATTR_FILE] == "") { + if ((myAdditionalTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_CALIBRATOR) && (myAdditionalTagSelector->getCurrentTagProperties().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) + valuesMap[SUMO_ATTR_FILE] = (valuesMap[SUMO_ATTR_ID] + ".xml"); + } + } + // If element own a list of SelectorChildEdges as attribute + if (tagValues.hasAttribute(SUMO_ATTR_EDGES) && valuesMap[SUMO_ATTR_EDGES].empty()) { + // obtain edge IDs + valuesMap[SUMO_ATTR_EDGES] = mySelectorChildEdges->getEdgeIdsSelected(); + // check if attribute has at least one edge + if (valuesMap[SUMO_ATTR_EDGES] == "") { + myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_EDGE) + "s cannot be empty"); + return false; + } + } + // get values of mySelectorChildLanes, if tag correspond to an element that has lanes as children + if (tagValues.hasAttribute(SUMO_ATTR_LANES) && valuesMap[SUMO_ATTR_LANES].empty()) { + // obtain lane IDs + valuesMap[SUMO_ATTR_LANES] = mySelectorChildLanes->getLaneIdsSelected(); + // check if attribute has at least a lane + if (valuesMap[SUMO_ATTR_LANES] == "") { + myAdditionalAttributes->showWarningMessage("List of " + toString(SUMO_TAG_LANE) + "s cannot be empty"); + return false; + } + } + // all ok, continue building additionals + return true; +} + + +bool +GNEAdditionalFrame::buildAdditionalOverEdge(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues) { + // check that edge exist + if (lane) { + // Get attribute lane's edge + valuesMap[SUMO_ATTR_EDGE] = lane->getParentEdge()->getID(); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = generateID(lane->getParentEdge()); + } + } else { + return false; + } + // parse common attributes + if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { + return false; + } + // show warning dialogbox and stop check if input parameters are valid + if (!myAdditionalAttributes->areValuesValid()) { + myAdditionalAttributes->showWarningMessage(); + return false; + } else { + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); + // try to build additional + if (GNEAdditionalHandler::buildAdditional(myViewNet->getNet(), true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { + // Refresh additional Parent Selector (For additionals that have a limited number of children) + myParentAdditional->refreshSelectorParentModul(); + // clear selected eddges and lanes + mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); + mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); + // refresh additional attributes + myAdditionalAttributes->refreshRows(); + return true; + } else { + return false; + } + } +} + + +bool +GNEAdditionalFrame::buildAdditionalOverLane(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues) { + // check that lane exist + if (lane != nullptr) { + // Get attribute lane + valuesMap[SUMO_ATTR_LANE] = lane->getID(); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = generateID(lane); + } + } else { + return false; + } + // Obtain position of the mouse over lane (limited over grid) + double mousePositionOverLane = lane->getLaneShape().nearest_offset_to_point2D(myViewNet->snapToActiveGrid(myViewNet->getPositionInformation())) / lane->getLengthGeometryFactor(); + // set attribute position as mouse position over lane + valuesMap[SUMO_ATTR_POSITION] = toString(mousePositionOverLane); + // parse common attributes + if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { + return false; + } + // show warning dialogbox and stop check if input parameters are valid + if (!myAdditionalAttributes->areValuesValid()) { + myAdditionalAttributes->showWarningMessage(); + return false; + } else { + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); + // try to build additional + if (GNEAdditionalHandler::buildAdditional(myViewNet->getNet(), true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { + // Refresh additional Parent Selector (For additionals that have a limited number of children) + myParentAdditional->refreshSelectorParentModul(); + // clear selected eddges and lanes + mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); + mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); + // refresh additional attributes + myAdditionalAttributes->refreshRows(); + return true; + } else { + return false; + } + } +} + + +bool +GNEAdditionalFrame::buildAdditionalOverLanes(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues) { + // stop if lane isn't valid + if (lane == nullptr) { + return false; + } + if (mySelectorParentLanes->isSelectingLanes()) { + // select clicked lane, but don't build additional + mySelectorParentLanes->addSelectedLane(lane, myViewNet->getPositionInformation()); + return false; + } else if (mySelectorParentLanes->getSelectedLanes().empty()) { + // if there isn't selected lanes, that means that we will be start selecting lanes + mySelectorParentLanes->startConsecutiveLaneSelector(lane, myViewNet->getPositionInformation()); + return false; + } else { + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = generateID(mySelectorParentLanes->getSelectedLanes().front().first); + } + // obtain lane IDs + std::vector laneIDs; + for (auto i : mySelectorParentLanes->getSelectedLanes()) { + laneIDs.push_back(i.first->getID()); + } + valuesMap[SUMO_ATTR_LANES] = joinToString(laneIDs, " "); + // Check if clicked position over first lane has to be obtained + if (tagValues.hasAttribute(SUMO_ATTR_POSITION)) { + valuesMap[SUMO_ATTR_POSITION] = toString(mySelectorParentLanes->getSelectedLanes().front().second); + } + // Check if clicked position over last lane has to be obtained + if (tagValues.hasAttribute(SUMO_ATTR_ENDPOS)) { + valuesMap[SUMO_ATTR_ENDPOS] = toString(mySelectorParentLanes->getSelectedLanes().back().second); + } + // parse common attributes + if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { + return false; + } + // show warning dialogbox and stop check if input parameters are valid + if (myAdditionalAttributes->areValuesValid() == false) { + myAdditionalAttributes->showWarningMessage(); + return false; + } else { + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); + // try to build additional + if (GNEAdditionalHandler::buildAdditional(myViewNet->getNet(), true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { + // Refresh additional Parent Selector (For additionals that have a limited number of children) + myParentAdditional->refreshSelectorParentModul(); + // abort lane selector + mySelectorParentLanes->abortConsecutiveLaneSelector(); + // refresh additional attributes + myAdditionalAttributes->refreshRows(); + return true; + } else { + // additional cannot be build + return false; + } + } + } +} + + +bool +GNEAdditionalFrame::buildAdditionalOverView(std::map& valuesMap, const GNETagProperties& tagValues) { + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = generateID(nullptr); + } + // Obtain position as the clicked position over view + valuesMap[SUMO_ATTR_POSITION] = toString(myViewNet->snapToActiveGrid(myViewNet->getPositionInformation())); + // parse common attributes + if (!buildAdditionalCommonAttributes(valuesMap, tagValues)) { + return false; + } + // show warning dialogbox and stop check if input parameters are valid + if (myAdditionalAttributes->areValuesValid() == false) { + myAdditionalAttributes->showWarningMessage(); + return false; + } else { + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesMap, getPredefinedTagsMML(), toString(tagValues.getTag())); + // try to build additional + if (GNEAdditionalHandler::buildAdditional(myViewNet->getNet(), true, myAdditionalTagSelector->getCurrentTagProperties().getTag(), SUMOSAXAttrs, nullptr)) { + // Refresh additional Parent Selector (For additionals that have a limited number of children) + myParentAdditional->refreshSelectorParentModul(); + // clear selected eddges and lanes + mySelectorChildEdges->onCmdClearSelection(nullptr, 0, nullptr); + mySelectorChildLanes->onCmdClearSelection(nullptr, 0, nullptr); + // refresh additional attributes + myAdditionalAttributes->refreshRows(); + return true; + } else { + return false; + } + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEAdditionalFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,327 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEAdditionalFrame.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2015 +/// +// The Widget for add additional elements +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEAdditionalFrame + * The Widget for setting internal attributes of additional elements + */ +class GNEAdditionalFrame : public GNEFrame { + +public: + + // =========================================================================== + // class SelectorParentLanes + // =========================================================================== + + class SelectorParentLanes : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEAdditionalFrame::SelectorParentLanes) + public: + /// @brief constructor + SelectorParentLanes(GNEAdditionalFrame* additionalFrameParent); + + /// @brief destructor + ~SelectorParentLanes(); + + /// @brief show SelectorParentLanes modul + void showSelectorParentLanesModul(); + + /// @brief hide SelectorParentLanes + void hideSelectorParentLanesModul(); + + /// @brief start selection of consecutive lanes + void startConsecutiveLaneSelector(GNELane* lane, const Position& clickedPosition); + + /// @brief stop selection of consecutive lanes + bool stopConsecutiveLaneSelector(); + + /// @brief abort selection of consecutive lanes + void abortConsecutiveLaneSelector(); + + /// @brief return true if lane can be selected as consecutive lane + bool addSelectedLane(GNELane* lane, const Position& clickedPosition); + + /// @brief remove last added point + void removeLastSelectedLane(); + + /// @brief return true if modul is selecting lane + bool isSelectingLanes() const; + + /// @brief return true if modul is shown + bool isShown() const; + + /// @brief get selected lane color + const RGBColor& getSelectedLaneColor() const; + + /// @brief get current selected lanes + const std::vector >& getSelectedLanes() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press stop selection button + long onCmdStopSelection(FXObject*, FXSelector, void*); + + /// @brief Called when the user press abort selection button + long onCmdAbortSelection(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(SelectorParentLanes) + + private: + /// @brief pointer to additionalFrameParent + GNEAdditionalFrame* myAdditionalFrameParent; + + /// @brief button for stop selecting + FXButton* myStopSelectingButton; + + /// @brief button for abort selecting + FXButton* myAbortSelectingButton; + + /// @brief Vector with the selected lanes and the clicked position + std::vector > mySelectedLanes; + + /// @brief Vector with the colored lanes + std::vector myCandidateLanes; + + /// @brief color for candidate lanes + RGBColor myCandidateLaneColor; + + /// @brief color for selected lanes + RGBColor mySelectedLaneColor; + + /// @brief check if certain lane is selected + bool isLaneSelected(GNELane* lane) const; + }; + + // =========================================================================== + // class SelectorChildEdges + // =========================================================================== + + class SelectorChildEdges : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEAdditionalFrame::SelectorChildEdges) + + public: + /// @brief constructor + SelectorChildEdges(GNEAdditionalFrame* additionalFrameParent); + + /// @brief destructor + ~SelectorChildEdges(); + + /// @brief get list of selecte id's in string format + std::string getEdgeIdsSelected() const; + + /// @brief Show SelectorChildEdges Modul + void showSelectorChildEdgesModul(std::string search = ""); + + /// @brief hide SelectorChildEdges Modul + void hideSelectorChildEdgesModul(); + + /// @brief Update use selectedEdges + void updateUseSelectedEdges(); + + /// @name FOX-callbacks + /// @{ + /// @brief called when user trigger checkBox of useSelectedEdges + long onCmdUseSelectedEdges(FXObject*, FXSelector, void*); + + /// @brief called when user type in search box + long onCmdTypeInSearchBox(FXObject*, FXSelector, void*); + + /// @brief called when user select a edge of the list + long onCmdSelectEdge(FXObject*, FXSelector, void*); + + /// @brief called when clear selection button is pressed + long onCmdClearSelection(FXObject*, FXSelector, void*); + + /// @brief called when invert selection button is pressed + long onCmdInvertSelection(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(SelectorChildEdges) + + private: + /// @brief pointer to additional frame parent + GNEAdditionalFrame* myAdditionalFrameParent; + + /// @brief CheckBox for selected edges + FXCheckButton* myUseSelectedEdgesCheckButton; + + /// @brief List of SelectorChildEdges + FXList* myList; + + /// @brief text field for search edge IDs + FXTextField* myEdgesSearch; + + /// @brief button for clear selection + FXButton* myClearEdgesSelection; + + /// @brief button for invert selection + FXButton* myInvertEdgesSelection; + }; + + // =========================================================================== + // class SelectorChildLanes + // =========================================================================== + + class SelectorChildLanes : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEAdditionalFrame::SelectorChildLanes) + + public: + /// @brief constructor + SelectorChildLanes(GNEAdditionalFrame* additionalFrameParent); + + /// @brief destructor + ~SelectorChildLanes(); + + /// @brief get list of selecte lane ids in string format + std::string getLaneIdsSelected() const; + + /// @brief Show list of SelectorChildLanes Modul + void showSelectorChildLanesModul(std::string search = ""); + + /// @brief hide SelectorChildLanes Modul + void hideSelectorChildLanesModul(); + + // @brief Update use selectedLanes + void updateUseSelectedLanes(); + + /// @name FOX-callbacks + /// @{ + /// @brief called when user trigger checkBox of useSelectedLanes + long onCmdUseSelectedLanes(FXObject*, FXSelector, void*); + + /// @brief called when user type in search box + long onCmdTypeInSearchBox(FXObject*, FXSelector, void*); + + /// @brief called when user select a lane of the list + long onCmdSelectLane(FXObject*, FXSelector, void*); + + /// @brief called when clear selection button is pressed + long onCmdClearSelection(FXObject*, FXSelector, void*); + + /// @brief called when invert selection button is pressed + long onCmdInvertSelection(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(SelectorChildLanes) + + private: + /// @brief pointer to additional frame parent + GNEAdditionalFrame* myAdditionalFrameParent; + + /// @brief CheckBox for selected lanes + FXCheckButton* myUseSelectedLanesCheckButton; + + /// @brief List of SelectorChildLanes + FXList* myList; + + /// @brief text field for search lane IDs + FXTextField* myLanesSearch; + + /// @brief button for clear selection + FXButton* clearLanesSelection; + + /// @brief button for invert selection + FXButton* invertLanesSelection; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEAdditionalFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEAdditionalFrame(); + + /// @brief show Frame + void show(); + + /**@brief add additional element + * @param objectsUnderCursor collection of objects under cursor after click over view + * @return true if additional was sucesfully added + */ + bool addAdditional(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief show selector child lane and update use selected edges/lanes + void showSelectorChildLanesModul(); + + /// @brief getConsecutive Lane Selector + GNEAdditionalFrame::SelectorParentLanes* getConsecutiveLaneSelector() const; + +protected: + /// @brief Tag selected in TagSelector + void tagSelected(); + +private: + /// @brief generate a ID for an additiona element + std::string generateID(GNENetworkElement* networkElement) const; + + /// @brief build common additional attributes + bool buildAdditionalCommonAttributes(std::map& valuesMap, const GNETagProperties& tagValues); + + /// @brief build additional with Parent + bool buildAdditionalWithParent(std::map& valuesMap, GNEAdditional* parent, const GNETagProperties& tagValues); + + /// @brief build additional over an edge (parent of lane) + bool buildAdditionalOverEdge(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues); + + /// @brief build additional over a single lane + bool buildAdditionalOverLane(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues); + + /// @brief build additional over lanes + bool buildAdditionalOverLanes(std::map& valuesMap, GNELane* lane, const GNETagProperties& tagValues); + + /// @brief build additional over view + bool buildAdditionalOverView(std::map& valuesMap, const GNETagProperties& tagValues); + + /// @brief item selector + GNEFrameModuls::TagSelector* myAdditionalTagSelector; + + /// @brief internal additional attributes + GNEFrameAttributesModuls::AttributesCreator* myAdditionalAttributes; + + /// @brief Netedit parameter + GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + + /// @brief Modul for select parent lanes (currently only consecutives) + SelectorParentLanes* mySelectorParentLanes; + + /// @brief Modul for select a single parent additional + GNEFrameModuls::SelectorParent* myParentAdditional; + + /// @brief Modul for select child edges + SelectorChildEdges* mySelectorChildEdges; + + /// @brief Modul for select child lanes + SelectorChildLanes* mySelectorChildLanes; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,585 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2011-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEConnectorFrame.cpp +/// @author Jakob Erdmann +/// @date May 2011 +/// +// The Widget for modifying lane-to-lane connections +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEConnectorFrame::ConnectionModifications) ConnectionModificationsMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEConnectorFrame::ConnectionModifications::onCmdCancelModifications), + FXMAPFUNC(SEL_COMMAND, MID_OK, GNEConnectorFrame::ConnectionModifications::onCmdSaveModifications), +}; + +FXDEFMAP(GNEConnectorFrame::ConnectionOperations) ConnectionOperationsMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_CLEAR, GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_RESET, GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTDEADENDS, GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadEnds), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTDEADSTARTS, GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadStarts), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTCONFLICTS, GNEConnectorFrame::ConnectionOperations::onCmdSelectConflicts), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CONNECTORFRAME_SELECTPASS, GNEConnectorFrame::ConnectionOperations::onCmdSelectPass), +}; + +// Object implementation +FXIMPLEMENT(GNEConnectorFrame::ConnectionModifications, FXGroupBox, ConnectionModificationsMap, ARRAYNUMBER(ConnectionModificationsMap)) +FXIMPLEMENT(GNEConnectorFrame::ConnectionOperations, FXGroupBox, ConnectionOperationsMap, ARRAYNUMBER(ConnectionOperationsMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEConnectorFrame::CurrentLane - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::CurrentLane::CurrentLane(GNEConnectorFrame* connectorFrameParent) : + FXGroupBox(connectorFrameParent->myContentFrame, "Lane", GUIDesignGroupBoxFrame) { + // create lane label + myCurrentLaneLabel = new FXLabel(this, "No lane selected", 0, GUIDesignLabelLeft); +} + + +GNEConnectorFrame::CurrentLane::~CurrentLane() {} + + +void +GNEConnectorFrame::CurrentLane::updateCurrentLaneLabel(const std::string& laneID) { + if (laneID.empty()) { + myCurrentLaneLabel->setText("No lane selected"); + } else { + myCurrentLaneLabel->setText((std::string("Current Lane: ") + laneID).c_str()); + } +} + +// --------------------------------------------------------------------------- +// GNEConnectorFrame::ConnectionModifications - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::ConnectionModifications::ConnectionModifications(GNEConnectorFrame* connectorFrameParent) : + FXGroupBox(connectorFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + myConnectorFrameParent(connectorFrameParent) { + + // Create "Cancel" button + myCancelButton = new FXButton(this, "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)", + 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); +} + + +GNEConnectorFrame::ConnectionModifications::~ConnectionModifications() {} + + +long +GNEConnectorFrame::ConnectionModifications::onCmdCancelModifications(FXObject*, FXSelector, void*) { + if (myConnectorFrameParent->myCurrentEditedLane != 0) { + myConnectorFrameParent->getViewNet()->getUndoList()->p_abort(); + if (myConnectorFrameParent->myNumChanges) { + myConnectorFrameParent->getViewNet()->setStatusBarText("Changes reverted"); + } + myConnectorFrameParent->cleanup(); + myConnectorFrameParent->getViewNet()->updateViewNet(); + } + return 1; +} + + +long +GNEConnectorFrame::ConnectionModifications::onCmdSaveModifications(FXObject*, FXSelector, void*) { + if (myConnectorFrameParent->myCurrentEditedLane != 0) { + // check if routes has to be protected + if (myProtectRoutesCheckBox->isEnabled() && (myProtectRoutesCheckBox->getCheck() == TRUE)) { + for (const auto& i : myConnectorFrameParent->myCurrentEditedLane->getParentEdge()->getChildDemandElements()) { + if (!i->isDemandElementValid()) { + FXMessageBox::warning(getApp(), MBOX_OK, + "Error saving connection operations", "%s", + ("Connection edition cannot be saved because route '" + i->getID() + "' is broken.").c_str()); + return 1; + } + } + } + // finish route editing + myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); + if (myConnectorFrameParent->myNumChanges) { + myConnectorFrameParent->getViewNet()->setStatusBarText("Changes accepted"); + } + myConnectorFrameParent->cleanup(); + myConnectorFrameParent->getViewNet()->updateViewNet(); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNEConnectorFrame::ConnectionOperations - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::ConnectionOperations::ConnectionOperations(GNEConnectorFrame* connectorFrameParent) : + FXGroupBox(connectorFrameParent->myContentFrame, "Operations", GUIDesignGroupBoxFrame), + 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)", + 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)", + 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)", + 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", + 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", + 0, this, MID_CHOOSEN_CLEAR, GUIDesignButton); + // Create "Reset Selected" button + myResetSelectedButton = new FXButton(this, "Reset Selected\t\tRecomputes connections at all selected junctions", + 0, this, MID_CHOOSEN_RESET, GUIDesignButton); +} + + +GNEConnectorFrame::ConnectionOperations::~ConnectionOperations() {} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadEnds(FXObject*, FXSelector, void*) { + // select all lanes that have no successor lane + std::vector deadEnds; + // every edge knows its outgoing connections so we can look at each edge in isolation + const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); + for (auto i : edges) { + for (auto j : i->getLanes()) { + if (i->getNBEdge()->getConnectionsFromLane(j->getIndex()).size() == 0) { + deadEnds.push_back(j); + } + } + } + myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(deadEnds, GNESelectorFrame::ModificationMode::Operation::REPLACE); + return 1; +} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdSelectDeadStarts(FXObject*, FXSelector, void*) { + // select all lanes that have no predecessor lane + std::set deadStarts; + GNENet* net = myConnectorFrameParent->getViewNet()->getNet(); + // every edge knows only its outgoing connections so we look at whole junctions + const std::vector junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(); + for (auto i : junctions) { + // first collect all outgoing lanes + for (auto j : i->getNBNode()->getOutgoingEdges()) { + GNEEdge* edge = net->retrieveEdge(j->getID()); + for (auto k : edge->getLanes()) { + deadStarts.insert(k); + } + } + // then remove all approached lanes + for (auto j : i->getNBNode()->getIncomingEdges()) { + GNEEdge* edge = net->retrieveEdge(j->getID()); + for (auto k : edge->getNBEdge()->getConnections()) { + deadStarts.erase(net->retrieveEdge(k.toEdge->getID())->getLanes()[k.toLane]); + } + } + } + std::vector selectObjects(deadStarts.begin(), deadStarts.end()); + myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(selectObjects, GNESelectorFrame::ModificationMode::Operation::REPLACE); + return 1; +} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdSelectConflicts(FXObject*, FXSelector, void*) { + std::vector conflicts; + // conflicts happen per edge so we can look at each edge in isolation + const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); + for (auto i : edges) { + const EdgeVector destinations = i->getNBEdge()->getConnectedEdges(); + for (auto j : destinations) { + GNEEdge* dest = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdge(j->getID()); + for (auto k : dest->getLanes()) { + const bool isConflicted = count_if(i->getNBEdge()->getConnections().begin(), i->getNBEdge()->getConnections().end(), + NBEdge::connections_toedgelane_finder(j, (int)(k)->getIndex(), -1)) > 1; + if (isConflicted) { + conflicts.push_back(k); + } + } + } + + } + myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(conflicts, GNESelectorFrame::ModificationMode::Operation::REPLACE); + return 1; +} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdSelectPass(FXObject*, FXSelector, void*) { + std::vector pass; + const std::vector edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(); + for (auto i : edges) { + for (auto j : i->getNBEdge()->getConnections()) { + if (j.mayDefinitelyPass) { + pass.push_back(i->getLanes()[j.fromLane]); + } + } + } + myConnectorFrameParent->getViewNet()->getViewParent()->getSelectorFrame()->handleIDs(pass, GNESelectorFrame::ModificationMode::Operation::REPLACE); + return 1; +} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdClearSelectedConnections(FXObject*, FXSelector, void*) { + myConnectorFrameParent->myConnectionModifications->onCmdCancelModifications(0, 0, 0); + myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("clear connections from selected lanes, edges and " + toString(SUMO_TAG_JUNCTION) + "s"); + // clear junction's connection + auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true); + for (auto i : junctions) { + i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); // clear connections + i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList(), GNEAttributeCarrier::FEATURE_MODIFIED); // prevent re-guessing + } + // clear edge's connection + auto edges = myConnectorFrameParent->getViewNet()->getNet()->retrieveEdges(true); + for (auto i : edges) { + for (auto j : i->getLanes()) { + myConnectorFrameParent->removeConnections(j); + } + } + // clear lane's connection + auto lanes = myConnectorFrameParent->getViewNet()->getNet()->retrieveLanes(true); + for (auto i : lanes) { + myConnectorFrameParent->removeConnections(dynamic_cast(i)); + } + myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); + return 1; +} + + +long +GNEConnectorFrame::ConnectionOperations::onCmdResetSelectedConnections(FXObject*, FXSelector, void*) { + myConnectorFrameParent->myConnectionModifications->onCmdCancelModifications(0, 0, 0); + myConnectorFrameParent->getViewNet()->getUndoList()->p_begin("reset connections from selected lanes"); + auto junctions = myConnectorFrameParent->getViewNet()->getNet()->retrieveJunctions(true); + for (auto i : junctions) { + i->setLogicValid(false, myConnectorFrameParent->getViewNet()->getUndoList()); + } + myConnectorFrameParent->getViewNet()->getUndoList()->p_end(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNEConnectorFrame::ConnectionSelection - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::ConnectionSelection::ConnectionSelection(GNEConnectorFrame* connectorFrameParent) : + FXGroupBox(connectorFrameParent->myContentFrame, "Selection", GUIDesignGroupBoxFrame) { + // 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); +} + + +GNEConnectorFrame::ConnectionSelection::~ConnectionSelection() {} + +// --------------------------------------------------------------------------- +// GNEConnectorFrame::ConnectionLegend - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::ConnectionLegend::ConnectionLegend(GNEConnectorFrame* connectorFrameParent) : + FXGroupBox(connectorFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame), + mySourceColor(RGBColor::CYAN), + myTargetColor(RGBColor::GREEN), + myPotentialTargetColor(RGBColor(0, 64, 0, 255)), + myTargetPassColor(RGBColor::MAGENTA), + myConflictColor(RGBColor::YELLOW) { + + // create source label + mySourceLabel = new FXLabel(this, "Source lane", 0, GUIDesignLabelLeft); + mySourceLabel->setBackColor(MFXUtils::getFXColor(mySourceColor)); + + // create target label + myTargetLabel = new FXLabel(this, "Target lane", 0, GUIDesignLabelLeft); + myTargetLabel->setBackColor(MFXUtils::getFXColor(myTargetColor)); + + // create possible target label + myPossibleTargetLabel = new FXLabel(this, "Possible Target", 0, GUIDesignLabelLeft); + myPossibleTargetLabel->setBackColor(MFXUtils::getFXColor(myPotentialTargetColor)); + + // create target (pass) label + myTargetPassLabel = new FXLabel(this, "Target (pass)", 0, GUIDesignLabelLeft); + myTargetPassLabel->setBackColor(MFXUtils::getFXColor(myTargetPassColor)); + + // create conflict label + myConflictLabel = new FXLabel(this, "Conflict", 0, GUIDesignLabelLeft); + myConflictLabel->setBackColor(MFXUtils::getFXColor(myConflictColor)); +} + + +GNEConnectorFrame::ConnectionLegend::~ConnectionLegend() {} + + +const RGBColor& +GNEConnectorFrame::ConnectionLegend::getSourceColor() const { + return mySourceColor; +} + + +const RGBColor& +GNEConnectorFrame::ConnectionLegend::getTargetColor() const { + return myTargetColor; +} + + +const RGBColor& +GNEConnectorFrame::ConnectionLegend::getPotentialTargetColor() const { + return myPotentialTargetColor; +} + + +const RGBColor& +GNEConnectorFrame::ConnectionLegend::getTargetPassColor() const { + return myTargetPassColor; +} + + +const RGBColor& +GNEConnectorFrame::ConnectionLegend::getConflictColor() const { + return myConflictColor; +} + +// --------------------------------------------------------------------------- +// GNEConnectorFrame - methods +// --------------------------------------------------------------------------- + +GNEConnectorFrame::GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): + GNEFrame(horizontalFrameParent, viewNet, "Edit Connections"), + myCurrentEditedLane(0) { + // create current lane modul + myCurrentLane = new CurrentLane(this); + + // create connection modifications modul + myConnectionModifications = new ConnectionModifications(this); + + // create connection operations modul + myConnectionOperations = new ConnectionOperations(this); + + // create connection selection modul + myConnectionSelection = new ConnectionSelection(this); + + // create connection legend modul + myConnectionLegend = new ConnectionLegend(this); +} + + +GNEConnectorFrame::~GNEConnectorFrame() {} + + +void +GNEConnectorFrame::handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // build connection + buildConnection(objectsUnderCursor.getLaneFront(), myViewNet->getKeyPressed().shiftKeyPressed(), myViewNet->getKeyPressed().controlKeyPressed(), true); +} + + +GNEConnectorFrame::ConnectionModifications* +GNEConnectorFrame::getConnectionModifications() const { + return myConnectionModifications; +} + + +void +GNEConnectorFrame::removeConnections(GNELane* lane) { + // select lane as current lane + buildConnection(lane, false, false, true); // select as current lane + // iterate over all potential targets + for (auto i : myPotentialTargets) { + // remove connections using the apropiate parameters in function "buildConnection" + buildConnection(i, false, false, false); + } + // save modifications + myConnectionModifications->onCmdSaveModifications(0, 0, 0); +} + + +void +GNEConnectorFrame::buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle) { + if (myCurrentEditedLane == 0) { + myCurrentEditedLane = lane; + myCurrentEditedLane->setSpecialColor(&myConnectionLegend->getSourceColor()); + initTargets(); + myNumChanges = 0; + myViewNet->getUndoList()->p_begin("modify " + toString(SUMO_TAG_CONNECTION) + "s"); + } else if (myPotentialTargets.count(lane) + || (allowConflict && lane->getParentEdge()->getGNEJunctionSource() == myCurrentEditedLane->getParentEdge()->getGNEJunctionDestiny())) { + const int fromIndex = myCurrentEditedLane->getIndex(); + GNEEdge* srcEdge = myCurrentEditedLane->getParentEdge(); + GNEEdge* destEdge = lane->getParentEdge(); + std::vector connections = srcEdge->getNBEdge()->getConnectionsFromLane(fromIndex); + bool changed = false; + LaneStatus status = getLaneStatus(connections, lane); + if (status == CONFLICTED && allowConflict) { + status = UNCONNECTED; + } + switch (status) { + case UNCONNECTED: + if (toggle) { + // create new connection + NBEdge::Connection newCon(fromIndex, destEdge->getNBEdge(), lane->getIndex(), mayDefinitelyPass); + // if the connection was previously deleted (by clicking the same lane twice), restore all values + for (NBEdge::Connection& c : myDeletedConnections) { + // fromLane must be the same, only check toLane + if (c.toEdge == destEdge->getNBEdge() && c.toLane == lane->getIndex()) { + newCon = c; + newCon.mayDefinitelyPass = mayDefinitelyPass; + } + } + NBConnection newNBCon(srcEdge->getNBEdge(), fromIndex, destEdge->getNBEdge(), lane->getIndex(), newCon.tlLinkIndex); + myViewNet->getUndoList()->add(new GNEChange_Connection(srcEdge, newCon, false, true), true); + lane->setSpecialColor(mayDefinitelyPass ? &myConnectionLegend->getTargetPassColor() : &myConnectionLegend->getTargetColor()); + srcEdge->getGNEJunctionDestiny()->invalidateTLS(myViewNet->getUndoList(), NBConnection::InvalidConnection, newNBCon); + } + break; + case CONNECTED: + case CONNECTED_PASS: { + // remove connection + GNEConnection* con = srcEdge->retrieveGNEConnection(fromIndex, destEdge->getNBEdge(), lane->getIndex()); + myDeletedConnections.push_back(con->getNBEdgeConnection()); + myViewNet->getNet()->deleteConnection(con, myViewNet->getUndoList()); + lane->setSpecialColor(&myConnectionLegend->getPotentialTargetColor()); + changed = true; + break; + } + case CONFLICTED: + SVCPermissions fromPermissions = srcEdge->getNBEdge()->getPermissions(fromIndex); + SVCPermissions toPermissions = destEdge->getNBEdge()->getPermissions(lane->getIndex()); + if ((fromPermissions & toPermissions) == SVC_PEDESTRIAN) { + myViewNet->setStatusBarText("Pedestrian connections are generated automatically"); + } else if ((fromPermissions & toPermissions) == 0) { + myViewNet->setStatusBarText("Incompatible vehicle class permissions"); + } else { + myViewNet->setStatusBarText("Another lane from the same edge already connects to that lane"); + } + break; + } + if (changed) { + myNumChanges += 1; + } + } else { + myViewNet->setStatusBarText("Invalid target for " + toString(SUMO_TAG_CONNECTION)); + } + myCurrentLane->updateCurrentLaneLabel(myCurrentEditedLane->getID()); +} + + +void +GNEConnectorFrame::initTargets() { + // gather potential targets + NBNode* nbn = myCurrentEditedLane->getParentEdge()->getGNEJunctionDestiny()->getNBNode(); + + for (auto it : nbn->getOutgoingEdges()) { + GNEEdge* edge = myViewNet->getNet()->retrieveEdge(it->getID()); + for (auto it_lane : edge->getLanes()) { + myPotentialTargets.insert(it_lane); + } + } + // set color for existing connections + std::vector connections = myCurrentEditedLane->getParentEdge()->getNBEdge()->getConnectionsFromLane(myCurrentEditedLane->getIndex()); + for (auto it : myPotentialTargets) { + switch (getLaneStatus(connections, it)) { + case CONNECTED: + it->setSpecialColor(&myConnectionLegend->getTargetColor()); + break; + case CONNECTED_PASS: + it->setSpecialColor(&myConnectionLegend->getTargetPassColor()); + break; + case CONFLICTED: + it->setSpecialColor(&myConnectionLegend->getConflictColor()); + break; + case UNCONNECTED: + it->setSpecialColor(&myConnectionLegend->getPotentialTargetColor()); + break; + } + } +} + + +void +GNEConnectorFrame::cleanup() { + // restore colors of potential targets + for (auto it : myPotentialTargets) { + it->setSpecialColor(0); + } + // clear attributes + myPotentialTargets.clear(); + myNumChanges = 0; + myCurrentEditedLane->setSpecialColor(0); + myCurrentEditedLane = nullptr; + myDeletedConnections.clear(); + myCurrentLane->updateCurrentLaneLabel(""); +} + + +GNEConnectorFrame::LaneStatus +GNEConnectorFrame::getLaneStatus(const std::vector& connections, GNELane* targetLane) { + NBEdge* srcEdge = myCurrentEditedLane->getParentEdge()->getNBEdge(); + const int fromIndex = myCurrentEditedLane->getIndex(); + NBEdge* destEdge = targetLane->getParentEdge()->getNBEdge(); + const int toIndex = targetLane->getIndex(); + std::vector::const_iterator con_it = find_if( + connections.begin(), connections.end(), + NBEdge::connections_finder(fromIndex, destEdge, toIndex)); + const bool isConnected = con_it != connections.end(); + if (isConnected) { + if (con_it->mayDefinitelyPass) { + return CONNECTED_PASS; + } else { + return CONNECTED; + } + } else if (srcEdge->hasConnectionTo(destEdge, toIndex) + || (srcEdge->getPermissions(fromIndex) & destEdge->getPermissions(toIndex) & ~SVC_PEDESTRIAN) == 0) { + return CONFLICTED; + } else { + return UNCONNECTED; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEConnectorFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,320 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEConnectorFrame.h +/// @author Jakob Erdmann +/// @date May 2011 +/// +// The Widget for modifying lane-to-lane connections +/****************************************************************************/ +#pragma once + +#include +#include +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEConnectorFrame + * The Widget for modifying selections of network-elements + */ +class GNEConnectorFrame : public GNEFrame { + +public: + + // =========================================================================== + // class CurrentLane + // =========================================================================== + + class CurrentLane : protected FXGroupBox { + + public: + /// @brief constructor + CurrentLane(GNEConnectorFrame* connectorFrameParent); + + /// @brief destructor + ~CurrentLane(); + + /// @brief set current junction label + void updateCurrentLaneLabel(const std::string& laneID); + + private: + /// @brief Label for current Lane + FXLabel* myCurrentLaneLabel; + }; + + // =========================================================================== + // class ConnectionModifications + // =========================================================================== + + class ConnectionModifications : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEConnectorFrame::ConnectionModifications) + + public: + /// @brief constructor + ConnectionModifications(GNEConnectorFrame* connectorFrameParent); + + /// @brief destructor + ~ConnectionModifications(); + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user presses the OK-Button saves any connection modifications + long onCmdSaveModifications(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the Cancel-button discards any connection modifications + long onCmdCancelModifications(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(ConnectionModifications) + + private: + /// @brief pointer to connectorFrame parent + GNEConnectorFrame* myConnectorFrameParent; + + /// @brief "Cancel" button + FXButton* myCancelButton; + + /// @brief "OK" button + FXButton* mySaveButton; + + /// @brief protect routes checkbox + FXCheckButton* myProtectRoutesCheckBox; + }; + + // =========================================================================== + // class ConnectionOperations + // =========================================================================== + + class ConnectionOperations : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEConnectorFrame::ConnectionOperations) + + public: + /// @brief constructor + ConnectionOperations(GNEConnectorFrame* connectorFrameParent); + + /// @brief destructor + ~ConnectionOperations(); + + /// @name FOX-callbacks + /// @{ + + /// @brief Called when the user presses the select dead ends button + long onCmdSelectDeadEnds(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the select dead starts button + long onCmdSelectDeadStarts(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the select conflicts button + long onCmdSelectConflicts(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the select pass button + long onCmdSelectPass(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the clear selected connections button + long onCmdClearSelectedConnections(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the reset selected connections button + long onCmdResetSelectedConnections(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(ConnectionOperations) + + private: + /// @brief pointer to connectorFrame parent + GNEConnectorFrame* myConnectorFrameParent; + + /// @brief "Select Dead Ends" button + FXButton* mySelectDeadEndsButton; + + /// @brief "Select Dead Starts" button + FXButton* mySelectDeadStartsButton; + + /// @brief "Select Conflicts" button + FXButton* mySelectConflictsButton; + + /// @brief "Select Edges which may always pass" + FXButton* mySelectPassingButton; + + /// @brief "Clear Selected" + FXButton* myClearSelectedButton; + + /// @brief "Reset Selected" + FXButton* myResetSelectedButton; + }; + + // =========================================================================== + // class ConnectionSelection + // =========================================================================== + + class ConnectionSelection : protected FXGroupBox { + + public: + /// @brief constructor + ConnectionSelection(GNEConnectorFrame* connectorFrameParent); + + /// @brief destructor + ~ConnectionSelection(); + + private: + /// @brief Selection Hint + FXLabel* myHoldShiftLabel; + + /// @brief hold control label + FXLabel* myHoldControlLabel; + }; + + // =========================================================================== + // class ConnectionLegend + // =========================================================================== + + class ConnectionLegend : protected FXGroupBox { + + public: + /// @brief constructor + ConnectionLegend(GNEConnectorFrame* connectorFrameParent); + + /// @brief destructor + ~ConnectionLegend(); + + /// @brief get color for the from-lane of a connection + const RGBColor& getSourceColor() const; + + /// @brief get color for the to-lane of a connection + const RGBColor& getTargetColor() const; + + /// @brief get color for potential to-lane targets (currently unconnected) + const RGBColor& getPotentialTargetColor() const; + + /// @brief get color for the to-lane of a connection with pass attribute + const RGBColor& getTargetPassColor() const; + + /// @brief get color for a to-lane that cannot be used because another connection conflicts + const RGBColor& getConflictColor() const; + + private: + /// @brief source label + FXLabel* mySourceLabel; + + /// @brief target label + FXLabel* myTargetLabel; + + /// @brief possible target label + FXLabel* myPossibleTargetLabel; + + /// @brief target pass label + FXLabel* myTargetPassLabel; + + /// @brief conflict label + FXLabel* myConflictLabel; + + /// @brief color for the from-lane of a connection + RGBColor mySourceColor; + + /// @brief color for the to-lane of a connection + RGBColor myTargetColor; + + /// @brief color for potential to-lane targets (currently unconnected) + RGBColor myPotentialTargetColor; + + /// @brief color for the to-lane of a connection with pass attribute + RGBColor myTargetPassColor; + + /// @brief color for a to-lane that cannot be used because another connection conflicts + RGBColor myConflictColor; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEConnectorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEConnectorFrame(); + + /**@brief either sets the current lane or toggles the connection of the + * @param objectsUnderCursor collection of objects under cursor after click over view + */ + void handleLaneClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief get pointer to ConnectionModifications modul + ConnectionModifications* getConnectionModifications() const; + +private: + /// @brief the status of a target lane + enum LaneStatus { + UNCONNECTED, + CONNECTED, + CONNECTED_PASS, + CONFLICTED + }; + + /**@brief either sets the current lane or toggles the connection of the + * current lane to this lane (if they share a junction) + * @param[in] lane Either the lane to set as current lane, or the destination from current lane + * @param[in] mayDefinitelyPass Whether new connections shall have the pass attribute set + * @param[in] toggle Whether non-existing connections shall be created + */ + void buildConnection(GNELane* lane, bool mayDefinitelyPass, bool allowConflict, bool toggle); + + /// @brief init targets + void initTargets(); + + /// @brief clean up when deselecting current lane + void cleanup(); + + /// @brief remove connections + void removeConnections(GNELane* lane); + + /// @brief return the status of toLane + LaneStatus getLaneStatus(const std::vector& connections, GNELane* targetLane); + + /// @brief CurrentLane modul + CurrentLane* myCurrentLane; + + /// @brief ConnectionModifications modul + ConnectionModifications* myConnectionModifications; + + /// @brief ConnectionOperations modul + ConnectionOperations* myConnectionOperations; + + /// @brief ConnectionSelection modul + ConnectionSelection* myConnectionSelection; + + /// @brief ConnectionLegend modul + ConnectionLegend* myConnectionLegend; + + /// @brief the lane of which connections are to be modified + GNELane* myCurrentEditedLane; + + /// @brief the set of lanes to which the current lane may be connected + std::set myPotentialTargets; + + /// @brief number of changes + int myNumChanges; + + /// @brief the internal lanes belonging the the current junction indexed by their tl-index + std::map myInternalLanes; + + /// @brief vector of connections deleted in the current editing step + std::vector myDeletedConnections; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,162 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECreateEdgeFrame.cpp +/// @author Mirko Barthauer (Technische Universitaet Braunschweig) +/// @date May 2018 +/// +// The Widget for editing connection prohibits +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// =========================================================================== +// FOX callback mapping +// =========================================================================== +FXDEFMAP(GNECreateEdgeFrame) GNECreateEdgeFrameMap[] = { + /** currently unused **/ + FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNECreateEdgeFrame::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_OK, GNECreateEdgeFrame::onCmdOK) + /** **/ +}; + +// Object implementation +FXIMPLEMENT(GNECreateEdgeFrame, FXVerticalFrame, GNECreateEdgeFrameMap, ARRAYNUMBER(GNECreateEdgeFrameMap)) + +// =========================================================================== +// static members +// =========================================================================== + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNECreateEdgeFrame::GNECreateEdgeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Create Edge"), + myCreateEdgeSource(nullptr) { +} + + +GNECreateEdgeFrame::~GNECreateEdgeFrame() {} + + +void +GNECreateEdgeFrame::processClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, + GNEViewNetHelper::ObjectsUnderCursor& objectsUnderGrippedCursor, const bool oppositeEdge, const bool chainEdge) { + // obtain junction depending of gridEnabled + GNEJunction* junction = nullptr; + if (objectsUnderCursor.getJunctionFront()) { + junction = objectsUnderCursor.getJunctionFront(); + } else if (objectsUnderGrippedCursor.getJunctionFront()) { + junction = objectsUnderGrippedCursor.getJunctionFront(); + } + // begin undo list + if (!myViewNet->getUndoList()->hasCommandGroup()) { + myViewNet->getUndoList()->p_begin("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, + myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), myViewNet->getUndoList()); + // check if edge was sucesfully created + if (newEdge) { + // create another edge, if create opposite edge is enabled + if (oppositeEdge) { + myViewNet->getNet()->createEdge(junction, myCreateEdgeSource, myViewNet->getViewParent()->getInspectorFrame()->getTemplateEditor()->getEdgeTemplate(), + myViewNet->getUndoList(), "-" + newEdge->getNBEdge()->getID()); + } + // edge created, then unmark as create edge source + myCreateEdgeSource->unMarkAsCreateEdgeSource(); + // end undo list + if (myViewNet->getUndoList()->hasCommandGroup()) { + myViewNet->getUndoList()->p_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()->p_begin("create new " + toString(SUMO_TAG_EDGE)); + } else { + myCreateEdgeSource = nullptr; + } + } else { + myViewNet->setStatusBarText("An " + toString(SUMO_TAG_EDGE) + " with the same geometry already exists!"); + } + } else { + myViewNet->setStatusBarText("Start- and endpoint for an " + toString(SUMO_TAG_EDGE) + " must be distinct!"); + } + update(); + } +} + + +void GNECreateEdgeFrame::abortEdgeCreation() { + // if myCreateEdgeSource exist, unmark ist as create edge source + if (myCreateEdgeSource != nullptr) { + // remove current created edge source + myCreateEdgeSource->unMarkAsCreateEdgeSource(); + myCreateEdgeSource = nullptr; + } +} + + +void +GNECreateEdgeFrame::show() { + GNEFrame::show(); +} + + +void +GNECreateEdgeFrame::hide() { + GNEFrame::hide(); +} + + +long +GNECreateEdgeFrame::onCmdCancel(FXObject*, FXSelector, void*) { + /** unused **/ + return 1; +} + + +long +GNECreateEdgeFrame::onCmdOK(FXObject*, FXSelector, void*) { + /** unused **/ + return 1; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECreateEdgeFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,79 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECreateEdgeFrame.h +/// @author Pablo Alvarez Lopez +/// @date Dec 2018 +/// +// The Widget for create edges (and junctions) +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNECreateEdgeFrame + * The Widget for create edges + */ +class GNECreateEdgeFrame : public GNEFrame { + /// @brief FOX-declaration + FXDECLARE(GNECreateEdgeFrame) + +public: + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNECreateEdgeFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNECreateEdgeFrame(); + + /**@brief handle processClick and set the relative colouring + * @param[in] clickedPosition clicked position over ViewNet + * @param objectsUnderCursor collection of objects under cursor after click over view (note: in this case use non-constant reference due setCreatedJunction) + * @param objectsUnderGrippedCursor collection of objects under gripped cursor after click over view (note: in this case use non-constant reference due setCreatedJunction) + * @param oppositeEdge automatically create an opposite edge + * @param chainEdge create edges in chain mode + */ + void processClick(const Position& clickedPosition, GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor, + GNEViewNetHelper::ObjectsUnderCursor& objectsUnderGrippedCursor, const bool oppositeEdge, const bool chainEdge); + + /// @brief abort current edge creation + void abortEdgeCreation(); + + /// @brief show prohibition frame + void show(); + + /// @brief hide prohibition frame + void hide(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user presses the OK-Button saves any edge modifications + long onCmdOK(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the Cancel-button discards any edge modifications + long onCmdCancel(FXObject*, FXSelector, void*); + +protected: + FOX_CONSTRUCTOR(GNECreateEdgeFrame) + +private: + /// @brief source junction for new edge + GNEJunction* myCreateEdgeSource; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,582 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECrossingFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Oct 2016 +/// +// The Widget for add Crossing elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNECrossingFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_USESELECTED, GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_CLEARSELECTION, GNECrossingFrame::EdgesSelector::onCmdClearSelection), + FXMAPFUNC(SEL_COMMAND, MID_GNE_ADDITIONALFRAME_INVERTSELECTION, GNECrossingFrame::EdgesSelector::onCmdInvertSelection), +}; + +FXDEFMAP(GNECrossingFrame::CrossingParameters) CrossingParametersMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECrossingFrame::CrossingParameters::onCmdSetAttribute), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNECrossingFrame::CrossingParameters::onCmdHelp), +}; + +FXDEFMAP(GNECrossingFrame::CreateCrossing) CreateCrossingMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNECrossingFrame::CreateCrossing::onCmdCreateCrossing), +}; + +// Object implementation +FXIMPLEMENT(GNECrossingFrame::EdgesSelector, FXGroupBox, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap)) +FXIMPLEMENT(GNECrossingFrame::CrossingParameters, FXGroupBox, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap)) +FXIMPLEMENT(GNECrossingFrame::CreateCrossing, FXGroupBox, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNECrossingFrame::CurrentJunction - methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::CurrentJunction::CurrentJunction(GNECrossingFrame* crossingFrameParent) : + FXGroupBox(crossingFrameParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame) { + // create junction label + myCurrentJunctionLabel = new FXLabel(this, "No junction selected", 0, GUIDesignLabelLeft); +} + + +GNECrossingFrame::CurrentJunction::~CurrentJunction() {} + + +void +GNECrossingFrame::CurrentJunction::updateCurrentJunctionLabel(const std::string& junctionID) { + if (junctionID.empty()) { + myCurrentJunctionLabel->setText("No junction selected"); + } else { + myCurrentJunctionLabel->setText((std::string("Current Junction: ") + junctionID).c_str()); + } +} + +// --------------------------------------------------------------------------- +// GNECrossingFrame::EdgesSelector - methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::EdgesSelector::EdgesSelector(GNECrossingFrame* crossingFrameParent) : + FXGroupBox(crossingFrameParent->myContentFrame, ("selection of " + toString(SUMO_TAG_EDGE) + "s").c_str(), GUIDesignGroupBoxFrame), + 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); + + // Create button for clear selection + myClearEdgesSelection = new FXButton(this, ("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); +} + + +GNECrossingFrame::EdgesSelector::~EdgesSelector() {} + + +GNEJunction* +GNECrossingFrame::EdgesSelector::getCurrentJunction() const { + return myCurrentJunction; +} + + +void +GNECrossingFrame::EdgesSelector::enableEdgeSelector(GNEJunction* currentJunction) { + // restore color of all lanes of edge candidates + restoreEdgeColors(); + // Set current junction + myCurrentJunction = currentJunction; + // Update view net to show the new colors + myCrossingFrameParent->getViewNet()->updateViewNet(); + // check if use selected eges must be enabled + myUseSelectedEdges->disable(); + for (auto i : myCurrentJunction->getGNEEdges()) { + if (i->isAttributeCarrierSelected()) { + myUseSelectedEdges->enable(); + } + } + // Enable rest of elements + myClearEdgesSelection->enable(); + myInvertEdgesSelection->enable(); +} + + +void +GNECrossingFrame::EdgesSelector::disableEdgeSelector() { + // disable current junction + myCurrentJunction = nullptr; + // disable all elements of the EdgesSelector + myUseSelectedEdges->disable(); + myClearEdgesSelection->disable(); + myInvertEdgesSelection->disable(); + // Disable crossing parameters + myCrossingFrameParent->myCrossingParameters->disableCrossingParameters(); +} + + +void +GNECrossingFrame::EdgesSelector::restoreEdgeColors() { + if (myCurrentJunction != nullptr) { + // restore color of all lanes of edge candidates + for (auto i : myCurrentJunction->getGNEEdges()) { + for (auto j : i->getLanes()) { + j->setSpecialColor(nullptr); + } + } + // Update view net to show the new colors + myCrossingFrameParent->getViewNet()->updateViewNet(); + myCurrentJunction = nullptr; + } +} + + +long +GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { + myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction); + return 1; +} + + +long +GNECrossingFrame::EdgesSelector::onCmdClearSelection(FXObject*, FXSelector, void*) { + myCrossingFrameParent->myCrossingParameters->clearEdges(); + return 1; +} + + +long +GNECrossingFrame::EdgesSelector::onCmdInvertSelection(FXObject*, FXSelector, void*) { + myCrossingFrameParent->myCrossingParameters->invertEdges(myCurrentJunction); + return 1; +} + +// --------------------------------------------------------------------------- +// GNECrossingFrame::NeteditAttributes- methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::CrossingParameters::CrossingParameters(GNECrossingFrame* crossingFrameParent) : + FXGroupBox(crossingFrameParent->myContentFrame, "Crossing parameters", GUIDesignGroupBoxFrame), + myCrossingFrameParent(crossingFrameParent), + myCurrentParametersValid(true) { + FXHorizontalFrame* crossingParameter = nullptr; + // create label and string textField for edges + crossingParameter = new FXHorizontalFrame(this, 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); + 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); + 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->disable(); +} + + +GNECrossingFrame::CrossingParameters::~CrossingParameters() {} + + +void +GNECrossingFrame::CrossingParameters::enableCrossingParameters(bool hasTLS) { + // obtain Tag Values + const auto& tagProperties = GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING); + // Enable all elements of the crossing frames + myCrossingEdgesLabel->enable(); + myCrossingEdges->enable(); + myCrossingPriorityLabel->enable(); + // only enable priority check button if junction's crossing doesn't have TLS + if (hasTLS) { + myCrossingPriorityCheckButton->disable(); + } else { + myCrossingPriorityCheckButton->enable(); + } + myCrossingWidthLabel->enable(); + myCrossingWidth->enable(); + myHelpCrossingAttribute->enable(); + // set values of parameters + onCmdSetAttribute(nullptr, 0, nullptr); + // Crossings placed in junctinos with TLS always has priority + if (hasTLS) { + myCrossingPriorityCheckButton->setCheck(TRUE); + } else { + myCrossingPriorityCheckButton->setCheck(GNEAttributeCarrier::parse(tagProperties.getDefaultValue(SUMO_ATTR_PRIORITY))); + } + myCrossingWidth->setText(tagProperties.getDefaultValue(SUMO_ATTR_WIDTH).c_str()); + myCrossingWidth->setTextColor(FXRGB(0, 0, 0)); +} + + +void +GNECrossingFrame::CrossingParameters::disableCrossingParameters() { + // clear all values of parameters + myCrossingEdges->setText(""); + myCrossingPriorityCheckButton->setCheck(false); + myCrossingPriorityCheckButton->setText("false"); + myCrossingWidth->setText(""); + // Disable all elements of the crossing frames + myCrossingEdgesLabel->disable(); + myCrossingEdges->disable(); + myCrossingPriorityLabel->disable(); + myCrossingPriorityCheckButton->disable(); + myCrossingWidthLabel->disable(); + myCrossingWidth->disable(); + myHelpCrossingAttribute->disable(); + myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false); +} + + +bool +GNECrossingFrame::CrossingParameters::isCrossingParametersEnabled() const { + return myCrossingEdgesLabel->isEnabled(); +} + + +void +GNECrossingFrame::CrossingParameters::markEdge(GNEEdge* edge) { + GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction(); + if (currentJunction != nullptr) { + // Check if edge belongs to junction's edge + if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) != currentJunction->getGNEEdges().end()) { + // Update text field with the new edge + std::vector crossingEdges = GNEAttributeCarrier::parse > (myCrossingEdges->getText().text()); + // Check if new edge must be added or removed + std::vector::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID()); + if (itFinder == crossingEdges.end()) { + crossingEdges.push_back(edge->getID()); + } else { + crossingEdges.erase(itFinder); + } + myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); + } + // Update colors and attributes + onCmdSetAttribute(nullptr, 0, nullptr); + } +} + + +void +GNECrossingFrame::CrossingParameters::clearEdges() { + myCrossingEdges->setText(""); + // Update colors and attributes + onCmdSetAttribute(nullptr, 0, nullptr); +} + + +void +GNECrossingFrame::CrossingParameters::invertEdges(GNEJunction* parentJunction) { + std::vector crossingEdges; + for (auto i : parentJunction->getGNEEdges()) { + if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) == myCurrentSelectedEdges.end()) { + crossingEdges.push_back(i->getID()); + } + } + myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); + // Update colors and attributes + onCmdSetAttribute(nullptr, 0, nullptr); +} + + +void +GNECrossingFrame::CrossingParameters::useSelectedEdges(GNEJunction* parentJunction) { + std::vector crossingEdges; + for (auto i : parentJunction->getGNEEdges()) { + if (i->isAttributeCarrierSelected()) { + crossingEdges.push_back(i->getID()); + } + } + myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str()); + // Update colors and attributes + onCmdSetAttribute(nullptr, 0, nullptr); +} + + +std::vector +GNECrossingFrame::CrossingParameters::getCrossingEdges() const { + std::vector NBEdgeVector; + // Iterate over myCurrentSelectedEdges + for (auto i : myCurrentSelectedEdges) { + NBEdgeVector.push_back(i->getNBEdge()); + } + return NBEdgeVector; +} + + +bool +GNECrossingFrame::CrossingParameters::getCrossingPriority() const { + if (myCrossingPriorityCheckButton->getCheck()) { + return true; + } else { + return false; + } +} + + +bool +GNECrossingFrame::CrossingParameters::isCurrentParametersValid() const { + return myCurrentParametersValid; +} + + +double +GNECrossingFrame::CrossingParameters::getCrossingWidth() const { + return GNEAttributeCarrier::parse(myCrossingWidth->getText().text()); +} + + +long +GNECrossingFrame::CrossingParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) { + myCurrentParametersValid = true; + // get string vector with the edges + std::vector crossingEdges = GNEAttributeCarrier::parse > (myCrossingEdges->getText().text()); + // Clear selected edges + myCurrentSelectedEdges.clear(); + // iterate over vector of edge IDs + for (auto i : crossingEdges) { + GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->retrieveEdge(i, false); + GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction(); + // Check that edge exists and belongs to Junction + if (edge == nullptr) { + myCurrentParametersValid = false; + } else if (std::find(currentJunction->getGNEEdges().begin(), currentJunction->getGNEEdges().end(), edge) == currentJunction->getGNEEdges().end()) { + myCurrentParametersValid = false; + } else { + // select or unselected edge + auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge); + if (itFinder == myCurrentSelectedEdges.end()) { + myCurrentSelectedEdges.push_back(edge); + } else { + myCurrentSelectedEdges.erase(itFinder); + } + } + } + + // change color of textfield dependig of myCurrentParametersValid + if (myCurrentParametersValid) { + myCrossingEdges->setTextColor(FXRGB(0, 0, 0)); + myCrossingEdges->killFocus(); + } else { + myCrossingEdges->setTextColor(FXRGB(255, 0, 0)); + myCurrentParametersValid = false; + } + + // Update colors of edges + for (auto i : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getGNEEdges()) { + if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), i) != myCurrentSelectedEdges.end()) { + for (auto j : i->getLanes()) { + j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateSelectedColor()); + } + } else { + for (auto j : i->getLanes()) { + j->setSpecialColor(&myCrossingFrameParent->getEdgeCandidateColor()); + } + } + } + // Update view net + myCrossingFrameParent->getViewNet()->updateViewNet(); + + // Check that at least there are a selected edge + if (crossingEdges.empty()) { + myCurrentParametersValid = false; + } + + // change label of crossing priority + if (myCrossingPriorityCheckButton->getCheck()) { + myCrossingPriorityCheckButton->setText("true"); + } else { + myCrossingPriorityCheckButton->setText("false"); + } + + // Check width + if (GNEAttributeCarrier::canParse(myCrossingWidth->getText().text()) && + GNEAttributeCarrier::parse(myCrossingWidth->getText().text()) > 0) { + myCrossingWidth->setTextColor(FXRGB(0, 0, 0)); + myCrossingWidth->killFocus(); + } else { + myCrossingWidth->setTextColor(FXRGB(255, 0, 0)); + myCurrentParametersValid = false; + } + + // Enable or disable create crossing button depending of the current parameters + myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid); + return 0; +} + + +long +GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) { + myCrossingFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_CROSSING)); + return 1; +} + +// --------------------------------------------------------------------------- +// GNECrossingFrame::CreateCrossing - methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::CreateCrossing::CreateCrossing(GNECrossingFrame* crossingFrameParent) : + FXGroupBox(crossingFrameParent->myContentFrame, "Create", GUIDesignGroupBoxFrame), + myCrossingFrameParent(crossingFrameParent) { + // Create groupbox for create crossings + myCreateCrossingButton = new FXButton(this, "Create crossing", 0, this, MID_GNE_CREATE, GUIDesignButton); + myCreateCrossingButton->disable(); +} + + +GNECrossingFrame::CreateCrossing::~CreateCrossing() {} + + +long +GNECrossingFrame::CreateCrossing::onCmdCreateCrossing(FXObject*, FXSelector, void*) { + // First check that current parameters are valid + if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) { + // iterate over junction's crossing to find duplicated crossings + if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) { + // create new crossing + myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(), + myCrossingFrameParent->myCrossingParameters->getCrossingEdges(), + myCrossingFrameParent->myCrossingParameters->getCrossingWidth(), + myCrossingFrameParent->myCrossingParameters->getCrossingPriority(), + -1, -1, + PositionVector::EMPTY, + false, true), true); + // clear selected edges + myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0); + } else { + WRITE_WARNING("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."); + } + } + return 1; +} + + +void +GNECrossingFrame::CreateCrossing::setCreateCrossingButton(bool value) { + if (value) { + myCreateCrossingButton->enable(); + } else { + myCreateCrossingButton->disable(); + } +} + +// --------------------------------------------------------------------------- +// GNECrossingFrame - methods +// --------------------------------------------------------------------------- + +GNECrossingFrame::GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Crossings") { + // create CurrentJunction modul + myCurrentJunction = new CurrentJunction(this); + + // Create edge Selector modul + myEdgeSelector = new EdgesSelector(this); + + // Create CrossingParameters modul + myCrossingParameters = new CrossingParameters(this); + + // create CreateCrossing modul + myCreateCrossing = new CreateCrossing(this); + + // Create groupbox and labels for legends + FXGroupBox* groupBoxLegend = new FXGroupBox(myContentFrame, "Legend", GUIDesignGroupBoxFrame); + FXLabel* colorCandidateLabel = new FXLabel(groupBoxLegend, "Candidate", 0, GUIDesignLabelLeft); + colorCandidateLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateColor())); + FXLabel* colorSelectedLabel = new FXLabel(groupBoxLegend, "Selected", 0, GUIDesignLabelLeft); + colorSelectedLabel->setBackColor(MFXUtils::getFXColor(getEdgeCandidateSelectedColor())); + + // disable edge selector + myEdgeSelector->disableEdgeSelector(); +} + + +GNECrossingFrame::~GNECrossingFrame() { +} + + +void +GNECrossingFrame::hide() { + // restore color of all lanes of edge candidates + myEdgeSelector->restoreEdgeColors(); + // hide frame + GNEFrame::hide(); +} + + +void +GNECrossingFrame::addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // If current element is a junction + if (objectsUnderCursor.getJunctionFront()) { + // change label + myCurrentJunction->updateCurrentJunctionLabel(objectsUnderCursor.getJunctionFront()->getID()); + // Enable edge selector and crossing parameters + myEdgeSelector->enableEdgeSelector(objectsUnderCursor.getJunctionFront()); + myCrossingParameters->enableCrossingParameters(objectsUnderCursor.getJunctionFront()->getNBNode()->isTLControlled()); + // clears selected edges + myCrossingParameters->clearEdges(); + } else if (objectsUnderCursor.getEdgeFront()) { + // mark edge + myCrossingParameters->markEdge(objectsUnderCursor.getEdgeFront()); + } else { + // set default label + myCurrentJunction->updateCurrentJunctionLabel(""); + // restore color of all lanes of edge candidates + myEdgeSelector->restoreEdgeColors(); + // Disable edge selector + myEdgeSelector->disableEdgeSelector(); + } + // always update view after an operation + myViewNet->updateViewNet(); +} + + +void +GNECrossingFrame::createCrossingHotkey() { + if (myEdgeSelector->getCurrentJunction()) { + // simply call onCmdCreateCrossing of CreateCrossing modul + myCreateCrossing->onCmdCreateCrossing(0, 0, 0); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNECrossingFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,278 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNECrossingFrame.h +/// @author Pablo Alvarez Lopez +/// @date Oct 2016 +/// +// The Widget for add Crossing elements +/****************************************************************************/ +#pragma once + +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNECrossingFrame + * The Widget for setting internal attributes of Crossing elements + */ +class GNECrossingFrame : public GNEFrame { + +public: + + // =========================================================================== + // class CurrentJunction + // =========================================================================== + + class CurrentJunction : protected FXGroupBox { + + public: + /// @brief constructor + CurrentJunction(GNECrossingFrame* crossingFrameParent); + + /// @brief destructor + ~CurrentJunction(); + + /// @brief set current junction label + void updateCurrentJunctionLabel(const std::string& junctionID); + + private: + /// @brief Label for current Junction + FXLabel* myCurrentJunctionLabel; + + }; + + // =========================================================================== + // class EdgesSelector + // =========================================================================== + + class EdgesSelector : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNECrossingFrame::EdgesSelector) + + public: + /// @brief constructor + EdgesSelector(GNECrossingFrame* crossingFrameParent); + + /// @brief destructor + ~EdgesSelector(); + + /// @brief get current junction + GNEJunction* getCurrentJunction() const; + + /// @brief enable edgeSelector + void enableEdgeSelector(GNEJunction* currentJunction); + + /// @brief disable edgeSelector + void disableEdgeSelector(); + + /// @brief restore colors of all edges + void restoreEdgeColors(); + + /// @name FOX-callbacks + /// @{ + /// @brief called when useSelectedEdges button edge is pressed + long onCmdUseSelectedEdges(FXObject*, FXSelector, void*); + + /// @brief called when clear selection button is pressed + long onCmdClearSelection(FXObject*, FXSelector, void*); + + /// @brief called when invert selection button is pressed + long onCmdInvertSelection(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(EdgesSelector) + + private: + /// @brief pointer to GNECrossingFrame parent + GNECrossingFrame* myCrossingFrameParent; + + /// @brief CheckBox for selected edges + FXButton* myUseSelectedEdges; + + /// @brief button for clear selection + FXButton* myClearEdgesSelection; + + /// @brief button for invert selection + FXButton* myInvertEdgesSelection; + + /// @brief current Junction + GNEJunction* myCurrentJunction; + }; + + // =========================================================================== + // class CrossingParameters + // =========================================================================== + + class CrossingParameters : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNECrossingFrame::CrossingParameters) + + public: + /// @brief constructor + CrossingParameters(GNECrossingFrame* crossingFrameParent); + + /// @brief destructor + ~CrossingParameters(); + + /// @brief enable crossing parameters and set the default value of parameters + void enableCrossingParameters(bool hasTLS); + + /// @brief disable crossing parameters and clear parameters + void disableCrossingParameters(); + + /// @brief check if currently the CrossingParameters is enabled + bool isCrossingParametersEnabled() const; + + /// @brief mark or dismark edge + void markEdge(GNEEdge* edge); + + /// @brief clear edges + void clearEdges(); + + /// @brief invert edges + void invertEdges(GNEJunction* parentJunction); + + /// @brief use selected eges + void useSelectedEdges(GNEJunction* parentJunction); + + /// @brief get crossing NBedges + std::vector getCrossingEdges() const; + + /// @brief get crossing priority + bool getCrossingPriority() const; + + /// @brief get crossing width + double getCrossingWidth() const; + + /// @brief check if current parameters are valid + bool isCurrentParametersValid() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when user set a value + long onCmdSetAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when help button is pressed + long onCmdHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(CrossingParameters) + + private: + /// @brief pointer to GNECrossingFrame parent + GNECrossingFrame* myCrossingFrameParent; + + /// @brief current selected edges + std::vector myCurrentSelectedEdges; + + /// @brief Label for edges + FXLabel* myCrossingEdgesLabel; + + /// @brief TextField for edges + FXTextField* myCrossingEdges; + + /// @brief Label for Priority + FXLabel* myCrossingPriorityLabel; + + /// @brief CheckBox for Priority + FXCheckButton* myCrossingPriorityCheckButton; + + /// @brief Label for width + FXLabel* myCrossingWidthLabel; + + /// @brief TextField for width + FXTextField* myCrossingWidth; + + /// @brief button for help + FXButton* myHelpCrossingAttribute; + + /// @brief flag to check if current parameters are valid + bool myCurrentParametersValid; + }; + + // =========================================================================== + // class CreateCrossing + // =========================================================================== + + class CreateCrossing : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNECrossingFrame::CreateCrossing) + + public: + /// @brief constructor + CreateCrossing(GNECrossingFrame* crossingFrameParent); + + /// @brief destructor + ~CreateCrossing(); + + /// @brief enable or disable button create crossing + void setCreateCrossingButton(bool value); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press the button create edge + long onCmdCreateCrossing(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(CreateCrossing) + + private: + /// @brief pointer to crossingFrame parent + GNECrossingFrame* myCrossingFrameParent; + + /// @field FXButton for create Crossing + FXButton* myCreateCrossingButton; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNECrossingFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNECrossingFrame(); + + /// @brief hide crossing frame + void hide(); + + /**@brief add Crossing element + * @param objectsUnderCursor collection of objects under cursor after click over view + */ + void addCrossing(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief create crossing (used when user press ENTER key in Crossing mode) + void createCrossingHotkey(); + +protected: + FOX_CONSTRUCTOR(GNECrossingFrame) + +private: + /// @brief current junction modul + GNECrossingFrame::CurrentJunction* myCurrentJunction; + + /// @brief edge selector modul + GNECrossingFrame::EdgesSelector* myEdgeSelector; + + /// @brief crossing parameters modul + GNECrossingFrame::CrossingParameters* myCrossingParameters; + + /// @brief create crossing modul + GNECrossingFrame::CreateCrossing* myCreateCrossing; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,520 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPolygonFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Aug 2017 +/// +// The Widget for add polygons +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEPolygonFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEPolygonFrame::GEOPOICreator) GEOPOICreatorMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates), + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNEPolygonFrame::GEOPOICreator::onCmdSetFormat), + FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI), +}; + +// Object implementation +FXIMPLEMENT(GNEPolygonFrame::GEOPOICreator, FXGroupBox, GEOPOICreatorMap, ARRAYNUMBER(GEOPOICreatorMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEPolygonFrame::GEOPOICreator - methods +// --------------------------------------------------------------------------- + +GNEPolygonFrame::GEOPOICreator::GEOPOICreator(GNEPolygonFrame* polygonFrameParent) : + FXGroupBox(polygonFrameParent->myContentFrame, "GEO POI Creator", GUIDesignGroupBoxFrame), + 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); + // set lat-lon as default + myLatLonRadioButton->setCheck(TRUE); + // create text field for coordinates + myCoordinatesTextField = new FXTextField(this, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField); + // create checkBox + myCenterViewAfterCreationCheckButton = new FXCheckButton(this, "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); + // create information label + myLabelCartesianPosition = new FXLabel(this, "Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude", 0, GUIDesignLabelFrameInformation); +} + + +GNEPolygonFrame::GEOPOICreator::~GEOPOICreator() {} + + +void +GNEPolygonFrame::GEOPOICreator::showGEOPOICreatorModul() { + // check if there is an GEO Proj string is defined + if (GeoConvHelper::getFinal().getProjString() != "!") { + myCoordinatesTextField->enable(); + myCoordinatesTextField->setText(""); + myCoordinatesTextField->enable(); + myCreateGEOPOIButton->enable(); + } else { + myCoordinatesTextField->setText("No geo-conversion defined"); + myCoordinatesTextField->disable(); + myCreateGEOPOIButton->disable(); + } + show(); +} + + +void +GNEPolygonFrame::GEOPOICreator::hideGEOPOICreatorModul() { + hide(); +} + + +long +GNEPolygonFrame::GEOPOICreator::onCmdSetCoordinates(FXObject*, FXSelector, void*) { + // check if input contains spaces + std::string input = myCoordinatesTextField->getText().text(); + std::string inputWithoutSpaces; + for (const auto& i : input) { + if (i != ' ') { + inputWithoutSpaces.push_back(i); + } + } + // if input contains spaces, call this function again, and in other case set red text color + if (input.size() != inputWithoutSpaces.size()) { + myCoordinatesTextField->setText(inputWithoutSpaces.c_str()); + } + if (inputWithoutSpaces.size() > 0) { + myCreateGEOPOIButton->setText("Create GEO POI"); + } else { + myCreateGEOPOIButton->setText("Create GEO POI (clipboard)"); + } + // simply check if given value can be parsed to Position + if (GNEAttributeCarrier::canParse(myCoordinatesTextField->getText().text())) { + myCoordinatesTextField->setTextColor(FXRGB(0, 0, 0)); + myCoordinatesTextField->killFocus(); + // convert coordinates into lon-lat + Position geoPos = GNEAttributeCarrier::parse(myCoordinatesTextField->getText().text()); + if (myLatLonRadioButton->getCheck() == TRUE) { + geoPos.swapXY(); + } + GeoConvHelper::getFinal().x2cartesian_const(geoPos); + // check if GEO Position has to be swapped + // update myLabelCartesianPosition + myLabelCartesianPosition->setText(("Cartesian equivalence:\n- X = " + toString(geoPos.x()) + "\n- Y = " + toString(geoPos.y())).c_str()); + } else { + myCoordinatesTextField->setTextColor(FXRGB(255, 0, 0)); + myLabelCartesianPosition->setText("Cartesian equivalence:\n- X = give valid longitude\n- Y = give valid latitude"); + }; + return 1; +} + + +long +GNEPolygonFrame::GEOPOICreator::onCmdSetFormat(FXObject* obj, FXSelector, void*) { + //disable other radio button depending of selected option + if (obj == myLonLatRadioButton) { + myLonLatRadioButton->setCheck(TRUE); + myLatLonRadioButton->setCheck(FALSE); + } else if (obj == myLatLonRadioButton) { + myLonLatRadioButton->setCheck(FALSE); + myLatLonRadioButton->setCheck(TRUE); + } + // in both cases call onCmdSetCoordinates(0,0,0) to set new cartesian equivalence + onCmdSetCoordinates(0, 0, 0); + return 1; +} + + +long +GNEPolygonFrame::GEOPOICreator::onCmdCreateGEOPOI(FXObject*, FXSelector, void*) { + // first check if current GEO Position is valid + if (myPolygonFrameParent->myShapeAttributes->areValuesValid()) { + std::string geoPosStr = myCoordinatesTextField->getText().text(); + if (geoPosStr.empty()) { + // use clipboard + WRITE_WARNING("Using clipboard"); + geoPosStr = GUIUserIO::copyFromClipboard(*getApp()); + myCoordinatesTextField->setText(geoPosStr.c_str()); + // remove spaces, update cartesian value + onCmdSetCoordinates(0, 0, 0); + geoPosStr = myCoordinatesTextField->getText().text(); + myCoordinatesTextField->setText(""); + myCreateGEOPOIButton->setText("Create GEO POI (clipboard)"); + } + if (GNEAttributeCarrier::canParse(geoPosStr)) { + // obtain shape attributes and values + auto valuesMap = myPolygonFrameParent->myShapeAttributes->getAttributesAndValues(true); + // obtain netedit attributes and values + myPolygonFrameParent->myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myPolygonFrameParent->myViewNet->getNet()->generateShapeID(myPolygonFrameParent->myShapeTagSelector->getCurrentTagProperties().getTag()); + } + // force GEO attribute to true and obain position + valuesMap[SUMO_ATTR_GEO] = "true"; + Position geoPos = GNEAttributeCarrier::parse(geoPosStr); + // convert coordinates into lon-lat + if (myLatLonRadioButton->getCheck() == TRUE) { + geoPos.swapXY(); + } + GeoConvHelper::getFinal().x2cartesian_const(geoPos); + valuesMap[SUMO_ATTR_POSITION] = toString(geoPos); + // return AddShape::SUCCESS if POI was sucesfully created + if (myPolygonFrameParent->addPOI(valuesMap)) { + // check if view has to be centered over created GEO POI + if (myCenterViewAfterCreationCheckButton->getCheck() == TRUE) { + // create a boundary over given GEO Position and center view over it + Boundary centerPosition; + centerPosition.add(geoPos); + centerPosition = centerPosition.grow(10); + myPolygonFrameParent->myViewNet->getViewParent()->getView()->centerTo(centerPosition); + } + } else { + WRITE_WARNING("Could not create GEO POI"); + } + } + // refresh shape attributes + myPolygonFrameParent->myShapeAttributes->refreshRows(); + } + return 1; +} + + +// --------------------------------------------------------------------------- +// GNEPolygonFrame - methods +// --------------------------------------------------------------------------- + +GNEPolygonFrame::GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Shapes") { + + // create item Selector modul for shapes + myShapeTagSelector = new GNEFrameModuls::TagSelector(this, GNETagProperties::TagType::SHAPE); + + // Create shape parameters + myShapeAttributes = new GNEFrameAttributesModuls::AttributesCreator(this); + + // Create Netedit parameter + myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + + // Create drawing controls + myDrawingShape = new GNEFrameModuls::DrawingShape(this); + + /// @brief create GEOPOICreator + myGEOPOICreator = new GEOPOICreator(this); + + // set polygon as default shape + myShapeTagSelector->setCurrentTag(SUMO_TAG_POLY); +} + + +GNEPolygonFrame::~GNEPolygonFrame() { +} + + +void +GNEPolygonFrame::show() { + // refresh item selector + myShapeTagSelector->refreshTagProperties(); + // show frame + GNEFrame::show(); +} + + +GNEPolygonFrame::AddShape +GNEPolygonFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // Declare map to keep values + std::map valuesMap; + // 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 AddShape::INVALID; + } + // obtain shape attributes and values + valuesMap = myShapeAttributes->getAttributesAndValues(true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront()); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(myShapeTagSelector->getCurrentTagProperties().getTag()); + } + // obtain position + valuesMap[SUMO_ATTR_POSITION] = toString(clickedPosition); + // set GEO Position as false (because we have created POI clicking over View + valuesMap[SUMO_ATTR_GEO] = "false"; + // return AddShape::SUCCESS if POI was sucesfully created + if (addPOI(valuesMap)) { + // refresh shape attributes + myShapeAttributes->refreshRows(); + return AddShape::SUCCESS; + } else { + return AddShape::INVALID; + } + } else if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POILANE) { + // abort if lane is nullptr + if (objectsUnderCursor.getLaneFront() == nullptr) { + WRITE_WARNING(toString(SUMO_TAG_POILANE) + " can be only placed over lanes"); + return AddShape::INVALID; + } + // show warning dialogbox and stop if input parameters are invalid + if (myShapeAttributes->areValuesValid() == false) { + myShapeAttributes->showWarningMessage(); + return AddShape::INVALID; + } + // obtain shape attributes and values + valuesMap = myShapeAttributes->getAttributesAndValues(true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, objectsUnderCursor.getLaneFront()); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(myShapeTagSelector->getCurrentTagProperties().getTag()); + } + // obtain Lane + valuesMap[SUMO_ATTR_LANE] = objectsUnderCursor.getLaneFront()->getID(); + // obtain position over lane + valuesMap[SUMO_ATTR_POSITION] = toString(objectsUnderCursor.getLaneFront()->getLaneShape().nearest_offset_to_point2D(clickedPosition)); + // return AddShape::SUCCESS if POI was sucesfully created + if (addPOILane(valuesMap)) { + // refresh shape attributes + myShapeAttributes->refreshRows(); + return AddShape::SUCCESS; + } else { + return AddShape::INVALID; + } + } 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); + } + return AddShape::UPDATEDTEMPORALSHAPE; + } else { + // return AddShape::NOTHING if is drawing isn't enabled + return AddShape::NOTHING; + } + } else { + myViewNet->setStatusBarText("Current selected shape isn't valid."); + return AddShape::INVALID; + } +} + + +std::string +GNEPolygonFrame::getIdsSelected(const FXList* list) { + // Obtain Id's of list + std::string vectorOfIds; + for (int i = 0; i < list->getNumItems(); i++) { + if (list->isItemSelected(i)) { + if (vectorOfIds.size() > 0) { + vectorOfIds += " "; + } + vectorOfIds += (list->getItem(i)->getText()).text(); + } + } + return vectorOfIds; +} + + +GNEFrameModuls::DrawingShape* +GNEPolygonFrame::getDrawingShapeModul() const { + return myDrawingShape; +} + + +bool +GNEPolygonFrame::shapeDrawed() { + // show warning dialogbox and stop check if input parameters are valid + if (!myShapeAttributes->areValuesValid()) { + myShapeAttributes->showWarningMessage(); + return false; + } else if (myDrawingShape->getTemporalShape().size() == 0) { + WRITE_WARNING("Polygon shape cannot be empty"); + return false; + } else { + // Declare map to keep values + std::map valuesMap = myShapeAttributes->getAttributesAndValues(true); + // obtain netedit attributes and values + myNeteditAttributes->getNeteditAttributesAndValues(valuesMap, nullptr); + // Check if ID has to be generated + if (valuesMap.count(SUMO_ATTR_ID) == 0) { + valuesMap[SUMO_ATTR_ID] = myViewNet->getNet()->generateShapeID(SUMO_TAG_POLY); + } + // obtain shape and check if has to be closed + PositionVector temporalShape = myDrawingShape->getTemporalShape(); + if (valuesMap[GNE_ATTR_CLOSE_SHAPE] == "true") { + temporalShape.closePolygon(); + } + valuesMap[SUMO_ATTR_SHAPE] = toString(temporalShape); + // obtain geo (by default false) + valuesMap[SUMO_ATTR_GEO] = "false"; + // return true if polygon was successfully created + if (addPolygon(valuesMap)) { + // refresh shape attributes + myShapeAttributes->refreshRows(); + return true; + } + } + return false; +} + + +void +GNEPolygonFrame::tagSelected() { + if (myShapeTagSelector->getCurrentTagProperties().getTag() != SUMO_TAG_NOTHING) { + // if there are parmeters, show and Recalc groupBox + myShapeAttributes->showAttributesCreatorModul(myShapeTagSelector->getCurrentTagProperties(), {}); + // show netedit attributes + myNeteditAttributes->showNeteditAttributesModul(myShapeTagSelector->getCurrentTagProperties()); + // Check if drawing mode has to be shown + if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POLY) { + myDrawingShape->showDrawingShape(); + } else { + myDrawingShape->hideDrawingShape(); + } + // Check if GEO POI Creator has to be shown + if (myShapeTagSelector->getCurrentTagProperties().getTag() == SUMO_TAG_POI) { + myGEOPOICreator->showGEOPOICreatorModul(); + } else { + myGEOPOICreator->hideGEOPOICreatorModul(); + } + } else { + // hide all widgets + myShapeAttributes->hideAttributesCreatorModul(); + myNeteditAttributes->hideNeteditAttributesModul(); + myDrawingShape->hideDrawingShape(); + myGEOPOICreator->hideGEOPOICreatorModul(); + } +} + + +bool +GNEPolygonFrame::addPolygon(const std::map& polyValues) { + // parse attributes from polyValues + std::string id = polyValues.at(SUMO_ATTR_ID); + std::string type = polyValues.at(SUMO_ATTR_TYPE); + RGBColor color = RGBColor::parseColor(polyValues.at(SUMO_ATTR_COLOR)); + std::string layerStr = polyValues.at(SUMO_ATTR_LAYER); + double angle = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_ANGLE)); + std::string imgFile = polyValues.at(SUMO_ATTR_IMGFILE); + bool relativePath = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_RELATIVEPATH)); + PositionVector shape = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_SHAPE)); + bool fill = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_FILL)); + double lineWidth = GNEAttributeCarrier::parse(polyValues.at(SUMO_ATTR_LINEWIDTH)); + // parse layer + double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER; + // create new Polygon only if number of shape points is greather than 2 + myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POLY)); + if ((shape.size() > 0) && myViewNet->getNet()->getAttributeCarriers()->addPolygon(id, type, color, layer, angle, imgFile, relativePath, shape, false, fill, lineWidth)) { + // set manually attributes use GEO, block movement and block shape + GNEShape* poly = myViewNet->getNet()->retrieveShape(SUMO_TAG_POLY, id); + poly->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, polyValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); + poly->setAttribute(GNE_ATTR_BLOCK_SHAPE, polyValues.at(GNE_ATTR_BLOCK_SHAPE), myViewNet->getUndoList()); + myViewNet->getUndoList()->p_end(); + return true; + } else { + // abort creation + myViewNet->getUndoList()->p_abort(); + return false; + } +} + + +bool +GNEPolygonFrame::addPOI(const std::map& POIValues) { + // parse attributes from POIValues + std::string id = POIValues.at(SUMO_ATTR_ID); + std::string type = POIValues.at(SUMO_ATTR_TYPE); + RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR)); + std::string layerStr = POIValues.at(SUMO_ATTR_LAYER); + Position pos = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION)); + double angle = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_ANGLE)); + std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE); + bool relativePath = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_RELATIVEPATH)); + double widthPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_WIDTH)); + double heightPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_HEIGHT)); + double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER_POI; + bool geo = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_GEO)); + // create new POI + myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POI)); + if (myViewNet->getNet()->getAttributeCarriers()->addPOI(id, type, color, pos, geo, "", 0, 0, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) { + // Set manually the attribute block movement + GNEShape* POI = myViewNet->getNet()->retrieveShape(SUMO_TAG_POI, id); + POI->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, POIValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); + myViewNet->getUndoList()->p_end(); + return true; + } else { + // abort creation + myViewNet->getUndoList()->p_abort(); + return false; + } +} + + +bool +GNEPolygonFrame::addPOILane(const std::map& POIValues) { + // parse attributes from POIValues + std::string id = POIValues.at(SUMO_ATTR_ID); + std::string type = POIValues.at(SUMO_ATTR_TYPE); + RGBColor color = RGBColor::parseColor(POIValues.at(SUMO_ATTR_COLOR)); + std::string layerStr = POIValues.at(SUMO_ATTR_LAYER); + double angle = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_ANGLE)); + std::string imgFile = POIValues.at(SUMO_ATTR_IMGFILE); + bool relativePath = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_RELATIVEPATH)); + GNELane* lane = myViewNet->getNet()->retrieveLane(POIValues.at(SUMO_ATTR_LANE)); + double posLane = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION)); + double posLat = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_POSITION_LAT)); + double widthPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_WIDTH)); + double heightPOI = GNEAttributeCarrier::parse(POIValues.at(SUMO_ATTR_HEIGHT)); + // parse layer + double layer = GNEAttributeCarrier::canParse(layerStr) ? GNEAttributeCarrier::parse(layerStr) : Shape::DEFAULT_LAYER_POI; + // create new POILane + myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POILANE)); + if (myViewNet->getNet()->getAttributeCarriers()->addPOI(id, type, color, Position(), false, lane->getID(), posLane, posLat, layer, angle, imgFile, relativePath, widthPOI, heightPOI)) { + // Set manually the attribute block movement + GNEShape* POILane = myViewNet->getNet()->retrieveShape(SUMO_TAG_POILANE, id); + POILane->setAttribute(GNE_ATTR_BLOCK_MOVEMENT, POIValues.at(GNE_ATTR_BLOCK_MOVEMENT), myViewNet->getUndoList()); + myViewNet->getUndoList()->p_end(); + return true; + } else { + // abort creation + myViewNet->getUndoList()->p_abort(); + return false; + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEPolygonFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,160 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEPolygonFrame.h +/// @author Pablo Alvarez Lopez +/// @date Aug 2017 +/// +// The Widget for add polygons +/****************************************************************************/ +#pragma once +#include + +// =========================================================================== +// class definitions +// =========================================================================== +/** +* @class GNEPolygonFrame +* The Widget for setting internal attributes of shape elements +*/ +class GNEPolygonFrame : public GNEFrame { + +public: + + /// @brief enum with all possible values after try to create an shape using frame + enum class AddShape { + SUCCESS, // Shape was successfully created + UPDATEDTEMPORALSHAPE, // Added or removed a new point to temporal shape + INVALID, // Shape wasn't created + NOTHING // Nothing to do + }; + + // =========================================================================== + // class GEOPOICreator + // =========================================================================== + + class GEOPOICreator : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNEPolygonFrame::GEOPOICreator) + + public: + /// @brief constructor + GEOPOICreator(GNEPolygonFrame* polygonFrameParent); + + /// @brief destructor + ~GEOPOICreator(); + + /// @brief Show list of GEOPOICreator Modul + void showGEOPOICreatorModul(); + + /// @brief hide GEOPOICreator Modul + void hideGEOPOICreatorModul(); + + /// @name FOX-callbacks + /// @{ + /// @brief called when user change the coordinates TextField + long onCmdSetCoordinates(FXObject*, FXSelector, void*); + + /// @brief called when user select a format radio button + long onCmdSetFormat(FXObject*, FXSelector, void*); + + /// @brief called when user type in search box + long onCmdCreateGEOPOI(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(GEOPOICreator) + + private: + /// @brief pointer to Shape frame parent + GNEPolygonFrame* myPolygonFrameParent; + + /// @brief radio button for the configuration lon-lat + FXRadioButton* myLonLatRadioButton; + + /// @brief radio button for the configuration lat-lon + FXRadioButton* myLatLonRadioButton; + + /// @brief text field for given geo coordinates + FXTextField* myCoordinatesTextField; + + /// @brief button for enable or disable certer view after creation of GEO POI + FXCheckButton* myCenterViewAfterCreationCheckButton; + + /// @brief button for create GEO Coordinates + FXButton* myCreateGEOPOIButton; + + /// @brief FXLabel for the equivalent position of GEO Position in Cartesian Position + FXLabel* myLabelCartesianPosition; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEPolygonFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEPolygonFrame(); + + /// @brief show Frame + void show(); + + /**@brief process click over Viewnet + * @param[in] clickedPosition clicked position over ViewNet + * @param[in] ObjectsUnderCursor objects under cursor after click over view + * @return AddShapeStatus with the result of operation + */ + GNEPolygonFrame::AddShape processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief get list of selecte id's in string format + static std::string getIdsSelected(const FXList* list); + + /// @brief get drawing mode editor + GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; + +protected: + /**@brief build a shaped element using the drawed shape + * return true if was successfully created + * @note called when user stop drawing polygon + */ + bool shapeDrawed(); + + /// @brief Tag selected in TagSelector + void tagSelected(); + + /// @brief add Polygon + bool addPolygon(const std::map& POIValues); + + /// @brief add POI + bool addPOI(const std::map& POIValues); + + /// @brief add POILane + bool addPOILane(const std::map& POIValues); + +private: + /// @brief shape tag selector + GNEFrameModuls::TagSelector* myShapeTagSelector; + + /// @brief shape internal attributes + GNEFrameAttributesModuls::AttributesCreator* myShapeAttributes; + + /// @brief Netedit parameter + GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + + /// @brief Drawing shape + GNEFrameModuls::DrawingShape* myDrawingShape; + + /// @brief GEOPOICreator + GEOPOICreator* myGEOPOICreator; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,284 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEProhibitionFrame.cpp +/// @author Mirko Barthauer (Technische Universitaet Braunschweig) +/// @date May 2018 +/// +// The Widget for editing connection prohibits +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "GNEProhibitionFrame.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNEProhibitionFrame) GNEProhibitionFrameMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNEProhibitionFrame::onCmdCancel), + FXMAPFUNC(SEL_COMMAND, MID_OK, GNEProhibitionFrame::onCmdOK) +}; + +// Object implementation +FXIMPLEMENT(GNEProhibitionFrame, FXVerticalFrame, GNEProhibitionFrameMap, ARRAYNUMBER(GNEProhibitionFrameMap)) + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNEProhibitionFrame::RelativeToConnection - methods +// --------------------------------------------------------------------------- + +GNEProhibitionFrame::RelativeToConnection::RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent) : + FXGroupBox(prohibitionFrameParent->myContentFrame, "Relative to connection", GUIDesignGroupBoxFrame), + myProhibitionFrameParent(prohibitionFrameParent) { + // Create label for current connection description and update it + myConnDescriptionLabel = new FXLabel(this, "", nullptr, GUIDesignLabelFrameInformation); + // update description + updateDescription(); +} + + +GNEProhibitionFrame::RelativeToConnection::~RelativeToConnection() {} + + +void +GNEProhibitionFrame::RelativeToConnection::updateDescription() const { + // update depending of myCurrentConn + if (myProhibitionFrameParent->myCurrentConn == nullptr) { + myConnDescriptionLabel->setText("No Connection selected\n"); + } else { + myConnDescriptionLabel->setText(("from lane " + myProhibitionFrameParent->myCurrentConn->getLaneFrom()->getMicrosimID() + + "\nto lane " + myProhibitionFrameParent->myCurrentConn->getLaneTo()->getMicrosimID()).c_str()); + } +} + +// --------------------------------------------------------------------------- +// GNEProhibitionFrame::ProhibitionLegend - methods +// --------------------------------------------------------------------------- + +GNEProhibitionFrame::ProhibitionLegend::ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent) : + FXGroupBox(prohibitionFrameParent->myContentFrame, "Legend", GUIDesignGroupBoxFrame), + 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); + 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->setBackColor(MFXUtils::getFXColor(myUndefinedColor)); + // label for yields + legendLabel = new FXLabel(this, "Yields", nullptr, GUIDesignLabelFrameInformation); + legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitedColor)); + // label for right of way + legendLabel = new FXLabel(this, "Has right of way", nullptr, GUIDesignLabelFrameInformation); + legendLabel->setBackColor(MFXUtils::getFXColor(myProhibitingColor)); + // label for unregulated conflict + legendLabel = new FXLabel(this, "Unregulated conflict", nullptr, GUIDesignLabelFrameInformation); + legendLabel->setBackColor(MFXUtils::getFXColor(myUnregulatedConflictColor)); + // label for mutual conflict + legendLabel = new FXLabel(this, "Mutual conflict", nullptr, GUIDesignLabelFrameInformation); + legendLabel->setBackColor(MFXUtils::getFXColor(myMutualConflictColor)); +} + + +GNEProhibitionFrame::ProhibitionLegend::~ProhibitionLegend() {} + + +const RGBColor& +GNEProhibitionFrame::ProhibitionLegend::getUndefinedColor() const { + return myUndefinedColor; +} + + +const RGBColor& +GNEProhibitionFrame::ProhibitionLegend::getProhibitedColor() const { + return myProhibitedColor; +} + + +const RGBColor& +GNEProhibitionFrame::ProhibitionLegend::getProhibitingColor() const { + return myProhibitingColor; +} + + +const RGBColor& +GNEProhibitionFrame::ProhibitionLegend::getUnregulatedConflictColor() const { + return myUnregulatedConflictColor; +} + + +const RGBColor& +GNEProhibitionFrame::ProhibitionLegend::getMutualConflictColor() const { + return myMutualConflictColor; +} + +// --------------------------------------------------------------------------- +// GNEProhibitionFrame::Modifications - methods +// --------------------------------------------------------------------------- + +GNEProhibitionFrame::Modifications::Modifications(GNEProhibitionFrame* prohibitionFrameParent) : + FXGroupBox(prohibitionFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame) { + + // Create "OK" button + mySaveButton = new FXButton(this, "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)", + GUIIconSubSys::getIcon(GUIIcon::CANCEL), prohibitionFrameParent, MID_CANCEL, GUIDesignButton); + + // Currently mySaveButton is disabled + mySaveButton->disable(); + mySaveButton->hide(); +} + + +GNEProhibitionFrame::Modifications::~Modifications() {} + +// --------------------------------------------------------------------------- +// GNEProhibitionFrame - methods +// --------------------------------------------------------------------------- + +GNEProhibitionFrame::GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "Prohibits"), + myCurrentConn(nullptr) { + // set frame header label + getFrameHeaderLabel()->setText("Prohibitions"); + + // create RelativeToConnection + myRelativeToConnection = new RelativeToConnection(this); + + // create ProhibitionLegend + myProhibitionLegend = new ProhibitionLegend(this); + + // create Modifications + myModifications = new Modifications(this); +} + + +GNEProhibitionFrame::~GNEProhibitionFrame() {} + + +void +GNEProhibitionFrame::handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // build prohibition + buildProhibition(objectsUnderCursor.getConnectionFront(), myViewNet->getKeyPressed().shiftKeyPressed(), myViewNet->getKeyPressed().controlKeyPressed(), true); +} + + +void +GNEProhibitionFrame::show() { + GNEFrame::show(); +} + + +void +GNEProhibitionFrame::hide() { + GNEFrame::hide(); +} + + +long +GNEProhibitionFrame::onCmdCancel(FXObject*, FXSelector, void*) { + if (myCurrentConn != nullptr) { + for (auto conn : myConcernedConns) { + conn->setSpecialColor(nullptr); + } + myCurrentConn->setSpecialColor(nullptr); + myCurrentConn = nullptr; + myConcernedConns.clear(); + myRelativeToConnection->updateDescription(); + myViewNet->updateViewNet(); + } + return 1; +} + + +long +GNEProhibitionFrame::onCmdOK(FXObject*, FXSelector, void*) { + return 1; +} + +// --------------------------------------------------------------------------- +// GNEProhibitionFrame - private methods +// --------------------------------------------------------------------------- + +void +GNEProhibitionFrame::buildProhibition(GNEConnection* conn, bool /* mayDefinitelyPass */, bool /* allowConflict */, bool /* toggle */) { + if (myCurrentConn == nullptr) { + myCurrentConn = conn; + myCurrentConn->setSpecialColor(&myViewNet->getVisualisationSettings().colorSettings.selectedProhibitionColor); + + // determine prohibition status of all other connections with respect to the selected one + GNEJunction* junction = myCurrentConn->getEdgeFrom()->getGNEJunctionDestiny(); + std::vector allConns = junction->getGNEConnections(); + NBNode* node = junction->getNBNode(); + NBEdge* currentConnFrom = myCurrentConn->getEdgeFrom()->getNBEdge(); + + const int currentLinkIndex = node->getConnectionIndex(currentConnFrom, myCurrentConn->getNBEdgeConnection()); + std::string currentFoesString = node->getFoes(currentLinkIndex); + std::string currentResponseString = node->getResponse(currentLinkIndex); + std::reverse(currentFoesString.begin(), currentFoesString.end()); + std::reverse(currentResponseString.begin(), currentResponseString.end()); + // iterate over all connections + for (const auto& i : allConns) { + if (i != myCurrentConn) { + NBEdge* otherConnFrom = i->getEdgeFrom()->getNBEdge(); + const int linkIndex = node->getConnectionIndex(otherConnFrom, i->getNBEdgeConnection()); + std::string responseString = node->getResponse(linkIndex); + std::reverse(responseString.begin(), responseString.end()); + // determine the prohibition status + bool foes = ((int)currentFoesString.size() > linkIndex) && (currentFoesString[linkIndex] == '1'); + bool forbids = ((int)responseString.size() > currentLinkIndex) && (responseString[currentLinkIndex] == '1'); + bool forbidden = ((int)currentResponseString.size() > linkIndex) && (currentResponseString[linkIndex] == '1'); + // insert in myConcernedConns + myConcernedConns.insert(i); + // change color depending of prohibition status + if (!foes) { + i->setSpecialColor(&myProhibitionLegend->getUndefinedColor()); + } else { + if (forbids && forbidden) { + i->setSpecialColor(&myProhibitionLegend->getMutualConflictColor()); + } else if (forbids) { + i->setSpecialColor(&myProhibitionLegend->getProhibitedColor()); + } else if (forbidden) { + i->setSpecialColor(&myProhibitionLegend->getProhibitingColor()); + } else { + i->setSpecialColor(&myProhibitionLegend->getUnregulatedConflictColor()); + } + } + } + } + // update description + myRelativeToConnection->updateDescription(); + } +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNEProhibitionFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,190 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEProhibitionFrame.h +/// @author Mirko Barthauer (Technische Universitaet Braunschweig) +/// @date May 2018 +/// +// The Widget for remove network-elements +/****************************************************************************/ +#pragma once +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEConnection; +class GNEAttributeCarrier; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNEProhibitionFrame + * The Widget for editing connection foes + */ +class GNEProhibitionFrame : public GNEFrame { + /// @brief FOX-declaration + FXDECLARE(GNEProhibitionFrame) + +public: + + /// @brief the prohibition status of a connection + enum ConnStatus { + UNDEFINED, + PROHIBITED, + PROHIBITING + }; + + // =========================================================================== + // class RelativeToConnection + // =========================================================================== + + class RelativeToConnection : protected FXGroupBox { + + public: + /// @brief constructor + RelativeToConnection(GNEProhibitionFrame* prohibitionFrameParent); + + /// @brief destructor + ~RelativeToConnection(); + + /// @brief update description + void updateDescription() const; + + private: + /// @brief pointer to prohibition frame parent + GNEProhibitionFrame* myProhibitionFrameParent; + + /// @brief the label that shows the currently selected connection + FXLabel* myConnDescriptionLabel; + }; + + // =========================================================================== + // class ProhibitionLegend + // =========================================================================== + + class ProhibitionLegend : protected FXGroupBox { + + public: + /// @brief constructor + ProhibitionLegend(GNEProhibitionFrame* prohibitionFrameParent); + + /// @brief destructor + ~ProhibitionLegend(); + + /// @brief get color for non-conflicting pairs of connections + const RGBColor& getUndefinedColor() const; + + /// @brief get color for waiting connections + const RGBColor& getProhibitedColor() const; + + /// @brief get color for connections with precedence + const RGBColor& getProhibitingColor() const; + + /// @brief get color for unregulated conflicts + const RGBColor& getUnregulatedConflictColor() const; + + /// @brief get color for mutual conflicts + const RGBColor& getMutualConflictColor() const; + + private: + /// @brief color for non-conflicting pairs of connections + RGBColor myUndefinedColor; + + /// @brief color for waiting connections + RGBColor myProhibitedColor; + + /// @brief color for connections with precedence + RGBColor myProhibitingColor; + + /// @brief color for unregulated conflicts + RGBColor myUnregulatedConflictColor; + + /// @brief color for mutual conflicts + RGBColor myMutualConflictColor; + }; + + // =========================================================================== + // class Modifications + // =========================================================================== + + class Modifications : protected FXGroupBox { + + public: + /// @brief constructor + Modifications(GNEProhibitionFrame* prohibitionFrameParent); + + /// @brief destructor + ~Modifications(); + + private: + /// @brief "Save" button + FXButton* mySaveButton; + + /// @brief "Cancel" button + FXButton* myCancelButton; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNEProhibitionFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNEProhibitionFrame(); + + /**@brief handle prohibitions and set the relative colouring + * @param objectsUnderCursor collection of objects under cursor after click over view + */ + void handleProhibitionClick(const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief show prohibition frame + void show(); + + /// @brief hide prohibition frame + void hide(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user presses the OK-Button saves any prohibition modifications + long onCmdOK(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the Cancel-button discards any prohibition modifications + long onCmdCancel(FXObject*, FXSelector, void*); + + /// @} + +protected: + FOX_CONSTRUCTOR(GNEProhibitionFrame) + + /// @brief build prohibition + void buildProhibition(GNEConnection* conn, bool mayDefinitelyPass, bool allowConflict, bool toggle); + +private: + /// @brief Relative To Connection + RelativeToConnection* myRelativeToConnection; + + /// @brief prohibition legend + ProhibitionLegend* myProhibitionLegend; + + /// @brief Modifications + Modifications* myModifications; + + /// @brief the connection which prohibits + GNEConnection* myCurrentConn; + + /// @brief the set of connections which + std::set myConcernedConns; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETAZFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETAZFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETAZFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETAZFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1548 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZFrame.cpp +/// @author Pablo Alvarez Lopez +/// @date Oct 2018 +/// +// The Widget for add TAZ elements +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNETAZFrame.h" + + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNETAZFrame::TAZParameters) TAZParametersMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE_DIALOG, GNETAZFrame::TAZParameters::onCmdSetColorAttribute), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZParameters::onCmdSetAttribute), + FXMAPFUNC(SEL_COMMAND, MID_HELP, GNETAZFrame::TAZParameters::onCmdHelp), +}; + +FXDEFMAP(GNETAZFrame::TAZSaveChanges) TAZSaveChangesMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_OK, GNETAZFrame::TAZSaveChanges::onCmdSaveChanges), + FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNETAZFrame::TAZSaveChanges::onCmdCancelChanges), +}; + +FXDEFMAP(GNETAZFrame::TAZChildDefaultParameters) TAZChildDefaultParametersMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZChildDefaultParameters::onCmdSetDefaultValues), + FXMAPFUNC(SEL_COMMAND, MID_GNE_SELECT, GNETAZFrame::TAZChildDefaultParameters::onCmdUseSelectedEdges), +}; + +FXDEFMAP(GNETAZFrame::TAZSelectionStatistics) TAZSelectionStatisticsMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNETAZFrame::TAZSelectionStatistics::onCmdSetNewValues), +}; + +FXDEFMAP(GNETAZFrame::TAZEdgesGraphic) TAZEdgesGraphicMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CHOOSEN_OPERATION, GNETAZFrame::TAZEdgesGraphic::onCmdChoosenBy), +}; + +// 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)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZCurrent - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZCurrent::TAZEdge::TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNETAZSourceSink* _TAZSource, GNETAZSourceSink* _TAZSink) : + edge(_edge), + TAZSource(_TAZSource), + TAZSink(_TAZSink), + sourceColor(0), + sinkColor(0), + sourcePlusSinkColor(0), + sourceMinusSinkColor(0), + myTAZCurrentParent(TAZCurrentParent) +{ } + + +GNETAZFrame::TAZCurrent::TAZEdge::~TAZEdge() {} + + +void +GNETAZFrame::TAZCurrent::TAZEdge::updateColors() { + sourceColor = GNEAttributeCarrier::parse(TAZSource->getAttribute(GNE_ATTR_TAZCOLOR)); + sinkColor = GNEAttributeCarrier::parse(TAZSink->getAttribute(GNE_ATTR_TAZCOLOR)); + // Obtain Source+Sink needs more steps. First obtain Source+Sink Weight + double sourcePlusSinkWeight = TAZSource->getDepartWeight() + TAZSink->getDepartWeight(); + // avoid division between zero + if ((myTAZCurrentParent->myMaxSourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight) == 0) { + sourcePlusSinkColor = 0; + } else { + // calculate percentage relative to the max and min Source+Sink weight + double percentage = (sourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight) / + (myTAZCurrentParent->myMaxSourcePlusSinkWeight - myTAZCurrentParent->myMinSourcePlusSinkWeight); + // convert percentage to a value between [0-9] (because we have only 10 colors) + if (percentage >= 1) { + sourcePlusSinkColor = 9; + } else if (percentage < 0) { + sourcePlusSinkColor = 0; + } else { + sourcePlusSinkColor = (int)(percentage * 10); + } + } + // Obtain Source+Sink needs more steps. First obtain Source-Sink Weight + double sourceMinusSinkWeight = TAZSource->getDepartWeight() - TAZSink->getDepartWeight(); + // avoid division between zero + if ((myTAZCurrentParent->myMaxSourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight) == 0) { + sourceMinusSinkColor = 0; + } else { + // calculate percentage relative to the max and min Source-Sink weight + double percentage = (sourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight) / + (myTAZCurrentParent->myMaxSourceMinusSinkWeight - myTAZCurrentParent->myMinSourceMinusSinkWeight); + // convert percentage to a value between [0-9] (because we have only 10 colors) + if (percentage >= 1) { + sourceMinusSinkColor = 9; + } else if (percentage < 0) { + sourceMinusSinkColor = 0; + } else { + sourceMinusSinkColor = (int)(percentage * 10); + } + } +} + + +GNETAZFrame::TAZCurrent::TAZCurrent(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "TAZ", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent), + myEditedTAZ(nullptr), + myMaxSourcePlusSinkWeight(0), + myMinSourcePlusSinkWeight(-1), + myMaxSourceMinusSinkWeight(0), + myMinSourceMinusSinkWeight(-1) { + // create TAZ label + myTAZCurrentLabel = new FXLabel(this, "No TAZ selected", 0, GUIDesignLabelLeft); +} + + +GNETAZFrame::TAZCurrent::~TAZCurrent() {} + + +void +GNETAZFrame::TAZCurrent::setTAZ(GNETAZ* editedTAZ) { + // set new current TAZ + myEditedTAZ = editedTAZ; + // update label and moduls + if (myEditedTAZ != nullptr) { + myTAZCurrentLabel->setText(("Current TAZ: " + myEditedTAZ->getID()).c_str()); + // obtain a copy of all edges of the net (to avoid slowdown during manipulations) + myNetEdges = myTAZFrameParent->myViewNet->getNet()->retrieveEdges(); + // obtain a copy of all SELECTED edges of the net (to avoid slowdown during manipulations) + mySelectedEdges = myTAZFrameParent->myViewNet->getNet()->retrieveEdges(true); + // resfresh TAZ Edges + refreshTAZEdges(); + // hide TAZ parameters + myTAZFrameParent->myTAZParameters->hideTAZParametersModul(); + // hide Netedit parameters + myTAZFrameParent->myNeteditAttributes->hideNeteditAttributesModul(); + // hide drawing shape + myTAZFrameParent->myDrawingShape->hideDrawingShape(); + // show edge common parameters + myTAZFrameParent->myTAZCommonStatistics->showTAZCommonStatisticsModul(); + // show save TAZ Edges + myTAZFrameParent->myTAZSaveChanges->showTAZSaveChangesModul(); + // show edge common parameters + myTAZFrameParent->myTAZChildDefaultParameters->showTAZChildDefaultParametersModul(); + // show Edges graphics + myTAZFrameParent->myTAZEdgesGraphic->showTAZEdgesGraphicModul(); + } else { + // show TAZ parameters + myTAZFrameParent->myTAZParameters->showTAZParametersModul(); + // show Netedit parameters + myTAZFrameParent->myNeteditAttributes->showNeteditAttributesModul(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); + // show drawing shape + myTAZFrameParent->myDrawingShape->showDrawingShape(); + // hide edge common parameters + myTAZFrameParent->myTAZCommonStatistics->hideTAZCommonStatisticsModul(); + // hide edge common parameters + myTAZFrameParent->myTAZChildDefaultParameters->hideTAZChildDefaultParametersModul(); + // hide Edges graphics + myTAZFrameParent->myTAZEdgesGraphic->hideTAZEdgesGraphicModul(); + // hide save TAZ Edges + myTAZFrameParent->myTAZSaveChanges->hideTAZSaveChangesModul(); + // restore label + myTAZCurrentLabel->setText("No TAZ selected"); + // clear net edges (always the last step due hideTAZEdgesGraphicModul() function) + myNetEdges.clear(); + // clear selected edges + mySelectedEdges.clear(); + // reset all weight values + myMaxSourcePlusSinkWeight = 0; + myMinSourcePlusSinkWeight = -1; + myMaxSourceMinusSinkWeight = 0; + myMinSourceMinusSinkWeight = -1; + } +} + + +GNETAZ* +GNETAZFrame::TAZCurrent::getTAZ() const { + return myEditedTAZ; +} + + +bool +GNETAZFrame::TAZCurrent::isTAZEdge(GNEEdge* edge) const { + // simply iterate over edges and check edge parameter + for (const auto& i : myTAZEdges) { + if (i.edge == edge) { + return true; + } + } + // not found, then return false + return false; +} + + +const std::vector& +GNETAZFrame::TAZCurrent::getNetEdges() const { + return myNetEdges; +} + + +const std::vector& +GNETAZFrame::TAZCurrent::getSelectedEdges() const { + return mySelectedEdges; +} + + +const std::vector& +GNETAZFrame::TAZCurrent::getTAZEdges() const { + return myTAZEdges; +} + + +void +GNETAZFrame::TAZCurrent::refreshTAZEdges() { + // clear all curren TAZEdges + myTAZEdges.clear(); + // clear weight values + myMaxSourcePlusSinkWeight = 0; + myMinSourcePlusSinkWeight = -1; + myMaxSourceMinusSinkWeight = 0; + myMinSourceMinusSinkWeight = -1; + // only refresh if we're editing an TAZ + if (myEditedTAZ) { + // iterate over child additional and create TAZEdges + for (const auto& i : myEditedTAZ->getChildAdditionals()) { + addTAZChild(dynamic_cast(i)); + } + // update colors after add all edges + for (auto& i : myTAZEdges) { + i.updateColors(); + } + // update edge colors + myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); + } +} + + +void +GNETAZFrame::TAZCurrent::addTAZChild(GNETAZSourceSink* sourceSink) { + // first make sure that additional is an TAZ Source or Sink + if (sourceSink && ((sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) || (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSINK))) { + GNEEdge* edge = myTAZFrameParent->myViewNet->getNet()->retrieveEdge(sourceSink->getAttribute(SUMO_ATTR_EDGE)); + // first check if TAZEdge has to be created + bool createTAZEdge = true; + for (auto& i : myTAZEdges) { + if (i.edge == edge) { + createTAZEdge = false; + // update TAZ Source or Sink + if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { + i.TAZSource = sourceSink; + } else { + i.TAZSink = sourceSink; + } + } + } + // check if additional has to be created + if (createTAZEdge) { + if (sourceSink->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { + myTAZEdges.push_back(TAZEdge(this, edge, sourceSink, nullptr)); + } else { + myTAZEdges.push_back(TAZEdge(this, edge, nullptr, sourceSink)); + } + } + // recalculate weights + myMaxSourcePlusSinkWeight = 0; + myMinSourcePlusSinkWeight = -1; + myMaxSourceMinusSinkWeight = 0; + myMinSourceMinusSinkWeight = -1; + for (const auto& i : myTAZEdges) { + // make sure that both TAZ Source and Sink exist + if (i.TAZSource && i.TAZSink) { + // obtain source plus sink + double sourcePlusSink = i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight(); + // check myMaxSourcePlusSinkWeight + if (sourcePlusSink > myMaxSourcePlusSinkWeight) { + myMaxSourcePlusSinkWeight = sourcePlusSink; + } + // check myMinSourcePlusSinkWeight + if ((myMinSourcePlusSinkWeight == -1) || (sourcePlusSink < myMinSourcePlusSinkWeight)) { + myMinSourcePlusSinkWeight = sourcePlusSink; + } + // obtain source minus sink + double sourceMinusSink = i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight(); + // use valor absolute + if (sourceMinusSink < 0) { + sourceMinusSink *= -1; + } + // check myMaxSourcePlusSinkWeight + if (sourceMinusSink > myMaxSourceMinusSinkWeight) { + myMaxSourceMinusSinkWeight = sourceMinusSink; + } + // check myMinSourcePlusSinkWeight + if ((myMinSourceMinusSinkWeight == -1) || (sourceMinusSink < myMinSourceMinusSinkWeight)) { + myMinSourceMinusSinkWeight = sourceMinusSink; + } + } + } + } else { + throw ProcessError("Invalid TAZ Child"); + } +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZCommonStatistics - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZCommonStatistics::TAZCommonStatistics(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Statistics", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent) { + // create label for statistics + myStatisticsLabel = new FXLabel(this, "Statistics", 0, GUIDesignLabelFrameInformation); +} + + +GNETAZFrame::TAZCommonStatistics::~TAZCommonStatistics() {} + + +void +GNETAZFrame::TAZCommonStatistics::showTAZCommonStatisticsModul() { + // always update statistics after show + updateStatistics(); + show(); +} + + +void +GNETAZFrame::TAZCommonStatistics::hideTAZCommonStatisticsModul() { + hide(); +} + + +void +GNETAZFrame::TAZCommonStatistics::updateStatistics() { + if (myTAZFrameParent->myTAZCurrent->getTAZ()) { + // declare ostringstream for statistics + std::ostringstream information; + information + << "- Number of Edges: " << toString(myTAZFrameParent->myTAZCurrent->getTAZ()->getChildAdditionals().size() / 2) << "\n" + << "- Min source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SOURCE) << "\n" + << "- Max source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SOURCE) << "\n" + << "- Average source: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SOURCE) << "\n" + << "\n" + << "- Min sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MIN_SINK) << "\n" + << "- Max sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_MAX_SINK) << "\n" + << "- Average sink: " << myTAZFrameParent->myTAZCurrent->getTAZ()->getAttribute(GNE_ATTR_AVERAGE_SINK); + // set new label + myStatisticsLabel->setText(information.str().c_str()); + } else { + myStatisticsLabel->setText("No TAZ Selected"); + } +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZSaveChanges - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZSaveChanges::TAZSaveChanges(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent) { + // Create groupbox for save changes + mySaveChangesButton = new FXButton(this, "Save 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->disable(); +} + + +GNETAZFrame::TAZSaveChanges::~TAZSaveChanges() {} + + +void +GNETAZFrame::TAZSaveChanges::showTAZSaveChangesModul() { + show(); +} + + +void +GNETAZFrame::TAZSaveChanges::hideTAZSaveChangesModul() { + // cancel changes before hidding modul + onCmdCancelChanges(0, 0, 0); + hide(); +} + + +void +GNETAZFrame::TAZSaveChanges::enableButtonsAndBeginUndoList() { + // check that save changes is disabled + if (!mySaveChangesButton->isEnabled()) { + // enable mySaveChangesButton and myCancelChangesButton + mySaveChangesButton->enable(); + myCancelChangesButton->enable(); + // start undo list set + myTAZFrameParent->myViewNet->getUndoList()->p_begin("TAZ attributes"); + } +} + + +bool +GNETAZFrame::TAZSaveChanges::isChangesPending() const { + // simply check if save Changes Button is enabled + return mySaveChangesButton->isEnabled(); +} + + +long +GNETAZFrame::TAZSaveChanges::onCmdSaveChanges(FXObject*, FXSelector, void*) { + // check that save changes is enabled + if (mySaveChangesButton->isEnabled()) { + // disable mySaveChangesButton and myCancelChangesButtonand + mySaveChangesButton->disable(); + myCancelChangesButton->disable(); + // finish undo list set + myTAZFrameParent->myViewNet->getUndoList()->p_end(); + } + return 1; +} + + +long +GNETAZFrame::TAZSaveChanges::onCmdCancelChanges(FXObject*, FXSelector, void*) { + // check that save changes is enabled + if (mySaveChangesButton->isEnabled()) { + // disable buttons + mySaveChangesButton->disable(); + myCancelChangesButton->disable(); + // abort undo list + myTAZFrameParent->myViewNet->getUndoList()->p_abort(); + // always refresh TAZ Edges after removing TAZSources/Sinks + myTAZFrameParent->myTAZCurrent->refreshTAZEdges(); + // update use edges button + myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); + } + return 1; +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZChildDefaultParameters - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZChildDefaultParameters::TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "TAZ Sources/Sinks", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent), + myDefaultTAZSourceWeight(1), + myDefaultTAZSinkWeight(1) { + // create checkbox for toogle membership + FXHorizontalFrame* toogleMembershipFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + new FXLabel(toogleMembershipFrame, "Membership", 0, GUIDesignLabelAttribute); + myToggleMembership = new FXCheckButton(toogleMembershipFrame, "Toggle", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton); + // by default enabled + myToggleMembership->setCheck(TRUE); + // create default TAZ Source weight + myDefaultTAZSourceFrame = new FXHorizontalFrame(this, 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); + 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); + // Create information label + std::ostringstream information; + information + << "- Toogle Membership:\n" + << " Create new Sources/Sinks\n" + << " with given weights."; + myInformationLabel = new FXLabel(this, information.str().c_str(), 0, GUIDesignLabelFrameInformation); +} + + +GNETAZFrame::TAZChildDefaultParameters::~TAZChildDefaultParameters() {} + + +void +GNETAZFrame::TAZChildDefaultParameters::showTAZChildDefaultParametersModul() { + // check if TAZ selection Statistics Modul has to be shown + if (myToggleMembership->getCheck() == FALSE) { + myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); + } else { + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); + } + // update selected button + updateSelectEdgesButton(); + // show modul + show(); +} + + +void +GNETAZFrame::TAZChildDefaultParameters::hideTAZChildDefaultParametersModul() { + // hide TAZ Selection Statistics Modul + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); + // hide modul + hide(); +} + + +void +GNETAZFrame::TAZChildDefaultParameters::updateSelectEdgesButton() { + if (myToggleMembership->getCheck() == TRUE) { + // check if use selected edges has to be enabled + if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) { + myUseSelectedEdges->setText("Use selected edges"); + myUseSelectedEdges->enable(); + } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) { + myUseSelectedEdges->setText("Remove all edges"); + myUseSelectedEdges->enable(); + } else { + myUseSelectedEdges->setText("Use selected edges"); + myUseSelectedEdges->disable(); + } + } else if (myTAZFrameParent->getTAZCurrentModul()->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& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { + if (!i.edge->isAttributeCarrierSelected()) { + allSelected = false; + } + } + if (allSelected) { + myUseSelectedEdges->setText("Remove all edges from selection"); + } else { + myUseSelectedEdges->setText("Add all edges to selection"); + } + } else if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 1) { + if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().front().edge->isAttributeCarrierSelected()) { + myUseSelectedEdges->setText("Remove edge from selection"); + } else { + myUseSelectedEdges->setText("Add edge to selection"); + } + } else { + // check if all edges of TAZChildren selected are selected + bool allSelected = true; + for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { + if (!i.edge->isAttributeCarrierSelected()) { + allSelected = false; + } + } + if (allSelected) { + myUseSelectedEdges->setText(("Remove " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " from to selection").c_str()); + } else { + myUseSelectedEdges->setText(("Add " + toString(myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size()) + " edges to selection").c_str()); + } + } + } else { + // TAZ doesn't have children, then disable button + myUseSelectedEdges->disable(); + } +} + + +double +GNETAZFrame::TAZChildDefaultParameters::getDefaultTAZSourceWeight() const { + return myDefaultTAZSourceWeight; +} + + +double +GNETAZFrame::TAZChildDefaultParameters::getDefaultTAZSinkWeight() const { + return myDefaultTAZSinkWeight; +} + + +bool +GNETAZFrame::TAZChildDefaultParameters::getToggleMembership() const { + return (myToggleMembership->getCheck() == TRUE); +} + + +long +GNETAZFrame::TAZChildDefaultParameters::onCmdSetDefaultValues(FXObject* obj, FXSelector, void*) { + // find edited object + if (obj == myToggleMembership) { + // first clear selected edges + myTAZFrameParent->myTAZSelectionStatistics->clearSelectedEdges(); + // set text of myToggleMembership + if (myToggleMembership->getCheck() == TRUE) { + myToggleMembership->setText("toogle"); + // show TAZSource/Sink Frames + myDefaultTAZSourceFrame->show(); + myDefaultTAZSinkFrame->show(); + // update information label + std::ostringstream information; + information + << "- Toogle Membership:\n" + << " Create new Sources/Sinks\n" + << " with given weights."; + myInformationLabel->setText(information.str().c_str()); + // hide TAZSelectionStatistics + myTAZFrameParent->myTAZSelectionStatistics->hideTAZSelectionStatisticsModul(); + // check if use selected edges has to be enabled + if (myTAZFrameParent->myTAZCurrent->getSelectedEdges().size() > 0) { + myUseSelectedEdges->setText("Use selected edges"); + } else if (myTAZFrameParent->myTAZCurrent->getTAZEdges().size() > 0) { + myUseSelectedEdges->setText("Remove all edges"); + } else { + myUseSelectedEdges->setText("Use selected edges"); + myUseSelectedEdges->disable(); + } + } else { + myToggleMembership->setText("keep"); + // hide TAZSource/Sink Frames + myDefaultTAZSourceFrame->hide(); + myDefaultTAZSinkFrame->hide(); + // update information label + std::ostringstream information; + information + << "- Keep Membership:\n" + << " Select Sources/Sinks.\n" + << "- Press ESC to clear\n" + << " current selection."; + myInformationLabel->setText(information.str().c_str()); + // show TAZSelectionStatistics + myTAZFrameParent->myTAZSelectionStatistics->showTAZSelectionStatisticsModul(); + } + // update button + updateSelectEdgesButton(); + } else if (obj == myTextFieldDefaultValueTAZSources) { + // check if given value is valid + if (GNEAttributeCarrier::canParse(myTextFieldDefaultValueTAZSources->getText().text())) { + myDefaultTAZSourceWeight = GNEAttributeCarrier::parse(myTextFieldDefaultValueTAZSources->getText().text()); + // check if myDefaultTAZSourceWeight is greather than 0 + if (myDefaultTAZSourceWeight >= 0) { + // set valid color + myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(0, 0, 0)); + } else { + // set invalid color + myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0)); + myDefaultTAZSourceWeight = 1; + } + } else { + // set invalid color + myTextFieldDefaultValueTAZSources->setTextColor(FXRGB(255, 0, 0)); + myDefaultTAZSourceWeight = 1; + } + } else if (obj == myTextFieldDefaultValueTAZSinks) { + // check if given value is valid + if (GNEAttributeCarrier::canParse(myTextFieldDefaultValueTAZSinks->getText().text())) { + myDefaultTAZSinkWeight = GNEAttributeCarrier::parse(myTextFieldDefaultValueTAZSinks->getText().text()); + // check if myDefaultTAZSinkWeight is greather than 0 + if (myDefaultTAZSinkWeight >= 0) { + // set valid color + myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(0, 0, 0)); + } else { + // set invalid color + myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0)); + myDefaultTAZSinkWeight = 1; + } + } else { + // set invalid color + myTextFieldDefaultValueTAZSinks->setTextColor(FXRGB(255, 0, 0)); + myDefaultTAZSinkWeight = 1; + } + } + return 1; +} + + +long +GNETAZFrame::TAZChildDefaultParameters::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) { + // select edge or create new TAZ Source/Child, depending of myToggleMembership + if (myToggleMembership->getCheck() == TRUE) { + // first drop all edges + myTAZFrameParent->dropTAZMembers(); + // iterate over selected edges and add it as TAZMember + for (const auto& i : myTAZFrameParent->myTAZCurrent->getSelectedEdges()) { + myTAZFrameParent->addOrRemoveTAZMember(i); + } + // update selected button + updateSelectEdgesButton(); + } else { + if (myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected().size() == 0) { + // first check if all TAZEdges are selected + bool allSelected = true; + for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { + if (!i.edge->isAttributeCarrierSelected()) { + allSelected = false; + } + } + // select or unselect all depending of allSelected + if (allSelected) { + // remove form selection all TAZEdges + for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList()); + } + } else { + // add to selection all TAZEdges + for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); + } + } + } else { + // first check if all TAZEdges are selected + bool allSelected = true; + for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { + if (!i.edge->isAttributeCarrierSelected()) { + allSelected = false; + } + } + // select or unselect all depending of allSelected + if (allSelected) { + // only remove from selection selected TAZEdges + for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { + if (i.edge->isAttributeCarrierSelected()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "false", myTAZFrameParent->myViewNet->getUndoList()); + } + } + } else { + // only add to selection selected TAZEdges + for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { + if (!i.edge->isAttributeCarrierSelected()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); + } + } + } + } + } + // update selection button + myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); + // update view net + myTAZFrameParent->myViewNet->updateViewNet(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZSelectionStatistics - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZSelectionStatistics::TAZSelectionStatistics(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "Selection Statistics", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent) { + // create default TAZ Source weight + myTAZSourceFrame = new FXHorizontalFrame(this, 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); + 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); +} + + +GNETAZFrame::TAZSelectionStatistics::~TAZSelectionStatistics() {} + + +void +GNETAZFrame::TAZSelectionStatistics::showTAZSelectionStatisticsModul() { + // update Statistics before show + updateStatistics(); + show(); +} + + +void +GNETAZFrame::TAZSelectionStatistics::hideTAZSelectionStatisticsModul() { + // clear children before hide + clearSelectedEdges(); + hide(); +} + + +bool +GNETAZFrame::TAZSelectionStatistics::selectEdge(const TAZCurrent::TAZEdge& TAZEdge) { + // find TAZEdge using edge as criterium wasn't previously selected + for (const auto& i : myEdgeAndTAZChildrenSelected) { + if (i.edge == TAZEdge.edge) { + throw ProcessError("TAZEdge already selected"); + } + } + // add edge and their TAZ Children into myTAZChildSelected + myEdgeAndTAZChildrenSelected.push_back(TAZEdge); + // always update statistics after insertion + updateStatistics(); + // update edge colors + myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); + // update selection button + myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); + return true; +} + + +bool +GNETAZFrame::TAZSelectionStatistics::unselectEdge(GNEEdge* edge) { + if (edge) { + // find TAZEdge using edge as criterium + for (auto i = myEdgeAndTAZChildrenSelected.begin(); i != myEdgeAndTAZChildrenSelected.end(); i++) { + if (i->edge == edge) { + myEdgeAndTAZChildrenSelected.erase(i); + // always update statistics after insertion + updateStatistics(); + // update edge colors + myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); + // update selection button + myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); + return true; + } + } + // throw exception if edge wasn't found + throw ProcessError("edge wasn't found"); + } else { + throw ProcessError("Invalid edge"); + } +} + + +bool +GNETAZFrame::TAZSelectionStatistics::isEdgeSelected(GNEEdge* edge) { + // find TAZEdge using edge as criterium + for (const auto& i : myEdgeAndTAZChildrenSelected) { + if (i.edge == edge) { + return true; + } + } + // edge wasn't found, then return false + return false; +} + + +void +GNETAZFrame::TAZSelectionStatistics::clearSelectedEdges() { + // clear all selected edges (and the TAZ Children) + myEdgeAndTAZChildrenSelected.clear(); + // always update statistics after clear edges + updateStatistics(); + // update edge colors + myTAZFrameParent->myTAZEdgesGraphic->updateEdgeColors(); + // update selection button + myTAZFrameParent->myTAZChildDefaultParameters->updateSelectEdgesButton(); +} + + +const std::vector& +GNETAZFrame::TAZSelectionStatistics::getEdgeAndTAZChildrenSelected() const { + return myEdgeAndTAZChildrenSelected; +} + + +long +GNETAZFrame::TAZSelectionStatistics::onCmdSetNewValues(FXObject* obj, FXSelector, void*) { + if (obj == myTextFieldTAZSourceWeight) { + // check if given value is valid + if (GNEAttributeCarrier::canParse(myTextFieldTAZSourceWeight->getText().text())) { + double newTAZSourceWeight = GNEAttributeCarrier::parse(myTextFieldTAZSourceWeight->getText().text()); + // check if myDefaultTAZSourceWeight is greather than 0 + if (newTAZSourceWeight >= 0) { + // set valid color in TextField + myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0)); + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // update weight of all TAZSources + for (const auto& i : myEdgeAndTAZChildrenSelected) { + i.TAZSource->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSourceWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); + } + // refresh TAZ Edges + myTAZFrameParent->getTAZCurrentModul()->refreshTAZEdges(); + } else { + // set invalid color + myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0)); + } + } else { + // set invalid color + myTextFieldTAZSourceWeight->setTextColor(FXRGB(255, 0, 0)); + } + } else if (obj == myTextFieldTAZSinkWeight) { + // check if given value is valid + if (GNEAttributeCarrier::canParse(myTextFieldTAZSinkWeight->getText().text())) { + double newTAZSinkWeight = GNEAttributeCarrier::parse(myTextFieldTAZSinkWeight->getText().text()); + // check if myDefaultTAZSinkWeight is greather than 0 + if (newTAZSinkWeight >= 0) { + // set valid color in TextField + myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0)); + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // update weight of all TAZSources + for (const auto& i : myEdgeAndTAZChildrenSelected) { + i.TAZSink->setAttribute(SUMO_ATTR_WEIGHT, myTextFieldTAZSinkWeight->getText().text(), myTAZFrameParent->myViewNet->getUndoList()); + } + // refresh TAZ Edges + myTAZFrameParent->getTAZCurrentModul()->refreshTAZEdges(); + } else { + // set invalid color + myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0)); + } + } else { + // set invalid color + myTextFieldTAZSinkWeight->setTextColor(FXRGB(255, 0, 0)); + } + } + return 1; +} + + +long +GNETAZFrame::TAZSelectionStatistics::onCmdSelectEdges(FXObject*, FXSelector, void*) { + if (myEdgeAndTAZChildrenSelected.size() == 0) { + // add to selection all TAZEdges + for (const auto& i : myTAZFrameParent->getTAZCurrentModul()->getTAZEdges()) { + // avoid empty undolists + if (!i.edge->isAttributeCarrierSelected()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); + } + } + } else { + // only add to selection selected TAZEdges + for (const auto& i : myEdgeAndTAZChildrenSelected) { + // avoid empty undolists + if (!i.edge->isAttributeCarrierSelected()) { + // enable save button + myTAZFrameParent->myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // change attribute selected + i.edge->setAttribute(GNE_ATTR_SELECTED, "true", myTAZFrameParent->myViewNet->getUndoList()); + } + } + } + return 1; +} + + +void +GNETAZFrame::TAZSelectionStatistics::updateStatistics() { + if (myEdgeAndTAZChildrenSelected.size() > 0) { + // show TAZSources/Sinks frames + myTAZSourceFrame->show(); + myTAZSinkFrame->show(); + // declare string sets for TextFields (to avoid duplicated values) + std::set weightSourceSet; + std::set weightSinkSet; + // declare stadistic variables + double weight = 0; + double maxWeightSource = 0; + double minWeightSource = -1; + double averageWeightSource = 0; + double maxWeightSink = 0; + double minWeightSink = -1; + double averageWeightSink = 0; + // iterate over child additional + for (const auto& i : myEdgeAndTAZChildrenSelected) { + //start with sources + weight = i.TAZSource->getDepartWeight(); + // insert source weight in weightSinkTextField + weightSourceSet.insert(toString(weight)); + // check max Weight + if (maxWeightSource < weight) { + maxWeightSource = weight; + } + // check min Weight + if (minWeightSource == -1 || (maxWeightSource < weight)) { + minWeightSource = weight; + } + // update Average + averageWeightSource += weight; + // continue with sinks + weight = i.TAZSink->getDepartWeight(); + // save sink weight in weightSinkTextField + weightSinkSet.insert(toString(weight)); + // check max Weight + if (maxWeightSink < weight) { + maxWeightSink = weight; + } + // check min Weight + if (minWeightSink == -1 || (maxWeightSink < weight)) { + minWeightSink = weight; + } + // update Average + averageWeightSink += weight; + } + // calculate average + averageWeightSource /= myEdgeAndTAZChildrenSelected.size(); + averageWeightSink /= myEdgeAndTAZChildrenSelected.size(); + // declare ostringstream for statistics + std::ostringstream information; + std::string edgeInformation; + // first fill edgeInformation + if (myEdgeAndTAZChildrenSelected.size() == 1) { + edgeInformation = "- Edge ID: " + myEdgeAndTAZChildrenSelected.begin()->edge->getID(); + } else { + edgeInformation = "- Number of edges: " + toString(myEdgeAndTAZChildrenSelected.size()); + } + // fill rest of information + information + << edgeInformation << "\n" + << "- Min source: " << toString(minWeightSource) << "\n" + << "- Max source: " << toString(maxWeightSource) << "\n" + << "- Average source: " << toString(averageWeightSource) << "\n" + << "\n" + << "- Min sink: " << toString(minWeightSink) << "\n" + << "- Max sink: " << toString(maxWeightSink) << "\n" + << "- Average sink: " << toString(averageWeightSink); + // set new label + myStatisticsLabel->setText(information.str().c_str()); + // set TextFields (Text and color) + myTextFieldTAZSourceWeight->setText(joinToString(weightSourceSet, " ").c_str()); + myTextFieldTAZSourceWeight->setTextColor(FXRGB(0, 0, 0)); + myTextFieldTAZSinkWeight->setText(joinToString(weightSinkSet, " ").c_str()); + myTextFieldTAZSinkWeight->setTextColor(FXRGB(0, 0, 0)); + } else { + // hide TAZSources/Sinks frames + myTAZSourceFrame->hide(); + myTAZSinkFrame->hide(); + // hide myStatisticsLabel + myStatisticsLabel->setText("No edges selected"); + } +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZParameters- methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZParameters::TAZParameters(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "TAZ parameters", GUIDesignGroupBoxFrame), + myTAZFrameParent(TAZFrameParent) { + // create Button and string textField for color and set blue as default color + FXHorizontalFrame* colorParameter = new FXHorizontalFrame(this, 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 Label and CheckButton for use innen edges with true as default value + FXHorizontalFrame* useInnenEdges = new FXHorizontalFrame(this, 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); +} + + +GNETAZFrame::TAZParameters::~TAZParameters() {} + + +void +GNETAZFrame::TAZParameters::showTAZParametersModul() { + FXGroupBox::show(); +} + + +void +GNETAZFrame::TAZParameters::hideTAZParametersModul() { + FXGroupBox::hide(); +} + + +bool +GNETAZFrame::TAZParameters::isCurrentParametersValid() const { + return GNEAttributeCarrier::canParse(myTextFieldColor->getText().text()); +} + + +bool +GNETAZFrame::TAZParameters::isAddEdgesWithinEnabled() const { + return (myAddEdgesWithinCheckButton->getCheck() == TRUE); +} + + +std::map +GNETAZFrame::TAZParameters::getAttributesAndValues() const { + std::map parametersAndValues; + // get color (currently the only editable attribute) + parametersAndValues[SUMO_ATTR_COLOR] = myTextFieldColor->getText().text(); + return parametersAndValues; +} + + +long +GNETAZFrame::TAZParameters::onCmdSetColorAttribute(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(myTextFieldColor->getText().text())) { + colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor(myTextFieldColor->getText().text()))); + } else { + colordialog.setRGBA(MFXUtils::getFXColor(RGBColor::parseColor("blue"))); + } + // execute dialog to get a new color + if (colordialog.execute()) { + myTextFieldColor->setText(toString(MFXUtils::getRGBColor(colordialog.getRGBA())).c_str()); + onCmdSetAttribute(0, 0, 0); + } + return 0; +} + + +long +GNETAZFrame::TAZParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) { + // only COLOR text field has to be checked + bool currentParametersValid = GNEAttributeCarrier::canParse(myTextFieldColor->getText().text()); + // change color of textfield dependig of myCurrentParametersValid + if (currentParametersValid) { + myTextFieldColor->setTextColor(FXRGB(0, 0, 0)); + myTextFieldColor->killFocus(); + } else { + myTextFieldColor->setTextColor(FXRGB(255, 0, 0)); + currentParametersValid = false; + } + // change useInnenEdgesCheckButton text + if (myAddEdgesWithinCheckButton->getCheck() == TRUE) { + myAddEdgesWithinCheckButton->setText("use"); + } else { + myAddEdgesWithinCheckButton->setText("not use"); + } + return 0; +} + + +long +GNETAZFrame::TAZParameters::onCmdHelp(FXObject*, FXSelector, void*) { + myTAZFrameParent->openHelpAttributesDialog(GNEAttributeCarrier::getTagProperties(SUMO_TAG_TAZ)); + return 1; +} + +// --------------------------------------------------------------------------- +// GNETAZFrame::TAZEdgesGraphic - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::TAZEdgesGraphic::TAZEdgesGraphic(GNETAZFrame* TAZFrameParent) : + FXGroupBox(TAZFrameParent->myContentFrame, "Edges", GUIDesignGroupBoxFrame), + 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); + NonTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeDefaultColor)); + NonTAZEdgeLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE)); + // create label for selected TAZEdge color information + FXLabel* selectedTAZEdgeLabel = new FXLabel(this, "Selected TAZ Edge", nullptr, GUIDesignLabelCenter); + selectedTAZEdgeLabel->setBackColor(MFXUtils::getFXColor(myEdgeSelectedColor)); + // build rainbow + GNEFrameModuls::buildRainbow(this, myScaleColors); + // create Radio button for show edges by source weight + myColorBySourceWeight = new FXRadioButton(this, "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); + // create Radio button for show edges by source + sink weight + myColorBySourcePlusSinkWeight = new FXRadioButton(this, "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); + // show by source as default + myColorBySourceWeight->setCheck(true); +} + + +GNETAZFrame::TAZEdgesGraphic::~TAZEdgesGraphic() {} + + +void +GNETAZFrame::TAZEdgesGraphic::showTAZEdgesGraphicModul() { + // update edge colors + updateEdgeColors(); + show(); +} + + +void +GNETAZFrame::TAZEdgesGraphic::hideTAZEdgesGraphicModul() { + // iterate over all edges and restore color + for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) { + for (const auto j : i->getLanes()) { + j->setSpecialColor(nullptr); + } + } + hide(); +} + + +void +GNETAZFrame::TAZEdgesGraphic::updateEdgeColors() { + // start painting all edges in gray + for (const auto& i : myTAZFrameParent->myTAZCurrent->getNetEdges()) { + // set candidate color (in this case, gray) + for (const auto j : i->getLanes()) { + j->setSpecialColor(&myEdgeDefaultColor); + } + } + // now paint Source/sinks colors + for (const auto& i : myTAZFrameParent->myTAZCurrent->getTAZEdges()) { + // set candidate color (in this case, + for (const auto j : i.edge->getLanes()) { + // check what will be painted (source, sink or both) + if (myColorBySourceWeight->getCheck() == TRUE) { + j->setSpecialColor(&myScaleColors.at(i.sourceColor), i.TAZSource->getDepartWeight()); + } else if (myColorBySinkWeight->getCheck() == TRUE) { + j->setSpecialColor(&myScaleColors.at(i.sinkColor), i.TAZSink->getDepartWeight()); + } else if (myColorBySourcePlusSinkWeight->getCheck() == TRUE) { + j->setSpecialColor(&myScaleColors.at(i.sourcePlusSinkColor), i.TAZSource->getDepartWeight() + i.TAZSink->getDepartWeight()); + } else { + j->setSpecialColor(&myScaleColors.at(i.sourceMinusSinkColor), i.TAZSource->getDepartWeight() - i.TAZSink->getDepartWeight()); + } + } + } + // as last step paint candidate colors + for (const auto& i : myTAZFrameParent->myTAZSelectionStatistics->getEdgeAndTAZChildrenSelected()) { + // set candidate selected color + for (const auto& j : i.edge->getLanes()) { + j->setSpecialColor(&myEdgeSelectedColor); + } + } + // always update view after setting new colors + myTAZFrameParent->myViewNet->updateViewNet(); +} + + +long +GNETAZFrame::TAZEdgesGraphic::onCmdChoosenBy(FXObject* obj, FXSelector, void*) { + // check what radio was pressed and disable the others + if (obj == myColorBySourceWeight) { + myColorBySinkWeight->setCheck(FALSE); + myColorBySourcePlusSinkWeight->setCheck(FALSE); + myColorBySourceMinusSinkWeight->setCheck(FALSE); + } else if (obj == myColorBySinkWeight) { + myColorBySourceWeight->setCheck(FALSE); + myColorBySourcePlusSinkWeight->setCheck(FALSE); + myColorBySourceMinusSinkWeight->setCheck(FALSE); + } else if (obj == myColorBySourcePlusSinkWeight) { + myColorBySourceWeight->setCheck(FALSE); + myColorBySinkWeight->setCheck(FALSE); + myColorBySourceMinusSinkWeight->setCheck(FALSE); + } else if (obj == myColorBySourceMinusSinkWeight) { + myColorBySourceWeight->setCheck(FALSE); + myColorBySinkWeight->setCheck(FALSE); + myColorBySourcePlusSinkWeight->setCheck(FALSE); + } + // update edge colors + updateEdgeColors(); + return 1; +} + +// --------------------------------------------------------------------------- +// GNETAZFrame - methods +// --------------------------------------------------------------------------- + +GNETAZFrame::GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet) : + GNEFrame(horizontalFrameParent, viewNet, "TAZs") { + + // create current TAZ modul + myTAZCurrent = new TAZCurrent(this); + + // Create TAZ Parameters modul + myTAZParameters = new TAZParameters(this); + + /// @brief create Netedit parameter + myNeteditAttributes = new GNEFrameAttributesModuls::NeteditAttributes(this); + + // Create drawing controls modul + myDrawingShape = new GNEFrameModuls::DrawingShape(this); + + // Create TAZ Edges Common Statistics modul + myTAZCommonStatistics = new TAZCommonStatistics(this); + + // Create save TAZ Edges modul + myTAZSaveChanges = new TAZSaveChanges(this); + + // Create TAZ Edges Common Parameters modul + myTAZChildDefaultParameters = new TAZChildDefaultParameters(this); + + // Create TAZ Edges Selection Statistics modul + myTAZSelectionStatistics = new TAZSelectionStatistics(this); + + // Create TAZ Edges Common Parameters modul + myTAZEdgesGraphic = new TAZEdgesGraphic(this); + + // by default there isn't a TAZ + myTAZCurrent->setTAZ(nullptr); +} + + +GNETAZFrame::~GNETAZFrame() { +} + + +void +GNETAZFrame::hide() { + // hide frame + GNEFrame::hide(); +} + + +bool +GNETAZFrame::processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // Declare map to keep values + std::map valuesOfElement; + 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); + } + return true; + } else if ((myTAZCurrent->getTAZ() == nullptr) || (objectsUnderCursor.getTAZFront() && myTAZCurrent->getTAZ() && !myTAZSaveChanges->isChangesPending())) { + // if user click over an TAZ and there isn't changes pending, then select a new TAZ + if (objectsUnderCursor.getTAZFront()) { + // avoid reset of Frame if user doesn't click over an TAZ + myTAZCurrent->setTAZ(objectsUnderCursor.getTAZFront()); + return true; + } else { + return false; + } + } else if (objectsUnderCursor.getEdgeFront()) { + // if toogle Edge is enabled, select edge. In other case create two new TAZSource/Sinks + if (myTAZChildDefaultParameters->getToggleMembership()) { + // create new TAZSource/Sinks or delete it + return addOrRemoveTAZMember(objectsUnderCursor.getEdgeFront()); + } else { + // first check if clicked edge was previously selected + if (myTAZSelectionStatistics->isEdgeSelected(objectsUnderCursor.getEdgeFront())) { + // clear selected edges + myTAZSelectionStatistics->clearSelectedEdges(); + } else { + // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks) + for (const auto& i : myTAZCurrent->getTAZEdges()) { + if (i.edge == objectsUnderCursor.getEdgeFront()) { + // clear current selection (to avoid having two or more edges selected at the same time using mouse clicks) + myTAZSelectionStatistics->clearSelectedEdges(); + // now select edge + myTAZSelectionStatistics->selectEdge(i); + // edge selected, then return true + return true; + } + } + } + // edge wasn't selected, then return false + return false; + } + } else { + // nothing to do + return false; + } +} + + +void +GNETAZFrame::processEdgeSelection(const std::vector& edges) { + // first check that a TAZ is selected + if (myTAZCurrent->getTAZ()) { + // if "toogle Membership" is enabled, create new TAZSources/sinks. In other case simply select edges + if (myTAZChildDefaultParameters->getToggleMembership()) { + // iterate over edges + for (auto i : edges) { + // first check if edge owns a TAZEge + if (myTAZCurrent->isTAZEdge(i) == false) { + // create new TAZ Sources/Sinks + addOrRemoveTAZMember(i); + } + } + } else { + // iterate over edges + for (auto i : edges) { + // first check that selected edge isn't already selected + if (!myTAZSelectionStatistics->isEdgeSelected(i)) { + // iterate over TAZEdges saved in TAZCurrent (it contains the Edge and Source/sinks) + for (const auto& j : myTAZCurrent->getTAZEdges()) { + if (j.edge == i) { + myTAZSelectionStatistics->selectEdge(j); + } + } + } + } + } + } +} + + +GNEFrameModuls::DrawingShape* +GNETAZFrame::getDrawingShapeModul() const { + return myDrawingShape; +} + + +GNETAZFrame::TAZCurrent* +GNETAZFrame::getTAZCurrentModul() const { + return myTAZCurrent; +} + + +GNETAZFrame::TAZSelectionStatistics* +GNETAZFrame::getTAZSelectionStatisticsModul() const { + return myTAZSelectionStatistics; +} + + +GNETAZFrame::TAZSaveChanges* +GNETAZFrame::getTAZSaveChangesModul() const { + return myTAZSaveChanges; +} + + +bool +GNETAZFrame::shapeDrawed() { + // show warning dialogbox and stop check if input parameters are valid + if (!myTAZParameters->isCurrentParametersValid()) { + return false; + } else if (myDrawingShape->getTemporalShape().size() == 0) { + WRITE_WARNING("TAZ shape cannot be empty"); + return false; + } else { + // Declare map to keep TAZ Parameters values + std::map valuesOfElement = myTAZParameters->getAttributesAndValues(); + + // obtain Netedit attributes + myNeteditAttributes->getNeteditAttributesAndValues(valuesOfElement, nullptr); + + // generate new ID + valuesOfElement[SUMO_ATTR_ID] = myViewNet->getNet()->generateAdditionalID(SUMO_TAG_TAZ); + + // obtain shape and close it + PositionVector shape = myDrawingShape->getTemporalShape(); + shape.closePolygon(); + valuesOfElement[SUMO_ATTR_SHAPE] = toString(shape); + + // check if TAZ has to be created with edges + if (myTAZParameters->isAddEdgesWithinEnabled()) { + std::vector edgeIDs; + auto ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(shape.getBoxBoundary(), true); + for (auto i : ACsInBoundary) { + if (i.second->getTagProperty().getTag() == SUMO_TAG_EDGE) { + edgeIDs.push_back(i.first); + } + } + valuesOfElement[SUMO_ATTR_EDGES] = toString(edgeIDs); + } else { + // TAZ is created without edges + valuesOfElement[SUMO_ATTR_EDGES] = ""; + } + // declare SUMOSAXAttributesImpl_Cached to convert valuesMap into SUMOSAXAttributes + SUMOSAXAttributesImpl_Cached SUMOSAXAttrs(valuesOfElement, getPredefinedTagsMML(), toString(SUMO_TAG_TAZ)); + // return true if TAZ was successfully created + return GNEAdditionalHandler::buildAdditional(myViewNet->getNet(), true, SUMO_TAG_TAZ, SUMOSAXAttrs, nullptr); + } +} + + +bool +GNETAZFrame::addOrRemoveTAZMember(GNEEdge* edge) { + // first check if edge exist; + if (edge) { + // first check if already exist (in this case, remove it) + for (const auto& i : myTAZCurrent->getTAZEdges()) { + if (i.edge == edge) { + // enable save changes button + myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // remove Source and Sinks using GNEChange_Additional + myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true); + myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true); + // always refresh TAZ Edges after removing TAZSources/Sinks + myTAZCurrent->refreshTAZEdges(); + // update select edges button + myTAZChildDefaultParameters->updateSelectEdgesButton(); + return true; + } + } + // if wasn't found, then add it + myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters + GNETAZSourceSink* TAZSource = new GNETAZSourceSink(SUMO_TAG_TAZSOURCE, myTAZCurrent->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSourceWeight()); + myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSource, true), true); + // create TAZ Sink using GNEChange_Additional and value of TAZChild default parameters + GNETAZSourceSink* TAZSink = new GNETAZSourceSink(SUMO_TAG_TAZSINK, myTAZCurrent->getTAZ(), edge, myTAZChildDefaultParameters->getDefaultTAZSinkWeight()); + myViewNet->getUndoList()->add(new GNEChange_Additional(TAZSink, true), true); + // always refresh TAZ Edges after adding TAZSources/Sinks + myTAZCurrent->refreshTAZEdges(); + // update selected button + myTAZChildDefaultParameters->updateSelectEdgesButton(); + return true; + } else { + throw ProcessError("Edge cannot be null"); + } +} + + +void +GNETAZFrame::dropTAZMembers() { + // iterate over all TAZEdges + for (const auto& i : myTAZCurrent->getTAZEdges()) { + // enable save changes button + myTAZSaveChanges->enableButtonsAndBeginUndoList(); + // remove Source and Sinks using GNEChange_Additional + myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSource, false), true); + myViewNet->getUndoList()->add(new GNEChange_Additional(i.TAZSink, false), true); + } + // always refresh TAZ Edges after removing TAZSources/Sinks + myTAZCurrent->refreshTAZEdges(); +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETAZFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETAZFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETAZFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETAZFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,575 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETAZFrame.h +/// @author Pablo Alvarez Lopez +/// @date Oct 2018 +/// +// The Widget for add TAZ elements +/****************************************************************************/ +#pragma once + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +class GNETAZSourceSink; + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNETAZFrame + * The Widget for setting internal attributes of TAZ elements + */ +class GNETAZFrame : public GNEFrame { + +public: + // =========================================================================== + // class TAZCurrent + // =========================================================================== + + class TAZCurrent : protected FXGroupBox { + + public: + /// @brief struct for edges and the source/sink colors + struct TAZEdge { + /// @brief constructor + TAZEdge(TAZCurrent* TAZCurrentParent, GNEEdge* _edge, GNETAZSourceSink* _TAZSource, GNETAZSourceSink* _TAZSink); + + /// @brief destructor (needed because RGBColors has to be deleted) + ~TAZEdge(); + + /// @brief update colors + void updateColors(); + + /// @brief TAZ edge + GNEEdge* edge; + + /// @brief source TAZ + GNETAZSourceSink* TAZSource; + + /// @brif sink TAZ + GNETAZSourceSink* TAZSink; + + /// @brief color by source [0-9] + int sourceColor; + + /// @brief color by sink [0-9] + int sinkColor; + + /// @brief color by source + sink [0-9] + int sourcePlusSinkColor; + + /// @brief color by source - sink [0-9] + int sourceMinusSinkColor; + + private: + /// @brief pointer to TAZCurrentParent + TAZCurrent* myTAZCurrentParent; + }; + + /// @brief constructor + TAZCurrent(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZCurrent(); + + /// @brief set current TAZ + void setTAZ(GNETAZ* editedTAZ); + + /// @brief get current TAZ + GNETAZ* getTAZ() const; + + /// @brief check if given edge belongs to current TAZ + bool isTAZEdge(GNEEdge* edge) const; + + /// @brief get current net edges + const std::vector& getNetEdges() const; + + /// @brief get current selected edges + const std::vector& getSelectedEdges() const; + + /// @brief get TAZEdges + const std::vector& getTAZEdges() const; + + /// @brief refresh TAZEdges + void refreshTAZEdges(); + + protected: + /// @brief add TAZChild + void addTAZChild(GNETAZSourceSink* additional); + + private: + /// @brief pointer to TAZ Frame + GNETAZFrame* myTAZFrameParent; + + /// @brief current edited TAZ + GNETAZ* myEditedTAZ; + + /// @brief vector with pointers to edges (it's used to avoid slowdowns during Source/Sinks manipulations) + std::vector myNetEdges; + + /// @brief vector with pointers to selected edges + std::vector mySelectedEdges; + + /// @brief vector with TAZ's edges + std::vector myTAZEdges; + + /// @brief Label for current TAZ + FXLabel* myTAZCurrentLabel; + + /// @brief maximum source plus sink value of current TAZ Edges + double myMaxSourcePlusSinkWeight; + + /// @brief minimum source plus sink value of current TAZ Edges + double myMinSourcePlusSinkWeight; + + /// @brief maximum source minus sink value of current TAZ Edges + double myMaxSourceMinusSinkWeight; + + /// @brief minimum source minus sink value of current TAZ Edges + double myMinSourceMinusSinkWeight; + }; + + // =========================================================================== + // class TAZCommonStatistics + // =========================================================================== + + class TAZCommonStatistics : protected FXGroupBox { + + public: + /// @brief constructor + TAZCommonStatistics(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZCommonStatistics(); + + /// @brief show TAZ Common Statistics Modul + void showTAZCommonStatisticsModul(); + + /// @brief hide TAZ Common Statistics Modul + void hideTAZCommonStatisticsModul(); + + protected: + /// @brief update Statistics label + void updateStatistics(); + + private: + /// @brief pointer to TAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @brief Statistics labels + FXLabel* myStatisticsLabel; + }; + + // =========================================================================== + // class TAZSaveChanges + // =========================================================================== + + class TAZSaveChanges : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETAZFrame::TAZSaveChanges) + + public: + /// @brief constructor + TAZSaveChanges(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZSaveChanges(); + + /// @brief show TAZ Save Changes Modul + void showTAZSaveChangesModul(); + + /// @brief hide TAZ Save Changes Modul + void hideTAZSaveChangesModul(); + + /// @brief enable buttons save and cancel changes (And begin Undo List) + void enableButtonsAndBeginUndoList(); + + /// @brief return true if there is changes to save + bool isChangesPending() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user press the button save changes + long onCmdSaveChanges(FXObject*, FXSelector, void*); + + /// @brief Called when the user press the button cancel changes + long onCmdCancelChanges(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TAZSaveChanges) + + private: + /// @brief pointer to TAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @field FXButton for save changes in TAZEdges + FXButton* mySaveChangesButton; + + /// @field FXButton for cancel changes in TAZEdges + FXButton* myCancelChangesButton; + }; + + // =========================================================================== + // class TAZChildDefaultParameters + // =========================================================================== + + class TAZChildDefaultParameters : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETAZFrame::TAZChildDefaultParameters) + + public: + /// @brief constructor + TAZChildDefaultParameters(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZChildDefaultParameters(); + + /// @brief show TAZ child default parameters Modul + void showTAZChildDefaultParametersModul(); + + /// @brief hide TAZ child default parameters Modul + void hideTAZChildDefaultParametersModul(); + + /// @brief update "select edges button" + void updateSelectEdgesButton(); + + /// @brief get default TAZSource weight + double getDefaultTAZSourceWeight() const; + + /// @brief default TAZSink weight + double getDefaultTAZSinkWeight() const; + + /// @brief check if toggle membership is enabled + bool getToggleMembership() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user changes default values + long onCmdSetDefaultValues(FXObject* obj, FXSelector, void*); + + /// @brief Called when the user press use selected edges + long onCmdUseSelectedEdges(FXObject* obj, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TAZChildDefaultParameters) + + private: + /// @brief pointer to TAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @brief CheckButton to enable or disable Toggle edge Membership + FXCheckButton* myToggleMembership; + + /// @brief Horizontal Frame for default TAZ Source Weight + FXHorizontalFrame* myDefaultTAZSourceFrame; + + /// @brief textField to set a default value for TAZ Sources + FXTextField* myTextFieldDefaultValueTAZSources; + + /// @brief Horizontal Frame for default TAZ Sink Weight + FXHorizontalFrame* myDefaultTAZSinkFrame; + + /// @brief textField to set a default value for TAZ Sinks + FXTextField* myTextFieldDefaultValueTAZSinks; + + /// @brief button for use selected edges + FXButton* myUseSelectedEdges; + + /// @brief information label + FXLabel* myInformationLabel; + + /// @brief default TAZSource weight + double myDefaultTAZSourceWeight; + + /// @brief default TAZSink weight + double myDefaultTAZSinkWeight; + }; + + // =========================================================================== + // class TAZSelectionStatistics + // =========================================================================== + + class TAZSelectionStatistics : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETAZFrame::TAZSelectionStatistics) + + public: + /// @brief constructor + TAZSelectionStatistics(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZSelectionStatistics(); + + /// @brief show TAZ Selection Statistics Modul + void showTAZSelectionStatisticsModul(); + + /// @brief hide TAZ Selection Statistics Modul + void hideTAZSelectionStatisticsModul(); + + /// @brief add an edge and their TAZ Children in the list of selected items + bool selectEdge(const TAZCurrent::TAZEdge& edge); + + /// @brief un select an edge (and their TAZ Children) + bool unselectEdge(GNEEdge* edge); + + /// @brief check if an edge is selected + bool isEdgeSelected(GNEEdge* edge); + + /// @brief clear current TAZ children + void clearSelectedEdges(); + + /// @brief get map with edge and TAZChildren + const std::vector& getEdgeAndTAZChildrenSelected() const; + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user set a new value + long onCmdSetNewValues(FXObject* obj, FXSelector, void*); + + /// @brief Called when the user press select edges + long onCmdSelectEdges(FXObject* obj, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TAZSelectionStatistics) + + /// @brief update TAZSelectionStatistics + void updateStatistics(); + + private: + /// @brief pointer to TAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @brief Horizontal Frame for default TAZ Source Weight + FXHorizontalFrame* myTAZSourceFrame; + + /// @brief textField for TAZ Source weight + FXTextField* myTextFieldTAZSourceWeight; + + /// @brief Horizontal Frame for default TAZ Sink Weight + FXHorizontalFrame* myTAZSinkFrame; + + /// @brief textField for TAZ Sink weight + FXTextField* myTextFieldTAZSinkWeight; + + /// @brief Statistics labels + FXLabel* myStatisticsLabel; + + /// @brief vector with the current selected edges and their associated children + std::vector myEdgeAndTAZChildrenSelected; + }; + + // =========================================================================== + // class TAZParameters + // =========================================================================== + + class TAZParameters : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETAZFrame::TAZParameters) + + public: + /// @brief constructor + TAZParameters(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZParameters(); + + /// @brief show TAZ parameters and set the default value of parameters + void showTAZParametersModul(); + + /// @brief hide TAZ parameters + void hideTAZParametersModul(); + + /// @brief check if current parameters are valid + bool isCurrentParametersValid() const; + + /// @brief check if edges within has to be used after TAZ Creation + bool isAddEdgesWithinEnabled() const; + + /// @brief get a map with attributes and their values + std::map getAttributesAndValues() const; + + /// @name FOX-callbacks + /// @{ + /// @brief called when user press the "Color" button + long onCmdSetColorAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when user set a value + long onCmdSetAttribute(FXObject*, FXSelector, void*); + + /// @brief Called when help button is pressed + long onCmdHelp(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TAZParameters) + + private: + /// @brief pointer to GNETAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @brief Button for open color editor + FXButton* myColorEditor; + + /// @brief textField to modify the default value of color parameter + FXTextField* myTextFieldColor; + + /// @brief CheckButton to enable or disable use edges within TAZ after creation + FXCheckButton* myAddEdgesWithinCheckButton; + + /// @brief button for help + FXButton* myHelpTAZAttribute; + }; + + // =========================================================================== + // class TAZEdgesGraphic + // =========================================================================== + + class TAZEdgesGraphic : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETAZFrame::TAZEdgesGraphic) + + public: + /// @brief constructor + TAZEdgesGraphic(GNETAZFrame* TAZFrameParent); + + /// @brief destructor + ~TAZEdgesGraphic(); + + /// @brief show TAZ Edges Graphic Modul + void showTAZEdgesGraphicModul(); + + /// @brief hide TAZ Edges Graphic Modul + void hideTAZEdgesGraphicModul(); + + /// @brief update edge colors; + void updateEdgeColors(); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user select one kind of representation + long onCmdChoosenBy(FXObject* obj, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TAZEdgesGraphic) + + private: + /// @brief pointer to TAZFrame parent + GNETAZFrame* myTAZFrameParent; + + /// @brief add radio button "color by source" + FXRadioButton* myColorBySourceWeight; + + /// @brief add radio button "color by sink" + FXRadioButton* myColorBySinkWeight; + + /// @brief add radio button "color source + sink" + FXRadioButton* myColorBySourcePlusSinkWeight; + + /// @brief add radio button "color source - Sink" + FXRadioButton* myColorBySourceMinusSinkWeight; + + /// @brief vector with the scale colors + std::vector myScaleColors; + + /// @brief default RGBColor for all edges + RGBColor myEdgeDefaultColor; + + /// @brief RGBColor color for selected egdes + RGBColor myEdgeSelectedColor; + }; + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNETAZFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNETAZFrame(); + + /// @brief hide TAZ frame + void hide(); + + /**@brief process click over Viewnet + * @param[in] clickedPosition clicked position over ViewNet + * @param[in] objectsUnderCursor objects under cursors + * @return true if something (select TAZ or add edge) was sucefully done + */ + bool processClick(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief process selection of edges in view net + void processEdgeSelection(const std::vector& edges); + + /// @brief get drawing mode modul + GNEFrameModuls::DrawingShape* getDrawingShapeModul() const; + + /// @brief get Current TAZ modul + TAZCurrent* getTAZCurrentModul() const; + + /// @brief get TAZ Selection Statistics modul + TAZSelectionStatistics* getTAZSelectionStatisticsModul() const; + + /// @brief get TAZ Save Changes modul + TAZSaveChanges* getTAZSaveChangesModul() const; + +protected: + /**@brief build a shaped element using the drawed shape + * return true if was sucesfully created + * @note called when user stop drawing shape + */ + bool shapeDrawed(); + + /// @brief add or remove a TAZSource and a TAZSink, or remove it if edge is in the list of TAZ Children + bool addOrRemoveTAZMember(GNEEdge* edge); + + /// @brief drop all TAZSources and TAZ Sinks of current TAZ + void dropTAZMembers(); + +private: + /// @brief current TAZ + TAZCurrent* myTAZCurrent; + + /// @brief TAZ Edges common parameters + TAZCommonStatistics* myTAZCommonStatistics; + + /// @brief TAZ parameters + TAZParameters* myTAZParameters; + + /// @brief Netedit parameter + GNEFrameAttributesModuls::NeteditAttributes* myNeteditAttributes; + + /// @brief Drawing shape + GNEFrameModuls::DrawingShape* myDrawingShape; + + /// @brief save TAZ Edges + TAZSaveChanges* myTAZSaveChanges; + + /// @brief TAZ child defaults parameters + TAZChildDefaultParameters* myTAZChildDefaultParameters; + + /// @brief TAZ Edges selection parameters + TAZSelectionStatistics* myTAZSelectionStatistics; + + /// @brief TAZ Edges Graphic + TAZEdgesGraphic* myTAZEdgesGraphic; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.cpp sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.cpp --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1416 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETLSEditorFrame.cpp +/// @author Jakob Erdmann +/// @date May 2011 +/// +// The Widget for modifying traffic lights +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNETLSEditorFrame.h" + +// =========================================================================== +// FOX callback mapping +// =========================================================================== + +FXDEFMAP(GNETLSEditorFrame) GNETLSEditorFrameMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_CANCEL, GNETLSEditorFrame::onCmdCancel), + FXMAPFUNC(SEL_UPDATE, MID_CANCEL, GNETLSEditorFrame::onUpdModified), + FXMAPFUNC(SEL_COMMAND, MID_OK, GNETLSEditorFrame::onCmdOK), + FXMAPFUNC(SEL_UPDATE, MID_OK, GNETLSEditorFrame::onUpdModified), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_CREATE, GNETLSEditorFrame::onCmdDefCreate), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_CREATE, GNETLSEditorFrame::onUpdDefCreate), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_DELETE, GNETLSEditorFrame::onCmdDefDelete), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_DELETE, GNETLSEditorFrame::onUpdDefSwitch), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SWITCH, GNETLSEditorFrame::onCmdDefSwitch), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_SWITCH, GNETLSEditorFrame::onUpdDefSwitch), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_OFFSET, GNETLSEditorFrame::onCmdDefOffset), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_OFFSET, GNETLSEditorFrame::onUpdNeedsDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_RENAME, GNETLSEditorFrame::onCmdDefRename), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SUBRENAME, GNETLSEditorFrame::onCmdDefSubRename), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_ADDOFF, GNETLSEditorFrame::onCmdDefAddOff), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_GUESSPROGRAM, GNETLSEditorFrame::onCmdGuess), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_CREATE, GNETLSEditorFrame::onCmdPhaseCreate), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_PHASE_CREATE, GNETLSEditorFrame::onUpdNeedsDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_DELETE, GNETLSEditorFrame::onCmdPhaseDelete), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_PHASE_DELETE, GNETLSEditorFrame::onUpdNeedsDefAndPhase), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_CLEANUP, GNETLSEditorFrame::onCmdCleanup), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_CLEANUP, GNETLSEditorFrame::onUpdNeedsSingleDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_ADDUNUSED, GNETLSEditorFrame::onCmdAddUnused), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_ADDUNUSED, GNETLSEditorFrame::onUpdNeedsDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_GROUP_STATES, GNETLSEditorFrame::onCmdGroupStates), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_GROUP_STATES, GNETLSEditorFrame::onUpdNeedsSingleDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_UNGROUP_STATES, GNETLSEditorFrame::onCmdUngroupStates), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_UNGROUP_STATES, GNETLSEditorFrame::onUpdUngroupStates), + FXMAPFUNC(SEL_SELECTED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), + FXMAPFUNC(SEL_DESELECTED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), + FXMAPFUNC(SEL_CHANGED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseSwitch), + FXMAPFUNC(SEL_REPLACED, MID_GNE_TLSFRAME_PHASE_TABLE, GNETLSEditorFrame::onCmdPhaseEdit), +}; + +FXDEFMAP(GNETLSEditorFrame::TLSFile) TLSFileMap[] = { + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_LOAD_PROGRAM, GNETLSEditorFrame::TLSFile::onCmdLoadTLSProgram), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_LOAD_PROGRAM, GNETLSEditorFrame::TLSFile::onUpdNeedsDef), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_SAVE_PROGRAM, GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TLSFRAME_SAVE_PROGRAM, GNETLSEditorFrame::TLSFile::onUpdNeedsDef), +}; + +// Object implementation +FXIMPLEMENT(GNETLSEditorFrame, FXVerticalFrame, GNETLSEditorFrameMap, ARRAYNUMBER(GNETLSEditorFrameMap)) +FXIMPLEMENT(GNETLSEditorFrame::TLSFile, FXGroupBox, TLSFileMap, ARRAYNUMBER(TLSFileMap)) + + +// =========================================================================== +// method definitions +// =========================================================================== + +GNETLSEditorFrame::GNETLSEditorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet): + GNEFrame(horizontalFrameParent, viewNet, "Edit Traffic Light"), + myEditedDef(nullptr) { + + // Create Overlapped Inspection modul + myOverlappedInspection = new GNEFrameModuls::OverlappedInspection(this, SUMO_TAG_JUNCTION); + + // create TLSJunction modul + myTLSJunction = new GNETLSEditorFrame::TLSJunction(this); + + // create TLSDefinition modul + myTLSDefinition = new GNETLSEditorFrame::TLSDefinition(this); + + // create TLSAttributes modul + myTLSAttributes = new GNETLSEditorFrame::TLSAttributes(this); + + // create TLSModifications modul + myTLSModifications = new GNETLSEditorFrame::TLSModifications(this); + + // create TLSPhases modul + myTLSPhases = new GNETLSEditorFrame::TLSPhases(this); + + // create TLSFile modul + myTLSFile = new GNETLSEditorFrame::TLSFile(this); + + // "Add 'off' program" + /* + new FXButton(myContentFrame, "Add \"Off\"-Program\t\tAdds a program for switching off this traffic light", + 0, this, MID_GNE_TLSFRAME_ADDOFF, GUIDesignButton); + */ +} + + +GNETLSEditorFrame::~GNETLSEditorFrame() { + cleanup(); +} + + +void +GNETLSEditorFrame::show() { + // hide myOverlappedInspection + myOverlappedInspection->hideOverlappedInspection(); + GNEFrame::show(); +} + +void +GNETLSEditorFrame::editTLS(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor) { + // first check if in objectsUnderCursor there is a junction + if (objectsUnderCursor.getJunctionFront()) { + // show objects under cursor + myOverlappedInspection->showOverlappedInspection(objectsUnderCursor, clickedPosition); + // hide if we inspect only one junction + if (myOverlappedInspection->getNumberOfOverlappedACs() == 1) { + myOverlappedInspection->hideOverlappedInspection(); + } + // set junction + editJunction(objectsUnderCursor.getJunctionFront()); + } else { + myViewNet->setStatusBarText("Click over a junction to edit a TLS"); + } +} + + +bool +GNETLSEditorFrame::isTLSSaved() { + if (myTLSModifications->checkHaveModifications()) { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening question FXMessageBox 'save TLS'"); + // open question box + FXuint answer = FXMessageBox::question(this, MBOX_YES_NO_CANCEL, + "Save TLS Changes", "%s", + "There is unsaved changes in current edited traffic light.\nDo you want to save it before changing mode?"); + if (answer == MBOX_CLICKED_YES) { //1:yes, 2:no, 4:esc/cancel + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'YES'"); + // save modifications + onCmdOK(nullptr, 0, nullptr); + return true; + } else if (answer == MBOX_CLICKED_NO) { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'No'"); + // cancel modifications + onCmdCancel(nullptr, 0, nullptr); + return true; + } else { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'save TLS' with 'Cancel'"); + // abort changing mode + return false; + } + } else { + return true; + } +} + + +bool +GNETLSEditorFrame::parseTLSPrograms(const std::string& file) { + NBTrafficLightLogicCont& tllCont = myViewNet->getNet()->getTLLogicCont(); + NBTrafficLightLogicCont tmpTLLCont; + NIXMLTrafficLightsHandler tllHandler(tmpTLLCont, myViewNet->getNet()->getEdgeCont()); + // existing definitions must be available to update their programs + std::set origDefs; + for (NBTrafficLightDefinition* def : tllCont.getDefinitions()) { + // make a copy of every program + NBTrafficLightLogic* logic = tllCont.getLogic(def->getID(), def->getProgramID()); + if (logic != nullptr) { + NBTrafficLightDefinition* copy = new NBLoadedSUMOTLDef(*def, *logic); + std::vector nodes = def->getNodes(); + for (auto it_node : nodes) { + GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it_node->getID()); + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, def, false, false), true); + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, copy, true), true); + } + tmpTLLCont.insert(copy); + origDefs.insert(copy); + } else { + WRITE_WARNING("tlLogic '" + def->getID() + "', program '" + def->getProgramID() + "' could not be built"); + } + } + //std::cout << " initialized tmpCont with " << origDefs.size() << " defs\n"; + XMLSubSys::runParser(tllHandler, file); + + std::vector loadedTLS; + for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { + NBLoadedSUMOTLDef* sdef = dynamic_cast(def); + if (sdef != nullptr) { + loadedTLS.push_back(sdef); + } + } + myViewNet->setStatusBarText("Loaded " + toString(loadedTLS.size()) + " programs"); + for (auto def : loadedTLS) { + if (origDefs.count(def) != 0) { + // already add to undolist before + //std::cout << " skip " << def->getDescription() << "\n"; + continue; + } + std::vector nodes = def->getNodes(); + //std::cout << " add " << def->getDescription() << " for nodes=" << toString(nodes) << "\n"; + for (auto it_node : nodes) { + GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it_node->getID()); + //myViewNet->getUndoList()->add(new GNEChange_TLS(junction, myTLSEditorParent->myEditedDef, false), true); + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, def, true), true); + } + } + // clean up temporary container to avoid deletion of defs when it's destruct is called + for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { + tmpTLLCont.removeProgram(def->getID(), def->getProgramID(), false); + } + return true; +} + + +long +GNETLSEditorFrame::onCmdCancel(FXObject*, FXSelector, void*) { + if (myTLSJunction->getCurrentJunction() != nullptr) { + myViewNet->getUndoList()->p_abort(); + cleanup(); + myViewNet->updateViewNet(); + } + return 1; +} + + +long +GNETLSEditorFrame::onCmdOK(FXObject*, FXSelector, void*) { + if (myTLSJunction->getCurrentJunction() != nullptr) { + if (myTLSModifications->checkHaveModifications()) { + NBTrafficLightDefinition* oldDefinition = myTLSAttributes->getCurrentTLSDefinition(); + std::vector nodes = oldDefinition->getNodes(); + for (auto it : nodes) { + GNEJunction* junction = myViewNet->getNet()->retrieveJunction(it->getID()); + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, oldDefinition, false), true); + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, myEditedDef, true), true); + } + myEditedDef = nullptr; + myViewNet->getUndoList()->p_end(); + cleanup(); + myViewNet->updateViewNet(); + } else { + onCmdCancel(nullptr, 0, nullptr); + } + } + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefCreate(FXObject*, FXSelector, void*) { + GNEJunction* junction = myTLSJunction->getCurrentJunction(); + // abort because we onCmdOk assumes we wish to save an edited definition + onCmdCancel(nullptr, 0, nullptr); + // check that current junction has two or more edges + if ((junction->getGNEIncomingEdges().size() > 0) && (junction->getGNEOutgoingEdges().size() > 0)) { + if (junction->getAttribute(SUMO_ATTR_TYPE) != toString(SumoXMLNodeType::TRAFFIC_LIGHT)) { + junction->setAttribute(SUMO_ATTR_TYPE, toString(SumoXMLNodeType::TRAFFIC_LIGHT), myViewNet->getUndoList()); + } else { + if (junction->getNBNode()->isTLControlled()) { + // use existing traffic light as template for type, signal groups, controlled nodes etc + NBTrafficLightDefinition* tpl = *junction->getNBNode()->getControllingTLS().begin(); + NBTrafficLightLogic* newLogic = tpl->compute(OptionsCont::getOptions()); + NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*tpl, *newLogic); + delete newLogic; + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, newDef, true, true), true); + } else { + // for some reason the traffic light was not built, try again + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, nullptr, true, true), true); + } + } + editJunction(junction); + } else { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening warning FXMessageBox 'invalid TLS'"); + // open question box + FXMessageBox::warning(this, MBOX_OK, + "TLS cannot be created", "%s", + "Traffic Light cannot be created because junction must have\n at least one incoming edge and one outgoing edge."); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'invalid TLS'"); + } + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefDelete(FXObject*, FXSelector, void*) { + GNEJunction* junction = myTLSJunction->getCurrentJunction(); + const bool changeType = myTLSAttributes->getNumberOfTLSDefinitions() == 1; + NBTrafficLightDefinition* tlDef = myTLSAttributes->getCurrentTLSDefinition(); + onCmdCancel(nullptr, 0, nullptr); // abort because onCmdOk assumes we wish to save an edited definition + if (changeType) { + junction->setAttribute(SUMO_ATTR_TYPE, toString(SumoXMLNodeType::PRIORITY), myViewNet->getUndoList()); + } else { + myViewNet->getUndoList()->add(new GNEChange_TLS(junction, tlDef, false), true); + } + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefSwitch(FXObject*, FXSelector, void*) { + assert(myTLSJunction->getCurrentJunction() != 0); + assert(myTLSAttributes->getNumberOfTLSDefinitions() == myTLSAttributes->getNumberOfPrograms()); + NBTrafficLightDefinition* tlDef = myTLSAttributes->getCurrentTLSDefinition(); + // logic may not have been recomputed yet. recompute to be sure + NBTrafficLightLogicCont& tllCont = myViewNet->getNet()->getTLLogicCont(); + myViewNet->getNet()->computeJunction(myTLSJunction->getCurrentJunction()); + NBTrafficLightLogic* tllogic = tllCont.getLogic(tlDef->getID(), tlDef->getProgramID()); + if (tllogic != nullptr) { + // now we can be sure that the tlDef is up to date (i.e. re-guessed) + buildIinternalLanes(tlDef); + // create working copy from original def + delete myEditedDef; + myEditedDef = new NBLoadedSUMOTLDef(*tlDef, *tllogic); + myTLSAttributes->setOffset(myEditedDef->getLogic()->getOffset()); + myTLSPhases->initPhaseTable(); + myTLSPhases->updateCycleDuration(); + myTLSPhases->showCycleDuration(); + } else { + // tlDef has no valid logic (probably because id does not control any links + onCmdCancel(nullptr, 0, nullptr); + myViewNet->setStatusBarText("Traffic light does not control any links"); + } + return 1; +} + + +long +GNETLSEditorFrame::onUpdDefSwitch(FXObject* o, FXSelector, void*) { + const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0 && !myTLSModifications->checkHaveModifications(); + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + + +long +GNETLSEditorFrame::onUpdNeedsDef(FXObject* o, FXSelector, void*) { + const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0; + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + + +long +GNETLSEditorFrame::onUpdNeedsDefAndPhase(FXObject* o, FXSelector, void*) { + // do not delete the last phase + const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() > 0 && myTLSPhases->getPhaseTable()->getNumRows() > 1; + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + + +long +GNETLSEditorFrame::onUpdDefCreate(FXObject* o, FXSelector, void*) { + GNEJunction* junction = myTLSJunction->getCurrentJunction(); + const bool enable = junction != nullptr && !myTLSModifications->checkHaveModifications(); + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + const bool copy = junction != nullptr && junction->getNBNode()->isTLControlled(); + static_cast(o)->setText(copy ? "Copy" : "Create"); + return 1; +} + + +long +GNETLSEditorFrame::onUpdModified(FXObject* o, FXSelector, void*) { + bool enable = myTLSModifications->checkHaveModifications(); + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + + + +long +GNETLSEditorFrame::onCmdDefOffset(FXObject*, FXSelector, void*) { + myTLSModifications->setHaveModifications(true); + myEditedDef->setOffset(myTLSAttributes->getOffset()); + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefRename(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefSubRename(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNETLSEditorFrame::onCmdDefAddOff(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNETLSEditorFrame::onCmdGuess(FXObject*, FXSelector, void*) { + return 1; +} + + +long +GNETLSEditorFrame::onCmdPhaseSwitch(FXObject*, FXSelector, void*) { + const int index = myTLSPhases->getPhaseTable()->getCurrentRow(); + const NBTrafficLightLogic::PhaseDefinition& phase = getPhases()[index]; + myTLSPhases->getPhaseTable()->selectRow(index); + // need not hold since links could have been deleted somewhere else and indices may be reused + // assert(phase.state.size() == myInternalLanes.size()); + for (auto it : myInternalLanes) { + int tlIndex = it.first; + std::vector lanes = it.second; + LinkState state = LINKSTATE_DEADEND; + if (tlIndex >= 0 && tlIndex < (int)phase.state.size()) { + state = (LinkState)phase.state[tlIndex]; + } + for (auto it_lane : lanes) { + it_lane->setLinkState(state); + } + } + myViewNet->updateViewNet(); + return 1; +} + + +bool +GNETLSEditorFrame::fixedDuration() const { + assert(myEditedDef != nullptr); + return myEditedDef->getType() == TrafficLightType::STATIC; +} + + +void +GNETLSEditorFrame::selectedOverlappedElement(GNEAttributeCarrier* AC) { + editJunction(dynamic_cast(AC)); +} + + +long +GNETLSEditorFrame::onCmdPhaseCreate(FXObject*, FXSelector, void*) { + myTLSModifications->setHaveModifications(true); + // allows insertion at first position by deselecting via arrow keys + int newIndex = myTLSPhases->getPhaseTable()->getSelStartRow() + 1; + int oldIndex = MAX2(0, myTLSPhases->getPhaseTable()->getSelStartRow()); + // copy current row + SUMOTime duration = getSUMOTime(myTLSPhases->getPhaseTable()->getItemText(oldIndex, 0)); + const std::string oldState = myTLSPhases->getPhaseTable()->getItemText(oldIndex, fixedDuration() ? 1 : 3).text(); + std::string state = oldState; + + std::set crossingIndices; + for (NBNode* n : myEditedDef->getNodes()) { + for (NBNode::Crossing* c : n->getCrossings()) { + crossingIndices.insert(c->tlLinkIndex); + crossingIndices.insert(c->tlLinkIndex2); + } + } + + // smart adapations for new state + bool haveGreen = false; + bool haveYellow = false; + for (char c : state) { + if (c == LINKSTATE_TL_GREEN_MAJOR || c == LINKSTATE_TL_GREEN_MINOR) { + haveGreen = true; + } else if (c == LINKSTATE_TL_YELLOW_MAJOR || c == LINKSTATE_TL_YELLOW_MINOR) { + haveYellow = true; + } + } + const OptionsCont& oc = OptionsCont::getOptions(); + if (haveGreen && haveYellow) { + // guess left-mover state + duration = TIME2STEPS(oc.getInt("tls.left-green.time")); + for (int i = 0; i < (int)state.size(); i++) { + if (state[i] == LINKSTATE_TL_YELLOW_MAJOR || state[i] == LINKSTATE_TL_YELLOW_MINOR) { + state[i] = LINKSTATE_TL_RED; + } else if (state[i] == LINKSTATE_TL_GREEN_MINOR) { + state[i] = LINKSTATE_TL_GREEN_MAJOR; + } + } + } else if (haveGreen) { + // guess yellow state + myEditedDef->setParticipantsInformation(); + duration = TIME2STEPS(myEditedDef->computeBrakingTime(oc.getFloat("tls.yellow.min-decel"))); + for (int i = 0; i < (int)state.size(); i++) { + if (state[i] == LINKSTATE_TL_GREEN_MAJOR || state[i] == LINKSTATE_TL_GREEN_MINOR) { + if (crossingIndices.count(i) == 0) { + state[i] = LINKSTATE_TL_YELLOW_MINOR; + } else { + state[i] = LINKSTATE_TL_RED; + } + } + } + } else if (haveYellow) { + duration = TIME2STEPS(oc.isDefault("tls.allred.time") ? 2 : oc.getInt("tls.allred.time")); + // guess all-red state + for (int i = 0; i < (int)state.size(); i++) { + if (state[i] == LINKSTATE_TL_YELLOW_MAJOR || state[i] == LINKSTATE_TL_YELLOW_MINOR) { + state[i] = LINKSTATE_TL_RED; + } + } + } + // fix continuous green states + const int nextIndex = myTLSPhases->getPhaseTable()->getNumRows() > newIndex ? newIndex : 0; + const std::string state2 = myTLSPhases->getPhaseTable()->getItemText(nextIndex, fixedDuration() ? 1 : 3).text(); + for (int i = 0; i < (int)state.size(); i++) { + if ((oldState[i] == LINKSTATE_TL_GREEN_MAJOR || oldState[i] == LINKSTATE_TL_GREEN_MINOR) + && (state2[i] == LINKSTATE_TL_GREEN_MAJOR || state2[i] == LINKSTATE_TL_GREEN_MINOR)) { + state[i] = oldState[i]; + } + } + + myEditedDef->getLogic()->addStep(duration, state, std::vector(), "", newIndex); + myTLSPhases->getPhaseTable()->setCurrentItem(newIndex, 0); + myTLSPhases->initPhaseTable(newIndex); + myTLSPhases->getPhaseTable()->setFocus(); + return 1; +} + + +long +GNETLSEditorFrame::onCmdPhaseDelete(FXObject*, FXSelector, void*) { + myTLSModifications->setHaveModifications(true); + const int newRow = MAX2((int)0, (int)myTLSPhases->getPhaseTable()->getCurrentRow() - 1); + myEditedDef->getLogic()->deletePhase(myTLSPhases->getPhaseTable()->getCurrentRow()); + myTLSPhases->initPhaseTable(newRow); + myTLSPhases->getPhaseTable()->setFocus(); + return 1; +} + + +long +GNETLSEditorFrame::onCmdCleanup(FXObject*, FXSelector, void*) { + myTLSModifications->setHaveModifications(myEditedDef->cleanupStates()); + buildIinternalLanes(myEditedDef); + myTLSPhases->initPhaseTable(0); + myTLSPhases->getPhaseTable()->setFocus(); + myTLSModifications->setHaveModifications(true); + return 1; +} + + +long +GNETLSEditorFrame::onCmdAddUnused(FXObject*, FXSelector, void*) { + myEditedDef->getLogic()->setStateLength( + myEditedDef->getLogic()->getNumLinks() + 1); + myTLSModifications->setHaveModifications(true); + myTLSPhases->initPhaseTable(0); + myTLSPhases->getPhaseTable()->setFocus(); + return 1; +} + + +long +GNETLSEditorFrame::onCmdGroupStates(FXObject*, FXSelector, void*) { + myEditedDef->groupSignals(); + myTLSModifications->setHaveModifications(true); + buildIinternalLanes(myEditedDef); + myTLSPhases->initPhaseTable(0); + myTLSPhases->getPhaseTable()->setFocus(); + return 1; +} + + +long +GNETLSEditorFrame::onCmdUngroupStates(FXObject*, FXSelector, void*) { + myEditedDef->setParticipantsInformation(); + myEditedDef->ungroupSignals(); + myTLSModifications->setHaveModifications(true); + buildIinternalLanes(myEditedDef); + myTLSPhases->initPhaseTable(0); + myTLSPhases->getPhaseTable()->setFocus(); + return 1; +} + + +long +GNETLSEditorFrame::onUpdNeedsSingleDef(FXObject* o, FXSelector, void*) { + const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() == 1; + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + +long +GNETLSEditorFrame::onUpdUngroupStates(FXObject* o, FXSelector, void*) { + const bool enable = myTLSAttributes->getNumberOfTLSDefinitions() == 1 && myEditedDef != nullptr && myEditedDef->usingSignalGroups(); + o->handle(this, FXSEL(SEL_COMMAND, enable ? FXWindow::ID_ENABLE : FXWindow::ID_DISABLE), nullptr); + return 1; +} + +long +GNETLSEditorFrame::onCmdPhaseEdit(FXObject*, FXSelector, void* ptr) { + /* @note: there is a bug when copying/pasting rows: when this handler is + * called the value of the cell is not yet updated. This means you have to + * click inside the cell and hit enter to actually update the value */ + FXTablePos* tp = (FXTablePos*)ptr; + FXString value = myTLSPhases->getPhaseTable()->getItemText(tp->row, tp->col); + const int colDuration = 0; + const int colMinDur = fixedDuration() ? -1 : 1; + const int colMaxDur = fixedDuration() ? -1 : 2; + const int colState = fixedDuration() ? 1 : 3; + const int colNext = fixedDuration() ? 2 : 4; + const int colName = fixedDuration() ? 3 : 5; + + if (tp->col == colDuration) { + // duration edited + if (GNEAttributeCarrier::canParse(value.text())) { + SUMOTime duration = getSUMOTime(value); + if (duration > 0) { + myEditedDef->getLogic()->setPhaseDuration(tp->row, duration); + myTLSModifications->setHaveModifications(true); + myTLSPhases->updateCycleDuration(); + return 1; + } + } + // input error, reset value + myTLSPhases->getPhaseTable()->setItemText(tp->row, colDuration, toString(STEPS2TIME(getPhases()[tp->row].duration)).c_str()); + } else if (tp->col == colMinDur) { + // minDur edited + if (GNEAttributeCarrier::canParse(value.text())) { + SUMOTime minDur = getSUMOTime(value); + if (minDur > 0) { + myEditedDef->getLogic()->setPhaseMinDuration(tp->row, minDur); + myTLSModifications->setHaveModifications(true); + return 1; + } + } else if (StringUtils::prune(value.text()).empty()) { + myEditedDef->getLogic()->setPhaseMinDuration(tp->row, NBTrafficLightDefinition::UNSPECIFIED_DURATION); + myTLSModifications->setHaveModifications(true); + return 1; + } + // input error, reset value + myTLSPhases->getPhaseTable()->setItemText(tp->row, colMinDur, varDurString(getPhases()[tp->row].minDur).c_str()); + } else if (tp->col == colMaxDur) { + // maxDur edited + if (GNEAttributeCarrier::canParse(value.text())) { + SUMOTime maxDur = getSUMOTime(value); + if (maxDur > 0) { + myEditedDef->getLogic()->setPhaseMaxDuration(tp->row, maxDur); + myTLSModifications->setHaveModifications(true); + return 1; + } + } else if (StringUtils::prune(value.text()).empty()) { + myEditedDef->getLogic()->setPhaseMaxDuration(tp->row, NBTrafficLightDefinition::UNSPECIFIED_DURATION); + myTLSModifications->setHaveModifications(true); + return 1; + } + // input error, reset value + myTLSPhases->getPhaseTable()->setItemText(tp->row, colMaxDur, varDurString(getPhases()[tp->row].maxDur).c_str()); + } else if (tp->col == colState) { + // state edited + try { + // insert phase with new step and delete the old phase + const NBTrafficLightLogic::PhaseDefinition& phase = getPhases()[tp->row]; + myEditedDef->getLogic()->addStep(phase.duration, value.text(), phase.next, phase.name, tp->row); + myEditedDef->getLogic()->deletePhase(tp->row + 1); + myTLSModifications->setHaveModifications(true); + onCmdPhaseSwitch(nullptr, 0, nullptr); + } catch (ProcessError&) { + // input error, reset value + myTLSPhases->getPhaseTable()->setItemText(tp->row, colState, getPhases()[tp->row].state.c_str()); + } + } else if (tp->col == colNext) { + // next edited + bool ok = true; + if (GNEAttributeCarrier::canParse >(value.text())) { + std::vector nextEdited = GNEAttributeCarrier::parse >(value.text()); + for (int n : nextEdited) { + if (n < 0 || n >= myTLSPhases->getPhaseTable()->getNumRows()) { + ok = false; + break; + } + } + if (ok) { + myEditedDef->getLogic()->setPhaseNext(tp->row, nextEdited); + myTLSModifications->setHaveModifications(true); + return 1; + } + } + // input error, reset value + myTLSPhases->getPhaseTable()->setItemText(tp->row, colNext, ""); + } else if (tp->col == colName) { + // name edited + myEditedDef->getLogic()->setPhaseName(tp->row, value.text()); + myTLSModifications->setHaveModifications(true); + return 1; + } + return 1; +} + + +void +GNETLSEditorFrame::cleanup() { + if (myTLSJunction->getCurrentJunction()) { + myTLSJunction->getCurrentJunction()->selectTLS(false); + if (myTLSAttributes->getNumberOfTLSDefinitions() > 0) { + for (NBNode* node : myTLSAttributes->getCurrentTLSDefinition()->getNodes()) { + myViewNet->getNet()->retrieveJunction(node->getID())->selectTLS(false); + } + } + } + // clean data structures + myTLSJunction->setCurrentJunction(nullptr); + myTLSModifications->setHaveModifications(false); + delete myEditedDef; + myEditedDef = nullptr; + buildIinternalLanes(nullptr); // only clears + // clean up controls + myTLSAttributes->clearTLSAttributes(); + myTLSPhases->initPhaseTable(); // only clears when there are no definitions + myTLSPhases->hideCycleDuration(); + myTLSJunction->updateJunctionDescription(); +} + + +void +GNETLSEditorFrame::buildIinternalLanes(NBTrafficLightDefinition* tlDef) { + // clean up previous objects + for (auto it : myInternalLanes) { + for (auto it_intLanes : it.second) { + // due GNEInternalLane aren't attribute carriers, we need to use the net grid + myViewNet->getNet()->getGrid().removeAdditionalGLObject(it_intLanes); + delete it_intLanes; + } + } + myInternalLanes.clear(); + // create new internal lanes + if (tlDef != nullptr) { + const int NUM_POINTS = 10; + assert(myTLSJunction->getCurrentJunction()); + NBNode* nbnCurrentJunction = myTLSJunction->getCurrentJunction()->getNBNode(); + std::string innerID = ":" + nbnCurrentJunction->getID(); // see NWWriter_SUMO::writeInternalEdges + const NBConnectionVector& links = tlDef->getControlledLinks(); + for (auto it : links) { + int tlIndex = it.getTLIndex(); + PositionVector shape = it.getFrom()->getToNode()->computeInternalLaneShape(it.getFrom(), NBEdge::Connection(it.getFromLane(), + it.getTo(), it.getToLane()), NUM_POINTS); + if (shape.length() < 2) { + // enlarge shape to ensure visibility + shape.clear(); + PositionVector laneShapeFrom = it.getFrom()->getLaneShape(it.getFromLane()); + PositionVector laneShapeTo = it.getTo()->getLaneShape(it.getToLane()); + shape.push_back(laneShapeFrom.positionAtOffset(MAX2(0.0, laneShapeFrom.length() - 1))); + shape.push_back(laneShapeTo.positionAtOffset(MIN2(1.0, laneShapeFrom.length()))); + } + GNEInternalLane* ilane = new GNEInternalLane(this, innerID + '_' + toString(tlIndex), shape, tlIndex); + // due GNEInternalLane aren't attribute carriers, we need to use the net grid + myViewNet->getNet()->getGrid().addAdditionalGLObject(ilane); + myInternalLanes[tlIndex].push_back(ilane); + } + for (NBNode* nbn : tlDef->getNodes()) { + for (auto c : nbn->getCrossings()) { + if (c->tlLinkIndex2 > 0 && c->tlLinkIndex2 != c->tlLinkIndex) { + // draw both directions + PositionVector forward = c->shape; + forward.move2side(c->width / 4); + GNEInternalLane* ilane = new GNEInternalLane(this, c->id, forward, c->tlLinkIndex); + // due GNEInternalLane aren't attribute carriers, we need to use the net grid + myViewNet->getNet()->getGrid().addAdditionalGLObject(ilane); + myInternalLanes[c->tlLinkIndex].push_back(ilane); + + PositionVector backward = c->shape.reverse(); + backward.move2side(c->width / 4); + GNEInternalLane* ilane2 = new GNEInternalLane(this, c->id + "_r", backward, c->tlLinkIndex2); + // due GNEInternalLane aren't attribute carriers, we need to use the net grid + myViewNet->getNet()->getGrid().addAdditionalGLObject(ilane2); + myInternalLanes[c->tlLinkIndex2].push_back(ilane2); + } else { + // draw only one lane for both directions + GNEInternalLane* ilane = new GNEInternalLane(this, c->id, c->shape, c->tlLinkIndex); + // due GNEInternalLane aren't attribute carriers, we need to use the net grid + myViewNet->getNet()->getGrid().addAdditionalGLObject(ilane); + myInternalLanes[c->tlLinkIndex].push_back(ilane); + } + } + } + } +} + + +std::string +GNETLSEditorFrame::varDurString(SUMOTime dur) { + return dur == NBTrafficLightDefinition::UNSPECIFIED_DURATION ? " " : toString(STEPS2TIME(dur)); +} + + +const std::vector& +GNETLSEditorFrame::getPhases() { + return myEditedDef->getLogic()->getPhases(); +} + + +void +GNETLSEditorFrame::handleChange(GNEInternalLane* lane) { + myTLSModifications->setHaveModifications(true); + if (myViewNet->changeAllPhases()) { + const std::vector& phases = getPhases(); + for (int row = 0; row < (int)phases.size(); row++) { + myEditedDef->getLogic()->setPhaseState(row, lane->getTLIndex(), lane->getLinkState()); + } + } else { + myEditedDef->getLogic()->setPhaseState(myTLSPhases->getPhaseTable()->getCurrentRow(), lane->getTLIndex(), lane->getLinkState()); + } + myTLSPhases->initPhaseTable(myTLSPhases->getPhaseTable()->getCurrentRow()); + myTLSPhases->getPhaseTable()->setFocus(); +} + + +void +GNETLSEditorFrame::handleMultiChange(GNELane* lane, FXObject* obj, FXSelector sel, void* eventData) { + if (myEditedDef != nullptr) { + myTLSModifications->setHaveModifications(true); + const NBConnectionVector& links = myEditedDef->getControlledLinks(); + std::set fromIDs; + fromIDs.insert(lane->getMicrosimID()); + // if neither the lane nor its edge are selected, apply changes to the whole edge + if (!lane->getParentEdge()->isAttributeCarrierSelected() && !lane->isAttributeCarrierSelected()) { + for (auto it_lane : lane->getParentEdge()->getLanes()) { + fromIDs.insert(it_lane->getMicrosimID()); + } + } else { + // if the edge is selected, apply changes to all lanes of all selected edges + if (lane->getParentEdge()->isAttributeCarrierSelected()) { + std::vector edges = myViewNet->getNet()->retrieveEdges(true); + for (auto it : edges) { + for (auto it_lane : it->getLanes()) { + fromIDs.insert(it_lane->getMicrosimID()); + } + } + } + // if the lane is selected, apply changes to all selected lanes + if (lane->isAttributeCarrierSelected()) { + std::vector lanes = myViewNet->getNet()->retrieveLanes(true); + for (auto it_lane : lanes) { + fromIDs.insert(it_lane->getMicrosimID()); + } + } + + } + // set new state for all connections from the chosen lane IDs + for (auto it : links) { + if (fromIDs.count(it.getFrom()->getLaneID(it.getFromLane())) > 0) { + std::vector lanes = myInternalLanes[it.getTLIndex()]; + for (auto it_lane : lanes) { + it_lane->onDefault(obj, sel, eventData); + } + } + } + } +} + + +bool +GNETLSEditorFrame::controlsEdge(GNEEdge* edge) const { + if (myEditedDef != nullptr) { + const NBConnectionVector& links = myEditedDef->getControlledLinks(); + for (auto it : links) { + if (it.getFrom()->getID() == edge->getMicrosimID()) { + return true; + } + } + } + return false; +} + + +void +GNETLSEditorFrame::editJunction(GNEJunction* junction) { + if ((myTLSJunction->getCurrentJunction() == nullptr) || (!myTLSModifications->checkHaveModifications() && (junction != myTLSJunction->getCurrentJunction()))) { + onCmdCancel(nullptr, 0, nullptr); + myViewNet->getUndoList()->p_begin("modifying traffic light definition"); + myTLSJunction->setCurrentJunction(junction); + myTLSAttributes->initTLSAttributes(myTLSJunction->getCurrentJunction()); + myTLSJunction->updateJunctionDescription(); + // only select TLS if getCurrentJunction exist + if (myTLSJunction->getCurrentJunction()) { + myTLSJunction->getCurrentJunction()->selectTLS(true); + } + if (myTLSAttributes->getNumberOfTLSDefinitions() > 0) { + for (NBNode* node : myTLSAttributes->getCurrentTLSDefinition()->getNodes()) { + myViewNet->getNet()->retrieveJunction(node->getID())->selectTLS(true); + } + } + } else { + myViewNet->setStatusBarText("Unsaved modifications. Abort or Save"); + } +} + + +SUMOTime +GNETLSEditorFrame::getSUMOTime(const FXString& string) { + return TIME2STEPS(GNEAttributeCarrier::parse(string.text())); +} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSAttributes - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSAttributes::TLSAttributes(GNETLSEditorFrame* TLSEditorParent) : + FXGroupBox(TLSEditorParent->myContentFrame, "Traffic light Attributes", GUIDesignGroupBoxFrame), + myTLSEditorParent(TLSEditorParent) { + + // create frame, label and textfield for name (By default disabled) + FXHorizontalFrame* nameFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myNameLabel = new FXLabel(nameFrame, "ID", 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); + myProgramLabel = 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); + myOffsetLabel = new FXLabel(offsetFrame, "Offset", nullptr, GUIDesignLabelAttribute); + myOffsetTextField = new FXTextField(offsetFrame, GUIDesignTextFieldNCol, myTLSEditorParent, MID_GNE_TLSFRAME_OFFSET, GUIDesignTextField); + myOffsetTextField->disable(); +} + + +GNETLSEditorFrame::TLSAttributes::~TLSAttributes() {} + + +void +GNETLSEditorFrame::TLSAttributes::initTLSAttributes(GNEJunction* junction) { + assert(junction); + myTLSDefinitions.clear(); + // enable name TextField + myNameTextField->enable(); + // enable Offset + myOffsetTextField->enable(); + // obtain TLSs + for (auto it : junction->getNBNode()->getControllingTLS()) { + myTLSDefinitions.push_back(it); + myNameTextField->setText(it->getID().c_str()); + myNameTextField->enable(); + myProgramComboBox->appendItem(it->getProgramID().c_str()); + } + if (myTLSDefinitions.size() > 0) { + myProgramComboBox->enable(); + myProgramComboBox->setCurrentItem(0); + myProgramComboBox->setNumVisible(myProgramComboBox->getNumItems()); + myTLSEditorParent->onCmdDefSwitch(nullptr, 0, nullptr); + } +} + + +void +GNETLSEditorFrame::TLSAttributes::clearTLSAttributes() { + // clear definitions + myTLSDefinitions.clear(); + // clear and disable name TextField + myNameTextField->setText(""); + myNameTextField->disable(); + // clear and disable myProgramComboBox + myProgramComboBox->clearItems(); + myProgramComboBox->disable(); + // clear and disable Offset TextField + myOffsetTextField->setText(""); + myOffsetTextField->disable(); +} + + +NBTrafficLightDefinition* +GNETLSEditorFrame::TLSAttributes::getCurrentTLSDefinition() const { + return myTLSDefinitions.at(myProgramComboBox->getCurrentItem()); +} + + +int +GNETLSEditorFrame::TLSAttributes::getNumberOfTLSDefinitions() const { + return (int)myTLSDefinitions.size(); +} + + +int +GNETLSEditorFrame::TLSAttributes::getNumberOfPrograms() const { + return myProgramComboBox->getNumItems(); +} + + +SUMOTime +GNETLSEditorFrame::TLSAttributes::getOffset() const { + return getSUMOTime(myOffsetTextField->getText()); +} + + +void +GNETLSEditorFrame::TLSAttributes::setOffset(SUMOTime offset) { + myOffsetTextField->setText(toString(STEPS2TIME(offset)).c_str()); +} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSJunction - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSJunction::TLSJunction(GNETLSEditorFrame* tlsEditorParent) : + FXGroupBox(tlsEditorParent->myContentFrame, "Junction", GUIDesignGroupBoxFrame), + myCurrentJunction(nullptr) { + // Create frame for junction ID + FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + myLabelJunctionID = new FXLabel(junctionIDFrame, "Junction ID", nullptr, GUIDesignLabelAttribute); + myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_TLSFRAME_SELECT_JUNCTION, GUIDesignTextField); + myTextFieldJunctionID->setEditable(false); + // update junction description after creation + updateJunctionDescription(); + // show TLS Junction + show(); +} + + +GNETLSEditorFrame::TLSJunction::~TLSJunction() {} + + +GNEJunction* +GNETLSEditorFrame::TLSJunction::getCurrentJunction() const { + return myCurrentJunction; +} + + +void +GNETLSEditorFrame::TLSJunction::setCurrentJunction(GNEJunction* junction) { + myCurrentJunction = junction; +} + + +void +GNETLSEditorFrame::TLSJunction::updateJunctionDescription() const { + if (myCurrentJunction == nullptr) { + myTextFieldJunctionID->setText(""); + } else { + NBNode* nbn = myCurrentJunction->getNBNode(); + myTextFieldJunctionID->setText(nbn->getID().c_str()); + } +} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSDefinition - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSDefinition::TLSDefinition(GNETLSEditorFrame* TLSEditorParent) : + FXGroupBox(TLSEditorParent->myContentFrame, "Traffic Light Programs", GUIDesignGroupBoxFrame) { + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, 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); + // create delete tlDef button + myDeleteTLProgram = new FXButton(buttonsFrame, "Delete\t\tDelete a traffic light program. If all programs are deleted the junction turns into a priority junction.", + GUIIconSubSys::getIcon(GUIIcon::REMOVE), TLSEditorParent, MID_GNE_TLSFRAME_DELETE, GUIDesignButton); + // show TLS TLSDefinition + show(); +} + + +GNETLSEditorFrame::TLSDefinition::~TLSDefinition() {} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSPhases - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSPhases::TLSPhases(GNETLSEditorFrame* TLSEditorParent) : + FXGroupBox(TLSEditorParent->myContentFrame, "Phases", GUIDesignGroupBoxFrame), + myTLSEditorParent(TLSEditorParent), + myTableFont(new FXFont(getApp(), "Courier New", 9)) { + + // create and configure phase table + myTableScroll = new FXScrollWindow(this, 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); + myPhaseTable->setRowHeaderMode(LAYOUT_FIX_WIDTH); + myPhaseTable->setRowHeaderWidth(0); + myPhaseTable->hide(); + myPhaseTable->setFont(myTableFont); + myPhaseTable->setHelpText("phase duration in seconds | phase state"); + + // create total duration info label + myCycleDuration = new FXLabel(this, "", 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); + + FXHorizontalFrame* phaseButtons = new FXHorizontalFrame(this, 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 + + // create new phase button + myInsertDuplicateButton = new FXButton(col1, "Insert Phase\t\tInsert new phase after the selected phase. The new state is deduced from the selected phase.", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_PHASE_CREATE, GUIDesignButton); + // create delete phase button + myDeleteSelectedPhaseButton = new FXButton(col2, "Delete Phase\t\tDelete selected phase", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_PHASE_DELETE, GUIDesignButton); + + // create cleanup states button + new FXButton(col1, "Clean States\t\tClean unused states from all phase. (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_CLEANUP, GUIDesignButton); + + // add unused states button + new FXButton(col2, "Add States\t\tExtend the state vector for all phases by one entry (unused until a connection or crossing is assigned to the new index).", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_ADDUNUSED, GUIDesignButton); + + // group states button + new FXButton(col1, "Group Signals\t\tShorten state definition by letting connections with the same signal states use the same index. (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_GROUP_STATES, GUIDesignButton); + + // ungroup states button + new FXButton(col2, "Ungroup Signals\t\tLet every connection use a distinct index (reverse state grouping). (Not allowed for multiple programs)", nullptr, myTLSEditorParent, MID_GNE_TLSFRAME_UNGROUP_STATES, GUIDesignButton); + // show TLSFile + show(); +} + + +GNETLSEditorFrame::TLSPhases::~TLSPhases() { + delete myTableFont; +} + + +FXTable* +GNETLSEditorFrame::TLSPhases::getPhaseTable() const { + return myPhaseTable; +} + + +void +GNETLSEditorFrame::TLSPhases::initPhaseTable(int index) { + myPhaseTable->setVisibleRows(1); + myPhaseTable->setVisibleColumns(2); + myPhaseTable->hide(); + if (myTLSEditorParent->myTLSAttributes->getNumberOfTLSDefinitions() > 0) { + const bool fixed = myTLSEditorParent->fixedDuration(); + const int cols = fixed ? 4 : 6; + const int colDuration = 0; + const int colMinDur = fixed ? -1 : 1; + const int colMaxDur = fixed ? -1 : 2; + const int colState = fixed ? 1 : 3; + const int colNext = fixed ? 2 : 4; + const int colName = fixed ? 3 : 5; + + const std::vector& phases = myTLSEditorParent->getPhases(); + myPhaseTable->setTableSize((int)phases.size(), cols); + myPhaseTable->setVisibleRows((int)phases.size()); + myPhaseTable->setVisibleColumns(cols); + for (int row = 0; row < (int)phases.size(); row++) { + myPhaseTable->setItemText(row, colDuration, toString(STEPS2TIME(phases[row].duration)).c_str()); + if (!fixed) { + myPhaseTable->setItemText(row, colMinDur, varDurString(phases[row].minDur).c_str()); + myPhaseTable->setItemText(row, colMaxDur, varDurString(phases[row].maxDur).c_str()); + } + myPhaseTable->setItemText(row, colState, phases[row].state.c_str()); + myPhaseTable->setItemText(row, colNext, phases[row].next.size() > 0 ? toString(phases[row].next).c_str() : " "); + myPhaseTable->setItemText(row, colName, phases[row].name.c_str()); + myPhaseTable->getItem(row, 1)->setJustify(FXTableItem::LEFT); + } + myPhaseTable->fitColumnsToContents(0, cols); + myPhaseTable->setColumnText(colDuration, "dur"); + if (colMinDur >= 0) { + myPhaseTable->setColumnText(colMinDur, "min"); + myPhaseTable->setColumnText(colMaxDur, "max"); + myPhaseTable->setColumnWidth(colMinDur, MAX2(myPhaseTable->getColumnWidth(colMinDur), 30)); + myPhaseTable->setColumnWidth(colMaxDur, MAX2(myPhaseTable->getColumnWidth(colMaxDur), 35)); + } + myPhaseTable->setColumnText(colState, "state"); + myPhaseTable->setColumnText(colNext, "nxt"); + myPhaseTable->setColumnText(colName, "name"); + myPhaseTable->setColumnWidth(colNext, MAX2(myPhaseTable->getColumnWidth(colNext), 30)); + myPhaseTable->setColumnWidth(colName, MAX2(myPhaseTable->getColumnWidth(colName), 45)); + + myPhaseTable->setHeight((int)phases.size() * 21 + 21); // experimental + myPhaseTable->setCurrentItem(index, 0); + myPhaseTable->selectRow(index, true); + myPhaseTable->show(); + myPhaseTable->setFocus(); + myTableScroll->setHeight(myPhaseTable->getHeight() + 15); + + // neither my myPhaseTable->getWidth nor getDefaultWidth return the sum of column widths + // however, the scroll pane uses getDefaultWidth to determine the + // horizontal scrolling area which can only be changed via + // getDefColumnWidth, hence the baroque work-around + + int neededWidth = 0; + for (int i = 0; i < cols; i++) { + neededWidth += myPhaseTable->getColumnWidth(i); + } + myPhaseTable->setDefColumnWidth(neededWidth / cols); + } + update(); +} + + +void +GNETLSEditorFrame::TLSPhases::showCycleDuration() { + myCycleDuration->show(); +} + + +void +GNETLSEditorFrame::TLSPhases::hideCycleDuration() { + myCycleDuration->hide(); +} + +void +GNETLSEditorFrame::TLSPhases::updateCycleDuration() { + SUMOTime cycleDuration = 0; + for (auto it : myTLSEditorParent->getPhases()) { + cycleDuration += it.duration; + } + std::string text = "Cycle time: " + toString(STEPS2TIME(cycleDuration)); + myCycleDuration->setText(text.c_str()); +} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSModifications - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSModifications::TLSModifications(GNETLSEditorFrame* TLSEditorParent) : + FXGroupBox(TLSEditorParent->myContentFrame, "Modifications", GUIDesignGroupBoxFrame), + myTLSEditorParent(TLSEditorParent), + myHaveModifications(false) { + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, GUIDesignAuxiliarHorizontalFrame); + // create save modifications button + mySaveModificationsButtons = new FXButton(buttonsFrame, "Save\t\tSave program modifications (Enter)", + GUIIconSubSys::getIcon(GUIIcon::OK), myTLSEditorParent, MID_OK, GUIDesignButton); + // create discard modifications buttons + myDiscardModificationsButtons = new FXButton(buttonsFrame, "Cancel\t\tDiscard program modifications (Esc)", + GUIIconSubSys::getIcon(GUIIcon::CANCEL), myTLSEditorParent, MID_CANCEL, GUIDesignButton); + // show TLSModifications + show(); +} + + +GNETLSEditorFrame::TLSModifications::~TLSModifications() {} + + +bool +GNETLSEditorFrame::TLSModifications::checkHaveModifications() const { + return myHaveModifications; +} + + +void +GNETLSEditorFrame::TLSModifications::setHaveModifications(bool value) { + myHaveModifications = value; +} + +// --------------------------------------------------------------------------- +// GNETLSEditorFrame::TLSFile - methods +// --------------------------------------------------------------------------- + +GNETLSEditorFrame::TLSFile::TLSFile(GNETLSEditorFrame* TLSEditorParent) : + FXGroupBox(TLSEditorParent->myContentFrame, "TLS Program File", GUIDesignGroupBoxFrame), + myTLSEditorParent(TLSEditorParent) { + FXHorizontalFrame* buttonsFrame = new FXHorizontalFrame(this, 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 + mySaveTLSProgramButton = new FXButton(buttonsFrame, "Save\t\tSave TLS program to additional file", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_GNE_TLSFRAME_SAVE_PROGRAM, GUIDesignButton); + // show TLSFile + show(); +} + + +GNETLSEditorFrame::TLSFile::~TLSFile() {} + + +long +GNETLSEditorFrame::TLSFile::onCmdLoadTLSProgram(FXObject*, FXSelector, void*) { + FXFileDialog opendialog(this, "Load TLS Program"); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::MODETLS)); + opendialog.setSelectMode(SELECTFILE_EXISTING); + opendialog.setPatternList("*.xml"); + if (gCurrentFolder.length() != 0) { + opendialog.setDirectory(gCurrentFolder); + } + if (opendialog.execute()) { + // run parser + NBTrafficLightLogicCont tmpTLLCont; + NIXMLTrafficLightsHandler tllHandler(tmpTLLCont, myTLSEditorParent->myViewNet->getNet()->getEdgeCont(), true); + tmpTLLCont.insert(myTLSEditorParent->myEditedDef); + XMLSubSys::runParser(tllHandler, opendialog.getFilename().text()); + + NBLoadedSUMOTLDef* newDefSameProgram = nullptr; + std::set newDefsOtherProgram; + for (auto item : tmpTLLCont.getPrograms(myTLSEditorParent->myEditedDef->getID())) { + if (item.second != myTLSEditorParent->myEditedDef) { + NBLoadedSUMOTLDef* sdef = dynamic_cast(item.second); + if (item.first == myTLSEditorParent->myEditedDef->getProgramID()) { + newDefSameProgram = sdef; + } else { + newDefsOtherProgram.insert(sdef); + } + } + } + const int newPrograms = (int)newDefsOtherProgram.size(); + if (newPrograms > 0 || newDefSameProgram != nullptr) { + std::vector nodes = myTLSEditorParent->myEditedDef->getNodes(); + for (auto newProg : newDefsOtherProgram) { + for (auto it_node : nodes) { + GNEJunction* junction = myTLSEditorParent->getViewNet()->getNet()->retrieveJunction(it_node->getID()); + myTLSEditorParent->getViewNet()->getUndoList()->add(new GNEChange_TLS(junction, newProg, true), true); + } + } + if (newPrograms > 0) { + WRITE_MESSAGE("Loaded " + toString(newPrograms) + " new programs for tlLogic '" + myTLSEditorParent->myEditedDef->getID() + "'"); + } + if (newDefSameProgram != nullptr) { + // replace old program when loading the same program ID + myTLSEditorParent->myEditedDef = newDefSameProgram; + WRITE_MESSAGE("Updated program '" + newDefSameProgram->getProgramID() + "' for tlLogic '" + myTLSEditorParent->myEditedDef->getID() + "'"); + } + } else { + myTLSEditorParent->getViewNet()->setStatusBarText("No programs found for traffic light '" + myTLSEditorParent->myEditedDef->getID() + "'"); + } + + // clean up temporary container to avoid deletion of defs when it's destruct is called + for (NBTrafficLightDefinition* def : tmpTLLCont.getDefinitions()) { + tmpTLLCont.removeProgram(def->getID(), def->getProgramID(), false); + } + + myTLSEditorParent->myTLSPhases->initPhaseTable(); + myTLSEditorParent->myTLSModifications->setHaveModifications(true); + } + return 0; +} + + +long +GNETLSEditorFrame::TLSFile::onCmdSaveTLSProgram(FXObject*, FXSelector, void*) { + FXString file = MFXUtils::getFilename2Write(this, + "Save TLS Program as", ".xml", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), + gCurrentFolder); + if (file == "") { + return 1; + } + OutputDevice& device = OutputDevice::getDevice(file.text()); + + // save program + device.writeXMLHeader("additional", "additional_file.xsd"); + device.openTag(SUMO_TAG_TLLOGIC); + device.writeAttr(SUMO_ATTR_ID, myTLSEditorParent->myEditedDef->getLogic()->getID()); + device.writeAttr(SUMO_ATTR_TYPE, myTLSEditorParent->myEditedDef->getLogic()->getType()); + device.writeAttr(SUMO_ATTR_PROGRAMID, myTLSEditorParent->myEditedDef->getLogic()->getProgramID()); + device.writeAttr(SUMO_ATTR_OFFSET, writeSUMOTime(myTLSEditorParent->myEditedDef->getLogic()->getOffset())); + // write the phases + const bool varPhaseLength = myTLSEditorParent->myEditedDef->getLogic()->getType() != TrafficLightType::STATIC; + const std::vector& phases = myTLSEditorParent->myEditedDef->getLogic()->getPhases(); + for (auto j : phases) { + device.openTag(SUMO_TAG_PHASE); + device.writeAttr(SUMO_ATTR_DURATION, writeSUMOTime(j.duration)); + device.writeAttr(SUMO_ATTR_STATE, j.state); + if (varPhaseLength) { + if (j.minDur != NBTrafficLightDefinition::UNSPECIFIED_DURATION) { + device.writeAttr(SUMO_ATTR_MINDURATION, writeSUMOTime(j.minDur)); + } + if (j.maxDur != NBTrafficLightDefinition::UNSPECIFIED_DURATION) { + device.writeAttr(SUMO_ATTR_MAXDURATION, writeSUMOTime(j.maxDur)); + } + } + device.closeTag(); + } + device.close(); + return 1; +} + + +std::string +GNETLSEditorFrame::TLSFile::writeSUMOTime(SUMOTime steps) { + double time = STEPS2TIME(steps); + if (time == std::floor(time)) { + return toString(int(time)); + } else { + return toString(time); + } +} + +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); + return 1; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.h sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.h --- sumo-1.5.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/frames/network/GNETLSEditorFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,470 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNETLSEditorFrame.h +/// @author Jakob Erdmann +/// @date May 2011 +/// +// The Widget for modifying traffic lights +/****************************************************************************/ +#pragma once + +#include +#include + +// =========================================================================== +// class declarations +// =========================================================================== +class NBTrafficLightDefinition; +class NBLoadedSUMOTLDef; +class NBOwnTLDef; +class GNEInternalLane; + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class GNETLSEditorFrame + * The Widget for modifying Traffic Lights (TLS) + */ +class GNETLSEditorFrame : public GNEFrame { + /// @brief FOX-declaration + FXDECLARE(GNETLSEditorFrame) + +public: + + // =========================================================================== + // class TLSJunction + // =========================================================================== + + class TLSJunction : protected FXGroupBox { + + public: + /// @brief constructor + TLSJunction(GNETLSEditorFrame* tlsEditorParent); + + /// @brief destructor + ~TLSJunction(); + + /// @brief get current modified junction + GNEJunction* getCurrentJunction() const; + + /// @brief set current junction + void setCurrentJunction(GNEJunction* junction); + + /// @brief update descrition + void updateJunctionDescription() const; + + private: + /// @brief label for junction ID + FXLabel* myLabelJunctionID; + + /// @brief text field for junction ID + FXTextField* myTextFieldJunctionID; + + /// @brief the junction of the tls is being modified + GNEJunction* myCurrentJunction; + }; + + // =========================================================================== + // class TLSDefinition + // =========================================================================== + + class TLSDefinition : protected FXGroupBox { + + public: + /// @brief constructor + TLSDefinition(GNETLSEditorFrame* TLSEditorParent); + + /// @brief destructor + ~TLSDefinition(); + + private: + /// @brief button for create new Traffic light program + FXButton* myNewTLProgram; + + /// @brief button for delete traffic light program + FXButton* myDeleteTLProgram; + }; + + // =========================================================================== + // class TLSAttributes + // =========================================================================== + + class TLSAttributes : protected FXGroupBox { + + public: + /// @brief constructor + TLSAttributes(GNETLSEditorFrame* TLSEditorParent); + + /// @brief destructor + ~TLSAttributes(); + + /// @brief initializes the definitions and corresponding listbox + void initTLSAttributes(GNEJunction* junction); + + /// @brief clear TLS attributes + void clearTLSAttributes(); + + /// @brief get current definition + NBTrafficLightDefinition* getCurrentTLSDefinition() const; + + /// @brief get current offset in SUMOTIme + SUMOTime getOffset() const; + + /// @brief set new offset + void setOffset(SUMOTime offset); + + /// @brief get number of definitions + int getNumberOfTLSDefinitions() const; + + /// @brief get number of programs + int getNumberOfPrograms() const; + + private: + /// @brief pointer to TLSEditorParent + GNETLSEditorFrame* myTLSEditorParent; + + /// @brief the list of Definitions for the current junction + std::vector myTLSDefinitions; + + /// @brief name label + FXLabel* myNameLabel; + + /// @brief name text field + FXTextField* myNameTextField; + + /// @brief program label + FXLabel* myProgramLabel; + + /// @brief the comboBox for selecting the tl-definition to edit + FXComboBox* myProgramComboBox; + + /// @brief offset label + FXLabel* myOffsetLabel; + + /// @brief the control for modifying offset + FXTextField* myOffsetTextField; + }; + + // =========================================================================== + // class TLSPhases + // =========================================================================== + + class TLSPhases : protected FXGroupBox { + + public: + /// @brief constructor + TLSPhases(GNETLSEditorFrame* TLSEditorParent); + + /// @brief destructor + ~TLSPhases(); + + /// @brief get phase table + FXTable* getPhaseTable() const; + + /**@brief initialies the phase table + * @param[in] index The index to select + */ + void initPhaseTable(int index = 0); + + /// @brief show cycle duration + void showCycleDuration(); + + /// @brief hide cycle duration + void hideCycleDuration(); + + /// @brief recomputes cycle duration and updates label + void updateCycleDuration(); + + private: + /// @brief pointer to TLSEditor Parent + GNETLSEditorFrame* myTLSEditorParent; + + /// @brief font for the phase table + FXFont* myTableFont; + + /// @brief window for oversized phase tables + FXScrollWindow* myTableScroll; + + /// @brief table for selecting and rearranging phases and for changing duration + FXTable* myPhaseTable; + + /// @brief label with the cycle duration + FXLabel* myCycleDuration; + + /// @brief insert new phase button + FXButton* myInsertDuplicateButton; + + /// @brief delete phase button + FXButton* myDeleteSelectedPhaseButton; + }; + + // =========================================================================== + // class TLSModifications + // =========================================================================== + + class TLSModifications : protected FXGroupBox { + + public: + /// @brief constructor + TLSModifications(GNETLSEditorFrame* TLSEditorParent); + + /// @brief destructor + ~TLSModifications(); + + /// @brief check if current TLS was modified + bool checkHaveModifications() const; + + /// @brief set if current TLS was modified + void setHaveModifications(bool value); + + private: + /// @brief pointer to TLSEditor Parent + GNETLSEditorFrame* myTLSEditorParent; + + /// @brief button for cancel modifications + FXButton* myDiscardModificationsButtons; + + /// @brief button for save modifications + FXButton* mySaveModificationsButtons; + + /// @brief whether the current tls was modified + bool myHaveModifications; + }; + + // =========================================================================== + // class TLSFile + // =========================================================================== + + class TLSFile : protected FXGroupBox { + /// @brief FOX-declaration + FXDECLARE(GNETLSEditorFrame::TLSFile) + + public: + /// @brief constructor + TLSFile(GNETLSEditorFrame* TLSEditorParent); + + /// @brief destructor + ~TLSFile(); + + /// @name FOX-callbacks + /// @{ + /// @brief load TLS Program from an additional file + long onCmdLoadTLSProgram(FXObject*, FXSelector, void*); + + /// @brief save TLS Programm to an additional file + long onCmdSaveTLSProgram(FXObject*, FXSelector, void*); + + /// @brief enable buttons, only when a tlLogic is being edited + long onUpdNeedsDef(FXObject*, FXSelector, void*); + /// @} + + protected: + FOX_CONSTRUCTOR(TLSFile) + + private: + /// @brief pointer to TLSEditor Parent + GNETLSEditorFrame* myTLSEditorParent; + + /// @brief button for load TLS Programs + FXButton* myLoadTLSProgramButton; + + /// @brief button for save TLS Programs + FXButton* mySaveTLSProgramButton; + + /// @brief convert SUMOTime into string + std::string writeSUMOTime(SUMOTime steps); + }; + + + /**@brief Constructor + * @brief parent FXHorizontalFrame in which this GNEFrame is placed + * @brief viewNet viewNet that uses this GNEFrame + */ + GNETLSEditorFrame(FXHorizontalFrame* horizontalFrameParent, GNEViewNet* viewNet); + + /// @brief Destructor + ~GNETLSEditorFrame(); + + /// @brief show inspector frame + void show(); + + /**@brief edits the traffic light for the given clicked junction + * @param[in] clickedPosition clicked position + * @param[in] objectsUnderCursor The clicked objects under cursor + */ + void editTLS(const Position& clickedPosition, const GNEViewNetHelper::ObjectsUnderCursor& objectsUnderCursor); + + /// @brief check if modifications in TLS was saved + bool isTLSSaved(); + + /// @brief parse TLS Programs from a file + bool parseTLSPrograms(const std::string& file); + + /// @name FOX-callbacks + /// @{ + /// @brief Called when the user presses the OK-Button + /// @note saves any modifications + long onCmdOK(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the Cancel-button + /// @note discards any modifications + long onCmdCancel(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the button Toogle + long onCmdToggle(FXObject*, FXSelector, void*); + + /// @brief Called when the user presses the button Guess + long onCmdGuess(FXObject*, FXSelector, void*); + + /// @brief Called when the user creates a TLS + long onCmdDefCreate(FXObject*, FXSelector, void*); + + /// @brief Called when the user deletes a TLS + long onCmdDefDelete(FXObject*, FXSelector, void*); + + /// @brief Called when the user changes the offset of a TLS + long onCmdDefOffset(FXObject*, FXSelector, void*); + + /// @brief Called when the user switchs a TLS + long onCmdDefSwitch(FXObject*, FXSelector, void*); + + /// @brief Called when the user renames a TLS + long onCmdDefRename(FXObject*, FXSelector, void*); + + /// @brief Called when the user sub-renames a TLS + long onCmdDefSubRename(FXObject*, FXSelector, void*); + + /// @brief Called when the user adds a OFF + long onCmdDefAddOff(FXObject*, FXSelector, void*); + + /// @brief Called when the user switchs a Phase + long onCmdPhaseSwitch(FXObject*, FXSelector, void*); + + /// @brief Called when the user creates a Phase + long onCmdPhaseCreate(FXObject*, FXSelector, void*); + + /// @brief Called when the user deletes a Phase + long onCmdPhaseDelete(FXObject*, FXSelector, void*); + + /// @brief Called when the user cleans up states + long onCmdCleanup(FXObject*, FXSelector, void*); + + /// @brief Called when the user cleans up states + long onCmdAddUnused(FXObject*, FXSelector, void*); + + /// @brief Called when the user groups states + long onCmdGroupStates(FXObject*, FXSelector, void*); + + /// @brief Called when the user ungroups states + long onCmdUngroupStates(FXObject*, FXSelector, void*); + + /// @brief Called to update the ungroups states button + long onUpdUngroupStates(FXObject*, FXSelector, void*); + + /// @brief Called when the user edits a Phase + long onCmdPhaseEdit(FXObject*, FXSelector, void*); + + /// @brief Called when the user makes RILSA + long onCmdMakeRILSAConforming(FXObject*, FXSelector, void*); + + /// @brief Called when occurs an update of switch definition + long onUpdDefSwitch(FXObject*, FXSelector, void*); + + /// @brief Called when occurs an update of needs definition + long onUpdNeedsDef(FXObject*, FXSelector, void*); + + /// @brief Called to buttons that modify link indices + long onUpdNeedsSingleDef(FXObject*, FXSelector, void*); + + /// @brief Called when occurs an update of needs definition an dphase + long onUpdNeedsDefAndPhase(FXObject*, FXSelector, void*); + + /// @brief Called when occurs an update of create definition + long onUpdDefCreate(FXObject*, FXSelector, void*); + + /// @brief Called when occurs an update of modified + long onUpdModified(FXObject*, FXSelector, void*); + /// @} + + /// @brief update phase definition for the current traffic light and phase + void handleChange(GNEInternalLane* lane); + + /// @brief update phase definition for the current traffic light and phase + void handleMultiChange(GNELane* lane, FXObject* obj, FXSelector sel, void* data); + + /// @brief whether the given edge is controlled by the currently edited tlDef + bool controlsEdge(GNEEdge* edge) const; + + /// @brief whether the current traffic light uses fixed phase durations + bool fixedDuration() const; + + /// @brief open AttributesCreator extended dialog (can be reimplemented in frame children) + void selectedOverlappedElement(GNEAttributeCarrier* AC); + +protected: + FOX_CONSTRUCTOR(GNETLSEditorFrame) + + /**@brief edits the traffic light for the given junction + * @param[in] junction The junction of which the traffic light shall be edited + */ + void editJunction(GNEJunction* junction); + + /// @brief converts to SUMOTime + static SUMOTime getSUMOTime(const FXString& string); + +private: + /// @brief Overlapped Inspection + GNEFrameModuls::OverlappedInspection* myOverlappedInspection; + + /// @brief modul for TLS Junction + GNETLSEditorFrame::TLSJunction* myTLSJunction; + + /// @brief modul for TLS Definition + GNETLSEditorFrame::TLSDefinition* myTLSDefinition; + + /// @brief modul for TLS attributes + GNETLSEditorFrame::TLSAttributes* myTLSAttributes; + + /// @brief modul for load/Save TLS Modifications + GNETLSEditorFrame::TLSModifications* myTLSModifications; + + /// @brief modul for TLS Phases + GNETLSEditorFrame::TLSPhases* myTLSPhases; + + /// @brief modul for load/Save TLS Programs + GNETLSEditorFrame::TLSFile* myTLSFile; + + /// @brief the internal lanes belonging the the current junction indexed by their tl-index + typedef std::map > TLIndexMap; + TLIndexMap myInternalLanes; + + /// @brief the traffic light definition being edited + NBLoadedSUMOTLDef* myEditedDef; + + /// @brief index of the phase being shown + int myPhaseIndex; + + /// @brief cleans up previous lanes + void cleanup(); + + /// @brief builds internal lanes for the given tlDef + void buildIinternalLanes(NBTrafficLightDefinition* tlDef); + + /// @brief the phase of the current traffic light + const std::vector& getPhases(); + + /// @brief convert duration (potentially undefined) to string + static std::string varDurString(SUMOTime dur); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindow.cpp sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindow.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -12,27 +12,21 @@ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later /****************************************************************************/ /// @file GNEApplicationWindow.cpp -/// @author Jakob Erdmann -/// @date Feb 2011 +/// @author Pablo Alvarez Lopez +/// @date mar 2020 /// -// The main window of Netedit (adapted from GUIApplicationWindow) +// Functions from main window of NETEDIT /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - #include -#include -#include +#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include #include -#include #include #include #include @@ -67,6 +61,7 @@ // =========================================================================== // FOX-declarations // =========================================================================== + FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[] = { // quit calls FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_Q_CLOSE, GNEApplicationWindow::onCmdQuit), @@ -109,12 +104,19 @@ FXMAPFUNC(SEL_COMMAND, MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS, GNEApplicationWindow::onCmdSaveAdditionalsAs), FXMAPFUNC(SEL_UPDATE, MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS, GNEApplicationWindow::onUpdNeedsNetwork), // demand elements - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GNEApplicationWindow::onCmdOpenDemandElements), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, GNEApplicationWindow::onUpdNeedsNetwork), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GNEApplicationWindow::onCmdSaveDemandElements), - FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GNEApplicationWindow::onUpdSaveDemandElements), - FXMAPFUNC(SEL_COMMAND, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS, GNEApplicationWindow::onCmdSaveDemandElementsAs), - FXMAPFUNC(SEL_UPDATE, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS, GNEApplicationWindow::onUpdNeedsNetwork), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, GNEApplicationWindow::onCmdOpenDemandElements), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, GNEApplicationWindow::onUpdNeedsNetwork), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GNEApplicationWindow::onCmdSaveDemandElements), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GNEApplicationWindow::onUpdSaveDemandElements), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS, GNEApplicationWindow::onCmdSaveDemandElementsAs), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS, GNEApplicationWindow::onUpdNeedsNetwork), + // data elements + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS, GNEApplicationWindow::onCmdOpenDataElements), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS, GNEApplicationWindow::onUpdNeedsNetwork), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS, GNEApplicationWindow::onCmdSaveDataElements), + FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS, GNEApplicationWindow::onUpdSaveDataElements), + FXMAPFUNC(SEL_COMMAND, MID_GNE_TOOLBARFILE_SAVEDATA_AS, GNEApplicationWindow::onCmdSaveDataElementsAs), + FXMAPFUNC(SEL_UPDATE, MID_GNE_TOOLBARFILE_SAVEDATA_AS, GNEApplicationWindow::onUpdNeedsNetwork), // other FXMAPFUNC(SEL_COMMAND, MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS, GNEApplicationWindow::onCmdSaveTLSProgramsAs), FXMAPFUNC(SEL_UPDATE, MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS, GNEApplicationWindow::onUpdNeedsNetwork), @@ -122,23 +124,24 @@ FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_CTRL_W_CLOSESIMULATION, GNEApplicationWindow::onUpdNeedsNetwork), // Toolbar supermode - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_NETWORK, GNEApplicationWindow::onCmdSetSuperMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DEMAND, GNEApplicationWindow::onCmdSetSuperMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_SUPERMODE_NETWORK, GNEApplicationWindow::onCmdSetSuperMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_DEMAND, GNEApplicationWindow::onCmdSetSuperMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DATA, GNEApplicationWindow::onCmdSetSuperMode), // Toolbar edit - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_E_EDGEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MOVEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_DELETEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_INSPECTMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_SELECTMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_TLSMODE_VTYPEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_TAZMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_POLYGONMODE_PERSONMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_VEHICLEMODE, GNEApplicationWindow::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_E_MODES_EDGE_EDGEDATA, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_MODES_INSPECT, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_A_MODES_ADDITIONAL_STOP, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ, GNEApplicationWindow::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON, 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_F9_EDIT_VIEWSCHEME, GNEApplicationWindow::onCmdEditViewScheme), FXMAPFUNC(SEL_UPDATE, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GNEApplicationWindow::onUpdNeedsNetwork), FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GNEApplicationWindow::onCmdEditViewport), @@ -199,7 +202,7 @@ // toolbar help FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION, GNEApplicationWindow::onCmdHelp), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_ABOUT, GNEApplicationWindow::onCmdAbout), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F12_ABOUT, GNEApplicationWindow::onCmdAbout), // alt + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ALT_0_TOOGLEEDITOPTION, GNEApplicationWindow::onCmdToogleEditOptions), @@ -241,8 +244,8 @@ FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, GNEApplicationWindow::onCmdClearTemplate), // Other - FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F12_FOCUSUPPERELEMENT, GNEApplicationWindow::onCmdFocusFrame), + FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, GNEApplicationWindow::onCmdFocusFrame), }; // Object implementation @@ -250,99 +253,6 @@ // =========================================================================== -// GNEApplicationWindow::ToolbarsGrip method definitions -// =========================================================================== - -GNEApplicationWindow::ToolbarsGrip::ToolbarsGrip(GNEApplicationWindow* GNEApp) : - menu(nullptr), - superModes(nullptr), - saveElements(nullptr), - navigation(nullptr), - modes(nullptr), - modeOptions(nullptr), - myGNEApp(GNEApp), - myToolBarShellMenu(nullptr), - myToolBarShellSuperModes(nullptr), - myToolBarShellSaveElements(nullptr), - myToolBarShellNavigation(nullptr), - myToolBarShellModes(nullptr), - myToolBarShellModeOptions(nullptr) { -} - - -void -GNEApplicationWindow::ToolbarsGrip::buildMenuToolbarsGrip() { - // build menu bar (for File, edit, processing...) using specify design - myToolBarShellMenu = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - menu = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellMenu, GUIDesignToolbarMenuBarNetedit); - // declare toolbar grip for menu bar - new FXToolBarGrip(menu, menu, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); -} - - -void -GNEApplicationWindow::ToolbarsGrip::buildViewParentToolbarsGrips() { - // build menu bar for supermodes (next to menu bar) - myToolBarShellSuperModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - superModes = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellSuperModes, GUIDesignToolBarRaisedSame); - // declare toolbar grip for menu bar superModes - new FXToolBarGrip(superModes, superModes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // build menu bar for save elements (bot to menu bar) - myToolBarShellSaveElements = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - saveElements = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellSaveElements, GUIDesignToolBarRaisedNext); - // declare toolbar grip for menu bar saveElements - new FXToolBarGrip(saveElements, saveElements, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // build menu bar for navigation - myToolBarShellNavigation = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - navigation = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellNavigation, GUIDesignToolBarRaisedSame); - // declare toolbar grip for menu bar navigation - new FXToolBarGrip(navigation, navigation, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // build menu bar for modes - myToolBarShellModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - modes = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellModes, GUIDesignToolBarRaisedSame); - // declare toolbar grip for menu bar modes - new FXToolBarGrip(modes, modes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // build menu bar for mode Options - myToolBarShellModeOptions = new FXToolBarShell(myGNEApp, GUIDesignToolBar); - modeOptions = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellModeOptions, GUIDesignToolBarRaisedSame); - // declare toolbar grip for menu bar modes - new FXToolBarGrip(modeOptions, modeOptions, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); - // create menu bars - superModes->create(); - saveElements->create(); - navigation->create(); - modes->create(); - modeOptions->create(); - // create toolbar shells - myToolBarShellSuperModes->create(); - myToolBarShellSaveElements->create(); - myToolBarShellNavigation->create(); - myToolBarShellModes->create(); - myToolBarShellModeOptions->create(); - // recalc top dop after creating elements - myGNEApp->myTopDock->recalc(); -} - - -void -GNEApplicationWindow::ToolbarsGrip::destroyParentToolbarsGrips() { - // delete Menu bars - delete superModes; - delete saveElements; - delete navigation; - delete modes; - delete modeOptions; - // also delete toolbar shells to avoid floating windows - delete myToolBarShellSuperModes; - delete myToolBarShellSaveElements; - delete myToolBarShellNavigation; - delete myToolBarShellModes; - delete myToolBarShellModeOptions; - // recalc top dop after deleting elements - myGNEApp->myTopDock->recalc(); -} - -// =========================================================================== // GNEApplicationWindow method definitions // =========================================================================== @@ -351,9 +261,10 @@ myLoadThread(nullptr), myAmLoading(false), myFileMenu(nullptr), - myFileMenuAdditionals(nullptr), myFileMenuTLS(nullptr), + myFileMenuAdditionals(nullptr), myFileMenuDemandElements(nullptr), + myFileMenuDataElements(nullptr), myEditMenu(nullptr), myProcessingMenu(nullptr), myLocatorMenu(nullptr), @@ -398,7 +309,7 @@ setTarget(this); setSelector(MID_WINDOW); // build toolbar menu - myToolbarsGrip.buildMenuToolbarsGrip(); + getToolbarsGrip().buildMenuToolbarsGrip(); // build the thread - io myLoadThreadEvent.setTarget(this), myLoadThreadEvent.setSelector(ID_LOADTHREAD_EVENT); // build the status bar @@ -427,7 +338,7 @@ // set the caption setTitle(myTitlePrefix); // set Netedit ICON - setIcon(GUIIconSubSys::getIcon(ICON_NETEDIT)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::NETEDIT)); // build NETEDIT Accelerators (hotkeys) GUIShortcutsSubSys::buildNETEDITAccelerators(this); } @@ -440,9 +351,10 @@ FXMainWindow::create(); myFileMenu->create(); myEditMenu->create(); - myFileMenuAdditionals->create(); myFileMenuTLS->create(); + myFileMenuAdditionals->create(); myFileMenuDemandElements->create(); + myFileMenuDataElements->create(); //mySettingsMenu->create(); myWindowsMenu->create(); myHelpMenu->create(); @@ -471,10 +383,11 @@ delete myGLVisual; // must delete menus to avoid segfault on removing accelerators // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s) - delete myFileMenuAdditionals, - delete myFileMenuTLS, - delete myFileMenuDemandElements, - delete myFileMenu; + delete myFileMenuTLS; + delete myFileMenuAdditionals; + delete myFileMenuDemandElements; + delete myFileMenuDataElements; + delete myFileMenu; delete myEditMenu; delete myLocatorMenu; delete myProcessingMenu; @@ -543,7 +456,7 @@ } else { // get the new file name FXFileDialog opendialog(this, "Open Netconvert Configuration"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_CONFIG)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList(myConfigPattern.c_str()); if (gCurrentFolder.length() != 0) { @@ -569,7 +482,7 @@ } else { // get the new file name FXFileDialog opendialog(this, "Open Network"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_NET)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_NET)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -598,7 +511,7 @@ } else { // get the new file name FXFileDialog opendialog(this, "Import Foreign Network"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_NET)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::OPEN_NET)); opendialog.setSelectMode(SELECTFILE_EXISTING); FXString osmPattern("OSM net (*.osm.xml,*.osm)"); opendialog.setPatternText(0, osmPattern); @@ -643,7 +556,7 @@ WRITE_DEBUG("Open additional dialog"); // get the Additional file name FXFileDialog opendialog(this, "Open Additionals file"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("Additional files (*.add.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -658,7 +571,7 @@ // disable validation for additionals XMLSubSys::setValidation("never", "auto"); // Create additional handler - GNEAdditionalHandler additionalHandler(file, myNet->getViewNet()); + GNEAdditionalHandler additionalHandler(file, myNet); // begin undoList operation myUndoList->p_begin("Loading additionals from '" + file + "'"); // Run parser for additionals @@ -684,7 +597,7 @@ WRITE_DEBUG("Open TLSProgram dialog"); // get the shape file name FXFileDialog opendialog(this, "Open TLSPrograms file"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODETLS)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::MODETLS)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("TLSProgram files (*.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -720,7 +633,7 @@ WRITE_DEBUG("Open demand element dialog"); // get the demand element file name FXFileDialog opendialog(this, "Open demand element file"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("Demand element files (*.rou.xml)\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -735,7 +648,7 @@ // disable validation for additionals XMLSubSys::setValidation("never", "auto"); // Create additional handler - GNERouteHandler demandHandler(file, myNet->getViewNet()); + GNERouteHandler demandHandler(file, myNet); // begin undoList operation myUndoList->p_begin("Loading demand elements from '" + file + "'"); // Run parser for additionals @@ -756,6 +669,47 @@ long +GNEApplicationWindow::onCmdOpenDataElements(FXObject*, FXSelector, void*) { + // write debug information + WRITE_DEBUG("Open data element dialog"); + // get the data element file name + FXFileDialog opendialog(this, "Open data element file"); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA)); + opendialog.setSelectMode(SELECTFILE_EXISTING); + opendialog.setPatternList("Data element files (*.xml)\nAll files (*)"); + if (gCurrentFolder.length() != 0) { + opendialog.setDirectory(gCurrentFolder); + } + if (opendialog.execute()) { + // close additional dialog + WRITE_DEBUG("Close data element dialog"); + // udpate current folder + gCurrentFolder = opendialog.getDirectory(); + std::string file = opendialog.getFilename().text(); + // disable validation for additionals + XMLSubSys::setValidation("never", "auto"); + // Create additional handler + GNEDataHandler dataHandler(file, myNet); + // begin undoList operation + myUndoList->p_begin("Loading data elements from '" + file + "'"); + // Run parser for additionals + if (!XMLSubSys::runParser(dataHandler, file, false)) { + WRITE_ERROR("Loading of " + file + " failed."); + } + // end undoList operation and update view + myUndoList->p_end(); + update(); + // restore validation for data + XMLSubSys::setValidation("auto", "auto"); + } else { + // write debug information + WRITE_DEBUG("Cancel data element dialog"); + } + return 1; +} + + +long GNEApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* fileData) { // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753) if (myViewNet && !onCmdClose(0, 0, 0)) { @@ -924,7 +878,7 @@ setStatusBarText("'" + ec->myFile + "' loaded."); setWindowSizeAndPos(); // build viewparent toolbar grips before creating view parent - myToolbarsGrip.buildViewParentToolbarsGrips(); + getToolbarsGrip().buildViewParentToolbarsGrips(); // initialise NETEDIT View GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, "NETEDIT VIEW", this, nullptr, myNet, myUndoList, nullptr, MDI_TRACKING, 10, 10, 300, 200); // create it maximized @@ -943,9 +897,9 @@ } // set network name on the caption setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->myFile.c_str())); - // set supermode network + // force supermode network if (myViewNet) { - myViewNet->onCmdSetSupermode(0, MID_HOTKEY_F3_SUPERMODE_NETWORK, 0); + myViewNet->forceSupermodeNetwork(); } if (myViewNet && ec->myViewportFromRegistry) { Position off; @@ -965,7 +919,7 @@ // iterate over every additional file for (const auto& additionalFile : additionalFiles) { WRITE_MESSAGE("Loading additionals and shapes from '" + additionalFile + "'"); - GNEAdditionalHandler additionalHandler(additionalFile, myNet->getViewNet()); + GNEAdditionalHandler additionalHandler(additionalFile, myNet); // disable validation for additionals XMLSubSys::setValidation("never", "auto"); // Run parser @@ -987,7 +941,7 @@ // iterate over every route file for (const auto& demandElementsFile : demandElementsFiles) { WRITE_MESSAGE("Loading demand elements from '" + demandElementsFile + "'"); - GNERouteHandler routeHandler(demandElementsFile, myNet->getViewNet()); + GNERouteHandler routeHandler(demandElementsFile, myNet); // disable validation for demand elements XMLSubSys::setValidation("never", "auto"); if (!XMLSubSys::runParser(routeHandler, demandElementsFile, false)) { @@ -999,6 +953,27 @@ myUndoList->p_end(); } + // check if data elements has to be loaded at start + if (oc.isSet("data-files") && !oc.getString("data-files").empty() && myNet) { + // obtain vector of data files + std::vector dataElementsFiles = oc.getStringVector("data-files"); + // begin undolist + myUndoList->p_begin("Loading data elements from '" + toString(dataElementsFiles) + "'"); + // iterate over every data file + for (const auto& dataElementsFile : dataElementsFiles) { + WRITE_MESSAGE("Loading data elements from '" + dataElementsFile + "'"); + GNEDataHandler dataHandler(dataElementsFile, myNet); + // disable validation for data elements + XMLSubSys::setValidation("never", "auto"); + if (!XMLSubSys::runParser(dataHandler, dataElementsFile, false)) { + WRITE_ERROR("Loading of " + dataElementsFile + " failed."); + } + // disable validation for data elements + XMLSubSys::setValidation("auto", "auto"); + } + + myUndoList->p_end(); + } // check if additionals output must be changed if (oc.isSet("additionals-output")) { // overwrite "additional-files" with value "additionals-output" @@ -1011,6 +986,12 @@ oc.resetWritable(); oc.set("route-files", oc.getString("demandelements-output")); } + // check if data elements output must be changed + if (oc.isSet("dataelements-output")) { + // overwrite "data-files" with value "dataelements-output" + oc.resetWritable(); + oc.set("data-files", oc.getString("dataelements-output")); + } // after loading net shouldn't be saved if (myNet) { myNet->requireSaveNet(false); @@ -1026,615 +1007,6 @@ myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg()); } -// =========================================================================== -// GNEApplicationWindow::MenuBarFile method definitions -// =========================================================================== - -GNEApplicationWindow::MenuBarFile::MenuBarFile(GNEApplicationWindow* GNEApp) : - myRecentNets(GNEApp->getApp(), "nets"), - myGNEApp(GNEApp) -{ } - - -void -GNEApplicationWindow::MenuBarFile::buildRecentFiles(FXMenuPane* fileMenu) { - FXMenuSeparator* sep1 = new FXMenuSeparator(fileMenu); - sep1->setTarget(&myRecentConfigs); - sep1->setSelector(FXRecentFiles::ID_ANYFILES); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10); - new FXMenuCommand(fileMenu, "Clear Recent Configurat&ions", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR); - myRecentConfigs.setTarget(myGNEApp); - myRecentConfigs.setSelector(MID_RECENTFILE); - FXMenuSeparator* sep2 = new FXMenuSeparator(fileMenu); - sep2->setTarget(&myRecentNets); - sep2->setSelector(FXRecentFiles::ID_ANYFILES); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9); - new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10); - new FXMenuCommand(fileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR); - myRecentNets.setTarget(myGNEApp); - myRecentNets.setSelector(MID_RECENTFILE); -} - -// --------------------------------------------------------------------------- -// GNEViewNet::FileMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::FileMenuCommands::FileMenuCommands(GNEApplicationWindow* GNEApp) : - saveAdditionals(nullptr), - saveAdditionalsAs(nullptr), - saveTLSPrograms(nullptr), - saveDemandElements(nullptr), - saveDemandElementsAs(nullptr), - myGNEApp(GNEApp) { -} - - -void -GNEApplicationWindow::FileMenuCommands::buildFileMenuCommands(FXMenuPane* fileMenu) { - new FXMenuCommand(fileMenu, - "&New Network...\tCtrl+N\tCreate a new network.", - GUIIconSubSys::getIcon(ICON_OPEN_NET), myGNEApp, MID_HOTKEY_CTRL_N_NEWNETWORK); - new FXMenuCommand(fileMenu, - "&Open Network...\tCtrl+O\tOpen a SUMO network.", - GUIIconSubSys::getIcon(ICON_OPEN_NET), myGNEApp, MID_OPEN_NETWORK); - new FXMenuCommand(fileMenu, - "Open Netconvert Configura&tion...\tCtrl+Shift+O\tOpen a configuration file with NETCONVERT options.", - GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), myGNEApp, MID_OPEN_CONFIG); - new FXMenuCommand(fileMenu, - "Import &Foreign Network...\t\tImport a foreign network such as OSM.", - GUIIconSubSys::getIcon(ICON_OPEN_NET), myGNEApp, MID_GNE_TOOLBARFILE_OPENFOREIGN); - new FXMenuCommand(fileMenu, - "&Reload\tCtrl+R\tReloads the network.", - GUIIconSubSys::getIcon(ICON_RELOAD), myGNEApp, MID_HOTKEY_CTRL_R_RELOAD); - new FXMenuCommand(fileMenu, - "&Save Network...\tCtrl+S\tSave the network.", - GUIIconSubSys::getIcon(ICON_SAVENETELEMENTS), myGNEApp, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK); - new FXMenuCommand(fileMenu, - "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.", - GUIIconSubSys::getIcon(ICON_SAVENETELEMENTS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS); - new FXMenuCommand(fileMenu, - "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.", - GUIIconSubSys::getIcon(ICON_SAVE), myGNEApp, MID_HOTKEY_CTRL_L_SAVEASPLAINXML); - new FXMenuCommand(fileMenu, - "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).", - GUIIconSubSys::getIcon(ICON_SAVE), myGNEApp, MID_HOTKEY_CTRL_J_SAVEJOINEDJUNCTIONS); - // create Additionals menu options - myGNEApp->myFileMenuAdditionals = new FXMenuPane(myGNEApp); - new FXMenuCommand(myGNEApp->myFileMenuAdditionals, - "Load A&dditionals...\tCtrl+A\tLoad additionals and shapes.", - GUIIconSubSys::getIcon(ICON_OPEN_ADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS); - saveAdditionals = new FXMenuCommand(myGNEApp->myFileMenuAdditionals, - "Save Additionals\tCtrl+Shift+A\tSave additionals and shapes.", - GUIIconSubSys::getIcon(ICON_SAVEADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS); - saveAdditionals->disable(); - saveAdditionalsAs = new FXMenuCommand(myGNEApp->myFileMenuAdditionals, - "Save Additionals As...\t\tSave additional elements in another file.", - GUIIconSubSys::getIcon(ICON_SAVEADDITIONALS), myGNEApp, MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS); - saveAdditionalsAs->disable(); - new FXMenuCascade(fileMenu, "Additionals and shapes", GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), myGNEApp->myFileMenuAdditionals); - // create TLS menu options - myGNEApp->myFileMenuTLS = new FXMenuPane(myGNEApp); - new FXMenuCommand(myGNEApp->myFileMenuTLS, - "Load TLS Programs...\tCtrl+K\tload TLS Programs in all Traffic Lights of the net.", - GUIIconSubSys::getIcon(ICON_OPEN_TLSPROGRAMS), myGNEApp, MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS); - saveTLSPrograms = new FXMenuCommand(myGNEApp->myFileMenuTLS, - "Save TLS Programs \tCtrl+Shift+K\tSave TLS Programs of all Traffic Lights of the current net.", - GUIIconSubSys::getIcon(ICON_SAVE), myGNEApp, MID_HOTKEY_CTRL_SHIFT_K_SAVETLS); - saveTLSPrograms->disable(); - new FXMenuCommand(myGNEApp->myFileMenuTLS, - "Save TLS Programs As...\t\tSave TLS Programs of all Traffic Lights of the current net in another file.", - GUIIconSubSys::getIcon(ICON_SAVE), myGNEApp, MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS); - new FXMenuCascade(fileMenu, "Traffic Lights", GUIIconSubSys::getIcon(ICON_MODETLS), myGNEApp->myFileMenuTLS); - // create DemandElements menu options - myGNEApp->myFileMenuDemandElements = new FXMenuPane(myGNEApp); - new FXMenuCommand(myGNEApp->myFileMenuDemandElements, - "Load demand elements...\tCtrl+D\tLoad demand elements.", - GUIIconSubSys::getIcon(ICON_OPEN_ADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND); - saveDemandElements = new FXMenuCommand(myGNEApp->myFileMenuDemandElements, - "Save demand elements\tCtrl+Shift+D\tSave demand elements.", - GUIIconSubSys::getIcon(ICON_SAVEDEMANDELEMENTS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS); - saveDemandElements->disable(); - saveDemandElementsAs = new FXMenuCommand(myGNEApp->myFileMenuDemandElements, - "Save demand elements as...\t\tSave demand elements in another file.", - GUIIconSubSys::getIcon(ICON_SAVEDEMANDELEMENTS), myGNEApp, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS); - saveDemandElementsAs->disable(); - new FXMenuCascade(fileMenu, "Demand elements", GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), myGNEApp->myFileMenuDemandElements); - // close network - new FXMenuSeparator(fileMenu); - new FXMenuCommand(fileMenu, - "Close\tCtrl+W\tClose the net&work.", - GUIIconSubSys::getIcon(ICON_CLOSE), myGNEApp, MID_HOTKEY_CTRL_W_CLOSESIMULATION); - // build recent files - myGNEApp->myMenuBarFile.buildRecentFiles(fileMenu); - new FXMenuSeparator(fileMenu); - new FXMenuCommand(fileMenu, "&Quit\tCtrl+Q\tQuit the Application.", nullptr, myGNEApp, MID_HOTKEY_CTRL_Q_CLOSE, 0); -} - -// --------------------------------------------------------------------------- -// GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::NetworkMenuCommands(const EditMenuCommands* editMenuCommandsParent) : - createEdgeMode(nullptr), - moveMode(nullptr), - deleteMode(nullptr), - inspectMode(nullptr), - selectMode(nullptr), - connectMode(nullptr), - prohibitionMode(nullptr), - TLSMode(nullptr), - additionalMode(nullptr), - crossingMode(nullptr), - TAZMode(nullptr), - shapeMode(nullptr), - myEditMenuCommandsParent(editMenuCommandsParent), - myHorizontalSeparator(nullptr) { -} - - -void -GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::showNetworkMenuCommands() { - createEdgeMode->show(); - moveMode->show(); - deleteMode->show(); - inspectMode->show(); - selectMode->show(); - connectMode->show(); - prohibitionMode->show(); - TLSMode->show(); - additionalMode->show(); - crossingMode->show(); - TAZMode->show(); - shapeMode->show(); - // also show separator - myHorizontalSeparator->show(); -} - - -void -GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::hideNetworkMenuCommands() { - createEdgeMode->hide(); - moveMode->hide(); - deleteMode->hide(); - inspectMode->hide(); - selectMode->hide(); - connectMode->hide(); - prohibitionMode->hide(); - TLSMode->hide(); - additionalMode->hide(); - crossingMode->hide(); - TAZMode->hide(); - shapeMode->hide(); - // also hide separator - myHorizontalSeparator->hide(); -} - - -void -GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::buildNetworkMenuCommands(FXMenuPane* editMenu) { - // build every FXMenuCommand giving it a shortcut - createEdgeMode = new FXMenuCommand(editMenu, - "&Edge mode\tE\tCreate junction and edges.", - GUIIconSubSys::getIcon(ICON_MODECREATEEDGE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_E_EDGEMODE); - moveMode = new FXMenuCommand(editMenu, - "&Move mode\tM\tMove elements.", - GUIIconSubSys::getIcon(ICON_MODEMOVE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_M_MOVEMODE); - deleteMode = new FXMenuCommand(editMenu, - "&Delete mode\tD\tDelete elements.", - GUIIconSubSys::getIcon(ICON_MODEDELETE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_D_DELETEMODE); - inspectMode = new FXMenuCommand(editMenu, - "&Inspect mode\tI\tInspect elements and change their attributes.", - GUIIconSubSys::getIcon(ICON_MODEINSPECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_I_INSPECTMODE); - selectMode = new FXMenuCommand(editMenu, - "&Select mode\tS\tSelect elements.", - GUIIconSubSys::getIcon(ICON_MODESELECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_S_SELECTMODE); - connectMode = new FXMenuCommand(editMenu, - "&Connection mode\tC\tEdit connections between lanes.", - GUIIconSubSys::getIcon(ICON_MODECONNECTION), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE); - prohibitionMode = new FXMenuCommand(editMenu, - "Pro&hibition mode\tW\tEdit connection prohibitions.", - GUIIconSubSys::getIcon(ICON_MODEPROHIBITION), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE); - TLSMode = new FXMenuCommand(editMenu, - "&Traffic light mode\tT\tEdit traffic lights over junctions.", - GUIIconSubSys::getIcon(ICON_MODETLS), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_TLSMODE_VTYPEMODE); - additionalMode = new FXMenuCommand(editMenu, - "&Additional mode\tA\tCreate additional elements.", - GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE); - crossingMode = new FXMenuCommand(editMenu, - "C&rossing mode\tR\tCreate crossings between edges.", - GUIIconSubSys::getIcon(ICON_MODECROSSING), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE); - TAZMode = new FXMenuCommand(editMenu, - "TA&Z mode\tZ\tCreate Traffic Assignment Zones.", - GUIIconSubSys::getIcon(ICON_MODETAZ), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_Z_TAZMODE); - shapeMode = new FXMenuCommand(editMenu, - "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.", - GUIIconSubSys::getIcon(ICON_MODEPOLYGON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_POLYGONMODE_PERSONMODE); - // build separator - myHorizontalSeparator = new FXMenuSeparator(editMenu); -} - -// --------------------------------------------------------------------------- -// GNEApplicationWindow::EditMenuCommands::DemandMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::DemandMenuCommands(const EditMenuCommands* editMenuCommandsParent) : - routeMode(nullptr), - vehicleMode(nullptr), - vehicleTypeMode(nullptr), - stopMode(nullptr), - personTypeMode(nullptr), - personMode(nullptr), - personPlanMode(nullptr), - myEditMenuCommandsParent(editMenuCommandsParent), - myHorizontalSeparator(nullptr) { -} - - -void -GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::showDemandMenuCommands() { - routeMode->show(); - vehicleMode->show(); - vehicleTypeMode->show(); - stopMode->show(); - personTypeMode->show(); - personMode->show(); - personPlanMode->show(); - // also show separator - myHorizontalSeparator->show(); -} - - -void -GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::hideDemandMenuCommands() { - routeMode->hide(); - vehicleMode->hide(); - vehicleTypeMode->hide(); - stopMode->hide(); - personTypeMode->hide(); - personMode->hide(); - personPlanMode->hide(); - // also hide separator - myHorizontalSeparator->hide(); -} - - -void -GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::buildDemandMenuCommands(FXMenuPane* editMenu) { - // build every FXMenuCommand giving it a shortcut - routeMode = new FXMenuCommand(editMenu, - "Route mode\tR\tCreate Routes.", - GUIIconSubSys::getIcon(ICON_MODEROUTE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE); - vehicleMode = new FXMenuCommand(editMenu, - "Vehicle mode\tV\tCreate vehicles.", - GUIIconSubSys::getIcon(ICON_MODEVEHICLE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_V_VEHICLEMODE); - vehicleTypeMode = new FXMenuCommand(editMenu, - "Vehicle type mode\tT\tCreate vehicle types.", - GUIIconSubSys::getIcon(ICON_MODEVEHICLETYPE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_TLSMODE_VTYPEMODE); - stopMode = new FXMenuCommand(editMenu, - "Stop mode\tA\tCreate stops.", - GUIIconSubSys::getIcon(ICON_MODESTOP), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE); - personTypeMode = new FXMenuCommand(editMenu, - "Person type mode\tW\tCreate person types.", - GUIIconSubSys::getIcon(ICON_MODEPERSONTYPE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE); - personMode = new FXMenuCommand(editMenu, - "Person mode\tP\tCreate persons.", - GUIIconSubSys::getIcon(ICON_MODEPERSON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_POLYGONMODE_PERSONMODE); - personPlanMode = new FXMenuCommand(editMenu, - "Person plan mode\tC\tCreate person plans.", - GUIIconSubSys::getIcon(ICON_MODEPERSONPLAN), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE); - // build separator - myHorizontalSeparator = new FXMenuSeparator(editMenu); -} - -// --------------------------------------------------------------------------- -// GNEApplicationWindow::EditMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::EditMenuCommands::EditMenuCommands(GNEApplicationWindow* GNEApp) : - myGNEApp(GNEApp), - networkMenuCommands(this), - demandMenuCommands(this), - undoLastChange(nullptr), - redoLastChange(nullptr), - editViewScheme(nullptr), - editViewPort(nullptr), - toogleGrid(nullptr), - loadAdditionalsInSUMOGUI(nullptr), - loadDemandInSUMOGUI(nullptr), - openInSUMOGUI(nullptr) { -} - - -void -GNEApplicationWindow::EditMenuCommands::buildEditMenuCommands(FXMenuPane* editMenu) { - // build undo/redo command - undoLastChange = new FXMenuCommand(editMenu, - "&Undo\tCtrl+Z\tUndo the last change.", - GUIIconSubSys::getIcon(ICON_UNDO), myGNEApp, MID_HOTKEY_CTRL_Z_UNDO); - redoLastChange = new FXMenuCommand(editMenu, - "&Redo\tCtrl+Y\tRedo the last change.", - GUIIconSubSys::getIcon(ICON_REDO), myGNEApp, MID_HOTKEY_CTRL_Y_REDO); - // build separator - new FXMenuSeparator(editMenu); - // build Supermode commands and hide it - myGNEApp->mySupermodeCommands.buildSupermodeCommands(editMenu); - myGNEApp->mySupermodeCommands.hideSupermodeCommands(); - // build Network modes commands and hide it - networkMenuCommands.buildNetworkMenuCommands(editMenu); - networkMenuCommands.hideNetworkMenuCommands(); - // build Demand Modes commands - demandMenuCommands.buildDemandMenuCommands(editMenu); - demandMenuCommands.hideDemandMenuCommands(); - editViewScheme = new FXMenuCommand(editMenu, - "Edit Visualisation\tF9\tOpens a dialog for editing visualization settings.", - nullptr, myGNEApp, MID_HOTKEY_F9_EDIT_VIEWSCHEME); - editViewPort = new FXMenuCommand(editMenu, - "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.", - nullptr, myGNEApp, MID_HOTKEY_CTRL_I_EDITVIEWPORT); - toogleGrid = new FXMenuCommand(editMenu, - "Toggle Grid\tCtrl+G\tToggles background grid (and snap-to-grid functionality).", - nullptr, myGNEApp, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID); - // add open in sumo options - new FXMenuSeparator(editMenu); - loadAdditionalsInSUMOGUI = new FXMenuCheck(editMenu, - "Load additionals in SUMO-GUI\t\tLoad additionals in SUMO-GUI.", - myGNEApp, MID_GNE_TOOLBAREDIT_LOADADDITIONALS); - loadAdditionalsInSUMOGUI->setCheck(TRUE); - loadDemandInSUMOGUI = new FXMenuCheck(editMenu, - "Load demand in SUMO-GUI\t\tLoad demand in SUMO-GUI.", - myGNEApp, MID_GNE_TOOLBAREDIT_LOADDEMAND); - loadDemandInSUMOGUI->setCheck(TRUE); - openInSUMOGUI = new FXMenuCommand(editMenu, - "Open in SUMO-GUI\tCtrl+T\tOpens the SUMO-GUI application with the current network.", - GUIIconSubSys::getIcon(ICON_SUMO_MINI), myGNEApp, MID_HOTKEY_CTRL_T_OPENSUMONETEDIT); -} - -// --------------------------------------------------------------------------- -// GNEViewNet::ProcessingMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::ProcessingMenuCommands::ProcessingMenuCommands(GNEApplicationWindow* GNEApp) : - computeNetwork(nullptr), - computeNetworkVolatile(nullptr), - cleanJunctions(nullptr), - joinJunctions(nullptr), - clearInvalidCrossings(nullptr), - computeDemand(nullptr), - cleanRoutes(nullptr), - joinRoutes(nullptr), - clearInvalidDemandElements(nullptr), - optionMenus(nullptr), - myGNEApp(GNEApp) { -} - - -void -GNEApplicationWindow::ProcessingMenuCommands::buildProcessingMenuCommands(FXMenuPane* fileMenu) { - // build network processing menu commands - computeNetwork = new FXMenuCommand(fileMenu, - "Compute Junctions\tF5\tComputes junction shape and logic.", - GUIIconSubSys::getIcon(ICON_COMPUTEJUNCTIONS), myGNEApp, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND); - computeNetworkVolatile = new FXMenuCommand(fileMenu, - "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.", - GUIIconSubSys::getIcon(ICON_COMPUTEJUNCTIONS), myGNEApp, MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE); - cleanJunctions = new FXMenuCommand(fileMenu, - "Clean Junctions\tF6\tRemoves solitary junctions.", - GUIIconSubSys::getIcon(ICON_CLEANJUNCTIONS), myGNEApp, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES); - joinJunctions = new FXMenuCommand(fileMenu, - "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.", - GUIIconSubSys::getIcon(ICON_JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES); - clearInvalidCrossings = new FXMenuCommand(fileMenu, - "Clean invalid crossings\tF8\tClear invalid crossings.", - GUIIconSubSys::getIcon(ICON_JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS); - // build demand processing menu commands - computeDemand = new FXMenuCommand(fileMenu, - "Compute demand\tF5\tComputes demand elements.", - GUIIconSubSys::getIcon(ICON_COMPUTEDEMAND), myGNEApp, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND); - cleanRoutes = new FXMenuCommand(fileMenu, - "Clean routes\tF6\tRemoves routes without vehicles.", - GUIIconSubSys::getIcon(ICON_CLEANROUTES), myGNEApp, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES); - joinRoutes = new FXMenuCommand(fileMenu, - "Join routes\tF7\tJoins routes with the same edges.", - GUIIconSubSys::getIcon(ICON_JOINROUTES), myGNEApp, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES); - clearInvalidDemandElements = new FXMenuCommand(fileMenu, - "Clean invalid route elements\tF8\tClear elements with an invalid path (routes, Trips, Flows...).", - GUIIconSubSys::getIcon(ICON_JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS); - // add separator (because optionsmenu is commmon for Network and Demand modes - new FXMenuSeparator(fileMenu); - optionMenus = new FXMenuCommand(fileMenu, - "Options\tF10\t\tConfigure Processing Options.", - GUIIconSubSys::getIcon(ICON_OPTIONS), myGNEApp, MID_HOTKEY_F10_OPTIONSMENU); -} - - -void -GNEApplicationWindow::ProcessingMenuCommands::showNetworkProcessingMenuCommands() { - // first enable menu commands - computeNetwork->enable(); - computeNetworkVolatile->enable(); - cleanJunctions->enable(); - joinJunctions->enable(); - clearInvalidCrossings->enable(); - // now show it - computeNetwork->show(); - computeNetworkVolatile->show(); - cleanJunctions->show(); - joinJunctions->show(); - clearInvalidCrossings->show(); -} - - -void -GNEApplicationWindow::ProcessingMenuCommands::hideNetworkProcessingMenuCommands() { - // first disable menu commands - computeNetwork->disable(); - computeNetworkVolatile->disable(); - cleanJunctions->disable(); - joinJunctions->disable(); - clearInvalidCrossings->disable(); - // now hide it - computeNetwork->hide(); - computeNetworkVolatile->hide(); - cleanJunctions->hide(); - joinJunctions->hide(); - clearInvalidCrossings->hide(); -} - - -void -GNEApplicationWindow::ProcessingMenuCommands::showDemandProcessingMenuCommands() { - // first enable menu commands - computeDemand->enable(); - cleanRoutes->enable(); - joinRoutes->enable(); - clearInvalidDemandElements->enable(); - // now show it - computeDemand->show(); - cleanRoutes->show(); - joinRoutes->show(); - clearInvalidDemandElements->show(); -} - - -void -GNEApplicationWindow::ProcessingMenuCommands::hideDemandProcessingMenuCommands() { - // first disable menu commands - computeDemand->disable(); - cleanRoutes->disable(); - joinRoutes->disable(); - clearInvalidDemandElements->disable(); - // now hide it - computeDemand->hide(); - cleanRoutes->hide(); - joinRoutes->hide(); - clearInvalidDemandElements->hide(); -} - -// --------------------------------------------------------------------------- -// GNEViewNet::LocateMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::LocateMenuCommands::LocateMenuCommands(GNEApplicationWindow* GNEApp) : - myGNEApp(GNEApp) { -} - - -void -GNEApplicationWindow::LocateMenuCommands::buildLocateMenuCommands(FXMenuPane* locateMenu) { - // build locate menu commands - new FXMenuCommand(locateMenu, - "Locate &Junctions\tShift+J\tOpen a dialog for locating a Junction.", - GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), myGNEApp, MID_LOCATEJUNCTION); - new FXMenuCommand(locateMenu, - "Locate &Edges\tShift+E\tOpen a dialog for locating an Edge.", - GUIIconSubSys::getIcon(ICON_LOCATEEDGE), myGNEApp, MID_LOCATEEDGE); - new FXMenuCommand(locateMenu, - "Locate &Vehicles\tShift+V\tOpen a dialog for locating a Vehicle.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), myGNEApp, MID_LOCATEVEHICLE); - new FXMenuCommand(locateMenu, - "Locate &Person\tShift+P\tOpen a dialog for locating a Person.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), myGNEApp, MID_LOCATEPERSON); - new FXMenuCommand(locateMenu, - "Locate &Route\tShift+R\tOpen a dialog for locating a Route.", - GUIIconSubSys::getIcon(ICON_LOCATEROUTE), myGNEApp, MID_LOCATEROUTE); - new FXMenuCommand(locateMenu, - "Locate &Stops\tShift+S\tOpen a dialog for locating a Stop.", - GUIIconSubSys::getIcon(ICON_LOCATESTOP), myGNEApp, MID_LOCATESTOP); - new FXMenuCommand(locateMenu, - "Locate &TLS\tShift+T\tOpen a dialog for locating a Traffic Light.", - GUIIconSubSys::getIcon(ICON_LOCATETLS), myGNEApp, MID_LOCATETLS); - new FXMenuCommand(locateMenu, - "Locate &Additional\tShift+A\tOpen a dialog for locating an Additional Structure.", - GUIIconSubSys::getIcon(ICON_LOCATEADD), myGNEApp, MID_LOCATEADD); - new FXMenuCommand(locateMenu, - "Locate P&oI\tShift+O\tOpen a dialog for locating a Point of Interest.", - GUIIconSubSys::getIcon(ICON_LOCATEPOI), myGNEApp, MID_LOCATEPOI); - new FXMenuCommand(locateMenu, - "Locate Po&lygon\tShift+L\tOpen a dialog for locating a Polygon.", - GUIIconSubSys::getIcon(ICON_LOCATEPOLY), myGNEApp, MID_LOCATEPOLY); -} - -// --------------------------------------------------------------------------- -// GNEViewNet::WindowsMenuCommands - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::WindowsMenuCommands::WindowsMenuCommands(GNEApplicationWindow* GNEApp) : - myGNEApp(GNEApp) { -} - - -void -GNEApplicationWindow::WindowsMenuCommands::buildWindowsMenuCommands(FXMenuPane* windowsMenu) { - // build windows menu commands - new FXMenuCheck(windowsMenu, - "&Show Status Line\t\tToggle this Status Bar on/off.", - myGNEApp->myStatusbar, FXWindow::ID_TOGGLESHOWN); - new FXMenuCheck(windowsMenu, - "Show &Message Window\t\tToggle the Message Window on/off.", - myGNEApp->myMessageWindow, FXWindow::ID_TOGGLESHOWN); - new FXMenuCommand(windowsMenu, - "&Clear Message Window\t\tClear the message window.", - nullptr, myGNEApp, MID_CLEARMESSAGEWINDOW); -} - -// --------------------------------------------------------------------------- -// GNEViewNet::NetworkCheckableButtons - methods -// --------------------------------------------------------------------------- - -GNEApplicationWindow::SupermodeCommands::SupermodeCommands(GNEApplicationWindow* GNEApp) : - networkMode(nullptr), - demandMode(nullptr), - myGNEApp(GNEApp), - myHorizontalSeparator(nullptr) { -} - - -void -GNEApplicationWindow::SupermodeCommands::showSupermodeCommands() { - networkMode->show(); - demandMode->show(); - // also show separator - myHorizontalSeparator->show(); -} - - -void -GNEApplicationWindow::SupermodeCommands::hideSupermodeCommands() { - networkMode->hide(); - demandMode->hide(); - // also hide separator - myHorizontalSeparator->hide(); -} - - -void -GNEApplicationWindow::SupermodeCommands::buildSupermodeCommands(FXMenuPane* editMenu) { - // build supermode menu commands - networkMode = new FXMenuCommand(editMenu, "&Network mode\tF3\tSelect network mode.", - GUIIconSubSys::getIcon(ICON_SUPERMODENETWORK), myGNEApp, MID_HOTKEY_F3_SUPERMODE_NETWORK); - demandMode = new FXMenuCommand(editMenu, "&Demand mode\tF4\tSelect demand mode.", - GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), myGNEApp, MID_HOTKEY_F4_SUPERMODE_DEMAND); - // build separator - myHorizontalSeparator = new FXMenuSeparator(editMenu); -} - // --------------------------------------------------------------------------- // private methods // --------------------------------------------------------------------------- @@ -1647,11 +1019,33 @@ myFileMenu = new FXMenuPane(this, LAYOUT_FIX_HEIGHT); menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&File", nullptr, myFileMenu, LAYOUT_FIX_HEIGHT); menuTitle->setHeight(23); - myFileMenuCommands.buildFileMenuCommands(myFileMenu); + myFileMenuTLS = new FXMenuPane(this); + myFileMenuAdditionals = new FXMenuPane(this); + myFileMenuDemandElements = new FXMenuPane(this); + myFileMenuDataElements = new FXMenuPane(this); + myFileMenuCommands.buildFileMenuCommands(myFileMenu, myFileMenuTLS, myFileMenuAdditionals, myFileMenuDemandElements, myFileMenuDataElements); + // build recent files + myMenuBarFile.buildRecentFiles(myFileMenu); + new FXMenuSeparator(myFileMenu); + new FXMenuCommand(myFileMenu, + "&Quit\tCtrl+Q\tQuit the Application.", + nullptr, this, MID_HOTKEY_CTRL_Q_CLOSE, 0); // build edit menu myEditMenu = new FXMenuPane(this); menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Edit", nullptr, myEditMenu, LAYOUT_FIX_HEIGHT); menuTitle->setHeight(23); + // build undo/redo command + myEditMenuCommands.undoLastChange = new FXMenuCommand(myEditMenu, + "&Undo\tCtrl+Z\tUndo the last change.", + GUIIconSubSys::getIcon(GUIIcon::UNDO), this, MID_HOTKEY_CTRL_Z_UNDO); + myEditMenuCommands.redoLastChange = new FXMenuCommand(myEditMenu, + "&Redo\tCtrl+Y\tRedo the last change.", + GUIIconSubSys::getIcon(GUIIcon::REDO), this, MID_HOTKEY_CTRL_Y_REDO); + // build separator + new FXMenuSeparator(myEditMenu); + // build Supermode commands and hide it + mySupermodeCommands.buildSupermodeCommands(myEditMenu); + mySupermodeCommands.hideSupermodeCommands(); myEditMenuCommands.buildEditMenuCommands(myEditMenu); // build processing menu (trigger netbuild computations) myProcessingMenu = new FXMenuPane(this); @@ -1667,7 +1061,7 @@ myWindowsMenu = new FXMenuPane(this); menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Windows", nullptr, myWindowsMenu, LAYOUT_FIX_HEIGHT); menuTitle->setHeight(23); - myWindowsMenuCommands.buildWindowsMenuCommands(myWindowsMenu); + myWindowsMenuCommands.buildWindowsMenuCommands(myWindowsMenu, myStatusbar, myMessageWindow); // build help menu myHelpMenu = new FXMenuPane(this); menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Help", nullptr, myHelpMenu, LAYOUT_FIX_HEIGHT); @@ -1677,8 +1071,8 @@ "&Online Documentation\tF1\tOpen Online documentation.", nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION); new FXMenuCommand(myHelpMenu, - "&About\tF2\tAbout netedit.", - GUIIconSubSys::getIcon(ICON_NETEDIT_MINI), this, MID_HOTKEY_F2_ABOUT); + "&About\tF12\tAbout netedit.", + GUIIconSubSys::getIcon(GUIIcon::NETEDIT_MINI), this, MID_HOTKEY_F12_ABOUT); } @@ -1730,8 +1124,15 @@ } -GNEApplicationWindow::ToolbarsGrip& +GNEViewNet* +GNEApplicationWindow::getViewNet() { + return myViewNet; +} + + +GNEApplicationWindowHelper::ToolbarsGrip& GNEApplicationWindow::getToolbarsGrip() { + myToolbarsGrip.myTopDock = myTopDock; return myToolbarsGrip; } @@ -1807,9 +1208,10 @@ OptionsCont& oc = OptionsCont::getOptions(); // declare variable to save FXMessageBox outputs. FXuint answer = 0; - // declare string to save paths in wich additionals, shapes and demand will be saved + // declare string to save paths in wich additionals, shapes demand and data elements will be saved std::string additionalsSavePath = oc.getString("additional-files"); std::string demandElementsSavePath = oc.getString("route-files"); + std::string dataElementsSavePath = oc.getString("data-files"); // write warning if netedit is running in testing mode WRITE_DEBUG("Opening FXMessageBox 'Volatile Recomputing'"); // open question dialog box @@ -1849,7 +1251,7 @@ // Open a dialog to set filename output FXString file = MFXUtils::getFilename2Write(this, "Select name of the demand element file", ".xml", - GUIIconSubSys::getIcon(ICON_MODETLS), + GUIIconSubSys::getIcon(GUIIcon::MODETLS), gCurrentFolder).text(); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); @@ -1909,7 +1311,7 @@ // Open a dialog to set filename output FXString file = MFXUtils::getFilename2Write(this, "Select name of the demand element file", ".rou.xml", - GUIIconSubSys::getIcon(ICON_MODETLS), + GUIIconSubSys::getIcon(GUIIcon::MODETLS), gCurrentFolder).text(); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); @@ -1947,8 +1349,68 @@ // clear demand element path demandElementsSavePath = ""; } + // Check if there are data elements in our net + if (myNet->getNumberOfDataSets() > 0) { + // ask user if want to save data elements if weren't saved previously + if (oc.getString("data-files") == "") { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox 'Save data elements before recomputing'"); + // open question dialog box + answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save data elements before recomputing with volatile options", + "Would you like to save data elements before recomputing?"); + 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 'Save data elements before recomputing' with 'No'"); + } else if (answer == 4) { + WRITE_DEBUG("Closed FXMessageBox 'Save data elements before recomputing' with 'ESC'"); + } + } else { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'Save data elements before recomputing' with 'Yes'"); + // Open a dialog to set filename output + FXString file = MFXUtils::getFilename2Write(this, + "Select name of the data element file", ".rou.xml", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), + gCurrentFolder).text(); + // add xml extension + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); + // check that file is valid + if (fileWithExtension != "") { + // update data files + oc.resetWritable(); + oc.set("data-files", fileWithExtension); + // set obtanied filename output into data elementSavePath (can be "") + dataElementsSavePath = oc.getString("data-files"); + } + } + } + // Check if data element must be saved in a temporal directory, if user didn't define a directory for data elements + if (oc.getString("data-files") == "") { + // Obtain temporal directory provided by FXSystem::getCurrentDirectory() + dataElementsSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpDataElementsNetedit.xml"); + } + // Start saving data elements + getApp()->beginWaitCursor(); + try { + myNet->saveDataElements(dataElementsSavePath); + } catch (IOError& e) { + // write warning if netedit is running in testing mode + WRITE_DEBUG("Opening FXMessageBox 'Error saving data elements before recomputing'"); + // open error message box + FXMessageBox::error(this, MBOX_OK, "Saving data elements in temporal folder failed!", "%s", e.what()); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'Error saving data elements before recomputing' with 'OK'"); + } + // end saving data elements + myMessageWindow->addSeparator(); + getApp()->endWaitCursor(); + } else { + // clear data element path + dataElementsSavePath = ""; + } // compute with volatile options - myNet->computeNetwork(this, true, true, additionalsSavePath, demandElementsSavePath); + myNet->computeNetwork(this, true, true, additionalsSavePath, demandElementsSavePath, dataElementsSavePath); updateControls(); return 1; } @@ -1956,6 +1418,12 @@ void +GNEApplicationWindow::enableSaveTLSProgramsMenu() { + myFileMenuCommands.saveTLSPrograms->enable(); +} + + +void GNEApplicationWindow::enableSaveAdditionalsMenu() { myFileMenuCommands.saveAdditionals->enable(); myFileMenuCommands.saveAdditionalsAs->enable(); @@ -1970,12 +1438,6 @@ void -GNEApplicationWindow::enableSaveTLSProgramsMenu() { - myFileMenuCommands.saveTLSPrograms->enable(); -} - - -void GNEApplicationWindow::enableSaveDemandElementsMenu() { myFileMenuCommands.saveDemandElements->disable(); myFileMenuCommands.saveDemandElementsAs->disable(); @@ -1989,6 +1451,20 @@ } +void +GNEApplicationWindow::enableSaveDataElementsMenu() { + myFileMenuCommands.saveDataElements->disable(); + myFileMenuCommands.saveDataElementsAs->disable(); +} + + +void +GNEApplicationWindow::disableSaveDataElementsMenu() { + myFileMenuCommands.saveDataElements->disable(); + myFileMenuCommands.saveDataElementsAs->disable(); +} + + long GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) { // check that currently there is a View @@ -2014,7 +1490,7 @@ // first check if there is a view if (myViewNet) { // process depending of supermode - if (myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myViewNet->getEditModes().isCurrentSupermodeNetwork()) { // check what FXMenuCommand was called switch (FXSELID(sel)) { case MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND: @@ -2174,7 +1650,6 @@ } else { // abort current operation myViewNet->abortOperation(); - myViewNet->update(); } } return 1; @@ -2252,24 +1727,28 @@ // check that view exists if (myViewNet) { // Toogle getMenuCheckShowGrid of GNEViewNet - if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) { - myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE); + if ((myViewNet->getNetworkViewOptions().menuCheckShowGrid->getCheck() == TRUE) || + (myViewNet->getDemandViewOptions().menuCheckShowGrid->getCheck() == TRUE)) { + myViewNet->getNetworkViewOptions().menuCheckShowGrid->setCheck(FALSE); + myViewNet->getDemandViewOptions().menuCheckShowGrid->setCheck(FALSE); // show extra information for tests WRITE_DEBUG("Disabled grid throught Ctrl+g hotkey"); } else { - myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(TRUE); + myViewNet->getNetworkViewOptions().menuCheckShowGrid->setCheck(TRUE); + myViewNet->getDemandViewOptions().menuCheckShowGrid->setCheck(TRUE); // show extra information for tests WRITE_DEBUG("Enabled grid throught Ctrl+g hotkey"); } // Call manually show grid function - myViewNet->onCmdToogleShowGrid(obj, sel, ptr); + myViewNet->onCmdToogleShowGridNetwork(obj, sel, ptr); + myViewNet->onCmdToogleShowGridDemand(obj, sel, ptr); } return 1; } long -GNEApplicationWindow::onCmdToogleEditOptions(FXObject* obj, FXSelector sel, void* ptr) { +GNEApplicationWindow::onCmdToogleEditOptions(FXObject* obj, FXSelector sel, void* /* ptr */) { // first check that we have a ViewNet if (myViewNet) { // first check what selector was called @@ -2281,237 +1760,22 @@ // declare a vector in which save visible menu commands std::vector visibleMenuCommands; // get common, network and demand visible menu commands - myViewNet->getCommonViewOptions().getVisibleCommonMenuCommands(visibleMenuCommands); myViewNet->getNetworkViewOptions().getVisibleNetworkMenuCommands(visibleMenuCommands); myViewNet->getDemandViewOptions().getVisibleDemandMenuCommands(visibleMenuCommands); + myViewNet->getDataViewOptions().getVisibleDataMenuCommands(visibleMenuCommands); // now check that numericalKeyPressed isn't greather than visible view options if (numericalKeyPressed >= (int)visibleMenuCommands.size()) { return 1; } - // finally function correspond to visibleMenuCommands[numericalKeyPressed] - if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getCommonViewOptions().menuCheckShowGrid) { - // Toogle menuCheckShowGrid - if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) { - myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleShowGrid - return myViewNet->onCmdToogleShowGrid(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getCommonViewOptions().menuCheckDrawSpreadVehicles) { - // Toogle menuCheckDrawSpreadVehicles - if (myViewNet->getCommonViewOptions().menuCheckDrawSpreadVehicles->getCheck() == TRUE) { - myViewNet->getCommonViewOptions().menuCheckDrawSpreadVehicles->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled toogle draw spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getCommonViewOptions().menuCheckDrawSpreadVehicles->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled toogle spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleDrawSpreadVehicles - return myViewNet->onCmdToogleDrawSpreadVehicles(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowDemandElements) { - // Toogle menuCheckShowDemandElements - if (myViewNet->getNetworkViewOptions().menuCheckShowDemandElements->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckShowDemandElements->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckShowDemandElements->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleShowDemandElements - return myViewNet->onCmdToogleShowDemandElements(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckSelectEdges) { - // Toogle menuCheckSelectEdges - if (myViewNet->getNetworkViewOptions().menuCheckSelectEdges->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckSelectEdges->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled select edges throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckSelectEdges->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled select edges throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleSelectEdges - return myViewNet->onCmdToogleSelectEdges(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowConnections) { - // Toogle menuCheckShowConnections - if (myViewNet->getNetworkViewOptions().menuCheckShowConnections->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckShowConnections->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled show connections throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckShowConnections->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled show connections throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleShowConnections - return myViewNet->onCmdToogleShowConnections(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckHideConnections) { - // Toogle menuCheckHideConnections - if (myViewNet->getNetworkViewOptions().menuCheckHideConnections->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckHideConnections->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled hide connections throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckHideConnections->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled hide connections throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleHideConnections - return myViewNet->onCmdToogleHideConnections(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckExtendSelection) { - // Toogle menuCheckExtendSelection - if (myViewNet->getNetworkViewOptions().menuCheckExtendSelection->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckExtendSelection->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled extend selection throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckExtendSelection->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled extend selection throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleExtendSelection - return myViewNet->onCmdToogleExtendSelection(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases) { - // Toogle menuCheckChangeAllPhases - if (myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled change all phases throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled change all phases throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleChangeAllPhases - return myViewNet->onCmdToogleChangeAllPhases(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge) { - // Toogle menuCheckWarnAboutMerge - if (myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled warn about merge throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled warn about merge throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleWarnAboutMerge - return myViewNet->onCmdToogleWarnAboutMerge(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble) { - // Toogle menuCheckShowJunctionBubble - if (myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleShowJunctionBubble - return myViewNet->onCmdToogleShowJunctionBubbles(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckMoveElevation) { - // Toogle menuCheckMoveElevation - if (myViewNet->getNetworkViewOptions().menuCheckMoveElevation->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckMoveElevation->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled move elevation throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckMoveElevation->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled move elevation throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleMoveElevation - return myViewNet->onCmdToogleMoveElevation(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChainEdges) { - // Toogle menuCheckChainEdges - if (myViewNet->getNetworkViewOptions().menuCheckChainEdges->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckChainEdges->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled chain edges throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckChainEdges->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled chain edges throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleChainEdges - return myViewNet->onCmdToogleChainEdges(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge) { - // Toogle menuCheckAutoOppositeEdge - if (myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->getCheck() == TRUE) { - myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleAutoOppositeEdge - return myViewNet->onCmdToogleAutoOppositeEdge(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideShapes) { - // Toogle menuCheckHideShapes - if (myViewNet->getDemandViewOptions().menuCheckHideShapes->getCheck() == TRUE) { - myViewNet->getDemandViewOptions().menuCheckHideShapes->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled hide shapes throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getDemandViewOptions().menuCheckHideShapes->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled hide shapes throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleHideNonInspecteDemandElements - return myViewNet->onCmdToogleHideShapes(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements) { - // Toogle menuCheckHideNonInspectedDemandElements - if (myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->getCheck() == TRUE) { - myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleHideNonInspecteDemandElements - return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans) { - // Toogle menuCheckShowAllPersonPlans - if (myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->getCheck() == TRUE) { - myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled show all person plans throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled show all person plans throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleHideNonInspecteDemandElements - return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr); - } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckLockPerson) { - // Toogle menuCheckShowAllPersonPlans - if (myViewNet->getDemandViewOptions().menuCheckLockPerson->getCheck() == TRUE) { - myViewNet->getDemandViewOptions().menuCheckLockPerson->setCheck(FALSE); - // show extra information for tests - WRITE_DEBUG("Disabled lock person plan throught alt + " + toString(numericalKeyPressed + 1)); - } else { - myViewNet->getDemandViewOptions().menuCheckLockPerson->setCheck(TRUE); - // show extra information for tests - WRITE_DEBUG("Enabled lock person plan throught alt + " + toString(numericalKeyPressed + 1)); - } - // Call manually onCmdToogleHideNonInspecteDemandElements - return myViewNet->onCmdToogleLockPerson(obj, sel, ptr); - } else { - // nothing to toogle + // toogle edit options + if (GNEApplicationWindowHelper::toogleEditOptionsNetwork(myViewNet, + visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, obj, sel)) { + return 1; + } else if (GNEApplicationWindowHelper::toogleEditOptionsDemand(myViewNet, + visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, obj, sel)) { + return 1; + } else if (GNEApplicationWindowHelper::toogleEditOptionsData(myViewNet, + visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, obj, sel)) { return 1; } } @@ -2646,7 +1910,7 @@ GNEApplicationWindow::onCmdSaveAsNetwork(FXObject*, FXSelector, void*) { FXString file = MFXUtils::getFilename2Write(this, "Save Network as", ".net.xml", - GUIIconSubSys::getIcon(ICON_SAVENETELEMENTS), + GUIIconSubSys::getIcon(GUIIcon::SAVENETWORKELEMENTS), gCurrentFolder); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".net.xml"); @@ -2666,7 +1930,7 @@ GNEApplicationWindow::onCmdSaveAsPlainXML(FXObject*, FXSelector, void*) { FXString file = MFXUtils::getFilename2Write(this, "Select name of the plain-xml edge-file (other names will be deduced from this)", "", - GUIIconSubSys::getIcon(ICON_SAVE), + GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder); // check that file is valid (note: in this case we don't need to use function FileHelpers::addExtension) if (file != "") { @@ -2714,7 +1978,7 @@ GNEApplicationWindow::onCmdSaveJoined(FXObject*, FXSelector, void*) { FXString file = MFXUtils::getFilename2Write(this, "Select name of the joined-junctions file", ".nod.xml", - GUIIconSubSys::getIcon(ICON_SAVE), + GUIIconSubSys::getIcon(GUIIcon::SAVE), gCurrentFolder); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); @@ -2786,6 +2050,13 @@ long +GNEApplicationWindow::onUpdSaveDataElements(FXObject* sender, FXSelector, void*) { + sender->handle(this, ((myNet == nullptr) || myNet->isDataElementsSaved()) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr); + return 1; +} + + +long GNEApplicationWindow::onUpdUndo(FXObject* obj, FXSelector sel, void* ptr) { return myUndoList->p_onUpdUndo(obj, sel, ptr); } @@ -2828,6 +2099,74 @@ long +GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject*, FXSelector, void*) { + // obtain option container + OptionsCont& oc = OptionsCont::getOptions(); + // check if save additional menu is enabled + if (myFileMenuCommands.saveTLSPrograms->isEnabled()) { + // Check if TLS Programs file was already set at start of netedit or with a previous save + if (oc.getString("TLSPrograms-output").empty()) { + FXString file = MFXUtils::getFilename2Write(this, + "Select name of the TLS file", ".xml", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), + gCurrentFolder); + // add xml extension + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); + // check tat file is valid + if (file == "") { + // None TLS Programs file was selected, then stop function + return 0; + } else { + // change value of "TLSPrograms-output" + oc.resetWritable(); + oc.set("TLSPrograms-output", fileWithExtension); + } + } + // Start saving TLS Programs + getApp()->beginWaitCursor(); + try { + myNet->saveTLSPrograms(oc.getString("TLSPrograms-output")); + myMessageWindow->appendMsg(EVENT_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 + WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'"); + // open error message box + FXMessageBox::error(this, MBOX_OK, "Saving TLS Programs failed!", "%s", e.what()); + // write warning if netedit is running in testing mode + WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'"); + } + myMessageWindow->addSeparator(); + getApp()->endWaitCursor(); + return 1; + } else { + return 0; + } +} + + +long +GNEApplicationWindow::onCmdSaveTLSProgramsAs(FXObject*, FXSelector, void*) { + // Open window to select TLS Programs file + FXString file = MFXUtils::getFilename2Write(this, + "Select name of the TLS Progarm file", ".xml", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), + gCurrentFolder); + // add xml extension + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); + // check tat file is valid + if (fileWithExtension != "") { + // change value of "TLSPrograms-files" + OptionsCont::getOptions().set("TLSPrograms-output", fileWithExtension); + // save TLS Programs + return onCmdSaveTLSPrograms(nullptr, 0, nullptr); + } else { + return 1; + } +} + + +long GNEApplicationWindow::onCmdSaveAdditionals(FXObject*, FXSelector, void*) { // obtain option container OptionsCont& oc = OptionsCont::getOptions(); @@ -2837,7 +2176,7 @@ if (oc.getString("additional-files").empty()) { FXString file = MFXUtils::getFilename2Write(this, "Select name of the additional file", ".add.xml", - GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), gCurrentFolder); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".add.xml"); @@ -2879,7 +2218,7 @@ // Open window to select additional file FXString file = MFXUtils::getFilename2Write(this, "Select name of the additional file", ".add.xml", - GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), gCurrentFolder); // add xml extension std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".add.xml"); @@ -2900,42 +2239,42 @@ long -GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject*, FXSelector, void*) { +GNEApplicationWindow::onCmdSaveDemandElements(FXObject*, FXSelector, void*) { // obtain option container OptionsCont& oc = OptionsCont::getOptions(); - // check if save additional menu is enabled - if (myFileMenuCommands.saveTLSPrograms->isEnabled()) { - // Check if TLS Programs file was already set at start of netedit or with a previous save - if (oc.getString("TLSPrograms-output").empty()) { + // check if save demand element menu is enabled + if (myFileMenuCommands.saveDemandElements->isEnabled()) { + // Check if demand elements file was already set at start of netedit or with a previous save + if (oc.getString("route-files").empty()) { FXString file = MFXUtils::getFilename2Write(this, - "Select name of the TLS file", ".xml", - GUIIconSubSys::getIcon(ICON_MODETLS), + "Select name of the demand element file", ".rou.xml", + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), gCurrentFolder); // add xml extension - std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); // check tat file is valid - if (file == "") { - // None TLS Programs file was selected, then stop function - return 0; - } else { - // change value of "TLSPrograms-output" + if (fileWithExtension != "") { + // change value of "route-files" oc.resetWritable(); - oc.set("TLSPrograms-output", fileWithExtension); + oc.set("route-files", fileWithExtension); + } else { + // None demand elements file was selected, then stop function + return 0; } } - // Start saving TLS Programs + // Start saving demand elements getApp()->beginWaitCursor(); try { - myNet->saveTLSPrograms(oc.getString("TLSPrograms-output")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "TLS Programs saved in " + oc.getString("TLSPrograms-output") + ".\n"); - myFileMenuCommands.saveTLSPrograms->disable(); + myNet->saveDemandElements(oc.getString("route-files")); + myMessageWindow->appendMsg(EVENT_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 - WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'"); + WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'"); // open error message box - FXMessageBox::error(this, MBOX_OK, "Saving TLS Programs failed!", "%s", e.what()); + FXMessageBox::error(this, MBOX_OK, "Saving demand elements failed!", "%s", e.what()); // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'"); + WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'"); } myMessageWindow->addSeparator(); getApp()->endWaitCursor(); @@ -2947,20 +2286,24 @@ long -GNEApplicationWindow::onCmdSaveTLSProgramsAs(FXObject*, FXSelector, void*) { - // Open window to select TLS Programs file +GNEApplicationWindow::onCmdSaveDemandElementsAs(FXObject*, FXSelector, void*) { + // Open window to select additionasl file FXString file = MFXUtils::getFilename2Write(this, - "Select name of the TLS Program file", ".xml", - GUIIconSubSys::getIcon(ICON_MODETLS), + "Select name of the demand element file", ".rou.xml", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND), gCurrentFolder); // add xml extension - std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); - // check tat file is valid + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); + // check that file is correct if (fileWithExtension != "") { - // change value of "TLSPrograms-files" - OptionsCont::getOptions().set("TLSPrograms-output", fileWithExtension); - // save TLS Programs - return onCmdSaveTLSPrograms(nullptr, 0, nullptr); + // reset writtable flag + OptionsCont::getOptions().resetWritable(); + // change value of "route-files" + OptionsCont::getOptions().set("route-files", fileWithExtension); + // change flag of menu command for save demand elements + myFileMenuCommands.saveDemandElements->enable(); + // save demand elements + return onCmdSaveDemandElements(nullptr, 0, nullptr); } else { return 1; } @@ -2968,42 +2311,42 @@ long -GNEApplicationWindow::onCmdSaveDemandElements(FXObject*, FXSelector, void*) { +GNEApplicationWindow::onCmdSaveDataElements(FXObject*, FXSelector, void*) { // obtain option container OptionsCont& oc = OptionsCont::getOptions(); - // check if save demand element menu is enabled - if (myFileMenuCommands.saveDemandElements->isEnabled()) { - // Check if demand elements file was already set at start of netedit or with a previous save - if (oc.getString("route-files").empty()) { + // check if save data element menu is enabled + if (myFileMenuCommands.saveDataElements->isEnabled()) { + // Check if data elements file was already set at start of netedit or with a previous save + if (oc.getString("data-files").empty()) { FXString file = MFXUtils::getFilename2Write(this, - "Select name of the demand element file", ".rou.xml", - GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), + "Select name of the data element file", ".xml", + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), gCurrentFolder); // add xml extension - std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); // check tat file is valid if (fileWithExtension != "") { - // change value of "route-files" + // change value of "data-files" oc.resetWritable(); - oc.set("route-files", fileWithExtension); + oc.set("data-files", fileWithExtension); } else { - // None demand elements file was selected, then stop function + // None data elements file was selected, then stop function return 0; } } - // Start saving demand elements + // Start saving data elements getApp()->beginWaitCursor(); try { - myNet->saveDemandElements(oc.getString("route-files")); - myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Demand elements saved in " + oc.getString("route-files") + ".\n"); - myFileMenuCommands.saveDemandElements->disable(); + myNet->saveDataElements(oc.getString("data-files")); + myMessageWindow->appendMsg(EVENT_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 - WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'"); + WRITE_DEBUG("Opening FXMessageBox 'error saving data elements'"); // open error message box - FXMessageBox::error(this, MBOX_OK, "Saving demand elements failed!", "%s", e.what()); + FXMessageBox::error(this, MBOX_OK, "Saving data elements failed!", "%s", e.what()); // write warning if netedit is running in testing mode - WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'"); + WRITE_DEBUG("Closed FXMessageBox 'error saving data elements' with 'OK'"); } myMessageWindow->addSeparator(); getApp()->endWaitCursor(); @@ -3015,24 +2358,24 @@ long -GNEApplicationWindow::onCmdSaveDemandElementsAs(FXObject*, FXSelector, void*) { +GNEApplicationWindow::onCmdSaveDataElementsAs(FXObject*, FXSelector, void*) { // Open window to select additionasl file FXString file = MFXUtils::getFilename2Write(this, - "Select name of the demand element file", ".rou.xml", - GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), + "Select name of the data element file", ".xml", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), gCurrentFolder); // add xml extension - std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml"); + std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml"); // check that file is correct if (fileWithExtension != "") { // reset writtable flag OptionsCont::getOptions().resetWritable(); - // change value of "route-files" - OptionsCont::getOptions().set("route-files", fileWithExtension); - // change flag of menu command for save demand elements - myFileMenuCommands.saveDemandElements->enable(); - // save demand elements - return onCmdSaveDemandElements(nullptr, 0, nullptr); + // change value of "data-files" + OptionsCont::getOptions().set("data-files", fileWithExtension); + // change flag of menu command for save data elements + myFileMenuCommands.saveDataElements->enable(); + // save data elements + return onCmdSaveDataElements(nullptr, 0, nullptr); } else { return 1; } @@ -3195,24 +2538,43 @@ void -GNEApplicationWindow::updateSuperModeMenuCommands(int supermode) { - // cast supermode - Supermode currentSupermode = static_cast(supermode); - if (currentSupermode == Supermode::GNE_SUPERMODE_NETWORK) { +GNEApplicationWindow::updateSuperModeMenuCommands(const Supermode supermode) { + if (supermode == Supermode::NETWORK) { + // menu commands myEditMenuCommands.networkMenuCommands.showNetworkMenuCommands(); myEditMenuCommands.demandMenuCommands.hideDemandMenuCommands(); + myEditMenuCommands.dataMenuCommands.hideDataMenuCommands(); + // processing myProcessingMenuCommands.showNetworkProcessingMenuCommands(); myProcessingMenuCommands.hideDemandProcessingMenuCommands(); - } else if (currentSupermode == Supermode::GNE_SUPERMODE_DEMAND) { + myProcessingMenuCommands.hideDataProcessingMenuCommands(); + } else if (supermode == Supermode::DEMAND) { + // menu commands myEditMenuCommands.networkMenuCommands.hideNetworkMenuCommands(); myEditMenuCommands.demandMenuCommands.showDemandMenuCommands(); + myEditMenuCommands.dataMenuCommands.hideDataMenuCommands(); + // processing myProcessingMenuCommands.hideNetworkProcessingMenuCommands(); myProcessingMenuCommands.showDemandProcessingMenuCommands(); + myProcessingMenuCommands.hideDataProcessingMenuCommands(); + } else if (supermode == Supermode::DATA) { + // menu commands + myEditMenuCommands.networkMenuCommands.hideNetworkMenuCommands(); + myEditMenuCommands.demandMenuCommands.hideDemandMenuCommands(); + myEditMenuCommands.dataMenuCommands.showDataMenuCommands(); + // processing + myProcessingMenuCommands.hideNetworkProcessingMenuCommands(); + myProcessingMenuCommands.hideDemandProcessingMenuCommands(); + myProcessingMenuCommands.showDataProcessingMenuCommands(); } else { + // menu commands myEditMenuCommands.networkMenuCommands.hideNetworkMenuCommands(); myEditMenuCommands.demandMenuCommands.hideDemandMenuCommands(); + myEditMenuCommands.dataMenuCommands.hideDataMenuCommands(); + // processing myProcessingMenuCommands.hideNetworkProcessingMenuCommands(); myProcessingMenuCommands.hideDemandProcessingMenuCommands(); + myProcessingMenuCommands.hideDataProcessingMenuCommands(); } } @@ -3239,6 +2601,23 @@ // --------------------------------------------------------------------------- GNEApplicationWindow::GNEApplicationWindow() : + myLoadThread(nullptr), + myAmLoading(false), + myFileMenu(nullptr), + myFileMenuTLS(nullptr), + myFileMenuAdditionals(nullptr), + myFileMenuDemandElements(nullptr), + myFileMenuDataElements(nullptr), + myEditMenu(nullptr), + myProcessingMenu(nullptr), + myLocatorMenu(nullptr), + myWindowsMenu(nullptr), + myHelpMenu(nullptr), + myMessageWindow(nullptr), + myMainSplitter(nullptr), + hadDependentBuild(false), + myNet(nullptr), + myUndoList(nullptr), myToolbarsGrip(this), myMenuBarFile(this), myFileMenuCommands(this), @@ -3246,8 +2625,10 @@ myProcessingMenuCommands(this), myLocateMenuCommands(this), myWindowsMenuCommands(this), - mySupermodeCommands(this) { -} + mySupermodeCommands(this), + myViewNet(nullptr), + myMDIMenu(nullptr) +{ } long @@ -3275,4 +2656,5 @@ return 0; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindow.h sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindow.h --- sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,33 +17,9 @@ /// // The main window of Netedit (adapted from GUIApplicationWindow) /****************************************************************************/ -#ifndef GNEApplicationWindow_h -#define GNEApplicationWindow_h +#pragma once - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class GNELoadThread; -class GNEUndoList; -class GNENet; -class GNEViewNet; -class GUIEvent; +#include "GNEApplicationWindowHelper.h" // =========================================================================== @@ -64,61 +40,6 @@ FXDECLARE(GNEApplicationWindow) public: - /// @brief struct for griped toolbars - struct ToolbarsGrip { - - /// @brief constructor - ToolbarsGrip(GNEApplicationWindow* GNEApp); - - /// @brief build menu toolbar grips - void buildMenuToolbarsGrip(); - - /// @brief build toolbars grips - void buildViewParentToolbarsGrips(); - - /// @brief build toolbars grips - void destroyParentToolbarsGrips(); - - /// @brief The application menu bar (for file, edit, processing...) - FXMenuBar* menu; - - /// @brief The application menu bar for supermodes (network and demand) - FXMenuBar* superModes; - - /// @brief The application menu bar for save elements (NetElements, additionals and demand elements) - FXMenuBar* saveElements; - - /// @brief The application menu bar for navigation (zoom, coloring...) - FXMenuBar* navigation; - - /// @brief The application menu bar (for select, inspect...) - FXMenuBar* modes; - - /// @brief The application menu bar for mode options (show connections, select edges...) - FXMenuBar* modeOptions; - - private: - /// @brief pointer to current GNEApplicationWindow - GNEApplicationWindow* myGNEApp; - - /// @brief menu bar drag (for file, edit, processing...) - FXToolBarShell* myToolBarShellMenu; - - /// @brief menu bar drag for modes (network and demand) - FXToolBarShell* myToolBarShellSuperModes; - - /// @brief menu bar drag for save elements (NetElements, additionals and demand elements) - FXToolBarShell* myToolBarShellSaveElements; - - /// @brief menu bar drag for navigation (Zoom, coloring...) - FXToolBarShell* myToolBarShellNavigation; - - /// @brief menu bar drag for modes (select, inspect, delete...) - FXToolBarShell* myToolBarShellModes; - - /// @brief menu bar drag for mode options(show connections, select edges...) - FXToolBarShell* myToolBarShellModeOptions; - }; /**@brief Constructor * @param[in] a The FOX application @@ -144,21 +65,27 @@ /// @brief called if the user selects Processing->compute junctions with volatile options long computeJunctionWithVolatileOptions(); + /// @brief enable save TLS Programs + void enableSaveTLSProgramsMenu(); + /// @brief enable save additionals void enableSaveAdditionalsMenu(); /// @brief disable save additionals void disableSaveAdditionalsMenu(); - /// @brief enable save TLS Programs - void enableSaveTLSProgramsMenu(); - /// @brief enable save demand elements void enableSaveDemandElementsMenu(); /// @brief disable save demand elements void disableSaveDemandElementsMenu(); + /// @brief enable save data elements + void enableSaveDataElementsMenu(); + + /// @brief disable save data elements + void disableSaveDataElementsMenu(); + /// @name Inter-thread event handling /// @{ /// @brief called when an event occurred @@ -194,6 +121,9 @@ /// @brief called when the command/FXCall open demand is executed long onCmdOpenDemandElements(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall open data is executed + long onCmdOpenDataElements(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall reload is executed long onCmdReload(FXObject*, FXSelector, void*); @@ -215,24 +145,30 @@ /// @brief called when the command/FXCall save network is executed long onCmdSaveNetwork(FXObject*, FXSelector, void*); - /// @brief called when the command/FXCall save additionals is executed - long onCmdSaveAdditionals(FXObject*, FXSelector, void*); - - /// @brief called when the command/FXCall save additionals as is executed - long onCmdSaveAdditionalsAs(FXObject*, FXSelector, void*); - /// @brief called when the command/FXCall save TLSPrograms is executed long onCmdSaveTLSPrograms(FXObject*, FXSelector, void*); /// @brief called when the command/FXCall save TLSPrograms as is executed long onCmdSaveTLSProgramsAs(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall save additionals is executed + long onCmdSaveAdditionals(FXObject*, FXSelector, void*); + + /// @brief called when the command/FXCall save additionals as is executed + long onCmdSaveAdditionalsAs(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall save demand elements is executed long onCmdSaveDemandElements(FXObject*, FXSelector, void*); /// @brief called when the command/FXCall save demand elements as is executed long onCmdSaveDemandElementsAs(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall save data elements is executed + long onCmdSaveDataElements(FXObject*, FXSelector, void*); + + /// @brief called when the command/FXCall save data elements as is executed + long onCmdSaveDataElementsAs(FXObject*, FXSelector, void*); + /// @brief called when the command/FXCall save network as is executed long onCmdSaveAsNetwork(FXObject*, FXSelector, void*); @@ -251,6 +187,9 @@ /// @brief called when the update/FXCall save demand elements is executed long onUpdSaveDemandElements(FXObject*, FXSelector, void*); + /// @brief called when the update/FXCall save data elements is executed + long onUpdSaveDataElements(FXObject*, FXSelector, void*); + /// @brief called when the update/FXCall undo is executed long onUpdUndo(FXObject* obj, FXSelector sel, void* ptr); @@ -381,14 +320,17 @@ /// @brief get pointer to undoList GNEUndoList* getUndoList(); + /// @brief get pointer to viewNet + GNEViewNet* getViewNet(); + /// @brief get ToolbarsGrip - ToolbarsGrip& getToolbarsGrip(); + GNEApplicationWindowHelper::ToolbarsGrip& getToolbarsGrip(); /// @brief update control contents after undo/redo or recompute void updateControls(); - /// @brief update FXMenuCommands - void updateSuperModeMenuCommands(int supermode); + /// @brief update FXMenuCommands depending of supermode + void updateSuperModeMenuCommands(const Supermode supermode); /// @brief disable undo-redo giving a string with the reason void disableUndoRedo(const std::string& reason); @@ -411,9 +353,10 @@ /// @brief the submenus FXMenuPane* myFileMenu, - *myFileMenuAdditionals, *myFileMenuTLS, + *myFileMenuAdditionals, *myFileMenuDemandElements, + *myFileMenuDataElements, *myEditMenu, *myProcessingMenu, *myLocatorMenu, @@ -448,345 +391,29 @@ std::string myUndoRedoListEnabled; private: - /// @brief struct for menu bar file - struct MenuBarFile { - - /// @brief constructor - MenuBarFile(GNEApplicationWindow* GNEApp); - - /// @brief build recent files - void buildRecentFiles(FXMenuPane* fileMenu); - - /// @brief List of recent config files - FXRecentFiles myRecentConfigs; - - /// @brief List of recent nets - FXRecentFiles myRecentNets; - - private: - /// @brief pointer to current GNEApplicationWindow - GNEApplicationWindow* myGNEApp; - }; - - /// @brief struct for File menu commands - struct FileMenuCommands { - - /// @brief constructor - FileMenuCommands(GNEApplicationWindow* GNEApp); - - /// @brief build menu commands - void buildFileMenuCommands(FXMenuPane* editMenu); - - /// @brief FXMenuCommand for enable or disable save additionals - FXMenuCommand* saveAdditionals; - - /// @brief FXMenuCommand for enable or disable save additionals As - FXMenuCommand* saveAdditionalsAs; - - /// @brief FXMenuCommand for enable or disable save additionals - FXMenuCommand* saveTLSPrograms; - - /// @brief FXMenuCommand for enable or disable save demand elements - FXMenuCommand* saveDemandElements; - - /// @brief FXMenuCommand for enable or disable save demand elements as - FXMenuCommand* saveDemandElementsAs; - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - }; - - /// @brief struct for edit menu commands - struct EditMenuCommands { - - /// @brief struct for network menu commands - struct NetworkMenuCommands { - - /// @brief constructor - NetworkMenuCommands(const EditMenuCommands* editMenuCommandsParent); - - /// @brief build menu commands - void buildNetworkMenuCommands(FXMenuPane* editMenu); - - /// @brief show all menu commands - void showNetworkMenuCommands(); - - /// @brief hide all menu commands - void hideNetworkMenuCommands(); - - /// @brief menu command for create edge - FXMenuCommand* createEdgeMode; - - /// @brief menu command for move mode - FXMenuCommand* moveMode; - - /// @brief menu command for delete mode - FXMenuCommand* deleteMode; - - /// @brief menu command for inspect mode - FXMenuCommand* inspectMode; - - /// @brief menu command for select mode - FXMenuCommand* selectMode; - - /// @brief menu command for connect mode - FXMenuCommand* connectMode; - - /// @brief menu command for prohibition mode - FXMenuCommand* prohibitionMode; - - /// @brief menu command for TLS Mode - FXMenuCommand* TLSMode; - - /// @brief menu command for additional mode - FXMenuCommand* additionalMode; - - /// @brief menu command for crossing mode - FXMenuCommand* crossingMode; - - /// @brief menu command for TAZ mode - FXMenuCommand* TAZMode; - - /// @brief menu command for shape mode - FXMenuCommand* shapeMode; - - private: - /// @brief reference to EditMenuCommands - const EditMenuCommands* myEditMenuCommandsParent; - - /// @brief separator between sets of FXMenuCommand - FXMenuSeparator* myHorizontalSeparator; - }; - - /// @brief struct for Demand menu commands - struct DemandMenuCommands { - - /// @brief constructor - DemandMenuCommands(const EditMenuCommands* editMenuCommandsParent); - - /// @brief build menu commands - void buildDemandMenuCommands(FXMenuPane* editMenu); - - /// @brief show all menu commands - void showDemandMenuCommands(); - - /// @brief hide all menu commands - void hideDemandMenuCommands(); - - /// @brief menu command for route mode - FXMenuCommand* routeMode; - - /// @brief menu command for vehicle mode - FXMenuCommand* vehicleMode; - - /// @brief menu command for vehicle type mode - FXMenuCommand* vehicleTypeMode; - - /// @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; - - /// @brief menu command for person plan mode - FXMenuCommand* personPlanMode; - - private: - /// @brief reference to EditMenuCommands - const EditMenuCommands* myEditMenuCommandsParent; - - /// @brief separator between sets of FXMenuCommand - FXMenuSeparator* myHorizontalSeparator; - }; - - /// @brief constructor - EditMenuCommands(GNEApplicationWindow* GNEApp); - - /// @brief build edit menu commands - void buildEditMenuCommands(FXMenuPane* editMenu); - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - - public: - /// @brief Network Menu Commands - NetworkMenuCommands networkMenuCommands; - - /// @brief Demand Menu Commands - DemandMenuCommands demandMenuCommands; - - /// @brief FXMenuCommand for undo last change - FXMenuCommand* undoLastChange; - - /// @brief FXMenuCommand for redo last change - FXMenuCommand* redoLastChange; - - /// @brief FXMenuCommand for edit view scheme - FXMenuCommand* editViewScheme; - - /// @brief FXMenuCommand for edit view port - FXMenuCommand* editViewPort; - - /// @brief FXMenuCommand for toogle grid - FXMenuCommand* toogleGrid; - - /// @brief menu check for load additionals in SUMO GUI - FXMenuCheck* loadAdditionalsInSUMOGUI; - - /// @brief menu check for load demand in SUMO GUI - FXMenuCheck* loadDemandInSUMOGUI; - - /// @brief FXMenuCommand for open in SUMO GUI - FXMenuCommand* openInSUMOGUI; - }; - - /// @brief struct for processing menu commands - struct ProcessingMenuCommands { - - /// @brief constructor - ProcessingMenuCommands(GNEApplicationWindow* GNEApp); - - /// @brief build menu commands - void buildProcessingMenuCommands(FXMenuPane* editMenu); - - /// @brief show network processing menu commands - void showNetworkProcessingMenuCommands(); - - /// @brief show network processing menu commands - void hideNetworkProcessingMenuCommands(); - - /// @brief show demand processing menu commands - void showDemandProcessingMenuCommands(); - - /// @brief show demand processing menu commands - void hideDemandProcessingMenuCommands(); - - /// @name Processing FXMenuCommands for Network mode - /// @{ - /// @brief FXMenuCommand for compute network - FXMenuCommand* computeNetwork; - - /// @brief FXMenuCommand for compute network with volatile options - FXMenuCommand* computeNetworkVolatile; - - /// @brief FXMenuCommand for clean junctions without edges - FXMenuCommand* cleanJunctions; - - /// @brief FXMenuCommand for join selected junctions - FXMenuCommand* joinJunctions; - - /// @brief FXMenuCommand for clear invalid crosings - FXMenuCommand* clearInvalidCrossings; - /// @} - - /// @name Processing FXMenuCommands for Demand mode - /// @{ - /// @brief FXMenuCommand for compute demand elements - FXMenuCommand* computeDemand; - - /// @brief FXMenuCommand for clean routes without vehicles - FXMenuCommand* cleanRoutes; - - /// @brief FXMenuCommand for join routes - FXMenuCommand* joinRoutes; - - /// @brief FXMenuCommand for clear invalid demand elements - FXMenuCommand* clearInvalidDemandElements; - /// @} - - /// @brief FXMenuCommand for open option menus - FXMenuCommand* optionMenus; - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - }; - - /// @brief struct for locate menu commands - struct LocateMenuCommands { - - /// @brief constructor - LocateMenuCommands(GNEApplicationWindow* GNEApp); - - /// @brief build menu commands - void buildLocateMenuCommands(FXMenuPane* locateMenu); - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - }; - - /// @brief struct for windows menu commands - struct WindowsMenuCommands { - - /// @brief constructor - WindowsMenuCommands(GNEApplicationWindow* GNEApp); - - /// @brief build menu commands - void buildWindowsMenuCommands(FXMenuPane* windowsMenu); - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - }; - - /// @brief struct for supermode commands - struct SupermodeCommands { - - /// @brief constructor - SupermodeCommands(GNEApplicationWindow* GNEApp); - - /// @brief build menu commands - void buildSupermodeCommands(FXMenuPane* editMenu); - - /// @brief show all menu commands - void showSupermodeCommands(); - - /// @brief hide all menu commands - void hideSupermodeCommands(); - - /// @brief FXMenuCommand for network supermode - FXMenuCommand* networkMode; - - /// @brief FXMenuCommand for demand supermode - FXMenuCommand* demandMode; - - private: - /// @brief pointer to current GNEApplicationWindows - GNEApplicationWindow* myGNEApp; - - /// @brief separator between sets of FXMenuCommand - FXMenuSeparator* myHorizontalSeparator; - }; - /// @brief Toolbars Grip - ToolbarsGrip myToolbarsGrip; + GNEApplicationWindowHelper::ToolbarsGrip myToolbarsGrip; /// @brief MenuBarFile - MenuBarFile myMenuBarFile; + GNEApplicationWindowHelper::MenuBarFile myMenuBarFile; /// @brief File Menu Commands - FileMenuCommands myFileMenuCommands; + GNEApplicationWindowHelper::FileMenuCommands myFileMenuCommands; /// @brief Edit Menu Commands - EditMenuCommands myEditMenuCommands; + GNEApplicationWindowHelper::EditMenuCommands myEditMenuCommands; /// @brief Edit Menu Commands - ProcessingMenuCommands myProcessingMenuCommands; + GNEApplicationWindowHelper::ProcessingMenuCommands myProcessingMenuCommands; /// @brief Locate Menu Commands - LocateMenuCommands myLocateMenuCommands; + GNEApplicationWindowHelper::LocateMenuCommands myLocateMenuCommands; /// @brief Windows Menu Commands - WindowsMenuCommands myWindowsMenuCommands; + GNEApplicationWindowHelper::WindowsMenuCommands myWindowsMenuCommands; /// @brief Supermode Commands - SupermodeCommands mySupermodeCommands; + GNEApplicationWindowHelper::SupermodeCommands mySupermodeCommands; /// @brief pointer to current view net GNEViewNet* myViewNet; @@ -815,9 +442,3 @@ /// @brief warns about unsaved changes in demand elements and gives the user the option to abort bool continueWithUnsavedDemandElementChanges(const std::string& operation); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindowHelper.cpp sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindowHelper.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindowHelper.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindowHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1133 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEApplicationWindowHelper.cpp +/// @author Jakob Erdmann +/// @date Feb 2011 +/// +// The main window of Netedit (adapted from GUIApplicationWindow) +/****************************************************************************/ +#include +#include +#include + +#include "GNEApplicationWindow.h" +#include "GNEViewNet.h" + +#ifdef HAVE_VERSION_H +#include +#endif + +// =========================================================================== +// GNEApplicationWindowHelper::ToolbarsGrip method definitions +// =========================================================================== + +GNEApplicationWindowHelper::ToolbarsGrip::ToolbarsGrip(GNEApplicationWindow* GNEApp) : + menu(nullptr), + superModes(nullptr), + saveElements(nullptr), + navigation(nullptr), + modes(nullptr), + modeOptions(nullptr), + intervalBar(nullptr), + myTopDock(nullptr), + myGNEApp(GNEApp), + myToolBarShellMenu(nullptr), + myToolBarShellSuperModes(nullptr), + myToolBarShellSaveElements(nullptr), + myToolBarShellNavigation(nullptr), + myToolBarShellModes(nullptr), + myToolBarShellModeOptions(nullptr), + myToolBarShellIntervalBar(nullptr) { +} + + +void +GNEApplicationWindowHelper::ToolbarsGrip::buildMenuToolbarsGrip() { + // build menu bar (for File, edit, processing...) using specify design + myToolBarShellMenu = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + menu = new FXMenuBar(myTopDock, myToolBarShellMenu, GUIDesignToolbarMenuBarNetedit); + // declare toolbar grip for menu bar + new FXToolBarGrip(menu, menu, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); +} + + +void +GNEApplicationWindowHelper::ToolbarsGrip::buildViewParentToolbarsGrips() { + // build menu bar for supermodes (next to menu bar) + myToolBarShellSuperModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + superModes = new FXMenuBar(myTopDock, myToolBarShellSuperModes, GUIDesignToolBarRaisedSame); + // declare toolbar grip for menu bar superModes + new FXToolBarGrip(superModes, superModes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // build menu bar for save elements (bot to menu bar) + myToolBarShellSaveElements = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + saveElements = new FXMenuBar(myTopDock, myToolBarShellSaveElements, GUIDesignToolBarRaisedNext); + // declare toolbar grip for menu bar saveElements + new FXToolBarGrip(saveElements, saveElements, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // build menu bar for navigation + myToolBarShellNavigation = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + navigation = new FXMenuBar(myTopDock, myToolBarShellNavigation, GUIDesignToolBarRaisedSame); + // declare toolbar grip for menu bar navigation + new FXToolBarGrip(navigation, navigation, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // build menu bar for modes + myToolBarShellModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + modes = new FXMenuBar(myTopDock, myToolBarShellModes, GUIDesignToolBarRaisedSame); + // declare toolbar grip for menu bar modes + new FXToolBarGrip(modes, modes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // build menu bar for mode Options + myToolBarShellModeOptions = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + modeOptions = new FXMenuBar(myTopDock, myToolBarShellModeOptions, GUIDesignToolBarRaisedSame); + // declare toolbar grip for menu bar modes + new FXToolBarGrip(modeOptions, modeOptions, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // build menu bar for interal + myToolBarShellIntervalBar = new FXToolBarShell(myGNEApp, GUIDesignToolBar); + intervalBar = new FXMenuBar(myTopDock, myToolBarShellModeOptions, GUIDesignToolBarRaisedNext); + // declare toolbar grip for menu bar modes + new FXToolBarGrip(intervalBar, intervalBar, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); + // create menu bars + superModes->create(); + saveElements->create(); + navigation->create(); + modes->create(); + modeOptions->create(); + intervalBar->create(); + // create toolbar shells + myToolBarShellSuperModes->create(); + myToolBarShellSaveElements->create(); + myToolBarShellNavigation->create(); + myToolBarShellModes->create(); + myToolBarShellModeOptions->create(); + myToolBarShellIntervalBar->create(); + // recalc top dop after creating elements + myTopDock->recalc(); +} + + +void +GNEApplicationWindowHelper::ToolbarsGrip::destroyParentToolbarsGrips() { + // delete Menu bars + delete superModes; + delete saveElements; + delete navigation; + delete modes; + delete modeOptions; + delete intervalBar; + // also delete toolbar shells to avoid floating windows + delete myToolBarShellSuperModes; + delete myToolBarShellSaveElements; + delete myToolBarShellNavigation; + delete myToolBarShellModes; + delete myToolBarShellModeOptions; + delete myToolBarShellIntervalBar; + // recalc top dop after deleting elements + myTopDock->recalc(); +} + +// =========================================================================== +// GNEApplicationWindowHelper::MenuBarFile method definitions +// =========================================================================== + +GNEApplicationWindowHelper::MenuBarFile::MenuBarFile(GNEApplicationWindow* GNEApp) : + myRecentNets(GNEApp->getApp(), "nets"), + myGNEApp(GNEApp) +{ } + + +void +GNEApplicationWindowHelper::MenuBarFile::buildRecentFiles(FXMenuPane* fileMenu) { + FXMenuSeparator* sep1 = new FXMenuSeparator(fileMenu); + sep1->setTarget(&myRecentConfigs); + sep1->setSelector(FXRecentFiles::ID_ANYFILES); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10); + new FXMenuCommand(fileMenu, "Clear Recent Configurat&ions", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR); + myRecentConfigs.setTarget(myGNEApp); + myRecentConfigs.setSelector(MID_RECENTFILE); + FXMenuSeparator* sep2 = new FXMenuSeparator(fileMenu); + sep2->setTarget(&myRecentNets); + sep2->setSelector(FXRecentFiles::ID_ANYFILES); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9); + new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10); + new FXMenuCommand(fileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR); + myRecentNets.setTarget(myGNEApp); + myRecentNets.setSelector(MID_RECENTFILE); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::FileMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::FileMenuCommands::FileMenuCommands(GNEApplicationWindow* GNEApp) : + saveAdditionals(nullptr), + saveAdditionalsAs(nullptr), + saveTLSPrograms(nullptr), + saveDemandElements(nullptr), + saveDemandElementsAs(nullptr), + saveDataElements(nullptr), + saveDataElementsAs(nullptr), + myGNEApp(GNEApp) { +} + + +void +GNEApplicationWindowHelper::FileMenuCommands::buildFileMenuCommands(FXMenuPane* fileMenu, FXMenuPane* fileMenuTLS, FXMenuPane* fileMenuAdditionals, + FXMenuPane* fileMenuDemandElements, FXMenuPane* fileMenuDataElements) { + new FXMenuCommand(fileMenu, + "&New Network...\tCtrl+N\tCreate a new network.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), myGNEApp, MID_HOTKEY_CTRL_N_NEWNETWORK); + new FXMenuCommand(fileMenu, + "&Open Network...\tCtrl+O\tOpen a SUMO network.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), myGNEApp, MID_OPEN_NETWORK); + new FXMenuCommand(fileMenu, + "Open Netconvert Configura&tion...\tCtrl+Shift+O\tOpen a configuration file with NETCONVERT options.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), myGNEApp, MID_OPEN_CONFIG); + new FXMenuCommand(fileMenu, + "Import &Foreign Network...\t\tImport a foreign network such as OSM.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_NET), myGNEApp, MID_GNE_TOOLBARFILE_OPENFOREIGN); + new FXMenuCommand(fileMenu, + "&Reload\tCtrl+R\tReloads the network.", + GUIIconSubSys::getIcon(GUIIcon::RELOAD), myGNEApp, MID_HOTKEY_CTRL_R_RELOAD); + new FXMenuCommand(fileMenu, + "&Save Network...\tCtrl+S\tSave the network.", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK); + new FXMenuCommand(fileMenu, + "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS); + new FXMenuCommand(fileMenu, + "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_HOTKEY_CTRL_L_SAVEASPLAINXML); + new FXMenuCommand(fileMenu, + "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_HOTKEY_CTRL_J_SAVEJOINEDJUNCTIONS); + // create TLS menu options + new FXMenuCommand(fileMenuTLS, + "load TLS Programs...\tCtrl+K\tload TLS Programs in all Traffic Lights of the net.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_TLSPROGRAMS), myGNEApp, MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS); + saveTLSPrograms = new FXMenuCommand(fileMenuTLS, + "Save TLS Programs \tCtrl+Shift+K\tSave TLS Programs of all Traffic Lights of the current net.", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_HOTKEY_CTRL_SHIFT_K_SAVETLS); + saveTLSPrograms->disable(); + new FXMenuCommand(fileMenuTLS, + "Save TLS Programs As...\t\tSave TLS Programs of all Traffic Lights of the current net in another file.", + GUIIconSubSys::getIcon(GUIIcon::SAVE), myGNEApp, MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS); + new FXMenuCascade(fileMenu, + "Traffic Lights", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), fileMenuTLS); + // create Additionals menu options + new FXMenuCommand(fileMenuAdditionals, + "Load A&dditionals...\tCtrl+A\tLoad additionals and shapes.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_ADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS); + saveAdditionals = new FXMenuCommand(fileMenuAdditionals, + "Save Additionals\tCtrl+Shift+A\tSave additionals and shapes.", + GUIIconSubSys::getIcon(GUIIcon::SAVEADDITIONALELEMENTS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS); + saveAdditionals->disable(); + saveAdditionalsAs = new FXMenuCommand(fileMenuAdditionals, + "Save Additionals As...\t\tSave additional elements in another file.", + GUIIconSubSys::getIcon(GUIIcon::SAVEADDITIONALELEMENTS), myGNEApp, MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS); + saveAdditionalsAs->disable(); + new FXMenuCascade(fileMenu, "Additionals and shapes", GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), fileMenuAdditionals); + // create DemandElements menu options + new FXMenuCommand(fileMenuDemandElements, + "Load demand elements...\tCtrl+D\tLoad demand elements.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_ADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS); + saveDemandElements = new FXMenuCommand(fileMenuDemandElements, + "Save demand elements\tCtrl+Shift+D\tSave demand elements.", + GUIIconSubSys::getIcon(GUIIcon::SAVEDEMANDELEMENTS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS); + saveDemandElements->disable(); + saveDemandElementsAs = new FXMenuCommand(fileMenuDemandElements, + "Save demand elements as...\t\tSave demand elements in another file.", + GUIIconSubSys::getIcon(GUIIcon::SAVEDEMANDELEMENTS), myGNEApp, MID_GNE_TOOLBARFILE_SAVEDEMAND_AS); + saveDemandElementsAs->disable(); + new FXMenuCascade(fileMenu, + "Demand elements", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND), fileMenuDemandElements); + // create DataElements menu options + new FXMenuCommand(fileMenuDataElements, + "Load data elements...\tCtrl+B\tLoad data elements.", + GUIIconSubSys::getIcon(GUIIcon::OPEN_ADDITIONALS), myGNEApp, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS); + saveDataElements = new FXMenuCommand(fileMenuDataElements, + "Save data elements\tCtrl+Shift+B\tSave data elements.", + GUIIconSubSys::getIcon(GUIIcon::SAVEDATAELEMENTS), myGNEApp, MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS); + saveDataElements->disable(); + saveDataElementsAs = new FXMenuCommand(fileMenuDataElements, + "Save data elements as...\t\tSave data elements in another file.", + GUIIconSubSys::getIcon(GUIIcon::SAVEDATAELEMENTS), myGNEApp, MID_GNE_TOOLBARFILE_SAVEDATA_AS); + saveDataElementsAs->disable(); + new FXMenuCascade(fileMenu, + "Data elements", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), fileMenuDataElements); + // close network + new FXMenuSeparator(fileMenu); + new FXMenuCommand(fileMenu, + "Close\tCtrl+W\tClose the net&work.", + GUIIconSubSys::getIcon(GUIIcon::CLOSE), myGNEApp, MID_HOTKEY_CTRL_W_CLOSESIMULATION); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::EditMenuCommands::NetworkMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::EditMenuCommands::NetworkMenuCommands::NetworkMenuCommands(const EditMenuCommands* editMenuCommandsParent) : + createEdgeMode(nullptr), + moveMode(nullptr), + deleteMode(nullptr), + inspectMode(nullptr), + selectMode(nullptr), + connectMode(nullptr), + prohibitionMode(nullptr), + TLSMode(nullptr), + additionalMode(nullptr), + crossingMode(nullptr), + TAZMode(nullptr), + shapeMode(nullptr), + myEditMenuCommandsParent(editMenuCommandsParent), + myHorizontalSeparator(nullptr) { +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::NetworkMenuCommands::showNetworkMenuCommands() { + createEdgeMode->show(); + moveMode->show(); + deleteMode->show(); + inspectMode->show(); + selectMode->show(); + connectMode->show(); + prohibitionMode->show(); + TLSMode->show(); + additionalMode->show(); + crossingMode->show(); + TAZMode->show(); + shapeMode->show(); + // also show separator + myHorizontalSeparator->show(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::NetworkMenuCommands::hideNetworkMenuCommands() { + createEdgeMode->hide(); + moveMode->hide(); + deleteMode->hide(); + inspectMode->hide(); + selectMode->hide(); + connectMode->hide(); + prohibitionMode->hide(); + TLSMode->hide(); + additionalMode->hide(); + crossingMode->hide(); + TAZMode->hide(); + shapeMode->hide(); + // also hide separator + myHorizontalSeparator->hide(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::NetworkMenuCommands::buildNetworkMenuCommands(FXMenuPane* editMenu) { + // build every FXMenuCommand giving it a shortcut + createEdgeMode = new FXMenuCommand(editMenu, + "&Edge mode\tE\tCreate junction and edges.", + GUIIconSubSys::getIcon(GUIIcon::MODECREATEEDGE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_E_MODES_EDGE_EDGEDATA); + moveMode = new FXMenuCommand(editMenu, + "&Move mode\tM\tMove elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEMOVE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_M_MODES_MOVE); + deleteMode = new FXMenuCommand(editMenu, + "&Delete mode\tD\tDelete elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_D_MODES_DELETE); + inspectMode = new FXMenuCommand(editMenu, + "&Inspect mode\tI\tInspect elements and change their attributes.", + GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_I_MODES_INSPECT); + selectMode = new FXMenuCommand(editMenu, + "&Select mode\tS\tSelect elements.", + GUIIconSubSys::getIcon(GUIIcon::MODESELECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_S_MODES_SELECT); + connectMode = new FXMenuCommand(editMenu, + "&Connection mode\tC\tEdit connections between lanes.", + GUIIconSubSys::getIcon(GUIIcon::MODECONNECTION), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN); + prohibitionMode = new FXMenuCommand(editMenu, + "Pro&hibition mode\tW\tEdit connection prohibitions.", + GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE); + TLSMode = new FXMenuCommand(editMenu, + "&Traffic light mode\tT\tEdit traffic lights over junctions.", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_VTYPE); + additionalMode = new FXMenuCommand(editMenu, + "&Additional mode\tA\tCreate additional elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_A_MODES_ADDITIONAL_STOP); + crossingMode = new FXMenuCommand(editMenu, + "C&rossing mode\tR\tCreate crossings between edges.", + GUIIconSubSys::getIcon(GUIIcon::MODECROSSING), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA); + TAZMode = new FXMenuCommand(editMenu, + "TA&Z mode\tZ\tCreate Traffic Assignment Zones.", + GUIIconSubSys::getIcon(GUIIcon::MODETAZ), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_Z_MODES_TAZ); + shapeMode = new FXMenuCommand(editMenu, + "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.", + GUIIconSubSys::getIcon(GUIIcon::MODEPOLYGON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_MODES_POLYGON_PERSON); + // build separator + myHorizontalSeparator = new FXMenuSeparator(editMenu); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::EditMenuCommands::DemandMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::EditMenuCommands::DemandMenuCommands::DemandMenuCommands(const EditMenuCommands* editMenuCommandsParent) : + routeMode(nullptr), + vehicleMode(nullptr), + vehicleTypeMode(nullptr), + stopMode(nullptr), + personTypeMode(nullptr), + personMode(nullptr), + personPlanMode(nullptr), + myEditMenuCommandsParent(editMenuCommandsParent), + myHorizontalSeparator(nullptr) { +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DemandMenuCommands::showDemandMenuCommands() { + routeMode->show(); + vehicleMode->show(); + vehicleTypeMode->show(); + stopMode->show(); + personTypeMode->show(); + personMode->show(); + personPlanMode->show(); + // also show separator + myHorizontalSeparator->show(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DemandMenuCommands::hideDemandMenuCommands() { + routeMode->hide(); + vehicleMode->hide(); + vehicleTypeMode->hide(); + stopMode->hide(); + personTypeMode->hide(); + personMode->hide(); + personPlanMode->hide(); + // also hide separator + myHorizontalSeparator->hide(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DemandMenuCommands::buildDemandMenuCommands(FXMenuPane* editMenu) { + // build every FXMenuCommand giving it a shortcut + routeMode = new FXMenuCommand(editMenu, + "Route mode\tR\tCreate Routes.", + GUIIconSubSys::getIcon(GUIIcon::MODEROUTE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA); + vehicleMode = new FXMenuCommand(editMenu, + "Vehicle mode\tV\tCreate vehicles.", + GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_V_MODES_VEHICLE); + vehicleTypeMode = new FXMenuCommand(editMenu, + "Vehicle type mode\tT\tCreate vehicle types.", + GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLETYPE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_MODES_TLS_VTYPE); + stopMode = new FXMenuCommand(editMenu, + "Stop mode\tA\tCreate stops.", + GUIIconSubSys::getIcon(GUIIcon::MODESTOP), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_A_MODES_ADDITIONAL_STOP); + personTypeMode = new FXMenuCommand(editMenu, + "Person type mode\tW\tCreate person types.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSONTYPE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE); + personMode = new FXMenuCommand(editMenu, + "Person mode\tP\tCreate persons.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_MODES_POLYGON_PERSON); + personPlanMode = new FXMenuCommand(editMenu, + "Person plan mode\tC\tCreate person plans.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSONPLAN), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN); + // build separator + myHorizontalSeparator = new FXMenuSeparator(editMenu); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::EditMenuCommands::DataMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::EditMenuCommands::DataMenuCommands::DataMenuCommands(const EditMenuCommands* editMenuCommandsParent) : + edgeData(nullptr), + edgeRelData(nullptr), + myEditMenuCommandsParent(editMenuCommandsParent), + myHorizontalSeparator(nullptr) { +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DataMenuCommands::showDataMenuCommands() { + edgeData->show(); + edgeRelData->show(); + // also show separator + myHorizontalSeparator->show(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DataMenuCommands::hideDataMenuCommands() { + edgeData->hide(); + edgeRelData->hide(); + // also hide separator + myHorizontalSeparator->hide(); +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::DataMenuCommands::buildDataMenuCommands(FXMenuPane* editMenu) { + // build every FXMenuCommand giving it a shortcut + edgeData = new FXMenuCommand(editMenu, + "EdgeData Mode\tE\tCreate edgeData elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEEDGEDATA), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_E_MODES_EDGE_EDGEDATA); + edgeRelData = new FXMenuCommand(editMenu, + "EdgeRelation Mode\tR\tCreate edgeRelation elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEEDGERELDATA), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA); + // build separator + myHorizontalSeparator = new FXMenuSeparator(editMenu); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::EditMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::EditMenuCommands::EditMenuCommands(GNEApplicationWindow* GNEApp) : + myGNEApp(GNEApp), + networkMenuCommands(this), + demandMenuCommands(this), + dataMenuCommands(this), + undoLastChange(nullptr), + redoLastChange(nullptr), + editViewScheme(nullptr), + editViewPort(nullptr), + toogleGrid(nullptr), + loadAdditionalsInSUMOGUI(nullptr), + loadDemandInSUMOGUI(nullptr), + openInSUMOGUI(nullptr) { +} + + +void +GNEApplicationWindowHelper::EditMenuCommands::buildEditMenuCommands(FXMenuPane* editMenu) { + // build Network modes commands and hide it + networkMenuCommands.buildNetworkMenuCommands(editMenu); + networkMenuCommands.hideNetworkMenuCommands(); + // build Demand Modes commands + demandMenuCommands.buildDemandMenuCommands(editMenu); + demandMenuCommands.hideDemandMenuCommands(); + // build Data Modes commands + dataMenuCommands.buildDataMenuCommands(editMenu); + dataMenuCommands.hideDataMenuCommands(); + // build rest of menu commands + editViewScheme = new FXMenuCommand(editMenu, + "Edit Visualisation\tF9\tOpens a dialog for editing visualization settings.", + nullptr, myGNEApp, MID_HOTKEY_F9_EDIT_VIEWSCHEME); + editViewPort = new FXMenuCommand(editMenu, + "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.", + nullptr, myGNEApp, MID_HOTKEY_CTRL_I_EDITVIEWPORT); + toogleGrid = new FXMenuCommand(editMenu, + "Toggle Grid\tCtrl+G\tToggles background grid (and snap-to-grid functionality).", + nullptr, myGNEApp, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID); + // add open in sumo options + new FXMenuSeparator(editMenu); + loadAdditionalsInSUMOGUI = new FXMenuCheck(editMenu, + "Load additionals in SUMO-GUI\t\tLoad additionals in SUMO-GUI.", + myGNEApp, MID_GNE_TOOLBAREDIT_LOADADDITIONALS); + loadAdditionalsInSUMOGUI->setCheck(TRUE); + loadDemandInSUMOGUI = new FXMenuCheck(editMenu, + "Load demand in SUMO-GUI\t\tLoad demand in SUMO-GUI.", + myGNEApp, MID_GNE_TOOLBAREDIT_LOADDEMAND); + loadDemandInSUMOGUI->setCheck(TRUE); + openInSUMOGUI = new FXMenuCommand(editMenu, + "Open in SUMO-GUI\tCtrl+T\tOpens the SUMO-GUI application with the current network.", + GUIIconSubSys::getIcon(GUIIcon::SUMO_MINI), myGNEApp, MID_HOTKEY_CTRL_T_OPENSUMONETEDIT); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::ProcessingMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::ProcessingMenuCommands::ProcessingMenuCommands(GNEApplicationWindow* GNEApp) : + computeNetwork(nullptr), + computeNetworkVolatile(nullptr), + cleanJunctions(nullptr), + joinJunctions(nullptr), + clearInvalidCrossings(nullptr), + computeDemand(nullptr), + cleanRoutes(nullptr), + joinRoutes(nullptr), + clearInvalidDemandElements(nullptr), + optionMenus(nullptr), + myGNEApp(GNEApp) { +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::buildProcessingMenuCommands(FXMenuPane* fileMenu) { + // build network processing menu commands + computeNetwork = new FXMenuCommand(fileMenu, + "Compute Junctions\tF5\tComputes junction shape and logic.", + GUIIconSubSys::getIcon(GUIIcon::COMPUTEJUNCTIONS), myGNEApp, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND); + computeNetworkVolatile = new FXMenuCommand(fileMenu, + "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.", + GUIIconSubSys::getIcon(GUIIcon::COMPUTEJUNCTIONS), myGNEApp, MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE); + cleanJunctions = new FXMenuCommand(fileMenu, + "Clean Junctions\tF6\tRemoves solitary junctions.", + GUIIconSubSys::getIcon(GUIIcon::CLEANJUNCTIONS), myGNEApp, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES); + joinJunctions = new FXMenuCommand(fileMenu, + "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.", + GUIIconSubSys::getIcon(GUIIcon::JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES); + clearInvalidCrossings = new FXMenuCommand(fileMenu, + "Clean invalid crossings\tF8\tClear invalid crossings.", + GUIIconSubSys::getIcon(GUIIcon::JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS); + // build demand processing menu commands + computeDemand = new FXMenuCommand(fileMenu, + "Compute demand\tF5\tComputes demand elements.", + GUIIconSubSys::getIcon(GUIIcon::COMPUTEDEMAND), myGNEApp, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND); + cleanRoutes = new FXMenuCommand(fileMenu, + "Clean routes\tF6\tRemoves routes without vehicles.", + GUIIconSubSys::getIcon(GUIIcon::CLEANROUTES), myGNEApp, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES); + joinRoutes = new FXMenuCommand(fileMenu, + "Join routes\tF7\tJoins routes with the same edges.", + GUIIconSubSys::getIcon(GUIIcon::JOINROUTES), myGNEApp, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES); + clearInvalidDemandElements = new FXMenuCommand(fileMenu, + "Clean invalid route elements\tF8\tClear elements with an invalid path (routes, Trips, Flows...).", + GUIIconSubSys::getIcon(GUIIcon::JOINJUNCTIONS), myGNEApp, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS); + // add separator (because optionsmenu is commmon for Network and Demand modes + new FXMenuSeparator(fileMenu); + optionMenus = new FXMenuCommand(fileMenu, + "Options\tF10\t\tConfigure Processing Options.", + GUIIconSubSys::getIcon(GUIIcon::OPTIONS), myGNEApp, MID_HOTKEY_F10_OPTIONSMENU); +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::showNetworkProcessingMenuCommands() { + // first enable menu commands + computeNetwork->enable(); + computeNetworkVolatile->enable(); + cleanJunctions->enable(); + joinJunctions->enable(); + clearInvalidCrossings->enable(); + // now show it + computeNetwork->show(); + computeNetworkVolatile->show(); + cleanJunctions->show(); + joinJunctions->show(); + clearInvalidCrossings->show(); +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::hideNetworkProcessingMenuCommands() { + // first disable menu commands + computeNetwork->disable(); + computeNetworkVolatile->disable(); + cleanJunctions->disable(); + joinJunctions->disable(); + clearInvalidCrossings->disable(); + // now hide it + computeNetwork->hide(); + computeNetworkVolatile->hide(); + cleanJunctions->hide(); + joinJunctions->hide(); + clearInvalidCrossings->hide(); +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::showDemandProcessingMenuCommands() { + // first enable menu commands + computeDemand->enable(); + cleanRoutes->enable(); + joinRoutes->enable(); + clearInvalidDemandElements->enable(); + // now show it + computeDemand->show(); + cleanRoutes->show(); + joinRoutes->show(); + clearInvalidDemandElements->show(); +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::hideDemandProcessingMenuCommands() { + // first disable menu commands + computeDemand->disable(); + cleanRoutes->disable(); + joinRoutes->disable(); + clearInvalidDemandElements->disable(); + // now hide it + computeDemand->hide(); + cleanRoutes->hide(); + joinRoutes->hide(); + clearInvalidDemandElements->hide(); +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::showDataProcessingMenuCommands() { + +} + + +void +GNEApplicationWindowHelper::ProcessingMenuCommands::hideDataProcessingMenuCommands() { + +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::LocateMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::LocateMenuCommands::LocateMenuCommands(GNEApplicationWindow* GNEApp) : + myGNEApp(GNEApp) { +} + + +void +GNEApplicationWindowHelper::LocateMenuCommands::buildLocateMenuCommands(FXMenuPane* locateMenu) { + // build locate menu commands + new FXMenuCommand(locateMenu, + "Locate &Junctions\tShift+J\tOpen a dialog for locating a Junction.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), myGNEApp, MID_LOCATEJUNCTION); + new FXMenuCommand(locateMenu, + "Locate &Edges\tShift+E\tOpen a dialog for locating an Edge.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), myGNEApp, MID_LOCATEEDGE); + new FXMenuCommand(locateMenu, + "Locate &Vehicles\tShift+V\tOpen a dialog for locating a Vehicle.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), myGNEApp, MID_LOCATEVEHICLE); + new FXMenuCommand(locateMenu, + "Locate &Person\tShift+P\tOpen a dialog for locating a Person.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), myGNEApp, MID_LOCATEPERSON); + new FXMenuCommand(locateMenu, + "Locate &Route\tShift+R\tOpen a dialog for locating a Route.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEROUTE), myGNEApp, MID_LOCATEROUTE); + new FXMenuCommand(locateMenu, + "Locate &Stops\tShift+S\tOpen a dialog for locating a Stop.", + GUIIconSubSys::getIcon(GUIIcon::LOCATESTOP), myGNEApp, MID_LOCATESTOP); + new FXMenuCommand(locateMenu, + "Locate &TLS\tShift+T\tOpen a dialog for locating a Traffic Light.", + GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), myGNEApp, MID_LOCATETLS); + new FXMenuCommand(locateMenu, + "Locate &Additional\tShift+A\tOpen a dialog for locating an Additional Structure.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), myGNEApp, MID_LOCATEADD); + new FXMenuCommand(locateMenu, + "Locate P&oI\tShift+O\tOpen a dialog for locating a Point of Interest.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), myGNEApp, MID_LOCATEPOI); + new FXMenuCommand(locateMenu, + "Locate Po&lygon\tShift+L\tOpen a dialog for locating a Polygon.", + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), myGNEApp, MID_LOCATEPOLY); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::WindowsMenuCommands - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::WindowsMenuCommands::WindowsMenuCommands(GNEApplicationWindow* GNEApp) : + myGNEApp(GNEApp) { +} + + +void +GNEApplicationWindowHelper::WindowsMenuCommands::buildWindowsMenuCommands(FXMenuPane* windowsMenu, FXStatusBar* statusbar, GUIMessageWindow* messageWindow) { + // build windows menu commands + new FXMenuCheck(windowsMenu, + "&Show Status Line\t\tToggle this Status Bar on/off.", + statusbar, FXWindow::ID_TOGGLESHOWN); + new FXMenuCheck(windowsMenu, + "Show &Message Window\t\tToggle the Message Window on/off.", + messageWindow, FXWindow::ID_TOGGLESHOWN); + new FXMenuCommand(windowsMenu, + "&Clear Message Window\t\tClear the message window.", + nullptr, myGNEApp, MID_CLEARMESSAGEWINDOW); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper::NetworkCheckableButtons - methods +// --------------------------------------------------------------------------- + +GNEApplicationWindowHelper::SupermodeCommands::SupermodeCommands(GNEApplicationWindow* GNEApp) : + networkMode(nullptr), + demandMode(nullptr), + dataMode(nullptr), + myGNEApp(GNEApp), + myHorizontalSeparator(nullptr) { +} + + +void +GNEApplicationWindowHelper::SupermodeCommands::showSupermodeCommands() { + networkMode->show(); + demandMode->show(); + dataMode->show(); + // also show separator + myHorizontalSeparator->show(); +} + + +void +GNEApplicationWindowHelper::SupermodeCommands::hideSupermodeCommands() { + networkMode->hide(); + demandMode->hide(); + dataMode->hide(); + // also hide separator + myHorizontalSeparator->hide(); +} + + +void +GNEApplicationWindowHelper::SupermodeCommands::buildSupermodeCommands(FXMenuPane* editMenu) { + // build supermode menu commands + networkMode = new FXMenuCommand(editMenu, + "&Network mode\tF2\tSelect network mode.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODENETWORK), myGNEApp, MID_HOTKEY_F2_SUPERMODE_NETWORK); + demandMode = new FXMenuCommand(editMenu, + "&Demand mode\tF3\tSelect demand mode.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND), myGNEApp, MID_HOTKEY_F3_SUPERMODE_DEMAND); + dataMode = new FXMenuCommand(editMenu, + "&Data mode\tF4\tSelect data mode.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), myGNEApp, MID_HOTKEY_F4_SUPERMODE_DATA); + // build separator + myHorizontalSeparator = new FXMenuSeparator(editMenu); +} + +// --------------------------------------------------------------------------- +// GNEApplicationWindowHelper - methods +// --------------------------------------------------------------------------- + +bool +GNEApplicationWindowHelper::toogleEditOptionsNetwork(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, const int numericalKeyPressed, FXObject* obj, FXSelector sel) { + // finally function correspond to visibleMenuCommands[numericalKeyPressed] + if (menuCheck == viewNet->getNetworkViewOptions().menuCheckShowGrid) { + // Toogle menuCheckShowGrid + if (viewNet->getNetworkViewOptions().menuCheckShowGrid->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckShowGrid->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckShowGrid->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowGridNetwork + viewNet->onCmdToogleShowGridNetwork(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckDrawSpreadVehicles) { + // Toogle menuCheckDrawSpreadVehicles + if (viewNet->getNetworkViewOptions().menuCheckDrawSpreadVehicles->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckDrawSpreadVehicles->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled toogle draw spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckDrawSpreadVehicles->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled toogle spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleDrawSpreadVehicles + viewNet->onCmdToogleDrawSpreadVehicles(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckShowDemandElements) { + // Toogle menuCheckShowDemandElements + if (viewNet->getNetworkViewOptions().menuCheckShowDemandElements->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckShowDemandElements->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckShowDemandElements->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowDemandElements + viewNet->onCmdToogleShowDemandElements(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckSelectEdges) { + // Toogle menuCheckSelectEdges + if (viewNet->getNetworkViewOptions().menuCheckSelectEdges->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckSelectEdges->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled select edges throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckSelectEdges->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled select edges throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleSelectEdges + viewNet->onCmdToogleSelectEdges(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckShowConnections) { + // Toogle menuCheckShowConnections + if (viewNet->getNetworkViewOptions().menuCheckShowConnections->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckShowConnections->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show connections throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckShowConnections->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show connections throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowConnections + viewNet->onCmdToogleShowConnections(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckHideConnections) { + // Toogle menuCheckHideConnections + if (viewNet->getNetworkViewOptions().menuCheckHideConnections->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckHideConnections->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled hide connections throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckHideConnections->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled hide connections throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleHideConnections + viewNet->onCmdToogleHideConnections(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckExtendSelection) { + // Toogle menuCheckExtendSelection + if (viewNet->getNetworkViewOptions().menuCheckExtendSelection->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckExtendSelection->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled extend selection throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckExtendSelection->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled extend selection throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleExtendSelection + viewNet->onCmdToogleExtendSelection(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckChangeAllPhases) { + // Toogle menuCheckChangeAllPhases + if (viewNet->getNetworkViewOptions().menuCheckChangeAllPhases->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckChangeAllPhases->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled change all phases throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckChangeAllPhases->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled change all phases throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleChangeAllPhases + viewNet->onCmdToogleChangeAllPhases(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckWarnAboutMerge) { + // Toogle menuCheckWarnAboutMerge + if (viewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled warn about merge throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled warn about merge throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleWarnAboutMerge + viewNet->onCmdToogleWarnAboutMerge(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckShowJunctionBubble) { + // Toogle menuCheckShowJunctionBubble + if (viewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowJunctionBubble + viewNet->onCmdToogleShowJunctionBubbles(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckMoveElevation) { + // Toogle menuCheckMoveElevation + if (viewNet->getNetworkViewOptions().menuCheckMoveElevation->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckMoveElevation->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled move elevation throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckMoveElevation->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled move elevation throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleMoveElevation + viewNet->onCmdToogleMoveElevation(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckChainEdges) { + // Toogle menuCheckChainEdges + if (viewNet->getNetworkViewOptions().menuCheckChainEdges->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckChainEdges->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled chain edges throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckChainEdges->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled chain edges throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleChainEdges + viewNet->onCmdToogleChainEdges(obj, sel, nullptr); + } else if (menuCheck == viewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge) { + // Toogle menuCheckAutoOppositeEdge + if (viewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->getCheck() == TRUE) { + viewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleAutoOppositeEdge + viewNet->onCmdToogleAutoOppositeEdge(obj, sel, nullptr); + } else { + return false; + } + return true; +} + + +bool +GNEApplicationWindowHelper::toogleEditOptionsDemand(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, const int numericalKeyPressed, FXObject* obj, FXSelector sel) { + if (menuCheck == viewNet->getDemandViewOptions().menuCheckShowGrid) { + // Toogle menuCheckShowGrid + if (viewNet->getDemandViewOptions().menuCheckShowGrid->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckShowGrid->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckShowGrid->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowGridDemand + viewNet->onCmdToogleShowGridDemand(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDemandViewOptions().menuCheckDrawSpreadVehicles) { + // Toogle menuCheckDrawSpreadVehicles + if (viewNet->getDemandViewOptions().menuCheckDrawSpreadVehicles->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckDrawSpreadVehicles->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled toogle draw spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckDrawSpreadVehicles->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled toogle spread vehicles throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleDrawSpreadVehicles + viewNet->onCmdToogleDrawSpreadVehicles(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDemandViewOptions().menuCheckHideShapes) { + // Toogle menuCheckHideShapes + if (viewNet->getDemandViewOptions().menuCheckHideShapes->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckHideShapes->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled hide shapes throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckHideShapes->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled hide shapes throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleHideNonInspecteDemandElements + viewNet->onCmdToogleHideShapes(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements) { + // Toogle menuCheckHideNonInspectedDemandElements + if (viewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleHideNonInspecteDemandElements + viewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDemandViewOptions().menuCheckShowAllPersonPlans) { + // Toogle menuCheckShowAllPersonPlans + if (viewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show all person plans throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show all person plans throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleHideNonInspecteDemandElements + viewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDemandViewOptions().menuCheckLockPerson) { + // Toogle menuCheckShowAllPersonPlans + if (viewNet->getDemandViewOptions().menuCheckLockPerson->getCheck() == TRUE) { + viewNet->getDemandViewOptions().menuCheckLockPerson->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled lock person plan throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDemandViewOptions().menuCheckLockPerson->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled lock person plan throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleLockPerson + viewNet->onCmdToogleLockPerson(obj, sel, nullptr); + } else { + return false; + } + return true; +} + + +bool +GNEApplicationWindowHelper::toogleEditOptionsData(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, const int numericalKeyPressed, FXObject* obj, FXSelector sel) { + if (menuCheck == viewNet->getDataViewOptions().menuCheckShowAdditionals) { + // Toogle menuCheckHideShapes + if (viewNet->getDataViewOptions().menuCheckShowAdditionals->getCheck() == TRUE) { + viewNet->getDataViewOptions().menuCheckShowAdditionals->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show additionals throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDataViewOptions().menuCheckShowAdditionals->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show shapes throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowAdditionals + viewNet->onCmdToogleShowAdditionals(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDataViewOptions().menuCheckShowShapes) { + // Toogle menuCheckHideShapes + if (viewNet->getDataViewOptions().menuCheckShowShapes->getCheck() == TRUE) { + viewNet->getDataViewOptions().menuCheckShowShapes->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show shapes throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDataViewOptions().menuCheckShowShapes->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show shapes throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowShapes + viewNet->onCmdToogleShowShapes(obj, sel, nullptr); + } else if (menuCheck == viewNet->getDataViewOptions().menuCheckShowDemandElements) { + // Toogle menuCheckShowDemandElements + if (viewNet->getDataViewOptions().menuCheckShowDemandElements->getCheck() == TRUE) { + viewNet->getDataViewOptions().menuCheckShowDemandElements->setCheck(FALSE); + // show extra information for tests + WRITE_DEBUG("Disabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } else { + viewNet->getDataViewOptions().menuCheckShowDemandElements->setCheck(TRUE); + // show extra information for tests + WRITE_DEBUG("Enabled show demand elements throught alt + " + toString(numericalKeyPressed + 1)); + } + // Call manually onCmdToogleShowDemandElements + viewNet->onCmdToogleShowDemandElements(obj, sel, nullptr); + } else { + return false; + } + return true; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindowHelper.h sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindowHelper.h --- sumo-1.5.0+dfsg1/src/netedit/GNEApplicationWindowHelper.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEApplicationWindowHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,495 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEApplicationWindowHelper.h +/// @author Pablo Alvarez Lopez +/// @date mar 2020 +/// +// Functions from main window of NETEDIT +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNEViewNetHelper.h" + + +// =========================================================================== +// class declarations +// =========================================================================== +class GNEApplicationWindow; +class GNELoadThread; +class GNEUndoList; +class GNENet; +class GNEViewNet; +class GUIEvent; + + +// =========================================================================== +// class definition +// =========================================================================== + +struct GNEApplicationWindowHelper { + + /// @brief struct for griped toolbars + struct ToolbarsGrip { + + /// @brief constructor + ToolbarsGrip(GNEApplicationWindow* GNEApp); + + /// @brief build menu toolbar grips + void buildMenuToolbarsGrip(); + + /// @brief build toolbars grips + void buildViewParentToolbarsGrips(); + + /// @brief build toolbars grips + void destroyParentToolbarsGrips(); + + /// @brief The application menu bar (for file, edit, processing...) + FXMenuBar* menu; + + /// @brief The application menu bar for supermodes (network and demand) + FXMenuBar* superModes; + + /// @brief The application menu bar for save elements (NetworkElements, additionals and demand elements) + FXMenuBar* saveElements; + + /// @brief The application menu bar for navigation (zoom, coloring...) + FXMenuBar* navigation; + + /// @brief The application menu bar (for select, inspect...) + FXMenuBar* modes; + + /// @brief The application menu bar for mode options (show connections, select edges...) + FXMenuBar* modeOptions; + + /// @brief The application menu bar for mode options (show connections, select edges...) + FXMenuBar* intervalBar; + + FXDockSite* myTopDock; + private: + /// @brief pointer to current GNEApplicationWindow + GNEApplicationWindow* myGNEApp; + /// @brief menu bar drag (for file, edit, processing...) + FXToolBarShell* myToolBarShellMenu; + + /// @brief menu bar drag for modes (network and demand) + FXToolBarShell* myToolBarShellSuperModes; + + /// @brief menu bar drag for save elements (NetworkElements, additionals and demand elements) + FXToolBarShell* myToolBarShellSaveElements; + + /// @brief menu bar drag for navigation (Zoom, coloring...) + FXToolBarShell* myToolBarShellNavigation; + + /// @brief menu bar drag for modes (select, inspect, delete...) + FXToolBarShell* myToolBarShellModes; + + /// @brief menu bar drag for mode options (show connections, select edges...) + FXToolBarShell* myToolBarShellModeOptions; + + /// @brief menu bar drag for interval bar + FXToolBarShell* myToolBarShellIntervalBar; + }; + + /// @brief struct for menu bar file + struct MenuBarFile { + + /// @brief constructor + MenuBarFile(GNEApplicationWindow* GNEApp); + + /// @brief build recent files + void buildRecentFiles(FXMenuPane* fileMenu); + + /// @brief List of recent config files + FXRecentFiles myRecentConfigs; + + /// @brief List of recent nets + FXRecentFiles myRecentNets; + + private: + /// @brief pointer to current GNEApplicationWindow + GNEApplicationWindow* myGNEApp; + }; + + /// @brief struct for File menu commands + struct FileMenuCommands { + + /// @brief constructor + FileMenuCommands(GNEApplicationWindow* GNEApp); + + /// @brief build menu commands + void buildFileMenuCommands(FXMenuPane* fileMenu, FXMenuPane* fileMenuTLS, FXMenuPane* fileMenuAdditionals, + FXMenuPane* fileMenuDemandElements, FXMenuPane* fileMenuDataElements); + + /// @brief FXMenuCommand for enable or disable save additionals + FXMenuCommand* saveAdditionals; + + /// @brief FXMenuCommand for enable or disable save additionals As + FXMenuCommand* saveAdditionalsAs; + + /// @brief FXMenuCommand for enable or disable save additionals + FXMenuCommand* saveTLSPrograms; + + /// @brief FXMenuCommand for enable or disable save demand elements + FXMenuCommand* saveDemandElements; + + /// @brief FXMenuCommand for enable or disable save demand elements as + FXMenuCommand* saveDemandElementsAs; + + /// @brief FXMenuCommand for enable or disable save data elements + FXMenuCommand* saveDataElements; + + /// @brief FXMenuCommand for enable or disable save data elements as + FXMenuCommand* saveDataElementsAs; + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + }; + + /// @brief struct for edit menu commands + struct EditMenuCommands { + + /// @brief struct for network menu commands + struct NetworkMenuCommands { + + /// @brief constructor + NetworkMenuCommands(const EditMenuCommands* editMenuCommandsParent); + + /// @brief build menu commands + void buildNetworkMenuCommands(FXMenuPane* editMenu); + + /// @brief show all menu commands + void showNetworkMenuCommands(); + + /// @brief hide all menu commands + void hideNetworkMenuCommands(); + + /// @brief menu command for create edge + FXMenuCommand* createEdgeMode; + + /// @brief menu command for move mode + FXMenuCommand* moveMode; + + /// @brief menu command for delete mode + FXMenuCommand* deleteMode; + + /// @brief menu command for inspect mode + FXMenuCommand* inspectMode; + + /// @brief menu command for select mode + FXMenuCommand* selectMode; + + /// @brief menu command for connect mode + FXMenuCommand* connectMode; + + /// @brief menu command for prohibition mode + FXMenuCommand* prohibitionMode; + + /// @brief menu command for TLS Mode + FXMenuCommand* TLSMode; + + /// @brief menu command for additional mode + FXMenuCommand* additionalMode; + + /// @brief menu command for crossing mode + FXMenuCommand* crossingMode; + + /// @brief menu command for TAZ mode + FXMenuCommand* TAZMode; + + /// @brief menu command for shape mode + FXMenuCommand* shapeMode; + + private: + /// @brief reference to EditMenuCommands + const EditMenuCommands* myEditMenuCommandsParent; + + /// @brief separator between sets of FXMenuCommand + FXMenuSeparator* myHorizontalSeparator; + }; + + /// @brief struct for Demand menu commands + struct DemandMenuCommands { + + /// @brief constructor + DemandMenuCommands(const EditMenuCommands* editMenuCommandsParent); + + /// @brief build menu commands + void buildDemandMenuCommands(FXMenuPane* editMenu); + + /// @brief show all menu commands + void showDemandMenuCommands(); + + /// @brief hide all menu commands + void hideDemandMenuCommands(); + + /// @brief menu command for route mode + FXMenuCommand* routeMode; + + /// @brief menu command for vehicle mode + FXMenuCommand* vehicleMode; + + /// @brief menu command for vehicle type mode + FXMenuCommand* vehicleTypeMode; + + /// @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; + + /// @brief menu command for person plan mode + FXMenuCommand* personPlanMode; + + private: + /// @brief reference to EditMenuCommands + const EditMenuCommands* myEditMenuCommandsParent; + + /// @brief separator between sets of FXMenuCommand + FXMenuSeparator* myHorizontalSeparator; + }; + + + /// @brief struct for Data menu commands + struct DataMenuCommands { + + /// @brief constructor + DataMenuCommands(const EditMenuCommands* editMenuCommandsParent); + + /// @brief build menu commands + void buildDataMenuCommands(FXMenuPane* editMenu); + + /// @brief show all menu commands + void showDataMenuCommands(); + + /// @brief hide all menu commands + void hideDataMenuCommands(); + + /// @brief menu command for edge mode + FXMenuCommand* edgeData; + + /// @brief menu command for edge rel mode + FXMenuCommand* edgeRelData; + + private: + /// @brief reference to EditMenuCommands + const EditMenuCommands* myEditMenuCommandsParent; + + /// @brief separator between sets of FXMenuCommand + FXMenuSeparator* myHorizontalSeparator; + }; + + /// @brief constructor + EditMenuCommands(GNEApplicationWindow* GNEApp); + + /// @brief build edit menu commands + void buildEditMenuCommands(FXMenuPane* editMenu); + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + + public: + /// @brief Network Menu Commands + NetworkMenuCommands networkMenuCommands; + + /// @brief Demand Menu Commands + DemandMenuCommands demandMenuCommands; + + /// @brief Data Menu Commands + DataMenuCommands dataMenuCommands; + + /// @brief FXMenuCommand for undo last change + FXMenuCommand* undoLastChange; + + /// @brief FXMenuCommand for redo last change + FXMenuCommand* redoLastChange; + + /// @brief FXMenuCommand for edit view scheme + FXMenuCommand* editViewScheme; + + /// @brief FXMenuCommand for edit view port + FXMenuCommand* editViewPort; + + /// @brief FXMenuCommand for toogle grid + FXMenuCommand* toogleGrid; + + /// @brief menu check for load additionals in SUMO GUI + FXMenuCheck* loadAdditionalsInSUMOGUI; + + /// @brief menu check for load demand in SUMO GUI + FXMenuCheck* loadDemandInSUMOGUI; + + /// @brief FXMenuCommand for open in SUMO GUI + FXMenuCommand* openInSUMOGUI; + }; + + /// @brief struct for processing menu commands + struct ProcessingMenuCommands { + + /// @brief constructor + ProcessingMenuCommands(GNEApplicationWindow* GNEApp); + + /// @brief build menu commands + void buildProcessingMenuCommands(FXMenuPane* editMenu); + + /// @brief show network processing menu commands + void showNetworkProcessingMenuCommands(); + + /// @brief show network processing menu commands + void hideNetworkProcessingMenuCommands(); + + /// @brief show demand processing menu commands + void showDemandProcessingMenuCommands(); + + /// @brief show demand processing menu commands + void hideDemandProcessingMenuCommands(); + + /// @brief show data processing menu commands + void showDataProcessingMenuCommands(); + + /// @brief show data processing menu commands + void hideDataProcessingMenuCommands(); + + /// @name Processing FXMenuCommands for Network mode + /// @{ + /// @brief FXMenuCommand for compute network + FXMenuCommand* computeNetwork; + + /// @brief FXMenuCommand for compute network with volatile options + FXMenuCommand* computeNetworkVolatile; + + /// @brief FXMenuCommand for clean junctions without edges + FXMenuCommand* cleanJunctions; + + /// @brief FXMenuCommand for join selected junctions + FXMenuCommand* joinJunctions; + + /// @brief FXMenuCommand for clear invalid crosings + FXMenuCommand* clearInvalidCrossings; + /// @} + + /// @name Processing FXMenuCommands for Demand mode + /// @{ + /// @brief FXMenuCommand for compute demand elements + FXMenuCommand* computeDemand; + + /// @brief FXMenuCommand for clean routes without vehicles + FXMenuCommand* cleanRoutes; + + /// @brief FXMenuCommand for join routes + FXMenuCommand* joinRoutes; + + /// @brief FXMenuCommand for clear invalid demand elements + FXMenuCommand* clearInvalidDemandElements; + /// @} + + /// @name Processing FXMenuCommands for Data mode + /// @{ + + /// @} + + /// @brief FXMenuCommand for open option menus + FXMenuCommand* optionMenus; + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + }; + + /// @brief struct for locate menu commands + struct LocateMenuCommands { + + /// @brief constructor + LocateMenuCommands(GNEApplicationWindow* GNEApp); + + /// @brief build menu commands + void buildLocateMenuCommands(FXMenuPane* locateMenu); + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + }; + + /// @brief struct for windows menu commands + struct WindowsMenuCommands { + + /// @brief constructor + WindowsMenuCommands(GNEApplicationWindow* GNEApp); + + /// @brief build menu commands + void buildWindowsMenuCommands(FXMenuPane* windowsMenu, FXStatusBar* statusbar, GUIMessageWindow* messageWindow); + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + }; + + /// @brief struct for supermode commands + struct SupermodeCommands { + + /// @brief constructor + SupermodeCommands(GNEApplicationWindow* GNEApp); + + /// @brief build menu commands + void buildSupermodeCommands(FXMenuPane* editMenu); + + /// @brief show all menu commands + void showSupermodeCommands(); + + /// @brief hide all menu commands + void hideSupermodeCommands(); + + /// @brief FXMenuCommand for network supermode + FXMenuCommand* networkMode; + + /// @brief FXMenuCommand for demand supermode + FXMenuCommand* demandMode; + + /// @brief FXMenuCommand for data supermode + FXMenuCommand* dataMode; + + private: + /// @brief pointer to current GNEApplicationWindows + GNEApplicationWindow* myGNEApp; + + /// @brief separator between sets of FXMenuCommand + FXMenuSeparator* myHorizontalSeparator; + }; + + /// @brief toogle edit options Network menu commands (called in GNEApplicationWindow::onCmdToogleEditOptions) + static bool toogleEditOptionsNetwork(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, + const int numericalKeyPressed, FXObject* obj, FXSelector sel); + + /// @brief toogle edit options Demand menu commands (called in GNEApplicationWindow::onCmdToogleEditOptions) + static bool toogleEditOptionsDemand(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, + const int numericalKeyPressed, FXObject* obj, FXSelector sel); + + /// @brief toogle edit options Data menu commands (called in GNEApplicationWindow::onCmdToogleEditOptions) + static bool toogleEditOptionsData(GNEViewNet* viewNet, const FXMenuCheck* menuCheck, + const int numericalKeyPressed, FXObject* obj, FXSelector sel); +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEAttributeCarrier.cpp sumo-1.6.0+dfsg1/src/netedit/GNEAttributeCarrier.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEAttributeCarrier.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEAttributeCarrier.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,4744 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAttributeCarrier.cpp -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// Abstract Base class for gui objects which carry attributes -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEAttributeCarrier.h" -#include "GNENet.h" - - -// =========================================================================== -// static members -// =========================================================================== - -std::map GNEAttributeCarrier::myTagProperties; -GNEAttributeCarrier::TagProperties 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); - - -// =========================================================================== -// method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEAttributeCarrier::AttributeProperties - methods -// --------------------------------------------------------------------------- - -GNEAttributeCarrier::AttributeProperties::AttributeProperties() : - myAttribute(SUMO_ATTR_NOTHING), - myTagPropertyParent(nullptr), - myAttrStr(toString(SUMO_ATTR_NOTHING)), - myAttributeProperty(ATTRPROPERTY_STRING), - myDefinition(""), - myDefaultValue(""), - myAttrSynonym(SUMO_ATTR_NOTHING), - myMinimumRange(0), - myMaximumRange(0) {} - - -GNEAttributeCarrier::AttributeProperties::AttributeProperties(const SumoXMLAttr attribute, const int attributeProperty, const std::string& definition, std::string defaultValue) : - myAttribute(attribute), - myTagPropertyParent(nullptr), - myAttrStr(toString(attribute)), - myAttributeProperty(attributeProperty), - myDefinition(definition), - myDefaultValue(defaultValue), - myAttrSynonym(SUMO_ATTR_NOTHING), - myMinimumRange(0), - myMaximumRange(0) { - // empty definition aren't valid - if (definition.empty()) { - 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 & ATTRPROPERTY_DEFAULTVALUESTATIC)) { - throw FormatException("AttributeProperty for '" + toString(attribute) + "' doesn't support default values"); - } - // default value cannot be static and mutables at the same time - if ((attributeProperty & ATTRPROPERTY_DEFAULTVALUESTATIC) && (attributeProperty & ATTRPROPERTY_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 & ATTRPROPERTY_OPTIONAL) && !((attributeProperty & ATTRPROPERTY_DEFAULTVALUESTATIC) || (attributeProperty & ATTRPROPERTY_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 & ATTRPROPERTY_FLOWDEFINITION) && (attributeProperty & ATTRPROPERTY_ACTIVATABLE)) { - throw FormatException("Attribute '" + toString(attribute) + "' cannot be flowdefinition and activatable at the same time"); - } -} - - -GNEAttributeCarrier::AttributeProperties::~AttributeProperties() {} - - -void -GNEAttributeCarrier::AttributeProperties::checkAttributeIntegrity() { - // check that positive attributes correspond only to a int, floats or SUMOTimes - if (isPositive() && !(isInt() || isFloat() || isSUMOTime())) { - throw FormatException("Only int, floats or SUMOTimes can be positive"); - } - // check that secuential attributes correspond to a list - if (isSecuential() && !isList()) { - throw FormatException("Secuential property only is compatible with list properties"); - } - // check that synonym attribute isn't nothing - if (hasAttrSynonym() && (myAttrSynonym == SUMO_ATTR_NOTHING)) { - throw FormatException("synonym attribute cannot be nothing"); - } - // check that ranges are valid - if (hasAttrRange()) { - if (myMinimumRange == myMaximumRange) { - throw FormatException("empty range"); - } else if ((myMinimumRange == 0) && (myMaximumRange == 0)) { - throw FormatException("non-defined range"); - } else if ((myMaximumRange - myMinimumRange) <= 0) { - 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"); - } -} - - -void -GNEAttributeCarrier::AttributeProperties::setDiscreteValues(const std::vector& discreteValues) { - if (isDiscrete()) { - myDiscreteValues = discreteValues; - } else { - throw FormatException("AttributeProperty doesn't support discrete values values"); - } -} - - -void -GNEAttributeCarrier::AttributeProperties::setSynonym(const SumoXMLAttr synonym) { - if (hasAttrSynonym()) { - myAttrSynonym = synonym; - } else { - throw FormatException("AttributeProperty doesn't support synonyms"); - } -} - - -void -GNEAttributeCarrier::AttributeProperties::setRange(const double minimum, const double maximum) { - if (hasAttrRange()) { - myMinimumRange = minimum; - myMaximumRange = maximum; - // check that given range is valid - if (myMinimumRange == myMaximumRange) { - throw FormatException("empty range"); - } else if ((myMinimumRange == 0) && (myMaximumRange == 0)) { - throw FormatException("non-defined range"); - } else if ((myMaximumRange - myMinimumRange) <= 0) { - throw FormatException("invalid range"); - } - } else { - throw FormatException("AttributeProperty doesn't support ranges"); - } -} - - -void -GNEAttributeCarrier::AttributeProperties::setTagPropertyParent(TagProperties* tagPropertyParent) { - myTagPropertyParent = tagPropertyParent; -} - - -SumoXMLAttr -GNEAttributeCarrier::AttributeProperties::getAttr() const { - return myAttribute; -} - - -const std::string& -GNEAttributeCarrier::AttributeProperties::getAttrStr() const { - return myAttrStr; -} - - -const GNEAttributeCarrier::TagProperties& -GNEAttributeCarrier::AttributeProperties::getTagPropertyParent() const { - return *myTagPropertyParent; -} - - -int -GNEAttributeCarrier::AttributeProperties::getPositionListed() const { - for (auto i = myTagPropertyParent->begin(); i != myTagPropertyParent->end(); i++) { - if (i->getAttr() == myAttribute) { - return (int)(i - myTagPropertyParent->begin()); - } - } - throw ProcessError("Attribute wasn't found in myTagPropertyParent"); -} - - -const std::string& -GNEAttributeCarrier::AttributeProperties::getDefinition() const { - return myDefinition; -} - - -const std::string& -GNEAttributeCarrier::AttributeProperties::getDefaultValue() const { - return myDefaultValue; -} - - -std::string -GNEAttributeCarrier::AttributeProperties::getDescription() const { - std::string pre; - std::string type; - std::string plural; - std::string last; - // pre type - if ((myAttributeProperty & ATTRPROPERTY_LIST) != 0) { - pre += "list of "; - if ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0) { - plural = "es"; - } else { - plural = "s"; - } - } - if ((myAttributeProperty & ATTRPROPERTY_POSITIVE) != 0) { - pre += "positive "; - } - if ((myAttributeProperty & ATTRPROPERTY_DISCRETE) != 0) { - pre += "discrete "; - } - if ((myAttributeProperty & ATTRPROPERTY_OPTIONAL) != 0) { - pre += "optional "; - } - if ((myAttributeProperty & ATTRPROPERTY_UNIQUE) != 0) { - pre += "unique "; - } - if ((myAttributeProperty & ATTRPROPERTY_VCLASSES) != 0) { - pre += "vclasses "; - } - // type - if ((myAttributeProperty & ATTRPROPERTY_INT) != 0) { - type = "integer"; - } - if ((myAttributeProperty & ATTRPROPERTY_FLOAT) != 0) { - type = "float"; - } - if ((myAttributeProperty & ATTRPROPERTY_SUMOTIME) != 0) { - type = "SUMOTime"; - } - if ((myAttributeProperty & ATTRPROPERTY_BOOL) != 0) { - type = "boolean"; - } - if ((myAttributeProperty & ATTRPROPERTY_STRING) != 0) { - type = "string"; - } - if ((myAttributeProperty & ATTRPROPERTY_POSITION) != 0) { - type = "position"; - } - if ((myAttributeProperty & ATTRPROPERTY_COLOR) != 0) { - type = "color"; - } - if ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0) { - type = "VClass"; - } - if ((myAttributeProperty & ATTRPROPERTY_FILENAME) != 0) { - type = "filename"; - } - if ((myAttributeProperty & ATTRPROPERTY_PROBABILITY) != 0) { - type = "probability"; - last = "[0, 1]"; - } - if ((myAttributeProperty & ATTRPROPERTY_ANGLE) != 0) { - type = "angle"; - last = "[0, 360]"; - } - return pre + type + plural + last; -} - - -const std::vector& -GNEAttributeCarrier::AttributeProperties::getDiscreteValues() const { - return myDiscreteValues; -} - - -SumoXMLAttr -GNEAttributeCarrier::AttributeProperties::getAttrSynonym() const { - if (hasAttrSynonym()) { - return myAttrSynonym; - } else { - throw ProcessError("Attr doesn't support synonym"); - } -} - - -double -GNEAttributeCarrier::AttributeProperties::getMinimumRange() const { - if (hasAttrRange()) { - return myMinimumRange; - } else { - throw ProcessError("Attr doesn't support range"); - } -} - - -double -GNEAttributeCarrier::AttributeProperties::getMaximumRange() const { - if (hasAttrRange()) { - return myMaximumRange; - } else { - throw ProcessError("Attr doesn't support range"); - } -} - - -bool -GNEAttributeCarrier::AttributeProperties::hasStaticDefaultValue() const { - return (myAttributeProperty & ATTRPROPERTY_DEFAULTVALUESTATIC) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::hasMutableDefaultValue() const { - return (myAttributeProperty & ATTRPROPERTY_DEFAULTVALUEMUTABLE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::hasAttrSynonym() const { - return (myAttributeProperty & ATTRPROPERTY_SYNONYM) != 0; -} - -bool -GNEAttributeCarrier::AttributeProperties::hasAttrRange() const { - return (myAttributeProperty & ATTRPROPERTY_RANGE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isInt() const { - return (myAttributeProperty & ATTRPROPERTY_INT) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isFloat() const { - return (myAttributeProperty & ATTRPROPERTY_FLOAT) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isSUMOTime() const { - return (myAttributeProperty & ATTRPROPERTY_SUMOTIME) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isBool() const { - return (myAttributeProperty & ATTRPROPERTY_BOOL) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isString() const { - return (myAttributeProperty & ATTRPROPERTY_STRING) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isposition() const { - return (myAttributeProperty & ATTRPROPERTY_POSITION) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isProbability() const { - return (myAttributeProperty & ATTRPROPERTY_PROBABILITY) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isNumerical() const { - return (myAttributeProperty & (ATTRPROPERTY_INT | ATTRPROPERTY_FLOAT | ATTRPROPERTY_SUMOTIME)) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isPositive() const { - return (myAttributeProperty & ATTRPROPERTY_POSITIVE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isColor() const { - return (myAttributeProperty & ATTRPROPERTY_COLOR) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isFilename() const { - return (myAttributeProperty & ATTRPROPERTY_FILENAME) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isVClass() const { - return (myAttributeProperty & ATTRPROPERTY_VCLASS) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isSVCPermission() const { - return ((myAttributeProperty & ATTRPROPERTY_LIST) != 0) && ((myAttributeProperty & ATTRPROPERTY_VCLASS) != 0); -} - - -bool -GNEAttributeCarrier::AttributeProperties::isList() const { - return (myAttributeProperty & ATTRPROPERTY_LIST) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isSecuential() const { - return (myAttributeProperty & ATTRPROPERTY_SECUENCIAL) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isUnique() const { - return (myAttributeProperty & ATTRPROPERTY_UNIQUE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isOptional() const { - return (myAttributeProperty & ATTRPROPERTY_OPTIONAL) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isDiscrete() const { - return (myAttributeProperty & ATTRPROPERTY_DISCRETE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isVClasses() const { - return (myAttributeProperty & ATTRPROPERTY_VCLASSES) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isExtended() const { - return (myAttributeProperty & ATTRPROPERTY_EXTENDED) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::requireUpdateGeometry() const { - return (myAttributeProperty & ATTRPROPERTY_UPDATEGEOMETRY) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isActivatable() const { - return (myAttributeProperty & ATTRPROPERTY_ACTIVATABLE) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isComplex() const { - return (myAttributeProperty & ATTRPROPERTY_COMPLEX) != 0; -} - - -bool -GNEAttributeCarrier::AttributeProperties::isFlowDefinition() const { - return (myAttributeProperty & ATTRPROPERTY_FLOWDEFINITION) != 0; -} - -// --------------------------------------------------------------------------- -// GNEAttributeCarrier::TagProperties - methods -// --------------------------------------------------------------------------- - -GNEAttributeCarrier::TagProperties::TagProperties() : - myTag(SUMO_TAG_NOTHING), - myTagType(0), - myTagProperty(0), - myIcon(ICON_EMPTY), - myParentTag(SUMO_TAG_NOTHING), - myTagSynonym(SUMO_TAG_NOTHING) { -} - - -GNEAttributeCarrier::TagProperties::TagProperties(SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, SumoXMLTag parentTag, SumoXMLTag tagSynonym) : - myTag(tag), - myTagStr(toString(tag)), - myTagType(tagType), - myTagProperty(tagProperty), - myIcon(icon), - myParentTag(parentTag), - myTagSynonym(tagSynonym) { -} - - -GNEAttributeCarrier::TagProperties::~TagProperties() {} - - -SumoXMLTag -GNEAttributeCarrier::TagProperties::getTag() const { - return myTag; -} - - -const std::string& -GNEAttributeCarrier::TagProperties::getTagStr() const { - return myTagStr; -} - - -void -GNEAttributeCarrier::TagProperties::checkTagIntegrity() const { - // check that element must ist at least netElement, Additional, or shape - if (!isNetElement() && !isAdditional() && !isShape() && !isTAZ() && !isDemandElement()) { - throw ProcessError("element must be at leas netElement, additional, TAZ, shape or demandElement"); - } - // check that element only is netElement, Additional, or shape at the same time - if ((isNetElement() + isAdditional() + isShape() + isTAZ() + isDemandElement()) > 1) { - throw ProcessError("element can be only a netElement, additional, shape or demandElement at the same time"); - } - // if element can mask the start and end position, check that bot attributes exist - if (canMaskStartEndPos() && (!hasAttribute(SUMO_ATTR_STARTPOS) || !hasAttribute(SUMO_ATTR_ENDPOS))) { - throw ProcessError("If attribute mask the start and end position, bot attribute has to be defined"); - } - // check that synonym tag isn't nothing - if (hasTagSynonym() && (myTagSynonym == SUMO_TAG_NOTHING)) { - throw FormatException("Synonym tag cannot be nothing"); - } - // check that synonym was defined - if (!hasTagSynonym() && (myTagSynonym != SUMO_TAG_NOTHING)) { - throw FormatException("Tag doesn't support synonyms"); - } - // check integrity of all attributes - for (auto i : myAttributeProperties) { - i.checkAttributeIntegrity(); - // check that if attribute is vehicle classes, own a combination of Allow/disallow attibute - if (i.isVClasses()) { - if ((i.getAttr() != SUMO_ATTR_ALLOW) && (i.getAttr() != SUMO_ATTR_DISALLOW)) { - throw ProcessError("Attributes aren't combinables"); - } else if ((i.getAttr() == SUMO_ATTR_ALLOW) && !hasAttribute(SUMO_ATTR_DISALLOW)) { - throw ProcessError("allow need a disallow attribute in the same tag"); - } else if ((i.getAttr() == SUMO_ATTR_DISALLOW) && !hasAttribute(SUMO_ATTR_ALLOW)) { - throw ProcessError("disallow need an allow attribute in the same tag"); - } - } - } -} - - -const std::string& -GNEAttributeCarrier::TagProperties::getDefaultValue(SumoXMLAttr attr) const { - // iterate over attribute properties - for (const auto& i : myAttributeProperties) { - if (i.getAttr() == attr) { - if (!i.hasStaticDefaultValue()) { - throw ProcessError("attribute '" + i.getAttrStr() + "' doesn't have a default value"); - } else { - return i.getDefaultValue(); - } - } - } - throw ProcessError("Attribute '" + toString(attr) + "' not defined"); -} - - -void -GNEAttributeCarrier::TagProperties::addAttribute(const AttributeProperties& attributeProperty) { - if (isAttributeDeprecated(attributeProperty.getAttr())) { - throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' is deprecated and cannot be inserted"); - } else if ((myAttributeProperties.size() + 1) >= MAXNUMBEROFATTRIBUTES) { - throw ProcessError("Maximum number of attributes for tag " + attributeProperty.getAttrStr() + " exceeded"); - } else { - // Check that attribute wasn't already inserted - for (auto i : myAttributeProperties) { - if (i.getAttr() == attributeProperty.getAttr()) { - throw ProcessError("Attribute '" + attributeProperty.getAttrStr() + "' already inserted"); - } - } - // insert AttributeProperties in vector - myAttributeProperties.push_back(attributeProperty); - myAttributeProperties.back().setTagPropertyParent(this); - } -} - - -void -GNEAttributeCarrier::TagProperties::addDeprecatedAttribute(SumoXMLAttr attr) { - // Check that attribute wasn't already inserted - for (auto i : myAttributeProperties) { - if (i.getAttr() == attr) { - throw ProcessError("Attribute '" + toString(attr) + "' is deprecated but was inserted in list of attributes"); - } - } - // add it into myDeprecatedAttributes - myDeprecatedAttributes.push_back(attr); -} - - -const GNEAttributeCarrier::AttributeProperties& -GNEAttributeCarrier::TagProperties::getAttributeProperties(SumoXMLAttr attr) const { - // iterate over attribute properties - for (const auto& i : myAttributeProperties) { - if ((i.getAttr() == attr) || (i.hasAttrSynonym() && (i.getAttrSynonym() == attr))) { - return i; - } - } - // throw error if these attribute doesn't exist - throw ProcessError("Attribute '" + toString(attr) + "' doesn't exist"); -} - - -std::vector::const_iterator -GNEAttributeCarrier::TagProperties::begin() const { - return myAttributeProperties.begin(); -} - - -std::vector::const_iterator -GNEAttributeCarrier::TagProperties::end() const { - return myAttributeProperties.end(); -} - - -int -GNEAttributeCarrier::TagProperties::getNumberOfAttributes() const { - return (int)myAttributeProperties.size(); -} - - -GUIIcon -GNEAttributeCarrier::TagProperties::getGUIIcon() const { - return myIcon; -} - - -SumoXMLTag -GNEAttributeCarrier::TagProperties::getParentTag() const { - if (hasParent()) { - return myParentTag; - } else { - throw ProcessError("Tag doesn't have parent"); - } -} - - -SumoXMLTag -GNEAttributeCarrier::TagProperties::getTagSynonym() const { - if (hasTagSynonym()) { - return myTagSynonym; - } else { - throw ProcessError("Tag doesn't have synonym"); - } -} - - -bool -GNEAttributeCarrier::TagProperties::hasAttribute(SumoXMLAttr attr) const { - // iterate over attribute properties - for (const auto& i : myAttributeProperties) { - if (i.getAttr() == attr) { - return true; - } - } - return false; -} - - -bool -GNEAttributeCarrier::TagProperties::isNetElement() const { - return (myTagType & TAGTYPE_NETELEMENT) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isAdditional() const { - return (myTagType & TAGTYPE_ADDITIONAL) != 0; -} - -bool -GNEAttributeCarrier::TagProperties::isShape() const { - return (myTagType & TAGTYPE_SHAPE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isTAZ() const { - return (myTagType & TAGTYPE_TAZ) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isDemandElement() const { - return (myTagType & TAGTYPE_DEMANDELEMENT) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isStoppingPlace() const { - return (myTagType & TAGTYPE_STOPPINGPLACE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isDetector() const { - return (myTagType & TAGTYPE_DETECTOR) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isVehicleType() const { - return (myTagType & TAGTYPE_VTYPE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isVehicle() const { - return (myTagType & TAGTYPE_VEHICLE) != 0; -} - -bool -GNEAttributeCarrier::TagProperties::isRoute() const { - return (myTagType & TAGTYPE_ROUTE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isStop() const { - return (myTagType & TAGTYPE_STOP) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isPerson() const { - return (myTagType & TAGTYPE_PERSON) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isPersonPlan() const { - return (myTagType & TAGTYPE_PERSONPLAN) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isPersonTrip() const { - return (myTagType & TAGTYPE_PERSONTRIP) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isWalk() const { - return (myTagType & TAGTYPE_WALK) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isRide() const { - return (myTagType & TAGTYPE_RIDE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isPersonStop() const { - return (myTagType & TAGTYPE_PERSONSTOP) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isDrawable() const { - return (myTagProperty & TAGPROPERTY_DRAWABLE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isSelectable() const { - return (myTagProperty & TAGPROPERTY_SELECTABLE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canBlockMovement() const { - return (myTagProperty & TAGPROPERTY_BLOCKMOVEMENT) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canBlockShape() const { - return (myTagProperty & TAGPROPERTY_BLOCKSHAPE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canCloseShape() const { - return (myTagProperty & TAGPROPERTY_CLOSESHAPE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasGEOPosition() const { - return (myTagProperty & TAGPROPERTY_GEOPOSITION) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasGEOShape() const { - return (myTagProperty & TAGPROPERTY_GEOSHAPE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasParent() const { - return (myTagProperty & TAGPROPERTY_PARENT) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasTagSynonym() const { - return (myTagProperty & TAGPROPERTY_SYNONYM) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasDialog() const { - return (myTagProperty & TAGPROPERTY_DIALOG) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasMinimumNumberOfChildren() const { - return (myTagProperty & TAGPROPERTY_MINIMUMCHILDREN) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::hasParameters() const { - // note: By default all Tags supports parameters, except Tags with "TAGPROPERTY_NOPARAMETERS" - return (myTagProperty & TAGPROPERTY_NOPARAMETERS) == 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isPlacedInRTree() const { - return (myTagProperty & TAGPROPERTY_RTREE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canBeSortedManually() const { - return (myTagProperty & TAGPROPERTY_SORTINGCHILDREN) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canBeReparent() const { - return (myTagProperty & TAGPROPERTY_REPARENT) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canAutomaticSortChildren() const { - return (myTagProperty & TAGPROPERTY_AUTOMATICSORTING) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canWriteChildrenSeparate() const { - return (myTagProperty & TAGPROPERTY_WRITECHILDRENSEPARATE) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canMaskStartEndPos() const { - return (myTagProperty & TAGPROPERTY_MASKSTARTENDPOS) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canMaskXYZPositions() const { - return (myTagProperty & TAGPROPERTY_MASKXYZPOSITION) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::canCenterCameraAfterCreation() const { - return (myTagProperty & TAGPROPERTY_CENTERAFTERCREATION) != 0; -} - - -bool -GNEAttributeCarrier::TagProperties::isAttributeDeprecated(SumoXMLAttr attr) const { - return (std::find(myDeprecatedAttributes.begin(), myDeprecatedAttributes.end(), attr) != myDeprecatedAttributes.end()); -} - -// --------------------------------------------------------------------------- -// GNEAttributeCarrier - methods -// --------------------------------------------------------------------------- - -GNEAttributeCarrier::GNEAttributeCarrier(const SumoXMLTag tag) : - myTagProperty(getTagProperties(tag)), - mySelected(false) { -} - - -GNEAttributeCarrier::~GNEAttributeCarrier() {} - - -const GNEGeometry::DottedGeometry& -GNEAttributeCarrier::getDottedGeometry() const { - return myDottedGeometry; -} - - -template<> int -GNEAttributeCarrier::parse(const std::string& string) { - return StringUtils::toInt(string); -} - - -template<> double -GNEAttributeCarrier::parse(const std::string& string) { - return StringUtils::toDouble(string); -} - - -template<> SUMOTime -GNEAttributeCarrier::parse(const std::string& string) { - SUMOTime time = string2time(string); - if (time < 0) { - throw TimeFormatException("SUMOTIME cannot be negative"); - } else { - return time; - } -} - - -template<> bool -GNEAttributeCarrier::parse(const std::string& string) { - return StringUtils::toBool(string); -} - - -template<> std::string -GNEAttributeCarrier::parse(const std::string& string) { - return string; -} - - -template<> SUMOVehicleClass -GNEAttributeCarrier::parse(const std::string& string) { - if (string.size() == 0) { - throw EmptyData(); - } else if (!SumoVehicleClassStrings.hasString(string)) { - return SVC_IGNORING; - } else { - return SumoVehicleClassStrings.get(string); - } -} - - -template<> RGBColor -GNEAttributeCarrier::parse(const std::string& string) { - return RGBColor::parseColor(string); -} - - -template<> Position -GNEAttributeCarrier::parse(const std::string& string) { - if (string.size() == 0) { - throw EmptyData(); - } else { - bool ok = true; - PositionVector pos = GeomConvHelper::parseShapeReporting(string, "user-supplied position", 0, ok, false, false); - if (!ok || (pos.size() != 1)) { - throw NumberFormatException("(Position) " + string); - } else { - return pos[0]; - } - } -} - - -template<> PositionVector -GNEAttributeCarrier::parse(const std::string& string) { - PositionVector posVector; - // empty string are allowed (It means empty position vector) - if (string.empty()) { - return posVector; - } else { - bool ok = true; - posVector = GeomConvHelper::parseShapeReporting(string, "user-supplied shape", 0, ok, false, true); - if (!ok) { - throw NumberFormatException("(Position List) " + string); - } else { - return posVector; - } - } -} - - -template<> SUMOVehicleShape -GNEAttributeCarrier::parse(const std::string& string) { - if ((string == "unknown") || (!SumoVehicleShapeStrings.hasString(string))) { - return SVS_UNKNOWN; - } else { - return SumoVehicleShapeStrings.get(string); - } -} - - -template<> std::vector -GNEAttributeCarrier::parse(const std::string& string) { - return StringTokenizer(string).getVector(); -} - - -template<> std::set -GNEAttributeCarrier::parse(const std::string& string) { - std::vector vectorString = StringTokenizer(string).getVector(); - std::set solution; - for (const auto& i : vectorString) { - solution.insert(i); - } - return solution; -} - - -template<> std::vector -GNEAttributeCarrier::parse(const std::string& string) { - std::vector parsedValues = parse >(string); - std::vector parsedIntValues; - for (const auto& i : parsedValues) { - parsedIntValues.push_back(parse(i)); - } - return parsedIntValues; -} - - -template<> std::vector -GNEAttributeCarrier::parse(const std::string& string) { - std::vector parsedValues = parse >(string); - std::vector parsedDoubleValues; - for (const auto& i : parsedValues) { - parsedDoubleValues.push_back(parse(i)); - } - return parsedDoubleValues; -} - - -template<> std::vector -GNEAttributeCarrier::parse(const std::string& string) { - std::vector parsedValues = parse >(string); - std::vector parsedBoolValues; - for (const auto& i : parsedValues) { - parsedBoolValues.push_back(parse(i)); - } - return parsedBoolValues; -} - - -template<> std::vector -GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { - // Declare string vector - std::vector edgeIds = GNEAttributeCarrier::parse > (value); - std::vector parsedEdges; - // Iterate over edges IDs, retrieve Edges and add it into parsedEdges - for (const auto& i : edgeIds) { - GNEEdge* retrievedEdge = net->retrieveEdge(i, false); - if (retrievedEdge) { - parsedEdges.push_back(net->retrieveEdge(i)); - } else { - throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_EDGES) + ". " + toString(SUMO_TAG_EDGE) + " '" + i + "' doesn't exist"); - } - } - return parsedEdges; -} - - -template<> std::vector -GNEAttributeCarrier::parse(GNENet* net, const std::string& value) { - // Declare string vector - std::vector laneIds = GNEAttributeCarrier::parse > (value); - std::vector parsedLanes; - // Iterate over lanes IDs, retrieve Lanes and add it into parsedLanes - for (const auto& i : laneIds) { - GNELane* retrievedLane = net->retrieveLane(i, false); - if (retrievedLane) { - parsedLanes.push_back(net->retrieveLane(i)); - } else { - throw FormatException("Error parsing parameter " + toString(SUMO_ATTR_LANES) + ". " + toString(SUMO_TAG_LANE) + " '" + i + "' doesn't exist"); - } - } - return parsedLanes; -} - - -template<> std::string -GNEAttributeCarrier::parseIDs(const std::vector& ACs) { - // obtain ID's of edges and return their join - std::vector edgeIDs; - for (const auto& i : ACs) { - edgeIDs.push_back(i->getID()); - } - return joinToString(edgeIDs, " "); -} - - -template<> std::string -GNEAttributeCarrier::parseIDs(const std::vector& ACs) { - // obtain ID's of lanes and return their join - std::vector laneIDs; - for (const auto& i : ACs) { - laneIDs.push_back(i->getID()); - } - return joinToString(laneIDs, " "); -} - - -bool -GNEAttributeCarrier::lanesConsecutives(const std::vector& lanes) { - // we need at least two lanes - if (lanes.size() > 1) { - // now check that lanes are consecutives (not neccesary connected) - int currentLane = 0; - while (currentLane < ((int)lanes.size() - 1)) { - int nextLane = -1; - // iterate over outgoing edges of destiny juntion of edge's lane - for (int i = 0; (i < (int)lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().size()) && (nextLane == -1); i++) { - // iterate over lanes of outgoing edges of destiny juntion of edge's lane - for (int j = 0; (j < (int)lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().size()) && (nextLane == -1); j++) { - // check if lane correspond to the next lane of "lanes" - if (lanes.at(currentLane)->getParentEdge()->getGNEJunctionDestiny()->getGNEOutgoingEdges().at(i)->getLanes().at(j) == lanes.at(currentLane + 1)) { - nextLane = currentLane; - } - } - } - if (nextLane == -1) { - return false; - } else { - currentLane++; - } - } - return true; - } else { - return false; - } -} - - -std::string -GNEAttributeCarrier::getAlternativeValueForDisabledAttributes(SumoXMLAttr key) const { - switch (key) { - // Crossings - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - return "No TLS"; - // connections - case SUMO_ATTR_DIR: { - // special case for connection directions - std::string direction = getAttribute(key); - if (direction == "s") { - return "Straight (s)"; - } else if (direction == "t") { - return "Turn (t))"; - } else if (direction == "l") { - return "Left (l)"; - } else if (direction == "r") { - return "Right (r)"; - } else if (direction == "L") { - return "Partially left (L)"; - } else if (direction == "R") { - return "Partially right (R)"; - } else if (direction == "invalid") { - return "No direction (Invalid))"; - } else { - return "undefined"; - } - } - case SUMO_ATTR_STATE: { - // special case for connection states - std::string state = getAttribute(key); - if (state == "-") { - return "Dead end (-)"; - } else if (state == "=") { - return "equal (=)"; - } else if (state == "m") { - return "Minor link (m)"; - } else if (state == "M") { - return "Major link (M)"; - } else if (state == "O") { - return "TLS controller off (O)"; - } else if (state == "o") { - return "TLS yellow flashing (o)"; - } else if (state == "y") { - return "TLS yellow minor link (y)"; - } else if (state == "Y") { - return "TLS yellow major link (Y)"; - } else if (state == "r") { - return "TLS red (r)"; - } else if (state == "g") { - return "TLS green minor (g)"; - } else if (state == "G") { - return "TLS green major (G)"; - } else { - return "undefined"; - } - } - // flows - case SUMO_ATTR_VEHSPERHOUR: - case SUMO_ATTR_PERIOD: - case SUMO_ATTR_PROB: - case SUMO_ATTR_END: - case SUMO_ATTR_NUMBER: - if (myTagProperty.hasAttribute(key) && myTagProperty.getAttributeProperties(key).isFlowDefinition()) { - if (isAttributeEnabled(SUMO_ATTR_VEHSPERHOUR)) { - if (isAttributeEnabled(SUMO_ATTR_END)) { - return "not together with number and period or probability"; - } else { - return "not together with end and period or probability"; - } - } else if (isAttributeEnabled(SUMO_ATTR_PERIOD)) { - if (isAttributeEnabled(SUMO_ATTR_END)) { - return "not together with number and vehsPerHour or probability"; - } else { - return "not together with end and vehsPerHour or probability"; - } - } else if (isAttributeEnabled(SUMO_ATTR_PROB)) { - if (isAttributeEnabled(SUMO_ATTR_END)) { - return "not together with number and vehsPerHour or period"; - } else { - return "not together with end and vehsPerHour or period"; - } - } else if (isAttributeEnabled(SUMO_ATTR_END) && (isAttributeEnabled(SUMO_ATTR_NUMBER))) { - return "not together with end and number"; - } - } - FALLTHROUGH; - default: - return getAttribute(key); - } -} - - -std::string -GNEAttributeCarrier::getAttributeForSelection(SumoXMLAttr key) const { - return getAttribute(key); -} - - -const std::string& -GNEAttributeCarrier::getTagStr() const { - return myTagProperty.getTagStr(); -} - - -const GNEAttributeCarrier::TagProperties& -GNEAttributeCarrier::getTagProperty() const { - return myTagProperty; -} - - -FXIcon* -GNEAttributeCarrier::getIcon() const { - // define on first access - if (myTagProperties.size() == 0) { - fillAttributeCarriers(); - } - return GUIIconSubSys::getIcon(myTagProperty.getGUIIcon()); -} - - -const std::string -GNEAttributeCarrier::getID() const { - return getAttribute(SUMO_ATTR_ID); -} - -// =========================================================================== -// static methods -// =========================================================================== - -const GNEAttributeCarrier::TagProperties& -GNEAttributeCarrier::getTagProperties(SumoXMLTag tag) { - if (tag == SUMO_TAG_NOTHING) { - return dummyTagProperty; - } - // 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"); - } else { - return myTagProperties.at(tag); - } -} - - -std::vector -GNEAttributeCarrier::allowedTags(bool onlyDrawables) { - std::vector allTags; - // define on first access - if (myTagProperties.size() == 0) { - fillAttributeCarriers(); - } - // fill all tags - for (const auto& i : myTagProperties) { - if (!onlyDrawables || i.second.isDrawable()) { - allTags.push_back(i.first); - } - } - return allTags; -} - - -std::vector -GNEAttributeCarrier::allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables) { - std::vector allowedTags; - // define on first access - if (myTagProperties.size() == 0) { - fillAttributeCarriers(); - } - if (tagPropertyCategory & TAGTYPE_NETELEMENT) { - // fill netElements tags - for (const auto& i : myTagProperties) { - if (i.second.isNetElement() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_ADDITIONAL) { - // fill additional tags - for (const auto& i : myTagProperties) { - if (i.second.isAdditional() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_SHAPE) { - // fill shape tags - for (const auto& i : myTagProperties) { - if (i.second.isShape() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_TAZ) { - // fill taz tags - for (const auto& i : myTagProperties) { - if (i.second.isTAZ() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_DEMANDELEMENT) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isDemandElement() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_ROUTE) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isRoute() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_VEHICLE) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isVehicle() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_STOP) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isStop() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_PERSON) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isPerson() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_PERSONPLAN) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isPersonPlan() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_PERSONTRIP) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isPersonTrip() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_WALK) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isWalk() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_RIDE) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isRide() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - if (tagPropertyCategory & TAGTYPE_PERSONSTOP) { - // fill demand tags - for (const auto& i : myTagProperties) { - if (i.second.isPersonStop() && (!onlyDrawables || i.second.isDrawable())) { - allowedTags.push_back(i.first); - } - } - } - return allowedTags; -} - - -// =========================================================================== -// private -// =========================================================================== - -void -GNEAttributeCarrier::fillAttributeCarriers() { - // fill all groups of ACs - fillNetElements(); - fillAdditionals(); - fillShapes(); - fillDemandElements(); - fillVehicleElements(); - fillStopElements(); - fillPersonElements(); - fillPersonStopElements(); - // check integrity of all Tags (function checkTagIntegrity() throw an exception if there is an inconsistency) - for (const auto& i : myTagProperties) { - i.second.checkTagIntegrity(); - } -} - - -void -GNEAttributeCarrier::fillNetElements() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // obtain Node Types except NODETYPE_DEAD_END_DEPRECATED - const OptionsCont& oc = OptionsCont::getOptions(); - std::vector nodeTypes = SUMOXMLDefinitions::NodeTypes.getStrings(); - nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_DEAD_END_DEPRECATED))); - nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_DEAD_END))); - nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_NOJUNCTION))); - nodeTypes.erase(std::find(nodeTypes.begin(), nodeTypes.end(), toString(NODETYPE_INTERNAL))); - // fill netElement ACs - SumoXMLTag currentTag = SUMO_TAG_EDGE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_EDGE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the edge"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of a node within the nodes-file the edge shall start at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of a node within the nodes-file the edge shall end at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The maximum speed allowed on the edge in m/s", - toString(oc.getFloat("default.speed"))); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PRIORITY, - ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The priority of the edge", - toString(oc.getInt("default.priority"))); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NUMLANES, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The number of lanes of the edge", - toString(oc.getInt("default.lanenumber"))); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The name of a type within the SUMO edge type file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly allows the given vehicle classes (not given will be not allowed)", - "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_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); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_UPDATEGEOMETRY, - "The length of the edge in meter"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPREADTYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Lane width for all lanes of this edge in meters (used for visualization)", - "right"); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneSpreadFunctions.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC, - "street name (need not be unique, used for visualization)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Lane width for all lanes of this edge in meters (used for visualization)", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDOFFSET, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Move the stop line back from the intersection by the given amount", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(GNE_ATTR_SHAPE_START, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_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 = AttributeProperties(GNE_ATTR_SHAPE_END, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_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 = AttributeProperties(GNE_ATTR_BIDIR, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, // 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 = AttributeProperties(SUMO_ATTR_DISTANCE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UNIQUE, - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - } - currentTag = SUMO_TAG_JUNCTION; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_JUNCTION); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the node"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_POSITION | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y - "The x-y-z position of the node on the plane in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "An optional type for the node"); - attrProperty.setDiscreteValues(nodeTypes); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "A custom shape for that node"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_RADIUS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Optional turning radius (for all corners) for that node in meters", - "1.5"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_KEEP_CLEAR, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Whether the junction-blocking-heuristic should be activated at this node", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_RIGHT_OF_WAY, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "How to compute right of way rules at this node", - SUMOXMLDefinitions::RightOfWayValues.getString(RIGHT_OF_WAY_DEFAULT)); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::RightOfWayValues.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRINGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Whether this junction is at the fringe of the network", - SUMOXMLDefinitions::FringeTypeValues.getString(FRINGE_TYPE_DEFAULT)); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::FringeTypeValues.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLTYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "An optional type for the traffic light algorithm"); - attrProperty.setDiscreteValues({toString(TLTYPE_STATIC), toString(TLTYPE_ACTUATED), toString(TLTYPE_DELAYBASED)}); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLID, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC, - "An optional id for the traffic light program"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_LANE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "ID of lane (Automatic, non editable)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_INDEX, - ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The enumeration index of the lane (0 is the rightmost lane, -1 is the leftmost one)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Speed in meters per second", - "13.89"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly allows the given vehicle classes (not given will be not allowed)", - "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Width in meters (used for visualization)", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDOFFSET, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Move the stop line back from the intersection by the given amount", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ACCELERATION, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Enable or disable lane as acceleration lane", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "If the shape is given it overrides the computation based on edge shape"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_CROSSING; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_CROSSING, SUMO_TAG_JUNCTION); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The ID of Crossing"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EDGES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The (road) edges which are crossed"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PRIORITY, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Whether the pedestrians have priority over the vehicles (automatically set to true at tls-controlled intersections)", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The width of the crossings", - toString(OptionsCont::getOptions().getFloat("default.crossing-width"))); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX, - ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "sets the tls-index for this crossing", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX2, - ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "sets the opposite-direction tls-index for this crossing", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "Overrids default shape of pedestrian crossing"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_CONNECTION; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_NETELEMENT, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_CONNECTION, SUMO_TAG_EDGE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the vehicles leave"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the vehicles may reach when leaving 'from'"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FROM_LANE, - ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "the lane index of the incoming lane (numbers starting with 0)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO_LANE, - ATTRPROPERTY_INT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "the lane index of the outgoing lane (numbers starting with 0)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PASS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "if set, vehicles which pass this (lane-2-lane) connection) will not wait", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_KEEP_CLEAR, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "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 = AttributeProperties(SUMO_ATTR_CONTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "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 = AttributeProperties(SUMO_ATTR_UNCONTROLLED, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "If set to true, This connection will not be TLS-controlled despite its node being controlled", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VISIBILITY_DISTANCE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Vision distance between vehicles", - toString(NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX, - ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "sets index of this connection within the controlling trafficlight", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TLLINKINDEX2, - ATTRPROPERTY_INT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "sets index for the internal junction of this connection within the controlling trafficlight", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly allows the given vehicle classes (not given will be not allowed)", - "all"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES, - "Explicitly disallows the given vehicle classes (not given will be allowed)"); - attrProperty.setDiscreteValues(SumoVehicleClassStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "sets custom speed limit for the connection", - toString(NBEdge::UNSPECIFIED_SPEED)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CUSTOMSHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "sets custom shape for the connection"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DIR, - ATTRPROPERTY_STRING, - "turning direction for this connection (computed)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STATE, - ATTRPROPERTY_STRING, - "link state for this connection (computed)"); - myTagProperties[currentTag].addAttribute(attrProperty); - } -} - - -void -GNEAttributeCarrier::fillAdditionals() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill additional elements - SumoXMLTag currentTag = SUMO_TAG_BUS_STOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CONTAINERSTOP, SUMO_TAG_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of bus stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the bus stop shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The begin position on the lane (the lower position on the lane) in meters"); - - myTagProperties[currentTag].addAttribute(attrProperty); - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_LINES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_PERSON_CAPACITY, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Meant to be the names of the bus lines that stop at this bus stop. This is only used for visualization purposes", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_ACCESS; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_ACCESS, SUMO_TAG_BUS_STOP); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the stop access shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane (the lower position on the lane) in meters", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The walking length of the access in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - } - currentTag = SUMO_TAG_CONTAINER_STOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CONTAINERSTOP, SUMO_TAG_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of container stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the container stop shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The begin position on the lane (the lower position on the lane) in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_LINES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - } - currentTag = SUMO_TAG_CHARGING_STATION; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_CHARGINGSTATION, SUMO_TAG_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of charging station"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Lane of the charging station location"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "Begin position in the specified lane"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "End position in the specified lane"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_CHARGINGPOWER, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Charging power in W", - "22000.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EFFICIENCY, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_RANGE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Charging efficiency [0,1]", - "0.95"); - attrProperty.setRange(0, 1); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CHARGEINTRANSIT, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Enable or disable charge in transit, i.e. vehicle must or must not to stop for charging", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CHARGEDELAY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Time delay after the vehicles has reached / stopped on the charging station, before the energy transfer (charging) begins", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_PARKING_AREA; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_STOPPINGPLACE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKSTARTENDPOS, ICON_PARKINGAREA, SUMO_TAG_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of ParkingArea"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the Parking Area shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The begin position on the lane (the lower position on the lane) in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROADSIDE_CAPACITY, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - " The number of parking spaces for road-side parking", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ONROAD, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "If set, vehicles will park on the road lane and thereby reducing capacity", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The width of the road-side parking spaces", - "3.20"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The length of the road-side parking spaces. By default (endPos - startPos) / roadsideCapacity"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ANGLE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - } - currentTag = SUMO_TAG_PARKING_SPACE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_MASKXYZPOSITION | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_PARKINGSPACE, SUMO_TAG_PARKING_AREA); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_POSITION | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y - "The x-y-z position of the parking vehicle on the plane"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The width of the road-side parking spaces", - "3.20"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The length of the road-side parking spaces", - "5.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ANGLE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The angle of the road-side parking spaces relative to the lane angle, positive means clockwise", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - } - currentTag = SUMO_TAG_E1DETECTOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E1, SUMO_TAG_LANE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of E1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters. The position must be a value between -1*lane's length and the lane's length"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The aggregation period the values the detector collects shall be summed up", - "900.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The path to the output file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Space separated list of vehicle type ids to consider"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - } - currentTag = SUMO_TAG_E2DETECTOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E2, SUMO_TAG_LANE); - // set "file" as deprecated attribute - myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of E2"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The length of the detector in meters", - "10.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The aggregation period the values the detector collects shall be summed up", - "900.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The path to the output file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Space separated list of vehicle type ids to consider"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - } - currentTag = SUMO_TAG_E2DETECTOR_MULTILANE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SYNONYM | TAGPROPERTY_BLOCKMOVEMENT, ICON_E2, SUMO_TAG_LANE, SUMO_TAG_E2DETECTOR); - // set "file" as deprecated attribute - myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_CONT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Multilane E2"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_SECUENCIAL | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The list of secuencial lane ids in which the detector shall be laid on"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The end position on the lane the detector shall be laid on in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The aggregation period the values the detector collects shall be summed up", - "900.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The path to the output file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Space separated list of vehicle type ids to consider"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_JAM_DIST_THRESHOLD, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - } - currentTag = SUMO_TAG_E3DETECTOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MINIMUMCHILDREN | TAGPROPERTY_AUTOMATICSORTING, ICON_E3); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of E3"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The aggregation period the values the detector collects shall be summed up", - "900.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The path to the output file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Space separated list of vehicle type ids to consider"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_HALTING_SPEED_THRESHOLD, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - } - currentTag = SUMO_TAG_DET_ENTRY; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_E3ENTRY, SUMO_TAG_E3DETECTOR); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - } - currentTag = SUMO_TAG_DET_EXIT; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_REPARENT | TAGPROPERTY_BLOCKMOVEMENT, ICON_E3EXIT, SUMO_TAG_E3DETECTOR); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - } - currentTag = SUMO_TAG_INSTANT_INDUCTION_LOOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL | TAGTYPE_DETECTOR, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_E1INSTANT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Instant Induction Loop (E1Instant)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the lane the detector shall be laid on. The lane must be a part of the network used"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the lane the detector shall be laid on in meters. The position must be a value between -1*lane's length and the lane's length"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The path to the output file"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Space separated list of vehicle type ids to consider"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - } - currentTag = SUMO_TAG_VSS; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_DIALOG, ICON_VARIABLESPEEDSIGN); - // set "file" as deprecated attribute - myTagProperties[currentTag].addDeprecatedAttribute(SUMO_ATTR_FILE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The id of Variable Speed Signal"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_LANES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "list of lanes of Variable Speed Sign"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_STEP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_VSSSTEP, SUMO_TAG_VSS); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_TIME, - ATTRPROPERTY_SUMOTIME, - "Time"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Speed", - "13.89"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_CALIBRATOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_DIALOG | TAGPROPERTY_CENTERAFTERCREATION, ICON_CALIBRATOR); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Calibrator"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of edge in the simulation network"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The position of the calibrator on the specified lane", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The aggregation interval in which to calibrate the flows. Default is step-length", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROUTEPROBE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The id of the routeProbe element from which to determine the route distribution for generated vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_OUTPUT, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The output file for writing calibrator information or NULL"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_LANECALIBRATOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_SYNONYM | TAGPROPERTY_DIALOG | TAGPROPERTY_CENTERAFTERCREATION, ICON_CALIBRATOR, SUMO_TAG_NOTHING, SUMO_TAG_CALIBRATOR); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Calibrator"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of lane in the simulation network"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The position of the calibrator on the specified lane", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The aggregation interval in which to calibrate the flows. Default is step-length", - "100.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROUTEPROBE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The id of the routeProbe element from which to determine the route distribution for generated vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_OUTPUT, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The output file for writing calibrator information or NULL"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_FLOW_CALIBRATOR; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_FLOW, SUMO_TAG_CALIBRATOR); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the vehicle type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROUTE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the route the vehicle shall drive along"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common vehicle attributes - fillCommonVehicleAttributes(currentTag); - - attrProperty = AttributeProperties(SUMO_ATTR_BEGIN, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "First " + toString(currentTag) + " departure time", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_END, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "End of departure interval", - "3600.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VEHSPERHOUR, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_ACTIVATABLE, - "Number of " + toString(currentTag) + "s per hour, equally spaced"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEED, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_ACTIVATABLE, - "Speed of " + toString(currentTag) + "s"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_REROUTER; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_DIALOG | TAGPROPERTY_WRITECHILDRENSEPARATE, ICON_REROUTER); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Rerouter"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EDGES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "An edge id or a list of edge ids where vehicles shall be rerouted"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The path to the definition file (alternatively, the intervals may defined as children of the rerouter)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_PROBABILITY | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The probability for vehicle rerouting (0-1)", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HALTING_TIME_THRESHOLD, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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 = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The list of vehicle types that shall be affected by this rerouter (empty to affect all types)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_OFF, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Whether the router should be inactive initially (and switched on in the gui)", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_INTERVAL; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_REROUTERINTERVAL, SUMO_TAG_REROUTER); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_BEGIN, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Begin", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_END, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "End", - "3600.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_CLOSING_REROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_CLOSINGREROUTE, SUMO_TAG_INTERVAL); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "Edge ID"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES | ATTRPROPERTY_OPTIONAL, - "allowed vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES | ATTRPROPERTY_OPTIONAL, - "disallowed vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_CLOSING_LANE_REROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_CLOSINGLANEREROUTE, SUMO_TAG_INTERVAL); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "Lane ID"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES | ATTRPROPERTY_OPTIONAL, - "allowed vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DISALLOW, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_VCLASSES | ATTRPROPERTY_OPTIONAL, - "disallowed vehicles"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_DEST_PROB_REROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_DESTPROBREROUTE, SUMO_TAG_INTERVAL); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "Edge ID"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "SUMO Probability", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_PARKING_ZONE_REROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_PARKINGZONEREROUTE, SUMO_TAG_INTERVAL); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_PARKING, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM, - "ParkingArea ID"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "SUMO Probability", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VISIBLE, - ATTRPROPERTY_BOOL | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Enable or disable visibility for parking area reroutes", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_ROUTE_PROB_REROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_PARENT, ICON_ROUTEPROBREROUTE, SUMO_TAG_INTERVAL); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ROUTE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "Route"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "SUMO Probability", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_ROUTEPROBE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_CENTERAFTERCREATION, ICON_ROUTEPROBE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of RouteProbe"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of an edge in the simulation network"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FREQUENCY, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The frequency in which to report the distribution", - "3600"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The file for generated output"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BEGIN, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The time at which to start generating output", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_VAPORIZER; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_ADDITIONAL, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_CENTERAFTERCREATION, ICON_VAPORIZER); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Edge in which vaporizer is placed"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BEGIN, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Start Time", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_END, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "End Time", - "3600.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NAME, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Name of " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_TAZ; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_BLOCKSHAPE | TAGPROPERTY_AUTOMATICSORTING, ICON_TAZ); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the TAZ"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The shape of the TAZ"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The RGBA color with which the TAZ shall be displayed", - "red"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_TAZSOURCE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_PARENT, ICON_TAZEDGE, SUMO_TAG_TAZ); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of edge in the simulation network"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WEIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Depart weight associated to this Edge", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_TAZSINK; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_TAZ, TAGPROPERTY_PARENT, ICON_TAZEDGE, SUMO_TAG_TAZ); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_SYNONYM | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of edge in the simulation network"); - attrProperty.setSynonym(SUMO_ATTR_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WEIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Arrival weight associated to this Edget", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } -} - - -void -GNEAttributeCarrier::fillShapes() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill shape ACs - SumoXMLTag currentTag = SUMO_TAG_POLY; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_BLOCKSHAPE | TAGPROPERTY_CLOSESHAPE | TAGPROPERTY_GEOSHAPE, ICON_LOCATEPOLY /* temporal */); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the polygon"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE, - "The shape of the polygon"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The RGBA color with which the polygon shall be displayed", - "red"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FILL, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "An information whether the polygon shall be filled", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LINEWIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The default line width for drawing an unfilled polygon", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LAYER, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The layer in which the polygon lies", - toString(Shape::DEFAULT_LAYER)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A typename for the polygon", - toString(Shape::DEFAULT_TYPE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A bitmap to use for rendering this polygon", - toString(Shape::DEFAULT_IMG_FILE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Enable or disable use image file as a relative path", - toString(Shape::DEFAULT_RELATIVEPATH)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ANGLE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Angle of rendered image in degree", - toString(Shape::DEFAULT_ANGLE)); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_POI; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_RTREE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT | TAGPROPERTY_MASKXYZPOSITION | TAGPROPERTY_GEOPOSITION, ICON_LOCATEPOI /* temporal */); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_STRING | ATTRPROPERTY_POSITION | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, // virtual attribute from the combination of the actually attributes SUMO_ATTR_X, SUMO_ATTR_Y - "The position in view"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The color with which the " + toString(currentTag) + " shall be displayed", - "red"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A typename for the " + toString(currentTag), - toString(Shape::DEFAULT_TYPE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LAYER, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The layer of the " + toString(currentTag) + " for drawing and selecting", - toString(Shape::DEFAULT_LAYER_POI)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Width of rendered image in meters", - toString(Shape::DEFAULT_IMG_WIDTH)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HEIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Height of rendered image in meters", - toString(Shape::DEFAULT_IMG_HEIGHT)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A bitmap to use for rendering this " + toString(currentTag), - toString(Shape::DEFAULT_IMG_FILE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Enable or disable use image file as a relative path", - toString(Shape::DEFAULT_RELATIVEPATH)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ANGLE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Angle of rendered image in degree", - toString(Shape::DEFAULT_ANGLE)); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_POILANE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_SHAPE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_BLOCKMOVEMENT, ICON_LOCATEPOI /* temporal */); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of the lane at which the " + toString(currentTag) + " is located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The position on the named lane or in the net in meters at which the " + toString(currentTag) + " is located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_POSITION_LAT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The lateral offset on the named lane at which the " + toString(currentTag) + " is located at", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The color with which the " + toString(currentTag) + " shall be displayed", - "red"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A typename for the " + toString(currentTag), - toString(Shape::DEFAULT_TYPE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LAYER, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The layer of the " + toString(currentTag) + " for drawing and selecting", - toString(Shape::DEFAULT_LAYER_POI)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Width of rendered image in meters", - toString(Shape::DEFAULT_IMG_WIDTH)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HEIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Height of rendered image in meters", - toString(Shape::DEFAULT_IMG_HEIGHT)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A bitmap to use for rendering this " + toString(currentTag), - toString(Shape::DEFAULT_IMG_FILE)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_RELATIVEPATH, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Enable or disable use image file as a relative path", - toString(Shape::DEFAULT_RELATIVEPATH)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ANGLE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_ANGLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Angle of rendered image in degree", - toString(Shape::DEFAULT_ANGLE)); - myTagProperties[currentTag].addAttribute(attrProperty); - } -} - - -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 AttributeProperties - AttributeProperties attrProperty; - - // fill demand elements - SumoXMLTag currentTag = SUMO_TAG_ROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_ROUTE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT, ICON_ROUTE); - - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of Route"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EDGES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The edges the vehicle shall drive along, given as their ids, separated using spaces"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "This route's color", - "yellow"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_EMBEDDEDROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_ROUTE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT, ICON_ROUTE); - - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The edges the vehicle shall drive along, given as their ids, separated using spaces"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "This route's color", - "yellow"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_VTYPE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VTYPE, 0, ICON_VTYPE); - - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of VehicleType"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VCLASS, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "An abstract vehicle class", - "passenger"); - attrProperty.setDiscreteValues(vClassesVehicles); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "This vehicle type's color", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "The vehicle's netto-length (length) [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MINGAP, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "Empty space after leader [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MAXSPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "The vehicle's maximum velocity [m/s]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEEDFACTOR, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The vehicles expected multiplicator for lane speed limits"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SPEEDDEV, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The deviation of the speedFactor"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EMISSIONCLASS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "An abstract emission class"); - attrProperty.setDiscreteValues(PollutantsInterface::getAllClassesStr()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_GUISHAPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "How this vehicle is rendered"); - attrProperty.setDiscreteValues(SumoVehicleShapeStrings.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The vehicle's width [m] (only used for drawing)", - "1.8"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_HEIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The vehicle's height [m] (only used for drawing)", - "1.5"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Image file for rendering vehicles of this type (should be grayscale to allow functional coloring)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LANE_CHANGE_MODEL, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The model used for changing lanes", - "default"); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::LaneChangeModels.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CAR_FOLLOW_MODEL, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The model used for car following", - "Krauss"); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::CarFollowModels.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PERSON_CAPACITY, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The number of persons (excluding an autonomous driver) the vehicle can transport"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_CAPACITY, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The number of containers the vehicle can transport"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BOARDING_DURATION, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The time required by a person to board the vehicle", - "0.50"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LOADING_DURATION, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The time required to load a container onto the vehicle", - "90.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LATALIGNMENT, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The preferred lateral alignment when using the sublane-model", - "center"); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::LateralAlignments.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MINGAP_LAT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The minimum lateral gap at a speed difference of 50km/h when using the sublane-model", - "0.12"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MAXSPEED_LAT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The maximum lateral speed when using the sublane-model", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ACTIONSTEPLENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The probability when being added to a distribution without an explicit probability", - toString(DEFAULT_VEH_PROB)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_OSGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "3D model file for this class", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CARRIAGE_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Carriage lengths"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LOCOMOTIVE_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Locomotive lengths"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CARRIAGE_GAP, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "GAP between carriages", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill VType Car Following Model Values (implemented in a separated function to improve code legibility) - fillCarFollowingModelAttributes(currentTag); - - // fill VType Junction Model Parameters (implemented in a separated function to improve code legibility) - fillJunctionModelAttributes(currentTag); - - // fill VType Lane Change Model Parameters (implemented in a separated function to improve code legibility) - fillLaneChangingModelAttributes(currentTag); - } - currentTag = SUMO_TAG_PTYPE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VTYPE, TAGPROPERTY_SYNONYM, ICON_PTYPE, SUMO_TAG_NOTHING, SUMO_TAG_VTYPE); - - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The id of PersonType"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VCLASS, - ATTRPROPERTY_VCLASS | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "An abstract person class", - "pedestrian"); - attrProperty.setDiscreteValues(vClassesPersons); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "This person type's color", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_WIDTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "The person's width [m] (only used for drawing)"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LENGTH, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "The person's netto-length (length) [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MINGAP, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "Empty space after leader [m]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MAXSPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUEMUTABLE | ATTRPROPERTY_OPTIONAL, - "The person's maximum velocity [m/s]"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "This value causes persons to violate a red light if the duration of the red phase is lower than the given threshold.", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMGFILE, - ATTRPROPERTY_STRING | ATTRPROPERTY_FILENAME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Image file for rendering persons of this type (should be grayscale to allow functional coloring)"); - myTagProperties[currentTag].addAttribute(attrProperty); - } -} - - -void -GNEAttributeCarrier::fillVehicleElements() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill vehicle ACs - SumoXMLTag currentTag = SUMO_TAG_VEHICLE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_VEHICLE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the vehicle type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROUTE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the route the " + toString(currentTag) + " shall drive along"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // add common attributes - fillCommonVehicleAttributes(currentTag); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPART, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The time step at which the " + toString(currentTag) + " shall enter the network", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_ROUTEFLOW; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_SYNONYM, ICON_ROUTEFLOW, SUMO_TAG_NOTHING, SUMO_TAG_FLOW); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ROUTE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the route the " + toString(currentTag) + " shall drive along"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // add common attributes - fillCommonVehicleAttributes(currentTag); - - // add flow attributes - fillCommonFlowAttributes(currentTag); - } - currentTag = SUMO_TAG_TRIP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_TRIP); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of " + toString(currentTag) + "s that will be generated using this trip definition"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " ends at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VIA, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of intermediate edge ids which shall be part of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - // add common attributes - fillCommonVehicleAttributes(currentTag); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPART, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The departure time of the (first) " + toString(currentTag) + " which is generated using this " + toString(currentTag) + " definition", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_FLOW; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_FLOW); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag), - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " ends at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VIA, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - } - /* currently disabled. See #5259 - currentTag = SUMO_TAG_TRIP_TAZ; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_VEHICLE, TAGPROPERTY_DRAWABLE, ICON_TRIP); - } - */ -} - - -void -GNEAttributeCarrier::fillStopElements() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill stops ACs - SumoXMLTag currentTag = SUMO_TAG_STOP_LANE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_MASKSTARTENDPOS | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the stop shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The begin position on the lane (the lower position on the lane) in meters", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } - currentTag = SUMO_TAG_STOP_BUSSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "BusStop associated with this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } - currentTag = SUMO_TAG_STOP_CONTAINERSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "ContainerStop associated with this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } - currentTag = SUMO_TAG_STOP_CHARGINGSTATION; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_CHARGING_STATION, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "ChargingStation associated with this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } - currentTag = SUMO_TAG_STOP_PARKINGAREA; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_STOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_PARKING_AREA, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "ParkingArea associated with this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } -} - - -void -GNEAttributeCarrier::fillPersonElements() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill vehicle ACs - SumoXMLTag currentTag = SUMO_TAG_PERSON; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSON, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_PERSON); - - // add flow attributes - fillCommonPersonAttributes(currentTag); - - // set specific attribute depart (note: Persons doesn't support triggered and containerTriggered values) - attrProperty = AttributeProperties(SUMO_ATTR_DEPART, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The time step at which the " + toString(currentTag) + " shall enter the network", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - } - currentTag = SUMO_TAG_PERSONFLOW; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSON, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE, ICON_PERSONFLOW); - - // add flow attributes - fillCommonPersonAttributes(currentTag); - - // add flow attributes - fillCommonFlowAttributes(currentTag); - } - currentTag = SUMO_TAG_PERSONTRIP_FROMTO; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_PERSONTRIP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_PERSONTRIP_FROMTO); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " ends at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of possible vehicle types to take"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MODES, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of possible traffic modes. Walking is always possible regardless of this value"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "arrival position on the destination edge", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_PERSONTRIP_BUSSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_PERSONTRIP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_PERSONTRIP_BUSSTOP); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VTYPES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of possible vehicle types to take"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_MODES, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of possible traffic modes. Walking is always possible regardless of this value"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_RIDE_FROMTO; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_RIDE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_RIDE_FROMTO); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " ends at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LINES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC, - "list of vehicle alternatives to take for the " + toString(currentTag), - "ANY"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "arrival position on the destination edge", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_RIDE_BUSSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_RIDE, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_RIDE_BUSSTOP); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the edge the " + toString(currentTag) + " starts at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LINES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC, - "list of vehicle alternatives to take for the ride", - "ANY"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_WALK_EDGES; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_WALK, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_WALK_EDGES); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_EDGES, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "id of the edges to walk"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Arrival position on the destination edge", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - - currentTag = SUMO_TAG_WALK_ROUTE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_WALK, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_WALK_ROUTE); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_ROUTE, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the route to walk"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Arrival position on the destination edge", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - currentTag = SUMO_TAG_WALK_FROMTO; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_WALK, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_WALK_FROMTO); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the start edge"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TO, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the destination edge"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VIA, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Ids of the intermediate edges"); - myTagProperties[currentTag].addAttribute(attrProperty); - - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Arrival position on the destination edge", - "-1"); - myTagProperties[currentTag].addAttribute(attrProperty); - } - - currentTag = SUMO_TAG_WALK_BUSSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONPLAN | TAGTYPE_WALK, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_PARENT | TAGPROPERTY_SORTINGCHILDREN, ICON_WALK_BUSSTOP); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_FROM, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the start edge"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "Id of the destination " + toString(SUMO_TAG_BUS_STOP)); - myTagProperties[currentTag].addAttribute(attrProperty); - } -} - - -void -GNEAttributeCarrier::fillPersonStopElements() { - // declare empty AttributeProperties - AttributeProperties attrProperty; - // fill vehicle ACs - SumoXMLTag currentTag = SUMO_TAG_PERSONSTOP_LANE; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONSTOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_MASKSTARTENDPOS | TAGPROPERTY_SORTINGCHILDREN | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_LANE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The name of the lane the stop shall be located at"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_STARTPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The begin position on the lane (the lower position on the lane) in meters"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ENDPOS, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_FRIENDLY_POS, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "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); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } - currentTag = SUMO_TAG_PERSONSTOP_BUSSTOP; - { - // set values of tag - myTagProperties[currentTag] = TagProperties(currentTag, TAGTYPE_DEMANDELEMENT | TAGTYPE_PERSONSTOP, TAGPROPERTY_DRAWABLE | TAGPROPERTY_SELECTABLE | TAGPROPERTY_SORTINGCHILDREN | TAGPROPERTY_NOPARAMETERS, ICON_STOPELEMENT); - // set values of attributes - attrProperty = AttributeProperties(SUMO_ATTR_BUS_STOP, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "BusStop associated with this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - - // fill common stop attributes - fillCommonStopAttributes(currentTag); - } -} - - -void -GNEAttributeCarrier::fillCommonVehicleAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC, - "This " + toString(currentTag) + "'s color", - "yellow"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPARTLANE, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The lane on which the " + toString(currentTag) + " shall be inserted", - "first"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */, - "The position at which the " + toString(currentTag) + " shall enter the net", - "base"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPARTSPEED, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */, - "The speed with which the " + toString(currentTag) + " shall enter the network", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALLANE, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */, - "The lane at which the " + toString(currentTag) + " shall leave the network", - "current"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */, - "The position at which the " + toString(currentTag) + " shall leave the network", - "max"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALSPEED, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL /* ATTRPROPERTY_MULTIDISCRETE (Currently disabled) */, - "The speed with which the " + toString(currentTag) + " shall leave the network", - "current"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LINE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "A string specifying the id of a public transport line which can be used when specifying person rides"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PERSON_NUMBER, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The number of occupied seats when the " + toString(currentTag) + " is inserted", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_NUMBER, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The number of occupied container places when the " + toString(currentTag) + " is inserted", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS_LAT, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The lateral position on the departure lane at which the " + toString(currentTag) + " shall enter the net", - "center"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ARRIVALPOS_LAT, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The lateral position on the arrival lane at which the " + toString(currentTag) + " shall arrive", - "center"); - myTagProperties[currentTag].addAttribute(attrProperty); -} - - -void -GNEAttributeCarrier::fillCommonFlowAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_BEGIN, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC, - "First " + toString(currentTag) + " departure time", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_END, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_FLOWDEFINITION, - "End of departure interval", - "3600.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_NUMBER, - ATTRPROPERTY_INT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_FLOWDEFINITION, - "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", - "1800"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_VEHSPERHOUR, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_FLOWDEFINITION, - "Number of " + toString(currentTag) + "s per hour, equally spaced (not together with period or probability)", - "1800"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PERIOD, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_FLOWDEFINITION, - "Insert equally spaced " + toString(currentTag) + "s at that period (not together with vehsPerHour or probability)", - "2"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PROB, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_FLOWDEFINITION, - "probability for emitting a " + toString(currentTag) + " each second (not together with vehsPerHour or period)", - "0.5"); - myTagProperties[currentTag].addAttribute(attrProperty); -} - - -void -GNEAttributeCarrier::fillCarFollowingModelAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_ACCEL, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The acceleration ability of vehicles of this type [m/s^2]", - "2.60"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DECEL, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "The deceleration ability of vehicles of this type [m/s^2]", - "4.50"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_APPARENTDECEL, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The apparent deceleration of the vehicle as used by the standard model [m/s^2]", - "4.50"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EMERGENCYDECEL, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The maximal physically possible deceleration for the vehicle [m/s^2]", - "4.50"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_SIGMA, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_RANGE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Car-following model parameter", - "0.50"); - attrProperty.setRange(0, 1); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TAU, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Car-following model parameter", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TMP1, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "SKRAUSSX parameter 1", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TMP2, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "SKRAUSSX parameter 2", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TMP3, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "SKRAUSSX parameter 3", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TMP4, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "SKRAUSSX parameter 4", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TMP5, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "SKRAUSSX parameter 5", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_PWAGNER2009_TAULAST, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Peter Wagner 2009 parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_PWAGNER2009_APPROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Peter Wagner 2009 parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_FACTOR, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "IDMM parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_IDMM_ADAPT_TIME, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "IDMM parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_WIEDEMANN_SECURITY, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Wiedemann parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_WIEDEMANN_ESTIMATION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Wiedemann parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLLISION_MINGAP_FACTOR, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "MinGap factor parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_K, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "K parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - - attrProperty = AttributeProperties(SUMO_ATTR_CF_KERNER_PHI, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Kerner Phi parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_IDM_DELTA, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "IDM Delta parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CF_IDM_STEPPING, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "IDM Stepping parameter", - ""); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TRAIN_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DISCRETE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Train Types", - "NGT400"); - attrProperty.setDiscreteValues(SUMOXMLDefinitions::TrainTypes.getStrings()); - myTagProperties[currentTag].addAttribute(attrProperty); -} - - -void -GNEAttributeCarrier::fillJunctionModelAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - attrProperty = AttributeProperties(SUMO_ATTR_JM_CROSSING_GAP, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Minimum distance to pedestrians that are walking towards the conflict point with the ego vehicle.", - "10"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_JM_IGNORE_KEEPCLEAR_TIME, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_YELLOW_TIME, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_JM_DRIVE_AFTER_RED_TIME, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_JM_DRIVE_RED_SPEED, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "This value causes vehicles affected by jmDriveAfterRedTime to slow down when violating a red light.", - "0.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_PROB, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_JM_IGNORE_FOE_SPEED, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_JM_SIGMA_MINOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "This value configures driving imperfection (dawdling) while passing a minor link.", - "0.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_JM_TIMEGAP_MINOR, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "This value defines the minimum time gap when passing ahead of a prioritized vehicle. ", - "1"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_IMPATIENCE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Willingess of drivers to impede vehicles with higher priority", - "0.0"); - myTagProperties[currentTag].addAttribute(attrProperty); -} - - -void -GNEAttributeCarrier::fillLaneChangingModelAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_STRATEGIC_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The eagerness for performing strategic lane changing. Higher values result in earlier lane-changing.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_COOPERATIVE_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The willingness for performing cooperative lane changing. Lower values result in reduced cooperation.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_SPEEDGAIN_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The eagerness for performing lane changing to gain speed. Higher values result in more lane-changing.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_KEEPRIGHT_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The eagerness for following the obligation to keep right. Higher values result in earlier lane-changing.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_SUBLANE_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_LCA_OPPOSITE_PARAM, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The eagerness for overtaking through the opposite-direction lane. Higher values result in more lane-changing.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_PUSHY, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Willingness to encroach laterally on other drivers.", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_PUSHYGAP, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Minimum lateral gap when encroaching laterally on other drives (alternative way to define lcPushy)", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_ASSERTIVE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Willingness to accept lower front and rear gaps on the target lane.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_IMPATIENCE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Dynamic factor for modifying lcAssertive and lcPushy.", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_TIME_TO_IMPATIENCE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Time to reach maximum impatience (of 1). Impatience grows whenever a lane-change manoeuvre is blocked.", - "infinity"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_ACCEL_LAT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Maximum lateral acceleration per second.", - "1.0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_LOOKAHEADLEFT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_LCA_SPEEDGAINRIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_LCA_MAXSPEEDLATSTANDING, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Upper bound on lateral speed when standing.", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_MAXSPEEDLATFACTOR, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "Upper bound on lateral speed while moving computed as lcMaxSpeedLatStanding + lcMaxSpeedLatFactor * getSpeed()", - "1.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_LCA_TURN_ALIGNMENT_DISTANCE, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_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 = AttributeProperties(SUMO_ATTR_LCA_OVERTAKE_RIGHT, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "The probability for violating rules gainst overtaking on the right.", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - - /* - attrProperty = AttributeProperties(SUMO_ATTR_LCA_EXPERIMENTAL1, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_EXTENDED, - "XXXXX", - "0.00"); - myTagProperties[currentTag].addAttribute(attrProperty); - */ -} - - -void -GNEAttributeCarrier::fillCommonPersonAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE, - "The name of the " + toString(currentTag)); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_UNIQUE | ATTRPROPERTY_UPDATEGEOMETRY, - "The id of the " + toString(currentTag) + " type to use for this " + toString(currentTag) + - DEFAULT_VTYPE_ID); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_COLOR, - ATTRPROPERTY_STRING | ATTRPROPERTY_COLOR | ATTRPROPERTY_DEFAULTVALUESTATIC, - "This " + toString(currentTag) + "'s color", - "yellow"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_DEPARTPOS, - ATTRPROPERTY_COMPLEX | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL | ATTRPROPERTY_UPDATEGEOMETRY, - "The position at which the " + toString(currentTag) + " shall enter the net", - "base"); - myTagProperties[currentTag].addAttribute(attrProperty); -} - - -void -GNEAttributeCarrier::fillCommonStopAttributes(SumoXMLTag currentTag) { - // declare empty AttributeProperties - AttributeProperties attrProperty; - - attrProperty = AttributeProperties(SUMO_ATTR_DURATION, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "Minimum duration for stopping", - "60"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_UNTIL, - ATTRPROPERTY_FLOAT | ATTRPROPERTY_POSITIVE | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "The time step at which the route continues", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EXTENSION, - ATTRPROPERTY_SUMOTIME | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_DEFAULTVALUESTATIC, - "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 = AttributeProperties(SUMO_ATTR_INDEX, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Where to insert the stop in the vehicle's list of stops", - "end"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_TRIGGERED, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Whether a person may end the stop", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of persons that must board the vehicle before it may continue"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_CONTAINER_TRIGGERED, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Whether a container may end the stop", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_EXPECTED_CONTAINERS, - ATTRPROPERTY_STRING | ATTRPROPERTY_LIST | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "List of containers that must be loaded onto the vehicle before it may continue"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_PARKING, - ATTRPROPERTY_BOOL | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_ACTIVATABLE | ATTRPROPERTY_OPTIONAL, - "whether the vehicle stops on the road or beside ", - "0"); - myTagProperties[currentTag].addAttribute(attrProperty); - - attrProperty = AttributeProperties(SUMO_ATTR_ACTTYPE, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Activity displayed for stopped person in GUI and output files ", - "waiting"); - myTagProperties[currentTag].addAttribute(attrProperty); - - /** Attribute currently disabled. It will be implemented in #6011 - attrProperty = AttributeProperties(SUMO_ATTR_TRIP_ID, - ATTRPROPERTY_STRING | ATTRPROPERTY_DEFAULTVALUESTATIC | ATTRPROPERTY_OPTIONAL, - "Value used for trips that uses this stop"); - myTagProperties[currentTag].addAttribute(attrProperty); - */ -} - - -bool -GNEAttributeCarrier::checkParsedAttribute(const TagProperties& tagProperties, - const AttributeProperties& 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 (tagProperties.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 (tagProperties.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 name values - if ((attribute == SUMO_ATTR_NAME) && !SUMOXMLDefinitions::isValidAttribute(parsedAttribute)) { - errorFormat = "name contains invalid characters; "; - } - // 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 + tagProperties.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 TagProperties& tagProperties, - const AttributeProperties& 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; " + tagProperties.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; " + tagProperties.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; " + tagProperties.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; " + tagProperties.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; " + tagProperties.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.5.0+dfsg1/src/netedit/GNEAttributeCarrier.h sumo-1.6.0+dfsg1/src/netedit/GNEAttributeCarrier.h --- sumo-1.5.0+dfsg1/src/netedit/GNEAttributeCarrier.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEAttributeCarrier.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,883 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEAttributeCarrier.h -/// @author Jakob Erdmann -/// @date Mar 2011 -/// -// Abstract Base class for gui objects which carry attributes -/****************************************************************************/ -#ifndef GNEAttributeCarrier_h -#define GNEAttributeCarrier_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEReferenceCounter.h" -#include "GNEGeometry.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEUndoList; -class GNELane; -class GNEEdge; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEAttributeCarrier - * - * Abstract Base class for gui objects which carry attributes - * inherits from GNEReferenceCounter for convenience - */ -class GNEAttributeCarrier : public GNEReferenceCounter { - - /// @brief declare friend class - friend class GNEChange_Attribute; - friend class GNEChange_EnableAttribute; - -public: - - // @brief declare class TagProperties - class TagProperties; - - /// @brief struct with the tag Properties - enum AttrProperty { - ATTRPROPERTY_INT = 1 << 0, // Attribute is an integer (Including Zero) - ATTRPROPERTY_FLOAT = 1 << 1, // Attribute is a float - ATTRPROPERTY_SUMOTIME = 1 << 2, // Attribute is a SUMOTime - ATTRPROPERTY_BOOL = 1 << 3, // Attribute is boolean (0/1, true/false) - ATTRPROPERTY_STRING = 1 << 4, // Attribute is a string - ATTRPROPERTY_POSITION = 1 << 5, // Attribute is a position defined by doubles (x,y or x,y,z) - ATTRPROPERTY_COLOR = 1 << 6, // Attribute is a color defined by a specifically word (Red, green) or by a special format (XXX,YYY,ZZZ) - ATTRPROPERTY_VCLASS = 1 << 7, // Attribute is a VClass (passenger, bus, motorcicle...) - ATTRPROPERTY_POSITIVE = 1 << 8, // Attribute is positive (Including Zero) - ATTRPROPERTY_UNIQUE = 1 << 9, // Attribute is unique (cannot be edited in a selection of similar elements (ID, Position...) - ATTRPROPERTY_FILENAME = 1 << 10, // Attribute is a filename (string that cannot contains certain characters) - ATTRPROPERTY_DISCRETE = 1 << 11, // Attribute is discrete (only certain values are allowed) - ATTRPROPERTY_PROBABILITY = 1 << 12, // Attribute is probability (only allowed values between 0 and 1, including both) - ATTRPROPERTY_ANGLE = 1 << 13, // Attribute is an angle (only takes values between 0 and 360, including both, another value will be automatically reduced - ATTRPROPERTY_LIST = 1 << 14, // Attribute is a list of other elements separated by spaces - ATTRPROPERTY_SECUENCIAL = 1 << 15, // Attribute is a special sequence of elements (for example: secuencial lanes in Multi Lane E2 detectors) - ATTRPROPERTY_OPTIONAL = 1 << 16, // Attribute will not be written in XML file if current value is the same of his default Static/Mutable value - ATTRPROPERTY_DEFAULTVALUESTATIC = 1 << 17, // Attribute owns a static default value - ATTRPROPERTY_DEFAULTVALUEMUTABLE = 1 << 18, // Attribute owns a mutable default value (Default value depends of value of other attribute) - ATTRPROPERTY_VCLASSES = 1 << 19, // Attribute is a combination of VClasses (allow/disallow) - ATTRPROPERTY_SYNONYM = 1 << 20, // Attribute will be written with a different name in der XML - ATTRPROPERTY_RANGE = 1 << 21, // Attribute only accept a range of elements (example: Probability [0,1]) - ATTRPROPERTY_EXTENDED = 1 << 22, // Attribute is extended (in Frame will not be shown, but is editable in a Dialog, see VType attributes) - ATTRPROPERTY_UPDATEGEOMETRY = 1 << 23, // Attribute require update geometry at the end of function setAttribute(...) - ATTRPROPERTY_ACTIVATABLE = 1 << 24, // Attribute can be switch on/off using a checkbox in frame - ATTRPROPERTY_COMPLEX = 1 << 25, // Attribute is complex: Requiere a special function to check if the given value is valid - ATTRPROPERTY_FLOWDEFINITION = 1 << 26, // Attribute is part of a flow definition (Number, vehsPerHour...) - }; - - /// @brief struct with the attribute Properties - class AttributeProperties { - - public: - /// @brief default constructor - AttributeProperties(); - - /// @brief parameter constructor - AttributeProperties(const SumoXMLAttr attribute, const int attributeProperty, const std::string& definition, std::string defaultValue = ""); - - /// @brief destructor - ~AttributeProperties(); - - /// @brief check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float) - void checkAttributeIntegrity(); - - /// @brief set discrete values - void setDiscreteValues(const std::vector& discreteValues); - - /// @brief set synonim - void setSynonym(const SumoXMLAttr synonym); - - /// @brief set range - void setRange(const double minimum, const double maximum); - - /// @brief set tag property parent - void setTagPropertyParent(TagProperties* tagPropertyParent); - - /// @brief get XML Attribute - SumoXMLAttr getAttr() const; - - /// @brief get XML Attribute - const std::string& getAttrStr() const; - - /// @brief get reference to tagProperty parent - const TagProperties& getTagPropertyParent() const; - - /// @brief get position in list (used in frames for listing attributes with certain sort) - int getPositionListed() const; - - /// @brief get default value - const std::string& getDefinition() const; - - /// @brief get default value - const std::string& getDefaultValue() const; - - /// @brief return a description of attribute - std::string getDescription() const; - - /// @brief get discrete values - const std::vector& getDiscreteValues() const; - - /// @brief get tag synonym - SumoXMLAttr getAttrSynonym() const; - - /// @brief get minimum range - double getMinimumRange() const; - - /// @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 Attr correspond to an element that will be written in XML with another name - bool hasAttrSynonym() const; - - /// @brief return true if Attr correspond to an element that only accept a range of values - bool hasAttrRange() const; - - /// @brief return true if atribute is an integer - bool isInt() const; - - /// @brief return true if atribute is a float - bool isFloat() const; - - /// @brief return true if atribute is a SUMOTime - bool isSUMOTime() const; - - /// @brief return true if atribute is boolean - bool isBool() const; - - /// @brief return true if atribute is a string - bool isString() const; - - /// @brief return true if atribute is a position - bool isposition() const; - - /// @brief return true if atribute is a probability - bool isProbability() const; - - /// @brief return true if atribute is numerical (int or float) - bool isNumerical() const; - - /// @brief return true if atribute is positive - bool isPositive() const; - - /// @brief return true if atribute is a color - bool isColor() const; - - /// @brief return true if atribute is a filename - bool isFilename() const; - - /// @brief return true if atribute is a VehicleClass - bool isVClass() const; - - /// @brief return true if atribute is a VehicleClass - bool isSVCPermission() const; - - /// @brief return true if atribute is a list - bool isList() const; - - /// @brief return true if atribute is sequential - bool isSecuential() const; - - /// @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; - - /// @brief return true if atribute is a list of VClasses - bool isVClasses() const; - - /// @brief return true if atribute is extended - bool isExtended() const; - - /// @brief return true if atribute requires a update geometry in setAttribute(...) - bool requireUpdateGeometry() const; - - /// @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; - - private: - /// @brief XML Attribute - SumoXMLAttr myAttribute; - - /// @brief pointer to tagProperty parent - TagProperties* myTagPropertyParent; - - /// @brief string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls) - std::string myAttrStr; - - /// @brief Property of attribute - int myAttributeProperty; - - /// @brief text with a definition of attribute - std::string myDefinition; - - /// @brief default value (by default empty) - std::string myDefaultValue; - - /// @brief discrete values that can take this Attribute (by default empty) - std::vector myDiscreteValues; - - /// @brief Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) - SumoXMLAttr myAttrSynonym; - - /// @brief minimun Range - double myMinimumRange; - - /// @brief maxium Range - double myMaximumRange; - }; - - enum TagType { - TAGTYPE_NETELEMENT = 1 << 0, // Edges, Junctions, Lanes... - TAGTYPE_ADDITIONAL = 1 << 1, // Bus Stops, Charging Stations, Detectors... - TAGTYPE_SHAPE = 1 << 2, // POIs, Polygons - TAGTYPE_DEMANDELEMENT = 1 << 3, // Routes, Vehicles, Trips... - TAGTYPE_TAZ = 1 << 4, // Traffic Assignment Zones - TAGTYPE_STOPPINGPLACE = 1 << 5, // StoppingPlaces (BusStops, ChargingStations...) - TAGTYPE_DETECTOR = 1 << 6, // Detectors (E1, E2...) - TAGTYPE_VTYPE = 1 << 7, // Vehicle types (vType and pTye) - TAGTYPE_VEHICLE = 1 << 8, // Vehicles (Flows, trips...) - TAGTYPE_ROUTE = 1 << 9, // Routes and embedded routes - TAGTYPE_STOP = 1 << 10, // Stops - TAGTYPE_PERSON = 1 << 11, // Persons - TAGTYPE_PERSONPLAN = 1 << 12, // Person plans (Walks, rides, ...) - TAGTYPE_PERSONTRIP = 1 << 13, // Walks - TAGTYPE_WALK = 1 << 14, // Walks - TAGTYPE_RIDE = 1 << 15, // Rides - TAGTYPE_PERSONSTOP = 1 << 16, // Person stops - }; - - enum TAGProperty { - TAGPROPERTY_DRAWABLE = 1 << 0, // Element can be drawed in view - TAGPROPERTY_BLOCKMOVEMENT = 1 << 1, // Element can block their movement - TAGPROPERTY_BLOCKSHAPE = 1 << 2, // Element can block their shape - TAGPROPERTY_CLOSESHAPE = 1 << 3, // Element can close their shape - TAGPROPERTY_GEOPOSITION = 1 << 4, // Element's position can be defined using a GEO position - TAGPROPERTY_GEOSHAPE = 1 << 5, // Element's shape acn be defined using a GEO Shape - TAGPROPERTY_DIALOG = 1 << 6, // Element can be edited using a dialog (GNECalibratorDialog, GNERerouterDialog...) - TAGPROPERTY_PARENT = 1 << 7, // Element will be writed in XML as child of another element (E3Entry -> E3Detector...) - TAGPROPERTY_MINIMUMCHILDREN = 1 << 8, // Element will be only writed in XML if has a minimum number of children - TAGPROPERTY_REPARENT = 1 << 9, // Element can be reparent - TAGPROPERTY_SYNONYM = 1 << 10, // Element will be written with a different name in der XML - TAGPROPERTY_AUTOMATICSORTING = 1 << 11, // Element sort automatic their Children (used by Additionals) - TAGPROPERTY_SELECTABLE = 1 << 12, // Element is selectable - TAGPROPERTY_MASKSTARTENDPOS = 1 << 13, // Element mask attributes StartPos and EndPos as "length" (Only used in the appropiate GNEFrame) - TAGPROPERTY_MASKXYZPOSITION = 1 << 14, // Element mask attributes X, Y and Z as "Position" - TAGPROPERTY_WRITECHILDRENSEPARATE = 1 << 15, // Element writes their children in a separated filename - TAGPROPERTY_NOPARAMETERS = 1 << 16, // Element doesn't accept parameters "key1=value1|key2=value2|...|keyN=valueN" (by default all tags supports parameters) - TAGPROPERTY_RTREE = 1 << 17, // Element is placed in RTREE - TAGPROPERTY_SORTINGCHILDREN = 1 << 18, // Element can be sorted in their parent element manually (in ACHierarchy) - TAGPROPERTY_CENTERAFTERCREATION = 1 << 19, // Camera is moved after element creation - }; - - /// @brief struct with the attribute Properties - class TagProperties { - public: - /// @brief default constructor - TagProperties(); - - /// @brief parameter constructor - TagProperties(SumoXMLTag tag, int tagType, int tagProperty, GUIIcon icon, SumoXMLTag parentTag = SUMO_TAG_NOTHING, SumoXMLTag tagSynonym = SUMO_TAG_NOTHING); - - /// @brief destructor - ~TagProperties(); - - /// @brief get Tag vinculated with this attribute Property - SumoXMLTag getTag() const; - - /// @brief get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toString(...) - const std::string& getTagStr() const; - - /// @brief check Tag integrity (this include all their attributes) - void checkTagIntegrity() const; - - /// @brief add attribute (duplicated attributed aren't allowed) - void addAttribute(const AttributeProperties& attributeProperty); - - /// @brief add deprecated Attribute - void addDeprecatedAttribute(SumoXMLAttr attr); - - /// @brief get attribute (throw error if doesn't exist) - const AttributeProperties& getAttributeProperties(SumoXMLAttr attr) const; - - /// @brief get begin of attribute values (used for iterate) - std::vector::const_iterator begin() const; - - /// @brief get end of attribute values (used for iterate) - std::vector::const_iterator end() const; - - /// @brief get number of attributes - int getNumberOfAttributes() const; - - /// @brief return the default value of the attribute of an element - const std::string& getDefaultValue(SumoXMLAttr attr) const; - - /// @brief get GUI icon associated to this Tag - GUIIcon getGUIIcon() const; - - /// @brief if Tag owns a parent, return parent tag - SumoXMLTag getParentTag() const; - - /// @brief get tag synonym - SumoXMLTag getTagSynonym() const; - - /// @brief check if current TagProperties owns the attribute attr - bool hasAttribute(SumoXMLAttr attr) const; - - /// @brief return true if tag correspond to a netElement - bool isNetElement() const; - - /// @brief return true if tag correspond to an additional - bool isAdditional() const; - - /// @brief return true if tag correspond to a shape - bool isShape() const; - - /// @brief return true if tag correspond to a TAZ - bool isTAZ() const; - - /// @brief return true if tag correspond to a demand element - bool isDemandElement() const; - - /// @brief return true if tag correspond to a detector (Only used to group all stoppingPlaces in the output XML) - bool isStoppingPlace() const; - - /// @brief return true if tag correspond to a shape (Only used to group all detectors in the XML) - bool isDetector() const; - - /// @brief return true if tag correspond to a vehicle type element - bool isVehicleType() const; - - /// @brief return true if tag correspond to a vehicle element - bool isVehicle() const; - - /// @brief return true if tag correspond to a route element - bool isRoute() const; - - /// @brief return true if tag correspond to a stop element - bool isStop() const; - - /// @brief return true if tag correspond to a person element - bool isPerson() const; - - /// @brief return true if tag correspond to a person plan - bool isPersonPlan() const; - - /// @brief return true if tag correspond to a person trip - bool isPersonTrip() const; - - /// @brief return true if tag correspond to a walk element - bool isWalk() const; - - /// @brief return true if tag correspond to a ride element - bool isRide() const; - - /// @brief return true if tag correspond to a person stop element - bool isPersonStop() 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; - - /// @brief return true if tag correspond to an element that can block their movement - bool canBlockMovement() const; - - /// @brief return true if tag correspond to an element that can block their shape - bool canBlockShape() const; - - /// @brief return true if tag correspond to an element that can close their shape - bool canCloseShape() const; - - /// @brief return true if tag correspond to an element that can use a geo position - bool hasGEOPosition() const; - - /// @brief return true if tag correspond to an element that can use a geo shape - bool hasGEOShape() const; - - /// @brief return true if tag correspond to an element that can had another element as parent - bool hasParent() const; - - /// @brief return true if tag correspond to an element that will be written in XML with another tag - bool hasTagSynonym() const; - - /// @brief return true if tag correspond to an element that can be edited using a dialog - bool hasDialog() const; - - /// @brief return true if tag correspond to an element that only have a limited number of children - bool hasMinimumNumberOfChildren() const; - - /// @brief return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|...|keyN=valueN" - bool hasParameters() const; - - /// @brief return true if Tag correspond to an element that has has to be placed in RTREE - bool isPlacedInRTree() const; - - /// @brief return true if Tag correspond to an element that can be sorted within their parent - bool canBeSortedManually() const; - - /// @brief return true if tag correspond to an element that can be reparent - bool canBeReparent() const; - - /// @brief return true if tag correspond to an element that can sort their children automatic - bool canAutomaticSortChildren() const; - - /// @brief return true if tag correspond to an element that can sort their children automatic - bool canWriteChildrenSeparate() const; - - /// @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 attribute of this tag is deprecated - bool isAttributeDeprecated(SumoXMLAttr attr) const; - - private: - /// @brief Sumo XML Tag vinculated wit this tag Property - SumoXMLTag myTag; - - /// @brief Sumo XML Tag vinculated wit this tag Property in String format - std::string myTagStr; - - /// @brief Attribute Type - int myTagType; - - /// @brief Attribute properties - int myTagProperty; - - /// @brief vector with the attribute values vinculated with this Tag - std::vector myAttributeProperties; - - /// @brief icon associated to this Tag - GUIIcon myIcon; - - /// @brief parent tag - SumoXMLTag myParentTag; - - /// @brief Tag written in XML (If is SUMO_TAG_NOTHING), original Tag name will be written) - SumoXMLTag myTagSynonym; - - /// @brief List with the deprecated Attributes - std::vector myDeprecatedAttributes; - }; - - /**@brief Constructor - * @param[in] tag SUMO Tag assigned to this type of object - * @param[in] icon GUIIcon associated to the type of object - */ - GNEAttributeCarrier(const SumoXMLTag tag); - - /// @brief Destructor - virtual ~GNEAttributeCarrier(); - - /// @brief get dotted geometry - const GNEGeometry::DottedGeometry& getDottedGeometry() const; - - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @name This functions has to be implemented in all GNEAttributeCarriers - /// @{ - /// @brief select attribute carrier using GUIGlobalSelection - virtual void selectAttributeCarrier(bool changeFlag = true) = 0; - - /// @brief unselect attribute carrier using GUIGlobalSelection - virtual void unselectAttributeCarrier(bool changeFlag = true) = 0; - - /// @brief check if attribute carrier is selected - virtual bool isAttributeCarrierSelected() const = 0; - - /// @brief check if attribute carrier must be drawn using selecting color. - virtual bool drawUsingSelectColor() const = 0; - - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /* @brief method for check if new value for certain attribute is valid - * @param[in] key The attribute key - * @param[in] value The new value - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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 - */ - virtual void enableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; - - /* @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 - */ - virtual void disableAttribute(SumoXMLAttr key, GNEUndoList* undoList) = 0; - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - virtual std::string getPopUpID() const = 0; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - virtual std::string getHierarchyName() const = 0; - /// @} - - /* @brief method for return an alternative value for disabled attributes. Used only in GNEFrames - * @param[in] key The attribute key - */ - 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 TagProperties& getTagProperty() const; - - /// @brief get FXIcon associated to this AC - FXIcon* getIcon() const; - - /// @brief function to support debugging - const std::string getID() const; - - /// @brief get Tag Properties - static const TagProperties& getTagProperties(SumoXMLTag tag); - - /// @brief get tags of all editable element types - static std::vector allowedTags(bool onlyDrawables); - - /// @brief get tags of all editable element types using TagProperty Type (TAGTYPE_NETELEMENT, TAGTYPE_ADDITIONAL, etc.) - static std::vector allowedTagsByCategory(int tagPropertyCategory, bool onlyDrawables); - - /// @brief true if a value of type T can be parsed from string - template - static bool canParse(const std::string& string) { - try { - parse(string); - } catch (NumberFormatException&) { - return false; - } catch (TimeFormatException&) { - return false; - } catch (EmptyData&) { - return false; - } catch (BoolFormatException&) { - return false; - } - return true; - } - - /// @brief parses a value of type T from string (used for basic types: int, double, bool, etc.) - template - static T parse(const std::string& string); - - /// @brief true if a value of type T can be parsed from string - template - static bool canParse(GNENet* net, const std::string& value, bool report) { - try { - parse(net, value); - } catch (FormatException& exception) { - if (report) { - WRITE_WARNING(exception.what()) - } - return false; - } - return true; - } - - /// @brief parses a complex value of type T from string (use for list of edges, list of lanes, etc.) - template - static T parse(GNENet* net, const std::string& value); - - /// @brief parses a list of specific Attribute Carriers into a string of IDs - template - static std::string parseIDs(const std::vector& ACs); - - /// @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(); - } - // check if we're parsing block movement - if (attribute == GNE_ATTR_BLOCK_MOVEMENT) { - // first check if we can parse - if (tagProperties.canBlockMovement()) { - // First check if attribute can be parsed to bool - parsedAttribute = attrs.get(attribute, objectID.c_str(), parsedOk, false); - // check that sucesfully parsed attribute can be converted to type double - if (!canParse(parsedAttribute)) { - abort = true; - // return default value - return parse("0"); - } else { - // return readed value - return parse(parsedAttribute); - } - } else { - throw ProcessError("Trying to parsing block movement attribute in an AC that cannot be moved"); - } - } - // now check if we're parsing a GEO Attribute - if (tagProperties.hasGEOPosition() && ((attribute == SUMO_ATTR_LON) || (attribute == SUMO_ATTR_LAT))) { - // first check if GEO Attribute is defined - if (attrs.hasAttribute(attribute)) { - // First check if attribute can be parsed to string - parsedAttribute = attrs.get(attribute, objectID.c_str(), parsedOk, false); - // check that sucesfully parsed attribute can be converted to type double - if (!canParse(parsedAttribute)) { - WRITE_WARNING("Format of GEO attribute '" + toString(attribute) + "' of " + - warningMessage + " is invalid; Cannot be parsed to float; " + tagProperties.getTagStr() + " cannot be created"); - // return default value - return parse("0"); - } else { - // return readed value - return parse(parsedAttribute); - } - } - parsedOk = false; - // return default value - return parse("0"); - } - // 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); - } - -protected: - /// @brief the xml tag to which this attribute carrier corresponds - const TagProperties& myTagProperty; - - /// @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 TagProperties dummyTagProperty; - - /// @brief dotted geometry - GNEGeometry::DottedGeometry myDottedGeometry; - -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 fill Attribute Carriers - static void fillAttributeCarriers(); - - /// @brief fill Net Elements - static void fillNetElements(); - - /// @brief fill Additionals - static void fillAdditionals(); - - /// @brief fill Shapes - static void fillShapes(); - - /// @brief fill Demand Elements - static void fillDemandElements(); - - /// @brief fill vehicle elements - static void fillVehicleElements(); - - /// @brief fill Stop elements - static void fillStopElements(); - - /// @brief fill Person Elements - static void fillPersonElements(); - - /// @brief fill PersonStop elements - static void fillPersonStopElements(); - - /// @brief fill common vehicle attributes (used by vehicles, trips, routeFlows and flows) - static void fillCommonVehicleAttributes(SumoXMLTag currentTag); - - /// @brief fill common flow attributes (used by flows, routeFlows and personFlows) - static void fillCommonFlowAttributes(SumoXMLTag currentTag); - - /// @brief fill Car Following Model of Vehicle/Person Types - static void fillCarFollowingModelAttributes(SumoXMLTag currentTag); - - /// @brief fill Junction Model Attributes of Vehicle/Person Types - static void fillJunctionModelAttributes(SumoXMLTag currentTag); - - /// @brief fill Junction Model Attributes of Vehicle/Person Types - static void fillLaneChangingModelAttributes(SumoXMLTag currentTag); - - /// @brief fill common person attributes (used by person and personFlows) - static void fillCommonPersonAttributes(SumoXMLTag currentTag); - - /// @brief fill stop person attributes (used by stops and personStps) - static void fillCommonStopAttributes(SumoXMLTag currentTag); - - /// @brief parse and check attribute (note: This function is only to improve legilibility) - static bool checkParsedAttribute(const TagProperties& tagProperties, const AttributeProperties& 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 TagProperties& tagProperties, - const AttributeProperties& attrProperties, std::string& parsedAttribute, std::string& warningMessage); - - /// @brief map with the tags properties - static std::map myTagProperties; - - /// @brief Invalidated copy constructor. - GNEAttributeCarrier(const GNEAttributeCarrier&) = delete; - - /// @brief Invalidated assignment operator - GNEAttributeCarrier& operator=(const GNEAttributeCarrier& src) = delete; -}; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEEvent_NetworkLoaded.h sumo-1.6.0+dfsg1/src/netedit/GNEEvent_NetworkLoaded.h --- sumo-1.5.0+dfsg1/src/netedit/GNEEvent_NetworkLoaded.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEEvent_NetworkLoaded.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Event to send when the network has been loaded by GNELoadThread /****************************************************************************/ -#ifndef GNEEvent_NetworkLoaded_h -#define GNEEvent_NetworkLoaded_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,9 +64,3 @@ /// @brief whether loading viewport from registry bool myViewportFromRegistry; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEGeometry.cpp sumo-1.6.0+dfsg1/src/netedit/GNEGeometry.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEGeometry.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEGeometry.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,10 @@ /// // File for geometry classes and functions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -1105,4 +1099,5 @@ return (int)index; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEGeometry.h sumo-1.6.0+dfsg1/src/netedit/GNEGeometry.h --- sumo-1.5.0+dfsg1/src/netedit/GNEGeometry.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEGeometry.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // File for geometry classes and functions /****************************************************************************/ -#ifndef GNEGeometry_h -#define GNEGeometry_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -436,8 +430,3 @@ /// @brief normalize angle for lookup in myCircleCoords static int angleLookup(const double angleDeg); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalChildElements.cpp sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalChildElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalChildElements.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalChildElements.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,631 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEHierarchicalChildElements.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// A abstract class for representation of additional elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEHierarchicalChildElements.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -GNEHierarchicalChildElements::GNEHierarchicalChildElements(GNEAttributeCarrier* AC, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements) : - myChildConnections(this), - myChildEdges(childEdges), - myChildLanes(childLanes), - myChildShapes(childShapes), - myChildAdditionals(childAdditionals), - myChildDemandElements(childDemandElements), - myAC(AC) { - // fill SortedChildDemandElementsByType with all demand element tags (it's needed because getChildDemandElementsSortedByType(...) function is constant - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT, false); - for (const auto& tag : listOfTags) { - myDemandElementsByType[tag] = {}; - } -} - - -GNEHierarchicalChildElements::~GNEHierarchicalChildElements() {} - - -const Position& -GNEHierarchicalChildElements::getChildPosition(const GNELane* lane) { - for (const auto& childConnection : myChildConnections.symbolsPositionAndRotation) { - if (childConnection.lane == lane) { - return childConnection.pos; - } - } - throw ProcessError("Lane doesn't exist"); -} - - -double -GNEHierarchicalChildElements::getChildRotation(const GNELane* lane) { - for (const auto& childConnection : myChildConnections.symbolsPositionAndRotation) { - if (childConnection.lane == lane) { - return childConnection.rot; - } - } - throw ProcessError("Lane doesn't exist"); -} - - -void -GNEHierarchicalChildElements::updateChildConnections() { - myChildConnections.update(); -} - - -void -GNEHierarchicalChildElements::drawChildConnections(const GUIVisualizationSettings& s, const GUIGlObjectType GLTypeParent) const { - myChildConnections.draw(s, GLTypeParent); -} - - -void -GNEHierarchicalChildElements::addChildAdditional(GNEAdditional* additional) { - // Check if additional is valid - if (additional == nullptr) { - throw InvalidArgument("Trying to add an empty child additional in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - // add it in child additional container - myChildAdditionals.push_back(additional); - // Check if children has to be sorted automatically - if (myAC->getTagProperty().canAutomaticSortChildren()) { - sortChildAdditionals(); - } - // update parent additional after add additional (note: by default non-implemented) - updateParentAdditional(); - } -} - - -void -GNEHierarchicalChildElements::removeChildAdditional(GNEAdditional* additional) { - // First check that additional was already inserted - auto it = std::find(myChildAdditionals.begin(), myChildAdditionals.end(), additional); - if (it == myChildAdditionals.end()) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildAdditionals.erase(it); - // Check if children has to be sorted automatically - if (myAC->getTagProperty().canAutomaticSortChildren()) { - sortChildAdditionals(); - } - // update parent additional after add additional (note: by default non-implemented) - updateParentAdditional(); - } -} - - -const std::vector& -GNEHierarchicalChildElements::getChildAdditionals() const { - return myChildAdditionals; -} - - -void -GNEHierarchicalChildElements::sortChildAdditionals() { - if (myAC->getTagProperty().getTag() == SUMO_TAG_E3DETECTOR) { - // we need to sort Entry/Exits due additional.xds model - std::vector sortedEntryExits; - // obtain all entrys - for (const auto& additional : myChildAdditionals) { - if (additional->getTagProperty().getTag() == SUMO_TAG_DET_ENTRY) { - sortedEntryExits.push_back(additional); - } - } - // obtain all exits - for (const auto& additional : myChildAdditionals) { - if (additional->getTagProperty().getTag() == SUMO_TAG_DET_EXIT) { - sortedEntryExits.push_back(additional); - } - } - // change myChildAdditionals for sortedEntryExits - if (sortedEntryExits.size() == myChildAdditionals.size()) { - myChildAdditionals = sortedEntryExits; - } else { - throw ProcessError("Some child additional were lost during sorting"); - } - } else if (myAC->getTagProperty().getTag() == SUMO_TAG_TAZ) { - // we need to sort Entry/Exits due additional.xds model - std::vector sortedTAZSourceSink; - // obtain all TAZSources - for (const auto& additional : myChildAdditionals) { - if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSOURCE) { - sortedTAZSourceSink.push_back(additional); - } - } - // obtain all TAZSinks - for (const auto& additional : myChildAdditionals) { - if (additional->getTagProperty().getTag() == SUMO_TAG_TAZSINK) { - sortedTAZSourceSink.push_back(additional); - } - } - // change myChildAdditionals for sortedEntryExits - if (sortedTAZSourceSink.size() == myChildAdditionals.size()) { - myChildAdditionals = sortedTAZSourceSink; - } else { - throw ProcessError("Some child additional were lost during sorting"); - } - } else { - // declare a vector to keep sorted children - std::vector, GNEAdditional*> > sortedChildren; - // iterate over child additional - for (const auto& additional : myChildAdditionals) { - sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional)); - // set begin/start attribute - if (additional->getTagProperty().hasAttribute(SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_TIME))) { - sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_TIME); - } else if (additional->getTagProperty().hasAttribute(SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_BEGIN))) { - sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_BEGIN); - } - // set end attribute - if (additional->getTagProperty().hasAttribute(SUMO_ATTR_END) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_END))) { - sortedChildren.back().first.second = additional->getAttributeDouble(SUMO_ATTR_END); - } else { - sortedChildren.back().first.second = sortedChildren.back().first.first; - } - } - // sort children - std::sort(sortedChildren.begin(), sortedChildren.end()); - // make sure that number of sorted children is the same as the child additional - if (sortedChildren.size() == myChildAdditionals.size()) { - myChildAdditionals.clear(); - for (auto i : sortedChildren) { - myChildAdditionals.push_back(i.second); - } - } else { - throw ProcessError("Some child additional were lost during sorting"); - } - } -} - - -bool -GNEHierarchicalChildElements::checkChildAdditionalsOverlapping() const { - // declare a vector to keep sorted children - std::vector, GNEAdditional*> > sortedChildren; - // iterate over child additional - for (const auto& additional : myChildAdditionals) { - sortedChildren.push_back(std::make_pair(std::make_pair(0., 0.), additional)); - // set begin/start attribute - if (additional->getTagProperty().hasAttribute(SUMO_ATTR_TIME) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_TIME))) { - sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_TIME); - } else if (additional->getTagProperty().hasAttribute(SUMO_ATTR_BEGIN) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_BEGIN))) { - sortedChildren.back().first.first = additional->getAttributeDouble(SUMO_ATTR_BEGIN); - } - // set end attribute - if (additional->getTagProperty().hasAttribute(SUMO_ATTR_END) && GNEAttributeCarrier::canParse(additional->getAttribute(SUMO_ATTR_END))) { - sortedChildren.back().first.second = additional->getAttributeDouble(SUMO_ATTR_END); - } else { - sortedChildren.back().first.second = sortedChildren.back().first.first; - } - } - // sort children - std::sort(sortedChildren.begin(), sortedChildren.end()); - // make sure that number of sorted children is the same as the child additional - if (sortedChildren.size() == myChildAdditionals.size()) { - if (sortedChildren.size() <= 1) { - return true; - } else { - // check overlapping - for (int i = 0; i < (int)sortedChildren.size() - 1; i++) { - if (sortedChildren.at(i).first.second > sortedChildren.at(i + 1).first.first) { - return false; - } - } - } - return true; - } else { - throw ProcessError("Some child additional were lost during sorting"); - } -} - - -void -GNEHierarchicalChildElements::addChildDemandElement(GNEDemandElement* demandElement) { - // Check if demand element is valid - if (demandElement == nullptr) { - throw InvalidArgument("Trying to add an empty child demand element in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - // add it in demandElement child container - myChildDemandElements.push_back(demandElement); - // add it also in SortedChildDemandElementsByType container - myDemandElementsByType.at(demandElement->getTagProperty().getTag()).push_back(demandElement); - // Check if children has to be sorted automatically - if (myAC->getTagProperty().canAutomaticSortChildren()) { - sortChildDemandElements(); - } - } -} - - -void -GNEHierarchicalChildElements::removeChildDemandElement(GNEDemandElement* demandElement) { - // First check that demandElement was already inserted - auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - auto itByType = std::find(myDemandElementsByType.at(demandElement->getTagProperty().getTag()).begin(), myDemandElementsByType.at(demandElement->getTagProperty().getTag()).end(), demandElement); - if (it == myChildDemandElements.end()) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - // first check if element is duplicated in vector - bool singleElement = std::count(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement) == 1; - myChildDemandElements.erase(it); - // only remove it from mySortedChildDemandElementsByType if is a single element - if (singleElement && (itByType != myDemandElementsByType.at(demandElement->getTagProperty().getTag()).end())) { - myDemandElementsByType.at(demandElement->getTagProperty().getTag()).erase(itByType); - } - // Check if children has to be sorted automatically - if (myAC->getTagProperty().canAutomaticSortChildren()) { - sortChildDemandElements(); - } - } -} - - -const std::vector& -GNEHierarchicalChildElements::getChildDemandElements() const { - return myChildDemandElements; -} - - -const std::vector& -GNEHierarchicalChildElements::getChildDemandElementsByType(SumoXMLTag tag) const { - return myDemandElementsByType.at(tag); -} - - -void -GNEHierarchicalChildElements::sortChildDemandElements() { - // by default empty -} - - -bool -GNEHierarchicalChildElements::checkChildDemandElementsOverlapping() const { - return true; -} - - -GNEDemandElement* -GNEHierarchicalChildElements::getPreviousChildDemandElement(const GNEDemandElement* demandElement) const { - // find child demand element - auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - // return element or null depending of iterator - if (it == myChildDemandElements.end()) { - return nullptr; - } else if (it == myChildDemandElements.begin()) { - return nullptr; - } else { - return *(it - 1); - } -} - - -GNEDemandElement* -GNEHierarchicalChildElements::getNextChildDemandElement(const GNEDemandElement* demandElement) const { - // find child demand element - auto it = std::find(myChildDemandElements.begin(), myChildDemandElements.end(), demandElement); - // return element or null depending of iterator - if (it == myChildDemandElements.end()) { - return nullptr; - } else if (it == (myChildDemandElements.end() - 1)) { - return nullptr; - } else { - return *(it + 1); - } -} - - -void -GNEHierarchicalChildElements::addChildEdge(GNEEdge* edge) { - // Check that edge is valid and doesn't exist previously - if (edge == nullptr) { - throw InvalidArgument("Trying to add an empty child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildEdges.push_back(edge); - } -} - - -void -GNEHierarchicalChildElements::removeChildEdge(GNEEdge* edge) { - // Check that edge is valid and exist previously - if (edge == nullptr) { - throw InvalidArgument("Trying to remove an empty child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myChildEdges.begin(), myChildEdges.end(), edge) == myChildEdges.end()) { - throw InvalidArgument("Trying to remove a non previously inserted child edge in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildEdges.erase(std::find(myChildEdges.begin(), myChildEdges.end(), edge)); - // update connections geometry - myChildConnections.update(); - } -} - - -const std::vector& -GNEHierarchicalChildElements::getChildEdges() const { - return myChildEdges; -} - - -void -GNEHierarchicalChildElements::addChildLane(GNELane* lane) { - // Check if lane is valid - if (lane == nullptr) { - throw InvalidArgument("Trying to add an empty child lane in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildLanes.push_back(lane); - // update connections geometry - myChildConnections.update(); - } -} - - -void -GNEHierarchicalChildElements::removeChildLane(GNELane* lane) { - // Check if lane is valid - if (lane == nullptr) { - throw InvalidArgument("Trying to remove an empty child lane in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildLanes.erase(std::find(myChildLanes.begin(), myChildLanes.end(), lane)); - // update connections geometry - myChildConnections.update(); - } -} - - -const std::vector& -GNEHierarchicalChildElements::getChildLanes() const { - return myChildLanes; -} - - -void -GNEHierarchicalChildElements::addChildShape(GNEShape* shape) { - // Check that shape is valid and doesn't exist previously - if (shape == nullptr) { - throw InvalidArgument("Trying to add an empty child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myChildShapes.begin(), myChildShapes.end(), shape) != myChildShapes.end()) { - throw InvalidArgument("Trying to add a duplicate child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildShapes.push_back(shape); - // update connections geometry - myChildConnections.update(); - } -} - - -void -GNEHierarchicalChildElements::removeChildShape(GNEShape* shape) { - // Check that shape is valid and exist previously - if (shape == nullptr) { - throw InvalidArgument("Trying to remove an empty child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myChildShapes.begin(), myChildShapes.end(), shape) == myChildShapes.end()) { - throw InvalidArgument("Trying to remove a non previously inserted child shape in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myChildShapes.erase(std::find(myChildShapes.begin(), myChildShapes.end(), shape)); - // update connections geometry - myChildConnections.update(); - } -} - - -const std::vector& -GNEHierarchicalChildElements::getChildShapes() const { - return myChildShapes; -} - - -void -GNEHierarchicalChildElements::updateParentAdditional() { - // by default nothing to do -} - - -void -GNEHierarchicalChildElements::updateParentDemandElement() { - // by default nothing to do -} - - -void -GNEHierarchicalChildElements::changeChildEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs) { - // remove demandElement of child edges - for (const auto& edge : myChildEdges) { - edge->removeParentAdditional(elementChild); - } - // obtain new child edges (note: it can be empty) - myChildEdges = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newEdgeIDs); - // add demandElement into parent edges - for (const auto& edge : myChildEdges) { - edge->addParentAdditional(elementChild); - } - // update connections geometry - myChildConnections.update(); -} - - -void -GNEHierarchicalChildElements::changeChildLanes(GNEAdditional* elementChild, const std::string& newLaneIDs) { - // remove demandElement of child lanes - for (const auto& lane : myChildLanes) { - lane->removeParentAdditional(elementChild); - } - // obtain new child lanes (note: it can be empty) - myChildLanes = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newLaneIDs); - // add demandElement into parent lanes - for (const auto& lane : myChildLanes) { - lane->addParentAdditional(elementChild); - } - // update connections geometry - myChildConnections.update(); -} - -// --------------------------------------------------------------------------- -// GNEHierarchicalChildElements::ChildConnections - methods -// --------------------------------------------------------------------------- - -GNEHierarchicalChildElements::ChildConnections::ConnectionGeometry::ConnectionGeometry() : - lane(nullptr), - pos(Position::INVALID), - rot(0) { -} - - -GNEHierarchicalChildElements::ChildConnections::ConnectionGeometry::ConnectionGeometry(GNELane* _lane, Position _pos, double _rot) : - lane(_lane), - pos(_pos), - rot(_rot) { -} - - -GNEHierarchicalChildElements::ChildConnections::ChildConnections(GNEHierarchicalChildElements* hierarchicalElement) : - myHierarchicalElement(hierarchicalElement) {} - - -void -GNEHierarchicalChildElements::ChildConnections::update() { - // first clear connection positions - connectionPositions.clear(); - symbolsPositionAndRotation.clear(); - // calculate position and rotation of every simbol for every edge - for (const auto& edge : myHierarchicalElement->myChildEdges) { - for (const auto& lane : edge->getLanes()) { - Position pos; - double rot; - // set position and length depending of shape's lengt - if (lane->getLaneShape().length() - 6 > 0) { - pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length() - 6); - rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length() - 6); - } else { - pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length()); - rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length()); - } - symbolsPositionAndRotation.push_back(ConnectionGeometry(lane, pos, rot)); - } - } - // calculate position and rotation of every symbol for every lane - for (const auto& lane : myHierarchicalElement->myChildLanes) { - Position pos; - double rot; - // set position and length depending of shape's lengt - if (lane->getLaneShape().length() - 6 > 0) { - pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length() - 6); - rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length() - 6); - } else { - pos = lane->getLaneShape().positionAtOffset(lane->getLaneShape().length()); - rot = lane->getLaneShape().rotationDegreeAtOffset(lane->getLaneShape().length()); - } - symbolsPositionAndRotation.push_back(ConnectionGeometry(lane, pos, rot)); - } - // calculate position for every child additional - for (const auto& additional : myHierarchicalElement->myChildAdditionals) { - // check that position is different of position - if (additional->getPositionInView() != myHierarchicalElement->getPositionInView()) { - std::vector posConnection; - double A = std::abs(additional->getPositionInView().x() - myHierarchicalElement->getPositionInView().x()); - double B = std::abs(additional->getPositionInView().y() - myHierarchicalElement->getPositionInView().y()); - // Set positions of connection's vertex. Connection is build from Entry to E3 - posConnection.push_back(additional->getPositionInView()); - if (myHierarchicalElement->getPositionInView().x() > additional->getPositionInView().x()) { - if (myHierarchicalElement->getPositionInView().y() > additional->getPositionInView().y()) { - posConnection.push_back(Position(additional->getPositionInView().x() + A, additional->getPositionInView().y())); - } else { - posConnection.push_back(Position(additional->getPositionInView().x(), additional->getPositionInView().y() - B)); - } - } else { - if (myHierarchicalElement->getPositionInView().y() > additional->getPositionInView().y()) { - posConnection.push_back(Position(additional->getPositionInView().x(), additional->getPositionInView().y() + B)); - } else { - posConnection.push_back(Position(additional->getPositionInView().x() - A, additional->getPositionInView().y())); - } - } - posConnection.push_back(myHierarchicalElement->getPositionInView()); - connectionPositions.push_back(posConnection); - } - } - // calculate geometry for connections between parent and children - for (const auto& symbol : symbolsPositionAndRotation) { - std::vector posConnection; - double A = std::abs(symbol.pos.x() - myHierarchicalElement->getPositionInView().x()); - double B = std::abs(symbol.pos.y() - myHierarchicalElement->getPositionInView().y()); - // Set positions of connection's vertex. Connection is build from Entry to E3 - posConnection.push_back(symbol.pos); - if (myHierarchicalElement->getPositionInView().x() > symbol.pos.x()) { - if (myHierarchicalElement->getPositionInView().y() > symbol.pos.y()) { - posConnection.push_back(Position(symbol.pos.x() + A, symbol.pos.y())); - } else { - posConnection.push_back(Position(symbol.pos.x(), symbol.pos.y() - B)); - } - } else { - if (myHierarchicalElement->getPositionInView().y() > symbol.pos.y()) { - posConnection.push_back(Position(symbol.pos.x(), symbol.pos.y() + B)); - } else { - posConnection.push_back(Position(symbol.pos.x() - A, symbol.pos.y())); - } - } - posConnection.push_back(myHierarchicalElement->getPositionInView()); - connectionPositions.push_back(posConnection); - } -} - - -void -GNEHierarchicalChildElements::ChildConnections::draw(const GUIVisualizationSettings& s, const GUIGlObjectType parentType) const { - // first check if connections can be drawn - if (!s.drawForRectangleSelection) { - // Iterate over myConnectionPositions - for (const auto& connection : connectionPositions) { - // Add a draw matrix - glPushMatrix(); - // traslate in the Z axis - glTranslated(0, 0, parentType - 0.01); - // Set color of the base - GLHelper::setColor(s.colorSettings.childConnections); - // iterate over connections - for (auto position = connection.begin(); (position + 1) != connection.end(); position++) { - // Draw Lines - GLHelper::drawLine((*position), (*(position + 1))); - } - // Pop draw matrix - glPopMatrix(); - } - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalChildElements.h sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalChildElements.h --- sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalChildElements.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalChildElements.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,272 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEHierarchicalChildElements.h -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// A abstract class for representation of Hierarchical Elements -/****************************************************************************/ -#ifndef GNEHierarchicalChildElements_h -#define GNEHierarchicalChildElements_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include - -#include "GNEAttributeCarrier.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEAdditional; -class GNEDemandElement; -class GNEShape; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEHierarchicalChildElements - * @brief An special type of Attribute carrier that owns hierarchical elements - */ -class GNEHierarchicalChildElements { - -public: - - /// @brief declare GNEChange_Children as friend class - friend class GNEChange_Children; - - /**@brief Parameter Constructor - * @param[in] childEdges vector of child edges - * @param[in] childLanes vector of child lanes - * @param[in] childShapes vector of child shapes - * @param[in] childAdditionals vector of child additional - * @param[in] childDemandElements vector of child demand elements - */ - GNEHierarchicalChildElements(GNEAttributeCarrier* AC, - const std::vector& childEdges, - const std::vector& childLanes, - const std::vector& childShapes, - const std::vector& childAdditionals, - const std::vector& childDemandElements); - - /// @brief Destructor - ~GNEHierarchicalChildElements(); - - /// @brief get child position calculated in ChildConnections - const Position& getChildPosition(const GNELane* lane); - - /// @brief get child rotation calculated in ChildConnections - double getChildRotation(const GNELane* lane); - - /// @brief update child connections - void updateChildConnections(); - - // Draw connections between parent and children - void drawChildConnections(const GUIVisualizationSettings& s, const GUIGlObjectType GLTypeParent) const; - - /// @brief gererate a new ID for an element child - virtual std::string generateChildID(SumoXMLTag childTag) = 0; - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief Returns position of hierarchical element in view - virtual Position getPositionInView() const = 0; - /// @} - - /// @name members and functions related to child edges - /// @{ - /// @brief add child edge - void addChildEdge(GNEEdge* edge); - - /// @brief remove child edge - void removeChildEdge(GNEEdge* edge); - - /// @brief get child edges - const std::vector& getChildEdges() const; - - /// @} - - /// @name members and functions related to child lanes - /// @{ - /// @brief add child lane - void addChildLane(GNELane* lane); - - /// @brief remove child lane - void removeChildLane(GNELane* lane); - - /// @brief get child lanes - const std::vector& getChildLanes() const; - - /// @} - - /// @name members and functions related to child shapes - /// @{ - /// @brief add child shape - void addChildShape(GNEShape* shape); - - /// @brief remove child shape - void removeChildShape(GNEShape* shape); - - /// @brief get child shapes - const std::vector& getChildShapes() const; - - /// @} - - /// @name members and functions related to child additionals - /// @{ - /// @brief add child additional - void addChildAdditional(GNEAdditional* additional); - - /// @brief remove child additional - void removeChildAdditional(GNEAdditional* additional); - - /// @brief return child additionals - const std::vector& getChildAdditionals() const; - - /// @brief sort child additionals (used by Rerouters, VSS, TAZs...) - void sortChildAdditionals(); - - /// @brief check if children are overlapped (Used by Rerouters) - bool checkChildAdditionalsOverlapping() const; - - /// @} - - /// @name members and functions related to child demand elements - /// @{ - /// @brief add child demand element - void addChildDemandElement(GNEDemandElement* demandElement); - - /// @brief remove child demand element - void removeChildDemandElement(GNEDemandElement* demandElement); - - /// @brief return child demand elements - const std::vector& getChildDemandElements() const; - - /// @brief return child demand elements by type - const std::vector& getChildDemandElementsByType(SumoXMLTag tag) const; - - /// @brief sort child demand elements - void sortChildDemandElements(); - - /// @brief check if childs demand elements are overlapped - bool checkChildDemandElementsOverlapping() const; - - /// @brief get previous child demand element to the given demand element - GNEDemandElement* getPreviousChildDemandElement(const GNEDemandElement* demandElement) const; - - /// @brief get next child demand element to the given demand element - GNEDemandElement* getNextChildDemandElement(const GNEDemandElement* demandElement) const; - - /// @} - - /// @brief update parent after add or remove a child (can be reimplemented, for example used for statistics) - virtual void updateParentAdditional(); - - /// @brief update parent after add or remove a child (can be reimplemented, for example used for statistics) - virtual void updateParentDemandElement(); - -protected: - - /// @brief struct for pack all variables and functions relative to connections between hierarchical element and their children - struct ChildConnections { - - private: - /// @brief connection geometry - struct ConnectionGeometry { - /// @brief default constructor - ConnectionGeometry(); - - /// @brief parameter constructor - ConnectionGeometry(GNELane* _lane, Position _pos, double _rot); - - /// @brief lane - GNELane* lane; - - /// @brief position - Position pos; - - /// @brief rotation - double rot; - }; - - public: - /// @brief constructor - ChildConnections(GNEHierarchicalChildElements* hierarchicalElement); - - /// @brief update Connection's geometry - void update(); - - /// @brief draw connections between Parent and childrens - void draw(const GUIVisualizationSettings& s, const GUIGlObjectType parentType) const; - - /// @brief position and rotation of every symbol over lane - std::vector symbolsPositionAndRotation; - - /// @brief Matrix with the Vertex's positions of connections between parents an their children - std::vector connectionPositions; - - private: - /// @brief pointer to hierarchical element parent - GNEHierarchicalChildElements* myHierarchicalElement; - }; - - /// @brief change child edges of an additional - void changeChildEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs); - - /// @brief change child edges of an additional - void changeChildLanes(GNEAdditional* elementChild, const std::string& newEdgeIDs); - - /// @brief variable ChildConnections - ChildConnections myChildConnections; - -private: - /// @brief vector with the child edges of this element - std::vector myChildEdges; - - /// @brief vector with the child lanes of this element - std::vector myChildLanes; - - /// @brief vector with the child lanes of this element - std::vector myChildShapes; - - /// @brief vector with the child additional - std::vector myChildAdditionals; - - /// @brief vector with the demand elements children - std::vector myChildDemandElements; - - /// @brief vector with the demand elements children sorted by type and filtered (to avoid duplicated - std::map> myDemandElementsByType; - - /// @brief pointer to AC (needed to avoid diamond problem) - GNEAttributeCarrier* myAC; - - /// @brief Invalidated copy constructor. - GNEHierarchicalChildElements(const GNEHierarchicalChildElements&) = delete; - - /// @brief Invalidated assignment operator. - GNEHierarchicalChildElements& operator=(const GNEHierarchicalChildElements&) = delete; -}; - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalParentElements.cpp sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalParentElements.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalParentElements.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalParentElements.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,593 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEHierarchicalParentElements.cpp -/// @author Pablo Alvarez Lopez -/// @date Dec 2015 -/// -// A abstract class for representation of additional elements -/****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEHierarchicalParentElements.h" - -// =========================================================================== -// member method definitions -// =========================================================================== - -// --------------------------------------------------------------------------- -// GNEHierarchicalParentElements - methods -// --------------------------------------------------------------------------- - -GNEHierarchicalParentElements::GNEHierarchicalParentElements(GNEAttributeCarrier* AC, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements) : - myParentConnections(this), - myParentEdges(parentEdges), - myParentLanes(parentLanes), - myParentShapes(parentShapes), - myParentAdditionals(parentAdditionals), - myParentDemandElements(parentDemandElements), - myAC(AC) { -} - - -GNEHierarchicalParentElements::~GNEHierarchicalParentElements() {} - - -void -GNEHierarchicalParentElements::addParentAdditional(GNEAdditional* additional) { - // First check that additional wasn't already inserted - if (std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional) != myParentAdditionals.end()) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' was already inserted in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentAdditionals.push_back(additional); - } -} - - -void -GNEHierarchicalParentElements::removeParentAdditional(GNEAdditional* additional) { - // First check that additional was already inserted - auto it = std::find(myParentAdditionals.begin(), myParentAdditionals.end(), additional); - if (it == myParentAdditionals.end()) { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentAdditionals.erase(it); - } -} - - -const std::vector& -GNEHierarchicalParentElements::getParentAdditionals() const { - return myParentAdditionals; -} - - -void -GNEHierarchicalParentElements::addParentDemandElement(GNEDemandElement* demandElement) { - // First check that demandElement wasn't already inserted - if (std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement) != myParentDemandElements.end()) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' was already inserted in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentDemandElements.push_back(demandElement); - } -} - - -void -GNEHierarchicalParentElements::removeParentDemandElement(GNEDemandElement* demandElement) { - // First check that demandElement was already inserted - auto it = std::find(myParentDemandElements.begin(), myParentDemandElements.end(), demandElement); - if (it == myParentDemandElements.end()) { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentDemandElements.erase(it); - } -} - - -const std::vector& -GNEHierarchicalParentElements::getParentDemandElements() const { - return myParentDemandElements; -} - - -std::string -GNEHierarchicalParentElements::getNewListOfParents(const GNENetElement* currentElement, const GNENetElement* newNextElement) const { - std::vector solution; - if ((currentElement->getTagProperty().getTag() == SUMO_TAG_EDGE) && (newNextElement->getTagProperty().getTag() == SUMO_TAG_EDGE)) { - // reserve solution - solution.reserve(myParentEdges.size()); - // iterate over edges - for (const auto& edge : myParentEdges) { - // add edge ID - solution.push_back(edge->getID()); - // if current edge is the current element, then insert newNextElement ID - if (edge == currentElement) { - solution.push_back(newNextElement->getID()); - } - } - } else if ((currentElement->getTagProperty().getTag() == SUMO_TAG_LANE) && (newNextElement->getTagProperty().getTag() == SUMO_TAG_LANE)) { - // reserve solution - solution.reserve(myParentLanes.size()); - // iterate over lanes - for (const auto& lane : myParentLanes) { - // add lane ID - solution.push_back(lane->getID()); - // if current lane is the current element, then insert newNextElement ID - if (lane == currentElement) { - solution.push_back(newNextElement->getID()); - } - } - } - return toString(solution); -} - - -void -GNEHierarchicalParentElements::addParentEdge(GNEEdge* edge) { - // Check that edge is valid and doesn't exist previously - if (edge == nullptr) { - throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myParentEdges.begin(), myParentEdges.end(), edge) != myParentEdges.end()) { - throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentEdges.push_back(edge); - } -} - - -void -GNEHierarchicalParentElements::removeParentEdge(GNEEdge* edge) { - // Check that edge is valid and exist previously - if (edge == nullptr) { - throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - auto it = std::find(myParentEdges.begin(), myParentEdges.end(), edge); - if (it == myParentEdges.end()) { - throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentEdges.erase(it); - } - } -} - - -const std::vector& -GNEHierarchicalParentElements::getParentEdges() const { - return myParentEdges; -} - - -std::vector -GNEHierarchicalParentElements::getMiddleParentEdges() const { - std::vector middleEdges; - // there are only middle edges if there is more than two edges - if (middleEdges.size() > 2) { - // resize middleEdges - middleEdges.resize(myParentEdges.size() - 2); - // iterate over second and previous last parent edge - for (auto i = (myParentEdges.begin() + 1); i != (myParentEdges.end() - 1); i++) { - middleEdges.push_back(*i); - } - } - return middleEdges; -} - - -const std::vector& -GNEHierarchicalParentElements::getPathEdges() const { - return myRouteEdges; -} - - -void -GNEHierarchicalParentElements::addParentLane(GNELane* lane) { - // Check that lane is valid and doesn't exist previously - if (lane == nullptr) { - throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myParentLanes.begin(), myParentLanes.end(), lane) != myParentLanes.end()) { - throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentLanes.push_back(lane); - } -} - - -void -GNEHierarchicalParentElements::removeParentLane(GNELane* lane) { - // Check that lane is valid and exist previously - if (lane == nullptr) { - throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myParentLanes.begin(), myParentLanes.end(), lane) == myParentLanes.end()) { - throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentLanes.erase(std::find(myParentLanes.begin(), myParentLanes.end(), lane)); - } -} - - -const std::vector& -GNEHierarchicalParentElements::getParentLanes() const { - return myParentLanes; -} - - -void -GNEHierarchicalParentElements::addParentShape(GNEShape* shape) { - // Check that shape is valid and doesn't exist previously - if (shape == nullptr) { - throw InvalidArgument("Trying to add an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myParentShapes.begin(), myParentShapes.end(), shape) != myParentShapes.end()) { - throw InvalidArgument("Trying to add a duplicate " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentShapes.push_back(shape); - } -} - - -void -GNEHierarchicalParentElements::removeParentShape(GNEShape* shape) { - // Check that shape is valid and exist previously - if (shape == nullptr) { - throw InvalidArgument("Trying to remove an empty " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else if (std::find(myParentShapes.begin(), myParentShapes.end(), shape) == myParentShapes.end()) { - throw InvalidArgument("Trying to remove a non previously inserted " + toString(SUMO_TAG_EDGE) + " parent in " + myAC->getTagStr() + " with ID='" + myAC->getID() + "'"); - } else { - myParentShapes.erase(std::find(myParentShapes.begin(), myParentShapes.end(), shape)); - } -} - - -const std::vector& -GNEHierarchicalParentElements::getParentShapes() const { - return myParentShapes; -} - -// --------------------------------------------------------------------------- -// GNEHierarchicalParentElements - protected methods -// --------------------------------------------------------------------------- - -void -GNEHierarchicalParentElements::replaceParentEdges(GNEShape* elementChild, const std::string& newEdgeIDs) { - // remove additional of parent edges - for (const auto& edge : myParentEdges) { - edge->removeChildShape(elementChild); - } - // obtain new parent edges - myParentEdges = GNEAttributeCarrier::parse >(elementChild->getNet(), newEdgeIDs); - // check that lane parets aren't empty - if (myParentEdges.empty()) { - throw InvalidArgument("New list of parent edges cannot be empty"); - } else { - // add additional into parent edges - for (const auto& edge : myParentEdges) { - edge->addChildShape(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs) { - // remove additional of parent edges - for (const auto& edge : myParentEdges) { - edge->removeChildAdditional(elementChild); - } - // obtain new parent edges - myParentEdges = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newEdgeIDs); - // check that lane parets aren't empty - if (myParentEdges.empty()) { - throw InvalidArgument("New list of parent edges cannot be empty"); - } else { - // add additional into parent edges - for (const auto& edge : myParentEdges) { - edge->addChildAdditional(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentEdges(GNEDemandElement* elementChild, const std::string& newEdgeIDs) { - // remove demandElement of parent edges - for (const auto& edge : myParentEdges) { - edge->removeChildDemandElement(elementChild); - } - // obtain new parent edges - myParentEdges = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newEdgeIDs); - // check that lane parets aren't empty - if (myParentEdges.empty()) { - throw InvalidArgument("New list of parent edges cannot be empty"); - } else { - // add demandElement into parent edges - for (const auto& edge : myParentEdges) { - edge->addChildDemandElement(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentEdges(GNEDemandElement* elementChild, const std::vector& newEdges) { - // remove demandElement of parent edges - for (const auto& edge : myParentEdges) { - edge->removeChildDemandElement(elementChild); - } - // set new edges - myParentEdges = newEdges; - // check that lane parets aren't empty - if (myParentEdges.empty()) { - throw InvalidArgument("New list of parent edges cannot be empty"); - } else { - // add demandElement into parent edges - for (const auto& edge : myParentEdges) { - edge->addChildDemandElement(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceFirstParentEdge(GNEDemandElement* elementChild, GNEEdge* newFirstEdge) { - // first check that at least there is two edges - if (myParentEdges.size() < 2) { - throw InvalidArgument("Invalid minimum number of edges"); - } else { - // remove demandElement of parent edges - myParentEdges.front()->removeChildDemandElement(elementChild); - // replace first edge - myParentEdges[0] = newFirstEdge; - // add demandElement into parent edges - myParentEdges.front()->addChildDemandElement(elementChild); - } -} - - -void -GNEHierarchicalParentElements::replaceMiddleParentEdges(GNEDemandElement* elementChild, const std::vector& newMiddleEdges, const bool updateChildReferences) { - // declare a vector for new parent edges - std::vector newEdges; - // check if add first edge - if (myParentEdges.size() > 0) { - newEdges.push_back(myParentEdges.front()); - } - // add newMiddleEdges - for (const auto& edge : newMiddleEdges) { - newEdges.push_back(edge); - } - // check if add last edge - if (myParentEdges.size() > 1) { - newEdges.push_back(myParentEdges.back()); - } - // check if we have to update references in all childs, or simply update parent edges vector - if (updateChildReferences) { - replaceParentEdges(elementChild, newEdges); - } else { - myParentEdges = newEdges; - } -} - - -void -GNEHierarchicalParentElements::replaceLastParentEdge(GNEDemandElement* elementChild, GNEEdge* newLastEdge) { - // first check that at least there is two edges - if (myParentEdges.size() < 2) { - throw InvalidArgument("Invalid minimum number of edges"); - } else { - // remove demandElement of parent edges - myParentEdges.back()->removeChildDemandElement(elementChild); - // replace last edge - myParentEdges.pop_back(); - myParentEdges.push_back(newLastEdge); - // add demandElement into parent edges - myParentEdges.back()->addChildDemandElement(elementChild); - } -} - - -void -GNEHierarchicalParentElements::replacePathEdges(GNEDemandElement* elementChild, const std::vector& routeEdges) { - // remove demandElement of parent edges - for (const auto& edge : myRouteEdges) { - edge->removePathElement(elementChild); - } - // set new route edges - myRouteEdges = routeEdges; - // add demandElement into parent edges - for (const auto& edge : myRouteEdges) { - edge->addPathElement(elementChild); - } -} - - -void -GNEHierarchicalParentElements::replaceParentLanes(GNEAdditional* elementChild, const std::string& newLaneIDs) { - // remove additional of parent edges - for (const auto& lane : myParentLanes) { - lane->removeChildAdditional(elementChild); - } - // obtain new parent edges - myParentLanes = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newLaneIDs); - // check that lane parets aren't empty - if (myParentLanes.empty()) { - throw InvalidArgument("New list of parent lanes cannot be empty"); - } else { - // add additional into parent edges - for (const auto& lane : myParentLanes) { - lane->addChildAdditional(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentLanes(GNEDemandElement* elementChild, const std::string& newLaneIDs) { - // remove demandElement of parent edges - for (const auto& lane : myParentLanes) { - lane->removeChildDemandElement(elementChild); - } - // obtain new parent edges - myParentLanes = GNEAttributeCarrier::parse >(elementChild->getViewNet()->getNet(), newLaneIDs); - // check that lane parets aren't empty - if (myParentLanes.empty()) { - throw InvalidArgument("New list of parent lanes cannot be empty"); - } else { - // add demandElement into parent edges - for (const auto& lane : myParentLanes) { - lane->addChildDemandElement(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentLanes(GNEShape* elementChild, const std::string& newLaneIDs) { - // remove demandElement of parent edges - for (const auto& lane : myParentLanes) { - lane->removeChildShape(elementChild); - } - // obtain new parent edges - myParentLanes = GNEAttributeCarrier::parse >(elementChild->getNet(), newLaneIDs); - // check that lane parets aren't empty - if (myParentLanes.empty()) { - throw InvalidArgument("New list of parent lanes cannot be empty"); - } else { - // add demandElement into parent edges - for (const auto& lane : myParentLanes) { - lane->addChildShape(elementChild); - } - } -} - - -void -GNEHierarchicalParentElements::replaceParentAdditional(GNEShape* shapeTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { - if ((int)myParentAdditionals.size() < additionalParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); - } else { - // remove additional of the children of parent additional - myParentAdditionals.at(additionalParentIndex)->removeChildShape(shapeTobeChanged); - // set new parent additional - myParentAdditionals.at(additionalParentIndex) = shapeTobeChanged->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); - // add additional int the children of parent additional - myParentAdditionals.at(additionalParentIndex)->addChildShape(shapeTobeChanged); - // update geometry after inserting - shapeTobeChanged->updateGeometry(); - } -} - - -void -GNEHierarchicalParentElements::replaceParentAdditional(GNEAdditional* additionalTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { - if ((int)myParentAdditionals.size() < additionalParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); - } else { - // remove additional of the children of parent additional - myParentAdditionals.at(additionalParentIndex)->removeChildAdditional(additionalTobeChanged); - // set new parent additional - myParentAdditionals.at(additionalParentIndex) = additionalTobeChanged->getViewNet()->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); - // add additional int the children of parent additional - myParentAdditionals.at(additionalParentIndex)->addChildAdditional(additionalTobeChanged); - // update geometry after inserting - additionalTobeChanged->updateGeometry(); - } -} - - -void -GNEHierarchicalParentElements::replaceParentAdditional(GNEDemandElement* demandElementTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex) { - if ((int)myParentAdditionals.size() < additionalParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(additionalParentIndex) + " parent additionals"); - } else { - // remove demand element of the children of parent additional - myParentAdditionals.at(additionalParentIndex)->removeChildDemandElement(demandElementTobeChanged); - // set new parent demand element - myParentAdditionals.at(additionalParentIndex) = demandElementTobeChanged->getViewNet()->getNet()->retrieveAdditional(myParentAdditionals.at(additionalParentIndex)->getTagProperty().getTag(), newParentAdditionalID); - // add demand element int the children of parent additional - myParentAdditionals.at(additionalParentIndex)->removeChildDemandElement(demandElementTobeChanged); - // update geometry after inserting - demandElementTobeChanged->updateGeometry(); - } -} - - -void -GNEHierarchicalParentElements::replaceParentDemandElement(GNEShape* shapeTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { - if ((int)myParentDemandElements.size() < demandElementParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); - } else { - // remove demand element of the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->removeChildShape(shapeTobeChanged); - // set new parent demand element - myParentDemandElements.at(demandElementParentIndex) = shapeTobeChanged->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); - // add demand element int the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->addChildShape(shapeTobeChanged); - // update geometry after inserting - shapeTobeChanged->updateGeometry(); - } -} - - -void -GNEHierarchicalParentElements::replaceParentDemandElement(GNEAdditional* additionalTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { - if ((int)myParentDemandElements.size() < demandElementParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); - } else { - // remove demand element of the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->removeChildAdditional(additionalTobeChanged); - // set new parent demand element - myParentDemandElements.at(demandElementParentIndex) = additionalTobeChanged->getViewNet()->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); - // add demand element int the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->addChildAdditional(additionalTobeChanged); - // update geometry after inserting - additionalTobeChanged->updateGeometry(); - } -} - - -void -GNEHierarchicalParentElements::replaceParentDemandElement(GNEDemandElement* demandElementTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex) { - if ((int)myParentDemandElements.size() < demandElementParentIndex) { - throw InvalidArgument(myAC->getTagStr() + " with ID '" + myAC->getID() + "' doesn't have " + toString(demandElementParentIndex) + " parent demand elements"); - } else { - // remove additional of the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->removeChildDemandElement(demandElementTobeChanged); - // set new parent additional - myParentDemandElements.at(demandElementParentIndex) = demandElementTobeChanged->getViewNet()->getNet()->retrieveDemandElement(myParentDemandElements.at(demandElementParentIndex)->getTagProperty().getTag(), newParentDemandElementID); - // add additional int the children of parent additional - myParentDemandElements.at(demandElementParentIndex)->addChildDemandElement(demandElementTobeChanged); - // update geometry after inserting - demandElementTobeChanged->updateGeometry(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalParentElements.h sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalParentElements.h --- sumo-1.5.0+dfsg1/src/netedit/GNEHierarchicalParentElements.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEHierarchicalParentElements.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,268 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEHierarchicalParentElements.h -/// @author Pablo Alvarez Lopez -/// @date March 2019 -/// -// A abstract class for representation of Hierarchical Elements -/****************************************************************************/ -#ifndef GNEHierarchicalParentElements_h -#define GNEHierarchicalParentElements_h - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include -#include - -#include "GNEAttributeCarrier.h" -#include "GNEGeometry.h" - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEAdditional; -class GNENetElement; -class GNEDemandElement; -class GNEShape; -class GNEConnection; - -// =========================================================================== -// class definitions -// =========================================================================== - -/** - * @class GNEHierarchicalParentElements - * @brief An special type of Attribute carrier that owns hierarchical elements - */ -class GNEHierarchicalParentElements { - -public: - - /// @brief declare GNEChange_Children as friend class - friend class GNEChange_Children; - - /**@brief Constructor used by elements that have another additionals as parent - * @param[in] tag Type of xml tag that define the element (SUMO_TAG_BUS_STOP, SUMO_TAG_JUNCTION, etc...) - * @param[in] parentEdges vector of parent edges - * @param[in] parentLanes vector of parent lanes - * @param[in] parentShapes vector of parent shapes - * @param[in] parentAdditionals vector of parent additionals - * @param[in] parentDemandElements vector of parent demand elements - */ - GNEHierarchicalParentElements(GNEAttributeCarrier* AC, - const std::vector& parentEdges, - const std::vector& parentLanes, - const std::vector& parentShapes, - const std::vector& parentAdditionals, - const std::vector& parentDemandElements); - - /// @brief Destructor - ~GNEHierarchicalParentElements(); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief Returns position of hierarchical element in view - virtual Position getPositionInView() const = 0; - /// @} - - /// @name members and functions related to parent edges - /// @{ - /// @brief add parent edge - void addParentEdge(GNEEdge* edge); - - /// @brief remove parent edge - void removeParentEdge(GNEEdge* edge); - - /// @brief get parent edges - const std::vector& getParentEdges() const; - - /// @brief get middle (via) parent edges - std::vector getMiddleParentEdges() const; - - /// @brief get path edges - const std::vector& getPathEdges() const; - - /// @} - - /// @name members and functions related to parent lanes - /// @{ - /// @brief add parent lane - void addParentLane(GNELane* lane); - - /// @brief remove parent lane - void removeParentLane(GNELane* lane); - - /// @brief get parent lanes - const std::vector& getParentLanes() const; - - /// @} - - /// @name members and functions related to parent shapes - /// @{ - /// @brief add parent shape - void addParentShape(GNEShape* shape); - - /// @brief remove parent shape - void removeParentShape(GNEShape* shape); - - /// @brief get parent shapes - const std::vector& getParentShapes() const; - - /// @} - - /// @name members and functions related to parent additionals - /// @{ - /// @brief add parent additional - void addParentAdditional(GNEAdditional* additional); - - /// @brief remove parent additional - void removeParentAdditional(GNEAdditional* additional); - - /// @brief get parent additionals - const std::vector& getParentAdditionals() const; - - /// @} - - /// @name members and functions related to parent demand elements - /// @{ - /// @brief add parent demand element - void addParentDemandElement(GNEDemandElement* demandElement); - - /// @brief remove parent demand element - void removeParentDemandElement(GNEDemandElement* demandElement); - - /// @brief get parent demand elements - const std::vector& getParentDemandElements() const; - - /// @} - - /// @brief if use edge/parent lanes as a list of consecutive elements, obtain a list of IDs of elements after insert a new element - std::string getNewListOfParents(const GNENetElement* currentElement, const GNENetElement* newNextElement) const; - -protected: - /// @name members and functions relative to changing parents - /// @{ - - /// @brief replace the parent edges of a shape - void replaceParentEdges(GNEShape* elementChild, const std::string& newEdgeIDs); - - /// @brief replace the parent edges of an additional - void replaceParentEdges(GNEAdditional* elementChild, const std::string& newEdgeIDs); - - /// @brief replace the parent edges of a demandElement - void replaceParentEdges(GNEDemandElement* elementChild, const std::string& newEdgeIDs); - - /// @brief replace the parent edges of a demandElement (GNEEdge version) - void replaceParentEdges(GNEDemandElement* elementChild, const std::vector& newEdges); - - /// @brief replace the first parent edge (used by demand elements) - void replaceFirstParentEdge(GNEDemandElement* elementChild, GNEEdge* newFirstEdge); - - /// @brief replace middle (via) parent edges - void replaceMiddleParentEdges(GNEDemandElement* elementChild, const std::vector& newMiddleEdges, const bool updateChildReferences); - - /// @brief replace the last parent edge (used by demand elements) - void replaceLastParentEdge(GNEDemandElement* elementChild, GNEEdge* newLastEdge); - - /// @brief replace edge route Parents - void replacePathEdges(GNEDemandElement* elementChild, const std::vector& routeEdges); - - /// @brief replace the parent edges of a shape - void replaceParentLanes(GNEShape* elementChild, const std::string& newLaneIDs); - - /// @brief replace the parent edges of an additional - void replaceParentLanes(GNEAdditional* elementChild, const std::string& newLaneIDs); - - /// @brief replace the parent edges of a demandElement - void replaceParentLanes(GNEDemandElement* elementChild, const std::string& newLaneIDs); - - /**@brief replace the parent additional of a shape - * @throw exception if this shape doesn't have previously a defined Additional parent - * @throw exception if shape with ID newParentAdditionalID doesn't exist - */ - void replaceParentAdditional(GNEShape* shapeTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); - - /**@brief replace the parent additional of an additional - * @throw exception if this additional doesn't have previously a defined Additional parent - * @throw exception if additional with ID newParentAdditionalID doesn't exist - */ - void replaceParentAdditional(GNEAdditional* additionalTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); - - /**@brief replace the parent additional of a demand element - * @throw exception if this additional doesn't have previously a defined Additional parent - * @throw exception if additional with ID newParentAdditionalID doesn't exist - */ - void replaceParentAdditional(GNEDemandElement* demandElementTobeChanged, const std::string& newParentAdditionalID, int additionalParentIndex); - - /**@brief replace the parent demand element of a shape - * @throw exception if this demand element doesn't have previously a defined DemandElement parent - * @throw exception if demand element with ID newParentDemandElementID doesn't exist - */ - void replaceParentDemandElement(GNEShape* shapeTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); - - /**@brief replace the parent demand element of an additional - * @throw exception if this demand element doesn't have previously a defined DemandElement parent - * @throw exception if demand element with ID newParentDemandElementID doesn't exist - */ - void replaceParentDemandElement(GNEAdditional* additionalTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); - - /**@brief change first parent demand element of demandElement - * @throw exception if this demand element doesn't have previously a defined DemandElement parent - * @throw exception if demand element with ID newParentDemandElementID doesn't exist - */ - void replaceParentDemandElement(GNEDemandElement* demandElementTobeChanged, const std::string& newParentDemandElementID, int demandElementParentIndex); - - /// @} - - /// @brief variable ParentConnections - GNEGeometry::ParentConnections myParentConnections; - -private: - /// @brief list of parent edges of this element - std::vector myParentEdges; - - /// @brief list of edges used in Flow/Trips/PersonTrips - std::vector myRouteEdges; - - /// @brief list of parent lanes of this element - std::vector myParentLanes; - - /// @brief list of parent shapes of this element - std::vector myParentShapes; - - /// @brief list of parent additionals of this element - std::vector myParentAdditionals; - - /// @brief list of demand elements parents of this element - std::vector myParentDemandElements; - - /// @brief pointer to AC (needed to avoid diamond problem) - GNEAttributeCarrier* myAC; - - /// @brief Invalidated copy constructor. - GNEHierarchicalParentElements(const GNEHierarchicalParentElements&) = delete; - - /// @brief Invalidated assignment operator. - GNEHierarchicalParentElements& operator=(const GNEHierarchicalParentElements&) = delete; -}; - -#endif diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNELoadThread.cpp sumo-1.6.0+dfsg1/src/netedit/GNELoadThread.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNELoadThread.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNELoadThread.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ // The thread that performs the loading of a Netedit-net (adapted from // GUILoadThread) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -243,6 +238,13 @@ oc.doRegister("demandelements-output", new Option_String()); oc.addDescription("demandelements-output", "Netedit", "file in which demand elements must be saved"); + oc.doRegister("data-files", 'd', new Option_FileName()); + oc.addSynonyme("data-files", "data"); + oc.addDescription("data-files", "Netedit", "Load data elements descriptions from FILE(s)"); + + oc.doRegister("dataelements-output", new Option_String()); + oc.addDescription("dataelements-output", "Netedit", "file in which data elements must be saved"); + oc.doRegister("TLSPrograms-output", new Option_String()); oc.addDescription("TLSPrograms-output", "Netedit", "file in which TLS Programs must be saved"); diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNELoadThread.h sumo-1.6.0+dfsg1/src/netedit/GNELoadThread.h --- sumo-1.5.0+dfsg1/src/netedit/GNELoadThread.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNELoadThread.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ // The thread that performs the loading of a Netedit-net (adapted from // GUILoadThread) /****************************************************************************/ -#ifndef GNELoadThread_h -#define GNELoadThread_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -107,8 +101,3 @@ /// @brief if true, a new net is created bool myNewNet; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEMoveShape.cpp sumo-1.6.0+dfsg1/src/netedit/GNEMoveShape.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEMoveShape.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEMoveShape.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,83 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEMoveShape.cpp +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// Class used for elements that own a movable shape +/****************************************************************************/ +#include + +#include "GNEMoveShape.h" + + +GNEMoveShape::GNEMoveShape() : + myGeometryPointIndex(0), + myMoveEntireShape(0) { +} + + +void +GNEMoveShape::startMoveShape(const PositionVector& shapeBeforeMoving, const double offsetMovingShape, const double sensibility) { + // update shape before moving + myShapeBeforeMoving = shapeBeforeMoving; + // check if entire shape must be moved + if (offsetMovingShape == -1) { + myMoveEntireShape = true; + } else if (myShapeBeforeMoving.size() > 0) { + myMoveEntireShape = false; + // calculate position over shape + if (offsetMovingShape <= 0) { + myPosOverShape = myShapeBeforeMoving.front(); + } else if (offsetMovingShape >= getShapeBeforeMoving().length()) { + myPosOverShape = myShapeBeforeMoving.back(); + } else { + myPosOverShape = shapeBeforeMoving.positionAtOffset2D(offsetMovingShape); + } + // reset geometry point index + myGeometryPointIndex = -1; + // check if in shapeBeforeMoving, for the given offsetMovingShape, there is a geometry point + for (int i = 0; i < (int)shapeBeforeMoving.size(); i++) { + if (shapeBeforeMoving[i].distanceSquaredTo2D(myPosOverShape) <= sensibility) { + myGeometryPointIndex = i; + } + } + } +} + + +const PositionVector& +GNEMoveShape::getShapeBeforeMoving() const { + return myShapeBeforeMoving; +} + + +const Position& +GNEMoveShape::getPosOverShapeBeforeMoving() const { + return myPosOverShape; +} + + +const int& +GNEMoveShape::getGeometryPointIndex() const { + return myGeometryPointIndex; +} + + +bool +GNEMoveShape::moveEntireShape() const { + return myMoveEntireShape; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEMoveShape.h sumo-1.6.0+dfsg1/src/netedit/GNEMoveShape.h --- sumo-1.5.0+dfsg1/src/netedit/GNEMoveShape.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEMoveShape.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,63 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNEMoveShape.h +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// Class used for elements that own a movable shape +/****************************************************************************/ +#pragma once +#include + +#include + + +// =========================================================================== +// class definitions +// =========================================================================== + +class GNEMoveShape { + +public: + /// @brief constructor + GNEMoveShape(); + + /// @gbrief start move shape + void startMoveShape(const PositionVector& shapeBeforeMoving, const double offsetMovingShape, const double sensibility); + + /// @brief get shape before moving + const PositionVector& getShapeBeforeMoving() const; + + /// @brief get position over shape before moving + const Position& getPosOverShapeBeforeMoving() const; + + /// @brief get geometry point index + const int& getGeometryPointIndex() const; + + /// @brief check if entire shape must be moved + bool moveEntireShape() const; + +private: + /// @brief save shape Before moving + PositionVector myShapeBeforeMoving; + + /// @brief position over shape before moving + Position myPosOverShape; + + /// @brief geometry point index + int myGeometryPointIndex; + + /// @brief move entire shape + bool myMoveEntireShape; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNENet.cpp sumo-1.6.0+dfsg1/src/netedit/GNENet.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNENet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNENet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -25,23 +25,15 @@ // call compute to save results // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include -#include -#include -#include -#include -#include -#include +#include #include #include #include -#include +#include +#include +#include #include #include #include @@ -49,19 +41,27 @@ #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 @@ -76,7 +76,7 @@ // FOX callback mapping // =========================================================================== -FXIMPLEMENT_ABSTRACT(GNENet::GNEChange_ReplaceEdgeInTLS, GNEChange, nullptr, 0) +FXIMPLEMENT_ABSTRACT(GNENetHelper::GNEChange_ReplaceEdgeInTLS, GNEChange, nullptr, 0) // =========================================================================== // static members @@ -90,9 +90,10 @@ GNENet::GNENet(NBNetBuilder* netBuilder) : GUIGlObject(GLO_NETWORK, ""), - ShapeContainer(), myViewNet(nullptr), myNetBuilder(netBuilder), + myAttributeCarriers(new GNENetHelper::AttributeCarriers(this)), + myPathCalculator(new GNENetHelper::PathCalculator(this)), myEdgeIDSupplier("gneE", netBuilder->getEdgeCont().getAllNames()), myJunctionIDSupplier("gneJ", netBuilder->getNodeCont().getAllNames()), myNeedRecompute(true), @@ -100,8 +101,8 @@ myAdditionalsSaved(true), myTLSProgramsSaved(true), myDemandElementsSaved(true), - myUpdateGeometryEnabled(true), - myAllowUndoShapes(true) { + myDataElementsSaved(true), + myUpdateGeometryEnabled(true) { // set net in gIDStorage GUIGlObjectStorage::gIDStorage.setNetObject(this); // Write GL debug information @@ -112,79 +113,33 @@ if (myZBoundary.ymin() != Z_INITIALIZED) { myZBoundary.add(0, 0); } - // fill additionals with tags (note: this include the TAZS) - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_TAZ, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } - - // fill demand elements with tags - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_STOP, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } + } GNENet::~GNENet() { - // Decrease reference of Polys (needed after volatile recomputing) - for (auto i : myPolygons) { - dynamic_cast(i.second)->decRef("GNENet::~GNENet"); - } - // Decrease reference of POIs (needed after volatile recomputing) - for (auto i : myPOIs) { - dynamic_cast(i.second)->decRef("GNENet::~GNENet"); - } - // Drop Edges - for (auto it : myAttributeCarriers.edges) { - it.second->decRef("GNENet::~GNENet"); - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + it.second->getTagStr() + " '" + it.second->getID() + "' in GNENet destructor"); - delete it.second; - } - // Drop junctions - for (auto it : myAttributeCarriers.junctions) { - it.second->decRef("GNENet::~GNENet"); - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + it.second->getTagStr() + " '" + it.second->getID() + "' in GNENet destructor"); - delete it.second; - } - // Drop Additionals (Only used for additionals that were inserted without using GNEChange_Additional) - for (auto it : myAttributeCarriers.additionals) { - for (auto j : it.second) { - // decrease reference manually (because it was increased manually in GNEAdditionalHandler) - j.second->decRef(); - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + j.second->getTagStr() + " '" + j.second->getID() + "' in GNENet destructor"); - delete j.second; - } - } - // Drop demand elements (Only used for demand elements that were inserted without using GNEChange_DemandElement, for example the default VType") - for (auto it : myAttributeCarriers.demandElements) { - for (auto j : it.second) { - // decrease reference manually (because it was increased manually in GNERouteHandler) - j.second->decRef(); - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + j.second->getTagStr() + " '" + j.second->getID() + "' in GNENet destructor"); - delete j.second; - } - } - // delete RouteCalculator instance of GNEDemandElement - GNEDemandElement::deleteRouteCalculatorInstance(); + // delete route calculator Instance + delete myPathCalculator; + // delete AttributeCarriers + delete myAttributeCarriers; // show extra information for tests WRITE_DEBUG("Deleting net builder in GNENet destructor"); delete myNetBuilder; } +GNENetHelper::AttributeCarriers* +GNENet::getAttributeCarriers() const { + return myAttributeCarriers; +} + + +GNENetHelper::PathCalculator* +GNENet::getPathCalculator() { + return myPathCalculator; +} + + const Boundary& GNENet::getBoundary() const { // SUMORTree is also a Boundary @@ -192,6 +147,12 @@ } +SUMORTree& +GNENet::getGrid() { + return myGrid; +} + + GUIGLObjectPopupMenu* GNENet::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); @@ -214,78 +175,7 @@ void GNENet::drawGL(const GUIVisualizationSettings& /*s*/) const { -} - - -bool -GNENet::addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer, double angle, - const std::string& imgFile, bool relativePath, const PositionVector& shape, bool geo, bool fill, double lineWidth, bool /*ignorePruning*/) { - // check if ID is duplicated - if (myPolygons.get(id) == nullptr) { - // create poly - GNEPoly* poly = new GNEPoly(this, id, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, relativePath, false, false); - if (myAllowUndoShapes) { - myViewNet->getUndoList()->p_begin("add " + toString(SUMO_TAG_POLY)); - myViewNet->getUndoList()->add(new GNEChange_Shape(poly, true), true); - myViewNet->getUndoList()->p_end(); - } else { - // insert shape without allowing undo/redo - insertShape(poly, true); - poly->incRef("addPolygon"); - } - return true; - } else { - return false; - } -} - - -bool -GNENet::addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, - const std::string& lane, double posOverLane, double posLat, double layer, double angle, - const std::string& imgFile, bool relativePath, double width, double height, bool /*ignorePruning*/) { - // check if ID is duplicated - if (myPOIs.get(id) == nullptr) { - // create POI or POILane depending of parameter lane - if (lane == "") { - // create POI - GNEPOI* poi = new GNEPOI(this, id, type, color, pos, geo, layer, angle, imgFile, relativePath, width, height, false); - if (myPOIs.add(poi->getID(), poi)) { - if (myAllowUndoShapes) { - myViewNet->getUndoList()->p_begin("add " + poi->getTagStr()); - myViewNet->getUndoList()->add(new GNEChange_Shape(poi, true), true); - myViewNet->getUndoList()->p_end(); - } else { - // insert shape without allowing undo/redo - insertShape(poi, true); - poi->incRef("addPOI"); - } - return true; - } else { - throw ProcessError("Error adding GNEPOI into shapeContainer"); - } - } else { - // create POI over lane - GNELane* retrievedLane = retrieveLane(lane); - GNEPOI* poi = new GNEPOI(this, id, type, color, layer, angle, imgFile, relativePath, retrievedLane, posOverLane, posLat, width, height, false); - if (myPOIs.add(poi->getID(), poi)) { - if (myAllowUndoShapes) { - myViewNet->getUndoList()->p_begin("add " + poi->getTagStr()); - myViewNet->getUndoList()->add(new GNEChange_Shape(poi, true), true); - myViewNet->getUndoList()->p_end(); - } else { - // insert shape without allowing undo/redo - insertShape(poi, true); - poi->incRef("addPOI"); - } - return true; - } else { - throw ProcessError("Error adding GNEPOI over lane into shapeContainer"); - } - } - } else { - return false; - } + // nothing to drawn } @@ -295,21 +185,24 @@ } -const Boundary& -GNENet::getZBoundary() const { - return myZBoundary; +void +GNENet::expandBoundary(const Boundary& newBoundary) { + myGrid.add(newBoundary); } -SUMORTree& -GNENet::getVisualisationSpeedUp() { - return myGrid; +const Boundary& +GNENet::getZBoundary() const { + return myZBoundary; } -const SUMORTree& -GNENet::getVisualisationSpeedUp() const { - return myGrid; +void +GNENet::addZValueInBoundary(const double z) { + // @todo let Boundary class track z-coordinate natively + if (z != 0) { + myZBoundary.add(z, Z_INITIALIZED); + } } @@ -321,7 +214,6 @@ // create GNEJunciton GNEJunction* junction = new GNEJunction(this, nbn); undoList->add(new GNEChange_Junction(junction, true), true); - assert(myAttributeCarriers.junctions[id]); return junction; } @@ -380,7 +272,6 @@ } requireRecompute(); undoList->p_end(); - assert(myAttributeCarriers.edges[id]); return edge; } @@ -418,11 +309,11 @@ // deleting edges changes in the underlying EdgeVector so we have to make a copy const EdgeVector incident = junction->getNBNode()->getEdges(); for (auto it : incident) { - deleteEdge(myAttributeCarriers.edges[it->getID()], undoList, true); + deleteEdge(myAttributeCarriers->getEdges().at(it->getID()), undoList, true); } // remove any traffic lights from the traffic light container (avoids lots of warnings) - junction->setAttribute(SUMO_ATTR_TYPE, toString(NODETYPE_PRIORITY), undoList); + junction->setAttribute(SUMO_ATTR_TYPE, toString(SumoXMLNodeType::PRIORITY), undoList); // delete edge undoList->add(new GNEChange_Junction(junction, false), true); @@ -433,38 +324,43 @@ void GNENet::deleteEdge(GNEEdge* edge, GNEUndoList* undoList, bool recomputeConnections) { undoList->p_begin("delete " + toString(SUMO_TAG_EDGE)); - // delete all shapes children of edge - while (edge->getChildShapes().size() > 0) { - deleteShape(edge->getChildShapes().front(), undoList); - } - // delete all shapes children of lane - for (auto i : edge->getLanes()) { - while (i->getChildShapes().size() > 0) { - deleteShape(i->getChildShapes().front(), undoList); + // iterate over lanes + for (const auto& lane : edge->getLanes()) { + // delete lane additionals + while (lane->getChildAdditionals().size() > 0) { + deleteAdditional(lane->getChildAdditionals().front(), undoList); } - } - // delete all child edge demand elements - while (edge->getChildDemandElements().size() > 0) { - deleteDemandElement(edge->getChildDemandElements().front(), undoList); - } - // delete all child demand elementss of edge's lanes - for (auto i : edge->getLanes()) { - while (i->getChildDemandElements().size() > 0) { - deleteDemandElement(i->getChildDemandElements().front(), undoList); + // delete lane shapes + while (lane->getChildShapes().size() > 0) { + deleteShape(lane->getChildShapes().front(), undoList); + } + // delete lane demand elements + while (lane->getChildDemandElements().size() > 0) { + deleteDemandElement(lane->getChildDemandElements().front(), undoList); + } + // delete lane generic data elements + while (lane->getChildGenericDataElements().size() > 0) { + deleteGenericData(lane->getChildGenericDataElements().front(), undoList); } } - // delete all child edge additional + // delete edge child additionals while (edge->getChildAdditionals().size() > 0) { deleteAdditional(edge->getChildAdditionals().front(), undoList); } - // delete all child additional of edge's lanes - for (auto i : edge->getLanes()) { - while (i->getChildAdditionals().size() > 0) { - deleteAdditional(i->getChildAdditionals().front(), undoList); - } + // delete edge child shapes + while (edge->getChildShapes().size() > 0) { + deleteShape(edge->getChildShapes().front(), undoList); + } + // delete edge child demand elements + while (edge->getChildDemandElements().size() > 0) { + deleteDemandElement(edge->getChildDemandElements().front(), undoList); + } + // delete edge child generic datas + while (edge->getChildGenericDataElements().size() > 0) { + deleteGenericData(edge->getChildGenericDataElements().front(), undoList); } // invalidate path element childrens - edge->invalidatePathChildElementss(); + edge->invalidatePathChildElements(); // remove edge from crossings related with this edge edge->getGNEJunctionSource()->removeEdgeFromCrossings(edge, undoList); edge->getGNEJunctionDestiny()->removeEdgeFromCrossings(edge, undoList); @@ -478,11 +374,11 @@ } // if junction source is a TLS and after deletion will have only an edge, remove TLS if (edge->getGNEJunctionSource()->getNBNode()->isTLControlled() && (edge->getGNEJunctionSource()->getGNEOutgoingEdges().size() <= 1)) { - edge->getGNEJunctionSource()->setAttribute(SUMO_ATTR_TYPE, toString(NODETYPE_PRIORITY), undoList); + edge->getGNEJunctionSource()->setAttribute(SUMO_ATTR_TYPE, toString(SumoXMLNodeType::PRIORITY), undoList); } // if junction destiny is a TLS and after deletion will have only an edge, remove TLS if (edge->getGNEJunctionDestiny()->getNBNode()->isTLControlled() && (edge->getGNEJunctionDestiny()->getGNEIncomingEdges().size() <= 1)) { - edge->getGNEJunctionDestiny()->setAttribute(SUMO_ATTR_TYPE, toString(NODETYPE_PRIORITY), undoList); + edge->getGNEJunctionDestiny()->setAttribute(SUMO_ATTR_TYPE, toString(SumoXMLNodeType::PRIORITY), undoList); } // Delete edge undoList->add(new GNEChange_Edge(edge, false), true); @@ -496,52 +392,62 @@ void GNENet::replaceIncomingEdge(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList) { undoList->p_begin("replace " + toString(SUMO_TAG_EDGE)); - undoList->p_add(new GNEChange_Attribute(by, this, SUMO_ATTR_TO, which->getAttribute(SUMO_ATTR_TO))); - // replace in additionals children of edge + undoList->p_add(new GNEChange_Attribute(by, SUMO_ATTR_TO, which->getAttribute(SUMO_ATTR_TO))); + // iterate over lane + for (const auto& lane : which->getLanes()) { + // replace in additionals + std::vector copyOfLaneAdditionals = lane->getChildAdditionals(); + for (const auto& additional : copyOfLaneAdditionals) { + undoList->p_add(new GNEChange_Attribute(additional, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(lane->getIndex()))); + } + // replace in shapes + std::vector copyOfLaneShapes = lane->getChildShapes(); + for (const auto& shape : copyOfLaneShapes) { + undoList->p_add(new GNEChange_Attribute(shape, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(lane->getIndex()))); + } + // replace in demand elements + std::vector copyOfLaneDemandElements = lane->getChildDemandElements(); + for (const auto& demandElement : copyOfLaneDemandElements) { + undoList->p_add(new GNEChange_Attribute(demandElement, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(lane->getIndex()))); + } + // replace in generic datas + std::vector copyOfLaneGenericDatas = lane->getChildGenericDataElements(); + for (const auto& demandElement : copyOfLaneGenericDatas) { + undoList->p_add(new GNEChange_Attribute(demandElement, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(lane->getIndex()))); + } + } + // replace in edge additionals children while (which->getChildAdditionals().size() > 0) { - undoList->p_add(new GNEChange_Attribute(which->getChildAdditionals().front(), this, SUMO_ATTR_EDGE, by->getID())); + undoList->p_add(new GNEChange_Attribute(which->getChildAdditionals().front(), SUMO_ATTR_EDGE, by->getID())); } - // replace in additionals children of lane - for (auto i : which->getLanes()) { - std::vector copyOfLaneAdditionals = i->getChildAdditionals(); - for (auto j : copyOfLaneAdditionals) { - undoList->p_add(new GNEChange_Attribute(j, this, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(i->getIndex()))); - } + // replace in edge shapes children + while (which->getChildShapes().size() > 0) { + undoList->p_add(new GNEChange_Attribute(which->getChildShapes().front(), SUMO_ATTR_EDGE, by->getID())); } - // replace in demand elements children of edge + // replace in edge demand elements children while (which->getChildDemandElements().size() > 0) { - undoList->p_add(new GNEChange_Attribute(which->getChildDemandElements().front(), this, SUMO_ATTR_EDGE, by->getID())); - } - // replace in demand elements children of lane - for (auto i : which->getLanes()) { - std::vector copyOfLaneDemandElements = i->getChildDemandElements(); - for (auto j : copyOfLaneDemandElements) { - undoList->p_add(new GNEChange_Attribute(j, this, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(i->getIndex()))); - } + undoList->p_add(new GNEChange_Attribute(which->getChildDemandElements().front(), SUMO_ATTR_EDGE, by->getID())); } - // replace in shapes children of lane - for (auto i : which->getLanes()) { - std::vector copyOfLaneShapes = i->getChildShapes(); - for (auto j : copyOfLaneShapes) { - undoList->p_add(new GNEChange_Attribute(j, this, SUMO_ATTR_LANE, by->getNBEdge()->getLaneID(i->getIndex()))); - } + // replace in edge demand elements children + while (which->getChildGenericDataElements().size() > 0) { + undoList->p_add(new GNEChange_Attribute(which->getChildGenericDataElements().front(), SUMO_ATTR_EDGE, by->getID())); } // replace in rerouters - for (auto rerouter : which->getParentAdditionals()) { + for (const auto& rerouter : which->getParentAdditionals()) { replaceInListAttribute(rerouter, SUMO_ATTR_EDGES, which->getID(), by->getID(), undoList); } // replace in crossings - for (auto crossing : which->getGNEJunctionDestiny()->getGNECrossings()) { + for (const auto& crossing : which->getGNEJunctionDestiny()->getGNECrossings()) { // if at least one of the edges of junction to remove belongs to a crossing of the source junction, delete it replaceInListAttribute(crossing, SUMO_ATTR_EDGES, which->getID(), by->getID(), undoList); } // fix connections (make a copy because they will be modified - std::vector connections = which->getNBEdge()->getConnections(); - for (auto con : connections) { - undoList->add(new GNEChange_Connection(which, con, false, false), true); - undoList->add(new GNEChange_Connection(by, con, false, true), true); + std::vector NBConnections = which->getNBEdge()->getConnections(); + for (const auto& NBConnection : NBConnections) { + undoList->add(new GNEChange_Connection(which, NBConnection, false, false), true); + undoList->add(new GNEChange_Connection(by, NBConnection, false, true), true); } - undoList->add(new GNEChange_ReplaceEdgeInTLS(getTLLogicCont(), which->getNBEdge(), by->getNBEdge()), true); + undoList->add(new GNENetHelper::GNEChange_ReplaceEdgeInTLS(getTLLogicCont(), which->getNBEdge(), by->getNBEdge()), true); // Delete edge undoList->add(new GNEChange_Edge(which, false), true); // finish replace edge @@ -557,17 +463,21 @@ deleteEdge(edge, undoList, recomputeConnections); } else { undoList->p_begin("delete " + toString(SUMO_TAG_LANE)); - // delete additionals children of lane + // delete lane additional children while (lane->getChildAdditionals().size() > 0) { deleteAdditional(lane->getChildAdditionals().front(), undoList); } - // delete child demand elements of lane + // delete lane shape children + while (lane->getChildShapes().size() > 0) { + undoList->add(new GNEChange_Shape(lane->getChildShapes().front(), false), true); + } + // delete lane demand element children while (lane->getChildDemandElements().size() > 0) { deleteDemandElement(lane->getChildDemandElements().front(), undoList); } - // delete POIShapes of Lane - while (lane->getChildShapes().size() > 0) { - undoList->add(new GNEChange_Shape(lane->getChildShapes().front(), false), true); + // delete lane generic data children + while (lane->getChildGenericDataElements().size() > 0) { + deleteGenericData(lane->getChildGenericDataElements().front(), undoList); } // update affected connections if (recomputeConnections) { @@ -606,13 +516,14 @@ GNENet::deleteCrossing(GNECrossing* crossing, GNEUndoList* undoList) { undoList->p_begin("delete crossing"); // remove it using GNEChange_Crossing - undoList->add(new GNEChange_Crossing(crossing->getParentJunction(), crossing->getNBCrossing()->edges, - crossing->getNBCrossing()->width, crossing->getNBCrossing()->priority, - crossing->getNBCrossing()->customTLIndex, - crossing->getNBCrossing()->customTLIndex2, - crossing->getNBCrossing()->customShape, - crossing->isAttributeCarrierSelected(), - false), true); + undoList->add(new GNEChange_Crossing( + crossing->getParentJunction(), crossing->getNBCrossing()->edges, + crossing->getNBCrossing()->width, crossing->getNBCrossing()->priority, + crossing->getNBCrossing()->customTLIndex, + crossing->getNBCrossing()->customTLIndex2, + crossing->getNBCrossing()->customShape, + crossing->isAttributeCarrierSelected(), + false), true); // remove crossing requires always a recompute (due geometry and connections) requireRecompute(); undoList->p_end(); @@ -631,11 +542,15 @@ void GNENet::deleteAdditional(GNEAdditional* additional, GNEUndoList* undoList) { undoList->p_begin("delete " + additional->getTagStr()); - // first remove all child demand elements of this additional calling this function recursively + // remove all demand element children of this additional deleteDemandElement this function recursively while (additional->getChildDemandElements().size() > 0) { deleteDemandElement(additional->getChildDemandElements().front(), undoList); } - // first remove all child additional of this additional calling this function recursively + // remove all generic data children of this additional deleteGenericData this function recursively + while (additional->getChildGenericDataElements().size() > 0) { + deleteGenericData(additional->getChildGenericDataElements().front(), undoList); + } + // remove all additional children of this additional calling this function recursively while (additional->getChildAdditionals().size() > 0) { deleteAdditional(additional->getChildAdditionals().front(), undoList); } @@ -652,10 +567,14 @@ throw ProcessError("Trying to delete a default Vehicle Type"); } else { undoList->p_begin("delete " + demandElement->getTagStr()); - // first remove all child demand elements of this demandElement calling this function recursively + // remove all child demand elements of this demandElement calling this function recursively while (demandElement->getChildDemandElements().size() > 0) { deleteDemandElement(demandElement->getChildDemandElements().front(), undoList); } + // remove all generic data children of this additional deleteGenericData this function recursively + while (demandElement->getChildGenericDataElements().size() > 0) { + deleteGenericData(demandElement->getChildGenericDataElements().front(), undoList); + } // we need an special case for person if (demandElement->getTagProperty().isPersonPlan() && (demandElement->getParentDemandElements().front()->getChildDemandElements().size() == 1)) { // obtain person @@ -675,6 +594,49 @@ void +GNENet::deleteDataSet(GNEDataSet* dataSet, GNEUndoList* undoList) { + undoList->p_begin("delete " + dataSet->getTagStr()); + // first remove all data interval children + while (dataSet->getDataIntervalChildren().size() > 0) { + deleteDataInterval(dataSet->getDataIntervalChildren().begin()->second, undoList); + } + // remove data set + undoList->add(new GNEChange_DataSet(dataSet, false), true); + undoList->p_end(); +} + + +void +GNENet::deleteDataInterval(GNEDataInterval* dataInterval, GNEUndoList* undoList) { + undoList->p_begin("delete " + dataInterval->getTagStr()); + // first remove all generic data children + while (dataInterval->getGenericDataChildren().size() > 0) { + deleteGenericData(dataInterval->getGenericDataChildren().front(), undoList); + } + // remove data interval + undoList->add(new GNEChange_DataInterval(dataInterval, false), true); + undoList->p_end(); +} + + +void +GNENet::deleteGenericData(GNEGenericData* genericData, GNEUndoList* undoList) { + undoList->p_begin("delete " + genericData->getTagStr()); + // remove all child demand elements of this demandElement calling this function recursively + while (genericData->getChildDemandElements().size() > 0) { + deleteDemandElement(genericData->getChildDemandElements().front(), undoList); + } + // remove all generic data children of this additional deleteGenericData this function recursively + while (genericData->getChildGenericDataElements().size() > 0) { + deleteGenericData(genericData->getChildGenericDataElements().front(), undoList); + } + // remove generic data + undoList->add(new GNEChange_GenericData(genericData, false), true); + undoList->p_end(); +} + + +void GNENet::duplicateLane(GNELane* lane, GNEUndoList* undoList, bool recomputeConnections) { undoList->p_begin("duplicate " + toString(SUMO_TAG_LANE)); GNEEdge* edge = lane->getParentEdge(); @@ -695,14 +657,14 @@ bool addRestriction = true; if (vclass == SVC_PEDESTRIAN) { GNEEdge* edge = lane->getParentEdge(); - for (const auto lane : edge->getLanes()) { - if (lane->isRestricted(SVC_PEDESTRIAN)) { + for (const auto& edgeLane : edge->getLanes()) { + if (edgeLane->isRestricted(SVC_PEDESTRIAN)) { // prevent adding a 2nd sidewalk addRestriction = false; } else { // ensure that the sidewalk is used exclusively const SVCPermissions allOldWithoutPeds = edge->getNBEdge()->getPermissions(lane->getIndex()) & ~SVC_PEDESTRIAN; - lane->setAttribute(SUMO_ATTR_ALLOW, getVehicleClassNames(allOldWithoutPeds), undoList); + edgeLane->setAttribute(SUMO_ATTR_ALLOW, getVehicleClassNames(allOldWithoutPeds), undoList); } } } @@ -829,7 +791,7 @@ } } // modify the edge so that it ends at the new junction (and all incoming connections are preserved - undoList->p_add(new GNEChange_Attribute(edge, this, SUMO_ATTR_TO, newJunction->getID())); + undoList->p_add(new GNEChange_Attribute(edge, SUMO_ATTR_TO, newJunction->getID())); // set first part of geometry newGeoms.first.pop_back(); newGeoms.first.erase(newGeoms.first.begin()); @@ -904,7 +866,7 @@ GNENet::addReversedEdge(GNEEdge* edge, GNEUndoList* undoList) { undoList->p_begin("add reversed " + toString(SUMO_TAG_EDGE)); GNEEdge* reversed = nullptr; - if (edge->getNBEdge()->getLaneSpreadFunction() == LANESPREAD_RIGHT || isRailway(edge->getNBEdge()->getPermissions())) { + if (edge->getNBEdge()->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT || isRailway(edge->getNBEdge()->getPermissions())) { // for rail edges, we assume bi-directional tracks are wanted reversed = createEdge(edge->getGNEJunctionDestiny(), edge->getGNEJunctionSource(), edge, undoList, "-" + edge->getID(), false, true); assert(reversed != 0); @@ -941,27 +903,25 @@ // place moved junction in the same position of target junction moved->setAttribute(SUMO_ATTR_POSITION, target->getAttribute(SUMO_ATTR_POSITION), undoList); // deleting edges changes in the underlying EdgeVector so we have to make a copy - const EdgeVector incoming = moved->getNBNode()->getIncomingEdges(); - for (NBEdge* edge : incoming) { + const EdgeVector incomingNBEdges = moved->getNBNode()->getIncomingEdges(); + for (const auto& incomingNBEdge : incomingNBEdges) { // delete edges between the merged junctions - GNEEdge* e = myAttributeCarriers.edges[edge->getID()]; - assert(e != 0); - if (e->getGNEJunctionSource() == target) { - deleteEdge(e, undoList, false); + GNEEdge* edge = myAttributeCarriers->getEdges().at(incomingNBEdge->getID()); + if (edge->getGNEJunctionSource() == target) { + deleteEdge(edge, undoList, false); } else { - undoList->p_add(new GNEChange_Attribute(e, this, SUMO_ATTR_TO, target->getID())); + undoList->p_add(new GNEChange_Attribute(edge, SUMO_ATTR_TO, target->getID())); } } // deleting edges changes in the underlying EdgeVector so we have to make a copy - const EdgeVector outgoing = moved->getNBNode()->getOutgoingEdges(); - for (NBEdge* edge : outgoing) { + const EdgeVector outgoingNBEdges = moved->getNBNode()->getOutgoingEdges(); + for (const auto& outgoingNBEdge : outgoingNBEdges) { // delete edges between the merged junctions - GNEEdge* e = myAttributeCarriers.edges[edge->getID()]; - assert(e != 0); - if (e->getGNEJunctionDestiny() == target) { - deleteEdge(e, undoList, false); + GNEEdge* edge = myAttributeCarriers->getEdges().at(outgoingNBEdge->getID()); + if (edge->getGNEJunctionDestiny() == target) { + deleteEdge(edge, undoList, false); } else { - undoList->p_add(new GNEChange_Attribute(e, this, SUMO_ATTR_FROM, target->getID())); + undoList->p_add(new GNEChange_Attribute(edge, SUMO_ATTR_FROM, target->getID())); } } // deleted moved junction @@ -973,7 +933,7 @@ bool GNENet::checkJunctionPosition(const Position& pos) { // Check that there isn't another junction in the same position as Pos - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { if (i.second->getPositionInView() == pos) { return false; } @@ -988,7 +948,9 @@ WRITE_DEBUG("net has to be saved"); std::string additionalsSaved = (myAdditionalsSaved ? "saved" : "unsaved"); std::string demandElementsSaved = (myDemandElementsSaved ? "saved" : "unsaved"); - WRITE_DEBUG("Current saving Status: net unsaved, additionals " + additionalsSaved + ", demand elements " + demandElementsSaved); + std::string dataSetsSaved = (myDataElementsSaved ? "saved" : "unsaved"); + WRITE_DEBUG("Current saving Status: net unsaved, additionals " + additionalsSaved + + ", demand elements " + demandElementsSaved + ", data sets " + dataSetsSaved); } myNetSaved = !value; } @@ -1030,31 +992,15 @@ GNENet::setViewNet(GNEViewNet* viewNet) { // set view net myViewNet = viewNet; - - // Create default vehicle Type (it has to be created here due myViewNet was previously nullptr) - GNEVehicleType* defaultVehicleType = new GNEVehicleType(myViewNet, DEFAULT_VTYPE_ID, SVC_PASSENGER, SUMO_TAG_VTYPE); - myAttributeCarriers.demandElements.at(defaultVehicleType->getTagProperty().getTag()).insert(std::make_pair(defaultVehicleType->getID(), 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(myViewNet, DEFAULT_BIKETYPE_ID, SVC_BICYCLE, SUMO_TAG_VTYPE); - myAttributeCarriers.demandElements.at(defaultBikeType->getTagProperty().getTag()).insert(std::make_pair(defaultBikeType->getID(), defaultBikeType)); - defaultBikeType->incRef("GNENet::DEFAULT_BIKETYPE_ID"); - - // Create default person Type (it has to be created here due myViewNet was previously nullptr) - GNEVehicleType* defaultPersonType = new GNEVehicleType(myViewNet, DEFAULT_PEDTYPE_ID, SVC_PEDESTRIAN, SUMO_TAG_PTYPE); - myAttributeCarriers.demandElements.at(defaultPersonType->getTagProperty().getTag()).insert(std::make_pair(defaultPersonType->getID(), defaultPersonType)); - defaultPersonType->incRef("GNENet::DEFAULT_PEDTYPE_ID"); - - // create instance of RouteCalculator - GNEDemandElement::createRouteCalculatorInstance(this); + // add default vTypes + myAttributeCarriers->addDefaultVTypes(); } GNEJunction* GNENet::retrieveJunction(const std::string& id, bool failHard) const { - if (myAttributeCarriers.junctions.count(id)) { - return myAttributeCarriers.junctions.at(id); + if (myAttributeCarriers->getJunctions().count(id)) { + return myAttributeCarriers->getJunctions().at(id); } else if (failHard) { // If junction wasn't found, throw exception throw UnknownElement("Junction " + id); @@ -1064,17 +1010,11 @@ } -const GNENet::AttributeCarriers& -GNENet::getAttributeCarriers() const { - return myAttributeCarriers; -} - - GNEEdge* GNENet::retrieveEdge(const std::string& id, bool failHard) const { - auto i = myAttributeCarriers.edges.find(id); + auto i = myAttributeCarriers->getEdges().find(id); // If edge was found - if (i != myAttributeCarriers.edges.end()) { + if (i != myAttributeCarriers->getEdges().end()) { return i->second; } else if (failHard) { // If edge wasn't found, throw exception @@ -1087,44 +1027,21 @@ GNEEdge* GNENet::retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard) const { - assert((from != nullptr) && (to != nullptr)); - // iterate over Junctions of net - for (auto i : myAttributeCarriers.edges) { - if ((i.second->getGNEJunctionSource() == from) && (i.second->getGNEJunctionDestiny() == to)) { - return i.second; + if ((from != nullptr) && (to != nullptr)) { + // iterate over Junctions of net + for (const auto& edge : myAttributeCarriers->getEdges()) { + if ((edge.second->getGNEJunctionSource() == from) && (edge.second->getGNEJunctionDestiny() == to)) { + return edge.second; + } + } + // if edge wasn't found, throw exception or return nullptr + if (failHard) { + throw UnknownElement("Edge with from='" + from->getID() + "' and to='" + to->getID() + "'"); + } else { + return nullptr; } - } - // if edge wasn' found, throw exception or return nullptr - if (failHard) { - throw UnknownElement("Edge with from='" + from->getID() + "' and to='" + to->getID() + "'"); - } else { - return nullptr; - } -} - - -GNEPoly* -GNENet::retrievePolygon(const std::string& id, bool failHard) const { - if (myPolygons.get(id) != 0) { - return reinterpret_cast(myPolygons.get(id)); - } else if (failHard) { - // If Polygon wasn't found, throw exception - throw UnknownElement("Polygon " + id); - } else { - return nullptr; - } -} - - -GNEPOI* -GNENet::retrievePOI(const std::string& id, bool failHard) const { - if (myPOIs.get(id) != 0) { - return reinterpret_cast(myPOIs.get(id)); - } else if (failHard) { - // If POI wasn't found, throw exception - throw UnknownElement("POI " + id); } else { - return nullptr; + throw UnknownElement("Junctions cannot be nullptr"); } } @@ -1132,7 +1049,7 @@ GNEConnection* GNENet::retrieveConnection(const std::string& id, bool failHard) const { // iterate over junctions - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { // iterate over connections for (auto j : i.second->getGNEConnections()) { if (j->getID() == id) { @@ -1153,7 +1070,7 @@ GNENet::retrieveConnections(bool onlySelected) const { std::vector result; // iterate over junctions - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { // iterate over connections for (auto j : i.second->getGNEConnections()) { if (!onlySelected || j->isAttributeCarrierSelected()) { @@ -1168,7 +1085,7 @@ GNECrossing* GNENet::retrieveCrossing(const std::string& id, bool failHard) const { // iterate over junctions - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { // iterate over crossings for (auto j : i.second->getGNECrossings()) { if (j->getID() == id) { @@ -1189,7 +1106,7 @@ GNENet::retrieveCrossings(bool onlySelected) const { std::vector result; // iterate over junctions - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { // iterate over crossings for (auto j : i.second->getGNECrossings()) { if (!onlySelected || j->isAttributeCarrierSelected()) { @@ -1205,7 +1122,7 @@ GNENet::retrieveEdges(bool onlySelected) { std::vector result; // returns edges depending of selection - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { if (!onlySelected || i.second->isAttributeCarrierSelected()) { result.push_back(i.second); } @@ -1218,7 +1135,7 @@ GNENet::retrieveLanes(bool onlySelected) { std::vector result; // returns lanes depending of selection - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { for (auto j : i.second->getLanes()) { if (!onlySelected || j->isAttributeCarrierSelected()) { result.push_back(j); @@ -1266,7 +1183,7 @@ GNENet::retrieveJunctions(bool onlySelected) { std::vector result; // returns junctions depending of selection - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { if (!onlySelected || i.second->isAttributeCarrierSelected()) { result.push_back(i.second); } @@ -1278,25 +1195,10 @@ std::vector GNENet::retrieveShapes(SumoXMLTag shapeTag, bool onlySelected) { std::vector result; - // return dependingn of shape type - if (shapeTag == SUMO_TAG_POLY) { - // return all polys depending of onlySelected - for (auto it : getPolygons()) { - GNEShape* shape = dynamic_cast(it.second); - if (!onlySelected || shape->isAttributeCarrierSelected()) { - result.push_back(shape); - } - } - } else { - // check if we need to return a POI or POILane - for (auto it : getPOIs()) { - GNEPOI* poi = dynamic_cast(it.second); - if (poi && (poi->getTagProperty().getTag() == shapeTag)) { - // return all POIs or POILanes depending of onlySelected - if (!onlySelected || poi->isAttributeCarrierSelected()) { - result.push_back(poi); - } - } + // return all polys depending of onlySelected + for (const auto& shape : myAttributeCarriers->getShapes().at(shapeTag)) { + if (!onlySelected || shape.second->isAttributeCarrierSelected()) { + result.push_back(shape.second); } } return result; @@ -1307,16 +1209,11 @@ GNENet::retrieveShapes(bool onlySelected) { std::vector result; // return all polygons and POIs - for (const auto& it : getPolygons()) { - GNEPoly* poly = dynamic_cast(it.second); - if (!onlySelected || poly->isAttributeCarrierSelected()) { - result.push_back(poly); - } - } - for (const auto& it : getPOIs()) { - GNEPOI* poi = dynamic_cast(it.second); - if (!onlySelected || poi->isAttributeCarrierSelected()) { - result.push_back(poi); + for (const auto& shapeTag : myAttributeCarriers->getShapes()) { + for (const auto& shape : shapeTag.second) { + if (!onlySelected || shape.second->isAttributeCarrierSelected()) { + result.push_back(shape.second); + } } } return result; @@ -1324,19 +1221,31 @@ void -GNENet::addGLObjectIntoGrid(GUIGlObject* o) { - myGrid.addAdditionalGLObject(o); +GNENet::addGLObjectIntoGrid(GNEAttributeCarrier* AC) { + // first check if given object has an associated GUIGlObject + if (AC->getGUIGlObject()) { + // check if object must be inserted in RTREE + if (AC->getTagProperty().isPlacedInRTree()) { + myGrid.addAdditionalGLObject(AC->getGUIGlObject()); + } + } } void -GNENet::removeGLObjectFromGrid(GUIGlObject* o) { - myGrid.removeAdditionalGLObject(o); +GNENet::removeGLObjectFromGrid(GNEAttributeCarrier* AC) { + // first check if given object has an associated GUIGlObject + if (AC->getGUIGlObject()) { + // check if object must be inserted in RTREE + if (AC->getTagProperty().isPlacedInRTree()) { + myGrid.removeAdditionalGLObject(AC->getGUIGlObject()); + } + } } GNEAttributeCarrier* -GNENet::retrieveAttributeCarrier(GUIGlID id, bool failHard) { +GNENet::retrieveAttributeCarrier(const GUIGlID id, bool failHard) const { // obtain blocked GUIGlObject GUIGlObject* object = GUIGlObjectStorage::gIDStorage.getObjectBlocking(id); // Make sure that object exists @@ -1363,13 +1272,13 @@ std::vector result; if (type == SUMO_TAG_NOTHING) { // return all elements - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { result.push_back(i.second); for (auto j : i.second->getGNECrossings()) { result.push_back(j); } } - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { result.push_back(i.second); for (auto j : i.second->getLanes()) { result.push_back(j); @@ -1378,75 +1287,78 @@ result.push_back(j); } } - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { for (auto j : i.second) { result.push_back(j.second); } } - for (auto i : myPolygons) { - result.push_back(dynamic_cast(i.second)); - } - for (auto i : myPOIs) { - result.push_back(dynamic_cast(i.second)); + for (auto i : myAttributeCarriers->getShapes()) { + for (auto j : i.second) { + result.push_back(j.second); + } } - for (auto i : myAttributeCarriers.demandElements) { + for (auto i : myAttributeCarriers->getDemandElements()) { for (auto j : i.second) { result.push_back(j.second); } } - } else if (GNEAttributeCarrier::getTagProperties(type).isAdditional() || GNEAttributeCarrier::getTagProperties(type).isTAZ()) { + } else if (GNEAttributeCarrier::getTagProperties(type).isAdditionalElement() || GNEAttributeCarrier::getTagProperties(type).isTAZ()) { // only returns additionals of a certain type. - for (auto i : myAttributeCarriers.additionals.at(type)) { + for (auto i : myAttributeCarriers->getAdditionals().at(type)) { result.push_back(i.second); } } else if (GNEAttributeCarrier::getTagProperties(type).isDemandElement() || GNEAttributeCarrier::getTagProperties(type).isStop()) { // only returns demand elements of a certain type. - for (auto i : myAttributeCarriers.demandElements.at(type)) { + for (auto i : myAttributeCarriers->getDemandElements().at(type)) { result.push_back(i.second); } } else { // return only a part of elements, depending of type switch (type) { case SUMO_TAG_JUNCTION: - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { result.push_back(i.second); } break; case SUMO_TAG_EDGE: - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { result.push_back(i.second); } break; case SUMO_TAG_LANE: - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { for (auto j : i.second->getLanes()) { result.push_back(j); } } break; case SUMO_TAG_CONNECTION: - for (auto i : myAttributeCarriers.edges) { + for (auto i : myAttributeCarriers->getEdges()) { for (auto j : i.second->getGNEConnections()) { result.push_back(j); } } break; case SUMO_TAG_CROSSING: - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { for (auto j : i.second->getGNECrossings()) { result.push_back(j); } } break; case SUMO_TAG_POLY: - for (auto i : myPolygons) { - result.push_back(dynamic_cast(i.second)); + for (const auto& polygon : myAttributeCarriers->getShapes().at(SUMO_TAG_POLY)) { + result.push_back(polygon.second); } break; case SUMO_TAG_POI: + for (const auto& POI : myAttributeCarriers->getShapes().at(SUMO_TAG_POI)) { + result.push_back(POI.second); + } + break; case SUMO_TAG_POILANE: - for (auto i : myPOIs) { - result.push_back(dynamic_cast(i.second)); + for (const auto& POILane : myAttributeCarriers->getShapes().at(SUMO_TAG_POILANE)) { + result.push_back(POILane.second); } break; default: @@ -1459,7 +1371,7 @@ void -GNENet::computeNetwork(GNEApplicationWindow* window, bool force, bool volatileOptions, std::string additionalPath, std::string demandPath) { +GNENet::computeNetwork(GNEApplicationWindow* window, bool force, bool volatileOptions, std::string additionalPath, std::string demandPath, std::string dataPath) { if (!myNeedRecompute) { if (force) { if (volatileOptions) { @@ -1479,61 +1391,36 @@ } // save current number of lanes for every edge if recomputing is with volatile options if (volatileOptions) { - for (auto it : myAttributeCarriers.edges) { + for (auto it : myAttributeCarriers->getEdges()) { myEdgesAndNumberOfLanes[it.second->getID()] = (int)it.second->getLanes().size(); } } - // compute and update OptionsCont& oc = OptionsCont::getOptions(); computeAndUpdate(oc, volatileOptions); - // load additionals if was recomputed with volatile options if (additionalPath != "") { - // fill additionals with tags - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_TAZ, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } // Create additional handler - GNEAdditionalHandler additionalHandler(additionalPath, myViewNet); + GNEAdditionalHandler additionalHandler(additionalPath, this); // Run parser if (!XMLSubSys::runParser(additionalHandler, additionalPath, false)) { WRITE_MESSAGE("Loading of " + additionalPath + " failed."); - } else { - // update view - update(); } // clear myEdgesAndNumberOfLanes after reload additionals myEdgesAndNumberOfLanes.clear(); } // load demand elements if was recomputed with volatile options if (demandPath != "") { - // fill demandElements with tags - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_STOP, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } // Create demandElement handler - GNERouteHandler demandElementHandler(demandPath, myViewNet, false); + GNERouteHandler demandElementHandler(demandPath, this, false); // Run parser if (!XMLSubSys::runParser(demandElementHandler, demandPath, false)) { WRITE_MESSAGE("Loading of " + demandPath + " failed."); - } else { - // update view - update(); } // clear myEdgesAndNumberOfLanes after reload demandElements myEdgesAndNumberOfLanes.clear(); } + UNUSED_PARAMETER(dataPath); window->getApp()->endWaitCursor(); window->setStatusBarText("Finished computing junctions."); } @@ -1543,7 +1430,7 @@ GNENet::computeDemandElements(GNEApplicationWindow* window) { window->setStatusBarText("Computing demand elements ..."); // iterate over all demand elements and compute - for (const auto& i : myAttributeCarriers.demandElements) { + for (const auto& i : myAttributeCarriers->getDemandElements()) { for (const auto& j : i.second) { j.second->computePath(); } @@ -1553,6 +1440,21 @@ void +GNENet::computeDataElements(GNEApplicationWindow* window) { + window->setStatusBarText("Computing data elements ..."); + /* + // iterate over all demand elements and compute + for (const auto& i : myAttributeCarriers->getDemandElements()) { + for (const auto& j : i.second) { + j.second->computePath(); + } + } + */ + window->setStatusBarText("Finished computing data elements."); +} + + +void GNENet::computeJunction(GNEJunction* junction) { // recompute tl-logics OptionsCont& oc = OptionsCont::getOptions(); @@ -1578,7 +1480,7 @@ bool GNENet::netHasGNECrossings() const { - for (auto n : myAttributeCarriers.junctions) { + for (auto n : myAttributeCarriers->getJunctions()) { if (n.second->getGNECrossings().size() > 0) { return true; } @@ -1621,13 +1523,13 @@ bool setTL; std::string id = "cluster"; TrafficLightType type; - SumoXMLNodeType nodeType = NODETYPE_UNKNOWN; + SumoXMLNodeType nodeType = SumoXMLNodeType::UNKNOWN; myNetBuilder->getNodeCont().analyzeCluster(cluster, id, pos, setTL, type, nodeType); // save position oldPos = pos; // Check that there isn't another junction in the same position as Pos but doesn't belong to cluster - for (auto i : myAttributeCarriers.junctions) { + for (auto i : myAttributeCarriers->getJunctions()) { if ((i.second->getPositionInView() == pos) && (cluster.find(i.second->getNBNode()) == cluster.end())) { // show warning in gui testing debug mode WRITE_DEBUG("Opening FXMessageBox 'Join non-selected junction'"); @@ -1688,19 +1590,18 @@ } // remap edges for (auto it : allIncoming) { - undoList->p_add(new GNEChange_Attribute(myAttributeCarriers.edges[it->getID()], this, SUMO_ATTR_TO, joined->getID())); + undoList->p_add(new GNEChange_Attribute(myAttributeCarriers->getEdges().at(it->getID()), SUMO_ATTR_TO, joined->getID())); } EdgeSet edgesWithin; for (auto it : allOutgoing) { // delete edges within the cluster - GNEEdge* e = myAttributeCarriers.edges[it->getID()]; - assert(e != 0); - if (e->getGNEJunctionDestiny() == joined) { + GNEEdge* edge = myAttributeCarriers->getEdges().at(it->getID()); + if (edge->getGNEJunctionDestiny() == joined) { edgesWithin.insert(it); - deleteEdge(e, undoList, false); + deleteEdge(edge, undoList, false); } else { - undoList->p_add(new GNEChange_Attribute(myAttributeCarriers.edges[it->getID()], this, SUMO_ATTR_FROM, joined->getID())); + undoList->p_add(new GNEChange_Attribute(myAttributeCarriers->getEdges().at(it->getID()), SUMO_ATTR_FROM, joined->getID())); } } @@ -1741,7 +1642,7 @@ GNENet::cleanInvalidCrossings(GNEUndoList* undoList) { // obtain current net's crossings std::vector myNetCrossings; - for (auto it : myAttributeCarriers.junctions) { + for (auto it : myAttributeCarriers->getJunctions()) { myNetCrossings.reserve(myNetCrossings.size() + it.second->getGNECrossings().size()); myNetCrossings.insert(myNetCrossings.end(), it.second->getGNECrossings().begin(), it.second->getGNECrossings().end()); } @@ -1793,7 +1694,7 @@ GNENet::removeSolitaryJunctions(GNEUndoList* undoList) { undoList->p_begin("Clean " + toString(SUMO_TAG_JUNCTION) + "s"); std::vector toRemove; - for (auto it : myAttributeCarriers.junctions) { + for (auto it : myAttributeCarriers->getJunctions()) { GNEJunction* junction = it.second; if (junction->getNBNode()->getEdges().size() == 0) { toRemove.push_back(junction); @@ -1810,9 +1711,9 @@ GNENet::cleanUnusedRoutes(GNEUndoList* undoList) { // first declare a vector to save all routes without children std::vector routesWithoutChildren; - routesWithoutChildren.reserve(myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE).size()); + routesWithoutChildren.reserve(myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE).size()); // iterate over routes - for (const auto& i : myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE)) { + for (const auto& i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE)) { if (i.second->getChildDemandElements().empty()) { routesWithoutChildren.push_back(i.second); } @@ -1826,8 +1727,6 @@ // due route doesn't have children, simply call GNEChange_DemandElement undoList->add(new GNEChange_DemandElement(i, false), true); } - // update view - myViewNet->update(); // end undo list undoList->p_end(); } @@ -1839,7 +1738,7 @@ // first declare a sorted set of sorted route's edges in string format std::set > mySortedRoutes; // iterate over routes and save it in mySortedRoutes (only if it doesn't have Stop Children) - for (const auto& i : myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE)) { + for (const auto& i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE)) { // first check route has stops bool hasStops = false; for (const auto& j : i.second->getChildDemandElements()) { @@ -1892,8 +1791,6 @@ } } } - // update view - myViewNet->update(); // end undo list undoList->p_end(); } @@ -1904,23 +1801,23 @@ GNENet::cleanInvalidDemandElements(GNEUndoList* undoList) { // first declare a vector to save all invalid demand elements std::vector invalidDemandElements; - invalidDemandElements.reserve(myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE).size() + - myAttributeCarriers.demandElements.at(SUMO_TAG_FLOW).size() + - myAttributeCarriers.demandElements.at(SUMO_TAG_TRIP).size()); + invalidDemandElements.reserve(myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE).size() + + myAttributeCarriers->getDemandElements().at(SUMO_TAG_FLOW).size() + + myAttributeCarriers->getDemandElements().at(SUMO_TAG_TRIP).size()); // iterate over routes - for (const auto& i : myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE)) { + for (const auto& i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE)) { if (!i.second->isDemandElementValid()) { invalidDemandElements.push_back(i.second); } } // iterate over flows - for (const auto& i : myAttributeCarriers.demandElements.at(SUMO_TAG_FLOW)) { + for (const auto& i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_FLOW)) { if (!i.second->isDemandElementValid()) { invalidDemandElements.push_back(i.second); } } // iterate over trip - for (const auto& i : myAttributeCarriers.demandElements.at(SUMO_TAG_TRIP)) { + for (const auto& i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_TRIP)) { if (!i.second->isDemandElementValid()) { invalidDemandElements.push_back(i.second); } @@ -1934,8 +1831,6 @@ // simply call GNEChange_DemandElement undoList->add(new GNEChange_DemandElement(i, false), true); } - // update view - myViewNet->update(); // end undo list undoList->p_end(); } @@ -1943,48 +1838,51 @@ void GNENet::replaceJunctionByGeometry(GNEJunction* junction, GNEUndoList* undoList) { - assert(junction->getNBNode()->checkIsRemovable()); - // start operation - undoList->p_begin("Replace junction by geometry"); - // obtain Edges to join - std::vector > toJoin = junction->getNBNode()->getEdgesToJoin(); - // clear connections of junction to replace - clearJunctionConnections(junction, undoList); - // iterate over NBEdges to join - for (auto j : toJoin) { - // obtain GNEEdges - GNEEdge* begin = myAttributeCarriers.edges[j.first->getID()]; - GNEEdge* continuation = myAttributeCarriers.edges[j.second->getID()]; - // remove connections between the edges - std::vector connections = begin->getNBEdge()->getConnections(); - for (auto con : connections) { - undoList->add(new GNEChange_Connection(begin, con, false, false), true); - } - // fix shape of replaced edge - PositionVector newShape = begin->getNBEdge()->getInnerGeometry(); - if (begin->getNBEdge()->hasDefaultGeometryEndpointAtNode(begin->getNBEdge()->getToNode())) { - newShape.push_back(junction->getNBNode()->getPosition()); - } else { - newShape.push_back(begin->getNBEdge()->getGeometry()[-1]); - } - if (continuation->getNBEdge()->hasDefaultGeometryEndpointAtNode(begin->getNBEdge()->getToNode())) { - newShape.push_back_noDoublePos(junction->getNBNode()->getPosition()); - } else { - newShape.push_back_noDoublePos(continuation->getNBEdge()->getGeometry()[0]); - } - // replace incoming edge - replaceIncomingEdge(continuation, begin, undoList); + if (junction->getNBNode()->checkIsRemovable()) { + // start operation + undoList->p_begin("Replace junction by geometry"); + // obtain Edges to join + std::vector > toJoin = junction->getNBNode()->getEdgesToJoin(); + // clear connections of junction to replace + clearJunctionConnections(junction, undoList); + // iterate over NBEdges to join + for (auto j : toJoin) { + // obtain GNEEdges + GNEEdge* begin = myAttributeCarriers->getEdges().at(j.first->getID()); + GNEEdge* continuation = myAttributeCarriers->getEdges().at(j.second->getID()); + // remove connections between the edges + std::vector connections = begin->getNBEdge()->getConnections(); + for (auto con : connections) { + undoList->add(new GNEChange_Connection(begin, con, false, false), true); + } + // fix shape of replaced edge + PositionVector newShape = begin->getNBEdge()->getInnerGeometry(); + if (begin->getNBEdge()->hasDefaultGeometryEndpointAtNode(begin->getNBEdge()->getToNode())) { + newShape.push_back(junction->getNBNode()->getPosition()); + } else { + newShape.push_back(begin->getNBEdge()->getGeometry()[-1]); + } + if (continuation->getNBEdge()->hasDefaultGeometryEndpointAtNode(begin->getNBEdge()->getToNode())) { + newShape.push_back_noDoublePos(junction->getNBNode()->getPosition()); + } else { + newShape.push_back_noDoublePos(continuation->getNBEdge()->getGeometry()[0]); + } + // replace incoming edge + replaceIncomingEdge(continuation, begin, undoList); - newShape.append(continuation->getNBEdge()->getInnerGeometry()); - begin->setAttribute(GNE_ATTR_SHAPE_END, continuation->getAttribute(GNE_ATTR_SHAPE_END), undoList); - 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()); + newShape.append(continuation->getNBEdge()->getInnerGeometry()); + begin->setAttribute(GNE_ATTR_SHAPE_END, continuation->getAttribute(GNE_ATTR_SHAPE_END), undoList); + 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()); + } + //delete replaced junction + deleteJunction(junction, undoList); + // finish operation + undoList->p_end(); + } else { + throw ProcessError("Junction isn't removable"); } - //delete replaced junction - deleteJunction(junction, undoList); - // finish operation - undoList->p_end(); } @@ -2000,7 +1898,7 @@ std::map> straightConnections; for (GNEEdge* e : junction->getGNEIncomingEdges()) { for (const auto& c : e->getNBEdge()->getConnections()) { - if (c.fromLane >= 0 && junction->getNBNode()->getDirection(e->getNBEdge(), c.toEdge) == LINKDIR_STRAIGHT) { + if (c.fromLane >= 0 && junction->getNBNode()->getDirection(e->getNBEdge(), c.toEdge) == LinkDirection::STRAIGHT) { straightConnections[e].push_back(c); } }; @@ -2021,19 +1919,19 @@ //std::cout << " incoming " << e->getID() << " pos=" << pos << " origTo=" << e->getNBEdge()->getParameter("origTo") << " newID=" << newID << "\n"; if (e->getNBEdge()->getGeometry().back().almostSame(pos) || e->getNBEdge()->getParameter("origTo") == newID) { //std::cout << " match\n"; - undoList->p_add(new GNEChange_Attribute(e, this, SUMO_ATTR_TO, newJunction->getID())); + undoList->p_add(new GNEChange_Attribute(e, SUMO_ATTR_TO, newJunction->getID())); } } for (GNEEdge* e : outgoing) { //std::cout << " outgoing " << e->getID() << " pos=" << pos << " origFrom=" << e->getNBEdge()->getParameter("origFrom") << " newID=" << newID << "\n"; if (e->getNBEdge()->getGeometry().front().almostSame(pos) || e->getNBEdge()->getParameter("origFrom") == newID) { //std::cout << " match\n"; - undoList->p_add(new GNEChange_Attribute(e, this, SUMO_ATTR_FROM, newJunction->getID())); + undoList->p_add(new GNEChange_Attribute(e, SUMO_ATTR_FROM, newJunction->getID())); } } if (newID != newJunction->getID()) { if (newJunction->isValid(SUMO_ATTR_ID, newID)) { - undoList->p_add(new GNEChange_Attribute(newJunction, this, SUMO_ATTR_ID, newID)); + undoList->p_add(new GNEChange_Attribute(newJunction, SUMO_ATTR_ID, newID)); } else { WRITE_WARNING("Could not rename split node to '" + newID + "'"); } @@ -2096,25 +1994,11 @@ void -GNENet::renameEdge(GNEEdge* edge, const std::string& newID) { - myAttributeCarriers.edges.erase(edge->getNBEdge()->getID()); - myNetBuilder->getEdgeCont().rename(edge->getNBEdge(), newID); - edge->setMicrosimID(newID); - myAttributeCarriers.edges[newID] = edge; - // rename all connections related to this edge - for (auto i : edge->getLanes()) { - i->updateConnectionIDs(); - } -} - - -void GNENet::changeEdgeEndpoints(GNEEdge* edge, const std::string& newSource, const std::string& newDest) { NBNode* from = retrieveJunction(newSource)->getNBNode(); NBNode* to = retrieveJunction(newDest)->getNBNode(); edge->getNBEdge()->reinitNodes(from, to); requireRecompute(); - update(); } @@ -2137,8 +2021,8 @@ if (AC && AC->isAttributeCarrierSelected()) { // now check if selected supermode is correct if (ignoreCurrentSupermode || - ((myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && !AC->getTagProperty().isDemandElement()) || - ((myViewNet->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && AC->getTagProperty().isDemandElement())) { + ((myViewNet->getEditModes().isCurrentSupermodeNetwork()) && !AC->getTagProperty().isDemandElement()) || + ((myViewNet->getEditModes().isCurrentSupermodeDemand()) && AC->getTagProperty().isDemandElement())) { // add it into result vector result.push_back(AC); } @@ -2161,18 +2045,6 @@ void -GNENet::renameJunction(GNEJunction* junction, const std::string& newID) { - std::string oldID = junction->getID(); - myAttributeCarriers.junctions.erase(junction->getNBNode()->getID()); - myNetBuilder->getNodeCont().rename(junction->getNBNode(), newID); - junction->setMicrosimID(newID); - myAttributeCarriers.junctions[newID] = junction; - // build crossings - junction->getNBNode()->buildCrossings(); -} - - -void GNENet::addExplicitTurnaround(std::string id) { myExplicitTurnarounds.insert(id); } @@ -2186,8 +2058,8 @@ GNEAdditional* GNENet::retrieveAdditional(SumoXMLTag type, const std::string& id, bool hardFail) const { - if ((myAttributeCarriers.additionals.count(type) > 0) && (myAttributeCarriers.additionals.at(type).count(id) != 0)) { - return myAttributeCarriers.additionals.at(type).at(id); + if ((myAttributeCarriers->getAdditionals().count(type) > 0) && (myAttributeCarriers->getAdditionals().at(type).count(id) != 0)) { + return myAttributeCarriers->getAdditionals().at(type).at(id); } else if (hardFail) { throw ProcessError("Attempted to retrieve non-existant additional"); } else { @@ -2200,7 +2072,7 @@ GNENet::retrieveAdditionals(bool onlySelected) const { std::vector result; // returns additionals depending of selection - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { for (auto j : i.second) { if (!onlySelected || j.second->isAttributeCarrierSelected()) { result.push_back(j.second); @@ -2214,7 +2086,7 @@ int GNENet::getNumberOfAdditionals(SumoXMLTag type) const { int counter = 0; - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { if ((type == SUMO_TAG_NOTHING) || (type == i.first)) { counter += (int)i.second.size(); } @@ -2224,26 +2096,14 @@ void -GNENet::updateAdditionalID(const std::string& oldID, GNEAdditional* additional) { - if (myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).count(oldID) == 0) { - throw ProcessError(additional->getTagStr() + " with old ID='" + oldID + "' doesn't exist"); - } else { - // remove an insert additional again into container - myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).erase(oldID); - myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).insert(std::make_pair(additional->getID(), additional)); - // additionals has to be saved - requireSaveAdditionals(true); - } -} - - -void GNENet::requireSaveAdditionals(bool value) { if (myAdditionalsSaved) { WRITE_DEBUG("Additionals has to be saved"); std::string netSaved = (myNetSaved ? "saved" : "unsaved"); std::string demandElementsSaved = (myDemandElementsSaved ? "saved" : "unsaved"); - WRITE_DEBUG("Current saving Status: net " + netSaved + ", additionals unsaved, demand elements " + demandElementsSaved); + std::string dataSetSaved = (myDataElementsSaved ? "saved" : "unsaved"); + WRITE_DEBUG("Current saving Status: net " + netSaved + ", additionals unsaved, demand elements " + + demandElementsSaved + ", data sets " + dataSetSaved); } myAdditionalsSaved = !value; if (myViewNet != nullptr) { @@ -2262,7 +2122,7 @@ std::vector invalidSingleLaneAdditionals; std::vector invalidMultiLaneAdditionals; // iterate over additionals and obtain invalids - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { for (auto j : i.second) { // check if has to be fixed if (j.second->getTagProperty().hasAttribute(SUMO_ATTR_LANE) && !j.second->isAdditionalValid()) { @@ -2288,8 +2148,8 @@ WRITE_DEBUG("Additionals saved after dialog"); } // update view - myViewNet->update(); - // set focus again in viewNet + myViewNet->updateViewNet(); + // set focus again in net myViewNet->setFocus(); } else { saveAdditionalsConfirmed(filename); @@ -2310,7 +2170,7 @@ std::string GNENet::generateAdditionalID(SumoXMLTag type) const { int counter = 0; - while (myAttributeCarriers.additionals.at(type).count(toString(type) + "_" + toString(counter)) != 0) { + while (myAttributeCarriers->getAdditionals().at(type).count(toString(type) + "_" + toString(counter)) != 0) { counter++; } return (toString(type) + "_" + toString(counter)); @@ -2319,8 +2179,8 @@ GNEDemandElement* GNENet::retrieveDemandElement(SumoXMLTag type, const std::string& id, bool hardFail) const { - if ((myAttributeCarriers.demandElements.count(type) > 0) && (myAttributeCarriers.demandElements.at(type).count(id) != 0)) { - return myAttributeCarriers.demandElements.at(type).at(id); + if ((myAttributeCarriers->getDemandElements().count(type) > 0) && (myAttributeCarriers->getDemandElements().at(type).count(id) != 0)) { + return myAttributeCarriers->getDemandElements().at(type).at(id); } else if (hardFail) { throw ProcessError("Attempted to retrieve non-existant demand element"); } else { @@ -2333,7 +2193,7 @@ GNENet::retrieveDemandElements(bool onlySelected) const { std::vector result; // returns demand elements depending of selection - for (auto i : myAttributeCarriers.demandElements) { + for (auto i : myAttributeCarriers->getDemandElements()) { for (auto j : i.second) { if (!onlySelected || j.second->isAttributeCarrierSelected()) { result.push_back(j.second); @@ -2347,7 +2207,7 @@ int GNENet::getNumberOfDemandElements(SumoXMLTag type) const { int counter = 0; - for (auto i : myAttributeCarriers.demandElements) { + for (auto i : myAttributeCarriers->getDemandElements()) { if ((type == SUMO_TAG_NOTHING) || (type == i.first)) { counter += (int)i.second.size(); } @@ -2357,49 +2217,14 @@ void -GNENet::updateDemandElementID(const std::string& oldID, GNEDemandElement* demandElement) { - if (myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).count(oldID) == 0) { - throw ProcessError(demandElement->getTagStr() + " with old ID='" + oldID + "' doesn't exist"); - } else { - // remove an insert demand element again into container - myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).erase(oldID); - myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).insert(std::make_pair(demandElement->getID(), demandElement)); - // remove an insert demand element again into vehicleDepartures container - if (demandElement->getTagProperty().isVehicle()) { - if (myAttributeCarriers.vehicleDepartures.count(demandElement->getBegin() + "_" + oldID) == 0) { - throw ProcessError(demandElement->getTagStr() + " with old ID='" + oldID + "' doesn't exist"); - } else { - myAttributeCarriers.vehicleDepartures.erase(demandElement->getBegin() + "_" + oldID); - myAttributeCarriers.vehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); - } - } - // demand elements has to be saved - requireSaveDemandElements(true); - } -} - - -void -GNENet::updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement) { - if (myAttributeCarriers.vehicleDepartures.count(oldBegin + "_" + demandElement->getID()) == 0) { - throw ProcessError(demandElement->getTagStr() + " with old begin='" + oldBegin + "' doesn't exist"); - } else { - // remove an insert demand element again into vehicleDepartures container - if (demandElement->getTagProperty().isVehicle()) { - myAttributeCarriers.vehicleDepartures.erase(oldBegin + "_" + demandElement->getID()); - myAttributeCarriers.vehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); - } - } -} - - -void GNENet::requireSaveDemandElements(bool value) { if (myDemandElementsSaved == true) { WRITE_DEBUG("DemandElements has to be saved"); std::string netSaved = (myNetSaved ? "saved" : "unsaved"); std::string additionalsSaved = (myAdditionalsSaved ? "saved" : "unsaved"); - WRITE_DEBUG("Current saving Status: net " + netSaved + ", additionals " + additionalsSaved + ", demand elements unsaved"); + std::string dataSetsSaved = (myDemandElementsSaved ? "saved" : "unsaved"); + WRITE_DEBUG("Current saving Status: net " + netSaved + ", additionals " + additionalsSaved + + ", demand elements unsaved, data sets " + dataSetsSaved); } myDemandElementsSaved = !value; if (myViewNet != nullptr) { @@ -2419,7 +2244,7 @@ // obtain invalid demandElements depending of number of their parent lanes std::vector invalidSingleLaneDemandElements; // iterate over demandElements and obtain invalids - for (const auto& demandElementSet : myAttributeCarriers.demandElements) { + for (const auto& demandElementSet : myAttributeCarriers->getDemandElements()) { for (const auto& demandElement : demandElementSet.second) { // compute before check if demand element is valid demandElement.second->computePath(); @@ -2445,8 +2270,8 @@ WRITE_DEBUG("demand elements saved after dialog"); } // update view - myViewNet->update(); - // set focus again in viewNet + myViewNet->updateViewNet(); + // set focus again in net myViewNet->setFocus(); } else { saveDemandElementsConfirmed(filename); @@ -2469,20 +2294,20 @@ int counter = 0; if ((type == SUMO_TAG_VEHICLE) || (type == SUMO_TAG_TRIP) || (type == SUMO_TAG_ROUTEFLOW) || (type == SUMO_TAG_FLOW)) { // special case for vehicles (Vehicles, Flows, Trips and routeFlows share nameSpaces) - while ((myAttributeCarriers.demandElements.at(SUMO_TAG_VEHICLE).count(prefix + toString(type) + "_" + toString(counter)) != 0) || - (myAttributeCarriers.demandElements.at(SUMO_TAG_TRIP).count(prefix + toString(type) + "_" + toString(counter)) != 0) || - (myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTEFLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0) || - (myAttributeCarriers.demandElements.at(SUMO_TAG_FLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0)) { + while ((myAttributeCarriers->getDemandElements().at(SUMO_TAG_VEHICLE).count(prefix + toString(type) + "_" + toString(counter)) != 0) || + (myAttributeCarriers->getDemandElements().at(SUMO_TAG_TRIP).count(prefix + toString(type) + "_" + toString(counter)) != 0) || + (myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTEFLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0) || + (myAttributeCarriers->getDemandElements().at(SUMO_TAG_FLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0)) { counter++; } } else if ((type == SUMO_TAG_PERSON) || (type == SUMO_TAG_PERSONFLOW)) { // special case for persons (person and personFlows share nameSpaces) - while ((myAttributeCarriers.demandElements.at(SUMO_TAG_PERSON).count(prefix + toString(type) + "_" + toString(counter)) != 0) || - (myAttributeCarriers.demandElements.at(SUMO_TAG_PERSONFLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0)) { + while ((myAttributeCarriers->getDemandElements().at(SUMO_TAG_PERSON).count(prefix + toString(type) + "_" + toString(counter)) != 0) || + (myAttributeCarriers->getDemandElements().at(SUMO_TAG_PERSONFLOW).count(prefix + toString(type) + "_" + toString(counter)) != 0)) { counter++; } } else { - while (myAttributeCarriers.demandElements.at(type).count(prefix + toString(type) + "_" + toString(counter)) != 0) { + while (myAttributeCarriers->getDemandElements().at(type).count(prefix + toString(type) + "_" + toString(counter)) != 0) { counter++; } } @@ -2490,12 +2315,259 @@ } +GNEDataSet* +GNENet::retrieveDataSet(const std::string& id, bool hardFail) const { + if (myAttributeCarriers->getDataSets().count(id) > 0) { + return myAttributeCarriers->getDataSets().at(id); + } else if (hardFail) { + throw ProcessError("Attempted to retrieve non-existant data set"); + } else { + return nullptr; + } +} + + +std::vector +GNENet::retrieveDataSets() const { + std::vector result; + result.reserve(myAttributeCarriers->getDataSets().size()); + // returns data sets + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + result.push_back(dataSet.second); + } + return result; +} + + +std::vector +GNENet::retrieveGenericDatas(bool onlySelected) const { + std::vector result; + size_t numGenericDatas = 0; + // first reserve + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + numGenericDatas += dataInterval.second->getGenericDataChildren().size(); + } + } + result.reserve(numGenericDatas); + // returns generic datas depending of selection + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + if (!onlySelected || genericData->isAttributeCarrierSelected()) { + result.push_back(genericData); + } + } + } + } + return result; +} + + +int +GNENet::getNumberOfDataSets() const { + return (int)myAttributeCarriers->getDataSets().size(); +} + + +void +GNENet::requireSaveDataElements(bool value) { + if (myDataElementsSaved == true) { + WRITE_DEBUG("DataSets has to be saved"); + std::string netSaved = (myNetSaved ? "saved" : "unsaved"); + std::string additionalsSaved = (myAdditionalsSaved ? "saved" : "unsaved"); + std::string demandEleementsSaved = (myDemandElementsSaved ? "saved" : "unsaved"); + WRITE_DEBUG("Current saving Status: net " + netSaved + ", additionals " + additionalsSaved + + ", demand elements " + demandEleementsSaved + ", data sets unsaved"); + } + myDataElementsSaved = !value; + if (myViewNet != nullptr) { + if (myDataElementsSaved) { + myViewNet->getViewParent()->getGNEAppWindows()->disableSaveDataElementsMenu(); + } else { + myViewNet->getViewParent()->getGNEAppWindows()->enableSaveDataElementsMenu(); + } + } +} + + +void +GNENet::saveDataElements(const std::string& filename) { + // first recompute data sets + computeDataElements(myViewNet->getViewParent()->getGNEAppWindows()); + // save data elements + saveDataElementsConfirmed(filename); + // change value of flag + myDataElementsSaved = true; + // show debug information + WRITE_DEBUG("data sets saved"); +} + + +bool +GNENet::isDataElementsSaved() const { + return myDataElementsSaved; +} + + +std::string +GNENet::generateDataSetID(const std::string& prefix) const { + const std::string dataSetTagStr = toString(SUMO_TAG_DATASET); + int counter = 0; + while (myAttributeCarriers->getDataSets().count(prefix + dataSetTagStr + "_" + toString(counter)) != 0) { + counter++; + } + return (prefix + dataSetTagStr + "_" + toString(counter)); +} + + +std::set +GNENet::retrieveGenericDataParameters(const std::string& genericDataTag, const double begin, const double end) const { + // declare solution + std::set attributesSolution; + // declare generic data vector + std::vector genericDatas; + // iterate over all data sets + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + for (const auto& interval : dataSet.second->getDataIntervalChildren()) { + // check interval + if ((interval.second->getAttributeDouble(SUMO_ATTR_BEGIN) >= begin) && (interval.second->getAttributeDouble(SUMO_ATTR_END) <= end)) { + // iterate over generic datas + for (const auto& genericData : interval.second->getGenericDataChildren()) { + if (genericDataTag.empty() || (genericData->getTagProperty().getTagStr() == genericDataTag)) { + genericDatas.push_back(genericData); + } + } + } + } + } + // iterate over generic datas + for (const auto& genericData : genericDatas) { + for (const auto& attribute : genericData->getParametersMap()) { + attributesSolution.insert(attribute.first); + } + } + return attributesSolution; +} + + +std::set +GNENet::retrieveGenericDataParameters(const std::string& dataSetID, const std::string& genericDataTag, + const std::string& beginStr, const std::string& endStr) const { + // declare solution + std::set attributesSolution; + // vector of data sets and intervals + std::vector dataSets; + std::vector dataIntervals; + // if dataSetID is empty, return all parameters + if (dataSetID.empty()) { + // add all data sets + dataSets.reserve(myAttributeCarriers->getDataSets().size()); + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + dataSets.push_back(dataSet.second); + } + } else if (myAttributeCarriers->getDataSets().count(dataSetID) > 0) { + dataSets.push_back(myAttributeCarriers->getDataSets().at(dataSetID)); + } else { + return attributesSolution; + } + // now continue with data intervals + int numberOfIntervals = 0; + for (const auto& dataSet : dataSets) { + numberOfIntervals += (int)dataSet->getDataIntervalChildren().size(); + } + // resize dataIntervals + dataIntervals.reserve(numberOfIntervals); + // add intervals + for (const auto& dataSet : dataSets) { + for (const auto& dataInterval : dataSet->getDataIntervalChildren()) { + // continue depending of begin and end + if (beginStr.empty() && endStr.empty()) { + dataIntervals.push_back(dataInterval.second); + } else if (endStr.empty()) { + // parse begin + const double begin = GNEAttributeCarrier::parse(beginStr); + if (dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN) >= begin) { + dataIntervals.push_back(dataInterval.second); + } + } else if (beginStr.empty()) { + // parse end + const double end = GNEAttributeCarrier::parse(endStr); + if (dataInterval.second->getAttributeDouble(SUMO_ATTR_END) <= end) { + dataIntervals.push_back(dataInterval.second); + } + } else { + // parse both begin end + const double begin = GNEAttributeCarrier::parse(beginStr); + const double end = GNEAttributeCarrier::parse(endStr); + if ((dataInterval.second->getAttributeDouble(SUMO_ATTR_BEGIN) >= begin) && + (dataInterval.second->getAttributeDouble(SUMO_ATTR_END) <= end)) { + dataIntervals.push_back(dataInterval.second); + } + } + } + } + // finally iterate over intervals and get attributes + for (const auto& dataInterval : dataIntervals) { + for (const auto& genericData : dataInterval->getGenericDataChildren()) { + // check generic data tag + if (genericDataTag.empty() || (genericData->getTagProperty().getTagStr() == genericDataTag)) { + for (const auto& attribute : genericData->getParametersMap()) { + attributesSolution.insert(attribute.first); + } + } + } + } + return attributesSolution; +} + + +double +GNENet::getDataSetIntervalMinimumBegin() const { + double minimumBegin = 0; + // update with first minimum (if exist) + if ((myAttributeCarriers->getDataSets().size() > 0) && (myAttributeCarriers->getDataSets().begin()->second->getDataIntervalChildren().size() > 0)) { + minimumBegin = myAttributeCarriers->getDataSets().begin()->second->getDataIntervalChildren().begin()->second->getAttributeDouble(SUMO_ATTR_BEGIN); + } + // iterate over all data sets + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + // iterate over interval + for (const auto& interval : dataSet.second->getDataIntervalChildren()) { + if (interval.second->getAttributeDouble(SUMO_ATTR_BEGIN) < minimumBegin) { + minimumBegin = interval.second->getAttributeDouble(SUMO_ATTR_BEGIN); + } + } + } + return minimumBegin; +} + + +double +GNENet::getDataSetIntervalMaximumEnd() const { + double maximumEnd = 0; + // update with first maximum (if exist) + if ((myAttributeCarriers->getDataSets().size() > 0) && (myAttributeCarriers->getDataSets().begin()->second->getDataIntervalChildren().size() > 0)) { + maximumEnd = myAttributeCarriers->getDataSets().begin()->second->getDataIntervalChildren().begin()->second->getAttributeDouble(SUMO_ATTR_END); + } + // iterate over all data sets + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + // iterate over interval + for (const auto& interval : dataSet.second->getDataIntervalChildren()) { + if (interval.second->getAttributeDouble(SUMO_ATTR_END) > maximumEnd) { + maximumEnd = interval.second->getAttributeDouble(SUMO_ATTR_END); + } + } + } + return maximumEnd; +} + + void GNENet::saveAdditionalsConfirmed(const std::string& filename) { OutputDevice& device = OutputDevice::getDevice(filename); device.writeXMLHeader("additional", "additional_file.xsd"); // now write all route probes (see Ticket #4058) - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { if (i.first == SUMO_TAG_ROUTEPROBE) { for (auto j : i.second) { j.second->writeAdditional(device); @@ -2503,7 +2575,7 @@ } } // now write all stoppingPlaces - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { if (GNEAttributeCarrier::getTagProperties(i.first).isStoppingPlace()) { for (auto j : i.second) { // only save stoppingPlaces that doesn't have Additional parents, because they are automatically writed by writeAdditional(...) parent's function @@ -2514,7 +2586,7 @@ } } // now write all detectors - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { if (GNEAttributeCarrier::getTagProperties(i.first).isDetector()) { for (auto j : i.second) { // only save Detectors that doesn't have Additional parents, because they are automatically writed by writeAdditional(...) parent's function @@ -2525,7 +2597,7 @@ } } // now write rest of additionals - for (auto i : myAttributeCarriers.additionals) { + for (auto i : myAttributeCarriers->getAdditionals()) { const auto& tagValue = GNEAttributeCarrier::getTagProperties(i.first); if (!tagValue.isStoppingPlace() && !tagValue.isDetector() && (i.first != SUMO_TAG_ROUTEPROBE) && (i.first != SUMO_TAG_VTYPE) && (i.first != SUMO_TAG_ROUTE)) { for (auto j : i.second) { @@ -2536,12 +2608,17 @@ } } } - // now write shapes and POIs - for (const auto& i : myPolygons) { - dynamic_cast(i.second)->writeShape(device); - } - for (const auto& i : myPOIs) { - dynamic_cast(i.second)->writeShape(device); + // write Polygons + for (const auto& poly : myAttributeCarriers->getShapes().at(SUMO_TAG_POLY)) { + poly.second->writeShape(device); + } + // write POIs + for (const auto& shape : myAttributeCarriers->getShapes()) { + for (const auto& POI : shape.second) { + if (POI.second->getTagProperty().getTag() != SUMO_TAG_POLY) { + POI.second->writeShape(device); + } + } } device.close(); } @@ -2552,33 +2629,73 @@ OutputDevice& device = OutputDevice::getDevice(filename); device.writeXMLHeader("routes", "routes_file.xsd"); // first write all vehicle types - for (auto i : myAttributeCarriers.demandElements.at(SUMO_TAG_VTYPE)) { + for (auto i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_VTYPE)) { i.second->writeDemandElement(device); } // first write all person types - for (auto i : myAttributeCarriers.demandElements.at(SUMO_TAG_PTYPE)) { + for (auto i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_PTYPE)) { i.second->writeDemandElement(device); } // now write all routes (and their associated stops) - for (auto i : myAttributeCarriers.demandElements.at(SUMO_TAG_ROUTE)) { + for (auto i : myAttributeCarriers->getDemandElements().at(SUMO_TAG_ROUTE)) { i.second->writeDemandElement(device); } // finally write all vehicles and persons sorted by depart time (and their associated stops, personPlans, etc.) - for (auto i : myAttributeCarriers.vehicleDepartures) { + for (auto i : myAttributeCarriers->getVehicleDepartures()) { i.second->writeDemandElement(device); } device.close(); } +void +GNENet::saveDataElementsConfirmed(const std::string& filename) { + OutputDevice& device = OutputDevice::getDevice(filename); + device.writeXMLHeader("meandata", "meandata_file.xsd"); + // write all data sets + for (const auto& dataSet : myAttributeCarriers->getDataSets()) { + dataSet.second->writeDataSet(device); + } + // close device + device.close(); +} + + +GNEShape* +GNENet::retrieveShape(SumoXMLTag type, const std::string& id, bool hardFail) const { + if ((myAttributeCarriers->getShapes().count(type) > 0) && (myAttributeCarriers->getShapes().at(type).count(id) != 0)) { + return myAttributeCarriers->getShapes().at(type).at(id); + } else if (hardFail) { + throw ProcessError("Attempted to retrieve non-existant shape"); + } else { + return nullptr; + } +} + + +std::vector +GNENet::retrieveShapes(bool onlySelected) const { + std::vector result; + // returns shapes depending of selection + for (auto i : myAttributeCarriers->getShapes()) { + for (auto j : i.second) { + if (!onlySelected || j.second->isAttributeCarrierSelected()) { + result.push_back(j.second); + } + } + } + return result; +} + + GNEPoly* -GNENet::addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col) { +GNENet::addPolygonForEditShapes(GNENetworkElement* networkElement, const PositionVector& shape, bool fill, RGBColor col) { if (shape.size() > 0) { // create poly for edit shapes GNEPoly* shapePoly = new GNEPoly(this, "edit_shape", "edit_shape", shape, false, fill, 0.3, col, GLO_POLYGON, 0, "", false, false, false); - shapePoly->setShapeEditedElement(netElement); + shapePoly->setShapeEditedElement(networkElement); myGrid.addAdditionalGLObject(shapePoly); - myViewNet->update(); + myViewNet->updateViewNet(); return shapePoly; } else { throw ProcessError("shape cannot be empty"); @@ -2589,11 +2706,12 @@ void GNENet::removePolygonForEditShapes(GNEPoly* polygon) { if (polygon) { - // remove it from Inspector Frame + // remove it from Inspector Frame and AttributeCarrierHierarchy myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(polygon); + myViewNet->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(polygon); // Remove from grid myGrid.removeAdditionalGLObject(polygon); - myViewNet->update(); + myViewNet->updateViewNet(); } else { throw ProcessError("Polygon for edit shapes has to be inicializated"); } @@ -2601,51 +2719,32 @@ std::string -GNENet::generateShapeID(SumoXMLTag shapeTag) const { - // generate tag depending of type of shape - if (shapeTag == SUMO_TAG_POLY) { - int counter = 0; - std::string newID = "poly_" + toString(counter); - // generate new IDs to find a non-assigned ID - while (myPolygons.get(newID) != nullptr) { +GNENet::generateShapeID(SumoXMLTag tag) const { + int counter = 0; + // generate tag depending of shape type + if (tag == SUMO_TAG_POLY) { + while (myAttributeCarriers->getShapes().at(tag).count(toString(tag) + "_" + toString(counter)) != 0) { counter++; - newID = "poly_" + toString(counter); } - return newID; + return (toString(tag) + "_" + toString(counter)); } else { - int counter = 0; - std::string newID = "POI_" + toString(counter); - // generate new IDs to find a non-assigned ID - while (myPOIs.get(newID) != nullptr) { + while (myAttributeCarriers->getShapes().at(tag).count(toString(SUMO_TAG_POI) + "_" + toString(counter)) != 0) { counter++; - newID = "POI_" + toString(counter); } - return newID; + return (toString(SUMO_TAG_POI) + "_" + toString(counter)); } } -void -GNENet::changeShapeID(GNEShape* s, const std::string& OldID) { - if (s->getTagProperty().getTag() == SUMO_TAG_POLY) { - if (myPolygons.get(OldID) == 0) { - throw UnknownElement("Polygon " + OldID); - } else { - myPolygons.changeID(OldID, s->getID()); - } - } else { - if (myPOIs.get(OldID) == 0) { - throw UnknownElement("POI " + OldID); - } else { - myPOIs.changeID(OldID, s->getID()); +int +GNENet::getNumberOfShapes(SumoXMLTag type) const { + int counter = 0; + for (auto i : myAttributeCarriers->getShapes()) { + if ((type == SUMO_TAG_NOTHING) || (type == i.first)) { + counter += (int)i.second.size(); } } -} - - -int -GNENet::getNumberOfShapes() const { - return (int)(myPolygons.size() + myPOIs.size()); + return counter; } @@ -2696,162 +2795,6 @@ return myUpdateGeometryEnabled; } -// --------------------------------------------------------------------------- -// GNENet - protected methods -// --------------------------------------------------------------------------- - -bool -GNENet::additionalExist(GNEAdditional* additional) const { - // first check that additional pointer is valid - if (additional) { - return myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).find(additional->getID()) != - myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).end(); - } else { - throw ProcessError("Invalid additional pointer"); - } -} - - -void -GNENet::insertAdditional(GNEAdditional* additional) { - // Check if additional element exists before insertion - if (!additionalExist(additional)) { - myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).insert(std::make_pair(additional->getID(), additional)); - // only add drawable elements in grid - if (additional->getTagProperty().isDrawable() && additional->getTagProperty().isPlacedInRTree()) { - myGrid.addAdditionalGLObject(additional); - } - // check if additional is selected - if (additional->isAttributeCarrierSelected()) { - additional->selectAttributeCarrier(false); - } - // update geometry after insertion of additionals if myUpdateGeometryEnabled is enabled - if (myUpdateGeometryEnabled) { - additional->updateGeometry(); - } - // additionals has to be saved - requireSaveAdditionals(true); - } else { - throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' already exist"); - } -} - - -bool -GNENet::deleteAdditional(GNEAdditional* additional, bool updateViewAfterDeleting) { - // first check that additional pointer is valid - if (additionalExist(additional)) { - // obtain demand element and erase it from container - auto it = myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).find(additional->getID()); - myAttributeCarriers.additionals.at(additional->getTagProperty().getTag()).erase(it); - // remove it from Inspector Frame - myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(additional); - // only remove drawable elements of grid - if (additional->getTagProperty().isDrawable() && additional->getTagProperty().isPlacedInRTree()) { - myGrid.removeAdditionalGLObject(additional); - } - // check if additional is selected - if (additional->isAttributeCarrierSelected()) { - additional->unselectAttributeCarrier(false); - } - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } - // additionals has to be saved - requireSaveAdditionals(true); - // additional removed, then return true - return true; - } else { - throw ProcessError("Invalid additional pointer"); - } -} - - -bool -GNENet::demandElementExist(GNEDemandElement* demandElement) const { - // first check that demandElement pointer is valid - if (demandElement) { - return myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).find(demandElement->getID()) != - myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).end(); - } else { - throw ProcessError("Invalid demandElement pointer"); - } -} - - -void -GNENet::insertDemandElement(GNEDemandElement* demandElement) { - // Check if demandElement element exists before insertion - if (!demandElementExist(demandElement)) { - // insert in demandElements container - myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).insert(std::make_pair(demandElement->getID(), demandElement)); - // also insert in vehicleDepartures container if it's either a vehicle or a person - if (demandElement->getTagProperty().isVehicle() || demandElement->getTagProperty().isPerson()) { - if (myAttributeCarriers.vehicleDepartures.count(demandElement->getBegin() + "_" + demandElement->getID()) != 0) { - throw ProcessError(demandElement->getTagStr() + " with departure ='" + demandElement->getBegin() + "_" + demandElement->getID() + "' already inserted"); - } else { - myAttributeCarriers.vehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); - } - } - // only add drawable elements in grid - if (demandElement->getTagProperty().isDrawable() && demandElement->getTagProperty().isPlacedInRTree()) { - myGrid.addAdditionalGLObject(demandElement); - } - // check if demandElement is selected - if (demandElement->isAttributeCarrierSelected()) { - demandElement->selectAttributeCarrier(false); - } - // update geometry after insertion of demandElements if myUpdateGeometryEnabled is enabled - if (myUpdateGeometryEnabled) { - demandElement->updateGeometry(); - } - // demandElements has to be saved - requireSaveDemandElements(true); - } else { - throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' already exist"); - } -} - - -bool -GNENet::deleteDemandElement(GNEDemandElement* demandElement, bool updateViewAfterDeleting) { - // first check that demandElement pointer is valid - if (demandElementExist(demandElement)) { - // obtain demand element and erase it from container - auto it = myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).find(demandElement->getID()); - myAttributeCarriers.demandElements.at(demandElement->getTagProperty().getTag()).erase(it); - // remove it from Inspector Frame - myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(demandElement); - // also remove fromvehicleDepartures container if it's either a vehicle or a person - if (demandElement->getTagProperty().isVehicle() || demandElement->getTagProperty().isPerson()) { - if (myAttributeCarriers.vehicleDepartures.count(demandElement->getBegin() + "_" + demandElement->getID()) == 0) { - throw ProcessError(demandElement->getTagStr() + " with departure ='" + demandElement->getBegin() + "_" + demandElement->getID() + "' doesn't exist"); - } else { - myAttributeCarriers.vehicleDepartures.erase(demandElement->getBegin() + "_" + demandElement->getID()); - } - } - // only remove drawable elements of grid - if (demandElement->getTagProperty().isDrawable() && demandElement->getTagProperty().isPlacedInRTree()) { - myGrid.removeAdditionalGLObject(demandElement); - } - // check if demandElement is selected - if (demandElement->isAttributeCarrierSelected()) { - demandElement->unselectAttributeCarrier(false); - } - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } - // demandElements has to be saved - requireSaveDemandElements(true); - // demandElement removed, then return true - return true; - } else { - throw ProcessError("Invalid demandElement pointer"); - } -} - // =========================================================================== // private // =========================================================================== @@ -2862,28 +2805,28 @@ NBNodeCont& nodeContainer = myNetBuilder->getNodeCont(); for (auto name_it : nodeContainer.getAllNames()) { NBNode* nbn = nodeContainer.retrieve(name_it); - registerJunction(new GNEJunction(this, nbn, true)); + myAttributeCarriers->registerJunction(new GNEJunction(this, nbn, true)); } // init edges NBEdgeCont& ec = myNetBuilder->getEdgeCont(); for (auto name_it : ec.getAllNames()) { NBEdge* nbe = ec.retrieve(name_it); - registerEdge(new GNEEdge(this, nbe, false, true)); + myAttributeCarriers->registerEdge(new GNEEdge(this, nbe, false, true)); if (myGrid.getWidth() > 10e16 || myGrid.getHeight() > 10e16) { throw ProcessError("Network size exceeds 1 Lightyear. Please reconsider your inputs.\n"); } } // make sure myGrid is initialized even for an empty net - if (myAttributeCarriers.edges.size() == 0) { + if (myAttributeCarriers->getEdges().size() == 0) { myGrid.add(Boundary(0, 0, 100, 100)); } // recalculate all lane2lane connections - for (const auto& i : myAttributeCarriers.edges) { - for (const auto& j : i.second->getLanes()) { - j->updateGeometry(); + for (const auto& edge : myAttributeCarriers->getEdges()) { + for (const auto& lane : edge.second->getLanes()) { + lane->updateGeometry(); } } @@ -2893,186 +2836,6 @@ void -GNENet::insertJunction(GNEJunction* junction) { - myNetBuilder->getNodeCont().insert(junction->getNBNode()); - registerJunction(junction); -} - - -void -GNENet::insertEdge(GNEEdge* edge) { - NBEdge* nbe = edge->getNBEdge(); - myNetBuilder->getEdgeCont().insert(nbe); // should we ignore pruning double edges? - // if this edge was previouls extracted from the edgeContainer we have to rewire the nodes - nbe->getFromNode()->addOutgoingEdge(nbe); - nbe->getToNode()->addIncomingEdge(nbe); - registerEdge(edge); -} - - -GNEJunction* -GNENet::registerJunction(GNEJunction* junction) { - // increase reference - junction->incRef("GNENet::registerJunction"); - junction->setResponsible(false); - myAttributeCarriers.junctions[junction->getMicrosimID()] = junction; - // add it into grid - myGrid.add(junction->getCenteringBoundary()); - myGrid.addAdditionalGLObject(junction); - // update geometry - junction->updateGeometry(); - // check if junction is selected - if (junction->isAttributeCarrierSelected()) { - junction->selectAttributeCarrier(false); - } - // @todo let Boundary class track z-coordinate natively - const double z = junction->getNBNode()->getPosition().z(); - if (z != 0) { - myZBoundary.add(z, Z_INITIALIZED); - } - update(); - return junction; -} - - -GNEEdge* -GNENet::registerEdge(GNEEdge* edge) { - edge->incRef("GNENet::registerEdge"); - edge->setResponsible(false); - // add edge to internal container of GNENet - myAttributeCarriers.edges[edge->getMicrosimID()] = edge; - // add edge to grid - myGrid.add(edge->getCenteringBoundary()); - myGrid.addAdditionalGLObject(edge); - // check if edge is selected - if (edge->isAttributeCarrierSelected()) { - edge->selectAttributeCarrier(false); - } - // Add references into GNEJunctions - edge->getGNEJunctionSource()->addOutgoingGNEEdge(edge); - edge->getGNEJunctionDestiny()->addIncomingGNEEdge(edge); - // update view - update(); - return edge; -} - - -void -GNENet::deleteSingleJunction(GNEJunction* junction, bool updateViewAfterDeleting) { - // remove it from Inspector Frame - myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(junction); - // Remove from grid and container - myGrid.removeAdditionalGLObject(junction); - // check if junction is selected - if (junction->isAttributeCarrierSelected()) { - junction->unselectAttributeCarrier(false); - } - myAttributeCarriers.junctions.erase(junction->getMicrosimID()); - myNetBuilder->getNodeCont().extract(junction->getNBNode()); - junction->decRef("GNENet::deleteSingleJunction"); - junction->setResponsible(true); - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } -} - - -void -GNENet::deleteSingleEdge(GNEEdge* edge, bool updateViewAfterDeleting) { - // remove it from Inspector Frame - myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(edge); - // remove edge from visual grid and container - myGrid.removeAdditionalGLObject(edge); - // check if junction is selected - if (edge->isAttributeCarrierSelected()) { - edge->unselectAttributeCarrier(false); - } - myAttributeCarriers.edges.erase(edge->getMicrosimID()); - // extract edge of district container - myNetBuilder->getEdgeCont().extract(myNetBuilder->getDistrictCont(), edge->getNBEdge()); - edge->decRef("GNENet::deleteSingleEdge"); - edge->setResponsible(true); - // Remove refrences from GNEJunctions - edge->getGNEJunctionSource()->removeOutgoingGNEEdge(edge); - edge->getGNEJunctionDestiny()->removeIncomingGNEEdge(edge); - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } -} - - -void -GNENet::insertShape(GNEShape* shape, bool updateViewAfterDeleting) { - // add shape depending of their type and if is selected - if (shape->getTagProperty().getTag() == SUMO_TAG_POLY) { - GUIPolygon* poly = dynamic_cast(shape); - // all polys are placed over RTree - myGrid.addAdditionalGLObject(poly); - myPolygons.add(shape->getID(), poly); - } else { - GUIPointOfInterest* poi = dynamic_cast(shape); - // Only certain POIs are placed in RTrees - if (shape->getTagProperty().isPlacedInRTree()) { - myGrid.addAdditionalGLObject(poi); - } - myPOIs.add(shape->getID(), poi); - - } - // check if shape has to be selected - if (shape->isAttributeCarrierSelected()) { - shape->selectAttributeCarrier(false); - } - // insert shape requires always save additionals - requireSaveAdditionals(true); - // after inserting, update geometry (needed for POILanes - shape->updateGeometry(); - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } -} - - -void -GNENet::removeShape(GNEShape* shape, bool updateViewAfterDeleting) { - // remove it from Inspector Frame - myViewNet->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(shape); - if (shape->getTagProperty().getTag() == SUMO_TAG_POLY) { - GUIPolygon* poly = dynamic_cast(shape); - myGrid.removeAdditionalGLObject(poly); - myPolygons.remove(shape->getID(), false); - } else { - GUIPointOfInterest* poi = dynamic_cast(shape); - // only certain POIS are placed in RTREE - if (shape->getTagProperty().isPlacedInRTree()) { - myGrid.removeAdditionalGLObject(poi); - } - myPOIs.remove(shape->getID(), false); - } - // check if shape has to be unselected - if (shape->isAttributeCarrierSelected()) { - shape->unselectAttributeCarrier(false); - } - // remove shape requires always save additionals - requireSaveAdditionals(true); - // check if view has to be updated - if (updateViewAfterDeleting) { - myViewNet->update(); - } -} - - -void -GNENet::update() { - if (myViewNet) { - myViewNet->update(); - } -} - - -void GNENet::reserveEdgeID(const std::string& id) { myEdgeIDSupplier.avoid(id); } @@ -3086,12 +2849,12 @@ void GNENet::initGNEConnections() { - for (const auto& i : myAttributeCarriers.edges) { + for (const auto& edge : myAttributeCarriers->getEdges()) { // remake connections - i.second->remakeGNEConnections(); + edge.second->remakeGNEConnections(); // update geometry of connections - for (const auto& j : i.second->getGNEConnections()) { - j->updateGeometry(); + for (const auto& connection : edge.second->getGNEConnections()) { + connection->updateGeometry(); } } } @@ -3101,44 +2864,32 @@ GNENet::computeAndUpdate(OptionsCont& oc, bool volatileOptions) { // make sure we only add turn arounds to edges which currently exist within the network std::set liveExplicitTurnarounds; - for (auto it : myExplicitTurnarounds) { - if (myAttributeCarriers.edges.count(it) > 0) { - liveExplicitTurnarounds.insert(it); + for (const auto& explicitTurnarounds : myExplicitTurnarounds) { + if (myAttributeCarriers->getEdges().count(explicitTurnarounds) > 0) { + liveExplicitTurnarounds.insert(explicitTurnarounds); } } // removes all junctions of grid WRITE_GLDEBUG("Removing junctions during recomputing"); - for (const auto& it : myAttributeCarriers.junctions) { + for (const auto& it : myAttributeCarriers->getJunctions()) { myGrid.removeAdditionalGLObject(it.second); } // remove all edges from grid WRITE_GLDEBUG("Removing edges during recomputing"); - for (const auto& it : myAttributeCarriers.edges) { + for (const auto& it : myAttributeCarriers->getEdges()) { myGrid.removeAdditionalGLObject(it.second); } // compute using NetBuilder myNetBuilder->compute(oc, liveExplicitTurnarounds, volatileOptions); - // update ids if necessary + // remap ids if necessary if (oc.getBool("numerical-ids") || oc.isSet("reserved-ids")) { - std::map newEdgeMap; - std::map newJunctionMap; - // fill newEdgeMap - for (auto it : myAttributeCarriers.edges) { - it.second->setMicrosimID(it.second->getNBEdge()->getID()); - newEdgeMap[it.second->getNBEdge()->getID()] = it.second; - } - for (auto it : myAttributeCarriers.junctions) { - newJunctionMap[it.second->getNBNode()->getID()] = it.second; - it.second->setMicrosimID(it.second->getNBNode()->getID()); - } - myAttributeCarriers.edges = newEdgeMap; - myAttributeCarriers.junctions = newJunctionMap; + myAttributeCarriers->remapJunctionAndEdgeIds(); } // update rtree if necessary if (!oc.getBool("offset.disable-normalization")) { - for (auto it : myAttributeCarriers.edges) { + for (const auto& edge : myAttributeCarriers->getEdges()) { // refresh edge geometry - it.second->updateGeometry(); + edge.second->updateGeometry(); } } // Clear current inspected ACs in inspectorFrame if a previous net was loaded @@ -3150,7 +2901,7 @@ myGrid.add(GeoConvHelper::getFinal().getConvBoundary()); // if volatile options are true if (volatileOptions) { - // check that viewNet exist + // check that net exist if (myViewNet == nullptr) { throw ProcessError("ViewNet doesn't exist"); } @@ -3158,64 +2909,12 @@ myUpdateGeometryEnabled = false; // clear undo list (This will be remove additionals and shapes) myViewNet->getUndoList()->p_clear(); - // remove all edges of net (It was already removed from grid) - auto copyOfEdges = myAttributeCarriers.edges; - for (auto it : copyOfEdges) { - myAttributeCarriers.edges.erase(it.second->getMicrosimID()); - } - // removes all junctions of net (It was already removed from grid) - auto copyOfJunctions = myAttributeCarriers.junctions; - for (auto it : copyOfJunctions) { - myAttributeCarriers.junctions.erase(it.second->getMicrosimID()); - } - // clear rest of additional that weren't removed during cleaning of undo list - for (const auto& it : myAttributeCarriers.additionals) { - for (const auto& j : it.second) { - // only remove drawable additionals - if (j.second->getTagProperty().isDrawable()) { - myGrid.removeAdditionalGLObject(j.second); - } - } - } - myAttributeCarriers.additionals.clear(); - // fill additionals with tags (note: this include the TAZS) - auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_ADDITIONAL, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_TAZ, false); - for (auto i : listOfTags) { - myAttributeCarriers.additionals.insert(std::make_pair(i, std::map())); - } - // clear rest of polygons that weren't removed during cleaning of undo list - for (const auto& it : myPolygons) { - myGrid.removeAdditionalGLObject(dynamic_cast(it.second)); - } - myPolygons.clear(); - // clear rest of POIs that weren't removed during cleaning of undo list - for (const auto& it : myPOIs) { - myGrid.removeAdditionalGLObject(dynamic_cast(it.second)); - } - myPOIs.clear(); - // clear rest of demand elements that weren't removed during cleaning of undo list - for (const auto& it : myAttributeCarriers.demandElements) { - for (const auto& j : it.second) { - // only remove drawable additionals - if (j.second->getTagProperty().isDrawable()) { - myGrid.removeAdditionalGLObject(j.second); - } - } - } - myAttributeCarriers.additionals.clear(); - // fill demand elements with tags - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_DEMANDELEMENT, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } - listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNEAttributeCarrier::TagType::TAGTYPE_STOP, false); - for (auto i : listOfTags) { - myAttributeCarriers.demandElements.insert(std::make_pair(i, std::map())); - } + // clear all elements (it will also removed from grid) + myAttributeCarriers->clearJunctions(); + myAttributeCarriers->clearEdges(); + myAttributeCarriers->clearAdditionals(); + myAttributeCarriers->clearShapes(); + myAttributeCarriers->clearDemandElements(); // enable update geometry again myUpdateGeometryEnabled = true; // Write GL debug information @@ -3225,29 +2924,29 @@ } else { // insert all junctions of grid again WRITE_GLDEBUG("Add junctions during recomputing after calling myNetBuilder->compute(...)"); - for (const auto& it : myAttributeCarriers.junctions) { - myGrid.addAdditionalGLObject(it.second); + for (const auto& junction : myAttributeCarriers->getJunctions()) { + myGrid.addAdditionalGLObject(junction.second); } // insert all edges from grid again - WRITE_GLDEBUG("Add egdges during recomputing after calling myNetBuilder->compute(...)"); - for (const auto& it : myAttributeCarriers.edges) { - myGrid.addAdditionalGLObject(it.second); + WRITE_GLDEBUG("Add edges during recomputing after calling myNetBuilder->compute(...)"); + for (const auto& edge : myAttributeCarriers->getEdges()) { + myGrid.addAdditionalGLObject(edge.second); } // remake connections - for (auto it : myAttributeCarriers.edges) { - it.second->remakeGNEConnections(); + for (const auto& connection : myAttributeCarriers->getEdges()) { + connection.second->remakeGNEConnections(); } // iterate over junctions of net - for (const auto& it : myAttributeCarriers.junctions) { + for (const auto& junction : myAttributeCarriers->getJunctions()) { // undolist may not yet exist but is also not needed when just marking junctions as valid - it.second->setLogicValid(true, nullptr); + junction.second->setLogicValid(true, nullptr); // updated geometry - it.second->updateGeometryAfterNetbuild(); + junction.second->updateGeometryAfterNetbuild(); } // iterate over all edges of net - for (const auto& it : myAttributeCarriers.edges) { + for (const auto& edge : myAttributeCarriers->getEdges()) { // update geometry - it.second->updateGeometry(); + edge.second->updateGeometry(); } } // net recomputed, then return false; @@ -3266,4 +2965,5 @@ ac->setAttribute(key, toString(newValues), undoList); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNENet.h sumo-1.6.0+dfsg1/src/netedit/GNENet.h --- sumo-1.5.0+dfsg1/src/netedit/GNENet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNENet.h 2020-04-27 21:47:56.000000000 +0000 @@ -26,50 +26,9 @@ // call NBNetBuilder::buildLoaded to save results // /****************************************************************************/ -#ifndef GNENet_h -#define GNENet_h +#pragma once - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== - -class NBNetBuilder; -class GNEAdditional; -class GNEDemandElement; -class GNEApplicationWindow; -class GNEAttributeCarrier; -class GNEConnection; -class GNECrossing; -class GNEEdge; -class GNEJunction; -class GNELane; -class GNENetElement; -class GNEPOI; -class GNEPoly; -class GNEShape; -class GNEUndoList; -class GNEViewNet; +#include "GNENetHelper.h" // =========================================================================== // class definitions @@ -78,39 +37,9 @@ * @class GNENet * @brief A NBNetBuilder extended by visualisation and editing capabilities */ -class GNENet : public GUIGlObject, public ShapeContainer { - - /// @brief declare friend class - friend class GNEAdditionalHandler; - friend class GNERouteHandler; - friend class GNEChange_Junction; - friend class GNEChange_Edge; - friend class GNEChange_Lane; - friend class GNEChange_Connection; - friend class GNEChange_Shape; - friend class GNEChange_CalibratorItem; - friend class GNEChange_Additional; - friend class GNEChange_DemandElement; +class GNENet : public GUIGlObject { public: - /// @brief struct used for saving all attribute carriers of net, in different formats - struct AttributeCarriers { - /// @brief map with the name and pointer to junctions of net - std::map junctions; - - /// @brief map with the name and pointer to edges of net - std::map edges; - - /// @brief map with the name and pointer to additional elements of net - std::map > additionals; - - /// @brief map with the name and pointer to demand elements of net - std::map > demandElements; - - /// @brief special map used for saving Demand Elements of type "Vehicle" (Vehicles, routeFlows, etc.) sorted by depart time - std::map vehicleDepartures; - }; - /**@brief Constructor * @param[in] netbuilder the netbuilder which may already have been filled * GNENet becomes responsible for cleaning this up @@ -120,6 +49,12 @@ /// @brief Destructor ~GNENet(); + /// @brief retrieve all attribute carriers of Net + GNENetHelper::AttributeCarriers* getAttributeCarriers() const; + + /// @brief obtain instance of PathCalculator + GNENetHelper::PathCalculator* getPathCalculator(); + /// @name inherited from GUIGlObject /// @{ /**@brief Returns an own popup-menu @@ -147,9 +82,15 @@ */ Boundary getCenteringBoundary() const; + /// @brief expand boundary + void expandBoundary(const Boundary& newBoundary); + /// @brief Returns the Z boundary (stored in the x() coordinate) values of 0 do not affect the boundary const Boundary& getZBoundary() const; + /// @brief add Z in net boundary + void addZValueInBoundary(const double z); + /**@brief Draws the object * @param[in] s The settings for the current view (may influence drawing) * @see GUIGlObject::drawGL @@ -157,61 +98,14 @@ void drawGL(const GUIVisualizationSettings& s) const; /// @} - /// @name inherited from ShapeHandler - /// @{ - - /**@brief Builds a polygon using the given values and adds it to the container - * @param[in] id The name of the polygon - * @param[in] type The (abstract) type of the polygon - * @param[in] color The color of the polygon - * @param[in] layer The layer of the polygon - * @param[in] angle The rotation of the polygon - * @param[in] imgFile The raster image of the polygon - * @param[in] relativePath set image file as relative path - * @param[in] shape The shape of the polygon - * @param[in] geo specify if shape was loaded as GEO coordinate - * @param[in] fill Whether the polygon shall be filled - * @param[in] lineWidth The widht for drawing unfiled polygon - * @return whether the polygon could be added - */ - bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer, - double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, - bool geo, bool fill, double lineWidth, bool ignorePruning = false); - - /**@brief Builds a POI using the given values and adds it to the container - * @param[in] id The name of the POI - * @param[in] type The (abstract) type of the POI - * @param[in] color The color of the POI - * @param[in] pos The position of the POI - * @param[in[ geo use GEO coordinates (lon/lat) - * @param[in] lane The Lane in which this POI is placed - * @param[in] posOverLane The position over Lane - * @param[in] posLat The position lateral over Lane - * @param[in] layer The layer of the POI - * @param[in] angle The rotation of the POI - * @param[in] imgFile The raster image of the POI - * @param[in] relativePath set image file as relative path - * @param[in] width The width of the POI image - * @param[in] height The height of the POI image - * @return whether the poi could be added - */ - bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, - const std::string& lane, double posOverLane, double posLat, double layer, double angle, - const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false); - /// @} - /// @brief returns the bounder of the network const Boundary& getBoundary() const; /**@brief Returns the RTree used for visualisation speed-up * @return The visualisation speed-up + * @note only use in GNEViewNet constructor */ - SUMORTree& getVisualisationSpeedUp(); - - /**@brief Returns the RTree used for visualisation speed-up - * @return The visualisation speed-up - */ - const SUMORTree& getVisualisationSpeedUp() const; + SUMORTree& getGrid(); /**@brief creates a new junction * @param[in] position The position of the new junction @@ -291,6 +185,24 @@ */ void deleteDemandElement(GNEDemandElement* demandElement, GNEUndoList* undoList); + /**@brief remove data set + * @param[in] dataSet The data set to be removed + * @param[in] undoList The undolist in which to mark changes + */ + void deleteDataSet(GNEDataSet* dataSet, GNEUndoList* undoList); + + /**@brief remove data interval + * @param[in] dataInterval The data interval to be removed + * @param[in] undoList The undolist in which to mark changes + */ + void deleteDataInterval(GNEDataInterval* dataInterval, GNEUndoList* undoList); + + /**@brief remove generic data + * @param[in] genericData The generic data to be removed + * @param[in] undoList The undolist in which to mark changes + */ + void deleteGenericData(GNEGenericData* genericData, GNEUndoList* undoList); + /**@brief duplicates lane * @param[in] lane The lane to be duplicated * @param[in] undoList The undolist in which to mark changes @@ -351,9 +263,6 @@ */ void mergeJunctions(GNEJunction* moved, GNEJunction* target, GNEUndoList* undoList); - /// @brief retrieve all attribute carriers of Net - const AttributeCarriers& getAttributeCarriers() const; - /**@brief get junction by id * @param[in] id The id of the desired junction * @param[in] failHard Whether attempts to retrieve a nonexisting junction should result in an exception @@ -375,20 +284,6 @@ */ GNEEdge* retrieveEdge(GNEJunction* from, GNEJunction* to, bool failHard = true) const; - /**@brief get Polygon by id - * @param[in] id The id of the desired polygon - * @param[in] failHard Whether attempts to retrieve a nonexisting polygon should result in an exception - * @throws UnknownElement - */ - GNEPoly* retrievePolygon(const std::string& id, bool failHard = true) const; - - /**@brief get POI by id - * @param[in] id The id of the desired POI - * @param[in] failHard Whether attempts to retrieve a nonexisting POI should result in an exception - * @throws UnknownElement - */ - GNEPOI* retrievePOI(const std::string& id, bool failHard = true) const; - /**@brief get Connection by id * @param[in] id The id of the desired Connection * @param[in] failHard Whether attempts to retrieve a nonexisting Connection should result in an exception @@ -418,7 +313,7 @@ * @param[in] failHard Whether attempts to retrieve a nonexisting AttributeCarrier should result in an exception * @throws InvalidArgument if GL ID doesn't have a associated Attribute Carrier */ - GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true); + GNEAttributeCarrier* retrieveAttributeCarrier(const GUIGlID id, bool failHard = true) const; /**@brief get the attribute carriers based on Type * @param[in] type The GUI-type of the AC. SUMO_TAG_NOTHING returns all elements (Warning: bottleneck) @@ -480,20 +375,14 @@ */ void saveJoined(OptionsCont& oc); - /// @brief Set the viewNet to be notified of network changes + /// @brief Set the net to be notified of network changes void setViewNet(GNEViewNet* viewNet); /// @brief add GL Object into net - void addGLObjectIntoGrid(GUIGlObject* o); + void addGLObjectIntoGrid(GNEAttributeCarrier* AC); /// @brief add GL Object into net - void removeGLObjectFromGrid(GUIGlObject* o); - - /// @brief updates the map and reserves new id - void renameEdge(GNEEdge* edge, const std::string& newID); - - /// @brief updates the map and reserves new id - void renameJunction(GNEJunction* junction, const std::string& newID); + void removeGLObjectFromGrid(GNEAttributeCarrier* AC); /// @brief modifies endpoins of the given edge void changeEdgeEndpoints(GNEEdge* edge, const std::string& newSourceID, const std::string& newDestID); @@ -522,14 +411,20 @@ * param[in] volatileOptions enable or disable volatile options * param[in] additionalPath path in wich additionals were saved before recomputing with volatile options * param[in] demandPath path in wich demand elements were saved before recomputing with volatile options + * param[in] dataPath path in wich data elements were saved before recomputing with volatile options */ - void computeNetwork(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string demandPath = ""); + void computeNetwork(GNEApplicationWindow* window, bool force = false, bool volatileOptions = false, std::string additionalPath = "", std::string demandPath = "", std::string dataPath = ""); /**@brief compute demand elements * param[in] window The window to inform about delay */ void computeDemandElements(GNEApplicationWindow* window); + /**@brief compute data elements + * param[in] window The window to inform about delay + */ + void computeDataElements(GNEApplicationWindow* window); + /**@brief join selected junctions * @note difference to mergeJunctions: * - can join more than 2 @@ -609,11 +504,6 @@ */ int getNumberOfAdditionals(SumoXMLTag type = SUMO_TAG_NOTHING) const; - /**@brief update additional ID in container - * @note this function is automatically called when user changes the ID of an additional - */ - void updateAdditionalID(const std::string& oldID, GNEAdditional* additional); - /// @brief inform that additionals has to be saved void requireSaveAdditionals(bool value); @@ -651,16 +541,6 @@ */ int getNumberOfDemandElements(SumoXMLTag type = SUMO_TAG_NOTHING) const; - /**@brief update demand element ID in container - * @note this function is automatically called when user changes the ID of an demand element - */ - void updateDemandElementID(const std::string& oldID, GNEDemandElement* demandElement); - - /**@brief update demand element begin in container - * @note this function is automatically called when user changes the begin/departure of an demand element - */ - void updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement); - /// @brief inform that demand elements has to be saved void requireSaveDemandElements(bool value); @@ -677,18 +557,81 @@ /// @} - /// @name Functions related to Shapes + /// @name Functions related to DataSet Items /// @{ + /**@brief Returns the named data set + * @param[in] id The id of the data set to return. + * @param[in] failHard Whether attempts to retrieve a nonexisting data set should result in an exception + */ + GNEDataSet* retrieveDataSet(const std::string& id, bool hardFail = true) const; + + ///@brief return all data sets + std::vector retrieveDataSets() const; + + /**@brief return all generic datas + * @param[in] onlySelected Whether to return only selected generic datas + */ + std::vector retrieveGenericDatas(bool onlySelected = false) const; + + /**@brief Returns the number of data sets of the net + * @return Number of data sets of the net + */ + int getNumberOfDataSets() const; + + /// @brief inform that data sets has to be saved + void requireSaveDataElements(bool value); + + /**@brief save data set elements of the network + * @param[in] filename name of the file in wich save data sets + */ + void saveDataElements(const std::string& filename); + + /// @brief check if data sets are saved + bool isDataElementsSaved() const; + + /// @brief generate data set id + std::string generateDataSetID(const std::string& prefix) const; + + /// @brief return a set of parameters for the given data Interval + std::set retrieveGenericDataParameters(const std::string& genericDataTag, const double begin, const double end) const; + + /// @brief return a set of parameters for the given dataSet, generic data Type, begin and end + std::set retrieveGenericDataParameters(const std::string& dataSetID, const std::string& genericDataTag, + const std::string& beginStr, const std::string& endStr) const; + + /// @brief get minimum interval + double getDataSetIntervalMinimumBegin() const; + + /// @brief get maximum interval + double getDataSetIntervalMaximumEnd() const; + + /// @} + + /// @name Functions related with Shapes + /// @{ + + /**@brief Returns the named shape + * @param[in] type tag with the type of shape + * @param[in] id The id of the shape to return. + * @param[in] failHard Whether attempts to retrieve a nonexisting shape should result in an exception + */ + GNEShape* retrieveShape(SumoXMLTag type, const std::string& id, bool hardFail = true) const; + + /**@brief return all shapes + * @param[in] onlySelected Whether to return only selected shapes + */ + std::vector retrieveShapes(bool onlySelected = false) const; + /**@brief Builds a special polygon used for edit Junctions's shapes - * @param[in] netElement GNENetElement to be edited + * @param[in] networkElement GNENetworkElement to be edited * @param[in] shape shape to be edited * @param[in] fill enable or disable fill polygon * @param[in] col The color for drawing the polygon * @throw processError if shape is empty * @return created GNEPoly */ - GNEPoly* addPolygonForEditShapes(GNENetElement* netElement, const PositionVector& shape, bool fill, RGBColor col); + GNEPoly* addPolygonForEditShapes(GNENetworkElement* networkElement, const PositionVector& shape, bool fill, RGBColor col); /// @brief remove Polygon for edit shapes void removePolygonForEditShapes(GNEPoly* polygon); @@ -696,11 +639,11 @@ /// @brief generate Shape ID std::string generateShapeID(SumoXMLTag shapeTag) const; - /// @brief change Shape ID - void changeShapeID(GNEShape* s, const std::string& OldID); - - /// @brief get number of shapes - int getNumberOfShapes() const; + /**@brief Returns the number of shapes of the net + * @param[in] type type of shape to count. SUMO_TAG_NOTHING will count all shapes + * @return Number of shapes of the net + */ + int getNumberOfShapes(SumoXMLTag type = SUMO_TAG_NOTHING) const; /// @} /// @name Functions related to TLS Programs @@ -734,14 +677,17 @@ /// @brief the rtree which contains all GUIGlObjects (so named for historical reasons) SUMORTree myGrid; - /// @brief The viewNet to be notofied of about changes + /// @brief The net to be notofied of about changes GNEViewNet* myViewNet; /// @brief The internal netbuilder NBNetBuilder* myNetBuilder; /// @brief AttributeCarriers of net - AttributeCarriers myAttributeCarriers; + GNENetHelper::AttributeCarriers* myAttributeCarriers; + + /// @brief PathCalculator instance + GNENetHelper::PathCalculator* myPathCalculator; /// @name ID Suppliers for newly created edges and junctions // @{ @@ -767,76 +713,16 @@ /// @brief Flag to check if demand elements has to be saved bool myDemandElementsSaved; + /// @brief Flag to check if data elements has to be saved + bool myDataElementsSaved; + /// @brief Flag to enable or disable update geometry of elements after inserting or removing element in net bool myUpdateGeometryEnabled; - /// @name Insertion and erasing of GNEAdditionals items - /// @{ - - /// @brief return true if additional exist (use pointer instead ID) - bool additionalExist(GNEAdditional* additional) const; - - /**@brief Insert a additional element int GNENet container. - * @throw processError if route was already inserted - */ - void insertAdditional(GNEAdditional* additional); - - /**@brief delete additional element of GNENet container - * @throw processError if additional wasn't previously inserted - */ - bool deleteAdditional(GNEAdditional* additional, bool updateViewAfterDeleting); - - /// @} - - /// @name Insertion and erasing of GNEDemandElements items - /// @{ - - /// @brief return true if demand element exist (use pointer instead ID) - bool demandElementExist(GNEDemandElement* demandElement) const; - - /**@brief Insert a demand element element int GNENet container. - * @throw processError if route was already inserted - */ - void insertDemandElement(GNEDemandElement* demandElement); - - /**@brief delete demand element element of GNENet container - * @throw processError if demand element wasn't previously inserted - */ - bool deleteDemandElement(GNEDemandElement* demandElement, bool updateViewAfterDeleting); - - /// @} - private: /// @brief Init Junctions and edges void initJunctionsAndEdges(); - /// @brief inserts a single junction into the net and into the underlying netbuild-container - void insertJunction(GNEJunction* junction); - - /// @brief inserts a single edge into the net and into the underlying netbuild-container - void insertEdge(GNEEdge* edge); - - /// @brief registers a junction with GNENet containers - GNEJunction* registerJunction(GNEJunction* junction); - - /// @brief registers an edge with GNENet containers - GNEEdge* registerEdge(GNEEdge* edge); - - /// @brief deletes a single junction - void deleteSingleJunction(GNEJunction* junction, bool updateViewAfterDeleting); - - /// @brief deletes a single edge - void deleteSingleEdge(GNEEdge* edge, bool updateViewAfterDeleting); - - /// @brief insert shape - void insertShape(GNEShape* shape, bool updateViewAfterDeleting); - - /// @brief remove created shape (but NOT delete) - void removeShape(GNEShape* shape, bool updateViewAfterDeleting); - - /// @brief notify myViewNet - void update(); - /// @brief reserve edge ID (To avoid duplicates) void reserveEdgeID(const std::string& id); @@ -852,6 +738,9 @@ /// @brief save demand elements after confirming invalid objects void saveDemandElementsConfirmed(const std::string& filename); + /// @brief save data elements after confirming invalid objects + void saveDataElementsConfirmed(const std::string& filename); + static void replaceInListAttribute(GNEAttributeCarrier* ac, SumoXMLAttr key, const std::string& which, const std::string& by, GNEUndoList* undoList); /// @brief the z boundary (stored in the x-coordinate), values of 0 are ignored @@ -863,60 +752,9 @@ /// @brief map with the Edges and their number of lanes std::map myEdgesAndNumberOfLanes; - /// @brief flag used to indicate if shaped created can be undo - bool myAllowUndoShapes; - - /// @brief class for GNEChange_ReplaceEdgeInTLS - class GNEChange_ReplaceEdgeInTLS : public GNEChange { - FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS) - - public: - /// @brief constructor - GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont& tllcont, NBEdge* replaced, NBEdge* by) : - GNEChange(0, true), - myTllcont(tllcont), myReplaced(replaced), myBy(by) { } - - /// @bief destructor - ~GNEChange_ReplaceEdgeInTLS() {}; - - /// @brief undo name - FXString undoName() const { - return "Redo replace in TLS"; - } - - /// @brief get Redo name - FXString redoName() const { - return "Undo replace in TLS"; - } - - /// @brief undo action - void undo() { - myTllcont.replaceRemoved(myBy, -1, myReplaced, -1); - } - - /// @brief redo action - void redo() { - myTllcont.replaceRemoved(myReplaced, -1, myBy, -1); - } - - /// @brief wether original and new value differ - bool trueChange() { - return myReplaced != myBy; - } - - private: - /// @brief container for traffic light logic - NBTrafficLightLogicCont& myTllcont; - - /// @brief replaced NBEdge - NBEdge* myReplaced; - - /// @brief replaced by NBEdge - NBEdge* myBy; - }; + /// @brief Invalidated copy constructor. + GNENet(const GNENet&) = delete; + /// @brief Invalidated assignment operator. + GNENet& operator=(const GNENet&) = delete; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNENetHelper.cpp sumo-1.6.0+dfsg1/src/netedit/GNENetHelper.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNENetHelper.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNENetHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,1073 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNENetHelper.cpp +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// Helper for GNENet +/****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "GNENetHelper.h" + +// --------------------------------------------------------------------------- +// GNENetHelper::AttributeCarriers - methods +// --------------------------------------------------------------------------- + +GNENetHelper::AttributeCarriers::AttributeCarriers(GNENet* net) : + myNet(net), + myAllowUndoShapes(true) { + // fill additionals with tags (note: this include the TAZs) + auto listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::ADDITIONALELEMENT, false); + for (const auto& additionalTag : listOfTags) { + myAdditionals.insert(std::make_pair(additionalTag, std::map())); + } + listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::TAZ, false); + for (const auto& tazTag : listOfTags) { + myAdditionals.insert(std::make_pair(tazTag, std::map())); + } + // fill shapes with tags + listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::SHAPE, false); + for (const auto& shapeTag : listOfTags) { + myShapes.insert(std::make_pair(shapeTag, std::map())); + } + // fill demand elements with tags + listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::DEMANDELEMENT, false); + for (const auto& demandTag : listOfTags) { + myDemandElements.insert(std::make_pair(demandTag, std::map())); + } + listOfTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::TagType::STOP, false); + for (const auto& stopTag : listOfTags) { + myDemandElements.insert(std::make_pair(stopTag, std::map())); + } +} + + +GNENetHelper::AttributeCarriers::~AttributeCarriers() { + // Drop Edges + for (const auto& edge : myEdges) { + edge.second->decRef("GNENetHelper::~GNENet"); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + edge.second->getTagStr() + " '" + edge.second->getID() + "' in AttributeCarriers destructor"); + delete edge.second; + } + // Drop myJunctions + for (const auto& junction : myJunctions) { + junction.second->decRef("GNENetHelper::~GNENet"); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + junction.second->getTagStr() + " '" + junction.second->getID() + "' in AttributeCarriers destructor"); + delete junction.second; + } + // Drop Additionals (Only used for additionals that were inserted without using GNEChange_Additional) + for (const auto& additionalTag : myAdditionals) { + for (const auto& additional : additionalTag.second) { + // decrease reference manually (because it was increased manually in GNEAdditionalHandler) + additional.second->decRef(); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + additional.second->getTagStr() + " '" + additional.second->getID() + "' in AttributeCarriers destructor"); + delete additional.second; + } + } + // Drop Shapes (Only used for shapes that were inserted without using GNEChange_Shape) + for (const auto& shapeTag : myShapes) { + for (const auto& shape : shapeTag.second) { + // decrease reference manually (because it was increased manually in GNEShapeHandler) + shape.second->decRef(); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + shape.second->getTagStr() + " '" + shape.second->getID() + "' in AttributeCarriers destructor"); + delete shape.second; + } + } + // Drop demand elements (Only used for demand elements that were inserted without using GNEChange_DemandElement, for example the default VType") + for (const auto& demandElementTag : myDemandElements) { + for (const auto& demandElement : demandElementTag.second) { + // decrease reference manually (because it was increased manually in GNERouteHandler) + demandElement.second->decRef(); + // show extra information for tests + WRITE_DEBUG("Deleting unreferenced " + demandElement.second->getTagStr() + " '" + demandElement.second->getID() + "' in AttributeCarriers destructor"); + delete demandElement.second; + } + } +} + + +void +GNENetHelper::AttributeCarriers::updateID(GNEAttributeCarrier* AC, const std::string newID) { + if (AC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { + updateJunctionID(AC, newID); + } else if (AC->getTagProperty().getTag() == SUMO_TAG_EDGE) { + updateEdgeID(AC, newID); + } else if (AC->getTagProperty().isAdditionalElement() || AC->getTagProperty().isTAZ()) { + updateAdditionalID(AC, newID); + } else if (AC->getTagProperty().isShape()) { + updateShapeID(AC, newID); + } else if (AC->getTagProperty().isDemandElement()) { + updateDemandElementID(AC, newID); + } else if (AC->getTagProperty().isDataElement()) { + updateDataSetID(AC, newID); + } else { + throw ProcessError("Unknow Attribute Carrier"); + } +} + + +void +GNENetHelper::AttributeCarriers::remapJunctionAndEdgeIds() { + std::map newEdgeMap; + std::map newJunctionMap; + // fill newEdgeMap + for (const auto& edge : myEdges) { + edge.second->setMicrosimID(edge.second->getNBEdge()->getID()); + newEdgeMap[edge.second->getNBEdge()->getID()] = edge.second; + } + for (const auto& junction : myJunctions) { + newJunctionMap[junction.second->getNBNode()->getID()] = junction.second; + junction.second->setMicrosimID(junction.second->getNBNode()->getID()); + } + myEdges = newEdgeMap; + myJunctions = newJunctionMap; +} + + +GNEJunction* +GNENetHelper::AttributeCarriers::registerJunction(GNEJunction* junction) { + // increase reference + junction->incRef("GNENet::registerJunction"); + junction->setResponsible(false); + myJunctions[junction->getMicrosimID()] = junction; + // expand net boundary + myNet->expandBoundary(junction->getCenteringBoundary()); + // add edge into grid + myNet->addGLObjectIntoGrid(junction); + // update geometry + junction->updateGeometry(); + // check if junction is selected + if (junction->isAttributeCarrierSelected()) { + junction->selectAttributeCarrier(false); + } + // add z in net boundary + myNet->addZValueInBoundary(junction->getNBNode()->getPosition().z()); + return junction; +} + + +const std::map& +GNENetHelper::AttributeCarriers::getJunctions() const { + return myJunctions; +} + + +void +GNENetHelper::AttributeCarriers::clearJunctions() { + /* + // removes all junctions of net (It was already removed from grid) + auto copyOfJunctions = myAttributeCarriers->getJunctions(); + for (auto junction : copyOfJunctions) { + myAttributeCarriers->getJunctions().erase(junction.second->getMicrosimID()); + } + */ + myJunctions.clear(); +} + + +GNEEdge* +GNENetHelper::AttributeCarriers::registerEdge(GNEEdge* edge) { + edge->incRef("GNENet::registerEdge"); + edge->setResponsible(false); + // add edge to internal container of GNENet + myEdges[edge->getMicrosimID()] = edge; + // expand edge boundary + myNet->expandBoundary(edge->getCenteringBoundary()); + // add edge into grid + myNet->addGLObjectIntoGrid(edge); + // check if edge is selected + if (edge->isAttributeCarrierSelected()) { + edge->selectAttributeCarrier(false); + } + // Add references into GNEJunctions + edge->getGNEJunctionSource()->addOutgoingGNEEdge(edge); + edge->getGNEJunctionDestiny()->addIncomingGNEEdge(edge); + return edge; +} + + +const std::map& +GNENetHelper::AttributeCarriers::getEdges() const { + return myEdges; +} + + +void GNENetHelper::AttributeCarriers::clearEdges() { + /* + // remove all edges of net (It was already removed from grid) + auto copyOfEdges = myAttributeCarriers->getEdges(); + for (auto edge : copyOfEdges) { + myAttributeCarriers->getEdges().erase(edge.second->getMicrosimID()); + } + */ + myEdges.clear(); +} + + +bool +GNENetHelper::AttributeCarriers::addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer, double angle, + const std::string& imgFile, bool relativePath, const PositionVector& shape, bool geo, bool fill, double lineWidth, bool /*ignorePruning*/) { + // check if ID is duplicated + if (myShapes.at(SUMO_TAG_POLY).count(id) == 0) { + // create poly + GNEPoly* poly = new GNEPoly(myNet, id, type, shape, geo, fill, lineWidth, color, layer, angle, imgFile, relativePath, false, false); + if (myAllowUndoShapes) { + myNet->getViewNet()->getUndoList()->p_begin("add " + toString(SUMO_TAG_POLY)); + myNet->getViewNet()->getUndoList()->add(new GNEChange_Shape(poly, true), true); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // insert shape without allowing undo/redo + insertShape(poly); + poly->incRef("addPolygon"); + } + return true; + } else { + return false; + } +} + + +bool +GNENetHelper::AttributeCarriers::addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, + const std::string& lane, double posOverLane, double posLat, double layer, double angle, + const std::string& imgFile, bool relativePath, double width, double height, bool /*ignorePruning*/) { + // get POITag (Depending of attribute lane) + const SumoXMLTag POITag = lane.empty() ? SUMO_TAG_POI : SUMO_TAG_POILANE; + // check if ID is duplicated + if (myShapes.at(POITag).count(id) == 0) { + // create POI or POILane depending of parameter lane + if (lane.empty()) { + // create POI + GNEPOI* POI = new GNEPOI(myNet, id, type, color, pos, geo, layer, angle, imgFile, relativePath, width, height, false); + if (myAllowUndoShapes) { + myNet->getViewNet()->getUndoList()->p_begin("add " + POI->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_Shape(POI, true), true); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // insert shape without allowing undo/redo + insertShape(POI); + POI->incRef("addPOI"); + } + return true; + } else { + // create POI over lane + GNELane* retrievedLane = myNet->retrieveLane(lane, false); + if (retrievedLane == nullptr) { + WRITE_ERROR("invalid lane to use within POI " + id); + } else { + GNEPOI* POILane = new GNEPOI(myNet, id, type, color, layer, angle, imgFile, relativePath, retrievedLane, posOverLane, posLat, width, height, false); + if (myAllowUndoShapes) { + myNet->getViewNet()->getUndoList()->p_begin("add " + POILane->getTagStr()); + myNet->getViewNet()->getUndoList()->add(new GNEChange_Shape(POILane, true), true); + myNet->getViewNet()->getUndoList()->p_end(); + } else { + // insert shape without allowing undo/redo + insertShape(POILane); + retrievedLane->addChildShape(POILane); + POILane->incRef("addPOILane"); + } + } + return true; + } + } else { + return false; + } +} + + +const std::map >& +GNENetHelper::AttributeCarriers::getAdditionals() const { + return myAdditionals; +} + + +void +GNENetHelper::AttributeCarriers::clearAdditionals() { + // clear elements in grid + for (const auto& additionalsTags : myAdditionals) { + for (const auto& additional : additionalsTags.second) { + myNet->removeGLObjectFromGrid(additional.second); + } + } + // iterate over myAdditionals and clear all additionals + for (auto& additionals : myAdditionals) { + additionals.second.clear(); + } +} + + +const std::map >& +GNENetHelper::AttributeCarriers::getShapes() const { + return myShapes; +} + + +void +GNENetHelper::AttributeCarriers::clearShapes() { + // clear elements in grid + for (const auto& shapesTags : myShapes) { + for (const auto& shape : shapesTags.second) { + myNet->removeGLObjectFromGrid(shape.second); + } + } + // iterate over myShapes and clear all shapes + for (auto& shapes : myShapes) { + shapes.second.clear(); + } +} + + +const std::map >& +GNENetHelper::AttributeCarriers::getDemandElements() const { + return myDemandElements; +} + + +const std::map& +GNENetHelper::AttributeCarriers::getVehicleDepartures() const { + return myVehicleDepartures; +} + + +void +GNENetHelper::AttributeCarriers::clearDemandElements() { + // clear elements in grid + for (const auto& demandElementsTags : myDemandElements) { + for (const auto& demandElement : demandElementsTags.second) { + myNet->removeGLObjectFromGrid(demandElement.second); + } + } + // iterate over myDemandElements and clear all demand elemnts + for (auto& demandElements : myDemandElements) { + demandElements.second.clear(); + } +} + + +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); + myDemandElements.at(defaultVehicleType->getTagProperty().getTag()).insert(std::make_pair(defaultVehicleType->getID(), 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); + myDemandElements.at(defaultBikeType->getTagProperty().getTag()).insert(std::make_pair(defaultBikeType->getID(), defaultBikeType)); + defaultBikeType->incRef("GNENet::DEFAULT_BIKETYPE_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); + myDemandElements.at(defaultPersonType->getTagProperty().getTag()).insert(std::make_pair(defaultPersonType->getID(), defaultPersonType)); + defaultPersonType->incRef("GNENet::DEFAULT_PEDTYPE_ID"); +} + + +void +GNENetHelper::AttributeCarriers::updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement) { + if (myVehicleDepartures.count(oldBegin + "_" + demandElement->getID()) == 0) { + throw ProcessError(demandElement->getTagStr() + " with old begin='" + oldBegin + "' doesn't exist"); + } else { + // remove an insert demand element again into vehicleDepartures container + if (demandElement->getTagProperty().isVehicle()) { + myVehicleDepartures.erase(oldBegin + "_" + demandElement->getID()); + myVehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); + } + } +} + + +const std::map& +GNENetHelper::AttributeCarriers::getDataSets() const { + return myDataSets; +} + + +void +GNENetHelper::AttributeCarriers::clearDataSets() { + // clear elements in grid + for (const auto& dataSet : myDataSets) { + for (const auto& dataInterval : dataSet.second->getDataIntervalChildren()) { + for (const auto& genericData : dataInterval.second->getGenericDataChildren()) { + myNet->removeGLObjectFromGrid(genericData); + } + } + } + // just clear myDataSets + myDataSets.clear(); +} + + +std::vector +GNENetHelper::AttributeCarriers::retrieveGenericDatas(const SumoXMLTag genericDataTag, const double begin, const double end) { + // declare generic data vector + std::vector genericDatas; + // iterate over all data sets + for (const auto& dataSet : myDataSets) { + for (const auto& interval : dataSet.second->getDataIntervalChildren()) { + // check interval + if ((interval.second->getAttributeDouble(SUMO_ATTR_BEGIN) >= begin) && (interval.second->getAttributeDouble(SUMO_ATTR_END) <= end)) { + // iterate over generic datas + for (const auto& genericData : interval.second->getGenericDataChildren()) { + if (genericData->getTagProperty().getTag() == genericDataTag) { + genericDatas.push_back(genericData); + } + } + } + } + } + return genericDatas; +} + + +void +GNENetHelper::AttributeCarriers::insertJunction(GNEJunction* junction) { + myNet->getNetBuilder()->getNodeCont().insert(junction->getNBNode()); + registerJunction(junction); +} + + +void +GNENetHelper::AttributeCarriers::deleteSingleJunction(GNEJunction* junction) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(junction); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(junction); + // Remove from grid and container + myNet->removeGLObjectFromGrid(junction); + // check if junction is selected + if (junction->isAttributeCarrierSelected()) { + junction->unselectAttributeCarrier(false); + } + myJunctions.erase(junction->getMicrosimID()); + myNet->getNetBuilder()->getNodeCont().extract(junction->getNBNode()); + junction->decRef("GNENet::deleteSingleJunction"); + junction->setResponsible(true); +} + + +void +GNENetHelper::AttributeCarriers::updateJunctionID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myJunctions.count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.junction"); + } else if (myJunctions.count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in myJunctions"); + } else { + // retrieve junction + GNEJunction* junction = myJunctions.at(AC->getID()); + // remove junction from container + myJunctions.erase(junction->getNBNode()->getID()); + // rename in NetBuilder + myNet->getNetBuilder()->getNodeCont().rename(junction->getNBNode(), newID); + // update microsim ID + junction->setMicrosimID(newID); + // add it into myJunctions again + myJunctions[AC->getID()] = junction; + // build crossings + junction->getNBNode()->buildCrossings(); + // net has to be saved + myNet->requireSaveNet(true); + } +} + + +void +GNENetHelper::AttributeCarriers::insertEdge(GNEEdge* edge) { + NBEdge* nbe = edge->getNBEdge(); + myNet->getNetBuilder()->getEdgeCont().insert(nbe); // should we ignore pruning double edges? + // if this edge was previouls extracted from the edgeContainer we have to rewire the nodes + nbe->getFromNode()->addOutgoingEdge(nbe); + nbe->getToNode()->addIncomingEdge(nbe); + registerEdge(edge); +} + + +void +GNENetHelper::AttributeCarriers::deleteSingleEdge(GNEEdge* edge) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(edge); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(edge); + // remove edge from visual grid and container + myNet->removeGLObjectFromGrid(edge); + // check if junction is selected + if (edge->isAttributeCarrierSelected()) { + edge->unselectAttributeCarrier(false); + } + myEdges.erase(edge->getMicrosimID()); + // extract edge of district container + myNet->getNetBuilder()->getEdgeCont().extract(myNet->getNetBuilder()->getDistrictCont(), edge->getNBEdge()); + edge->decRef("GNENet::deleteSingleEdge"); + edge->setResponsible(true); + // Remove refrences from GNEJunctions + edge->getGNEJunctionSource()->removeOutgoingGNEEdge(edge); + edge->getGNEJunctionDestiny()->removeIncomingGNEEdge(edge); +} + + +void +GNENetHelper::AttributeCarriers::updateEdgeID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myEdges.count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.edge"); + } else if (myEdges.count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in myEdges"); + } else { + // retrieve edge + GNEEdge* edge = myEdges.at(AC->getID()); + // remove edge from container + myEdges.erase(edge->getNBEdge()->getID()); + // rename in NetBuilder + myNet->getNetBuilder()->getEdgeCont().rename(edge->getNBEdge(), newID); + // update microsim ID + edge->setMicrosimID(newID); + // add it into myEdges again + myEdges[AC->getID()] = edge; + // rename all connections related to this edge + for (const auto& lane : edge->getLanes()) { + lane->updateConnectionIDs(); + } + // net has to be saved + myNet->requireSaveNet(true); + } +} + + +bool +GNENetHelper::AttributeCarriers::additionalExist(GNEAdditional* additional) const { + // first check that additional pointer is valid + if (additional) { + return myAdditionals.at(additional->getTagProperty().getTag()).find(additional->getID()) != + myAdditionals.at(additional->getTagProperty().getTag()).end(); + } else { + throw ProcessError("Invalid additional pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::insertAdditional(GNEAdditional* additional) { + // Check if additional element exists before insertion + if (!additionalExist(additional)) { + myAdditionals.at(additional->getTagProperty().getTag()).insert(std::make_pair(additional->getID(), additional)); + // add element in grid + myNet->addGLObjectIntoGrid(additional); + // check if additional is selected + if (additional->isAttributeCarrierSelected()) { + additional->selectAttributeCarrier(false); + } + // update geometry after insertion of additionals if myUpdateGeometryEnabled is enabled + if (myNet->isUpdateGeometryEnabled()) { + additional->updateGeometry(); + } + // additionals has to be saved + myNet->requireSaveAdditionals(true); + } else { + throw ProcessError(additional->getTagStr() + " with ID='" + additional->getID() + "' already exist"); + } +} + + +bool +GNENetHelper::AttributeCarriers::deleteAdditional(GNEAdditional* additional) { + // first check that additional pointer is valid + if (additionalExist(additional)) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(additional); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(additional); + // obtain demand element and erase it from container + auto it = myAdditionals.at(additional->getTagProperty().getTag()).find(additional->getID()); + myAdditionals.at(additional->getTagProperty().getTag()).erase(it); + // remove element from grid + myNet->removeGLObjectFromGrid(additional); + // check if additional is selected + if (additional->isAttributeCarrierSelected()) { + additional->unselectAttributeCarrier(false); + } + // additionals has to be saved + myNet->requireSaveAdditionals(true); + // additional removed, then return true + return true; + } else { + throw ProcessError("Invalid additional pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::updateAdditionalID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myAdditionals.at(AC->getTagProperty().getTag()).count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.additionals"); + } else if (myAdditionals.at(AC->getTagProperty().getTag()).count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in AttributeCarriers.additionals"); + } else { + // retrieve additional + GNEAdditional* additional = myAdditionals.at(AC->getTagProperty().getTag()).at(AC->getID()); + // remove additional from container + myAdditionals.at(additional->getTagProperty().getTag()).erase(additional->getID()); + // set new ID in additional + additional->setMicrosimID(newID); + // insert additional again in container + myAdditionals.at(additional->getTagProperty().getTag()).insert(std::make_pair(additional->getID(), additional)); + // additionals has to be saved + myNet->requireSaveAdditionals(true); + } +} + + +bool +GNENetHelper::AttributeCarriers::shapeExist(GNEShape* shape) const { + // first check that shape pointer is valid + if (shape) { + return myShapes.at(shape->getTagProperty().getTag()).find(shape->getID()) != + myShapes.at(shape->getTagProperty().getTag()).end(); + } else { + throw ProcessError("Invalid shape pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::insertShape(GNEShape* shape) { + // Check if shape element exists before insertion + if (!shapeExist(shape)) { + myShapes.at(shape->getTagProperty().getTag()).insert(std::make_pair(shape->getID(), shape)); + // add element in grid + myNet->addGLObjectIntoGrid(shape); + // check if shape is selected + if (shape->isAttributeCarrierSelected()) { + shape->selectAttributeCarrier(false); + } + // update geometry after insertion of shapes if myUpdateGeometryEnabled is enabled + if (myNet->isUpdateGeometryEnabled()) { + shape->updateGeometry(); + } + // shapes has to be saved + myNet->requireSaveAdditionals(true); + } else { + throw ProcessError(shape->getTagStr() + " with ID='" + shape->getID() + "' already exist"); + } +} + + +bool +GNENetHelper::AttributeCarriers::deleteShape(GNEShape* shape) { + // first check that shape pointer is valid + if (shapeExist(shape)) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(shape); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(shape); + // obtain demand element and erase it from container + auto it = myShapes.at(shape->getTagProperty().getTag()).find(shape->getID()); + myShapes.at(shape->getTagProperty().getTag()).erase(it); + // remove element from grid + myNet->removeGLObjectFromGrid(shape); + // check if shape is selected + if (shape->isAttributeCarrierSelected()) { + shape->unselectAttributeCarrier(false); + } + // shapes has to be saved + myNet->requireSaveAdditionals(true); + // shape removed, then return true + return true; + } else { + throw ProcessError("Invalid shape pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::updateShapeID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myShapes.at(AC->getTagProperty().getTag()).count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.shapes"); + } else if (myShapes.at(AC->getTagProperty().getTag()).count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in AttributeCarriers.shapes"); + } else { + // retrieve shape + GNEShape* shape = myShapes.at(AC->getTagProperty().getTag()).at(AC->getID()); + // remove shape from container + myShapes.at(shape->getTagProperty().getTag()).erase(shape->getID()); + // set new ID in shape + shape->getGUIGlObject()->setMicrosimID(newID); + // insert shape again in container + myShapes.at(shape->getTagProperty().getTag()).insert(std::make_pair(shape->getID(), shape)); + // shapes has to be saved + myNet->requireSaveAdditionals(true); + } +} + + +bool +GNENetHelper::AttributeCarriers::demandElementExist(GNEDemandElement* demandElement) const { + // first check that demandElement pointer is valid + if (demandElement) { + return myDemandElements.at(demandElement->getTagProperty().getTag()).find(demandElement->getID()) != + myDemandElements.at(demandElement->getTagProperty().getTag()).end(); + } else { + throw ProcessError("Invalid demandElement pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::insertDemandElement(GNEDemandElement* demandElement) { + // Check if demandElement element exists before insertion + if (!demandElementExist(demandElement)) { + // insert in demandElements container + myDemandElements.at(demandElement->getTagProperty().getTag()).insert(std::make_pair(demandElement->getID(), demandElement)); + // also insert in vehicleDepartures container if it's either a vehicle or a person + if (demandElement->getTagProperty().isVehicle() || demandElement->getTagProperty().isPerson()) { + if (myVehicleDepartures.count(demandElement->getBegin() + "_" + demandElement->getID()) != 0) { + throw ProcessError(demandElement->getTagStr() + " with departure ='" + demandElement->getBegin() + "_" + demandElement->getID() + "' already inserted"); + } else { + myVehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); + } + } + // add element in grid + myNet->addGLObjectIntoGrid(demandElement); + // check if demandElement is selected + if (demandElement->isAttributeCarrierSelected()) { + demandElement->selectAttributeCarrier(false); + } + // update geometry after insertion of demandElements if myUpdateGeometryEnabled is enabled + if (myNet->isUpdateGeometryEnabled()) { + demandElement->updateGeometry(); + } + // demandElements has to be saved + myNet->requireSaveDemandElements(true); + } else { + throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' already exist"); + } +} + + +bool +GNENetHelper::AttributeCarriers::deleteDemandElement(GNEDemandElement* demandElement) { + // first check that demandElement pointer is valid + if (demandElementExist(demandElement)) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(demandElement); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(demandElement); + // obtain demand element and erase it from container + auto it = myDemandElements.at(demandElement->getTagProperty().getTag()).find(demandElement->getID()); + myDemandElements.at(demandElement->getTagProperty().getTag()).erase(it); + // also remove fromvehicleDepartures container if it's either a vehicle or a person + if (demandElement->getTagProperty().isVehicle() || demandElement->getTagProperty().isPerson()) { + if (myVehicleDepartures.count(demandElement->getBegin() + "_" + demandElement->getID()) == 0) { + throw ProcessError(demandElement->getTagStr() + " with departure ='" + demandElement->getBegin() + "_" + demandElement->getID() + "' doesn't exist"); + } else { + myVehicleDepartures.erase(demandElement->getBegin() + "_" + demandElement->getID()); + } + } + // remove element from grid + myNet->removeGLObjectFromGrid(demandElement); + // check if demandElement is selected + if (demandElement->isAttributeCarrierSelected()) { + demandElement->unselectAttributeCarrier(false); + } + // demandElements has to be saved + myNet->requireSaveDemandElements(true); + // demandElement removed, then return true + return true; + } else { + throw ProcessError("Invalid demandElement pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::updateDemandElementID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myDemandElements.at(AC->getTagProperty().getTag()).count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.myDemandElements"); + } else if (myDemandElements.at(AC->getTagProperty().getTag()).count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in AttributeCarriers.myDemandElements"); + } else { + // retrieve demand element + GNEDemandElement* demandElement = myDemandElements.at(AC->getTagProperty().getTag()).at(AC->getID()); + // remove demand from container + myDemandElements.at(demandElement->getTagProperty().getTag()).erase(demandElement->getID()); + // if is vehicle, remove it from vehicleDepartures + if (demandElement->getTagProperty().isVehicle()) { + if (myVehicleDepartures.count(demandElement->getBegin() + "_" + demandElement->getID()) == 0) { + throw ProcessError(demandElement->getTagStr() + " with ID='" + demandElement->getID() + "' doesn't exist in AttributeCarriers.vehicleDepartures"); + } else { + myVehicleDepartures.erase(demandElement->getBegin() + "_" + demandElement->getID()); + } + } + // set new ID in demand + demandElement->setMicrosimID(newID); + // insert demand again in container + myDemandElements.at(demandElement->getTagProperty().getTag()).insert(std::make_pair(demandElement->getID(), demandElement)); + // if is vehicle, add it into vehicleDepartures + if (demandElement->getTagProperty().isVehicle()) { + myVehicleDepartures.insert(std::make_pair(demandElement->getBegin() + "_" + demandElement->getID(), demandElement)); + } + // myDemandElements has to be saved + myNet->requireSaveDemandElements(true); + } +} + + +bool +GNENetHelper::AttributeCarriers::dataSetExist(GNEDataSet* dataSet) const { + // first check that dataSet pointer is valid + if (dataSet) { + return myDataSets.find(dataSet->getID()) != myDataSets.end(); + } else { + throw ProcessError("Invalid dataSet pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::insertDataSet(GNEDataSet* dataSet) { + // Check if dataSet element exists before insertion + if (!dataSetExist(dataSet)) { + // insert in dataSets container + myDataSets.insert(std::make_pair(dataSet->getID(), dataSet)); + // dataSets has to be saved + myNet->requireSaveDataElements(true); + // update interval toolbar + myNet->getViewNet()->getIntervalBar().updateIntervalBar(); + } else { + throw ProcessError(dataSet->getTagStr() + " with ID='" + dataSet->getID() + "' already exist"); + } +} + + +bool +GNENetHelper::AttributeCarriers::deleteDataSet(GNEDataSet* dataSet) { + // first check that dataSet pointer is valid + if (dataSetExist(dataSet)) { + // remove it from Inspector Frame and AttributeCarrierHierarchy + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributesEditor()->removeEditedAC(dataSet); + myNet->getViewNet()->getViewParent()->getInspectorFrame()->getAttributeCarrierHierarchy()->removeCurrentEditedAttribute(dataSet); + // obtain demand element and erase it from container + myDataSets.erase(myDataSets.find(dataSet->getID())); + // dataSets has to be saved + myNet->requireSaveDataElements(true); + // update interval toolbar + myNet->getViewNet()->getIntervalBar().updateIntervalBar(); + // dataSet removed, then return true + return true; + } else { + throw ProcessError("Invalid dataSet pointer"); + } +} + + +void +GNENetHelper::AttributeCarriers::updateDataSetID(GNEAttributeCarrier* AC, const std::string& newID) { + if (myDataSets.count(AC->getID()) == 0) { + throw ProcessError(AC->getTagStr() + " with ID='" + AC->getID() + "' doesn't exist in AttributeCarriers.dataSets"); + } else if (myDataSets.count(newID) != 0) { + throw ProcessError("There is another " + AC->getTagStr() + " with new ID='" + newID + "' in dataSets"); + } else { + // retrieve dataSet + GNEDataSet* dataSet = myDataSets.at(AC->getID()); + // remove dataSet from container + myDataSets.erase(dataSet->getID()); + // set new ID in dataSet + dataSet->setDataSetID(newID); + // insert dataSet again in container + myDataSets[dataSet->getID()] = dataSet; + // data sets has to be saved + myNet->requireSaveDataElements(true); + // update interval toolbar + myNet->getViewNet()->getIntervalBar().updateIntervalBar(); + } +} + +// --------------------------------------------------------------------------- +// GNENetHelper::PathCalculator - methods +// --------------------------------------------------------------------------- + +GNENetHelper::PathCalculator::PathCalculator(const GNENet* net) : + myNet(net), + myDijkstraRouter(nullptr) { + // create myDijkstraRouter + myDijkstraRouter = new DijkstraRouter( + myNet->getNetBuilder()->getEdgeCont().getAllRouterEdges(), + true, &NBRouterEdge::getTravelTimeStatic, nullptr, true); +} + + +GNENetHelper::PathCalculator::~PathCalculator() { + delete myDijkstraRouter; +} + + +void +GNENetHelper::PathCalculator::updatePathCalculator() { + // simply delete and create myDijkstraRouter again + if (myDijkstraRouter) { + delete myDijkstraRouter; + } + myDijkstraRouter = new DijkstraRouter( + myNet->getNetBuilder()->getEdgeCont().getAllRouterEdges(), + true, &NBRouterEdge::getTravelTimeStatic, nullptr, true); +} + + +std::vector +GNENetHelper::PathCalculator::calculatePath(const SUMOVehicleClass vClass, const std::vector& partialEdges) const { + // declare a solution vector + std::vector solution; + // calculate route depending of number of partial myEdges + if (partialEdges.size() == 1) { + // if there is only one partialEdges, route has only one edge + solution.push_back(partialEdges.front()); + } else { + // declare temporal vehicle + NBVehicle tmpVehicle("temporalNBVehicle", vClass); + // obtain pointer to GNENet + GNENet* net = partialEdges.front()->getNet(); + // iterate over every selected myEdges + for (int i = 1; i < (int)partialEdges.size(); i++) { + // declare a temporal route in which save route between two last myEdges + std::vector partialRoute; + myDijkstraRouter->compute(partialEdges.at(i - 1)->getNBEdge(), partialEdges.at(i)->getNBEdge(), &tmpVehicle, 10, partialRoute); + // save partial route in solution + for (const auto& edgeID : partialRoute) { + solution.push_back(net->retrieveEdge(edgeID->getID())); + } + } + } + // filter solution + auto solutionIt = solution.begin(); + // iterate over solution + while (solutionIt != solution.end()) { + if ((solutionIt + 1) != solution.end()) { + // if next edge is the same of current edge, remove it + if (*solutionIt == *(solutionIt + 1)) { + solutionIt = solution.erase(solutionIt); + } else { + solutionIt++; + } + } else { + solutionIt++; + } + } + return solution; +} + + +std::vector +GNENetHelper::PathCalculator::calculatePath(const SUMOVehicleClass vClass, const std::vector& partialEdgesStr) const { + // declare a vector of GNEEdges + std::vector partialEdges; + partialEdges.reserve(partialEdgesStr.size()); + // convert to vector of GNEEdges + for (const auto& egeID : partialEdgesStr) { + partialEdges.push_back(myNet->retrieveEdge(egeID)); + } + // calculate DijkstraRoute using partialEdges + return calculatePath(vClass, partialEdges); +} + + +bool +GNENetHelper::PathCalculator::consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge* from, const GNEEdge* to) const { + // check conditions + if ((from == nullptr) || (to == nullptr)) { + // myEdges cannot be null + return false; + } else if (from == to) { + // the same edge cannot be consecutive of itself + return false; + } else if (vClass == SVC_PEDESTRIAN) { + // for pedestrians consecutive myEdges are always connected + return true; + } else { + // declare temporal vehicle + NBVehicle tmpVehicle("temporalNBVehicle", vClass); + // declare a temporal route in which save route between two last myEdges + std::vector solution; + // calculate route betwen from and to edge + myDijkstraRouter->compute(from->getNBEdge(), to->getNBEdge(), &tmpVehicle, 10, solution); + // check if soultion is enmpty + if (solution.size() == 2) { + return true; + } else { + return false; + } + } +} + +// --------------------------------------------------------------------------- +// GNENetHelper::GNEChange_ReplaceEdgeInTLS - methods +// --------------------------------------------------------------------------- + +GNENetHelper::GNEChange_ReplaceEdgeInTLS::GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont& tllcont, NBEdge* replaced, NBEdge* by) : + GNEChange(true), + myTllcont(tllcont), + myReplaced(replaced), + myBy(by) { +} + + +GNENetHelper::GNEChange_ReplaceEdgeInTLS::~GNEChange_ReplaceEdgeInTLS() {} + + +FXString +GNENetHelper::GNEChange_ReplaceEdgeInTLS::undoName() const { + return "Redo replace in TLS"; +} + + +FXString +GNENetHelper::GNEChange_ReplaceEdgeInTLS::redoName() const { + return "Undo replace in TLS"; +} + + +void +GNENetHelper::GNEChange_ReplaceEdgeInTLS::undo() { + myTllcont.replaceRemoved(myBy, -1, myReplaced, -1); +} + + +void +GNENetHelper::GNEChange_ReplaceEdgeInTLS::redo() { + myTllcont.replaceRemoved(myReplaced, -1, myBy, -1); +} + + +bool +GNENetHelper::GNEChange_ReplaceEdgeInTLS::trueChange() { + return myReplaced != myBy; +} + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNENetHelper.h sumo-1.6.0+dfsg1/src/netedit/GNENetHelper.h --- sumo-1.5.0+dfsg1/src/netedit/GNENetHelper.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNENetHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,435 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 GNENetHelper.h +/// @author Pablo Alvarez Lopez +/// @date Mar 2020 +/// +// Helper for GNENet +// +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// =========================================================================== +// class declarations +// =========================================================================== + +class NBNetBuilder; +class GNEAdditional; +class GNEDataSet; +class GNEDemandElement; +class GNEApplicationWindow; +class GNEAttributeCarrier; +class GNEConnection; +class GNECrossing; +class GNEEdge; +class GNEJunction; +class GNELane; +class GNENetworkElement; +class GNEPOI; +class GNEPoly; +class GNEShape; +class GNEUndoList; +class GNEViewNet; + +// =========================================================================== +// class definitions +// =========================================================================== + +struct GNENetHelper { + + /// @brief struct used for saving all attribute carriers of net, in different formats + class AttributeCarriers : ShapeContainer { + + /// @brief declare friend class + friend class GNEAdditionalHandler; + friend class GNERouteHandler; + friend class GNEChange_Junction; + friend class GNEChange_Edge; + friend class GNEChange_Additional; + friend class GNEChange_Shape; + friend class GNEChange_DemandElement; + friend class GNEChange_DataSet; + + public: + /// @brief constructor + AttributeCarriers(GNENet* net); + + /// @brief destructor + ~AttributeCarriers(); + + /// @brief update ID + void updateID(GNEAttributeCarrier* AC, const std::string newID); + + /// @brief remap junction and edge IDs + void remapJunctionAndEdgeIds(); + + /// @name function for junctions + /// @{ + /// @brief registers a junction with GNENet containers + GNEJunction* registerJunction(GNEJunction* junction); + + /// @brief map with the ID and pointer to junctions of net + const std::map& getJunctions() const; + + /// @brief clear junctions + void clearJunctions(); + + /// @} + + /// @name function for edges + /// @{ + /// @brief registers an edge with GNENet containers + GNEEdge* registerEdge(GNEEdge* edge); + + /// @brief map with the ID and pointer to edges of net + const std::map& getEdges() const; + + /// @brief clear junctions + void clearEdges(); + + /// @} + + /// @name inherited from ShapeHandler + /// @{ + /**@brief Builds a polygon using the given values and adds it to the container + * @param[in] id The name of the polygon + * @param[in] type The (abstract) type of the polygon + * @param[in] color The color of the polygon + * @param[in] layer The layer of the polygon + * @param[in] angle The rotation of the polygon + * @param[in] imgFile The raster image of the polygon + * @param[in] relativePath set image file as relative path + * @param[in] shape The shape of the polygon + * @param[in] geo specify if shape was loaded as GEO coordinate + * @param[in] fill Whether the polygon shall be filled + * @param[in] lineWidth The widht for drawing unfiled polygon + * @return whether the polygon could be added + */ + bool addPolygon(const std::string& id, const std::string& type, const RGBColor& color, double layer, + double angle, const std::string& imgFile, bool relativePath, const PositionVector& shape, + bool geo, bool fill, double lineWidth, bool ignorePruning = false); + + /**@brief Builds a POI using the given values and adds it to the container + * @param[in] id The name of the POI + * @param[in] type The (abstract) type of the POI + * @param[in] color The color of the POI + * @param[in] pos The position of the POI + * @param[in[ geo use GEO coordinates (lon/lat) + * @param[in] lane The Lane in which this POI is placed + * @param[in] posOverLane The position over Lane + * @param[in] posLat The position lateral over Lane + * @param[in] layer The layer of the POI + * @param[in] angle The rotation of the POI + * @param[in] imgFile The raster image of the POI + * @param[in] relativePath set image file as relative path + * @param[in] width The width of the POI image + * @param[in] height The height of the POI image + * @return whether the poi could be added + */ + bool addPOI(const std::string& id, const std::string& type, const RGBColor& color, const Position& pos, bool geo, + const std::string& lane, double posOverLane, double posLat, double layer, double angle, + const std::string& imgFile, bool relativePath, double width, double height, bool ignorePruning = false); + + /// @} + + /// @name function for additionals + /// @{ + /// @brief get additionals + const std::map >& getAdditionals() const; + + /// @brief clear additionals + void clearAdditionals(); + + /// @} + + /// @name function for shapes + /// @{ + /// @brief get shapes + const std::map >& getShapes() const; + + /// @brief clear shapes + void clearShapes(); + + /// @} + + /// @name function for demand elements + /// @{ + /// @brief get demand elements + const std::map >& getDemandElements() const; + + /// @brief get vehicle departures + const std::map& getVehicleDepartures() const; + + /// @brief clear demand elements + void clearDemandElements(); + + /// @brief add default VTypes + void addDefaultVTypes(); + + /**@brief update demand element begin in container + * @note this function is automatically called when user changes the begin/departure of an demand element + */ + void updateDemandElementBegin(const std::string& oldBegin, GNEDemandElement* demandElement); + + /// @} + + /// @name function for demand elements + /// @{ + /// @brief get demand elements + const std::map& getDataSets() const; + + /// @brief clear demand elements + void clearDataSets(); + + /// @} + + /// @name function for data Sets + /// @{ + /// @brief retrieve generic datas within the given interval + std::vector retrieveGenericDatas(const SumoXMLTag genericDataTag, const double begin, const double end); + + /// @} + + protected: + /// @name Insertion and erasing of GNEJunctions + /// @{ + /// @brief inserts a single junction into the net and into the underlying netbuild-container + void insertJunction(GNEJunction* junction); + + /// @brief deletes a single junction + void deleteSingleJunction(GNEJunction* junction); + + /// @brief update junction ID in container + void updateJunctionID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @{ + + /// @name Insertion and erasing of GNEEdges + /// @{ + /// @brief inserts a single edge into the net and into the underlying netbuild-container + void insertEdge(GNEEdge* edge); + + /// @brief deletes a single edge + void deleteSingleEdge(GNEEdge* edge); + + /// @brief update edge ID in container + void updateEdgeID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @{ + + /// @name Insertion and erasing of GNEAdditionals items + /// @{ + + /// @brief return true if given additional exist + bool additionalExist(GNEAdditional* additional) const; + + /**@brief Insert a additional element int GNENet container. + * @throw processError if route was already inserted + */ + void insertAdditional(GNEAdditional* additional); + + /**@brief delete additional element of GNENet container + * @throw processError if additional wasn't previously inserted + */ + bool deleteAdditional(GNEAdditional* additional); + + /// @brief update additional ID in container + void updateAdditionalID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @} + + /// @name Insertion and erasing of GNEShapes items + /// @{ + + /// @brief return true if given shape exist + bool shapeExist(GNEShape* shape) const; + + /**@brief Insert a shape element int GNENet container. + * @throw processError if route was already inserted + */ + void insertShape(GNEShape* shape); + + /**@brief delete shape element of GNENet container + * @throw processError if shape wasn't previously inserted + */ + bool deleteShape(GNEShape* shape); + + /// @brief update shape ID in container + void updateShapeID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @} + + /// @name Insertion and erasing of GNEDemandElements items + /// @{ + + /// @brief return true if given demand element exist + bool demandElementExist(GNEDemandElement* demandElement) const; + + /**@brief Insert a demand element element int GNENet container. + * @throw processError if route was already inserted + */ + void insertDemandElement(GNEDemandElement* demandElement); + + /**@brief delete demand element element of GNENet container + * @throw processError if demand element wasn't previously inserted + */ + bool deleteDemandElement(GNEDemandElement* demandElement); + + /// @brief update demand element ID in container + void updateDemandElementID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @} + + /// @name Insertion and erasing of GNEDataSets items + /// @{ + + /// @brief return true if given demand element exist + bool dataSetExist(GNEDataSet* dataSet) const; + + /**@brief Insert a demand element element int GNENet container. + * @throw processError if route was already inserted + */ + void insertDataSet(GNEDataSet* dataSet); + + /**@brief delete demand element element of GNENet container + * @throw processError if demand element wasn't previously inserted + */ + bool deleteDataSet(GNEDataSet* dataSet); + + /// @brief update data element ID in container + void updateDataSetID(GNEAttributeCarrier* AC, const std::string& newID); + + /// @} + + private: + /// @brief map with the ID and pointer to junctions of net + std::map myJunctions; + + /// @brief map with the ID and pointer to edges of net + std::map myEdges; + + /// @brief map with the ID and pointer to additional elements of net + std::map > myAdditionals; + + /// @brief map with the ID and pointer to shape elements of net + std::map > myShapes; + + /// @brief map with the ID and pointer to demand elements of net + std::map > myDemandElements; + + /// @brief special map used for saving Demand Elements of type "Vehicle" (Vehicles, routeFlows, etc.) sorted by depart time + std::map myVehicleDepartures; + + /// @brief map with the ID and pointer to data sets of net + std::map myDataSets; + + /// @brief pointer to net + GNENet* myNet; + + /// @brief flag used to indicate if created shape can be undo + bool myAllowUndoShapes; + + /// @brief Invalidated copy constructor. + AttributeCarriers(const AttributeCarriers&) = delete; + + /// @brief Invalidated assignment operator. + AttributeCarriers& operator=(const AttributeCarriers&) = delete; + }; + + /// @brief class used to calculate paths in nets + class PathCalculator { + + public: + /// @brief constructor + PathCalculator(const GNENet* net); + + /// @brief destructor + ~PathCalculator(); + + /// @brief update path calculator (called when SuperModes Demand or Data is selected) + void updatePathCalculator(); + + /// @brief calculate Dijkstra path between a list of partial edges + std::vector calculatePath(const SUMOVehicleClass vClass, const std::vector& partialEdges) const; + + /// @brief calculate Dijkstra path between a list of partial edges (in string format) + std::vector calculatePath(const SUMOVehicleClass vClass, const std::vector& partialEdgesStr) const; + + /// @brief check if exist a path between the two given consecutives edges for the given VClass + bool consecutiveEdgesConnected(const SUMOVehicleClass vClass, const GNEEdge* from, const GNEEdge* to) const; + + private: + /// @brief pointer to net + const GNENet* myNet; + + /// @brief SUMO Abstract myDijkstraRouter + SUMOAbstractRouter* myDijkstraRouter; + }; + + /// @brief class for GNEChange_ReplaceEdgeInTLS + class GNEChange_ReplaceEdgeInTLS : public GNEChange { + FXDECLARE_ABSTRACT(GNEChange_ReplaceEdgeInTLS) + + public: + /// @brief constructor + GNEChange_ReplaceEdgeInTLS(NBTrafficLightLogicCont& tllcont, NBEdge* replaced, NBEdge* by); + + /// @bief destructor + ~GNEChange_ReplaceEdgeInTLS(); + + /// @brief undo name + FXString undoName() const; + + /// @brief get Redo name + FXString redoName() const; + + /// @brief undo action + void undo(); + + /// @brief redo action + void redo(); + + /// @brief wether original and new value differ + bool trueChange(); + + private: + /// @brief container for traffic light logic + NBTrafficLightLogicCont& myTllcont; + + /// @brief replaced NBEdge + NBEdge* myReplaced; + + /// @brief replaced by NBEdge + NBEdge* myBy; + }; +}; diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEReferenceCounter.h sumo-1.6.0+dfsg1/src/netedit/GNEReferenceCounter.h --- sumo-1.5.0+dfsg1/src/netedit/GNEReferenceCounter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEReferenceCounter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ // We may wish to keep references to junctions/nodes either in the network or in the undoList // to clean up properly we have to resort to reference counting /****************************************************************************/ -#ifndef GNEReferenceCounter_h -#define GNEReferenceCounter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -43,6 +37,9 @@ //// @brief constructor GNEReferenceCounter(): myCount(0) {} + /// @brief return ID of object + virtual const std::string& getID() const = 0; + //// @brief destructor ~GNEReferenceCounter() { // If myCount is different of 0, means that references weren't removed correctly @@ -83,18 +80,7 @@ return myCount == 0; } - /// @brief return ID of object - virtual const std::string getID() const = 0; - - private: /// @brief reference counter int myCount; - }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEUndoList.cpp sumo-1.6.0+dfsg1/src/netedit/GNEUndoList.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEUndoList.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEUndoList.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,8 @@ // GNEUndoList inherits from FXUndoList and patches some methods. these are // prefixed with p_ /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include -#include +#include #include "GNEApplicationWindow.h" #include "GNEUndoList.h" @@ -82,14 +77,22 @@ void GNEUndoList::p_end() { myCommandGroups.pop(); + // check if net has to be updated + if (myCommandGroups.empty() && myGNEApplicationWindowParent->getViewNet()) { + myGNEApplicationWindowParent->getViewNet()->updateViewNet(); + } end(); } void GNEUndoList::p_clear() { + // disable updating of interval bar + myGNEApplicationWindowParent->getViewNet()->getIntervalBar().disableIntervalBarUpdate(); p_abort(); clear(); + // enable updating of interval bar again + myGNEApplicationWindowParent->getViewNet()->getIntervalBar().enableIntervalBarUpdate(); } diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEUndoList.h sumo-1.6.0+dfsg1/src/netedit/GNEUndoList.h --- sumo-1.5.0+dfsg1/src/netedit/GNEUndoList.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEUndoList.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,13 +23,7 @@ // GNEUndoList inherits from FXUndoList and patches some methods. these are // prefixed with p_ /****************************************************************************/ -#ifndef GNEUndoList_h -#define GNEUndoList_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -132,9 +126,3 @@ // @brief the parent GNEApplicationWindow for this undolist GNEApplicationWindow* const myGNEApplicationWindowParent; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewNet.cpp sumo-1.6.0+dfsg1/src/netedit/GNEViewNet.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEViewNet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewNet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,40 +18,37 @@ /// // A view on the network being edited (adapted from GUIViewTraffic) /****************************************************************************/ - - -// =========================================================================== -// included 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 +#include #include #include #include @@ -76,26 +73,26 @@ FXDEFMAP(GNEViewNet) GNEViewNetMap[] = { // Super Modes - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_NETWORK, GNEViewNet::onCmdSetSupermode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DEMAND, GNEViewNet::onCmdSetSupermode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_SUPERMODE_NETWORK, GNEViewNet::onCmdSetSupermode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_DEMAND, GNEViewNet::onCmdSetSupermode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DATA, GNEViewNet::onCmdSetSupermode), // Modes - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_E_EDGEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MOVEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_DELETEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_INSPECTMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_SELECTMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_TLSMODE_VTYPEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_TAZMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_POLYGONMODE_PERSONMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_VEHICLEMODE, GNEViewNet::onCmdSetMode), - FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE, GNEViewNet::onCmdSetMode), - // Common view options - FXMAPFUNC(SEL_COMMAND, MID_GNE_COMMONVIEWOPTIONS_SHOWGRID, GNEViewNet::onCmdToogleShowGrid), - FXMAPFUNC(SEL_COMMAND, MID_GNE_COMMONVIEWOPTIONS_DRAWSPREADVEHICLES, GNEViewNet::onCmdToogleDrawSpreadVehicles), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_E_MODES_EDGE_EDGEDATA, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_I_MODES_INSPECT, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_S_MODES_SELECT, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_T_MODES_TLS_VTYPE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_A_MODES_ADDITIONAL_STOP, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_V_MODES_VEHICLE, GNEViewNet::onCmdSetMode), + FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GNEViewNet::onCmdSetMode), // Network view options + FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID, GNEViewNet::onCmdToogleShowGridNetwork), + FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES, GNEViewNet::onCmdToogleDrawSpreadVehicles), FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS, GNEViewNet::onCmdToogleShowDemandElements), FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES, GNEViewNet::onCmdToogleSelectEdges), FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS, GNEViewNet::onCmdToogleShowConnections), @@ -108,10 +105,16 @@ FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES, GNEViewNet::onCmdToogleChainEdges), FXMAPFUNC(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES, GNEViewNet::onCmdToogleAutoOppositeEdge), // Demand view options + FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID, GNEViewNet::onCmdToogleShowGridDemand), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES, GNEViewNet::onCmdToogleDrawSpreadVehicles), FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED, GNEViewNet::onCmdToogleHideNonInspecteDemandElements), FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES, GNEViewNet::onCmdToogleHideShapes), FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS, GNEViewNet::onCmdToogleShowAllPersonPlans), FXMAPFUNC(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON, GNEViewNet::onCmdToogleLockPerson), + // Data view options + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS, GNEViewNet::onCmdToogleShowAdditionals), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES, GNEViewNet::onCmdToogleShowShapes), + FXMAPFUNC(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS, GNEViewNet::onCmdToogleShowDemandElements), // Select elements FXMAPFUNC(SEL_COMMAND, MID_ADDSELECT, GNEViewNet::onCmdAddSelected), FXMAPFUNC(SEL_COMMAND, MID_REMOVESELECT, GNEViewNet::onCmdRemoveSelected), @@ -164,6 +167,13 @@ FXMAPFUNC(SEL_COMMAND, MID_GNE_POLYGON_DELETE_GEOMETRY_POINT, GNEViewNet::onCmdDeleteGeometryPoint), // POIs FXMAPFUNC(SEL_COMMAND, MID_GNE_POI_TRANSFORM, GNEViewNet::onCmdTransformPOI), + // IntervalBar + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_GENERICDATATYPE, GNEViewNet::onCmdIntervalBarGenericDataType), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_DATASET, GNEViewNet::onCmdIntervalBarDataSet), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_LIMITED, GNEViewNet::onCmdIntervalBarLimit), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_BEGIN, GNEViewNet::onCmdIntervalBarSetBegin), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_END, GNEViewNet::onCmdIntervalBarSetEnd), + FXMAPFUNC(SEL_COMMAND, MID_GNE_INTERVALBAR_ATTRIBUTE, GNEViewNet::onCmdIntervalBarSetAttribute) }; // Object implementation @@ -176,15 +186,17 @@ GNEViewNet::GNEViewNet(FXComposite* tmpParent, FXComposite* actualParent, GUIMainWindow& app, GNEViewParent* viewParent, GNENet* net, GNEUndoList* undoList, FXGLVisual* glVis, FXGLCanvas* share) : - GUISUMOAbstractView(tmpParent, app, viewParent, net->getVisualisationSpeedUp(), glVis, share), + GUISUMOAbstractView(tmpParent, app, viewParent, net->getGrid(), glVis, share), myEditModes(this), myTestingMode(this), myCommonCheckableButtons(this), myNetworkCheckableButtons(this), myDemandCheckableButtons(this), - myCommonViewOptions(this), + myDataCheckableButtons(this), myNetworkViewOptions(this), myDemandViewOptions(this), + myDataViewOptions(this), + myIntervalBar(this), myMoveSingleElementValues(this), myMoveMultipleElementValues(this), myVehicleOptions(this), @@ -195,14 +207,15 @@ myViewParent(viewParent), myNet(net), myCurrentFrame(nullptr), - myUndoList(undoList) { + myUndoList(undoList), + myDottedAC(nullptr) { // view must be the final member of actualParent reparent(actualParent); // Build edit modes buildEditModeControls(); // Mark undo list myUndoList->mark(); - // set this viewNet in Net + // set this net in Net myNet->setViewNet(this); // set drag delay ((GUIDanielPerspectiveChanger*)myChanger)->setDragDelay(100000000); // 100 milliseconds @@ -235,76 +248,82 @@ // for junctions new FXButton(cw.getLocatorPopup(), "\tLocate Junction\tLocate a junction within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), &cw, MID_LOCATEJUNCTION, + GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), &cw, MID_LOCATEJUNCTION, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for edges new FXButton(cw.getLocatorPopup(), "\tLocate Street\tLocate a street within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEEDGE), &cw, MID_LOCATEEDGE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), &cw, MID_LOCATEEDGE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for vehicles new FXButton(cw.getLocatorPopup(), "\tLocate Vehicle\tLocate a vehicle within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &cw, MID_LOCATEVEHICLE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), &cw, MID_LOCATEVEHICLE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for person new FXButton(cw.getLocatorPopup(), "\tLocate Person\tLocate a person within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &cw, MID_LOCATEPERSON, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &cw, MID_LOCATEPERSON, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for routes new FXButton(cw.getLocatorPopup(), "\tLocate Route\tLocate a route within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEROUTE), &cw, MID_LOCATEROUTE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEROUTE), &cw, MID_LOCATEROUTE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for routes new FXButton(cw.getLocatorPopup(), "\tLocate Stop\tLocate a stop within the network.", - GUIIconSubSys::getIcon(ICON_LOCATESTOP), &cw, MID_LOCATESTOP, + GUIIconSubSys::getIcon(GUIIcon::LOCATESTOP), &cw, MID_LOCATESTOP, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for persons (currently unused) /* new FXButton(cw.getLocatorPopup(), "\tLocate Vehicle\tLocate a person within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &v, MID_LOCATEPERSON, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); */ // for tls new FXButton(cw.getLocatorPopup(), "\tLocate TLS\tLocate a tls within the network.", - GUIIconSubSys::getIcon(ICON_LOCATETLS), &cw, MID_LOCATETLS, + GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), &cw, MID_LOCATETLS, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for additional stuff new FXButton(cw.getLocatorPopup(), "\tLocate Additional\tLocate an additional structure within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEADD), &cw, MID_LOCATEADD, + GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), &cw, MID_LOCATEADD, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for pois new FXButton(cw.getLocatorPopup(), "\tLocate PoI\tLocate a PoI within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOI), &cw, MID_LOCATEPOI, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), &cw, MID_LOCATEPOI, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for polygons new FXButton(cw.getLocatorPopup(), "\tLocate Polygon\tLocate a Polygon within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOLY), &cw, MID_LOCATEPOLY, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), &cw, MID_LOCATEPOLY, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } void -GNEViewNet::update() const { +GNEViewNet::updateViewNet() const { // this call is only used for breakpoints (to check when view is updated) GUISUMOAbstractView::update(); } +void +GNEViewNet::forceSupermodeNetwork() { + myEditModes.setSupermode(Supermode::NETWORK, true); +} + + std::set > GNEViewNet::getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges) { // use a SET of pairs to obtain IDs and Pointers to attribute carriers. We need this because certain ACs can be returned many times (example: Edges) @@ -313,14 +332,14 @@ // firstm make OpenGL context current prior to performing OpenGL commands if (makeCurrent()) { // obtain GUIGLIds of all objects in the given boundary (disabling drawForRectangleSelection) - std::vector ids = getObjectsInBoundary(boundary, false); + std::vector GLIds = getObjectsInBoundary(boundary, false); // finish make OpenGL context current makeNonCurrent(); // iterate over GUIGlIDs - for (auto i : ids) { + for (const auto& GLId : GLIds) { // avoid to select Net (i = 0) - if (i != 0) { - GNEAttributeCarrier* retrievedAC = myNet->retrieveAttributeCarrier(i); + if (GLId != 0) { + GNEAttributeCarrier* retrievedAC = myNet->retrieveAttributeCarrier(GLId); // in the case of a Lane, we need to change the retrieved lane to their the parent if myNetworkViewOptions.mySelectEdges is enabled if ((retrievedAC->getTagProperty().getTag() == SUMO_TAG_LANE) && (myNetworkViewOptions.selectEdges() || forceSelectEdges)) { retrievedAC = dynamic_cast(retrievedAC)->getParentEdge(); @@ -340,9 +359,9 @@ void GNEViewNet::buildSelectionACPopupEntry(GUIGLObjectPopupMenu* ret, GNEAttributeCarrier* AC) { if (AC->isAttributeCarrierSelected()) { - new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), this, MID_REMOVESELECT); + new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), this, MID_REMOVESELECT); } else { - new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(ICON_FLAG_PLUS), this, MID_ADDSELECT); + new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(GUIIcon::FLAG_PLUS), this, MID_ADDSELECT); } new FXMenuSeparator(ret); } @@ -359,7 +378,7 @@ } } myVisualizationSettings = &gSchemeStorage.get(name.c_str()); - update(); + updateViewNet(); return true; } @@ -445,12 +464,6 @@ } -const GNEViewNetHelper::CommonViewOptions& -GNEViewNet::getCommonViewOptions() const { - return myCommonViewOptions; -} - - const GNEViewNetHelper::NetworkViewOptions& GNEViewNet::getNetworkViewOptions() const { return myNetworkViewOptions; @@ -463,6 +476,12 @@ } +const GNEViewNetHelper::DataViewOptions& +GNEViewNet::getDataViewOptions() const { + return myDataViewOptions; +} + + const GNEViewNetHelper::KeyPressed& GNEViewNet::getKeyPressed() const { return myKeyPressed; @@ -507,7 +526,8 @@ scheme.clear(); // add new thresholds if (hide) { - minValue = MAX2(hideThreshold + 1, minValue); + const double rawRange = maxValue - minValue; + minValue = MAX2(hideThreshold + MIN2(1.0, rawRange / 100.0), minValue); scheme.addColor(RGBColor(204, 204, 204), hideThreshold); } double range = maxValue - minValue; @@ -548,7 +568,7 @@ bool GNEViewNet::showJunctionAsBubbles() const { - return (myEditModes.networkEditMode == GNE_NMODE_MOVE) && (myNetworkViewOptions.menuCheckShowJunctionBubble->getCheck()); + return (myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && (myNetworkViewOptions.menuCheckShowJunctionBubble->getCheck()); } @@ -558,18 +578,26 @@ myCommonCheckableButtons(this), myNetworkCheckableButtons(this), myDemandCheckableButtons(this), - myCommonViewOptions(this), + myDataCheckableButtons(this), myNetworkViewOptions(this), myDemandViewOptions(this), + myDataViewOptions(this), + myIntervalBar(this), myMoveSingleElementValues(this), myMoveMultipleElementValues(this), myVehicleOptions(this), myVehicleTypeOptions(this), mySaveElements(this), mySelectingArea(this), - myEditShapes(this) { + myEditShapes(this), + myViewParent(nullptr), + myNet(nullptr), + myCurrentFrame(nullptr), + myUndoList(nullptr), + myDottedAC(nullptr) { } + std::vector GNEViewNet::getEdgeLaneParamKeys(bool edgeKeys) const { std::set keys; @@ -638,10 +666,17 @@ drawDecals(); // depending of the visualizationSettings, enable or disable check box show grid if (myVisualizationSettings->showGrid) { - myCommonViewOptions.menuCheckShowGrid->setCheck(true); - paintGLGrid(); + // change show grid + myNetworkViewOptions.menuCheckShowGrid->setCheck(true); + myDemandViewOptions.menuCheckShowGrid->setCheck(true); + // draw grid only in network and demand mode + if (myEditModes.isCurrentSupermodeNetwork() || myEditModes.isCurrentSupermodeDemand()) { + paintGLGrid(); + } } else { - myCommonViewOptions.menuCheckShowGrid->setCheck(false); + // change show grid + myNetworkViewOptions.menuCheckShowGrid->setCheck(false); + myDemandViewOptions.menuCheckShowGrid->setCheck(false); } myNetworkViewOptions.menuCheckShowConnections->setCheck(myVisualizationSettings->showLane2Lane); } @@ -652,15 +687,17 @@ // draw testing elements myTestingMode.drawTestingElements(myApp); // draw temporal trip/flow route - myViewParent->getVehicleFrame()->getEdgePathCreator()->drawTemporalRoute(); + myViewParent->getVehicleFrame()->getEdgePathCreator()->drawTemporalPath(); // draw temporal person plan route - myViewParent->getPersonFrame()->getEdgePathCreator()->drawTemporalRoute(); + myViewParent->getPersonFrame()->getEdgePathCreator()->drawTemporalPath(); myViewParent->getPersonPlanFrame()->getPersonPlanCreator()->drawTemporalRoute(); // draw temporal non consecutive edge myViewParent->getRouteFrame()->drawTemporalRoute(); + // draw temporal edgeRelPath + myViewParent->getEdgeRelDataFrame()->getEdgePathCreator()->drawTemporalPath(); } // check menu checks of supermode demand - if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + if (myEditModes.isCurrentSupermodeDemand()) { // enable or disable menuCheckShowAllPersonPlans depending of there is a locked person if (myDemandViewOptions.getLockedPerson()) { myDemandViewOptions.menuCheckShowAllPersonPlans->disable(); @@ -670,9 +707,9 @@ // check if menuCheckLockPerson must be enabled or disabled if (myDemandViewOptions.menuCheckLockPerson->getCheck() == FALSE) { // check if we're in inspector mode and we're inspecting exactly one element - if ((myEditModes.demandEditMode == GNE_DMODE_INSPECT) && getDottedAC()) { + if ((myEditModes.demandEditMode == DemandEditMode::DEMAND_INSPECT) && getDottedAC()) { // obtain tag property - const GNEAttributeCarrier::TagProperties& tagProperty = getDottedAC()->getTagProperty(); + const GNETagProperties& tagProperty = getDottedAC()->getTagProperty(); // enable menu check lock person if is either a person, a person plan or a person stop if (tagProperty.isPerson() || tagProperty.isPersonPlan() || tagProperty.isPersonStop()) { myDemandViewOptions.menuCheckLockPerson->enable(); @@ -715,17 +752,19 @@ myObjectsUnderGrippedCursor.updateObjectUnderCursor(getGUIGlObjectsUnderGrippedCursor(), myEditShapes.editedShapePoly); } // process left button press function depending of supermode - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { processLeftButtonPressNetwork(eventData); - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + } else if (myEditModes.isCurrentSupermodeDemand()) { processLeftButtonPressDemand(eventData); + } else if (myEditModes.isCurrentSupermodeData()) { + processLeftButtonPressData(eventData); } makeNonCurrent(); } // update cursor updateCursor(); // update view - update(); + updateViewNet(); return 1; } @@ -739,13 +778,15 @@ // update cursor updateCursor(); // process left button release function depending of supermode - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { processLeftButtonReleaseNetwork(); - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + } else if (myEditModes.isCurrentSupermodeDemand()) { processLeftButtonReleaseDemand(); + } else if (myEditModes.isCurrentSupermodeData()) { + processLeftButtonReleaseData(); } // update view - update(); + updateViewNet(); return 1; } @@ -756,7 +797,7 @@ myKeyPressed.update(eventData); // update cursor updateCursor(); - if ((myEditModes.networkEditMode == GNE_NMODE_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { // disable right button press during drawing polygon return 1; } else { @@ -772,7 +813,7 @@ // update cursor updateCursor(); // disable right button release during drawing polygon - if ((myEditModes.networkEditMode == GNE_NMODE_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { return 1; } else { return GUISUMOAbstractView::onRightBtnRelease(obj, sel, eventData); @@ -789,10 +830,12 @@ // update cursor updateCursor(); // process mouse move function depending of supermode - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { processMoveMouseNetwork(); - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + } else if (myEditModes.isCurrentSupermodeDemand()) { processMoveMouseDemand(); + } else if (myEditModes.isCurrentSupermodeData()) { + processMoveMouseData(); } return 1; } @@ -805,12 +848,12 @@ // update cursor updateCursor(); // change "delete last created point" depending of shift key - if ((myEditModes.networkEditMode == GNE_NMODE_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myKeyPressed.shiftKeyPressed()); - update(); - } else if ((myEditModes.networkEditMode == GNE_NMODE_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { + updateViewNet(); + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) && myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { myViewParent->getTAZFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myKeyPressed.shiftKeyPressed()); - update(); + updateViewNet(); } return GUISUMOAbstractView::onKeyPress(o, sel, eventData); } @@ -823,14 +866,14 @@ // update cursor updateCursor(); // change "delete last created point" depending of shift key - if ((myEditModes.networkEditMode == GNE_NMODE_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myKeyPressed.shiftKeyPressed()); - update(); + updateViewNet(); } // check if selecting using rectangle has to be disabled if (mySelectingArea.selectingUsingRectangle && !myKeyPressed.shiftKeyPressed()) { mySelectingArea.selectingUsingRectangle = false; - update(); + updateViewNet(); } return GUISUMOAbstractView::onKeyRelease(o, sel, eventData); } @@ -841,28 +884,28 @@ // steal focus from any text fields and place it over view net setFocus(); // check what supermode is enabled - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { // abort operation depending of current mode - if (myEditModes.networkEditMode == GNE_NMODE_CREATE_EDGE) { + if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CREATE_EDGE) { // abort edge creation in create edge frame myViewParent->getCreateEdgeFrame()->abortEdgeCreation(); - } else if (myEditModes.networkEditMode == GNE_NMODE_SELECT) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_SELECT) { mySelectingArea.selectingUsingRectangle = false; // check if current selection has to be cleaned if (clearSelection) { myViewParent->getSelectorFrame()->clearCurrentSelection(); } - } else if (myEditModes.networkEditMode == GNE_NMODE_CONNECT) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CONNECT) { // abort changes in Connector Frame myViewParent->getConnectorFrame()->getConnectionModifications()->onCmdCancelModifications(0, 0, 0); - } else if (myEditModes.networkEditMode == GNE_NMODE_TLS) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TLS) { myViewParent->getTLSEditorFrame()->onCmdCancel(nullptr, 0, nullptr); - } else if (myEditModes.networkEditMode == GNE_NMODE_MOVE) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) { myEditShapes.stopEditCustomShape(); - } else if (myEditModes.networkEditMode == GNE_NMODE_POLYGON) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) { // abort current drawing myViewParent->getPolygonFrame()->getDrawingShapeModul()->abortDrawing(); - } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) { if (myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { // abort current drawing myViewParent->getPolygonFrame()->getDrawingShapeModul()->abortDrawing(); @@ -870,29 +913,33 @@ // finish current editing TAZ myViewParent->getTAZFrame()->getTAZCurrentModul()->setTAZ(nullptr); } - } else if (myEditModes.networkEditMode == GNE_NMODE_PROHIBITION) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_PROHIBITION) { myViewParent->getProhibitionFrame()->onCmdCancel(nullptr, 0, nullptr); - } else if (myEditModes.networkEditMode == GNE_NMODE_ADDITIONAL) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_ADDITIONAL) { // abort select lanes myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->abortConsecutiveLaneSelector(); } - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + } else if (myEditModes.isCurrentSupermodeDemand()) { // abort operation depending of current mode - if (myEditModes.demandEditMode == GNE_DMODE_SELECT) { + if (myEditModes.demandEditMode == DemandEditMode::DEMAND_SELECT) { mySelectingArea.selectingUsingRectangle = false; // check if current selection has to be cleaned if (clearSelection) { myViewParent->getSelectorFrame()->clearCurrentSelection(); } - } else if (myEditModes.demandEditMode == GNE_DMODE_ROUTE) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_ROUTE) { myViewParent->getRouteFrame()->hotkeyEsc(); - } else if (myEditModes.demandEditMode == GNE_DMODE_VEHICLE) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_VEHICLE) { myViewParent->getVehicleFrame()->getEdgePathCreator()->abortEdgePathCreation(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSON) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSON) { myViewParent->getPersonFrame()->getEdgePathCreator()->abortEdgePathCreation(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSONPLAN) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSONPLAN) { myViewParent->getPersonPlanFrame()->getPersonPlanCreator()->abortPersonPlanCreation(); } + } else if (myEditModes.isCurrentSupermodeData()) { + if (myEditModes.dataEditMode == DataEditMode::DATA_EDGERELDATA) { + myViewParent->getEdgeRelDataFrame()->getEdgePathCreator()->abortEdgePathCreation(); + } } // abort undo list myUndoList->p_abort(); @@ -901,11 +948,11 @@ void GNEViewNet::hotkeyDel() { - if (myEditModes.networkEditMode == GNE_NMODE_CONNECT || myEditModes.networkEditMode == GNE_NMODE_TLS) { - setStatusBarText("Cannot delete in this mode"); - } else { - // delete elements depending of current supermode - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + // delete elements depending of current supermode + if (myEditModes.isCurrentSupermodeNetwork()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_CONNECT) || (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TLS)) { + setStatusBarText("Cannot delete in this mode"); + } else { myUndoList->p_begin("delete network selection"); deleteSelectedConnections(); deleteSelectedCrossings(); @@ -915,30 +962,34 @@ deleteSelectedJunctions(); deleteSelectedShapes(); myUndoList->p_end(); - } else { - myUndoList->p_begin("delete demand selection"); - deleteSelectedDemandElements(); - myUndoList->p_end(); } - // update view - update(); + } else if (myEditModes.isCurrentSupermodeDemand()) { + myUndoList->p_begin("delete demand selection"); + deleteSelectedDemandElements(); + myUndoList->p_end(); + } else if (myEditModes.isCurrentSupermodeData()) { + myUndoList->p_begin("delete data selection"); + deleteSelectedGenericDatas(); + myUndoList->p_end(); } + // update view + updateViewNet(); } void GNEViewNet::hotkeyEnter() { // check what supermode is enabled - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { // abort operation depending of current mode - if (myEditModes.networkEditMode == GNE_NMODE_CONNECT) { + if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CONNECT) { // Accept changes in Connector Frame myViewParent->getConnectorFrame()->getConnectionModifications()->onCmdSaveModifications(0, 0, 0); - } else if (myEditModes.networkEditMode == GNE_NMODE_TLS) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TLS) { myViewParent->getTLSEditorFrame()->onCmdOK(nullptr, 0, nullptr); - } else if ((myEditModes.networkEditMode == GNE_NMODE_MOVE) && (myEditShapes.editedShapePoly != nullptr)) { + } else if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && (myEditShapes.editedShapePoly != nullptr)) { myEditShapes.saveEditedShape(); - } else if (myEditModes.networkEditMode == GNE_NMODE_POLYGON) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) { if (myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { // stop current drawing myViewParent->getPolygonFrame()->getDrawingShapeModul()->stopDrawing(); @@ -946,9 +997,9 @@ // start drawing myViewParent->getPolygonFrame()->getDrawingShapeModul()->startDrawing(); } - } else if (myEditModes.networkEditMode == GNE_NMODE_CROSSING) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_CROSSING) { myViewParent->getCrossingFrame()->createCrossingHotkey(); - } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) { if (myViewParent->getTAZFrame()->getDrawingShapeModul()->isDrawing()) { // stop current drawing myViewParent->getTAZFrame()->getDrawingShapeModul()->stopDrawing(); @@ -959,41 +1010,51 @@ // save pending changes myViewParent->getTAZFrame()->getTAZSaveChangesModul()->onCmdSaveChanges(0, 0, 0); } - } else if (myEditModes.networkEditMode == GNE_NMODE_ADDITIONAL) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_ADDITIONAL) { if (myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->isSelectingLanes()) { // stop select lanes to create additional myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->stopConsecutiveLaneSelector(); } } - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + } else if (myEditModes.isCurrentSupermodeDemand()) { // abort operation depending of current mode - if (myEditModes.demandEditMode == GNE_DMODE_ROUTE) { + if (myEditModes.demandEditMode == DemandEditMode::DEMAND_ROUTE) { myViewParent->getRouteFrame()->hotkeyEnter(); - } else if (myEditModes.demandEditMode == GNE_DMODE_VEHICLE) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_VEHICLE) { myViewParent->getVehicleFrame()->getEdgePathCreator()->finishEdgePathCreation(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSON) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSON) { myViewParent->getPersonFrame()->getEdgePathCreator()->finishEdgePathCreation(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSONPLAN) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSONPLAN) { myViewParent->getPersonPlanFrame()->getPersonPlanCreator()->finishPersonPlanCreation(); } + } else if (myEditModes.isCurrentSupermodeData()) { + if (myEditModes.dataEditMode == DataEditMode::DATA_EDGERELDATA) { + myViewParent->getEdgeRelDataFrame()->getEdgePathCreator()->finishEdgePathCreation(); + } } } void GNEViewNet::hotkeyBackSpace() { - // Currently only used in Demand mode - if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { + // check what supermode is enabled + if (myEditModes.isCurrentSupermodeNetwork()) { + // unused in Network mode + } else if (myEditModes.isCurrentSupermodeDemand()) { // abort operation depending of current mode - if (myEditModes.demandEditMode == GNE_DMODE_ROUTE) { + if (myEditModes.demandEditMode == DemandEditMode::DEMAND_ROUTE) { myViewParent->getRouteFrame()->hotkeyBackSpace(); - } else if (myEditModes.demandEditMode == GNE_DMODE_VEHICLE) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_VEHICLE) { myViewParent->getVehicleFrame()->getEdgePathCreator()->removeLastInsertedElement(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSON) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSON) { myViewParent->getPersonFrame()->getEdgePathCreator()->removeLastInsertedElement(); - } else if (myEditModes.demandEditMode == GNE_DMODE_PERSONPLAN) { + } else if (myEditModes.demandEditMode == DemandEditMode::DEMAND_PERSONPLAN) { myViewParent->getPersonPlanFrame()->getPersonPlanCreator()->removeLastAddedElement(); } + } else if (myEditModes.isCurrentSupermodeData()) { + if (myEditModes.dataEditMode == DataEditMode::DATA_EDGERELDATA) { + myViewParent->getEdgeRelDataFrame()->getEdgePathCreator()->removeLastInsertedElement(); + } } } @@ -1026,6 +1087,12 @@ } +GNEViewNetHelper::IntervalBar& +GNEViewNet::getIntervalBar() { + return myIntervalBar; +} + + const GNEAttributeCarrier* GNEViewNet::getDottedAC() const { return myDottedAC; @@ -1044,7 +1111,7 @@ bool GNEViewNet::showLockIcon() const { - return (myEditModes.networkEditMode == GNE_NMODE_MOVE || myEditModes.networkEditMode == GNE_NMODE_INSPECT || myEditModes.networkEditMode == GNE_NMODE_ADDITIONAL); + return (myEditModes.networkEditMode == NetworkEditMode::NETWORK_MOVE || myEditModes.networkEditMode == NetworkEditMode::NETWORK_INSPECT || myEditModes.networkEditMode == NetworkEditMode::NETWORK_ADDITIONAL); } @@ -1196,11 +1263,14 @@ GNEViewNet::onCmdSetSupermode(FXObject*, FXSelector sel, void*) { // check what network mode will be set switch (FXSELID(sel)) { - case MID_HOTKEY_F3_SUPERMODE_NETWORK: - myEditModes.setSupermode(GNE_SUPERMODE_NETWORK); + case MID_HOTKEY_F2_SUPERMODE_NETWORK: + myEditModes.setSupermode(Supermode::NETWORK, false); break; - case MID_HOTKEY_F4_SUPERMODE_DEMAND: - myEditModes.setSupermode(GNE_SUPERMODE_DEMAND); + case MID_HOTKEY_F3_SUPERMODE_DEMAND: + myEditModes.setSupermode(Supermode::DEMAND, false); + break; + case MID_HOTKEY_F4_SUPERMODE_DATA: + myEditModes.setSupermode(Supermode::DATA, false); break; default: break; @@ -1210,87 +1280,106 @@ long GNEViewNet::onCmdSetMode(FXObject*, FXSelector sel, void*) { - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { + if (myEditModes.isCurrentSupermodeNetwork()) { // check what network mode will be set switch (FXSELID(sel)) { - case MID_HOTKEY_I_INSPECTMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_INSPECT); + case MID_HOTKEY_I_MODES_INSPECT: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_INSPECT); break; - case MID_HOTKEY_D_DELETEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_DELETE); + case MID_HOTKEY_D_MODES_DELETE: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_DELETE); break; - case MID_HOTKEY_S_SELECTMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_SELECT); + case MID_HOTKEY_S_MODES_SELECT: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_SELECT); break; - case MID_HOTKEY_M_MOVEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_MOVE); + case MID_HOTKEY_M_MODES_MOVE: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_MOVE); break; - case MID_HOTKEY_E_EDGEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_CREATE_EDGE); + case MID_HOTKEY_E_MODES_EDGE_EDGEDATA: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_CREATE_EDGE); break; - case MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_CONNECT); + case MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_CONNECT); break; - case MID_HOTKEY_T_TLSMODE_VTYPEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_TLS); + case MID_HOTKEY_T_MODES_TLS_VTYPE: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_TLS); break; - case MID_HOTKEY_A_ADDITIONALMODE_STOPMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_ADDITIONAL); + case MID_HOTKEY_A_MODES_ADDITIONAL_STOP: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_ADDITIONAL); break; - case MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_CROSSING); + case MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_CROSSING); break; - case MID_HOTKEY_Z_TAZMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_TAZ); + case MID_HOTKEY_Z_MODES_TAZ: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_TAZ); break; - case MID_HOTKEY_P_POLYGONMODE_PERSONMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_POLYGON); + case MID_HOTKEY_P_MODES_POLYGON_PERSON: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_POLYGON); break; - case MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE: - myEditModes.setNetworkEditMode(GNE_NMODE_PROHIBITION); + case MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE: + myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_PROHIBITION); break; default: break; } - } else { + } else if (myEditModes.isCurrentSupermodeDemand()) { // check what demand mode will be set switch (FXSELID(sel)) { - case MID_HOTKEY_I_INSPECTMODE: - myEditModes.setDemandEditMode(GNE_DMODE_INSPECT); + case MID_HOTKEY_I_MODES_INSPECT: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_INSPECT); break; - case MID_HOTKEY_D_DELETEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_DELETE); + case MID_HOTKEY_D_MODES_DELETE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_DELETE); break; - case MID_HOTKEY_S_SELECTMODE: - myEditModes.setDemandEditMode(GNE_DMODE_SELECT); + case MID_HOTKEY_S_MODES_SELECT: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_SELECT); break; - case MID_HOTKEY_M_MOVEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_MOVE); + case MID_HOTKEY_M_MODES_MOVE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_MOVE); break; - case MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_ROUTE); + case MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_ROUTE); break; - case MID_HOTKEY_V_VEHICLEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_VEHICLE); + case MID_HOTKEY_V_MODES_VEHICLE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_VEHICLE); break; - case MID_HOTKEY_T_TLSMODE_VTYPEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_VEHICLETYPES); + case MID_HOTKEY_T_MODES_TLS_VTYPE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_VEHICLETYPES); break; - case MID_HOTKEY_A_ADDITIONALMODE_STOPMODE: - myEditModes.setDemandEditMode(GNE_DMODE_STOP); + case MID_HOTKEY_A_MODES_ADDITIONAL_STOP: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_STOP); break; - case MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE: - myEditModes.setDemandEditMode(GNE_DMODE_PERSONTYPES); + case MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_PERSONTYPES); break; - case MID_HOTKEY_P_POLYGONMODE_PERSONMODE: - myEditModes.setDemandEditMode(GNE_DMODE_PERSON); + case MID_HOTKEY_P_MODES_POLYGON_PERSON: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_PERSON); break; - case MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE: - myEditModes.setDemandEditMode(GNE_DMODE_PERSONPLAN); + case MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN: + myEditModes.setDemandEditMode(DemandEditMode::DEMAND_PERSONPLAN); break; default: break; } + } else if (myEditModes.isCurrentSupermodeData()) { + // check what demand mode will be set + switch (FXSELID(sel)) { + case MID_HOTKEY_I_MODES_INSPECT: + myEditModes.setDataEditMode(DataEditMode::DATA_INSPECT); + break; + case MID_HOTKEY_D_MODES_DELETE: + myEditModes.setDataEditMode(DataEditMode::DATA_DELETE); + break; + case MID_HOTKEY_S_MODES_SELECT: + myEditModes.setDataEditMode(DataEditMode::DATA_SELECT); + break; + case MID_HOTKEY_E_MODES_EDGE_EDGEDATA: + myEditModes.setDataEditMode(DataEditMode::DATA_EDGEDATA); + break; + case MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA: + myEditModes.setDataEditMode(DataEditMode::DATA_EDGERELDATA); + break; + } } return 1; } @@ -1492,7 +1581,7 @@ GNEViewNet::onCmdSimplifyShape(FXObject*, FXSelector, void*) { if (myEditShapes.editedShapePoly != nullptr) { myEditShapes.editedShapePoly->simplifyShape(false); - update(); + updateViewNet(); } else { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); if (polygonUnderMouse) { @@ -1507,7 +1596,7 @@ GNEViewNet::onCmdDeleteGeometryPoint(FXObject*, FXSelector, void*) { if (myEditShapes.editedShapePoly != nullptr) { myEditShapes.editedShapePoly->deleteGeometryPoint(getPopupPosition(), false); - update(); + updateViewNet(); } else { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); if (polygonUnderMouse) { @@ -1522,7 +1611,7 @@ GNEViewNet::onCmdClosePolygon(FXObject*, FXSelector, void*) { if (myEditShapes.editedShapePoly != nullptr) { myEditShapes.editedShapePoly->closePolygon(false); - update(); + updateViewNet(); } else { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); if (polygonUnderMouse) { @@ -1537,7 +1626,7 @@ GNEViewNet::onCmdOpenPolygon(FXObject*, FXSelector, void*) { if (myEditShapes.editedShapePoly != nullptr) { myEditShapes.editedShapePoly->openPolygon(false); - update(); + updateViewNet(); } else { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); if (polygonUnderMouse) { @@ -1551,12 +1640,12 @@ long GNEViewNet::onCmdSetFirstGeometryPoint(FXObject*, FXSelector, void*) { if (myEditShapes.editedShapePoly != nullptr) { - myEditShapes.editedShapePoly->changeFirstGeometryPoint(myEditShapes.editedShapePoly->getVertexIndex(getPopupPosition(), false, false), false); - update(); + myEditShapes.editedShapePoly->changeFirstGeometryPoint(myEditShapes.editedShapePoly->getPolyVertexIndex(getPopupPosition(), false), false); + updateViewNet(); } else { GNEPoly* polygonUnderMouse = getPolygonAtPopupPosition(); if (polygonUnderMouse) { - polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false, false)); + polygonUnderMouse->changeFirstGeometryPoint(polygonUnderMouse->getVertexIndex(getPopupPosition(), false)); } } return 1; @@ -1610,7 +1699,7 @@ myUndoList->p_begin("attach POI into " + toString(SUMO_TAG_LANE)); myNet->deleteShape(POI, myUndoList); // add POILane - myNet->addPOI(id, type, color, pos, false, nearestLane->getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight); + myNet->getAttributeCarriers()->addPOI(id, type, color, pos, false, nearestLane->getID(), minorPosOverLane, 0, layer, angle, imgFile, relativePath, POIWidth, POIHeight); myUndoList->p_end(); } } else { @@ -1629,11 +1718,11 @@ myUndoList->p_begin("release POI from " + toString(SUMO_TAG_LANE)); myNet->deleteShape(POI, myUndoList); // add POI - myNet->addPOI(id, type, color, pos, false, "", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight); + myNet->getAttributeCarriers()->addPOI(id, type, color, pos, false, "", 0, 0, layer, angle, imgFile, relativePath, POIWidth, POIWeight); myUndoList->p_end(); } // update view after transform - update(); + updateViewNet(); } return 1; } @@ -1989,18 +2078,20 @@ // declare a flag for cursor move bool cursorMove = false; // check if in current mode/supermode cursor move can be shown - if (myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) { - if ((myEditModes.networkEditMode == GNE_NMODE_ADDITIONAL) || - (myEditModes.networkEditMode == GNE_NMODE_POLYGON) || - (myEditModes.networkEditMode == GNE_NMODE_TAZ)) { + if (myEditModes.isCurrentSupermodeNetwork()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_ADDITIONAL) || + (myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) || + (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ)) { cursorMove = true; } - } else if (myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) { - if ((myEditModes.demandEditMode == GNE_DMODE_ROUTE) || - (myEditModes.demandEditMode == GNE_DMODE_VEHICLE) || - (myEditModes.demandEditMode == GNE_DMODE_STOP)) { + } else if (myEditModes.isCurrentSupermodeDemand()) { + if ((myEditModes.demandEditMode == DemandEditMode::DEMAND_ROUTE) || + (myEditModes.demandEditMode == DemandEditMode::DEMAND_VEHICLE) || + (myEditModes.demandEditMode == DemandEditMode::DEMAND_STOP)) { cursorMove = true; } + } else if (myEditModes.isCurrentSupermodeData()) { + // unused in data mode } // update cursor if control key is pressed if (myKeyPressed.controlKeyPressed() && cursorMove) { @@ -2069,7 +2160,7 @@ GNEJunction* junction = getJunctionAtPopupPosition(); if (junction != nullptr) { myNet->replaceJunctionByGeometry(junction, myUndoList); - update(); + updateViewNet(); } // destroy pop-up and set focus in view net destroyPopup(); @@ -2083,7 +2174,7 @@ GNEJunction* junction = getJunctionAtPopupPosition(); if (junction != nullptr) { myNet->splitJunction(junction, false, myUndoList); - update(); + updateViewNet(); } // destroy pop-up and set focus in view net destroyPopup(); @@ -2097,7 +2188,7 @@ GNEJunction* junction = getJunctionAtPopupPosition(); if (junction != nullptr) { myNet->splitJunction(junction, true, myUndoList); - update(); + updateViewNet(); } // destroy pop-up and set focus in view net destroyPopup(); @@ -2125,7 +2216,7 @@ } else { myNet->clearJunctionConnections(junction, myUndoList); } - update(); + updateViewNet(); } // destroy pop-up and set focus in view net destroyPopup(); @@ -2153,7 +2244,7 @@ } else { myNet->resetJunctionConnections(junction, myUndoList); } - update(); + updateViewNet(); } // destroy pop-up and set focus in view net destroyPopup(); @@ -2193,20 +2284,6 @@ long -GNEViewNet::onCmdToogleShowDemandElements(FXObject*, FXSelector sel, void*) { - // compute demand elements - myNet->computeDemandElements(myViewParent->getGNEAppWindows()); - // update view to show demand elements - update(); - // set focus in menu check again, if this function was called clicking over menu check instead using alt+ - if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) { - myNetworkViewOptions.menuCheckShowDemandElements->setFocus(); - } - return 1; -} - - -long GNEViewNet::onCmdToogleSelectEdges(FXObject*, FXSelector sel, void*) { // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES)) { @@ -2227,7 +2304,7 @@ // Hide/show connections require recompute getNet()->requireRecompute(); // Update viewnNet to show/hide conections - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS)) { myNetworkViewOptions.menuCheckShowConnections->setFocus(); @@ -2239,7 +2316,7 @@ long GNEViewNet::onCmdToogleHideConnections(FXObject*, FXSelector sel, void*) { // Update viewnNet to show/hide conections - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS)) { myNetworkViewOptions.menuCheckHideConnections->setFocus(); @@ -2251,7 +2328,7 @@ long GNEViewNet::onCmdToogleExtendSelection(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION)) { myNetworkViewOptions.menuCheckExtendSelection->setFocus(); @@ -2263,7 +2340,7 @@ long GNEViewNet::onCmdToogleChangeAllPhases(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES)) { myNetworkViewOptions.menuCheckChangeAllPhases->setFocus(); @@ -2273,18 +2350,36 @@ long -GNEViewNet::onCmdToogleShowGrid(FXObject*, FXSelector sel, void*) { +GNEViewNet::onCmdToogleShowGridNetwork(FXObject*, FXSelector sel, void*) { // show or hidde grid depending of myNetworkViewOptions.menuCheckShowGrid - if (myCommonViewOptions.menuCheckShowGrid->getCheck()) { + if (myNetworkViewOptions.menuCheckShowGrid->getCheck()) { myVisualizationSettings->showGrid = true; } else { myVisualizationSettings->showGrid = false; } // update view to show grid - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ - if (sel == FXSEL(SEL_COMMAND, MID_GNE_COMMONVIEWOPTIONS_SHOWGRID)) { - myCommonViewOptions.menuCheckShowGrid->setFocus(); + if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID)) { + myNetworkViewOptions.menuCheckShowGrid->setFocus(); + } + return 1; +} + + +long +GNEViewNet::onCmdToogleShowGridDemand(FXObject*, FXSelector sel, void*) { + // show or hidde grid depending of myDemandViewOptions.menuCheckShowGrid + if (myDemandViewOptions.menuCheckShowGrid->getCheck()) { + myVisualizationSettings->showGrid = true; + } else { + myVisualizationSettings->showGrid = false; + } + // update view to show grid + updateViewNet(); + // set focus in menu check again, if this function was called clicking over menu check instead using alt+ + if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID)) { + myDemandViewOptions.menuCheckShowGrid->setFocus(); } return 1; } @@ -2293,23 +2388,25 @@ long GNEViewNet::onCmdToogleDrawSpreadVehicles(FXObject*, FXSelector sel, void*) { // compute vehicle geometry - for (const auto& vehicle : myNet->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) { + for (const auto& vehicle : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) { vehicle.second->updateGeometry(); } - for (const auto& routeFlow : myNet->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) { + for (const auto& routeFlow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW)) { routeFlow.second->updateGeometry(); } - for (const auto& trip : myNet->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) { + for (const auto& trip : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) { trip.second->updateGeometry(); } - for (const auto& flow : myNet->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) { + for (const auto& flow : myNet->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) { flow.second->updateGeometry(); } // update view to show new vehicles positions - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ - if (sel == FXSEL(SEL_COMMAND, MID_GNE_COMMONVIEWOPTIONS_DRAWSPREADVEHICLES)) { - myCommonViewOptions.menuCheckDrawSpreadVehicles->setFocus(); + if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES)) { + myNetworkViewOptions.menuCheckDrawSpreadVehicles->setFocus(); + } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES)) { + myDemandViewOptions.menuCheckDrawSpreadVehicles->setFocus(); } return 1; } @@ -2318,7 +2415,7 @@ long GNEViewNet::onCmdToogleWarnAboutMerge(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE)) { myNetworkViewOptions.menuCheckWarnAboutMerge->setFocus(); @@ -2330,7 +2427,7 @@ long GNEViewNet::onCmdToogleShowJunctionBubbles(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES)) { myNetworkViewOptions.menuCheckShowJunctionBubble->setFocus(); @@ -2342,7 +2439,7 @@ long GNEViewNet::onCmdToogleMoveElevation(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION)) { myNetworkViewOptions.menuCheckMoveElevation->setFocus(); @@ -2354,7 +2451,7 @@ long GNEViewNet::onCmdToogleChainEdges(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES)) { myNetworkViewOptions.menuCheckChainEdges->setFocus(); @@ -2366,7 +2463,7 @@ long GNEViewNet::onCmdToogleAutoOppositeEdge(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES)) { myNetworkViewOptions.menuCheckAutoOppositeEdge->setFocus(); @@ -2378,7 +2475,7 @@ long GNEViewNet::onCmdToogleHideNonInspecteDemandElements(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED)) { myDemandViewOptions.menuCheckHideNonInspectedDemandElements->setFocus(); @@ -2390,7 +2487,7 @@ long GNEViewNet::onCmdToogleHideShapes(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES)) { myDemandViewOptions.menuCheckHideShapes->setFocus(); @@ -2402,7 +2499,7 @@ long GNEViewNet::onCmdToogleShowAllPersonPlans(FXObject*, FXSelector sel, void*) { // Only update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS)) { myDemandViewOptions.menuCheckShowAllPersonPlans->setFocus(); @@ -2436,7 +2533,7 @@ myDemandViewOptions.menuCheckLockPerson->setText("lock person"); } // update view - update(); + updateViewNet(); // set focus in menu check again, if this function was called clicking over menu check instead using alt+ if (sel == FXSEL(SEL_COMMAND, MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON)) { myDemandViewOptions.menuCheckLockPerson->setFocus(); @@ -2446,6 +2543,88 @@ long +GNEViewNet::onCmdToogleShowAdditionals(FXObject*, FXSelector sel, void*) { + // Only update view + updateViewNet(); + // set focus in menu check again, if this function was called clicking over menu check instead using alt+ + if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS)) { + myDataViewOptions.menuCheckShowAdditionals->setFocus(); + } + return 1; +} + + +long +GNEViewNet::onCmdToogleShowShapes(FXObject*, FXSelector sel, void*) { + // Only update view + updateViewNet(); + // set focus in menu check again, if this function was called clicking over menu check instead using alt+ + if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES)) { + myDataViewOptions.menuCheckShowShapes->setFocus(); + } + return 1; +} + + +long +GNEViewNet::onCmdToogleShowDemandElements(FXObject*, FXSelector sel, void*) { + // compute demand elements + myNet->computeDemandElements(myViewParent->getGNEAppWindows()); + // update view to show demand elements + updateViewNet(); + // set focus in menu check again, if this function was called clicking over menu check instead using alt+ + if (sel == FXSEL(SEL_COMMAND, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS)) { + myNetworkViewOptions.menuCheckShowDemandElements->setFocus(); + } else if (sel == FXSEL(SEL_COMMAND, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS)) { + myDataViewOptions.menuCheckShowDemandElements->setFocus(); + } + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*) { + myIntervalBar.setGenericDataType(); + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarDataSet(FXObject*, FXSelector, void*) { + myIntervalBar.setDataSet(); + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarLimit(FXObject*, FXSelector, void*) { + myIntervalBar.setInterval(); + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*) { + myIntervalBar.setBegin(); + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*) { + myIntervalBar.setEnd(); + return 1; +} + + +long +GNEViewNet::onCmdIntervalBarSetAttribute(FXObject*, FXSelector, void*) { + myIntervalBar.setAttribute(); + return 1; +} + + +long GNEViewNet::onCmdAddSelected(FXObject*, FXSelector, void*) { // make GL current (To allow take objects in popup position) if (makeCurrent()) { @@ -2501,14 +2680,20 @@ // build menu checks for Demand checkable buttons myDemandCheckableButtons.buildDemandCheckableButtons(); - // build menu checks of view options Common - myCommonViewOptions.buildCommonViewOptionsMenuChecks(); + // build menu checks of view options Data + myDataCheckableButtons.buildDataCheckableButtons(); // build menu checks of view options Network myNetworkViewOptions.buildNetworkViewOptionsMenuChecks(); // build menu checks of view options Demand myDemandViewOptions.buildDemandViewOptionsMenuChecks(); + + // build menu checks of view options Data + myDataViewOptions.buildDataViewOptionsMenuChecks(); + + // build interval bar + myIntervalBar.buildIntervalBarElements(); } @@ -2518,18 +2703,26 @@ myNetworkViewOptions.hideNetworkViewOptionsMenuChecks(); // hide all checkbox of view options Demand myDemandViewOptions.hideDemandViewOptionsMenuChecks(); + // hide all checkbox of view options Data + myDataViewOptions.hideDataViewOptionsMenuChecks(); // disable all common edit modes myCommonCheckableButtons.disableCommonCheckableButtons(); // disable all network edit modes myNetworkCheckableButtons.disableNetworkCheckableButtons(); + // disable all network edit modes + myDataCheckableButtons.disableDataCheckableButtons(); + // hide interval bar + myIntervalBar.hideIntervalBar(); // hide all frames myViewParent->hideAllFrames(); - // In network mode, always show option "show demand elements" + // In network mode, always show option "show grid", "draw spread vehicles" and "show demand elements" + myNetworkViewOptions.menuCheckShowGrid->show(); + myNetworkViewOptions.menuCheckDrawSpreadVehicles->show(); myNetworkViewOptions.menuCheckShowDemandElements->show(); // enable selected controls switch (myEditModes.networkEditMode) { // common modes - case GNE_NMODE_INSPECT: + case NetworkEditMode::NETWORK_INSPECT: myViewParent->getInspectorFrame()->show(); myViewParent->getInspectorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getInspectorFrame(); @@ -2540,7 +2733,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_DELETE: + case NetworkEditMode::NETWORK_DELETE: myViewParent->getDeleteFrame()->show(); myViewParent->getDeleteFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getDeleteFrame(); @@ -2551,7 +2744,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_SELECT: + case NetworkEditMode::NETWORK_SELECT: myViewParent->getSelectorFrame()->show(); myViewParent->getSelectorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getSelectorFrame(); @@ -2564,24 +2757,24 @@ myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; // specific modes - case GNE_NMODE_CREATE_EDGE: - myNetworkCheckableButtons.createEdgeButton->setChecked(true); + case NetworkEditMode::NETWORK_CREATE_EDGE: // show view options myNetworkViewOptions.menuCheckChainEdges->show(); myNetworkViewOptions.menuCheckAutoOppositeEdge->show(); + myNetworkCheckableButtons.createEdgeButton->setChecked(true); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_MOVE: - myCommonCheckableButtons.moveButton->setChecked(true); + case NetworkEditMode::NETWORK_MOVE: // show view options myNetworkViewOptions.menuCheckWarnAboutMerge->show(); myNetworkViewOptions.menuCheckShowJunctionBubble->show(); myNetworkViewOptions.menuCheckMoveElevation->show(); + myNetworkCheckableButtons.moveNetworkElementsButton->setChecked(true); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_CONNECT: + case NetworkEditMode::NETWORK_CONNECT: myViewParent->getConnectorFrame()->show(); myViewParent->getConnectorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getConnectorFrame(); @@ -2591,7 +2784,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_TLS: + case NetworkEditMode::NETWORK_TLS: myViewParent->getTLSEditorFrame()->show(); myViewParent->getTLSEditorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getTLSEditorFrame(); @@ -2601,7 +2794,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_ADDITIONAL: + case NetworkEditMode::NETWORK_ADDITIONAL: myViewParent->getAdditionalFrame()->show(); myViewParent->getAdditionalFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getAdditionalFrame(); @@ -2609,7 +2802,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_CROSSING: + case NetworkEditMode::NETWORK_CROSSING: myViewParent->getCrossingFrame()->show(); myViewParent->getCrossingFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getCrossingFrame(); @@ -2617,7 +2810,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_TAZ: + case NetworkEditMode::NETWORK_TAZ: myViewParent->getTAZFrame()->show(); myViewParent->getTAZFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getTAZFrame(); @@ -2625,7 +2818,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_POLYGON: + case NetworkEditMode::NETWORK_POLYGON: myViewParent->getPolygonFrame()->show(); myViewParent->getPolygonFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getPolygonFrame(); @@ -2633,7 +2826,7 @@ // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_NMODE_PROHIBITION: + case NetworkEditMode::NETWORK_PROHIBITION: myViewParent->getProhibitionFrame()->show(); myViewParent->getProhibitionFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getProhibitionFrame(); @@ -2653,7 +2846,7 @@ // force repaint because different modes draw different things onPaint(nullptr, 0, nullptr); // finally update view - update(); + updateViewNet(); } @@ -2663,141 +2856,151 @@ myNetworkViewOptions.hideNetworkViewOptionsMenuChecks(); // hide all checkbox of view options Demand myDemandViewOptions.hideDemandViewOptionsMenuChecks(); + // hide all checkbox of view options Data + myDataViewOptions.hideDataViewOptionsMenuChecks(); // disable all common edit modes myCommonCheckableButtons.disableCommonCheckableButtons(); // disable all Demand edit modes myDemandCheckableButtons.disableDemandCheckableButtons(); + // disable all network edit modes + myDataCheckableButtons.disableDataCheckableButtons(); + // hide interval bar + myIntervalBar.hideIntervalBar(); // hide all frames myViewParent->hideAllFrames(); + // always show "hide shapes", "show grid" and "draw spread vehicles" + myDemandViewOptions.menuCheckShowGrid->show(); + myDemandViewOptions.menuCheckDrawSpreadVehicles->show(); + myDemandViewOptions.menuCheckHideShapes->show(); // enable selected controls switch (myEditModes.demandEditMode) { // common modes - case GNE_DMODE_INSPECT: + case DemandEditMode::DEMAND_INSPECT: myViewParent->getInspectorFrame()->show(); myViewParent->getInspectorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getInspectorFrame(); + // set checkable button myCommonCheckableButtons.inspectButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckHideNonInspectedDemandElements->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_DELETE: + case DemandEditMode::DEMAND_DELETE: myViewParent->getDeleteFrame()->show(); myViewParent->getDeleteFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getDeleteFrame(); + // set checkable button myCommonCheckableButtons.deleteButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_SELECT: + case DemandEditMode::DEMAND_SELECT: myViewParent->getSelectorFrame()->show(); myViewParent->getSelectorFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getSelectorFrame(); + // set checkable button myCommonCheckableButtons.selectButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_MOVE: - myCommonCheckableButtons.moveButton->setChecked(true); + case DemandEditMode::DEMAND_MOVE: + // set checkable button + myDemandCheckableButtons.moveDemandElementsButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; // specific modes - case GNE_DMODE_ROUTE: + case DemandEditMode::DEMAND_ROUTE: myViewParent->getRouteFrame()->show(); myViewParent->getRouteFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getRouteFrame(); + // set checkable button myDemandCheckableButtons.routeButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_VEHICLE: + case DemandEditMode::DEMAND_VEHICLE: myViewParent->getVehicleFrame()->show(); myViewParent->getVehicleFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getVehicleFrame(); + // set checkable button myDemandCheckableButtons.vehicleButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_VEHICLETYPES: + case DemandEditMode::DEMAND_VEHICLETYPES: myViewParent->getVehicleTypeFrame()->show(); myViewParent->getVehicleTypeFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getVehicleTypeFrame(); + // set checkable button myDemandCheckableButtons.vehicleTypeButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); /// show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_STOP: + case DemandEditMode::DEMAND_STOP: myViewParent->getStopFrame()->show(); myViewParent->getStopFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getStopFrame(); + // set checkable button myDemandCheckableButtons.stopButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_PERSONTYPES: + case DemandEditMode::DEMAND_PERSONTYPES: myViewParent->getPersonTypeFrame()->show(); myViewParent->getPersonTypeFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getPersonTypeFrame(); + // set checkable button myDemandCheckableButtons.personTypeButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_PERSON: + case DemandEditMode::DEMAND_PERSON: myViewParent->getPersonFrame()->show(); myViewParent->getPersonFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getPersonFrame(); + // set checkable button myDemandCheckableButtons.personButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); break; - case GNE_DMODE_PERSONPLAN: + case DemandEditMode::DEMAND_PERSONPLAN: myViewParent->getPersonPlanFrame()->show(); myViewParent->getPersonPlanFrame()->focusUpperElement(); myCurrentFrame = myViewParent->getPersonPlanFrame(); + // set checkable button myDemandCheckableButtons.personPlanButton->setChecked(true); // show view options - myDemandViewOptions.menuCheckHideShapes->show(); myDemandViewOptions.menuCheckShowAllPersonPlans->show(); myDemandViewOptions.menuCheckLockPerson->show(); // show toolbar grip of view options @@ -2815,11 +3018,104 @@ // force repaint because different modes draw different things onPaint(nullptr, 0, nullptr); // finally update view - update(); + updateViewNet(); } void +GNEViewNet::updateDataModeSpecificControls() { + // hide all checkbox of view options Network + myNetworkViewOptions.hideNetworkViewOptionsMenuChecks(); + // hide all checkbox of view options Demand + myDemandViewOptions.hideDemandViewOptionsMenuChecks(); + // hide all checkbox of view options Data + myDataViewOptions.hideDataViewOptionsMenuChecks(); + // disable all common edit modes + myCommonCheckableButtons.disableCommonCheckableButtons(); + // disable all Data edit modes + myDataCheckableButtons.disableDataCheckableButtons(); + // show interval bar + myIntervalBar.showIntervalBar(); + // hide all frames + myViewParent->hideAllFrames(); + // In data mode, always show option "show demand elements" and "hide shapes" + myDataViewOptions.menuCheckShowAdditionals->show(); + myDataViewOptions.menuCheckShowShapes->show(); + myDataViewOptions.menuCheckShowDemandElements->show(); + // enable selected controls + switch (myEditModes.dataEditMode) { + // common modes + case DataEditMode::DATA_INSPECT: + myViewParent->getInspectorFrame()->show(); + myViewParent->getInspectorFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getInspectorFrame(); + // set checkable button + myCommonCheckableButtons.inspectButton->setChecked(true); + // enable IntervalBar + myIntervalBar.enableIntervalBar(); + // show toolbar grip of view options + myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); + break; + case DataEditMode::DATA_DELETE: + myViewParent->getDeleteFrame()->show(); + myViewParent->getDeleteFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getDeleteFrame(); + // set checkable button + myCommonCheckableButtons.deleteButton->setChecked(true); + // enable IntervalBar + myIntervalBar.enableIntervalBar(); + // show toolbar grip of view options + myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); + break; + case DataEditMode::DATA_SELECT: + myViewParent->getSelectorFrame()->show(); + myViewParent->getSelectorFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getSelectorFrame(); + // set checkable button + myCommonCheckableButtons.selectButton->setChecked(true); + // enable IntervalBar + myIntervalBar.enableIntervalBar(); + // show toolbar grip of view options + myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); + break; + case DataEditMode::DATA_EDGEDATA: + myViewParent->getEdgeDataFrame()->show(); + myViewParent->getEdgeDataFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getEdgeDataFrame(); + // set checkable button + myDataCheckableButtons.edgeDataButton->setChecked(true); + // disable IntervalBar + myIntervalBar.disableIntervalBar(); + // show toolbar grip of view options + myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); + break; + case DataEditMode::DATA_EDGERELDATA: + myViewParent->getEdgeRelDataFrame()->show(); + myViewParent->getEdgeRelDataFrame()->focusUpperElement(); + myCurrentFrame = myViewParent->getEdgeRelDataFrame(); + // set checkable button + myDataCheckableButtons.edgeRelDataButton->setChecked(true); + // disable IntervalBar + myIntervalBar.disableIntervalBar(); + // show toolbar grip of view options + myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); + break; + default: + break; + } + // update common Network buttons + myCommonCheckableButtons.updateCommonCheckableButtons(); + // Update Data buttons + myDataCheckableButtons.updateDataCheckableButtons(); + // recalc toolbar + myViewParent->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); + // force repaint because different modes draw different things + onPaint(nullptr, 0, nullptr); + // finally update view + updateViewNet(); +} + +void GNEViewNet::deleteSelectedJunctions() { std::vector junctions = myNet->retrieveJunctions(true); if (junctions.size() > 0) { @@ -2898,6 +3194,21 @@ void +GNEViewNet::deleteSelectedGenericDatas() { + std::vector genericDatas = myNet->retrieveGenericDatas(true); + if (genericDatas.size() > 0) { + std::string plural = genericDatas.size() == 1 ? ("") : ("s"); + myUndoList->p_begin("delete selected generic data" + plural); + // iterate over generic datas + for (const auto& genericData : genericDatas) { + myNet->deleteGenericData(genericData, myUndoList); + } + myUndoList->p_end(); + } +} + + +void GNEViewNet::deleteSelectedCrossings() { // obtain selected crossings std::vector junctions = myNet->retrieveJunctions(); @@ -2964,7 +3275,7 @@ bool -GNEViewNet::mergeJunctions(GNEJunction* moved, const Position& oldPos) { +GNEViewNet::mergeJunctions(GNEJunction* moved) { const Position& newPos = moved->getNBNode()->getPosition(); GNEJunction* mergeTarget = nullptr; // try to find another junction to merge with @@ -3014,7 +3325,7 @@ } } // restore previous position of junction moved - moved->moveGeometry(oldPos, Position(0, 0)); + moved->moveGeometry(Position(0, 0)); // finish geometry moving moved->endGeometryMoving(); // merge moved and targed junctions @@ -3029,14 +3340,14 @@ void GNEViewNet::updateControls() { switch (myEditModes.networkEditMode) { - case GNE_NMODE_INSPECT: + case NetworkEditMode::NETWORK_INSPECT: myViewParent->getInspectorFrame()->update(); break; default: break; } // update view - update(); + updateViewNet(); } // --------------------------------------------------------------------------- @@ -3154,28 +3465,28 @@ void GNEViewNet::processLeftButtonPressNetwork(void* eventData) { + // first swap lane to edges if mySelectEdges is enabled and shift key isn't pressed + if (myNetworkViewOptions.selectEdges() && (myKeyPressed.shiftKeyPressed() == false)) { + myObjectsUnderCursor.swapLane2Edge(); + } // decide what to do based on mode switch (myEditModes.networkEditMode) { - case GNE_NMODE_INSPECT: { + case NetworkEditMode::NETWORK_INSPECT: { // process left click in Inspector Frame myViewParent->getInspectorFrame()->processNetworkSupermodeClick(getPositionInformation(), myObjectsUnderCursor); // process click processClick(eventData); break; } - case GNE_NMODE_DELETE: { + case NetworkEditMode::NETWORK_DELETE: { // check that we have clicked over an non-demand element if (myObjectsUnderCursor.getAttributeCarrierFront() && !myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { - // change the selected attribute carrier if myNetworkViewOptions.mySelectEdges is enabled and clicked element is a getLaneFront() - if (myNetworkViewOptions.selectEdges() && (myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE) && !myKeyPressed.shiftKeyPressed()) { - myObjectsUnderCursor.swapLane2Edge(); - } // check if we are deleting a selection or an single attribute carrier if (myObjectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { // before delete al selected attribute carriers, check if we clicked over a geometry point if (myViewParent->getDeleteFrame()->getDeleteOptions()->deleteOnlyGeometryPoints() && - (((myObjectsUnderCursor.getEdgeFront()) && (myObjectsUnderCursor.getEdgeFront()->getVertexIndex(getPositionInformation(), false, false) != -1)) - || ((myObjectsUnderCursor.getPolyFront()) && (myObjectsUnderCursor.getPolyFront()->getVertexIndex(getPositionInformation(), false, false) != -1)))) { + (((myObjectsUnderCursor.getEdgeFront()) && (myObjectsUnderCursor.getEdgeFront()->getEdgeVertexIndex(getPositionInformation(), false) != -1)) || + ((myObjectsUnderCursor.getPolyFront()) && (myObjectsUnderCursor.getPolyFront()->getPolyVertexIndex(getPositionInformation(), false) != -1)))) { myViewParent->getDeleteFrame()->removeAttributeCarrier(myObjectsUnderCursor); } else { myViewParent->getDeleteFrame()->removeSelectedAttributeCarriers(); @@ -3189,7 +3500,7 @@ } break; } - case GNE_NMODE_SELECT: + case NetworkEditMode::NETWORK_SELECT: // check if a rect for selecting is being created if (myKeyPressed.shiftKeyPressed()) { // begin rectangle selection @@ -3197,13 +3508,9 @@ } else { // first check that under cursor there is an attribute carrier, isn't a demand element and is selectable if (myObjectsUnderCursor.getAttributeCarrierFront() && !myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { - // change the selected attribute carrier if myNetworkViewOptions.mySelectEdges is enabled and clicked element is a getLaneFront() - if (myNetworkViewOptions.selectEdges() && (myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().getTag() == SUMO_TAG_LANE)) { - myObjectsUnderCursor.swapLane2Edge(); - } // Check if this GLobject type is locked if (!myViewParent->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(myObjectsUnderCursor.getGlTypeFront())) { - // toogle netElement selection + // toogle networkElement selection if (myObjectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { myObjectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); } else { @@ -3215,7 +3522,7 @@ processClick(eventData); } break; - case GNE_NMODE_CREATE_EDGE: { + case NetworkEditMode::NETWORK_CREATE_EDGE: { // make sure that Control key isn't pressed if (!myKeyPressed.controlKeyPressed()) { // process left click in create edge frame Frame @@ -3228,11 +3535,9 @@ processClick(eventData); break; } - case GNE_NMODE_MOVE: { + case NetworkEditMode::NETWORK_MOVE: { // allways swap lane to edges in movement mode - if (myObjectsUnderCursor.getLaneFront()) { - myObjectsUnderCursor.swapLane2Edge(); - } + myObjectsUnderCursor.swapLane2Edge(); // check that AC under cursor isn't a demand element if (myObjectsUnderCursor.getAttributeCarrierFront() && !myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { // check if we're moving a set of selected items @@ -3240,7 +3545,7 @@ // move selected ACs myMoveMultipleElementValues.beginMoveSelection(myObjectsUnderCursor.getAttributeCarrierFront()); // update view - update(); + updateViewNet(); } else if (!myMoveSingleElementValues.beginMoveSingleElementNetworkMode()) { // process click if there isn't movable elements (to move camera using drag an drop) processClick(eventData); @@ -3251,27 +3556,27 @@ } break; } - case GNE_NMODE_CONNECT: { + case NetworkEditMode::NETWORK_CONNECT: { if (myObjectsUnderCursor.getLaneFront()) { // Handle laneclick (shift key may pass connections, Control key allow conflicts) myViewParent->getConnectorFrame()->handleLaneClick(myObjectsUnderCursor); - update(); + updateViewNet(); } // process click processClick(eventData); break; } - case GNE_NMODE_TLS: { + case NetworkEditMode::NETWORK_TLS: { if (myObjectsUnderCursor.getJunctionFront()) { // edit TLS in TLSEditor frame myViewParent->getTLSEditorFrame()->editTLS(getPositionInformation(), myObjectsUnderCursor); - update(); + updateViewNet(); } // process click processClick(eventData); break; } - case GNE_NMODE_ADDITIONAL: { + case NetworkEditMode::NETWORK_ADDITIONAL: { // avoid create additionals if control key is pressed if (!myKeyPressed.controlKeyPressed()) { if (myViewParent->getAdditionalFrame()->getConsecutiveLaneSelector()->isShown()) { @@ -3284,31 +3589,27 @@ } } else if (myViewParent->getAdditionalFrame()->addAdditional(myObjectsUnderCursor)) { // update view to show the new additional - update(); + updateViewNet(); } } // process click processClick(eventData); break; } - case GNE_NMODE_CROSSING: { + case NetworkEditMode::NETWORK_CROSSING: { // swap lanes to edges in crossingsMode - if (myObjectsUnderCursor.getLaneFront()) { - myObjectsUnderCursor.swapLane2Edge(); - } + myObjectsUnderCursor.swapLane2Edge(); // call function addCrossing from crossing frame myViewParent->getCrossingFrame()->addCrossing(myObjectsUnderCursor); // process click processClick(eventData); break; } - case GNE_NMODE_TAZ: { + case NetworkEditMode::NETWORK_TAZ: { // avoid create TAZs if control key is pressed if (!myKeyPressed.controlKeyPressed()) { // swap laness to edges in TAZ Mode - if (myObjectsUnderCursor.getLaneFront()) { - myObjectsUnderCursor.swapLane2Edge(); - } + myObjectsUnderCursor.swapLane2Edge(); // check if we want to create a rect for selecting edges if (myKeyPressed.shiftKeyPressed() && (myViewParent->getTAZFrame()->getTAZCurrentModul()->getTAZ() != nullptr)) { // begin rectangle selection @@ -3317,7 +3618,7 @@ // check if process click was scuesfully if (myViewParent->getTAZFrame()->processClick(snapToActiveGrid(getPositionInformation()), myObjectsUnderCursor)) { // view net must be always update - update(); + updateViewNet(); } // process click processClick(eventData); @@ -3328,15 +3629,15 @@ } break; } - case GNE_NMODE_POLYGON: { + case NetworkEditMode::NETWORK_POLYGON: { // avoid create shapes if control key is pressed if (!myKeyPressed.controlKeyPressed()) { if (!myObjectsUnderCursor.getPOIFront()) { - GNEPolygonFrame::AddShapeResult result = myViewParent->getPolygonFrame()->processClick(snapToActiveGrid(getPositionInformation()), myObjectsUnderCursor); + GNEPolygonFrame::AddShape result = myViewParent->getPolygonFrame()->processClick(snapToActiveGrid(getPositionInformation()), myObjectsUnderCursor); // view net must be always update - update(); + updateViewNet(); // process click depending of the result of "process click" - if ((result != GNEPolygonFrame::ADDSHAPE_UPDATEDTEMPORALSHAPE)) { + if ((result != GNEPolygonFrame::AddShape::UPDATEDTEMPORALSHAPE)) { // process click processClick(eventData); } @@ -3347,11 +3648,11 @@ } break; } - case GNE_NMODE_PROHIBITION: { + case NetworkEditMode::NETWORK_PROHIBITION: { if (myObjectsUnderCursor.getConnectionFront()) { // shift key may pass connections, Control key allow conflicts. myViewParent->getProhibitionFrame()->handleProhibitionClick(myObjectsUnderCursor); - update(); + updateViewNet(); } // process click processClick(eventData); @@ -3374,9 +3675,9 @@ // check if we're creating a rectangle selection or we want only to select a lane if (mySelectingArea.startDrawing) { // check if we're selecting all type of elements o we only want a set of edges for TAZ - if (myEditModes.networkEditMode == GNE_NMODE_SELECT) { + if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_SELECT) { mySelectingArea.processRectangleSelection(); - } else if (myEditModes.networkEditMode == GNE_NMODE_TAZ) { + } else if (myEditModes.networkEditMode == NetworkEditMode::NETWORK_TAZ) { // process edge selection myViewParent->getTAZFrame()->processEdgeSelection(mySelectingArea.processEdgeRectangleSelection()); } @@ -3409,7 +3710,7 @@ void GNEViewNet::processMoveMouseNetwork() { // change "delete last created point" depending if during movement shift key is pressed - if ((myEditModes.networkEditMode == GNE_NMODE_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { + if ((myEditModes.networkEditMode == NetworkEditMode::NETWORK_POLYGON) && myViewParent->getPolygonFrame()->getDrawingShapeModul()->isDrawing()) { myViewParent->getPolygonFrame()->getDrawingShapeModul()->setDeleteLastCreatedPoint(myKeyPressed.shiftKeyPressed()); } // check what type of additional is moved @@ -3430,14 +3731,14 @@ GNEViewNet::processLeftButtonPressDemand(void* eventData) { // decide what to do based on mode switch (myEditModes.demandEditMode) { - case GNE_DMODE_INSPECT: { + case DemandEditMode::DEMAND_INSPECT: { // process left click in Inspector Frame myViewParent->getInspectorFrame()->processDemandSupermodeClick(getPositionInformation(), myObjectsUnderCursor); // process click processClick(eventData); break; } - case GNE_DMODE_DELETE: { + case DemandEditMode::DEMAND_DELETE: { // check that we have clicked over an demand element if (myObjectsUnderCursor.getAttributeCarrierFront() && myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { // check if we are deleting a selection or an single attribute carrier @@ -3452,7 +3753,7 @@ } break; } - case GNE_DMODE_SELECT: + case DemandEditMode::DEMAND_SELECT: // check if a rect for selecting is being created if (myKeyPressed.shiftKeyPressed()) { // begin rectangle selection @@ -3467,7 +3768,7 @@ if (myObjectsUnderCursor.getAttributeCarrierFront() && myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { // Check if this GLobject type is locked if (!myViewParent->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(myObjectsUnderCursor.getGlTypeFront())) { - // toogle netElement selection + // toogle networkElement selection if (myObjectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { myObjectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); } else { @@ -3480,7 +3781,7 @@ } } break; - case GNE_DMODE_MOVE: { + case DemandEditMode::DEMAND_MOVE: { // check that AC under cursor is a demand element if (myObjectsUnderCursor.getAttributeCarrierFront() && myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDemandElement()) { @@ -3489,7 +3790,7 @@ // move selected ACs myMoveMultipleElementValues.beginMoveSelection(myObjectsUnderCursor.getAttributeCarrierFront()); // update view - update(); + updateViewNet(); } else if (!myMoveSingleElementValues.beginMoveSingleElementDemandMode()) { // process click if there isn't movable elements (to move camera using drag an drop) processClick(eventData); @@ -3500,7 +3801,7 @@ } break; } - case GNE_DMODE_ROUTE: { + case DemandEditMode::DEMAND_ROUTE: { // check if we clicked over a lane and Control key isn't pressed if (myObjectsUnderCursor.getLaneFront() && !myKeyPressed.controlKeyPressed()) { // Handle edge click @@ -3510,7 +3811,7 @@ processClick(eventData); break; } - case GNE_DMODE_VEHICLE: { + case DemandEditMode::DEMAND_VEHICLE: { // make sure that Control key isn't pressed if (!myKeyPressed.controlKeyPressed()) { // Handle click @@ -3520,7 +3821,7 @@ processClick(eventData); break; } - case GNE_DMODE_STOP: { + case DemandEditMode::DEMAND_STOP: { // make sure that Control key isn't pressed if (!myKeyPressed.controlKeyPressed()) { // Handle click @@ -3530,7 +3831,7 @@ processClick(eventData); break; } - case GNE_DMODE_PERSON: { + case DemandEditMode::DEMAND_PERSON: { // make sure that Control key isn't pressed if (!myKeyPressed.controlKeyPressed()) { // Handle click @@ -3540,7 +3841,7 @@ processClick(eventData); break; } - case GNE_DMODE_PERSONPLAN: { + case DemandEditMode::DEMAND_PERSONPLAN: { // make sure that Control key isn't pressed if (!myKeyPressed.controlKeyPressed()) { // Handle click @@ -3588,4 +3889,121 @@ } } + +void +GNEViewNet::processLeftButtonPressData(void* eventData) { + // decide what to do based on mode + switch (myEditModes.dataEditMode) { + case DataEditMode::DATA_INSPECT: { + // process left click in Inspector Frame + myViewParent->getInspectorFrame()->processDataSupermodeClick(getPositionInformation(), myObjectsUnderCursor); + // process click + processClick(eventData); + break; + } + case DataEditMode::DATA_DELETE: { + // check that we have clicked over an data element + if (myObjectsUnderCursor.getAttributeCarrierFront() && myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDataElement()) { + // check if we are deleting a selection or an single attribute carrier + if (myObjectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { + myViewParent->getDeleteFrame()->removeSelectedAttributeCarriers(); + } else { + myViewParent->getDeleteFrame()->removeAttributeCarrier(myObjectsUnderCursor); + } + } else { + // process click + processClick(eventData); + } + break; + } + case DataEditMode::DATA_SELECT: + // check if a rect for selecting is being created + if (myKeyPressed.shiftKeyPressed()) { + // begin rectangle selection + mySelectingArea.beginRectangleSelection(); + } else { + // check if a rect for selecting is being created + if (myKeyPressed.shiftKeyPressed()) { + // begin rectangle selection + mySelectingArea.beginRectangleSelection(); + } else { + // first check that under cursor there is an attribute carrier, is data element and is selectable + if (myObjectsUnderCursor.getAttributeCarrierFront() && myObjectsUnderCursor.getAttributeCarrierFront()->getTagProperty().isDataElement()) { + // Check if this GLobject type is locked + if (!myViewParent->getSelectorFrame()->getLockGLObjectTypes()->IsObjectTypeLocked(myObjectsUnderCursor.getGlTypeFront())) { + // toogle networkElement selection + if (myObjectsUnderCursor.getAttributeCarrierFront()->isAttributeCarrierSelected()) { + myObjectsUnderCursor.getAttributeCarrierFront()->unselectAttributeCarrier(); + } else { + myObjectsUnderCursor.getAttributeCarrierFront()->selectAttributeCarrier(); + } + } + } + // process click + processClick(eventData); + } + } + break; + case DataEditMode::DATA_EDGEDATA: + // avoid create edgeData if control key is pressed + if (!myKeyPressed.controlKeyPressed()) { + if (myViewParent->getEdgeDataFrame()->addEdgeData(myObjectsUnderCursor)) { + // update view to show the new edge data + updateViewNet(); + } + } + // process click + processClick(eventData); + break; + case DataEditMode::DATA_EDGERELDATA: + // avoid create edgeData if control key is pressed + if (!myKeyPressed.controlKeyPressed()) { + if (myViewParent->getEdgeRelDataFrame()->addEdgeRelationData(myObjectsUnderCursor)) { + // update view to show the new edge data + updateViewNet(); + } + } + // process click + processClick(eventData); + break; + default: { + // process click + processClick(eventData); + } + } +} + + +void +GNEViewNet::processLeftButtonReleaseData() { + // check moved items + if (myMoveMultipleElementValues.isMovingSelection()) { + myMoveMultipleElementValues.finishMoveSelection(); + } else if (mySelectingArea.selectingUsingRectangle) { + // check if we're creating a rectangle selection or we want only to select a lane + if (mySelectingArea.startDrawing) { + mySelectingArea.processRectangleSelection(); + } + // finish selection + mySelectingArea.finishRectangleSelection(); + } else { + // finish moving of single elements + myMoveSingleElementValues.finishMoveSingleElement(); + } +} + + +void +GNEViewNet::processMoveMouseData() { + if (mySelectingArea.selectingUsingRectangle) { + // update selection corner of selecting area + mySelectingArea.moveRectangleSelection(); + } else { + // move single elements + myMoveSingleElementValues.moveSingleElement(); + } +} + + /****************************************************************************/ + diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewNet.h sumo-1.6.0+dfsg1/src/netedit/GNEViewNet.h --- sumo-1.5.0+dfsg1/src/netedit/GNEViewNet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewNet.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A view on the network being edited (adapted from GUIViewTraffic) /****************************************************************************/ -#ifndef GNEViewNet_h -#define GNEViewNet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include "GNEViewNetHelper.h" #include @@ -72,7 +66,10 @@ void buildViewToolBars(GUIGlChildWindow&); /// @brief Mark the entire GNEViewNet to be repainted later - void update() const; + void updateViewNet() const; + + /// @brief set supermode Network (used after load/create new network) + void forceSupermodeNetwork(); /// @brief get AttributeCarriers in Boundary std::set > getAttributeCarriersInBoundary(const Boundary& boundary, bool forceSelectEdges = false); @@ -105,15 +102,15 @@ /// @brief get testing mode const GNEViewNetHelper::TestingMode& getTestingMode() const; - /// @brief get Common view options - const GNEViewNetHelper::CommonViewOptions& getCommonViewOptions() const; - /// @brief get network view options const GNEViewNetHelper::NetworkViewOptions& getNetworkViewOptions() const; /// @brief get demand view options const GNEViewNetHelper::DemandViewOptions& getDemandViewOptions() const; + /// @brief get data view options + const GNEViewNetHelper::DataViewOptions& getDataViewOptions() const; + /// @brief get Key Pressed modul const GNEViewNetHelper::KeyPressed& getKeyPressed() const; @@ -246,8 +243,6 @@ /// @name View options network call backs /// @{ - /// @brief toogle show demand elements - long onCmdToogleShowDemandElements(FXObject*, FXSelector, void*); /// @brief toogle select edges long onCmdToogleSelectEdges(FXObject*, FXSelector, void*); @@ -265,7 +260,10 @@ long onCmdToogleChangeAllPhases(FXObject*, FXSelector, void*); /// @brief toogle show grid - long onCmdToogleShowGrid(FXObject*, FXSelector, void*); + long onCmdToogleShowGridNetwork(FXObject*, FXSelector, void*); + + /// @brief toogle show grid + long onCmdToogleShowGridDemand(FXObject*, FXSelector, void*); /// @brief toogle draw vehicles in begin position or spread in lane long onCmdToogleDrawSpreadVehicles(FXObject*, FXSelector, void*); @@ -296,6 +294,39 @@ /// @brief toogle lock person in super mode demand long onCmdToogleLockPerson(FXObject*, FXSelector, void*); + + /// @brief toogle show additionals in super mode data + long onCmdToogleShowAdditionals(FXObject*, FXSelector, void*); + + /// @brief toogle show shapes in super mode data + long onCmdToogleShowShapes(FXObject*, FXSelector, void*); + + /// @brief toogle show demand elements + long onCmdToogleShowDemandElements(FXObject*, FXSelector, void*); + + /// @} + + //// @name interval bar functions + /// @{ + + /// @brief change generic data type in interval bar + long onCmdIntervalBarGenericDataType(FXObject*, FXSelector, void*); + + /// @brief change data set in interval bar + long onCmdIntervalBarDataSet(FXObject*, FXSelector, void*); + + /// @brief change limit interval in interval bar + long onCmdIntervalBarLimit(FXObject*, FXSelector, void*); + + /// @brief change begin in interval bar + long onCmdIntervalBarSetBegin(FXObject*, FXSelector, void*); + + /// @brief change end in interval bar + long onCmdIntervalBarSetEnd(FXObject*, FXSelector, void*); + + /// @brief change attribute in interval bar + long onCmdIntervalBarSetAttribute(FXObject*, FXSelector, void*); + /// @} /// @brief select AC under cursor @@ -328,6 +359,9 @@ /// @brief get the undoList object GNEUndoList* getUndoList() const; + /// @brief get interval bar + GNEViewNetHelper::IntervalBar& getIntervalBar(); + /// @brief get AttributeCarrier under cursor const GNEAttributeCarrier* getDottedAC() const; @@ -400,21 +434,27 @@ /// @brief variable used to save checkable buttons for Supermode Demand GNEViewNetHelper::DemandCheckableButtons myDemandCheckableButtons; + + /// @brief variable used to save checkable buttons for Supermode Data + GNEViewNetHelper::DataCheckableButtons myDataCheckableButtons; /// @} /// @name structs related with view options /// @{ - /// @brief variable used to save variables related with common view options - GNEViewNetHelper::CommonViewOptions myCommonViewOptions; - - /// @brief variable used to save variables related with view options in Network Supermode + /// @brief variable used to save variables related with view options in supermode Network GNEViewNetHelper::NetworkViewOptions myNetworkViewOptions; - /// @brief variable used to save variables related with view options in Demand Supermode + /// @brief variable used to save variables related with view options in supermode Demand GNEViewNetHelper::DemandViewOptions myDemandViewOptions; + + /// @brief variable used to save variables related with view options in supermode Data + GNEViewNetHelper::DataViewOptions myDataViewOptions; /// @} + /// @brief variable used to save IntervalBar + GNEViewNetHelper::IntervalBar myIntervalBar; + /// @name structs related with move elements /// @{ /// @brief variable used to save variables related with movement of single elements @@ -469,6 +509,9 @@ /// @brief updates Demand mode specific controls void updateDemandModeSpecificControls(); + /// @brief updates Data mode specific controls + void updateDataModeSpecificControls(); + /// @brief delete all currently selected junctions void deleteSelectedJunctions(); @@ -484,6 +527,9 @@ /// @brief delete all currently selected demand elements void deleteSelectedDemandElements(); + /// @brief delete all currently selected generic data elements + void deleteSelectedGenericDatas(); + /// @brief delete all currently selected crossings void deleteSelectedCrossings(); @@ -494,7 +540,7 @@ void deleteSelectedShapes(); /// @brief try to merge moved junction with another junction in that spot return true if merging did take place - bool mergeJunctions(GNEJunction* moved, const Position& oldPos); + bool mergeJunctions(GNEJunction* moved); /// @brief try to retrieve an edge at popup position GNEEdge* getEdgeAtPopupPosition(); @@ -566,14 +612,18 @@ /// @brief process move mouse function in Supermode Demand void processMoveMouseDemand(); + /// @brief process left button press function in Supermode Data + void processLeftButtonPressData(void* eventData); + + /// @brief process left button release function in Supermode Data + void processLeftButtonReleaseData(); + + /// @brief process move mouse function in Supermode Data + void processMoveMouseData(); + /// @brief Invalidated copy constructor. GNEViewNet(const GNEViewNet&) = delete; /// @brief Invalidated assignment operator. GNEViewNet& operator=(const GNEViewNet&) = delete; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewNetHelper.cpp sumo-1.6.0+dfsg1/src/netedit/GNEViewNetHelper.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEViewNetHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewNetHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,23 +18,20 @@ /// // A file used to reduce the size of GNEViewNet.h grouping structs and classes /****************************************************************************/ - - -// =========================================================================== -// included 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 @@ -55,14 +52,21 @@ // GNEViewNetHelper::ObjectsUnderCursor - methods // --------------------------------------------------------------------------- -GNEViewNetHelper::ObjectsUnderCursor::ObjectsUnderCursor() {} +GNEViewNetHelper::ObjectsUnderCursor::ObjectsUnderCursor() : + mySwapLane2edge(false) {} void GNEViewNetHelper::ObjectsUnderCursor::updateObjectUnderCursor(const std::vector& GUIGlObjects, GNEPoly* editedPolyShape) { + // reset flag + mySwapLane2edge = false; // first clear all containers - myAttributeCarriers.clear(); - myNetElements.clear(); + myGUIGlObjectLanes.clear(); + myGUIGlObjectEdges.clear(); + myAttributeCarrierLanes.clear(); + myAttributeCarrierEdges.clear(); + myNetworkElementLanes.clear(); + myNetworkElementEdges.clear(); myAdditionals.clear(); myShapes.clear(); myDemandElements.clear(); @@ -74,117 +78,178 @@ myTAZs.clear(); myPOIs.clear(); myPolys.clear(); - // set GUIGlObject + myGenericDatas.clear(); + myEdgeDatas.clear(); + myEdgeRelDatas.clear(); + // set GUIGlObject in myGUIGlObjectLanes sortGUIGlObjectsByAltitude(GUIGlObjects); // iterate over GUIGlObjects - for (const auto& i : myGUIGlObjects) { - // only continue if isn't GLO_NETELEMENT (0) - if (i->getType() != GLO_NETELEMENT) { + for (const auto& GUIGlObject : myGUIGlObjectLanes) { + // only continue if isn't GLO_NETWORKELEMENT (0) + if (GUIGlObject->getType() != GLO_NETWORKELEMENT) { // cast attribute carrier from glObject - myAttributeCarriers.push_back(dynamic_cast(i)); + GNEAttributeCarrier* AC = dynamic_cast(GUIGlObject); // only continue if attributeCarrier isn't nullptr; - if (myAttributeCarriers.back()) { + if (AC) { + // add it in myAttributeCarrierLanes and myAttributeCarrierEdges + myAttributeCarrierLanes.push_back(AC); + myAttributeCarrierEdges.push_back(AC); // If we're editing a shape, ignore rest of elements (including other polygons) if (editedPolyShape != nullptr) { - if (myAttributeCarriers.back() == editedPolyShape) { + if (AC == editedPolyShape) { // cast Poly from attribute carrier - myPolys.push_back(dynamic_cast(myAttributeCarriers.back())); + myPolys.push_back(dynamic_cast(AC)); } } else { - // obtain tag property (only for improve code legibility) - const auto& tagValue = myAttributeCarriers.back()->getTagProperty(); - // check if attributeCarrier can be casted into netElement, additional or shape - if (tagValue.isNetElement()) { - // cast netElement from attribute carrier - myNetElements.push_back(dynamic_cast(myAttributeCarriers.back())); - } else if (tagValue.isDemandElement()) { - // cast demand element from attribute carrier - myDemandElements.push_back(dynamic_cast(myAttributeCarriers.back())); - } else if (tagValue.isAdditional()) { + // cast specific network elemetns + if (AC->getTagProperty().isNetworkElement()) { + // cast specific network element + switch (GUIGlObject->getType()) { + case GLO_JUNCTION: { + // cast Junction + GNEJunction* junction = dynamic_cast(AC); + if (junction) { + myJunctions.push_back(junction); + // add it in network containers + myNetworkElementLanes.push_back(junction); + myNetworkElementEdges.push_back(junction); + } else { + throw ProcessError("invalid cast"); + } + break; + } + case GLO_EDGE: { + // cast Edge + GNEEdge* edge = dynamic_cast(AC); + if (edge) { + myEdges.push_back(edge); + // add it in network containers + myNetworkElementLanes.push_back(edge); + myNetworkElementEdges.push_back(edge); + } else { + throw ProcessError("invalid cast"); + } + break; + } + case GLO_LANE: { + // cast Lane + GNELane* lane = dynamic_cast(AC); + if (lane) { + myLanes.push_back(lane); + myEdges.push_back(lane->getParentEdge()); + // add it in network containers + myNetworkElementLanes.push_back(lane); + myNetworkElementEdges.push_back(lane->getParentEdge()); + // change last inserted attribute carrier + myAttributeCarrierEdges.pop_back(); + myAttributeCarrierEdges.push_back(lane->getParentEdge()); + } else { + throw ProcessError("invalid cast"); + } + break; + } + case GLO_CROSSING: { + // cast Crossing + GNECrossing* crossing = dynamic_cast(AC); + if (crossing) { + myCrossings.push_back(crossing); + // add it in network containers + myNetworkElementLanes.push_back(crossing); + myNetworkElementEdges.push_back(crossing); + } else { + throw ProcessError("invalid cast"); + } + break; + } + case GLO_CONNECTION: { + // cast Connection + GNEConnection* connection = dynamic_cast(AC); + if (connection) { + myConnections.push_back(connection); + // add it in network containers + myNetworkElementLanes.push_back(connection); + myNetworkElementEdges.push_back(connection); + } else { + throw ProcessError("invalid cast"); + } + break; + } + default: + break; + } + } else if (AC->getTagProperty().isAdditionalElement()) { // cast additional element from attribute carrier - myAdditionals.push_back(dynamic_cast(myAttributeCarriers.back())); - } else if (tagValue.isShape()) { - // cast shape element from attribute carrier - myShapes.push_back(dynamic_cast(myAttributeCarriers.back())); - } else if (tagValue.isTAZ()) { + myAdditionals.push_back(dynamic_cast(AC)); + } else if (AC->getTagProperty().isTAZ()) { // cast TAZ element from attribute carrier - myTAZs.push_back(dynamic_cast(myAttributeCarriers.back())); - } - // now set specify AC type - switch (i->getType()) { - case GLO_JUNCTION: - myJunctions.push_back(dynamic_cast(myAttributeCarriers.back())); - break; - case GLO_EDGE: { - // fisrt obtain Edge - GNEEdge* edge = dynamic_cast(myAttributeCarriers.back()); - // check if parent edge is already inserted in myEdges (for example, due clicking over Geometry Points) - if (std::find(myEdges.begin(), myEdges.end(), edge) == myEdges.end()) { - myEdges.push_back(edge); - } - break; + myTAZs.push_back(dynamic_cast(AC)); + } else if (AC->getTagProperty().isShape()) { + // cast shape element from attribute carrier + myShapes.push_back(dynamic_cast(AC)); + // cast specific shape + switch (GUIGlObject->getType()) { + case GLO_POI: + myPOIs.push_back(dynamic_cast(AC)); + break; + case GLO_POLYGON: + myPolys.push_back(dynamic_cast(AC)); + break; + default: + break; } - case GLO_LANE: { - myLanes.push_back(dynamic_cast(myAttributeCarriers.back())); - // check if edge's parent lane is already inserted in myEdges (for example, due clicking over Geometry Points) - if (std::find(myEdges.begin(), myEdges.end(), myLanes.back()->getParentEdge()) == myEdges.end()) { - myEdges.push_back(myLanes.back()->getParentEdge()); - } - break; + } else if (AC->getTagProperty().isDemandElement()) { + // cast demand element from attribute carrier + myDemandElements.push_back(dynamic_cast(AC)); + } else if (AC->getTagProperty().isGenericData()) { + // cast generic data from attribute carrier + myGenericDatas.push_back(dynamic_cast(AC)); + // cast specific generic data + switch (GUIGlObject->getType()) { + case GLO_EDGEDATA: + myEdgeDatas.push_back(dynamic_cast(AC)); + break; + case GLO_EDGERELDATA: + myEdgeRelDatas.push_back(dynamic_cast(AC)); + break; + default: + break; } - case GLO_CROSSING: - myCrossings.push_back(dynamic_cast(myAttributeCarriers.back())); - break; - case GLO_CONNECTION: - myConnections.push_back(dynamic_cast(myAttributeCarriers.back())); - break; - case GLO_POI: - myPOIs.push_back(dynamic_cast(myAttributeCarriers.back())); - break; - case GLO_POLYGON: - myPolys.push_back(dynamic_cast(myAttributeCarriers.back())); - break; - default: - break; } } - } else { - myAttributeCarriers.pop_back(); } } + // fill myGUIGlObjectEdges + if (GUIGlObject->getType() == GLO_LANE) { + myGUIGlObjectEdges.push_back(myLanes.back()->getParentEdge()); + } else { + myGUIGlObjectEdges.push_back(GUIGlObject); + } } - /* - // write information in debug mode (Currently disabled) - WRITE_DEBUG("ObjectsUnderCursor: GUIGlObjects: " + toString(GUIGlObjects.size()) + - ", AttributeCarriers: " + toString(myAttributeCarriers.size()) + - ", NetElements: " + toString(myNetElements.size()) + + // write information in debug mode + WRITE_DEBUG("ObjectsUnderCursor: GUIGlObjects: " + toString(myGUIGlObjectLanes.size()) + + ", AttributeCarriers: " + toString(myAttributeCarrierLanes.size()) + + ", NetworkElements: " + toString(myNetworkElementLanes.size()) + ", Additionals: " + toString(myAdditionals.size()) + - ", DemandElements: " + toString(myDemandElements.size()) + ", Shapes: " + toString(myShapes.size()) + + ", DemandElements: " + toString(myDemandElements.size()) + + ", GenericDatas: " + toString(myGenericDatas.size()) + ", Junctions: " + toString(myJunctions.size()) + ", Edges: " + toString(myEdges.size()) + ", Lanes: " + toString(myLanes.size()) + ", Crossings: " + toString(myCrossings.size()) + ", Connections: " + toString(myConnections.size()) + ", TAZs: " + toString(myTAZs.size()) + + ", Polys: " + toString(myPolys.size()) + ", POIs: " + toString(myPOIs.size()) + - ", Polys: " + toString(myPolys.size())); - */ + ", EdgeDatas: " + toString(myEdgeDatas.size()) + + ", EdgeRelDatas: " + toString(myEdgeRelDatas.size())); } void GNEViewNetHelper::ObjectsUnderCursor::swapLane2Edge() { - // clear some containers - myGUIGlObjects.clear(); - myAttributeCarriers.clear(); - myNetElements.clear(); - // fill containers using edges - for (const auto& i : myEdges) { - myGUIGlObjects.push_back(i); - myAttributeCarriers.push_back(i); - myNetElements.push_back(i); - } + // change flag + mySwapLane2edge = true; // write information for debug WRITE_DEBUG("ObjectsUnderCursor: swapped Lanes to edges") } @@ -192,8 +257,14 @@ GUIGlID GNEViewNetHelper::ObjectsUnderCursor::getGlIDFront() const { - if (myGUIGlObjects.size() > 0) { - return myGUIGlObjects.front()->getGlID(); + if (mySwapLane2edge) { + if (myGUIGlObjectEdges.size() > 0) { + return myGUIGlObjectEdges.front()->getGlID(); + } else { + return 0; + } + } else if (myGUIGlObjectLanes.size() > 0) { + return myGUIGlObjectLanes.front()->getGlID(); } else { return 0; } @@ -202,8 +273,14 @@ GUIGlObjectType GNEViewNetHelper::ObjectsUnderCursor::getGlTypeFront() const { - if (myGUIGlObjects.size() > 0) { - return myGUIGlObjects.front()->getType(); + if (mySwapLane2edge) { + if (myGUIGlObjectEdges.size() > 0) { + return myGUIGlObjectEdges.front()->getType(); + } else { + return GLO_NETWORK; + } + } else if (myGUIGlObjectLanes.size() > 0) { + return myGUIGlObjectLanes.front()->getType(); } else { return GLO_NETWORK; } @@ -212,18 +289,30 @@ GNEAttributeCarrier* GNEViewNetHelper::ObjectsUnderCursor::getAttributeCarrierFront() const { - if (myAttributeCarriers.size() > 0) { - return myAttributeCarriers.front(); + if (mySwapLane2edge) { + if (myAttributeCarrierEdges.size() > 0) { + return myAttributeCarrierEdges.front(); + } else { + return nullptr; + } + } else if (myAttributeCarrierLanes.size() > 0) { + return myAttributeCarrierLanes.front(); } else { return nullptr; } } -GNENetElement* -GNEViewNetHelper::ObjectsUnderCursor::getNetElementFront() const { - if (myNetElements.size() > 0) { - return myNetElements.front(); +GNENetworkElement* +GNEViewNetHelper::ObjectsUnderCursor::getNetworkElementFront() const { + if (mySwapLane2edge) { + if (myNetworkElementEdges.size() > 0) { + return myNetworkElementEdges.front(); + } else { + return nullptr; + } + } else if (myNetworkElementLanes.size() > 0) { + return myNetworkElementLanes.front(); } else { return nullptr; } @@ -260,6 +349,16 @@ } +GNEGenericData* +GNEViewNetHelper::ObjectsUnderCursor::getGenericDataElementFront() const { + if (myGenericDatas.size() > 0) { + return myGenericDatas.front(); + } else { + return nullptr; + } +} + + GNEJunction* GNEViewNetHelper::ObjectsUnderCursor::getJunctionFront() const { if (myJunctions.size() > 0) { @@ -340,25 +439,47 @@ } +GNEEdgeData* +GNEViewNetHelper::ObjectsUnderCursor::getEdgeDataElementFront() const { + if (myEdgeDatas.size() > 0) { + return myEdgeDatas.front(); + } else { + return nullptr; + } +} + + +GNEEdgeRelData* +GNEViewNetHelper::ObjectsUnderCursor::getEdgeRelDataElementFront() const { + if (myEdgeRelDatas.size() > 0) { + return myEdgeRelDatas.front(); + } else { + return nullptr; + } +} + + const std::vector& GNEViewNetHelper::ObjectsUnderCursor::getClickedAttributeCarriers() const { - return myAttributeCarriers; + if (mySwapLane2edge) { + return myAttributeCarrierEdges; + } else { + return myAttributeCarrierLanes; + } } void GNEViewNetHelper::ObjectsUnderCursor::sortGUIGlObjectsByAltitude(const std::vector& GUIGlObjects) { - // first clear myGUIGlObjects - myGUIGlObjects.clear(); - // declare a map to save sorted GUIGlObjects + // declare a map to save GUIGlObjects sorted by GLO_TYPE std::map > mySortedGUIGlObjects; for (const auto& i : GUIGlObjects) { mySortedGUIGlObjects[i->getType()].push_back(i); } - // move sorted GUIGlObjects into myGUIGlObjects using a reverse iterator + // move sorted GUIGlObjects into myGUIGlObjectLanes using a reverse iterator for (std::map >::reverse_iterator i = mySortedGUIGlObjects.rbegin(); i != mySortedGUIGlObjects.rend(); i++) { for (const auto& j : i->second) { - myGUIGlObjects.push_back(j); + myGUIGlObjectLanes.push_back(j); } } } @@ -402,7 +523,6 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::MoveSingleElementValues::MoveSingleElementValues(GNEViewNet* viewNet) : - movingIndexShape(-1), myViewNet(viewNet), myMovingStartPos(false), myMovingEndPos(false), @@ -427,15 +547,13 @@ } else if (myViewNet->myObjectsUnderCursor.getPOIFront()) { // set POI moved object myPOIToMove = myViewNet->myObjectsUnderCursor.getPOIFront(); - // Save original Position of POI in view - originalPositionInView = myPOIToMove->getPositionInView(); + // start POI geometry moving + myPOIToMove->startPOIGeometryMoving(); // there is moved items, then return true return true; } else if (myViewNet->myObjectsUnderCursor.getAdditionalFront()) { // set additionals moved object myAdditionalToMove = myViewNet->myObjectsUnderCursor.getAdditionalFront(); - // save current position of additional - originalPositionInView = myAdditionalToMove->getPositionInView(); // start additional geometry moving myAdditionalToMove->startGeometryMoving(); // there is moved items, then return true @@ -446,8 +564,6 @@ } else if (myViewNet->myObjectsUnderCursor.getJunctionFront()) { // set junction moved object myJunctionToMove = myViewNet->myObjectsUnderCursor.getJunctionFront(); - // Save original Position of Element in view - originalPositionInView = myJunctionToMove->getPositionInView(); // start junction geometry moving myJunctionToMove->startGeometryMoving(); // there is moved items, then return true @@ -470,8 +586,6 @@ if (myViewNet->myObjectsUnderCursor.getDemandElementFront()) { // set additionals moved object myDemandElementToMove = myViewNet->myObjectsUnderCursor.getDemandElementFront(); - // save current position of demand element - originalPositionInView = myDemandElementToMove->getPositionInView(); // start demand element geometry moving myDemandElementToMove->startGeometryMoving(); // there is moved items, then return true @@ -498,75 +612,78 @@ } // check what element will be moved if (myPolyToMove) { - // move shape's geometry without commiting changes depending if polygon is blocked - if (myPolyToMove->isPolygonBlocked()) { - // move entire shape - myPolyToMove->moveEntireShape(originalShapeBeforeMoving, offsetMovement); - } else { - // move only a certain Geometry Point - movingIndexShape = myPolyToMove->moveVertexShape(movingIndexShape, originalPositionInView, offsetMovement); - } + // move poly's geometry without commiting changes + myPolyToMove->movePolyShape(offsetMovement); + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myPOIToMove) { // Move POI's geometry without commiting changes - myPOIToMove->moveGeometry(originalPositionInView, offsetMovement); + myPOIToMove->movePOIGeometry(offsetMovement); + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myJunctionToMove) { // Move Junction's geometry without commiting changes - myJunctionToMove->moveGeometry(originalPositionInView, offsetMovement); + myJunctionToMove->moveGeometry(offsetMovement); + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myEdgeToMove) { // check if we're moving the start or end position, or a geometry point if (myMovingStartPos) { - myEdgeToMove->moveShapeStart(originalPositionInView, offsetMovement); + myEdgeToMove->moveShapeBegin(offsetMovement); } else if (myMovingEndPos) { - myEdgeToMove->moveShapeEnd(originalPositionInView, offsetMovement); + myEdgeToMove->moveShapeEnd(offsetMovement); } else { // move edge's geometry without commiting changes - movingIndexShape = myEdgeToMove->moveVertexShape(movingIndexShape, originalPositionInView, offsetMovement); + myEdgeToMove->moveEdgeShape(offsetMovement); } + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myAdditionalToMove && (myAdditionalToMove->isAdditionalBlocked() == false)) { // Move Additional geometry without commiting changes myAdditionalToMove->moveGeometry(offsetMovement); + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myDemandElementToMove/* && (myDemandElementToMove->isDemandElementBlocked() == false)*/) { // Move DemandElement geometry without commiting changes myDemandElementToMove->moveGeometry(offsetMovement); + // update view (needed to see the movement) + myViewNet->updateViewNet(); } else if (myTAZToMove) { /// move TAZ's geometry without commiting changes depending if polygon is blocked - if (myTAZToMove->isShapeBlocked()) { - // move entire shape - myTAZToMove->moveEntireShape(originalShapeBeforeMoving, offsetMovement); - } else { - // move only a certain Geometry Point - movingIndexShape = myTAZToMove->moveVertexShape(movingIndexShape, originalPositionInView, offsetMovement); - } + /*if (myTAZToMove->isShapeBlocked()) {*/ + // move TAZ's geometry without commiting changes + myTAZToMove->moveTAZShape(offsetMovement); + /*}*/ + // update view (needed to see the movement) + myViewNet->updateViewNet(); } - // update view (needed to see the movement) - myViewNet->update(); } void GNEViewNetHelper::MoveSingleElementValues::finishMoveSingleElement() { if (myPolyToMove) { - myPolyToMove->commitShapeChange(originalShapeBeforeMoving, myViewNet->getUndoList()); + myPolyToMove->commitPolyShapeChange(myViewNet->getUndoList()); myPolyToMove = nullptr; } else if (myPOIToMove) { - myPOIToMove->commitGeometryMoving(originalPositionInView, myViewNet->getUndoList()); + myPOIToMove->commitPOIGeometryMoving(myViewNet->getUndoList()); myPOIToMove = nullptr; } else if (myJunctionToMove) { // check if in the moved position there is another Junction and it will be merged - if (!myViewNet->mergeJunctions(myJunctionToMove, originalPositionInView)) { - myJunctionToMove->commitGeometryMoving(originalPositionInView, myViewNet->getUndoList()); + if (!myViewNet->mergeJunctions(myJunctionToMove)) { + myJunctionToMove->commitGeometryMoving(myViewNet->getUndoList()); } myJunctionToMove = nullptr; } else if (myEdgeToMove) { // commit change depending of what was moved if (myMovingStartPos) { - myEdgeToMove->commitShapeStartChange(originalPositionInView, myViewNet->getUndoList()); + myEdgeToMove->commitShapeChangeBegin(myViewNet->getUndoList()); myMovingStartPos = false; } else if (myMovingEndPos) { - myEdgeToMove->commitShapeEndChange(originalPositionInView, myViewNet->getUndoList()); + myEdgeToMove->commitShapeChangeEnd(myViewNet->getUndoList()); myMovingEndPos = false; } else { - myEdgeToMove->commitShapeChange(originalShapeBeforeMoving, myViewNet->getUndoList()); + myEdgeToMove->commitEdgeShapeChange(myViewNet->getUndoList()); } myEdgeToMove = nullptr; } else if (myAdditionalToMove) { @@ -578,7 +695,7 @@ myDemandElementToMove->endGeometryMoving(); myDemandElementToMove = nullptr; } else if (myTAZToMove) { - myTAZToMove->commitShapeChange(originalShapeBeforeMoving, myViewNet->getUndoList()); + myTAZToMove->commitTAZShapeChange(myViewNet->getUndoList()); myTAZToMove = nullptr; } } @@ -586,18 +703,17 @@ bool GNEViewNetHelper::MoveSingleElementValues::calculatePolyValues() { - // set Poly to move + // assign clicked poly to polyToMove myPolyToMove = myViewNet->myObjectsUnderCursor.getPolyFront(); + // calculate polyShapeOffset + double polyShapeOffset = myPolyToMove->getShape().nearest_offset_to_point2D(myViewNet->getPositionInformation(), false); + // if polyShapeOffset is -1, then we clicked over // now we have two cases: if we're editing the X-Y coordenade or the altitude (z) if (myViewNet->myNetworkViewOptions.menuCheckMoveElevation->shown() && myViewNet->myNetworkViewOptions.menuCheckMoveElevation->getCheck() == TRUE) { // check if in the clicked position a geometry point exist - int existentIndex = myPolyToMove->getVertexIndex(myViewNet->getPositionInformation(), false, false); - if (existentIndex != -1) { - // save original shape (needed for commit change) - myViewNet->myMoveSingleElementValues.originalShapeBeforeMoving = myPolyToMove->getShape(); - // obtain existent index - myViewNet->myMoveSingleElementValues.movingIndexShape = existentIndex; - myViewNet->myMoveSingleElementValues.originalPositionInView = myPolyToMove->getShape()[existentIndex]; + if (myPolyToMove->getPolyVertexIndex(myViewNet->getPositionInformation(), false) != -1) { + // start geometry moving + myPolyToMove->startPolyShapeGeometryMoving(polyShapeOffset); // poly values sucesfully calculated, then return true return true; } else { @@ -607,48 +723,10 @@ return false; } } else { - // save original shape (needed for commit change) - myViewNet->myMoveSingleElementValues.originalShapeBeforeMoving = myPolyToMove->getShape(); - // save clicked position as moving original position - myViewNet->myMoveSingleElementValues.originalPositionInView = myViewNet->getPositionInformation(); - // obtain index of vertex to move if shape isn't blocked - if ((myPolyToMove->isPolygonBlocked() == false) && (myPolyToMove->isMovementBlocked() == false)) { - // check if we want to remove a Geometry Point - if (myViewNet->myKeyPressed.shiftKeyPressed()) { - // check if we're clicked over a Geometry Point - myViewNet->myMoveSingleElementValues.movingIndexShape = myPolyToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, false, false); - if (myViewNet->myMoveSingleElementValues.movingIndexShape != -1) { - myPolyToMove->deleteGeometryPoint(myViewNet->myMoveSingleElementValues.originalPositionInView); - // after removing Geomtery Point, reset PolyToMove - myPolyToMove = nullptr; - // poly values wasn't calculated, then return false - return false; - } - // poly values sucesfully calculated, then return true - return true; - } else { - // obtain index of vertex to move and moving reference - myViewNet->myMoveSingleElementValues.movingIndexShape = myPolyToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, false, false); - // check if a new Vertex must be created - if (myViewNet->myMoveSingleElementValues.movingIndexShape == -1) { - if (myPolyToMove->getShape().distance2D(myViewNet->myMoveSingleElementValues.originalPositionInView) <= 0.8) { - // create new geometry point - myViewNet->myMoveSingleElementValues.movingIndexShape = myPolyToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, true, true); - } else { - // nothing to move, then return false - return false; - } - } - // set Z value - myViewNet->myMoveSingleElementValues.originalPositionInView.setz(myPolyToMove->getShape()[myViewNet->myMoveSingleElementValues.movingIndexShape].z()); - // poly values sucesfully calculated, then return true - return true; - } - } else { - myViewNet->myMoveSingleElementValues.movingIndexShape = -1; - // check if polygon has the entire movement blocked, or only the shape blocked - return (myPolyToMove->isMovementBlocked() == false); - } + // start geometry moving + myPolyToMove->startPolyShapeGeometryMoving(polyShapeOffset); + // poly values sucesfully calculated, then return true + return true; } } @@ -663,33 +741,30 @@ } else { // assign clicked edge to edgeToMove myEdgeToMove = myViewNet->myObjectsUnderCursor.getEdgeFront(); + // calculate edgeShapeOffset + const double edgeShapeOffset = myEdgeToMove->getNBEdge()->getGeometry().nearest_offset_to_point2D(myViewNet->getPositionInformation()); // check if we clicked over a start or end position if (myEdgeToMove->clickedOverShapeStart(myViewNet->getPositionInformation())) { - // save start pos - myViewNet->myMoveSingleElementValues.originalPositionInView = myEdgeToMove->getNBEdge()->getGeometry().front(); + // set flag myViewNet->myMoveSingleElementValues.myMovingStartPos = true; - // start geometry moving - myEdgeToMove->startGeometryMoving(); + // start begin geometry moving + myEdgeToMove->startShapeBegin(); // edge values sucesfully calculated, then return true return true; } else if (myEdgeToMove->clickedOverShapeEnd(myViewNet->getPositionInformation())) { - // save end pos - myViewNet->myMoveSingleElementValues.originalPositionInView = myEdgeToMove->getNBEdge()->getGeometry().back(); + // set flag myViewNet->myMoveSingleElementValues.myMovingEndPos = true; - // start geometry moving - myEdgeToMove->startGeometryMoving(); + // start end geometry moving + myEdgeToMove->startShapeEnd(); // edge values sucesfully calculated, then return true return true; } else { // now we have two cases: if we're editing the X-Y coordenade or the altitude (z) if (myViewNet->myNetworkViewOptions.menuCheckMoveElevation->shown() && myViewNet->myNetworkViewOptions.menuCheckMoveElevation->getCheck() == TRUE) { // check if in the clicked position a geometry point exist - int existentIndex = myEdgeToMove->getVertexIndex(myViewNet->getPositionInformation(), false, false); - if (existentIndex != -1) { - myViewNet->myMoveSingleElementValues.movingIndexShape = existentIndex; - myViewNet->myMoveSingleElementValues.originalPositionInView = myEdgeToMove->getNBEdge()->getInnerGeometry()[existentIndex]; + if (myEdgeToMove->getEdgeVertexIndex(myViewNet->getPositionInformation(), false) != -1) { // start geometry moving - myEdgeToMove->startGeometryMoving(); + myEdgeToMove->startEdgeGeometryMoving(edgeShapeOffset, false); // edge values sucesfully calculated, then return true return true; } else { @@ -699,25 +774,10 @@ return false; } } else { - // save original shape (needed for commit change) - myViewNet->myMoveSingleElementValues.originalShapeBeforeMoving = myEdgeToMove->getNBEdge()->getInnerGeometry(); - // obtain index of vertex to move and moving reference - myViewNet->myMoveSingleElementValues.movingIndexShape = myEdgeToMove->getVertexIndex(myViewNet->getPositionInformation(), false, false); - // if index doesn't exist, create it snapping new edge to grid - if (myViewNet->myMoveSingleElementValues.movingIndexShape == -1) { - myViewNet->myMoveSingleElementValues.movingIndexShape = myEdgeToMove->getVertexIndex(myViewNet->getPositionInformation(), true, true); - } - // make sure that myViewNet->myMoveSingleElementValues.movingIndexShape isn't -1 - if (myViewNet->myMoveSingleElementValues.movingIndexShape != -1) { - myViewNet->myMoveSingleElementValues.originalPositionInView = myEdgeToMove->getNBEdge()->getInnerGeometry()[myViewNet->myMoveSingleElementValues.movingIndexShape]; - // start geometry moving - myEdgeToMove->startGeometryMoving(); - // edge values sucesfully calculated, then return true - return true; - } else { - // edge values wasn't calculated, then return false - return false; - } + // start geometry moving + myEdgeToMove->startEdgeGeometryMoving(edgeShapeOffset, false); + // edge values sucesfully calculated, then return true + return true; } } } @@ -726,42 +786,29 @@ bool GNEViewNetHelper::MoveSingleElementValues::calculateTAZValues() { - // set TAZ to move + // assign clicked TAZ to TAZToMove myTAZToMove = myViewNet->myObjectsUnderCursor.getTAZFront(); - // save original shape (needed for commit change) - myViewNet->myMoveSingleElementValues.originalShapeBeforeMoving = myTAZToMove->getTAZShape(); - // save clicked position as moving original position - myViewNet->myMoveSingleElementValues.originalPositionInView = myViewNet->getPositionInformation(); - // obtain index of vertex to move if shape isn't blocked - if ((myTAZToMove->isShapeBlocked() == false) && (myTAZToMove->isAdditionalBlocked() == false)) { - // check if we want to remove a Geometry Point - if (myViewNet->myKeyPressed.shiftKeyPressed()) { - // check if we're clicked over a Geometry Point - myViewNet->myMoveSingleElementValues.movingIndexShape = myTAZToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, false, false); - if (myViewNet->myMoveSingleElementValues.movingIndexShape != -1) { - myTAZToMove->deleteGeometryPoint(myViewNet->myMoveSingleElementValues.originalPositionInView); - // after removing Geomtery Point, reset TAZToMove - myTAZToMove = nullptr; - // TAZ values wasn't calculated, then return false - return false; - } + // calculate TAZShapeOffset + const double TAZShapeOffset = myTAZToMove->getTAZShape().nearest_offset_to_point2D(myViewNet->getPositionInformation(), false); + // now we have two cases: if we're editing the X-Y coordenade or the altitude (z) + if (myViewNet->myNetworkViewOptions.menuCheckMoveElevation->shown() && myViewNet->myNetworkViewOptions.menuCheckMoveElevation->getCheck() == TRUE) { + // check if in the clicked position a geometry point exist + if (myTAZToMove->getTAZVertexIndex(myViewNet->getPositionInformation(), false) != -1) { + // start geometry moving + myTAZToMove->startTAZGeometryMoving(TAZShapeOffset); // TAZ values sucesfully calculated, then return true return true; } else { - // obtain index of vertex to move and moving reference - myViewNet->myMoveSingleElementValues.movingIndexShape = myTAZToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, false, false); - if (myViewNet->myMoveSingleElementValues.movingIndexShape == -1) { - // create new geometry point - myViewNet->myMoveSingleElementValues.movingIndexShape = myTAZToMove->getVertexIndex(myViewNet->myMoveSingleElementValues.originalPositionInView, true, true); - } - // TAZ values sucesfully calculated, then return true - return true; + // stop TAZ moving + myTAZToMove = nullptr; + // TAZ values wasn't calculated, then return false + return false; } } else { - // abort moving index shape - myViewNet->myMoveSingleElementValues.movingIndexShape = -1; - // check if TAZ has the entire movement blocked, or only the shape blocked - return (myTAZToMove->isAdditionalBlocked() == false); + // start geometry moving + myTAZToMove->startTAZGeometryMoving(TAZShapeOffset); + // TAZ values sucesfully calculated, then return true + return true; } } @@ -782,117 +829,81 @@ // save clicked position (to calculate offset) myClickedPosition = myViewNet->getPositionInformation(); // obtain Junctions and edges selected - std::vector selectedJunctions = myViewNet->getNet()->retrieveJunctions(true); - std::vector selectedEdges = myViewNet->getNet()->retrieveEdges(true); + myMovedJunctions = myViewNet->getNet()->retrieveJunctions(true); + const auto movedEdges = myViewNet->getNet()->retrieveEdges(true); + // make a set using of myMovedEdges + myMovedEdges = std::set(movedEdges.begin(), movedEdges.end()); // Junctions are always moved, then save position of current selected junctions (Needed when mouse is released) - for (auto i : selectedJunctions) { - // save junction position - myMovedJunctionOriginPositions[i] = i->getPositionInView(); + for (const auto& junction : myMovedJunctions) { // start geometry moving - i->startGeometryMoving(); + junction->startGeometryMoving(); + // interate over junction edges + for (const auto& edge : junction->getGNEEdges()) { + // if both junction are selected, then move shape + if (edge->isAttributeCarrierSelected() && + edge->getGNEJunctionSource()->isAttributeCarrierSelected() && + edge->getGNEJunctionDestiny()->isAttributeCarrierSelected()) { + myMovedEdges.insert(edge); + } + } } // make special movement depending of clicked AC if (originAC->getTagProperty().getTag() == SUMO_TAG_JUNCTION) { // if clicked element is a junction, move shapes of all selected edges - for (auto i : selectedEdges) { - // save entire edge geometry - myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry(); + for (const auto& edge : myMovedEdges) { + // add edge into movedEdges + myMovedEdges.insert(edge); // start geometry moving - i->startGeometryMoving(); + edge->startEdgeGeometryMoving(-1, false); } } else if (originAC->getTagProperty().getTag() == SUMO_TAG_EDGE) { - // obtain clicked edge - GNEEdge* clickedEdge = dynamic_cast(originAC); - // if clicked edge has origin and destiny junction selected, move shapes of all selected edges - if (myMovedJunctionOriginPositions.count(clickedEdge->getGNEJunctionSource()) > 0 && - myMovedJunctionOriginPositions.count(clickedEdge->getGNEJunctionDestiny()) > 0) { - for (auto i : selectedEdges) { - // save entire edge geometry - myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry(); - // start geometry moving - i->startGeometryMoving(); - } - } else { - // declare three groups for dividing edges - std::vector noJunctionsSelected; - std::vector originJunctionSelected; - std::vector destinyJunctionSelected; - // divide selected edges into four groups, depending of the selection of their junctions - for (auto i : selectedEdges) { - bool originSelected = myMovedJunctionOriginPositions.count(i->getGNEJunctionSource()) > 0; - bool destinySelected = myMovedJunctionOriginPositions.count(i->getGNEJunctionDestiny()) > 0; - // bot junctions selected - if (!originSelected && !destinySelected) { - noJunctionsSelected.push_back(i); - } else if (originSelected && !destinySelected) { - originJunctionSelected.push_back(i); - } else if (!originSelected && destinySelected) { - destinyJunctionSelected.push_back(i); - } else if (!originSelected && !destinySelected) { - // save edge geometry - myMovedEdgesOriginShape[i] = i->getNBEdge()->getInnerGeometry(); - // start geometry moving - i->startGeometryMoving(); - } - } - // save original shape of all noJunctionsSelected edges (needed for commit change) - for (auto i : noJunctionsSelected) { - myMovedEgdesGeometryPoints[i] = new MoveSingleElementValues(myViewNet); - // save edge geometry - myMovedEgdesGeometryPoints[i]->originalShapeBeforeMoving = i->getNBEdge()->getInnerGeometry(); - // start geometry moving - i->startGeometryMoving(); - } - // obtain index shape of clicked edge - int index = clickedEdge->getVertexIndex(myViewNet->getPositionInformation(), true, true); - // check that index is valid - if (index < 0) { - // end geometry moving without changes in moved junctions - for (auto i : myMovedJunctionOriginPositions) { - i.first->endGeometryMoving(); - } - // end geometry moving without changes in moved edges - for (auto i : myMovedEdgesOriginShape) { - i.first->endGeometryMoving(); - } - // end geometry moving without changes in moved shapes - for (auto i : myMovedEgdesGeometryPoints) { - i.first->endGeometryMoving(); - } - // stop moving selection - myMovingSelection = false; - // clear containers - myMovedJunctionOriginPositions.clear(); - myMovedEdgesOriginShape.clear(); - // delete all movedEgdesGeometryPoints before clear container - for (const auto& i : myMovedEgdesGeometryPoints) { - delete i.second; - } - myMovedEgdesGeometryPoints.clear(); - } else { - // save index and original position - myMovedEgdesGeometryPoints[clickedEdge] = new MoveSingleElementValues(myViewNet); - myMovedEgdesGeometryPoints[clickedEdge]->movingIndexShape = index; - myMovedEgdesGeometryPoints[clickedEdge]->originalPositionInView = myViewNet->getPositionInformation(); - // start moving of clicked edge AFTER getting vertex Index - clickedEdge->startGeometryMoving(); - // do the same for the rest of noJunctionsSelected edges - for (auto i : noJunctionsSelected) { - if (i != clickedEdge) { - myMovedEgdesGeometryPoints[i] = new MoveSingleElementValues(myViewNet); - // save index and original position - myMovedEgdesGeometryPoints[i]->movingIndexShape = i->getVertexIndex(myViewNet->getPositionInformation(), true, true); - // set originalPosition depending if edge is opposite to clicked edge - if (i->getOppositeEdge() == clickedEdge) { - myMovedEgdesGeometryPoints[i]->originalPositionInView = myViewNet->getPositionInformation(); - } else { - myMovedEgdesGeometryPoints[i]->originalPositionInView = i->getNBEdge()->getInnerGeometry()[myMovedEgdesGeometryPoints[i]->movingIndexShape]; - } - // start moving of clicked edge AFTER getting vertex Index - i->startGeometryMoving(); - } - } + // get clicked edge + GNEEdge* clickedEdge = myViewNet->myObjectsUnderCursor.getEdgeFront(); + GNEEdge* oppositeClickedEdge = clickedEdge->getOppositeEdge(); + // calculate edgeShapeOffset + const double edgeShapeOffset = clickedEdge->getNBEdge()->getGeometry().nearest_offset_to_point2D(myViewNet->getPositionInformation()); + // split edges in two groups + std::vector groupNormalEdges; + std::vector groupOppositeEdges; + // add clicked edge in group A + groupNormalEdges.push_back(clickedEdge); + // remove it from copyOfMovedEdges + myMovedEdges.erase(clickedEdge); + // if opposite edge is selected, add it in group B + if (oppositeClickedEdge && oppositeClickedEdge->isAttributeCarrierSelected()) { + groupOppositeEdges.push_back(clickedEdge->getOppositeEdge()); + // remove it from copyOfMovedEdges + myMovedEdges.erase(oppositeClickedEdge); + } + // iterate over copyOfMovedEdges + while (myMovedEdges.size() > 0) { + // get first and opposite edge + GNEEdge* edge = (*myMovedEdges.begin()); + GNEEdge* oppositeEdge = edge->getOppositeEdge(); + // add edge in group A + groupNormalEdges.push_back(edge); + // check if oppositeEdge exist and is selected + if (oppositeEdge && oppositeEdge->isAttributeCarrierSelected()) { + // add opposite edge in group B + groupOppositeEdges.push_back(oppositeEdge); + // remove opposite edge from setMovedEdges + myMovedEdges.erase(oppositeEdge); } + // pop back element + myMovedEdges.erase(edge); + } + // move shapes of both groups + for (const auto& edge : groupNormalEdges) { + // insert it again in myMovedEdges + myMovedEdges.insert(edge); + // start geometry moving + edge->startEdgeGeometryMoving(edgeShapeOffset, false); + } + for (const auto& edge : groupOppositeEdges) { + // insert it again in myMovedEdges + myMovedEdges.insert(edge); + // start geometry moving using an opposite offset + edge->startEdgeGeometryMoving(edgeShapeOffset, true); } } } @@ -910,20 +921,16 @@ // leave z empty (because in this case offset only actuates over X-Y) offsetMovement.setz(0); } - // move selected junctions - for (auto i : myMovedJunctionOriginPositions) { - i.first->moveGeometry(i.second, offsetMovement); - } - // move entire edge shapes - for (auto i : myMovedEdgesOriginShape) { - i.first->moveEntireShape(i.second, offsetMovement); - } - // move partial shapes - for (auto i : myMovedEgdesGeometryPoints) { - i.first->moveVertexShape(i.second->movingIndexShape, i.second->originalPositionInView, offsetMovement); + // move junctions + for (const auto& junction : myMovedJunctions) { + junction->moveGeometry(offsetMovement); + } + // move edges + for (const auto& edge : myMovedEdges) { + edge->moveEdgeShape(offsetMovement); } // update view (needed to see the movement) - myViewNet->update(); + myViewNet->updateViewNet(); } @@ -932,29 +939,20 @@ // begin undo list myViewNet->getUndoList()->p_begin("position of selected elements"); // commit positions of moved junctions - for (auto i : myMovedJunctionOriginPositions) { - i.first->commitGeometryMoving(i.second, myViewNet->getUndoList()); + for (const auto& junction : myMovedJunctions) { + junction->commitGeometryMoving(myViewNet->getUndoList()); } // commit shapes of entired moved edges - for (auto i : myMovedEdgesOriginShape) { - i.first->commitShapeChange(i.second, myViewNet->getUndoList()); - } - //commit shapes of partial moved shapes - for (auto i : myMovedEgdesGeometryPoints) { - i.first->commitShapeChange(i.second->originalShapeBeforeMoving, myViewNet->getUndoList()); + for (const auto& edge : myMovedEdges) { + edge->commitEdgeShapeChange(myViewNet->getUndoList()); } // end undo list myViewNet->getUndoList()->p_end(); // stop moving selection myMovingSelection = false; // clear containers - myMovedJunctionOriginPositions.clear(); - myMovedEdgesOriginShape.clear(); - // delete all movedEgdesGeometryPoints before clear container - for (const auto& i : myMovedEgdesGeometryPoints) { - delete i.second; - } - myMovedEgdesGeometryPoints.clear(); + myMovedJunctions.clear(); + myMovedEdges.clear(); } @@ -1035,7 +1033,7 @@ + " height:" + toString(fabs(selectionCorner1.y() - selectionCorner2.y())) + " diagonal:" + toString(selectionCorner1.distanceTo2D(selectionCorner2))); // update view (needed to update rectangle) - myViewNet->update(); + myViewNet->updateViewNet(); } @@ -1122,10 +1120,16 @@ std::set > ACsInBoundary = myViewNet->getAttributeCarriersInBoundary(boundary); // filter ACsInBoundary depending of current supermode std::set > ACsInBoundaryFiltered; - for (const auto& i : ACsInBoundary) { - if (((myViewNet->myEditModes.currentSupermode == GNE_SUPERMODE_NETWORK) && !i.second->getTagProperty().isDemandElement()) || - ((myViewNet->myEditModes.currentSupermode == GNE_SUPERMODE_DEMAND) && i.second->getTagProperty().isDemandElement())) { - ACsInBoundaryFiltered.insert(i); + for (const auto& AC : ACsInBoundary) { + if (myViewNet->myEditModes.isCurrentSupermodeNetwork()) { + if (AC.second->getTagProperty().isNetworkElement() || AC.second->getTagProperty().isAdditionalElement() || + AC.second->getTagProperty().isTAZ() || AC.second->getTagProperty().isShape()) { + ACsInBoundaryFiltered.insert(AC); + } + } else if (myViewNet->myEditModes.isCurrentSupermodeDemand() && AC.second->getTagProperty().isDemandElement()) { + ACsInBoundaryFiltered.insert(AC); + } else if (myViewNet->myEditModes.isCurrentSupermodeData() && AC.second->getTagProperty().isGenericData()) { + ACsInBoundaryFiltered.insert(AC); } } // declare two sets of attribute carriers, one for select and another for unselect @@ -1135,8 +1139,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::SET_RESTRICT) || - (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::SET_REPLACE)) { + if ((myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::RESTRICT) || + (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::REPLACE)) { // obtain selected ACs depending of current supermode std::vector selectedAC = myViewNet->getNet()->getSelectedAttributeCarriers(false); // add id into ACs to unselect @@ -1147,10 +1151,10 @@ // iterate over AtributeCarriers obtained of boundary an place it in ACToSelect or ACToUnselect for (auto i : ACsInBoundaryFiltered) { switch (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode()) { - case GNESelectorFrame::ModificationMode::SET_SUB: + case GNESelectorFrame::ModificationMode::Operation::SUB: ACToUnselect.push_back(i.second); break; - case GNESelectorFrame::ModificationMode::SET_RESTRICT: + case GNESelectorFrame::ModificationMode::Operation::RESTRICT: if (std::find(ACToUnselect.begin(), ACToUnselect.end(), i.second) != ACToUnselect.end()) { ACToSelect.push_back(i.second); } @@ -1161,7 +1165,7 @@ } } // select junctions and their connections and crossings if Auto select junctions is enabled (note: only for "add mode") - if (myViewNet->autoSelectNodes() && GNESelectorFrame::ModificationMode::SET_ADD) { + if (myViewNet->autoSelectNodes() && (myViewNet->myViewParent->getSelectorFrame()->getModificationModeModul()->getModificationMode() == GNESelectorFrame::ModificationMode::Operation::ADD)) { std::vector edgesToSelect; // iterate over ACToSelect and extract edges for (auto i : ACToSelect) { @@ -1285,6 +1289,7 @@ saveNetwork(nullptr), saveAdditionalElements(nullptr), saveDemandElements(nullptr), + saveDataElements(nullptr), myViewNet(viewNet) { } @@ -1293,19 +1298,24 @@ GNEViewNetHelper::SaveElements::buildSaveElementsButtons() { // create save network button saveNetwork = new FXButton(myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements, - "\tSave network\tSave network.", GUIIconSubSys::getIcon(ICON_SAVENETELEMENTS), + "\tSave network\tSave network.", GUIIconSubSys::getIcon(GUIIcon::SAVENETWORKELEMENTS), myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK, GUIDesignButtonToolbar); saveNetwork->create(); // create save additional elements button saveAdditionalElements = new FXButton(myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements, - "\tSave additional elements\tSave additional elements.", GUIIconSubSys::getIcon(ICON_SAVEADDITIONALS), + "\tSave additional elements\tSave additional elements.", GUIIconSubSys::getIcon(GUIIcon::SAVEADDITIONALELEMENTS), myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS, GUIDesignButtonToolbar); saveAdditionalElements->create(); // create save demand elements button saveDemandElements = new FXButton(myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements, - "\tSave demand elements\tSave demand elements.", GUIIconSubSys::getIcon(ICON_SAVEDEMANDELEMENTS), + "\tSave demand elements\tSave demand elements.", GUIIconSubSys::getIcon(GUIIcon::SAVEDEMANDELEMENTS), myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, GUIDesignButtonToolbar); saveDemandElements->create(); + // create save data elements button + saveDataElements = new FXButton(myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements, + "\tSave data elements\tSave data elements.", GUIIconSubSys::getIcon(GUIIcon::SAVEDATAELEMENTS), + myViewNet->getViewParent()->getGNEAppWindows(), MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS, GUIDesignButtonToolbar); + saveDataElements->create(); // recalc menu bar because there is new elements myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().saveElements->recalc(); // show menu bar modes @@ -1317,26 +1327,34 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::EditModes::EditModes(GNEViewNet* viewNet) : - currentSupermode(GNE_SUPERMODE_NONE), - networkEditMode(GNE_NMODE_INSPECT), - demandEditMode(GNE_DMODE_INSPECT), + networkEditMode(NetworkEditMode::NETWORK_INSPECT), + demandEditMode(DemandEditMode::DEMAND_INSPECT), + dataEditMode(DataEditMode::DATA_INSPECT), networkButton(nullptr), demandButton(nullptr), - myViewNet(viewNet) { + dataButton(nullptr), + myViewNet(viewNet), + myCurrentSupermode(Supermode::NETWORK) { } void GNEViewNetHelper::EditModes::buildSuperModeButtons() { - // create buttons - networkButton = new MFXCheckableButton(false, myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Network\t\tSet mode for edit network elements.", - GUIIconSubSys::getIcon(ICON_SUPERMODENETWORK), myViewNet, MID_HOTKEY_F3_SUPERMODE_NETWORK, GUIDesignButtonToolbarSupermode); + // create network button + networkButton = new MFXCheckableButton(false, + myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Network\t\tSet mode for edit network elements.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODENETWORK), myViewNet, MID_HOTKEY_F2_SUPERMODE_NETWORK, GUIDesignButtonToolbarSupermode); networkButton->create(); - - demandButton = new MFXCheckableButton(false, myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Demand\t\tSet mode for edit traffic demand.", - GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), myViewNet, MID_HOTKEY_F4_SUPERMODE_DEMAND, GUIDesignButtonToolbarSupermode); + // create demand button + demandButton = new MFXCheckableButton(false, + myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Demand\t\tSet mode for edit traffic demand.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDEMAND), myViewNet, MID_HOTKEY_F3_SUPERMODE_DEMAND, GUIDesignButtonToolbarSupermode); demandButton->create(); - + // create data button + dataButton = new MFXCheckableButton(false, + myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().superModes, "Data\t\tSet mode for edit data demand.", + GUIIconSubSys::getIcon(GUIIcon::SUPERMODEDATA), myViewNet, MID_HOTKEY_F4_SUPERMODE_DATA, GUIDesignButtonToolbarSupermode); + dataButton->create(); // recalc menu bar because there is new elements myViewNet->getViewParent()->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); // show menu bar modes @@ -1345,8 +1363,8 @@ void -GNEViewNetHelper::EditModes::setSupermode(Supermode supermode) { - if (supermode == currentSupermode) { +GNEViewNetHelper::EditModes::setSupermode(Supermode supermode, const bool force) { + if (!force && (supermode == myCurrentSupermode)) { myViewNet->setStatusBarText("Mode already selected"); if (myViewNet->myCurrentFrame != nullptr) { myViewNet->myCurrentFrame->focusUpperElement(); @@ -1356,46 +1374,66 @@ // abort current operation myViewNet->abortOperation(false); // set super mode - currentSupermode = supermode; + myCurrentSupermode = supermode; // set supermodes - if (supermode == GNE_SUPERMODE_NETWORK) { + if (supermode == Supermode::NETWORK) { // change buttons networkButton->setChecked(true); demandButton->setChecked(false); + dataButton->setChecked(false); // show network buttons myViewNet->myNetworkCheckableButtons.showNetworkCheckableButtons(); // hide demand buttons myViewNet->myDemandCheckableButtons.hideDemandCheckableButtons(); + // hide data buttons + myViewNet->myDataCheckableButtons.hideDataCheckableButtons(); // force update network mode setNetworkEditMode(networkEditMode, true); - } else if (supermode == GNE_SUPERMODE_DEMAND) { + } else if (supermode == Supermode::DEMAND) { // change buttons networkButton->setChecked(false); demandButton->setChecked(true); + dataButton->setChecked(false); // hide network buttons myViewNet->myNetworkCheckableButtons.hideNetworkCheckableButtons(); // show demand buttons myViewNet->myDemandCheckableButtons.showDemandCheckableButtons(); + // hide data buttons + myViewNet->myDataCheckableButtons.hideDataCheckableButtons(); // force update demand mode setDemandEditMode(demandEditMode, true); + } else if (supermode == Supermode::DATA) { + // change buttons + networkButton->setChecked(false); + demandButton->setChecked(false); + dataButton->setChecked(true); + // hide network buttons + myViewNet->myNetworkCheckableButtons.hideNetworkCheckableButtons(); + // hide demand buttons + myViewNet->myDemandCheckableButtons.hideDemandCheckableButtons(); + // show data buttons + myViewNet->myDataCheckableButtons.showDataCheckableButtons(); + // force update data mode + setDataEditMode(dataEditMode, true); } // update buttons networkButton->update(); demandButton->update(); + dataButton->update(); // update Supermode CommandButtons in GNEAppWindows - myViewNet->myViewParent->getGNEAppWindows()->updateSuperModeMenuCommands(currentSupermode); + myViewNet->myViewParent->getGNEAppWindows()->updateSuperModeMenuCommands(myCurrentSupermode); } } void -GNEViewNetHelper::EditModes::setNetworkEditMode(NetworkEditMode mode, bool force) { +GNEViewNetHelper::EditModes::setNetworkEditMode(NetworkEditMode mode, const bool force) { if ((mode == networkEditMode) && !force) { myViewNet->setStatusBarText("Network mode already selected"); if (myViewNet->myCurrentFrame != nullptr) { myViewNet->myCurrentFrame->focusUpperElement(); } - } else if (networkEditMode == GNE_NMODE_TLS && !myViewNet->myViewParent->getTLSEditorFrame()->isTLSSaved()) { + } else if (networkEditMode == NetworkEditMode::NETWORK_TLS && !myViewNet->myViewParent->getTLSEditorFrame()->isTLSSaved()) { myViewNet->setStatusBarText("save modifications in TLS before change mode"); myViewNet->myCurrentFrame->focusUpperElement(); } else { @@ -1406,20 +1444,23 @@ // set new Network mode networkEditMode = mode; // for common modes (Inspect/Delete/Select/move) change also the other supermode - if (networkEditMode == GNE_NMODE_INSPECT) { - demandEditMode = GNE_DMODE_INSPECT; - } else if (networkEditMode == GNE_NMODE_DELETE) { - demandEditMode = GNE_DMODE_DELETE; - } else if (networkEditMode == GNE_NMODE_SELECT) { - demandEditMode = GNE_DMODE_SELECT; - } else if (networkEditMode == GNE_NMODE_MOVE) { - demandEditMode = GNE_DMODE_MOVE; + if (networkEditMode == NetworkEditMode::NETWORK_INSPECT) { + demandEditMode = DemandEditMode::DEMAND_INSPECT; + dataEditMode = DataEditMode::DATA_INSPECT; + } else if (networkEditMode == NetworkEditMode::NETWORK_DELETE) { + demandEditMode = DemandEditMode::DEMAND_DELETE; + dataEditMode = DataEditMode::DATA_DELETE; + } else if (networkEditMode == NetworkEditMode::NETWORK_SELECT) { + demandEditMode = DemandEditMode::DEMAND_SELECT; + dataEditMode = DataEditMode::DATA_SELECT; + } else if (networkEditMode == NetworkEditMode::NETWORK_MOVE) { + demandEditMode = DemandEditMode::DEMAND_MOVE; } // certain modes require a recomputing switch (mode) { - case GNE_NMODE_CONNECT: - case GNE_NMODE_PROHIBITION: - case GNE_NMODE_TLS: + case NetworkEditMode::NETWORK_CONNECT: + case NetworkEditMode::NETWORK_PROHIBITION: + case NetworkEditMode::NETWORK_TLS: // modes which depend on computed data myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows()); break; @@ -1433,7 +1474,7 @@ void -GNEViewNetHelper::EditModes::setDemandEditMode(DemandEditMode mode, bool force) { +GNEViewNetHelper::EditModes::setDemandEditMode(DemandEditMode mode, const bool force) { if ((mode == demandEditMode) && !force) { myViewNet->setStatusBarText("Demand mode already selected"); if (myViewNet->myCurrentFrame != nullptr) { @@ -1447,73 +1488,78 @@ // set new Demand mode demandEditMode = mode; // for common modes (Inspect/Delete/Select/Move) change also the other supermode - if (demandEditMode == GNE_DMODE_INSPECT) { - networkEditMode = GNE_NMODE_INSPECT; - } else if (demandEditMode == GNE_DMODE_DELETE) { - networkEditMode = GNE_NMODE_DELETE; - } else if (demandEditMode == GNE_DMODE_SELECT) { - networkEditMode = GNE_NMODE_SELECT; - } else if (demandEditMode == GNE_DMODE_MOVE) { - networkEditMode = GNE_NMODE_MOVE; + if (demandEditMode == DemandEditMode::DEMAND_INSPECT) { + networkEditMode = NetworkEditMode::NETWORK_INSPECT; + dataEditMode = DataEditMode::DATA_INSPECT; + } else if (demandEditMode == DemandEditMode::DEMAND_DELETE) { + networkEditMode = NetworkEditMode::NETWORK_DELETE; + dataEditMode = DataEditMode::DATA_DELETE; + } else if (demandEditMode == DemandEditMode::DEMAND_SELECT) { + networkEditMode = NetworkEditMode::NETWORK_SELECT; + dataEditMode = DataEditMode::DATA_SELECT; + } else if (demandEditMode == DemandEditMode::DEMAND_MOVE) { + networkEditMode = NetworkEditMode::NETWORK_MOVE; } // demand modes require ALWAYS a recomputing myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows()); // update DijkstraRouter of RouteCalculatorInstance - GNEDemandElement::getRouteCalculatorInstance()->updateDijkstraRouter(); + myViewNet->myNet->getPathCalculator()->updatePathCalculator(); // update network mode specific controls myViewNet->updateDemandModeSpecificControls(); } } -// --------------------------------------------------------------------------- -// GNEViewNetHelper::CommonViewOptions - methods -// --------------------------------------------------------------------------- - - -GNEViewNetHelper::CommonViewOptions::CommonViewOptions(GNEViewNet* viewNet) : - menuCheckShowGrid(nullptr), - menuCheckDrawSpreadVehicles(nullptr), - myViewNet(viewNet) { -} - void -GNEViewNetHelper::CommonViewOptions::buildCommonViewOptionsMenuChecks() { - - menuCheckShowGrid = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, - ("Grid\t\tshow grid and restrict movement to the grid (size defined in visualization options)"), - myViewNet, MID_GNE_COMMONVIEWOPTIONS_SHOWGRID, LAYOUT_FIX_HEIGHT); - - menuCheckShowGrid->setHeight(23); - menuCheckShowGrid->setCheck(false); - menuCheckShowGrid->create(); - - menuCheckDrawSpreadVehicles = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, - ("Spread vehicles\t\tDraw vehicles spread in lane or in depart position"), - myViewNet, MID_GNE_COMMONVIEWOPTIONS_DRAWSPREADVEHICLES, LAYOUT_FIX_HEIGHT); +GNEViewNetHelper::EditModes::setDataEditMode(DataEditMode mode, const bool force) { + if ((mode == dataEditMode) && !force) { + myViewNet->setStatusBarText("Data mode already selected"); + if (myViewNet->myCurrentFrame != nullptr) { + myViewNet->myCurrentFrame->focusUpperElement(); + } + } else { + myViewNet->setStatusBarText(""); + myViewNet->abortOperation(false); + // stop editing of custom shapes + myViewNet->myEditShapes.stopEditCustomShape(); + // set new Data mode + dataEditMode = mode; + // for common modes (Inspect/Delete/Select/Move) change also the other supermode + if (dataEditMode == DataEditMode::DATA_INSPECT) { + networkEditMode = NetworkEditMode::NETWORK_INSPECT; + demandEditMode = DemandEditMode::DEMAND_INSPECT; + } else if (dataEditMode == DataEditMode::DATA_DELETE) { + networkEditMode = NetworkEditMode::NETWORK_DELETE; + demandEditMode = DemandEditMode::DEMAND_DELETE; + } else if (dataEditMode == DataEditMode::DATA_SELECT) { + networkEditMode = NetworkEditMode::NETWORK_SELECT; + demandEditMode = DemandEditMode::DEMAND_SELECT; + } + // data modes require ALWAYS a recomputing + myViewNet->myNet->computeNetwork(myViewNet->myViewParent->getGNEAppWindows()); + // update DijkstraRouter of RouteCalculatorInstance + myViewNet->myNet->getPathCalculator()->updatePathCalculator(); + // update network mode specific controls + myViewNet->updateDataModeSpecificControls(); + } +} - menuCheckDrawSpreadVehicles->setHeight(23); - menuCheckDrawSpreadVehicles->setCheck(false); - menuCheckDrawSpreadVehicles->create(); +bool +GNEViewNetHelper::EditModes::isCurrentSupermodeNetwork() const { + return (myCurrentSupermode == Supermode::NETWORK); } -void -GNEViewNetHelper::CommonViewOptions::getVisibleCommonMenuCommands(std::vector& commands) const { - // save visible menu commands in commands vector - if (menuCheckShowGrid->shown()) { - commands.push_back(menuCheckShowGrid); - } - if (menuCheckDrawSpreadVehicles->shown()) { - commands.push_back(menuCheckDrawSpreadVehicles); - } +bool +GNEViewNetHelper::EditModes::isCurrentSupermodeDemand() const { + return (myCurrentSupermode == Supermode::DEMAND); } bool -GNEViewNetHelper::CommonViewOptions::drawSpreadVehicles() const { - return (menuCheckDrawSpreadVehicles->getCheck() == TRUE); +GNEViewNetHelper::EditModes::isCurrentSupermodeData() const { + return (myCurrentSupermode == Supermode::DATA); } // --------------------------------------------------------------------------- @@ -1521,12 +1567,40 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::NetworkViewOptions::NetworkViewOptions(GNEViewNet* viewNet) : + menuCheckShowGrid(nullptr), + menuCheckDrawSpreadVehicles(nullptr), + menuCheckShowDemandElements(nullptr), + menuCheckSelectEdges(nullptr), + menuCheckShowConnections(nullptr), + menuCheckHideConnections(nullptr), + menuCheckExtendSelection(nullptr), + menuCheckChangeAllPhases(nullptr), + menuCheckWarnAboutMerge(nullptr), + menuCheckShowJunctionBubble(nullptr), + menuCheckMoveElevation(nullptr), + menuCheckChainEdges(nullptr), + menuCheckAutoOppositeEdge(nullptr), myViewNet(viewNet) { } void GNEViewNetHelper::NetworkViewOptions::buildNetworkViewOptionsMenuChecks() { + // create menu checks + menuCheckShowGrid = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Grid\t\tshow grid and restrict movement to the grid (size defined in visualization options)"), + myViewNet, MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID, LAYOUT_FIX_HEIGHT); + menuCheckShowGrid->setHeight(23); + menuCheckShowGrid->setCheck(false); + menuCheckShowGrid->create(); + + menuCheckDrawSpreadVehicles = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Spread vehicles\t\tDraw vehicles spread in lane or in depart position"), + myViewNet, MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES, LAYOUT_FIX_HEIGHT); + menuCheckDrawSpreadVehicles->setHeight(23); + menuCheckDrawSpreadVehicles->setCheck(false); + menuCheckDrawSpreadVehicles->create(); + menuCheckShowDemandElements = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, ("Show demand elements\t\tToggle show demand elements"), myViewNet, MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS, LAYOUT_FIX_HEIGHT); @@ -1611,6 +1685,8 @@ void GNEViewNetHelper::NetworkViewOptions::hideNetworkViewOptionsMenuChecks() { + menuCheckShowGrid->hide(); + menuCheckDrawSpreadVehicles->hide(); menuCheckShowDemandElements->hide(); menuCheckSelectEdges->hide(); menuCheckShowConnections->hide(); @@ -1630,6 +1706,12 @@ void GNEViewNetHelper::NetworkViewOptions::getVisibleNetworkMenuCommands(std::vector& commands) const { // save visible menu commands in commands vector + if (menuCheckShowGrid->shown()) { + commands.push_back(menuCheckShowGrid); + } + if (menuCheckDrawSpreadVehicles->shown()) { + commands.push_back(menuCheckDrawSpreadVehicles); + } if (menuCheckShowDemandElements->shown()) { commands.push_back(menuCheckShowDemandElements); } @@ -1667,6 +1749,12 @@ bool +GNEViewNetHelper::NetworkViewOptions::drawSpreadVehicles() const { + return (menuCheckDrawSpreadVehicles->getCheck() == TRUE); +} + + +bool GNEViewNetHelper::NetworkViewOptions::showDemandElements() const { if (menuCheckShowDemandElements->shown()) { return (menuCheckShowDemandElements->getCheck() == TRUE); @@ -1690,10 +1778,10 @@ bool GNEViewNetHelper::NetworkViewOptions::showConnections() const { - if (myViewNet->myEditModes.networkEditMode == GNE_NMODE_CONNECT) { - // check if menu hceck hide connections ins shown + if (myViewNet->myEditModes.networkEditMode == NetworkEditMode::NETWORK_CONNECT) { + // check if menu check hide connections ins shown return (menuCheckHideConnections->getCheck() == FALSE); - } else if (myViewNet->myEditModes.networkEditMode == GNE_NMODE_PROHIBITION) { + } else if (myViewNet->myEditModes.networkEditMode == NetworkEditMode::NETWORK_PROHIBITION) { return true; } else if (menuCheckShowConnections->shown() == false) { return false; @@ -1717,6 +1805,8 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::DemandViewOptions::DemandViewOptions(GNEViewNet* viewNet) : + menuCheckShowGrid(nullptr), + menuCheckDrawSpreadVehicles(nullptr), menuCheckHideShapes(nullptr), menuCheckHideNonInspectedDemandElements(nullptr), menuCheckShowAllPersonPlans(nullptr), @@ -1728,6 +1818,20 @@ void GNEViewNetHelper::DemandViewOptions::buildDemandViewOptionsMenuChecks() { + // create menu checks + menuCheckShowGrid = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Grid\t\tshow grid and restrict movement to the grid (size defined in visualization options)"), + myViewNet, MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID, LAYOUT_FIX_HEIGHT); + menuCheckShowGrid->setHeight(23); + menuCheckShowGrid->setCheck(false); + menuCheckShowGrid->create(); + + menuCheckDrawSpreadVehicles = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Spread vehicles\t\tDraw vehicles spread in lane or in depart position"), + myViewNet, MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES, LAYOUT_FIX_HEIGHT); + menuCheckDrawSpreadVehicles->setHeight(23); + menuCheckDrawSpreadVehicles->setCheck(false); + menuCheckDrawSpreadVehicles->create(); menuCheckHideShapes = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, ("Hide shapes\t\tToggle show shapes (Polygons and POIs)"), @@ -1764,6 +1868,8 @@ void GNEViewNetHelper::DemandViewOptions::hideDemandViewOptionsMenuChecks() { + menuCheckShowGrid->hide(); + menuCheckDrawSpreadVehicles->hide(); menuCheckHideShapes->hide(); menuCheckHideNonInspectedDemandElements->hide(); menuCheckShowAllPersonPlans->hide(); @@ -1776,6 +1882,12 @@ void GNEViewNetHelper::DemandViewOptions::getVisibleDemandMenuCommands(std::vector& commands) const { // save visible menu commands in commands vector + if (menuCheckShowGrid->shown()) { + commands.push_back(menuCheckShowGrid); + } + if (menuCheckDrawSpreadVehicles->shown()) { + commands.push_back(menuCheckDrawSpreadVehicles); + } if (menuCheckHideShapes->shown()) { commands.push_back(menuCheckHideShapes); } @@ -1792,6 +1904,12 @@ bool +GNEViewNetHelper::DemandViewOptions::drawSpreadVehicles() const { + return (menuCheckDrawSpreadVehicles->getCheck() == TRUE); +} + + +bool GNEViewNetHelper::DemandViewOptions::showNonInspectedDemandElements(const GNEDemandElement* demandElement) const { if (menuCheckHideNonInspectedDemandElements->shown()) { // check conditions @@ -1867,6 +1985,465 @@ } // --------------------------------------------------------------------------- +// GNEViewNetHelper::DataViewOptions - methods +// --------------------------------------------------------------------------- + +GNEViewNetHelper::DataViewOptions::DataViewOptions(GNEViewNet* viewNet) : + menuCheckShowAdditionals(nullptr), + menuCheckShowShapes(nullptr), + menuCheckShowDemandElements(nullptr), + myViewNet(viewNet) { +} + + +void +GNEViewNetHelper::DataViewOptions::buildDataViewOptionsMenuChecks() { + // create menu checks + menuCheckShowAdditionals = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Show additionals\t\tToggle show additionals"), + myViewNet, MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS, LAYOUT_FIX_HEIGHT); + menuCheckShowAdditionals->setHeight(23); + menuCheckShowAdditionals->setCheck(false); + menuCheckShowAdditionals->create(); + + menuCheckShowShapes = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Show shapes\t\tToggle show shapes (Polygons and POIs)"), + myViewNet, MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES, LAYOUT_FIX_HEIGHT); + menuCheckShowShapes->setHeight(23); + menuCheckShowShapes->setCheck(false); + menuCheckShowShapes->create(); + + menuCheckShowDemandElements = new FXMenuCheck(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions, + ("Show demand elements\t\tToggle show demand elements"), + myViewNet, MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS, LAYOUT_FIX_HEIGHT); + menuCheckShowDemandElements->setHeight(23); + menuCheckShowDemandElements->setCheck(false); + menuCheckShowDemandElements->create(); + + // always recalc after creating new elements + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->recalc(); +} + + +void +GNEViewNetHelper::DataViewOptions::hideDataViewOptionsMenuChecks() { + menuCheckShowAdditionals->hide(); + menuCheckShowShapes->hide(); + menuCheckShowDemandElements->hide(); + // Also hide toolbar grip + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modeOptions->show(); +} + + +void +GNEViewNetHelper::DataViewOptions::getVisibleDataMenuCommands(std::vector& commands) const { + // save visible menu commands in commands vector + if (menuCheckShowAdditionals->shown()) { + commands.push_back(menuCheckShowAdditionals); + } + if (menuCheckShowShapes->shown()) { + commands.push_back(menuCheckShowShapes); + } + if (menuCheckShowDemandElements->shown()) { + commands.push_back(menuCheckShowDemandElements); + } +} + + +bool +GNEViewNetHelper::DataViewOptions::showAdditionals() const { + if (menuCheckShowAdditionals->shown()) { + return (menuCheckShowAdditionals->getCheck() == TRUE); + } else { + return true; + } +} + + +bool +GNEViewNetHelper::DataViewOptions::showShapes() const { + if (menuCheckShowShapes->shown()) { + return (menuCheckShowShapes->getCheck() == TRUE); + } else { + return true; + } +} + + +bool +GNEViewNetHelper::DataViewOptions::showDemandElements() const { + if (menuCheckShowDemandElements->shown()) { + return (menuCheckShowDemandElements->getCheck() == TRUE); + } else { + return true; + } +} + +// --------------------------------------------------------------------------- +// GNEViewNetHelper::IntervalBar - methods +// --------------------------------------------------------------------------- + +GNEViewNetHelper::IntervalBar::IntervalBar(GNEViewNet* viewNet) : + myViewNet(viewNet), + myIntervalBarUpdate(true), + myGenericDataTypesComboBox(nullptr), + myDataSetsComboBox(nullptr), + myLimitByIntervalCheckBox(nullptr), + myBeginTextField(nullptr), + myEndTextField(nullptr), + myFilteredAttributesComboBox(nullptr), + myNoGenericDatas(""), + myAllGenericDatas(""), + myNoDataSets(""), + myAllDataSets(""), + myAllAttributes("") { +} + + +void +GNEViewNetHelper::IntervalBar::buildIntervalBarElements() { + // create interval label + FXLabel* genericDataLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + "Data type", 0, GUIDesignLabelAttribute); + genericDataLabel->create(); + // create combo box for generic datas + myGenericDataTypesComboBox = new FXComboBox(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + GUIDesignComboBoxNCol, myViewNet, MID_GNE_INTERVALBAR_GENERICDATATYPE, GUIDesignComboBoxWidth120); + myGenericDataTypesComboBox->create(); + FXLabel* dataSetLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + "Data sets", 0, GUIDesignLabelAttribute); + dataSetLabel->create(); + // create combo box for sets + myDataSetsComboBox = new FXComboBox(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + GUIDesignComboBoxNCol, myViewNet, MID_GNE_INTERVALBAR_DATASET, GUIDesignComboBoxWidth120); + myDataSetsComboBox->create(); + // create checkbutton for myLimitByInterval + myLimitByIntervalCheckBox = new FXCheckButton(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + "Interval", myViewNet, MID_GNE_INTERVALBAR_LIMITED, GUIDesignCheckButtonAttribute); + myLimitByIntervalCheckBox->create(); + // create textfield for begin + myBeginTextField = new FXTextField(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + GUIDesignTextFieldNCol, myViewNet, MID_GNE_INTERVALBAR_BEGIN, GUIDesignTextFielWidth50Real); + myBeginTextField->create(); + // create text field for end + myEndTextField = new FXTextField(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + GUIDesignTextFieldNCol, myViewNet, MID_GNE_INTERVALBAR_END, GUIDesignTextFielWidth50Real); + myEndTextField->create(); + // create attribute label + FXLabel* attributeLabel = new FXLabel(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + "Attribute", 0, GUIDesignLabelAttribute); + attributeLabel->create(); + // create combo box for attributes + myFilteredAttributesComboBox = new FXComboBox(myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar, + GUIDesignComboBoxNCol, myViewNet, MID_GNE_INTERVALBAR_ATTRIBUTE, GUIDesignComboBoxWidth180); + myFilteredAttributesComboBox->create(); + // always recalc after creating new elements + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->recalc(); +} + + +void +GNEViewNetHelper::IntervalBar::enableIntervalBar() { + // enable elements + myGenericDataTypesComboBox->enable(); + myDataSetsComboBox->enable(); + myLimitByIntervalCheckBox->enable(); + if (myLimitByIntervalCheckBox->getCheck() == TRUE) { + myBeginTextField->enable(); + myEndTextField->enable(); + } else { + myBeginTextField->disable(); + myEndTextField->disable(); + } + myFilteredAttributesComboBox->enable(); +} + + +void +GNEViewNetHelper::IntervalBar::disableIntervalBar() { + // disable all elements + myGenericDataTypesComboBox->disable(); + myDataSetsComboBox->disable(); + myLimitByIntervalCheckBox->disable(); + myBeginTextField->disable(); + myEndTextField->disable(); + myFilteredAttributesComboBox->disable(); +} + + +void +GNEViewNetHelper::IntervalBar::enableIntervalBarUpdate() { + myIntervalBarUpdate = true; + // now update interval bar + updateIntervalBar(); +} + + +void +GNEViewNetHelper::IntervalBar::disableIntervalBarUpdate() { + myIntervalBarUpdate = false; +} + + +void +GNEViewNetHelper::IntervalBar::showIntervalBar() { + // check if begin and end textFields has to be updated (only once) + if (myBeginTextField->getText().empty()) { + setBegin(); + } + if (myEndTextField->getText().empty()) { + setEnd(); + } + // first update interval bar + updateIntervalBar(); + // show toolbar grip + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->show(); +} + + +void +GNEViewNetHelper::IntervalBar::hideIntervalBar() { + // hide toolbar grip + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().intervalBar->hide(); +} + + +void +GNEViewNetHelper::IntervalBar::updateIntervalBar() { + if (myIntervalBarUpdate) { + // first save current data set + const std::string previousDataSet = myDataSetsComboBox->getNumItems() > 0 ? myDataSetsComboBox->getItem(myDataSetsComboBox->getCurrentItem()).text() : ""; + // first clear items + myDataSetsComboBox->clearItems(); + myGenericDataTypesComboBox->clearItems(); + if (myViewNet->getNet()) { + // retrieve data sets + const auto dataSets = myViewNet->getNet()->retrieveDataSets(); + if (dataSets.empty()) { + myGenericDataTypesComboBox->appendItem(myNoGenericDatas); + myDataSetsComboBox->appendItem(myNoDataSets); + // disable elements + disableIntervalBar(); + } else { + // declare integer to save previous data set index + int previousDataSetIndex = 0; + // enable elements + enableIntervalBar(); + // add "" item + myGenericDataTypesComboBox->appendItem(myAllGenericDatas); + myDataSetsComboBox->appendItem(myAllDataSets); + // get all generic data types + const auto genericDataTags = GNEAttributeCarrier::allowedTagsByCategory(GNETagProperties::GENERICDATA, false); + // add all generic data types + for (const auto& dataTag : genericDataTags) { + myGenericDataTypesComboBox->appendItem(toString(dataTag).c_str()); + } + myGenericDataTypesComboBox->setNumVisible(myGenericDataTypesComboBox->getNumItems()); + // add data sets + for (const auto& dataSet : dataSets) { + // check if current data set is the previous data set + if (dataSet->getID() == previousDataSet) { + previousDataSetIndex = myDataSetsComboBox->getNumItems(); + } + myDataSetsComboBox->appendItem(dataSet->getID().c_str()); + } + // set visible elements + if (myDataSetsComboBox->getNumItems() < 10) { + myDataSetsComboBox->setNumVisible(myDataSetsComboBox->getNumItems()); + } else { + myDataSetsComboBox->setNumVisible(10); + } + // set current data set + myDataSetsComboBox->setCurrentItem(previousDataSetIndex); + } + // update limit by interval + setInterval(); + } + } +} + + +std::string +GNEViewNetHelper::IntervalBar::getGenericDataTypeStr() const { + if (myGenericDataTypesComboBox->isEnabled() && (myGenericDataTypesComboBox->getText() == myAllGenericDatas)) { + return ""; + } else { + return myGenericDataTypesComboBox->getText().text(); + } +} + + +std::string +GNEViewNetHelper::IntervalBar::getDataSetStr() const { + if (myDataSetsComboBox->isEnabled() && (myDataSetsComboBox->getText() == myAllDataSets)) { + return ""; + } else { + return myDataSetsComboBox->getText().text(); + } +} + + +std::string +GNEViewNetHelper::IntervalBar::getBeginStr() const { + if (myBeginTextField->isEnabled() && GNEAttributeCarrier::canParse(myBeginTextField->getText().text())) { + return myBeginTextField->getText().text(); + } else { + return ""; + } +} + + +std::string +GNEViewNetHelper::IntervalBar::getEndStr() const { + if (myEndTextField->isEnabled() && GNEAttributeCarrier::canParse(myEndTextField->getText().text())) { + return myEndTextField->getText().text(); + } else { + return ""; + } +} + + +std::string +GNEViewNetHelper::IntervalBar::getAttributeStr() const { + if (myFilteredAttributesComboBox->isEnabled() && + ((myFilteredAttributesComboBox->getText() == myAllAttributes) || (myFilteredAttributesComboBox->getTextColor() != FXRGB(0, 0, 0)))) { + return ""; + } else { + return myFilteredAttributesComboBox->getText().text(); + } +} + + +void +GNEViewNetHelper::IntervalBar::setGenericDataType() { + // check if data set is correct + if (myGenericDataTypesComboBox->getText() == myAllGenericDatas) { + myGenericDataTypesComboBox->setTextColor(FXRGB(0, 0, 0)); + } else if (myGenericDataTypesComboBox->getText().empty()) { + myGenericDataTypesComboBox->setTextColor(FXRGB(0, 0, 0)); + myGenericDataTypesComboBox->setText(myAllGenericDatas); + } else { + // get all generic data types + const auto genericDataTags = GNEAttributeCarrier::allowedTagsByCategoryStr(GNETagProperties::GENERICDATA, false); + // convert all to strings + if (std::find(genericDataTags.begin(), genericDataTags.end(), myGenericDataTypesComboBox->getText().text()) != genericDataTags.end()) { + myGenericDataTypesComboBox->setTextColor(FXRGB(0, 0, 0)); + } else { + myGenericDataTypesComboBox->setTextColor(FXRGB(255, 0, 0)); + } + } + // update comboBox attributes + updateComboBoxAttributes(); + // update view net + myViewNet->updateViewNet(); +} + + +void +GNEViewNetHelper::IntervalBar::setDataSet() { + // check if data set is correct + if (myDataSetsComboBox->getText() == myAllDataSets) { + myDataSetsComboBox->setTextColor(FXRGB(0, 0, 0)); + } else if (myDataSetsComboBox->getText().empty()) { + myDataSetsComboBox->setTextColor(FXRGB(0, 0, 0)); + myDataSetsComboBox->setText(myAllDataSets); + } else if (myViewNet->getNet()->retrieveDataSet(myDataSetsComboBox->getText().text(), false)) { + myDataSetsComboBox->setTextColor(FXRGB(0, 0, 0)); + } else { + myDataSetsComboBox->setTextColor(FXRGB(255, 0, 0)); + } + // update comboBox attributes + updateComboBoxAttributes(); + // update view net + myViewNet->updateViewNet(); +} + + +void +GNEViewNetHelper::IntervalBar::setInterval() { + // enable or disable text fields + if (myLimitByIntervalCheckBox->isEnabled() && (myLimitByIntervalCheckBox->getCheck() == TRUE)) { + myBeginTextField->enable(); + myEndTextField->enable(); + } else { + myBeginTextField->disable(); + myEndTextField->disable(); + } + // update comboBox attributes + updateComboBoxAttributes(); + // update view net + myViewNet->updateViewNet(); +} + + +void +GNEViewNetHelper::IntervalBar::setBegin() { + if (myBeginTextField->getText().empty()) { + myBeginTextField->setText(toString(myViewNet->getNet()->getDataSetIntervalMinimumBegin()).c_str()); + myBeginTextField->setTextColor(FXRGB(0, 0, 0)); + } else if (GNEAttributeCarrier::canParse(myBeginTextField->getText().text())) { + myBeginTextField->setTextColor(FXRGB(0, 0, 0)); + } else { + myBeginTextField->setTextColor(FXRGB(255, 0, 0)); + } + // update comboBox attributes + updateComboBoxAttributes(); + // update view net + myViewNet->updateViewNet(); +} + + +void +GNEViewNetHelper::IntervalBar::setEnd() { + if (myEndTextField->getText().empty()) { + myEndTextField->setText(toString(myViewNet->getNet()->getDataSetIntervalMaximumEnd()).c_str()); + myEndTextField->setTextColor(FXRGB(0, 0, 0)); + } else if (GNEAttributeCarrier::canParse(myEndTextField->getText().text())) { + myEndTextField->setTextColor(FXRGB(0, 0, 0)); + } else { + myEndTextField->setTextColor(FXRGB(255, 0, 0)); + } + // update comboBox attributes + updateComboBoxAttributes(); + // update view net + myViewNet->updateViewNet(); +} + + +void +GNEViewNetHelper::IntervalBar::setAttribute() { + // +} + + +void +GNEViewNetHelper::IntervalBar::updateComboBoxAttributes() { + // update attributes + myFilteredAttributes = myViewNet->getNet()->retrieveGenericDataParameters(getDataSetStr(), + getGenericDataTypeStr(), getBeginStr(), getEndStr()); + // clear combo box + myFilteredAttributesComboBox->clearItems(); + // check if there is dataSets + if (myDataSetsComboBox->isEnabled()) { + // add wildcard for all attributes + myFilteredAttributesComboBox->appendItem(myAllAttributes); + // add all atributes in ComboBox + for (const auto& attribute : myFilteredAttributes) { + myFilteredAttributesComboBox->appendItem(attribute.c_str()); + } + // set visible elements + if (myFilteredAttributesComboBox->getNumItems() < 10) { + myFilteredAttributesComboBox->setNumVisible(myFilteredAttributesComboBox->getNumItems()); + } else { + myFilteredAttributesComboBox->setNumVisible(10); + } + } else { + // add wildcard for all attributes + myFilteredAttributesComboBox->appendItem(myNoDataSets); + } +} + +// --------------------------------------------------------------------------- // GNEViewNetHelper::CommonCheckableButtons - methods // --------------------------------------------------------------------------- @@ -1874,7 +2451,6 @@ inspectButton(nullptr), deleteButton(nullptr), selectButton(nullptr), - moveButton(nullptr), myViewNet(viewNet) { } @@ -1882,21 +2458,20 @@ void GNEViewNetHelper::CommonCheckableButtons::buildCommonCheckableButtons() { // inspect button - inspectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset inspect mode\tMode for inspect elements and change their attributes.", - GUIIconSubSys::getIcon(ICON_MODEINSPECT), myViewNet, MID_HOTKEY_I_INSPECTMODE, GUIDesignButtonToolbarCheckable); + inspectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset inspect mode\tMode for inspect elements and change their attributes.", + GUIIconSubSys::getIcon(GUIIcon::MODEINSPECT), myViewNet, MID_HOTKEY_I_MODES_INSPECT, GUIDesignButtonToolbarCheckable); inspectButton->create(); // delete button - deleteButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset delete mode\tMode for delete elements.", - GUIIconSubSys::getIcon(ICON_MODEDELETE), myViewNet, MID_HOTKEY_D_DELETEMODE, GUIDesignButtonToolbarCheckable); + deleteButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset delete mode\tMode for delete elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEDELETE), myViewNet, MID_HOTKEY_D_MODES_DELETE, GUIDesignButtonToolbarCheckable); deleteButton->create(); // select button - selectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset select mode\tMode for select elements.", - GUIIconSubSys::getIcon(ICON_MODESELECT), myViewNet, MID_HOTKEY_S_SELECTMODE, GUIDesignButtonToolbarCheckable); + selectButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset select mode\tMode for select elements.", + GUIIconSubSys::getIcon(GUIIcon::MODESELECT), myViewNet, MID_HOTKEY_S_MODES_SELECT, GUIDesignButtonToolbarCheckable); selectButton->create(); - // move button - moveButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset move mode\tMode for move elements.", - GUIIconSubSys::getIcon(ICON_MODEMOVE), myViewNet, MID_HOTKEY_M_MOVEMODE, GUIDesignButtonToolbarCheckable); - moveButton->create(); // always recalc menu bar after creating new elements myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); } @@ -1907,7 +2482,6 @@ inspectButton->show(); deleteButton->show(); selectButton->show(); - moveButton->show(); } @@ -1916,7 +2490,6 @@ inspectButton->hide(); deleteButton->hide(); selectButton->hide(); - moveButton->hide(); } @@ -1925,7 +2498,6 @@ inspectButton->setChecked(false); deleteButton->setChecked(false); selectButton->setChecked(false); - moveButton->setChecked(false); } @@ -1934,7 +2506,6 @@ inspectButton->update(); deleteButton->update(); selectButton->update(); - moveButton->update(); } // --------------------------------------------------------------------------- @@ -1942,6 +2513,7 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::NetworkCheckableButtons::NetworkCheckableButtons(GNEViewNet* viewNet) : + moveNetworkElementsButton(nullptr), createEdgeButton(nullptr), connectionButton(nullptr), trafficLightButton(nullptr), @@ -1956,37 +2528,50 @@ void GNEViewNetHelper::NetworkCheckableButtons::buildNetworkCheckableButtons() { + // move button + moveNetworkElementsButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset move mode\tMode for move elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEMOVE), myViewNet, MID_HOTKEY_M_MODES_MOVE, GUIDesignButtonToolbarCheckable); + moveNetworkElementsButton->create(); // create edge - createEdgeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset create edge mode\tMode for creating junction and edges.", - GUIIconSubSys::getIcon(ICON_MODECREATEEDGE), myViewNet, MID_HOTKEY_E_EDGEMODE, GUIDesignButtonToolbarCheckable); + createEdgeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset create edge mode\tMode for creating junction and edges.", + GUIIconSubSys::getIcon(GUIIcon::MODECREATEEDGE), myViewNet, MID_HOTKEY_E_MODES_EDGE_EDGEDATA, GUIDesignButtonToolbarCheckable); createEdgeButton->create(); // connection mode - connectionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset connection mode\tMode for edit connections between lanes.", - GUIIconSubSys::getIcon(ICON_MODECONNECTION), myViewNet, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE, GUIDesignButtonToolbarCheckable); + connectionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset connection mode\tMode for edit connections between lanes.", + GUIIconSubSys::getIcon(GUIIcon::MODECONNECTION), myViewNet, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN, GUIDesignButtonToolbarCheckable); connectionButton->create(); // prohibition mode - prohibitionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset prohibition mode\tMode for editing connection prohibitions.", - GUIIconSubSys::getIcon(ICON_MODEPROHIBITION), myViewNet, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE, GUIDesignButtonToolbarCheckable); + prohibitionButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset prohibition mode\tMode for editing connection prohibitions.", + GUIIconSubSys::getIcon(GUIIcon::MODEPROHIBITION), myViewNet, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GUIDesignButtonToolbarCheckable); 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.", - GUIIconSubSys::getIcon(ICON_MODETLS), myViewNet, MID_HOTKEY_T_TLSMODE_VTYPEMODE, GUIDesignButtonToolbarCheckable); + trafficLightButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset traffic light mode\tMode for edit traffic lights over junctions.", + GUIIconSubSys::getIcon(GUIIcon::MODETLS), myViewNet, MID_HOTKEY_T_MODES_TLS_VTYPE, GUIDesignButtonToolbarCheckable); trafficLightButton->create(); // additional mode - additionalButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset additional mode\tMode for adding additional elements.", - GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), myViewNet, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE, GUIDesignButtonToolbarCheckable); + additionalButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset additional mode\tMode for adding additional elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEADDITIONAL), myViewNet, MID_HOTKEY_A_MODES_ADDITIONAL_STOP, GUIDesignButtonToolbarCheckable); additionalButton->create(); // crossing mode - crossingButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset crossing mode\tMode for creating crossings between edges.", - GUIIconSubSys::getIcon(ICON_MODECROSSING), myViewNet, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE, GUIDesignButtonToolbarCheckable); + crossingButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset crossing mode\tMode for creating crossings between edges.", + GUIIconSubSys::getIcon(GUIIcon::MODECROSSING), myViewNet, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GUIDesignButtonToolbarCheckable); crossingButton->create(); // TAZ Mode - TAZButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset TAZ mode\tMode for creating Traffic Assignment Zones.", - GUIIconSubSys::getIcon(ICON_MODETAZ), myViewNet, MID_HOTKEY_Z_TAZMODE, GUIDesignButtonToolbarCheckable); + TAZButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset TAZ mode\tMode for creating Traffic Assignment Zones.", + GUIIconSubSys::getIcon(GUIIcon::MODETAZ), myViewNet, MID_HOTKEY_Z_MODES_TAZ, GUIDesignButtonToolbarCheckable); TAZButton->create(); // shape mode - shapeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tset polygon mode\tMode for creating polygons and POIs.", - GUIIconSubSys::getIcon(ICON_MODEPOLYGON), myViewNet, MID_HOTKEY_P_POLYGONMODE_PERSONMODE, GUIDesignButtonToolbarCheckable); + shapeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset polygon mode\tMode for creating polygons and POIs.", + GUIIconSubSys::getIcon(GUIIcon::MODEPOLYGON), myViewNet, MID_HOTKEY_P_MODES_POLYGON_PERSON, GUIDesignButtonToolbarCheckable); shapeButton->create(); // always recalc after creating new elements myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); @@ -1995,6 +2580,7 @@ void GNEViewNetHelper::NetworkCheckableButtons::showNetworkCheckableButtons() { + moveNetworkElementsButton->show(); createEdgeButton->show(); connectionButton->show(); trafficLightButton->show(); @@ -2008,6 +2594,7 @@ void GNEViewNetHelper::NetworkCheckableButtons::hideNetworkCheckableButtons() { + moveNetworkElementsButton->hide(); createEdgeButton->hide(); connectionButton->hide(); trafficLightButton->hide(); @@ -2021,6 +2608,7 @@ void GNEViewNetHelper::NetworkCheckableButtons::disableNetworkCheckableButtons() { + moveNetworkElementsButton->setChecked(false); createEdgeButton->setChecked(false); connectionButton->setChecked(false); trafficLightButton->setChecked(false); @@ -2034,6 +2622,7 @@ void GNEViewNetHelper::NetworkCheckableButtons::updateNetworkCheckableButtons() { + moveNetworkElementsButton->update(); createEdgeButton->update(); connectionButton->update(); trafficLightButton->update(); @@ -2049,6 +2638,7 @@ // --------------------------------------------------------------------------- GNEViewNetHelper::DemandCheckableButtons::DemandCheckableButtons(GNEViewNet* viewNet) : + moveDemandElementsButton(nullptr), routeButton(nullptr), vehicleButton(nullptr), vehicleTypeButton(nullptr), @@ -2062,33 +2652,45 @@ void GNEViewNetHelper::DemandCheckableButtons::buildDemandCheckableButtons() { + // move button + moveDemandElementsButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tset move mode\tMode for move elements.", + GUIIconSubSys::getIcon(GUIIcon::MODEMOVE), myViewNet, MID_HOTKEY_M_MODES_MOVE, GUIDesignButtonToolbarCheckable); + moveDemandElementsButton->create(); // route mode - routeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate route mode\tMode for creating routes.", - GUIIconSubSys::getIcon(ICON_MODEROUTE), myViewNet, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE, GUIDesignButtonToolbarCheckable); + routeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate route mode\tMode for creating routes.", + GUIIconSubSys::getIcon(GUIIcon::MODEROUTE), myViewNet, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GUIDesignButtonToolbarCheckable); routeButton->create(); // vehicle mode - vehicleButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate vehicle mode\tMode for creating vehicles.", - GUIIconSubSys::getIcon(ICON_MODEVEHICLE), myViewNet, MID_HOTKEY_V_VEHICLEMODE, GUIDesignButtonToolbarCheckable); + vehicleButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate vehicle mode\tMode for creating vehicles.", + GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLE), myViewNet, MID_HOTKEY_V_MODES_VEHICLE, GUIDesignButtonToolbarCheckable); vehicleButton->create(); // vehicle type mode - vehicleTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate vehicle type mode\tMode for creating vehicle types.", - GUIIconSubSys::getIcon(ICON_MODEVEHICLETYPE), myViewNet, MID_HOTKEY_T_TLSMODE_VTYPEMODE, GUIDesignButtonToolbarCheckable); + vehicleTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate vehicle type mode\tMode for creating vehicle types.", + GUIIconSubSys::getIcon(GUIIcon::MODEVEHICLETYPE), myViewNet, MID_HOTKEY_T_MODES_TLS_VTYPE, GUIDesignButtonToolbarCheckable); vehicleTypeButton->create(); // stop mode - stopButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate stop mode\tMode for creating stops.", - GUIIconSubSys::getIcon(ICON_MODESTOP), myViewNet, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE, GUIDesignButtonToolbarCheckable); + stopButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate stop mode\tMode for creating stops.", + GUIIconSubSys::getIcon(GUIIcon::MODESTOP), myViewNet, MID_HOTKEY_A_MODES_ADDITIONAL_STOP, GUIDesignButtonToolbarCheckable); stopButton->create(); // person type mode - personTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person type mode\tMode for creating person types.", - GUIIconSubSys::getIcon(ICON_MODEPERSONTYPE), myViewNet, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE, GUIDesignButtonToolbarCheckable); + personTypeButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate person type mode\tMode for creating person types.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSONTYPE), myViewNet, MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, GUIDesignButtonToolbarCheckable); personTypeButton->create(); // person mode - personButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person mode\tMode for creating persons.", - GUIIconSubSys::getIcon(ICON_MODEPERSON), myViewNet, MID_HOTKEY_P_POLYGONMODE_PERSONMODE, GUIDesignButtonToolbarCheckable); + personButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate person mode\tMode for creating persons.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSON), myViewNet, MID_HOTKEY_P_MODES_POLYGON_PERSON, GUIDesignButtonToolbarCheckable); personButton->create(); // person plan mode - personPlanButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, "\tcreate person plan mode\tMode for creating person plans.", - GUIIconSubSys::getIcon(ICON_MODEPERSONPLAN), myViewNet, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE, GUIDesignButtonToolbarCheckable); + personPlanButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate person plan mode\tMode for creating person plans.", + GUIIconSubSys::getIcon(GUIIcon::MODEPERSONPLAN), myViewNet, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN, GUIDesignButtonToolbarCheckable); personPlanButton->create(); // always recalc after creating new elements myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); @@ -2097,6 +2699,7 @@ void GNEViewNetHelper::DemandCheckableButtons::showDemandCheckableButtons() { + moveDemandElementsButton->show(); routeButton->show(); vehicleButton->show(); vehicleTypeButton->show(); @@ -2109,6 +2712,7 @@ void GNEViewNetHelper::DemandCheckableButtons::hideDemandCheckableButtons() { + moveDemandElementsButton->hide(); routeButton->hide(); vehicleButton->hide(); vehicleTypeButton->hide(); @@ -2121,6 +2725,7 @@ void GNEViewNetHelper::DemandCheckableButtons::disableDemandCheckableButtons() { + moveDemandElementsButton->setChecked(false); routeButton->setChecked(false); vehicleButton->setChecked(false); vehicleTypeButton->setChecked(false); @@ -2133,6 +2738,7 @@ void GNEViewNetHelper::DemandCheckableButtons::updateDemandCheckableButtons() { + moveDemandElementsButton->update(); routeButton->update(); vehicleButton->update(); vehicleTypeButton->update(); @@ -2143,33 +2749,89 @@ } // --------------------------------------------------------------------------- +// GNEViewNetHelper::DataCheckableButtons - methods +// --------------------------------------------------------------------------- + +GNEViewNetHelper::DataCheckableButtons::DataCheckableButtons(GNEViewNet* viewNet) : + edgeDataButton(nullptr), + edgeRelDataButton(nullptr), + myViewNet(viewNet) { +} + + +void +GNEViewNetHelper::DataCheckableButtons::buildDataCheckableButtons() { + // edgeData mode + edgeDataButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate edge data mode\tMode for creating edge datas.", + GUIIconSubSys::getIcon(GUIIcon::MODEEDGEDATA), myViewNet, MID_HOTKEY_E_MODES_EDGE_EDGEDATA, GUIDesignButtonToolbarCheckable); + edgeDataButton->create(); + // edgeRelData mode + edgeRelDataButton = new MFXCheckableButton(false, myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes, + "\tcreate edge relation data mode\tMode for creating edge relation datas.", + GUIIconSubSys::getIcon(GUIIcon::MODEEDGERELDATA), myViewNet, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, GUIDesignButtonToolbarCheckable); + edgeRelDataButton->create(); + // always recalc after creating new elements + myViewNet->myViewParent->getGNEAppWindows()->getToolbarsGrip().modes->recalc(); +} + + +void +GNEViewNetHelper::DataCheckableButtons::showDataCheckableButtons() { + edgeDataButton->show(); + edgeRelDataButton->show(); +} + + +void +GNEViewNetHelper::DataCheckableButtons::hideDataCheckableButtons() { + edgeDataButton->hide(); + edgeRelDataButton->hide(); +} + + +void +GNEViewNetHelper::DataCheckableButtons::disableDataCheckableButtons() { + edgeDataButton->setChecked(false); + edgeRelDataButton->setChecked(false); +} + + +void +GNEViewNetHelper::DataCheckableButtons::updateDataCheckableButtons() { + edgeDataButton->update(); + edgeRelDataButton->update(); +} + +// --------------------------------------------------------------------------- // GNEViewNetHelper::EditShapes - methods // --------------------------------------------------------------------------- GNEViewNetHelper::EditShapes::EditShapes(GNEViewNet* viewNet) : editedShapePoly(nullptr), - editingNetElementShapes(false), + editingNetworkElementShapes(false), + myPreviousNetworkEditMode(NetworkEditMode::NETWORK_NONE), myViewNet(viewNet) { } void -GNEViewNetHelper::EditShapes::startEditCustomShape(GNENetElement* element, const PositionVector& shape, bool fill) { +GNEViewNetHelper::EditShapes::startEditCustomShape(GNENetworkElement* element, const PositionVector& shape, bool fill) { if ((editedShapePoly == nullptr) && (element != nullptr) && (shape.size() > 1)) { // save current edit mode before starting myPreviousNetworkEditMode = myViewNet->myEditModes.networkEditMode; if ((element->getTagProperty().getTag() == SUMO_TAG_CONNECTION) || (element->getTagProperty().getTag() == SUMO_TAG_CROSSING)) { - editingNetElementShapes = true; + editingNetworkElementShapes = true; } else { - editingNetElementShapes = false; + editingNetworkElementShapes = false; } // set move mode - myViewNet->myEditModes.setNetworkEditMode(GNE_NMODE_MOVE); + myViewNet->myEditModes.setNetworkEditMode(NetworkEditMode::NETWORK_MOVE); // add special GNEPoly fo edit shapes (color is taken from junction color settings) RGBColor col = myViewNet->getVisualisationSettings().junctionColorer.getSchemes()[0].getColor(3); editedShapePoly = myViewNet->myNet->addPolygonForEditShapes(element, shape, fill, col); // update view net to show the new editedShapePoly - myViewNet->update(); + myViewNet->updateViewNet(); } } @@ -2200,8 +2862,8 @@ editedShapePoly->getShapeEditedElement()->setAttribute(attr, toString(editedShapePoly->getShape()), myViewNet->myUndoList); myViewNet->myUndoList->p_end(); stopEditCustomShape(); - myViewNet->update(); } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewNetHelper.h sumo-1.6.0+dfsg1/src/netedit/GNEViewNetHelper.h --- sumo-1.5.0+dfsg1/src/netedit/GNEViewNetHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewNetHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A file used to reduce the size of GNEViewNet.h grouping structs and classes /****************************************************************************/ -#ifndef GNEViewNetHelper_h -#define GNEViewNetHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -43,71 +37,87 @@ // =========================================================================== /// @brie enum for supermodes -enum Supermode { - /// @brief empty super mode - GNE_SUPERMODE_NONE, +enum class Supermode { /// @brief Network mode (Edges, junctions, etc..) - GNE_SUPERMODE_NETWORK, - ///@brief Demanding mode (Routes, Vehicles etc..) - GNE_SUPERMODE_DEMAND + NETWORK, + ///@brief Demand mode (Routes, Vehicles etc..) + DEMAND, + ///@brief Data mode (edgeData, LaneData etc..) + DATA }; /// @brie enum for network edit modes -enum NetworkEditMode { +enum class NetworkEditMode { /// @brief empty Network mode - GNE_NMODE_NONE, + NETWORK_NONE, ///@brief mode for inspecting network elements - GNE_NMODE_INSPECT, + NETWORK_INSPECT, ///@brief mode for deleting network elements - GNE_NMODE_DELETE, + NETWORK_DELETE, ///@brief mode for selecting network elements - GNE_NMODE_SELECT, + NETWORK_SELECT, ///@brief mode for moving network elements - GNE_NMODE_MOVE, + NETWORK_MOVE, ///@brief mode for creating new edges - GNE_NMODE_CREATE_EDGE, + NETWORK_CREATE_EDGE, ///@brief mode for connecting lanes - GNE_NMODE_CONNECT, + NETWORK_CONNECT, ///@brief mode for editing tls - GNE_NMODE_TLS, + NETWORK_TLS, ///@brief Mode for editing additionals - GNE_NMODE_ADDITIONAL, + NETWORK_ADDITIONAL, ///@brief Mode for editing crossing - GNE_NMODE_CROSSING, + NETWORK_CROSSING, ///@brief Mode for editing TAZ - GNE_NMODE_TAZ, + NETWORK_TAZ, ///@brief Mode for editing Polygons - GNE_NMODE_POLYGON, + NETWORK_POLYGON, ///@brief Mode for editing connection prohibitions - GNE_NMODE_PROHIBITION + NETWORK_PROHIBITION }; /// @brie enum for demand edit modes -enum DemandEditMode { +enum class DemandEditMode { /// @brief empty Demand mode - GNE_DMODE_NONE, + DEMAND_NONE, ///@brief mode for inspecting demand elements - GNE_DMODE_INSPECT, + DEMAND_INSPECT, ///@brief mode for deleting demand elements - GNE_DMODE_DELETE, + DEMAND_DELETE, ///@brief mode for selecting demand elements - GNE_DMODE_SELECT, + DEMAND_SELECT, ///@brief mode for moving demand elements - GNE_DMODE_MOVE, + DEMAND_MOVE, ///@brief Mode for editing routes - GNE_DMODE_ROUTE, + DEMAND_ROUTE, ///@brief Mode for editing vehicles - GNE_DMODE_VEHICLE, + DEMAND_VEHICLE, ///@brief Mode for editing vehicle types - GNE_DMODE_VEHICLETYPES, + DEMAND_VEHICLETYPES, ///@brief Mode for editing stops - GNE_DMODE_STOP, + DEMAND_STOP, ///@brief Mode for editing person types - GNE_DMODE_PERSONTYPES, + DEMAND_PERSONTYPES, ///@brief Mode for editing person - GNE_DMODE_PERSON, + DEMAND_PERSON, ///@brief Mode for editing person plan - GNE_DMODE_PERSONPLAN + DEMAND_PERSONPLAN +}; + +/// @brie enum for data edit modes +enum class DataEditMode { + /// @brief empty Data mode + DATA_NONE, + /// @brief mode for inspecting data elements + DATA_INSPECT, + /// @brief mode for deleting data elements + DATA_DELETE, + /// @brief mode for selecting data elements + DATA_SELECT, + /// @brief mode for create edgeData elements + DATA_EDGEDATA, + /// @brief mode for create edgeRelData elements + DATA_EDGERELDATA }; // =========================================================================== @@ -115,14 +125,14 @@ // =========================================================================== // main elements -class GNEViewParent; -class GNEViewNet; -class GNEUndoList; -class GNEFrame; class GNEAttributeCarrier; -// net elements +class GNEFrame; class GNENet; -class GNENetElement; +class GNEUndoList; +class GNEViewNet; +class GNEViewParent; +// network elements +class GNENetworkElement; class GNEJunction; class GNEEdge; class GNELane; @@ -141,6 +151,12 @@ class GNEFlow; class GNEVehicle; class GNEtrip; +// data elements +class GNEDataSet; +class GNEDataInterval; +class GNEGenericData; +class GNEEdgeData; +class GNEEdgeRelData; // =========================================================================== // classes and structs definitions @@ -160,63 +176,72 @@ /// @brief swap lane to edge void swapLane2Edge(); - /// @brief get front GUI GL ID (or a pointer to nullptr if there isn't) + /// @brief get front GUI GL ID or a pointer to nullptr GUIGlID getGlIDFront() const; - /// @brief get front GUI GL object type (or a pointer to nullptr if there isn't) + /// @brief get front GUI GL object type or a pointer to nullptr GUIGlObjectType getGlTypeFront() const; - /// @brief get front attribute carrier (or a pointer to nullptr if there isn't) + /// @brief get front attribute carrier or a pointer to nullptr GNEAttributeCarrier* getAttributeCarrierFront() const; - /// @brief get front net element (or a pointer to nullptr if there isn't) - GNENetElement* getNetElementFront() const; + /// @brief get front network element or a pointer to nullptr + GNENetworkElement* getNetworkElementFront() const; - /// @brief get front additional element (or a pointer to nullptr if there isn't) + /// @brief get front additional element or a pointer to nullptr GNEAdditional* getAdditionalFront() const; - /// @brief get front shape element (or a pointer to nullptr if there isn't) + /// @brief get front shape element or a pointer to nullptr GNEShape* getShapeFront() const; - /// @brief get front net element element (or a pointer to nullptr if there isn't) + /// @brief get front demand element or a pointer to nullptr GNEDemandElement* getDemandElementFront() const; - /// @brief get front junction (or a pointer to nullptr if there isn't) + /// @brief get generic data element or a pointer to nullptr + GNEGenericData* getGenericDataElementFront() const; + + /// @brief get front junction or a pointer to nullptr GNEJunction* getJunctionFront() const; - /// @brief get front edge (or a pointer to nullptr if there isn't) + /// @brief get front edge or a pointer to nullptr GNEEdge* getEdgeFront() const; - /// @brief get front lane (or a pointer to nullptr if there isn't) + /// @brief get front lane or a pointer to nullptr GNELane* getLaneFront() const; - /// @brief get front crossing (or a pointer to nullptr if there isn't) + /// @brief get front crossing or a pointer to nullptr GNECrossing* getCrossingFront() const; - /// @brief get front connection (or a pointer to nullptr if there isn't) + /// @brief get front connection or a pointer to nullptr GNEConnection* getConnectionFront() const; - /// @brief get front TAZ (or a pointer to nullptr if there isn't) + /// @brief get front TAZ or a pointer to nullptr GNETAZ* getTAZFront() const; - /// @brief get front POI (or a pointer to nullptr if there isn't) + /// @brief get front POI or a pointer to nullptr GNEPOI* getPOIFront() const; - /// @brief get front Poly (or a pointer to nullptr if there isn't) + /// @brief get front Poly or a pointer to nullptr GNEPoly* getPolyFront() const; + /// @brief get edge data element or a pointer to nullptr + GNEEdgeData* getEdgeDataElementFront() const; + + /// @brief get edge rel data element or a pointer to nullptr + GNEEdgeRelData* getEdgeRelDataElementFront() const; + /// @brief get vector with clicked ACs const std::vector& getClickedAttributeCarriers() const; private: /// @brief vector with the clicked GUIGlObjects - std::vector myGUIGlObjects; + std::vector myGUIGlObjectLanes, myGUIGlObjectEdges; /// @brief vector with the clicked attribute carriers - std::vector myAttributeCarriers; + std::vector myAttributeCarrierLanes, myAttributeCarrierEdges; - /// @brief vector with the clicked net elements - std::vector myNetElements; + /// @brief vector with the clicked network elements + std::vector myNetworkElementLanes, myNetworkElementEdges; /// @brief vector with the clicked additional elements std::vector myAdditionals; @@ -227,6 +252,9 @@ /// @brief vector with the clicked demand elements std::vector myDemandElements; + /// @brief vector with the clicked generic datas + std::vector myGenericDatas; + /// @brief vector with the clicked junctions std::vector myJunctions; @@ -251,6 +279,15 @@ /// @brief vector with the clicked Polys std::vector myPolys; + /// @brief vector with the clicked edge datas + std::vector myEdgeDatas; + + /// @brief vector with the clicked edge relation datas + std::vector myEdgeRelDatas; + + /// @brief flag to enable/disable swap lane to edge + bool mySwapLane2edge; + /// @brief invert GUIGlObjects void sortGUIGlObjectsByAltitude(const std::vector& GUIGlObjects); @@ -305,8 +342,11 @@ /// @brief chekable button for save demand elements FXButton* saveDemandElements; + /// @brief chekable button for save data elements + FXButton* saveDataElements; + private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief Invalidated copy constructor. @@ -325,17 +365,26 @@ /// @brief build checkable buttons void buildSuperModeButtons(); - /// @brief set Network edit mode - void setSupermode(Supermode supermode); + /// @brief set supermode + void setSupermode(Supermode supermode, const bool force); /// @brief set Network edit mode - void setNetworkEditMode(NetworkEditMode networkMode, bool force = false); + void setNetworkEditMode(NetworkEditMode networkMode, const bool force = false); /// @brief set Demand edit mode - void setDemandEditMode(DemandEditMode demandMode, bool force = false); + void setDemandEditMode(DemandEditMode demandMode, const bool force = false); - /// @brief the current supermode - Supermode currentSupermode; + /// @brief set Data edit mode + void setDataEditMode(DataEditMode dataMode, const bool force = false); + + /// @check if current supermode is Network + bool isCurrentSupermodeNetwork() const; + + /// @check if current supermode is Demand + bool isCurrentSupermodeDemand() const; + + /// @check if current supermode is Data + bool isCurrentSupermodeData() const; /// @brief the current Network edit mode NetworkEditMode networkEditMode; @@ -343,16 +392,25 @@ /// @brief the current Demand edit mode DemandEditMode demandEditMode; + /// @brief the current Data edit mode + DataEditMode dataEditMode; + /// @brief chekable button for supermode Network MFXCheckableButton* networkButton; /// @brief chekable button for supermode Demand MFXCheckableButton* demandButton; + /// @brief chekable button for supermode Data + MFXCheckableButton* dataButton; + private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; + /// @brief the current supermode + Supermode myCurrentSupermode; + /// @brief Invalidated copy constructor. EditModes(const EditModes&) = delete; @@ -360,38 +418,6 @@ EditModes& operator=(const EditModes&) = delete; }; - /// @brief struct used to group all variables related to view options in all supermodes - struct CommonViewOptions { - - /// @brief default constructor - CommonViewOptions(GNEViewNet* viewNet); - - /// @brief build menu checks - void buildCommonViewOptionsMenuChecks(); - - /// @brief get visible common menu commands - void getVisibleCommonMenuCommands(std::vector& commands) const; - - /// @brief check if vehicles must be drawn spread - bool drawSpreadVehicles() const; - - /// @brief menu check to show grid button - FXMenuCheck* menuCheckShowGrid; - - /// @brief menu check to draw vehicles in begin position or spread in lane - FXMenuCheck* menuCheckDrawSpreadVehicles; - - private: - /// @brief pointer to viewNet - GNEViewNet* myViewNet; - - /// @brief Invalidated copy constructor. - CommonViewOptions(const CommonViewOptions&) = delete; - - /// @brief Invalidated assignment operator. - CommonViewOptions& operator=(const CommonViewOptions&) = delete; - }; - /// @brief struct used to group all variables related to view options in supermode Network struct NetworkViewOptions { @@ -407,6 +433,9 @@ /// @brief get visible network menu commands void getVisibleNetworkMenuCommands(std::vector& commands) const; + /// @brief check if vehicles must be drawn spread + bool drawSpreadVehicles() const; + /// @brief check if show demand elements checkbox is enabled bool showDemandElements() const; @@ -419,6 +448,12 @@ /// @brief check if we're editing elevation bool editingElevation() const; + /// @brief menu check to show grid button + FXMenuCheck* menuCheckShowGrid; + + /// @brief menu check to draw vehicles in begin position or spread in lane + FXMenuCheck* menuCheckDrawSpreadVehicles; + /// @brief menu check to show Demand Elements FXMenuCheck* menuCheckShowDemandElements; @@ -452,7 +487,7 @@ /// @brief menu check to create auto create opposite edge FXMenuCheck* menuCheckAutoOppositeEdge; private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief Invalidated copy constructor. @@ -477,10 +512,13 @@ /// @brief get visible demand menu commands void getVisibleDemandMenuCommands(std::vector& commands) const; + /// @brief check if vehicles must be drawn spread + bool drawSpreadVehicles() const; + /// @brief check if non inspected element has to be hidden bool showNonInspectedDemandElements(const GNEDemandElement* demandElement) const; - /// @brief check if shapes has to be hide + /// @brief check if shapes has to be drawn bool showShapes() const; /// @brief check all person plans has to be show @@ -495,6 +533,12 @@ /// @brief get locked person const GNEDemandElement* getLockedPerson() const; + /// @brief menu check to show grid button + FXMenuCheck* menuCheckShowGrid; + + /// @brief menu check to draw vehicles in begin position or spread in lane + FXMenuCheck* menuCheckDrawSpreadVehicles; + /// @brief Hide shapes (Polygons and POIs) FXMenuCheck* menuCheckHideShapes; @@ -508,7 +552,7 @@ FXMenuCheck* menuCheckLockPerson; private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief pointer to locked person @@ -521,6 +565,177 @@ DemandViewOptions& operator=(const DemandViewOptions&) = delete; }; + /// @brief struct used to group all variables related to view options in supermode Data + struct DataViewOptions { + + /// @brief default constructor + DataViewOptions(GNEViewNet* viewNet); + + /// @brief build menu checks + void buildDataViewOptionsMenuChecks(); + + /// @brief hide all options menu checks + void hideDataViewOptionsMenuChecks(); + + /// @brief get visible demand menu commands + void getVisibleDataMenuCommands(std::vector& commands) const; + + /// @brief check if additionals has to be drawn + bool showAdditionals() const; + + /// @brief check if shapes has to be drawn + bool showShapes() const; + + /// @brief check if show demand elements checkbox is enabled + bool showDemandElements() const; + + /// @brief menu check to show Additionals + FXMenuCheck* menuCheckShowAdditionals; + + /// @brief menu check to show Shapes + FXMenuCheck* menuCheckShowShapes; + + /// @brief menu check to show Demand Elements + FXMenuCheck* menuCheckShowDemandElements; + private: + /// @brief pointer to net + GNEViewNet* myViewNet; + + /// @brief Invalidated copy constructor. + DataViewOptions(const DataViewOptions&) = delete; + + /// @brief Invalidated assignment operator. + DataViewOptions& operator=(const DataViewOptions&) = delete; + }; + + /// @brief class used to group all variables related to interval bar + class IntervalBar { + public: + /// @brief default constructor + IntervalBar(GNEViewNet* viewNet); + + /// @brief build interval bar elements + void buildIntervalBarElements(); + + /// @brief enable interval bar + void enableIntervalBar(); + + /// @brief disable interval bar + void disableIntervalBar(); + + /// @brief enable interval bar update + void enableIntervalBarUpdate(); + + /// @brief enable interval bar update + void disableIntervalBarUpdate(); + + /// @brief show interval option bar + void showIntervalBar(); + + /// @brief hide all options menu checks + void hideIntervalBar(); + + /// @brief update interval bar + void updateIntervalBar(); + + /// @name get functions (called by GNEViewNet) + /// @{ + + /// @brief get generic data type + std::string getGenericDataTypeStr() const; + + /// @brief get dataSet + std::string getDataSetStr() const; + + /// @brief get begin + std::string getBeginStr() const; + + /// @brief get end + std::string getEndStr() const; + + /// @brief set attribute + std::string getAttributeStr() const; + + /// @} + + /// @name set functions (called by GNEViewNet) + /// @{ + + /// @brief set generic data type + void setGenericDataType(); + + /// @brief set dataSet + void setDataSet(); + + /// @brief update limit by interval + void setInterval(); + + /// @brief set begin + void setBegin(); + + /// @brief set end + void setEnd(); + + /// @brief set attribute + void setAttribute(); + + /// @} + + private: + /// @brief update combo box attributes + void updateComboBoxAttributes(); + + private: + /// @brief pointer to net + GNEViewNet* myViewNet; + + /// @brief flag to enable or disable update interval bar + bool myIntervalBarUpdate; + + /// @brief combo box for generic data types + FXComboBox* myGenericDataTypesComboBox; + + /// @brief combo box for data sets + FXComboBox* myDataSetsComboBox; + + /// @brief checkbox for limit data elements by interval + FXCheckButton* myLimitByIntervalCheckBox; + + /// @brief text field for interval begin + FXTextField* myBeginTextField; + + /// @brief text field for interval end + FXTextField* myEndTextField; + + /// @brief combo box for filtered attributes + FXComboBox* myFilteredAttributesComboBox; + + /// @brief set for attribuets + std::set myFilteredAttributes; + + /// @brief string with wildcard for no generic datas + const FXString myNoGenericDatas; + + /// @brief string with wildcard for all generic datas + const FXString myAllGenericDatas; + + /// @brief string with wildcard for no dataSets + const FXString myNoDataSets; + + /// @brief string with wildcard for all dataSets + const FXString myAllDataSets; + + /// @brief string with wildcard for all attributes + const FXString myAllAttributes; + + private: + /// @brief Invalidated copy constructor. + IntervalBar(const IntervalBar&) = delete; + + /// @brief Invalidated assignment operator. + IntervalBar& operator=(const IntervalBar&) = delete; + }; + /// @brief struct used to group all variables related with movement of single elements struct MoveSingleElementValues { @@ -539,15 +754,6 @@ /// @brief finish moving single elements in Network AND Demand mode void finishMoveSingleElement(); - /// @brief original shape of element before start moving (used by polygons, edges, etc., needed for commmit position changes) - PositionVector originalShapeBeforeMoving; - - /// @brief index moved - int movingIndexShape; - - /// @brief original position of geometry position (needed for commmit position changes) - Position originalPositionInView; - private: /// calculate Poly movement values (Position, Index, etc.) bool calculatePolyValues(); @@ -558,7 +764,7 @@ /// calculate TAZ movement values (Position, Index, etc.) bool calculateTAZValues(); - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief relative position of Clicked Position regarding to originalGeometryPointPosition (Used when user doesn't click exactly over the center of element) @@ -611,7 +817,7 @@ bool isMovingSelection() const; private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief original clicked position when moveSelection is called (used for calculate offset during moveSelection()) @@ -621,13 +827,10 @@ bool myMovingSelection; /// @brief container used for move junctions - std::map myMovedJunctionOriginPositions; - - /// @brief container used for move entire edges - std::map myMovedEdgesOriginShape; + std::vector myMovedJunctions; - /// @brief container used for move GeometryPoints of edges - std::map myMovedEgdesGeometryPoints; + /// @brief container used for move edges + std::set myMovedEdges; }; /// @brief struct used to group all variables related with movement of groups of elements @@ -643,7 +846,7 @@ void hideVehicleOptionsMenuChecks(); private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; @@ -660,7 +863,7 @@ void hideVehicleTypeOptionsMenuChecks(); private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; @@ -708,7 +911,7 @@ /// @brief second corner of the rectangle-selection Position selectionCorner2; - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; @@ -728,16 +931,16 @@ bool isTestingEnabled() const; private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; /// @brief flag to enable or disable testing mode bool myTestingEnabled; - /// @brief Width of viewNet in testing mode + /// @brief Width of net in testing mode int myTestingWidth; - /// @brief Height of viewNet in testing mode + /// @brief Height of net in testing mode int myTestingHeight; }; @@ -771,11 +974,8 @@ /// @brief chekable button for edit mode select MFXCheckableButton* selectButton; - /// @brief chekable button for edit mode move - MFXCheckableButton* moveButton; - private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; @@ -800,6 +1000,9 @@ /// @brief update network checkable buttons void updateNetworkCheckableButtons(); + /// @brief chekable button for edit mode "move network elements" + MFXCheckableButton* moveNetworkElementsButton; + /// @brief chekable button for edit mode create edge MFXCheckableButton* createEdgeButton; @@ -825,7 +1028,7 @@ MFXCheckableButton* prohibitionButton; private: - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; @@ -850,6 +1053,9 @@ /// @brief update Demand checkable buttons void updateDemandCheckableButtons(); + /// @brief chekable button for edit mode "move demand elements" + MFXCheckableButton* moveDemandElementsButton; + /// @brief chekable button for edit mode create routes MFXCheckableButton* routeButton; @@ -872,18 +1078,50 @@ MFXCheckableButton* personPlanButton; private: - /// @brief pointer to viewNet + /// @brief pointer to net + GNEViewNet* myViewNet; + }; + + /// @brief struct used to group all variables related with Data checkable Buttons + struct DataCheckableButtons { + + /// @brief default constructor + DataCheckableButtons(GNEViewNet* viewNet); + + /// @brief build checkable buttons + void buildDataCheckableButtons(); + + /// @brief show all Data Checkable Buttons + void showDataCheckableButtons(); + + /// @brief hide all Data Checkable Buttons + void hideDataCheckableButtons(); + + /// @brief hide all options menu checks + void disableDataCheckableButtons(); + + /// @brief update Data checkable buttons + void updateDataCheckableButtons(); + + /// @brief chekable button for edit mode "edgeData" + MFXCheckableButton* edgeDataButton; + + /// @brief chekable button for edit mode "edgeRelData" + MFXCheckableButton* edgeRelDataButton; + + private: + /// @brief pointer to net GNEViewNet* myViewNet; }; - /// @brief struct used to group all variables related with edit shapes of NetElements + /// @brief struct used to group all variables related with edit shapes of NetworkElements struct EditShapes { /// @brief default constructor EditShapes(GNEViewNet* viewNet); /// @brief start edit custom shape - void startEditCustomShape(GNENetElement* element, const PositionVector& shape, bool fill); + void startEditCustomShape(GNENetworkElement* element, const PositionVector& shape, bool fill); /// @brief edit edit shape void stopEditCustomShape(); @@ -894,18 +1132,14 @@ /// @brief polygon used for edit shapes GNEPoly* editedShapePoly; - /// @brief flag to edit net element shapes - bool editingNetElementShapes; + /// @brief flag to edit network element shapes + bool editingNetworkElementShapes; private: - /// @brief the previous edit mode before edit NetElement's shapes + /// @brief the previous edit mode before edit NetworkElement's shapes NetworkEditMode myPreviousNetworkEditMode; - /// @brief pointer to viewNet + /// @brief pointer to net GNEViewNet* myViewNet; }; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewParent.cpp sumo-1.6.0+dfsg1/src/netedit/GNEViewParent.cpp --- sumo-1.5.0+dfsg1/src/netedit/GNEViewParent.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewParent.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,33 +21,32 @@ // structures than to write everything from scratch. /****************************************************************************/ - -// =========================================================================== -// included 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 @@ -97,8 +96,8 @@ new FXVerticalSeparator(myGripNavigationToolbar, GUIDesignVerticalSeparator); // Create undo/redo buttons - myUndoButton = new FXButton(myGripNavigationToolbar, "\tUndo\tUndo the last Change.", GUIIconSubSys::getIcon(ICON_UNDO), parentWindow, MID_HOTKEY_CTRL_Z_UNDO, GUIDesignButtonToolbar); - myRedoButton = new FXButton(myGripNavigationToolbar, "\tRedo\tRedo the last Change.", GUIIconSubSys::getIcon(ICON_REDO), parentWindow, MID_HOTKEY_CTRL_Y_REDO, GUIDesignButtonToolbar); + myUndoButton = new FXButton(myGripNavigationToolbar, "\tUndo\tUndo the last Change.", GUIIconSubSys::getIcon(GUIIcon::UNDO), parentWindow, MID_HOTKEY_CTRL_Z_UNDO, GUIDesignButtonToolbar); + myRedoButton = new FXButton(myGripNavigationToolbar, "\tRedo\tRedo the last Change.", GUIIconSubSys::getIcon(GUIIcon::REDO), parentWindow, MID_HOTKEY_CTRL_Y_REDO, GUIDesignButtonToolbar); // Create Frame Splitter myFramesSplitter = new FXSplitter(myContentFrame, this, MID_GNE_VIEWPARENT_FRAMEAREAWIDTH, GUIDesignSplitter | SPLITTER_HORIZONTAL); @@ -145,6 +144,8 @@ myFrames.personTypeFrame = new GNEPersonTypeFrame(myFramesArea, viewNet); myFrames.personFrame = new GNEPersonFrame(myFramesArea, viewNet); myFrames.personPlanFrame = new GNEPersonPlanFrame(myFramesArea, viewNet); + myFrames.edgeDataFrame = new GNEEdgeDataFrame(myFramesArea, viewNet); + myFrames.edgeRelDataFrame = new GNEEdgeRelDataFrame(myFramesArea, viewNet); // Update frame areas after creation onCmdUpdateFrameAreaWidth(nullptr, 0, nullptr); @@ -288,6 +289,18 @@ } +GNEEdgeDataFrame* +GNEViewParent::getEdgeDataFrame() const { + return myFrames.edgeDataFrame; +} + + +GNEEdgeRelDataFrame* +GNEViewParent::getEdgeRelDataFrame() const { + return myFrames.edgeRelDataFrame; +} + + void GNEViewParent::showFramesArea() { // show and recalc framesArea if at least there is a frame shown @@ -363,7 +376,7 @@ GNEViewParent::onCmdMakeSnapshot(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Save Snapshot"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("All Image Files (*.gif, *.bmp, *.xpm, *.pcx, *.ico, *.rgb, *.xbm, *.tga, *.png, *.jpg, *.jpeg, *.tif, *.tiff, *.ps, *.eps, *.pdf, *.svg, *.tex, *.pgf)\n" "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n" @@ -419,7 +432,7 @@ for (auto i : junctions) { ACsToLocate.push_back(i); } - myACChoosers.ACChooserJunction = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), "Junction Chooser", ACsToLocate); + myACChoosers.ACChooserJunction = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), "Junction Chooser", ACsToLocate); } break; } @@ -434,7 +447,7 @@ for (auto i : edges) { ACsToLocate.push_back(i); } - myACChoosers.ACChooserEdges = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEEDGE), "Edge Chooser", ACsToLocate); + myACChoosers.ACChooserEdges = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), "Edge Chooser", ACsToLocate); } break; } @@ -444,27 +457,27 @@ myACChoosers.ACChooserVehicles->setFocus(); } else { // reserve memory - ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW).size()); + ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW).size()); // fill ACsToLocate with vehicles - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_VEHICLE)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_VEHICLE)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with vehicles - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_TRIP)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_TRIP)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with routeFlows - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTEFLOW)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTEFLOW)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with routeFlowsFromTo - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_FLOW)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_FLOW)) { ACsToLocate.push_back(i.second); } - myACChoosers.ACChooserVehicles = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), "Vehicle Chooser", ACsToLocate); + myACChoosers.ACChooserVehicles = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), "Vehicle Chooser", ACsToLocate); } break; } @@ -474,17 +487,17 @@ myACChoosers.ACChooserPersons->setFocus(); } else { // reserve memory - ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW).size()); + ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW).size()); // fill ACsToLocate with persons - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSON)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSON)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with personFlows - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_PERSONFLOW)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_PERSONFLOW)) { ACsToLocate.push_back(i.second); } - myACChoosers.ACChooserPersons = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEPERSON), "Person Chooser", ACsToLocate); + myACChoosers.ACChooserPersons = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), "Person Chooser", ACsToLocate); } break; } @@ -494,12 +507,12 @@ myACChoosers.ACChooserRoutes->setFocus(); } else { // reserve memory - ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE).size()); + ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE).size()); // fill ACsToLocate with routes - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_ROUTE)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_ROUTE)) { ACsToLocate.push_back(i.second); } - myACChoosers.ACChooserRoutes = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEROUTE), "Route Chooser", ACsToLocate); + myACChoosers.ACChooserRoutes = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEROUTE), "Route Chooser", ACsToLocate); } break; } @@ -509,32 +522,32 @@ myACChoosers.ACChooserStops->setFocus(); } else { // reserve memory - ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION).size() + - viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA).size()); + ACsToLocate.reserve(viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_LANE).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_BUSSTOP).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CONTAINERSTOP).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CHARGINGSTATION).size() + + viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_PARKINGAREA).size()); // fill ACsToLocate with stop over lanes - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_LANE)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_LANE)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with stop over busstops - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_BUSSTOP)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_BUSSTOP)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with stop over container stops - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CONTAINERSTOP)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CONTAINERSTOP)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with stop over charging stations - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_CHARGINGSTATION)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_CHARGINGSTATION)) { ACsToLocate.push_back(i.second); } // fill ACsToLocate with stop over parking areas - for (const auto& i : viewNet->getNet()->getAttributeCarriers().demandElements.at(SUMO_TAG_STOP_PARKINGAREA)) { + for (const auto& i : viewNet->getNet()->getAttributeCarriers()->getDemandElements().at(SUMO_TAG_STOP_PARKINGAREA)) { ACsToLocate.push_back(i.second); } - myACChoosers.ACChooserStops = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATESTOP), "Stop Chooser", ACsToLocate); + myACChoosers.ACChooserStops = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATESTOP), "Stop Chooser", ACsToLocate); } break; } @@ -551,7 +564,7 @@ ACsToLocate.push_back(i); } } - myACChoosers.ACChooserTLS = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATETLS), "TLS Chooser", ACsToLocate); + myACChoosers.ACChooserTLS = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), "TLS Chooser", ACsToLocate); } break; } @@ -561,12 +574,12 @@ myACChoosers.ACChooserAdditional->setFocus(); } else { // fill ACsToLocate with additionals - std::vector additionals = viewNet->getNet()->retrieveAdditionals(); - ACsToLocate.reserve(additionals.size()); - for (auto i : additionals) { - ACsToLocate.push_back(i); + for (const auto& additionalTag : viewNet->getNet()->getAttributeCarriers()->getAdditionals()) { + for (const auto& additional : additionalTag.second) { + ACsToLocate.push_back(additional.second); + } } - myACChoosers.ACChooserAdditional = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEADD), "Additional Chooser", ACsToLocate); + myACChoosers.ACChooserAdditional = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), "Additional Chooser", ACsToLocate); } break; } @@ -576,10 +589,13 @@ myACChoosers.ACChooserPOI->setFocus(); } else { // fill ACsToLocate with POIs - for (auto i : viewNet->getNet()->getPOIs()) { - ACsToLocate.push_back(dynamic_cast(i.second)); + for (const auto& POI : viewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POI)) { + ACsToLocate.push_back(POI.second); + } + for (const auto& POILane : viewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POILANE)) { + ACsToLocate.push_back(POILane.second); } - myACChoosers.ACChooserPOI = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEPOI), "POI Chooser", ACsToLocate); + myACChoosers.ACChooserPOI = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), "POI Chooser", ACsToLocate); } break; } @@ -589,10 +605,10 @@ myACChoosers.ACChooserPolygon->setFocus(); } else { // fill ACsToLocate with polys - for (auto i : viewNet->getNet()->getPolygons()) { - ACsToLocate.push_back(dynamic_cast(i.second)); + for (const auto& polygon : viewNet->getNet()->getAttributeCarriers()->getShapes().at(SUMO_TAG_POLY)) { + ACsToLocate.push_back(polygon.second); } - myACChoosers.ACChooserPolygon = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(ICON_LOCATEPOLY), "Poly Chooser", ACsToLocate); + myACChoosers.ACChooserPolygon = new GNEDialogACChooser(this, GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), "Poly Chooser", ACsToLocate); } break; } @@ -651,7 +667,9 @@ stopFrame(nullptr), personFrame(nullptr), personTypeFrame(nullptr), - personPlanFrame(nullptr) { + personPlanFrame(nullptr), + edgeDataFrame(nullptr), + edgeRelDataFrame(nullptr) { } @@ -677,6 +695,8 @@ personTypeFrame->hide(); personFrame->hide(); personPlanFrame->hide(); + edgeDataFrame->hide(); + edgeRelDataFrame->hide(); } @@ -703,6 +723,8 @@ personTypeFrame->setFrameWidth(frameWidth); personFrame->setFrameWidth(frameWidth); personPlanFrame->setFrameWidth(frameWidth); + edgeDataFrame->setFrameWidth(frameWidth); + edgeRelDataFrame->setFrameWidth(frameWidth); } @@ -747,6 +769,10 @@ return true; } else if (personPlanFrame->shown()) { return true; + } else if (edgeDataFrame->shown()) { + return true; + } else if (edgeRelDataFrame->shown()) { + return true; } else { return false; } @@ -794,6 +820,10 @@ return personFrame; } else if (personPlanFrame->shown()) { return personPlanFrame; + } else if (edgeDataFrame->shown()) { + return edgeDataFrame; + } else if (edgeRelDataFrame->shown()) { + return edgeRelDataFrame; } else { return nullptr; } @@ -855,5 +885,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/GNEViewParent.h sumo-1.6.0+dfsg1/src/netedit/GNEViewParent.h --- sumo-1.5.0+dfsg1/src/netedit/GNEViewParent.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/GNEViewParent.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ // While we don't actually need MDI for netedit it is easier to adapt existing // structures than to write everything from scratch. /****************************************************************************/ -#ifndef GNEViewParent_h -#define GNEViewParent_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -35,29 +29,37 @@ // =========================================================================== // class declarations // =========================================================================== -class GNEAdditionalFrame; + class GNEApplicationWindow; +class GNEDialogACChooser; +class GNEFrame; +class GNENet; +class GNEUndoList; +// common frames +class GNEDeleteFrame; +class GNEInspectorFrame; +class GNESelectorFrame; +// network frames +class GNEAdditionalFrame; class GNEConnectorFrame; class GNECreateEdgeFrame; class GNECrossingFrame; -class GNEDeleteFrame; -class GNEDialogACChooser; -class GNEInspectorFrame; -class GNENet; -class GNEFrame; class GNEPolygonFrame; class GNEProhibitionFrame; -class GNERouteFrame; -class GNESelectorFrame; class GNETAZFrame; class GNETLSEditorFrame; -class GNEUndoList; -class GNEVehicleFrame; -class GNEVehicleTypeFrame; -class GNEStopFrame; -class GNEPersonTypeFrame; +// demand frames class GNEPersonFrame; class GNEPersonPlanFrame; +class GNEPersonTypeFrame; +class GNERouteFrame; +class GNEStopFrame; +class GNEVehicleFrame; +class GNEVehicleTypeFrame; +// data frames +class GNEEdgeDataFrame; +class GNEEdgeRelDataFrame; + // =========================================================================== // class declarations @@ -107,60 +109,66 @@ /// @brief get current frame (note: it can be null) GNEFrame* getCurrentShownFrame() const; - /// @brief get frame for GNE_NMODE_INSPECT + /// @brief get frame for NETWORK_INSPECT GNEInspectorFrame* getInspectorFrame() const; - /// @brief get frame for GNE_NMODE_SELECT + /// @brief get frame for NETWORK_SELECT GNESelectorFrame* getSelectorFrame() const; - /// @brief get frame for GNE_NMODE_CONNECT + /// @brief get frame for NETWORK_CONNECT GNEConnectorFrame* getConnectorFrame() const; - /// @brief get frame for GNE_NMODE_TLS + /// @brief get frame for NETWORK_TLS GNETLSEditorFrame* getTLSEditorFrame() const; - /// @brief get frame for GNE_NMODE_ADDITIONAL + /// @brief get frame for NETWORK_ADDITIONAL GNEAdditionalFrame* getAdditionalFrame() const; - /// @brief get frame for GNE_NMODE_CROSSING + /// @brief get frame for NETWORK_CROSSING GNECrossingFrame* getCrossingFrame() const; - /// @brief get frame for GNE_NMODE_TAZ + /// @brief get frame for NETWORK_TAZ GNETAZFrame* getTAZFrame() const; - /// @brief get frame for GNE_NMODE_DELETE + /// @brief get frame for NETWORK_DELETE GNEDeleteFrame* getDeleteFrame() const; - /// @brief get frame for GNE_NMODE_POLYGON + /// @brief get frame for NETWORK_POLYGON GNEPolygonFrame* getPolygonFrame() const; - /// @brief get frame for GNE_NMODE_PROHIBITION + /// @brief get frame for NETWORK_PROHIBITION GNEProhibitionFrame* getProhibitionFrame() const; - /// @brief get frame for GNE_NMODE_CREATEEDGE + /// @brief get frame for NETWORK_CREATEEDGE GNECreateEdgeFrame* getCreateEdgeFrame() const; - /// @brief get frame for GNE_DMODE_ROUTE + /// @brief get frame for DEMAND_ROUTE GNERouteFrame* getRouteFrame() const; - /// @brief get frame for GNE_DMODE_VEHICLE + /// @brief get frame for DEMAND_VEHICLE GNEVehicleFrame* getVehicleFrame() const; - /// @brief get frame for GNE_DMODE_VEHICLETYPE + /// @brief get frame for DEMAND_VEHICLETYPE GNEVehicleTypeFrame* getVehicleTypeFrame() const; - /// @brief get frame for GNE_DMODE_STOP + /// @brief get frame for DEMAND_STOP GNEStopFrame* getStopFrame() const; - /// @brief get frame for GNE_DMODE_PERSONTYPE + /// @brief get frame for DEMAND_PERSONTYPE GNEPersonTypeFrame* getPersonTypeFrame() const; - /// @brief get frame for GNE_DMODE_PERSON + /// @brief get frame for DEMAND_PERSON GNEPersonFrame* getPersonFrame() const; - /// @brief get frame for GNE_DMODE_PERSONFRAME + /// @brief get frame for DEMAND_PERSONFRAME GNEPersonPlanFrame* getPersonPlanFrame() const; + /// @brief get frame for DATA_EDGEDATA + GNEEdgeDataFrame* getEdgeDataFrame() const; + + /// @brief get frame for DATA_EDGERELDATA + GNEEdgeRelDataFrame* getEdgeRelDataFrame() const; + /// @brief show frames area if at least a GNEFrame is showed /// @note this function is called in GNEFrame::Show(); void showFramesArea(); @@ -223,59 +231,65 @@ /// @brief get current frame show GNEFrame* getCurrentShownFrame() const; - /// @brief frame for GNE_NMODE_INSPECT + /// @brief frame for NETWORK_INSPECT GNEInspectorFrame* inspectorFrame; - /// @brief frame for GNE_NMODE_SELECT + /// @brief frame for NETWORK_SELECT GNESelectorFrame* selectorFrame; - /// @brief frame for GNE_NMODE_CONNECT + /// @brief frame for NETWORK_CONNECT GNEConnectorFrame* connectorFrame; - /// @brief frame for GNE_NMODE_TLS + /// @brief frame for NETWORK_TLS GNETLSEditorFrame* TLSEditorFrame; - /// @brief frame for GNE_NMODE_ADDITIONAL + /// @brief frame for NETWORK_ADDITIONAL GNEAdditionalFrame* additionalFrame; - /// @brief frame for GNE_NMODE_CROSSING + /// @brief frame for NETWORK_CROSSING GNECrossingFrame* crossingFrame; - /// @brief frame for GNE_NMODE_TAZ + /// @brief frame for NETWORK_TAZ GNETAZFrame* TAZFrame; - /// @brief frame for GNE_NMODE_DELETE + /// @brief frame for NETWORK_DELETE GNEDeleteFrame* deleteFrame; - /// @brief frame for GNE_NMODE_POLYGON + /// @brief frame for NETWORK_POLYGON GNEPolygonFrame* polygonFrame; - /// @brief frame for GNE_NMODE_PROHIBITION + /// @brief frame for NETWORK_PROHIBITION GNEProhibitionFrame* prohibitionFrame; - /// @brief frame for GNE_NMODE_CREATEDGE + /// @brief frame for NETWORK_CREATEDGE GNECreateEdgeFrame* createEdgeFrame; - /// @brief frame for GNE_DMODE_ROUTE + /// @brief frame for DEMAND_ROUTE GNERouteFrame* routeFrame; - /// @brief frame for GNE_DMODE_VEHICLE + /// @brief frame for DEMAND_VEHICLE GNEVehicleFrame* vehicleFrame; - /// @brief frame for GNE_DMODE_VEHICLETYPE + /// @brief frame for DEMAND_VEHICLETYPE GNEVehicleTypeFrame* vehicleTypeFrame; - /// @brief frame for GNE_DMODE_STOP + /// @brief frame for DEMAND_STOP GNEStopFrame* stopFrame; - /// @brief frame for GNE_DMODE_PERSON + /// @brief frame for DEMAND_PERSON GNEPersonFrame* personFrame; - /// @brief frame for GNE_DMODE_PERSONTYPE + /// @brief frame for DEMAND_PERSONTYPE GNEPersonTypeFrame* personTypeFrame; - /// @brief frame for GNE_DMODE_PERSONPLAN + /// @brief frame for DEMAND_PERSONPLAN GNEPersonPlanFrame* personPlanFrame; + + /// @brief frame for DATA_EDGEDATA + GNEEdgeDataFrame* edgeDataFrame; + + /// @brief frame for DATA_EDGERELDATA + GNEEdgeRelDataFrame* edgeRelDataFrame; }; /// @brief struct for ACChoosers dialog @@ -344,8 +358,3 @@ /// @brief struct for ACChoosers ACChoosers myACChoosers; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netedit_main.cpp sumo-1.6.0+dfsg1/src/netedit/netedit_main.cpp --- sumo-1.5.0+dfsg1/src/netedit/netedit_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netedit_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Main for NETEDIT (adapted from guisim_main) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -112,6 +107,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/CMakeLists.txt sumo-1.6.0+dfsg1/src/netedit/netelements/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netedit/netelements/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -set(netedit_netelements_SRCS - GNENetElement.h - GNENetElement.cpp - GNEEdge.h - GNEEdge.cpp - GNELane.h - GNELane.cpp - GNEInternalLane.h - GNEInternalLane.cpp - GNEConnection.h - GNEConnection.cpp - GNECrossing.h - GNECrossing.cpp - GNEJunction.h - GNEJunction.cpp - GNEProhibition.h - GNEProhibition.cpp - ) - -add_library(netedit_netelements STATIC ${netedit_netelements_SRCS}) -set_property(TARGET netedit_netelements PROPERTY PROJECT_LABEL "z_netedit_netelements") \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEConnection.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNEConnection.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEConnection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEConnection.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,678 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEConnection.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A class for visualizing connections between lanes -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEConnection.h" -#include "GNEJunction.h" -#include "GNEEdge.h" -#include "GNELane.h" -#include "GNEInternalLane.h" - - -// =========================================================================== -// static member definitions -// =========================================================================== -int NUM_POINTS = 5; - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEConnection::GNEConnection(GNELane* from, GNELane* to) : - GNENetElement(from->getNet(), "from" + from->getMicrosimID() + "to" + to->getMicrosimID(), - GLO_CONNECTION, SUMO_TAG_CONNECTION), - myFromLane(from), - myToLane(to), - myLinkState(LINKSTATE_TL_OFF_NOSIGNAL), - mySpecialColor(nullptr), - myShapeDeprecated(true) { -} - - -GNEConnection::~GNEConnection() { -} - - -std::string -GNEConnection::generateChildID(SumoXMLTag /*childTag*/) { - // currently unused - return ""; -} - - -const PositionVector& -GNEConnection::getConnectionShape() const { - if (myConnectionGeometry.getShape().size() > 0) { - return myConnectionGeometry.getShape(); - } else { - return getNBEdgeConnection().customShape; - } -} - - -void -GNEConnection::updateGeometry() { - // Get shape of from and to lanes - NBEdge::Connection& nbCon = getNBEdgeConnection(); - if (myShapeDeprecated) { - // obtain lane shape from - PositionVector laneShapeFrom; - if ((int)getEdgeFrom()->getNBEdge()->getLanes().size() > nbCon.fromLane) { - laneShapeFrom = getEdgeFrom()->getNBEdge()->getLanes().at(nbCon.fromLane).shape; - } else { - return; - } - // obtain lane shape to - PositionVector laneShapeTo; - if ((int)nbCon.toEdge->getLanes().size() > nbCon.toLane) { - laneShapeTo = nbCon.toEdge->getLanes().at(nbCon.toLane).shape; - } else { - return; - } - // Calculate shape of connection depending of the size of Junction shape - // value obtanied from GNEJunction::drawgl - if (nbCon.customShape.size() != 0) { - myConnectionGeometry.updateGeometry(nbCon.customShape); - } else if (getEdgeFrom()->getNBEdge()->getToNode()->getShape().area() > 4) { - if (nbCon.shape.size() != 0) { - PositionVector connectionShape = nbCon.shape; - // only append via shape if it exists - if (nbCon.haveVia) { - connectionShape.append(nbCon.viaShape); - } - myConnectionGeometry.updateGeometry(connectionShape); - } else { - // Calculate shape so something can be drawn immidiately - myConnectionGeometry.updateGeometry(getEdgeFrom()->getNBEdge()->getToNode()->computeSmoothShape( - laneShapeFrom, laneShapeTo, NUM_POINTS, - getEdgeFrom()->getNBEdge()->getTurnDestination() == nbCon.toEdge, - (double) 5. * (double) getEdgeFrom()->getNBEdge()->getNumLanes(), - (double) 5. * (double) nbCon.toEdge->getNumLanes())); - } - } else { - myConnectionGeometry.updateGeometry({laneShapeFrom.positionAtOffset(MAX2(0.0, laneShapeFrom.length() - 1)), - laneShapeTo.positionAtOffset(MIN2(1.0, laneShapeFrom.length()))}); - } - // check if internal junction marker must be calculated - if (nbCon.haveVia && (nbCon.shape.size() != 0)) { - // create marker for interal junction waiting position (contPos) - const double orthoLength = 0.5; - Position pos = nbCon.shape.back(); - myInternalJunctionMarker = nbCon.shape.getOrthogonal(pos, 10, true, 0.1); - if (myInternalJunctionMarker.length() < orthoLength) { - myInternalJunctionMarker.extrapolate(orthoLength - myInternalJunctionMarker.length()); - } - } else { - myInternalJunctionMarker.clear(); - } - // mark connection as non-deprecated - myShapeDeprecated = false; - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); - } -} - - -Position -GNEConnection::getPositionInView() const { - // currently unused - return Position(0, 0); -} - - -Boundary -GNEConnection::getBoundary() const { - if (myConnectionGeometry.getShape().size() == 0) { - // we need to use the center of junction parent as boundary if shape is empty - Position junctionParentPosition = myFromLane->getParentEdge()->getGNEJunctionDestiny()->getPositionInView(); - return Boundary(junctionParentPosition.x() - 0.1, junctionParentPosition.y() - 0.1, - junctionParentPosition.x() + 0.1, junctionParentPosition.x() + 0.1); - } else { - return myConnectionGeometry.getShape().getBoxBoundary(); - } -} - - -GNEEdge* -GNEConnection::getEdgeFrom() const { - return myFromLane->getParentEdge(); -} - - -GNEEdge* -GNEConnection::getEdgeTo() const { - return myToLane->getParentEdge(); -} - - -GNELane* -GNEConnection::getLaneFrom() const { - return myFromLane; -} - - -GNELane* -GNEConnection::getLaneTo() const { - return myToLane; -} - - -int -GNEConnection::getFromLaneIndex() const { - return myFromLane->getIndex(); -} - - -int -GNEConnection::getToLaneIndex() const { - return myToLane->getIndex(); -} - - -NBEdge::Connection& -GNEConnection::getNBEdgeConnection() const { - return getEdgeFrom()->getNBEdge()->getConnectionRef(getFromLaneIndex(), getEdgeTo()->getNBEdge(), getToLaneIndex()); -} - - -NBConnection -GNEConnection::getNBConnection() const { - const NBEdge::Connection& c = getNBEdgeConnection(); - return NBConnection(getEdgeFrom()->getNBEdge(), getFromLaneIndex(), - getEdgeTo()->getNBEdge(), getToLaneIndex(), - (int)c.tlLinkIndex, (int)c.tlLinkIndex2); -} - - -void -GNEConnection::updateID() { - setMicrosimID(myFromLane->getMicrosimID() + " -> " + myToLane->getMicrosimID()); -} - - -LinkState -GNEConnection::getLinkState() const { - return myLinkState; -} - - -void -GNEConnection::markConnectionGeometryDeprecated() { - myShapeDeprecated = true; -} - - -void -GNEConnection::updateLinkState() { - NBEdge::Connection& nbCon = getNBEdgeConnection(); - myLinkState = getEdgeFrom()->getNBEdge()->getToNode()->getLinkState(getEdgeFrom()->getNBEdge(), - nbCon.toEdge, - nbCon.fromLane, - nbCon.toLane, - nbCon.mayDefinitelyPass, - nbCon.tlID); -} - - -GUIGLObjectPopupMenu* -GNEConnection::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // build position copy entry - buildPositionCopyEntry(ret, false); - // check if we're in supermode network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // create menu commands - FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom connection shape", nullptr, &parent, MID_GNE_CONNECTION_EDIT_SHAPE); - // check if menu commands has to be disabled - NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; - // check if we're in the correct edit mode - if ((editMode == GNE_NMODE_CONNECT) || (editMode == GNE_NMODE_TLS) || (editMode == GNE_NMODE_CREATE_EDGE)) { - mcCustomShape->disable(); - } - } - return ret; -} - - -Boundary -GNEConnection::getCenteringBoundary() const { - Boundary b = getBoundary(); - b.grow(20); - return b; -} - - -void -GNEConnection::drawGL(const GUIVisualizationSettings& s) const { - // declare a flag to check if shape has to be draw - bool drawConnection = true; - if ((myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) && - s.drawDetail(s.detailSettings.connectionsDemandMode, s.addSize.getExaggeration(s, this))) { - drawConnection = !myShapeDeprecated; - } else if ((myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) && - myNet->getViewNet()->getNetworkViewOptions().showConnections()) { - drawConnection = !myShapeDeprecated; - } else { - drawConnection = false; - } - // Check if connection must be drawed - if (drawConnection) { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getBoundary()); - } - // Push draw matrix 1 - glPushMatrix(); - // Push name - glPushName(getGlID()); - // Traslate matrix - glTranslated(0, 0, GLO_JUNCTION + 0.1); // must draw on top of junction - // Set color - if (drawUsingSelectColor()) { - // override with special colors (unless the color scheme is based on selection) - GLHelper::setColor(s.colorSettings.selectedConnectionColor); - } else if (mySpecialColor != nullptr) { - GLHelper::setColor(*mySpecialColor); - } else { - // Set color depending of the link state - GLHelper::setColor(GNEInternalLane::colorForLinksState(getLinkState())); - } - // draw connection checking whether it is not too small if isn't being drawn for selecting - const double selectionScale = isAttributeCarrierSelected() ? s.selectionScale : 1; - if ((s.scale * selectionScale < 5.) && !s.drawForRectangleSelection) { - // If it's small, draw a simple line - GLHelper::drawLine(myConnectionGeometry.getShape()); - } else { - // draw a list of lines - const bool spreadSuperposed = s.scale >= 1 && s.spreadSuperposed && myFromLane->drawAsRailway(s) && getEdgeFrom()->getNBEdge()->isBidiRail(); - PositionVector shapeSuperposed = myConnectionGeometry.getShape(); - if (spreadSuperposed) { - shapeSuperposed.move2side(0.5); - } - GLHelper::drawBoxLines(shapeSuperposed, myConnectionGeometry.getShapeRotations(), myConnectionGeometry.getShapeLengths(), 0.2 * selectionScale); - glTranslated(0, 0, 0.1); - GLHelper::setColor(GLHelper::getColor().changedBrightness(51)); - // check if internal junction marker has to be drawn - if (myInternalJunctionMarker.size() > 0) { - GLHelper::drawLine(myInternalJunctionMarker); - } - // check if dotted contour has to be drawn (not useful at high zoom) - if (myNet->getViewNet()->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), 1, myDottedGeometry); - } - } - // Pop draw matrix 1 - glPopMatrix(); - - if (s.edgeValue.show) { - NBEdge::Connection& nbCon = getNBEdgeConnection(); - std::string value = nbCon.getParameter(s.edgeParam, ""); - if (value != "") { - int shapeIndex = (int)myConnectionGeometry.getShape().size() / 2; - Position p = (myConnectionGeometry.getShape().size() == 2 - ? (myConnectionGeometry.getShape().front() * 0.67 + myConnectionGeometry.getShape().back() * 0.33) - : myConnectionGeometry.getShape()[shapeIndex]); - GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, 0); - } - } - - // Pop name - glPopName(); - } -} - - -void -GNEConnection::setSpecialColor(const RGBColor* color) { - mySpecialColor = color; -} - -std::string -GNEConnection::getAttribute(SumoXMLAttr key) const { - if (key == SUMO_ATTR_ID) { - // used by GNEReferenceCounter - // @note: may be called for connections without a valid nbCon reference - return getMicrosimID(); - } - NBEdge::Connection& nbCon = getNBEdgeConnection(); - switch (key) { - case SUMO_ATTR_FROM: - return getEdgeFrom()->getID(); - case SUMO_ATTR_TO: - return nbCon.toEdge->getID(); - case SUMO_ATTR_FROM_LANE: - return toString(nbCon.toLane); - case SUMO_ATTR_TO_LANE: - return toString(nbCon.toLane); - case SUMO_ATTR_PASS: - return toString(nbCon.mayDefinitelyPass); - case SUMO_ATTR_KEEP_CLEAR: - return toString(nbCon.keepClear); - case SUMO_ATTR_CONTPOS: - return toString(nbCon.contPos); - case SUMO_ATTR_UNCONTROLLED: - return toString(nbCon.uncontrolled); - case SUMO_ATTR_VISIBILITY_DISTANCE: - return toString(nbCon.visibility); - case SUMO_ATTR_TLLINKINDEX: - return toString(nbCon.tlLinkIndex); - case SUMO_ATTR_TLLINKINDEX2: - return toString(nbCon.tlLinkIndex2); - case SUMO_ATTR_ALLOW: - if (nbCon.permissions == SVC_UNSPECIFIED) { - return getVehicleClassNames(nbCon.toEdge->getLanes()[nbCon.toLane].permissions); - } else { - return getVehicleClassNames(nbCon.permissions); - } - case SUMO_ATTR_DISALLOW: - if (nbCon.permissions == SVC_UNSPECIFIED) { - return getVehicleClassNames(invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions)); - } else { - return getVehicleClassNames(invertPermissions(nbCon.permissions)); - } - case SUMO_ATTR_SPEED: - return toString(nbCon.speed); - case SUMO_ATTR_DIR: - return toString(getEdgeFrom()->getNBEdge()->getToNode()->getDirection( - getEdgeFrom()->getNBEdge(), nbCon.toEdge, OptionsCont::getOptions().getBool("lefthand"))); - case SUMO_ATTR_STATE: - return toString(getEdgeFrom()->getNBEdge()->getToNode()->getLinkState( - getEdgeFrom()->getNBEdge(), nbCon.toEdge, nbCon.fromLane, nbCon.toLane, nbCon.mayDefinitelyPass, nbCon.tlID)); - case SUMO_ATTR_CUSTOMSHAPE: - return toString(nbCon.customShape); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return nbCon.getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - const NBEdge::Connection& c = getNBEdgeConnection(); - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_FROM_LANE: - case SUMO_ATTR_TO_LANE: - case SUMO_ATTR_PASS: - case SUMO_ATTR_KEEP_CLEAR: - case SUMO_ATTR_CONTPOS: - case SUMO_ATTR_UNCONTROLLED: - case SUMO_ATTR_VISIBILITY_DISTANCE: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - case SUMO_ATTR_SPEED: - case SUMO_ATTR_CUSTOMSHAPE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - // no special handling - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - case SUMO_ATTR_TLLINKINDEX: - if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) { - changeTLIndex(key, parse(value), c.tlLinkIndex2, undoList); - } - break; - case SUMO_ATTR_TLLINKINDEX2: - if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) { - changeTLIndex(key, c.tlLinkIndex, parse(value), undoList); - } - break; - case SUMO_ATTR_DIR: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - case SUMO_ATTR_STATE: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEConnection::changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList) { - // trigger GNEChange_TLS - undoList->p_begin("change tls linkIndex for connection"); - // make a copy - std::set defs = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS(); - for (NBTrafficLightDefinition* tlDef : defs) { - NBLoadedSUMOTLDef* sumoDef = dynamic_cast(tlDef); - NBTrafficLightLogic* tllogic = sumoDef ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions()); - if (tllogic != nullptr) { - NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(tlDef, tllogic); - newDef->addConnection(getEdgeFrom()->getNBEdge(), getEdgeTo()->getNBEdge(), - getLaneFrom()->getIndex(), getLaneTo()->getIndex(), tlIndex, tlIndex2, false); - // iterate over NBNodes - for (NBNode* node : tlDef->getNodes()) { - GNEJunction* junction = getNet()->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(junction, tlDef, false), true); - undoList->add(new GNEChange_TLS(junction, newDef, true), true); - } - } else { - WRITE_ERROR("Could not set attribute '" + toString(key) + "' (tls is broken)"); - } - } - undoList->p_end(); -} - -bool -GNEConnection::isValid(SumoXMLAttr key, const std::string& value) { - // Currently ignored before implementation to avoid warnings - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_FROM_LANE: - case SUMO_ATTR_TO_LANE: - return false; - case SUMO_ATTR_PASS: - return canParse(value); - case SUMO_ATTR_KEEP_CLEAR: - return canParse(value); - case SUMO_ATTR_CONTPOS: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_UNCONTROLLED: - return canParse(value); - case SUMO_ATTR_VISIBILITY_DISTANCE: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && - (getNBEdgeConnection().uncontrolled == false) && - (getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) && - canParse(value) && - (parse(value) >= 0 || parse(value) == -1)) { - // obtan Traffic light definition - NBTrafficLightDefinition* def = *getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().begin(); - return def->getMaxValidIndex() >= parse(value); - } else { - return false; - } - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - return canParseVehicleClasses(value); - case SUMO_ATTR_SPEED: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_CUSTOMSHAPE: { - // empty custom shapes are allowed - return canParse(value); - } - case SUMO_ATTR_STATE: - return false; - case SUMO_ATTR_DIR: - return false; - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEConnection::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_FROM: - case SUMO_ATTR_TO: - case SUMO_ATTR_FROM_LANE: - case SUMO_ATTR_TO_LANE: - case SUMO_ATTR_DIR: - case SUMO_ATTR_STATE: - // this attributes cannot be edited - return false; - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - // get Traffic Light definitions - if (getEdgeFrom()->getNBEdge()->getToNode()->isTLControlled()) { - NBTrafficLightDefinition* tlDef = *getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().begin(); - NBLoadedSUMOTLDef* sumoDef = dynamic_cast(tlDef); - NBTrafficLightLogic* tllogic = sumoDef != nullptr ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions()); - if (tllogic != nullptr) { - return true; - } else { - return false; - } - } - return false; - default: - return true; - } -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value) { - NBEdge::Connection& nbCon = getNBEdgeConnection(); - switch (key) { - case SUMO_ATTR_PASS: - nbCon.mayDefinitelyPass = parse(value); - break; - case SUMO_ATTR_KEEP_CLEAR: - nbCon.keepClear = parse(value); - break; - case SUMO_ATTR_UNCONTROLLED: - nbCon.uncontrolled = parse(value); - break; - case SUMO_ATTR_CONTPOS: - nbCon.contPos = parse(value); - break; - case SUMO_ATTR_VISIBILITY_DISTANCE: - nbCon.visibility = parse(value); - break; - case SUMO_ATTR_SPEED: - nbCon.speed = parse(value); - break; - case SUMO_ATTR_ALLOW: { - const SVCPermissions successorAllows = nbCon.toEdge->getLanes()[nbCon.toLane].permissions; - SVCPermissions customPermissions = parseVehicleClasses(value); - if (successorAllows != customPermissions) { - nbCon.permissions = customPermissions; - } - break; - } - case SUMO_ATTR_DISALLOW: { - const SVCPermissions successorDisallows = invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions); - SVCPermissions customPermissions = invertPermissions(parseVehicleClasses(value)); - if (successorDisallows != customPermissions) { - nbCon.permissions = customPermissions; - } - break; - } - case SUMO_ATTR_STATE: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - case SUMO_ATTR_DIR: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - case SUMO_ATTR_CUSTOMSHAPE: { - nbCon.customShape = parse(value); - break; - } - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - nbCon.setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } - // Update Geometry after setting a new attribute (but avoided for certain attributes) - if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) { - markConnectionGeometryDeprecated(); - updateGeometry(); - } -} - - -void -GNEConnection::updateDottedContour() { - // build contour using connection geometry - PositionVector contourFront = myConnectionGeometry.getShape(); - PositionVector contourback = contourFront; - // move both 0.25 to side - contourFront.move2side(0.25); - contourback.move2side(-0.25); - // reverse contourback - contourback = contourback.reverse(); - // add contour back to contourfront - for (const auto& position : contourback) { - contourFront.push_back(position); - } - // close contour front - contourFront.closePolygon(); - // set as dotted contour - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), contourFront); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEConnection.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNEConnection.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEConnection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEConnection.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,209 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2016-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEConnection.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A class for represent connections between Lanes -/****************************************************************************/ -#ifndef GNEConnection_h -#define GNEConnection_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNENetElement.h" - -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GNEEdge; - - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNEConnection : public GNENetElement { -public: - /** Constructor - * @param[in] from The edge the vehicles leave - * @param[in] connection NBEdge::Connection in which the rest of parameters are defined - * @param[in] uncontrolled if set to true, This connection will not be TLS-controlled despite its node being controlled. - **/ - GNEConnection(GNELane* from, GNELane* to); - - /// @brief Destructor - ~GNEConnection(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name Functions related with geometry of element - /// @{ - /// @brief get connection shape - const PositionVector& getConnectionShape() const; - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of hierarchical element in view - Position getPositionInView() const; - - /// @} - - /// Returns the street's geometry - Boundary getBoundary() const; - - /// @brief get the name of the edge the vehicles leave - GNEEdge* getEdgeFrom() const; - - /// @brief get the name of the edge the vehicles may reach when leaving "from" - GNEEdge* getEdgeTo() const; - - /// @briefthe get lane of the incoming lane - GNELane* getLaneFrom() const; - - /// @briefthe get lane of the outgoing lane - GNELane* getLaneTo() const; - - /// @briefthe get lane index of the incoming lane - int getFromLaneIndex() const; - - /// @briefthe get lane index of the outgoing lane - int getToLaneIndex() const; - - /// @brief get Edge::Connection - NBEdge::Connection& getNBEdgeConnection() const; - - /// @brief get NBConnection - NBConnection getNBConnection() const; - - /// @brief get LinkState - LinkState getLinkState() const; - - /// @brief check that connection's Geometry has to be updated - void markConnectionGeometryDeprecated(); - - /// @brief update internal ID of Connection - void updateID(); - - /// @brief recompute cached myLinkState - void updateLinkState(); - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@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 Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - void drawGL(const GUIVisualizationSettings& s) const; - /// @} - - /* @brief method for setting the special color of the connection - * @param[in] color Pointer to new special color - */ - void setSpecialColor(const RGBColor* Color2); - - /// @name 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 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 checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - -protected: - /// @brief incoming lane of this connection - GNELane* myFromLane; - - /// @brief outgoing lane of this connection - GNELane* myToLane; - - /// @brief Linkstate. @note cached because after 'undo' the connection needs to be drawn while the node logic (NBRequest) has not been recomputed - LinkState myLinkState; - - /// @brief optional special color - const RGBColor* mySpecialColor; - - /// @brief connection geometry - GNEGeometry::Geometry myConnectionGeometry; - - /// @brief flag to indicate that connection's shape has to be updated - bool myShapeDeprecated; - - /// @brief waiting position for internal junction - PositionVector myInternalJunctionMarker; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief manage change of tlLinkindices - void changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList); - - /// @brief Invalidated copy constructor. - GNEConnection(const GNEConnection&) = delete; - - /// @brief Invalidated assignment operator. - GNEConnection& operator=(const GNEConnection&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNECrossing.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNECrossing.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNECrossing.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNECrossing.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,495 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECrossing.cpp -/// @author Jakob Erdmann -/// @date June 2011 -/// -// A class for visualizing Inner Lanes (used when editing traffic lights) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNECrossing.h" -#include "GNEJunction.h" -#include "GNEEdge.h" - - -// =========================================================================== -// method definitions -// =========================================================================== -GNECrossing::GNECrossing(GNEJunction* parentJunction, std::vector crossingEdges) : - GNENetElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, GLO_CROSSING, SUMO_TAG_CROSSING), - myParentJunction(parentJunction), - myCrossingEdges(crossingEdges) { -} - - -GNECrossing::~GNECrossing() {} - - -std::string -GNECrossing::generateChildID(SumoXMLTag /*childTag*/) { - // currently unused - return ""; -} - - -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"); - } -} - - -void -GNECrossing::updateGeometry() { - // rebuild crossing and walking areas form node parent - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - // obtain shape - myCrossingGeometry.updateGeometry(crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape); - /* - // only rebuild shape if junction's shape isn't in Buuble mode - if (myParentJunction->getNBNode()->getShape().size() > 0) { - myCrossingGeometry.calculateShapeRotationsAndLengths(); - } - */ - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -Position -GNECrossing::getPositionInView() const { - // currently unused - return Position(0, 0); -} - - -GNEJunction* -GNECrossing::getParentJunction() const { - return myParentJunction; -} - - -const std::vector& -GNECrossing::getCrossingEdges() const { - return myCrossingEdges; -} - - -NBNode::Crossing* -GNECrossing::getNBCrossing() const { - return myParentJunction->getNBNode()->getCrossing(myCrossingEdges); -} - - -void -GNECrossing::drawGL(const GUIVisualizationSettings& s) const { - // only draw if option drawCrossingsAndWalkingareas is enabled and size of shape is greather than 0 and zoom is close enough - if (s.drawCrossingsAndWalkingareas && - (myCrossingGeometry.getShapeRotations().size() > 0) && - (myCrossingGeometry.getShapeLengths().size() > 0) && - (s.scale > 3.0)) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - if (myNet->getViewNet()->getEditModes().networkEditMode != GNE_NMODE_TLS) { - // push first draw matrix - glPushMatrix(); - // push name - glPushName(getGlID()); - // must draw on top of junction - glTranslated(0, 0, GLO_JUNCTION + 0.1); - // set color depending of selection and priority - if (drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedCrossingColor); - } else if (!crossing->valid) { - GLHelper::setColor(s.colorSettings.crossingInvalid); - } else if (crossing->priority) { - GLHelper::setColor(s.colorSettings.crossingPriority); - } else { - GLHelper::setColor(s.colorSettings.crossing); - } - // traslate to front - glTranslated(0, 0, .2); - // set default values - double length = 0.5; - double spacing = 1.0; - double halfWidth = crossing->width * 0.5; - // push second draw matrix - glPushMatrix(); - // draw on top of of the white area between the rails - glTranslated(0, 0, 0.1); - for (int i = 0; i < (int)myCrossingGeometry.getShape().size() - 1; ++i) { - // push three draw matrix - glPushMatrix(); - // translate and rotate - glTranslated(myCrossingGeometry.getShape()[i].x(), myCrossingGeometry.getShape()[i].y(), 0.0); - glRotated(myCrossingGeometry.getShapeRotations()[i], 0, 0, 1); - // draw crossing depending if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - for (double t = 0; t < myCrossingGeometry.getShapeLengths()[i]; t += spacing) { - glBegin(GL_QUADS); - glVertex2d(-halfWidth, -t); - glVertex2d(-halfWidth, -t - length); - glVertex2d(halfWidth, -t - length); - glVertex2d(halfWidth, -t); - glEnd(); - } - } else { - // only draw a single rectangle if it's being drawn only for selecting - glBegin(GL_QUADS); - glVertex2d(-halfWidth, 0); - glVertex2d(-halfWidth, -myCrossingGeometry.getShapeLengths().back()); - glVertex2d(halfWidth, -myCrossingGeometry.getShapeLengths().back()); - glVertex2d(halfWidth, 0); - glEnd(); - } - // pop three draw matrix - glPopMatrix(); - } - // pop second draw matrix - glPopMatrix(); - // traslate to back - glTranslated(0, 0, -.2); - // pop name - glPopName(); - // pop draw matrix - glPopMatrix(); - } - // link indices must be drawn in all edit modes if isn't being drawn for selecting - if (s.drawLinkTLIndex.show && !s.drawForRectangleSelection) { - drawTLSLinkNo(s); - } - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), 1, myDottedGeometry); - } - } -} - - -void -GNECrossing::drawTLSLinkNo(const GUIVisualizationSettings& s) const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION + 0.5); - PositionVector shape = crossing->shape; - shape.extrapolate(0.5); // draw on top of the walking area - int linkNo = crossing->tlLinkIndex; - int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo; - GLHelper::drawTextAtEnd(toString(linkNo2), shape, 0, s.drawLinkTLIndex, s.scale); - GLHelper::drawTextAtEnd(toString(linkNo), shape.reverse(), 0, s.drawLinkTLIndex, s.scale); - glPopMatrix(); -} - - -GUIGLObjectPopupMenu* -GNECrossing::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // build position copy entry - buildPositionCopyEntry(ret, false); - // check if we're in supermode network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - // create menu commands - FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom crossing shape", nullptr, &parent, MID_GNE_CROSSING_EDIT_SHAPE); - // check if menu commands has to be disabled - NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; - if ((editMode == GNE_NMODE_CONNECT) || (editMode == GNE_NMODE_TLS) || (editMode == GNE_NMODE_CREATE_EDGE)) { - mcCustomShape->disable(); - } - } - return ret; -} - - -Boundary -GNECrossing::getCenteringBoundary() const { - Boundary b; - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - if (crossing) { - if (crossing->customShape.size() > 0) { - b = crossing->customShape.getBoxBoundary(); - } else if (crossing->shape.size() > 0) { - b = crossing->shape.getBoxBoundary(); - } else { - return myParentJunction->getCenteringBoundary(); - } - b.grow(10); - return b; - } - // in other case return boundary of parent junction - return myParentJunction->getCenteringBoundary(); -} - - -std::string -GNECrossing::getAttribute(SumoXMLAttr key) const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges, (key != SUMO_ATTR_ID)); - switch (key) { - case SUMO_ATTR_ID: - // get attribute requires a special case - if (crossing) { - return crossing->id; - } else { - return "Temporal Unreferenced"; - } - case SUMO_ATTR_WIDTH: - return toString(crossing->customWidth); - case SUMO_ATTR_PRIORITY: - return crossing->priority ? "true" : "false"; - case SUMO_ATTR_EDGES: - return toString(crossing->edges); - case SUMO_ATTR_TLLINKINDEX: - return toString(crossing->customTLIndex); - case SUMO_ATTR_TLLINKINDEX2: - return toString(crossing->customTLIndex2); - case SUMO_ATTR_CUSTOMSHAPE: - return toString(crossing->customShape); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return crossing->getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNECrossing::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: - throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); - case SUMO_ATTR_EDGES: - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_PRIORITY: - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - case SUMO_ATTR_CUSTOMSHAPE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->add(new GNEChange_Attribute(this, myNet, key, value), true); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNECrossing::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - // id isn't editable - return false; - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - return (myParentJunction->getNBNode()->getCrossing(myCrossingEdges)->tlID != ""); - default: - return true; - } -} - - -bool -GNECrossing::isValid(SumoXMLAttr key, const std::string& value) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - switch (key) { - case SUMO_ATTR_ID: - return false; - case SUMO_ATTR_EDGES: - if (canParse >(myNet, value, false)) { - // parse edges and save their IDs in a set - std::vector parsedEdges = parse >(myNet, value); - EdgeVector nbEdges; - for (auto i : parsedEdges) { - nbEdges.push_back(i->getNBEdge()); - } - std::sort(nbEdges.begin(), nbEdges.end()); - // - EdgeVector originalEdges = crossing->edges; - std::sort(originalEdges.begin(), originalEdges.end()); - // return true if we're setting the same edges - if (toString(nbEdges) == toString(originalEdges)) { - return true; - } else { - return !myParentJunction->getNBNode()->checkCrossingDuplicated(nbEdges); - } - } else { - return false; - } - case SUMO_ATTR_WIDTH: - return canParse(value) && ((parse(value) > 0) || (parse(value) == -1)); // kann NICHT 0 sein, oder -1 (bedeutet default) - case SUMO_ATTR_PRIORITY: - return canParse(value); - case SUMO_ATTR_TLLINKINDEX: - case SUMO_ATTR_TLLINKINDEX2: - // -1 means that tlLinkIndex2 takes on the same value as tlLinkIndex when setting idnices - return (isAttributeEnabled(key) && - canParse(value) - && ((parse(value) >= 0) || ((parse(value) == -1) && (key == SUMO_ATTR_TLLINKINDEX2))) - && myParentJunction->getNBNode()->getControllingTLS().size() > 0 - && (*myParentJunction->getNBNode()->getControllingTLS().begin())->getMaxValidIndex() >= parse(value)); - case SUMO_ATTR_CUSTOMSHAPE: { - // empty shapes are allowed - return canParse(value); - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNECrossing::checkEdgeBelong(GNEEdge* edge) const { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->getNBEdge()) != crossing->edges.end()) { - return true; - } else { - return false; - } -} - - -bool -GNECrossing::checkEdgeBelong(const std::vector& edges) const { - for (auto i : edges) { - if (checkEdgeBelong(i)) { - return true; - } - } - return false; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value) { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - switch (key) { - case SUMO_ATTR_ID: - throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); - case SUMO_ATTR_EDGES: { - // obtain GNEEdges - std::vector edges = parse >(myNet, value); - // remove NBEdges of crossing - crossing->edges.clear(); - // set NBEdge of every GNEEdge into Crossing Edges - for (auto i : edges) { - crossing->edges.push_back(i->getNBEdge()); - } - // sort new edges - std::sort(crossing->edges.begin(), crossing->edges.end()); - // change myCrossingEdges by the new edges - myCrossingEdges = crossing->edges; - // update geometry of parent junction - myParentJunction->updateGeometry(); - break; - } - case SUMO_ATTR_WIDTH: - // Change width an refresh element - crossing->customWidth = parse(value); - break; - case SUMO_ATTR_PRIORITY: - crossing->priority = parse(value); - break; - case SUMO_ATTR_TLLINKINDEX: - crossing->customTLIndex = parse(value); - // make new value visible immediately - crossing->tlLinkIndex = crossing->customTLIndex; - break; - case SUMO_ATTR_TLLINKINDEX2: - crossing->customTLIndex2 = parse(value); - // make new value visible immediately - crossing->tlLinkIndex2 = crossing->customTLIndex2; - break; - case SUMO_ATTR_CUSTOMSHAPE: { - // set custom shape - crossing->customShape = parse(value); - break; - } - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - crossing->setParametersStr(value); - break; - default: - 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)) { - myParentJunction->updateGeometry(); - } -} - - -void -GNECrossing::updateDottedContour() { - auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges); - // build contour using connection geometry - PositionVector contourFront = myCrossingGeometry.getShape(); - PositionVector contourback = contourFront; - // move both to side - contourFront.move2side(crossing->width * 0.5); - contourback.move2side(crossing->width * -0.5); - // reverse contourback - contourback = contourback.reverse(); - // add contour back to contourfront - for (const auto& position : contourback) { - contourFront.push_back(position); - } - // close contour front - contourFront.closePolygon(); - // set as dotted contour - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), contourFront); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNECrossing.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNECrossing.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNECrossing.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNECrossing.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,174 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNECrossing.h -/// @author Jakob Erdmann -/// @date June 2011 -/// -// A class for visualizing Inner Lanes (used when editing traffic lights) -/****************************************************************************/ -#ifndef GNECrossing_h -#define GNECrossing_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNENetElement.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GUIGLObjectPopupMenu; -class PositionVector; -class GNEJunction; -class GNEEdge; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNECrossing - * @brief This object is responsible for drawing a shape and for supplying a - * a popup menu. Messages are routeted to an internal dataTarget and to the - * editor (hence inheritance from FXDelegator) - */ -class GNECrossing : public GNENetElement { -public: - - /**@brief Constructor - * @param[in] parentJunction GNEJunction in which this crossing is placed - * @param[in] crossing Node::Crossing - */ - GNECrossing(GNEJunction* parentJunction, std::vector edges); - - /// @brief Destructor - ~GNECrossing(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name Functions related with geometry of element - /// @{ - /// @brief get Crossing shape - const PositionVector& getCrossingShape() const; - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of hierarchical element in view - Position getPositionInView() const; - /// @} - - /// @brief get parent Junction - GNEJunction* getParentJunction() const; - - /// @brief get crossingEdges - const std::vector& getCrossingEdges() const; - - ///@brief get referente to NBode::Crossing - NBNode::Crossing* getNBCrossing() const; - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * - * @return The boundary the object is within - * @see GUIGlObject::getCenteringBoundary - */ - Boundary getCenteringBoundary() const; - - /**@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 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - - /// @brief return true if a edge belongs to crossing's edges - bool checkEdgeBelong(GNEEdge* edges) const; - - /// @brief return true if a edge of a vector of edges belongs to crossing's edges - bool checkEdgeBelong(const std::vector& edges) const; - -protected: - /// @brief the parent junction of this crossing - GNEJunction* myParentJunction; - - /// @brief Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges) - std::vector myCrossingEdges; - - /// @brief crossing geometry - GNEGeometry::Geometry myCrossingGeometry; - -private: - /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief draw TLS Link Number - void drawTLSLinkNo(const GUIVisualizationSettings& s) const; - - /// @brief Invalidated copy constructor. - GNECrossing(const GNECrossing&) = delete; - - /// @brief Invalidated assignment operator. - GNECrossing& operator=(const GNECrossing&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEEdge.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNEEdge.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEEdge.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,2523 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEEdge.cpp -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A road/street connecting two junctions (netedit-version, adapted from GUIEdge) -// Basically a container for an NBEdge with drawing and editing capabilities -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEConnection.h" -#include "GNECrossing.h" -#include "GNEJunction.h" -#include "GNELane.h" -#include "GNEEdge.h" - -//#define DEBUG_SMOOTH_GEOM -//#define DEBUGCOND(obj) (true) -#define VEHICLE_GAP 1 - -// =========================================================================== -// static -// =========================================================================== -const double GNEEdge::SNAP_RADIUS = SUMO_const_halfLaneWidth; - -// =========================================================================== -// members methods -// =========================================================================== - -GNEEdge::GNEEdge(GNENet* net, NBEdge* nbe, bool wasSplit, bool loaded): - GNENetElement(net, nbe->getID(), GLO_EDGE, SUMO_TAG_EDGE), - myNBEdge(nbe), - myGNEJunctionSource(myNet->retrieveJunction(nbe->getFromNode()->getID())), - myGNEJunctionDestiny(myNet->retrieveJunction(nbe->getToNode()->getID())), - myLanes(0), - myAmResponsible(false), - myWasSplit(wasSplit), - myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED), - myUpdateGeometry(true) { - // Create lanes - int numLanes = myNBEdge->getNumLanes(); - myLanes.reserve(numLanes); - for (int i = 0; i < numLanes; i++) { - myLanes.push_back(new GNELane(this, i)); - myLanes.back()->incRef("GNEEdge::GNEEdge"); - } - // update Lane geometries - for (const auto& i : myLanes) { - i->updateGeometry(); - } -} - - -GNEEdge::~GNEEdge() { - // Delete references to this eddge in lanes - for (const auto& lane : myLanes) { - lane->decRef("GNEEdge::~GNEEdge"); - if (lane->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in GNEEdge destructor"); - delete lane; - } - } - // delete references to this eddge in connections - for (const auto& connection : myGNEConnections) { - connection->decRef("GNEEdge::~GNEEdge"); - if (connection->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in GNEEdge destructor"); - delete connection; - } - } - if (myAmResponsible) { - delete myNBEdge; - } -} - - -std::string -GNEEdge::generateChildID(SumoXMLTag /*childTag*/) { - // currently unused - return ""; -} - - -void -GNEEdge::updateGeometry() { - // first check if myUpdateGeometry flag is enabled - if (myUpdateGeometry) { - // Update geometry of lanes - for (const auto& lane : myLanes) { - lane->updateGeometry(); - } - // Update geometry of connections (Only if updateGrid is enabled, because in move mode connections are hidden - // (note: only the previous marked as deprecated will be updated) - if (!myMovingGeometryBoundary.isInitialised()) { - for (const auto& connection : myGNEConnections) { - connection->updateGeometry(); - } - } - // Update geometry of additionals children vinculated to this edge - for (const auto& childAdditionals : getChildAdditionals()) { - childAdditionals->updateGeometry(); - } - // Update geometry of parent additionals that have this edge as parent - for (const auto& additionalParent : getParentAdditionals()) { - additionalParent->updateGeometry(); - } - // Update partial geometry of demand elements parents that have this edge as parent - for (const auto& demandElementParent : getParentDemandElements()) { - demandElementParent->updatePartialGeometry(this); - } - // Update partial geometry of demand elements children vinculated to this edge - for (const auto& childDemandElements : getChildDemandElements()) { - childDemandElements->updatePartialGeometry(this); - } - // Update partial geometry of routes vinculated to this edge - for (const auto& pathElementChild : myPathElementChilds) { - pathElementChild->updatePartialGeometry(this); - } - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); - } - // update vehicle geometry - updateVehicleSpreadGeometries(); - // update vehicle stack labels - updateVehicleStackLabels(); -} - - -Position -GNEEdge::getPositionInView() const { - // currently unused - return Position(0, 0); -} - - -bool -GNEEdge::clickedOverShapeStart(const Position& pos) { - if (myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) { - return (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS); - } else { - return false; - } -} - - -bool -GNEEdge::clickedOverShapeEnd(const Position& pos) { - if (myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) { - return (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS); - } else { - return false; - } -} - - -void -GNEEdge::moveShapeStart(const Position& oldPos, const Position& offset) { - // change shape startPosition using oldPosition and offset - Position shapeStartEdited = oldPos; - shapeStartEdited.add(offset); - // snap to active grid - shapeStartEdited = myNet->getViewNet()->snapToActiveGrid(shapeStartEdited, offset.z() == 0); - // make sure that start and end position are different - if (shapeStartEdited != myNBEdge->getGeometry().back()) { - // set shape start position without updating grid - setShapeStartPos(shapeStartEdited); - updateGeometry(); - } -} - - -void -GNEEdge::moveShapeEnd(const Position& oldPos, const Position& offset) { - // change shape endPosition using oldPosition and offset - Position shapeEndEdited = oldPos; - shapeEndEdited.add(offset); - // snap to active grid - shapeEndEdited = myNet->getViewNet()->snapToActiveGrid(shapeEndEdited, offset.z() == 0); - // make sure that start and end position are different - if (shapeEndEdited != myNBEdge->getGeometry().front()) { - // set shape end position without updating grid - setShapeEndPos(shapeEndEdited); - updateGeometry(); - } -} - - -void -GNEEdge::commitShapeStartChange(const Position& oldPos, GNEUndoList* undoList) { - // first save current shape start position - Position modifiedShapeStartPos = myNBEdge->getGeometry().front(); - // restore old shape start position - setShapeStartPos(oldPos); - // end geometry moving - endGeometryMoving(); - // set attribute using undolist - undoList->p_begin("shape start of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, GNE_ATTR_SHAPE_START, toString(modifiedShapeStartPos), true, toString(oldPos))); - undoList->p_end(); -} - - -void -GNEEdge::commitShapeEndChange(const Position& oldPos, GNEUndoList* undoList) { - // first save current shape end position - Position modifiedShapeEndPos = myNBEdge->getGeometry().back(); - // restore old shape end position - setShapeEndPos(oldPos); - // end geometry moving - endGeometryMoving(); - // set attribute using undolist - undoList->p_begin("shape end of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, GNE_ATTR_SHAPE_END, toString(modifiedShapeEndPos), true, toString(oldPos))); - undoList->p_end(); -} - - -void -GNEEdge::startGeometryMoving() { - // save current centering boundary - myMovingGeometryBoundary = getCenteringBoundary(); - // Save current centering boundary of lanes (and their children) - for (auto i : myLanes) { - i->startGeometryMoving(); - } - // Save current centering boundary of additionals children vinculated to this edge - for (auto i : getChildAdditionals()) { - i->startGeometryMoving(); - } - // Save current centering boundary of parent additionals that have this edge as parent - for (auto i : getParentAdditionals()) { - i->startGeometryMoving(); - } - // Save current centering boundary of demand elements children vinculated to this edge - for (auto i : getChildDemandElements()) { - i->startGeometryMoving(); - } - // Save current centering boundary of demand elements parents that have this edge as parent - for (auto i : getParentDemandElements()) { - i->startGeometryMoving(); - } -} - - -void -GNEEdge::endGeometryMoving() { - // check that endGeometryMoving was called only once - if (myMovingGeometryBoundary.isInitialised()) { - // Remove object from net - myNet->removeGLObjectFromGrid(this); - // reset myMovingGeometryBoundary - myMovingGeometryBoundary.reset(); - // Restore centering boundary of lanes (and their children) - for (auto i : myLanes) { - i->endGeometryMoving(); - } - // Restore centering boundary of additionals children vinculated to this edge - for (auto i : getChildAdditionals()) { - i->endGeometryMoving(); - } - // Restore centering boundary of parent additionals that have this edge as parent - for (auto i : getParentAdditionals()) { - i->endGeometryMoving(); - } - // Restore centering boundary of demand elements children vinculated to this edge - for (auto i : getChildDemandElements()) { - i->endGeometryMoving(); - } - // Restore centering boundary of demand elements parents that have this edge as parent - for (auto i : getParentDemandElements()) { - i->endGeometryMoving(); - } - // add object into grid again (using the new centering boundary) - myNet->addGLObjectIntoGrid(this); - } -} - - -int -GNEEdge::getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid) { - PositionVector entireGeometry = myNBEdge->getGeometry(); - // check if position has to be snapped to grid - if (snapToGrid) { - pos = myNet->getViewNet()->snapToActiveGrid(pos); - } - double offset = entireGeometry.nearest_offset_to_point2D(pos, true); - if (offset == GeomHelper::INVALID_OFFSET) { - return -1; - } - Position newPos = entireGeometry.positionAtOffset2D(offset); - // first check if vertex already exists in the inner geometry - for (int i = 0; i < (int)entireGeometry.size(); i++) { - if (entireGeometry[i].distanceTo2D(newPos) < SNAP_RADIUS) { - if (i == 0 || i == (int)(entireGeometry.size() - 1)) { - return -1; - } - // index refers to inner geometry - return i - 1; - } - } - // if vertex doesn't exist, insert it - if (createIfNoExist) { - // check if position has to be snapped to grid - if (snapToGrid) { - newPos = myNet->getViewNet()->snapToActiveGrid(newPos); - } - startGeometryMoving(); - int index = entireGeometry.insertAtClosest(myNet->getViewNet()->snapToActiveGrid(newPos), true); - setGeometry(entireGeometry, false); - endGeometryMoving(); - // index refers to inner geometry - return (index - 1); - } else { - return -1; - } -} - - -int -GNEEdge::getVertexIndex(const double offset, bool createIfNoExist, bool snapToGrid) { - return getVertexIndex(myNBEdge->getGeometry().positionAtOffset2D(offset), createIfNoExist, snapToGrid); -} - - -int -GNEEdge::moveVertexShape(const int index, const Position& oldPos, const Position& offset) { - // obtain inner geometry of edge - PositionVector edgeGeometry = myNBEdge->getInnerGeometry(); - // Make sure that index is valid AND ins't the first and last index - if (index != -1) { - // check that index is correct before change position - if (index < (int)edgeGeometry.size()) { - // change position of vertex - edgeGeometry[index] = oldPos; - edgeGeometry[index].add(offset); - // filtern position using snap to active grid - edgeGeometry[index] = myNet->getViewNet()->snapToActiveGrid(edgeGeometry[index], offset.z() == 0); - // update edge's geometry without updating RTree (To avoid unnecesary changes in RTree) - setGeometry(edgeGeometry, true); - return index; - } else { - throw InvalidArgument("Index greater than shape size"); - } - } else { - return index; - } -} - - -void -GNEEdge::moveEntireShape(const PositionVector& oldShape, const Position& offset) { - // make a copy of the old shape to change it - PositionVector modifiedShape = oldShape; - // change all points of the inner geometry using offset - for (auto& i : modifiedShape) { - i.add(offset); - } - // restore modified shape - setGeometry(modifiedShape, true); -} - - -void -GNEEdge::commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList) { - // restore original shape into shapeToCommit - PositionVector innerShapeToCommit = myNBEdge->getInnerGeometry(); - // first check if second and penultimate isn't in Junction's buubles - double buubleRadius = GNEJunction::BUBBLE_RADIUS * myNet->getViewNet()->getVisualisationSettings().junctionSize.exaggeration; - if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[0].distanceTo2D(myNBEdge->getGeometry()[1]) < buubleRadius) { - innerShapeToCommit.removeClosest(innerShapeToCommit[0]); - } - if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 2].distanceTo2D(myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 1]) < buubleRadius) { - innerShapeToCommit.removeClosest(innerShapeToCommit[(int)innerShapeToCommit.size() - 1]); - } - // second check if double points has to be removed - innerShapeToCommit.removeDoublePoints(SNAP_RADIUS); - // show warning if some of edge's shape was merged - if (innerShapeToCommit.size() != myNBEdge->getInnerGeometry().size()) { - WRITE_WARNING("Merged shape's point") - } - - updateGeometry(); - // restore old geometry to allow change attribute (And restore shape if during movement a new point was created - setGeometry(oldShape, true); - // finish geometry moving - endGeometryMoving(); - // commit new shape - undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_SHAPE, toString(innerShapeToCommit))); - undoList->p_end(); -} - - -void -GNEEdge::deleteGeometryPoint(const Position& pos, bool allowUndo) { - // obtain index and remove point - PositionVector modifiedShape = myNBEdge->getInnerGeometry(); - int index = modifiedShape.indexOfClosest(pos); - modifiedShape.erase(modifiedShape.begin() + index); - // set new shape depending of allowUndo - if (allowUndo) { - myNet->getViewNet()->getUndoList()->p_begin("delete geometry point"); - setAttribute(SUMO_ATTR_SHAPE, toString(modifiedShape), myNet->getViewNet()->getUndoList()); - myNet->getViewNet()->getUndoList()->p_end(); - } else { - // set new shape - setGeometry(modifiedShape, true); - } -} - - -void -GNEEdge::updateJunctionPosition(GNEJunction* junction, const Position& origPos) { - Position delta = junction->getNBNode()->getPosition() - origPos; - PositionVector geom = myNBEdge->getGeometry(); - // geometry endpoint need not equal junction position hence we modify it with delta - if (junction == myGNEJunctionSource) { - geom[0].add(delta); - } else { - geom[-1].add(delta); - } - setGeometry(geom, false); -} - - -Boundary -GNEEdge::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMovingGeometryBoundary.isInitialised()) { - return myMovingGeometryBoundary; - } else { - Boundary b; - for (const auto& i : myLanes) { - b.add(i->getCenteringBoundary()); - } - // ensure that geometry points are selectable even if the lane geometry is strange - for (const Position& pos : myNBEdge->getGeometry()) { - b.add(pos); - } - b.grow(10); - return b; - } -} - -const std::string -GNEEdge::getOptionalName() const { - return myNBEdge->getStreetName(); -} - -GUIGLObjectPopupMenu* -GNEEdge::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - // build position copy entry - buildPositionCopyEntry(ret, false); - return ret; -} - - -GNEJunction* -GNEEdge::getGNEJunctionSource() const { - return myGNEJunctionSource; -} - - -GNEJunction* -GNEEdge::getGNEJunctionDestiny() const { - return myGNEJunctionDestiny; -} - - -GNEEdge* -GNEEdge::getOppositeEdge() const { - return myNet->retrieveEdge(myGNEJunctionDestiny, myGNEJunctionSource, false); -} - - -void -GNEEdge::drawGL(const GUIVisualizationSettings& s) const { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // draw lanes - for (const auto& lane : myLanes) { - lane->drawGL(s); - } - // draw parent additionals - for (const auto& additional : getParentAdditionals()) { - if (additional->getTagProperty().getTag() == SUMO_TAG_REROUTER) { - // draw rerouter symbol - drawRerouterSymbol(s, additional); - } - } - // draw child additional - for (const auto& additional : getChildAdditionals()) { - additional->drawGL(s); - } - // draw child edge - if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements()) { - drawDemandElements(s); - } - // draw geometry points if isnt's too small and - if ((s.scale > 8.0) && (myNet->getViewNet()->getEditModes().currentSupermode != GNE_SUPERMODE_DEMAND)) { - drawGeometryPoints(s); - } - // draw vehicles - const std::map > vehiclesMap = getVehiclesOverEdgeMap(); - for (const auto& vehicleMap : vehiclesMap) { - for (const auto& vehicle : vehicleMap.second) { - vehicle->drawGL(s); - } - } - // draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawEdgeName(s); - } - // draw dotted contor around the first and last lane if isn't being drawn for selecting - if (myNet->getViewNet()->getDottedAC() == this) { - // use GLO_JUNCTION instead GLO_EDGE - GNEGeometry::drawShapeDottedContour(s, GLO_JUNCTION, s.laneWidthExaggeration, myDottedGeometry); - } -} - - -NBEdge* -GNEEdge::getNBEdge() const { - return myNBEdge; -} - - -Position -GNEEdge::getSplitPos(const Position& clickPos) { - const PositionVector& geom = myNBEdge->getGeometry(); - int index = geom.indexOfClosest(clickPos); - if (geom[index].distanceTo2D(clickPos) < SNAP_RADIUS) { - // split at existing geometry point - return geom[index]; - } else { - // split straight between the next two points - return geom.positionAtOffset(geom.nearest_offset_to_point2D(clickPos)); - } -} - - -void -GNEEdge::editEndpoint(Position pos, GNEUndoList* undoList) { - if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) && (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS)) { - undoList->p_begin("remove endpoint"); - setAttribute(GNE_ATTR_SHAPE_START, "", undoList); - undoList->p_end(); - } else if ((myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) && (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS)) { - undoList->p_begin("remove endpoint"); - setAttribute(GNE_ATTR_SHAPE_END, "", undoList); - undoList->p_end(); - } else { - // we need to create new Start/End position over Edge shape, not over clicked position - double offset = myNBEdge->getGeometry().nearest_offset_to_point2D(myNet->getViewNet()->snapToActiveGrid(pos), true); - if (offset != GeomHelper::INVALID_OFFSET) { - PositionVector geom = myNBEdge->getGeometry(); - // calculate position over edge shape relative to clicked positino - Position newPos = geom.positionAtOffset2D(offset); - // snap new position to grid - newPos = myNet->getViewNet()->snapToActiveGrid(newPos); - undoList->p_begin("set endpoint"); - int index = geom.indexOfClosest(pos); - // check if snap to existing geometry - if (geom[index].distanceTo2D(pos) < SNAP_RADIUS) { - pos = geom[index]; - } - Position destPos = myGNEJunctionDestiny->getNBNode()->getPosition(); - Position sourcePos = myGNEJunctionSource->getNBNode()->getPosition(); - if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) { - setAttribute(GNE_ATTR_SHAPE_END, toString(newPos), undoList); - myGNEJunctionDestiny->invalidateShape(); - } else { - setAttribute(GNE_ATTR_SHAPE_START, toString(newPos), undoList); - myGNEJunctionSource->invalidateShape(); - } - // possibly existing inner point is no longer needed - if (myNBEdge->getInnerGeometry().size() > 0 && getVertexIndex(pos, false, false) != -1) { - deleteGeometryPoint(pos, false); - } - undoList->p_end(); - } - } -} - - -void -GNEEdge::resetEndpoint(const Position& pos, GNEUndoList* undoList) { - Position destPos = myGNEJunctionDestiny->getNBNode()->getPosition(); - Position sourcePos = myGNEJunctionSource->getNBNode()->getPosition(); - if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) { - setAttribute(GNE_ATTR_SHAPE_END, toString(destPos), undoList); - myGNEJunctionDestiny->invalidateShape(); - } else { - setAttribute(GNE_ATTR_SHAPE_START, toString(sourcePos), undoList); - myGNEJunctionSource->invalidateShape(); - } -} - - -void -GNEEdge::setGeometry(PositionVector geom, bool inner) { - // set new geometry - const bool lefthand = OptionsCont::getOptions().getBool("lefthand"); - if (lefthand) { - geom.mirrorX(); - myNBEdge->mirrorX(); - } - myNBEdge->setGeometry(geom, inner); - if (lefthand) { - myNBEdge->mirrorX(); - } - // update geometry - updateGeometry(); - // invalidate junction source shape - myGNEJunctionSource->invalidateShape(); - // iterate over GNEJunctionSource edges and update geometry - for (const auto& edge : myGNEJunctionSource->getGNEIncomingEdges()) { - edge->updateGeometry(); - } - for (const auto& edge : myGNEJunctionSource->getGNEOutgoingEdges()) { - edge->updateGeometry(); - } - // invalidate junction destiny shape - myGNEJunctionDestiny->invalidateShape(); - // iterate over GNEJunctionDestiny edges and update geometry - for (const auto& edge : myGNEJunctionDestiny->getGNEIncomingEdges()) { - edge->updateGeometry(); - } - for (const auto& edge : myGNEJunctionDestiny->getGNEOutgoingEdges()) { - edge->updateGeometry(); - } -} - - -void -GNEEdge::remakeGNEConnections() { - // create new and removed unused GNEConnectinos - const std::vector& connections = myNBEdge->getConnections(); - // create a vector to keep retrieved and created connections - std::vector retrievedConnections; - // iterate over NBEdge::Connections of GNEEdge - for (auto it : connections) { - // retrieve existent GNEConnection, or create it - GNEConnection* retrievedGNEConnection = retrieveGNEConnection(it.fromLane, it.toEdge, it.toLane); - retrievedGNEConnection->updateLinkState(); - retrievedConnections.push_back(retrievedGNEConnection); - // check if previously this GNEConnections exists, and if true, remove it from myGNEConnections - std::vector::iterator retrievedExists = std::find(myGNEConnections.begin(), myGNEConnections.end(), retrievedGNEConnection); - if (retrievedExists != myGNEConnections.end()) { - myGNEConnections.erase(retrievedExists); - } else { - // include reference to created GNEConnection - retrievedGNEConnection->incRef("GNEEdge::remakeGNEConnections"); - } - // mark it as deprecated - retrievedGNEConnection->markConnectionGeometryDeprecated(); - } - // delete non retrieved GNEConnections - for (auto it : myGNEConnections) { - // decrease reference - it->decRef(); - // delete GNEConnection if is unreferenced - if (it->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + it->getTagStr() + " '" + it->getID() + "' in rebuildGNEConnections()"); - delete it; - } - } - // copy retrieved (existent and created) GNECrossigns to myGNEConnections - myGNEConnections = retrievedConnections; -} - - -void -GNEEdge::clearGNEConnections() { - // Drop all existents connections that aren't referenced anymore - for (auto i : myGNEConnections) { - // check if connection is selected - if (i->isAttributeCarrierSelected()) { - i->unselectAttributeCarrier(); - } - // Dec reference of connection - i->decRef("GNEEdge::clearGNEConnections"); - // Delete GNEConnectionToErase if is unreferenced - if (i->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + i->getTagStr() + " '" + i->getID() + "' in clearGNEConnections()"); - delete i; - } - } - myGNEConnections.clear(); -} - - -int -GNEEdge::getRouteProbeRelativePosition(GNERouteProbe* routeProbe) const { - std::vector routeProbes; - for (auto i : getChildAdditionals()) { - if (i->getTagProperty().getTag() == routeProbe->getTagProperty().getTag()) { - routeProbes.push_back(i); - } - } - // return index of routeProbe in routeProbes vector - auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe); - if (it == routeProbes.end()) { - return -1; - } else { - return (int)(it - routeProbes.begin()); - } -} - - -std::vector -GNEEdge::getGNECrossings() { - std::vector crossings; - for (auto i : myGNEJunctionSource->getGNECrossings()) { - if (i->checkEdgeBelong(this)) { - crossings.push_back(i); - } - } - for (auto i : myGNEJunctionDestiny->getGNECrossings()) { - if (i->checkEdgeBelong(this)) { - crossings.push_back(i); - } - } - return crossings; -} - - -void -GNEEdge::copyTemplate(GNEEdge* tpl, GNEUndoList* undoList) { - // begin undo list - undoList->p_begin("copy template"); - // copy edge-specific attributes - setAttribute(SUMO_ATTR_NUMLANES, tpl->getAttribute(SUMO_ATTR_NUMLANES), undoList); - setAttribute(SUMO_ATTR_TYPE, tpl->getAttribute(SUMO_ATTR_TYPE), undoList); - setAttribute(SUMO_ATTR_PRIORITY, tpl->getAttribute(SUMO_ATTR_PRIORITY), undoList); - setAttribute(SUMO_ATTR_SPREADTYPE, tpl->getAttribute(SUMO_ATTR_SPREADTYPE), undoList); - // copy raw values for lane-specific attributes - setAttribute(SUMO_ATTR_SPEED, toString(myNBEdge->getSpeed()), undoList); - setAttribute(SUMO_ATTR_WIDTH, toString(myNBEdge->getLaneWidth()), undoList); - setAttribute(SUMO_ATTR_ENDOFFSET, toString(myNBEdge->getEndOffset()), undoList); - // copy lane attributes as well - for (int i = 0; i < (int)myLanes.size(); i++) { - myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ALLOW), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_SPEED, tpl->myLanes[i]->getAttribute(SUMO_ATTR_SPEED), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, tpl->myLanes[i]->getAttribute(SUMO_ATTR_WIDTH), undoList); - myLanes[i]->setAttribute(SUMO_ATTR_ENDOFFSET, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ENDOFFSET), undoList); - } - // end undo list - undoList->p_end(); -} - - -std::set -GNEEdge::getLaneGlIDs() const { - std::set result; - for (auto i : myLanes) { - result.insert(i->getGlID()); - } - return result; -} - - -const std::vector& -GNEEdge::getLanes() const { - return myLanes; -} - - -const std::vector& -GNEEdge::getGNEConnections() const { - return myGNEConnections; -} - - -bool -GNEEdge::wasSplit() { - return myWasSplit; -} - - -std::string -GNEEdge::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getMicrosimID(); - case SUMO_ATTR_FROM: - return myGNEJunctionSource->getMicrosimID(); - case SUMO_ATTR_TO: - return myGNEJunctionDestiny->getMicrosimID(); - case SUMO_ATTR_NUMLANES: - return toString(myNBEdge->getNumLanes()); - case SUMO_ATTR_PRIORITY: - return toString(myNBEdge->getPriority()); - case SUMO_ATTR_LENGTH: - return toString(myNBEdge->getFinalLength()); - case SUMO_ATTR_TYPE: - return myNBEdge->getTypeID(); - case SUMO_ATTR_SHAPE: - return toString(myNBEdge->getInnerGeometry()); - case SUMO_ATTR_SPREADTYPE: - return toString(myNBEdge->getLaneSpreadFunction()); - case SUMO_ATTR_NAME: - return myNBEdge->getStreetName(); - case SUMO_ATTR_ALLOW: - return (getVehicleClassNames(myNBEdge->getPermissions()) + (myNBEdge->hasLaneSpecificPermissions() ? " (combined!)" : "")); - case SUMO_ATTR_DISALLOW: { - return (getVehicleClassNames(invertPermissions(myNBEdge->getPermissions())) + (myNBEdge->hasLaneSpecificPermissions() ? " (combined!)" : "")); - } - case SUMO_ATTR_SPEED: - if (myNBEdge->hasLaneSpecificSpeed()) { - return "lane specific"; - } else { - return toString(myNBEdge->getSpeed()); - } - case SUMO_ATTR_WIDTH: - if (myNBEdge->hasLaneSpecificWidth()) { - return "lane specific"; - } else { - return toString(myNBEdge->getLaneWidth()); - } - case SUMO_ATTR_ENDOFFSET: - if (myNBEdge->hasLaneSpecificEndOffset()) { - return "lane specific"; - } else { - return toString(myNBEdge->getEndOffset()); - } - case SUMO_ATTR_DISTANCE: - return toString(myNBEdge->getDistance()); - case GNE_ATTR_MODIFICATION_STATUS: - return myConnectionStatus; - case GNE_ATTR_SHAPE_START: - if (myNBEdge->getGeometry().front() == myGNEJunctionSource->getPositionInView()) { - return ""; - } else { - return toString(myNBEdge->getGeometry().front()); - } - case GNE_ATTR_SHAPE_END: - if (myNBEdge->getGeometry().back() == myGNEJunctionDestiny->getPositionInView()) { - return ""; - } else { - return toString(myNBEdge->getGeometry().back()); - } - case GNE_ATTR_BIDIR: - return toString(myNBEdge->isBidiRail()); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return myNBEdge->getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -std::string -GNEEdge::getAttributeForSelection(SumoXMLAttr key) const { - std::string result = getAttribute(key); - if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) { - result += " " + getVehicleClassNames(SVCAll, true); - } - return result; -} - -void -GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) { - switch (key) { - case SUMO_ATTR_WIDTH: - case SUMO_ATTR_ENDOFFSET: - case SUMO_ATTR_SPEED: - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: { - undoList->p_begin("change " + getTagStr() + " attribute"); - const std::string origValue = myLanes.at(0)->getAttribute(key); // will have intermediate value of "lane specific" - // lane specific attributes need to be changed via lanes to allow undo - for (auto it : myLanes) { - it->setAttribute(key, value, undoList); - } - // ensure that the edge value is also changed. Actually this sets the lane attributes again but it does not matter - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value, true, origValue)); - undoList->p_end(); - break; - } - case SUMO_ATTR_FROM: { - undoList->p_begin("change " + getTagStr() + " attribute"); - // Remove edge from crossings of junction source - removeEdgeFromCrossings(myGNEJunctionSource, undoList); - // continue changing from junction - GNEJunction* oldGNEJunctionSource = myGNEJunctionSource; - myGNEJunctionSource->setLogicValid(false, undoList); - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - myGNEJunctionSource->setLogicValid(false, undoList); - myNet->retrieveJunction(value)->setLogicValid(false, undoList); - setAttribute(GNE_ATTR_SHAPE_START, toString(myGNEJunctionSource->getNBNode()->getPosition()), undoList); - myGNEJunctionSource->invalidateShape(); - undoList->p_end(); - // update geometries of all implicated junctions - oldGNEJunctionSource->updateGeometry(); - myGNEJunctionSource->updateGeometry(); - myGNEJunctionDestiny->updateGeometry(); - break; - } - case SUMO_ATTR_TO: { - undoList->p_begin("change " + getTagStr() + " attribute"); - // Remove edge from crossings of junction destiny - removeEdgeFromCrossings(myGNEJunctionDestiny, undoList); - // continue changing destiny junction - GNEJunction* oldGNEJunctionDestiny = myGNEJunctionDestiny; - myGNEJunctionDestiny->setLogicValid(false, undoList); - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - myGNEJunctionDestiny->setLogicValid(false, undoList); - myNet->retrieveJunction(value)->setLogicValid(false, undoList); - setAttribute(GNE_ATTR_SHAPE_END, toString(myGNEJunctionDestiny->getNBNode()->getPosition()), undoList); - myGNEJunctionDestiny->invalidateShape(); - undoList->p_end(); - // update geometries of all implicated junctions - oldGNEJunctionDestiny->updateGeometry(); - myGNEJunctionDestiny->updateGeometry(); - myGNEJunctionSource->updateGeometry(); - break; - } - case SUMO_ATTR_ID: - case SUMO_ATTR_PRIORITY: - case SUMO_ATTR_LENGTH: - case SUMO_ATTR_TYPE: - case SUMO_ATTR_SPREADTYPE: - case SUMO_ATTR_DISTANCE: - case GNE_ATTR_MODIFICATION_STATUS: - case GNE_ATTR_SHAPE_START: - case GNE_ATTR_SHAPE_END: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - case SUMO_ATTR_NAME: - // user cares about street names. Make sure they appear in the output - OptionsCont::getOptions().resetWritable(); - OptionsCont::getOptions().set("output.street-names", "true"); - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - case SUMO_ATTR_NUMLANES: - if (value != getAttribute(key)) { - // Remove edge from crossings of junction source - removeEdgeFromCrossings(myGNEJunctionSource, undoList); - // Remove edge from crossings of junction destiny - removeEdgeFromCrossings(myGNEJunctionDestiny, undoList); - // set num lanes - setNumLanes(parse(value), undoList); - } - break; - case SUMO_ATTR_SHAPE: - // @note: assumes value of inner geometry! - // actually the geometry is already updated (incrementally - // during mouse movement). We set the restore point to the end - // of the last change-set - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - case GNE_ATTR_BIDIR: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEEdge::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) == nullptr); - case SUMO_ATTR_FROM: { - // check that is a valid ID and is different of ID of junction destiny - if (SUMOXMLDefinitions::isValidNetID(value) && (value != myGNEJunctionDestiny->getMicrosimID())) { - GNEJunction* junctionFrom = myNet->retrieveJunction(value, false); - // check that there isn't already another edge with the same From and To Edge - if ((junctionFrom != nullptr) && (myNet->retrieveEdge(junctionFrom, myGNEJunctionDestiny, false) == nullptr)) { - return true; - } else { - return false; - } - } else { - return false; - } - } - case SUMO_ATTR_TO: { - // check that is a valid ID and is different of ID of junction Source - if (SUMOXMLDefinitions::isValidNetID(value) && (value != myGNEJunctionSource->getMicrosimID())) { - GNEJunction* junctionTo = myNet->retrieveJunction(value, false); - // check that there isn't already another edge with the same From and To Edge - if ((junctionTo != nullptr) && (myNet->retrieveEdge(myGNEJunctionSource, junctionTo, false) == nullptr)) { - return true; - } else { - return false; - } - } else { - return false; - } - } - case SUMO_ATTR_SPEED: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_NUMLANES: - return canParse(value) && (parse(value) > 0); - case SUMO_ATTR_PRIORITY: - return canParse(value); - case SUMO_ATTR_LENGTH: - return canParse(value) && ((parse(value) > 0) || (parse(value) == NBEdge::UNSPECIFIED_LOADED_LENGTH)); - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - return canParseVehicleClasses(value); - case SUMO_ATTR_TYPE: - return true; - case SUMO_ATTR_SHAPE: - // empty shapes are allowed - return canParse(value); - case SUMO_ATTR_SPREADTYPE: - return SUMOXMLDefinitions::LaneSpreadFunctions.hasString(value); - case SUMO_ATTR_NAME: - return true; - case SUMO_ATTR_WIDTH: - return canParse(value) && ((parse(value) >= -1) || (parse(value) == NBEdge::UNSPECIFIED_WIDTH)); - case SUMO_ATTR_ENDOFFSET: - return canParse(value) && parse(value) >= 0 && parse(value) < myNBEdge->getLoadedLength(); - case SUMO_ATTR_DISTANCE: - return canParse(value); - case GNE_ATTR_SHAPE_START: { - if (value.empty()) { - return true; - } else if (canParse(value)) { - Position shapeStart = parse(value); - return (shapeStart != myNBEdge->getGeometry()[-1]); - } else { - return false; - } - } - case GNE_ATTR_SHAPE_END: { - if (value.empty()) { - return true; - } else if (canParse(value)) { - Position shapeEnd = parse(value); - return (shapeEnd != myNBEdge->getGeometry()[0]); - } else { - return false; - } - } - case GNE_ATTR_BIDIR: - return false; - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEEdge::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case GNE_ATTR_BIDIR: - return false; - default: - return true; - } -} - - -void -GNEEdge::setResponsible(bool newVal) { - myAmResponsible = newVal; -} - - -GNELane* -GNEEdge::getLaneByAllowedVClass(const SUMOVehicleClass vClass) const { - // iterate over all NBEdge lanes - for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) { - // if given VClass is in permissions, return lane - if (myNBEdge->getLanes().at(i).permissions & vClass) { - // return GNELane - return myLanes.at(i); - } - } - // return first lane - return myLanes.front(); -} - - -GNELane* -GNEEdge::getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const { - // iterate over all NBEdge lanes - for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) { - // if given VClass isn't in permissions, return lane - if (~(myNBEdge->getLanes().at(i).permissions) & vClass) { - // return GNELane - return myLanes.at(i); - } - } - // return first lane - return myLanes.front(); -} - - -void -GNEEdge::drawPartialRoute(const GUIVisualizationSettings& s, const GNEDemandElement* route, const GNEJunction* junction) const { - // calculate route width - double routeWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.route; - // obtain color - RGBColor routeColor; - if (route->drawUsingSelectColor()) { - routeColor = s.colorSettings.selectedRouteColor; - } else { - routeColor = route->getColor(); - } - // Start drawing adding an gl identificator - glPushName(route->getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, route->getType()); - // draw route - if (junction) { - // iterate over segments - for (const auto& segment : route->getDemandElementSegmentGeometry()) { - // draw partial segment - if ((segment.junction == junction) && (segment.AC == route)) { - // Set route color (needed due drawShapeDottedContour) - GLHelper::setColor(routeColor); - // draw box lines - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == route) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth); - } - } - } - } else { - // iterate over segments - for (const auto& segment : route->getDemandElementSegmentGeometry()) { - // draw partial segment - if ((segment.edge == this) && (segment.AC == route)) { - // Set route color (needed due drawShapeDottedContour) - GLHelper::setColor(routeColor); - // draw box lines - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == route) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth); - } - } - } - } - // Pop last matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - } - // Pop name - glPopName(); - // draw route children - for (const auto& i : route->getChildDemandElements()) { - if (i->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) { - drawPartialPersonPlan(s, i, junction); - } - } -} - - -void -GNEEdge::drawPartialTripFromTo(const GUIVisualizationSettings& s, const GNEDemandElement* tripOrFromTo, const GNEJunction* junction) const { - // calculate tripOrFromTo width - double tripOrFromToWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.trip; - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, tripOrFromTo->getType()); - // Set color of the base - if (tripOrFromTo->drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedVehicleColor); - } else { - GLHelper::setColor(s.colorSettings.vehicleTrips); - } - // draw trip from to - if (junction) { - // iterate over segments - if (myNet->getViewNet()->getCommonViewOptions().drawSpreadVehicles()) { - for (const auto& segment : tripOrFromTo->getDemandElementSegmentSpreadGeometry()) { - // draw partial segment - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); - } - } else { - for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) { - // draw partial segment - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); - } - } - } else { - // iterate over segments - if (myNet->getViewNet()->getCommonViewOptions().drawSpreadVehicles()) { - for (const auto& segment : tripOrFromTo->getDemandElementSegmentSpreadGeometry()) { - // draw partial segment - if ((segment.edge == this) && (segment.AC == tripOrFromTo)) { - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); - } - } - } else { - for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) { - // draw partial segment - if ((segment.edge == this) && (segment.AC == tripOrFromTo)) { - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth); - } - } - } - } - // Pop last matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - } -} - - -void -GNEEdge::drawPartialPersonPlan(const GUIVisualizationSettings& s, const GNEDemandElement* personPlan, const GNEJunction* junction) const { - // declare flag to enable or disable draw person plan - bool drawPersonPlan = false; - if (myNet->getViewNet()->getDemandViewOptions().showAllPersonPlans()) { - drawPersonPlan = true; - } else if (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) { - drawPersonPlan = true; - } else if (myNet->getViewNet()->getDemandViewOptions().getLockedPerson() == personPlan->getParentDemandElements().front()) { - drawPersonPlan = true; - } else if (myNet->getViewNet()->getDottedAC() && myNet->getViewNet()->getDottedAC()->getTagProperty().isPersonPlan() && - (myNet->getViewNet()->getDottedAC()->getAttribute(GNE_ATTR_PARENT) == personPlan->getAttribute(GNE_ATTR_PARENT))) { - drawPersonPlan = true; - } - // check if draw person plan elements can be drawn - if (drawPersonPlan) { - // calculate personPlan width - double personPlanWidth = 0; - // flag to check if width must be duplicated - bool duplicateWidth = (myNet->getViewNet()->getDottedAC() == personPlan) || (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) ? true : false; - // Set width depending of person plan type - if (personPlan->getTagProperty().isPersonTrip()) { - personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.personTrip; - } else if (personPlan->getTagProperty().isWalk()) { - personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.walk; - } else if (personPlan->getTagProperty().isRide()) { - personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.ride; - } - // check if width has to be duplicated - if (duplicateWidth) { - personPlanWidth *= 2; - } - // set personPlan color - RGBColor personPlanColor; - // Set color depending of person plan type - if (personPlan->drawUsingSelectColor()) { - personPlanColor = s.colorSettings.selectedPersonPlanColor; - } else if (personPlan->getTagProperty().isPersonTrip()) { - personPlanColor = s.colorSettings.personTrip; - } else if (personPlan->getTagProperty().isWalk()) { - personPlanColor = s.colorSettings.walk; - } else if (personPlan->getTagProperty().isRide()) { - personPlanColor = s.colorSettings.ride; - } - // Start drawing adding an gl identificator - glPushName(personPlan->getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, personPlan->getType()); - // draw person plan - if (junction) { - // iterate over segments - for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) { - // draw partial segment - if ((segment.junction == junction) && (segment.AC == personPlan)) { - // Set person plan color (needed due drawShapeDottedContour) - GLHelper::setColor(personPlanColor); - // draw box line - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == personPlan) { - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); - } - } - } - } else { - // iterate over segments - for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) { - // draw partial segment - if ((segment.edge == this) && (segment.AC == personPlan)) { - // Set person plan color (needed due drawShapeDottedContour) - GLHelper::setColor(personPlanColor); - // draw box line - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == personPlan) { - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth); - } - } - } - } - // Pop last matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - } - // Pop name - glPopName(); - // check if person plan ArrivalPos attribute - if (personPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) { - // obtain arrival position using last segment - const Position& arrivalPos = personPlan->getDemandElementSegmentGeometry().getLastPosition(); - // only draw arrival position point if isn't -1 - if (arrivalPos != Position::INVALID) { - // obtain circle width - const double circleWidth = (duplicateWidth ? SNAP_RADIUS : (SNAP_RADIUS / 2.0)) * MIN2((double)0.5, s.laneWidthExaggeration); - const double circleWidthSquared = circleWidth * circleWidth; - if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(arrivalPos) <= (circleWidthSquared + 2))) { - glPushMatrix(); - // translate to pos and move to upper using GLO_PERSONTRIP (to avoid overlapping) - glTranslated(arrivalPos.x(), arrivalPos.y(), GLO_PERSONTRIP + 0.01); - // Set color depending of person plan type - if (personPlan->drawUsingSelectColor()) { - GLHelper::setColor(s.colorSettings.selectedPersonPlanColor); - } else if (personPlan->getTagProperty().isPersonTrip()) { - GLHelper::setColor(s.colorSettings.personTrip); - } else if (personPlan->getTagProperty().isWalk()) { - GLHelper::setColor(s.colorSettings.walk); - } else if (personPlan->getTagProperty().isRide()) { - GLHelper::setColor(s.colorSettings.ride); - } - // resolution of drawn circle depending of the zoom (To improve smothness) - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - glPopMatrix(); - } - } - } - } - // draw person if this edge correspond to the first edge of first Person's person plan - GNEEdge* firstEdge = nullptr; - const GNEDemandElement* firstPersonPlan = personPlan->getParentDemandElements().front()->getChildDemandElements().front(); - if (firstPersonPlan->getTagProperty().isPersonStop()) { - if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_PERSONSTOP_LANE) { - // obtain edge of parent lane - firstEdge = firstPersonPlan->getParentLanes().front()->getParentEdge(); - } else { - // obtain edge of busstop's parent lane - firstEdge = firstPersonPlan->getParentAdditionals().front()->getParentLanes().front()->getParentEdge(); - } - } else if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) { - // obtain first rute edge - firstEdge = firstPersonPlan->getParentDemandElements().at(1)->getParentEdges().front(); - } else { - // obtain first parent edge - firstEdge = firstPersonPlan->getParentEdges().front(); - } - // draw person parent if this is the edge first edge and this is the first plan - if ((firstEdge == this) && (firstPersonPlan == personPlan)) { - personPlan->getParentDemandElements().front()->drawGL(s); - } -} - - -void -GNEEdge::addPathElement(GNEDemandElement* pathElementChild) { - // avoid insert duplicatd path element childs - if (std::find(myPathElementChilds.begin(), myPathElementChilds.end(), pathElementChild) == myPathElementChilds.end()) { - myPathElementChilds.push_back(pathElementChild); - } -} - - -void -GNEEdge::removePathElement(GNEDemandElement* pathElementChild) { - // search and remove pathElementChild - auto it = std::find(myPathElementChilds.begin(), myPathElementChilds.end(), pathElementChild); - if (it != myPathElementChilds.end()) { - myPathElementChilds.erase(it); - } -} - - -void -GNEEdge::invalidatePathChildElementss() { - // make a copy of myPathElementChilds - auto copyOfMyPathElementChilds = myPathElementChilds; - for (const auto& pathElementChild : copyOfMyPathElementChilds) { - pathElementChild->invalidatePath(); - } -} - - -void -GNEEdge::updateVehicleSpreadGeometries() { - // get lane vehicles map - const std::map > laneVehiclesMap = getVehiclesOverEdgeMap(); - // iterate over every lane - for (const auto& laneVehicle : laneVehiclesMap) { - // obtain total lenght - double totalLength = 0; - for (const auto& vehicle : laneVehicle.second) { - totalLength += vehicle->getAttributeDouble(SUMO_ATTR_LENGTH) + VEHICLE_GAP; - } - // calculate multiplier for vehicle positions - double multiplier = 1; - const double laneShapeLenght = laneVehicle.first->getLaneShape().length(); - if (laneShapeLenght == 0) { - multiplier = 0; - } else if (totalLength > laneShapeLenght) { - multiplier = (laneShapeLenght / totalLength); - } - // declare current lenght - double lenght = 0; - // iterate over vehicles to calculate position and rotations - for (const auto& vehicle : laneVehicle.second) { - vehicle->updateDemandElementSpreadGeometry(laneVehicle.first, lenght * multiplier); - // update lenght - lenght += vehicle->getAttributeDouble(SUMO_ATTR_LENGTH) + VEHICLE_GAP; - } - } -} - - -void -GNEEdge::updateVehicleStackLabels() { - // get lane vehicles map - const std::map > laneVehiclesMap = getVehiclesOverEdgeMap(); - // declare map for sprt vehicles using their departpos+lenght position (StackPosition) - std::vector > departPosVehicles; - // declare vector of stack demand elements - std::vector stackedVehicles; - // iterate over laneVehiclesMap and obtain a vector with - for (const auto& vehicleMap : laneVehiclesMap) { - // iterate over vehicles - for (const auto& vehicle : vehicleMap.second) { - // get vehicle's depart pos and lenght - const double departPos = vehicle->getAttributeDouble(SUMO_ATTR_DEPARTPOS); - const double length = vehicle->getAttributeDouble(SUMO_ATTR_LENGTH); - double posOverLane = vehicle->getAttributeDouble(SUMO_ATTR_DEPARTPOS); - // check if we have to adapt posOverLane - if (posOverLane < 0) { - posOverLane += vehicleMap.first->getLaneShape().length(); - } - // make a stack position using departPos and length - departPosVehicles.push_back(std::make_pair(StackPosition(departPos, length), vehicle)); - // update depart element geometry - vehicle->updateDemandElementGeometry(vehicleMap.first, posOverLane); - // reset vehicle stack label - vehicle->updateDemandElementStackLabel(0); - } - } - // sort departPosVehicles - std::sort(departPosVehicles.begin(), departPosVehicles.end()); - // iterate over departPosVehicles - for (const auto& departPosVehicle : departPosVehicles) { - // obtain stack position and vehicle - const GNEEdge::StackPosition& vehicleStackPosition = departPosVehicle.first; - GNEDemandElement* vehicle = departPosVehicle.second; - // if stackedVehicles is empty, add a new StackDemandElements - if (stackedVehicles.empty()) { - stackedVehicles.push_back(GNEEdge::StackDemandElements(vehicleStackPosition, vehicle)); - } else if (areStackPositionOverlapped(vehicleStackPosition, stackedVehicles.back().getStackPosition())) { - // add new vehicle to last inserted stackDemandElements - stackedVehicles[stackedVehicles.size() - 1].addDemandElements(vehicle); - } else { - // No overlapping, then add a new StackDemandElements - stackedVehicles.push_back(GNEEdge::StackDemandElements(vehicleStackPosition, vehicle)); - } - } - // iterate over stackedVehicles - for (const auto& vehicle : stackedVehicles) { - // only update vehicles with one or more stack - if (vehicle.getDemandElements().size() > 1) { - // set stack labels - vehicle.getDemandElements().front()->updateDemandElementStackLabel((int)vehicle.getDemandElements().size()); - } - } -} - -// =========================================================================== -// private -// =========================================================================== - -GNEEdge::StackPosition::StackPosition(const double departPos, const double length) : - tuple(departPos, departPos + length) { -} - - -double -GNEEdge::StackPosition::beginPosition() const { - return std::get<0>(*this); -} - - -double -GNEEdge::StackPosition::endPosition() const { - return std::get<1>(*this); -} - - -GNEEdge::StackDemandElements::StackDemandElements(const StackPosition stackedPosition, GNEDemandElement* demandElement) : - tuple(stackedPosition, { - demandElement -}) { -} - - -void -GNEEdge::StackDemandElements::addDemandElements(GNEDemandElement* demandElement) { - std::get<1>(*this).push_back(demandElement); -} - - -const GNEEdge::StackPosition& -GNEEdge::StackDemandElements::getStackPosition() const { - return std::get<0>(*this); -} - - -const std::vector& -GNEEdge::StackDemandElements::getDemandElements() const { - return std::get<1>(*this); -} - - -void -GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - myNet->renameEdge(this, value); - break; - case SUMO_ATTR_FROM: - myNet->changeEdgeEndpoints(this, value, myGNEJunctionDestiny->getMicrosimID()); - // update this edge of list of outgoings edges of the old GNEJunctionSource - myGNEJunctionSource->removeOutgoingGNEEdge(this); - // update GNEJunctionSource - myGNEJunctionSource = myNet->retrieveJunction(myNBEdge->getFromNode()->getID()); - // update this edge of list of outgoings edges of the new GNEJunctionSource - myGNEJunctionSource->addOutgoingGNEEdge(this); - break; - case SUMO_ATTR_TO: - myNet->changeEdgeEndpoints(this, myGNEJunctionSource->getMicrosimID(), value); - // update this edge of list of incomings edges of the old GNEJunctionDestiny - myGNEJunctionDestiny->removeIncomingGNEEdge(this); - // update GNEJunctionDestiny - myGNEJunctionDestiny = myNet->retrieveJunction(myNBEdge->getToNode()->getID()); - // update this edge of list of incomings edges of the new GNEJunctionDestiny - myGNEJunctionDestiny->addIncomingGNEEdge(this); - break; - case SUMO_ATTR_NUMLANES: - throw InvalidArgument("GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen"); - break; - case SUMO_ATTR_PRIORITY: - myNBEdge->myPriority = parse(value); - break; - case SUMO_ATTR_LENGTH: - myNBEdge->setLoadedLength(parse(value)); - break; - case SUMO_ATTR_TYPE: - myNBEdge->myType = value; - break; - case SUMO_ATTR_SHAPE: - // start geometry moving (because a new shape affect all child edges) - startGeometryMoving(); - // set new geometry - setGeometry(parse(value), true); - // start geometry moving (because a new shape affect all child edges) - endGeometryMoving(); - break; - case SUMO_ATTR_SPREADTYPE: - myNBEdge->setLaneSpreadFunction(SUMOXMLDefinitions::LaneSpreadFunctions.get(value)); - break; - case SUMO_ATTR_NAME: - myNBEdge->setStreetName(value); - break; - case SUMO_ATTR_SPEED: - myNBEdge->setSpeed(-1, parse(value)); - break; - case SUMO_ATTR_WIDTH: - myNBEdge->setLaneWidth(-1, parse(value)); - break; - case SUMO_ATTR_ENDOFFSET: - myNBEdge->setEndOffset(-1, parse(value)); - break; - case SUMO_ATTR_ALLOW: - break; // no edge value - case SUMO_ATTR_DISALLOW: - break; // no edge value - case SUMO_ATTR_DISTANCE: - myNBEdge->setDistance(parse(value)); - break; - case GNE_ATTR_MODIFICATION_STATUS: - myConnectionStatus = value; - if (value == FEATURE_GUESSED) { - WRITE_DEBUG("invalidating (removing) connections of edge '" + getID() + "' due it were guessed"); - myNBEdge->invalidateConnections(true); - clearGNEConnections(); - } else if (value != FEATURE_GUESSED) { - WRITE_DEBUG("declaring connections of edge '" + getID() + "' as loaded (It will not be removed)"); - myNBEdge->declareConnectionsAsLoaded(); - } - break; - case GNE_ATTR_SHAPE_START: { - // get geometry of NBEdge, remove FIRST element with the new value (or with the Junction Source position) and set it back to edge - Position newShapeStart; - if (value == "") { - newShapeStart = myGNEJunctionSource->getPositionInView(); - } else { - newShapeStart = parse(value); - } - // start geometry moving (because a new shape affect all child edges) - startGeometryMoving(); - // set shape start position - setShapeStartPos(newShapeStart); - // end geometry moving - endGeometryMoving(); - break; - } - case GNE_ATTR_SHAPE_END: { - // get geometry of NBEdge, remove LAST element with the new value (or with the Junction Destiny position) and set it back to edge - Position newShapeEnd; - if (value == "") { - newShapeEnd = myGNEJunctionDestiny->getPositionInView(); - } else { - newShapeEnd = parse(value); - } - // start geometry moving (because a new shape affect all child edges) - startGeometryMoving(); - // set shape end position - setShapeEndPos(newShapeEnd); - // end geometry moving - endGeometryMoving(); - break; - } - case GNE_ATTR_BIDIR: - throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified"); - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - myNBEdge->setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEEdge::updateDottedContour() { - // obtain lanes - const GNELane* frontLane = myLanes.front(); - const GNELane* backLane = myLanes.back(); - // obtain visualization settings - const GUIVisualizationSettings& visualizationSetting = myNet->getViewNet()->getVisualisationSettings(); - // obtain lane widdths - const double myHalfLaneWidthFront = myNBEdge->getLaneWidth(frontLane->getIndex()) / 2; - const double myHalfLaneWidthBack = (visualizationSetting.spreadSuperposed && backLane->drawAsRailway(visualizationSetting) && - myNBEdge->isBidiRail()) ? 0 : myNBEdge->getLaneWidth(backLane->getIndex()) / 2; - // obtain shapes from NBEdge - PositionVector mainShape = frontLane->getParentEdge()->getNBEdge()->getLaneShape(frontLane->getIndex()); - PositionVector backShape = backLane->getParentEdge()->getNBEdge()->getLaneShape(backLane->getIndex()); - // move to side depending of lefthand - if (visualizationSetting.lefthand) { - mainShape.move2side(myHalfLaneWidthFront * -1); - backShape.move2side(myHalfLaneWidthBack); - } else { - mainShape.move2side(myHalfLaneWidthFront); - backShape.move2side(myHalfLaneWidthBack * -1); - } - // reverse back shape - backShape = backShape.reverse(); - // add back shape into mainShape - for (const auto& position : backShape) { - mainShape.push_back(position); - } - // close polygon - mainShape.closePolygon(); - // update edge dotted geometry - updateDottedGeometry(mainShape); -} - - -void -GNEEdge::setNumLanes(int numLanes, GNEUndoList* undoList) { - // begin undo list - undoList->p_begin("change number of " + toString(SUMO_TAG_LANE) + "s"); - // invalidate logic of source/destiny edges - myGNEJunctionSource->setLogicValid(false, undoList); - myGNEJunctionDestiny->setLogicValid(false, undoList); - // disable update geometry (see #6336) - myUpdateGeometry = false; - // remove edge of RTREE - myNet->removeGLObjectFromGrid(this); - const int oldNumLanes = (int)myLanes.size(); - for (int i = oldNumLanes; i < numLanes; i++) { - // since the GNELane does not exist yet, it cannot have yet been referenced so we only pass a zero-pointer - undoList->add(new GNEChange_Lane(this, nullptr, myNBEdge->getLaneStruct(oldNumLanes - 1), true), true); - } - for (int i = (oldNumLanes - 1); i > (numLanes - 1); i--) { - // delete leftmost lane - undoList->add(new GNEChange_Lane(this, myLanes[i], myNBEdge->getLaneStruct(i), false), true); - } - // enable updateGeometry again - myUpdateGeometry = true; - // insert edge in RTREE again - myNet->addGLObjectIntoGrid(this); - // update geometry of entire edge - updateGeometry(); - // end undo list - undoList->p_end(); -} - - -void -GNEEdge::addLane(GNELane* lane, const NBEdge::Lane& laneAttrs, bool recomputeConnections) { - // boundary of edge depends of number of lanes. We need to extract if before add or remove lane - if (myUpdateGeometry) { - myNet->removeGLObjectFromGrid(this); - } - const int index = lane ? lane->getIndex() : myNBEdge->getNumLanes(); - // the laneStruct must be created first to ensure we have some geometry - // unless the connections are fully recomputed, existing indices must be shifted - myNBEdge->addLane(index, true, recomputeConnections, !recomputeConnections); - if (lane) { - // restore a previously deleted lane - myLanes.insert(myLanes.begin() + index, lane); - - } else { - // create a new lane by copying leftmost lane - lane = new GNELane(this, index); - myLanes.push_back(lane); - } - lane->incRef("GNEEdge::addLane"); - // check if lane is selected - if (lane->isAttributeCarrierSelected()) { - lane->selectAttributeCarrier(); - } - // we copy all attributes except shape since this is recomputed from edge shape - myNBEdge->setSpeed(lane->getIndex(), laneAttrs.speed); - myNBEdge->setPermissions(laneAttrs.permissions, lane->getIndex()); - myNBEdge->setPreferredVehicleClass(laneAttrs.preferred, lane->getIndex()); - myNBEdge->setEndOffset(lane->getIndex(), laneAttrs.endOffset); - myNBEdge->setLaneWidth(lane->getIndex(), laneAttrs.width); - // udate indices - for (int i = 0; i < (int)myLanes.size(); ++i) { - myLanes[i]->setIndex(i); - } - /* while technically correct, this looks ugly - myGNEJunctionSource->invalidateShape(); - myGNEJunctionDestiny->invalidateShape(); - */ - // Remake connections for this edge and all edges that target this lane - remakeGNEConnections(); - // remake connections of all edges of junction source and destiny - for (auto i : myGNEJunctionSource->getGNEEdges()) { - i->remakeGNEConnections(); - } - // remake connections of all edges of junction source and destiny - for (auto i : myGNEJunctionDestiny->getGNEEdges()) { - i->remakeGNEConnections(); - } - // add object again - if (myUpdateGeometry) { - myNet->addGLObjectIntoGrid(this); - } - // Update geometry with the new lane - updateGeometry(); -} - - -void -GNEEdge::removeLane(GNELane* lane, bool recomputeConnections) { - // boundary of edge depends of number of lanes. We need to extract if before add or remove lane - if (myUpdateGeometry) { - myNet->removeGLObjectFromGrid(this); - } - if (myLanes.size() == 0) { - throw ProcessError("Should not remove the last " + toString(SUMO_TAG_LANE) + " from an " + getTagStr()); - } - if (lane == nullptr) { - lane = myLanes.back(); - } - // check if lane is selected - if (lane->isAttributeCarrierSelected()) { - lane->unselectAttributeCarrier(); - } - // Delete lane of edge's container - // unless the connections are fully recomputed, existing indices must be shifted - myNBEdge->deleteLane(lane->getIndex(), recomputeConnections, !recomputeConnections); - lane->decRef("GNEEdge::removeLane"); - myLanes.erase(myLanes.begin() + lane->getIndex()); - // Delete lane if is unreferenced - if (lane->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in removeLane()"); - delete lane; - } - // udate indices - for (int i = 0; i < (int)myLanes.size(); ++i) { - myLanes[i]->setIndex(i); - } - /* while technically correct, this looks ugly - myGNEJunctionSource->invalidateShape(); - myGNEJunctionDestiny->invalidateShape(); - */ - // Remake connections of this edge - remakeGNEConnections(); - // remake connections of all edges of junction source and destiny - for (auto i : myGNEJunctionSource->getGNEEdges()) { - i->remakeGNEConnections(); - } - // remake connections of all edges of junction source and destiny - for (auto i : myGNEJunctionDestiny->getGNEEdges()) { - i->remakeGNEConnections(); - } - // add object again - if (myUpdateGeometry) { - myNet->addGLObjectIntoGrid(this); - } - // Update element - updateGeometry(); -} - - -void -GNEEdge::addConnection(NBEdge::Connection nbCon, bool selectAfterCreation) { - // If a new connection was sucesfully created - if (myNBEdge->setConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, NBEdge::L2L_USER, true, nbCon.mayDefinitelyPass, - nbCon.keepClear, nbCon.contPos, nbCon.visibility, - nbCon.speed, nbCon.customShape, nbCon.uncontrolled)) { - // Create or retrieve existent GNEConection - GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane); - // add it to GNEConnection container - myGNEConnections.push_back(con); - // Add reference - myGNEConnections.back()->incRef("GNEEdge::addConnection"); - // select GNEConnection if needed - if (selectAfterCreation) { - con->selectAttributeCarrier(); - } - // update geometry - con->updateGeometry(); - // iterate over all additionals from "from" lane and check E2 multilane integrity - for (auto i : con->getLaneFrom()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - // iterate over all additionals from "to" lane and check E2 multilane integrity - for (auto i : con->getLaneTo()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - } - // actually we only do this to force a redraw - updateGeometry(); -} - - -void -GNEEdge::removeConnection(NBEdge::Connection nbCon) { - // check if is a explicit turnaround - if (nbCon.toEdge == myNBEdge->getTurnDestination()) { - myNet->removeExplicitTurnaround(getMicrosimID()); - } - // remove NBEdge::connection from NBEdge - myNBEdge->removeFromConnections(nbCon); - // remove their associated GNEConnection - GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, false); - if (con != nullptr) { - con->decRef("GNEEdge::removeConnection"); - myGNEConnections.erase(std::find(myGNEConnections.begin(), myGNEConnections.end(), con)); - // iterate over all additionals from "from" lane and check E2 multilane integrity - for (auto i : con->getLaneFrom()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - // iterate over all additionals from "to" lane and check E2 multilane integrity - for (auto i : con->getLaneTo()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - // check if connection is selected - if (con->isAttributeCarrierSelected()) { - con->unselectAttributeCarrier(); - } - if (con->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + con->getTagStr() + " '" + con->getID() + "' in removeConnection()"); - delete con; - // actually we only do this to force a redraw - updateGeometry(); - } - } -} - - -GNEConnection* -GNEEdge::retrieveGNEConnection(int fromLane, NBEdge* to, int toLane, bool createIfNoExist) { - for (auto i : myGNEConnections) { - if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) { - return i; - } - } - if (createIfNoExist) { - // create new connection. Will be added to the rTree on first geometry computation - GNEConnection* createdConnection = new GNEConnection(myLanes[fromLane], myNet->retrieveEdge(to->getID())->getLanes()[toLane]); - // show extra information for tests - WRITE_DEBUG("Created " + createdConnection->getTagStr() + " '" + createdConnection->getID() + "' in retrieveGNEConnection()"); - // iterate over all additionals from "from" lane and check E2 multilane integrity - for (auto i : createdConnection->getLaneFrom()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - // iterate over all additionals from "to" lane and check E2 multilane integrity - for (auto i : createdConnection->getLaneTo()->getChildAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - dynamic_cast(i)->checkE2MultilaneIntegrity(); - } - } - return createdConnection; - } else { - return nullptr; - } -} - - - -void -GNEEdge::setMicrosimID(const std::string& newID) { - GUIGlObject::setMicrosimID(newID); - for (auto i : myLanes) { - i->setMicrosimID(getNBEdge()->getLaneID(i->getIndex())); - } -} - - -bool -GNEEdge::hasRestrictedLane(SUMOVehicleClass vclass) const { - for (auto i : myLanes) { - if (i->isRestricted(vclass)) { - return true; - } - } - return false; -} - - -void -GNEEdge::removeEdgeFromCrossings(GNEJunction* junction, GNEUndoList* undoList) { - // Remove all crossings that contain this edge in parameter "edges" - for (GNECrossing* const i : junction->getGNECrossings()) { - if (i->checkEdgeBelong(this)) { - myNet->deleteCrossing(i, undoList); - } - } -} - - -void -GNEEdge::straightenElevation(GNEUndoList* undoList) { - PositionVector modifiedShape = myNBEdge->getGeometry().interpolateZ( - myNBEdge->getFromNode()->getPosition().z(), - myNBEdge->getToNode()->getPosition().z()); - PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); - setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); -} - - -PositionVector -GNEEdge::smoothShape(const PositionVector& old, bool forElevation) { - const OptionsCont& oc = OptionsCont::getOptions(); - // distinguish 3 cases: - // a) if the edge has exactly 3 or 4 points, use these as control points - // b) if the edge has more than 4 points, use the first 2 and the last 2 as control points - // c) if the edge is straight and both nodes are geometry-like nodes, use geometry of the continuation edges as control points - PositionVector init; -#ifdef DEBUG_SMOOTH_GEOM - if (DEBUGCOND(this)) std::cout << getID() - << " forElevation=" << forElevation - << " fromGeometryLike=" << myNBEdge->getFromNode()->geometryLike() - << " toGeometryLike=" << myNBEdge->getToNode()->geometryLike() - << " smoothShape old=" << old << "\n"; -#endif - if (old.size() == 3 || old.size() == 4) { - init = old; - } else if (old.size() > 4 && !forElevation) { - // for elevation, the initial segments are not useful - init.push_back(old[0]); - init.push_back(old[1]); - init.push_back(old[-2]); - init.push_back(old[-1]); - } else if (myNBEdge->getFromNode()->geometryLike() && myNBEdge->getToNode()->geometryLike()) { - PositionVector begShape; - PositionVector endShape; - const EdgeVector& incoming = myNBEdge->getFromNode()->getIncomingEdges(); - const EdgeVector& outgoing = myNBEdge->getToNode()->getOutgoingEdges(); - if (incoming.size() == 1) { - begShape = incoming[0]->getGeometry(); - } else { - assert(incoming.size() == 2); - begShape = myNBEdge->isTurningDirectionAt(incoming[0]) ? incoming[1]->getGeometry() : incoming[0]->getGeometry(); - } - if (outgoing.size() == 1) { - endShape = outgoing[0]->getGeometry(); - } else { - assert(outgoing.size() == 2); - endShape = myNBEdge->isTurningDirectionAt(outgoing[0]) ? outgoing[1]->getGeometry() : outgoing[0]->getGeometry(); - } - const double dist = MIN2(old.length2D(), MAX2(old.length2D() / 8, fabs(old[0].z() - old[-1].z()) * OptionsCont::getOptions().getFloat("geometry.max-grade") / 3)); - if (forElevation) { - // initialize control point elevation for smooth continuation - init.push_back(old[0]); - init.push_back(old.positionAtOffset2D(dist)); - init.push_back(old.positionAtOffset2D(old.length2D() - dist)); - init.push_back(old[-1]); - double begZ = begShape.positionAtOffset2D(MAX2(0.0, begShape.length2D() - dist)).z(); - double endZ = endShape.positionAtOffset2D(MIN2(begShape.length2D(), dist)).z(); - // continue incline - init[1].setz(2 * init[0].z() - begZ); - init[2].setz(2 * init[-1].z() - endZ); - } else { - bool ok = true; - const double straightThresh = DEG2RAD(oc.getFloat("opendrive-output.straight-threshold")); - init = NBNode::bezierControlPoints(begShape, endShape, false, dist, dist, ok, nullptr, straightThresh); - } -#ifdef DEBUG_SMOOTH_GEOM - if (DEBUGCOND(this)) { - std::cout << " begShape=" << begShape << " endShape=" << endShape << " forElevation=" << forElevation << " dist=" << dist << " ok=" << ok << " init=" << init << "\n"; - } -#endif - } - if (init.size() == 0) { - return PositionVector::EMPTY; - } else { - const int numPoints = MAX2(oc.getInt("junctions.internal-link-detail"), - int(old.length2D() / oc.getFloat("opendrive.curve-resolution"))); - return init.bezier(numPoints); - } -} - - -void -GNEEdge::smooth(GNEUndoList* undoList) { - PositionVector modifiedShape = smoothShape(myNBEdge->getGeometry(), false); - if (modifiedShape.size() < 2) { - WRITE_WARNING("Could not compute smooth shape for edge '" + getID() + "'"); - } else { - PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); - setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); - } -} - - -void -GNEEdge::smoothElevation(GNEUndoList* undoList) { - PositionVector elevationBase; - for (const Position& pos : myNBEdge->getGeometry()) { - if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) { - elevationBase.push_back(pos); - } - } - PositionVector elevation = smoothShape(elevationBase, true); - if (elevation.size() <= 2) { - WRITE_WARNING("Could not compute smooth elevation for edge '" + getID() + "'"); - } else { - PositionVector modifiedShape = myNBEdge->getGeometry(); - if (modifiedShape.size() < 5) { - modifiedShape = modifiedShape.resample(OptionsCont::getOptions().getFloat("opendrive.curve-resolution")); - } - const double scale = elevation.length2D() / modifiedShape.length2D(); - //std::cout << " elevation=" << elevation << "\n mod1=" << modifiedShape << " scale=" << scale << "\n"; - double seen = 0; - for (int i = 1; i < (int)modifiedShape.size(); ++i) { - seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]); - modifiedShape[i].setz(elevation.positionAtOffset2D(seen * scale).z()); - } - //std::cout << " mod2=" << modifiedShape << "\n"; - PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1); - setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList); - } -} - - -void -GNEEdge::setShapeStartPos(const Position& pos) { - // remove start position and add it the new position - PositionVector geom = myNBEdge->getGeometry(); - geom.erase(geom.begin()); - geom.push_front_noDoublePos(pos); - // restore modified shape - setGeometry(geom, false); -} - - -void -GNEEdge::setShapeEndPos(const Position& pos) { - // remove end position and add it the new position - PositionVector geom = myNBEdge->getGeometry(); - geom.pop_back(); - geom.push_back_noDoublePos(pos); - // restore modified shape - setGeometry(geom, false); -} - - -const std::map > -GNEEdge::getVehiclesOverEdgeMap() const { - // declare vehicles over edge vector - std::vector vehiclesOverEdge; - // declare solution map - std::map > vehiclesOverEdgeMap; - // declare a set of vehicles (to avoid duplicates) - std::set > vehicles; - // first obtain all vehicles of this edge - for (const auto& edgeChild : getChildDemandElements()) { - if (((edgeChild->getTagProperty().getTag() == SUMO_TAG_TRIP) || (edgeChild->getTagProperty().getTag() == SUMO_TAG_FLOW)) && - (edgeChild->getParentEdges().front() == this)) { - vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild)); - vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild)); - } else if ((edgeChild->getTagProperty().getTag() == SUMO_TAG_ROUTE) && (edgeChild->getParentEdges().front() == this)) { - for (const auto& routeChild : edgeChild->getChildDemandElements()) { - if ((routeChild->getTagProperty().getTag() == SUMO_TAG_VEHICLE) || (routeChild->getTagProperty().getTag() == SUMO_TAG_ROUTEFLOW)) { - vehicles.insert(std::make_pair(routeChild->getAttributeDouble(SUMO_ATTR_DEPART), routeChild)); - } - } - } else if ((edgeChild->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE) && (edgeChild->getParentEdges().front() == this)) { - vehicles.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(SUMO_ATTR_DEPART), edgeChild->getParentDemandElements().front())); - } - } - // reserve - vehiclesOverEdge.reserve(vehicles.size()); - // iterate over vehicles - for (const auto& vehicle : vehicles) { - // add it over vehiclesOverEdge; - vehiclesOverEdge.push_back(vehicle.second); - } - // now split vehicles by lanes - for (const auto& vehicle : vehiclesOverEdge) { - const GNELane* vehicleLane = vehicle->getFirstAllowedVehicleLane(); - if (vehicleLane) { - vehiclesOverEdgeMap[vehicleLane].push_back(vehicle); - } - } - return vehiclesOverEdgeMap; -} - - -void -GNEEdge::drawGeometryPoints(const GUIVisualizationSettings& s) const { - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, this); - // obtain circle width - bool drawBig = (myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_MOVE || - myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_DELETE); - double circleWidth = drawBig ? SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration) : 0.5; - double circleWidthSquared = circleWidth * circleWidth; - // obtain color - RGBColor color = s.junctionColorer.getSchemes()[0].getColor(2); - if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { - // override with special colors (unless the color scheme is based on selection) - color = s.colorSettings.selectedEdgeColor.changedBrightness(-20); - } - GLHelper::setColor(color); - // recognize full transparency and simply don't draw - if (color.alpha() > 0) { - // push name - glPushName(getGlID()); - // draw geometry points expect initial and final - for (int i = 1; i < (int)myNBEdge->getGeometry().size() - 1; i++) { - Position pos = myNBEdge->getGeometry()[i]; - if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(pos) <= (circleWidthSquared + 2))) { - glPushMatrix(); - glTranslated(pos.x(), pos.y(), GLO_JUNCTION - 0.01); - // resolution of drawn circle depending of the zoom (To improve smothness) - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - glPopMatrix(); - // draw elevation or special symbols (Start, End and Block) - if (!s.drawForRectangleSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { - glPushMatrix(); - // Translate to geometry point - glTranslated(pos.x(), pos.y(), GLO_JUNCTION); - // draw Z value - GLHelper::drawText(toString(pos.z()), Position(), GLO_MAX - 5, s.edgeValue.scaledSize(s.scale) / 2, s.edgeValue.color); - glPopMatrix(); - } - } - } - // draw line geometry, start and end points if shapeStart or shape end is edited, and depending of drawForRectangleSelection - if (myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_MOVE) { - if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) && - (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().front()) <= (circleWidthSquared + 2)))) { - glPushMatrix(); - glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.01); - // resolution of drawn circle depending of the zoom (To improve smothness) - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - glPopMatrix(); - // draw a "s" over last point depending of drawForRectangleSelection - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { - glPushMatrix(); - glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.02); - GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE); - glPopMatrix(); - // draw line between Junction and point - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION - 0.01); - glLineWidth(4); - GLHelper::drawLine(myNBEdge->getGeometry().front(), myGNEJunctionSource->getPositionInView()); - // draw line between begin point of last lane shape and the first edge shape point - GLHelper::drawLine(myNBEdge->getGeometry().front(), myNBEdge->getLanes().back().shape.front()); - glPopMatrix(); - } - } - if ((myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) && - (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().back()) <= (circleWidthSquared + 2)))) { - glPushMatrix(); - glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.01); - // resolution of drawn circle depending of the zoom (To improve smothness) - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - glPopMatrix(); - // draw a "e" over last point depending of drawForRectangleSelection - if (!s.drawForRectangleSelection && s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { - glPushMatrix(); - glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.02); - GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE); - glPopMatrix(); - // draw line between Junction and point - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION - 0.01); - glLineWidth(4); - GLHelper::drawLine(myNBEdge->getGeometry().back(), myGNEJunctionDestiny->getPositionInView()); - // draw line between last point of first lane shape and the last edge shape point - GLHelper::drawLine(myNBEdge->getGeometry().back(), myNBEdge->getLanes().back().shape.back()); - glPopMatrix(); - } - } - } - // pop name - glPopName(); - } -} - - -void -GNEEdge::drawEdgeName(const GUIVisualizationSettings& s) const { - // draw the name and/or the street name - const bool drawStreetName = s.streetName.show && (myNBEdge->getStreetName() != ""); - const bool spreadSuperposed = s.spreadSuperposed && myLanes.back()->drawAsRailway(s) && myNBEdge->isBidiRail(); - if (s.edgeName.show || drawStreetName || s.edgeValue.show) { - glPushName(getGlID()); - GNELane* lane1 = myLanes[0]; - GNELane* lane2 = myLanes[myLanes.size() - 1]; - Position p = lane1->getLaneShape().positionAtOffset(lane1->getLaneShape().length() / (double) 2.); - p.add(lane2->getLaneShape().positionAtOffset(lane2->getLaneShape().length() / (double) 2.)); - p.mul(.5); - if (spreadSuperposed) { - // move name to the right of the edge and towards its beginning - const double dist = 0.6 * s.edgeName.scaledSize(s.scale); - const double shiftA = lane1->getLaneShape().rotationAtOffset(lane1->getLaneShape().length() / (double) 2.) - DEG2RAD(135); - Position shift(dist * cos(shiftA), dist * sin(shiftA)); - p.add(shift); - } - double angle = lane1->getLaneShape().rotationDegreeAtOffset(lane1->getLaneShape().length() / (double) 2.); - angle += 90; - if (angle > 90 && angle < 270) { - angle -= 180; - } - if (s.edgeName.show) { - drawName(p, s.scale, s.edgeName, angle); - } - if (drawStreetName) { - GLHelper::drawTextSettings(s.streetName, myNBEdge->getStreetName(), p, s.scale, angle); - } - if (s.edgeValue.show) { - const int activeScheme = s.laneColorer.getActive(); - std::string value; - if (activeScheme == 12) { - // edge param, could be non-numerical - value = getNBEdge()->getParameter(s.edgeParam, ""); - } else if (activeScheme == 13) { - // lane param, could be non-numerical - value = getNBEdge()->getLaneStruct(lane2->getIndex()).getParameter(s.laneParam, ""); - } else { - // use numerical value value of leftmost lane to hopefully avoid sidewalks, bikelanes etc - const double doubleValue = lane2->getColorValue(s, activeScheme); - const RGBColor color = s.laneColorer.getScheme().getColor(doubleValue); - value = color.alpha() == 0 ? "" : toString(doubleValue); - } - if (value != "") { - GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, angle); - } - } - glPopName(); - } -} - - -void -GNEEdge::drawRerouterSymbol(const GUIVisualizationSettings& s, GNEAdditional* rerouter) const { - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, rerouter); - // first check if additional has to be drawn - if (s.drawAdditionals(exaggeration)) { - // Start drawing adding an gl identificator - glPushName(rerouter->getGlID()); - // draw rerouter symbol over all lanes - for (const auto& j : myLanes) { - const Position& lanePos = rerouter->getChildPosition(j); - const double laneRot = rerouter->getChildRotation(j); - // draw rerouter symbol - glPushMatrix(); - glTranslated(lanePos.x(), lanePos.y(), rerouter->getType()); - glRotated(-1 * laneRot, 0, 0, 1); - glScaled(exaggeration, exaggeration, 1); - // mode - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - 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); - glEnd(); - // draw "U" - if (!s.drawForRectangleSelection) { - GLHelper::drawText("U", Position(0, 2), .1, 3, RGBColor::BLACK, 180); - double probability = parse(rerouter->getAttribute(SUMO_ATTR_PROB)) * 100; - // draw Probability - GLHelper::drawText((toString(probability) + "%").c_str(), Position(0, 4), .1, 0.7, RGBColor::BLACK, 180); - } - // finish draw - glPopMatrix(); - // draw contour if is selected - if (myNet->getViewNet()->getDottedAC() == rerouter) { - GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.8, 6, -1 * laneRot, 0, 3); - } - } - } - // Pop name - glPopName(); - // Draw connections - rerouter->drawChildConnections(s, getType()); -} - - -void -GNEEdge::drawDemandElements(const GUIVisualizationSettings& s) const { - // certain demand elements children can contain loops (for example, routes) and it causes overlapping problems. It's needed to filter it before drawing - if (s.drawForPositionSelection) { - // draw routes - for (const auto& route : getChildDemandElementsByType(SUMO_TAG_ROUTE)) { - // first check if route can be drawn - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { - // draw partial route - drawPartialRoute(s, route, nullptr); - } - } - // draw embedded routes - for (const auto& embeddedRoute : getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE)) { - // first check if embedded route can be drawn - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { - // draw partial route - drawPartialRoute(s, embeddedRoute, nullptr); - } - } - } else { - // if drawForPositionSelection is disabled, only draw the first element - if (getChildDemandElementsByType(SUMO_TAG_ROUTE).size() > 0) { - const auto& route = getChildDemandElementsByType(SUMO_TAG_ROUTE).front(); - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { - drawPartialRoute(s, route, nullptr); - } - } - if (getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).size() > 0) { - const auto& embeddedRoute = getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).front(); - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { - drawPartialRoute(s, embeddedRoute, nullptr); - } - } - } - // draw person plans - if (s.drawForPositionSelection) { - for (const auto& personTripFromTo : getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO)) { - drawPartialPersonPlan(s, personTripFromTo, nullptr); - } - for (const auto& personTripBusStop : getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP)) { - drawPartialPersonPlan(s, personTripBusStop, nullptr); - } - for (const auto& walkEdges : getChildDemandElementsByType(SUMO_TAG_WALK_EDGES)) { - drawPartialPersonPlan(s, walkEdges, nullptr); - } - for (const auto& walkFromTo : getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO)) { - drawPartialPersonPlan(s, walkFromTo, nullptr); - } - for (const auto& walkBusStop : getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP)) { - drawPartialPersonPlan(s, walkBusStop, nullptr); - } - for (const auto& walkRoute : getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE)) { - drawPartialPersonPlan(s, walkRoute, nullptr); - } - for (const auto& rideFromTo : getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO)) { - drawPartialPersonPlan(s, rideFromTo, nullptr); - } - for (const auto& rideBusStop : getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP)) { - drawPartialPersonPlan(s, rideBusStop, nullptr); - } - } else { - // if drawForPositionSelection is disabled, only draw the first element - if (getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).front(), nullptr); - } - if (getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).size() > 0) { - drawPartialPersonPlan(s, getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).front(), nullptr); - } - } - // draw path element childs - for (const auto& elementChild : myPathElementChilds) { - if (elementChild->getTagProperty().isVehicle()) { - // draw partial trip only if is being inspected or selected (and we aren't in draw for selecting mode) - if (!s.drawForRectangleSelection && ((myNet->getViewNet()->getDottedAC() == elementChild) || elementChild->isAttributeCarrierSelected())) { - drawPartialTripFromTo(s, elementChild, nullptr); - } - } else if (elementChild->getTagProperty().isPersonPlan()) { - drawPartialPersonPlan(s, elementChild, nullptr); - } - } -} - - -bool -GNEEdge::areStackPositionOverlapped(const GNEEdge::StackPosition& vehicleA, const GNEEdge::StackPosition& vehicleB) const { - if ((vehicleA.beginPosition() == vehicleB.beginPosition()) && (vehicleA.endPosition() == vehicleB.endPosition())) { - return true; - } else if ((vehicleA.beginPosition() < vehicleB.beginPosition()) && (vehicleA.endPosition() > vehicleB.endPosition())) { - return true; - } else if ((vehicleA.beginPosition() < vehicleB.beginPosition()) && (vehicleA.endPosition() > vehicleB.beginPosition())) { - return true; - } else if ((vehicleA.beginPosition() < vehicleB.endPosition()) && (vehicleA.endPosition() > vehicleB.endPosition())) { - return true; - } else { - return false; - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEEdge.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNEEdge.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEEdge.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,460 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEEdge.h -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A road/street connecting two junctions (netedit-version, adapted from GUIEdge) -// Basically a container for an NBEdge with drawing and editing capabilities -/****************************************************************************/ -#ifndef GNEEdge_h -#define GNEEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include - -#include "GNENetElement.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEJunction; -class GNELane; -class GNEConnection; -class GNERouteProbe; -class GNEVaporizer; -class GNERerouter; -class GNECrossing; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEEdge - * @brief A road/street connecting two junctions (netedit-version) - * - * @see MSEdge - */ -class GNEEdge : public GNENetElement { - - /// @brief Friend class - friend class GNEChange_Lane; - friend class GNEChange_Connection; - -public: - /// @brief Definition of the lane's vector - typedef std::vector LaneVector; - - /// @brief Definition of the connection's vector - typedef std::vector ConnectionVector; - - /**@brief Constructor - * @param[in] net The net to inform about gui updates - * @param[in] nbe The represented edge - * @param[in] loaded Whether the edge was loaded from a file - */ - GNEEdge(GNENet* net, NBEdge* nbe, bool wasSplit = false, bool loaded = false); - - /// @brief Destructor. - ~GNEEdge(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of hierarchical element in view - Position getPositionInView() const; - /// @} - - /// @name functions for edit start and end positions of shapes - /// @{ - /// @brief return true if user clicked over ShapeStart - bool clickedOverShapeStart(const Position& pos); - - /// @brief return true if user clicked over ShapeEnd - bool clickedOverShapeEnd(const Position& pos); - - /// @brief move position of shape start without commiting change - void moveShapeStart(const Position& oldPos, const Position& offset); - - /// @brief move position of shape end without commiting change - void moveShapeEnd(const Position& oldPos, const Position& offset); - - /// @brief commit position changing in shape start - void commitShapeStartChange(const Position& oldPos, GNEUndoList* undoList); - - /// @brief commit position changing in shape end - void commitShapeEndChange(const Position& oldPos, GNEUndoList* undoList); - /// @} - - /// @name functions for edit geometry - /// @{ - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(); - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(); - /// @} - - /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge - * @param pos position of new/existent vertex - * @param createIfNoExist enable or disable creation of new verte if there isn't another vertex in position - * @param snapToGrid enable or disable snapToActiveGrid - * @return index of position vector - */ - int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid); - - /**@brief return index of a vertex of shape, or of a new vertex if position is over an shape's edge - * @param offset position over edge - * @param createIfNoExist enable or disable creation of new verte if there isn't another vertex in position - * @param snapToGrid enable or disable snapToActiveGrid - * @return index of position vector - */ - int getVertexIndex(const double offset, bool createIfNoExist, bool snapToGrid); - - /**@brief change position of a vertex of shape without commiting change - * @param[in] index index of Vertex shape - * @param[in] newPos The new position of vertex - * @return index of vertex (in some cases index can change - */ - int moveVertexShape(const int index, const Position& oldPos, const Position& offset); - - /**@brief move entire shape without commiting change - * @param[in] oldShape the old shape of polygon before moving - * @param[in] offset the offset of movement - */ - void moveEntireShape(const PositionVector& oldShape, const Position& offset); - - /**@brief commit geometry changes in the attributes of an element after use of changeShapeGeometry(...) - * @param[in] oldShape the old shape of polygon - * @param[in] undoList The undoList on which to register changes - */ - void commitShapeChange(const PositionVector& oldShape, GNEUndoList* undoList); - - /// @brief delete the geometry point closest to the given pos - void deleteGeometryPoint(const Position& pos, bool allowUndo = true); - - /// @brief update edge geometry after junction move - void updateJunctionPosition(GNEJunction* junction, const Position& origPos); - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * - * @return The boundary the object is within - * @see GUIGlObject::getCenteringBoundary - */ - Boundary getCenteringBoundary() const; - - /// @brief Returns the street name - const std::string getOptionalName() const; - - /**@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; - /// @} - - /// @brief returns the internal NBEdge - NBEdge* getNBEdge() const; - - /// @brief returns the source-junction - GNEJunction* getGNEJunctionSource() const; - - /// @brief returns the destination-junction - GNEJunction* getGNEJunctionDestiny() const; - - /// @brief get opposite edge - GNEEdge* getOppositeEdge() const; - - /// @brief makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint - void editEndpoint(Position pos, GNEUndoList* undoList); - - /// @brief restores the endpoint to the junction position at the appropriate end - void resetEndpoint(const Position& pos, GNEUndoList* undoList); - - /// @name 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; - std::string getAttributeForSelection(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 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 check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - - /// @brief set responsibility for deleting internal strctures - void setResponsible(bool newVal); - - /**@brief update edge geometry and inform the lanes - * @param[in] geom The new geometry - * @param[in] inner Whether geom is only the inner points - */ - void setGeometry(PositionVector geom, bool inner); - - /// @brief remake connections - void remakeGNEConnections(); - - /// @brief copy edge attributes from tpl - void copyTemplate(GNEEdge* tpl, GNEUndoList* undolist); - - /// @brief returns GLIDs of all lanes - std::set getLaneGlIDs() const; - - /// @brief returns a reference to the lane vector - const std::vector& getLanes() const; - - /// @brief returns a reference to the GNEConnection vector - const std::vector& getGNEConnections() const; - - /// @brief get GNEConnection if exist, and if not create it if create is enabled - GNEConnection* retrieveGNEConnection(int fromLane, NBEdge* to, int toLane, bool createIfNoExist = true); - - /// @brief whether this edge was created from a split - bool wasSplit(); - - /* @brief compute a splitting position which keeps the resulting edges - * straight unless the user clicked near a geometry point */ - Position getSplitPos(const Position& clickPos); - - /// @brief override to also set lane ids - void setMicrosimID(const std::string& newID); - - /// @brief check if edge has a restricted lane - bool hasRestrictedLane(SUMOVehicleClass vclass) const; - - // the radius in which to register clicks for geometry nodes - static const double SNAP_RADIUS; - - /// @brief clear current connections - void clearGNEConnections(); - - /// @brief obtain relative positions of RouteProbes - int getRouteProbeRelativePosition(GNERouteProbe* routeProbe) const; - - /// @brief get GNECrossings vinculated with this Edge - std::vector getGNECrossings(); - - /// @brief make geometry smooth - void smooth(GNEUndoList* undoList); - - /// @brief interpolate z values linear between junctions - void straightenElevation(GNEUndoList* undoList); - - /// @brief smooth elevation with regard to adjoining edges - void smoothElevation(GNEUndoList* undoList); - - /// @brief return smoothed shape - PositionVector smoothShape(const PositionVector& shape, bool forElevation); - - /// @brief return the first lane that allow a vehicle of type vClass (or the first lane, if none was found) - GNELane* getLaneByAllowedVClass(const SUMOVehicleClass vClass) const; - - /// @brief return the first lane that disallow a vehicle of type vClass (or the first lane, if none was found) - GNELane* getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const; - - /// @brief draw partial route - void drawPartialRoute(const GUIVisualizationSettings& s, const GNEDemandElement* route, const GNEJunction* junction) const; - - /// @brief draw partial trip and Flow - void drawPartialTripFromTo(const GUIVisualizationSettings& s, const GNEDemandElement* tripOrFromTo, const GNEJunction* junction) const; - - /// @brief draw partial person plan - void drawPartialPersonPlan(const GUIVisualizationSettings& s, const GNEDemandElement* personPlan, const GNEJunction* junction) const; - - /// @brief add path element (Only used by GNEHierarchicalParentElements::changeRouteEdges) - void addPathElement(GNEDemandElement* pathElementChild); - - /// @brief remove path element (Only used by GNEHierarchicalParentElements::changeRouteEdges) - void removePathElement(GNEDemandElement* pathElementChild); - - /// @brief invalidate path element childs - void invalidatePathChildElementss(); - - // @brief update vehicle spread geometries - void updateVehicleSpreadGeometries(); - - // @brief update vehicle geometries - void updateVehicleStackLabels(); - -protected: - /// @brief the underlying NBEdge - NBEdge* myNBEdge; - - /// @brief variable used to save shape bevore moving (used to avoid inconsistences in GL Tree) - PositionVector myMovingShape; - - /// @brief pointer to GNEJunction source - GNEJunction* myGNEJunctionSource; - - /// @brief pointer to GNEJunction destiny - GNEJunction* myGNEJunctionDestiny; - - /// @brief vectgor with the lanes of this edge - LaneVector myLanes; - - /// @brief vector with the connections of this edge - ConnectionVector myGNEConnections; - - /// @brief whether we are responsible for deleting myNBNode - bool myAmResponsible; - - /// @brief whether this edge was created from a split - bool myWasSplit; - - /// @brief modification status of the connections - std::string myConnectionStatus; - - /// @brief vector with references to path element childs - std::vector myPathElementChilds; - -private: - /// @brief Stack position (used to stack demand elements over edges) - class StackPosition : public std::tuple { - - public: - /// @brief constructor - StackPosition(const double departPos, const double length); - - /// @brief get begin position - double beginPosition() const; - - /// @brief get end position - double endPosition() const; - }; - - /// @brief Stack demand elements - class StackDemandElements : public std::tuple > { - - public: - /// @brief constructor - StackDemandElements(const StackPosition stackedPosition, GNEDemandElement* demandElement); - - /// @brief add demand elment to current StackDemandElements - void addDemandElements(GNEDemandElement* demandElement); - - /// @brief get stack position - const StackPosition& getStackPosition() const; - - /// @brief get demand elements - const std::vector& getDemandElements() const; - }; - - /// @brif flag to enable/disable update geomtetry of lanes (used mainly by setNumLanes) - bool myUpdateGeometry; - - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief update dotted contour - void updateDottedContour(); - - /**@brief changes the number of lanes. - * When reducing the number of lanes, higher-numbered lanes are removed first. - * When increasing the number of lanes, the last known attributes for a lane - * with this number are restored. If none are found the attributes for the - * leftmost lane are copied - */ - void setNumLanes(int numLanes, GNEUndoList* undoList); - - /// @brief@brief increase number of lanes by one use the given attributes and restore the GNELane - void addLane(GNELane* lane, const NBEdge::Lane& laneAttrs, bool recomputeConnections); - - /// @briefdecrease the number of lanes by one. argument is only used to increase robustness (assertions) - void removeLane(GNELane* lane, bool recomputeConnections); - - /// @brief adds a connection - void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation = false); - - /// @brief removes a connection - void removeConnection(NBEdge::Connection nbCon); - - /// @brief remove crossing of junction - void removeEdgeFromCrossings(GNEJunction* junction, GNEUndoList* undoList); - - /// @brief change Shape StartPos - void setShapeStartPos(const Position& pos); - - /// @brief change Shape EndPos - void setShapeEndPos(const Position& pos); - - /// @brief get vehicles a that start over this edge - const std::map > getVehiclesOverEdgeMap() const; - - /// @brief draw geometry points - void drawGeometryPoints(const GUIVisualizationSettings& s) const; - - /// @brief draw edge name - void drawEdgeName(const GUIVisualizationSettings& s) const; - - /// @brief draw Rerouter symbols - void drawRerouterSymbol(const GUIVisualizationSettings& s, GNEAdditional* rerouter) const; - - /// @brief draw demand elements - void drawDemandElements(const GUIVisualizationSettings& s) const; - - /// @brief check if given stacked positions are overlapped - bool areStackPositionOverlapped(const GNEEdge::StackPosition& vehicleA, const GNEEdge::StackPosition& vehicleB) const; - - /// @brief invalidated copy constructor - GNEEdge(const GNEEdge& s) = delete; - - /// @brief invalidated assignment operator - GNEEdge& operator=(const GNEEdge& s) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEInternalLane.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNEInternalLane.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEInternalLane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEInternalLane.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,202 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEInternalLane.cpp -/// @author Jakob Erdmann -/// @date June 2011 -/// -// A class for visualizing Inner Lanes (used when editing traffic lights) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNEInternalLane.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== -/// @note: msvc10 does not approve of allocating empty arrays -/* -FXDEFMAP(GNEInternalLane) GNEInternalLaneMap[]= { - //FXMAPFUNC(SEL_COMMAND, MID_GNE_TLSFRAME_PHASE_DURATION, GNETLSEditorFrame::onDefault), -}; -*/ - -// Object implementation -//FXIMPLEMENT(GNEInternalLane, FXDelegator, GNEInternalLaneMap, ARRAYNUMBER(GNEInternalLaneMap)) -FXIMPLEMENT(GNEInternalLane, FXDelegator, 0, 0) - -// =========================================================================== -// static member definitions -// =========================================================================== - -StringBijection::Entry GNEInternalLane::linkStateNamesValues[] = { - { "Green-Major", LINKSTATE_TL_GREEN_MAJOR }, - { "Green-Minor", LINKSTATE_TL_GREEN_MINOR }, - { "Yellow-Major", LINKSTATE_TL_YELLOW_MAJOR }, - { "Yellow-Minor", LINKSTATE_TL_YELLOW_MINOR }, - { "Red", LINKSTATE_TL_RED }, - { "Red-Yellow", LINKSTATE_TL_REDYELLOW }, - { "Stop", LINKSTATE_STOP }, - { "Off", LINKSTATE_TL_OFF_NOSIGNAL }, - { "Off-Blinking", LINKSTATE_TL_OFF_BLINKING }, -}; - -const StringBijection GNEInternalLane::LinkStateNames( - GNEInternalLane::linkStateNamesValues, LINKSTATE_TL_OFF_BLINKING); - -// =========================================================================== -// method definitions -// =========================================================================== -GNEInternalLane::GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state) : - GUIGlObject(editor == nullptr ? GLO_JUNCTION : GLO_TLLOGIC, id), - myState(state), - myStateTarget(myState), - myEditor(editor), - myTlIndex(tlIndex), - myPopup(nullptr) { - // calculate internal lane geometry - myInternalLaneGeometry.updateGeometry(shape); -} - - -GNEInternalLane::GNEInternalLane() : - GUIGlObject(GLO_TLLOGIC, "dummyInternalLane") { - assert(false); -} - - -GNEInternalLane::~GNEInternalLane() {} - - -long -GNEInternalLane::onDefault(FXObject* obj, FXSelector sel, void* data) { - if (myEditor != nullptr) { - FXuint before = myState; - myStateTarget.handle(obj, sel, data); - if (myState != before) { - myEditor->handleChange(this); - } - // let GUISUMOAbstractView know about clicks so that the popup is properly destroyed - if (FXSELTYPE(sel) == SEL_COMMAND) { - if (myPopup != nullptr) { - myPopup->getParentView()->destroyPopup(); - myPopup = nullptr; - } - } - } - return 1; -} - - -void -GNEInternalLane::drawGL(const GUIVisualizationSettings& s) const { - glPushMatrix(); - glPushName(getGlID()); - glTranslated(0, 0, GLO_JUNCTION + 0.1); // must draw on top of junction - GLHelper::setColor(colorForLinksState(myState)); - // draw lane - // check whether it is not too small - if (s.scale < 1.) { - GLHelper::drawLine(myInternalLaneGeometry.getShape()); - } else { - GNEGeometry::drawGeometry(myEditor->getViewNet(), myInternalLaneGeometry, 0.2); - } - glPopName(); - glPopMatrix(); -} - - -void -GNEInternalLane::setLinkState(LinkState state) { - myState = state; - myOrigState = state; -} - - -LinkState -GNEInternalLane::getLinkState() const { - return (LinkState)myState; -} - - -int -GNEInternalLane::getTLIndex() const { - return myTlIndex; -} - - -GUIGLObjectPopupMenu* -GNEInternalLane::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - myPopup = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(myPopup, app); - if ((myEditor != nullptr) && (myEditor->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK)) { - const std::vector names = LinkStateNames.getStrings(); - for (std::vector::const_iterator it = names.begin(); it != names.end(); it++) { - FXuint state = LinkStateNames.get(*it); - std::string origHint = ((LinkState)state == myOrigState ? " (original)" : ""); - FXMenuRadio* mc = new FXMenuRadio(myPopup, (*it + origHint).c_str(), this, FXDataTarget::ID_OPTION + state); - mc->setSelBackColor(MFXUtils::getFXColor(colorForLinksState(state))); - mc->setBackColor(MFXUtils::getFXColor(colorForLinksState(state))); - } - } - return myPopup; -} - - -GUIParameterTableWindow* -GNEInternalLane::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - // internal lanes don't have attributes - GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); - // close building - ret->closeBuilding(); - return ret; -} - - -Boundary -GNEInternalLane::getCenteringBoundary() const { - Boundary b = myInternalLaneGeometry.getShape().getBoxBoundary(); - b.grow(10); - return b; -} - - -RGBColor -GNEInternalLane::colorForLinksState(FXuint state) { - if (state == LINKSTATE_TL_YELLOW_MINOR) { - // special case (default gui does not distinguish between yellow major/minor - return RGBColor(179, 179, 0, 255); - } else { - try { - return GUIVisualizationSettings::getLinkColor((LinkState)state); - } catch (ProcessError&) { - WRITE_WARNING("invalid link state='" + toString(state) + "'"); - return RGBColor::BLACK; - } - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEInternalLane.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNEInternalLane.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEInternalLane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEInternalLane.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,160 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEInternalLane.h -/// @author Jakob Erdmann -/// @date June 2011 -/// -// A class for visualizing Inner Lanes (used when editing traffic lights) -/****************************************************************************/ -#ifndef GNEInternalLane_h -#define GNEInternalLane_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNENetElement.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GUIGLObjectPopupMenu; -class GNETLSEditorFrame; -class PositionVector; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEInternalLane - * @brief This object is responsible for drawing a shape and for supplying a - * a popup menu. Messages are routeted to an internal dataTarget and to the - * editor (hence inheritance from FXDelegator) - */ -class GNEInternalLane : public GUIGlObject, public FXDelegator { - /// @brief FOX-declaration - FXDECLARE(GNEInternalLane) - -public: - - /**@brief Constructor - * @param[in] editor The editor to notify about changes - * @param[in] id The id of this internal lane - * @param[in] shape The shape of the lane - * @param[in] tlIndex The tl-index of the lane - */ - GNEInternalLane(GNETLSEditorFrame* editor, const std::string& id, const PositionVector& shape, int tlIndex, LinkState state = LINKSTATE_DEADEND); - - /// @brief Destructor - virtual ~GNEInternalLane(); - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * - * @return The boundary the object is within - * @see GUIGlObject::getCenteringBoundary - */ - Boundary getCenteringBoundary() const; - - /**@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; - /// @} - - /// @brief set the linkState (controls drawing color) - void setLinkState(LinkState state); - - /// @brief whether link state has been modfied - LinkState getLinkState() const; - - /// @brief multiplexes message to two targets - long onDefault(FXObject*, FXSelector, void*); - - /// @brief get Traffic Light index - int getTLIndex() const; - - /// @brief long names for link states - static const StringBijection LinkStateNames; - - /// @brief return the color for each linkstate - static RGBColor colorForLinksState(FXuint state); - -protected: - /// @brief FOX needs this - GNEInternalLane(); - -private: - /// @brief internal lane geometry - GNEGeometry::Geometry myInternalLaneGeometry; - - /// @brief the state of the link (used for visualization) - FXuint myState; - FXDataTarget myStateTarget; - - /// @brief the original state of the link (used for tracking modification) - LinkState myOrigState; - - /// @brief data target for selection state - FXDataTarget stateTarget; - - /// @brief the editor to inform about changes - GNETLSEditorFrame* myEditor; - - /// @brief the tl-index of this lane - int myTlIndex; - - /// @brief the created popup - GUIGLObjectPopupMenu* myPopup; - - /// @brief linkstates names values - static StringBijection::Entry linkStateNamesValues[]; - -private: - /// @brief return the color for each linkstate - static const std::string& longNameForLinkState(FXuint state); - - /// @brief Invalidated copy constructor. - GNEInternalLane(const GNEInternalLane&); - - /// @brief Invalidated assignment operator. - GNEInternalLane& operator=(const GNEInternalLane&); -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEJunction.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNEJunction.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEJunction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEJunction.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1622 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEJunction.cpp -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A class for visualizing and editing junctions in netedit (adapted from -// GUIJunctionWrapper) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNEEdge.h" -#include "GNELane.h" -#include "GNEConnection.h" -#include "GNEJunction.h" -#include "GNECrossing.h" - - -// =========================================================================== -// static members -// =========================================================================== - -const double GNEJunction::BUBBLE_RADIUS(4); - -// =========================================================================== -// method definitions -// =========================================================================== - -GNEJunction::GNEJunction(GNENet* net, NBNode* nbn, bool loaded) : - GNENetElement(net, nbn->getID(), GLO_JUNCTION, SUMO_TAG_JUNCTION), - myNBNode(nbn), - myMaxSize(1), - myAmCreateEdgeSource(false), - myLogicStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED), - myAmResponsible(false), - myHasValidLogic(loaded), - myAmTLSSelected(false), - myColorForMissingConnections(false) { -} - - -GNEJunction::~GNEJunction() { - // delete all GNECrossing - for (const auto& crossing : myGNECrossings) { - crossing->decRef(); - if (crossing->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + crossing->getTagStr() + " '" + crossing->getID() + "' in GNEJunction destructor"); - delete crossing; - } - } - - if (myAmResponsible) { - // show extra information for tests - WRITE_DEBUG("Deleting NBNode of '" + getID() + "' in GNEJunction destructor"); - delete myNBNode; - } -} - - -std::string -GNEJunction::generateChildID(SumoXMLTag childTag) { - int counter = 0; - while (myNet->retrieveJunction(getID() + toString(childTag) + toString(counter), false) != nullptr) { - counter++; - } - return (getID() + toString(childTag) + toString(counter)); -} - - -const PositionVector& -GNEJunction::getJunctionShape() const { - return myNBNode->getShape(); -} - - -void -GNEJunction::updateGeometry() { - updateGeometryAfterNetbuild(true); - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -void -GNEJunction::updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings) { - myMaxSize = MAX2(getCenteringBoundary().getWidth(), getCenteringBoundary().getHeight()); - rebuildGNECrossings(rebuildNBNodeCrossings); - checkMissingConnections(); - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -Position -GNEJunction::getPositionInView() const { - return myNBNode->getPosition(); -} - - -void -GNEJunction::rebuildGNECrossings(bool rebuildNBNodeCrossings) { - // rebuild GNECrossings only if create crossings and walkingAreas in net is enabled - if (myNet->getNetBuilder()->haveNetworkCrossings()) { - if (rebuildNBNodeCrossings) { - // build new NBNode::Crossings and walking areas - mirrorXLeftHand(); - myNBNode->buildCrossingsAndWalkingAreas(); - mirrorXLeftHand(); - } - // create a vector to keep retrieved and created crossings - std::vector retrievedCrossings; - // iterate over NBNode::Crossings of GNEJunction - for (const auto& NBNodeConnection : myNBNode->getCrossingsIncludingInvalid()) { - // retrieve existent GNECrossing, or create it - GNECrossing* retrievedGNECrossing = retrieveGNECrossing(NBNodeConnection); - retrievedCrossings.push_back(retrievedGNECrossing); - // check if previously this GNECrossings exists, and if true, remove it from myGNECrossings and insert in tree again - std::vector::iterator retrievedExists = std::find(myGNECrossings.begin(), myGNECrossings.end(), retrievedGNECrossing); - if (retrievedExists != myGNECrossings.end()) { - myGNECrossings.erase(retrievedExists); - // update geometry of retrieved crossing - retrievedGNECrossing->updateGeometry(); - } else { - // include reference to created GNECrossing - retrievedGNECrossing->incRef(); - } - } - // delete non retrieved GNECrossings (we don't need to extract if from Tree two times) - for (const auto& crossing : myGNECrossings) { - crossing->decRef(); - // check if crossing is selected - if (crossing->isAttributeCarrierSelected()) { - crossing->unselectAttributeCarrier(); - } - if (crossing->unreferenced()) { - // show extra information for tests - WRITE_DEBUG("Deleting unreferenced " + crossing->getTagStr() + " in rebuildGNECrossings()"); - delete crossing; - } - } - // copy retrieved (existent and created) GNECrossigns to myGNECrossings - myGNECrossings = retrievedCrossings; - } -} - -void -GNEJunction::mirrorXLeftHand() { - if (OptionsCont::getOptions().getBool("lefthand")) { - myNBNode->mirrorX(); - for (NBEdge* e : myNBNode->getEdges()) { - e->mirrorX(); - - } - } -} - - -GUIGLObjectPopupMenu* -GNEJunction::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - buildNameCopyPopupEntry(ret); - // build selection and show parameters menu - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - buildShowParamsPopupEntry(ret); - buildPositionCopyEntry(ret, false); - // check if we're in supermode network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - //if (parent.getVisualisationSettings()->editMode != GNE_MODE_CONNECT) { - // // XXX if joinable - // new FXMenuCommand(ret, "Join adjacent edges", 0, &parent, MID_GNE_JOIN_EDGES); - //} - const int numEndpoints = (int)myNBNode->getEndPoints().size(); - // check if we're handling a selection - bool handlingSelection = isAttributeCarrierSelected() && (myNet->retrieveJunctions(true).size() > 1); - // check if menu commands has to be disabled - const bool wrongMode = (myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_CONNECT) || - (myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_TLS) || - (myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_CREATE_EDGE); - // create menu commands - FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom junction shape", nullptr, &parent, MID_GNE_JUNCTION_EDIT_SHAPE); - FXMenuCommand* mcResetCustomShape = new FXMenuCommand(ret, "Reset junction shape", nullptr, &parent, MID_GNE_JUNCTION_RESET_SHAPE); - FXMenuCommand* mcReplace = new FXMenuCommand(ret, "Replace junction by geometry point", nullptr, &parent, MID_GNE_JUNCTION_REPLACE); - FXMenuCommand* mcSplit = new FXMenuCommand(ret, ("Split junction (" + toString(numEndpoints) + " end points)").c_str(), nullptr, &parent, MID_GNE_JUNCTION_SPLIT); - FXMenuCommand* mcSplitReconnect = new FXMenuCommand(ret, "Split junction and reconnect", nullptr, &parent, MID_GNE_JUNCTION_SPLIT_RECONNECT); - FXMenuCommand* mcClearConnections = new FXMenuCommand(ret, "Clear connections", nullptr, &parent, MID_GNE_JUNCTION_CLEAR_CONNECTIONS); - FXMenuCommand* mcResetConnections = new FXMenuCommand(ret, "Reset connections", nullptr, &parent, MID_GNE_JUNCTION_RESET_CONNECTIONS); - // check if current mode is correct - if (wrongMode) { - mcCustomShape->disable(); - mcClearConnections->disable(); - mcResetConnections->disable(); - } - // check if we're handling a selection - if (handlingSelection) { - mcResetCustomShape->setText("Reset junction shapes"); - } - // disable mcClearConnections if juction hasn't connections - if (getGNEConnections().empty()) { - mcClearConnections->disable(); - } - // disable mcResetCustomShape if junction doesn't have a custom shape - if (myNBNode->getShape().size() == 0) { - mcResetCustomShape->disable(); - } - // checkIsRemovable requiers turnarounds to be computed. This is ugly - if ((myNBNode->getIncomingEdges().size() == 2) && (myNBNode->getOutgoingEdges().size() == 2)) { - NBTurningDirectionsComputer::computeTurnDirectionsForNode(myNBNode, false); - } - std::string reason = "wrong edit mode"; - if (wrongMode || !myNBNode->checkIsRemovableReporting(reason)) { - mcReplace->setText(mcReplace->getText() + " (" + reason.c_str() + ")"); - mcReplace->disable(); - } - if (numEndpoints == 1) { - mcSplit->disable(); - mcSplitReconnect->disable(); - } - } - return ret; -} - - -Boundary -GNEJunction::getCenteringBoundary() const { - // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry) - if (myMovingGeometryBoundary.isInitialised()) { - return myMovingGeometryBoundary; - } else if (myNBNode->getShape().size() > 0) { - Boundary b = myNBNode->getShape().getBoxBoundary(); - b.grow(10); - return b; - } else { - // calculate boundary using EXTENT as size - const double EXTENT = 2; - Boundary b(myNBNode->getPosition().x() - EXTENT, myNBNode->getPosition().y() - EXTENT, - myNBNode->getPosition().x() + EXTENT, myNBNode->getPosition().y() + EXTENT); - b.grow(10); - return b; - } -} - - -void -GNEJunction::drawGL(const GUIVisualizationSettings& s) const { - // check if boundary has to be drawn - if (s.drawBoundaries) { - GLHelper::drawBoundary(getCenteringBoundary()); - } - // declare variable for exaggeration - double junctionExaggeration = isAttributeCarrierSelected() ? s.selectionScale : 1; - junctionExaggeration *= s.junctionSize.getExaggeration(s, this, 4); - // only continue if exaggeration is greather than 0 - if (junctionExaggeration > 0) { - // declare values for circles - const double circleWidth = BUBBLE_RADIUS * junctionExaggeration; - const double circleWidthSquared = circleWidth * circleWidth; - // declare variable for mouse position - const Position mousePosition = myNet->getViewNet()->getPositionInformation(); - // push name - if (s.scale * junctionExaggeration * myMaxSize < 1.) { - // draw something simple so that selection still works - glPushName(getGlID()); - GLHelper::drawBoxLine(myNBNode->getPosition(), 0, 1, 1); - glPopName(); - } else { - // node shape has been computed and is valid for drawing - glPushName(getGlID()); - // declare flag for drawing junction shape - const bool drawShape = (myNBNode->getShape().size() > 0) && s.drawJunctionShape; - // declare flag for drawing junction as bubbles - bool drawBubble = (!drawShape || (myNBNode->getShape().area() < 4)) && s.drawJunctionShape; - // check if show junctions as bubbles checkbox is enabled - if (myNet->getViewNet()->showJunctionAsBubbles()) { - drawBubble = true; - } - // in supermode demand Bubble musn't be drawn - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_DEMAND) { - drawBubble = false; - } - // check if shape has to be drawn - if (drawShape) { - // set shape color - RGBColor junctionShapeColor = setColor(s, false); - // recognize full transparency and simply don't draw - if (junctionShapeColor.alpha() != 0) { - glPushMatrix(); - glTranslated(0, 0, getType()); - // obtain junction Shape - PositionVector junctionShape = myNBNode->getShape(); - // close junction shape - junctionShape.closePolygon(); - // adjust shape to exaggeration - if (junctionExaggeration > 1) { - junctionShape.scaleRelative(junctionExaggeration); - } - // first check if inner junction polygon can be drawn - if (s.drawForPositionSelection) { - // only draw a point if mouse is around shape - if (junctionShape.around(mousePosition)) { - // push matrix - glPushMatrix(); - glTranslated(mousePosition.x(), mousePosition.y(), GLO_JUNCTION); - GLHelper::drawFilledCircle(1, s.getCircleResolution()); - glPopMatrix(); - } - } else if ((s.scale * junctionExaggeration * myMaxSize) < 40.) { - GLHelper::drawFilledPoly(junctionShape, true); - } else { - GLHelper::drawFilledPolyTesselated(junctionShape, true); - } - glPopMatrix(); - } - } - // check if bubble has to be drawn - if (drawBubble) { - // set bubble color - RGBColor bubbleColor = setColor(s, true); - // recognize full transparency and simply don't draw - if (bubbleColor.alpha() != 0) { - glPushMatrix(); - // move matrix to - glTranslated(myNBNode->getPosition().x(), myNBNode->getPosition().y(), getType() + 0.05); - // only draw filled circle if we aren't in draw for selecting mode, or if distance to center is enough) - if (!s.drawForPositionSelection || (mousePosition.distanceSquaredTo2D(myNBNode->getPosition()) <= (circleWidthSquared + 2))) { - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - } - glPopMatrix(); - } - } - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == this) { - GNEGeometry::drawShapeDottedContour(s, getType(), junctionExaggeration, myDottedGeometry); - } - // draw TLS - drawTLSIcon(s); - // (optional) draw name @todo expose this setting if isn't drawed if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(myNBNode->getPosition(), s.scale, s.junctionName); - } - // draw elevation - if (!s.drawForRectangleSelection && myNet->getViewNet()->getNetworkViewOptions().editingElevation()) { - glPushMatrix(); - // Translate to center of junction - glTranslated(myNBNode->getPosition().x(), myNBNode->getPosition().y(), getType() + 1); - // draw Z value - GLHelper::drawText(toString(myNBNode->getPosition().z()), Position(), GLO_MAX - 5, s.junctionName.scaledSize(s.scale), s.junctionName.color); - glPopMatrix(); - } - // name must be removed from selection stack before drawing crossings - glPopName(); - // draw crossings only if junction isn't being moved - if (!myMovingGeometryBoundary.isInitialised()) { - for (const auto& i : myGNECrossings) { - i->drawGL(s); - } - } - // draw Junction childs - drawJunctionChilds(s); - } - } -} - - -NBNode* -GNEJunction::getNBNode() const { - return myNBNode; -} - - -std::vector -GNEJunction::getJunctionNeighbours() const { - // use set to avoid duplicates junctions - std::set junctions; - for (const auto& i : myGNEIncomingEdges) { - junctions.insert(i->getGNEJunctionSource()); - } - for (const auto& i : myGNEOutgoingEdges) { - junctions.insert(i->getGNEJunctionDestiny()); - } - return std::vector(junctions.begin(), junctions.end()); -} - - -void -GNEJunction::addIncomingGNEEdge(GNEEdge* edge) { - // Check if incoming edge was already inserted - std::vector::iterator i = std::find(myGNEIncomingEdges.begin(), myGNEIncomingEdges.end(), edge); - if (i != myGNEIncomingEdges.end()) { - throw InvalidArgument("Incoming " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' was already inserted into " + getTagStr() + " with ID " + getID() + "'"); - } else { - // Add edge into containers - myGNEIncomingEdges.push_back(edge); - myGNEEdges.push_back(edge); - } -} - - - -void -GNEJunction::addOutgoingGNEEdge(GNEEdge* edge) { - // Check if outgoing edge was already inserted - std::vector::iterator i = std::find(myGNEOutgoingEdges.begin(), myGNEOutgoingEdges.end(), edge); - if (i != myGNEOutgoingEdges.end()) { - throw InvalidArgument("Outgoing " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' was already inserted into " + getTagStr() + " with ID " + getID() + "'"); - } else { - // Add edge into containers - myGNEOutgoingEdges.push_back(edge); - myGNEEdges.push_back(edge); - } -} - - -void -GNEJunction::removeIncomingGNEEdge(GNEEdge* edge) { - // Check if incoming edge was already inserted - std::vector::iterator i = std::find(myGNEIncomingEdges.begin(), myGNEIncomingEdges.end(), edge); - if (i == myGNEIncomingEdges.end()) { - throw InvalidArgument("Incoming " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' doesn't found into " + getTagStr() + " with ID " + getID() + "'"); - } else { - // remove edge from containers - myGNEIncomingEdges.erase(i); - myGNEEdges.erase(std::find(myGNEEdges.begin(), myGNEEdges.end(), edge)); - } -} - - -void -GNEJunction::removeOutgoingGNEEdge(GNEEdge* edge) { - // Check if outgoing edge was already inserted - std::vector::iterator i = std::find(myGNEOutgoingEdges.begin(), myGNEOutgoingEdges.end(), edge); - if (i == myGNEOutgoingEdges.end()) { - throw InvalidArgument("Outgoing " + toString(SUMO_TAG_EDGE) + " with ID '" + edge->getID() + "' doesn't found into " + getTagStr() + " with ID " + getID() + "'"); - } else { - // remove edge from containers - myGNEOutgoingEdges.erase(i); - myGNEEdges.erase(std::find(myGNEEdges.begin(), myGNEEdges.end(), edge)); - } -} - - -const std::vector& -GNEJunction::getGNEEdges() const { - return myGNEEdges; -} - - -const std::vector& -GNEJunction::getGNEIncomingEdges() const { - return myGNEIncomingEdges; -} - - -const std::vector& -GNEJunction::getGNEOutgoingEdges() const { - return myGNEOutgoingEdges; -} - - -const std::vector& -GNEJunction::getGNECrossings() const { - return myGNECrossings; -} - - -std::vector -GNEJunction::getGNEConnections() const { - std::vector connections; - for (const auto& i : myGNEIncomingEdges) { - for (const auto& j : i->getGNEConnections()) { - connections.push_back(j); - } - } - return connections; -} - - -void -GNEJunction::markAsCreateEdgeSource() { - myAmCreateEdgeSource = true; -} - - -void -GNEJunction::unMarkAsCreateEdgeSource() { - myAmCreateEdgeSource = false; -} - - -void -GNEJunction::selectTLS(bool selected) { - myAmTLSSelected = selected; -} - - -void -GNEJunction::startGeometryMoving(bool extendToNeighbors) { - // save current centering boundary - myMovingGeometryBoundary = getCenteringBoundary(); - // First declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections - std::set affectedJunctions; - std::set affectedEdges; - // Iterate over GNEEdges - for (const auto& edge : myGNEEdges) { - // Add source and destiny junctions - affectedJunctions.insert(edge->getGNEJunctionSource()); - affectedJunctions.insert(edge->getGNEJunctionDestiny()); - // Obtain neighbors of Junction source - for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { - affectedEdges.insert(junctionSourceEdge); - } - // Obtain neighbors of Junction destiny - for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { - affectedEdges.insert(junctionDestinyEdge); - } - } - // Iterate over affected Junctions only if extendToNeighbors is enabled - if (extendToNeighbors) { - for (const auto& affectedJunction : affectedJunctions) { - // don't include this junction (to avoid start more than one times) - if (affectedJunction != this) { - // start geometry moving in edges - affectedJunction->startGeometryMoving(false); - } - } - } - // Iterate over affected Edges - for (const auto& edge : affectedEdges) { - // start geometry moving in edges - edge->startGeometryMoving(); - } -} - - -void -GNEJunction::endGeometryMoving(bool extendToNeighbors) { - // check that endGeometryMoving was called only once - if (myMovingGeometryBoundary.isInitialised()) { - // Remove object from net - myNet->removeGLObjectFromGrid(this); - // reset myMovingGeometryBoundary - myMovingGeometryBoundary.reset(); - // First declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections - std::set affectedJunctions; - std::set affectedEdges; - // Iterate over GNEEdges - for (const auto& edge : myGNEEdges) { - // Add source and destiny junctions - affectedJunctions.insert(edge->getGNEJunctionSource()); - affectedJunctions.insert(edge->getGNEJunctionDestiny()); - // Obtain neighbors of Junction source - for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { - affectedEdges.insert(junctionSourceEdge); - } - // Obtain neighbors of Junction destiny - for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { - affectedEdges.insert(junctionDestinyEdge); - } - } - // Iterate over affected Junctions - if (extendToNeighbors) { - for (const auto& junction : affectedJunctions) { - // don't include this junction (to avoid end it more than one times) - if (junction != this) { - // end geometry moving in edges - junction->endGeometryMoving(false); - } - } - } - // Iterate over affected Edges - for (const auto& affectedEdge : affectedEdges) { - // end geometry moving in edges - affectedEdge->endGeometryMoving(); - } - // add object into grid again (using the new centering boundary) - myNet->addGLObjectIntoGrid(this); - // update geometry of affected junctions - if (extendToNeighbors) { - for (const auto& junction : affectedJunctions) { - junction->updateGeometry(); - } - } - } -} - - -void -GNEJunction::moveGeometry(const Position& oldPos, const Position& offset) { - // calculate new position - Position newPosition = oldPos; - newPosition.add(offset); - // filtern position using snap to active grid - newPosition = myNet->getViewNet()->snapToActiveGrid(newPosition, offset.z() == 0); - // move junction geometry without updating grid - moveJunctionGeometry(newPosition); -} - - -void -GNEJunction::commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList) { - // first end geometry point - endGeometryMoving(); - if (isValid(SUMO_ATTR_POSITION, toString(myNBNode->getPosition()))) { - undoList->p_begin("position of " + getTagStr()); - undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_POSITION, toString(myNBNode->getPosition()), true, toString(oldPos))); - undoList->p_end(); - } else { - // tried to set an invalid position, revert back to the previous one - moveJunctionGeometry(oldPos); - } -} - - -void -GNEJunction::invalidateShape() { - if (!myNBNode->hasCustomShape()) { - if (myNBNode->myPoly.size() > 0) { - // write GL Debug - WRITE_GLDEBUG("<-- Invalidating shape of junction '" + getID() + "' -->"); - // remove Juntion from grid - myNet->removeGLObjectFromGrid(this); - // clear poly - myNBNode->myPoly.clear(); - // add Juntion into grid - myNet->addGLObjectIntoGrid(this); - } - myNet->requireRecompute(); - } -} - - -void -GNEJunction::setLogicValid(bool valid, GNEUndoList* undoList, const std::string& status) { - myHasValidLogic = valid; - if (!valid) { - assert(undoList != 0); - assert(undoList->hasCommandGroup()); - NBTurningDirectionsComputer::computeTurnDirectionsForNode(myNBNode, false); - EdgeVector incoming = myNBNode->getIncomingEdges(); - for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) { - GNEEdge* srcEdge = myNet->retrieveEdge((*it)->getID()); - removeConnectionsFrom(srcEdge, undoList, false); // false, because the whole tls will be invalidated at the end - undoList->add(new GNEChange_Attribute(srcEdge, myNet, GNE_ATTR_MODIFICATION_STATUS, status), true); - } - undoList->add(new GNEChange_Attribute(this, myNet, GNE_ATTR_MODIFICATION_STATUS, status), true); - invalidateTLS(undoList); - } else { - // logic valed, then rebuild GNECrossings to adapt it to the new logic - // (but don't rebuild the crossings in NBNode because they are already finished) - rebuildGNECrossings(false); - } -} - - -void -GNEJunction::removeConnectionsFrom(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane) { - NBEdge* srcNBE = edge->getNBEdge(); - NBEdge* turnEdge = srcNBE->getTurnDestination(); - // Make a copy of connections - std::vector connections = srcNBE->getConnections(); - // delete in reverse so that undoing will add connections in the original order - for (std::vector::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) { - if (lane >= 0 && (*con_it).fromLane != lane) { - continue; - } - bool hasTurn = con_it->toEdge == turnEdge; - undoList->add(new GNEChange_Connection(edge, *con_it, false, false), true); - // needs to come after GNEChange_Connection - // XXX bug: this code path will not be used on a redo! - if (hasTurn) { - myNet->addExplicitTurnaround(srcNBE->getID()); - } - } - if (updateTLS) { - std::vector removeConnections; - for (NBEdge::Connection con : connections) { - removeConnections.push_back(NBConnection(srcNBE, con.fromLane, con.toEdge, con.toLane)); - } - removeTLSConnections(removeConnections, undoList); - } -} - - -void -GNEJunction::removeConnectionsTo(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane) { - NBEdge* destNBE = edge->getNBEdge(); - std::vector removeConnections; - for (NBEdge* srcNBE : myNBNode->getIncomingEdges()) { - GNEEdge* srcEdge = myNet->retrieveEdge(srcNBE->getID()); - std::vector connections = srcNBE->getConnections(); - for (std::vector::reverse_iterator con_it = connections.rbegin(); con_it != connections.rend(); con_it++) { - if ((*con_it).toEdge == destNBE) { - if (lane >= 0 && (*con_it).toLane != lane) { - continue; - } - bool hasTurn = srcNBE->getTurnDestination() == destNBE; - undoList->add(new GNEChange_Connection(srcEdge, *con_it, false, false), true); - // needs to come after GNEChange_Connection - // XXX bug: this code path will not be used on a redo! - if (hasTurn) { - myNet->addExplicitTurnaround(srcNBE->getID()); - } - removeConnections.push_back(NBConnection(srcNBE, (*con_it).fromLane, destNBE, (*con_it).toLane)); - } - } - } - if (updateTLS) { - removeTLSConnections(removeConnections, undoList); - } -} - - -void -GNEJunction::removeTLSConnections(std::vector& connections, GNEUndoList* undoList) { - if (connections.size() > 0) { - const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! - for (const auto& TLS : coypOfTls) { - NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); - // guessed TLS (NBOwnTLDef) do not need to be updated - if (tlDef != nullptr) { - std::string newID = tlDef->getID(); - // create replacement before deleting the original because deletion will mess up saving original nodes - NBLoadedSUMOTLDef* replacementDef = new NBLoadedSUMOTLDef(tlDef, tlDef->getLogic()); - for (NBConnection& con : connections) { - replacementDef->removeConnection(con); - } - undoList->add(new GNEChange_TLS(this, tlDef, false), true); - undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); - // the removed traffic light may have controlled more than one junction. These too have become invalid now - const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! - for (const auto& node : copyOfNodes) { - GNEJunction* sharing = myNet->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); - undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); - } - } - } - } -} - - -void -GNEJunction::replaceIncomingConnections(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList) { - // remap connections of the edge - assert(which->getLanes().size() == by->getLanes().size()); - std::vector connections = which->getNBEdge()->getConnections(); - for (NBEdge::Connection& c : connections) { - undoList->add(new GNEChange_Connection(which, c, false, false), true); - undoList->add(new GNEChange_Connection(by, c, false, true), true); - } - // also remap tls connections - const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! - for (const auto& TLS : coypOfTls) { - NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); - // guessed TLS (NBOwnTLDef) do not need to be updated - if (tlDef != nullptr) { - std::string newID = tlDef->getID(); - // create replacement before deleting the original because deletion will mess up saving original nodes - NBLoadedSUMOTLDef* replacementDef = new NBLoadedSUMOTLDef(tlDef, tlDef->getLogic()); - for (int i = 0; i < (int)which->getLanes().size(); ++i) { - replacementDef->replaceRemoved(which->getNBEdge(), i, by->getNBEdge(), i); - } - undoList->add(new GNEChange_TLS(this, tlDef, false), true); - undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); - // the removed traffic light may have controlled more than one junction. These too have become invalid now - const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! - for (const auto& node : copyOfNodes) { - GNEJunction* sharing = myNet->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); - undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); - } - } - } -} - - -void -GNEJunction::markAsModified(GNEUndoList* undoList) { - EdgeVector incoming = myNBNode->getIncomingEdges(); - for (EdgeVector::iterator it = incoming.begin(); it != incoming.end(); it++) { - NBEdge* srcNBE = *it; - GNEEdge* srcEdge = myNet->retrieveEdge(srcNBE->getID()); - undoList->add(new GNEChange_Attribute(srcEdge, myNet, GNE_ATTR_MODIFICATION_STATUS, FEATURE_MODIFIED), true); - } -} - - -void -GNEJunction::invalidateTLS(GNEUndoList* undoList, const NBConnection& deletedConnection, const NBConnection& addedConnection) { - assert(undoList->hasCommandGroup()); - // NBLoadedSUMOTLDef becomes invalid, replace with NBOwnTLDef which will be dynamically recomputed - const std::set coypOfTls = myNBNode->getControllingTLS(); // make a copy! - for (const auto& TLS : coypOfTls) { - NBLoadedSUMOTLDef* tlDef = dynamic_cast(TLS); - if (tlDef != nullptr) { - NBTrafficLightDefinition* replacementDef = nullptr; - std::string newID = tlDef->getID(); // + "_reguessed"; // changes due to reguessing will be visible in diff - if (deletedConnection != NBConnection::InvalidConnection) { - // create replacement before deleting the original because deletion will mess up saving original nodes - NBLoadedSUMOTLDef* repl = new NBLoadedSUMOTLDef(tlDef, tlDef->getLogic()); - repl->removeConnection(deletedConnection); - replacementDef = repl; - } else if (addedConnection != NBConnection::InvalidConnection) { - if (addedConnection.getTLIndex() == NBConnection::InvalidTlIndex) { - // custom tl indices of crossings might become invalid upon recomputation so we must save them - // however, the could remain valud so we register a change but keep them at their old value - for (GNECrossing* c : myGNECrossings) { - const std::string oldValue = c->getAttribute(SUMO_ATTR_TLLINKINDEX); - undoList->add(new GNEChange_Attribute(c, myNet, SUMO_ATTR_TLLINKINDEX, toString(NBConnection::InvalidTlIndex)), true); - undoList->add(new GNEChange_Attribute(c, myNet, SUMO_ATTR_TLLINKINDEX, oldValue), true); - const std::string oldValue2 = c->getAttribute(SUMO_ATTR_TLLINKINDEX); - undoList->add(new GNEChange_Attribute(c, myNet, SUMO_ATTR_TLLINKINDEX2, toString(NBConnection::InvalidTlIndex)), true); - undoList->add(new GNEChange_Attribute(c, myNet, SUMO_ATTR_TLLINKINDEX2, oldValue2), true); - } - } - NBLoadedSUMOTLDef* repl = new NBLoadedSUMOTLDef(tlDef, tlDef->getLogic()); - repl->addConnection(addedConnection.getFrom(), addedConnection.getTo(), - addedConnection.getFromLane(), addedConnection.getToLane(), addedConnection.getTLIndex(), addedConnection.getTLIndex2()); - replacementDef = repl; - } else { - replacementDef = new NBOwnTLDef(newID, tlDef->getOffset(), tlDef->getType()); - replacementDef->setProgramID(tlDef->getProgramID()); - } - undoList->add(new GNEChange_TLS(this, tlDef, false), true); - undoList->add(new GNEChange_TLS(this, replacementDef, true, false, newID), true); - // the removed traffic light may have controlled more than one junction. These too have become invalid now - const std::vector copyOfNodes = tlDef->getNodes(); // make a copy! - for (const auto& node : copyOfNodes) { - GNEJunction* sharing = myNet->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(sharing, tlDef, false), true); - undoList->add(new GNEChange_TLS(sharing, replacementDef, true, false, newID), true); - } - } - } -} - -void -GNEJunction::removeEdgeFromCrossings(GNEEdge* edge, GNEUndoList* undoList) { - // obtain a copy of GNECrossing of junctions - auto copyOfGNECrossings = myGNECrossings; - // iterate over copy of GNECrossings - for (int i = 0; i < (int)myGNECrossings.size(); i++) { - auto c = myGNECrossings.at(i); - // obtain the set of edges vinculated with the crossing (due it works as ID) - EdgeSet edgeSet(c->getCrossingEdges().begin(), c->getCrossingEdges().end()); - // If this edge is part of the set of edges of crossing - if (edgeSet.count(edge->getNBEdge()) == 1) { - // delete crossing if this is their last edge - if ((c->getCrossingEdges().size() == 1) && (c->getCrossingEdges().front() == edge->getNBEdge())) { - myNet->deleteCrossing(c, undoList); - i = 0; - } else { - // remove this edge of the edge's attribute of crossing (note: This can invalidate the crossing) - std::vector edges = GNEAttributeCarrier::parse>(c->getAttribute(SUMO_ATTR_EDGES)); - edges.erase(std::find(edges.begin(), edges.end(), edge->getID())); - c->setAttribute(SUMO_ATTR_EDGES, joinToString(edges, " "), undoList); - } - } - } -} - - -bool -GNEJunction::isLogicValid() { - return myHasValidLogic; -} - - -GNECrossing* -GNEJunction::retrieveGNECrossing(NBNode::Crossing* NBNodeCrossing, bool createIfNoExist) { - // iterate over all crossing - for (const auto& crossing : myGNECrossings) { - // if found, return it - if (crossing->getCrossingEdges() == NBNodeCrossing->edges) { - return crossing; - } - } - if (createIfNoExist) { - // create new GNECrossing - GNECrossing* createdGNECrossing = new GNECrossing(this, NBNodeCrossing->edges); - // show extra information for tests - WRITE_DEBUG("Created " + createdGNECrossing->getTagStr() + " '" + createdGNECrossing->getID() + "' in retrieveGNECrossing()"); - // update geometry after creating - createdGNECrossing->updateGeometry(); - return createdGNECrossing; - } else { - return nullptr; - } -} - - -void -GNEJunction::markConnectionsDeprecated(bool includingNeighbours) { - // only it's needed to mark the connections of incoming edges - for (const auto& i : myGNEIncomingEdges) { - for (const auto& j : i->getGNEConnections()) { - j->markConnectionGeometryDeprecated(); - } - if (includingNeighbours) { - i->getGNEJunctionSource()->markConnectionsDeprecated(false); - } - } -} - - -std::string -GNEJunction::getAttribute(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - return getMicrosimID(); - case SUMO_ATTR_POSITION: - return toString(myNBNode->getPosition()); - case SUMO_ATTR_TYPE: - return toString(myNBNode->getType()); - case GNE_ATTR_MODIFICATION_STATUS: - return myLogicStatus; - case SUMO_ATTR_SHAPE: - return toString(myNBNode->getShape()); - case SUMO_ATTR_RADIUS: - return toString(myNBNode->getRadius()); - case SUMO_ATTR_TLTYPE: - if (isAttributeEnabled(SUMO_ATTR_TLTYPE)) { - // @todo this causes problems if the node were to have multiple programs of different type (plausible) - return toString((*myNBNode->getControllingTLS().begin())->getType()); - } else { - return "No TLS"; - } - case SUMO_ATTR_TLID: - if (isAttributeEnabled(SUMO_ATTR_TLID)) { - return toString((*myNBNode->getControllingTLS().begin())->getID()); - } else { - return "No TLS"; - } - case SUMO_ATTR_KEEP_CLEAR: - // keep clear is only used as a convenience feature in plain xml - // input. When saving to .net.xml the status is saved only for the connections - // to show the correct state we must check all connections - for (const auto& i : myGNEIncomingEdges) { - for (const auto& j : i->getGNEConnections()) { - if (j->getNBEdgeConnection().keepClear) { - return toString(true); - } - } - } - return toString(false); - case SUMO_ATTR_RIGHT_OF_WAY: - return SUMOXMLDefinitions::RightOfWayValues.getString(myNBNode->getRightOfWay()); - case SUMO_ATTR_FRINGE: - return SUMOXMLDefinitions::FringeTypeValues.getString(myNBNode->getFringeType()); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return myNBNode->getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEJunction::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: - case SUMO_ATTR_POSITION: - case GNE_ATTR_MODIFICATION_STATUS: - case SUMO_ATTR_SHAPE: - case SUMO_ATTR_RADIUS: - case SUMO_ATTR_RIGHT_OF_WAY: - case SUMO_ATTR_FRINGE: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - undoList->add(new GNEChange_Attribute(this, myNet, key, value), true); - break; - case SUMO_ATTR_KEEP_CLEAR: - // change Keep Clear attribute in all connections - undoList->p_begin("change keepClear for whole junction"); - for (const auto& i : myGNEIncomingEdges) { - for (const auto& j : i->getGNEConnections()) { - undoList->add(new GNEChange_Attribute(j, myNet, key, value), true); - } - } - undoList->p_end(); - break; - case SUMO_ATTR_TYPE: { - undoList->p_begin("change " + getTagStr() + " type"); - if (NBNode::isTrafficLight(SUMOXMLDefinitions::NodeTypes.get(value))) { - if (getNBNode()->isTLControlled() && - // if switching changing from or to traffic_light_right_on_red we need to remove the old plan - (getNBNode()->getType() == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED - || SUMOXMLDefinitions::NodeTypes.get(value) == NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED) - ) { - // make a copy because we will modify the original - const std::set copyOfTls = myNBNode->getControllingTLS(); - for (const auto& TLS : copyOfTls) { - undoList->add(new GNEChange_TLS(this, TLS, false), true); - } - } - if (!getNBNode()->isTLControlled()) { - // create new traffic light - undoList->add(new GNEChange_TLS(this, nullptr, true), true); - } - } else if (getNBNode()->isTLControlled()) { - // delete old traffic light - // make a copy because we will modify the original - const std::set copyOfTls = myNBNode->getControllingTLS(); - for (const auto& TLS : copyOfTls) { - undoList->add(new GNEChange_TLS(this, TLS, false, false), true); - } - } - // must be the final step, otherwise we do not know which traffic lights to remove via GNEChange_TLS - undoList->add(new GNEChange_Attribute(this, myNet, key, value), true); - for (const auto& crossing : myGNECrossings) { - undoList->add(new GNEChange_Attribute(crossing, myNet, SUMO_ATTR_TLLINKINDEX, "-1"), true); - undoList->add(new GNEChange_Attribute(crossing, myNet, SUMO_ATTR_TLLINKINDEX2, "-1"), true); - } - undoList->p_end(); - break; - } - case SUMO_ATTR_TLTYPE: { - undoList->p_begin("change " + getTagStr() + " tl-type"); - // make a copy because we will modify the original - const std::set copyOfTls = myNBNode->getControllingTLS(); - for (const auto& TLS : copyOfTls) { - NBLoadedSUMOTLDef* oldLoaded = dynamic_cast(TLS); - if (oldLoaded != nullptr) { - NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(oldLoaded, oldLoaded->getLogic()); - newDef->guessMinMaxDuration(); - std::vector nodes = TLS->getNodes(); - for (const auto& node : nodes) { - GNEJunction* junction = myNet->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(junction, TLS, false), true); - undoList->add(new GNEChange_TLS(junction, TLS, true), true); - } - } - } - undoList->add(new GNEChange_Attribute(this, myNet, key, value), true); - undoList->p_end(); - break; - } - case SUMO_ATTR_TLID: { - undoList->p_begin("change " + toString(SUMO_TAG_TRAFFIC_LIGHT) + " id"); - const std::set copyOfTls = myNBNode->getControllingTLS(); - assert(copyOfTls.size() > 0); - NBTrafficLightDefinition* currentTLS = *copyOfTls.begin(); - NBTrafficLightDefinition* currentTLSCopy = nullptr; - const bool currentIsSingle = currentTLS->getNodes().size() == 1; - const bool currentIsLoaded = dynamic_cast(currentTLS) != nullptr; - if (currentIsLoaded) { - currentTLSCopy = new NBLoadedSUMOTLDef(currentTLS, - dynamic_cast(currentTLS)->getLogic()); - } - // remove from previous tls - for (const auto& TLS : copyOfTls) { - undoList->add(new GNEChange_TLS(this, TLS, false), true); - } - NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); - // programs to which the current node shall be added - const std::map programs = tlCont.getPrograms(value); - if (programs.size() > 0) { - for (const auto& TLSProgram : programs) { - NBTrafficLightDefinition* oldTLS = TLSProgram.second; - if (dynamic_cast(oldTLS) != nullptr) { - undoList->add(new GNEChange_TLS(this, oldTLS, true), true); - } else { - // delete and re-create the definition because the loaded phases are now invalid - if (dynamic_cast(oldTLS) != nullptr && - dynamic_cast(oldTLS)->usingSignalGroups()) { - // keep the old program and add all-red state for the added links - NBLoadedSUMOTLDef* newTLSJoined = new NBLoadedSUMOTLDef(oldTLS, dynamic_cast(oldTLS)->getLogic()); - newTLSJoined->joinLogic(currentTLSCopy); - undoList->add(new GNEChange_TLS(this, newTLSJoined, true, true), true); - } else { - undoList->add(new GNEChange_TLS(this, nullptr, true, false, value), true); - } - NBTrafficLightDefinition* newTLS = *myNBNode->getControllingTLS().begin(); - // switch from old to new definition - std::vector copyOfNodes = oldTLS->getNodes(); - for (const auto& node : copyOfNodes) { - GNEJunction* oldJunction = myNet->retrieveJunction(node->getID()); - undoList->add(new GNEChange_TLS(oldJunction, oldTLS, false), true); - undoList->add(new GNEChange_TLS(oldJunction, newTLS, true), true); - } - } - } - } else { - if (currentIsSingle && currentIsLoaded) { - // rename the traffic light but keep everything else - NBTrafficLightLogic* renamedLogic = dynamic_cast(currentTLSCopy)->getLogic(); - renamedLogic->setID(value); - NBLoadedSUMOTLDef* renamedTLS = new NBLoadedSUMOTLDef(currentTLSCopy, renamedLogic); - renamedTLS->setID(value); - undoList->add(new GNEChange_TLS(this, renamedTLS, true, true), true); - } else { - // create new traffic light - undoList->add(new GNEChange_TLS(this, nullptr, true, false, value), true); - } - } - delete currentTLSCopy; - undoList->p_end(); - break; - } - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEJunction::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveJunction(value, false) == nullptr); - case SUMO_ATTR_TYPE: - return SUMOXMLDefinitions::NodeTypes.hasString(value); - case SUMO_ATTR_POSITION: - return canParse(value); - case SUMO_ATTR_SHAPE: - // empty shapes are allowed - return canParse(value); - case SUMO_ATTR_RADIUS: - return canParse(value) && (parse(value) >= -1); - case SUMO_ATTR_TLTYPE: - return myNBNode->isTLControlled() && SUMOXMLDefinitions::TrafficLightTypes.hasString(value); - case SUMO_ATTR_TLID: - return myNBNode->isTLControlled() && (value != ""); - case SUMO_ATTR_KEEP_CLEAR: - return canParse(value); - case SUMO_ATTR_RIGHT_OF_WAY: - return SUMOXMLDefinitions::RightOfWayValues.hasString(value); - case SUMO_ATTR_FRINGE: - return SUMOXMLDefinitions::FringeTypeValues.hasString(value); - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNEJunction::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_TLTYPE: - case SUMO_ATTR_TLID: - return myNBNode->isTLControlled(); - case SUMO_ATTR_KEEP_CLEAR: { - // check if at least there is an incoming connection - for (const auto& i : myGNEIncomingEdges) { - if (i->getGNEConnections().size() > 0) { - return true; - } - } - return false; - } - default: - return true; - } -} - - -void -GNEJunction::setResponsible(bool newVal) { - myAmResponsible = newVal; -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNEJunction::drawTLSIcon(const GUIVisualizationSettings& s) const { - // draw TLS icon if isn't being drawn for selecting - if ((myNet->getViewNet()->getEditModes().networkEditMode == GNE_NMODE_TLS) && - (myNBNode->isTLControlled()) && !myAmTLSSelected && !s.drawForRectangleSelection) { - glPushMatrix(); - Position pos = myNBNode->getPosition(); - glTranslated(pos.x(), pos.y(), getType() + 0.1); - glColor3d(1, 1, 1); - const double halfWidth = 32 / s.scale; - const double halfHeight = 64 / s.scale; - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_TLS), -halfWidth, -halfHeight, halfWidth, halfHeight); - glPopMatrix(); - } -} - - -void -GNEJunction::drawJunctionChilds(const GUIVisualizationSettings& s) const { - // draw connections and route elements connections (Only for incoming edges) - for (const auto& incomingEdge : myGNEIncomingEdges) { - // first draw connections - for (const auto& connection : incomingEdge->getGNEConnections()) { - connection->drawGL(s); - } - // then draw E2 multilane detectors - for (const auto& lane : incomingEdge->getLanes()) { - for (const auto& additional : lane->getChildAdditionals()) { - if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - lane->drawPartialE2DetectorPlan(s, additional, this); - } - } - } - // first check if Demand elements can be shown - if (myNet->getViewNet()->getNetworkViewOptions().showDemandElements()) { - // draw demand elements - drawDemandElements(s, incomingEdge); - } - } -} - - -void -GNEJunction::drawDemandElements(const GUIVisualizationSettings& s, const GNEEdge* edge) const { - // certain demand elements children can contain loops (for example, routes) and it causes overlapping problems. It's needed to filter it before drawing - if (s.drawForPositionSelection) { - for (const auto& route : edge->getChildDemandElementsByType(SUMO_TAG_ROUTE)) { - // first check if route can be drawn - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { - // draw partial route - edge->drawPartialRoute(s, route, this); - } - } - for (const auto& embeddedRoute : edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE)) { - // first check if embedded route can be drawn - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { - // draw partial route - edge->drawPartialRoute(s, embeddedRoute, this); - } - } - } else { - // if drawForPositionSelection is disabled, only draw the first element - if (edge->getChildDemandElementsByType(SUMO_TAG_ROUTE).size() > 0) { - const auto& route = edge->getChildDemandElementsByType(SUMO_TAG_ROUTE).front(); - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(route)) { - edge->drawPartialRoute(s, route, this); - } - } - if (edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).size() > 0) { - const auto& embeddedRoute = edge->getChildDemandElementsByType(SUMO_TAG_EMBEDDEDROUTE).front(); - if (myNet->getViewNet()->getDemandViewOptions().showNonInspectedDemandElements(embeddedRoute)) { - edge->drawPartialRoute(s, embeddedRoute, this); - } - } - } - for (const auto& trip : edge->getChildDemandElementsByType(SUMO_TAG_TRIP)) { - // Start drawing adding an gl identificator - glPushName(trip->getGlID()); - // draw partial trip only if is being inspected or selected - if ((myNet->getViewNet()->getDottedAC() == trip) || trip->isAttributeCarrierSelected()) { - edge->drawPartialTripFromTo(s, trip, this); - } - // only draw trip in the first edge - if (trip->getAttribute(SUMO_ATTR_FROM) == getID()) { - trip->drawGL(s); - } - // Pop name - glPopName(); - } - for (const auto& flow : edge->getChildDemandElementsByType(SUMO_TAG_FLOW)) { - // Start drawing adding an gl identificator - glPushName(flow->getGlID()); - // draw partial trip only if is being inspected or selected - if ((myNet->getViewNet()->getDottedAC() == flow) || flow->isAttributeCarrierSelected()) { - edge->drawPartialTripFromTo(s, flow, this); - } - // only draw flow in the first edge - if (flow->getAttribute(SUMO_ATTR_FROM) == getID()) { - flow->drawGL(s); - } - // Pop name - glPopName(); - } - // draw partial person plan elements - if (s.drawForPositionSelection) { - for (const auto& personTripFromTo : edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO)) { - edge->drawPartialPersonPlan(s, personTripFromTo, this); - } - for (const auto& personTripBusStop : edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP)) { - edge->drawPartialPersonPlan(s, personTripBusStop, this); - } - for (const auto& walkEdges : edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES)) { - edge->drawPartialPersonPlan(s, walkEdges, this); - } - for (const auto& walkFromTo : edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO)) { - edge->drawPartialPersonPlan(s, walkFromTo, this); - } - for (const auto& walkBusStop : edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP)) { - edge->drawPartialPersonPlan(s, walkBusStop, this); - } - for (const auto& walkRoute : edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE)) { - edge->drawPartialPersonPlan(s, walkRoute, this); - } - for (const auto& rideFromTo : edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO)) { - edge->drawPartialPersonPlan(s, rideFromTo, this); - } - for (const auto& rideBusStop : edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP)) { - edge->drawPartialPersonPlan(s, rideBusStop, this); - } - } else { - // if drawForPositionSelection is disabled, only draw the first element - if (edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_FROMTO).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_PERSONTRIP_BUSSTOP).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_EDGES).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_FROMTO).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_BUSSTOP).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_WALK_ROUTE).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_RIDE_FROMTO).front(), nullptr); - } - if (edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).size() > 0) { - edge->drawPartialPersonPlan(s, edge->getChildDemandElementsByType(SUMO_TAG_RIDE_BUSSTOP).front(), nullptr); - } - } -} - - -void -GNEJunction::setAttribute(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_KEEP_CLEAR: { - throw InvalidArgument(toString(key) + " cannot be edited"); - } - case SUMO_ATTR_ID: { - myNet->renameJunction(this, value); - break; - } - case SUMO_ATTR_TYPE: { - SumoXMLNodeType type = SUMOXMLDefinitions::NodeTypes.get(value); - if (myNBNode->getType() == NODETYPE_PRIORITY && type == NODETYPE_RIGHT_BEFORE_LEFT) { - myNet->getNetBuilder()->getEdgeCont().removeRoundabout(myNBNode); - } - myNBNode->reinit(myNBNode->getPosition(), type); - break; - } - case SUMO_ATTR_POSITION: { - // start geometry moving (because new position affect all junction children) - startGeometryMoving(); - // set new position in NBNode without updating grid - moveJunctionGeometry(parse(value)); - // end geometry moving - endGeometryMoving(); - // mark this connections and all of the junction's Neighbours as deprecated - markConnectionsDeprecated(true); - break; - } - case GNE_ATTR_MODIFICATION_STATUS: - if (myLogicStatus == FEATURE_GUESSED && value != FEATURE_GUESSED) { - // clear guessed connections. previous connections will be restored - myNBNode->invalidateIncomingConnections(); - // Clear GNEConnections of incoming edges - for (const auto& i : myGNEIncomingEdges) { - i->clearGNEConnections(); - } - } - myLogicStatus = value; - break; - case SUMO_ATTR_SHAPE: { - // start geometry moving (because new position affect all junction children) - startGeometryMoving(); - // set new shape (without updating grid) - const PositionVector shape = parse(value); - myNBNode->setCustomShape(shape); - // end geometry moving - endGeometryMoving(); - // mark this connections and all of the junction's Neighbours as deprecated - markConnectionsDeprecated(true); - break; - } - case SUMO_ATTR_RADIUS: { - myNBNode->setRadius(parse(value)); - break; - } - case SUMO_ATTR_TLTYPE: { - // we need to make a copy of controlling TLS (because original will be updated) - const std::set copyOfTls = myNBNode->getControllingTLS(); - for (const auto& TLS : copyOfTls) { - TLS->setType(SUMOXMLDefinitions::TrafficLightTypes.get(value)); - } - break; - } - case SUMO_ATTR_RIGHT_OF_WAY: - myNBNode->setRightOfWay(SUMOXMLDefinitions::RightOfWayValues.get(value)); - break; - case SUMO_ATTR_FRINGE: - myNBNode->setFringeType(SUMOXMLDefinitions::FringeTypeValues.get(value)); - break; - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - myNBNode->setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNEJunction::updateDottedContour() { - // obtain junction shape - PositionVector shape = myNBNode->getShape(); - // check if we have to calculate buuble or shape - if (shape.area() < 4) { - updateDottedGeometry(GNEGeometry::getVertexCircleAroundPosition(myNBNode->getPosition(), 4, 32)); - } else { - // close polygon - shape.closePolygon(); - updateDottedGeometry(shape); - } -} - - -double -GNEJunction::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const { - switch (activeScheme) { - case 0: - if (myColorForMissingConnections) { - return 3; - } else { - return 0; - } - case 1: - return isAttributeCarrierSelected(); - case 2: - switch (myNBNode->getType()) { - case NODETYPE_TRAFFIC_LIGHT: - return 0; - case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: - return 1; - case NODETYPE_PRIORITY: - return 2; - case NODETYPE_PRIORITY_STOP: - return 3; - case NODETYPE_RIGHT_BEFORE_LEFT: - return 4; - case NODETYPE_ALLWAY_STOP: - return 5; - case NODETYPE_DISTRICT: - return 6; - case NODETYPE_NOJUNCTION: - return 7; - case NODETYPE_DEAD_END: - case NODETYPE_DEAD_END_DEPRECATED: - return 8; - case NODETYPE_UNKNOWN: - return 8; // may happen before first network computation - case NODETYPE_INTERNAL: - assert(false); - return 8; - case NODETYPE_RAIL_SIGNAL: - return 9; - case NODETYPE_ZIPPER: - return 10; - case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: - return 11; - case NODETYPE_RAIL_CROSSING: - return 12; - } - case 3: - return myNBNode->getPosition().z(); - default: - assert(false); - return 0; - } -} - -void -GNEJunction::checkMissingConnections() { - for (auto edge : myGNEIncomingEdges) { - if (edge->getGNEConnections().size() > 0) { - myColorForMissingConnections = false; - return; - } - } - // no connections. Use normal color for border edges and cul-de-sac - if (myGNEIncomingEdges.size() == 0 || myGNEOutgoingEdges.size() == 0) { - myColorForMissingConnections = false; - return; - } else if (myGNEIncomingEdges.size() == 1 && myGNEOutgoingEdges.size() == 1) { - NBEdge* in = myGNEIncomingEdges[0]->getNBEdge(); - NBEdge* out = myGNEOutgoingEdges[0]->getNBEdge(); - if (in->isTurningDirectionAt(out)) { - myColorForMissingConnections = false; - return; - } - } - myColorForMissingConnections = true; -} - - -void -GNEJunction::moveJunctionGeometry(const Position& pos) { - // obtain NBNode position - const Position orig = myNBNode->getPosition(); - // reinit NBNode - myNBNode->reinit(pos, myNBNode->getType()); - // set new position of adjacent edges - for (const auto& edge : getNBNode()->getEdges()) { - myNet->retrieveEdge(edge->getID())->updateJunctionPosition(this, orig); - } - // declare three sets with all affected GNEJunctions, GNEEdges and GNEConnections - std::set affectedJunctions; - std::set affectedEdges; - // Iterate over GNEEdges - for (const auto& edge : myGNEEdges) { - // Add source and destiny junctions - affectedJunctions.insert(edge->getGNEJunctionSource()); - affectedJunctions.insert(edge->getGNEJunctionDestiny()); - // Obtain neighbors of Junction source - for (const auto& junctionSourceEdge : edge->getGNEJunctionSource()->getGNEEdges()) { - affectedEdges.insert(junctionSourceEdge); - } - // Obtain neighbors of Junction destiny - for (const auto& junctionDestinyEdge : edge->getGNEJunctionDestiny()->getGNEEdges()) { - affectedEdges.insert(junctionDestinyEdge); - } - } - // Iterate over affected Edges - for (const auto& affectedEdge : affectedEdges) { - // Update edge geometry - affectedEdge->updateGeometry(); - } -} - - -RGBColor -GNEJunction::setColor(const GUIVisualizationSettings& s, bool bubble) const { - const int scheme = s.junctionColorer.getActive(); - RGBColor color = s.junctionColorer.getScheme().getColor(getColorValue(s, scheme)); - if (bubble && scheme == 0 && !myColorForMissingConnections) { - color = s.junctionColorer.getScheme().getColor(1); - } - // override with special colors (unless the color scheme is based on selection) - if (drawUsingSelectColor() && scheme != 1) { - color = s.colorSettings.selectionColor; - } - if (myAmCreateEdgeSource) { - color = RGBColor(0, 255, 0); - } - GLHelper::setColor(color); - return color; -} - - -void -GNEJunction::addTrafficLight(NBTrafficLightDefinition* tlDef, bool forceInsert) { - NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); - tlCont.insert(tlDef, forceInsert); // may return false for tlDef which controls multiple junctions - tlDef->addNode(myNBNode); -} - - -void -GNEJunction::removeTrafficLight(NBTrafficLightDefinition* tlDef) { - NBTrafficLightLogicCont& tlCont = myNet->getTLLogicCont(); - if (tlDef->getNodes().size() == 1) { - tlCont.extract(tlDef); - } - myNBNode->removeTrafficLight(tlDef); -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEJunction.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNEJunction.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEJunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEJunction.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,346 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEJunction.h -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A class for visualizing and editing junctions in netedit (adapted from -// GUIJunctionWrapper) -/****************************************************************************/ -#ifndef GNEJunction_h -#define GNEJunction_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNENetElement.h" -#include - -// =========================================================================== -// class declarations -// =========================================================================== -class GNENet; -class GNEEdge; -class GNECrossing; -class NBTrafficLightDefinition; -class GNEConnection; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNEJunction - * - * In the case the represented junction's shape is empty, the boundary - * is computed using the junction's position to which an offset of 1m to each - * side is added. - */ -class GNEJunction : public GNENetElement { - - /// @brief Declare friend class - friend class GNEChange_TLS; - friend class GNEChange_Crossing; - -public: - /// @brief constant values for drawing buubles - static const double BUBBLE_RADIUS; - - /**@brief Constructor - * @param[in] net The net to inform about gui updates - * @param[in] nbn The represented node - * @param[in] loaded Whether the junction was loaded from a file - */ - GNEJunction(GNENet* net, NBNode* nbn, bool loaded = false); - - /// @brief Destructor - ~GNEJunction(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name Functions related with geometry of element - /// @{ - /// @brief get junction shape - const PositionVector& getJunctionShape() const; - - /// @brief update pre-computed geometry information (including crossings) - void updateGeometry(); - - /// @brief update pre-computed geometry information without modifying netbuild structures - // @note: using an extra function because updateGeometry overrides an abstract virtual function - void updateGeometryAfterNetbuild(bool rebuildNBNodeCrossings = false); - - /// @brief Returns position of hierarchical element in view - Position getPositionInView() const; - /// @} - - /// @name inherited from GUIGlObject - /// @{ - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * - * @return The boundary the object is within - * @see GUIGlObject::getCenteringBoundary - */ - Boundary getCenteringBoundary() const; - - /**@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; - /// @} - - /// @brief Return net build node - NBNode* getNBNode() const; - - /// @brief return GNEJunction neighbours - std::vector getJunctionNeighbours() const; - - /// @brief add incoming GNEEdge - void addIncomingGNEEdge(GNEEdge* edge); - - /// @brief add outgoing GNEEdge - void addOutgoingGNEEdge(GNEEdge* edge); - - /// @brief remove incoming GNEEdge - void removeIncomingGNEEdge(GNEEdge* edge); - - /// @brief remove outgoing GNEEdge - void removeOutgoingGNEEdge(GNEEdge* edge); - - /// @brief Returns all GNEEdges vinculated with this Junction - const std::vector& getGNEEdges() const; - - /// @brief Returns incoming GNEEdges - const std::vector& getGNEIncomingEdges() const; - - /// @brief Returns incoming GNEEdges - const std::vector& getGNEOutgoingEdges() const; - - /// @brief Returns GNECrossings - const std::vector& getGNECrossings() const; - - /// @brief Returns all GNEConnections vinculated with this junction - std::vector getGNEConnections() const; - - /// @brief marks as first junction in createEdge-mode - void markAsCreateEdgeSource(); - - /// @brief removes mark as first junction in createEdge-mode - void unMarkAsCreateEdgeSource(); - - /// @brief notify the junction of being selected in tls-mode. (used to control drawing) - void selectTLS(bool selected); - - /// @name functions related with geometry movement - /// @{ - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(bool extendToNeighbors = true); - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(bool extendToNeighbors = true); - - /**@brief change the position of the element geometry without saving in undoList - * @param[in] oldPos old position before start moving - */ - void moveGeometry(const Position& oldPos, const Position& offset); - - /// @brief registers completed movement with the undoList - void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList); - - /// @} - - /// @name 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 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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @brief method for check if the value for certain attribute is set - * @param[in] key The attribute key - */ - bool isAttributeEnabled(SumoXMLAttr key) const; - /// @} - - /// @brief set responsibility for deleting internal strctures - void setResponsible(bool newVal); - - /* @brief notify junction that one of its edges has changed its shape, and - * therefore the junction shape is no longer valid */ - void invalidateShape(); - - /* @brief update validity of this junctions logic - * if the logic is invalidated, existing connections are removed via undo-list - * so that the previous state can be restored - * also calls invalidateTLS - * @param[in] valid The new validity of the junction - * @note: this should always be called with an active command group - */ - void setLogicValid(bool valid, GNEUndoList* undoList, const std::string& status = FEATURE_GUESSED); - - /// @brief remove all connections from the given edge - void removeConnectionsFrom(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane = -1); - - /// @brief remove all connections to the given edge - void removeConnectionsTo(GNEEdge* edge, GNEUndoList* undoList, bool updateTLS, int lane = -1); - - /// @brief prevent re-guessing connections at this junction - void markAsModified(GNEUndoList* undoList); - - /* @brief invalidates loaded or edited TLS - * @param[in] deletedConnection If a valid connection is given a replacement def with this connection removed - * but all other information intact will be computed instead of guessing a new tlDef - * @note: this should always be called with an active command group - */ - void invalidateTLS(GNEUndoList* undoList, - const NBConnection& deletedConnection = NBConnection::InvalidConnection, - const NBConnection& addedConnection = NBConnection::InvalidConnection); - - /// @brief replace one edge by another in all tls connections - void replaceIncomingConnections(GNEEdge* which, GNEEdge* by, GNEUndoList* undoList); - - /// @brief removes the given edge from all pedestrian crossings - void removeEdgeFromCrossings(GNEEdge* edge, GNEUndoList* undoList); - - /// @brief whether this junction has a valid logic - bool isLogicValid(); - - /// @brief get GNECrossing if exist, and if not create it if create is enabled - GNECrossing* retrieveGNECrossing(NBNode::Crossing* NBNodeCrossing, bool createIfNoExist = true); - - /// @brief mark connections as deprecated - void markConnectionsDeprecated(bool includingNeighbours); - -private: - /// @brief A reference to the represented junction - NBNode* myNBNode; - - /// @brief vector with the GNEEdges vinculated with this junction - std::vector myGNEEdges; - - /// @brief vector with the incomings GNEEdges vinculated with this junction - std::vector myGNEIncomingEdges; - - /// @brief vector with the outgoings GNEEdges vinculated with this junction - std::vector myGNEOutgoingEdges; - - /// @brief the built crossing objects - std::vector myGNECrossings; - - /// @brief The maximum size (in either x-, or y-dimension) for determining whether to draw or not - double myMaxSize; - - /// @brief whether this junction is the first junction for a newly creatededge - /// @see GNEApplicationWindow::createEdgeSource) - bool myAmCreateEdgeSource; - - /// @brief modification status of the junction logic (all connections across this junction) - std::string myLogicStatus; - - /// @brief whether we are responsible for deleting myNBNode - bool myAmResponsible; - - /// @brief whether this junctions logic is valid - bool myHasValidLogic; - - /// @brief whether this junction is selected in tls-mode - bool myAmTLSSelected; - - /// @brief whether this junction probably should have some connections but doesn't - bool myColorForMissingConnections; - - /// @brief draw TLS icon - void drawTLSIcon(const GUIVisualizationSettings& s) const; - - /// @brief draw junction childs - void drawJunctionChilds(const GUIVisualizationSettings& s) const; - - /// @brief draw demand elements childs - void drawDemandElements(const GUIVisualizationSettings& s, const GNEEdge* edge) const; - - /// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute) - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief update dotted contour - void updateDottedContour(); - - /**@brief reposition the node at pos without updating GRID and informs the edges - * @param[in] pos The new position - * @note: those operations are not added to the undoList. - */ - void moveJunctionGeometry(const Position& pos); - - /// @brief sets junction color depending on circumstances - RGBColor setColor(const GUIVisualizationSettings& s, bool bubble) const; - - /// @brief determines color value - double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const; - - /// @brief compute whether this junction probably should have some connections but doesn't - void checkMissingConnections(); - - /// @brief adds a traffic light - void addTrafficLight(NBTrafficLightDefinition* tlDef, bool forceInsert); - - /// @brief removes a traffic light - void removeTrafficLight(NBTrafficLightDefinition* tlDef); - - /// @brief rebuilds crossing objects for this junction - void rebuildGNECrossings(bool rebuildNBNodeCrossings = true); - - /// @brief remove the given connections from all traffic light definitions of this junction - void removeTLSConnections(std::vector& connections, GNEUndoList* undoList); - - /// @brief temporarily mirror coordinates in lefthand network to compute correct crossing geometries - void mirrorXLeftHand(); - - /// @brief Invalidated copy constructor. - GNEJunction(const GNEJunction&) = delete; - - /// @brief Invalidated assignment operator. - GNEJunction& operator=(const GNEJunction&) = delete; -}; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNELane.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNELane.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNELane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNELane.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,1514 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNELane.cpp -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A class for visualizing Lane geometry (adapted from GNELaneWrapper) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "GNELane.h" -#include "GNEEdge.h" -#include "GNEJunction.h" -#include "GNEInternalLane.h" -#include "GNEConnection.h" - -// =========================================================================== -// FOX callback mapping -// =========================================================================== - -// Object implementation -FXIMPLEMENT(GNELane, FXDelegator, 0, 0) - -// =========================================================================== -// method definitions -// =========================================================================== - -GNELane::GNELane(GNEEdge* edge, const int index) : - GNENetElement(edge->getNet(), edge->getNBEdge()->getLaneID(index), GLO_LANE, SUMO_TAG_LANE), - myParentEdge(edge), - myIndex(index), - mySpecialColor(nullptr), - mySpecialColorValue(-1), - myLane2laneConnections(this) { -} - -GNELane::GNELane() : - GNENetElement(nullptr, "dummyConstructorGNELane", GLO_LANE, SUMO_TAG_LANE), - myParentEdge(nullptr), - myIndex(-1), - mySpecialColor(nullptr), - mySpecialColorValue(-1), - myLane2laneConnections(this) { -} - - -GNELane::~GNELane() {} - -std::string -GNELane::generateChildID(SumoXMLTag /*childTag*/) { - // currently unused - return ""; -} - - -const PositionVector& -GNELane::getLaneShape() const { - return myParentEdge->getNBEdge()->getLaneShape(myIndex); -} - - -const std::vector& -GNELane::getShapeRotations() const { - return myLaneGeometry.getShapeRotations(); -} - - -const std::vector& -GNELane::getShapeLengths() const { - return myLaneGeometry.getShapeLengths(); -} - - -void -GNELane::updateGeometry() { - // Clear texture containers - myLaneRestrictedTexturePositions.clear(); - myLaneRestrictedTextureRotations.clear(); - //double length = myParentEdge->getLength(); // @todo see ticket #448 - // may be different from length - // Obtain lane shape of NBEdge - myLaneGeometry.updateGeometry(myParentEdge->getNBEdge()->getLaneShape(myIndex)); - // update connections - myLane2laneConnections.updateLane2laneConnection(); - // update shapes parents associated with this lane - for (auto i : getParentShapes()) { - i->updateGeometry(); - } - // update child shapes associated with this lane - for (auto i : getChildShapes()) { - i->updateGeometry(); - } - // update additionals children associated with this lane - for (auto i : getParentAdditionals()) { - i->updateGeometry(); - } - // update additionals parents associated with this lane - for (auto i : getChildAdditionals()) { - i->updateGeometry(); - } - // partial update demand elements parents associated with this lane - for (auto i : getParentDemandElements()) { - i->updatePartialGeometry(myParentEdge); - } - // partial update demand elements children associated with this lane - for (auto i : getChildDemandElements()) { - i->updatePartialGeometry(myParentEdge); - } - // In Move mode, connections aren't updated - if (myNet->getViewNet() && myNet->getViewNet()->getEditModes().networkEditMode != GNE_NMODE_MOVE) { - // Update incoming connections of this lane - auto incomingConnections = getGNEIncomingConnections(); - for (auto i : incomingConnections) { - i->updateGeometry(); - } - // Update outgoings connections of this lane - auto outGoingConnections = getGNEOutcomingConnections(); - for (auto i : outGoingConnections) { - i->updateGeometry(); - } - } - // If lane has enought length for show textures of restricted lanes - if ((getLaneShapeLength() > 4)) { - // if lane is restricted - if (isRestricted(SVC_PEDESTRIAN) || isRestricted(SVC_BICYCLE) || isRestricted(SVC_BUS)) { - // get values for position and rotation of icons - for (int i = 2; i < getLaneShapeLength() - 1; i += 15) { - myLaneRestrictedTexturePositions.push_back(myLaneGeometry.getShape().positionAtOffset(i)); - myLaneRestrictedTextureRotations.push_back(myLaneGeometry.getShape().rotationDegreeAtOffset(i)); - } - } - } - // mark dotted geometry deprecated - myDottedGeometry.markDottedGeometryDeprecated(); -} - - -Position -GNELane::getPositionInView() const { - // currently unused - return Position(0, 0); -} - - -void -GNELane::drawLinkNo(const GUIVisualizationSettings& s) const { - const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); - int noLinks = (int)cons.size(); - if (noLinks == 0) { - return; - } - // draw all links - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION + 0.5); - double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks; - double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; - for (int i = noLinks; --i >= 0;) { - double x2 = x1 - (double)(w / 2.); - const int linkIndex = myParentEdge->getNBEdge()->getToNode()->getConnectionIndex(myParentEdge->getNBEdge(), - cons[s.lefthand ? noLinks - 1 - i : i]); - GLHelper::drawTextAtEnd(toString(linkIndex), myLaneGeometry.getShape(), x2, s.drawLinkJunctionIndex, s.scale); - x1 -= w; - } - glPopMatrix(); -} - - -void -GNELane::drawTLSLinkNo(const GUIVisualizationSettings& s) const { - const std::vector& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); - int noLinks = (int)cons.size(); - if (noLinks == 0) { - return; - } - // draw all links - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION + 0.5); - double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks; - double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; - for (int i = noLinks; --i >= 0;) { - double x2 = x1 - (double)(w / 2.); - int linkNo = cons[s.lefthand ? noLinks - 1 - i : i].tlLinkIndex; - GLHelper::drawTextAtEnd(toString(linkNo), myLaneGeometry.getShape(), x2, s.drawLinkTLIndex, s.scale); - x1 -= w; - } - glPopMatrix(); -} - - -void -GNELane::drawLinkRules(const GUIVisualizationSettings& /*s*/) const { - // currently unused -} - - -void -GNELane::drawArrows(const GUIVisualizationSettings& s) const { - const Position& begin = myLaneGeometry.getShape()[-2]; - const Position& end = myLaneGeometry.getShape().back(); - const double rot = GNEGeometry::calculateRotation(begin, end); - glPushMatrix(); - glPushName(0); - glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape - glColor3d(1, 1, 1); - glTranslated(end.x(), end.y(), 0); - glRotated(rot, 0, 0, 1); - // draw all links - const std::vector& edgeCons = myParentEdge->getNBEdge()->myConnections; - NBNode* dest = myParentEdge->getNBEdge()->myTo; - for (auto i : edgeCons) { - if (i.fromLane == myIndex) { - LinkDirection dir = dest->getDirection(myParentEdge->getNBEdge(), i.toEdge, s.lefthand); - switch (dir) { - case LINKDIR_STRAIGHT: - GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05); - GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25); - break; - case LINKDIR_LEFT: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05); - GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (double) 1, (double) .25); - break; - case LINKDIR_RIGHT: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); - GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (double) 1, (double) .25); - break; - case LINKDIR_TURN: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05); - GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05); - GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (double) 1, (double) .25); - break; - case LINKDIR_TURN_LEFTHAND: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05); - GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05); - GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (double) 1, (double) .25); - break; - case LINKDIR_PARTLEFT: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05); - GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (double) 1, (double) .25); - break; - case LINKDIR_PARTRIGHT: - GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05); - GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05); - GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (double) 1, (double) .25); - break; - case LINKDIR_NODIR: - GLHelper::drawBoxLine(Position(1, 5.8), 245, 2, .05); - GLHelper::drawBoxLine(Position(-1, 5.8), 115, 2, .05); - glTranslated(0, 5, 0); - GLHelper::drawOutlineCircle(0.9, 0.8, 32); - glTranslated(0, -5, 0); - break; - } - } - } - glPopName(); - glPopMatrix(); -} - - -void -GNELane::drawLane2LaneConnections() const { - glPushMatrix(); - glPushName(0); - glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape - std::vector connections = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex); - NBNode* node = myParentEdge->getNBEdge()->getToNode(); - const Position& startPos = myLaneGeometry.getShape()[-1]; - for (auto it : connections) { - const LinkState state = node->getLinkState(myParentEdge->getNBEdge(), it.toEdge, it.fromLane, it.toLane, it.mayDefinitelyPass, it.tlID); - switch (state) { - case LINKSTATE_TL_OFF_NOSIGNAL: - glColor3d(1, 1, 0); - break; - case LINKSTATE_TL_OFF_BLINKING: - glColor3d(0, 1, 1); - break; - case LINKSTATE_MAJOR: - glColor3d(1, 1, 1); - break; - case LINKSTATE_MINOR: - glColor3d(.4, .4, .4); - break; - case LINKSTATE_STOP: - glColor3d(.7, .4, .4); - break; - case LINKSTATE_EQUAL: - glColor3d(.7, .7, .7); - break; - case LINKSTATE_ALLWAY_STOP: - glColor3d(.7, .7, 1); - break; - case LINKSTATE_ZIPPER: - glColor3d(.75, .5, 0.25); - break; - default: - throw ProcessError("Unexpected LinkState '" + toString(state) + "'"); - } - const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0]; - glBegin(GL_LINES); - glVertex2d(startPos.x(), startPos.y()); - glVertex2d(endPos.x(), endPos.y()); - glEnd(); - GLHelper::drawTriangleAtEnd(startPos, endPos, (double) 1.5, (double) .2); - } - glPopName(); - glPopMatrix(); -} - - -void -GNELane::drawGL(const GUIVisualizationSettings& s) const { - // Push draw matrix 1 - glPushMatrix(); - // Push name - glPushName(getGlID()); - // Traslate to fromt - glTranslated(0, 0, myParentEdge->getNBEdge()->getLength() < 1 ? GLO_JUNCTION + 1 : getType()); - const RGBColor color = setLaneColor(s); - // start drawing lane checking whether it is not too small - const double selectionScale = isAttributeCarrierSelected() || myParentEdge->isAttributeCarrierSelected() ? s.selectionScale : 1; - const double exaggeration = selectionScale * s.laneWidthExaggeration; // * s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); - // XXX apply usefull scale values - //exaggeration *= s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive())); - // recognize full transparency and simply don't draw - if ((color.alpha() == 0) || ((s.scale * exaggeration) < s.laneMinSize)) { - // Pop draw matrix 1 - glPopMatrix(); - // Pop Lane Name - glPopName(); - } else if ((s.scale * exaggeration) < 1.) { - // draw as lines, depending of myShapeColors - if (myShapeColors.size() > 0) { - GLHelper::drawLine(myLaneGeometry.getShape(), myShapeColors); - } else { - GLHelper::drawLine(myLaneGeometry.getShape()); - } - // Pop draw matrix 1 - glPopMatrix(); - // Pop Lane Name - glPopName(); - // draw parents - for (const auto& i : getParentAdditionals()) { - if (i->getTagProperty().getTag() == SUMO_TAG_VSS) { - // draw VSS Symbol - drawVSSSymbol(s, i); - } - } - // draw child shapes - for (const auto& POILane : getChildShapes()) { - POILane->drawGL(s); - } - // draw child additional - for (const auto& additional : getChildAdditionals()) { - //draw partial E2 detectors - if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - drawPartialE2DetectorPlan(s, additional, nullptr); - } else if (!additional->getTagProperty().isPlacedInRTree()) { - // check that ParkingAreas aren't draw two times - additional->drawGL(s); - } - } - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } else { - // we draw the lanes with reduced width so that the lane markings below are visible - // (this avoids artifacts at geometry corners without having to - // compute lane-marking intersection points) - const double halfWidth2 = exaggeration * (myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2 - SUMO_const_laneMarkWidth / 2); - // Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen - const double halfWidth = drawUsingSelectColor() ? halfWidth2 - exaggeration * 0.3 : halfWidth2; - const bool spreadSuperposed = s.spreadSuperposed && drawAsRailway(s) && myParentEdge->getNBEdge()->isBidiRail(); - // Check if lane has to be draw as railway and if isn't being drawn for selecting - if (drawAsRailway(s) && (!s.drawForRectangleSelection || spreadSuperposed)) { - PositionVector shape = myLaneGeometry.getShape(); - const double width = myParentEdge->getNBEdge()->getLaneWidth(myIndex); - // draw as railway: assume standard gauge of 1435mm when lane width is not set - // draw foot width 150mm, assume that distance between rail feet inner sides is reduced on both sides by 39mm with regard to the gauge - // assume crosstie length of 181% gauge (2600mm for standard gauge) - double halfGauge = 0.5 * (width == SUMO_const_laneWidth ? 1.4350 : width) * exaggeration; - if (spreadSuperposed) { - shape.move2side(halfGauge * 0.8); - halfGauge *= 0.4; - //std::cout << "spreadSuperposed " << getID() << " old=" << myLaneGeometry.getShape() << " new=" << shape << "\n"; - } - const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration; - const double halfRailWidth = halfInnerFeetWidth + 0.15 * exaggeration; - const double halfCrossTieWidth = halfGauge * 1.81; - // Draw lane geometry - GNEGeometry::drawLaneGeometry(myNet->getViewNet(), shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), myShapeColors, halfRailWidth); - // Save current color - RGBColor current = GLHelper::getColor(); - // Draw gray on top with reduced width (the area between the two tracks) - glColor3d(0.8, 0.8, 0.8); - glTranslated(0, 0, .1); - GNEGeometry::drawLaneGeometry(myNet->getViewNet(), shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), {}, halfInnerFeetWidth); - // Set current color back - GLHelper::setColor(current); - // Draw crossties - GLHelper::drawCrossTies(shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), 0.26 * exaggeration, 0.6 * exaggeration, halfCrossTieWidth, s.drawForRectangleSelection); - } else { - GNEGeometry::drawLaneGeometry(myNet->getViewNet(), myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), myShapeColors, halfWidth); - } - if (halfWidth != halfWidth2 && !spreadSuperposed) { - // draw again to show the selected edge - GLHelper::setColor(s.colorSettings.selectedEdgeColor); - glTranslated(0, 0, -.1); - GNEGeometry::drawLaneGeometry(myNet->getViewNet(), myLaneGeometry.getShape(), myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), {}, halfWidth2); - } - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == this) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape, halfWidth); - } - // Pop draw matrix 1 - glPopMatrix(); - // only draw details depending of the scale and if isn't being drawn for selecting - if ((s.scale >= 10) && !s.drawForRectangleSelection && !s.drawForPositionSelection) { - // if exaggeration is 1, draw drawMarkings - if (s.laneShowBorders && exaggeration == 1 && !drawAsRailway(s)) { - drawMarkings(s, exaggeration); - } - // draw ROWs only if target junction has a valid logic) - if (s.showLinkDecals && myParentEdge->getGNEJunctionDestiny()->isLogicValid() && s.scale > 3) { - drawArrows(s); - } - // Draw direction indicators if the correspondient option is enabled - if (s.showLaneDirection) { - if (drawAsRailway(s)) { - // improve visibility of superposed rail edges - setLaneColor(s); - } else { - glColor3d(0.3, 0.3, 0.3); - } - drawDirectionIndicators(exaggeration, spreadSuperposed); - } - if (s.drawLinkJunctionIndex.show) { - drawLinkNo(s); - } - if (s.drawLinkTLIndex.show) { - drawTLSLinkNo(s); - } - } - // If there are texture of restricted lanes to draw, check if icons can be drawn - if (!s.drawForRectangleSelection && !s.drawForPositionSelection && !s.disableLaneIcons && - (myLaneRestrictedTexturePositions.size() > 0) && s.drawDetail(s.detailSettings.laneTextures, exaggeration)) { - // Declare default width of icon (3) - double iconWidth = 1; - // Obtain width of icon, if width of lane is different - if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).width != -1) { - iconWidth = myParentEdge->getNBEdge()->getLaneStruct(myIndex).width / 3; - } - // Draw list of icons - for (int i = 0; i < (int)myLaneRestrictedTexturePositions.size(); i++) { - // Push draw matrix 2 - glPushMatrix(); - // Set white color - glColor3d(1, 1, 1); - // Traslate matrix 2 - glTranslated(myLaneRestrictedTexturePositions.at(i).x(), myLaneRestrictedTexturePositions.at(i).y(), getType() + 0.1); - // Rotate matrix 2 - glRotated(myLaneRestrictedTextureRotations.at(i), 0, 0, -1); - glRotated(90, 0, 0, 1); - // draw texture box depending of type of restriction - if (isRestricted(SVC_PEDESTRIAN)) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEPEDESTRIAN), iconWidth); - } else if (isRestricted(SVC_BICYCLE)) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEBIKE), iconWidth); - } else if (isRestricted(SVC_BUS)) { - GUITexturesHelper::drawTexturedBox(GUITextureSubSys::getTexture(GNETEXTURE_LANEBUS), iconWidth); - } - // Pop draw matrix 2 - glPopMatrix(); - } - } - // draw a Start/endPoints if lane has a custom shape - if (!s.drawForRectangleSelection && (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() > 1)) { - drawStartEndShapePoints(s); - } - // Pop Lane Name - glPopName(); - // draw parents - for (const auto& VSS : getParentAdditionals()) { - if (VSS->getTagProperty().getTag() == SUMO_TAG_VSS) { - // draw VSS Symbol - drawVSSSymbol(s, VSS); - } - } - // draw child shapes - for (const auto& POILane : getChildShapes()) { - POILane->drawGL(s); - } - // draw child additional - for (const auto& additional : getChildAdditionals()) { - //draw partial E2 detectors - if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) { - drawPartialE2DetectorPlan(s, additional, nullptr); - } else if (!additional->getTagProperty().isPlacedInRTree()) { - // check that ParkingAreas aren't draw two times - additional->drawGL(s); - } - } - // draw child demand elements - for (const auto& i : getChildDemandElements()) { - if (!i->getTagProperty().isPlacedInRTree()) { - i->drawGL(s); - } - } - } -} - - -void -GNELane::drawMarkings(const GUIVisualizationSettings& s, double scale) const { - glPushMatrix(); - glTranslated(0, 0, GLO_EDGE); - const double myHalfLaneWidth = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2; - // optionally draw inverse markings - if (myIndex > 0 && (myParentEdge->getNBEdge()->getPermissions(myIndex - 1) & myParentEdge->getNBEdge()->getPermissions(myIndex)) != 0) { - double mw = (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale; - double mw2 = (myHalfLaneWidth - SUMO_const_laneMarkWidth) * scale; - if (s.lefthand) { - mw *= -1; - mw2 *= -1; - } - int e = (int) myLaneGeometry.getShape().size() - 1; - for (int i = 0; i < e; ++i) { - glPushMatrix(); - glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 2.1); - glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1); - for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += 6) { - const double length = MIN2((double)3, myLaneGeometry.getShapeLengths()[i] - t); - glBegin(GL_QUADS); - glVertex2d(-mw, -t); - glVertex2d(-mw, -t - length); - glVertex2d(-mw2, -t - length); - glVertex2d(-mw2, -t); - glEnd(); - } - glPopMatrix(); - } - } - // draw white boundings and white markings - glColor3d(1, 1, 1); - GNEGeometry::drawGeometry(myNet->getViewNet(), myLaneGeometry, (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale); - glPopMatrix(); -} - - -GUIGLObjectPopupMenu* -GNELane::getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) { - // first obtain edit mode (needed because certain Commands depend of current edit mode) - const NetworkEditMode editMode = myNet->getViewNet()->getEditModes().networkEditMode; - GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this); - buildPopupHeader(ret, app); - buildCenterPopupEntry(ret); - // build copy names entry - if (editMode != GNE_NMODE_TLS) { - new FXMenuCommand(ret, "Copy parent edge name to clipboard", nullptr, ret, MID_COPY_EDGE_NAME); - buildNameCopyPopupEntry(ret); - } - // build selection - myNet->getViewNet()->buildSelectionACPopupEntry(ret, this); - if (editMode != GNE_NMODE_TLS) { - // build show parameters menu - buildShowParamsPopupEntry(ret); - // build position copy entry - buildPositionCopyEntry(ret, false); - } - // check if we're in supermode network - if (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK) { - if (editMode != GNE_NMODE_CONNECT && editMode != GNE_NMODE_TLS && editMode != GNE_NMODE_CREATE_EDGE) { - // Get icons - FXIcon* pedestrianIcon = GUIIconSubSys::getIcon(ICON_LANEPEDESTRIAN); - FXIcon* bikeIcon = GUIIconSubSys::getIcon(ICON_LANEBIKE); - FXIcon* busIcon = GUIIconSubSys::getIcon(ICON_LANEBUS); - FXIcon* greenVergeIcon = GUIIconSubSys::getIcon(ICON_LANEGREENVERGE); - // Create basic commands - std::string edgeDescPossibleMulti = toString(SUMO_TAG_EDGE); - const int edgeSelSize = (int)myNet->retrieveEdges(true).size(); - if (edgeSelSize && myParentEdge->isAttributeCarrierSelected() && (edgeSelSize > 1)) { - edgeDescPossibleMulti = toString(edgeSelSize) + " " + toString(SUMO_TAG_EDGE) + "s"; - } - // if lane is selected, calculate number of restricted lanes - bool edgeHasSidewalk = false; - bool edgeHasBikelane = false; - bool edgeHasBuslane = false; - bool edgeHasGreenVerge = false; - bool differentLaneShapes = false; - if (isAttributeCarrierSelected()) { - auto selectedLanes = myNet->retrieveLanes(true); - for (auto i : selectedLanes) { - if (i->getParentEdge()->hasRestrictedLane(SVC_PEDESTRIAN)) { - edgeHasSidewalk = true; - } - if (i->getParentEdge()->hasRestrictedLane(SVC_BICYCLE)) { - edgeHasBikelane = true; - } - if (i->getParentEdge()->hasRestrictedLane(SVC_BUS)) { - edgeHasBuslane = true; - } - if (i->getParentEdge()->hasRestrictedLane(SVC_IGNORING)) { - edgeHasGreenVerge = true; - } - if (i->getParentEdge()->getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) { - differentLaneShapes = true; - } - } - } else { - edgeHasSidewalk = myParentEdge->hasRestrictedLane(SVC_PEDESTRIAN); - edgeHasBikelane = myParentEdge->hasRestrictedLane(SVC_BICYCLE); - edgeHasBuslane = myParentEdge->hasRestrictedLane(SVC_BUS); - edgeHasGreenVerge = myParentEdge->hasRestrictedLane(SVC_IGNORING); - differentLaneShapes = myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() != 0; - } - // create menu pane for edge operations - FXMenuPane* edgeOperations = new FXMenuPane(ret); - ret->insertMenuPaneChild(edgeOperations); - new FXMenuCascade(ret, "edge operations", nullptr, edgeOperations); - // create menu commands for all edge oeprations - new FXMenuCommand(edgeOperations, "Split edge here", nullptr, &parent, MID_GNE_EDGE_SPLIT); - new FXMenuCommand(edgeOperations, "Split edge in both directions here", nullptr, &parent, MID_GNE_EDGE_SPLIT_BIDI); - new FXMenuCommand(edgeOperations, "Set geometry endpoint here (shift-click)", nullptr, &parent, MID_GNE_EDGE_EDIT_ENDPOINT); - new FXMenuCommand(edgeOperations, "Restore geometry endpoint (shift-click)", nullptr, &parent, MID_GNE_EDGE_RESET_ENDPOINT); - new FXMenuCommand(edgeOperations, ("Reverse " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_REVERSE); - new FXMenuCommand(edgeOperations, ("Add reverse direction for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_ADD_REVERSE); - new FXMenuCommand(edgeOperations, ("Reset lengths for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_RESET_LENGTH); - new FXMenuCommand(edgeOperations, ("Straighten " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN); - new FXMenuCommand(edgeOperations, ("Smooth " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH); - new FXMenuCommand(edgeOperations, ("Straighten elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN_ELEVATION); - new FXMenuCommand(edgeOperations, ("Smooth elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH_ELEVATION); - // create menu pane for lane operations - FXMenuPane* laneOperations = new FXMenuPane(ret); - ret->insertMenuPaneChild(laneOperations); - new FXMenuCascade(ret, "lane operations", nullptr, laneOperations); - new FXMenuCommand(laneOperations, "Duplicate lane", nullptr, &parent, MID_GNE_LANE_DUPLICATE); - if (differentLaneShapes) { - new FXMenuCommand(laneOperations, "reset custom shape", nullptr, &parent, MID_GNE_LANE_RESET_CUSTOMSHAPE); - } - // Create panel for lane operations and insert it in ret - FXMenuPane* addSpecialLanes = new FXMenuPane(laneOperations); - ret->insertMenuPaneChild(addSpecialLanes); - FXMenuPane* removeSpecialLanes = new FXMenuPane(laneOperations); - ret->insertMenuPaneChild(removeSpecialLanes); - FXMenuPane* transformSlanes = new FXMenuPane(laneOperations); - ret->insertMenuPaneChild(transformSlanes); - // Create menu comands for all add special lanes - FXMenuCommand* addSidewalk = new FXMenuCommand(addSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_ADD_SIDEWALK); - FXMenuCommand* addBikelane = new FXMenuCommand(addSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_ADD_BIKE); - FXMenuCommand* addBuslane = new FXMenuCommand(addSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_ADD_BUS); - FXMenuCommand* addGreenVerge = new FXMenuCommand(addSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_ADD_GREENVERGE); - // Create menu comands for all remove special lanes and disable it - FXMenuCommand* removeSidewalk = new FXMenuCommand(removeSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_REMOVE_SIDEWALK); - removeSidewalk->disable(); - FXMenuCommand* removeBikelane = new FXMenuCommand(removeSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_REMOVE_BIKE); - removeBikelane->disable(); - FXMenuCommand* removeBuslane = new FXMenuCommand(removeSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_REMOVE_BUS); - removeBuslane->disable(); - FXMenuCommand* removeGreenVerge = new FXMenuCommand(removeSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_REMOVE_GREENVERGE); - removeGreenVerge->disable(); - // Create menu comands for all trasform special lanes and disable it - FXMenuCommand* transformLaneToSidewalk = new FXMenuCommand(transformSlanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_TRANSFORM_SIDEWALK); - FXMenuCommand* transformLaneToBikelane = new FXMenuCommand(transformSlanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_TRANSFORM_BIKE); - FXMenuCommand* transformLaneToBuslane = new FXMenuCommand(transformSlanes, "Buslane", busIcon, &parent, MID_GNE_LANE_TRANSFORM_BUS); - FXMenuCommand* transformLaneToGreenVerge = new FXMenuCommand(transformSlanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_TRANSFORM_GREENVERGE); - // add menuCascade for lane operations - FXMenuCascade* cascadeAddSpecialLane = new FXMenuCascade(laneOperations, ("add restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, addSpecialLanes); - FXMenuCascade* cascadeRemoveSpecialLane = new FXMenuCascade(laneOperations, ("remove restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, removeSpecialLanes); - new FXMenuCascade(laneOperations, ("transform to restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, transformSlanes); - // Enable and disable options depending of current transform of the lane - if (edgeHasSidewalk) { - transformLaneToSidewalk->disable(); - addSidewalk->disable(); - removeSidewalk->enable(); - } - if (edgeHasBikelane) { - transformLaneToBikelane->disable(); - addBikelane->disable(); - removeBikelane->enable(); - } - if (edgeHasBuslane) { - transformLaneToBuslane->disable(); - addBuslane->disable(); - removeBuslane->enable(); - } - if (edgeHasGreenVerge) { - transformLaneToGreenVerge->disable(); - addGreenVerge->disable(); - removeGreenVerge->enable(); - } - // Check if cascade menus must be disabled - if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) { - cascadeAddSpecialLane->disable(); - } - if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) { - cascadeRemoveSpecialLane->disable(); - } - } else if (editMode == GNE_NMODE_TLS) { - if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->controlsEdge(myParentEdge)) { - new FXMenuCommand(ret, "Select state for all links from this edge:", nullptr, nullptr, 0); - const std::vector names = GNEInternalLane::LinkStateNames.getStrings(); - for (auto it : names) { - FXuint state = GNEInternalLane::LinkStateNames.get(it); - FXMenuRadio* mc = new FXMenuRadio(ret, it.c_str(), this, FXDataTarget::ID_OPTION + state); - mc->setSelBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state))); - mc->setBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state))); - } - } - } else { - FXMenuCommand* mc = new FXMenuCommand(ret, "Additional options available in 'Inspect Mode'", nullptr, nullptr, 0); - mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), nullptr); - } - // buildShowParamsPopupEntry(ret, false); - // build shape positions menu - if (editMode != GNE_NMODE_TLS) { - new FXMenuSeparator(ret); - const double pos = myLaneGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation()); - const double height = myLaneGeometry.getShape().positionAtOffset2D(myLaneGeometry.getShape().nearest_offset_to_point2D(parent.getPositionInformation())).z(); - new FXMenuCommand(ret, ("Shape pos: " + toString(pos)).c_str(), nullptr, nullptr, 0); - new FXMenuCommand(ret, ("Length pos: " + toString(pos * getLaneParametricLength() / getLaneShapeLength())).c_str(), nullptr, nullptr, 0); - new FXMenuCommand(ret, ("Height: " + toString(height)).c_str(), nullptr, nullptr, 0); - } - // new FXMenuSeparator(ret); - // buildPositionCopyEntry(ret, false); - } - return ret; -} - - -Boundary -GNELane::getCenteringBoundary() const { - if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() == 0) { - return myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape.getBoxBoundary(); - } else { - return myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.getBoxBoundary(); - } -} - - -int -GNELane::getIndex() const { - return myIndex; -} - -void -GNELane::setIndex(int index) { - myIndex = index; - setMicrosimID(myParentEdge->getNBEdge()->getLaneID(index)); -} - - -double -GNELane::getSpeed() const { - return myParentEdge->getNBEdge()->getLaneSpeed(myIndex); -} - - -double -GNELane::getLaneParametricLength() const { - double laneParametricLength = myParentEdge->getNBEdge()->getLoadedLength(); - if (laneParametricLength > 0) { - return laneParametricLength; - } else { - throw ProcessError("Lane Parametric Length cannot be never 0"); - } -} - - -double -GNELane::getLaneShapeLength() const { - return myLaneGeometry.getShape().length(); -} - - -bool -GNELane::isRestricted(SUMOVehicleClass vclass) const { - return myParentEdge->getNBEdge()->getPermissions(myIndex) == vclass; -} - - -const GNEGeometry::Lane2laneConnection& -GNELane::getLane2laneConnections() const { - return myLane2laneConnections; -} - - -std::string -GNELane::getAttribute(SumoXMLAttr key) const { - const NBEdge* edge = myParentEdge->getNBEdge(); - switch (key) { - case SUMO_ATTR_ID: - return getMicrosimID(); - case SUMO_ATTR_SPEED: - return toString(edge->getLaneSpeed(myIndex)); - case SUMO_ATTR_ALLOW: - return getVehicleClassNames(edge->getPermissions(myIndex)); - case SUMO_ATTR_DISALLOW: - return getVehicleClassNames(invertPermissions(edge->getPermissions(myIndex))); - case SUMO_ATTR_WIDTH: - return toString(edge->getLaneStruct(myIndex).width); - case SUMO_ATTR_ENDOFFSET: - return toString(edge->getLaneStruct(myIndex).endOffset); - case SUMO_ATTR_ACCELERATION: - return toString(edge->getLaneStruct(myIndex).accelRamp); - case SUMO_ATTR_CUSTOMSHAPE: - return toString(edge->getLaneStruct(myIndex).customShape); - case SUMO_ATTR_INDEX: - return toString(myIndex); - case GNE_ATTR_SELECTED: - return toString(isAttributeCarrierSelected()); - case GNE_ATTR_PARAMETERS: - return myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParametersStr(); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - -std::string -GNELane::getAttributeForSelection(SumoXMLAttr key) const { - std::string result = getAttribute(key); - if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) { - result += " " + getVehicleClassNames(SVCAll, true); - } - return result; -} - - -void -GNELane::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 SUMO_ATTR_ENDOFFSET: - case SUMO_ATTR_ACCELERATION: - case SUMO_ATTR_CUSTOMSHAPE: - case SUMO_ATTR_INDEX: - case GNE_ATTR_SELECTED: - case GNE_ATTR_PARAMETERS: - // no special handling - undoList->p_add(new GNEChange_Attribute(this, myNet, key, value)); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNELane::isValid(SumoXMLAttr key, const std::string& value) { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_INDEX: - return false; - case SUMO_ATTR_SPEED: - return canParse(value); - case SUMO_ATTR_ALLOW: - case SUMO_ATTR_DISALLOW: - return canParseVehicleClasses(value); - case SUMO_ATTR_WIDTH: - return canParse(value) && ((parse(value) > 0) || (parse(value) == NBEdge::UNSPECIFIED_WIDTH)); - case SUMO_ATTR_ENDOFFSET: - return canParse(value) && (parse(value) >= 0); - case SUMO_ATTR_ACCELERATION: - return canParse(value); - case SUMO_ATTR_CUSTOMSHAPE: { - // A lane shape can either be empty or have more than 1 element - if (value.empty()) { - return true; - } else if (canParse(value)) { - return parse(value).size() > 1; - } - return false; - } - case GNE_ATTR_SELECTED: - return canParse(value); - case GNE_ATTR_PARAMETERS: - return Parameterised::areParametersValid(value); - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -bool -GNELane::isAttributeEnabled(SumoXMLAttr key) const { - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_INDEX: - return false; - default: - return true; - } -} - - -void -GNELane::setSpecialColor(const RGBColor* color, double colorValue) { - mySpecialColor = color; - mySpecialColorValue = colorValue; -} - - -void -GNELane::drawPartialE2DetectorPlan(const GUIVisualizationSettings& s, const GNEAdditional* E2Detector, const GNEJunction* junction) const { - // calculate E2Detector width - //double E2DetectorWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.E2Detector; - double E2DetectorWidth = s.addSize.getExaggeration(s, E2Detector); - // obtain color - RGBColor E2DetectorColor; - if (E2Detector->drawUsingSelectColor()) { - E2DetectorColor = s.colorSettings.selectedRouteColor; - } else { - E2DetectorColor = s.detectorSettings.E2Color; - } - // Start drawing adding an gl identificator - glPushName(E2Detector->getGlID()); - // Add a draw matrix - glPushMatrix(); - // Start with the drawing of the area traslating matrix to origin - glTranslated(0, 0, E2Detector->getType()); - // draw E2Detector - if (junction) { - // iterate over segments - for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) { - // draw partial segment - if ((segment.junction == junction) && (segment.AC == E2Detector)) { - // Set E2Detector color (needed due drawShapeDottedContour) - GLHelper::setColor(E2DetectorColor); - // draw box lines - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == E2Detector) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth); - } - } - } - } else { - // iterate over segments - for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) { - // draw partial segment - if ((segment.lane == this) && (segment.AC == E2Detector)) { - // Set E2Detector color (needed due drawShapeDottedContour) - GLHelper::setColor(E2DetectorColor); - // draw box lines - GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth); - // check if shape dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == E2Detector) { - GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth); - } - } - } - } - // Pop last matrix - glPopMatrix(); - // Draw name if isn't being drawn for selecting - if (!s.drawForRectangleSelection) { - drawName(getCenteringBoundary().getCenter(), s.scale, s.addName); - } - // Pop name - glPopName(); -} - -// =========================================================================== -// private -// =========================================================================== - -void -GNELane::setAttribute(SumoXMLAttr key, const std::string& value) { - NBEdge* edge = myParentEdge->getNBEdge(); - switch (key) { - case SUMO_ATTR_ID: - case SUMO_ATTR_INDEX: - throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed"); - case SUMO_ATTR_SPEED: - edge->setSpeed(myIndex, parse(value)); - break; - case SUMO_ATTR_ALLOW: - edge->setPermissions(parseVehicleClasses(value), myIndex); - break; - case SUMO_ATTR_DISALLOW: - edge->setPermissions(invertPermissions(parseVehicleClasses(value)), myIndex); - break; - case SUMO_ATTR_WIDTH: - edge->setLaneWidth(myIndex, parse(value)); - break; - case SUMO_ATTR_ENDOFFSET: - edge->setEndOffset(myIndex, parse(value)); - break; - case SUMO_ATTR_ACCELERATION: - edge->setAcceleration(myIndex, parse(value)); - break; - case SUMO_ATTR_CUSTOMSHAPE: { - // first remove parent edge from net - myNet->removeGLObjectFromGrid(myParentEdge); - // set new shape - edge->setLaneShape(myIndex, parse(value)); - // add parent edge into net again - myNet->addGLObjectIntoGrid(myParentEdge); - break; - } - case GNE_ATTR_SELECTED: - if (parse(value)) { - selectAttributeCarrier(); - } else { - unselectAttributeCarrier(); - } - break; - case GNE_ATTR_PARAMETERS: - myParentEdge->getNBEdge()->getLaneStruct(myIndex).setParametersStr(value); - break; - default: - throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'"); - } -} - - -void -GNELane::updateDottedContour() { - // -} - - -RGBColor -GNELane::setLaneColor(const GUIVisualizationSettings& s) const { - // we need to draw lanes with a special color if we're inspecting a Trip or Flow and this lane belongs to a via's edge. - if (myNet->getViewNet()->getDottedAC() && (myNet->getViewNet()->getDottedAC()->isAttributeCarrierSelected() == false) && - ((myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_TRIP) || - (myNet->getViewNet()->getDottedAC()->getTagProperty().getTag() == SUMO_TAG_FLOW))) { - // obtain attribute "via" - std::vector viaEdges = parse >(myNet->getViewNet()->getDottedAC()->getAttribute(SUMO_ATTR_VIA)); - // iterate over viaEdges - for (const auto& i : viaEdges) { - // check if parent edge is in the via edges - if (myParentEdge->getID() == i) { - // set green color in GLHelper and return it - GLHelper::setColor(RGBColor::GREEN); - return RGBColor::GREEN; - } - } - } - // declare a RGBColor variable - RGBColor color; - if (mySpecialColor != nullptr) { - // If special color is enabled, set it - color = *mySpecialColor; - } else if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { - // override with special colors (unless the color scheme is based on selection) - color = s.colorSettings.selectedLaneColor; - } else if (myParentEdge->drawUsingSelectColor() && s.laneColorer.getActive() != 1) { - // override with special colors (unless the color scheme is based on selection) - color = s.colorSettings.selectedEdgeColor; - } else { - // Get normal lane color - const GUIColorer& c = s.laneColorer; - if (!setFunctionalColor(c.getActive(), color) && !setMultiColor(s, c, color)) { - color = c.getScheme().getColor(getColorValue(s, c.getActive())); - } - } - // set color in GLHelper - GLHelper::setColor(color); - return color; -} - -bool -GNELane::setFunctionalColor(int activeScheme, RGBColor& col) const { - switch (activeScheme) { - case 6: { - double hue = GeomHelper::naviDegree(myLaneGeometry.getShape().beginEndAngle()); // [0-360] - col = RGBColor::fromHSV(hue, 1., 1.); - return true; - } - default: - return false; - } -} - - -bool -GNELane::setMultiColor(const GUIVisualizationSettings& s, const GUIColorer& c, RGBColor& col) const { - const int activeScheme = c.getActive(); - myShapeColors.clear(); - switch (activeScheme) { - case 9: // color by height at segment start - for (PositionVector::const_iterator ii = myLaneGeometry.getShape().begin(); ii != myLaneGeometry.getShape().end() - 1; ++ii) { - myShapeColors.push_back(c.getScheme().getColor(ii->z())); - } - col = c.getScheme().getColor(getColorValue(s, 8)); - return true; - case 11: // color by inclination at segment start - for (int ii = 1; ii < (int)myLaneGeometry.getShape().size(); ++ii) { - const double inc = (myLaneGeometry.getShape()[ii].z() - myLaneGeometry.getShape()[ii - 1].z()) / MAX2(POSITION_EPS, myLaneGeometry.getShape()[ii].distanceTo2D(myLaneGeometry.getShape()[ii - 1])); - myShapeColors.push_back(c.getScheme().getColor(inc)); - } - col = c.getScheme().getColor(getColorValue(s, 10)); - return true; - default: - return false; - } -} - - -double -GNELane::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const { - const SVCPermissions myPermissions = myParentEdge->getNBEdge()->getPermissions(myIndex); - if (mySpecialColor != nullptr && mySpecialColorValue != std::numeric_limits::max()) { - return mySpecialColorValue; - } - switch (activeScheme) { - case 0: - switch (myPermissions) { - case SVC_PEDESTRIAN: - return 1; - case SVC_BICYCLE: - return 2; - case 0: - return 3; - case SVC_SHIP: - return 4; - default: - break; - } - if (isRailway(myPermissions)) { - return 5; - } else if ((myPermissions & SVC_PASSENGER) != 0) { - return 0; - } else { - return 6; - } - case 1: - return isAttributeCarrierSelected() || myParentEdge->isAttributeCarrierSelected(); - case 2: - return (double)myPermissions; - case 3: - return myParentEdge->getNBEdge()->getLaneSpeed(myIndex); - case 4: - return myParentEdge->getNBEdge()->getNumLanes(); - case 5: { - return myParentEdge->getNBEdge()->getLoadedLength() / myParentEdge->getNBEdge()->getLaneStruct(myIndex).shape.length(); - } - // case 6: by angle (functional) - case 7: { - return myParentEdge->getNBEdge()->getPriority(); - } - case 8: { - // color by z of first shape point - return myLaneGeometry.getShape()[0].z(); - } - // case 9: by segment height - case 10: { - // color by incline - return (myLaneGeometry.getShape()[-1].z() - myLaneGeometry.getShape()[0].z()) / myParentEdge->getNBEdge()->getLength(); - } - // case 11: by segment incline - - case 12: { - // by numerical edge param value - try { - return StringUtils::toDouble(myParentEdge->getNBEdge()->getParameter(s.edgeParam, "0")); - } catch (NumberFormatException&) { - try { - return StringUtils::toBool(myParentEdge->getNBEdge()->getParameter(s.edgeParam, "0")); - } catch (BoolFormatException&) { - return -1; - } - } - } - case 13: { - // by numerical lane param value - try { - return StringUtils::toDouble(myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParameter(s.laneParam, "0")); - } catch (NumberFormatException&) { - try { - return StringUtils::toBool(myParentEdge->getNBEdge()->getLaneStruct(myIndex).getParameter(s.laneParam, "0")); - } catch (BoolFormatException&) { - return -1; - } - } - } - case 14: { - return myParentEdge->getNBEdge()->getDistance(); - } - case 15: { - return fabs(myParentEdge->getNBEdge()->getDistance()); - } - } - return 0; -} - - -bool -GNELane::drawAsRailway(const GUIVisualizationSettings& s) const { - return isRailway(myParentEdge->getNBEdge()->getPermissions(myIndex)) && s.showRails && (!s.drawForRectangleSelection || s.spreadSuperposed); -} - - -bool -GNELane::drawAsWaterway(const GUIVisualizationSettings& s) const { - return isWaterway(myParentEdge->getNBEdge()->getPermissions(myIndex)) && s.showRails && !s.drawForRectangleSelection; // reusing the showRails setting -} - - -void -GNELane::drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const { - const double width = MAX2(NUMERICAL_EPS, (myParentEdge->getNBEdge()->getLaneWidth(myIndex) * exaggeration - * (spreadSuperposed ? 0.4 : 1))); - const double sideOffset = spreadSuperposed ? width * -0.5 : 0; - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION + 0.1); - int e = (int) myLaneGeometry.getShape().size() - 1; - for (int i = 0; i < e; ++i) { - glPushMatrix(); - glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 0.1); - glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1); - for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += width) { - const double length = MIN2(width * 0.5, myLaneGeometry.getShapeLengths()[i] - t); - glBegin(GL_TRIANGLES); - glVertex2d(sideOffset, -t - length); - glVertex2d(sideOffset - width * 0.25, -t); - glVertex2d(sideOffset + width * 0.25, -t); - glEnd(); - } - glPopMatrix(); - } - glPopMatrix(); -} - - -void -GNELane::drawVSSSymbol(const GUIVisualizationSettings& s, GNEAdditional* vss) const { - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, vss); - // first check if additional has to be drawn - if (s.drawAdditionals(exaggeration)) { - // obtain lanePos and route - const Position& lanePos = vss->getChildPosition(this); - const double laneRot = vss->getChildRotation(this); - // Start drawing adding an VSS gl identificator (used to identify element after clicking) - glPushName(vss->getGlID()); - // start drawing symbol - glPushMatrix(); - glTranslated(lanePos.x(), lanePos.y(), vss->getType()); - glRotated(-1 * laneRot, 0, 0, 1); - glTranslated(0, -1.5, 0); - glScaled(exaggeration, exaggeration, 1); - // draw circle - int noPoints = 9; - if (s.scale > 25) { - noPoints = (int)(9.0 + s.scale / 10.0); - if (noPoints > 36) { - noPoints = 36; - } - } - glColor3d(1, 0, 0); - GLHelper::drawFilledCircle((double) 1.3, noPoints); - if (!s.drawForRectangleSelection && (s.scale >= 5)) { - glTranslated(0, 0, .1); - glColor3d(0, 0, 0); - GLHelper::drawFilledCircle((double) 1.1, noPoints); - // draw the speed string - glColor3d(1, 1, 0); - glTranslated(0, 0, .1); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - // draw last value string - GLHelper::drawText("S", Position(0, 0), .1, 1.2, RGBColor(255, 255, 0), 180); - } - // Pop symbol matrix - glPopMatrix(); - // Pop VSS name - glPopName(); - // check if dotted contour has to be drawn - if (myNet->getViewNet()->getDottedAC() == vss) { - GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.6, 2.6, -1 * laneRot, 0, -1.5); - } - // Draw connections - vss->drawChildConnections(s, getType()); - } -} - - -void -GNELane::drawStartEndShapePoints(const GUIVisualizationSettings& s) const { - GLHelper::setColor(s.junctionColorer.getSchemes()[0].getColor(2)); - if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) { - // override with special colors (unless the color scheme is based on selection) - GLHelper::setColor(s.colorSettings.selectedEdgeColor.changedBrightness(-20)); - } - // obtain circle width and resolution - double circleWidth = GNEEdge::SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration) / 2; - // Obtain exaggeration of the draw - const double exaggeration = s.addSize.getExaggeration(s, this); - // obtain custom shape - const PositionVector& customShape = myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape; - // draw s depending of detail - if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { - glPushMatrix(); - glTranslated(customShape.front().x(), customShape.front().y(), GLO_JUNCTION + 0.01); - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - if (!s.drawForPositionSelection) { - glTranslated(0, 0, 0.01); - GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE); - } - glPopMatrix(); - } - // draw line between Junction and point - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION - 0.01); - glLineWidth(4); - GLHelper::drawLine(customShape.front(), myParentEdge->getGNEJunctionSource()->getPositionInView()); - glPopMatrix(); - // draw "e" depending of detail - if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) { - glPushMatrix(); - glTranslated(customShape.back().x(), customShape.back().y(), GLO_JUNCTION + 0.01); - GLHelper::drawFilledCircle(circleWidth, s.getCircleResolution()); - if (!s.drawForPositionSelection) { - glTranslated(0, 0, 0.01); - GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE); - } - glPopMatrix(); - } - // draw line between Junction and point - glPushMatrix(); - glTranslated(0, 0, GLO_JUNCTION - 0.01); - glLineWidth(4); - GLHelper::drawLine(customShape.back(), myParentEdge->getGNEJunctionDestiny()->getPositionInView()); - glPopMatrix(); -} - - -std::string -GNELane::getParentName() const { - return myParentEdge->getMicrosimID(); -} - - -long -GNELane::onDefault(FXObject* obj, FXSelector sel, void* data) { - myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->handleMultiChange(this, obj, sel, data); - return 1; -} - - -GNEEdge* -GNELane::getParentEdge() const { - return myParentEdge; -} - - -std::vector -GNELane::getGNEIncomingConnections() { - // Declare a vector to save incoming connections - std::vector incomingConnections; - // Obtain incoming edges if junction source was already created - GNEJunction* junctionSource = myParentEdge->getGNEJunctionSource(); - if (junctionSource) { - // Iterate over incoming GNEEdges of junction - for (auto i : junctionSource->getGNEIncomingEdges()) { - // Iterate over connection of incoming edges - for (auto j : i->getGNEConnections()) { - if (j->getNBEdgeConnection().fromLane == getIndex()) { - incomingConnections.push_back(j); - } - } - } - } - return incomingConnections; -} - - -std::vector -GNELane::getGNEOutcomingConnections() { - // Obtain GNEConnection of parent edge - const std::vector& edgeConnections = myParentEdge->getGNEConnections(); - std::vector outcomingConnections; - // Obtain outgoing connections - for (auto i : edgeConnections) { - if (i->getNBEdgeConnection().fromLane == getIndex()) { - outcomingConnections.push_back(i); - } - } - return outcomingConnections; -} - - -void -GNELane::updateConnectionIDs() { - // update incoming connections of lane - std::vector incomingConnections = getGNEIncomingConnections(); - for (auto i : incomingConnections) { - i->updateID(); - } - // update outocming connections of lane - std::vector outcomingConnections = getGNEOutcomingConnections(); - for (auto i : outcomingConnections) { - i->updateID(); - } -} - - -double -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())); - } else { - return POSITION_EPS; - }; -} - - -void -GNELane::startGeometryMoving() { - // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge - // Save current centering boundary of child shapes - for (auto i : getChildShapes()) { - i->startGeometryMoving(); - } - // Save current centering boundary of shapes with this lane as chid - for (auto i : getParentShapes()) { - i->startGeometryMoving(); - } - // Save current centering boundary of child additional - for (auto i : getChildAdditionals()) { - i->startGeometryMoving(); - } - // Save current centering boundary of additionals with this lane as chid - for (auto i : getParentAdditionals()) { - i->startGeometryMoving(); - } - // Save current centering boundary of child demand elements - for (auto i : getChildDemandElements()) { - i->startGeometryMoving(); - } - // Save current centering boundary of demand element with this lane as chid - for (auto i : getParentDemandElements()) { - i->startGeometryMoving(); - } -} - - -void -GNELane::endGeometryMoving() { - // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge - // Restore centering boundary of shapes with this lane as chid - for (auto i : getChildShapes()) { - i->endGeometryMoving(); - } - // Restore centering boundary of shapes with this lane as chid - for (auto i : getParentShapes()) { - i->endGeometryMoving(); - } - // Restore centering boundary of additionals with this lane as chid - for (auto i : getChildAdditionals()) { - i->endGeometryMoving(); - } - // Restore centering boundary of additionals with this lane as chid - for (auto i : getParentAdditionals()) { - i->endGeometryMoving(); - } - // Restore centering boundary of demand elements with this lane as chid - for (auto i : getChildDemandElements()) { - i->endGeometryMoving(); - } - // Restore centering boundary of demand elements with this lane as chid - for (auto i : getParentDemandElements()) { - i->endGeometryMoving(); - } -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNELane.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNELane.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNELane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNELane.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,301 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNELane.h -/// @author Jakob Erdmann -/// @date Feb 2011 -/// -// A class for visualizing Lane geometry (adapted from GUILaneWrapper) -/****************************************************************************/ -#ifndef GNELane_h -#define GNELane_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include "GNENetElement.h" - -// =========================================================================== -// class declarations -// =========================================================================== -class GUIGLObjectPopupMenu; -class PositionVector; -class GNETLSEditorFrame; -class GNEEdge; -class GNENet; -class GNEConnection; - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class GNELane - * @brief This lane is powered by an underlying GNEEdge and basically knows how - * to draw itself - */ -class GNELane : public GNENetElement, public FXDelegator { - /// @brief FOX-declaration - FXDECLARE(GNELane) - -public: - /**@brief Constructor - * @param[in] idStorage The storage of gl-ids to get the one for this lane representation from - * @param[in] the edge this lane belongs to - * @param[in] the index of this lane - */ - GNELane(GNEEdge* edge, const int index); - - /// @brief Destructor - ~GNELane(); - - /// @brief gererate a new ID for an element child - std::string generateChildID(SumoXMLTag childTag); - - /// @name Functions related with geometry of element - /// @{ - /// @brief get elements shape - const PositionVector& getLaneShape() const; - - /// @brief get rotations of the single shape parts - const std::vector& getShapeRotations() const; - - /// @brief get lengths of the single shape parts - const std::vector& getShapeLengths() const; - - /// @brief update pre-computed geometry information - void updateGeometry(); - - /// @brief Returns position of hierarchical element in view - Position getPositionInView() const; - /// @} - - /// @brief Returns underlying parent edge - GNEEdge* getParentEdge() const; - - /// @brief returns a vector with the incoming GNEConnections of this lane - std::vector getGNEIncomingConnections(); - - /// @brief returns a vector with the outgoing GNEConnections of this lane - std::vector getGNEOutcomingConnections(); - - /// @brief update IDs of incoming connections of this lane - void updateConnectionIDs(); - - /// @brief get length geometry factor - double getLengthGeometryFactor() const; - - /// @name functions for edit geometry - /// @{ - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void startGeometryMoving(); - - /// @brief begin movement (used when user click over edge to start a movement, to avoid problems with problems with GL Tree) - void endGeometryMoving(); - /// @} - - /// @name inherited from GUIGlObject - /// @{ - // @brief Returns the name of the parent object (if any) - // @return This object's parent id - std::string getParentName() const; - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /// @brief multiplexes message to two targets - long onDefault(FXObject*, FXSelector, void*); - - /**@brief Returns the boundary to which the view shall be centered in order to show the object - * - * @return The boundary the object is within - * @see GUIGlObject::getCenteringBoundary - */ - Boundary getCenteringBoundary() const; - - /**@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; - /// @} - - /// @brief returns the index of the lane - int getIndex() const; - - /// @brief returns the current speed of lane - double getSpeed() const; - - /* @brief method for setting the index of the lane - * @param[in] index The new index of lane - */ - void setIndex(int index); - - /** @brief returns the parameteric length of the lane - * @note is the same as their Edge parent, and cannot be never nullptr - */ - double getLaneParametricLength() const; - - /// @brief returns the length of the lane's shape - double getLaneShapeLength() const; - - /// @brief check if this lane is restricted - bool isRestricted(SUMOVehicleClass vclass) const; - - /// @brief get Lane2laneConnection struct - const GNEGeometry::Lane2laneConnection& getLane2laneConnections() const; - - /// @name 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; - std::string getAttributeForSelection(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 checking if the key and their correspond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - bool isValid(SumoXMLAttr key, const std::string& value); - - /* @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 setting the special color of the lane - * @param[in] color Pointer to new special color - */ - void setSpecialColor(const RGBColor* Color2, double colorValue = std::numeric_limits::max()); - - /// @brief return value for lane coloring according to the given scheme - double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const; - - /// @brief whether to draw this lane as a railway - bool drawAsRailway(const GUIVisualizationSettings& s) const; - - /// @brief draw partial E2 detector plan - void drawPartialE2DetectorPlan(const GUIVisualizationSettings& s, const GNEAdditional* E2Detector, const GNEJunction* junction) const; - -protected: - /// @brief FOX needs this - GNELane(); - - /// @brief The Edge that to which this lane belongs - GNEEdge* myParentEdge; - - /// @brief The index of this lane - int myIndex; - - /// @brief lane geometry - GNEGeometry::Geometry myLaneGeometry; - - /// @name computed only once (for performance) in updateGeometry() - /// @{ - - /// @brief Position of textures of restricted lanes - std::vector myLaneRestrictedTexturePositions; - - /// @brief Rotations of textures of restricted lanes - std::vector myLaneRestrictedTextureRotations; - /// @} - - /// @brief optional special color - const RGBColor* mySpecialColor = nullptr; - - /// @brief optional value that corresponds to which the special color corresponds - double mySpecialColorValue = -1; - - /// @brief The color of the shape parts (cached) - mutable std::vector myShapeColors; - - /// @brief lane2lane connections - GNEGeometry::Lane2laneConnection myLane2laneConnections; - -private: - /// @brief set attribute after validation - void setAttribute(SumoXMLAttr key, const std::string& value); - - /// @brief update dotted contour - void updateDottedContour(); - - /// @brief draw lane markings - void drawMarkings(const GUIVisualizationSettings& s, double scale) const; - - /// @brief draw link Number - void drawLinkNo(const GUIVisualizationSettings& s) const; - - /// @brief draw TLS Link Number - void drawTLSLinkNo(const GUIVisualizationSettings& s) const; - - /// @brief draw link rules - void drawLinkRules(const GUIVisualizationSettings& s) const; - - /// @brief draw arrows - void drawArrows(const GUIVisualizationSettings& s) const; - - /// @brief draw lane to lane connections - void drawLane2LaneConnections() const; - - /// @brief sets the color according to the current scheme index and some lane function - bool setFunctionalColor(int activeScheme, RGBColor& col) const; - - /// @brief sets multiple colors according to the current scheme index and some lane function - bool setMultiColor(const GUIVisualizationSettings& s, const GUIColorer& c, RGBColor& col) const; - - /// @brief whether to draw this lane as a waterways - bool drawAsWaterway(const GUIVisualizationSettings& s) const; - - /// @brief direction indicators for lanes - void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const; - - /// @brief draw VSS symbol - void drawVSSSymbol(const GUIVisualizationSettings& s, GNEAdditional* vss) const; - - /// @brief draw start and end shape points - void drawStartEndShapePoints(const GUIVisualizationSettings& s) const; - - /// @brief set color according to edit mode and visualisation settings - RGBColor setLaneColor(const GUIVisualizationSettings& s) const; - - /// @brief Invalidated copy constructor. - GNELane(const GNELane&) = delete; - - /// @brief Invalidated assignment operator. - GNELane& operator=(const GNELane&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNENetElement.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNENetElement.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNENetElement.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNENetElement.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,180 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNENetElement.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A abstract class for netElements -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "GNENetElement.h" - - -// =========================================================================== -// method definitions -// =========================================================================== - -GNENetElement::GNENetElement(GNENet* net, const std::string& id, GUIGlObjectType type, SumoXMLTag tag) : - GUIGlObject(type, id), - GNEAttributeCarrier(tag), - GNEHierarchicalParentElements(this, {}, {}, {}, {}, {}), - GNEHierarchicalChildElements(this, {}, {}, {}, {}, {}), - myNet(net), -myMovingGeometryBoundary() { -} - - -GNENetElement::~GNENetElement() {} - - -void -GNENetElement::updateDottedGeometry(const PositionVector& shape) { - myDottedGeometry.updateDottedGeometry(myNet->getViewNet()->getVisualisationSettings(), shape); -} - - -std::string -GNENetElement::generateChildID(SumoXMLTag /*childTag*/) { - return ""; -} - - -GNENet* -GNENetElement::getNet() const { - return myNet; -} - - -GUIParameterTableWindow* -GNENetElement::getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView&) { - // Create table - GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this); - // Iterate over attributes - for (const auto& i : myTagProperty) { - // Add attribute and set it dynamic if aren't unique - if (i.isUnique()) { - ret->mkItem(i.getAttrStr().c_str(), false, getAttribute(i.getAttr())); - } else { - ret->mkItem(i.getAttrStr().c_str(), true, getAttribute(i.getAttr())); - } - } - // close building - ret->closeBuilding(); - return ret; -} - - -void -GNENetElement::selectAttributeCarrier(bool changeFlag) { - if (!myNet) { - throw ProcessError("Net cannot be nullptr"); - } else { - gSelected.select(getGlID()); - // add object into list of selected objects - myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->addedLockedObject(getType()); - if (changeFlag) { - mySelected = true; - - } - } -} - - -void -GNENetElement::unselectAttributeCarrier(bool changeFlag) { - if (!myNet) { - throw ProcessError("Net cannot be nullptr"); - } else { - gSelected.deselect(getGlID()); - // remove object of list of selected objects - myNet->getViewNet()->getViewParent()->getSelectorFrame()->getLockGLObjectTypes()->removeLockedObject(getType()); - if (changeFlag) { - mySelected = false; - } - } -} - - -bool -GNENetElement::isAttributeCarrierSelected() const { - return mySelected; -} - - -bool -GNENetElement::drawUsingSelectColor() const { - if (mySelected && (myNet->getViewNet()->getEditModes().currentSupermode == GNE_SUPERMODE_NETWORK)) { - return true; - } else { - return false; - } -} - - -void -GNENetElement::enableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -void -GNENetElement::disableAttribute(SumoXMLAttr /*key*/, GNEUndoList* /*undoList*/) { - // -} - - -std::string -GNENetElement::getPopUpID() const { - if (myTagProperty.getTag() == SUMO_TAG_CONNECTION) { - return getAttribute(SUMO_ATTR_FROM) + "_" + getAttribute(SUMO_ATTR_FROM_LANE) + " -> " + getAttribute(SUMO_ATTR_TO) + "_" + getAttribute(SUMO_ATTR_TO_LANE); - } else { - return getTagStr() + ": " + getID(); - } -} - - -std::string -GNENetElement::getHierarchyName() const { - if (myTagProperty.getTag() == SUMO_TAG_LANE) { - return toString(SUMO_TAG_LANE) + " " + getAttribute(SUMO_ATTR_INDEX); - } else if (myTagProperty.getTag() == SUMO_TAG_CONNECTION) { - return getAttribute(SUMO_ATTR_FROM_LANE) + " -> " + getAttribute(SUMO_ATTR_TO_LANE); - } else if ((myTagProperty.getTag() == SUMO_TAG_EDGE) || (myTagProperty.getTag() == SUMO_TAG_CROSSING)) { - return getPopUpID(); - } else { - return getTagStr(); - } -} - - -void -GNENetElement::setEnabledAttribute(const int /*enabledAttributes*/) { - // -} - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNENetElement.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNENetElement.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNENetElement.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNENetElement.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNENetElement.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A abstract class for net elements -/****************************************************************************/ -#ifndef GNENetElement_h -#define GNENetElement_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== - -class GNEAdditional; -class GNEDemandElement; - -// =========================================================================== -// class definitions -// =========================================================================== - -class GNENetElement : public GUIGlObject, public GNEAttributeCarrier, public GNEHierarchicalParentElements, public GNEHierarchicalChildElements { - -public: - /**@brief Constructor. - * @param[in] net The net to inform about gui updates - * @param[in] id of the element - * @param[in] type type of GL object - * @param[in] tag sumo xml tag of the element - */ - GNENetElement(GNENet* net, const std::string& id, GUIGlObjectType type, SumoXMLTag tag); - - /// @brief Destructor - ~GNENetElement(); - - /// @brief updated dotted geometry - void updateDottedGeometry(const PositionVector& shape); - - /// @brief gererate a new ID for an element child - virtual std::string generateChildID(SumoXMLTag childTag) = 0; - - /// @name Functions related with geometry of element - /// @{ - /// @brief update pre-computed geometry information - virtual void updateGeometry() = 0; - - /// @brief update dotted contour - virtual void updateDottedContour() = 0; - - /// @brief Returns position of hierarchical element in view - virtual Position getPositionInView() const = 0; - /// @} - - /// @brief get Net in which this element is placed - GNENet* getNet() const; - - /// @name inherited from GUIGlObject - /// @{ - - /**@brief Returns an own parameter window - * - * @param[in] app The application needed to build the parameter window - * @param[in] parent The parent window needed to build the parameter window - * @return The built parameter window - * @see GUIGlObject::getParameterWindow - */ - GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent); - - /**@brief Returns an own popup-menu - * - * @param[in] app The application needed to build the popup-menu - * @param[in] parent The parent window needed to build the popup-menu - * @return The built popup-menu - * @see GUIGlObject::getPopUpMenu - */ - virtual GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) = 0; - - /// @brief Returns the boundary to which the view shall be centered in order to show the object - virtual Boundary getCenteringBoundary() const = 0; - - /**@brief Draws the object - * @param[in] s The settings for the current view (may influence drawing) - * @see GUIGlObject::drawGL - */ - virtual void drawGL(const GUIVisualizationSettings& s) const = 0; - /// @} - - /// @name inherited from GNEAttributeCarrier - /// @{ - - /// @brief select attribute carrier using GUIGlobalSelection - void selectAttributeCarrier(bool changeFlag = true); - - /// @brief unselect attribute carrier using GUIGlobalSelection - void unselectAttributeCarrier(bool changeFlag = true); - - /// @brief check if attribute carrier is selected - bool isAttributeCarrierSelected() const; - - /// @brief check if attribute carrier must be drawn using selecting color. - bool drawUsingSelectColor() const; - - /* @brief method for getting the Attribute of an XML key - * @param[in] key The attribute key - * @return string with the value associated to key - */ - virtual std::string getAttribute(SumoXMLAttr key) const = 0; - - /* @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 - */ - virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0; - - /* @brief method for checking if the key and their conrrespond attribute are valids - * @param[in] key The attribute key - * @param[in] value The value asociated to key key - * @return true if the value is valid, false in other case - */ - virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0; - - /* @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 - */ - virtual bool isAttributeEnabled(SumoXMLAttr key) const = 0; - - /// @brief get PopPup ID (Used in AC Hierarchy) - std::string getPopUpID() const; - - /// @brief get Hierarchy Name (Used in AC Hierarchy) - std::string getHierarchyName() const; - /// @} - -protected: - /// @brief the net to inform about updates - GNENet* myNet; - - /// @brief boundary used during moving of elements - Boundary myMovingGeometryBoundary; - -private: - /// @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 Invalidated copy constructor. - GNENetElement(const GNENetElement&) = delete; - - /// @brief Invalidated assignment operator. - GNENetElement& operator=(const GNENetElement&) = delete; -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEProhibition.cpp sumo-1.6.0+dfsg1/src/netedit/netelements/GNEProhibition.cpp --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEProhibition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEProhibition.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEProhibition.cpp -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A class for visualizing prohibitions between edges -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNEProhibition.h" - - - -// =========================================================================== -// static member definitions -// =========================================================================== - - -// =========================================================================== -// method definitions -// =========================================================================== - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netedit/netelements/GNEProhibition.h sumo-1.6.0+dfsg1/src/netedit/netelements/GNEProhibition.h --- sumo-1.5.0+dfsg1/src/netedit/netelements/GNEProhibition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netedit/netelements/GNEProhibition.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 GNEProhibition.h -/// @author Pablo Alvarez Lopez -/// @date Jun 2016 -/// -// A class for represent prohibitions between edges -/****************************************************************************/ -#ifndef GNEProhibition_h -#define GNEProhibition_h - - -// =========================================================================== -// included modules -// =========================================================================== - -#include "GNENetElement.h" - -// =========================================================================== -// class declarations -// =========================================================================== - - -// =========================================================================== -// class definitions -// =========================================================================== - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/netgen_main.cpp sumo-1.6.0+dfsg1/src/netgen/netgen_main.cpp --- sumo-1.5.0+dfsg1/src/netgen/netgen_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/netgen_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Main for NETGENERATE /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -271,6 +266,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGEdge.cpp sumo-1.6.0+dfsg1/src/netgen/NGEdge.cpp --- sumo-1.5.0+dfsg1/src/netgen/NGEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A netgen-representation of an edge /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,9 +71,9 @@ } SVCPermissions permissions = nb.getTypeCont().getPermissions(type); - LaneSpreadFunction lsf = LANESPREAD_RIGHT; + LaneSpreadFunction lsf = LaneSpreadFunction::RIGHT; if (isRailway(permissions) && nb.getTypeCont().getIsOneWay(type)) { - lsf = LANESPREAD_CENTER; + lsf = LaneSpreadFunction::CENTER; } NBEdge* result = new NBEdge( myID, @@ -93,4 +88,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGEdge.h sumo-1.6.0+dfsg1/src/netgen/NGEdge.h --- sumo-1.5.0+dfsg1/src/netgen/NGEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A netgen-representation of an edge /****************************************************************************/ -#ifndef NGNetElements_h -#define NGNetElements_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -120,8 +114,3 @@ * @brief A list of edges (edge pointers) */ typedef std::list NGEdgeList; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGFrame.cpp sumo-1.6.0+dfsg1/src/netgen/NGFrame.cpp --- sumo-1.5.0+dfsg1/src/netgen/NGFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for netgen /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -234,29 +229,29 @@ // check whether the junction type to use is properly set if (oc.isSet("default-junction-type")) { std::string type = oc.getString("default-junction-type"); - if (type != toString(NODETYPE_TRAFFIC_LIGHT) && - type != toString(NODETYPE_TRAFFIC_LIGHT_NOJUNCTION) && - type != toString(NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED) && - type != toString(NODETYPE_PRIORITY) && - type != toString(NODETYPE_PRIORITY_STOP) && - type != toString(NODETYPE_ALLWAY_STOP) && - type != toString(NODETYPE_ZIPPER) && - type != toString(NODETYPE_NOJUNCTION) && - type != toString(NODETYPE_RAIL_SIGNAL) && - type != toString(NODETYPE_RAIL_CROSSING) && - type != toString(NODETYPE_RIGHT_BEFORE_LEFT)) { + if (type != toString(SumoXMLNodeType::TRAFFIC_LIGHT) && + type != toString(SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION) && + type != toString(SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) && + type != toString(SumoXMLNodeType::PRIORITY) && + type != toString(SumoXMLNodeType::PRIORITY_STOP) && + type != toString(SumoXMLNodeType::ALLWAY_STOP) && + type != toString(SumoXMLNodeType::ZIPPER) && + type != toString(SumoXMLNodeType::NOJUNCTION) && + type != toString(SumoXMLNodeType::RAIL_SIGNAL) && + type != toString(SumoXMLNodeType::RAIL_CROSSING) && + type != toString(SumoXMLNodeType::RIGHT_BEFORE_LEFT)) { WRITE_ERROR("Only the following junction types are known: " + - toString(NODETYPE_TRAFFIC_LIGHT) + ", " + - toString(NODETYPE_TRAFFIC_LIGHT_NOJUNCTION) + ", " + - toString(NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED) + ", " + - toString(NODETYPE_PRIORITY) + ", " + - toString(NODETYPE_PRIORITY_STOP) + ", " + - toString(NODETYPE_ALLWAY_STOP) + ", " + - toString(NODETYPE_ZIPPER) + ", " + - toString(NODETYPE_NOJUNCTION) + ", " + - toString(NODETYPE_RAIL_SIGNAL) + ", " + - toString(NODETYPE_RAIL_CROSSING) + ", " + - toString(NODETYPE_RIGHT_BEFORE_LEFT)); + toString(SumoXMLNodeType::TRAFFIC_LIGHT) + ", " + + toString(SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION) + ", " + + toString(SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED) + ", " + + toString(SumoXMLNodeType::PRIORITY) + ", " + + toString(SumoXMLNodeType::PRIORITY_STOP) + ", " + + toString(SumoXMLNodeType::ALLWAY_STOP) + ", " + + toString(SumoXMLNodeType::ZIPPER) + ", " + + toString(SumoXMLNodeType::NOJUNCTION) + ", " + + toString(SumoXMLNodeType::RAIL_SIGNAL) + ", " + + toString(SumoXMLNodeType::RAIL_CROSSING) + ", " + + toString(SumoXMLNodeType::RIGHT_BEFORE_LEFT)); ok = false; } } @@ -265,4 +260,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGFrame.h sumo-1.6.0+dfsg1/src/netgen/NGFrame.h --- sumo-1.5.0+dfsg1/src/netgen/NGFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Sets and checks options for netgen /****************************************************************************/ -#ifndef NGFrame_h -#define NGFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -48,9 +42,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGNet.cpp sumo-1.6.0+dfsg1/src/netgen/NGNet.cpp --- sumo-1.5.0+dfsg1/src/netgen/NGNet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGNet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The class storing the generated network /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -340,4 +335,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGNet.h sumo-1.6.0+dfsg1/src/netgen/NGNet.h --- sumo-1.5.0+dfsg1/src/netgen/NGNet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGNet.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The class storing the generated network /****************************************************************************/ -#ifndef NGNet_h -#define NGNet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -225,9 +219,3 @@ NGNet& operator=(const NGNet&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGNode.cpp sumo-1.6.0+dfsg1/src/netgen/NGNode.cpp --- sumo-1.5.0+dfsg1/src/netgen/NGNode.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGNode.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A netgen-representation of a node /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -73,21 +68,21 @@ GeoConvHelper::getProcessing().x2cartesian(pos); // the center will have no logic! if (myAmCenter) { - return new NBNode(myID, pos, NODETYPE_NOJUNCTION); + return new NBNode(myID, pos, SumoXMLNodeType::NOJUNCTION); } NBNode* node = nullptr; std::string typeS = OptionsCont::getOptions().isSet("default-junction-type") ? OptionsCont::getOptions().getString("default-junction-type") : ""; if (SUMOXMLDefinitions::NodeTypes.hasString(typeS)) { - SumoXMLNodeType type = SUMOXMLDefinitions::NodeTypes.get(typeS); + const SumoXMLNodeType type = SUMOXMLDefinitions::NodeTypes.get(typeS); node = new NBNode(myID, pos, type); // check whether it is a traffic light junction if (NBNode::isTrafficLight(type)) { - TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get( - OptionsCont::getOptions().getString("tls.default-type")); - NBTrafficLightDefinition* tlDef = new NBOwnTLDef(myID, node, 0, type); + const TrafficLightType tlType = SUMOXMLDefinitions::TrafficLightTypes.get( + OptionsCont::getOptions().getString("tls.default-type")); + NBTrafficLightDefinition* tlDef = new NBOwnTLDef(myID, node, 0, tlType); if (!nb.getTLLogicCont().insert(tlDef)) { // actually, nothing should fail here delete tlDef; @@ -95,11 +90,11 @@ } } } else { - // otherwise netbuild may guess NODETYPE_TRAFFIC_LIGHT without actually building one - node = new NBNode(myID, pos, NODETYPE_PRIORITY); + // otherwise netbuild may guess SumoXMLNodeType::TRAFFIC_LIGHT without actually building one + node = new NBNode(myID, pos, SumoXMLNodeType::PRIORITY); } if (myAmFringe) { - node->setFringeType(FRINGE_TYPE_OUTER); + node->setFringeType(FringeType::OUTER); } return node; @@ -130,4 +125,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGNode.h sumo-1.6.0+dfsg1/src/netgen/NGNode.h --- sumo-1.5.0+dfsg1/src/netgen/NGNode.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGNode.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A netgen-representation of a node /****************************************************************************/ -#ifndef NGNode_h -#define NGNode_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -136,7 +130,7 @@ * * The position of the node is transformed to cartesian using GeoConvHelper::x2cartesian, * first. If this node is the center node of a spider net, a node of the type - * NBNode::NODETYPE_NOJUNCTION is returned. + * NBNode::SumoXMLNodeType::NOJUNCTION is returned. * Otherwise, a plain node is built and it is checked whether the options * indicate building one of the tls node-types. In this case, a logic is built and * stored. A ProcessError is thrown if this fails (should never happen, in fact). @@ -216,10 +210,3 @@ * @brief A list of nodes (node pointers) */ typedef std::list NGNodeList; - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGRandomNetBuilder.cpp sumo-1.6.0+dfsg1/src/netgen/NGRandomNetBuilder.cpp --- sumo-1.5.0+dfsg1/src/netgen/NGRandomNetBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGRandomNetBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Additional structures for building random nets /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -265,4 +260,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netgen/NGRandomNetBuilder.h sumo-1.6.0+dfsg1/src/netgen/NGRandomNetBuilder.h --- sumo-1.5.0+dfsg1/src/netgen/NGRandomNetBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netgen/NGRandomNetBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Additional structures for building random nets /****************************************************************************/ -#ifndef NGRandomNetBuilder_h -#define NGRandomNetBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -163,9 +157,3 @@ NGRandomNetBuilder& operator=(const NGRandomNetBuilder&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/CMakeLists.txt sumo-1.6.0+dfsg1/src/netimport/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/netimport/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,6 @@ NIImporter_OpenDrive.h NIImporter_OpenStreetMap.cpp NIImporter_OpenStreetMap.h - NIImporter_RobocupRescue.cpp - NIImporter_RobocupRescue.h NIImporter_SUMO.cpp NIImporter_SUMO.h NIImporter_VISUM.cpp diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIFrame.cpp sumo-1.6.0+dfsg1/src/netimport/NIFrame.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Sets and checks options for netimport /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -250,6 +245,9 @@ oc.addSynonyme("shapefile.guess-projection", "arcview.guess-projection", true); oc.addDescription("shapefile.guess-projection", "Formats", "Guess the proper projection"); + oc.doRegister("shapefile.traditional-axis-mapping", new Option_Bool(false)); + oc.addDescription("shapefile.traditional-axis-mapping", "Formats", "Use traditional axis order (lon, lat)"); + // register vissim options oc.doRegister("vissim.join-distance", new Option_Float(5.0f)); @@ -401,6 +399,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIFrame.h sumo-1.6.0+dfsg1/src/netimport/NIFrame.h --- sumo-1.5.0+dfsg1/src/netimport/NIFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for netimport /****************************************************************************/ -#ifndef NIFrame_h -#define NIFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -53,9 +47,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_ArcView.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_ArcView.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_ArcView.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_ArcView.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -146,14 +141,19 @@ OGRSpatialReference destTransf; // use wgs84 as destination destTransf.SetWellKnownGeogCS("WGS84"); +#if GDAL_VERSION_MAJOR > 2 + if (myOptions.getBool("shapefile.traditional-axis-mapping")) { + destTransf.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); + } +#endif OGRCoordinateTransformation* poCT = OGRCreateCoordinateTransformation(origTransf, &destTransf); - if (poCT == NULL) { + if (poCT == nullptr) { if (myOptions.isSet("shapefile.guess-projection")) { OGRSpatialReference origTransf2; origTransf2.SetWellKnownGeogCS("WGS84"); poCT = OGRCreateCoordinateTransformation(&origTransf2, &destTransf); } - if (poCT == 0) { + if (poCT == nullptr) { WRITE_WARNING("Could not create geocoordinates converter; check whether proj.4 is installed."); } } @@ -210,7 +210,7 @@ type = poFeature->GetFieldAsString("ST_TYP_AFT"); } if ((type != "" || myOptions.isSet("shapefile.type-id")) && !myTypeCont.knows(type)) { - WRITE_WARNING("Unknown type '" + type + "' for edge '" + id + "'"); + WRITE_WARNINGF("Unknown type '%' for edge '%'", type, id); } double width = myTypeCont.getWidth(type); bool oneway = myTypeCont.knows(type) ? myTypeCont.getIsOneWay(type) : false; @@ -244,7 +244,7 @@ return; } OGRLineString* cgeom = (OGRLineString*) poGeometry; - if (poCT != 0) { + if (poCT != nullptr) { // try transform to wgs84 cgeom->transform(poCT); } @@ -253,7 +253,7 @@ for (int j = 0; j < cgeom->getNumPoints(); j++) { Position pos((double) cgeom->getX(j), (double) cgeom->getY(j), (double) cgeom->getZ(j)); if (!NBNetBuilder::transformCoordinate(pos)) { - WRITE_WARNING("Unable to project coordinates for edge '" + id + "'."); + WRITE_WARNINGF("Unable to project coordinates for edge '%'.", id); } shape.push_back_noDoublePos(pos); } @@ -288,7 +288,7 @@ } if (from == to) { - WRITE_WARNING("Edge '" + id + "' connects identical nodes, skipping."); + WRITE_WARNINGF("Edge '%' connects identical nodes, skipping.", id); continue; } @@ -323,7 +323,7 @@ // add positive direction if wanted if (dir == "B" || dir == "F" || dir == "" || myOptions.getBool("shapefile.all-bidirectional")) { if (myEdgeCont.retrieve(id) == 0) { - LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LANESPREAD_RIGHT : LANESPREAD_CENTER; + LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LaneSpreadFunction::RIGHT : LaneSpreadFunction::CENTER; NBEdge* edge = new NBEdge(id, from, to, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape, name, origID, spread); edge->setPermissions(myTypeCont.getPermissions(type)); myEdgeCont.insert(edge); @@ -336,7 +336,7 @@ // add negative direction if wanted if ((dir == "B" || dir == "T" || myOptions.getBool("shapefile.all-bidirectional")) && !oneway) { if (myEdgeCont.retrieve("-" + id) == 0) { - LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LANESPREAD_RIGHT : LANESPREAD_CENTER; + LaneSpreadFunction spread = dir == "B" || dir == "FALSE" ? LaneSpreadFunction::RIGHT : LaneSpreadFunction::CENTER; NBEdge* edge = new NBEdge("-" + id, to, from, type, speed, nolanes, priority, width, NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), name, origID, spread); edge->setPermissions(myTypeCont.getPermissions(type)); myEdgeCont.insert(edge); @@ -469,8 +469,8 @@ NIImporter_ArcView::checkSpread(NBEdge* e) { NBEdge* ret = e->getToNode()->getConnectionTo(e->getFromNode()); if (ret != 0) { - e->setLaneSpreadFunction(LANESPREAD_RIGHT); - ret->setLaneSpreadFunction(LANESPREAD_RIGHT); + e->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); + ret->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); } } @@ -517,6 +517,4 @@ #endif - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_ArcView.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_ArcView.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_ArcView.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_ArcView.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for networks stored in ArcView-shape format /****************************************************************************/ -#ifndef NIImporter_ArcView_h -#define NIImporter_ArcView_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -117,7 +111,7 @@ /** @brief Checks whether the lane spread shall be changed * * If for the given edge an edge into the vice direction is already - * stored, both edges' lane spread functions are set to LANESPREAD_RIGHT. + * stored, both edges' lane spread functions are set to LaneSpreadFunction::RIGHT. * * @param[in] e The edge to check */ @@ -182,9 +176,3 @@ NIImporter_ArcView& operator=(const NIImporter_ArcView&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_DlrNavteq.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_DlrNavteq.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_DlrNavteq.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_DlrNavteq.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Importer for networks stored in Elmar's format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -380,7 +375,7 @@ geoms.push_back(to->getPosition()); const std::string origID = OptionsCont::getOptions().getBool("output.original-names") ? id : ""; e = new NBEdge(id, from, to, myTypeCont.knows(navTeqTypeId) ? navTeqTypeId : "", speed, numLanes, priority, - NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geoms, streetName, origID, LANESPREAD_CENTER); + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geoms, streetName, origID, LaneSpreadFunction::CENTER); } // NavTeq imports can be done with a typemap (if supplied), if not, the old defaults are used @@ -492,8 +487,8 @@ WRITE_WARNINGF("The traffic light edge '%' could not be found.", edgeID); } else { NBNode* node = edge->getToNode(); - if (node->getType() != NODETYPE_TRAFFIC_LIGHT) { - node->reinit(node->getPosition(), NODETYPE_TRAFFIC_LIGHT); + if (node->getType() != SumoXMLNodeType::TRAFFIC_LIGHT) { + node->reinit(node->getPosition(), SumoXMLNodeType::TRAFFIC_LIGHT); // @note. There may be additional information somewhere in the GDF files about traffic light type ... TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get(OptionsCont::getOptions().getString("tls.default-type")); // @note actually we could use the navteq node ID here @@ -817,7 +812,7 @@ const bool warnOnly = st.size() > 7; myEdgeCont.addPostProcessConnection(from->getID(), fromLane, to->getID(), toLane, false, true, NBEdge::UNSPECIFIED_CONTPOS, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE, - NBEdge::UNSPECIFIED_SPEED, PositionVector::EMPTY, false, warnOnly); + NBEdge::UNSPECIFIED_SPEED, NBEdge::UNSPECIFIED_LOADED_LENGTH, PositionVector::EMPTY, false, warnOnly); } // ensure that connections for other lanes are guessed if not specified from->declareConnectionsAsLoaded(NBEdge::EdgeBuildingStep::INIT); diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_DlrNavteq.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_DlrNavteq.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_DlrNavteq.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_DlrNavteq.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for networks stored in Elmar's format /****************************************************************************/ -#ifndef NIImporter_DlrNavteq_h -#define NIImporter_DlrNavteq_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -518,9 +512,3 @@ static time_t readDate(const std::string& yyyymmdd); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_ITSUMO.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_ITSUMO.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_ITSUMO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_ITSUMO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -303,4 +298,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_ITSUMO.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_ITSUMO.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_ITSUMO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_ITSUMO.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Importer for networks stored in ITSUMO format /****************************************************************************/ -#ifndef NIImporter_ITSUMO_h -#define NIImporter_ITSUMO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -243,9 +237,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_MATSim.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_MATSim.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_MATSim.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_MATSim.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Importer for networks stored in MATSim format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -182,9 +177,9 @@ void NIImporter_MATSim::EdgesHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - bool ok = true; if (element == MATSIM_TAG_NETWORK) { if (attrs.hasAttribute(MATSIM_ATTR_CAPDIVIDER)) { + bool ok = true; int capDivider = attrs.get(MATSIM_ATTR_CAPDIVIDER, "network", ok); if (ok) { myCapacityNorm = (double)(capDivider * 3600); @@ -214,6 +209,7 @@ if (element != MATSIM_TAG_LINK) { return; } + bool ok = true; std::string id = attrs.get(MATSIM_ATTR_ID, nullptr, ok); std::string fromNodeID = attrs.get(MATSIM_ATTR_FROM, id.c_str(), ok); std::string toNodeID = attrs.get(MATSIM_ATTR_TO, id.c_str(), ok); @@ -251,4 +247,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_MATSim.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_MATSim.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_MATSim.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_MATSim.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Importer for networks stored in MATSim format /****************************************************************************/ -#ifndef NIImporter_MATSim_h -#define NIImporter_MATSim_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -232,9 +226,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenDrive.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenDrive.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenDrive.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenDrive.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Importer for networks stored in openDrive format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -62,9 +57,9 @@ //#define DEBUG_SPIRAL //#define DEBUG_INTERNALSHAPES -#define DEBUG_COND(road) ((road)->id == "175") -#define DEBUG_COND2(edgeID) (StringUtils::startsWith((edgeID), "disabled")) -#define DEBUG_COND3(roadID) (roadID == "175") +#define DEBUG_COND(road) ((road)->id == "18") +#define DEBUG_COND2(edgeID) (StringUtils::startsWith((edgeID), "-18.")) +#define DEBUG_COND3(roadID) (roadID == "18") // =========================================================================== // definitions @@ -91,6 +86,8 @@ { "right", NIImporter_OpenDrive::OPENDRIVE_TAG_RIGHT }, { "lane", NIImporter_OpenDrive::OPENDRIVE_TAG_LANE }, { "signal", NIImporter_OpenDrive::OPENDRIVE_TAG_SIGNAL }, + { "signalReference", NIImporter_OpenDrive::OPENDRIVE_TAG_SIGNALREFERENCE }, + { "validity", NIImporter_OpenDrive::OPENDRIVE_TAG_VALIDITY }, { "junction", NIImporter_OpenDrive::OPENDRIVE_TAG_JUNCTION }, { "connection", NIImporter_OpenDrive::OPENDRIVE_TAG_CONNECTION }, { "laneLink", NIImporter_OpenDrive::OPENDRIVE_TAG_LANELINK }, @@ -150,6 +147,8 @@ { "connectingRoad", NIImporter_OpenDrive::OPENDRIVE_ATTR_CONNECTINGROAD }, { "from", NIImporter_OpenDrive::OPENDRIVE_ATTR_FROM }, { "to", NIImporter_OpenDrive::OPENDRIVE_ATTR_TO }, + { "fromLane", NIImporter_OpenDrive::OPENDRIVE_ATTR_FROMLANE }, + { "toLane", NIImporter_OpenDrive::OPENDRIVE_ATTR_TOLANE }, { "max", NIImporter_OpenDrive::OPENDRIVE_ATTR_MAX }, { "sOffset", NIImporter_OpenDrive::OPENDRIVE_ATTR_SOFFSET }, { "name", NIImporter_OpenDrive::OPENDRIVE_ATTR_NAME }, @@ -183,6 +182,7 @@ myMinWidth = oc.getFloat("opendrive.min-width"); myImportInternalShapes = oc.getBool("opendrive.internal-shapes"); NBTypeCont& tc = nb.getTypeCont(); + NBNodeCont& nc = nb.getNodeCont(); // build the handler std::map edges; NIImporter_OpenDrive handler(nb.getTypeCont(), edges); @@ -198,6 +198,22 @@ XMLSubSys::runParser(handler, *file); PROGRESS_DONE_MESSAGE(); } + // apply signal reference information + for (auto& item : edges) { + for (OpenDriveSignal& signal : item.second->signals) { + if (signal.type == "") { + if (handler.getSignals().count(signal.id) == 0) { + WRITE_WARNING("Could not find signal reference '" + signal.id + "'."); + } else { + const OpenDriveSignal& ref = handler.getSignals()[signal.id]; + signal.type = ref.type; + signal.name = ref.name; + signal.dynamic = ref.dynamic; + } + } + } + } + // split inner/outer edges std::map innerEdges, outerEdges; for (std::map::iterator i = edges.begin(); i != edges.end(); ++i) { @@ -221,6 +237,7 @@ // and place the node in the middle of this bounding box std::map posMap; std::map edge2junction; + std::vector joinedNodeIDs; // compute node positions for (std::map::iterator i = innerEdges.begin(); i != innerEdges.end(); ++i) { OpenDriveEdge* e = (*i).second; @@ -253,12 +270,12 @@ } } // set node information - setNodeSecure(nb.getNodeCont(), *e, l.elementID, l.linkType); + setNodeSecure(nb.getNodeCont(), *e, l.elementID, l.linkType, joinedNodeIDs); continue; } if (edge2junction.find(l.elementID) != edge2junction.end()) { // set node information of an internal road - setNodeSecure(nb.getNodeCont(), *e, edge2junction[l.elementID], l.linkType); + setNodeSecure(nb.getNodeCont(), *e, edge2junction[l.elementID], l.linkType, joinedNodeIDs); continue; } } @@ -296,7 +313,7 @@ cout << nid << " " << pos << " " << nb.getNodeCont().retrieve(nid)->getPosition() << endl; } */ - setNodeSecure(nb.getNodeCont(), *e, nid, l.linkType); + setNodeSecure(nb.getNodeCont(), *e, nid, l.linkType, joinedNodeIDs); } } // we should now have start/end nodes for all outer edge-to-outer edge connections @@ -320,9 +337,9 @@ } std::string nid = edge2junction[ie->id]; if (il.contactPoint == OPENDRIVE_CP_START) { - setNodeSecure(nb.getNodeCont(), *e, nid, OPENDRIVE_LT_PREDECESSOR); + setNodeSecure(nb.getNodeCont(), *e, nid, OPENDRIVE_LT_PREDECESSOR, joinedNodeIDs); } else { - setNodeSecure(nb.getNodeCont(), *e, nid, OPENDRIVE_LT_SUCCESSOR); + setNodeSecure(nb.getNodeCont(), *e, nid, OPENDRIVE_LT_SUCCESSOR, joinedNodeIDs); } } } @@ -345,12 +362,42 @@ } } + std::map joinedNodes; + for (NodeSet& joined : joinedNodeIDs) { + Position joinedPos(0, 0); + for (NBNode* j : joined) { + joinedPos = joinedPos + j->getPosition(); + } + joinedPos = joinedPos * (1.0 / joined.size()); + const std::string joinedID = "cluster_" + joinNamedToString(joined, "_"); + if (!nc.insert(joinedID, joinedPos)) { + throw ProcessError("Could not add node '" + joinedID + "'."); + } + NBNode* n = nc.retrieve(joinedID); + for (NBNode* j : joined) { + joinedNodes[j] = n; + } + } + for (std::map::iterator i = outerEdges.begin(); i != outerEdges.end(); ++i) { + OpenDriveEdge* e = (*i).second; + if (joinedNodes.count(e->from) != 0) { + nc.extract(e->from, true); + e->from = joinedNodes[e->from]; + } + if (joinedNodes.count(e->to) != 0) { + nc.extract(e->to, true); + e->to = joinedNodes[e->to]; + } + } + // ------------------------- // edge building // ------------------------- const double defaultSpeed = tc.getSpeed(""); const bool saveOrigIDs = OptionsCont::getOptions().getBool("output.original-names"); + // lane-id-map sumoEdge,sumoLaneIndex->odrLaneIndex + std::map, int> laneIndexMap; // build edges for (std::map::iterator i = outerEdges.begin(); i != outerEdges.end(); ++i) { OpenDriveEdge* e = (*i).second; @@ -432,7 +479,7 @@ NBEdge* currRight = nullptr; if ((*j).rightLaneNumber > 0) { currRight = new NBEdge("-" + id, sFrom, sTo, (*j).rightType, defaultSpeed, (*j).rightLaneNumber, priorityR, - NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom, e->streetName, "", LANESPREAD_RIGHT, true); + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom, e->streetName, "", LaneSpreadFunction::RIGHT, true); lanesBuilt = true; const std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_RIGHT]; for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { @@ -440,6 +487,7 @@ 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 (!nb.getEdgeCont().insert(currRight, myImportAllTypes)) { @@ -468,7 +516,7 @@ NBEdge* currLeft = nullptr; if ((*j).leftLaneNumber > 0) { currLeft = new NBEdge(id, sTo, sFrom, (*j).leftType, defaultSpeed, (*j).leftLaneNumber, priorityL, - NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom.reverse(), e->streetName, "", LANESPREAD_RIGHT, true); + NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, geom.reverse(), e->streetName, "", LaneSpreadFunction::RIGHT, true); lanesBuilt = true; const std::vector& lanes = (*j).lanesByDir[OPENDRIVE_TAG_LEFT]; for (std::vector::const_iterator k = lanes.begin(); k != lanes.end(); ++k) { @@ -476,6 +524,7 @@ 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 (!nb.getEdgeCont().insert(currLeft, myImportAllTypes)) { @@ -551,7 +600,7 @@ } } if (!lanesBuilt) { - WRITE_WARNING("Edge '" + e->id + "' has no lanes."); + WRITE_WARNINGF("Edge '%' has no lanes.", e->id); } } @@ -641,6 +690,7 @@ NBEdge::UNSPECIFIED_CONTPOS, NBEdge::UNSPECIFIED_VISIBILITY_DISTANCE, NBEdge::UNSPECIFIED_SPEED, + NBEdge::UNSPECIFIED_LOADED_LENGTH, (*i).shape); if ((*i).origID != "" && saveOrigIDs) { @@ -662,25 +712,27 @@ std::map tlsControlled; for (std::map::iterator i = edges.begin(); i != edges.end(); ++i) { OpenDriveEdge* e = (*i).second; - for (std::vector::const_iterator j = e->signals.begin(); j != e->signals.end(); ++j) { - if ((*j).type != "1000001") { // traffic_light (Section 6.11) + for (const OpenDriveSignal& signal : e->signals) { + if (signal.type != "1000001") { // traffic_light (Section 6.11) + continue; + } + if (e->laneSections.size() == 0) { + WRITE_WARNING("Edge '" + e->id + "' has signals but no lane sections."); continue; } std::vector::iterator k = e->laneSections.begin(); bool found = false; for (; k != e->laneSections.end() - 1 && !found;) { - if ((*j).s > (*k).s && (*j).s <= (*(k + 1)).s) { + if (signal.s > (*k).s && signal.s <= (*(k + 1)).s) { found = true; } else { ++k; } } - // @todo: major problem, currently, still not completely solved: - // inner edges may have traffic lights, too. Nice on one hand, as directions can be recognized - // but hard to follow backwards std::string id = (*k).sumoID; if (id == "") { + // traffic light on connecting road if (e->junction != "") { //WRITE_WARNING("Found a traffic light signal on an internal edge; will not build it (original edge id='" + e->id + "')."); std::string fromID, toID; @@ -692,12 +744,12 @@ OpenDriveEdge* e = edges[(*l).elementID]; if ((*l).contactPoint == OPENDRIVE_CP_START) { fromID = e->laneSections[0].sumoID; - if ((*j).orientation < 0) { + if (signal.orientation < 0) { fromID = "-" + fromID; } } else { fromID = e->laneSections.back().sumoID; - if ((*j).orientation > 0) { + if (signal.orientation > 0) { fromID = "-" + fromID; } } @@ -710,44 +762,73 @@ toID = (*l).contactPoint == OPENDRIVE_CP_START ? e->laneSections[0].sumoID : e->laneSections.back().sumoID; } } - id = fromID + "->" + toID; + // figure out the correct combination of directions + NBEdge* from; + NBEdge* to; + auto fromTo = retrieveSignalEdges(nb, fromID, toID, e->junction); + from = fromTo.first; + to = fromTo.second; + if (from == nullptr) { + WRITE_WARNINGF("Could not find edge '%' for signal '%'.", fromID, signal.id); + continue; + } + + // consider signal validity to determine direction + if (signal.maxLane != 0) { + bool fromForward = from->getID()[0] == '-'; + bool lanesForward = signal.maxLane < 0; + if (fromForward != lanesForward) { + std::swap(fromID, toID); + + auto fromTo = retrieveSignalEdges(nb, fromID, toID, e->junction); + from = fromTo.first; + to = fromTo.second; + if (from == nullptr) { + WRITE_WARNINGF("Could not find edge '%' for signal '%'.", fromID, signal.id); + continue; + } + } + } + for (NBEdge::Connection& c : from->getConnections()) { + if (c.toEdge == to) { + int odLane = laneIndexMap[std::make_pair(from, c.fromLane)]; + //std::cout << " fromLane=" << c.fromLane << " odLane=" << odLane << "\n"; + if (signal.minLane == 0 || (signal.minLane <= odLane && signal.maxLane >= odLane)) { + c.setParameter("signalID", signal.id); + } + } + } + getTLSSecure(from, nb); + //std::cout << "odrEdge=" << e->id << " fromID=" << fromID << " toID=" << toID << " from=" << from->getID() << " to=" << to->getID() + // << " signal=" << signal.id << " minLane=" << signal.minLane << " maxLane=" << signal.maxLane << "\n"; } else { - WRITE_WARNING("Found a traffic light signal on an unknown edge (original edge id='" + e->id + "')."); + WRITE_WARNINGF("Found a traffic light signal on an unknown edge (original edge id='%').", e->id); continue; } } else { - if ((*j).orientation > 0) { + // traffic light on normal road + if (signal.orientation == 1) { + // forward direction has negative lane indices and gets a negative prefix in sumo id = "-" + id; } + NBEdge* edge = nb.getEdgeCont().retrieve(id); + if (edge == nullptr) { + WRITE_WARNINGF("Could not find edge '%' for signal '%'.", id, signal.id); + continue; + } + getTLSSecure(edge, nb); + /// XXX consider lane validity + for (NBEdge::Connection& c : edge->getConnections()) { + int odLane = laneIndexMap[std::make_pair(edge, c.fromLane)]; + if (signal.minLane == 0 || (signal.minLane <= odLane && signal.maxLane >= odLane)) { + c.setParameter("signalID", signal.id); + } + } + //std::cout << "odrEdge=" << e->id << " sumoID=" << (*k).sumoID << " sumoEdge=" << edge->getID() + // << " signal=" << signal.id << " minLane=" << signal.minLane << " maxLane=" << signal.maxLane << "\n"; } - tlsControlled[id] = (*j).name; - } - } - - for (std::map::iterator i = tlsControlled.begin(); i != tlsControlled.end(); ++i) { - std::string id = (*i).first; - if (id.find("->") != std::string::npos) { - id = id.substr(0, id.find("->")); - } - NBEdge* e = nb.getEdgeCont().retrieve(id); - if (e == nullptr) { - WRITE_WARNING("Could not find edge '" + id + "' while building its traffic light."); - continue; - } - NBNode* toNode = e->getToNode(); - if (!toNode->isTLControlled()) { - TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get(OptionsCont::getOptions().getString("tls.default-type")); - NBOwnTLDef* tlDef = new NBOwnTLDef(toNode->getID(), toNode, 0, type); - if (!nb.getTLLogicCont().insert(tlDef)) { - // actually, nothing should fail here - delete tlDef; - throw ProcessError(); - } - toNode->addTrafficLight(tlDef); - //tlDef->setSinglePhase(); + // @note: tls 'signalID' parameters are set via NBTrafficLightLogicCont::setOpenDriveSignalParameters } - NBTrafficLightDefinition* tlDef = *toNode->getControllingTLS().begin(); - tlDef->setParameter("connection:" + id, (*i).second); } // ------------------------- @@ -758,6 +839,39 @@ } } +std::pair +NIImporter_OpenDrive::retrieveSignalEdges(NBNetBuilder& nb, const std::string& fromID, const std::string& toID, const std::string& junction) { + NBEdge* from; + NBEdge* to; + from = nb.getEdgeCont().retrieve(fromID); + if (from == nullptr || from->getToNode()->getID() != junction) { + from = nb.getEdgeCont().retrieve(fromID[0] == '-' ? fromID.substr(1) : "-" + fromID); + } + to = nb.getEdgeCont().retrieve(toID); + if (to == nullptr || to->getFromNode()->getID() != junction) { + to = nb.getEdgeCont().retrieve(toID[0] == '-' ? toID.substr(1) : "-" + toID); + } + return std::make_pair(from, to); +} + + +NBTrafficLightDefinition* +NIImporter_OpenDrive::getTLSSecure(NBEdge* inEdge, NBNetBuilder& nb) { + NBNode* toNode = inEdge->getToNode(); + if (!toNode->isTLControlled()) { + TrafficLightType type = SUMOXMLDefinitions::TrafficLightTypes.get(OptionsCont::getOptions().getString("tls.default-type")); + NBOwnTLDef* tlDef = new NBOwnTLDef(toNode->getID(), toNode, 0, type); + if (!nb.getTLLogicCont().insert(tlDef)) { + // actually, nothing should fail here + delete tlDef; + throw ProcessError(); + } + toNode->addTrafficLight(tlDef); + //tlDef->setSinglePhase(); + } + return *toNode->getControllingTLS().begin(); +} + void NIImporter_OpenDrive::setLaneAttributes(const OpenDriveEdge* e, NBEdge::Lane& sumoLane, const OpenDriveLane& odLane, bool saveOrigIDs, const NBTypeCont& tc) { if (saveOrigIDs) { @@ -843,7 +957,20 @@ WRITE_WARNING("Circular connections in junction including roads '" + c.fromEdge + "' and '" + c.toEdge + "', loop size " + toString(seen.size())); } } else { - if (laneSectionsConnected(dest, c.toLane, (*i).fromLane)) { + int in = c.toLane; + int out = (*i).fromLane; + if (c.toCP == OPENDRIVE_CP_END) { + // inner edge runs in reverse direction + std::swap(in, out); + } +#ifdef DEBUG_CONNECTIONS + if (DEBUG_COND3(c.fromEdge)) { + std::cout << " laneSectionsConnected dest=" << dest->id << " in=" << in << " out=" << out + << " connected=" << laneSectionsConnected(dest, in, out) << "\n"; + } +#endif + + if (laneSectionsConnected(dest, in, out)) { Connection cn = (*i); cn.fromEdge = c.fromEdge; cn.fromLane = c.fromLane; @@ -997,6 +1124,7 @@ for (OpenDriveLane& lane : laneSection.lanesByDir.find(OPENDRIVE_TAG_RIGHT)->second) { if (lane.id == in) { in = lane.successor; + break; } } } @@ -1004,6 +1132,7 @@ for (OpenDriveLane& lane : laneSection.lanesByDir.find(OPENDRIVE_TAG_LEFT)->second) { if (lane.id == in) { in = lane.successor; + break; } } } @@ -1125,22 +1254,48 @@ void NIImporter_OpenDrive::setNodeSecure(NBNodeCont& nc, OpenDriveEdge& e, - const std::string& nodeID, NIImporter_OpenDrive::LinkType lt) { + const std::string& nodeID, NIImporter_OpenDrive::LinkType lt, std::vector& joinedNodeIDs) { NBNode* n = nc.retrieve(nodeID); if (n == nullptr) { throw ProcessError("Could not find node '" + nodeID + "'."); } + NBNode* toJoin = nullptr; if (lt == OPENDRIVE_LT_SUCCESSOR) { if (e.to != nullptr && e.to != n) { - throw ProcessError("Edge '" + e.id + "' has two end nodes ('" + e.to->getID() + "' and '" + nodeID + "')."); + toJoin = e.to; } e.to = n; } else { if (e.from != nullptr && e.from != n) { - throw ProcessError("Edge '" + e.id + "' has two start nodes ('" + e.from->getID() + "' and '" + nodeID + "')."); + toJoin = e.from; } e.from = n; } + if (toJoin != nullptr) { + // join nodes + NodeSet* set1 = nullptr; + NodeSet* set2 = nullptr; + for (NodeSet& joined : joinedNodeIDs) { + if (joined.count(toJoin) != 0) { + set1 = &joined; + } + if (joined.count(n) != 0) { + set2 = &joined; + } + } + if (set1 == nullptr && set2 == nullptr) { + joinedNodeIDs.push_back(NodeSet()); + joinedNodeIDs.back().insert(n); + joinedNodeIDs.back().insert(toJoin); + } else if (set1 == nullptr && set2 != nullptr) { + set2->insert(toJoin); + } else if (set1 != nullptr && set2 == nullptr) { + set1->insert(n); + } else { + set1->insert(set2->begin(), set2->end()); + joinedNodeIDs.erase(std::find(joinedNodeIDs.begin(), joinedNodeIDs.end(), *set2)); + } + } } bool @@ -1363,7 +1518,7 @@ try { double cDot = (curveEnd - curveStart) / g.length; if (cDot == 0 || g.length == 0) { - WRITE_WARNING("Could not compute spiral geometry for edge '" + e.id + "' (cDot=" + toString(cDot) + " length=" + toString(g.length) + ")."); + WRITE_WARNINGF("Could not compute spiral geometry for edge '%' (cDot=% length=%).", e.id, toString(cDot), toString(g.length)); ret.push_back(Position(g.x, g.y)); return ret; } @@ -1781,12 +1936,14 @@ bool ok = true; switch (element) { case OPENDRIVE_TAG_HEADER: { + /* int majorVersion = attrs.get(OPENDRIVE_ATTR_REVMAJOR, nullptr, ok); int minorVersion = attrs.get(OPENDRIVE_ATTR_REVMINOR, nullptr, ok); if (majorVersion != 1 || minorVersion != 2) { // TODO: leave note of exceptions WRITE_WARNING("Given openDrive file '" + getFileName() + "' uses version " + toString(majorVersion) + "." + toString(minorVersion) + ";\n Version 1.2 is supported."); } + */ } break; case OPENDRIVE_TAG_ROAD: { @@ -1940,10 +2097,29 @@ std::string id = attrs.get(OPENDRIVE_ATTR_ID, myCurrentEdge.id.c_str(), ok); std::string type = attrs.get(OPENDRIVE_ATTR_TYPE, myCurrentEdge.id.c_str(), ok); std::string name = attrs.getOpt(OPENDRIVE_ATTR_NAME, myCurrentEdge.id.c_str(), ok, "", false); - int orientation = attrs.get(OPENDRIVE_ATTR_ORIENTATION, myCurrentEdge.id.c_str(), ok) == "-" ? -1 : 1; + const std::string orientation = attrs.get(OPENDRIVE_ATTR_ORIENTATION, myCurrentEdge.id.c_str(), ok); + int orientationCode = orientation == "-" ? -1 : orientation == "+" ? 1 : 0; double s = attrs.get(OPENDRIVE_ATTR_S, myCurrentEdge.id.c_str(), ok); bool dynamic = attrs.get(OPENDRIVE_ATTR_DYNAMIC, myCurrentEdge.id.c_str(), ok) == "no" ? false : true; - myCurrentEdge.signals.push_back(OpenDriveSignal(id, type, name, orientation, dynamic, s)); + OpenDriveSignal signal = OpenDriveSignal(id, type, name, orientationCode, dynamic, s); + myCurrentEdge.signals.push_back(signal); + mySignals[id] = signal; + } + break; + case OPENDRIVE_TAG_SIGNALREFERENCE: { + std::string id = attrs.get(OPENDRIVE_ATTR_ID, myCurrentEdge.id.c_str(), ok); + const std::string orientation = attrs.get(OPENDRIVE_ATTR_ORIENTATION, myCurrentEdge.id.c_str(), ok); + int orientationCode = orientation == "-" ? -1 : orientation == "+" ? 1 : 0; + double s = attrs.get(OPENDRIVE_ATTR_S, myCurrentEdge.id.c_str(), ok); + OpenDriveSignal signal = OpenDriveSignal(id, "", "", orientationCode, false, s); + myCurrentEdge.signals.push_back(signal); + } + break; + case OPENDRIVE_TAG_VALIDITY: { + int fromLane = attrs.get(OPENDRIVE_ATTR_FROMLANE, myCurrentEdge.id.c_str(), ok); + int toLane = attrs.get(OPENDRIVE_ATTR_TOLANE, myCurrentEdge.id.c_str(), ok); + myCurrentEdge.signals.back().minLane = fromLane; + myCurrentEdge.signals.back().maxLane = toLane; } break; case OPENDRIVE_TAG_JUNCTION: @@ -2517,5 +2693,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenDrive.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenDrive.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenDrive.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenDrive.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for networks stored in openDrive format /****************************************************************************/ -#ifndef NIImporter_OpenDrive_h -#define NIImporter_OpenDrive_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -102,6 +96,8 @@ OPENDRIVE_TAG_RIGHT, OPENDRIVE_TAG_LANE, OPENDRIVE_TAG_SIGNAL, + OPENDRIVE_TAG_SIGNALREFERENCE, + OPENDRIVE_TAG_VALIDITY, OPENDRIVE_TAG_JUNCTION, OPENDRIVE_TAG_CONNECTION, OPENDRIVE_TAG_LANELINK, @@ -165,6 +161,8 @@ OPENDRIVE_ATTR_CONNECTINGROAD, OPENDRIVE_ATTR_FROM, OPENDRIVE_ATTR_TO, + OPENDRIVE_ATTR_FROMLANE, + OPENDRIVE_ATTR_TOLANE, OPENDRIVE_ATTR_MAX, OPENDRIVE_ATTR_SOFFSET, OPENDRIVE_ATTR_NAME, @@ -379,8 +377,15 @@ * @param[in] dynamicArg Whether the signal is dynamic * @param[in] sArg The offset from the start, counted from the begin */ - OpenDriveSignal(const std::string& idArg, const std::string typeArg, const std::string nameArg, int orientationArg, bool dynamicArg, double sArg) - : id(idArg), type(typeArg), name(nameArg), orientation(orientationArg), dynamic(dynamicArg), s(sArg) { } + OpenDriveSignal(const std::string& idArg, const std::string typeArg, const std::string nameArg, + int orientationArg, bool dynamicArg, double sArg) : + id(idArg), type(typeArg), name(nameArg), + orientation(orientationArg), dynamic(dynamicArg), s(sArg), + minLane(0), maxLane(0) + { } + + /// dummy constructor for use in maps + OpenDriveSignal() {} std::string id; std::string type; @@ -388,6 +393,9 @@ int orientation; bool dynamic; double s; + /// @brief signal validity range + int minLane; + int maxLane; }; @@ -565,7 +573,9 @@ void myEndElement(int element); //@} - + std::map& getSignals() { + return mySignals; + } private: void addLink(LinkType lt, const std::string& elementType, const std::string& elementID, @@ -587,6 +597,7 @@ std::string myCurrentConnectingRoad; ContactPoint myCurrentContactPoint; bool myConnectionWasEmpty; + std::map mySignals; static bool myImportAllTypes; static bool myImportWidths; @@ -637,9 +648,13 @@ static void revisitLaneSections(const NBTypeCont& tc, std::map& edges); static void setNodeSecure(NBNodeCont& nc, OpenDriveEdge& e, - const std::string& nodeID, NIImporter_OpenDrive::LinkType lt); + const std::string& nodeID, NIImporter_OpenDrive::LinkType lt, std::vector& joinedNodeIDs); + + static NBTrafficLightDefinition* getTLSSecure(NBEdge* inEdge, NBNetBuilder& nb); + static std::pair retrieveSignalEdges(NBNetBuilder& nb, const std::string& fromID, const std::string& toID, const std::string& junction); + static void splitMinWidths(OpenDriveEdge* e, const NBTypeCont& tc, double minDist); static void findWidthSplit(const NBTypeCont& tc, std::vector& lanes, @@ -663,9 +678,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -292,9 +287,9 @@ } n->node = node; if (n->railwayCrossing) { - node->reinit(pos, NODETYPE_RAIL_CROSSING); + node->reinit(pos, SumoXMLNodeType::RAIL_CROSSING); } else if (n->railwaySignal) { - node->reinit(pos, NODETYPE_RAIL_SIGNAL); + node->reinit(pos, SumoXMLNodeType::RAIL_SIGNAL); } else if (n->tlsControlled) { // ok, this node is a traffic light node where no other nodes // participate @@ -460,7 +455,11 @@ if (e->myMaxSpeed != MAXSPEED_UNGIVEN) { speed = e->myMaxSpeed / 3.6; } - if (speed <= 0) { + double speedBackward = speed; + if (e->myMaxSpeedBackward != MAXSPEED_UNGIVEN) { + speedBackward = e->myMaxSpeedBackward / 3.6; + } + if (speed <= 0 || speedBackward <= 0) { WRITE_WARNINGF("Skipping edge '%' because it has speed %.", id, speed); ok = false; } @@ -520,7 +519,7 @@ if (ok) { const int offsetFactor = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; LaneSpreadFunction lsf = (addBackward || OptionsCont::getOptions().getBool("osm.oneway-spread-right")) && - e->myRailDirection == WAY_UNKNOWN ? LANESPREAD_RIGHT : LANESPREAD_CENTER; + e->myRailDirection == WAY_UNKNOWN ? LaneSpreadFunction::RIGHT : LaneSpreadFunction::CENTER; id = StringUtils::escapeXML(id); const std::string reverseID = "-" + id; @@ -552,7 +551,7 @@ } if (addBackward) { assert(numLanesBackward > 0); - NBEdge* nbe = new NBEdge(reverseID, to, from, type, speed, numLanesBackward, tc.getPriority(type), + NBEdge* nbe = new NBEdge(reverseID, to, from, type, speedBackward, numLanesBackward, tc.getPriority(type), backwardWidth, NBEdge::UNSPECIFIED_OFFSET, shape.reverse(), StringUtils::escapeXML(streetName), origID, lsf, true); nbe->setPermissions(backwardPermissions); @@ -920,6 +919,7 @@ // we check whether the key is relevant (and we really need to transcode the value) to avoid hitting #1636 if (!StringUtils::endsWith(key, "way") && !StringUtils::startsWith(key, "lanes") && key != "maxspeed" && key != "maxspeed:type" + && key != "maxspeed:forward" && key != "maxspeed:backward" && key != "junction" && key != "name" && key != "tracks" && key != "layer" && key != "route" && key != "sidewalk" @@ -1042,25 +1042,11 @@ toString(myCurrentEdge->id) + "'."); } } else if (myCurrentEdge->myMaxSpeed == MAXSPEED_UNGIVEN && - (key == "maxspeed" || key == "maxspeed:type")) { + (key == "maxspeed" || key == "maxspeed:type" || key == "maxspeed:forward")) { // both 'maxspeed' and 'maxspeed:type' may be given so we must take care not to overwrite an already seen value - if (mySpeedMap.find(value) != mySpeedMap.end()) { - myCurrentEdge->myMaxSpeed = mySpeedMap[value]; - } else { - double conversion = 1; // OSM default is km/h - if (StringUtils::to_lower_case(value).find("km/h") != std::string::npos) { - value = StringUtils::prune(value.substr(0, value.find_first_not_of("0123456789"))); - } else if (StringUtils::to_lower_case(value).find("mph") != std::string::npos) { - value = StringUtils::prune(value.substr(0, value.find_first_not_of("0123456789"))); - conversion = KM_PER_MILE; - } - try { - myCurrentEdge->myMaxSpeed = StringUtils::toDouble(value) * conversion; - } catch (...) { - WRITE_WARNING("Value of key '" + key + "' is not numeric ('" + value + "') in edge '" + - toString(myCurrentEdge->id) + "'."); - } - } + myCurrentEdge->myMaxSpeed = interpretSpeed(key, value); + } else if (key == "maxspeed:backward" && myCurrentEdge->myMaxSpeedBackward == MAXSPEED_UNGIVEN) { + myCurrentEdge->myMaxSpeedBackward = interpretSpeed(key, value); } else if (key == "junction") { if ((value == "roundabout") && (myCurrentEdge->myIsOneWay.empty())) { myCurrentEdge->myIsOneWay = "yes"; @@ -1123,6 +1109,30 @@ } } + +double +NIImporter_OpenStreetMap::EdgesHandler::interpretSpeed(const std::string& key, std::string value) { + if (mySpeedMap.find(value) != mySpeedMap.end()) { + return mySpeedMap[value]; + } else { + double conversion = 1; // OSM default is km/h + if (StringUtils::to_lower_case(value).find("km/h") != std::string::npos) { + value = StringUtils::prune(value.substr(0, value.find_first_not_of("0123456789"))); + } else if (StringUtils::to_lower_case(value).find("mph") != std::string::npos) { + value = StringUtils::prune(value.substr(0, value.find_first_not_of("0123456789"))); + conversion = KM_PER_MILE; + } + try { + return StringUtils::toDouble(value) * conversion; + } catch (...) { + WRITE_WARNING("Value of key '" + key + "' is not numeric ('" + value + "') in edge '" + + toString(myCurrentEdge->id) + "'."); + return MAXSPEED_UNGIVEN; + } + } +} + + void NIImporter_OpenStreetMap::EdgesHandler::myEndElement(int element) { myParentElements.pop_back(); @@ -1407,8 +1417,14 @@ } ptStop->setIsMultipleStopPositions(myStops.size() > 1); } - } else if (myPTRouteType != "" && myIsRoute && OptionsCont::getOptions().isSet("ptline-output") && myStops.size() > 1) { + } else if (myPTRouteType != "" && myIsRoute && OptionsCont::getOptions().isSet("ptline-output")) { NBPTLine* ptLine = new NBPTLine(toString(myCurrentRelation), myName, myPTRouteType, myRef, myInterval, myNightService, interpretTransportType(myPTRouteType)); + if (myStops.size() == 0 && myPlatforms.size() != 0) { + WRITE_WARNINGF("PT line in relation % with is defined with platform members instead of stops. Stop location accuracy may be reduced.", myCurrentRelation); + for (NIIPTPlatform& p : myPlatforms) { + myStops.push_back(p.ref); + } + } ptLine->setMyNumOfStops((int)myStops.size()); for (long long ref : myStops) { if (myOSMNodes.find(ref) == myOSMNodes.end()) { @@ -1844,15 +1860,13 @@ std::vector nodes; std::vector usablePositions; std::vector usableIndex; - int i = 0; for (long long int n : e->myCurrentNodes) { NIOSMNode* node = myOSMNodes[n]; node->positionMeters = interpretDistance(node); if (node->positionMeters != std::numeric_limits::max()) { usablePositions.push_back(node->positionMeters); - usableIndex.push_back(i); + usableIndex.push_back((int)nodes.size()); } - i++; nodes.push_back(node); } if (usablePositions.size() == 0) { @@ -1921,24 +1935,27 @@ SUMOVehicleClass NIImporter_OpenStreetMap::interpretTransportType(const std::string& type, NIOSMNode* toSet) { SUMOVehicleClass result = SVC_IGNORING; - std::string stop = type; if (type == "train") { result = SVC_RAIL; } else if (type == "subway" || type == "light_rail") { result = SVC_RAIL_URBAN; - stop = "train"; - } else if (type == "bus") { - result = SVC_BUS; - } else if (type == "tram") { - result = SVC_TRAM; + } else if (SumoVehicleClassStrings.hasString(type)) { + result = SumoVehicleClassStrings.get(type); + } + std::string stop = ""; + if (result == SVC_TRAM) { + stop = ".tram"; + } else if (result == SVC_BUS) { + stop = ".bus"; + } else if (isRailway(result)) { + stop = ".train"; } if (toSet != nullptr && result != SVC_IGNORING) { toSet->permissions |= result; - toSet->ptStopLength = OptionsCont::getOptions().getFloat("osm.stop-output.length." + stop); + toSet->ptStopLength = OptionsCont::getOptions().getFloat("osm.stop-output.length" + stop); } return result; } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_OpenStreetMap.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Importer for networks stored in OpenStreetMap format /****************************************************************************/ -#ifndef NIImporter_OpenStreetMap_h -#define NIImporter_OpenStreetMap_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -164,7 +158,9 @@ explicit Edge(long long int _id) : - id(_id), myNoLanes(-1), myNoLanesForward(0), myMaxSpeed(MAXSPEED_UNGIVEN), + id(_id), myNoLanes(-1), myNoLanesForward(0), + myMaxSpeed(MAXSPEED_UNGIVEN), + myMaxSpeedBackward(MAXSPEED_UNGIVEN), myCyclewayType(WAY_UNKNOWN), // building of extra lane depends on bikelaneWidth of loaded typemap myBuswayType(WAY_NONE), // buslanes are always built when declared mySidewalkType(WAY_UNKNOWN), // building of extra lanes depends on sidewalkWidth of loaded typemap @@ -189,6 +185,8 @@ int myNoLanesForward; /// @brief maximum speed in km/h, or MAXSPEED_UNGIVEN double myMaxSpeed; + /// @brief maximum speed in km/h, or MAXSPEED_UNGIVEN + double myMaxSpeedBackward; /// @brief The type, stored in "highway" key std::string myHighWayType; /// @brief Information whether this is an one-way road @@ -445,6 +443,7 @@ void myEndElement(int element) override; //@} + double interpretSpeed(const std::string& key, std::string value); private: /// @brief The previously parsed nodes @@ -632,9 +631,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_RobocupRescue.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_RobocupRescue.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_RobocupRescue.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_RobocupRescue.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,211 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 NIImporter_RobocupRescue.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Mon, 14.04.2008 -/// -// Importer for networks stored in robocup rescue league format -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "NILoader.h" -#include "NIImporter_RobocupRescue.h" - - -// =========================================================================== -// method definitions -// =========================================================================== -// --------------------------------------------------------------------------- -// static methods (interface in this case) -// --------------------------------------------------------------------------- -void -NIImporter_RobocupRescue::loadNetwork(const OptionsCont& oc, NBNetBuilder& nb) { - // check whether the option is set (properly) - if (!oc.isSet("robocup-dir")) { - return; - } - // build the handler - NIImporter_RobocupRescue handler(nb.getNodeCont(), nb.getEdgeCont()); - // parse file(s) - std::vector files = oc.getStringVector("robocup-dir"); - for (std::vector::const_iterator file = files.begin(); file != files.end(); ++file) { - // nodes - std::string nodesName = (*file) + "/node.bin"; - if (!FileHelpers::isReadable(nodesName)) { - WRITE_ERROR("Could not open robocup-node-file '" + nodesName + "'."); - return; - } - PROGRESS_BEGIN_MESSAGE("Parsing robocup-nodes from '" + nodesName + "'"); - handler.loadNodes(nodesName); - PROGRESS_DONE_MESSAGE(); - // edges - std::string edgesName = (*file) + "/road.bin"; - if (!FileHelpers::isReadable(edgesName)) { - WRITE_ERROR("Could not open robocup-road-file '" + edgesName + "'."); - return; - } - PROGRESS_BEGIN_MESSAGE("Parsing robocup-roads from '" + edgesName + "'"); - handler.loadEdges(edgesName); - PROGRESS_DONE_MESSAGE(); - } -} - - - -// --------------------------------------------------------------------------- -// loader methods -// --------------------------------------------------------------------------- -NIImporter_RobocupRescue::NIImporter_RobocupRescue(NBNodeCont& nc, NBEdgeCont& ec) - : myNodeCont(nc), myEdgeCont(ec) {} - - -NIImporter_RobocupRescue::~NIImporter_RobocupRescue() { -} - - -void -NIImporter_RobocupRescue::loadNodes(const std::string& file) { - BinaryInputDevice dev(file); - int skip; - dev >> skip; // the number in 19_s - dev >> skip; // x-offset in 19_s - dev >> skip; // y-offset in 19_s - // - int noNodes; - dev >> noNodes; - WRITE_MESSAGE("Expected node number: " + toString(noNodes)); - do { - //cout << " left " << (noNodes) << endl; - int entrySize, id, posX, posY, numEdges; - dev >> entrySize; - entrySize /= 4; - dev >> id; - dev >> posX; - dev >> posY; - dev >> numEdges; - - std::vector edges; - for (int j = 0; j < numEdges; ++j) { - int edge; - dev >> edge; - edges.push_back(edge); - } - - int signal; - dev >> signal; - - std::vector turns; - for (int j = 0; j < numEdges; ++j) { - int turn; - dev >> turn; - turns.push_back(turn); - } - - std::vector > conns; - for (int j = 0; j < numEdges; ++j) { - int connF, connT; - dev >> connF; - dev >> connT; - conns.push_back(std::pair(connF, connT)); - } - - std::vector > times; - for (int j = 0; j < numEdges; ++j) { - int t1, t2, t3; - dev >> t1; - dev >> t2; - dev >> t3; - std::vector time; - time.push_back(t1); - time.push_back(t2); - time.push_back(t3); - times.push_back(time); - } - - Position pos((double)(posX / 1000.), -(double)(posY / 1000.)); - NBNetBuilder::transformCoordinate(pos); - NBNode* node = new NBNode(toString(id), pos); - myNodeCont.insert(node); - --noNodes; - } while (noNodes != 0); -} - - -void -NIImporter_RobocupRescue::loadEdges(const std::string& file) { - BinaryInputDevice dev(file); - int skip; - dev >> skip; // the number in 19_s - dev >> skip; // x-offset in 19_s - dev >> skip; // y-offset in 19_s - // - int noEdges; - dev >> noEdges; - std::cout << "Expected edge number: " << noEdges << std::endl; - do { - std::cout << " left " << (noEdges) << std::endl; - int entrySize, id, begNode, endNode, length, roadKind, carsToHead, - carsToTail, humansToHead, humansToTail, width, block, repairCost, median, - linesToHead, linesToTail, widthForWalkers; - dev >> entrySize >> id >> begNode >> endNode >> length >> roadKind >> carsToHead - >> carsToTail >> humansToHead >> humansToTail >> width >> block >> repairCost - >> median >> linesToHead >> linesToTail >> widthForWalkers; - NBNode* fromNode = myNodeCont.retrieve(toString(begNode)); - NBNode* toNode = myNodeCont.retrieve(toString(endNode)); - double speed = (double)(50. / 3.6); - int priority = -1; - LaneSpreadFunction spread = linesToHead > 0 && linesToTail > 0 ? LANESPREAD_RIGHT : LANESPREAD_CENTER; - if (linesToHead > 0) { - NBEdge* edge = new NBEdge(toString(id), fromNode, toNode, "", speed, linesToHead, priority, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, "", spread); - if (!myEdgeCont.insert(edge)) { - WRITE_ERROR("Could not insert edge '" + toString(id) + "'"); - } - } - if (linesToTail > 0) { - NBEdge* edge = new NBEdge("-" + toString(id), toNode, fromNode, "", speed, linesToTail, priority, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, "", spread); - if (!myEdgeCont.insert(edge)) { - WRITE_ERROR("Could not insert edge '-" + toString(id) + "'"); - } - } - --noEdges; - } while (noEdges != 0); -} - - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_RobocupRescue.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_RobocupRescue.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_RobocupRescue.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_RobocupRescue.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,106 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 NIImporter_RobocupRescue.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date Mon, 14.04.2008 -/// -// Importer for networks stored in robocup rescue league format -/****************************************************************************/ -#ifndef NIImporter_RobocupRescue_h -#define NIImporter_RobocupRescue_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include - - -// =========================================================================== -// class declarations -// =========================================================================== -class NBNetBuilder; -class NBEdge; -class OptionsCont; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class NIImporter_RobocupRescue - * @brief Importer for networks stored in robocup rescue league format - * - */ -class NIImporter_RobocupRescue { -public: - /** @brief Loads content of the optionally given RoboCup Rescue League files - * - * If the option "robocup-dir" is set, the files contained in the folder are read. - * - * If the option "robocup-dir" is not set, this method simply returns. - * - * @param[in] oc The options to use - * @param[in] nb The network builder to fill - */ - static void loadNetwork(const OptionsCont& oc, NBNetBuilder& nb); - - -protected: - /** @brief Constructor - * - * @param[in] nc The node control to fill - * @param[in] ec The edge control to fill - */ - NIImporter_RobocupRescue(NBNodeCont& nc, NBEdgeCont& ec); - - - /// @brief Destructor - ~NIImporter_RobocupRescue(); - - - /** @brief Loads nodes from the given file - * @param[in] file The file to read nodes from - */ - void loadNodes(const std::string& file); - - - /** @brief Loads edges from the given file - * @param[in] file The file to read edges from - */ - void loadEdges(const std::string& file); - - -protected: - /// @brief The node container to fill - NBNodeCont& myNodeCont; - - /// @brief The edge container to fill - NBEdgeCont& myEdgeCont; - -private: - /// @brief Invalidated assignment operator - NIImporter_RobocupRescue& operator=(const NIImporter_RobocupRescue& s); -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_SUMO.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_SUMO.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_SUMO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_SUMO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Importer for networks stored in SUMO format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -87,7 +82,8 @@ myLimitTurnSpeed(-1), myCheckLaneFoesAll(false), myCheckLaneFoesRoundabout(true), - myTlsIgnoreInternalJunctionJam(false) { + myTlsIgnoreInternalJunctionJam(false), + myDefaultSpreadType(toString(LaneSpreadFunction::RIGHT)) { } @@ -127,7 +123,7 @@ for (std::map::const_iterator i = myEdges.begin(); i != myEdges.end(); ++i) { EdgeAttrs* ed = (*i).second; // skip internal edges - if (ed->func == EDGEFUNC_INTERNAL || ed->func == EDGEFUNC_CROSSING || ed->func == EDGEFUNC_WALKINGAREA) { + if (ed->func == SumoXMLEdgeFunc::INTERNAL || ed->func == SumoXMLEdgeFunc::CROSSING || ed->func == SumoXMLEdgeFunc::WALKINGAREA) { continue; } // get and check the nodes @@ -194,18 +190,18 @@ continue; } if (nbe->hasConnectionTo(toEdge, c.toLaneIdx)) { - WRITE_WARNING("Target lane '" + toEdge->getLaneID(c.toLaneIdx) + "' has multiple connections from '" + nbe->getID() + "'."); + WRITE_WARNINGF("Target lane '%' has multiple connections from '%'.", toEdge->getLaneID(c.toLaneIdx), nbe->getID()); } // patch attribute uncontrolled for legacy networks where it is not set explicitly bool uncontrolled = c.uncontrolled; - if ((NBNode::isTrafficLight(toType) || toType == NODETYPE_RAIL_SIGNAL) + if ((NBNode::isTrafficLight(toType) || toType == SumoXMLNodeType::RAIL_SIGNAL) && c.tlLinkIndex == NBConnection::InvalidTlIndex) { uncontrolled = true; } nbe->addLane2LaneConnection( fromLaneIndex, toEdge, c.toLaneIdx, NBEdge::L2L_VALIDATED, - true, c.mayDefinitelyPass, c.keepClear, c.contPos, c.visibility, c.speed, c.customShape, uncontrolled, c.permissions); + true, c.mayDefinitelyPass, c.keepClear, c.contPos, c.visibility, c.speed, c.customLength, c.customShape, uncontrolled, c.permissions); if (c.getParametersMap().size() > 0) { nbe->getConnectionRef(fromLaneIndex, toEdge, c.toLaneIdx).updateParameters(c.getParametersMap()); } @@ -279,13 +275,13 @@ NBEdge* prohibitorFrom = myEdges[it->prohibitorFrom]->builtEdge; NBEdge* prohibitorTo = myEdges[it->prohibitorTo]->builtEdge; if (prohibitedFrom == nullptr) { - WRITE_WARNING("Edge '" + it->prohibitedFrom + "' in prohibition was not built"); + WRITE_WARNINGF("Edge '%' in prohibition was not built.", it->prohibitedFrom); } else if (prohibitedTo == nullptr) { - WRITE_WARNING("Edge '" + it->prohibitedTo + "' in prohibition was not built"); + WRITE_WARNINGF("Edge '%' in prohibition was not built.", it->prohibitedTo); } else if (prohibitorFrom == nullptr) { - WRITE_WARNING("Edge '" + it->prohibitorFrom + "' in prohibition was not built"); + WRITE_WARNINGF("Edge '%' in prohibition was not built.", it->prohibitorFrom); } else if (prohibitorTo == nullptr) { - WRITE_WARNING("Edge '" + it->prohibitorTo + "' in prohibition was not built"); + WRITE_WARNINGF("Edge '%' in prohibition was not built.", it->prohibitorTo); } else { NBNode* n = prohibitedFrom->getToNode(); n->addSortedLinkFoes( @@ -323,6 +319,9 @@ if (oc.isDefault("tls.ignore-internal-junction-jam") && oc.getBool("tls.ignore-internal-junction-jam") != myTlsIgnoreInternalJunctionJam) { oc.set("tls.ignore-internal-junction-jam", toString(myTlsIgnoreInternalJunctionJam)); } + if (oc.isDefault("default.spreadtype") && oc.getString("default.spreadtype") != myDefaultSpreadType) { + oc.set("default.spreadtype", myDefaultSpreadType); + } if (!deprecatedVehicleClassesSeen.empty()) { WRITE_WARNING("Deprecated vehicle class(es) '" + toString(deprecatedVehicleClassesSeen) + "' in input network."); deprecatedVehicleClassesSeen.clear(); @@ -425,6 +424,8 @@ myCheckLaneFoesAll = attrs.getOpt(SUMO_ATTR_CHECKLANEFOES_ALL, nullptr, ok, false); myCheckLaneFoesRoundabout = attrs.getOpt(SUMO_ATTR_CHECKLANEFOES_ROUNDABOUT, nullptr, ok, true); myTlsIgnoreInternalJunctionJam = attrs.getOpt(SUMO_ATTR_TLS_IGNORE_INTERNAL_JUNCTION_JAM, nullptr, ok, false); + myDefaultSpreadType = attrs.getOpt(SUMO_ATTR_SPREADTYPE, nullptr, ok, myDefaultSpreadType); + break; } case SUMO_TAG_EDGE: @@ -549,13 +550,13 @@ myCurrentEdge->id = id; // get the function myCurrentEdge->func = attrs.getEdgeFunc(ok); - if (myCurrentEdge->func == EDGEFUNC_CROSSING) { + if (myCurrentEdge->func == SumoXMLEdgeFunc::CROSSING) { // add the crossing but don't do anything else Crossing c(id); c.crossingEdges = attrs.get >(SUMO_ATTR_CROSSING_EDGES, nullptr, ok); myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(id)].push_back(c); return; - } else if (myCurrentEdge->func == EDGEFUNC_INTERNAL || myCurrentEdge->func == EDGEFUNC_WALKINGAREA) { + } else if (myCurrentEdge->func == SumoXMLEdgeFunc::INTERNAL || myCurrentEdge->func == SumoXMLEdgeFunc::WALKINGAREA) { myHaveSeenInternalEdge = true; return; // skip internal edges } @@ -576,8 +577,7 @@ OptionsCont::getOptions().set("output.street-names", "true"); } - std::string lsfS = toString(LANESPREAD_RIGHT); - lsfS = attrs.getOpt(SUMO_ATTR_SPREADTYPE, id.c_str(), ok, lsfS); + std::string lsfS = attrs.getOpt(SUMO_ATTR_SPREADTYPE, id.c_str(), ok, myDefaultSpreadType); if (SUMOXMLDefinitions::LaneSpreadFunctions.hasString(lsfS)) { myCurrentEdge->lsf = SUMOXMLDefinitions::LaneSpreadFunctions.get(lsfS); } else { @@ -606,7 +606,7 @@ myCurrentLane->customShape = attrs.getOpt(SUMO_ATTR_CUSTOMSHAPE, nullptr, ok, false); myCurrentLane->shape = attrs.get(SUMO_ATTR_SHAPE, id.c_str(), ok); myCurrentLane->type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, ""); - if (myCurrentEdge->func == EDGEFUNC_CROSSING) { + if (myCurrentEdge->func == SumoXMLEdgeFunc::CROSSING) { // save the width and the lane id of the crossing but don't do anything else std::vector& crossings = myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(myCurrentEdge->id)]; assert(crossings.size() > 0); @@ -615,7 +615,7 @@ crossings.back().customShape = myCurrentLane->shape; NBNetBuilder::transformCoordinates(crossings.back().customShape, true, myLocation); } - } else if (myCurrentEdge->func == EDGEFUNC_WALKINGAREA) { + } else if (myCurrentEdge->func == SumoXMLEdgeFunc::WALKINGAREA) { // save custom shape if needed but don't do anything else if (myCurrentLane->customShape) { WalkingAreaParsedCustomShape wacs; @@ -624,7 +624,7 @@ myWACustomShapes[myCurrentEdge->id] = wacs; } return; - } else if (myCurrentEdge->func == EDGEFUNC_INTERNAL) { + } else if (myCurrentEdge->func == SumoXMLEdgeFunc::INTERNAL) { return; // skip internal edges } if (attrs.hasAttribute("maxspeed")) { @@ -694,10 +694,10 @@ } SumoXMLNodeType type = attrs.getNodeType(ok); if (ok) { - if (type == NODETYPE_DEAD_END_DEPRECATED || type == NODETYPE_DEAD_END) { + if (type == SumoXMLNodeType::DEAD_END_DEPRECATED || type == SumoXMLNodeType::DEAD_END) { // dead end is a computed status. Reset this to unknown so it will // be corrected if additional connections are loaded - type = NODETYPE_UNKNOWN; + type = SumoXMLNodeType::UNKNOWN; } } else { WRITE_WARNING("Unknown node type for junction '" + id + "'."); @@ -723,7 +723,7 @@ NBNetBuilder::transformCoordinates(shape); node->setCustomShape(shape); } - if (type == NODETYPE_RAIL_SIGNAL || type == NODETYPE_RAIL_CROSSING) { + if (type == SumoXMLNodeType::RAIL_SIGNAL || type == SumoXMLNodeType::RAIL_CROSSING) { // both types of nodes come without a tlLogic myRailSignals.insert(id); } @@ -733,6 +733,9 @@ if (attrs.hasAttribute(SUMO_ATTR_FRINGE)) { node->setFringeType(attrs.getFringeType(ok)); } + if (attrs.hasAttribute(SUMO_ATTR_NAME)) { + node->setName(attrs.get(SUMO_ATTR_NAME, id.c_str(), ok)); + } } @@ -771,6 +774,7 @@ conn.permissions = parseVehicleClasses(allow, disallow, myNetworkVersion); } conn.speed = attrs.getOpt(SUMO_ATTR_SPEED, nullptr, ok, NBEdge::UNSPECIFIED_SPEED); + conn.customLength = attrs.getOpt(SUMO_ATTR_LENGTH, nullptr, ok, NBEdge::UNSPECIFIED_LOADED_LENGTH); conn.customShape = attrs.getOpt(SUMO_ATTR_SHAPE, nullptr, ok, PositionVector::EMPTY); NBNetBuilder::transformCoordinates(conn.customShape, false, myLocation); conn.uncontrolled = attrs.getOpt(SUMO_ATTR_UNCONTROLLED, nullptr, ok, NBEdge::UNSPECIFIED_CONNECTION_UNCONTROLLED, false); @@ -789,7 +793,7 @@ // determine crossing priority and tlIndex if (myPedestrianCrossings.size() > 0) { - if (from->func == EDGEFUNC_WALKINGAREA && myEdges[conn.toEdgeID]->func == EDGEFUNC_CROSSING) { + if (from->func == SumoXMLEdgeFunc::WALKINGAREA && myEdges[conn.toEdgeID]->func == SumoXMLEdgeFunc::CROSSING) { // connection from walkingArea to crossing std::vector& crossings = myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(fromID)]; for (std::vector::iterator it = crossings.begin(); it != crossings.end(); ++it) { @@ -803,7 +807,7 @@ } } } - } else if (from->func == EDGEFUNC_CROSSING && myEdges[conn.toEdgeID]->func == EDGEFUNC_WALKINGAREA) { + } else if (from->func == SumoXMLEdgeFunc::CROSSING && myEdges[conn.toEdgeID]->func == SumoXMLEdgeFunc::WALKINGAREA) { // connection from crossing to walkingArea (set optional linkIndex2) for (Crossing& c : myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(fromID)]) { if (fromID == c.edgeID) { @@ -815,13 +819,13 @@ // determine walking area reference edges if (myWACustomShapes.size() > 0) { EdgeAttrs* to = myEdges[conn.toEdgeID]; - if (from->func == EDGEFUNC_WALKINGAREA) { + if (from->func == SumoXMLEdgeFunc::WALKINGAREA) { std::map::iterator it = myWACustomShapes.find(fromID); if (it != myWACustomShapes.end()) { - if (to->func == EDGEFUNC_NORMAL) { + if (to->func == SumoXMLEdgeFunc::NORMAL) { // add target sidewalk as reference it->second.toEdges.push_back(conn.toEdgeID); - } else if (to->func == EDGEFUNC_CROSSING) { + } else if (to->func == SumoXMLEdgeFunc::CROSSING) { // add target crossing edges as reference for (Crossing crossing : myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(fromID)]) { if (conn.toEdgeID == crossing.edgeID) { @@ -830,13 +834,13 @@ } } } - } else if (to->func == EDGEFUNC_WALKINGAREA) { + } else if (to->func == SumoXMLEdgeFunc::WALKINGAREA) { std::map::iterator it = myWACustomShapes.find(conn.toEdgeID); if (it != myWACustomShapes.end()) { - if (from->func == EDGEFUNC_NORMAL) { + if (from->func == SumoXMLEdgeFunc::NORMAL) { // add origin sidewalk as reference it->second.fromEdges.push_back(fromID); - } else if (from->func == EDGEFUNC_CROSSING) { + } else if (from->func == SumoXMLEdgeFunc::CROSSING) { // add origin crossing edges as reference for (Crossing crossing : myPedestrianCrossings[SUMOXMLDefinitions::getJunctionIDFromInternalEdge(fromID)]) { if (fromID == crossing.edgeID) { diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_SUMO.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_SUMO.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_SUMO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_SUMO.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for networks stored in SUMO format /****************************************************************************/ -#ifndef NIImporter_SUMO_h -#define NIImporter_SUMO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -199,6 +193,8 @@ SVCPermissions permissions; /// @brief custom speed for connection double speed; + /// @brief custom length for connection + double customLength; /// @brief custom shape connection PositionVector customShape; /// @brief if set to true, This connection will not be TLS-controlled despite its node being controlled. @@ -393,6 +389,7 @@ bool myCheckLaneFoesRoundabout; /// @brief whether some right-of-way checks at traffic light junctions should be disabled bool myTlsIgnoreInternalJunctionJam; + std::string myDefaultSpreadType; /// @brief loaded roundabout edges std::vector > myRoundabouts; @@ -417,9 +414,3 @@ */ void parseProhibitionConnection(const std::string& attr, std::string& from, std::string& to, bool& ok); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_VISUM.cpp sumo-1.6.0+dfsg1/src/netimport/NIImporter_VISUM.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_VISUM.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_VISUM.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A VISUM network importer /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -424,7 +419,7 @@ NBEdge* previous = myNetBuilder.getEdgeCont().retrieve(myCurrentID); if (previous != nullptr) { myCurrentID = '-' + myCurrentID; - previous->setLaneSpreadFunction(LANESPREAD_RIGHT); + previous->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); oneway_checked = false; } if (find(myTouchedEdges.begin(), myTouchedEdges.end(), myCurrentID) != myTouchedEdges.end()) { @@ -434,7 +429,7 @@ if (find(myTouchedEdges.begin(), myTouchedEdges.end(), tmpid) != myTouchedEdges.end()) { previous = myNetBuilder.getEdgeCont().retrieve(tmpid); if (previous != nullptr) { - previous->setLaneSpreadFunction(LANESPREAD_RIGHT); + previous->setLaneSpreadFunction(LaneSpreadFunction::RIGHT); } oneway_checked = false; } @@ -442,7 +437,7 @@ const SVCPermissions permissions = getPermissions(KEYS.getString(VISUM_TYPES), false, myNetBuilder.getTypeCont().getPermissions(type)); int prio = myUseVisumPrio ? myNetBuilder.getTypeCont().getPriority(type) : -1; if (nolanes != 0 && speed != 0) { - LaneSpreadFunction lsf = oneway_checked ? LANESPREAD_CENTER : LANESPREAD_RIGHT; + LaneSpreadFunction lsf = oneway_checked ? LaneSpreadFunction::CENTER : LaneSpreadFunction::RIGHT; // @todo parse name from visum files NBEdge* e = new NBEdge(myCurrentID, from, to, type, speed, nolanes, prio, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, "", lsf); @@ -460,7 +455,7 @@ // add the opposite edge myCurrentID = '-' + myCurrentID; if (nolanes != 0 && speed != 0) { - LaneSpreadFunction lsf = oneway_checked ? LANESPREAD_CENTER : LANESPREAD_RIGHT; + LaneSpreadFunction lsf = oneway_checked ? LaneSpreadFunction::CENTER : LaneSpreadFunction::RIGHT; // @todo parse name from visum files NBEdge* e = new NBEdge(myCurrentID, from, to, type, speed, nolanes, prio, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, "", lsf); @@ -583,7 +578,7 @@ OptionsCont::getOptions().getFloat("visum.connector-speeds"), OptionsCont::getOptions().getInt("visum.connectors-lane-number"), -1, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, - "", LANESPREAD_RIGHT); + "", LaneSpreadFunction::RIGHT); edge->setAsMacroscopicConnector(); if (!myNetBuilder.getEdgeCont().insert(edge)) { WRITE_ERROR("A duplicate edge id occurred (ID='" + id + "')."); @@ -618,7 +613,7 @@ OptionsCont::getOptions().getFloat("visum.connector-speeds"), OptionsCont::getOptions().getInt("visum.connectors-lane-number"), -1, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, - "", LANESPREAD_RIGHT); + "", LaneSpreadFunction::RIGHT); edge->setAsMacroscopicConnector(); if (!myNetBuilder.getEdgeCont().insert(edge)) { WRITE_ERROR("A duplicate edge id occurred (ID='" + id + "')."); @@ -1513,4 +1508,5 @@ } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIImporter_VISUM.h sumo-1.6.0+dfsg1/src/netimport/NIImporter_VISUM.h --- sumo-1.5.0+dfsg1/src/netimport/NIImporter_VISUM.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIImporter_VISUM.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A VISUM network importer /****************************************************************************/ -#ifndef NIImporter_VISUM_h -#define NIImporter_VISUM_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -579,8 +573,3 @@ void loadLanguage(const std::string& file); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NILoader.cpp sumo-1.6.0+dfsg1/src/netimport/NILoader.cpp --- sumo-1.5.0+dfsg1/src/netimport/NILoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NILoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Perfoms network import /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -55,7 +50,6 @@ #include #include #include -#include #include #include #include @@ -93,7 +87,6 @@ NBHeightMapper::loadIfSet(oc); // try to load using different methods NIImporter_SUMO::loadNetwork(oc, myNetBuilder); - NIImporter_RobocupRescue::loadNetwork(oc, myNetBuilder); NIImporter_OpenStreetMap::loadNetwork(oc, myNetBuilder); NIImporter_VISUM::loadNetwork(oc, myNetBuilder); NIImporter_ArcView::loadNetwork(oc, myNetBuilder); @@ -121,6 +114,9 @@ if (myNetBuilder.getEdgeCont().size() == 0) { throw ProcessError("No edges loaded."); } + if (!myNetBuilder.getEdgeCont().checkConsistency(myNetBuilder.getNodeCont())) { + throw ProcessError(); + } // report loaded structures WRITE_MESSAGE(" Import done:"); if (myNetBuilder.getDistrictCont().size() > 0) { @@ -209,4 +205,5 @@ return ok; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NILoader.h sumo-1.6.0+dfsg1/src/netimport/NILoader.h --- sumo-1.5.0+dfsg1/src/netimport/NILoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NILoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Perfoms network import /****************************************************************************/ -#ifndef NILoader_h -#define NILoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -89,9 +83,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NINavTeqHelper.cpp sumo-1.6.0+dfsg1/src/netimport/NINavTeqHelper.cpp --- sumo-1.5.0+dfsg1/src/netimport/NINavTeqHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NINavTeqHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "NINavTeqHelper.h" @@ -211,5 +206,6 @@ e.allowVehicleClass(-1, SVC_PEDESTRIAN); } } -/****************************************************************************/ + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NINavTeqHelper.h sumo-1.6.0+dfsg1/src/netimport/NINavTeqHelper.h --- sumo-1.5.0+dfsg1/src/netimport/NINavTeqHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NINavTeqHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Some parser methods shared around several formats containing NavTeq-Nets /****************************************************************************/ -#ifndef NINavTeqHelper_h -#define NINavTeqHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ static void addVehicleClassesV6(NBEdge& e, const std::string& classS); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NITypeLoader.cpp sumo-1.6.0+dfsg1/src/netimport/NITypeLoader.cpp --- sumo-1.5.0+dfsg1/src/netimport/NITypeLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NITypeLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Perfoms network import /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,4 +82,5 @@ return ok; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NITypeLoader.h sumo-1.6.0+dfsg1/src/netimport/NITypeLoader.h --- sumo-1.5.0+dfsg1/src/netimport/NITypeLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NITypeLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Perfoms network import /****************************************************************************/ -#ifndef NITypeLoader_h -#define NITypeLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -55,9 +49,3 @@ static bool load(SUMOSAXHandler* handler, const std::vector& files, const std::string& type, const bool stringParse = false); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIVisumTL.cpp sumo-1.6.0+dfsg1/src/netimport/NIVisumTL.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIVisumTL.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIVisumTL.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -112,6 +107,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIVisumTL.h sumo-1.6.0+dfsg1/src/netimport/NIVisumTL.h --- sumo-1.5.0+dfsg1/src/netimport/NIVisumTL.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIVisumTL.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Intermediate class for storing visum traffic lights during their import /****************************************************************************/ -#ifndef NIVisumTL_h -#define NIVisumTL_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -195,9 +189,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLConnectionsHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLConnectionsHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLConnectionsHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLConnectionsHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Importer for edge connections stored in XML /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -69,7 +64,7 @@ void NIXMLConnectionsHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { - if (element == SUMO_TAG_DELETE) { + if (element == SUMO_TAG_DEL) { bool ok = true; std::string from = attrs.get(SUMO_ATTR_FROM, nullptr, ok); std::string to = attrs.get(SUMO_ATTR_TO, nullptr, ok); @@ -136,6 +131,19 @@ } else { fromEdge->addEdge2EdgeConnection(toEdge); fromEdge->getToNode()->invalidateTLS(myTLLogicCont, true, false); + if (attrs.hasAttribute(SUMO_ATTR_PASS) + || attrs.hasAttribute(SUMO_ATTR_KEEP_CLEAR) + || attrs.hasAttribute(SUMO_ATTR_CONTPOS) + || attrs.hasAttribute(SUMO_ATTR_VISIBILITY_DISTANCE) + || attrs.hasAttribute(SUMO_ATTR_SPEED) + || attrs.hasAttribute(SUMO_ATTR_LENGTH) + || attrs.hasAttribute(SUMO_ATTR_UNCONTROLLED) + || attrs.hasAttribute(SUMO_ATTR_SHAPE) + || attrs.hasAttribute(SUMO_ATTR_ALLOW) + || attrs.hasAttribute(SUMO_ATTR_DISALLOW)) { + WRITE_ERROR("No additional connection attributes are permitted in connection from edge '" + fromEdge->getID() + "' unless '" + + toString(SUMO_ATTR_FROM_LANE) + "' and '" + toString(SUMO_ATTR_TO_LANE) + "' are set."); + } } } if (element == SUMO_TAG_PROHIBITION) { @@ -222,7 +230,7 @@ " in connection from '%' to '%'.", toLane, from->getID(), to->getID()); return; } - if (from->hasConnectionTo(to, toLane) && from->getToNode()->getType() != NODETYPE_ZIPPER) { + if (from->hasConnectionTo(to, toLane) && from->getToNode()->getType() != SumoXMLNodeType::ZIPPER) { WRITE_WARNINGF("Target lane '%' is already connected from '%'.", to->getLaneID(toLane), from->getID()); } @@ -244,6 +252,7 @@ const double contPos = attrs.getOpt(SUMO_ATTR_CONTPOS, nullptr, ok, defaultCon.contPos); const double visibility = attrs.getOpt(SUMO_ATTR_VISIBILITY_DISTANCE, nullptr, ok, defaultCon.visibility); const double speed = attrs.getOpt(SUMO_ATTR_SPEED, nullptr, ok, defaultCon.speed); + const double length = attrs.getOpt(SUMO_ATTR_LENGTH, nullptr, ok, defaultCon.customLength); const bool uncontrolled = attrs.getOpt(SUMO_ATTR_UNCONTROLLED, nullptr, ok, defaultCon.uncontrolled); PositionVector customShape = attrs.getOpt(SUMO_ATTR_SHAPE, nullptr, ok, defaultCon.customShape); std::string allow = attrs.getOpt(SUMO_ATTR_ALLOW, nullptr, ok, ""); @@ -262,12 +271,12 @@ return; } if (!from->addLane2LaneConnection(fromLane, to, toLane, NBEdge::L2L_USER, true, mayDefinitelyPass, - keepClear, contPos, visibility, speed, customShape, uncontrolled, permissions)) { + keepClear, contPos, visibility, speed, length, customShape, uncontrolled, permissions)) { if (OptionsCont::getOptions().getBool("show-errors.connections-first-try")) { WRITE_WARNINGF("Could not set loaded connection from lane '%' to lane '%'.", from->getLaneID(fromLane), to->getLaneID(toLane)); } // set as to be re-applied after network processing - myEdgeCont.addPostProcessConnection(from->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass, keepClear, contPos, visibility, speed, customShape, uncontrolled, false, permissions); + myEdgeCont.addPostProcessConnection(from->getID(), fromLane, to->getID(), toLane, mayDefinitelyPass, keepClear, contPos, visibility, speed, length, customShape, uncontrolled, false, permissions); } } catch (NumberFormatException&) { myErrorMsgHandler->inform("At least one of the defined lanes was not numeric"); @@ -459,5 +468,5 @@ node->addWalkingAreaShape(edges, customShape); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLConnectionsHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLConnectionsHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLConnectionsHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLConnectionsHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for edge connections stored in XML /****************************************************************************/ -#ifndef NIXMLConnectionsHandler_h -#define NIXMLConnectionsHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -165,9 +159,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLEdgesHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLEdgesHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLEdgesHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLEdgesHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Importer for network edges stored in XML /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -97,7 +92,7 @@ case SUMO_TAG_SPLIT: addSplit(attrs); break; - case SUMO_TAG_DELETE: + case SUMO_TAG_DEL: deleteEdge(attrs); break; case SUMO_TAG_ROUNDABOUT: @@ -188,7 +183,7 @@ myCurrentWidth = myTypeCont.getWidth(myCurrentType); } myShape = PositionVector(); - myLanesSpread = LANESPREAD_RIGHT; + myLanesSpread = SUMOXMLDefinitions::LaneSpreadFunctions.get(myOptions.getString("default.spreadtype")); myLength = NBEdge::UNSPECIFIED_LOADED_LENGTH; myCurrentStreetName = ""; myReinitKeepEdgeShape = false; @@ -201,7 +196,7 @@ return; } if (!myTypeCont.knows(myCurrentType) && !myOptions.getBool("ignore-errors.edge-type")) { - WRITE_ERROR("Type '" + myCurrentType + "' used by edge '" + myCurrentID + "' was not defined (ignore with option --ignore-errors.edge-type)."); + WRITE_ERRORF("Type '%' used by edge '%' was not defined (ignore with option --ignore-errors.edge-type).", myCurrentType, myCurrentID); return; } myCurrentSpeed = myTypeCont.getSpeed(myCurrentType); @@ -283,6 +278,7 @@ // try to set the nodes if (!setNodes(attrs)) { // return if this failed + myCurrentEdge = nullptr; return; } // try to get the shape @@ -297,6 +293,7 @@ myBikeLaneWidth = attrs.getOpt(SUMO_ATTR_BIKELANEWIDTH, myCurrentID.c_str(), ok, myBikeLaneWidth); // insert the parsed edge into the edges map if (!ok) { + myCurrentEdge = nullptr; return; } // check whether a previously defined edge shall be overwritten @@ -334,7 +331,7 @@ NIXMLEdgesHandler::addLane(const SUMOSAXAttributes& attrs) { if (myCurrentEdge == nullptr) { if (!OptionsCont::getOptions().isInStringVector("remove-edges.explicit", myCurrentID)) { - WRITE_ERROR("Additional lane information could not be set - the edge with id '" + myCurrentID + "' is not known."); + WRITE_ERRORF("Additional lane information could not be set - the edge with id '%s' is not known.", myCurrentID); } return; } @@ -391,6 +388,16 @@ const std::string laneID = myCurrentID + "_" + toString(lane); WRITE_ERROR("Unable to project coordinates for lane '" + laneID + "'."); } + if (shape.size() == 1) { + // lane shape of length 1 is not permitted + shape.push_front(myCurrentEdge->getFromNode()->getPosition()); + shape.push_back(myCurrentEdge->getToNode()->getPosition()); + } + shape.removeDoublePoints(); + if (shape.size() < 2) { + // ignore lane shape for very short lanes + shape.clear(); + } myCurrentEdge->setLaneShape(lane, shape); } // set custom lane type @@ -459,6 +466,7 @@ e.offsetFactor = OptionsCont::getOptions().getBool("lefthand") ? -1 : 1; if (e.node == nullptr) { e.node = new NBNode(nodeID, myCurrentEdge->getGeometry().positionAtOffset(e.pos)); + myNodeCont.insert(e.node); } NIXMLNodesHandler::processNodeType(attrs, e.node, e.node->getID(), e.node->getPosition(), false, myNodeCont, myEdgeCont, myTLLogicCont); @@ -472,34 +480,35 @@ // the names and the coordinates of the beginning and the end node // may be found, try bool ok = true; - std::string begNodeID = myIsUpdate ? myCurrentEdge->getFromNode()->getID() : ""; - std::string endNodeID = myIsUpdate ? myCurrentEdge->getToNode()->getID() : ""; - std::string oldBegID = begNodeID; - std::string oldEndID = endNodeID; + if (myIsUpdate) { + myFromNode = myCurrentEdge->getFromNode(); + myToNode = myCurrentEdge->getToNode(); + } if (attrs.hasAttribute(SUMO_ATTR_FROM)) { - begNodeID = attrs.get(SUMO_ATTR_FROM, nullptr, ok); + const std::string begNodeID = attrs.get(SUMO_ATTR_FROM, nullptr, ok); + if (begNodeID != "") { + myFromNode = myNodeCont.retrieve(begNodeID); + if (myFromNode == nullptr) { + WRITE_ERROR("Edge's '" + myCurrentID + "' from-node '" + begNodeID + "' is not known."); + } + } } else if (!myIsUpdate) { WRITE_ERROR("The from-node is not given for edge '" + myCurrentID + "'."); ok = false; } if (attrs.hasAttribute(SUMO_ATTR_TO)) { - endNodeID = attrs.get(SUMO_ATTR_TO, nullptr, ok); + const std::string endNodeID = attrs.get(SUMO_ATTR_TO, nullptr, ok); + if (endNodeID != "") { + myToNode = myNodeCont.retrieve(endNodeID); + if (myToNode == nullptr) { + WRITE_ERROR("Edge's '" + myCurrentID + "' to-node '" + endNodeID + "' is not known."); + } + } } else if (!myIsUpdate) { WRITE_ERROR("The to-node is not given for edge '" + myCurrentID + "'."); ok = false; } - if (!ok) { - return false; - } - myFromNode = myNodeCont.retrieve(begNodeID); - myToNode = myNodeCont.retrieve(endNodeID); - if (myFromNode == nullptr) { - WRITE_ERROR("Edge's '" + myCurrentID + "' from-node '" + begNodeID + "' is not known."); - } - if (myToNode == nullptr) { - WRITE_ERROR("Edge's '" + myCurrentID + "' to-node '" + endNodeID + "' is not known."); - } - return myFromNode != nullptr && myToNode != nullptr; + return ok && myFromNode != nullptr && myToNode != nullptr; } @@ -547,7 +556,7 @@ } NBEdge* edge = myEdgeCont.retrieve(myCurrentID); if (edge == nullptr) { - WRITE_WARNING("Ignoring tag '" + toString(SUMO_TAG_DELETE) + "' for unknown edge '" + + WRITE_WARNING("Ignoring tag '" + toString(SUMO_TAG_DEL) + "' for unknown edge '" + myCurrentID + "'"); return; } @@ -597,7 +606,7 @@ } myEdgeCont.processSplits(myCurrentEdge, mySplits, myNodeCont, myDistrictCont, myTLLogicCont); myCurrentEdge = nullptr; - } else if (element == SUMO_TAG_LANE) { + } else if (element == SUMO_TAG_LANE && myCurrentLaneIndex != -1) { myLastParameterised.pop_back(); myCurrentLaneIndex = -1; } @@ -627,4 +636,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLEdgesHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLEdgesHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLEdgesHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLEdgesHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Importer for network edges stored in XML /****************************************************************************/ -#ifndef NIXMLEdgesHandler_h -#define NIXMLEdgesHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -300,9 +294,3 @@ NIXMLEdgesHandler& operator=(const NIXMLEdgesHandler& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLNodesHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLNodesHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLNodesHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLNodesHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Importer for network nodes stored in XML /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -86,7 +81,7 @@ case SUMO_TAG_JOINEXCLUDE: addJoinExclusion(attrs); break; - case SUMO_TAG_DELETE: + case SUMO_TAG_DEL: deleteNode(attrs); break; case SUMO_TAG_PARAM: @@ -167,17 +162,17 @@ NBNodeCont& nc, NBEdgeCont& ec, NBTrafficLightLogicCont& tlc) { bool ok = true; // get the type - SumoXMLNodeType type = NODETYPE_UNKNOWN; + SumoXMLNodeType type = SumoXMLNodeType::UNKNOWN; if (node != nullptr) { type = node->getType(); } std::string typeS = attrs.getOpt(SUMO_ATTR_TYPE, nodeID.c_str(), ok, ""); if (SUMOXMLDefinitions::NodeTypes.hasString(typeS)) { type = SUMOXMLDefinitions::NodeTypes.get(typeS); - if (type == NODETYPE_DEAD_END_DEPRECATED || type == NODETYPE_DEAD_END) { + if (type == SumoXMLNodeType::DEAD_END_DEPRECATED || type == SumoXMLNodeType::DEAD_END) { // dead end is a computed status. Reset this to unknown so it will // be corrected if additional connections are loaded - type = NODETYPE_UNKNOWN; + type = SumoXMLNodeType::UNKNOWN; } } std::set oldTLS; @@ -190,7 +185,7 @@ } else { // patch information oldTLS = node->getControllingTLS(); - if (node->getType() == NODETYPE_PRIORITY && type == NODETYPE_RIGHT_BEFORE_LEFT) { + if (node->getType() == SumoXMLNodeType::PRIORITY && type == SumoXMLNodeType::RIGHT_BEFORE_LEFT) { ec.removeRoundabout(node); } node->reinit(position, type, updateEdgeGeometries); @@ -236,6 +231,10 @@ if (attrs.hasAttribute(SUMO_ATTR_FRINGE)) { node->setFringeType(attrs.getFringeType(ok)); } + // set optional name + if (attrs.hasAttribute(SUMO_ATTR_NAME)) { + node->setName(attrs.get(SUMO_ATTR_NAME, nodeID.c_str(), ok)); + } return node; } @@ -250,7 +249,7 @@ } NBNode* node = myNodeCont.retrieve(myID); if (node == nullptr) { - WRITE_WARNING("Ignoring tag '" + toString(SUMO_TAG_DELETE) + "' for unknown node '" + + WRITE_WARNING("Ignoring tag '" + toString(SUMO_TAG_DEL) + "' for unknown node '" + myID + "'"); return; } else { @@ -361,6 +360,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLNodesHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLNodesHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLNodesHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLNodesHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for network nodes stored in XML /****************************************************************************/ -#ifndef NIXMLNodesHandler_h -#define NIXMLNodesHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -171,9 +165,3 @@ NIXMLNodesHandler& operator=(const NIXMLNodesHandler& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLPTHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLPTHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLPTHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLPTHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Importer for static public transport information /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -70,7 +65,10 @@ switch (element) { case SUMO_TAG_BUS_STOP: case SUMO_TAG_TRAIN_STOP: - if (myCurrentLine == nullptr) { + case SUMO_TAG_STOP: + if (myCurrentRouteID != "") { + addRouteStop(attrs); + } else if (myCurrentLine == nullptr) { addPTStop(attrs); } else { addPTLineStop(attrs); @@ -83,15 +81,25 @@ addPTLine(attrs); break; case SUMO_TAG_ROUTE: - addRoute(attrs); + if (myCurrentLine == nullptr) { + addRoute(attrs); + } else { + addPTLineRoute(attrs); + } + break; + case SUMO_TAG_FLOW: + case SUMO_TAG_TRIP: + addPTLineFromFlow(attrs); break; case SUMO_TAG_PARAM: - if (myLastParameterised.size() != 0) { + if (myCurrentLine != nullptr) { bool ok = true; const std::string key = attrs.get(SUMO_ATTR_KEY, nullptr, ok); - // circumventing empty string test - const std::string val = attrs.hasAttribute(SUMO_ATTR_VALUE) ? attrs.getString(SUMO_ATTR_VALUE) : ""; - myLastParameterised.back()->setParameter(key, val); + if (key == "completeness") { + myCurrentCompletion = attrs.get(SUMO_ATTR_VALUE, nullptr, ok); + } else if (key == "name") { + myCurrentLine->setName(attrs.get(SUMO_ATTR_VALUE, nullptr, ok)); + } } break; default: @@ -107,9 +115,14 @@ myCurrentStop = nullptr; break; case SUMO_TAG_PT_LINE: + case SUMO_TAG_FLOW: + case SUMO_TAG_TRIP: myCurrentLine->setMyNumOfStops((int)(myCurrentLine->getStops().size() / myCurrentCompletion)); myCurrentLine = nullptr; break; + case SUMO_TAG_ROUTE: + myCurrentRouteID = ""; + break; default: break; } @@ -124,6 +137,7 @@ const std::string laneID = attrs.get(SUMO_ATTR_LANE, id.c_str(), ok); const double startPos = attrs.get(SUMO_ATTR_STARTPOS, id.c_str(), ok); const double endPos = attrs.get(SUMO_ATTR_ENDPOS, id.c_str(), ok); + const double parkingLength = attrs.getOpt(SUMO_ATTR_PARKING_LENGTH, id.c_str(), ok, 0); //const std::string lines = attrs.get(SUMO_ATTR_LINES, id.c_str(), ok); const int laneIndex = NBEdge::getLaneIndexFromLaneID(laneID); const std::string edgeID = SUMOXMLDefinitions::getEdgeIDFromLane(laneID); @@ -137,9 +151,13 @@ return; } SVCPermissions permissions = edge->getPermissions(laneIndex); + // possibly the stops were written for a different network. If the lane is not a typical public transport stop lane, assume bus as the default + if (!isRailway(permissions) && permissions != SVC_SHIP && permissions != SVC_TAXI) { + permissions = SVC_BUS; + } if (ok) { Position pos = edge->geometryPositionAtOffset((startPos + endPos) / 2); - myCurrentStop = new NBPTStop(id, pos, edgeID, edgeID, endPos - startPos, name, permissions); + myCurrentStop = new NBPTStop(id, pos, edgeID, edgeID, endPos - startPos, name, permissions, parkingLength); if (!myStopCont.insert(myCurrentStop)) { WRITE_ERROR("Could not add public transport stop '" + id + "' (already exists)"); } @@ -168,7 +186,7 @@ const std::string type = attrs.get(SUMO_ATTR_TYPE, id.c_str(), ok); SUMOVehicleClass vClass = NIImporter_OpenStreetMap::interpretTransportType(type); if (attrs.hasAttribute(SUMO_ATTR_VCLASS)) { - vClass = getVehicleClassID(attrs.get(SUMO_ATTR_ID, id.c_str(), ok)); + vClass = getVehicleClassID(attrs.get(SUMO_ATTR_VCLASS, id.c_str(), ok)); } const int intervalS = attrs.getOpt(SUMO_ATTR_PERIOD, id.c_str(), ok, -1); const std::string nightService = attrs.getStringSecure("nightService", ""); @@ -179,8 +197,29 @@ } } + void -NIXMLPTHandler::addRoute(const SUMOSAXAttributes& attrs) { +NIXMLPTHandler::addPTLineFromFlow(const SUMOSAXAttributes& attrs) { + bool ok = true; + const std::string id = attrs.get(SUMO_ATTR_ID, "flow", ok); + const std::string line = attrs.get(SUMO_ATTR_LINE, id.c_str(), ok); + const std::string type = attrs.get(SUMO_ATTR_TYPE, id.c_str(), ok); + const std::string route = attrs.get(SUMO_ATTR_ROUTE, id.c_str(), ok); + SUMOVehicleClass vClass = NIImporter_OpenStreetMap::interpretTransportType(type); + const int intervalS = attrs.getOpt(SUMO_ATTR_PERIOD, id.c_str(), ok, -1); + if (ok) { + myCurrentLine = new NBPTLine(id, "", type, line, intervalS / 60, "", vClass); + myCurrentLine->setEdges(myRouteEdges[route]); + for (NBPTStop* stop : myRouteStops[route]) { + myCurrentLine->addPTStop(stop); + } + myLineCont.insert(myCurrentLine); + } +} + + +void +NIXMLPTHandler::addPTLineRoute(const SUMOSAXAttributes& attrs) { if (myCurrentLine == nullptr) { WRITE_ERROR("Found route outside line definition"); return; @@ -198,11 +237,30 @@ myCurrentLine->setEdges(edges); } +void +NIXMLPTHandler::addRoute(const SUMOSAXAttributes& attrs) { + bool ok = true; + myCurrentRouteID = attrs.get(SUMO_ATTR_ID, "route", ok); + const std::vector& edgeIDs = attrs.getStringVector(SUMO_ATTR_EDGES); + EdgeVector edges; + for (const std::string& edgeID : edgeIDs) { + NBEdge* edge = myEdgeCont.retrieve(edgeID); + if (edge == nullptr) { + WRITE_ERROR("Edge '" + edgeID + "' in route of line '" + myCurrentLine->getName() + "' not found"); + } else { + edges.push_back(edge); + } + } + myRouteEdges[myCurrentRouteID] = edges; +} + void NIXMLPTHandler::addPTLineStop(const SUMOSAXAttributes& attrs) { bool ok = true; - const std::string id = attrs.get(SUMO_ATTR_ID, "ptLine", ok); + const std::string id = attrs.hasAttribute(SUMO_ATTR_ID) + ? attrs.get(SUMO_ATTR_ID, "ptLine", ok) + : attrs.get(SUMO_ATTR_BUS_STOP, "ptline", ok); NBPTStop* stop = myStopCont.get(id); if (stop == nullptr) { WRITE_ERROR("Stop '" + id + "' within line '" + toString(myCurrentLine->getLineID()) + "' not found"); @@ -211,6 +269,20 @@ myCurrentLine->addPTStop(stop); } +void +NIXMLPTHandler::addRouteStop(const SUMOSAXAttributes& attrs) { + assert(myCurrentRouteID != ""); + bool ok = true; + const std::string id = attrs.hasAttribute(SUMO_ATTR_ID) + ? attrs.get(SUMO_ATTR_ID, "ptLine", ok) + : attrs.get(SUMO_ATTR_BUS_STOP, "ptline", ok); + NBPTStop* stop = myStopCont.get(id); + if (stop == nullptr) { + WRITE_ERROR("Stop '" + id + "' within route '" + toString(myCurrentRouteID) + "' not found"); + return; + } + myRouteStops[myCurrentRouteID].push_back(stop); +} -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLPTHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLPTHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLPTHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLPTHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Importer for static public transport information /****************************************************************************/ -#ifndef NIXMLPTHandler_h -#define NIXMLPTHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -145,12 +139,19 @@ /// @brief The currently processed line NBPTLine* myCurrentLine; + /// @brief The currently processed stand-alone route + std::string myCurrentRouteID; + /// @brief the completion level of the current line double myCurrentCompletion; /// @brief element to receive parameters std::vector myLastParameterised; + /// @brief stand-alone route information + std::map > myRouteStops; + std::map myRouteEdges; + private: /** @brief Parses an public transport stop @@ -161,6 +162,12 @@ /** @brief Parses a route as port of a public transport line * @param[in] attrs The attributes to get the routes's values from */ + void addPTLineRoute(const SUMOSAXAttributes& attrs); + + /** @brief Parses a stand-alone route when parsing implicit ptlines from + * routes and flows + * @param[in] attrs The attributes to get the routes's values from + */ void addRoute(const SUMOSAXAttributes& attrs); /** @brief Parses an public transport stop reference within a line element @@ -168,6 +175,11 @@ */ void addPTLineStop(const SUMOSAXAttributes& attrs); + /** @brief Parses an public transport stop reference within a route element + * @param[in] attrs The attributes to get the stops's values from + */ + void addRouteStop(const SUMOSAXAttributes& attrs); + /** @brief Parses an stop access definition * @param[in] attrs The attributes to get the access's values from */ @@ -178,6 +190,11 @@ */ void addPTLine(const SUMOSAXAttributes& attrs); + /** @brief Parses a public transport line + * @param[in] attrs The attributes to get the lines's values from + */ + void addPTLineFromFlow(const SUMOSAXAttributes& attrs); + private: /** @brief invalid copy constructor */ @@ -187,9 +204,3 @@ NIXMLPTHandler& operator=(const NIXMLPTHandler& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLShapeHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLShapeHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLShapeHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLShapeHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,10 +17,6 @@ /// // Importer for static public transport information /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -60,5 +56,4 @@ } - /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLShapeHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLShapeHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLShapeHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLShapeHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,8 +17,7 @@ /// // Importer for static public transport information /****************************************************************************/ -#ifndef NIXMLShapeHandler_h -#define NIXMLShapeHandler_h +#pragma once #include @@ -55,6 +54,3 @@ const NBEdgeCont& myEdgeCont; }; -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Importer for traffic lights stored in XML /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,7 +82,7 @@ case SUMO_TAG_CONNECTION: addTlConnection(attrs); break; - case SUMO_TAG_DELETE: + case SUMO_TAG_DEL: removeTlConnection(attrs); break; case SUMO_TAG_PARAM: @@ -124,7 +119,7 @@ } bool ok = true; std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); - std::string programID = attrs.getOpt(SUMO_ATTR_PROGRAMID, id.c_str(), ok, ""); + std::string programID = attrs.getOpt(SUMO_ATTR_PROGRAMID, id.c_str(), ok, "UNKNOWN_PROGRAM"); SUMOTime offset = attrs.hasAttribute(SUMO_ATTR_OFFSET) ? TIME2STEPS(attrs.get(SUMO_ATTR_OFFSET, id.c_str(), ok)) : 0; std::string typeS = attrs.getOpt(SUMO_ATTR_TYPE, nullptr, ok, OptionsCont::getOptions().getString("tls.default-type")); @@ -179,9 +174,8 @@ loadedDef->addControlledInnerEdges(newDef->getControlledInnerEdges()); if (deleteDefault) { // replace default Program - std::vector nodes = newDef->getNodes(); - for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { - (*it)->removeTrafficLight(newDef); + for (NBNode* const n : newDef->getNodes()) { + n->removeTrafficLight(newDef); } myTLLCont.removeProgram(id, NBTrafficLightDefinition::DefaultProgramID); } @@ -189,9 +183,8 @@ } else { // case 3 NBTrafficLightLogic* oldLogic = oldDef->getLogic(); - NBTrafficLightLogic* newLogic = new NBTrafficLightLogic(id, programID, - oldLogic->getNumLinks(), offset, type); - loadedDef = new NBLoadedSUMOTLDef(oldDef, newLogic); + NBTrafficLightLogic newLogic(id, programID, oldLogic->getNumLinks(), offset, type); + loadedDef = new NBLoadedSUMOTLDef(*oldDef, newLogic); // copy nodes std::vector nodes = oldDef->getNodes(); for (std::vector::iterator it = nodes.begin(); it != nodes.end(); it++) { @@ -276,7 +269,7 @@ } } else { SumoXMLNodeType type = from->getToNode()->getType(); - if (type != NODETYPE_RAIL_CROSSING && type != NODETYPE_RAIL_SIGNAL) { + if (type != SumoXMLNodeType::RAIL_CROSSING && type != SumoXMLNodeType::RAIL_SIGNAL) { WRITE_ERROR("The traffic light '" + tlID + "' is not known."); } } @@ -347,4 +340,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLTrafficLightsHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Importer for traffic lights stored in XML /****************************************************************************/ -#ifndef NIXMLTrafficLightsHandler_h -#define NIXMLTrafficLightsHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -131,9 +125,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLTypesHandler.cpp sumo-1.6.0+dfsg1/src/netimport/NIXMLTypesHandler.cpp --- sumo-1.5.0+dfsg1/src/netimport/NIXMLTypesHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLTypesHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Importer for edge type information stored in XML /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -116,6 +111,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/NIXMLTypesHandler.h sumo-1.6.0+dfsg1/src/netimport/NIXMLTypesHandler.h --- sumo-1.5.0+dfsg1/src/netimport/NIXMLTypesHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/NIXMLTypesHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Importer for edge type information stored in XML /****************************************************************************/ -#ifndef NIXMLTypesHandler_h -#define NIXMLTypesHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -94,9 +88,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -1267,6 +1262,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.h sumo-1.6.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/NIImporter_Vissim.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Importer for networks stored in Vissim format /****************************************************************************/ -#ifndef NIImporter_Vissim_h -#define NIImporter_Vissim_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -661,9 +655,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/NIVissimElements.h sumo-1.6.0+dfsg1/src/netimport/vissim/NIVissimElements.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/NIVissimElements.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/NIVissimElements.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimElements_h -#define NIVissimElements_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -90,9 +84,3 @@ VE_Kantensperrung, VE_DUMMY }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -179,6 +174,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimAbstractEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimAbstractEdge_h -#define NIVissimAbstractEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -75,9 +69,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -76,6 +71,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimBoundedClusterObject.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimBoundedClusterObject_h -#define NIVissimBoundedClusterObject_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -58,9 +52,3 @@ Boundary* myBoundary; int myClusterID; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -36,6 +31,4 @@ NIVissimClosedLaneDef::~NIVissimClosedLaneDef() {} - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLaneDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimClosedLaneDef_h -#define NIVissimClosedLaneDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -42,9 +36,3 @@ private: std::vector myAssignedVehicles; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosedLanesVector.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimClosedLanesVector_h -#define NIVissimClosedLanesVector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -31,9 +25,3 @@ #include "NIVissimClosedLaneDef.h" typedef std::vector NIVissimClosedLanesVector; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,6 +82,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimClosures.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimClosures_h -#define NIVissimClosures_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A temporary storage for conflict areas imported from Vissim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConflictArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimConflictArea_h -#define NIVissimConflictArea_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -130,8 +124,3 @@ /// @brief The dictionary static DictType myDict; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -786,6 +781,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnectionCluster.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimConnectionCluster_h -#define NIVissimConnectionCluster_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -194,9 +188,3 @@ static int myStaticBlaID; int myBlaID; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -322,5 +317,3 @@ /****************************************************************************/ - - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimConnection.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimConnection_h -#define NIVissimConnection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -113,9 +107,3 @@ static DictType myDict; static int myMaxID; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -394,6 +389,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDistrictConnection.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An edge imported from Vissim together for a container for /****************************************************************************/ -#ifndef NIVissimDistrictConnection_h -#define NIVissimDistrictConnection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -139,9 +133,3 @@ static std::map > myDistrictsConnections; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -355,6 +350,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimDisturbance.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimDisturbance_h -#define NIVissimDisturbance_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -84,9 +78,3 @@ static int myRunningID; static int refusedProhibits; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -464,7 +459,7 @@ if (fromNode == nullptr) { fromInf.first = 0; Position pos = myGeom[0]; - fromNode = new NBNode(toString(myID) + "-SourceNode", pos, NODETYPE_NOJUNCTION); + fromNode = new NBNode(toString(myID) + "-SourceNode", pos, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(fromNode)) { throw ProcessError("Could not insert node '" + fromNode->getID() + "' to nodes container."); } @@ -472,7 +467,7 @@ if (toNode == nullptr) { toInf.first = 0; Position pos = myGeom[-1]; - toNode = new NBNode(toString(myID) + "-DestinationNode", pos, NODETYPE_NOJUNCTION); + toNode = new NBNode(toString(myID) + "-DestinationNode", pos, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(toNode)) { throw ProcessError("Could not insert node '" + toNode->getID() + "' to nodes container."); } @@ -499,7 +494,7 @@ NBEdge* buildEdge = new NBEdge(toString(myID), fromNode, toNode, myType, avgSpeed / (double) 3.6, myNoLanes, -1, NBEdge::UNSPECIFIED_WIDTH, NBEdge::UNSPECIFIED_OFFSET, - myGeom, myName, "", LANESPREAD_CENTER, true); + myGeom, myName, "", LaneSpreadFunction::CENTER, true); for (int i = 0; i < myNoLanes; i++) { buildEdge->setLaneWidth(i, myLaneWidths[i]); if ((int) myLaneSpeeds.size() <= i || myLaneSpeeds[i] == -1) { @@ -594,7 +589,7 @@ if (myDistrictConnections.size() > 0) { double pos = *(myDistrictConnections.begin()); if (pos < 10) { - NBNode* node = new NBNode(toString(myID) + "-begin", beg, NODETYPE_NOJUNCTION); + NBNode* node = new NBNode(toString(myID) + "-begin", beg, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -605,7 +600,7 @@ } } // build a new node for the edge's begin otherwise - NBNode* node = new NBNode(toString(myID) + "-begin", beg, NODETYPE_NOJUNCTION); + NBNode* node = new NBNode(toString(myID) + "-begin", beg, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -630,7 +625,7 @@ if (myDistrictConnections.size() > 0) { double pos = *(myDistrictConnections.end() - 1); if (pos > myGeom.length() - 10) { - NBNode* node = new NBNode(toString(myID) + "-end", end, NODETYPE_NOJUNCTION); + NBNode* node = new NBNode(toString(myID) + "-end", end, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -642,7 +637,7 @@ } // build a new node for the edge's end otherwise - NBNode* node = new NBNode(toString(myID) + "-end", end, NODETYPE_NOJUNCTION); + NBNode* node = new NBNode(toString(myID) + "-end", end, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -671,14 +666,14 @@ NBNode* newNode = new NBNode(nid, fromNode->getPosition(), - NODETYPE_NOJUNCTION); + SumoXMLNodeType::NOJUNCTION); nc.erase(fromNode); nc.insert(newNode); return std::pair(newNode, toNode); } else { NBNode* newNode = new NBNode(nid, toNode->getPosition(), - NODETYPE_NOJUNCTION); + SumoXMLNodeType::NOJUNCTION); nc.erase(toNode); nc.insert(newNode); return std::pair(fromNode, newNode); @@ -703,7 +698,7 @@ NBNode* node = nc.retrieve(nid); if (node == nullptr) { node = new NBNode(nid, - pos, NODETYPE_NOJUNCTION); + pos, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -715,7 +710,7 @@ std::string nid = "ParkingPlace" + toString(d->getID()); NBNode* node = nc.retrieve(nid); if (node == nullptr) { - node = new NBNode(nid, pos, NODETYPE_NOJUNCTION); + node = new NBNode(nid, pos, SumoXMLNodeType::NOJUNCTION); if (!nc.insert(node)) { throw 1; } @@ -736,7 +731,7 @@ NBNode* end = new NBNode( toString(myID) + "-End", myGeom.back(), - NODETYPE_NOJUNCTION); + SumoXMLNodeType::NOJUNCTION); if (!nc.insert(end)) { throw 1; } @@ -748,7 +743,7 @@ NBNode* beg = new NBNode( toString(myID) + "-Begin", myGeom.front(), - NODETYPE_NOJUNCTION); + SumoXMLNodeType::NOJUNCTION); if (!nc.insert(beg)) { std::cout << "nope, NIVissimDisturbance" << std::endl; throw 1; @@ -1025,6 +1020,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A temporary storage for edges imported from Vissim /****************************************************************************/ -#ifndef NIVissimEdge_h -#define NIVissimEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "NIVissimConnectionCluster.h" @@ -302,9 +296,3 @@ static std::vector myLanesWithMissingSpeeds; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -73,6 +68,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimEdgePosMap.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimEdgePosMap_h -#define NIVissimEdgePosMap_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -47,9 +41,3 @@ typedef std::map ContType; ContType myCont; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -91,4 +86,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePoint.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimExtendedEdgePoint_h -#define NIVissimExtendedEdgePoint_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -75,9 +69,3 @@ double myPosition; std::vector myAssignedVehicles; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimExtendedEdgePointVector.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimExtendedEdgePointVector_h -#define NIVissimExtendedEdgePointVector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -31,9 +25,3 @@ #include "NIVissimExtendedEdgePoint.h" typedef std::vector NIVissimtendedEdgePointVector; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -172,7 +167,7 @@ "actuated_traffic_light"); } }*/ - NBNode* node = new NBNode(getNodeName(), pos, NODETYPE_PRIORITY); + NBNode* node = new NBNode(getNodeName(), pos, SumoXMLNodeType::PRIORITY); if (!nc.insert(node)) { delete node; throw 1; @@ -300,6 +295,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeCluster.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeCluster_h -#define NIVissimNodeCluster_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -96,9 +90,3 @@ bool myAmEdgeSplit; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -140,6 +135,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -114,6 +109,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Edges.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeDef_Edges_h -#define NIVissimNodeDef_Edges_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -72,9 +66,3 @@ protected: NIVissimNodeParticipatingEdgeVector myEdges; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeDef_h -#define NIVissimNodeDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -62,9 +56,3 @@ static DictType myDict; static int myMaxID; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -65,4 +60,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeDef_Poly.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeDef_Poly_h -#define NIVissimNodeDef_Poly_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -48,9 +42,3 @@ PositionVector myPoly; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -64,6 +59,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeParticipatingEdge_h -#define NIVissimNodeParticipatingEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -50,9 +44,3 @@ int myEdgeID; double myFromPos, myToPos; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimNodeParticipatingEdgeVector.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimNodeParticipatingEdgeVector_h -#define NIVissimNodeParticipatingEdgeVector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -31,9 +25,3 @@ #include "NIVissimNodeParticipatingEdge.h" typedef std::vector NIVissimNodeParticipatingEdgeVector; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -81,6 +76,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimSource.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimSource_h -#define NIVissimSource_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -55,9 +49,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -383,7 +378,7 @@ }*/ std::string id = toString(tl->myID); TrafficLightType type = ((tl->getType() == "festzeit" || tl->getType() == "festzeit_fake") ? - TLTYPE_STATIC : TLTYPE_ACTUATED); + TrafficLightType::STATIC : TrafficLightType::ACTUATED); NBLoadedTLDef* def = new NBLoadedTLDef(ec, id, 0, type); if (!tlc.insert(def)) { WRITE_ERROR("Error on adding a traffic light\n Must be a multiple id ('" + id + "')"); @@ -435,6 +430,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTL.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimTL_h -#define NIVissimTL_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -140,9 +134,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -117,6 +112,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimTrafficDescription.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimTrafficDescription_h -#define NIVissimTrafficDescription_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -56,9 +50,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -40,6 +35,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClass.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimVehicleClass_h -#define NIVissimVehicleClass_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -41,9 +35,3 @@ private: int myVWish; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleClassVector.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimVehicleClassVector_h -#define NIVissimVehicleClassVector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -31,9 +25,3 @@ #include "NIVissimVehicleClass.h" typedef std::vector NIVissimVehicleClassVector; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -80,6 +75,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehicleType.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimVehicleType_h -#define NIVissimVehicleType_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -56,9 +50,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // ------------------- /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,6 +82,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/tempstructs/NIVissimVehTypeClass.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef NIVissimVehTypeClass_h -#define NIVissimVehTypeClass_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -58,9 +52,3 @@ typedef std::map DictType; static DictType myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -72,6 +67,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Auswertungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Auswertungsdefinition_h -#define NIVissimSingleTypeParser_Auswertungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -55,6 +50,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Detektordefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Detektordefinition_h -#define NIVissimSingleTypeParser_Detektordefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -56,6 +51,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_DynUml.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_DynUml_h -#define NIVissimSingleTypeParser_DynUml_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Einheitendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Einheitendefinition_h -#define NIVissimSingleTypeParser_Einheitendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Emission.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Emission_h -#define NIVissimSingleTypeParser_Emission_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrtverlaufdateien.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Fahrtverlaufdateien_h -#define NIVissimSingleTypeParser_Fahrtverlaufdateien_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -57,6 +52,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrverhaltendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Fahrverhaltendefinition_h -#define NIVissimSingleTypeParser_Fahrverhaltendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -92,6 +87,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugklassendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Fahrzeugklassendefinition_h -#define NIVissimSingleTypeParser_Fahrzeugklassendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -55,9 +49,3 @@ NIImporter_Vissim::ColorMap& myColorMap; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -108,6 +103,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fahrzeugtypdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Fahrzeugtypdefinition_h -#define NIVissimSingleTypeParser_Fahrzeugtypdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -54,9 +48,3 @@ /// The color map to use NIImporter_Vissim::ColorMap& myColorMap; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -59,6 +54,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Fensterdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Fensterdefinition_h -#define NIVissimSingleTypeParser_Fensterdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gefahrwarnungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Gefahrwarnungsdefinition_h -#define NIVissimSingleTypeParser_Gefahrwarnungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Gelbverhaltendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Gelbverhaltendefinition_h -#define NIVissimSingleTypeParser_Gelbverhaltendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -72,6 +67,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition_h -#define NIVissimSingleTypeParser_Geschwindigkeitsverteilungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -65,6 +60,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Haltestellendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Haltestellendefinition_h -#define NIVissimSingleTypeParser_Haltestellendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -74,6 +69,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kantensperrung.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Kantensperrung_h -#define NIVissimSingleTypeParser_Kantensperrung_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Kennungszeile.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Kennungszeile_h -#define NIVissimSingleTypeParser_Kennungszeile_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -95,6 +90,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Knotendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Knotendefinition_h -#define NIVissimSingleTypeParser_Knotendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,6 +61,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Laengenverteilungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Laengenverteilungsdefinition_h -#define NIVissimSingleTypeParser_Laengenverteilungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -56,6 +51,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Langsamfahrbereichdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Langsamfahrbereichdefinition_h -#define NIVissimSingleTypeParser_Langsamfahrbereichdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -155,6 +150,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Lichtsignalanlagendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Lichtsignalanlagendefinition_h -#define NIVissimSingleTypeParser_Lichtsignalanlagendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ const std::string& type); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -54,6 +49,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Liniendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Liniendefinition_h -#define NIVissimSingleTypeParser_Liniendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Linksverkehr.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Linksverkehr_h -#define NIVissimSingleTypeParser_Linksverkehr_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_LSAKopplungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_LSAKopplungsdefinition_h -#define NIVissimSingleTypeParser_LSAKopplungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Messungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Messungsdefinition_h -#define NIVissimSingleTypeParser_Messungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Netzobjektdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Netzobjektdefinition_h -#define NIVissimSingleTypeParser_Netzobjektdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -122,6 +117,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Parkplatzdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Parkplatzdefinition_h -#define NIVissimSingleTypeParser_Parkplatzdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -64,6 +59,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querschnittsmessungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Querschnittsmessungsdefinition_h -#define NIVissimSingleTypeParser_Querschnittsmessungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -184,6 +179,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition_h -#define NIVissimSingleTypeParser_Querverkehrsstoerungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -62,9 +56,3 @@ NIVissimExtendedEdgePoint parsePos(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,6 +45,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Rautedefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Rautedefinition_h -#define NIVissimSingleTypeParser_Rautedefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -51,9 +45,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,6 +61,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Reisezeitmessungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Reisezeitmessungsdefinition_h -#define NIVissimSingleTypeParser_Reisezeitmessungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -47,6 +42,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungsentscheidungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Richtungsentscheidungsdefinition_h -#define NIVissimSingleTypeParser_Richtungsentscheidungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,6 +45,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Richtungspfeildefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Richtungspfeildefinition_h -#define NIVissimSingleTypeParser_Richtungspfeildefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -66,6 +61,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Routenentscheidungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Routenentscheidungsdefinition_h -#define NIVissimSingleTypeParser_Routenentscheidungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -112,6 +107,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgeberdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Signalgeberdefinition_h -#define NIVissimSingleTypeParser_Signalgeberdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -201,6 +196,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Signalgruppendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Signalgruppendefinition_h -#define NIVissimSingleTypeParser_Signalgruppendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -83,9 +77,3 @@ std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -58,6 +53,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Simdauer.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Simdauer_h -#define NIVissimSingleTypeParser_Simdauer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_SimRate.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_SimRate_h -#define NIVissimSingleTypeParser_SimRate_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -47,6 +42,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startuhrzeit.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Startuhrzeit_h -#define NIVissimSingleTypeParser_Startuhrzeit_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Startzufallszahl.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Startzufallszahl_h -#define NIVissimSingleTypeParser_Startzufallszahl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauparameterdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Stauparameterdefinition_h -#define NIVissimSingleTypeParser_Stauparameterdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stauzaehlerdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Stauzaehlerdefinition_h -#define NIVissimSingleTypeParser_Stauzaehlerdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -68,6 +63,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Stopschilddefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Stopschilddefinition_h -#define NIVissimSingleTypeParser_Stopschilddefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -135,6 +130,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckendefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Streckendefinition_h -#define NIVissimSingleTypeParser_Streckendefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,6 @@ /// // /****************************************************************************/ - - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -51,6 +45,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Streckentypdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Streckentypdefinition_h -#define NIVissimSingleTypeParser_Streckentypdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_TEAPACDefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_TEAPACDefinition_h -#define NIVissimSingleTypeParser_TEAPACDefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -166,6 +161,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verbindungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Verbindungsdefinition_h -#define NIVissimSingleTypeParser_Verbindungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -51,9 +45,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -77,6 +72,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition_h -#define NIVissimSingleTypeParser_Verkehrszusammensetzungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -62,6 +57,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Verlustzeitmessungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Verlustzeitmessungsdefinition_h -#define NIVissimSingleTypeParser_Verlustzeitmessungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -101,6 +96,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_VWunschentscheidungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_VWunschentscheidungsdefinition_h -#define NIVissimSingleTypeParser_VWunschentscheidungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XKurvedefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser__XKurvedefinition_h -#define NIVissimSingleTypeParser__XKurvedefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser__XVerteilungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser__XVerteilungsdefinition_h -#define NIVissimSingleTypeParser__XVerteilungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitenverteilungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Zeitenverteilungsdefinition_h -#define NIVissimSingleTypeParser_Zeitenverteilungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -48,6 +43,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zeitschrittfaktor.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Zeitschrittfaktor_h -#define NIVissimSingleTypeParser_Zeitschrittfaktor_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -83,6 +78,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zuflussdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Zuflussdefinition_h -#define NIVissimSingleTypeParser_Zuflussdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -60,6 +55,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h --- sumo-1.5.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netimport/vissim/typeloader/NIVissimSingleTypeParser_Zusammensetzungsdefinition.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // /****************************************************************************/ -#ifndef NIVissimSingleTypeParser_Zusammensetzungsdefinition_h -#define NIVissimSingleTypeParser_Zusammensetzungsdefinition_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -50,9 +44,3 @@ bool parse(std::istream& from); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The main interface for loading a microsim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -34,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -53,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -130,7 +125,7 @@ throw ProcessError("Invalid network, no network version declared."); } // check whether the loaded net agrees with the simulation options - if (myOptions.getBool("no-internal-links") && myXMLHandler.haveSeenInternalEdge()) { + if (myOptions.getBool("no-internal-links") && myXMLHandler.haveSeenInternalEdge() && myXMLHandler.haveSeenDefaultLength()) { WRITE_WARNING("Network contains internal links but option --no-internal-links is set. Vehicles will 'jump' across junctions and thus underestimate route lengths and travel times."); } buildNet(); @@ -160,8 +155,8 @@ const std::string sourceID = it->first + "-source"; if (MSEdge::dictionary(sinkID) == nullptr && MSEdge::dictionary(sourceID) == nullptr) { // sink must be built and addd before source - MSEdge* sink = myEdgeBuilder.buildEdge(sinkID, EDGEFUNC_CONNECTOR, "", "", -1, 0); - MSEdge* source = myEdgeBuilder.buildEdge(sourceID, EDGEFUNC_CONNECTOR, "", "", -1, 0); + MSEdge* sink = myEdgeBuilder.buildEdge(sinkID, SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0); + MSEdge* source = myEdgeBuilder.buildEdge(sourceID, SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0); sink->setOtherTazConnector(source); source->setOtherTazConnector(sink); MSEdge::dictionary(sinkID, sink); @@ -312,6 +307,7 @@ RandHelper::initRandGlobal(MSRouteHandler::getParsingRNG()); RandHelper::initRandGlobal(MSDevice::getEquipmentRNG()); RandHelper::initRandGlobal(OUProcess::getRNG()); + RandHelper::initRandGlobal(MSDevice_ToC::getResponseTimeRNG()); MSLane::initRNGs(OptionsCont::getOptions()); } @@ -330,9 +326,8 @@ junctions->postloadInitContainer(); routeLoaders = buildRouteLoaderControl(myOptions); tlc = myJunctionBuilder.buildTLLogics(); - const std::vector times = myOptions.getIntVector("save-state.times"); - for (std::vector::const_iterator i = times.begin(); i != times.end(); ++i) { - stateDumpTimes.push_back(TIME2STEPS(*i)); + for (std::string timeStr : myOptions.getStringVector("save-state.times")) { + stateDumpTimes.push_back(string2time(timeStr)); } if (myOptions.isSet("save-state.files")) { stateDumpFiles = myOptions.getStringVector("save-state.files"); diff -Nru sumo-1.5.0+dfsg1/src/netload/NLBuilder.h sumo-1.6.0+dfsg1/src/netload/NLBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The main interface for loading a microsim /****************************************************************************/ -#ifndef NLBuilder_h -#define NLBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -231,9 +225,3 @@ NLBuilder& operator=(const NLBuilder& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLDetectorBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLDetectorBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLDetectorBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLDetectorBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Builds detectors for microsim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -385,7 +380,7 @@ if (MSGlobals::gUseMesoSim) { return new MEInductLoop(id, MSGlobals::gMesoNet->getSegmentForEdge(lane->getEdge(), pos), pos, vTypes); } - return new MSInductLoop(id, lane, pos, vTypes); + return new MSInductLoop(id, lane, pos, vTypes, false); } @@ -458,6 +453,7 @@ const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string& vTypes, + const std::string& writeAttributes, const std::string& device) { if (begin < 0) { throw InvalidArgument("Negative begin time for meandata dump '" + id + "'."); @@ -472,19 +468,19 @@ MSMeanData* det = nullptr; if (type == "" || type == "performance" || type == "traffic") { det = new MSMeanData_Net(id, begin, end, useLanes, withEmpty, - printDefaults, withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, haltSpeed, vTypes); + printDefaults, withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, haltSpeed, vTypes, writeAttributes); } else if (type == "emissions" || type == "hbefa") { if (type == "hbefa") { WRITE_WARNING("The netstate type 'hbefa' is deprecated. Please use the type 'emissions' instead."); } det = new MSMeanData_Emissions(id, begin, end, useLanes, withEmpty, - printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes); + printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes, writeAttributes); } else if (type == "harmonoise") { det = new MSMeanData_Harmonoise(id, begin, end, useLanes, withEmpty, - printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes); + printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes, writeAttributes); } else if (type == "amitran") { det = new MSMeanData_Amitran(id, begin, end, useLanes, withEmpty, - printDefaults, withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, haltSpeed, vTypes); + printDefaults, withInternal, trackVehicles, detectPersons, maxTravelTime, minSamples, haltSpeed, vTypes, writeAttributes); } else { throw InvalidArgument("Invalid type '" + type + "' for meandata dump '" + id + "'."); } diff -Nru sumo-1.5.0+dfsg1/src/netload/NLDetectorBuilder.h sumo-1.6.0+dfsg1/src/netload/NLDetectorBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLDetectorBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLDetectorBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Builds detectors for microsim /****************************************************************************/ -#ifndef NLDetectorBuilder_h -#define NLDetectorBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -345,6 +339,7 @@ const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string& vTypes, + const std::string& writeAttributes, const std::string& device); /// @} @@ -494,9 +489,3 @@ NLDetectorBuilder& operator=(const NLDetectorBuilder&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLDiscreteEventBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLDiscreteEventBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLDiscreteEventBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLDiscreteEventBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // } /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -200,4 +195,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netload/NLDiscreteEventBuilder.h sumo-1.6.0+dfsg1/src/netload/NLDiscreteEventBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLDiscreteEventBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLDiscreteEventBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // missing_desc /****************************************************************************/ -#ifndef NLDiscreteEventBuilder_h -#define NLDiscreteEventBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ MSNet& myNet; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLEdgeControlBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLEdgeControlBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLEdgeControlBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLEdgeControlBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Interface for building edges /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -234,5 +229,5 @@ myActiveEdge->setCrossingEdges(crossingEdges); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netload/NLEdgeControlBuilder.h sumo-1.6.0+dfsg1/src/netload/NLEdgeControlBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLEdgeControlBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLEdgeControlBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Interface for building edges /****************************************************************************/ -#ifndef NLEdgeControlBuilder_h -#define NLEdgeControlBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -201,9 +195,3 @@ NLEdgeControlBuilder& operator=(const NLEdgeControlBuilder& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLHandler.cpp sumo-1.6.0+dfsg1/src/netload/NLHandler.cpp --- sumo-1.5.0+dfsg1/src/netload/NLHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,9 +22,6 @@ /// // The XML-Handler for network loading /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -71,6 +68,7 @@ myAmParsingTLLogicOrJunction(false), myCurrentIsBroken(false), myHaveWarnedAboutInvalidTLType(false), myHaveSeenInternalEdge(false), + myHaveSeenDefaultLength(false), myHaveSeenNeighs(false), myHaveSeenAdditionalSpeedRestrictions(false), myNetworkVersion(0), @@ -356,32 +354,32 @@ myCurrentIsBroken = true; return; } + // parse the function + const SumoXMLEdgeFunc func = attrs.getEdgeFunc(ok); + if (!ok) { + WRITE_ERROR("Edge '" + id + "' has an invalid type."); + myCurrentIsBroken = true; + } // omit internal edges if not wished if (id[0] == ':') { myHaveSeenInternalEdge = true; - if (!MSGlobals::gUsingInternalLanes) { + if (!MSGlobals::gUsingInternalLanes && (func == SumoXMLEdgeFunc::CROSSING || func == SumoXMLEdgeFunc::WALKINGAREA)) { myCurrentIsInternalToSkip = true; return; } std::string junctionID = SUMOXMLDefinitions::getJunctionIDFromInternalEdge(id); myJunctionGraph[id] = std::make_pair(junctionID, junctionID); } else { + myHaveSeenDefaultLength |= !attrs.hasAttribute(SUMO_ATTR_LENGTH); myJunctionGraph[id] = std::make_pair( attrs.get(SUMO_ATTR_FROM, id.c_str(), ok), attrs.get(SUMO_ATTR_TO, id.c_str(), ok)); - if (!ok) { - myCurrentIsBroken = true; - return; - } } - myCurrentIsInternalToSkip = false; - // parse the function - const SumoXMLEdgeFunc func = attrs.getEdgeFunc(ok); if (!ok) { - WRITE_ERROR("Edge '" + id + "' has an invalid type."); myCurrentIsBroken = true; return; } + myCurrentIsInternalToSkip = false; // get the street name const std::string streetName = attrs.getOpt(SUMO_ATTR_NAME, id.c_str(), ok, ""); // get the edge type @@ -392,6 +390,7 @@ const std::string bidi = attrs.getOpt(SUMO_ATTR_BIDI, id.c_str(), ok, ""); // get the kilometrage/mileage (for visualization and output) const double distance = attrs.getOpt(SUMO_ATTR_DISTANCE, id.c_str(), ok, 0); + if (!ok) { myCurrentIsBroken = true; return; @@ -404,7 +403,7 @@ myCurrentIsBroken = true; } - if (func == EDGEFUNC_CROSSING) { + if (func == SumoXMLEdgeFunc::CROSSING) { //get the crossingEdges attribute (to implement the other side of the road pushbutton) const std::string crossingEdges = attrs.getOpt(SUMO_ATTR_CROSSING_EDGES, id.c_str(), ok, ""); if (!crossingEdges.empty()) { @@ -519,6 +518,7 @@ ok = false; } std::string key = attrs.getOpt(SUMO_ATTR_KEY, id.c_str(), ok, ""); + std::string name = attrs.getOpt(SUMO_ATTR_NAME, id.c_str(), ok, ""); // incoming lanes std::vector incomingLanes; parseLanes(id, attrs.getStringSecure(SUMO_ATTR_INCLANES, ""), incomingLanes, ok); @@ -531,7 +531,7 @@ myCurrentIsBroken = true; } else { try { - myJunctionControlBuilder.openJunction(id, key, type, Position(x, y, z), shape, incomingLanes, internalLanes); + myJunctionControlBuilder.openJunction(id, key, type, Position(x, y, z), shape, incomingLanes, internalLanes, name); } catch (InvalidArgument& e) { WRITE_ERROR(e.what() + std::string("\n Can not build according junction.")); myCurrentIsBroken = true; @@ -693,7 +693,7 @@ bool ok = true; std::string id = attrs.get(SUMO_ATTR_ID, nullptr, ok); std::string programID = attrs.getOpt(SUMO_ATTR_PROGRAMID, id.c_str(), ok, ""); - TrafficLightType type = TLTYPE_STATIC; + TrafficLightType type = TrafficLightType::STATIC; std::string typeS; if (myJunctionControlBuilder.getTLLogicControlToUse().get(id, programID) == nullptr) { // SUMO_ATTR_TYPE is not needed when only modifying the offset of an @@ -708,12 +708,12 @@ } else { WRITE_ERROR("Traffic light '" + id + "' has unknown type '" + typeS + "'."); } - if (MSGlobals::gUseMesoSim && type == TLTYPE_ACTUATED) { + if (MSGlobals::gUseMesoSim && type == TrafficLightType::ACTUATED) { if (!myHaveWarnedAboutInvalidTLType) { - WRITE_WARNING("Traffic light type '" + toString(type) + "' cannot be used in mesoscopic simulation. Using '" + toString(TLTYPE_STATIC) + "' as fallback"); + WRITE_WARNING("Traffic light type '" + toString(type) + "' cannot be used in mesoscopic simulation. Using '" + toString(TrafficLightType::STATIC) + "' as fallback"); myHaveWarnedAboutInvalidTLType = true; } - type = TLTYPE_STATIC; + type = TrafficLightType::STATIC; } } // @@ -1166,6 +1166,7 @@ const std::string file = attrs.get(SUMO_ATTR_FILE, id.c_str(), ok); const std::string type = attrs.getOpt(SUMO_ATTR_TYPE, id.c_str(), ok, "performance"); std::string vtypes = attrs.getOpt(SUMO_ATTR_VTYPES, id.c_str(), ok, ""); + const std::string writeAttributes = attrs.getOpt(SUMO_ATTR_WRITE_ATTRIBUTES, id.c_str(), ok, ""); const SUMOTime frequency = attrs.getOptSUMOTimeReporting(SUMO_ATTR_FREQUENCY, id.c_str(), ok, -1); const SUMOTime begin = attrs.getOptSUMOTimeReporting(SUMO_ATTR_BEGIN, id.c_str(), ok, string2time(OptionsCont::getOptions().getString("begin"))); const SUMOTime end = attrs.getOptSUMOTimeReporting(SUMO_ATTR_END, id.c_str(), ok, string2time(OptionsCont::getOptions().getString("end"))); @@ -1175,7 +1176,7 @@ int detectPersons = 0; for (std::string mode : StringTokenizer(detectPersonsString).getVector()) { if (SUMOXMLDefinitions::PersonModeValues.hasString(mode)) { - detectPersons |= SUMOXMLDefinitions::PersonModeValues.get(mode); + detectPersons |= (int)SUMOXMLDefinitions::PersonModeValues.get(mode); } else { WRITE_ERROR("Invalid person mode '" + mode + "' in edgeData definition '" + id + "'"); return; @@ -1187,7 +1188,7 @@ // equivalent to TplConvert::_2bool used in SUMOSAXAttributes::getBool excludeEmpty[0] != 't' && excludeEmpty[0] != 'T' && excludeEmpty[0] != '1' && excludeEmpty[0] != 'x', excludeEmpty == "defaults", withInternal, trackVehicles, detectPersons, - maxTravelTime, minSamples, haltingSpeedThreshold, vtypes, + maxTravelTime, minSamples, haltingSpeedThreshold, vtypes, writeAttributes, FileHelpers::checkForRelativity(file, getFileName())); } catch (InvalidArgument& e) { WRITE_ERROR(e.what()); @@ -1249,8 +1250,8 @@ // make sure that the index is in range logic = myJunctionControlBuilder.getTLLogic(tlID).getActive(); if ((tlLinkIdx < 0 || tlLinkIdx >= (int)logic->getCurrentPhaseDef().getState().size()) - && logic->getLogicType() != TLTYPE_RAIL_SIGNAL - && logic->getLogicType() != TLTYPE_RAIL_CROSSING) { + && logic->getLogicType() != TrafficLightType::RAIL_SIGNAL + && logic->getLogicType() != TrafficLightType::RAIL_CROSSING) { WRITE_ERROR("Invalid " + toString(SUMO_ATTR_TLLINKINDEX) + " '" + toString(tlLinkIdx) + "' in connection controlled by '" + tlID + "'"); return; @@ -1354,13 +1355,13 @@ return; } try { - MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink", EDGEFUNC_CONNECTOR, "", "", -1, 0); + MSEdge* sink = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-sink", SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0); if (!MSEdge::dictionary(myCurrentDistrictID + "-sink", sink)) { delete sink; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-sink' exists."); } sink->initialize(new std::vector()); - MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source", EDGEFUNC_CONNECTOR, "", "", -1, 0); + MSEdge* source = myEdgeControlBuilder.buildEdge(myCurrentDistrictID + "-source", SumoXMLEdgeFunc::CONNECTOR, "", "", -1, 0); if (!MSEdge::dictionary(myCurrentDistrictID + "-source", source)) { delete source; throw InvalidArgument("Another edge with the id '" + myCurrentDistrictID + "-source' exists."); @@ -1479,4 +1480,6 @@ } return lane->geometryPositionAtOffset(lanePos, -lanePosLat); } + + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netload/NLHandler.h sumo-1.6.0+dfsg1/src/netload/NLHandler.h --- sumo-1.5.0+dfsg1/src/netload/NLHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The XML-Handler for network loading /****************************************************************************/ -#ifndef NLHandler_h -#define NLHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -109,6 +103,10 @@ return myHaveSeenInternalEdge; } + bool haveSeenDefaultLength() const { + return myHaveSeenDefaultLength; + } + bool haveSeenNeighs() const { return myHaveSeenNeighs; } @@ -330,6 +328,9 @@ /// @brief whether the loaded network contains internal lanes bool myHaveSeenInternalEdge; + /// @brief whether the loaded network contains edges with default lengths + bool myHaveSeenDefaultLength; + /// @brief whether the loaded network contains explicit neighbor lanes bool myHaveSeenNeighs; @@ -354,11 +355,3 @@ NLHandler& operator=(const NLHandler& s); }; - - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLJunctionControlBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLJunctionControlBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLJunctionControlBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLJunctionControlBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Builder of microsim-junctions and tls /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -94,7 +89,8 @@ const Position pos, const PositionVector& shape, const std::vector& incomingLanes, - const std::vector& internalLanes) { + const std::vector& internalLanes, + const std::string& name) { myActiveInternalLanes = internalLanes; myActiveIncomingLanes = incomingLanes; myActiveID = id; @@ -102,6 +98,7 @@ myType = type; myPosition.set(pos); myShape = shape; + myActiveName = name; myAdditionalParameter.clear(); } @@ -113,33 +110,33 @@ } MSJunction* junction = nullptr; switch (myType) { - case NODETYPE_NOJUNCTION: - case NODETYPE_DEAD_END: - case NODETYPE_DEAD_END_DEPRECATED: - case NODETYPE_DISTRICT: - case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: + case SumoXMLNodeType::NOJUNCTION: + case SumoXMLNodeType::DEAD_END: + case SumoXMLNodeType::DEAD_END_DEPRECATED: + case SumoXMLNodeType::DISTRICT: + case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: junction = buildNoLogicJunction(); break; - case NODETYPE_TRAFFIC_LIGHT: - case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: - case NODETYPE_RIGHT_BEFORE_LEFT: - case NODETYPE_PRIORITY: - case NODETYPE_PRIORITY_STOP: - case NODETYPE_ALLWAY_STOP: - case NODETYPE_ZIPPER: + case SumoXMLNodeType::TRAFFIC_LIGHT: + case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: + case SumoXMLNodeType::PRIORITY: + case SumoXMLNodeType::PRIORITY_STOP: + case SumoXMLNodeType::ALLWAY_STOP: + case SumoXMLNodeType::ZIPPER: junction = buildLogicJunction(); break; - case NODETYPE_INTERNAL: + case SumoXMLNodeType::INTERNAL: if (MSGlobals::gUsingInternalLanes) { junction = buildInternalJunction(); } break; - case NODETYPE_RAIL_SIGNAL: - case NODETYPE_RAIL_CROSSING: + case SumoXMLNodeType::RAIL_SIGNAL: + case SumoXMLNodeType::RAIL_CROSSING: myOffset = 0; myActiveKey = myActiveID; myActiveProgram = "0"; - myLogicType = myType == NODETYPE_RAIL_SIGNAL ? TLTYPE_RAIL_SIGNAL : TLTYPE_RAIL_CROSSING; + myLogicType = myType == SumoXMLNodeType::RAIL_SIGNAL ? TrafficLightType::RAIL_SIGNAL : TrafficLightType::RAIL_CROSSING; closeTrafficLightLogic(basePath); junction = buildLogicJunction(); break; @@ -165,7 +162,7 @@ MSJunction* NLJunctionControlBuilder::buildNoLogicJunction() { - return new MSNoLogicJunction(myActiveID, myType, myPosition, myShape, + return new MSNoLogicJunction(myActiveID, myType, myPosition, myShape, myActiveName, myActiveIncomingLanes, myActiveInternalLanes); } @@ -174,7 +171,8 @@ NLJunctionControlBuilder::buildLogicJunction() { MSJunctionLogic* jtype = getJunctionLogicSecure(); // build the junction - return new MSRightOfWayJunction(myActiveID, myType, myPosition, myShape, myActiveIncomingLanes, + return new MSRightOfWayJunction(myActiveID, myType, myPosition, myShape, myActiveName, + myActiveIncomingLanes, myActiveInternalLanes, jtype); } @@ -220,7 +218,7 @@ int step = 0; MSTrafficLightLogic* existing = nullptr; MSSimpleTrafficLightLogic::Phases::const_iterator i = myActivePhases.begin(); - if (myLogicType != TLTYPE_RAIL_SIGNAL && myLogicType != TLTYPE_RAIL_CROSSING) { + if (myLogicType != TrafficLightType::RAIL_SIGNAL && myLogicType != TrafficLightType::RAIL_CROSSING) { if (myAbsDuration == 0) { existing = getTLLogicControlToUse().get(myActiveKey, myActiveProgram); if (existing == nullptr) { @@ -259,29 +257,29 @@ MSTrafficLightLogic* tlLogic = nullptr; // build the tls-logic in dependance to its type switch (myLogicType) { - case TLTYPE_SWARM_BASED: + case TrafficLightType::SWARM_BASED: firstEventOffset = DELTA_T; //this is needed because swarm needs to update the pheromone on the lanes at every step tlLogic = new MSSwarmTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myActivePhases, step, firstEventOffset, myAdditionalParameter); break; - case TLTYPE_HILVL_DETERMINISTIC: + case TrafficLightType::HILVL_DETERMINISTIC: tlLogic = new MSDeterministicHiLevelTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myActivePhases, step, firstEventOffset, myAdditionalParameter); break; - case TLTYPE_SOTL_REQUEST: + case TrafficLightType::SOTL_REQUEST: tlLogic = new MSSOTLPolicyBasedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myLogicType, myActivePhases, step, firstEventOffset, myAdditionalParameter, new MSSOTLRequestPolicy(myAdditionalParameter)); break; - case TLTYPE_SOTL_PLATOON: + case TrafficLightType::SOTL_PLATOON: tlLogic = new MSSOTLPolicyBasedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myLogicType, myActivePhases, step, firstEventOffset, myAdditionalParameter, new MSSOTLPlatoonPolicy(myAdditionalParameter)); break; - case TLTYPE_SOTL_WAVE: + case TrafficLightType::SOTL_WAVE: tlLogic = new MSSOTLWaveTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myActivePhases, step, firstEventOffset, myAdditionalParameter); break; - case TLTYPE_SOTL_PHASE: + case TrafficLightType::SOTL_PHASE: tlLogic = new MSSOTLPolicyBasedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myLogicType, myActivePhases, step, firstEventOffset, myAdditionalParameter, new MSSOTLPhasePolicy(myAdditionalParameter)); break; - case TLTYPE_SOTL_MARCHING: + case TrafficLightType::SOTL_MARCHING: tlLogic = new MSSOTLPolicyBasedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myLogicType, myActivePhases, step, firstEventOffset, myAdditionalParameter, new MSSOTLMarchingPolicy(myAdditionalParameter)); break; - case TLTYPE_ACTUATED: + case TrafficLightType::ACTUATED: // @note it is unclear how to apply the given offset in the context // of variable-length phases tlLogic = new MSActuatedTrafficLightLogic(getTLLogicControlToUse(), @@ -289,32 +287,32 @@ myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), myAdditionalParameter, basePath); break; - case TLTYPE_DELAYBASED: + case TrafficLightType::DELAYBASED: tlLogic = new MSDelayBasedTrafficLightLogic(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myActivePhases, step, (*i)->minDuration + myNet.getCurrentTimeStep(), myAdditionalParameter, basePath); break; - case TLTYPE_STATIC: + case TrafficLightType::STATIC: tlLogic = new MSSimpleTrafficLightLogic(getTLLogicControlToUse(), - myActiveKey, myActiveProgram, TLTYPE_STATIC, + myActiveKey, myActiveProgram, TrafficLightType::STATIC, myActivePhases, step, firstEventOffset, myAdditionalParameter); break; - case TLTYPE_RAIL_SIGNAL: + case TrafficLightType::RAIL_SIGNAL: tlLogic = new MSRailSignal(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myNet.getCurrentTimeStep(), myAdditionalParameter); break; - case TLTYPE_RAIL_CROSSING: + case TrafficLightType::RAIL_CROSSING: tlLogic = new MSRailCrossing(getTLLogicControlToUse(), myActiveKey, myActiveProgram, myNet.getCurrentTimeStep(), myAdditionalParameter); break; - case TLTYPE_OFF: + case TrafficLightType::OFF: tlLogic = new MSOffTrafficLightLogic(getTLLogicControlToUse(), myActiveKey); break; - case TLTYPE_INVALID: + case TrafficLightType::INVALID: throw ProcessError("Invalid traffic light type '" + toString(myLogicType) + "'"); } myActivePhases.clear(); @@ -503,4 +501,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netload/NLJunctionControlBuilder.h sumo-1.6.0+dfsg1/src/netload/NLJunctionControlBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLJunctionControlBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLJunctionControlBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Builder of microsim-junctions and tls /****************************************************************************/ -#ifndef NLJunctionControlBuilder_h -#define NLJunctionControlBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -105,7 +99,8 @@ const Position pos, const PositionVector& shape, const std::vector& incomingLanes, - const std::vector& internalLanes); + const std::vector& internalLanes, + const std::string& name); /** @brief Closes (ends) the processing of the current junction @@ -386,6 +381,8 @@ /// @brief The shape of the current junction PositionVector myShape; + /// @brief the name of the current junction + std::string myActiveName; /// @brief The container for information which junctions shall be initialised using which values std::vector myLogics2PostLoadInit; @@ -422,9 +419,3 @@ bool myNetIsLoaded; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netload/NLTriggerBuilder.cpp sumo-1.6.0+dfsg1/src/netload/NLTriggerBuilder.cpp --- sumo-1.5.0+dfsg1/src/netload/NLTriggerBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLTriggerBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Builds trigger objects for microsim /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -502,8 +497,9 @@ const std::vector& lines = attrs.getOptStringVector(SUMO_ATTR_LINES, id.c_str(), ok, false); const int defaultCapacity = MAX2(MSStoppingPlace::getPersonsAbreast(topos - frompos) * 3, 6); const int personCapacity = attrs.getOpt(SUMO_ATTR_PERSON_CAPACITY, id.c_str(), ok, defaultCapacity); + const double parkingLength = attrs.getOpt(SUMO_ATTR_PARKING_LENGTH, id.c_str(), ok, 0); // build the bus stop - buildStoppingPlace(net, id, lines, lane, frompos, topos, element, ptStopName, personCapacity); + buildStoppingPlace(net, id, lines, lane, frompos, topos, element, ptStopName, personCapacity, parkingLength); } @@ -741,8 +737,8 @@ void NLTriggerBuilder::buildStoppingPlace(MSNet& net, std::string id, std::vector lines, MSLane* lane, - double frompos, double topos, const SumoXMLTag element, std::string ptStopName, int personCapacity) { - myCurrentStop = new MSStoppingPlace(id, lines, *lane, frompos, topos, ptStopName, personCapacity); + double frompos, double topos, const SumoXMLTag element, std::string ptStopName, int personCapacity, double parkingLength) { + myCurrentStop = new MSStoppingPlace(id, lines, *lane, frompos, topos, ptStopName, personCapacity, parkingLength); if (!net.addStoppingPlace(element, myCurrentStop)) { delete myCurrentStop; myCurrentStop = nullptr; @@ -932,4 +928,5 @@ return myParkingArea == nullptr ? myCurrentStop : myParkingArea; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netload/NLTriggerBuilder.h sumo-1.6.0+dfsg1/src/netload/NLTriggerBuilder.h --- sumo-1.5.0+dfsg1/src/netload/NLTriggerBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netload/NLTriggerBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ /// // Builds trigger objects for microsim /****************************************************************************/ -#ifndef NLTriggerBuilder_h -#define NLTriggerBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -313,7 +307,8 @@ * @exception InvalidArgument If the stop can not be added to the net (is duplicate) */ virtual void buildStoppingPlace(MSNet& net, std::string id, std::vector lines, MSLane* lane, - double frompos, double topos, const SumoXMLTag element, std::string string, int personCapacity); + double frompos, double topos, const SumoXMLTag element, std::string string, + int personCapacity, double parkingLength); /** @brief Builds a charging station * @@ -491,9 +486,3 @@ bool myHaveWarnedAboutEigen = false; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWFrame.cpp sumo-1.6.0+dfsg1/src/netwrite/NWFrame.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for netwrite /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -197,5 +192,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWFrame.h sumo-1.6.0+dfsg1/src/netwrite/NWFrame.h --- sumo-1.5.0+dfsg1/src/netwrite/NWFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Sets and checks options for netwrite /****************************************************************************/ -#ifndef NWFrame_h -#define NWFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -62,9 +56,3 @@ static void writePositionLong(const Position& pos, OutputDevice& dev); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_Amitran.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_Amitran.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_Amitran.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_Amitran.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Exporter writing networks using the Amitran format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -81,40 +76,40 @@ continue; } switch (i->second->getType()) { - case NODETYPE_TRAFFIC_LIGHT: - case NODETYPE_TRAFFIC_LIGHT_NOJUNCTION: - case NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED: + case SumoXMLNodeType::TRAFFIC_LIGHT: + case SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION: + case SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED: device << "\" type=\"trafficLight"; break; - case NODETYPE_PRIORITY: + case SumoXMLNodeType::PRIORITY: device << "\" type=\"priority"; break; - case NODETYPE_PRIORITY_STOP: + case SumoXMLNodeType::PRIORITY_STOP: device << "\" type=\"priorityStop"; break; - case NODETYPE_RIGHT_BEFORE_LEFT: + case SumoXMLNodeType::RIGHT_BEFORE_LEFT: device << "\" type=\"rightBeforeLeft"; break; - case NODETYPE_ALLWAY_STOP: + case SumoXMLNodeType::ALLWAY_STOP: device << "\" type=\"allwayStop"; break; - case NODETYPE_ZIPPER: + case SumoXMLNodeType::ZIPPER: device << "\" type=\"zipper"; break; - case NODETYPE_RAIL_SIGNAL: + case SumoXMLNodeType::RAIL_SIGNAL: device << "\" type=\"railSignal"; break; - case NODETYPE_RAIL_CROSSING: + case SumoXMLNodeType::RAIL_CROSSING: device << "\" type=\"railCrossing"; break; - case NODETYPE_DEAD_END: - case NODETYPE_DEAD_END_DEPRECATED: + case SumoXMLNodeType::DEAD_END: + case SumoXMLNodeType::DEAD_END_DEPRECATED: device << "\" type=\"deadEnd"; break; - case NODETYPE_DISTRICT: - case NODETYPE_NOJUNCTION: - case NODETYPE_INTERNAL: - case NODETYPE_UNKNOWN: + case SumoXMLNodeType::DISTRICT: + case SumoXMLNodeType::NOJUNCTION: + case SumoXMLNodeType::INTERNAL: + case SumoXMLNodeType::UNKNOWN: break; } device << "\"/>\n"; @@ -137,4 +132,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_Amitran.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_Amitran.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_Amitran.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_Amitran.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Exporter writing networks using the Amitran format /****************************************************************************/ -#ifndef NWWriter_Amitran_h -#define NWWriter_Amitran_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -52,9 +46,3 @@ static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Exporter writing networks using DlrNavteq (Elmar) format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -152,14 +147,14 @@ // negated edge id to determine spread type. We may need to do some // shifting to make this consistent const bool hasOppositeID = ec.getOppositeByID(e->getID()) != nullptr; - if (e->getLaneSpreadFunction() == LANESPREAD_RIGHT && !hasOppositeID) { + if (e->getLaneSpreadFunction() == LaneSpreadFunction::RIGHT && !hasOppositeID) { // need to write center-line geometry instead try { geom.move2side(e->getTotalWidth() / 2); } catch (InvalidArgument& exception) { WRITE_WARNING("Could not reconstruct shape for edge:'" + e->getID() + "' (" + exception.what() + ")."); } - } else if (e->getLaneSpreadFunction() == LANESPREAD_CENTER && hasOppositeID) { + } else if (e->getLaneSpreadFunction() == LaneSpreadFunction::CENTER && hasOppositeID) { // need to write left-border geometry instead try { geom.move2side(-e->getTotalWidth() / 2); @@ -558,5 +553,5 @@ device.close(); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_DlrNavteq.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Exporter writing networks using DlrNavteq (Elmar) format /****************************************************************************/ -#ifndef NWWriter_DlrNavteq_h -#define NWWriter_DlrNavteq_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -135,9 +129,3 @@ return (int)std::floor(metersPerSecond * 3.6 + 0.5); } }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_MATSim.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_MATSim.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_MATSim.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_MATSim.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Exporter writing networks using the MATSim format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "NWWriter_MATSim.h" #include @@ -83,4 +78,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_MATSim.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_MATSim.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_MATSim.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_MATSim.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Exporter writing networks using the MATSim format /****************************************************************************/ -#ifndef NWWriter_MATSim_h -#define NWWriter_MATSim_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ static void writeNetwork(const OptionsCont& oc, NBNetBuilder& nb); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_OpenDrive.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_OpenDrive.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_OpenDrive.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_OpenDrive.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -123,7 +118,7 @@ device.lf(); // write junction-internal edges (road). In OpenDRIVE these are called 'paths' or 'connecting roads' - OutputDevice_String junctionOSS(false, 3); + OutputDevice_String junctionOSS(3); for (std::map::const_iterator i = nc.begin(); i != nc.end(); ++i) { NBNode* n = (*i).second; int connectionID = 0; // unique within a junction @@ -228,9 +223,9 @@ const double straightThresh, const ShapeContainer& shc) { // buffer output because some fields are computed out of order - OutputDevice_String elevationOSS(false, 3); + OutputDevice_String elevationOSS(3); elevationOSS.setPrecision(8); - OutputDevice_String planViewOSS(false, 2); + OutputDevice_String planViewOSS(2); planViewOSS.setPrecision(8); double length = 0; @@ -408,7 +403,7 @@ device.openTag("type").writeAttr("s", 0).writeAttr("type", "town").closeTag(); device.openTag("planView"); device.setPrecision(8); // geometry hdg requires higher precision - OutputDevice_String elevationOSS(false, 3); + OutputDevice_String elevationOSS(3); elevationOSS.setPrecision(8); #ifdef DEBUG_SMOOTH_GEOM if (DEBUGCOND) { @@ -456,7 +451,7 @@ } else if (!inEdge->getToNode()->geometryLike()) { // draw shorter road marks to indicate turning paths LinkDirection dir = inEdge->getToNode()->getDirection(inEdge, outEdge, OptionsCont::getOptions().getBool("lefthand")); - if (dir == LINKDIR_LEFT || dir == LINKDIR_RIGHT || dir == LINKDIR_PARTLEFT || dir == LINKDIR_PARTRIGHT) { + if (dir == LinkDirection::LEFT || dir == LinkDirection::RIGHT || dir == LinkDirection::PARTLEFT || dir == LinkDirection::PARTRIGHT) { // XXX is not rendered by odrViewer so cannot be validated // device << " \n"; // device << " \n"; @@ -933,5 +928,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_OpenDrive.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_OpenDrive.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_OpenDrive.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_OpenDrive.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Exporter writing networks using the openDRIVE format /****************************************************************************/ -#ifndef NWWriter_OpenDrive_h -#define NWWriter_OpenDrive_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -114,9 +108,3 @@ /// @brief write road objects referenced as edge parameters static void writeRoadObjects(OutputDevice& device, const NBEdge* e, const ShapeContainer& shc); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_SUMO.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_SUMO.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_SUMO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_SUMO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Exporter writing networks using the SUMO format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -97,6 +92,9 @@ if (!oc.isDefault("tls.ignore-internal-junction-jam")) { attrs[SUMO_ATTR_TLS_IGNORE_INTERNAL_JUNCTION_JAM] = toString(oc.getBool("tls.ignore-internal-junction-jam")); } + if (oc.getString("default.spreadtype") != "right") { + attrs[SUMO_ATTR_SPREADTYPE] = oc.getString("default.spreadtype"); + } device.writeXMLHeader("net", "net_file.xsd", attrs); // street names may contain non-ascii chars device.lf(); // get involved container @@ -176,7 +174,7 @@ // write connections from pedestrian crossings std::vector crossings = node->getCrossings(); for (auto c : crossings) { - NWWriter_SUMO::writeInternalConnection(device, c->id, c->nextWalkingArea, 0, 0, "", LINKDIR_STRAIGHT, c->tlID, c->tlLinkIndex2); + NWWriter_SUMO::writeInternalConnection(device, c->id, c->nextWalkingArea, 0, 0, "", LinkDirection::STRAIGHT, c->tlID, c->tlLinkIndex2); } // write connections from pedestrian walking areas for (const NBNode::WalkingArea& wa : node->getWalkingAreas()) { @@ -193,7 +191,7 @@ assert(nextCrossing.tlLinkIndex >= 0); device.writeAttr(SUMO_ATTR_TLLINKINDEX, nextCrossing.tlLinkIndex); } - device.writeAttr(SUMO_ATTR_DIR, LINKDIR_STRAIGHT); + device.writeAttr(SUMO_ATTR_DIR, LinkDirection::STRAIGHT); device.writeAttr(SUMO_ATTR_STATE, nextCrossing.priority ? LINKSTATE_MAJOR : LINKSTATE_MINOR); device.closeTag(); } @@ -252,8 +250,8 @@ && predOpp == conOpp.toEdge && succOpp->getLaneID(conOpp.fromLane) == succ.oppositeID && predOpp->getLaneID(conOpp.toLane) == pred.oppositeID - && from->getToNode()->getDirection(from, con.toEdge, lefthand) == LINKDIR_STRAIGHT - && from->getToNode()->getDirection(succOpp, predOpp, lefthand) == LINKDIR_STRAIGHT + && from->getToNode()->getDirection(from, con.toEdge, lefthand) == LinkDirection::STRAIGHT + && from->getToNode()->getDirection(succOpp, predOpp, lefthand) == LinkDirection::STRAIGHT ) { #ifdef DEBUG_OPPOSITE_INTERNAL std::cout << " found " << conOpp.getInternalLaneID() << "\n"; @@ -330,7 +328,7 @@ edgeID = k.id; into.openTag(SUMO_TAG_EDGE); into.writeAttr(SUMO_ATTR_ID, edgeID); - into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_INTERNAL); + into.writeAttr(SUMO_ATTR_FUNCTION, SumoXMLEdgeFunc::INTERNAL); if (e->isBidiRail() && k.toEdge->isBidiRail() && e != k.toEdge->getTurnDestination(true)) { try { @@ -371,13 +369,13 @@ const NBEdge::Lane& successor = k.toEdge->getLanes()[k.toLane]; into.openTag(SUMO_TAG_EDGE); into.writeAttr(SUMO_ATTR_ID, k.viaID); - into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_INTERNAL); + into.writeAttr(SUMO_ATTR_FUNCTION, SumoXMLEdgeFunc::INTERNAL); SVCPermissions permissions = (k.permissions != SVC_UNSPECIFIED) ? k.permissions : ( successor.permissions & e->getPermissions(k.fromLane)); writeLane(into, k.viaID + "_0", k.vmax, permissions, successor.preferred, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_OFFSET, std::map(), successor.width, k.viaShape, &k, - MAX2(k.viaShape.length(), POSITION_EPS), // microsim needs positive length + MAX2(k.viaLength, POSITION_EPS), // microsim needs positive length 0, "", ""); into.closeTag(); } @@ -388,7 +386,7 @@ for (auto c : n.getCrossings()) { into.openTag(SUMO_TAG_EDGE); into.writeAttr(SUMO_ATTR_ID, c->id); - into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_CROSSING); + into.writeAttr(SUMO_ATTR_FUNCTION, SumoXMLEdgeFunc::CROSSING); into.writeAttr(SUMO_ATTR_CROSSING_EDGES, c->edges); writeLane(into, c->id + "_0", 1, SVC_PEDESTRIAN, 0, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_OFFSET, @@ -402,7 +400,7 @@ const NBNode::WalkingArea& wa = *it; into.openTag(SUMO_TAG_EDGE); into.writeAttr(SUMO_ATTR_ID, wa.id); - into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_WALKINGAREA); + into.writeAttr(SUMO_ATTR_FUNCTION, SumoXMLEdgeFunc::WALKINGAREA); writeLane(into, wa.id + "_0", 1, SVC_PEDESTRIAN, 0, NBEdge::UNSPECIFIED_OFFSET, NBEdge::UNSPECIFIED_OFFSET, std::map(), wa.width, wa.shape, nullptr, wa.length, 0, "", "", false, wa.hasCustomShape); @@ -426,10 +424,10 @@ into.writeAttr(SUMO_ATTR_TYPE, e.getTypeID()); } if (e.isMacroscopicConnector()) { - into.writeAttr(SUMO_ATTR_FUNCTION, EDGEFUNC_CONNECTOR); + into.writeAttr(SUMO_ATTR_FUNCTION, SumoXMLEdgeFunc::CONNECTOR); } // write the spread type if not default ("right") - if (e.getLaneSpreadFunction() != LANESPREAD_RIGHT) { + if (e.getLaneSpreadFunction() != LaneSpreadFunction::RIGHT) { into.writeAttr(SUMO_ATTR_SPREADTYPE, e.getLaneSpreadFunction()); } if (e.hasLoadedLength()) { @@ -550,15 +548,12 @@ into.writeAttr(SUMO_ATTR_TYPE, n.getType()); NWFrame::writePositionLong(n.getPosition(), into); // write the incoming lanes - std::string incLanes; + std::vector incLanes; const std::vector& incoming = n.getIncomingEdges(); for (std::vector::const_iterator i = incoming.begin(); i != incoming.end(); ++i) { int noLanes = (*i)->getNumLanes(); for (int j = 0; j < noLanes; j++) { - incLanes += (*i)->getLaneID(j); - if (i != incoming.end() - 1 || j < noLanes - 1) { - incLanes += ' '; - } + incLanes.push_back((*i)->getLaneID(j)); } } std::vector crossings = n.getCrossings(); @@ -566,36 +561,31 @@ // avoid duplicates for (auto c : crossings) { if (prevWAs.count(c->prevWalkingArea) == 0) { - incLanes += ' ' + c->prevWalkingArea + "_0"; + incLanes.push_back(c->prevWalkingArea + "_0"); prevWAs.insert(c->prevWalkingArea); } } into.writeAttr(SUMO_ATTR_INCLANES, incLanes); // write the internal lanes - std::string intLanes; + std::vector intLanes; if (!OptionsCont::getOptions().getBool("no-internal-links")) { - int l = 0; for (EdgeVector::const_iterator i = incoming.begin(); i != incoming.end(); i++) { const std::vector& elv = (*i)->getConnections(); for (std::vector::const_iterator k = elv.begin(); k != elv.end(); ++k) { if ((*k).toEdge == nullptr) { continue; } - if (l != 0) { - intLanes += ' '; - } if (!(*k).haveVia) { - intLanes += (*k).getInternalLaneID(); + intLanes.push_back((*k).getInternalLaneID()); } else { - intLanes += (*k).viaID + "_0"; + intLanes.push_back((*k).viaID + "_0"); } - l++; } } } - if (n.getType() != NODETYPE_DEAD_END && n.getType() != NODETYPE_NOJUNCTION) { + if (n.getType() != SumoXMLNodeType::DEAD_END && n.getType() != SumoXMLNodeType::NOJUNCTION) { for (auto c : crossings) { - intLanes += ' ' + c->id + "_0"; + intLanes.push_back(c->id + "_0"); } } into.writeAttr(SUMO_ATTR_INTLANES, intLanes); @@ -609,13 +599,16 @@ if (n.hasCustomShape()) { into.writeAttr(SUMO_ATTR_CUSTOMSHAPE, true); } - if (n.getRightOfWay() != RIGHT_OF_WAY_DEFAULT) { + if (n.getRightOfWay() != RightOfWay::DEFAULT) { into.writeAttr(SUMO_ATTR_RIGHT_OF_WAY, toString(n.getRightOfWay())); } - if (n.getFringeType() != FRINGE_TYPE_DEFAULT) { + if (n.getFringeType() != FringeType::DEFAULT) { into.writeAttr(SUMO_ATTR_FRINGE, toString(n.getFringeType())); } - if (n.getType() != NODETYPE_DEAD_END) { + if (n.getName() != "") { + into.writeAttr(SUMO_ATTR_NAME, n.getName()); + } + if (n.getType() != SumoXMLNodeType::DEAD_END) { // write right-of-way logics n.writeLogic(into); } @@ -652,7 +645,7 @@ } Position pos = (*k).shape[-1]; into.openTag(SUMO_TAG_JUNCTION).writeAttr(SUMO_ATTR_ID, (*k).viaID + "_0"); - into.writeAttr(SUMO_ATTR_TYPE, NODETYPE_INTERNAL); + into.writeAttr(SUMO_ATTR_TYPE, SumoXMLNodeType::INTERNAL); NWFrame::writePositionLong(pos, into); std::string incLanes = (*k).getInternalLaneID(); std::vector foeIDs; @@ -704,6 +697,9 @@ if (c.speed != NBEdge::UNSPECIFIED_SPEED && style != TLL) { into.writeAttr(SUMO_ATTR_SPEED, c.speed); } + if (c.customLength != NBEdge::UNSPECIFIED_LOADED_LENGTH && style != TLL) { + into.writeAttr(SUMO_ATTR_LENGTH, c.customLength); + } if (c.customShape.size() != 0 && style != TLL) { if (geoAccuracy) { into.setPrecision(gPrecisionGeo); @@ -731,7 +727,7 @@ if (style == SUMONET) { // write the direction information LinkDirection dir = from.getToNode()->getDirection(&from, c.toEdge, OptionsCont::getOptions().getBool("lefthand")); - assert(dir != LINKDIR_NODIR); + assert(dir != LinkDirection::NODIR); into.writeAttr(SUMO_ATTR_DIR, toString(dir)); // write the state information const LinkState linkState = from.getToNode()->getLinkState( @@ -939,7 +935,7 @@ into.writeAttr(SUMO_ATTR_PROGRAMID, logic->getProgramID()); into.writeAttr(SUMO_ATTR_OFFSET, writeSUMOTime(logic->getOffset())); // write the phases - const bool varPhaseLength = logic->getType() != TLTYPE_STATIC; + const bool varPhaseLength = logic->getType() != TrafficLightType::STATIC; for (const NBTrafficLightLogic::PhaseDefinition& phase : logic->getPhases()) { into.openTag(SUMO_TAG_PHASE); into.writeAttr(SUMO_ATTR_DURATION, writeSUMOTime(phase.duration)); @@ -996,5 +992,5 @@ into.closeTag(); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_SUMO.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_SUMO.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_SUMO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_SUMO.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Exporter writing networks using the SUMO format /****************************************************************************/ -#ifndef NWWriter_SUMO_h -#define NWWriter_SUMO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -185,7 +179,7 @@ static void writeInternalConnection(OutputDevice& into, const std::string& from, const std::string& to, int fromLane, int toLane, const std::string& via, - LinkDirection dir = LINKDIR_STRAIGHT, + LinkDirection dir = LinkDirection::STRAIGHT, const std::string& tlID = "", int linkIndex = NBConnection::InvalidTlIndex); @@ -208,9 +202,3 @@ static std::string getOppositeInternalID(const NBEdgeCont& ec, const NBEdge* from, const NBEdge::Connection& con, double& oppositeLength); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_XML.cpp sumo-1.6.0+dfsg1/src/netwrite/NWWriter_XML.cpp --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_XML.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_XML.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -153,12 +148,15 @@ if (n->getKeepClear() == false) { device.writeAttr(SUMO_ATTR_KEEP_CLEAR, n->getKeepClear()); } - if (n->getRightOfWay() != RIGHT_OF_WAY_DEFAULT) { + if (n->getRightOfWay() != RightOfWay::DEFAULT) { device.writeAttr(SUMO_ATTR_RIGHT_OF_WAY, toString(n->getRightOfWay())); } - if (n->getFringeType() != FRINGE_TYPE_DEFAULT) { + if (n->getFringeType() != FringeType::DEFAULT) { device.writeAttr(SUMO_ATTR_FRINGE, toString(n->getFringeType())); } + if (n->getName() != "") { + device.writeAttr(SUMO_ATTR_NAME, n->getName()); + } n->writeParams(device); device.closeTag(); } @@ -190,6 +188,7 @@ OutputDevice& cdevice = OutputDevice::getDevice(oc.getString("plain-output-prefix") + ".con.xml"); cdevice.writeXMLHeader("connections", "connections_file.xsd", attrs); const bool writeNames = oc.getBool("output.street-names"); + LaneSpreadFunction defaultSpread = SUMOXMLDefinitions::LaneSpreadFunctions.get(oc.getString("default.spreadtype")); for (std::map::const_iterator i = ec.begin(); i != ec.end(); ++i) { // write the edge itself to the edges-files NBEdge* e = (*i).second; @@ -214,7 +213,7 @@ writeShape(edevice, gch, e->getGeometry(), SUMO_ATTR_SHAPE, useGeo, geoAccuracy); } // write the spread type if not default ("right") - if (e->getLaneSpreadFunction() != LANESPREAD_RIGHT) { + if (e->getLaneSpreadFunction() != defaultSpread) { edevice.writeAttr(SUMO_ATTR_SPREADTYPE, toString(e->getLaneSpreadFunction())); } // write the length if it was specified @@ -428,7 +427,7 @@ } void NWWriter_XML::writePTLines(const OptionsCont& oc, NBPTLineCont& lc, NBEdgeCont& ec) { OutputDevice& device = OutputDevice::getDevice(oc.getString("ptline-output")); - device.writeXMLHeader("additional", "additional_file.xsd"); + device.writeXMLHeader("ptLines", "ptlines_file.xsd"); for (const auto& item : lc.getLines()) { item.second->write(device, ec); } diff -Nru sumo-1.5.0+dfsg1/src/netwrite/NWWriter_XML.h sumo-1.6.0+dfsg1/src/netwrite/NWWriter_XML.h --- sumo-1.5.0+dfsg1/src/netwrite/NWWriter_XML.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/netwrite/NWWriter_XML.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Exporter writing networks using XML (native input) format /****************************************************************************/ -#ifndef NWWriter_XML_h -#define NWWriter_XML_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -121,9 +115,3 @@ static void writeShape(OutputDevice& out, const GeoConvHelper& gch, PositionVector shape, SumoXMLAttr attr, bool useGeo, bool geoAccuracy); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODAmitranHandler.cpp sumo-1.6.0+dfsg1/src/od/ODAmitranHandler.cpp --- sumo-1.5.0+dfsg1/src/od/ODAmitranHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODAmitranHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // An XML-Handler for Amitran OD matrices /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/od/ODAmitranHandler.h sumo-1.6.0+dfsg1/src/od/ODAmitranHandler.h --- sumo-1.5.0+dfsg1/src/od/ODAmitranHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODAmitranHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An XML-Handler for Amitran OD matrices /****************************************************************************/ -#ifndef ODAmitranHandler_h -#define ODAmitranHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -97,8 +91,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/od/ODCell.h sumo-1.6.0+dfsg1/src/od/ODCell.h --- sumo-1.5.0+dfsg1/src/od/ODCell.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODCell.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A single O/D-matrix cell /****************************************************************************/ -#ifndef ODCell_h -#define ODCell_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -82,9 +76,3 @@ /// @brief the destination "district" is an edge id bool destinationIsEdge = false; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrictCont.cpp sumo-1.6.0+dfsg1/src/od/ODDistrictCont.cpp --- sumo-1.5.0+dfsg1/src/od/ODDistrictCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrictCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A container for districts /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrictCont.h sumo-1.6.0+dfsg1/src/od/ODDistrictCont.h --- sumo-1.5.0+dfsg1/src/od/ODDistrictCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrictCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A container for districts /****************************************************************************/ -#ifndef ODDistrictCont_h -#define ODDistrictCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "ODDistrict.h" @@ -100,9 +94,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrict.cpp sumo-1.6.0+dfsg1/src/od/ODDistrict.cpp --- sumo-1.5.0+dfsg1/src/od/ODDistrict.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrict.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A district (origin/destination) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -82,6 +77,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrict.h sumo-1.6.0+dfsg1/src/od/ODDistrict.h --- sumo-1.5.0+dfsg1/src/od/ODDistrict.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrict.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A district (origin/destination) /****************************************************************************/ -#ifndef ODDistrict_h -#define ODDistrict_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -143,9 +137,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrictHandler.cpp sumo-1.6.0+dfsg1/src/od/ODDistrictHandler.cpp --- sumo-1.5.0+dfsg1/src/od/ODDistrictHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrictHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // An XML-Handler for districts /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -149,6 +144,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODDistrictHandler.h sumo-1.6.0+dfsg1/src/od/ODDistrictHandler.h --- sumo-1.5.0+dfsg1/src/od/ODDistrictHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODDistrictHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An XML-Handler for districts /****************************************************************************/ -#ifndef ODDistrictHandler_h -#define ODDistrictHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -175,9 +169,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/od/ODMatrix.cpp sumo-1.6.0+dfsg1/src/od/ODMatrix.cpp --- sumo-1.5.0+dfsg1/src/od/ODMatrix.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODMatrix.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // An O/D (origin/destination) matrix /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -32,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -262,23 +258,27 @@ if (changed) { sort(vehicles.begin(), vehicles.end(), descending_departure_comperator()); } + + const OptionsCont& oc = OptionsCont::getOptions(); + std::string personDepartPos = oc.isSet("departpos") ? oc.getString("departpos") : "random"; + std::string personArrivalPos = oc.isSet("arrivalpos") ? oc.getString("arrivalpos") : "random"; for (std::vector::reverse_iterator i = vehicles.rbegin(); i != vehicles.rend() && (*i).depart == t; ++i) { if (t >= begin) { myNumWritten++; if (pedestrians) { dev.openTag(SUMO_TAG_PERSON).writeAttr(SUMO_ATTR_ID, (*i).id).writeAttr(SUMO_ATTR_DEPART, time2string(t)); - dev.writeAttr(SUMO_ATTR_DEPARTPOS, "random"); + dev.writeAttr(SUMO_ATTR_DEPARTPOS, personDepartPos); dev.openTag(SUMO_TAG_WALK); dev.writeAttr(SUMO_ATTR_FROM, (*i).from).writeAttr(SUMO_ATTR_TO, (*i).to); - dev.writeAttr(SUMO_ATTR_ARRIVALPOS, "random"); + dev.writeAttr(SUMO_ATTR_ARRIVALPOS, personArrivalPos); dev.closeTag(); dev.closeTag(); } else if (persontrips) { dev.openTag(SUMO_TAG_PERSON).writeAttr(SUMO_ATTR_ID, (*i).id).writeAttr(SUMO_ATTR_DEPART, time2string(t)); - dev.writeAttr(SUMO_ATTR_DEPARTPOS, "random"); + dev.writeAttr(SUMO_ATTR_DEPARTPOS, personDepartPos); dev.openTag(SUMO_TAG_PERSONTRIP); dev.writeAttr(SUMO_ATTR_FROM, (*i).from).writeAttr(SUMO_ATTR_TO, (*i).to); - dev.writeAttr(SUMO_ATTR_ARRIVALPOS, "random"); + dev.writeAttr(SUMO_ATTR_ARRIVALPOS, personArrivalPos); dev.closeTag(); dev.closeTag(); } else { diff -Nru sumo-1.5.0+dfsg1/src/od/ODMatrix.h sumo-1.6.0+dfsg1/src/od/ODMatrix.h --- sumo-1.5.0+dfsg1/src/od/ODMatrix.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od/ODMatrix.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An O/D (origin/destination) matrix /****************************************************************************/ -#ifndef ODMatrix_h -#define ODMatrix_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -449,8 +443,3 @@ ODMatrix& operator=(const ODMatrix& s) = delete; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/od2trips_main.cpp sumo-1.6.0+dfsg1/src/od2trips_main.cpp --- sumo-1.5.0+dfsg1/src/od2trips_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/od2trips_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Main for OD2TRIPS /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -334,6 +329,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/osgview/GUIOSGBuilder.cpp sumo-1.6.0+dfsg1/src/osgview/GUIOSGBuilder.cpp --- sumo-1.5.0+dfsg1/src/osgview/GUIOSGBuilder.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/osgview/GUIOSGBuilder.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Builds OSG nodes from microsim objects /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_OSG @@ -30,6 +25,7 @@ #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable: 4127) // do not warn about constant conditional expression +#pragma warning(disable: 4275) // do not warn about the DLL interface for OSG #endif #include #include @@ -430,4 +426,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/osgview/GUIOSGBuilder.h sumo-1.6.0+dfsg1/src/osgview/GUIOSGBuilder.h --- sumo-1.5.0+dfsg1/src/osgview/GUIOSGBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/osgview/GUIOSGBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,19 +17,12 @@ /// // Builds OSG nodes from microsim objects /****************************************************************************/ -#ifndef GUIOSGBuilder_h -#define GUIOSGBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef HAVE_OSG #include -#include #include "GUIOSGView.h" @@ -84,8 +77,3 @@ #endif - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/osgview/GUIOSGView.cpp sumo-1.6.0+dfsg1/src/osgview/GUIOSGView.cpp --- sumo-1.5.0+dfsg1/src/osgview/GUIOSGView.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/osgview/GUIOSGView.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // An OSG-based 3D view on the simulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_OSG @@ -36,6 +31,7 @@ #define NOMINMAX #pragma warning(push) #pragma warning(disable: 4127) // do not warn about constant conditional expression +#pragma warning(disable: 4275) // do not warn about the DLL interface for OSG #endif #include #include @@ -218,42 +214,42 @@ // for junctions new FXButton(v.getLocatorPopup(), "\tLocate Junction\tLocate a junction within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEJUNCTION), &v, MID_LOCATEJUNCTION, + GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), &v, MID_LOCATEJUNCTION, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for edges new FXButton(v.getLocatorPopup(), "\tLocate Street\tLocate a street within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEEDGE), &v, MID_LOCATEEDGE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEEDGE), &v, MID_LOCATEEDGE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for vehicles new FXButton(v.getLocatorPopup(), "\tLocate Vehicle\tLocate a vehicle within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, + GUIIconSubSys::getIcon(GUIIcon::LOCATEVEHICLE), &v, MID_LOCATEVEHICLE, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for persons new FXButton(v.getLocatorPopup(), "\tLocate Vehicle\tLocate a person within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPERSON), &v, MID_LOCATEPERSON, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPERSON), &v, MID_LOCATEPERSON, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for tls new FXButton(v.getLocatorPopup(), "\tLocate TLS\tLocate a tls within the network.", - GUIIconSubSys::getIcon(ICON_LOCATETLS), &v, MID_LOCATETLS, + GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), &v, MID_LOCATETLS, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for additional stuff new FXButton(v.getLocatorPopup(), "\tLocate Additional\tLocate an additional structure within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEADD), &v, MID_LOCATEADD, + GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), &v, MID_LOCATEADD, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for pois new FXButton(v.getLocatorPopup(), "\tLocate POI\tLocate a POI within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOI), &v, MID_LOCATEPOI, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOI), &v, MID_LOCATEPOI, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); // for polygons new FXButton(v.getLocatorPopup(), "\tLocate Polygon\tLocate a Polygon within the network.", - GUIIconSubSys::getIcon(ICON_LOCATEPOLY), &v, MID_LOCATEPOLY, + GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), &v, MID_LOCATEPOLY, ICON_ABOVE_TEXT | FRAME_THICK | FRAME_RAISED); } @@ -744,4 +740,5 @@ #endif + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/osgview/GUIOSGView.h sumo-1.6.0+dfsg1/src/osgview/GUIOSGView.h --- sumo-1.5.0+dfsg1/src/osgview/GUIOSGView.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/osgview/GUIOSGView.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,21 +17,24 @@ /// // An OSG-based 3D view on the simulation /****************************************************************************/ -#ifndef GUIOSGView_h -#define GUIOSGView_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef HAVE_OSG #include +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4275) // do not warn about the DLL interface for OSG +#endif #include #include #include #include +#include +#ifdef _MSC_VER +#pragma warning(pop) +#endif #include #include #include @@ -272,9 +275,3 @@ }; #endif - -#endif - -/****************************************************************************/ - - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderArcView.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderArcView.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderArcView.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderArcView.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A reader of pois and polygons from shape files /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -106,14 +101,19 @@ OGRSpatialReference destTransf; // use wgs84 as destination destTransf.SetWellKnownGeogCS("WGS84"); +#if GDAL_VERSION_MAJOR > 2 + if (oc.getBool("shapefile.traditional-axis-mapping")) { + destTransf.SetAxisMappingStrategy(OAMS_TRADITIONAL_GIS_ORDER); + } +#endif OGRCoordinateTransformation* poCT = OGRCreateCoordinateTransformation(origTransf, &destTransf); - if (poCT == NULL) { - if (oc.isSet("shapefile.guess-projection")) { + if (poCT == nullptr) { + if (oc.getBool("shapefile.guess-projection")) { OGRSpatialReference origTransf2; origTransf2.SetWellKnownGeogCS("WGS84"); poCT = OGRCreateCoordinateTransformation(&origTransf2, &destTransf); } - if (poCT == 0) { + if (poCT == nullptr) { WRITE_WARNING("Could not create geocoordinates converter; check whether proj.4 is installed."); } } @@ -121,7 +121,7 @@ OGRFeature* poFeature; poLayer->ResetReading(); int runningID = 0; - while ((poFeature = poLayer->GetNextFeature()) != NULL) { + while ((poFeature = poLayer->GetNextFeature()) != nullptr) { std::vector parCont; // read in edge attributes std::string id = useRunningID ? toString(runningID) : poFeature->GetFieldAsString(idField.c_str()); @@ -165,7 +165,9 @@ continue; } // try transform to wgs84 - poGeometry->transform(poCT); + if (poCT != nullptr) { + poGeometry->transform(poCT); + } OGRwkbGeometryType gtype = poGeometry->getGeometryType(); switch (gtype) { case wkbPoint: { @@ -308,4 +310,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderArcView.h sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderArcView.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderArcView.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderArcView.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A reader of pois and polygons from shape files /****************************************************************************/ -#ifndef PCLoaderArcView_h -#define PCLoaderArcView_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -88,9 +82,3 @@ PCLoaderArcView& operator=(const PCLoaderArcView&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -257,8 +252,4 @@ } - - - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.h sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderDlrNavteq.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A reader of pois and polygons stored in DLR-Navteq (Elmar)-format /****************************************************************************/ -#ifndef PCLoaderDlrNavteq_h -#define PCLoaderDlrNavteq_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -127,9 +121,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderOSM.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderOSM.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderOSM.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderOSM.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -647,4 +642,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderOSM.h sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderOSM.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderOSM.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderOSM.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A reader of pois and polygons stored in OSM-format /****************************************************************************/ -#ifndef PCLoaderOSM_h -#define PCLoaderOSM_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -376,9 +370,3 @@ }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderVisum.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderVisum.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderVisum.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderVisum.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -357,6 +352,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderVisum.h sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderVisum.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderVisum.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderVisum.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A reader of pois and polygons stored in VISUM-format /****************************************************************************/ -#ifndef PCLoaderVisum_h -#define PCLoaderVisum_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -75,9 +69,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderXML.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderXML.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderXML.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderXML.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -131,4 +126,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderXML.h sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderXML.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCLoaderXML.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCLoaderXML.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A reader for polygons and pois stored in XML-format /****************************************************************************/ -#ifndef PCLoaderXML_h -#define PCLoaderXML_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -107,9 +101,3 @@ OptionsCont& myOptions; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCNetProjectionLoader.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCNetProjectionLoader.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCNetProjectionLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCNetProjectionLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A reader for a SUMO network's projection description /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -119,4 +114,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCNetProjectionLoader.h sumo-1.6.0+dfsg1/src/polyconvert/PCNetProjectionLoader.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCNetProjectionLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCNetProjectionLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A reader for a SUMO network's projection description /****************************************************************************/ -#ifndef PCNetProjectionLoader_h -#define PCNetProjectionLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -98,9 +92,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCPolyContainer.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCPolyContainer.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCPolyContainer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCPolyContainer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A storage for loaded polygons and pois /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -209,6 +204,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCPolyContainer.h sumo-1.6.0+dfsg1/src/polyconvert/PCPolyContainer.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCPolyContainer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCPolyContainer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A storage for loaded polygons and pois /****************************************************************************/ -#ifndef PCPolyContainer_h -#define PCPolyContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -161,9 +155,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCTypeDefHandler.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCTypeDefHandler.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCTypeDefHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCTypeDefHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A handler for loading polygon type maps /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -77,4 +72,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCTypeDefHandler.h sumo-1.6.0+dfsg1/src/polyconvert/PCTypeDefHandler.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCTypeDefHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCTypeDefHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A handler for loading polygon type maps /****************************************************************************/ -#ifndef PCTypeDefHandler_h -#define PCTypeDefHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -93,9 +87,3 @@ PCTypeDefHandler& operator=(const PCTypeDefHandler& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCTypeMap.cpp sumo-1.6.0+dfsg1/src/polyconvert/PCTypeMap.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/PCTypeMap.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCTypeMap.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A storage for type mappings /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -82,6 +77,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/PCTypeMap.h sumo-1.6.0+dfsg1/src/polyconvert/PCTypeMap.h --- sumo-1.5.0+dfsg1/src/polyconvert/PCTypeMap.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/PCTypeMap.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A storage for type mappings /****************************************************************************/ -#ifndef PCTypeMap_h -#define PCTypeMap_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "utils/common/RGBColor.h" @@ -126,9 +120,3 @@ TypeDef myDefaultType; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/polyconvert/polyconvert_main.cpp sumo-1.6.0+dfsg1/src/polyconvert/polyconvert_main.cpp --- sumo-1.5.0+dfsg1/src/polyconvert/polyconvert_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/polyconvert/polyconvert_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Main for POLYCONVERT /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -124,6 +119,9 @@ oc.addSynonyme("shapefile.guess-projection", "arcview.guess-projection", true); oc.addDescription("shapefile.guess-projection", "Input", "Guesses the shapefile's projection"); + oc.doRegister("shapefile.traditional-axis-mapping", new Option_Bool(false)); + oc.addDescription("shapefile.traditional-axis-mapping", "Input", "Use traditional axis order (lon, lat)"); + oc.doRegister("shapefile.id-column", new Option_String()); oc.addSynonyme("shapefile.id-column", "shapefile.id-name", true); oc.addSynonyme("shapefile.id-column", "shape-files.id-name", true); @@ -250,7 +248,7 @@ if (!oc.isSet("net")) { // from the given options #ifdef PROJ_API_FILE - unsigned numProjections = oc.getBool("simple-projection") + oc.getBool("proj.utm") + oc.getBool("proj.dhdn") + (oc.getString("proj").length() > 1); + const int numProjections = oc.getBool("simple-projection") + oc.getBool("proj.utm") + oc.getBool("proj.dhdn") + (oc.getString("proj").length() > 1); if ((oc.isSet("osm-files") || oc.isSet("dlr-navteq-poly-files") || oc.isSet("dlr-navteq-poi-files")) && numProjections == 0) { oc.set("proj.utm", "true"); } @@ -388,6 +386,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROAbstractEdgeBuilder.h sumo-1.6.0+dfsg1/src/router/ROAbstractEdgeBuilder.h --- sumo-1.5.0+dfsg1/src/router/ROAbstractEdgeBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROAbstractEdgeBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Interface for building instances of router-edges /****************************************************************************/ -#ifndef ROAbstractEdgeBuilder_h -#define ROAbstractEdgeBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -101,9 +95,3 @@ ROAbstractEdgeBuilder& operator=(const ROAbstractEdgeBuilder& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROEdge.cpp sumo-1.6.0+dfsg1/src/router/ROEdge.cpp --- sumo-1.5.0+dfsg1/src/router/ROEdge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROEdge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // A basic edge for routing applications /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -50,6 +45,9 @@ bool ROEdge::myHaveTTWarned = false; bool ROEdge::myHaveEWarned = false; ROEdgeVector ROEdge::myEdges; +double ROEdge::myPriorityFactor(0); +double ROEdge::myMinEdgePriority(std::numeric_limits::max()); +double ROEdge::myEdgePriorityRange(0); // =========================================================================== @@ -437,6 +435,22 @@ return std::find(followers.begin(), followers.end(), &e) != followers.end(); } +bool +ROEdge::initPriorityFactor(double priorityFactor) { + myPriorityFactor = priorityFactor; + double maxEdgePriority = -std::numeric_limits::max(); + for (ROEdge* edge : myEdges) { + maxEdgePriority = MAX2(maxEdgePriority, (double)edge->getPriority()); + myMinEdgePriority = MIN2(myMinEdgePriority, (double)edge->getPriority()); + } + myEdgePriorityRange = maxEdgePriority - myMinEdgePriority; + if (myEdgePriorityRange == 0) { + WRITE_WARNING("Option weights.priority-factor does not take effect because all edges have the same priority."); + myPriorityFactor = 0; + return false; + } + return true; +} + /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROEdge.h sumo-1.6.0+dfsg1/src/router/ROEdge.h --- sumo-1.5.0+dfsg1/src/router/ROEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // A basic edge for routing applications /****************************************************************************/ -#ifndef ROEdge_h -#define ROEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -149,21 +143,21 @@ /// @brief return whether this edge is an internal edge inline bool isInternal() const { - return myFunction == EDGEFUNC_INTERNAL; + return myFunction == SumoXMLEdgeFunc::INTERNAL; } /// @brief return whether this edge is a pedestrian crossing inline bool isCrossing() const { - return myFunction == EDGEFUNC_CROSSING; + return myFunction == SumoXMLEdgeFunc::CROSSING; } /// @brief return whether this edge is walking area inline bool isWalkingArea() const { - return myFunction == EDGEFUNC_WALKINGAREA; + return myFunction == SumoXMLEdgeFunc::WALKINGAREA; } inline bool isTazConnector() const { - return myFunction == EDGEFUNC_CONNECTOR; + return myFunction == SumoXMLEdgeFunc::CONNECTOR; } void setOtherTazConnector(const ROEdge* edge) { @@ -429,6 +423,20 @@ return edge->getTravelTime(veh, time) * RandHelper::rand(1., gWeightsRandomFactor); } + /// @brief Alias for getTravelTimeStatic (there is no routing device to provide aggregated travel times) + static inline double getTravelTimeAggregated(const ROEdge* const edge, const ROVehicle* const veh, double time) { + return edge->getTravelTime(veh, time); + } + + /// @brief Return traveltime weighted by edge priority (scaled penalty for low-priority edges) + static inline double getTravelTimeStaticPriorityFactor(const ROEdge* const edge, const ROVehicle* const veh, double time) { + double result = edge->getTravelTime(veh, time); + // lower priority should result in higher effort (and the edge with + // minimum priority receives a factor of myPriorityFactor + const double relativeInversePrio = 1 - ((edge->getPriority() - myMinEdgePriority) / myEdgePriorityRange); + result *= 1 + relativeInversePrio * myPriorityFactor; + return result; + } /** @brief Returns a lower bound for the travel time on this edge without using any stored timeLine * @@ -460,6 +468,12 @@ static double getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time); + + static double getStoredEffort(const ROEdge* const edge, const ROVehicle* const /*veh*/, double time) { + double ret = 0; + edge->getStoredEffort(time, ret); + return ret; + } //@} @@ -503,6 +517,16 @@ return myLanes; } + /// @brief return opposite superposable/congruent edge, if it exist and 0 else + inline const ROEdge* getBidiEdge() const { + return myBidiEdge; + } + + /// @brief set opposite superposable/congruent edge + inline void setBidiEdge(const ROEdge* bidiEdge) { + myBidiEdge = bidiEdge; + } + ReversedEdge* getReversedRoutingEdge() const { if (myReversedRoutingEdge == nullptr) { myReversedRoutingEdge = new ReversedEdge(this); @@ -510,6 +534,21 @@ return myReversedRoutingEdge; } + RailEdge* getRailwayRoutingEdge() const { + if (myRailwayRoutingEdge == nullptr) { + myRailwayRoutingEdge = new RailEdge(this); + } + return myRailwayRoutingEdge; + } + + /// @brief whether effort data was loaded for this edge + bool hasStoredEffort() const { + return myUsingETimeLine; + } + + /// @brief initialize priority factor range + static bool initPriorityFactor(double priorityFactor); + protected: /** @brief Retrieves the stored effort * @@ -581,6 +620,9 @@ /// @brief the other taz-connector if this edge isTazConnector, otherwise nullptr const ROEdge* myOtherTazConnector; + /// @brief the bidirectional rail edge or nullpr + const ROEdge* myBidiEdge; + /// @brief The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start and end node for normal edges Boundary myBoundary; @@ -592,6 +634,12 @@ static ROEdgeVector myEdges; + /// @brief Coefficient for factoring edge priority into routing weight + static double myPriorityFactor; + /// @brief Minimum priority for all edges + static double myMinEdgePriority; + /// @brief the difference between maximum and minimum priority for all edges + static double myEdgePriorityRange; /// @brief The successors available for a given vClass mutable std::map myClassesSuccessorMap; @@ -601,6 +649,7 @@ /// @brief a reversed version for backward routing mutable ReversedEdge* myReversedRoutingEdge = nullptr; + mutable RailEdge* myRailwayRoutingEdge = nullptr; #ifdef HAVE_FOX /// The mutex used to avoid concurrent updates of myClassesSuccessorMap @@ -615,9 +664,3 @@ ROEdge& operator=(const ROEdge& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROFrame.cpp sumo-1.6.0+dfsg1/src/router/ROFrame.cpp --- sumo-1.5.0+dfsg1/src/router/ROFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Sets and checks options for routing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -203,6 +198,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROFrame.h sumo-1.6.0+dfsg1/src/router/ROFrame.h --- sumo-1.5.0+dfsg1/src/router/ROFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Sets and checks options for routing /****************************************************************************/ -#ifndef ROFrame_h -#define ROFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -64,9 +58,3 @@ static bool checkOptions(OptionsCont& oc); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROHelper.cpp sumo-1.6.0+dfsg1/src/router/ROHelper.cpp --- sumo-1.5.0+dfsg1/src/router/ROHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // Some helping methods for router /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -122,4 +118,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROHelper.h sumo-1.6.0+dfsg1/src/router/ROHelper.h --- sumo-1.5.0+dfsg1/src/router/ROHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Some helping methods for router /****************************************************************************/ -#ifndef ROHelper_h -#define ROHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -86,8 +80,3 @@ ConstROEdgeVector::const_iterator start, ConstROEdgeVector::const_iterator end); } - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROLane.h sumo-1.6.0+dfsg1/src/router/ROLane.h --- sumo-1.5.0+dfsg1/src/router/ROLane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROLane.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A single lane the router may use /****************************************************************************/ -#ifndef ROLane_h -#define ROLane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -148,9 +142,3 @@ ROLane& operator=(const ROLane& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROLoader.cpp sumo-1.6.0+dfsg1/src/router/ROLoader.cpp --- sumo-1.5.0+dfsg1/src/router/ROLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Loader for networks and route imports /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -162,6 +157,7 @@ // create a TAZ for every junction toFill.addJunctionTaz(eb); } + toFill.setBidiEdges(handler.getBidiMap()); } @@ -312,4 +308,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROLoader.h sumo-1.6.0+dfsg1/src/router/ROLoader.h --- sumo-1.5.0+dfsg1/src/router/ROLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Loader for networks and route imports /****************************************************************************/ -#ifndef ROLoader_h -#define ROLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -197,9 +191,3 @@ /// @brief Invalidated assignment operator ROLoader& operator=(const ROLoader& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RONet.cpp sumo-1.6.0+dfsg1/src/router/RONet.cpp --- sumo-1.5.0+dfsg1/src/router/RONet.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONet.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The router's network representation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -65,18 +60,19 @@ } -RONet::RONet() - : myVehicleTypes(), myDefaultVTypeMayBeDeleted(true), - myDefaultPedTypeMayBeDeleted(true), myDefaultBikeTypeMayBeDeleted(true), - myHaveActiveFlows(true), - myRoutesOutput(nullptr), myRouteAlternativesOutput(nullptr), myTypesOutput(nullptr), - myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0), - myHavePermissions(false), - myNumInternalEdges(0), - myErrorHandler(OptionsCont::getOptions().exists("ignore-errors") - && OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), - myKeepVTypeDist(OptionsCont::getOptions().exists("keep-vtype-distributions") - && OptionsCont::getOptions().getBool("keep-vtype-distributions")) { +RONet::RONet() : + myVehicleTypes(), myDefaultVTypeMayBeDeleted(true), + myDefaultPedTypeMayBeDeleted(true), myDefaultBikeTypeMayBeDeleted(true), + myHaveActiveFlows(true), + myRoutesOutput(nullptr), myRouteAlternativesOutput(nullptr), myTypesOutput(nullptr), + myReadRouteNo(0), myDiscardedRouteNo(0), myWrittenRouteNo(0), + myHavePermissions(false), + myNumInternalEdges(0), + myErrorHandler(OptionsCont::getOptions().exists("ignore-errors") + && OptionsCont::getOptions().getBool("ignore-errors") ? MsgHandler::getWarningInstance() : MsgHandler::getErrorInstance()), + myKeepVTypeDist(OptionsCont::getOptions().exists("keep-vtype-distributions") + && OptionsCont::getOptions().getBool("keep-vtype-distributions")), + myHasBidiEdges(false) { if (myInstance != nullptr) { throw ProcessError("A network was already constructed."); } @@ -168,9 +164,9 @@ delete sink; return false; } - sink->setFunction(EDGEFUNC_CONNECTOR); + sink->setFunction(SumoXMLEdgeFunc::CONNECTOR); addEdge(sink); - source->setFunction(EDGEFUNC_CONNECTOR); + source->setFunction(SumoXMLEdgeFunc::CONNECTOR); addEdge(source); sink->setOtherTazConnector(source); source->setOtherTazConnector(sink); @@ -234,6 +230,17 @@ } } +void +RONet::setBidiEdges(const std::map& bidiMap) { + for (const auto& item : bidiMap) { + ROEdge* bidi = myEdges.get(item.second); + if (bidi == nullptr) { + WRITE_ERROR("The bidi edge '" + item.second + "' is not known."); + } + item.first->setBidiEdge(bidi); + myHasBidiEdges = true; + } +} void RONet::addNode(RONode* node) { @@ -578,9 +585,9 @@ #endif for (std::vector::const_iterator j = i->second.begin(); j != i->second.end(); ++j) { (*j)->computeRoute(provider, removeLoops, myErrorHandler); - provider.getVehicleRouter().setBulkMode(true); + provider.getVehicleRouter((*j)->getVClass()).setBulkMode(true); } - provider.getVehicleRouter().setBulkMode(false); + provider.getVehicleRouter(SVC_IGNORING).setBulkMode(false); } } @@ -762,6 +769,16 @@ myHavePermissions = true; } +bool +RONet::hasLoadedEffort() const { + for (const auto& item : myEdges) { + if (item.second->hasStoredEffort()) { + return true; + } + } + return false; +} + const std::string RONet::getStoppingPlaceName(const std::string& id) const { for (const auto& mapItem : myStoppingPlaces) { @@ -786,4 +803,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RONet.h sumo-1.6.0+dfsg1/src/router/RONet.h --- sumo-1.5.0+dfsg1/src/router/RONet.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONet.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The router's network representation /****************************************************************************/ -#ifndef RONet_h -#define RONet_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -141,6 +135,9 @@ /// @brief add a taz for every junction unless a taz with the same id already exists void addJunctionTaz(ROAbstractEdgeBuilder& eb); + /// @brief add a taz for every junction unless a taz with the same id already exists + void setBidiEdges(const std::map& bidiMap); + /** @brief Retrieves all TAZ (districts) from the network * * @return The map of all districts @@ -409,6 +406,14 @@ void setPermissionsFound(); + /// @brief return whether the network contains bidirectional rail edges + bool hasBidiEdges() const { + return myHasBidiEdges; + } + + /// @brief whether efforts were loaded from file + bool hasLoadedEffort() const; + OutputDevice* getRouteOutput(const bool alternative = false) { if (alternative) { return myRouteAlternativesOutput; @@ -435,7 +440,7 @@ public: BulkmodeTask(const bool value) : myValue(value) {} void run(FXWorkerThread* context) { - static_cast(context)->getVehicleRouter().setBulkMode(myValue); + static_cast(context)->getVehicleRouter(SVC_IGNORING).setBulkMode(myValue); } private: const bool myValue; @@ -545,6 +550,9 @@ /// @brief whether to keep the the vtype distribution in output const bool myKeepVTypeDist; + /// @brief whether the network contains bidirectional railway edges + bool myHasBidiEdges; + #ifdef HAVE_FOX private: class RoutingTask : public FXWorkerThread::Task { @@ -575,9 +583,3 @@ RONet& operator=(const RONet& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RONetHandler.cpp sumo-1.6.0+dfsg1/src/router/RONetHandler.cpp --- sumo-1.5.0+dfsg1/src/router/RONetHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONetHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // The handler for SUMO-Networks /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -177,7 +172,7 @@ std::string to; int priority; myCurrentEdge = nullptr; - if (func == EDGEFUNC_INTERNAL || func == EDGEFUNC_CROSSING || func == EDGEFUNC_WALKINGAREA) { + if (func == SumoXMLEdgeFunc::INTERNAL || func == SumoXMLEdgeFunc::CROSSING || func == SumoXMLEdgeFunc::WALKINGAREA) { assert(myCurrentName[0] == ':'); const std::string junctionID = myCurrentName.substr(1, myCurrentName.rfind('_') - 1); from = junctionID; @@ -212,6 +207,10 @@ if (myNet.addEdge(myCurrentEdge)) { fromNode->addOutgoing(myCurrentEdge); toNode->addIncoming(myCurrentEdge); + const std::string bidi = attrs.getOpt(SUMO_ATTR_BIDI, myCurrentName.c_str(), ok, ""); + if (bidi != "") { + myBidiEdges[myCurrentEdge] = bidi; + } } else { myCurrentEdge = nullptr; } @@ -263,7 +262,7 @@ 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 (attrs.getNodeType(ok) == NODETYPE_INTERNAL) { + if (attrs.getNodeType(ok) == SumoXMLNodeType::INTERNAL) { return; } myUnseenNodeIDs.erase(id); @@ -417,4 +416,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/router/RONetHandler.h sumo-1.6.0+dfsg1/src/router/RONetHandler.h --- sumo-1.5.0+dfsg1/src/router/RONetHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONetHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The handler that parses a SUMO-network for its usage in a router /****************************************************************************/ -#ifndef RONetHandler_h -#define RONetHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -66,6 +60,10 @@ /// @brief Destructor virtual ~RONetHandler(); + /// @brief retrieve mapping of edges to bidi edges (must be resolved after loading network) + const std::map& getBidiMap() const { + return myBidiEdges; + } protected: /// @name inherited from GenericSAXHandler @@ -215,6 +213,9 @@ /// @brief time penalty for passing a minor link const double myMinorPenalty; + /// @brief temporary storage for bidi attributes (to be resolved after loading all edges) + std::map myBidiEdges; + private: /// @brief Invalidated copy constructor RONetHandler(const RONetHandler& src); @@ -223,9 +224,3 @@ RONetHandler& operator=(const RONetHandler& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RONode.cpp sumo-1.6.0+dfsg1/src/router/RONode.cpp --- sumo-1.5.0+dfsg1/src/router/RONode.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONode.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A single router's node /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -45,6 +40,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RONode.h sumo-1.6.0+dfsg1/src/router/RONode.h --- sumo-1.5.0+dfsg1/src/router/RONode.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RONode.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Base class for nodes used by the router /****************************************************************************/ -#ifndef RONode_h -#define RONode_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -106,9 +100,3 @@ RONode& operator=(const RONode& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROPerson.cpp sumo-1.6.0+dfsg1/src/router/ROPerson.cpp --- sumo-1.5.0+dfsg1/src/router/ROPerson.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROPerson.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A vehicle as used by router /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -63,8 +58,9 @@ void ROPerson::addTrip(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) { - PersonTrip* trip = new PersonTrip(from, to, modeSet, departPos, arrivalPos, busStop, walkFactor); + 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); RONet* net = RONet::getInstance(); SUMOVehicleParameter pars; pars.departProcedure = DEPART_TRIGGERED; @@ -107,11 +103,12 @@ void -ROPerson::addRide(const ROEdge* const from, const ROEdge* const to, const std::string& lines, double arrivalPos, const std::string& destStop) { +ROPerson::addRide(const ROEdge* const from, const ROEdge* const to, const std::string& lines, + double arrivalPos, const std::string& destStop, const std::string& group) { if (myPlan.empty() || myPlan.back()->isStop()) { myPlan.push_back(new PersonTrip()); } - myPlan.back()->addTripItem(new Ride(from, to, lines, -1., arrivalPos, destStop)); + myPlan.back()->addTripItem(new Ride(from, to, lines, group, -1., arrivalPos, destStop)); } @@ -151,6 +148,9 @@ } } os.writeAttr(SUMO_ATTR_LINES, lines); + if (group != "") { + os.writeAttr(SUMO_ATTR_GROUP, group); + } if (intended != "" && intended != lines) { os.writeAttr(SUMO_ATTR_INTENDED, intended); } @@ -190,7 +190,7 @@ ROPerson::PlanItem* ROPerson::PersonTrip::clone() const { - PersonTrip* result = new PersonTrip(from, to, modes, dep, arr, stopDest, walkFactor); + PersonTrip* result = new PersonTrip(from, to, modes, dep, arr, stopDest, walkFactor, group); for (auto* item : myTripItems) { result->myTripItems.push_back(item->clone()); } @@ -326,7 +326,7 @@ trip->addTripItem(new Walk(it->edges, it->cost, depPos, arrPos, it->destStop)); } } else if (veh != nullptr && it->line == veh->getID()) { - trip->addTripItem(new Ride(it->edges.front(), it->edges.back(), veh->getID(), it->cost, trip->getArrivalPos(), it->destStop)); + trip->addTripItem(new Ride(it->edges.front(), it->edges.back(), veh->getID(), trip->getGroup(), it->cost, trip->getArrivalPos(), it->destStop)); if (veh->getVClass() != SVC_TAXI) { RORoute* route = new RORoute(veh->getID() + "_RouteDef", it->edges); route->setProbability(1); @@ -334,7 +334,7 @@ carUsed = true; } } else { - trip->addTripItem(new Ride(nullptr, nullptr, it->line, it->cost, trip->getArrivalPos(), it->destStop, it->intended, TIME2STEPS(it->depart))); + trip->addTripItem(new Ride(nullptr, nullptr, it->line, trip->getGroup(), it->cost, trip->getArrivalPos(), it->destStop, it->intended, TIME2STEPS(it->depart))); } } } @@ -406,4 +406,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROPerson.h sumo-1.6.0+dfsg1/src/router/ROPerson.h --- sumo-1.5.0+dfsg1/src/router/ROPerson.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROPerson.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // A person as used by router /****************************************************************************/ -#ifndef ROPerson_h -#define ROPerson_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,10 +60,11 @@ virtual ~ROPerson(); void addTrip(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& vTypes, const double departPos, const double arrivalPos, + const std::string& busStop, double walkFactor, const std::string& group); - void addRide(const ROEdge* const from, const ROEdge* const to, const std::string& lines, double arrivalPos, const std::string& destStop); + void addRide(const ROEdge* const from, const ROEdge* const to, const std::string& lines, + double arrivalPos, const std::string& destStop, const std::string& group); void addWalk(const ConstROEdgeVector& edges, const double duration, const double speed, const double departPos, const double arrivalPos, const std::string& busStop); @@ -183,11 +179,12 @@ class Ride : public TripItem { public: Ride(const ROEdge* const _from, const ROEdge* const _to, - const std::string& _lines, const double _cost, const double arrivalPos, + const std::string& _lines, const std::string& _group, const double _cost, const double arrivalPos, const std::string& _destStop = "", const std::string& _intended = "", const SUMOTime _depart = -1) : TripItem(_cost), from(_from), to(_to), lines(_lines), + group(_group), destStop(_destStop), intended(_intended), depart(_depart), @@ -195,7 +192,7 @@ } TripItem* clone() const { - return new Ride(from, to, lines, cost, arr, destStop, intended, depart); + return new Ride(from, to, lines, group, cost, arr, destStop, intended, depart); } const ROEdge* getOrigin() const { @@ -213,6 +210,7 @@ const ROEdge* const from; const ROEdge* const to; const std::string lines; + const std::string group; const std::string destStop; const std::string intended; const SUMOTime depart; @@ -274,8 +272,8 @@ 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) - : from(from), to(to), modes(modeSet), dep(departPos), arr(arrivalPos), stopDest(_stopDest), walkFactor(_walkFactor) {} + 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) {} /// @brief Destructor virtual ~PersonTrip() { for (std::vector::const_iterator it = myTripItems.begin(); it != myTripItems.end(); ++it) { @@ -320,6 +318,11 @@ SVCPermissions getModes() const { return modes; } + + const std::string& getGroup() const { + return group; + } + const std::string& getStopDest() const { return stopDest; } @@ -348,6 +351,8 @@ std::vector myVehicles; /// @brief walking speed factor double walkFactor; + /// @brief group id for travelling in groups + const std::string group; private: /// @brief Invalidated assignment operator @@ -404,8 +409,3 @@ ROPerson& operator=(const ROPerson& src); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RORoutable.h sumo-1.6.0+dfsg1/src/router/RORoutable.h --- sumo-1.5.0+dfsg1/src/router/RORoutable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORoutable.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A routable thing such as a vehicle or person /****************************************************************************/ -#ifndef RORoutable_h -#define RORoutable_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -193,8 +187,3 @@ RORoutable& operator=(const RORoutable& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/router/RORoute.cpp sumo-1.6.0+dfsg1/src/router/RORoute.cpp --- sumo-1.5.0+dfsg1/src/router/RORoute.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORoute.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A complete router's route /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/router/RORouteDef.cpp sumo-1.6.0+dfsg1/src/router/RORouteDef.cpp --- sumo-1.5.0+dfsg1/src/router/RORouteDef.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORouteDef.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Base class for a vehicle's route definition /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/router/RORouteDef.h sumo-1.6.0+dfsg1/src/router/RORouteDef.h --- sumo-1.5.0+dfsg1/src/router/RORouteDef.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORouteDef.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Base class for a vehicle's route definition /****************************************************************************/ -#ifndef RORouteDef_h -#define RORouteDef_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -194,9 +188,3 @@ RORouteDef& operator=(const RORouteDef& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RORoute.h sumo-1.6.0+dfsg1/src/router/RORoute.h --- sumo-1.5.0+dfsg1/src/router/RORoute.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORoute.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A complete router's route /****************************************************************************/ -#ifndef RORoute_h -#define RORoute_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -220,9 +214,3 @@ RORoute& operator=(const RORoute& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/RORouteHandler.cpp sumo-1.6.0+dfsg1/src/router/RORouteHandler.cpp --- sumo-1.5.0+dfsg1/src/router/RORouteHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORouteHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Parser and container for routes during their loading /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -35,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -228,11 +224,12 @@ double arrivalPos = attrs.getOpt(SUMO_ATTR_ARRIVALPOS, myVehicleParameter->id.c_str(), ok, stop == nullptr ? -NUMERICAL_EPS : stop->endPos); const std::string desc = attrs.get(SUMO_ATTR_LINES, pid.c_str(), ok); - myActivePerson->addRide(from, to, desc, arrivalPos, busStopID); + const std::string group = attrs.getOpt(SUMO_ATTR_GROUP, pid.c_str(), ok, ""); + myActivePerson->addRide(from, to, desc, arrivalPos, busStopID, group); break; } case SUMO_TAG_CONTAINER: - myActiveContainerPlan = new OutputDevice_String(false, 1); + myActiveContainerPlan = new OutputDevice_String(1); myActiveContainerPlanSize = 0; myActiveContainerPlan->openTag(SUMO_TAG_CONTAINER); (*myActiveContainerPlan) << attrs; @@ -367,6 +364,12 @@ void +RORouteHandler::openRouteFlow(const SUMOSAXAttributes& /*attrs*/) { + // currently unused +} + + +void RORouteHandler::openTrip(const SUMOSAXAttributes& /*attrs*/) { // currently unused } @@ -806,21 +809,14 @@ void RORouteHandler::parseEdges(const std::string& desc, ConstROEdgeVector& into, const std::string& rid, bool& ok) { - if (desc[0] == BinaryFormatter::BF_ROUTE) { - std::istringstream in(desc, std::ios::binary); - char c; - in >> c; - FileHelpers::readEdgeVector(in, into, rid); - } else { - for (StringTokenizer st(desc); st.hasNext();) { - const std::string id = st.next(); - const ROEdge* edge = myNet.getEdge(id); - if (edge == nullptr) { - myErrorOutput->inform("The edge '" + id + "' within the route " + rid + " is not known."); - ok = false; - } else { - into.push_back(edge); - } + for (StringTokenizer st(desc); st.hasNext();) { + const std::string id = st.next(); + const ROEdge* edge = myNet.getEdge(id); + if (edge == nullptr) { + myErrorOutput->inform("The edge '" + id + "' within the route " + rid + " is not known."); + ok = false; + } else { + into.push_back(edge); } } } @@ -1015,6 +1011,7 @@ parseWalkPositions(attrs, myVehicleParameter->id, from, to, departPos, arrivalPos, busStopID, lastStage, ok); const std::string modes = attrs.getOpt(SUMO_ATTR_MODES, id, ok, ""); + const std::string group = attrs.getOpt(SUMO_ATTR_GROUP, id, ok, ""); SVCPermissions modeSet = 0; for (StringTokenizer st(modes); st.hasNext();) { const std::string mode = st.next(); @@ -1033,7 +1030,7 @@ 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) { - myActivePerson->addTrip(from, to, modeSet, types, departPos, arrivalPos, busStopID, walkFactor); + myActivePerson->addTrip(from, to, modeSet, types, departPos, arrivalPos, busStopID, walkFactor, group); } } diff -Nru sumo-1.5.0+dfsg1/src/router/RORouteHandler.h sumo-1.6.0+dfsg1/src/router/RORouteHandler.h --- sumo-1.5.0+dfsg1/src/router/RORouteHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/RORouteHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parser and container for routes during their loading /****************************************************************************/ -#ifndef RORouteHandler_h -#define RORouteHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -107,6 +101,9 @@ /// @brief opens a flow for reading void openFlow(const SUMOSAXAttributes& attrs); + /// @brief opens a route flow for reading + void openRouteFlow(const SUMOSAXAttributes& attrs); + /// @brief opens a trip for reading void openTrip(const SUMOSAXAttributes& attrs); @@ -249,9 +246,3 @@ /// @brief Invalidated assignment operator RORouteHandler& operator=(const RORouteHandler& s) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROVehicle.cpp sumo-1.6.0+dfsg1/src/router/ROVehicle.cpp --- sumo-1.5.0+dfsg1/src/router/ROVehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROVehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A vehicle as used by router /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -128,7 +123,7 @@ void ROVehicle::computeRoute(const RORouterProvider& provider, const bool removeLoops, MsgHandler* errorHandler) { - SUMOAbstractRouter& router = provider.getVehicleRouter(); + SUMOAbstractRouter& router = provider.getVehicleRouter(getVClass()); std::string noRouteMsg = "The vehicle '" + getID() + "' has no valid route."; RORouteDef* const routeDef = getRouteDefinition(); // check if the route definition is valid @@ -320,4 +315,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/router/ROVehicle.h sumo-1.6.0+dfsg1/src/router/ROVehicle.h --- sumo-1.5.0+dfsg1/src/router/ROVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/router/ROVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A vehicle as used by router /****************************************************************************/ -#ifndef ROVehicle_h -#define ROVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -116,6 +110,18 @@ return getType()->speedFactor.getMax(); } + /** @brief Returns the vehicle's type definition + * @return The vehicle's type definition + */ + inline const SUMOVTypeParameter& getVehicleType() const { + return *getType(); + } + + /// @brief Returns the vehicle's length + inline double getLength() const { + return getType()->length; + } + /** @brief Saves the complete vehicle description. * @@ -155,8 +161,3 @@ ROVehicle& operator=(const ROVehicle& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/sumo_main.cpp sumo-1.6.0+dfsg1/src/sumo_main.cpp --- sumo-1.5.0+dfsg1/src/sumo_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/sumo_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Main for SUMO /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H diff -Nru sumo-1.5.0+dfsg1/src/tools/emissionsDrivingCycle_main.cpp sumo-1.6.0+dfsg1/src/tools/emissionsDrivingCycle_main.cpp --- sumo-1.5.0+dfsg1/src/tools/emissionsDrivingCycle_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/tools/emissionsDrivingCycle_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Main for an emissions calculator /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -260,6 +255,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/tools/emissionsMap_main.cpp sumo-1.6.0+dfsg1/src/tools/emissionsMap_main.cpp --- sumo-1.5.0+dfsg1/src/tools/emissionsMap_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/tools/emissionsMap_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Main for an emissions map writer /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -63,6 +58,9 @@ WRITE_MESSAGE("Writing map of '" + className + "' into '" + of + "'."); } std::ofstream o(of.c_str()); + if (!o.good()) { + throw ProcessError("Could not open file '" + of + "' for writing."); + } for (double v = vMin; v <= vMax; v += vStep) { for (double a = aMin; a <= aMax; a += aStep) { for (double s = sMin; s <= sMax; s += sStep) { @@ -194,6 +192,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/tools/TrajectoriesHandler.cpp sumo-1.6.0+dfsg1/src/tools/TrajectoriesHandler.cpp --- sumo-1.5.0+dfsg1/src/tools/TrajectoriesHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/tools/TrajectoriesHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // An XML-Handler for amitran and netstate trajectories /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/tools/TrajectoriesHandler.h sumo-1.6.0+dfsg1/src/tools/TrajectoriesHandler.h --- sumo-1.5.0+dfsg1/src/tools/TrajectoriesHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/tools/TrajectoriesHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An XML-Handler for amitran and netstate trajectories /****************************************************************************/ -#ifndef TrajectoriesHandler_h -#define TrajectoriesHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -120,9 +114,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/CMakeLists.txt sumo-1.6.0+dfsg1/src/traci-server/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/traci-server/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -21,6 +21,24 @@ TraCIServerAPI_Polygon.cpp TraCIServerAPI_Route.h TraCIServerAPI_Route.cpp + TraCIServerAPI_Calibrator.h + TraCIServerAPI_Calibrator.cpp + TraCIServerAPI_BusStop.h + TraCIServerAPI_BusStop.cpp + TraCIServerAPI_ParkingArea.h + TraCIServerAPI_ParkingArea.cpp + TraCIServerAPI_ChargingStation.h + TraCIServerAPI_ChargingStation.cpp + TraCIServerAPI_RouteProbe.h + TraCIServerAPI_RouteProbe.cpp + TraCIServerAPI_Rerouter.h + TraCIServerAPI_Rerouter.cpp + TraCIServerAPI_VariableSpeedSign.h + TraCIServerAPI_VariableSpeedSign.cpp + TraCIServerAPI_MeanData.h + TraCIServerAPI_MeanData.cpp + TraCIServerAPI_OverheadWire.h + TraCIServerAPI_OverheadWire.cpp TraCIServerAPI_Simulation.h TraCIServerAPI_Simulation.cpp TraCIServerAPI_TrafficLight.h diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_BusStop.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_BusStop.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_BusStop::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_BUSSTOP_VARIABLE, variable, id); + try { + if (!libsumo::BusStop::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_BUSSTOP_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::BusStop::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_BUSSTOP_VARIABLE, "Get BusStop Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_BUSSTOP_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_BUSSTOP_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_BusStop::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, "Change BusStop State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::BusStop::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_BUSSTOP_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_BusStop.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_BusStop.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_BusStop + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_BusStop { +public: + /** @brief Processes a get value command (Command 0xa6: Get BusStop Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change BusStop State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_BusStop(const TraCIServerAPI_BusStop& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_BusStop& operator=(const TraCIServerAPI_BusStop& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,151 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_Calibrator.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting Calibrator values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_Calibrator.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_Calibrator::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_CALIBRATOR_VARIABLE, variable, id); + try { + if (!libsumo::Calibrator::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_CALIBRATOR_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::Calibrator::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_CALIBRATOR_VARIABLE, "Get Calibrator Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_CALIBRATOR_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_CALIBRATOR_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_Calibrator::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::CMD_SET_FLOW && variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Change Calibrator State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::CMD_SET_FLOW: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "A compound object is needed for setting calibrator flow.", outputStorage); + } + int parameterCount = inputStorage.readInt(); + double begin; + double end; + double vehsPerHour; + double speed; + std::string typeID; + std::string routeID; + std::string departLane; + std::string departSpeed; + if (parameterCount == 8) { + if (!server.readTypeCheckingDouble(inputStorage, begin)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the begin time as the first value.", outputStorage); + } + if (!server.readTypeCheckingDouble(inputStorage, end)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the end time as the second value.", outputStorage); + } + if (!server.readTypeCheckingDouble(inputStorage, vehsPerHour)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the number of vehicles per hour as the third value.", outputStorage); + } + if (!server.readTypeCheckingDouble(inputStorage, speed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the speed as the fourth value.", outputStorage); + } + if (!server.readTypeCheckingString(inputStorage, typeID)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the type id as the fifth value.", outputStorage); + } + if (!server.readTypeCheckingString(inputStorage, routeID)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the route id as the sixth value.", outputStorage); + } + if (!server.readTypeCheckingString(inputStorage, departLane)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the departLane as the seventh value.", outputStorage); + } + if (!server.readTypeCheckingString(inputStorage, departSpeed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "Setting flow requires the departSpeed as the eigth value.", outputStorage); + } + } else { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Setting calibrator flow requires 8 parameters.", outputStorage); + } + libsumo::Calibrator::setFlow(id, begin, end, vehsPerHour, speed, typeID, routeID, departLane, departSpeed); + } + break; + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::Calibrator::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_CALIBRATOR_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Calibrator.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_Calibrator.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting Calibrator values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_Calibrator + * @brief APIs for getting/setting Calibrator values via TraCI + */ +class TraCIServerAPI_Calibrator { +public: + /** @brief Processes a get value command (Command 0xa6: Get Calibrator Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change Calibrator State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_Calibrator(const TraCIServerAPI_Calibrator& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_Calibrator& operator=(const TraCIServerAPI_Calibrator& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_ChargingStation.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_ChargingStation.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_ChargingStation::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_CHARGINGSTATION_VARIABLE, variable, id); + try { + if (!libsumo::ChargingStation::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_CHARGINGSTATION_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::ChargingStation::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_CHARGINGSTATION_VARIABLE, "Get ChargingStation Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_CHARGINGSTATION_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_CHARGINGSTATION_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_ChargingStation::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, "Change ChargingStation State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::ChargingStation::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_CHARGINGSTATION_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ChargingStation.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_ChargingStation.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_ChargingStation + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_ChargingStation { +public: + /** @brief Processes a get value command (Command 0xa6: Get ChargingStation Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change ChargingStation State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_ChargingStation(const TraCIServerAPI_ChargingStation& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_ChargingStation& operator=(const TraCIServerAPI_ChargingStation& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Edge.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Edge_h -#define TraCIServerAPI_Edge_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -68,9 +63,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -91,4 +86,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_InductionLoop.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting induction loop values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_InductionLoop_h -#define TraCIServerAPI_InductionLoop_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -59,9 +53,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Junction.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting junction values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Junction_h -#define TraCIServerAPI_Junction_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -63,8 +57,3 @@ /// @brief invalidated assignment operator TraCIServerAPI_Junction& operator=(const TraCIServerAPI_Junction& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // APIs for getting/setting areal detector values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_LaneArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting areal detector values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_LaneArea_h -#define TraCIServerAPI_LaneArea_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -213,4 +208,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Lane.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // APIs for getting/setting lane values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Lane_h -#define TraCIServerAPI_Lane_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -75,8 +69,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_MeanData.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_MeanData.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_MeanData::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_MEANDATA_VARIABLE, variable, id); + try { + if (!libsumo::MeanData::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_MEANDATA_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::MeanData::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_MEANDATA_VARIABLE, "Get MeanData Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_MEANDATA_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_MEANDATA_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MeanData.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_MeanData.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_MeanData + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_MeanData { +public: + /** @brief Processes a get value command (Command 0xa6: Get MeanData Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change MeanData State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_MeanData(const TraCIServerAPI_MeanData& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_MeanData& operator=(const TraCIServerAPI_MeanData& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // APIs for getting/setting multi-entry/multi-exit detector values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_MultiEntryExit.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting multi-entry/multi-exit detector values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_MultiEntryExit_h -#define TraCIServerAPI_MultiEntryExit_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -59,9 +53,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_OverheadWire.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_OverheadWire.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_OverheadWire::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_OVERHEADWIRE_VARIABLE, variable, id); + try { + if (!libsumo::OverheadWire::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_OVERHEADWIRE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::OverheadWire::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_OVERHEADWIRE_VARIABLE, "Get OverheadWire Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_OVERHEADWIRE_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_OVERHEADWIRE_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_OverheadWire::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, "Change OverheadWire State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::OverheadWire::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_OVERHEADWIRE_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_OverheadWire.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_OverheadWire.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_OverheadWire + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_OverheadWire { +public: + /** @brief Processes a get value command (Command 0xa6: Get OverheadWire Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change OverheadWire State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_OverheadWire(const TraCIServerAPI_OverheadWire& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_OverheadWire& operator=(const TraCIServerAPI_OverheadWire& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_ParkingArea.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_ParkingArea.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_ParkingArea::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_PARKINGAREA_VARIABLE, variable, id); + try { + if (!libsumo::ParkingArea::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_PARKINGAREA_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::ParkingArea::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_PARKINGAREA_VARIABLE, "Get ParkingArea Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_PARKINGAREA_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_PARKINGAREA_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_ParkingArea::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, "Change ParkingArea State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::ParkingArea::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_PARKINGAREA_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_ParkingArea.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_ParkingArea.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_ParkingArea + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_ParkingArea { +public: + /** @brief Processes a get value command (Command 0xa6: Get ParkingArea Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change ParkingArea State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_ParkingArea(const TraCIServerAPI_ParkingArea& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_ParkingArea& operator=(const TraCIServerAPI_ParkingArea& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Person.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Person.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Person.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Person.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // APIs for getting/setting person values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -187,7 +182,7 @@ } int numParameters = inputStorage.readInt(); if (numParameters == 13) { - libsumo::Person::appendStage(*TraCIServerAPI_Simulation::readStage(server, inputStorage), id); + libsumo::Person::appendStage(id, *TraCIServerAPI_Simulation::readStage(server, inputStorage)); } else { int stageType; if (!server.readTypeCheckingInt(inputStorage, stageType)) { diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Person.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Person.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Person.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Person.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // APIs for getting/setting person values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Person_h -#define TraCIServerAPI_Person_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -73,8 +67,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_POI.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_POI.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_POI.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_POI.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_POI.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_POI.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_POI.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_POI.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting POI values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_POI_h -#define TraCIServerAPI_POI_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -69,9 +63,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Polygon.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting polygon values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Polygon_h -#define TraCIServerAPI_Polygon_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -69,9 +63,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_Rerouter.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_Rerouter.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_Rerouter::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_REROUTER_VARIABLE, variable, id); + try { + if (!libsumo::Rerouter::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_REROUTER_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::Rerouter::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_REROUTER_VARIABLE, "Get Rerouter Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_REROUTER_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_REROUTER_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_Rerouter::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, "Change Rerouter State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::Rerouter::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_REROUTER_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Rerouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_Rerouter.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_Rerouter + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_Rerouter { +public: + /** @brief Processes a get value command (Command 0xa6: Get Rerouter Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change Rerouter State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_Rerouter(const TraCIServerAPI_Rerouter& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_Rerouter& operator=(const TraCIServerAPI_Rerouter& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Route.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Route.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Route.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Route.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // APIs for getting/setting route values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Route.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Route.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Route.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Route.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting route values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Route_h -#define TraCIServerAPI_Route_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -69,9 +63,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_RouteProbe.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_RouteProbe.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_RouteProbe::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_ROUTEPROBE_VARIABLE, variable, id); + try { + if (!libsumo::RouteProbe::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_ROUTEPROBE_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::RouteProbe::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_ROUTEPROBE_VARIABLE, "Get RouteProbe Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_ROUTEPROBE_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_ROUTEPROBE_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_RouteProbe::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, "Change RouteProbe State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::RouteProbe::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_ROUTEPROBE_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_RouteProbe.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_RouteProbe.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_RouteProbe + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_RouteProbe { +public: + /** @brief Processes a get value command (Command 0xa6: Get RouteProbe Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change RouteProbe State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_RouteProbe(const TraCIServerAPI_RouteProbe& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_RouteProbe& operator=(const TraCIServerAPI_RouteProbe& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Simulation.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting edge values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Simulation_h -#define TraCIServerAPI_Simulation_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -92,9 +86,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // APIs for getting/setting traffic light values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -67,25 +62,25 @@ // phase number storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); storage.writeInt((int)logic.phases.size()); - for (const libsumo::TraCIPhase& phase : logic.phases) { + 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.writeDouble(phase->duration); storage.writeUnsignedByte(libsumo::TYPE_STRING); - storage.writeString(phase.state); + storage.writeString(phase->state); storage.writeUnsignedByte(libsumo::TYPE_DOUBLE); - storage.writeDouble(phase.minDur); + storage.writeDouble(phase->minDur); storage.writeUnsignedByte(libsumo::TYPE_DOUBLE); - storage.writeDouble(phase.maxDur); + storage.writeDouble(phase->maxDur); storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); - storage.writeInt((int)phase.next.size()); - for (int n : phase.next) { + storage.writeInt((int)phase->next.size()); + for (int n : phase->next) { storage.writeUnsignedByte(libsumo::TYPE_INTEGER); storage.writeInt(n); } storage.writeUnsignedByte(libsumo::TYPE_STRING); - storage.writeString(phase.name); + storage.writeString(phase->name); } // subparameter storage.writeUnsignedByte(libsumo::TYPE_COMPOUND); @@ -326,7 +321,7 @@ return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 4.6. parameter (name) must be a string.", outputStorage); } } - logic.phases.emplace_back(libsumo::TraCIPhase(duration, state, minDuration, maxDuration, next, name)); + logic.phases.emplace_back(new libsumo::TraCIPhase(duration, state, minDuration, maxDuration, next, name)); } if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { return server.writeErrorStatusCmd(libsumo::CMD_SET_TL_VARIABLE, "set program: 5. parameter (subparams) must be a compound object.", outputStorage); diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_TrafficLight.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting traffic light values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_TrafficLight_h -#define TraCIServerAPI_TrafficLight_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -69,9 +63,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,107 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_VariableSpeedSign.cpp +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#include + +#include +#include +#include +#include +#include +#include "TraCIServerAPI_VariableSpeedSign.h" + + +// =========================================================================== +// method definitions +// =========================================================================== +bool +TraCIServerAPI_VariableSpeedSign::processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + const int variable = inputStorage.readUnsignedByte(); + const std::string id = inputStorage.readString(); + server.initWrapper(libsumo::RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE, variable, id); + try { + if (!libsumo::VariableSpeedSign::handleVariable(id, variable, &server)) { + switch (variable) { + case libsumo::VAR_PARAMETER: { + std::string paramName = ""; + if (!server.readTypeCheckingString(inputStorage, paramName)) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VARIABLESPEEDSIGN_VARIABLE, "Retrieval of a parameter requires its name.", outputStorage); + } + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_STRING); + server.getWrapperStorage().writeString(libsumo::VariableSpeedSign::getParameter(id, paramName)); + break; + } + default: + return server.writeErrorStatusCmd(libsumo::CMD_GET_VARIABLESPEEDSIGN_VARIABLE, "Get VariableSpeedSign Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VARIABLESPEEDSIGN_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_GET_VARIABLESPEEDSIGN_VARIABLE, libsumo::RTYPE_OK, "", outputStorage); + server.writeResponseWithLength(outputStorage, server.getWrapperStorage()); + return true; +} + + +bool +TraCIServerAPI_VariableSpeedSign::processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage) { + std::string warning = ""; // additional description for response + // variable + int variable = inputStorage.readUnsignedByte(); + if (variable != libsumo::VAR_PARAMETER) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, "Change VariableSpeedSign State: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); + } + // id + std::string id = inputStorage.readString(); + + try { + // process + switch (variable) { + case libsumo::VAR_PARAMETER: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, "A compound object is needed for setting a parameter.", outputStorage); + } + //read itemNo + inputStorage.readInt(); + std::string name; + if (!server.readTypeCheckingString(inputStorage, name)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, "The name of the parameter must be given as a string.", outputStorage); + } + std::string value; + if (!server.readTypeCheckingString(inputStorage, value)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, "The value of the parameter must be given as a string.", outputStorage); + } + libsumo::VariableSpeedSign::setParameter(id, name, value); + } + break; + default: + break; + } + } catch (libsumo::TraCIException& e) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, e.what(), outputStorage); + } + server.writeStatusCmd(libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE, libsumo::RTYPE_OK, warning, outputStorage); + return true; +} + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VariableSpeedSign.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 TraCIServerAPI_VariableSpeedSign.h +/// @author Jakob Erdmann +/// @date 16.03.2020 +/// +// APIs for getting/setting busstop values via TraCI +/****************************************************************************/ +#pragma once +#include + +#include "TraCIServer.h" +#include + + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class TraCIServerAPI_VariableSpeedSign + * @brief APIs for getting/setting busstop values via TraCI + */ +class TraCIServerAPI_VariableSpeedSign { +public: + /** @brief Processes a get value command (Command 0xa6: Get VariableSpeedSign Variable) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processGet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + + /** @brief Processes a set value command (Command 0xc6: Change VariableSpeedSign State) + * + * @param[in] server The TraCI-server-instance which schedules this request + * @param[in] inputStorage The storage to read the command from + * @param[out] outputStorage The storage to write the result to + */ + static bool processSet(TraCIServer& server, tcpip::Storage& inputStorage, + tcpip::Storage& outputStorage); + + +private: + /// @brief invalidated copy constructor + TraCIServerAPI_VariableSpeedSign(const TraCIServerAPI_VariableSpeedSign& s); + + /// @brief invalidated assignment operator + TraCIServerAPI_VariableSpeedSign& operator=(const TraCIServerAPI_VariableSpeedSign& s); + + +}; diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -26,11 +26,6 @@ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -278,6 +273,103 @@ } break; } + case libsumo::VAR_FOLLOW_SPEED: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires requires a compound object.", outputStorage); + } + int parameterCount = inputStorage.readInt(); + double speed; + double gap; + double leaderSpeed; + double leaderMaxDecel; + std::string leaderID; + if (parameterCount == 5) { + // speed + if (!server.readTypeCheckingDouble(inputStorage, speed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires the speed as first parameter.", outputStorage); + } + // gap + if (!server.readTypeCheckingDouble(inputStorage, gap)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires the gap as second parameter.", outputStorage); + } + // leaderSpeed + if (!server.readTypeCheckingDouble(inputStorage, leaderSpeed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires the leaderSpeed as third parameter.", outputStorage); + } + // leaderMaxDecel + if (!server.readTypeCheckingDouble(inputStorage, leaderMaxDecel)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires the leaderMaxDecel as fourth parameter.", outputStorage); + } + // leaderID + if (!server.readTypeCheckingString(inputStorage, leaderID)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires the leaderID as fifth parameter.", outputStorage); + } + } else { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Retrieval of followSpeed requires 5 parameters.", outputStorage); + } + // retrieve + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_DOUBLE); + server.getWrapperStorage().writeDouble(libsumo::Vehicle::getFollowSpeed(id, speed, gap, leaderSpeed, leaderMaxDecel, leaderID)); + } + break; + case libsumo::VAR_SECURE_GAP: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of secureGap requires requires a compound object.", outputStorage); + } + int parameterCount = inputStorage.readInt(); + double speed; + double leaderSpeed; + double leaderMaxDecel; + std::string leaderID; + if (parameterCount == 4) { + // speed + if (!server.readTypeCheckingDouble(inputStorage, speed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of secureGap requires the speed as first parameter.", outputStorage); + } + // leaderSpeed + if (!server.readTypeCheckingDouble(inputStorage, leaderSpeed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of secureGap requires the leaderSpeed as second parameter.", outputStorage); + } + // leaderMaxDecel + if (!server.readTypeCheckingDouble(inputStorage, leaderMaxDecel)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of secureGap requires the leaderMaxDecel as third parameter.", outputStorage); + } + // leaderID + if (!server.readTypeCheckingString(inputStorage, leaderID)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of secureGap requires the leaderID as fourth parameter.", outputStorage); + } + } else { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Retrieval of secureGap requires 4 parameters.", outputStorage); + } + // retrieve + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_DOUBLE); + server.getWrapperStorage().writeDouble(libsumo::Vehicle::getSecureGap(id, speed, leaderSpeed, leaderMaxDecel, leaderID)); + } + break; + case libsumo::VAR_STOP_SPEED: { + if (inputStorage.readUnsignedByte() != libsumo::TYPE_COMPOUND) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of stopSpeed requires requires a compound object.", outputStorage); + } + int parameterCount = inputStorage.readInt(); + double speed; + double gap; + if (parameterCount == 2) { + // speed + if (!server.readTypeCheckingDouble(inputStorage, speed)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of stopSpeed requires the speed as first parameter.", outputStorage); + } + // gap + if (!server.readTypeCheckingDouble(inputStorage, gap)) { + return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Retrieval of stopSpeed requires the gap as second parameter.", outputStorage); + } + } else { + return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Retrieval of stopSpeed requires 2 parameters.", outputStorage); + } + // retrieve + server.getWrapperStorage().writeUnsignedByte(libsumo::TYPE_DOUBLE); + server.getWrapperStorage().writeDouble(libsumo::Vehicle::getStopSpeed(id, speed, gap)); + } + break; default: return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Get Vehicle Variable: unsupported variable " + toHex(variable, 2) + " specified", outputStorage); } @@ -339,9 +431,9 @@ return server.writeErrorStatusCmd(libsumo::CMD_SET_VEHICLE_VARIABLE, "Vehicle '" + id + "' is not known", outputStorage); } } - MSVehicle* v = dynamic_cast(sumoVehicle); + MSBaseVehicle* v = dynamic_cast(sumoVehicle); if (v == nullptr && shouldExist) { - return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Vehicle '" + id + "' is not a micro-simulation vehicle", outputStorage); + return server.writeErrorStatusCmd(libsumo::CMD_GET_VEHICLE_VARIABLE, "Vehicle '" + id + "' is not a proper vehicle", outputStorage); } try { switch (variable) { diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_Vehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting vehicle values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_Vehicle_h -#define TraCIServerAPI_Vehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,8 +64,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServerAPI_VehicleType.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // APIs for getting/setting vehicle type values via TraCI /****************************************************************************/ -#ifndef TraCIServerAPI_VehicleType_h -#define TraCIServerAPI_VehicleType_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "TraCIServer.h" @@ -76,9 +70,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServer.cpp sumo-1.6.0+dfsg1/src/traci-server/TraCIServer.cpp --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -27,10 +27,6 @@ /// // TraCI server used to control sumo by a remote TraCI client (e.g., ns2) /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_VERSION_H @@ -81,6 +77,15 @@ #include "TraCIServerAPI_Edge.h" #include "TraCIServerAPI_Simulation.h" #include "TraCIServerAPI_Person.h" +#include "TraCIServerAPI_Calibrator.h" +#include "TraCIServerAPI_BusStop.h" +#include "TraCIServerAPI_ParkingArea.h" +#include "TraCIServerAPI_ChargingStation.h" +#include "TraCIServerAPI_RouteProbe.h" +#include "TraCIServerAPI_Rerouter.h" +#include "TraCIServerAPI_VariableSpeedSign.h" +#include "TraCIServerAPI_MeanData.h" +#include "TraCIServerAPI_OverheadWire.h" // =========================================================================== @@ -225,13 +230,31 @@ myExecutors[libsumo::CMD_SET_SIM_VARIABLE] = &TraCIServerAPI_Simulation::processSet; myExecutors[libsumo::CMD_GET_PERSON_VARIABLE] = &TraCIServerAPI_Person::processGet; myExecutors[libsumo::CMD_SET_PERSON_VARIABLE] = &TraCIServerAPI_Person::processSet; + myExecutors[libsumo::CMD_GET_CALIBRATOR_VARIABLE] = &TraCIServerAPI_Calibrator::processGet; + myExecutors[libsumo::CMD_SET_CALIBRATOR_VARIABLE] = &TraCIServerAPI_Calibrator::processSet; + myExecutors[libsumo::CMD_GET_BUSSTOP_VARIABLE] = &TraCIServerAPI_BusStop::processGet; + myExecutors[libsumo::CMD_SET_BUSSTOP_VARIABLE] = &TraCIServerAPI_BusStop::processSet; + myExecutors[libsumo::CMD_GET_PARKINGAREA_VARIABLE] = &TraCIServerAPI_ParkingArea::processGet; + myExecutors[libsumo::CMD_SET_PARKINGAREA_VARIABLE] = &TraCIServerAPI_ParkingArea::processSet; + myExecutors[libsumo::CMD_GET_CHARGINGSTATION_VARIABLE] = &TraCIServerAPI_ChargingStation::processGet; + myExecutors[libsumo::CMD_SET_CHARGINGSTATION_VARIABLE] = &TraCIServerAPI_ChargingStation::processSet; + myExecutors[libsumo::CMD_GET_ROUTEPROBE_VARIABLE] = &TraCIServerAPI_RouteProbe::processGet; + myExecutors[libsumo::CMD_SET_ROUTEPROBE_VARIABLE] = &TraCIServerAPI_RouteProbe::processSet; + myExecutors[libsumo::CMD_GET_REROUTER_VARIABLE] = &TraCIServerAPI_Rerouter::processGet; + myExecutors[libsumo::CMD_SET_REROUTER_VARIABLE] = &TraCIServerAPI_Rerouter::processSet; + myExecutors[libsumo::CMD_GET_VARIABLESPEEDSIGN_VARIABLE] = &TraCIServerAPI_VariableSpeedSign::processGet; + myExecutors[libsumo::CMD_SET_VARIABLESPEEDSIGN_VARIABLE] = &TraCIServerAPI_VariableSpeedSign::processSet; + myExecutors[libsumo::CMD_GET_MEANDATA_VARIABLE] = &TraCIServerAPI_MeanData::processGet; + //myExecutors[libsumo::CMD_SET_MEANDATA_VARIABLE] = &TraCIServerAPI_MeanData::processSet; + myExecutors[libsumo::CMD_GET_OVERHEADWIRE_VARIABLE] = &TraCIServerAPI_OverheadWire::processGet; + myExecutors[libsumo::CMD_SET_OVERHEADWIRE_VARIABLE] = &TraCIServerAPI_OverheadWire::processSet; myParameterSizes[libsumo::VAR_LEADER] = 9; myDoCloseConnection = false; // display warning if internal lanes are not used - if (!MSGlobals::gUsingInternalLanes) { + if (!MSGlobals::gUsingInternalLanes && !MSGlobals::gUseMesoSim) { WRITE_WARNING("Starting TraCI without using internal lanes!"); MsgHandler::getWarningInstance()->inform("Vehicles will jump over junctions.", false); MsgHandler::getWarningInstance()->inform("Use without option --no-internal-links to avoid unexpected behavior", false); @@ -1015,7 +1038,9 @@ } writeStatusCmd(s.commandId, libsumo::RTYPE_OK, ""); } - if (modifiedSubscription != nullptr && modifiedSubscription->isVehicleToVehicleContextSubscription()) { + if (modifiedSubscription != nullptr && ( + modifiedSubscription->isVehicleToVehicleContextSubscription() + || modifiedSubscription->isVehicleToPersonContextSubscription())) { // Set last modified vehicle context subscription active for filter modifications myLastContextSubscription = modifiedSubscription; } else { diff -Nru sumo-1.5.0+dfsg1/src/traci-server/TraCIServer.h sumo-1.6.0+dfsg1/src/traci-server/TraCIServer.h --- sumo-1.5.0+dfsg1/src/traci-server/TraCIServer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci-server/TraCIServer.h 2020-04-27 21:47:56.000000000 +0000 @@ -25,13 +25,7 @@ /// // TraCI server used to control sumo by a remote TraCI client /****************************************************************************/ -#ifndef TRACISERVER_H -#define TRACISERVER_H - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -444,4 +438,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/traci_testclient/CMakeLists.txt sumo-1.6.0+dfsg1/src/traci_testclient/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/traci_testclient/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci_testclient/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -20,5 +20,5 @@ set_property(TARGET testlibsumostatic PROPERTY FOLDER "test_exe") set_target_properties(testlibsumostatic PROPERTIES OUTPUT_NAME testlibsumostatic${BINARY_SUFFIX}) set_target_properties(testlibsumostatic PROPERTIES OUTPUT_NAME_DEBUG testlibsumostatic${BINARY_SUFFIX}D) -target_link_libraries(testlibsumostatic libsumostatic ${sumolibs} traciserver microsim_cfmodels microsim_devices microsim_engine microsim_output microsim_transportables) +target_link_libraries(testlibsumostatic libsumostatic ${sumolibs} traciserver libsumostatic microsim_cfmodels microsim_devices microsim_engine microsim_output microsim_transportables) add_test(libsumostatictest ${CMAKE_SOURCE_DIR}/bin/testlibsumostatic) diff -Nru sumo-1.5.0+dfsg1/src/traci_testclient/testlibsumo_main.cpp sumo-1.6.0+dfsg1/src/traci_testclient/testlibsumo_main.cpp --- sumo-1.5.0+dfsg1/src/traci_testclient/testlibsumo_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci_testclient/testlibsumo_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Testing libsumo for C++ /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include diff -Nru sumo-1.5.0+dfsg1/src/traci_testclient/TraCITestClient.cpp sumo-1.6.0+dfsg1/src/traci_testclient/TraCITestClient.cpp --- sumo-1.5.0+dfsg1/src/traci_testclient/TraCITestClient.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci_testclient/TraCITestClient.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -791,6 +791,11 @@ answerLog << " getSpeed: " << vehicle.getSpeed("0") << "\n"; answerLog << " getLateralSpeed: " << vehicle.getLateralSpeed("0") << "\n"; answerLog << " getAcceleration: " << vehicle.getAcceleration("0") << "\n"; + + answerLog << " getFollowSpeed: " << vehicle.getFollowSpeed("0", 10, 20, 9, 4.5) << "\n"; + answerLog << " getSecureGap: " << vehicle.getSecureGap("0", 10, 9, 4.5) << "\n"; + answerLog << " getStopSpeed: " << vehicle.getStopSpeed("0", 10, 20) << "\n"; + answerLog << " getSpeedMode: " << vehicle.getSpeedMode("0") << "\n"; answerLog << " getSlope: " << vehicle.getSlope("0") << "\n"; answerLog << " getLine: " << vehicle.getLine("0") << "\n"; @@ -800,6 +805,7 @@ answerLog << " getMaxSpeed: " << vehicle.getMaxSpeed("0") << "\n"; answerLog << " isRouteValid: " << vehicle.isRouteValid("0") << "\n"; answerLog << " getStopState: " << vehicle.getStopState("0") << "\n"; + answerLog << " getStopDelay: " << vehicle.getStopDelay("0") << "\n"; vehicle.setParameter("0", "meaningOfLife", "42"); answerLog << " param: " << vehicle.getParameter("0", "meaningOfLife") << "\n"; libsumo::TraCIColor col1; @@ -1012,9 +1018,11 @@ } } libsumo::TraCILogic logic("custom", 0, 3); - logic.phases = std::vector({ libsumo::TraCIPhase(5, "rrrrrrr", 5, 5), libsumo::TraCIPhase(10, "ggggggg", 5, 15), - libsumo::TraCIPhase(3, "GGGGGGG", 3, 3), libsumo::TraCIPhase(3, "yyyyyyy", 3, 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) + }); trafficlights.setCompleteRedYellowGreenDefinition("n_m4", logic); std::vector logics = trafficlights.getCompleteRedYellowGreenDefinition("n_m4"); @@ -1023,10 +1031,10 @@ answerLog << " subID=" << logics[i].programID << " type=" << logics[i].type << " phase=" << logics[i].currentPhaseIndex << "\n"; answerLog << " params=" << joinToString(logics[i].subParameter, " ", ":") << "\n"; for (int j = 0; j < (int)logics[i].phases.size(); ++j) { - answerLog << " phase=" << logics[i].phases[j].state - << " dur=" << logics[i].phases[j].duration - << " minDur=" << logics[i].phases[j].minDur - << " maxDur=" << logics[i].phases[j].maxDur + answerLog << " phase=" << logics[i].phases[j]->state + << " dur=" << logics[i].phases[j]->duration + << " minDur=" << logics[i].phases[j]->minDur + << " maxDur=" << logics[i].phases[j]->maxDur << "\n"; } } diff -Nru sumo-1.5.0+dfsg1/src/traci_testclient/TraCITestClient.h sumo-1.6.0+dfsg1/src/traci_testclient/TraCITestClient.h --- sumo-1.5.0+dfsg1/src/traci_testclient/TraCITestClient.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci_testclient/TraCITestClient.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // A test execution class /****************************************************************************/ -#ifndef TRACITESTCLIENT_H -#define TRACITESTCLIENT_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -198,4 +193,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/traci_testclient/tracitestclient_main.cpp sumo-1.6.0+dfsg1/src/traci_testclient/tracitestclient_main.cpp --- sumo-1.5.0+dfsg1/src/traci_testclient/tracitestclient_main.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/traci_testclient/tracitestclient_main.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Main method for TraCITestClient /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/common/Command.h sumo-1.6.0+dfsg1/src/utils/common/Command.h --- sumo-1.5.0+dfsg1/src/utils/common/Command.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/Command.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // Base (microsim) event class /****************************************************************************/ -#ifndef Command_h -#define Command_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -77,9 +70,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/FileHelpers.cpp sumo-1.6.0+dfsg1/src/utils/common/FileHelpers.cpp --- sumo-1.5.0+dfsg1/src/utils/common/FileHelpers.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/FileHelpers.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Functions for an easier usage of files /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -221,5 +216,5 @@ return strm; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/FileHelpers.h sumo-1.6.0+dfsg1/src/utils/common/FileHelpers.h --- sumo-1.5.0+dfsg1/src/utils/common/FileHelpers.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/FileHelpers.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // Functions for an easier usage of files /****************************************************************************/ -#ifndef FileHelpers_h -#define FileHelpers_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -308,7 +301,3 @@ } } } -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/IDSupplier.cpp sumo-1.6.0+dfsg1/src/utils/common/IDSupplier.cpp --- sumo-1.5.0+dfsg1/src/utils/common/IDSupplier.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/IDSupplier.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,4 +71,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/IDSupplier.h sumo-1.6.0+dfsg1/src/utils/common/IDSupplier.h --- sumo-1.5.0+dfsg1/src/utils/common/IDSupplier.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/IDSupplier.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // A class that generates enumerated and prefixed string-ids /****************************************************************************/ -#ifndef IDSupplier_h -#define IDSupplier_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -67,9 +60,3 @@ std::string myPrefix; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/InstancePool.h sumo-1.6.0+dfsg1/src/utils/common/InstancePool.h --- sumo-1.5.0+dfsg1/src/utils/common/InstancePool.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/InstancePool.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,14 +17,7 @@ /// // A pool of resuable instances /****************************************************************************/ -#ifndef InstancePool_h -#define InstancePool_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -103,9 +96,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/MsgHandler.cpp sumo-1.6.0+dfsg1/src/utils/common/MsgHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/common/MsgHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/MsgHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -161,8 +156,10 @@ void -MsgHandler::clear() { - myWasInformed = false; +MsgHandler::clear(bool resetInformed) { + if (resetInformed) { + myWasInformed = false; + } if (myAggregationThreshold >= 0) { for (const auto& i : myAggregationCount) { if (i.second > myAggregationThreshold) { @@ -223,6 +220,7 @@ OutputDevice::getDevice("stderr"); OptionsCont& oc = OptionsCont::getOptions(); getWarningInstance()->setAggregationThreshold(oc.getInt("aggregate-warnings")); + getErrorInstance()->setAggregationThreshold(oc.getInt("aggregate-warnings")); if (oc.getBool("no-warnings")) { getWarningInstance()->removeRetriever(&OutputDevice::getDevice("stderr")); } diff -Nru sumo-1.5.0+dfsg1/src/utils/common/MsgHandler.h sumo-1.6.0+dfsg1/src/utils/common/MsgHandler.h --- sumo-1.5.0+dfsg1/src/utils/common/MsgHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/MsgHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ -#ifndef MsgHandler_h -#define MsgHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -137,8 +131,8 @@ /// @brief Ends a process information virtual void endProcessMsg(std::string msg); - /// @brief Clears information whether an error occurred previously - virtual void clear(); + /// @brief Clears information whether an error occurred previously and print aggregated message summary + virtual void clear(bool resetInformed = true); /// @brief Adds a further retriever to the instance responsible for a certain msg type virtual void addRetriever(OutputDevice* retriever); @@ -288,9 +282,6 @@ #define PROGRESS_TIME_MESSAGE(before) MsgHandler::getMessageInstance()->endProcessMsg("done (" + toString(SysUtils::getCurrentMillis() - before) + "ms)."); #define PROGRESS_FAILED_MESSAGE() MsgHandler::getMessageInstance()->endProcessMsg("failed."); #define WRITE_ERROR(msg) MsgHandler::getErrorInstance()->inform(msg); +#define WRITE_ERRORF(...) MsgHandler::getErrorInstance()->informf(__VA_ARGS__); #define WRITE_DEBUG(msg) if(MsgHandler::writeDebugMessages()){MsgHandler::getDebugInstance()->inform(msg);}; #define WRITE_GLDEBUG(msg) if(MsgHandler::writeDebugGLMessages()){MsgHandler::getGLDebugInstance()->inform(msg);}; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/MsgRetrievingFunction.h sumo-1.6.0+dfsg1/src/utils/common/MsgRetrievingFunction.h --- sumo-1.5.0+dfsg1/src/utils/common/MsgRetrievingFunction.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/MsgRetrievingFunction.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // Encapsulates an object's method for using it as a message retriever /****************************************************************************/ -#ifndef MsgRetrievingFunction_h -#define MsgRetrievingFunction_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -103,9 +96,3 @@ std::ostringstream myMessage; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/Named.h sumo-1.6.0+dfsg1/src/utils/common/Named.h --- sumo-1.5.0+dfsg1/src/utils/common/Named.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/Named.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // Base class for objects which have an id. /****************************************************************************/ -#ifndef Named_h -#define Named_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -131,9 +124,3 @@ std::string myID; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/NamedObjectCont.h sumo-1.6.0+dfsg1/src/utils/common/NamedObjectCont.h --- sumo-1.5.0+dfsg1/src/utils/common/NamedObjectCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/NamedObjectCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // A map of named object pointers /****************************************************************************/ -#ifndef NamedObjectCont_h -#define NamedObjectCont_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -159,9 +152,3 @@ /// @brief The map from key to object IDMap myMap; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/NamedRTree.h sumo-1.6.0+dfsg1/src/utils/common/NamedRTree.h --- sumo-1.5.0+dfsg1/src/utils/common/NamedRTree.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/NamedRTree.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // A RT-tree for efficient storing of SUMO's Named objects /****************************************************************************/ -#ifndef NamedRTree_h -#define NamedRTree_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -121,8 +114,3 @@ }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/Parameterised.cpp sumo-1.6.0+dfsg1/src/utils/common/Parameterised.cpp --- sumo-1.5.0+dfsg1/src/utils/common/Parameterised.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/Parameterised.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,6 @@ /// // A super class for objects with additional parameters /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - #include #include #include @@ -35,11 +29,42 @@ // =========================================================================== // method definitions // =========================================================================== -Parameterised::Parameterised() {} + +Parameterised::Parameterised() : + myAttrType(ParameterisedAttrType::STRING) { +} -Parameterised::Parameterised(const std::map& mapArg) - : myMap(mapArg) { +Parameterised::Parameterised(ParameterisedAttrType attrType) : + myAttrType(attrType) { +} + + +Parameterised::Parameterised(const std::map& mapArg) : + myAttrType(ParameterisedAttrType::STRING), + myMap(mapArg) { +} + + +Parameterised::Parameterised(ParameterisedAttrType attrType, const std::map& mapArg) : + myAttrType(attrType) { + // check if map has to be cleaned + if (myAttrType == ParameterisedAttrType::DOUBLE) { + // iterate over map + for (const auto& keyValue : mapArg) { + try { + // try to parse to do double, and if fails, write warning + StringUtils::toDouble(keyValue.second); + // insert keyValue in map + myMap.insert(keyValue); + } catch (NumberFormatException&) { + WRITE_WARNING("Invalid conversion from string to double (" + keyValue.second + ")"); + } + } + } else { + // just update myMap + myMap = mapArg; + } } @@ -48,7 +73,18 @@ void Parameterised::setParameter(const std::string& key, const std::string& value) { - myMap[key] = value; + if (myAttrType == ParameterisedAttrType::DOUBLE) { + try { + // try to parse to do double, and if fails, write warning + StringUtils::toDouble(value); + // insert in map + myMap[key] = value; + } catch (NumberFormatException&) { + WRITE_WARNING("Invalid conversion from string to double (" + value + ")"); + } + } else { + myMap[key] = value; + } } @@ -60,8 +96,8 @@ void Parameterised::updateParameters(const std::map& mapArg) { - for (auto i : mapArg) { - myMap[i.first] = i.second; + for (const auto& keyValue : mapArg) { + setParameter(keyValue.first, keyValue.second); } } @@ -73,8 +109,8 @@ const std::string -Parameterised::getParameter(const std::string& key, const std::string& defaultValue) const { - std::map::const_iterator i = myMap.find(key); +Parameterised::getParameter(const std::string& key, const std::string defaultValue) const { + const auto i = myMap.find(key); if (i != myMap.end()) { return i->second; } @@ -84,7 +120,7 @@ double Parameterised::getDouble(const std::string& key, const double defaultValue) const { - std::map::const_iterator i = myMap.find(key); + const auto i = myMap.find(key); if (i != myMap.end()) { try { return StringUtils::toDouble(i->second); @@ -113,15 +149,15 @@ std::string -Parameterised::getParametersStr(const std::string& kvsep, const std::string& sep) const { +Parameterised::getParametersStr(const std::string kvsep, const std::string sep) const { std::string result; // Generate an string using configurable seperatrs, default: "key1=value1|key2=value2|...|keyN=valueN" bool addSep = false; - for (auto kv : myMap) { + for (const auto& keyValue : myMap) { if (addSep) { result += sep; } - result += kv.first + kvsep + kv.second; + result += keyValue.first + kvsep + keyValue.second; addSep = true; } return result; @@ -130,27 +166,37 @@ void Parameterised::setParameters(const Parameterised& params) { - myMap = params.getParametersMap(); + // first clear map + myMap.clear(); + // set parameter + for (const auto& keyValue : params.getParametersMap()) { + setParameter(keyValue.first, keyValue.second); + } } void Parameterised::setParametersMap(const std::map& paramsMap) { - myMap = paramsMap; + // first clear map + myMap.clear(); + // set parameter + for (const auto& keyValue : paramsMap) { + setParameter(keyValue.first, keyValue.second); + } } void -Parameterised::setParametersStr(const std::string& paramsString, const std::string& kvsep, const std::string& sep) { +Parameterised::setParametersStr(const std::string& paramsString, const std::string kvsep, const std::string sep) { // clear parameters myMap.clear(); // separate value in a vector of string using | as separator std::vector parameters = StringTokenizer(paramsString, sep).getVector(); // iterate over all values - for (const auto& i : parameters) { + for (const auto& keyValue : parameters) { // obtain key and value and save it in myParameters - std::vector keyValue = StringTokenizer(i, kvsep).getVector(); - myMap[keyValue.front()] = keyValue.back(); + std::vector keyValueStr = StringTokenizer(keyValue, kvsep).getVector(); + setParameter(keyValueStr.front(), keyValueStr.back()); } } @@ -158,25 +204,26 @@ void Parameterised::writeParams(OutputDevice& device) const { // iterate over all parameters and write it - for (auto i : myMap) { + for (const auto& keyValue : myMap) { device.openTag(SUMO_TAG_PARAM); - device.writeAttr(SUMO_ATTR_KEY, StringUtils::escapeXML(i.first)); - device.writeAttr(SUMO_ATTR_VALUE, StringUtils::escapeXML(i.second)); + device.writeAttr(SUMO_ATTR_KEY, StringUtils::escapeXML(keyValue.first)); + device.writeAttr(SUMO_ATTR_VALUE, StringUtils::escapeXML(keyValue.second)); device.closeTag(); } } bool -Parameterised::areParametersValid(const std::string& value, bool report, const std::string& kvsep, const std::string& sep) { +Parameterised::areParametersValid(const std::string& value, bool report, + const ParameterisedAttrType attrType, const std::string kvsep, const std::string sep) { std::vector parameters = StringTokenizer(value, sep).getVector(); // first check if parsed parameters are valid - for (const auto& i : parameters) { + for (const auto& keyValueStr : parameters) { // check if parameter is valid - if (!isParameterValid(i, report, kvsep, sep)) { + if (!isParameterValid(keyValueStr, attrType, kvsep, sep)) { // report depending of flag if (report) { - WRITE_WARNING("Invalid format of parameter (" + i + ")"); + WRITE_WARNING("Invalid format of parameter (" + keyValueStr + ")"); } return false; } @@ -190,19 +237,28 @@ // =========================================================================== bool -Parameterised::isParameterValid(const std::string& value, bool /* report */, const std::string& kvsep, const std::string& sep) { +Parameterised::isParameterValid(const std::string& value, ParameterisedAttrType attrType, + const std::string& kvsep, const std::string& sep) { if (value.find(sep) != std::string::npos || value.find(kvsep) == std::string::npos) { return false; } // separate key and value - std::vector keyValue = StringTokenizer(value, kvsep).getVector(); + std::vector keyValueStr = StringTokenizer(value, kvsep).getVector(); // Check that keyValue size is exactly 2 (key, value) - if (keyValue.size() == 2) { + if (keyValueStr.size() == 2) { // check if key and value contains valid characters - if (SUMOXMLDefinitions::isValidParameterKey(keyValue.front()) == false) { + if (SUMOXMLDefinitions::isValidParameterKey(keyValueStr.front()) == false) { return false; - } else if (SUMOXMLDefinitions::isValidParameterValue(keyValue.back()) == false) { + } else if (SUMOXMLDefinitions::isValidParameterValue(keyValueStr.back()) == false) { return false; + } else if (attrType == ParameterisedAttrType::DOUBLE) { + // check if can be parsed to double + try { + StringUtils::toDouble(keyValueStr.back()); + return true; + } catch (NumberFormatException&) { + return false; + } } else { // key=value valid, then return true return true; @@ -214,4 +270,3 @@ } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/Parameterised.h sumo-1.6.0+dfsg1/src/utils/common/Parameterised.h --- sumo-1.5.0+dfsg1/src/utils/common/Parameterised.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/Parameterised.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,14 +20,7 @@ /// // A super class for objects with additional parameters /****************************************************************************/ -#ifndef Parameterised_h -#define Parameterised_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -45,14 +38,34 @@ */ class Parameterised { public: - /// @brief Constructor + + /// @brie enum for Parameterised type + enum class ParameterisedAttrType { + /// @brief Parameterised accept strings + STRING, + /// @brief Parameterised only accept doubles + DOUBLE + }; + + /// @brief Default constructor (for Strings) Parameterised(); - /**@brief Constructor with parameters + /**@brief Constructor + * @param[in] attrType parameterised attribute type + */ + Parameterised(ParameterisedAttrType attrType); + + /**@brief Constructor with parameters (for Strings) * @param[in] mapArg Pre-given parameter */ Parameterised(const std::map& mapArg); + /**@brief Constructor with parameters + * @param[in] attrType parameterised attribute type + * @param[in] mapArg Pre-given parameter + */ + Parameterised(ParameterisedAttrType attrType, const std::map& mapArg); + /// @brief Destructor ~Parameterised(); @@ -83,7 +96,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; + 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 @@ -99,7 +112,7 @@ const std::map& getParametersMap() const; /// @brief Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN" - std::string getParametersStr(const std::string& kvsep = "=", const std::string& sep = "|") const; + std::string getParametersStr(const std::string kvsep = "=", const std::string sep = "|") const; /// @brief set the inner key/value map in map format void setParameters(const Parameterised& params); @@ -112,26 +125,23 @@ * @param[in] kvsep The separater between key and value * @param[in] sep The separater between map entries */ - void setParametersStr(const std::string& paramsString, const std::string& kvsep = "=", const std::string& sep = "|"); + void setParametersStr(const std::string& paramsString, const std::string kvsep = "=", const std::string sep = "|"); /// @brief write Params in the given outputdevice void writeParams(OutputDevice& device) const; /// @brief check if given string can be parsed to a parameters map "key1=value1|key2=value2|...|keyN=valueN" - static bool areParametersValid(const std::string& value, - bool report = false, const std::string& kvsep = "=", const std::string& sep = "|"); + static bool areParametersValid(const std::string& value, bool report = false, ParameterisedAttrType attrType = ParameterisedAttrType::STRING, + const std::string kvsep = "=", const std::string sep = "|"); private: /// @brief check if given string can be parsed to a parameter of type "key=value" - static bool isParameterValid(const std::string& value, bool report, - const std::string& kvsep = "=", const std::string& sep = "|"); + static bool isParameterValid(const std::string& value, ParameterisedAttrType attrType, + const std::string& kvsep, const std::string& sep); + + /// @brief parameterised type + ParameterisedAttrType myAttrType; /// @brief The key->value map std::map myMap; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/ParametrisedWrappingCommand.h sumo-1.6.0+dfsg1/src/utils/common/ParametrisedWrappingCommand.h --- sumo-1.5.0+dfsg1/src/utils/common/ParametrisedWrappingCommand.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/ParametrisedWrappingCommand.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // A wrapper for a Command function with parameter /****************************************************************************/ -#ifndef UTILS_COMMON_PARAMETRISEDWRAPPINGCOMMAND_H_ -#define UTILS_COMMON_PARAMETRISEDWRAPPINGCOMMAND_H_ +#pragma once #include "Command.h" @@ -110,4 +109,3 @@ }; -#endif /* UTILS_COMMON_PARAMETRISEDWRAPPINGCOMMAND_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/PolySolver.cpp sumo-1.6.0+dfsg1/src/utils/common/PolySolver.cpp --- sumo-1.5.0+dfsg1/src/utils/common/PolySolver.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/PolySolver.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -139,5 +134,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/PolySolver.h sumo-1.6.0+dfsg1/src/utils/common/PolySolver.h --- sumo-1.5.0+dfsg1/src/utils/common/PolySolver.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/PolySolver.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // /****************************************************************************/ -#ifndef PolySolver_h -#define PolySolver_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include // =========================================================================== @@ -61,7 +55,3 @@ static std::tuple cubicSolve(double a, double b, double c, double d); }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/RandHelper.cpp sumo-1.6.0+dfsg1/src/utils/common/RandHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/common/RandHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/RandHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -85,4 +80,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/RandHelper.h sumo-1.6.0+dfsg1/src/utils/common/RandHelper.h --- sumo-1.5.0+dfsg1/src/utils/common/RandHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/RandHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // /****************************************************************************/ -#ifndef RandHelper_h -#define RandHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -186,7 +180,3 @@ #endif }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/RGBColor.cpp sumo-1.6.0+dfsg1/src/utils/common/RGBColor.cpp --- sumo-1.5.0+dfsg1/src/utils/common/RGBColor.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/RGBColor.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A RGB-color definition /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -332,5 +327,5 @@ return fromHSV(RandHelper::rand(360, &myRNG), s, v); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/RGBColor.h sumo-1.6.0+dfsg1/src/utils/common/RGBColor.h --- sumo-1.5.0+dfsg1/src/utils/common/RGBColor.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/RGBColor.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // A RGB-color definition /****************************************************************************/ -#ifndef RGBColor_h -#define RGBColor_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -216,9 +209,3 @@ /// @brief A random number generator to generate random colors independent of other randomness static std::mt19937 myRNG; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StaticCommand.h sumo-1.6.0+dfsg1/src/utils/common/StaticCommand.h --- sumo-1.5.0+dfsg1/src/utils/common/StaticCommand.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StaticCommand.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // A wrapper for a Command function /****************************************************************************/ -#ifndef StaticCommand_h -#define StaticCommand_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include "Command.h" @@ -105,9 +98,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StdDefs.cpp sumo-1.6.0+dfsg1/src/utils/common/StdDefs.cpp --- sumo-1.5.0+dfsg1/src/utils/common/StdDefs.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StdDefs.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// @date 2014-01-07 /// /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include "StdDefs.h" @@ -48,5 +43,5 @@ return rounded / (1 << fractionBits); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StdDefs.h sumo-1.6.0+dfsg1/src/utils/common/StdDefs.h --- sumo-1.5.0+dfsg1/src/utils/common/StdDefs.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StdDefs.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // /****************************************************************************/ -#ifndef StdDefs_h -#define StdDefs_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -68,7 +62,7 @@ const double INVALID_DOUBLE = std::numeric_limits::max(); /// @brief version for written networks and default version for loading -const double NETWORK_VERSION = 1.3; +const double NETWORK_VERSION = 1.6; /* ------------------------------------------------------------------------- @@ -145,8 +139,3 @@ /// @brief round to the given number of mantissa bits beyond the given number double roundBits(double x, int fractionBits); - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StringBijection.h sumo-1.6.0+dfsg1/src/utils/common/StringBijection.h --- sumo-1.5.0+dfsg1/src/utils/common/StringBijection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StringBijection.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // Bidirectional map between string and something else /****************************************************************************/ -#ifndef StringBijection_h -#define StringBijection_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -155,8 +148,3 @@ std::map myT2String; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StringTokenizer.cpp sumo-1.6.0+dfsg1/src/utils/common/StringTokenizer.cpp --- sumo-1.5.0+dfsg1/src/utils/common/StringTokenizer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StringTokenizer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A java-style StringTokenizer for c++ (stl) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -202,4 +197,5 @@ return ret; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StringTokenizer.h sumo-1.6.0+dfsg1/src/utils/common/StringTokenizer.h --- sumo-1.5.0+dfsg1/src/utils/common/StringTokenizer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StringTokenizer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // A java-style StringTokenizer for c++ (stl) /****************************************************************************/ -#ifndef StringTokenizer_h -#define StringTokenizer_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -151,9 +144,3 @@ /// @brief the list of substring lengths SizeVector myLengths; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StringUtils.cpp sumo-1.6.0+dfsg1/src/utils/common/StringUtils.cpp --- sumo-1.5.0+dfsg1/src/utils/common/StringUtils.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StringUtils.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Some static methods for string processing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/common/StringUtils.h sumo-1.6.0+dfsg1/src/utils/common/StringUtils.h --- sumo-1.5.0+dfsg1/src/utils/common/StringUtils.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/StringUtils.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,14 +20,7 @@ /// // Some static methods for string processing /****************************************************************************/ -#ifndef StringUtils_h -#define StringUtils_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -146,9 +139,3 @@ */ static std::string transcode(const XMLCh* const data, int length); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SUMOTime.cpp sumo-1.6.0+dfsg1/src/utils/common/SUMOTime.cpp --- sumo-1.5.0+dfsg1/src/utils/common/SUMOTime.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SUMOTime.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,9 +19,6 @@ /// // Variables, methods, and tools for internal time representation /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,7 +73,7 @@ // needed for signed zero errors, see #5926 t = abs(t); const SUMOTime scale = (SUMOTime)pow(10, MAX2(0, 3 - gPrecision)); - if (scale > 1) { + if (scale > 1 && t != SUMOTime_MAX) { t = (t + scale / 2) / scale; } const SUMOTime second = TIME2STEPS(1) / scale; @@ -96,7 +93,7 @@ t %= minute; oss << std::setw(2) << t / second; t %= second; - if (t != 0 || TS != 1.) { + if (t != 0 || TS < 1.) { oss << std::setw(MIN2(3, gPrecision)); oss << "." << t; } @@ -109,9 +106,9 @@ } -bool checkStepLengthMultiple(const SUMOTime t, const std::string& error) { - if (t % DELTA_T != 0) { - WRITE_WARNING("The given time value " + time2string(t) + " is not a multiple of the step length " + time2string(DELTA_T) + error + ".") +bool checkStepLengthMultiple(const SUMOTime t, const std::string& error, SUMOTime deltaT) { + if (t % deltaT != 0) { + WRITE_WARNING("The given time value " + time2string(t) + " is not a multiple of the step length " + time2string(deltaT) + error + ".") } // next line used to fix build return false; diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SUMOTime.h sumo-1.6.0+dfsg1/src/utils/common/SUMOTime.h --- sumo-1.5.0+dfsg1/src/utils/common/SUMOTime.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SUMOTime.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // Variables, methods, and tools for internal time representation /****************************************************************************/ -#ifndef SUMOTime_h -#define SUMOTime_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include "UtilExceptions.h" @@ -77,9 +70,4 @@ std::string time2string(SUMOTime t); /// @brief check if given SUMOTime is multiple of the step length -bool checkStepLengthMultiple(const SUMOTime t, const std::string& error = ""); - -#endif - - -/****************************************************************************/ +bool checkStepLengthMultiple(const SUMOTime t, const std::string& error = "", SUMOTime deltaT = DELTA_T); diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SUMOVehicleClass.cpp sumo-1.6.0+dfsg1/src/utils/common/SUMOVehicleClass.cpp --- sumo-1.5.0+dfsg1/src/utils/common/SUMOVehicleClass.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SUMOVehicleClass.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -422,5 +417,45 @@ return offsets; } -/****************************************************************************/ +double +getDefaultVehicleLength(const SUMOVehicleClass vc) { + switch (vc) { + case SVC_PEDESTRIAN: + return 0.215; + case SVC_BICYCLE: + return 1.6; + case SVC_MOPED: + return 2.1; + case SVC_MOTORCYCLE: + return 2.2; + case SVC_TRUCK: + return 7.1; + case SVC_TRAILER: + return 16.5; + case SVC_BUS: + return 12.; + case SVC_COACH: + return 14.; + case SVC_TRAM: + return 22.; + case SVC_RAIL_URBAN: + return 36.5 * 3; + case SVC_RAIL: + return 67.5 * 2; + case SVC_RAIL_ELECTRIC: + case SVC_RAIL_FAST: + return 25. * 8; + case SVC_DELIVERY: + case SVC_EMERGENCY: + return 6.5; + case SVC_SHIP: + return 17; + default: + return 5; /*4.3*/ + } +} + + + +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SUMOVehicleClass.h sumo-1.6.0+dfsg1/src/utils/common/SUMOVehicleClass.h --- sumo-1.5.0+dfsg1/src/utils/common/SUMOVehicleClass.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SUMOVehicleClass.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,14 +21,7 @@ /// // Definitions of SUMO vehicle classes and helper functions /****************************************************************************/ -#ifndef SUMOVehicleClass_h -#define SUMOVehicleClass_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -352,6 +345,13 @@ */ extern bool noVehicles(SVCPermissions permissions); +/** @brief Returns the default vehicle length + * This put into a function so it can be used by NBVehicle + * @param[in] vc the vehicle class + * @return the default length in m + */ +extern double getDefaultVehicleLength(const SUMOVehicleClass vc = SVC_IGNORING); + // --------------------------------------------------------------------------- // default vehicle type parameter // --------------------------------------------------------------------------- @@ -366,8 +366,3 @@ extern const double DEFAULT_PEDESTRIAN_SPEED; extern const double DEFAULT_CONTAINER_TRANSHIP_SPEED; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SystemFrame.cpp sumo-1.6.0+dfsg1/src/utils/common/SystemFrame.cpp --- sumo-1.5.0+dfsg1/src/utils/common/SystemFrame.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SystemFrame.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A set of actions common to all applications /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "SystemFrame.h" @@ -149,4 +144,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SystemFrame.h sumo-1.6.0+dfsg1/src/utils/common/SystemFrame.h --- sumo-1.5.0+dfsg1/src/utils/common/SystemFrame.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SystemFrame.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,15 +18,7 @@ /// // A set of actions common to all applications /****************************************************************************/ -#ifndef SystemFrame_h -#define SystemFrame_h - - -// =========================================================================== -// included modules -// =========================================================================== - - +#pragma once // =========================================================================== // class declarations // =========================================================================== @@ -84,9 +76,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SysUtils.cpp sumo-1.6.0+dfsg1/src/utils/common/SysUtils.cpp --- sumo-1.5.0+dfsg1/src/utils/common/SysUtils.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SysUtils.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,9 +18,6 @@ /// // A few system-specific functions /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -102,5 +99,5 @@ #endif } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/SysUtils.h sumo-1.6.0+dfsg1/src/utils/common/SysUtils.h --- sumo-1.5.0+dfsg1/src/utils/common/SysUtils.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/SysUtils.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,14 +17,7 @@ /// // A few system-specific functions /****************************************************************************/ -#ifndef SysUtils_h -#define SysUtils_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include // =========================================================================== @@ -54,8 +47,3 @@ /// @brief run a shell command without popping up any windows (particuarly on win32) static unsigned long runHiddenCommand(const std::string& cmd); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/ToString.h sumo-1.6.0+dfsg1/src/utils/common/ToString.h --- sumo-1.5.0+dfsg1/src/utils/common/ToString.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/ToString.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,14 +20,7 @@ /// // ------------------- /****************************************************************************/ -#ifndef ToString_h -#define ToString_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -367,9 +360,3 @@ inline std::string toString(const std::map& v, std::streamsize) { return joinToString(v, ", ", ":"); } - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/UtilExceptions.h sumo-1.6.0+dfsg1/src/utils/common/UtilExceptions.h --- sumo-1.5.0+dfsg1/src/utils/common/UtilExceptions.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/UtilExceptions.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,14 +20,7 @@ /// // Exceptions for used by some utility classes /****************************************************************************/ -#ifndef UtilExceptions_h -#define UtilExceptions_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -179,7 +172,3 @@ #else #define SOFT_ASSERT(expr) assert(expr); #endif - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/ValueRetriever.h sumo-1.6.0+dfsg1/src/utils/common/ValueRetriever.h --- sumo-1.5.0+dfsg1/src/utils/common/ValueRetriever.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/ValueRetriever.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,7 @@ /// // /****************************************************************************/ -#ifndef ValueRetriever_h -#define ValueRetriever_h - - -// =========================================================================== -// included modules -// =========================================================================== - - +#pragma once // =========================================================================== // class definitions // =========================================================================== @@ -40,9 +32,3 @@ virtual void addValue(T value) = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/ValueSource.h sumo-1.6.0+dfsg1/src/utils/common/ValueSource.h --- sumo-1.5.0+dfsg1/src/utils/common/ValueSource.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/ValueSource.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,15 +17,7 @@ /// // /****************************************************************************/ -#ifndef ValueSource_h -#define ValueSource_h - - -// =========================================================================== -// included modules -// =========================================================================== - - +#pragma once // =========================================================================== // class definitions // =========================================================================== @@ -42,9 +34,3 @@ virtual ValueSource* makedoubleReturningCopy() const = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/ValueTimeLine.h sumo-1.6.0+dfsg1/src/utils/common/ValueTimeLine.h --- sumo-1.5.0+dfsg1/src/utils/common/ValueTimeLine.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/ValueTimeLine.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A list of time ranges with assigned values /****************************************************************************/ -#ifndef ValueTimeLine_h -#define ValueTimeLine_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -174,8 +168,3 @@ TimedValueMap myValues; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/common/VectorHelper.h sumo-1.6.0+dfsg1/src/utils/common/VectorHelper.h --- sumo-1.5.0+dfsg1/src/utils/common/VectorHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/VectorHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,7 @@ /// // A simple vector of doubles /****************************************************************************/ -#ifndef VectorHelper_h -#define VectorHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include #include @@ -161,10 +154,3 @@ } return os; } - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/common/WrappingCommand.h sumo-1.6.0+dfsg1/src/utils/common/WrappingCommand.h --- sumo-1.5.0+dfsg1/src/utils/common/WrappingCommand.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/common/WrappingCommand.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,14 +18,7 @@ /// // A wrapper for a Command function /****************************************************************************/ -#ifndef WrappingCommand_h -#define WrappingCommand_h - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include "Command.h" @@ -124,9 +117,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/DistributionCont.cpp sumo-1.6.0+dfsg1/src/utils/distribution/DistributionCont.cpp --- sumo-1.5.0+dfsg1/src/utils/distribution/DistributionCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/DistributionCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,9 +17,6 @@ /// // A container for distributions /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include "DistributionCont.h" diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/DistributionCont.h sumo-1.6.0+dfsg1/src/utils/distribution/DistributionCont.h --- sumo-1.5.0+dfsg1/src/utils/distribution/DistributionCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/DistributionCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A container for distributions /****************************************************************************/ -#ifndef DistributionCont_h -#define DistributionCont_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -62,9 +56,3 @@ static TypedDistDict myDict; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/Distribution.h sumo-1.6.0+dfsg1/src/utils/distribution/Distribution.h --- sumo-1.5.0+dfsg1/src/utils/distribution/Distribution.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/Distribution.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The base class for distribution descriptions. /****************************************************************************/ -#ifndef Distribution_h -#define Distribution_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -62,9 +56,3 @@ virtual std::string toStr(std::streamsize accuracy) const = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Parameterized.cpp sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Parameterized.cpp --- sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Parameterized.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Parameterized.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A distribution described by parameters such as the mean value and std-dev /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -150,5 +145,5 @@ return true; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Parameterized.h sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Parameterized.h --- sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Parameterized.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Parameterized.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A distribution described by parameters such as the mean value and std-dev /****************************************************************************/ -#ifndef Distribution_MeanDev_h -#define Distribution_MeanDev_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -86,9 +80,3 @@ /// @brief The distribution's parameters std::vector myParameter; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Points.cpp sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Points.cpp --- sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Points.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Points.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The description of a distribution by a curve /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Points.h sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Points.h --- sumo-1.5.0+dfsg1/src/utils/distribution/Distribution_Points.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/Distribution_Points.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The description of a distribution by a curve /****************************************************************************/ -#ifndef Distribution_Points_h -#define Distribution_Points_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "RandomDistributor.h" @@ -66,9 +60,3 @@ /// Returns the string representation of this distribution std::string toStr(std::streamsize accuracy) const; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/distribution/RandomDistributor.h sumo-1.6.0+dfsg1/src/utils/distribution/RandomDistributor.h --- sumo-1.5.0+dfsg1/src/utils/distribution/RandomDistributor.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/distribution/RandomDistributor.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Represents a generic random distribution /****************************************************************************/ -#ifndef RandomDistributor_h -#define RandomDistributor_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -176,8 +170,3 @@ std::vector myProbs; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersEnergy.cpp sumo-1.6.0+dfsg1/src/utils/emissions/HelpersEnergy.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersEnergy.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersEnergy.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -227,4 +222,5 @@ } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersEnergy.h sumo-1.6.0+dfsg1/src/utils/emissions/HelpersEnergy.h --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersEnergy.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersEnergy.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ -#ifndef HelpersEnergy_h -#define HelpersEnergy_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -85,9 +79,3 @@ /// @brief The default parameter std::map myDefaultParameter; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHarmonoise.cpp sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHarmonoise.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHarmonoise.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHarmonoise.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Noise data collector for edges/lanes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "PollutantsInterface.h" @@ -139,7 +134,4 @@ } - - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHarmonoise.h sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHarmonoise.h --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHarmonoise.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHarmonoise.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper methods for Harmonoise-based noise emission computation /****************************************************************************/ -#ifndef HelpersHarmonoise_h -#define HelpersHarmonoise_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -101,9 +95,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA3.cpp sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA3.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA3.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA3.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Helper methods for HBEFA3-based emission computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -564,4 +559,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA3.h sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA3.h --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA3.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA3.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper methods for HBEFA3-based emission computation /****************************************************************************/ -#ifndef HelpersHBEFA3_h -#define HelpersHBEFA3_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -126,9 +120,3 @@ static double myFunctionParameter[45][6][6]; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA.cpp sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA.h sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA.h --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersHBEFA.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersHBEFA.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper methods for HBEFA-based emission computation /****************************************************************************/ -#ifndef HelpersHBEFA_h -#define HelpersHBEFA_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -94,9 +88,3 @@ static double myFunctionParameter[42][36]; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersPHEMlight.cpp sumo-1.6.0+dfsg1/src/utils/emissions/HelpersPHEMlight.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersPHEMlight.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersPHEMlight.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Helper methods for PHEMlight-based emission computation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/HelpersPHEMlight.h sumo-1.6.0+dfsg1/src/utils/emissions/HelpersPHEMlight.h --- sumo-1.5.0+dfsg1/src/utils/emissions/HelpersPHEMlight.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/HelpersPHEMlight.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper methods for PHEMlight-based emission computation /****************************************************************************/ -#ifndef HelpersPHEMlight_h -#define HelpersPHEMlight_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #define INTERNAL_PHEM @@ -135,9 +129,3 @@ mutable PHEMlightdll::Helpers myHelper; std::map myCEPs; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEP.cpp sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEP.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEP.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEP.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,10 +21,6 @@ /// // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -431,4 +427,5 @@ } } // end of GetPMaxNorm + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEP.h sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEP.h --- sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEP.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEP.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // Helper class for PHEM Light, holds a specific CEP for a PHEM emission class /****************************************************************************/ -#ifndef PHEMCEP_h -#define PHEMCEP_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -324,7 +319,3 @@ StringBijection _idlingValuesPollutants; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEPHandler.cpp sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEPHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEPHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEPHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // Helper class for PHEM Light, holds CEP data for emission computation /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEPHandler.h sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEPHandler.h --- sumo-1.5.0+dfsg1/src/utils/emissions/PHEMCEPHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PHEMCEPHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,12 +20,7 @@ /// // Helper singleton class for PHEM Light, holds CEP data for emission computation /****************************************************************************/ -#ifndef PHEMCEPHandler_h -#define PHEMCEPHandler_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -143,4 +138,3 @@ }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PHEMConstants.h sumo-1.6.0+dfsg1/src/utils/emissions/PHEMConstants.h --- sumo-1.5.0+dfsg1/src/utils/emissions/PHEMConstants.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PHEMConstants.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,7 @@ // Holds constants and data version info for PHEM Light /****************************************************************************/ -#ifndef PHEMConstants_h -#define PHEMConstants_h +#pragma once const double GRAVITY_CONST = 9.81; const double AIR_DENSITY_CONST = 1.182; @@ -39,4 +38,3 @@ const std::string PHEM_DATA_VERSION = "V5"; -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PollutantsInterface.cpp sumo-1.6.0+dfsg1/src/utils/emissions/PollutantsInterface.cpp --- sumo-1.5.0+dfsg1/src/utils/emissions/PollutantsInterface.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PollutantsInterface.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,16 +18,12 @@ /// // Interface to capsulate different emission models /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include #include +#include #include "HelpersHBEFA.h" #include "HelpersHBEFA3.h" #include "HelpersPHEMlight.h" @@ -105,6 +101,28 @@ } +std::string +PollutantsInterface::getPollutantName(const EmissionType e) { + switch (e) { + case CO2: + return "CO2"; + case CO: + return "CO"; + case HC: + return "HC"; + case FUEL: + return "fuel"; + case NO_X: + return "NOx"; + case PM_X: + return "PMx"; + case ELEC: + return "electricity"; + default: + throw InvalidArgument("Unknown emission type '" + toString(e) + "'"); + } +} + bool PollutantsInterface::isHeavy(const SUMOEmissionClass c) { return (c & HEAVY_BIT) != 0; @@ -175,5 +193,5 @@ return myHelpers[c >> 16]->getModifiedAccel(c, v, a, slope); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/emissions/PollutantsInterface.h sumo-1.6.0+dfsg1/src/utils/emissions/PollutantsInterface.h --- sumo-1.5.0+dfsg1/src/utils/emissions/PollutantsInterface.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/emissions/PollutantsInterface.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Interface to capsulate different emission models /****************************************************************************/ -#ifndef PollutantsInterface_h -#define PollutantsInterface_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include // defines std::tolower @@ -306,6 +300,9 @@ */ static std::string getName(const SUMOEmissionClass c); + /// @brief return the name for the given emission type + static std::string getPollutantName(const EmissionType e); + /** @brief Checks whether the emission class describes a bus, truck or similar vehicle * @param[in] c The vehicle emission class * @return whether it describes a heavy vehicle @@ -416,8 +413,3 @@ /// @brief get all emission classes in strin format static std::vector myAllClassesStr; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/CMakeLists.txt sumo-1.6.0+dfsg1/src/utils/foxtools/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/utils/foxtools/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -14,6 +14,7 @@ FXSingleEventThread.cpp FXSingleEventThread.h FXSynchQue.h + FXSynchSet.h FXThreadEvent.cpp FXThreadEvent.h FXWorkerThread.h diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXBaseObject.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXBaseObject.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXBaseObject.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXBaseObject.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ #ifndef FXBASEOBJECT_H #define FXBASEOBJECT_H - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXConditionalLock.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXConditionalLock.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXConditionalLock.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXConditionalLock.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ #ifndef FXConditionalLock_h #define FXConditionalLock_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXLCDLabel.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXLCDLabel.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXLCDLabel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXLCDLabel.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ #ifndef FXLCDLABEL_H #define FXLCDLABEL_H - - -// =========================================================================== -// included modules -// =========================================================================== #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXLinkLabel.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXLinkLabel.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXLinkLabel.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXLinkLabel.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ #ifndef FXLinkLabel_h #define FXLinkLabel_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXSevenSegment.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXSevenSegment.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXSevenSegment.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXSevenSegment.h 2020-04-27 21:47:56.000000000 +0000 @@ -23,11 +23,6 @@ #ifndef FXSEVENSEGMENT_H #define FXSEVENSEGMENT_H - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifndef FXFRAME_H diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXSingleEventThread.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXSingleEventThread.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXSingleEventThread.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXSingleEventThread.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ #ifndef FXSingleEventThread_h #define FXSingleEventThread_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXSynchQue.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXSynchQue.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXSynchQue.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXSynchQue.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /****************************************************************************/ #ifndef FXSynchQue_h #define FXSynchQue_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #ifdef HAVE_FOX @@ -214,5 +209,3 @@ #endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXSynchSet.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXSynchSet.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXSynchSet.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXSynchSet.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,180 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2004-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 FXSynchSet.h +/// @author Jakob Erdmann +/// @date 2020-03-29 +/// +// missing_desc +/****************************************************************************/ +#ifndef FXSynchSet_h +#define FXSynchSet_h +#include + +#ifdef HAVE_FOX +#include +#endif +#include +#include +#include + +//#define DEBUG_LOCKING + +#ifdef DEBUG_LOCKING +#include +#include "FXWorkerThread.h" +#endif + +template > +class FXSynchSet { +public: + FXSynchSet(const bool condition = true): +#ifdef HAVE_FOX + myMutex(true), +#endif + myCondition(condition) + {} + + // Attention! Removes locking behavior + void unsetCondition() { + myCondition = false; + } + + // Attention! Retains the lock + Container& getContainer() { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif +#ifdef DEBUG_LOCKING + if (debugflag) { + std::cout << " FXSynchSet::getContainer thread=" << FXWorkerThread::current() << "\n"; + } + myOwningThread = FXWorkerThread::current(); +#endif + return myItems; + } + + void unlock() { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif +#ifdef DEBUG_LOCKING + if (debugflag) { + std::cout << " FXSynchSet::unlock thread=" << FXWorkerThread::current() << "\n"; + } + myOwningThread = 0; +#endif + } + + void insert(T what) { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif + myItems.insert(what); +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif + } + + bool empty() { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif + const bool ret = myItems.size() == 0; +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif + return ret; + } + + void clear() { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif + myItems.clear(); +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif + } + + size_t size() const { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif + size_t res = myItems.size(); +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif + return res; + } + + bool contains(const T& item) const { +#ifdef HAVE_FOX + if (myCondition) { + myMutex.lock(); + } +#endif + bool res = std::find(myItems.begin(), myItems.end(), item) != myItems.end(); +#ifdef HAVE_FOX + if (myCondition) { + myMutex.unlock(); + } +#endif + return res; + } + + bool isLocked() const { +#ifdef HAVE_FOX + return myMutex.locked(); +#else + return false; +#endif + } + +private: +#ifdef HAVE_FOX + mutable FXMutex myMutex; +#endif + Container myItems; + bool myCondition; + +#ifdef DEBUG_LOCKING + mutable long long int myOwningThread = 0; +public: + mutable bool debugflag = false; +#endif + +}; + + +#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadEvent.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadEvent.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadEvent.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadEvent.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadEvent.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadEvent.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadEvent.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadEvent.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /****************************************************************************/ #ifndef FXThreadEvent_h #define FXThreadEvent_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "fxexdefs.h" @@ -154,6 +149,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadMessageRetriever.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadMessageRetriever.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXThreadMessageRetriever.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXThreadMessageRetriever.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef FXThreadMessageRetriever_h #define FXThreadMessageRetriever_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "FXBaseObject.h" @@ -38,6 +33,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/FXWorkerThread.h sumo-1.6.0+dfsg1/src/utils/foxtools/FXWorkerThread.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/FXWorkerThread.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/FXWorkerThread.h 2020-04-27 21:47:56.000000000 +0000 @@ -25,10 +25,6 @@ // at which interval report maximum workload of the threads, needs WORKLOAD_PROFILING // undefine to use summary report only #define WORKLOAD_INTERVAL 100 - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // missing_desc /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -618,6 +613,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXAddEditTypedTable.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXAddEditTypedTable_h #define MFXAddEditTypedTable_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MFXEditableTable.h" @@ -158,6 +153,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXCheckableButton.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXCheckableButton.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXCheckableButton.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXCheckableButton.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // missing_desc /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MFXCheckableButton.h" @@ -119,6 +114,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXCheckableButton.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXCheckableButton.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXCheckableButton.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXCheckableButton.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXCheckableButton_h #define MFXCheckableButton_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -87,6 +82,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXEditableTable.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXEditableTable.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXEditableTable.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXEditableTable.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // missing_desc /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -689,6 +684,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXEditableTable.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXEditableTable.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXEditableTable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXEditableTable.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXEditableTable_h #define MFXEditableTable_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -142,6 +137,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXIconComboBox.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXIconComboBox.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXIconComboBox.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXIconComboBox.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ #ifndef MFXIconComboBox_h #define MFXIconComboBox_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXImageHelper.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXImageHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXImageHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXImageHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // missing_desc /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -174,6 +169,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXImageHelper.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXImageHelper.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXImageHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXImageHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXImageHelper_h #define MFXImageHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -44,6 +39,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXInterThreadEventClient.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXInterThreadEventClient.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXInterThreadEventClient.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXInterThreadEventClient.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXInterThreadEventClient_h #define MFXInterThreadEventClient_h - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -37,6 +32,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXMenuHeader.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXMenuHeader.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXMenuHeader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXMenuHeader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Header for menu commands /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "MFXMenuHeader.h" @@ -35,6 +30,4 @@ MFXMenuHeader::~MFXMenuHeader() {} - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXMenuHeader.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXMenuHeader.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXMenuHeader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXMenuHeader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXMenuHeader_h #define MFXMenuHeader_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -40,6 +35,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXUtils.cpp sumo-1.6.0+dfsg1/src/utils/foxtools/MFXUtils.cpp --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXUtils.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXUtils.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Some helper functions for FOX /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -120,4 +115,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MFXUtils.h sumo-1.6.0+dfsg1/src/utils/foxtools/MFXUtils.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MFXUtils.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MFXUtils.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /****************************************************************************/ #ifndef MFXUtils_h #define MFXUtils_h - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -134,6 +129,3 @@ #endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/foxtools/MsgHandlerSynchronized.h sumo-1.6.0+dfsg1/src/utils/foxtools/MsgHandlerSynchronized.h --- sumo-1.5.0+dfsg1/src/utils/foxtools/MsgHandlerSynchronized.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/foxtools/MsgHandlerSynchronized.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Retrieves messages about the process and gives them further to output /****************************************************************************/ -#ifndef MsgHandlerSynchronized_h -#define MsgHandlerSynchronized_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef HAVE_FOX @@ -80,9 +74,9 @@ } /// @brief Clears information whether an error occurred previously - void clear() { + void clear(bool resetInformed = true) { FXMutexLock locker(myLock); - MsgHandler::clear(); + MsgHandler::clear(resetInformed); } /// @brief Adds a further retriever to the instance responsible for a certain msg type @@ -123,7 +117,3 @@ /// @brief invalid assignment operator MsgHandlerSynchronized& operator=(const MsgHandlerSynchronized& s) = delete; }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/AbstractPoly.h sumo-1.6.0+dfsg1/src/utils/geom/AbstractPoly.h --- sumo-1.5.0+dfsg1/src/utils/geom/AbstractPoly.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/AbstractPoly.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The base class for polygons /****************************************************************************/ -#ifndef AbstractPoly_h -#define AbstractPoly_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "Position.h" @@ -59,9 +53,3 @@ /// @brief Returns whether the AbstractPoly crosses the given line virtual bool crosses(const Position& p1, const Position& p2) const = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Boundary.cpp sumo-1.6.0+dfsg1/src/utils/geom/Boundary.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/Boundary.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Boundary.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class that stores the 2D geometrical boundary /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -379,6 +374,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Boundary.h sumo-1.6.0+dfsg1/src/utils/geom/Boundary.h --- sumo-1.5.0+dfsg1/src/utils/geom/Boundary.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Boundary.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A class that stores a 2D geometrical boundary /****************************************************************************/ -#ifndef Boundary_h -#define Boundary_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -158,9 +152,3 @@ /// @brief Information whether the boundary was initialised bool myWasInitialised; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Bresenham.cpp sumo-1.6.0+dfsg1/src/utils/geom/Bresenham.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/Bresenham.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Bresenham.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A class to realise a uniform n:m - relationship using the /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -54,6 +49,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Bresenham.h sumo-1.6.0+dfsg1/src/utils/geom/Bresenham.h --- sumo-1.5.0+dfsg1/src/utils/geom/Bresenham.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Bresenham.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A class to realise a uniform n:m - relationship using the /****************************************************************************/ -#ifndef Bresenham_h -#define Bresenham_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -63,9 +57,3 @@ In each step, the callback is executed. */ static void compute(BresenhamCallBack* callBack, const int val1, const int val2); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeoConvHelper.cpp sumo-1.6.0+dfsg1/src/utils/geom/GeoConvHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/GeoConvHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeoConvHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeoConvHelper.h sumo-1.6.0+dfsg1/src/utils/geom/GeoConvHelper.h --- sumo-1.5.0+dfsg1/src/utils/geom/GeoConvHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeoConvHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // static methods for processing the coordinates conversion for the current net /****************************************************************************/ -#ifndef GeoConvHelper_h -#define GeoConvHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -233,9 +227,3 @@ /// @brief invalidated copy constructor. GeoConvHelper(const GeoConvHelper&) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeomConvHelper.cpp sumo-1.6.0+dfsg1/src/utils/geom/GeomConvHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/GeomConvHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeomConvHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Some helping functions for geometry parsing /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -125,6 +120,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeomConvHelper.h sumo-1.6.0+dfsg1/src/utils/geom/GeomConvHelper.h --- sumo-1.5.0+dfsg1/src/utils/geom/GeomConvHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeomConvHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Some helping functions for geometry parsing /****************************************************************************/ -#ifndef GeomConvHelper_h -#define GeomConvHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -84,9 +78,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeomHelper.cpp sumo-1.6.0+dfsg1/src/utils/geom/GeomHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/GeomHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeomHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Some static methods performing geometrical operations /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -280,5 +275,5 @@ return ring; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/GeomHelper.h sumo-1.6.0+dfsg1/src/utils/geom/GeomHelper.h --- sumo-1.5.0+dfsg1/src/utils/geom/GeomHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/GeomHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Some static methods performing geometrical operations /****************************************************************************/ -#ifndef GeomHelper_h -#define GeomHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -161,8 +155,3 @@ static PositionVector makeRing(const double radius1, const double radius2, const Position& center, unsigned int nPoints); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Position.cpp sumo-1.6.0+dfsg1/src/utils/geom/Position.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/Position.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Position.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // A position in the 2D- or 3D-world /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/Position.h sumo-1.6.0+dfsg1/src/utils/geom/Position.h --- sumo-1.5.0+dfsg1/src/utils/geom/Position.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/Position.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A position in the 2D- or 3D-world /****************************************************************************/ -#ifndef Position_h -#define Position_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -297,9 +291,3 @@ /// @brief The z-position double myZ; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/PositionVector.cpp sumo-1.6.0+dfsg1/src/utils/geom/PositionVector.cpp --- sumo-1.5.0+dfsg1/src/utils/geom/PositionVector.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/PositionVector.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A list of positions /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -418,11 +413,19 @@ PositionVector::getCentroid() const { if (size() == 0) { return Position::INVALID; + } else if (size() == 1) { + return (*this)[0]; + } else if (size() == 2) { + return ((*this)[0] + (*this)[1]) * 0.5; } PositionVector tmp = *this; if (!isClosed()) { // make sure its closed tmp.push_back(tmp[0]); } + // shift to origin to increase numerical stability + Position offset = tmp[0]; + Position result; + tmp.sub(offset); const int endIndex = (int)tmp.size() - 1; double div = 0; // 6 * area including sign double x = 0; @@ -436,7 +439,7 @@ y += (tmp[i].y() + tmp[i + 1].y()) * z; } div *= 3; // 6 / 2, the 2 comes from the area formula - return Position(x / div, y / div); + result = Position(x / div, y / div); } else { // compute by decomposing into line segments // http://en.wikipedia.org/wiki/Centroid#By_geometric_decomposition @@ -449,10 +452,11 @@ } if (lengthSum == 0) { // it is probably only one point - return tmp[0]; + result = tmp[0]; } - return Position(x / lengthSum, y / lengthSum); + result = Position(x / lengthSum, y / lengthSum) + offset; } + return result + offset; } @@ -537,7 +541,7 @@ if (size() < 2) { return false; } - for (const_iterator i = begin(); i != end() - 1; i++) { + for (const_iterator i = begin(); i != end(); i++) { if (poly.around(*i, offset)) { return true; } @@ -1544,7 +1548,7 @@ PositionVector -PositionVector::getOrthogonal(const Position& p, double extend, bool before, double length) const { +PositionVector::getOrthogonal(const Position& p, double extend, bool before, double length, double deg) const { PositionVector result; PositionVector tmp = *this; tmp.extrapolate2D(extend); @@ -1555,15 +1559,20 @@ } Position base = tmp.positionAtOffset2D(baseOffset); const int closestIndex = tmp.indexOfClosest(base); + const double closestOffset = tmp.offsetAtIndex2D(closestIndex); result.push_back(base); - if (fabs(baseOffset - tmp.offsetAtIndex2D(closestIndex)) > NUMERICAL_EPS) { + if (fabs(baseOffset - closestOffset) > NUMERICAL_EPS) { result.push_back(tmp[closestIndex]); + if ((closestOffset < baseOffset) != before) { + deg *= -1; + } } else if (before) { // take the segment before closestIndex if possible if (closestIndex > 0) { result.push_back(tmp[closestIndex - 1]); } else { result.push_back(tmp[1]); + deg *= -1; } } else { // take the segment after closestIndex if possible @@ -1571,12 +1580,13 @@ result.push_back(tmp[closestIndex + 1]); } else { result.push_back(tmp[-1]); + deg *= -1; } } result = result.getSubpart2D(0, length); // rotate around base result.add(base * -1); - result.rotate2D(DEG2RAD(90)); + result.rotate2D(DEG2RAD(deg)); result.add(base); return result; } diff -Nru sumo-1.5.0+dfsg1/src/utils/geom/PositionVector.h sumo-1.6.0+dfsg1/src/utils/geom/PositionVector.h --- sumo-1.5.0+dfsg1/src/utils/geom/PositionVector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/geom/PositionVector.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A list of positions /****************************************************************************/ -#ifndef PositionVector_h -#define PositionVector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -396,8 +390,9 @@ * @param[in] extend how long to extend this vector for finding an orthogonal * @param[in] front Whether to take the segment before or after the base point in case of ambiguity * @param[in] length the length of the orthogonal + * @param[in] deg the rotation angle relative to the shape direction */ - PositionVector getOrthogonal(const Position& p, double extend, bool before, double length = 1.0) const; + PositionVector getOrthogonal(const Position& p, double extend, bool before, double length = 1.0, double deg = 90) const; /// @brief returned vector that is smoothed at the front (within dist) PositionVector smoothedZFront(double dist = std::numeric_limits::max()) const; @@ -423,9 +418,3 @@ /// @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); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursors.h sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursors.h --- sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursors.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursors.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An enumeration of icons used by the gui applications /****************************************************************************/ -#ifndef GUICursors_h -#define GUICursors_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -44,9 +38,3 @@ /// @brief max number of cursors CURSOR_MAX }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.cpp sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Helper for cursors loading and usage /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -89,4 +84,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.h sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.h --- sumo-1.5.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/cursors/GUICursorSubSys.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A class to manage icons of SUMO /****************************************************************************/ -#ifndef GUICursorSubSys_h -#define GUICursorSubSys_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -61,9 +55,3 @@ /// @brief vector with the icons FXCursor* myCursors[CURSOR_MAX]; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GLHelper.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GLHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GLHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GLHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -568,10 +563,8 @@ 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) { +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, const bool mirrorText) { if (width <= 0) { width = size; } @@ -592,6 +585,10 @@ #endif glTranslated(pos.x(), pos.y(), layer); glScaled(width / myFontSize, size / myFontSize, 1.); + if (mirrorText) { + glScaled(-1, 1, 1); + glScaled(1, -1, 1); + } glRotated(-angle, 0, 0, 1); fonsSetAlign(myFont, align == 0 ? FONS_ALIGN_CENTER | FONS_ALIGN_MIDDLE : align); fonsSetColor(myFont, glfonsRGBA(col.red(), col.green(), col.blue(), col.alpha())); diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GLHelper.h sumo-1.6.0+dfsg1/src/utils/gui/div/GLHelper.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GLHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GLHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Some methods which help to draw certain geometrical objects in openGL /****************************************************************************/ -#ifndef GLHelper_h -#define GLHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -295,9 +289,11 @@ */ static void drawText(const std::string& text, const Position& pos, const double layer, const double size, - const RGBColor& col = RGBColor::BLACK, const double angle = 0, - int align = 0, - double width = -1); + const RGBColor& col = RGBColor::BLACK, + const double angle = 0, + const int align = 0, + double width = -1, + const bool mirrorText = false); static void drawTextSettings( const GUIVisualizationTextSettings& settings, @@ -365,9 +361,3 @@ /// @brief static vector with a list of alternated black/white colors (used for contourns) static std::vector myDottedcontourColors; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GLObjectValuePassConnector.h sumo-1.6.0+dfsg1/src/utils/gui/div/GLObjectValuePassConnector.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GLObjectValuePassConnector.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GLObjectValuePassConnector.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Class passing values from a GUIGlObject to another object /****************************************************************************/ -#ifndef GLObjectValuePassConnector_h -#define GLObjectValuePassConnector_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -171,9 +165,3 @@ std::vector< GLObjectValuePassConnector* > GLObjectValuePassConnector::myContainer; template FXMutex GLObjectValuePassConnector::myLock; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Functions used in GUIPerson and GNEPerson /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -110,4 +105,5 @@ } } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBasePersonHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Functions used in GUIPerson and GNEPerson for drawing persons /****************************************************************************/ -#ifndef GUIBasePersonHelper_h -#define GUIBasePersonHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -52,9 +46,3 @@ static void drawAction_drawAsImage(const double angle, const double length, const double width, const std::string& file, const SUMOVehicleShape guiShape, const double exaggeration); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Functions used in GUIBaseVehicleHelper and GNEVehicle /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIBaseVehicleHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Functions used in GUIBaseVehicleHelper and GNEVehicle /****************************************************************************/ -#ifndef GUIBaseVehicleHelper_h -#define GUIBaseVehicleHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,9 +59,3 @@ static bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings& s, const std::string& file, const GUIGlObject* o, const double width, double length); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDesigns.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDesigns.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDesigns.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDesigns.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // File with the definitions of standard style of FXObjects in SUMO /****************************************************************************/ -#ifndef GUIDesigns_h -#define GUIDesigns_h - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -36,8 +31,11 @@ /// @brief text field extended over Frame with thick frame #define GUIDesignTextField (FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT), 0, 0, 0, 23, 2, 2, 2, 2 -/// @brief text field with thick frame and size of 100x23 -#define GUIDesignTextFielWidth100 (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 100, 23, 2, 2, 2, 2 +/// @brief text field with thick frame and size of 50x23 +#define GUIDesignTextFielWidth50 (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 50, 23, 2, 2, 2, 2 + +/// @brief text field with thick frame and size of 50x23 and limited to doubles +#define GUIDesignTextFielWidth50Real (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT | TEXTFIELD_REAL), 0, 0, 50, 23, 2, 2, 2, 2 /// @brief text field with thick frame, size of 180x23 /doubles (Used in GNEVehicleType) #define GUIDesignTextFielWidth180 (FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 180, 23, 2, 2, 2, 2 @@ -208,15 +206,21 @@ /// @brief Combo box editable extended over the all frame #define GUIDesignComboBox (FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT), 0, 0, 0, 23, 2, 2, 2, 2 -/// @brief Combo box static (not editable) +/// @brief Combo box static (not editable) #define GUIDesignComboBoxStatic (COMBOBOX_STATIC | FRAME_SUNKEN | LAYOUT_LEFT | LAYOUT_TOP | LAYOUT_FIX_HEIGHT), 0, 0, 0, 23, 2, 2, 2, 2 +/// @brief Combo box static (not editable) extended over the all frame +#define GUIDesignComboBoxStaticExtended (COMBOBOX_STATIC | FRAME_THICK | LAYOUT_FILL_X | LAYOUT_FIX_HEIGHT), 0, 0, 0, 23, 2, 2, 2, 2 + /// @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, 23, 2, 2, 2, 2 -/// @brief comboBox with thick frame, size of 180x23 /doubles (Used in GNEVehicleType) +/// @brief comboBox with thick frame, size of 180x23 (Used in GNEVehicleType) #define GUIDesignComboBoxWidth180 (COMBOBOX_NORMAL | FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 180, 23, 2, 2, 2, 2 +/// @brief comboBox with thick frame, size of 120x23 +#define GUIDesignComboBoxWidth120 (COMBOBOX_NORMAL | FRAME_THICK | LAYOUT_FIX_WIDTH | LAYOUT_FIX_HEIGHT), 0, 0, 120, 23, 2, 2, 2, 2 + /// @brief number of column of every combo box #define GUIDesignComboBoxNCol 1 /// @} @@ -527,7 +531,3 @@ /// @brief desgin for TabBooks #define GUIDesignTabBook (TABBOOK_LEFTTABS | PACK_UNIFORM_WIDTH | PACK_UNIFORM_HEIGHT | LAYOUT_FILL_X | LAYOUT_FILL_Y | LAYOUT_RIGHT) - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Editor for the list of chosen objects /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -61,7 +56,7 @@ // =========================================================================== GUIDialog_GLChosenEditor::GUIDialog_GLChosenEditor(GUIMainWindow* parent, GUISelectedStorage* str) : - FXMainWindow(parent->getApp(), "List of Selected Items", GUIIconSubSys::getIcon(ICON_APP_SELECTOR), nullptr, GUIDesignChooserDialog), + FXMainWindow(parent->getApp(), "List of Selected Items", GUIIconSubSys::getIcon(GUIIcon::APP_SELECTOR), nullptr, GUIDesignChooserDialog), myParent(parent), myStorage(str) { myStorage->add2Update(this); FXHorizontalFrame* hbox = new FXHorizontalFrame(this, GUIDesignAuxiliarFrame); @@ -75,19 +70,19 @@ // build the layout FXVerticalFrame* layout = new FXVerticalFrame(hbox, GUIDesignChooserLayoutRight); // "Load" - new FXButton(layout, "&Load selection\t\t", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_CHOOSEN_LOAD, GUIDesignChooserButtons); + new FXButton(layout, "&Load selection\t\t", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_CHOOSEN_LOAD, GUIDesignChooserButtons); // "Save" - new FXButton(layout, "&Save selection\t\t", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_CHOOSEN_SAVE, GUIDesignChooserButtons); + new FXButton(layout, "&Save selection\t\t", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_CHOOSEN_SAVE, GUIDesignChooserButtons); // extra separator new FXHorizontalSeparator(layout, GUIDesignHorizontalSeparator); // "Deselect Chosen" - new FXButton(layout, "&Deselect chosen\t\t", GUIIconSubSys::getIcon(ICON_FLAG), this, MID_CHOOSEN_DESELECT, GUIDesignChooserButtons); + new FXButton(layout, "&Deselect chosen\t\t", GUIIconSubSys::getIcon(GUIIcon::FLAG), this, MID_CHOOSEN_DESELECT, GUIDesignChooserButtons); // "Clear List" - new FXButton(layout, "&Clear selection\t\t", GUIIconSubSys::getIcon(ICON_FLAG), this, MID_CHOOSEN_CLEAR, GUIDesignChooserButtons); + new FXButton(layout, "&Clear selection\t\t", GUIIconSubSys::getIcon(GUIIcon::FLAG), this, MID_CHOOSEN_CLEAR, GUIDesignChooserButtons); // extra separator new FXHorizontalSeparator(layout, GUIDesignHorizontalSeparator); // "Close" - new FXButton(layout, "Cl&ose\t\t", GUIIconSubSys::getIcon(ICON_NO), this, MID_CANCEL, GUIDesignChooserButtons); + new FXButton(layout, "Cl&ose\t\t", GUIIconSubSys::getIcon(GUIIcon::NO), this, MID_CANCEL, GUIDesignChooserButtons); myParent->addChild(this); } @@ -125,7 +120,7 @@ GUIDialog_GLChosenEditor::onCmdLoad(FXObject*, FXSelector, void*) { // get the new file name FXFileDialog opendialog(this, "Open List of Selected Items"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_EXISTING); opendialog.setPatternList("*.txt\nAll files (*)"); if (gCurrentFolder.length() != 0) { @@ -146,7 +141,7 @@ long GUIDialog_GLChosenEditor::onCmdSave(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write(this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Save List of selected Items", ".txt", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -197,4 +192,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIDialog_GLChosenEditor.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Editor for the list of chosen objects /****************************************************************************/ -#ifndef GUIDialog_GLChosenEditor_h -#define GUIDialog_GLChosenEditor_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -129,9 +123,3 @@ /// @brief The storage GUISelectedStorage* myStorage; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // A global holder of selected objects /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIGlobalSelection.h" @@ -37,6 +32,4 @@ GUISelectedStorage gSelected; - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIGlobalSelection.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A global holder of selected objects /****************************************************************************/ -#ifndef GUIGlobalSelection_h -#define GUIGlobalSelection_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GUISelectedStorage.h" @@ -37,9 +31,3 @@ * @todo Check whether this should be replaced by a Singleton */ extern GUISelectedStorage gSelected; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIIOGlobals.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIIOGlobals.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIIOGlobals.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIIOGlobals.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // The folder used as last /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIIOGlobals.h" @@ -35,5 +30,5 @@ // by default Current Folder is empty FXString gCurrentFolder; -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIIOGlobals.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIIOGlobals.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIIOGlobals.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIIOGlobals.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The folder used as last /****************************************************************************/ -#ifndef GUIIOGlobals_h -#define GUIIOGlobals_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -39,9 +33,3 @@ * of the application. It is changed after a file was loaded/saved. */ extern FXString gCurrentFolder; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIMessageWindow.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIMessageWindow.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIMessageWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIMessageWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A logging window for the gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -274,4 +269,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIMessageWindow.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIMessageWindow.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIMessageWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIMessageWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A logging window for the gui /****************************************************************************/ -#ifndef GUIMessageWindow_h -#define GUIMessageWindow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -147,9 +141,3 @@ /// @brief The instances of message retriever encapsulations OutputDevice* myErrorRetriever, *myDebugRetriever, *myGLDebugRetriever, *myMessageRetriever, *myWarningRetriever; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableItem.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableItem.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableItem.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableItem.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A single line in a parameter window /****************************************************************************/ -#ifndef GUIParameterTableItem_h -#define GUIParameterTableItem_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -154,12 +148,12 @@ myTable->setItemText(myTablePosition, 1, value.c_str()); if (dynamic) { if (getdoubleSourceCopy() == nullptr) { - myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(ICON_YES)); + myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(GUIIcon::YES)); } else { - myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(ICON_TRACKER)); + myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(GUIIcon::TRACKER)); } } else { - myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(ICON_NO)); + myTable->setItemIcon(myTablePosition, 2, GUIIconSubSys::getIcon(GUIIcon::NO)); } myTable->setItemJustify(myTablePosition, 2, FXTableItem::CENTER_X | FXTableItem::CENTER_Y); } @@ -227,9 +221,3 @@ /// @brief The table this entry belongs to FXTable* myTable; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The window that holds the table of an object's parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -68,7 +63,7 @@ FXMainWindow(app.getApp(), (o.getFullName() + " Parameter").c_str(), nullptr, nullptr, DECOR_ALL, 20, 20, 200, 500), myObject(&o), myApplication(&app), - myTrackerY(0), + myTrackerY(50), myCurrentPos(0) { myTable = new FXTable(this, this, MID_TABLE, TABLE_COL_SIZABLE | TABLE_ROW_SIZABLE | LAYOUT_FILL_X | LAYOUT_FILL_Y); myTable->setTableSize(1, 3); @@ -85,7 +80,7 @@ header->setItemSize(1, 120); header->setItemJustify(2, JUSTIFY_CENTER_X); header->setItemSize(2, 60); - setIcon(GUIIconSubSys::getIcon(ICON_APP_TABLE)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TABLE)); myLock.lock(); myObject->addParameterTable(this); myLock.unlock(); @@ -277,4 +272,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParameterTableWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The window that holds the table of an object's parameter /****************************************************************************/ -#ifndef GUIParameterTableWindow_h -#define GUIParameterTableWindow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -250,9 +244,3 @@ FOX_CONSTRUCTOR(GUIParameterTableWindow) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -76,4 +71,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIParam_PopupMenu.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A popup-menu for dynamic patameter table entries /****************************************************************************/ -#ifndef GUIParam_PopupMenu_h -#define GUIParam_PopupMenu_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -101,9 +95,3 @@ FOX_CONSTRUCTOR(GUIParam_PopupMenuInterface) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUISelectedStorage.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUISelectedStorage.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUISelectedStorage.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUISelectedStorage.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Storage for "selected" objects /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -285,4 +280,5 @@ dev.close(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUISelectedStorage.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUISelectedStorage.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUISelectedStorage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUISelectedStorage.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Storage for "selected" objects /****************************************************************************/ -#ifndef GUISelectedStorage_h -#define GUISelectedStorage_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -288,9 +282,3 @@ /// @brief saves items from the given set static void save(const std::string& filename, const std::set& ids); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIUserIO.cpp sumo-1.6.0+dfsg1/src/utils/gui/div/GUIUserIO.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIUserIO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIUserIO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Some OS-dependant functions to ease cliboard manipulation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIUserIO.h" @@ -54,5 +49,5 @@ return string.text(); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIUserIO.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIUserIO.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIUserIO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIUserIO.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Some OS-dependant functions to ease cliboard manipulation /****************************************************************************/ -#ifndef GUIUserIO_h -#define GUIUserIO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ static std::string clipped; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/div/GUIVideoEncoder.h sumo-1.6.0+dfsg1/src/utils/gui/div/GUIVideoEncoder.h --- sumo-1.5.0+dfsg1/src/utils/gui/div/GUIVideoEncoder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/div/GUIVideoEncoder.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ // https://github.com/leixiaohua1020/simplest_ffmpeg_video_encoder and // https://github.com/codefromabove/FFmpegRGBAToYUV /****************************************************************************/ -#ifndef GUIVideoEncoder_h -#define GUIVideoEncoder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -240,8 +234,3 @@ int myFrameIndex; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent.h sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent.h --- sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Definition of an own event class /****************************************************************************/ -#ifndef GUIEvent_h -#define GUIEvent_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,9 +89,3 @@ /// @brief the type of the event GUIEventType myType; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent_Message.h sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent_Message.h --- sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent_Message.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent_Message.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Event send when a message (message, warning, error) has to besubmitted /****************************************************************************/ -#ifndef GUIEvent_Message_h -#define GUIEvent_Message_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GUIEvent.h" @@ -84,9 +78,3 @@ std::string myMsg; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent_SimulationStep.h sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent_SimulationStep.h --- sumo-1.5.0+dfsg1/src/utils/gui/events/GUIEvent_SimulationStep.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/events/GUIEvent_SimulationStep.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Event send when the a simulation step has been performed by GUIRunThread /****************************************************************************/ -#ifndef GUIEvent_SimulationStep_h -#define GUIEvent_SimulationStep_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GUIEvent.h" @@ -47,9 +41,3 @@ ~GUIEvent_SimulationStep() { } }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GLIncludes.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GLIncludes.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GLIncludes.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GLIncludes.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // collection of includes for GL usage /****************************************************************************/ -#ifndef GLIncludes_h -#define GLIncludes_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef WIN32 @@ -38,4 +32,3 @@ #include -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIGlObject_AbstractAdd.h" @@ -94,17 +89,17 @@ std::vector ret; if (typeFilter == GLO_NETWORK) { return ret; - } else if (typeFilter == GLO_NETELEMENT) { - // obtain all netElements + } else if (typeFilter == GLO_NETWORKELEMENT) { + // obtain all network elements for (auto i : myObjectList) { - if ((i->getType() > GLO_NETELEMENT) && (i->getType() < GLO_ADDITIONAL)) { + if ((i->getType() > GLO_NETWORKELEMENT) && (i->getType() < GLO_ADDITIONALELEMENT)) { ret.push_back(i->getGlID()); } } - } else if (typeFilter == GLO_ADDITIONAL) { + } else if (typeFilter == GLO_ADDITIONALELEMENT) { // obtain all additionals for (auto i : myObjectList) { - if ((i->getType() > GLO_ADDITIONAL) && (i->getType() < GLO_SHAPE)) { + if ((i->getType() > GLO_ADDITIONALELEMENT) && (i->getType() < GLO_SHAPE)) { ret.push_back(i->getGlID()); } } @@ -132,5 +127,5 @@ return ret; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject_AbstractAdd.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Base class for additional objects (detectors etc.) /****************************************************************************/ -#ifndef GUIGlObject_AbstractAdd_h -#define GUIGlObject_AbstractAdd_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "GUIGlObjectTypes.h" @@ -71,9 +65,3 @@ /// @brief The list of all addtional objects currently loaded static std::vector myObjectList; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -51,7 +46,7 @@ StringBijection::Entry GUIGlObject::GUIGlObjectTypeNamesInitializer[] = { {"network", GLO_NETWORK}, // - {"netElement", GLO_NETELEMENT}, + {"networkElement", GLO_NETWORKELEMENT}, {"edge", GLO_EDGE}, {"lane", GLO_LANE}, {"junction", GLO_JUNCTION}, @@ -59,7 +54,10 @@ {"connection", GLO_CONNECTION}, {"tlLogic", GLO_TLLOGIC}, // - {"additional", GLO_ADDITIONAL}, + {"edgeData", GLO_EDGEDATA}, + {"edgeRelData", GLO_EDGERELDATA}, + // + {"additional", GLO_ADDITIONALELEMENT}, {"busStop", GLO_BUS_STOP}, {"access", GLO_ACCESS}, {"taz", GLO_TAZ}, @@ -122,17 +120,20 @@ GUIGlObject::GUIGlObject(GUIGlObjectType type, const std::string& microsimID) : myGLObjectType(type), myMicrosimID(microsimID) { - // make sure that reserved GLO_ADDITIONAL isn't used - assert(myGLObjectType != GLO_ADDITIONAL); + // make sure that reserved GLO_ADDITIONALELEMENT isn't used + assert(myGLObjectType != GLO_ADDITIONALELEMENT); myFullName = createFullName(); + // register object myGlID = GUIGlObjectStorage::gIDStorage.registerObject(this, myFullName); } GUIGlObject::~GUIGlObject() { - for (auto i : myParamWindows) { - i->removeObject(this); + // remove all paramWindow related with this object + for (const auto& paramWindow : myParamWindows) { + paramWindow->removeObject(this); } + // remove object from GLObjectValuePassConnector and GUIGlObjectStorage GLObjectValuePassConnector::removeObject(*this); GUIGlObjectStorage::gIDStorage.remove(getGlID()); } @@ -176,8 +177,13 @@ void GUIGlObject::setMicrosimID(const std::string& newID) { + // first remove objects from GUIGlObjectStorage + GUIGlObjectStorage::gIDStorage.remove(myGlID); + // set new microsimID and fullName myMicrosimID = newID; myFullName = createFullName(); + // register object again + myGlID = GUIGlObjectStorage::gIDStorage.registerObject(this, myFullName); } @@ -219,7 +225,7 @@ void GUIGlObject::buildCenterPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator) { - new FXMenuCommand(ret, "Center", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), ret, MID_CENTER); + new FXMenuCommand(ret, "Center", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), ret, MID_CENTER); if (addSeparator) { new FXMenuSeparator(ret); } @@ -239,9 +245,9 @@ void GUIGlObject::buildSelectionPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator) { if (gSelected.isSelected(getType(), getGlID())) { - new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(ICON_FLAG_MINUS), ret, MID_REMOVESELECT); + new FXMenuCommand(ret, "Remove From Selected", GUIIconSubSys::getIcon(GUIIcon::FLAG_MINUS), ret, MID_REMOVESELECT); } else { - new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(ICON_FLAG_PLUS), ret, MID_ADDSELECT); + new FXMenuCommand(ret, "Add To Selected", GUIIconSubSys::getIcon(GUIIcon::FLAG_PLUS), ret, MID_ADDSELECT); } if (addSeparator) { new FXMenuSeparator(ret); @@ -251,7 +257,7 @@ void GUIGlObject::buildShowParamsPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator) { - new FXMenuCommand(ret, "Show Parameter", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPARS); + new FXMenuCommand(ret, "Show Parameter", GUIIconSubSys::getIcon(GUIIcon::APP_TABLE), ret, MID_SHOWPARS); if (addSeparator) { new FXMenuSeparator(ret); } @@ -260,7 +266,7 @@ void GUIGlObject::buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator) { - new FXMenuCommand(ret, "Show Type Parameter", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWTYPEPARS); + new FXMenuCommand(ret, "Show Type Parameter", GUIIconSubSys::getIcon(GUIIcon::APP_TABLE), ret, MID_SHOWTYPEPARS); if (addSeparator) { new FXMenuSeparator(ret); } @@ -281,7 +287,7 @@ void GUIGlObject::buildShowManipulatorPopupEntry(GUIGLObjectPopupMenu* ret, bool addSeparator) { - new FXMenuCommand(ret, "Open Manipulator...", GUIIconSubSys::getIcon(ICON_MANIP), ret, MID_MANIP); + new FXMenuCommand(ret, "Open Manipulator...", GUIIconSubSys::getIcon(GUIIcon::MANIP), ret, MID_MANIP); if (addSeparator) { new FXMenuSeparator(ret); } @@ -362,5 +368,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObject.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObject.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Base class for all objects that may be displayed within the openGL-gui /****************************************************************************/ -#ifndef GUIGlObject_h -#define GUIGlObject_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -287,7 +281,3 @@ /// @brief Invalidated assignment operator. GUIGlObject& operator=(const GUIGlObject&) = delete; }; -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The popup menu of a globject /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -175,5 +170,5 @@ return 1; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGLObjectPopupMenu.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The popup menu of a globject. /****************************************************************************/ -#ifndef GUIGLObjectPopupMenu_h -#define GUIGLObjectPopupMenu_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -123,9 +117,3 @@ /// @brief vector mit Sub-MenuPanes std::vector myMenuPanes; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A storage for displayed objects via their numerical id /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -144,4 +139,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectStorage.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A storage for displayed objects via their numerical id /****************************************************************************/ -#ifndef GUIGlObjectStorage_h -#define GUIGlObjectStorage_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -184,9 +178,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectTypes.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectTypes.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIGlObjectTypes.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIGlObjectTypes.h 2020-04-27 21:47:56.000000000 +0000 @@ -21,13 +21,7 @@ // each type has an associated string which will be prefefixed to an object id // when constructing the full name /****************************************************************************/ -#ifndef GUIGlObjectTypes_h -#define GUIGlObjectTypes_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -44,8 +38,11 @@ /// @brief The network - empty GLO_NETWORK = 0, - /// @brief reserved GLO type to pack all netElements - GLO_NETELEMENT = 1, + /// @name nettork elements + /// @{ + + /// @brief reserved GLO type to pack all network elements + GLO_NETWORKELEMENT = 1, /// @brief an edge GLO_EDGE = 2, /// @brief a lane @@ -59,8 +56,23 @@ /// @brief a tl-logic GLO_TLLOGIC = 8, - /// @brief reserved GLO type to pack all additionals - GLO_ADDITIONAL = 100, + /// @} + + /// @name data elements + /// @{ + + /// @brief edge data + GLO_EDGEDATA = 50, + /// @brief edge relation data + GLO_EDGERELDATA = 51, + + /// @} + + /// @name additional elements + /// @{ + + /// @brief reserved GLO type to pack all additionals elements + GLO_ADDITIONALELEMENT = 100, /// @brief a busStop GLO_BUS_STOP = 101, /// @brief a containerStop @@ -99,11 +111,14 @@ GLO_VAPORIZER = 118, /// @brief a Acces GLO_ACCESS = 119, - /// @brief a TAZ - GLO_TAZ = 120, /// @brief a segment of an overhead line GLO_OVERHEAD_WIRE_SEGMENT = 121, + /// @} + + /// @name shape elements + /// @{ + /// @brief reserved GLO type to pack shapes GLO_SHAPE = 200, /// @brief a polygon @@ -111,38 +126,53 @@ /// @brief a poi GLO_POI = 202, + /// @} + + /// @name demand elements + /// @{ + /// @brief reserved GLO type to pack all RouteElements (note: In this case the sorting of GLO_ is important!) GLO_ROUTEELEMENT = 300, + /// @bief vTypes GLO_VTYPE = 301, + /// @} + /// @name routes /// @{ + /// @brief a route GLO_ROUTE = 310, /// @brief a embedded route GLO_EMBEDDEDROUTE = 311, + /// @} /// @name Person plans /// @{ + /// @brief a ride GLO_RIDE = 320, /// @brief a walk GLO_WALK = 321, /// @brief a person trip GLO_PERSONTRIP = 322, + /// @} /// @name stops /// @{ + /// @brief a stop GLO_STOP = 330, /// @brief a person stop GLO_PERSONSTOP = 331, + /// @} /// @name vehicles /// @{ + /// @brief a vehicle GLO_VEHICLE = 340, /// @brief a trip @@ -151,26 +181,30 @@ GLO_FLOW = 342, /// @brief a routeFlow GLO_ROUTEFLOW = 343, + /// @} /// @name containers (carried by vehicles) /// @{ + /// @brief a container GLO_CONTAINER = 350, + /// @} /// @name persons /// @{ + /// @brief a person GLO_PERSON = 360, /// @brief a person flow GLO_PERSONFLOW = 361, + /// @} + /// @brief Traffic Assignment Zones (TAZs) + GLO_TAZ = 400, + /// @brief empty max GLO_MAX = 2048 }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // The GUI-version of a point of interest /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -166,5 +161,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPointOfInterest.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // missing_desc /****************************************************************************/ -#ifndef GUIPointOfInterest_h -#define GUIPointOfInterest_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -125,9 +119,3 @@ /// @brief draw inner POI (before pushName() ) void drawInnerPOI(const GUIVisualizationSettings& s, bool forceSelectionColor) const; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPolygon.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPolygon.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPolygon.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPolygon.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,10 +20,6 @@ /// // The GUI-version of a polygon /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPolygon.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPolygon.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIPolygon.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIPolygon.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The GUI-version of a polygon /****************************************************************************/ -#ifndef GUIPolygon_h -#define GUIPolygon_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -146,9 +140,3 @@ void performTesselation(double lineWidth) const; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.cpp sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Storage for geometrical objects extended by mutexes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUIShapeContainer.h" @@ -199,5 +194,5 @@ return ret; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.h sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.h --- sumo-1.5.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/globjects/GUIShapeContainer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Storage for geometrical objects extended by mutexes /****************************************************************************/ -#ifndef GUIShapeContainer_h -#define GUIShapeContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -162,8 +156,3 @@ /// @brief whether existing ids shall be replaced bool myAllowReplacement; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/datainterval.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/datainterval.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/datainterval.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/datainterval.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,24 @@ +/* XPM */ +static const char *datainterval_xpm[] = { +"16 16 3 1 ", +" c #00137F", +". c #0026FF", +"X c None", +/* pixels */ +"....XXXXXXXX....", +"....XXXXXXXX....", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..XXXXXXXXXXXX..", +"..X XX XX X..", +"..X XX XX X..", +"..XXXXXXXXXXXX..", +"....XXXXXXXX....", +"....XXXXXXXX...." +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/dataset.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/dataset.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/dataset.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/dataset.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,28 @@ +/* XPM */ +static const char *dataset_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 6 1 ", +" c black", +". c #007F0E", +"X c red", +"o c #FFD800", +"O c #0026FF", +"+ c white", +/* pixels */ +" +++++++++++++++", +" +++++++++++++++", +" ++++OOOO+++++++", +" ++++OOOO+++++++", +" XXXXOOOO+++++++", +" XXXXOOOO+++++++", +" XXXXOOOO....+++", +" XXXXOOOO....+++", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" XXXXOOOO....ooo", +" " +}; \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/edgedata.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/edgedata.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/edgedata.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/edgedata.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,29 @@ +/* XPM */ +static const char *edgedata_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 7 1 ", +" c black", +". c #7F0000", +"X c #007F0E", +"o c red", +"O c #FFD800", +"+ c #0026FF", +"@ c white", +/* pixels */ +" ", +" ", +" ", +" @@ @@ @@ @@ ", +" ", +" ", +" ", +"................", +".......@@@@@@@@.", +" @@++@@@@ ", +" oo++@@@@ ", +" oo++XX@@ ", +" @@ @@oo++XXOO ", +" oo++XXOO ", +" oo++XXOO ", +" " +}; \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/edgereldata.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/edgereldata.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/edgereldata.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/edgereldata.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,38 @@ +/* XPM */ +static const char *edgereldata_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 16 1 ", +" c black", +". c #007F0E", +"X c #0026FF", +"o c red", +"O c #FFD800", +"+ c white", +"@ c black", +"# c black", +"$ c black", +"% c black", +"& c black", +"* c black", +"= c black", +"- c black", +"; c black", +": c black", +/* pixels */ +" . ", +" ... ", +" ..... ", +" . o ", +"........... oo ", +"oooooooooooooooo", +"XXXXXO oo ", +" XO o ", +" X XO ++++++++ ", +" XX XO ++XX++++ ", +"XXXXXO ooXX++++ ", +" XX O ooXX..++ ", +" X O ooXX..OO ", +" OOOOooXX..OO ", +" OOOooXX..OO ", +" O " +}; \ No newline at end of file diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/error.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/error.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/error.xpm 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/error.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* XPM */ -static const char *error_xpm[] = { -/* columns rows colors chars-per-pixel */ -"16 16 10 1 ", -" c #E2564B", -". c #E1574C", -"X c #E2574C", -"o c #E3574C", -"O c #E2564D", -"+ c #E2574D", -"@ c #E3574D", -"# c #E2584B", -"$ c #E1584C", -"% c None", -/* pixels */ -"%%%%%#o@@.#%%%%%", -"%%%%o..o@@..%%%%", -"%%..#%%%%%%#o.%%", -"%%.%%%%%%%%%%.%%", -"%.@%%%%%%%%%%#.%", -"#o%%%%o%%.%%%%o%", -"o.%%%.o..o.%%%@o", -".o%%%%.oo.%%%%@@", -"@@%%%%o..o%%%%@@", -"o.%%%o.o@.o%%%@o", -"..%%%%.%%.%%%%.%", -"%o#%%%%%%%%%%#.%", -"%%.%%%%%%%%%%o%%", -"%%.o@%%%%%%#..%%", -"%%%%..@@@@@.%%%%", -"%%%%%..@@.#%%%%%" -}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_E3.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_E3.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_E3.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_E3.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -134,4 +134,5 @@ 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_E3Selected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_E3Selected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_E3Selected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_E3Selected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -134,4 +134,5 @@ 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Empty.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Empty.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Empty.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Empty.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -86,4 +86,5 @@ 0x1a, 0x29, 0xea, 0xde, 0xcd, 0xbb, 0xb7, 0xef, 0xdf, 0xc0, 0x0f, 0x06, 0x04, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_EmptySelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_EmptySelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_EmptySelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_EmptySelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -86,4 +86,5 @@ 0x1a, 0x29, 0xea, 0xde, 0xcd, 0xbb, 0xb7, 0xef, 0xdf, 0xc0, 0x0f, 0x06, 0x04, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LaneBike.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LaneBike.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LaneBike.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LaneBike.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -246,4 +246,5 @@ 0x79, 0x91, 0x18, 0xc9, 0x24, 0x2c, 0x11, 0x10, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LaneBus.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LaneBus.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LaneBus.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LaneBus.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -191,4 +191,5 @@ 0x66, 0xaa, 0x48, 0x6b, 0xd9, 0xd5, 0xba, 0xd6, 0x2c, 0x09, 0x08, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LanePedestrian.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LanePedestrian.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LanePedestrian.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LanePedestrian.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -214,4 +214,5 @@ 0x80, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Lock.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Lock.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Lock.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Lock.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -152,4 +152,5 @@ 0xb9, 0x18, 0xf3, 0x9c, 0xe8, 0x4c, 0xa7, 0x3a, 0xd7, 0xc9, 0xce, 0x75, 0x06, 0x04, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LockSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LockSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_LockSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_LockSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -153,4 +153,5 @@ 0x8c, 0xa7, 0x3c, 0xe7, 0x49, 0xcf, 0x7a, 0x1e, 0x24, 0x20, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_NotMoving.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_NotMoving.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_NotMoving.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_NotMoving.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -109,4 +109,5 @@ 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_NotMovingSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_NotMovingSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_NotMovingSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_NotMovingSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -109,4 +109,5 @@ 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Rerouter.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Rerouter.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Rerouter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Rerouter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -145,4 +145,5 @@ 0x92, 0x93, 0xa0, 0x0c, 0x65, 0x46, 0x3c, 0x12, 0x10, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RerouterSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RerouterSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RerouterSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RerouterSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -146,4 +146,5 @@ 0x42, 0x3c, 0x22, 0x4a, 0x55, 0xba, 0xf2, 0x95, 0x19, 0xf1, 0x48, 0x40, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbe.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbe.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbe.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbe.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -139,4 +139,5 @@ 0xa2, 0x16, 0x35, 0xe2, 0x91, 0x80, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_RouteProbeSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -139,4 +139,5 @@ 0xa2, 0x16, 0x35, 0xe2, 0x91, 0x80, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_TLS.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_TLS.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_TLS.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_TLS.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -156,4 +156,5 @@ 0x54, 0x27, 0x01, 0x01, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Vaporizer.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Vaporizer.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_Vaporizer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_Vaporizer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -139,4 +139,5 @@ 0xa2, 0x16, 0x3f, 0xe5, 0x91, 0x80, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VaporizerSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VaporizerSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VaporizerSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VaporizerSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -138,4 +138,5 @@ 0x2e, 0xf1, 0x89, 0xaa, 0xf2, 0x48, 0x40, 0x00, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSign.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -145,4 +145,5 @@ 0x93, 0xa0, 0x0c, 0x65, 0x46, 0x3c, 0x12, 0x10, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GNETexture_VariableSpeedSignSelected.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -145,4 +145,5 @@ 0x93, 0xa0, 0x0c, 0x65, 0x46, 0x3c, 0x12, 0x10, 0x00, 0x3b }; + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIcons.h sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIcons.h --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIcons.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIcons.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An enumeration of icons used by the gui applications /****************************************************************************/ -#ifndef GUIIcons_h -#define GUIIcons_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -36,379 +30,386 @@ * @enum GUIIcon * @brief An enumeration of icons used by the gui applications */ -enum GUIIcon { +enum class GUIIcon { /// @name general Interface icons /// @{ - ICON_SUMO, - ICON_SUMO_MINI, - ICON_SUMO_LOGO, - ICON_EMPTY, - ICON_OPEN_CONFIG, - ICON_OPEN_NET, - ICON_OPEN_SHAPES, - ICON_OPEN_ADDITIONALS, - ICON_OPEN_TLSPROGRAMS, - ICON_RELOAD, - ICON_SAVE, - ICON_CLOSE, - ICON_HELP, + SUMO, + SUMO_MINI, + SUMO_LOGO, + EMPTY, + OPEN_CONFIG, + OPEN_NET, + OPEN_SHAPES, + OPEN_ADDITIONALS, + OPEN_TLSPROGRAMS, + RELOAD, + SAVE, + CLOSE, + HELP, /// @} /// @name simulation control icons /// @{ - ICON_START, - ICON_STOP, - ICON_STEP, + START, + STOP, + STEP, /// @} /// @name simulation view icons /// @{ - ICON_MICROVIEW, - ICON_OSGVIEW, + MICROVIEW, + OSGVIEW, /// @} /// @name simulation view icons (other) /// @{ - ICON_RECENTERVIEW, - ICON_ALLOWROTATION, + RECENTERVIEW, + ALLOWROTATION, /// @} /// @name locate objects icons /// @{ - ICON_LOCATE, - ICON_LOCATEJUNCTION, - ICON_LOCATEEDGE, - ICON_LOCATEVEHICLE, - ICON_LOCATEROUTE, - ICON_LOCATESTOP, - ICON_LOCATEPERSON, - ICON_LOCATETLS, - ICON_LOCATEADD, - ICON_LOCATEPOI, - ICON_LOCATEPOLY, + LOCATE, + LOCATEJUNCTION, + LOCATEEDGE, + LOCATEVEHICLE, + LOCATEROUTE, + LOCATESTOP, + LOCATEPERSON, + LOCATETLS, + LOCATEADD, + LOCATEPOI, + LOCATEPOLY, /// @} /// @name green and yellow objects icons /// @{ - ICON_GREENEDGE, - ICON_GREENVEHICLE, - ICON_GREENPERSON, - ICON_YELLOWEDGE, - ICON_YELLOWVEHICLE, - ICON_YELLOWPERSON, + GREENEDGE, + GREENVEHICLE, + GREENPERSON, + YELLOWEDGE, + YELLOWVEHICLE, + YELLOWPERSON, /// @} /// @name options icons /// @{ - ICON_COLORWHEEL, - ICON_SAVEDB, - ICON_REMOVEDB, - ICON_SHOWTOOLTIPS, - ICON_EDITVIEWPORT, - ICON_ZOOMSTYLE, + COLORWHEEL, + SAVEDB, + REMOVEDB, + SHOWTOOLTIPS, + EDITVIEWPORT, + ZOOMSTYLE, /// @} /// @name app icons /// @{ - ICON_APP_TRACKER, - ICON_APP_FINDER, - ICON_APP_BREAKPOINTS, - ICON_APP_TLSTRACKER, - ICON_APP_TABLE, - ICON_APP_SELECTOR, + APP_TRACKER, + APP_FINDER, + APP_BREAKPOINTS, + APP_TLSTRACKER, + APP_TABLE, + APP_SELECTOR, /// @} /// @name decision icons /// @{ - ICON_YES, - ICON_NO, + YES, + NO, /// @} /// @name flags icons /// @{ - ICON_FLAG, - ICON_FLAG_PLUS, - ICON_FLAG_MINUS, + FLAG, + FLAG_PLUS, + FLAG_MINUS, /// @} /// @name windows icosn /// @{ - ICON_WINDOWS_CASCADE, - ICON_WINDOWS_TILE_VERT, - ICON_WINDOWS_TILE_HORI, + WINDOWS_CASCADE, + WINDOWS_TILE_VERT, + WINDOWS_TILE_HORI, /// @} /// @name manipulation icons /// @{ - ICON_MANIP, - ICON_CAMERA, + MANIP, + CAMERA, /// @} /// @name graph icons /// @{ - ICON_EXTRACT, - ICON_DILATE, - ICON_ERODE, - ICON_OPENING, - ICON_CLOSING, - ICON_CLOSE_GAPS, - ICON_ERASE_STAINS, - ICON_SKELETONIZE, - ICON_RARIFY, - ICON_CREATE_GRAPH, - ICON_OPEN_BMP_DIALOG, - ICON_EYEDROP, - ICON_PAINTBRUSH1X, - ICON_PAINTBRUSH2X, - ICON_PAINTBRUSH3X, - ICON_PAINTBRUSH4X, - ICON_PAINTBRUSH5X, - ICON_RUBBER1X, - ICON_RUBBER2X, - ICON_RUBBER3X, - ICON_RUBBER4X, - ICON_RUBBER5X, - ICON_EDITGRAPH, + EXTRACT, + DILATE, + ERODE, + OPENING, + CLOSING, + CLOSE_GAPS, + ERASE_STAINS, + SKELETONIZE, + RARIFY, + CREATE_GRAPH, + OPEN_BMP_DIALOG, + EYEDROP, + PAINTBRUSH1X, + PAINTBRUSH2X, + PAINTBRUSH3X, + PAINTBRUSH4X, + PAINTBRUSH5X, + RUBBER1X, + RUBBER2X, + RUBBER3X, + RUBBER4X, + RUBBER5X, + EDITGRAPH, /// @} /// @name other tools /// @{ - ICON_EXT, - ICON_CUT_SWELL, - ICON_TRACKER, + EXT, + CUT_SWELL, + TRACKER, /// @} /// @name net edit icons /// @{ - ICON_UNDO, - ICON_REDO, - ICON_NETEDIT, - ICON_NETEDIT_MINI, - ICON_LOCK, - ICON_ADD, - ICON_REMOVE, - ICON_BIGARROWLEFT, - ICON_BIGARROWRIGHT, + UNDO, + REDO, + NETEDIT, + NETEDIT_MINI, + LOCK, + ADD, + REMOVE, + BIGARROWLEFT, + BIGARROWRIGHT, /// @} /// @name arrows /// @{ - ICON_ARROW_UP, - ICON_ARROW_DOWN, - ICON_ARROW_LEFT, - ICON_ARROW_RIGHT, + ARROW_UP, + ARROW_DOWN, + ARROW_LEFT, + ARROW_RIGHT, /// @} /// @name lane icons /// @{ - ICON_LANEPEDESTRIAN, - ICON_LANEBUS, - ICON_LANEBIKE, - ICON_LANEGREENVERGE, + LANEPEDESTRIAN, + LANEBUS, + LANEBIKE, + LANEGREENVERGE, /// @} /// @name netedit save elements /// @{ - ICON_SAVENETELEMENTS, - ICON_SAVEADDITIONALS, - ICON_SAVEDEMANDELEMENTS, + SAVENETWORKELEMENTS, + SAVEADDITIONALELEMENTS, + SAVEDEMANDELEMENTS, + SAVEDATAELEMENTS, /// @} /// @name netedit supermode icons /// @{ - ICON_SUPERMODENETWORK, - ICON_SUPERMODEDEMAND, + SUPERMODENETWORK, + SUPERMODEDEMAND, + SUPERMODEDATA, /// @} /// @name NETEDIT Network modes icons /// @{ - ICON_MODEADDITIONAL, - ICON_MODECONNECTION, - ICON_MODECREATEEDGE, - ICON_MODECROSSING, - ICON_MODETAZ, - ICON_MODEDELETE, - ICON_MODEINSPECT, - ICON_MODEMOVE, - ICON_MODESELECT, - ICON_MODETLS, - ICON_MODEPOLYGON, - ICON_MODEPROHIBITION, + MODEADDITIONAL, + MODECONNECTION, + MODECREATEEDGE, + MODECROSSING, + MODETAZ, + MODEDELETE, + MODEINSPECT, + MODEMOVE, + MODESELECT, + MODETLS, + MODEPOLYGON, + MODEPROHIBITION, /// @} /// @name NETEDIT Demand modes icons /// @{ - ICON_MODEROUTE, - ICON_MODEVEHICLE, - ICON_MODEVEHICLETYPE, - ICON_MODESTOP, - ICON_MODEPERSONTYPE, - ICON_MODEPERSON, - ICON_MODEPERSONPLAN, + MODEROUTE, + MODEVEHICLE, + MODEVEHICLETYPE, + MODESTOP, + MODEPERSONTYPE, + MODEPERSON, + MODEPERSONPLAN, + /// @} + + /// @name NETEDIT Edge modes icons + /// @{ + MODEEDGEDATA, + MODEEDGERELDATA, /// @} /// @name NETEDIT processing icons /// @{ - ICON_COMPUTEJUNCTIONS, - ICON_CLEANJUNCTIONS, - ICON_JOINJUNCTIONS, - ICON_COMPUTEDEMAND, - ICON_CLEANROUTES, - ICON_JOINROUTES, - ICON_OPTIONS, - /// @} - - /// @name NETEDIT netElements icons - /// @{ - ICON_JUNCTION, - ICON_EDGE, - ICON_LANE, - ICON_CONNECTION, - ICON_PROHIBITION, - ICON_CROSSING, - /// @} - - /// @name NETEDIT additional icons - /// @{ - ICON_BUSSTOP, - ICON_ACCESS, - ICON_CONTAINERSTOP, - ICON_CHARGINGSTATION, - ICON_E1, - ICON_E2, - ICON_E3, - ICON_E3ENTRY, - ICON_E3EXIT, - ICON_E1INSTANT, - ICON_REROUTER, - ICON_ROUTEPROBE, - ICON_VAPORIZER, - ICON_VARIABLESPEEDSIGN, - ICON_CALIBRATOR, - ICON_PARKINGAREA, - ICON_PARKINGSPACE, - ICON_REROUTERINTERVAL, - ICON_VSSSTEP, - ICON_CLOSINGREROUTE, - ICON_CLOSINGLANEREROUTE, - ICON_DESTPROBREROUTE, - ICON_PARKINGZONEREROUTE, - ICON_ROUTEPROBREROUTE, - ICON_TAZ, - ICON_TAZEDGE, - /// @} - - /// @name NETEDIT DemandElements icons - /// @{ - ICON_ROUTE, - ICON_VTYPE, - ICON_PTYPE, - ICON_VEHICLE, - ICON_TRIP, - ICON_FLOW, - ICON_ROUTEFLOW, - ICON_STOPELEMENT, - ICON_PERSON, - ICON_PERSONFLOW, - ICON_PERSONTRIP_FROMTO, - ICON_PERSONTRIP_BUSSTOP, - ICON_WALK_EDGES, - ICON_WALK_FROMTO, - ICON_WALK_BUSSTOP, - ICON_WALK_ROUTE, - ICON_RIDE_FROMTO, - ICON_RIDE_BUSSTOP, - ICON_PERSON_BUSSTOP, - ICON_PERSON_CONTAINERSTOP, - ICON_PERSON_LANESTOP, + COMPUTEJUNCTIONS, + CLEANJUNCTIONS, + JOINJUNCTIONS, + COMPUTEDEMAND, + CLEANROUTES, + JOINROUTES, + OPTIONS, + /// @} + + /// @name NETEDIT network elements icons + /// @{ + JUNCTION, + EDGE, + LANE, + CONNECTION, + PROHIBITION, + CROSSING, + /// @} + + /// @name NETEDIT additional elements icons + /// @{ + BUSSTOP, + ACCESS, + CONTAINERSTOP, + CHARGINGSTATION, + E1, + E2, + E3, + E3ENTRY, + E3EXIT, + E1INSTANT, + REROUTER, + ROUTEPROBE, + VAPORIZER, + VARIABLESPEEDSIGN, + CALIBRATOR, + PARKINGAREA, + PARKINGSPACE, + REROUTERINTERVAL, + VSSSTEP, + CLOSINGREROUTE, + CLOSINGLANEREROUTE, + DESTPROBREROUTE, + PARKINGZONEREROUTE, + ROUTEPROBREROUTE, + TAZ, + TAZEDGE, + /// @} + + /// @name NETEDIT Demand elements icons + /// @{ + ROUTE, + VTYPE, + PTYPE, + VEHICLE, + TRIP, + FLOW, + ROUTEFLOW, + STOPELEMENT, + PERSON, + PERSONFLOW, + PERSONTRIP_FROMTO, + PERSONTRIP_BUSSTOP, + WALK_EDGES, + WALK_FROMTO, + WALK_BUSSTOP, + WALK_ROUTE, + RIDE_FROMTO, + RIDE_BUSSTOP, + PERSON_BUSSTOP, + PERSON_CONTAINERSTOP, + PERSON_LANESTOP, + /// @} + + /// @name NETEDIT data elements icons + /// @{ + DATASET, + DATAINTERVAL, + EDGEDATA, + EDGERELDATA, /// @} /// @name vehicle Class icons /// @{ - ICON_VCLASS_IGNORING, - ICON_VCLASS_PRIVATE, - ICON_VCLASS_EMERGENCY, - ICON_VCLASS_AUTHORITY, - ICON_VCLASS_ARMY, - ICON_VCLASS_VIP, - ICON_VCLASS_PASSENGER, - ICON_VCLASS_HOV, - ICON_VCLASS_TAXI, - ICON_VCLASS_BUS, - ICON_VCLASS_COACH, - ICON_VCLASS_DELIVERY, - ICON_VCLASS_TRUCK, - ICON_VCLASS_TRAILER, - ICON_VCLASS_TRAM, - ICON_VCLASS_RAIL_URBAN, - ICON_VCLASS_RAIL, - ICON_VCLASS_RAIL_ELECTRIC, - ICON_VCLASS_MOTORCYCLE, - ICON_VCLASS_MOPED, - ICON_VCLASS_BICYCLE, - ICON_VCLASS_PEDESTRIAN, - ICON_VCLASS_EVEHICLE, - ICON_VCLASS_SHIP, - ICON_VCLASS_CUSTOM1, - ICON_VCLASS_CUSTOM2, + VCLASS_IGNORING, + VCLASS_PRIVATE, + VCLASS_EMERGENCY, + VCLASS_AUTHORITY, + VCLASS_ARMY, + VCLASS_VIP, + VCLASS_PASSENGER, + VCLASS_HOV, + VCLASS_TAXI, + VCLASS_BUS, + VCLASS_COACH, + VCLASS_DELIVERY, + VCLASS_TRUCK, + VCLASS_TRAILER, + VCLASS_TRAM, + VCLASS_RAIL_URBAN, + VCLASS_RAIL, + VCLASS_RAIL_ELECTRIC, + VCLASS_MOTORCYCLE, + VCLASS_MOPED, + VCLASS_BICYCLE, + VCLASS_PEDESTRIAN, + VCLASS_EVEHICLE, + VCLASS_SHIP, + VCLASS_CUSTOM1, + VCLASS_CUSTOM2, /// @} /// @name vehicle Shape icons /// @{ - ICON_VSHAPE_PEDESTRIAN, - ICON_VSHAPE_BICYCLE, - ICON_VSHAPE_MOPED, - ICON_VSHAPE_MOTORCYCLE, - ICON_VSHAPE_PASSENGER, - ICON_VSHAPE_PASSENGER_SEDAN, - ICON_VSHAPE_PASSENGER_HATCHBACK, - ICON_VSHAPE_PASSENGER_WAGON, - ICON_VSHAPE_PASSENGER_VAN, - ICON_VSHAPE_DELIVERY, - ICON_VSHAPE_TRUCK, - ICON_VSHAPE_TRUCK_SEMITRAILER, - ICON_VSHAPE_TRUCK_1TRAILER, - ICON_VSHAPE_BUS, - ICON_VSHAPE_BUS_COACH, - ICON_VSHAPE_BUS_FLEXIBLE, - ICON_VSHAPE_BUS_TROLLEY, - ICON_VSHAPE_RAIL, - ICON_VSHAPE_RAIL_CAR, - ICON_VSHAPE_RAIL_CARGO, - ICON_VSHAPE_E_VEHICLE, - ICON_VSHAPE_ANT, - ICON_VSHAPE_SHIP, - ICON_VSHAPE_EMERGENCY, - ICON_VSHAPE_FIREBRIGADE, - ICON_VSHAPE_POLICE, - ICON_VSHAPE_RICKSHAW, - ICON_VSHAPE_UNKNOWN, + VSHAPE_PEDESTRIAN, + VSHAPE_BICYCLE, + VSHAPE_MOPED, + VSHAPE_MOTORCYCLE, + VSHAPE_PASSENGER, + VSHAPE_PASSENGER_SEDAN, + VSHAPE_PASSENGER_HATCHBACK, + VSHAPE_PASSENGER_WAGON, + VSHAPE_PASSENGER_VAN, + VSHAPE_DELIVERY, + VSHAPE_TRUCK, + VSHAPE_TRUCK_SEMITRAILER, + VSHAPE_TRUCK_1TRAILER, + VSHAPE_BUS, + VSHAPE_BUS_COACH, + VSHAPE_BUS_FLEXIBLE, + VSHAPE_BUS_TROLLEY, + VSHAPE_RAIL, + VSHAPE_RAIL_CAR, + VSHAPE_RAIL_CARGO, + VSHAPE_E_VEHICLE, + VSHAPE_ANT, + VSHAPE_SHIP, + VSHAPE_EMERGENCY, + VSHAPE_FIREBRIGADE, + VSHAPE_POLICE, + VSHAPE_RICKSHAW, + VSHAPE_UNKNOWN, /// @} /// @name icons for status /// @{ - ICON_OK, - ICON_ACCEPT, - ICON_CANCEL, - ICON_CORRECT, - ICON_ERROR, - ICON_RESET, - ICON_WARNING, + OK, + ACCEPT, + CANCEL, + CORRECT, + INCORRECT, + RESET, + WARNING, /// @} /// @name icons for grid /// @{ - ICON_GRID1, - ICON_GRID2, - ICON_GRID3, + GRID1, + GRID2, + GRID3, /// @} - - /// @brief max number of icons - ICON_MAX }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIconSubSys.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIconSubSys.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIconSubSys.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIconSubSys.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,15 +19,10 @@ /// // Helper for icons loading and usage /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include -#include -#include +#include + #include "GUIIcons.h" #include "GUIIconSubSys.h" @@ -142,12 +137,14 @@ #include "ext.xpm" #include "tracker.xpm" -#include "savenetelements.xpm" +#include "savenetworkelements.xpm" #include "saveaditionalelements.xpm" #include "savedemandelements.xpm" +#include "savedataelements.xpm" #include "supermodenetwork.xpm" #include "supermodedemand.xpm" +#include "supermodedata.xpm" #include "modeadditional.xpm" #include "modeconnection.xpm" @@ -170,6 +167,9 @@ #include "modeperson.xpm" #include "modepersonplan.xpm" +#include "modeedgedata.xpm" +#include "modeedgereldata.xpm" + #include "computejunctions.xpm" #include "cleanjunctions.xpm" #include "joinjunctions.xpm" @@ -234,6 +234,11 @@ #include "personcontainerstop.xpm" #include "personlanestop.xpm" +#include "dataset.xpm" +#include "datainterval.xpm" +#include "edgedata.xpm" +#include "edgereldata.xpm" + #include "vclass_ignoring.xpm" #include "vclass_private.xpm" #include "vclass_emergency.xpm" @@ -293,7 +298,7 @@ #include "accept.xpm" #include "cancel.xpm" #include "correct.xpm" -#include "error.xpm" +#include "incorrect.xpm" #include "reset.xpm" #include "warning.xpm" @@ -314,315 +319,327 @@ GUIIconSubSys::GUIIconSubSys(FXApp* a) { // build icons - myIcons[ICON_SUMO] = new FXXPMIcon(a, sumo_icon64_xpm); - myIcons[ICON_SUMO_MINI] = new FXXPMIcon(a, sumo_icon16_xpm); - myIcons[ICON_SUMO_LOGO] = new FXXPMIcon(a, sumo_logo_xpm); - myIcons[ICON_EMPTY] = new FXXPMIcon(a, empty_xpm); - myIcons[ICON_OPEN_CONFIG] = new FXXPMIcon(a, fileopen_xpm); - myIcons[ICON_OPEN_NET] = new FXXPMIcon(a, netopen_xpm); - myIcons[ICON_OPEN_SHAPES] = new FXXPMIcon(a, shapeopen_xpm); - myIcons[ICON_OPEN_ADDITIONALS] = new FXXPMIcon(a, shapeopen_xpm); - myIcons[ICON_OPEN_TLSPROGRAMS] = new FXXPMIcon(a, shapeopen_xpm); - myIcons[ICON_RELOAD] = new FXXPMIcon(a, reload_xpm); - myIcons[ICON_SAVE] = new FXXPMIcon(a, filesave_xpm); - myIcons[ICON_CLOSE] = new FXXPMIcon(a, empty_xpm); /** temporal **/ - myIcons[ICON_HELP] = new FXXPMIcon(a, empty_xpm); /** temporal **/ - myIcons[ICON_START] = new FXXPMIcon(a, play_xpm); - myIcons[ICON_STOP] = new FXXPMIcon(a, stop_xpm); - myIcons[ICON_STEP] = new FXXPMIcon(a, step_xpm); - myIcons[ICON_MICROVIEW] = new FXXPMIcon(a, new_window_xpm); - myIcons[ICON_OSGVIEW] = new FXXPMIcon(a, new_window_3d_xpm); - myIcons[ICON_RECENTERVIEW] = new FXXPMIcon(a, recenter_view_xpm); - myIcons[ICON_ALLOWROTATION] = new FXXPMIcon(a, allow_rotation_xpm); - myIcons[ICON_EDITVIEWPORT] = new FXXPMIcon(a, magnify_xpm); - myIcons[ICON_ZOOMSTYLE] = new FXXPMIcon(a, zoomstyle_xpm); - - myIcons[ICON_APP_TRACKER] = new FXXPMIcon(a, app_tracker_xpm); - myIcons[ICON_APP_FINDER] = new FXXPMIcon(a, app_finder_xpm); - myIcons[ICON_APP_BREAKPOINTS] = new FXXPMIcon(a, app_breakpoints_xpm); - myIcons[ICON_APP_TLSTRACKER] = new FXXPMIcon(a, app_tlstracker_xpm); - myIcons[ICON_APP_TABLE] = new FXXPMIcon(a, app_table_xpm); - myIcons[ICON_APP_SELECTOR] = new FXXPMIcon(a, app_selector_xpm); - - myIcons[ICON_LOCATE] = new FXXPMIcon(a, locate_xpm); - myIcons[ICON_LOCATEJUNCTION] = new FXXPMIcon(a, locate_junction_xpm); - myIcons[ICON_LOCATEEDGE] = new FXXPMIcon(a, locate_edge_xpm); - myIcons[ICON_LOCATEVEHICLE] = new FXXPMIcon(a, locate_vehicle_xpm); - myIcons[ICON_LOCATEROUTE] = new FXXPMIcon(a, locate_route_xpm); - myIcons[ICON_LOCATESTOP] = new FXXPMIcon(a, locate_stop_xpm); - myIcons[ICON_LOCATEPERSON] = new FXXPMIcon(a, locate_person_xpm); - myIcons[ICON_LOCATETLS] = new FXXPMIcon(a, locate_tls_xpm); - myIcons[ICON_LOCATEADD] = new FXXPMIcon(a, locate_add_xpm); - myIcons[ICON_LOCATEPOI] = new FXXPMIcon(a, locate_poi_xpm); - myIcons[ICON_LOCATEPOLY] = new FXXPMIcon(a, locate_poly_xpm); - - myIcons[ICON_GREENEDGE] = new FXXPMIcon(a, green_edge_xpm); - myIcons[ICON_GREENVEHICLE] = new FXXPMIcon(a, green_vehicle_xpm); - myIcons[ICON_GREENPERSON] = new FXXPMIcon(a, green_person_xpm); - myIcons[ICON_YELLOWEDGE] = new FXXPMIcon(a, yellow_edge_xpm); - myIcons[ICON_YELLOWVEHICLE] = new FXXPMIcon(a, yellow_vehicle_xpm); - myIcons[ICON_YELLOWPERSON] = new FXXPMIcon(a, yellow_person_xpm); - - myIcons[ICON_COLORWHEEL] = new FXXPMIcon(a, colorwheel_xpm); - myIcons[ICON_SAVEDB] = new FXXPMIcon(a, savedb_xpm); - myIcons[ICON_REMOVEDB] = new FXXPMIcon(a, removedb_xpm); - myIcons[ICON_SHOWTOOLTIPS] = new FXXPMIcon(a, show_tooltips_xpm); - myIcons[ICON_YES] = new FXXPMIcon(a, yes_xpm); - myIcons[ICON_NO] = new FXXPMIcon(a, no_xpm); - myIcons[ICON_FLAG] = new FXGIFIcon(a, flag); - myIcons[ICON_FLAG_PLUS] = new FXGIFIcon(a, flag_plus); - myIcons[ICON_FLAG_MINUS] = new FXGIFIcon(a, flag_minus); + myIcons[GUIIcon::SUMO] = new FXXPMIcon(a, sumo_icon64_xpm); + myIcons[GUIIcon::SUMO_MINI] = new FXXPMIcon(a, sumo_icon16_xpm); + myIcons[GUIIcon::SUMO_LOGO] = new FXXPMIcon(a, sumo_logo_xpm); + myIcons[GUIIcon::EMPTY] = new FXXPMIcon(a, empty_xpm); + myIcons[GUIIcon::OPEN_CONFIG] = new FXXPMIcon(a, fileopen_xpm); + myIcons[GUIIcon::OPEN_NET] = new FXXPMIcon(a, netopen_xpm); + myIcons[GUIIcon::OPEN_SHAPES] = new FXXPMIcon(a, shapeopen_xpm); + myIcons[GUIIcon::OPEN_ADDITIONALS] = new FXXPMIcon(a, shapeopen_xpm); + myIcons[GUIIcon::OPEN_TLSPROGRAMS] = new FXXPMIcon(a, shapeopen_xpm); + myIcons[GUIIcon::RELOAD] = new FXXPMIcon(a, reload_xpm); + myIcons[GUIIcon::SAVE] = new FXXPMIcon(a, filesave_xpm); + myIcons[GUIIcon::CLOSE] = new FXXPMIcon(a, empty_xpm); /** temporal **/ + myIcons[GUIIcon::HELP] = new FXXPMIcon(a, empty_xpm); /** temporal **/ + myIcons[GUIIcon::START] = new FXXPMIcon(a, play_xpm); + myIcons[GUIIcon::STOP] = new FXXPMIcon(a, stop_xpm); + myIcons[GUIIcon::STEP] = new FXXPMIcon(a, step_xpm); + myIcons[GUIIcon::MICROVIEW] = new FXXPMIcon(a, new_window_xpm); + myIcons[GUIIcon::OSGVIEW] = new FXXPMIcon(a, new_window_3d_xpm); + myIcons[GUIIcon::RECENTERVIEW] = new FXXPMIcon(a, recenter_view_xpm); + myIcons[GUIIcon::ALLOWROTATION] = new FXXPMIcon(a, allow_rotation_xpm); + myIcons[GUIIcon::EDITVIEWPORT] = new FXXPMIcon(a, magnify_xpm); + myIcons[GUIIcon::ZOOMSTYLE] = new FXXPMIcon(a, zoomstyle_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); + myIcons[GUIIcon::APP_TLSTRACKER] = new FXXPMIcon(a, app_tlstracker_xpm); + myIcons[GUIIcon::APP_TABLE] = new FXXPMIcon(a, app_table_xpm); + myIcons[GUIIcon::APP_SELECTOR] = new FXXPMIcon(a, app_selector_xpm); + + myIcons[GUIIcon::LOCATE] = new FXXPMIcon(a, locate_xpm); + myIcons[GUIIcon::LOCATEJUNCTION] = new FXXPMIcon(a, locate_junction_xpm); + myIcons[GUIIcon::LOCATEEDGE] = new FXXPMIcon(a, locate_edge_xpm); + myIcons[GUIIcon::LOCATEVEHICLE] = new FXXPMIcon(a, locate_vehicle_xpm); + myIcons[GUIIcon::LOCATEROUTE] = new FXXPMIcon(a, locate_route_xpm); + myIcons[GUIIcon::LOCATESTOP] = new FXXPMIcon(a, locate_stop_xpm); + myIcons[GUIIcon::LOCATEPERSON] = new FXXPMIcon(a, locate_person_xpm); + myIcons[GUIIcon::LOCATETLS] = new FXXPMIcon(a, locate_tls_xpm); + myIcons[GUIIcon::LOCATEADD] = new FXXPMIcon(a, locate_add_xpm); + myIcons[GUIIcon::LOCATEPOI] = new FXXPMIcon(a, locate_poi_xpm); + myIcons[GUIIcon::LOCATEPOLY] = new FXXPMIcon(a, locate_poly_xpm); + + myIcons[GUIIcon::GREENEDGE] = new FXXPMIcon(a, green_edge_xpm); + myIcons[GUIIcon::GREENVEHICLE] = new FXXPMIcon(a, green_vehicle_xpm); + myIcons[GUIIcon::GREENPERSON] = new FXXPMIcon(a, green_person_xpm); + myIcons[GUIIcon::YELLOWEDGE] = new FXXPMIcon(a, yellow_edge_xpm); + myIcons[GUIIcon::YELLOWVEHICLE] = new FXXPMIcon(a, yellow_vehicle_xpm); + myIcons[GUIIcon::YELLOWPERSON] = new FXXPMIcon(a, yellow_person_xpm); + + myIcons[GUIIcon::COLORWHEEL] = new FXXPMIcon(a, colorwheel_xpm); + myIcons[GUIIcon::SAVEDB] = new FXXPMIcon(a, savedb_xpm); + myIcons[GUIIcon::REMOVEDB] = new FXXPMIcon(a, removedb_xpm); + myIcons[GUIIcon::SHOWTOOLTIPS] = new FXXPMIcon(a, show_tooltips_xpm); + myIcons[GUIIcon::YES] = new FXXPMIcon(a, yes_xpm); + myIcons[GUIIcon::NO] = new FXXPMIcon(a, no_xpm); + myIcons[GUIIcon::FLAG] = new FXGIFIcon(a, flag); + myIcons[GUIIcon::FLAG_PLUS] = new FXGIFIcon(a, flag_plus); + myIcons[GUIIcon::FLAG_MINUS] = new FXGIFIcon(a, flag_minus); // window arrangements - myIcons[ICON_WINDOWS_CASCADE] = new FXXPMIcon(a, windows_cascade_xpm); - myIcons[ICON_WINDOWS_TILE_VERT] = new FXXPMIcon(a, windows_tile_vertically_xpm); - myIcons[ICON_WINDOWS_TILE_HORI] = new FXXPMIcon(a, windows_tile_horizontally_xpm); + myIcons[GUIIcon::WINDOWS_CASCADE] = new FXXPMIcon(a, windows_cascade_xpm); + myIcons[GUIIcon::WINDOWS_TILE_VERT] = new FXXPMIcon(a, windows_tile_vertically_xpm); + myIcons[GUIIcon::WINDOWS_TILE_HORI] = new FXXPMIcon(a, windows_tile_horizontally_xpm); // manipulate - myIcons[ICON_MANIP] = new FXGIFIcon(a, manip); - myIcons[ICON_CAMERA] = new FXXPMIcon(a, camera_xpm); - myIcons[ICON_EXTRACT] = new FXXPMIcon(a, extract_streets_xpm); - myIcons[ICON_DILATE] = new FXXPMIcon(a, dilate_xpm); - myIcons[ICON_ERODE] = new FXXPMIcon(a, erode_xpm); - myIcons[ICON_OPENING] = new FXXPMIcon(a, opening_xpm); - myIcons[ICON_CLOSING] = new FXXPMIcon(a, closing_xpm); - myIcons[ICON_ERASE_STAINS] = new FXXPMIcon(a, erase_stains_xpm); - myIcons[ICON_CLOSE_GAPS] = new FXXPMIcon(a, close_gaps_xpm); - myIcons[ICON_SKELETONIZE] = new FXXPMIcon(a, skeletonize_xpm); - myIcons[ICON_RARIFY] = new FXXPMIcon(a, rarify_xpm); - myIcons[ICON_CREATE_GRAPH] = new FXXPMIcon(a, create_graph_xpm); - myIcons[ICON_OPEN_BMP_DIALOG] = new FXXPMIcon(a, open_bmp_dialog_xpm); - myIcons[ICON_EYEDROP] = new FXXPMIcon(a, eyedrop_xpm); - myIcons[ICON_PAINTBRUSH1X] = new FXXPMIcon(a, paintbrush1x_xpm); - myIcons[ICON_PAINTBRUSH2X] = new FXXPMIcon(a, paintbrush2x_xpm); - myIcons[ICON_PAINTBRUSH3X] = new FXXPMIcon(a, paintbrush3x_xpm); - myIcons[ICON_PAINTBRUSH4X] = new FXXPMIcon(a, paintbrush4x_xpm); - myIcons[ICON_PAINTBRUSH5X] = new FXXPMIcon(a, paintbrush5x_xpm); - myIcons[ICON_RUBBER1X] = new FXXPMIcon(a, rubber1x_xpm); - myIcons[ICON_RUBBER2X] = new FXXPMIcon(a, rubber2x_xpm); - myIcons[ICON_RUBBER3X] = new FXXPMIcon(a, rubber3x_xpm); - myIcons[ICON_RUBBER4X] = new FXXPMIcon(a, rubber4x_xpm); - myIcons[ICON_RUBBER5X] = new FXXPMIcon(a, rubber5x_xpm); - myIcons[ICON_EDITGRAPH] = new FXXPMIcon(a, edit_graph_xpm); - - myIcons[ICON_UNDO] = new FXXPMIcon(a, undo_xpm); - myIcons[ICON_REDO] = new FXXPMIcon(a, redo_xpm); - myIcons[ICON_NETEDIT] = new FXXPMIcon(a, netedit_icon64_xpm); - myIcons[ICON_NETEDIT_MINI] = new FXXPMIcon(a, netedit_icon16_xpm); - myIcons[ICON_LOCK] = new FXXPMIcon(a, lock_xpm); - myIcons[ICON_ADD] = new FXXPMIcon(a, add_xpm); - myIcons[ICON_REMOVE] = new FXXPMIcon(a, remove_xpm); - myIcons[ICON_BIGARROWLEFT] = new FXXPMIcon(a, bigarrowleft_xmp); - myIcons[ICON_BIGARROWRIGHT] = new FXXPMIcon(a, bigarrowright_xmp); - - myIcons[ICON_ARROW_UP] = new FXXPMIcon(a, arrowup_xpm); - myIcons[ICON_ARROW_DOWN] = new FXXPMIcon(a, arrowdown_xpm); - myIcons[ICON_ARROW_LEFT] = new FXXPMIcon(a, arrowleft_xpm); - myIcons[ICON_ARROW_RIGHT] = new FXXPMIcon(a, arrowright_xpm); - - myIcons[ICON_LANEPEDESTRIAN] = new FXXPMIcon(a, lanepedestrian); - myIcons[ICON_LANEBUS] = new FXXPMIcon(a, lanebus); - myIcons[ICON_LANEBIKE] = new FXXPMIcon(a, lanebike); - myIcons[ICON_LANEGREENVERGE] = new FXXPMIcon(a, lanegreenverge); - - myIcons[ICON_EXT] = new FXXPMIcon(a, ext_xpm); - myIcons[ICON_CUT_SWELL] = new FXXPMIcon(a, cut_xpm); - myIcons[ICON_TRACKER] = new FXXPMIcon(a, tracker_xpm); - - myIcons[ICON_SAVENETELEMENTS] = new FXXPMIcon(a, savenetelements_xpm); - myIcons[ICON_SAVEADDITIONALS] = new FXXPMIcon(a, saveadditionalelements_xpm); - myIcons[ICON_SAVEDEMANDELEMENTS] = new FXXPMIcon(a, savedemandelements_xpm); - - myIcons[ICON_SUPERMODENETWORK] = new FXXPMIcon(a, supermodenetwork_xpm); - myIcons[ICON_SUPERMODEDEMAND] = new FXXPMIcon(a, supermodedemand_xpm); - - myIcons[ICON_MODEADDITIONAL] = new FXXPMIcon(a, modeadditional_xpm); - myIcons[ICON_MODECONNECTION] = new FXXPMIcon(a, modeconnection_xpm); - myIcons[ICON_MODECREATEEDGE] = new FXXPMIcon(a, modecreateedge_xpm); - myIcons[ICON_MODECROSSING] = new FXXPMIcon(a, modecrossing_xpm); - myIcons[ICON_MODETAZ] = new FXXPMIcon(a, modetaz_xpm); - myIcons[ICON_MODEDELETE] = new FXXPMIcon(a, modedelete_xpm); - myIcons[ICON_MODEINSPECT] = new FXXPMIcon(a, modeinspect_xpm); - myIcons[ICON_MODEMOVE] = new FXXPMIcon(a, modemove_xpm); - myIcons[ICON_MODESELECT] = new FXXPMIcon(a, modeselect_xpm); - myIcons[ICON_MODETLS] = new FXXPMIcon(a, modetrafficlight_xpm); - myIcons[ICON_MODEPOLYGON] = new FXXPMIcon(a, modepolygon_xpm); - myIcons[ICON_MODEPROHIBITION] = new FXXPMIcon(a, modeprohibition_xpm); - - myIcons[ICON_MODEROUTE] = new FXXPMIcon(a, moderoute_xpm); - myIcons[ICON_MODEVEHICLE] = new FXXPMIcon(a, modevehicle_xpm); - myIcons[ICON_MODEVEHICLETYPE] = new FXXPMIcon(a, modevehicletype_xpm); - myIcons[ICON_MODESTOP] = new FXXPMIcon(a, modestop_xpm); - myIcons[ICON_MODEPERSONTYPE] = new FXXPMIcon(a, modepersontype_xpm); - myIcons[ICON_MODEPERSON] = new FXXPMIcon(a, modeperson_xpm); - myIcons[ICON_MODEPERSONPLAN] = new FXXPMIcon(a, modepersonplan_xpm); - - myIcons[ICON_COMPUTEJUNCTIONS] = new FXXPMIcon(a, computejunctions_xpm); - myIcons[ICON_CLEANJUNCTIONS] = new FXXPMIcon(a, cleanjunctions_xpm); - myIcons[ICON_JOINJUNCTIONS] = new FXXPMIcon(a, joinjunctions_xpm); - myIcons[ICON_COMPUTEDEMAND] = new FXXPMIcon(a, computedemand_xpm); - myIcons[ICON_CLEANROUTES] = new FXXPMIcon(a, cleanroutes_xpm); - myIcons[ICON_JOINROUTES] = new FXXPMIcon(a, joinroutes_xpm); - - myIcons[ICON_OPTIONS] = new FXXPMIcon(a, options_xpm); - - myIcons[ICON_JUNCTION] = new FXXPMIcon(a, junction_xpm); - myIcons[ICON_EDGE] = new FXXPMIcon(a, edge_xpm); - myIcons[ICON_LANE] = new FXXPMIcon(a, lane_xpm); - myIcons[ICON_CONNECTION] = new FXXPMIcon(a, connection_xpm); - myIcons[ICON_PROHIBITION] = new FXXPMIcon(a, prohibition_xpm); - myIcons[ICON_CROSSING] = new FXXPMIcon(a, crossing_xpm); - - myIcons[ICON_BUSSTOP] = new FXXPMIcon(a, busstop_xpm); - myIcons[ICON_ACCESS] = new FXXPMIcon(a, access_xpm); - myIcons[ICON_CONTAINERSTOP] = new FXXPMIcon(a, containerstop_xpm); - myIcons[ICON_CHARGINGSTATION] = new FXXPMIcon(a, chargingstation_xpm); - myIcons[ICON_PARKINGAREA] = new FXXPMIcon(a, parkingarea_xpm); - myIcons[ICON_PARKINGSPACE] = new FXXPMIcon(a, parkingspace_xpm); - myIcons[ICON_E1] = new FXXPMIcon(a, e1_xpm); - myIcons[ICON_E2] = new FXXPMIcon(a, e2_xpm); - myIcons[ICON_E3] = new FXXPMIcon(a, e3_xpm); - myIcons[ICON_E3ENTRY] = new FXXPMIcon(a, e3entry_xpm); - myIcons[ICON_E3EXIT] = new FXXPMIcon(a, e3exit_xpm); - myIcons[ICON_E1INSTANT] = new FXXPMIcon(a, e1instant_xpm); - myIcons[ICON_REROUTER] = new FXXPMIcon(a, rerouter_xpm); - myIcons[ICON_ROUTEPROBE] = new FXXPMIcon(a, routeprobe_xpm); - myIcons[ICON_VAPORIZER] = new FXXPMIcon(a, vaporizer_xpm); - myIcons[ICON_VARIABLESPEEDSIGN] = new FXXPMIcon(a, variablespeedsign_xpm); - myIcons[ICON_CALIBRATOR] = new FXXPMIcon(a, calibrator_xpm); - myIcons[ICON_REROUTERINTERVAL] = new FXXPMIcon(a, rerouterinterval_xpm); - myIcons[ICON_VSSSTEP] = new FXXPMIcon(a, vssstep_xpm); - myIcons[ICON_CLOSINGREROUTE] = new FXXPMIcon(a, closingreroute_xpm); - myIcons[ICON_CLOSINGLANEREROUTE] = new FXXPMIcon(a, closinglanereroute_xpm); - myIcons[ICON_DESTPROBREROUTE] = new FXXPMIcon(a, destprobreroute_xpm); - myIcons[ICON_PARKINGZONEREROUTE] = new FXXPMIcon(a, parkingzonereroute_xpm); - myIcons[ICON_ROUTEPROBREROUTE] = new FXXPMIcon(a, routeprobreroute_xpm); - myIcons[ICON_TAZ] = new FXXPMIcon(a, taz_xpm); - myIcons[ICON_TAZEDGE] = new FXXPMIcon(a, tazedge_xpm); - - myIcons[ICON_ROUTE] = new FXXPMIcon(a, route_xpm); - myIcons[ICON_VTYPE] = new FXXPMIcon(a, vtype_xpm); - myIcons[ICON_PTYPE] = new FXXPMIcon(a, ptype_xpm); - myIcons[ICON_VEHICLE] = new FXXPMIcon(a, vehicle_xpm); - myIcons[ICON_TRIP] = new FXXPMIcon(a, trip_xpm); - myIcons[ICON_FLOW] = new FXXPMIcon(a, flow_xpm); - myIcons[ICON_ROUTEFLOW] = new FXXPMIcon(a, routeflow_xpm); - myIcons[ICON_STOPELEMENT] = new FXXPMIcon(a, stopelement_xpm); - myIcons[ICON_PERSON] = new FXXPMIcon(a, person_xpm); - myIcons[ICON_PERSONFLOW] = new FXXPMIcon(a, personflow_xpm); - myIcons[ICON_PERSONTRIP_FROMTO] = new FXXPMIcon(a, persontripfromto_xpm); - myIcons[ICON_PERSONTRIP_BUSSTOP] = new FXXPMIcon(a, persontripbusstop_xpm); - myIcons[ICON_WALK_EDGES] = new FXXPMIcon(a, walkedges_xpm); - myIcons[ICON_WALK_FROMTO] = new FXXPMIcon(a, walkfromto_xpm); - myIcons[ICON_WALK_BUSSTOP] = new FXXPMIcon(a, walkbusstop_xpm); - myIcons[ICON_WALK_ROUTE] = new FXXPMIcon(a, walkroute_xpm); - myIcons[ICON_RIDE_FROMTO] = new FXXPMIcon(a, ridefromto_xpm); - myIcons[ICON_RIDE_BUSSTOP] = new FXXPMIcon(a, ridebusstop_xpm); - myIcons[ICON_PERSON_BUSSTOP] = new FXXPMIcon(a, personbusstop_xpm); - myIcons[ICON_PERSON_CONTAINERSTOP] = new FXXPMIcon(a, personcontainerstop_xpm); - myIcons[ICON_PERSON_LANESTOP] = new FXXPMIcon(a, personlanestop_xpm); - - myIcons[ICON_VCLASS_IGNORING] = new FXXPMIcon(a, vclass_ignoring_xpm); - myIcons[ICON_VCLASS_PRIVATE] = new FXXPMIcon(a, vclass_private_xpm); - myIcons[ICON_VCLASS_EMERGENCY] = new FXXPMIcon(a, vclass_emergency_xpm); - myIcons[ICON_VCLASS_AUTHORITY] = new FXXPMIcon(a, vclass_authority_xpm); - myIcons[ICON_VCLASS_ARMY] = new FXXPMIcon(a, vclass_army_xpm); - myIcons[ICON_VCLASS_VIP] = new FXXPMIcon(a, vclass_vip_xpm); - myIcons[ICON_VCLASS_PASSENGER] = new FXXPMIcon(a, vclass_passenger_xpm); - myIcons[ICON_VCLASS_HOV] = new FXXPMIcon(a, vclass_hov_xpm); - myIcons[ICON_VCLASS_TAXI] = new FXXPMIcon(a, vclass_taxi_xpm); - myIcons[ICON_VCLASS_BUS] = new FXXPMIcon(a, vclass_bus_xpm); - myIcons[ICON_VCLASS_COACH] = new FXXPMIcon(a, vclass_coach_xpm); - myIcons[ICON_VCLASS_DELIVERY] = new FXXPMIcon(a, vclass_delivery_xpm); - myIcons[ICON_VCLASS_TRUCK] = new FXXPMIcon(a, vclass_truck_xpm); - myIcons[ICON_VCLASS_TRAILER] = new FXXPMIcon(a, vclass_trailer_xpm); - myIcons[ICON_VCLASS_TRAM] = new FXXPMIcon(a, vclass_tram_xpm); - myIcons[ICON_VCLASS_RAIL_URBAN] = new FXXPMIcon(a, vclass_rail_urban_xpm); - myIcons[ICON_VCLASS_RAIL] = new FXXPMIcon(a, vclass_rail_xpm); - myIcons[ICON_VCLASS_RAIL_ELECTRIC] = new FXXPMIcon(a, vclass_rail_electric_xpm); - myIcons[ICON_VCLASS_MOTORCYCLE] = new FXXPMIcon(a, vclass_motorcycle_xpm); - myIcons[ICON_VCLASS_MOPED] = new FXXPMIcon(a, vclass_moped_xpm); - myIcons[ICON_VCLASS_BICYCLE] = new FXXPMIcon(a, vclass_bicycle_xpm); - myIcons[ICON_VCLASS_PEDESTRIAN] = new FXXPMIcon(a, vclass_pedestrian_xpm); - myIcons[ICON_VCLASS_EVEHICLE] = new FXXPMIcon(a, vclass_evehicle_xpm); - myIcons[ICON_VCLASS_SHIP] = new FXXPMIcon(a, vclass_ship_xpm); - myIcons[ICON_VCLASS_CUSTOM1] = new FXXPMIcon(a, vclass_custom1_xpm); - myIcons[ICON_VCLASS_CUSTOM2] = new FXXPMIcon(a, vclass_custom2_xpm); - - myIcons[ICON_VSHAPE_PEDESTRIAN] = new FXXPMIcon(a, vshape_pedestrian_xpm); - myIcons[ICON_VSHAPE_BICYCLE] = new FXXPMIcon(a, vshape_bicycle_xpm); - myIcons[ICON_VSHAPE_MOPED] = new FXXPMIcon(a, vshape_moped_xpm); - myIcons[ICON_VSHAPE_MOTORCYCLE] = new FXXPMIcon(a, vshape_motorcycle_xpm); - myIcons[ICON_VSHAPE_PASSENGER] = new FXXPMIcon(a, vshape_passenger_xpm); - myIcons[ICON_VSHAPE_PASSENGER_SEDAN] = new FXXPMIcon(a, vshape_passenger_sedan_xpm); - myIcons[ICON_VSHAPE_PASSENGER_HATCHBACK] = new FXXPMIcon(a, vshape_passenger_hatchback_xpm); - myIcons[ICON_VSHAPE_PASSENGER_WAGON] = new FXXPMIcon(a, vshape_passenger_wagon_xpm); - myIcons[ICON_VSHAPE_PASSENGER_VAN] = new FXXPMIcon(a, vshape_passenger_van_xpm); - myIcons[ICON_VSHAPE_DELIVERY] = new FXXPMIcon(a, vshape_delivery_xpm); - myIcons[ICON_VSHAPE_TRUCK] = new FXXPMIcon(a, vshape_truck_xpm); - myIcons[ICON_VSHAPE_TRUCK_SEMITRAILER] = new FXXPMIcon(a, vshape_truck_semitrailer_xpm); - myIcons[ICON_VSHAPE_TRUCK_1TRAILER] = new FXXPMIcon(a, vshape_truck_1trailer_xpm); - myIcons[ICON_VSHAPE_BUS] = new FXXPMIcon(a, vshape_bus_xpm); - myIcons[ICON_VSHAPE_BUS_COACH] = new FXXPMIcon(a, vshape_bus_coach_xpm); - myIcons[ICON_VSHAPE_BUS_FLEXIBLE] = new FXXPMIcon(a, vshape_bus_flexible_xpm); - myIcons[ICON_VSHAPE_BUS_TROLLEY] = new FXXPMIcon(a, vshape_bus_trolley_xpm); - myIcons[ICON_VSHAPE_RAIL] = new FXXPMIcon(a, vshape_rail_xpm); - myIcons[ICON_VSHAPE_RAIL_CAR] = new FXXPMIcon(a, vshape_rail_car_xpm); - myIcons[ICON_VSHAPE_RAIL_CARGO] = new FXXPMIcon(a, vshape_rail_cargo_xpm); - myIcons[ICON_VSHAPE_E_VEHICLE] = new FXXPMIcon(a, vshape_e_vehicle_xpm); - myIcons[ICON_VSHAPE_ANT] = new FXXPMIcon(a, vshape_ant_xpm); - myIcons[ICON_VSHAPE_SHIP] = new FXXPMIcon(a, vshape_ship_xpm); - myIcons[ICON_VSHAPE_EMERGENCY] = new FXXPMIcon(a, vshape_emergency_xpm); - myIcons[ICON_VSHAPE_FIREBRIGADE] = new FXXPMIcon(a, vshape_firebrigade_xpm); - myIcons[ICON_VSHAPE_POLICE] = new FXXPMIcon(a, vshape_police_xpm); - myIcons[ICON_VSHAPE_RICKSHAW] = new FXXPMIcon(a, vshape_rickshaw_xpm); - myIcons[ICON_VSHAPE_UNKNOWN] = new FXXPMIcon(a, vshape_unknown_xpm); - - myIcons[ICON_OK] = new FXXPMIcon(a, accept_xpm); // @todo create ok icon - myIcons[ICON_ACCEPT] = new FXXPMIcon(a, accept_xpm); - myIcons[ICON_CANCEL] = new FXXPMIcon(a, cancel_xpm); - myIcons[ICON_CORRECT] = new FXXPMIcon(a, correct_xpm); - myIcons[ICON_ERROR] = new FXXPMIcon(a, error_xpm); - myIcons[ICON_RESET] = new FXXPMIcon(a, reset_xpm); - myIcons[ICON_WARNING] = new FXXPMIcon(a, warning_xpm); - - myIcons[ICON_GRID1] = new FXXPMIcon(a, grid1_xpm); - myIcons[ICON_GRID2] = new FXXPMIcon(a, grid2_xpm); - myIcons[ICON_GRID3] = new FXXPMIcon(a, grid3_xpm); + myIcons[GUIIcon::MANIP] = new FXGIFIcon(a, manip); + myIcons[GUIIcon::CAMERA] = new FXXPMIcon(a, camera_xpm); + myIcons[GUIIcon::EXTRACT] = new FXXPMIcon(a, extract_streets_xpm); + myIcons[GUIIcon::DILATE] = new FXXPMIcon(a, dilate_xpm); + myIcons[GUIIcon::ERODE] = new FXXPMIcon(a, erode_xpm); + myIcons[GUIIcon::OPENING] = new FXXPMIcon(a, opening_xpm); + myIcons[GUIIcon::CLOSING] = new FXXPMIcon(a, closing_xpm); + myIcons[GUIIcon::ERASE_STAINS] = new FXXPMIcon(a, erase_stains_xpm); + myIcons[GUIIcon::CLOSE_GAPS] = new FXXPMIcon(a, close_gaps_xpm); + myIcons[GUIIcon::SKELETONIZE] = new FXXPMIcon(a, skeletonize_xpm); + myIcons[GUIIcon::RARIFY] = new FXXPMIcon(a, rarify_xpm); + myIcons[GUIIcon::CREATE_GRAPH] = new FXXPMIcon(a, create_graph_xpm); + myIcons[GUIIcon::OPEN_BMP_DIALOG] = new FXXPMIcon(a, open_bmp_dialog_xpm); + myIcons[GUIIcon::EYEDROP] = new FXXPMIcon(a, eyedrop_xpm); + myIcons[GUIIcon::PAINTBRUSH1X] = new FXXPMIcon(a, paintbrush1x_xpm); + myIcons[GUIIcon::PAINTBRUSH2X] = new FXXPMIcon(a, paintbrush2x_xpm); + myIcons[GUIIcon::PAINTBRUSH3X] = new FXXPMIcon(a, paintbrush3x_xpm); + myIcons[GUIIcon::PAINTBRUSH4X] = new FXXPMIcon(a, paintbrush4x_xpm); + myIcons[GUIIcon::PAINTBRUSH5X] = new FXXPMIcon(a, paintbrush5x_xpm); + myIcons[GUIIcon::RUBBER1X] = new FXXPMIcon(a, rubber1x_xpm); + myIcons[GUIIcon::RUBBER2X] = new FXXPMIcon(a, rubber2x_xpm); + myIcons[GUIIcon::RUBBER3X] = new FXXPMIcon(a, rubber3x_xpm); + myIcons[GUIIcon::RUBBER4X] = new FXXPMIcon(a, rubber4x_xpm); + myIcons[GUIIcon::RUBBER5X] = new FXXPMIcon(a, rubber5x_xpm); + myIcons[GUIIcon::EDITGRAPH] = new FXXPMIcon(a, edit_graph_xpm); + + myIcons[GUIIcon::UNDO] = new FXXPMIcon(a, undo_xpm); + myIcons[GUIIcon::REDO] = new FXXPMIcon(a, redo_xpm); + myIcons[GUIIcon::NETEDIT] = new FXXPMIcon(a, netedit_icon64_xpm); + myIcons[GUIIcon::NETEDIT_MINI] = new FXXPMIcon(a, netedit_icon16_xpm); + myIcons[GUIIcon::LOCK] = new FXXPMIcon(a, lock_xpm); + myIcons[GUIIcon::ADD] = new FXXPMIcon(a, add_xpm); + myIcons[GUIIcon::REMOVE] = new FXXPMIcon(a, remove_xpm); + myIcons[GUIIcon::BIGARROWLEFT] = new FXXPMIcon(a, bigarrowleft_xmp); + myIcons[GUIIcon::BIGARROWRIGHT] = new FXXPMIcon(a, bigarrowright_xmp); + + myIcons[GUIIcon::ARROW_UP] = new FXXPMIcon(a, arrowup_xpm); + myIcons[GUIIcon::ARROW_DOWN] = new FXXPMIcon(a, arrowdown_xpm); + myIcons[GUIIcon::ARROW_LEFT] = new FXXPMIcon(a, arrowleft_xpm); + myIcons[GUIIcon::ARROW_RIGHT] = new FXXPMIcon(a, arrowright_xpm); + + myIcons[GUIIcon::LANEPEDESTRIAN] = new FXXPMIcon(a, lanepedestrian); + myIcons[GUIIcon::LANEBUS] = new FXXPMIcon(a, lanebus); + myIcons[GUIIcon::LANEBIKE] = new FXXPMIcon(a, lanebike); + myIcons[GUIIcon::LANEGREENVERGE] = new FXXPMIcon(a, lanegreenverge); + + myIcons[GUIIcon::EXT] = new FXXPMIcon(a, ext_xpm); + myIcons[GUIIcon::CUT_SWELL] = new FXXPMIcon(a, cut_xpm); + myIcons[GUIIcon::TRACKER] = new FXXPMIcon(a, tracker_xpm); + + myIcons[GUIIcon::SAVENETWORKELEMENTS] = new FXXPMIcon(a, savenetworkelements_xpm); + myIcons[GUIIcon::SAVEADDITIONALELEMENTS] = new FXXPMIcon(a, saveadditionalelements_xpm); + myIcons[GUIIcon::SAVEDEMANDELEMENTS] = new FXXPMIcon(a, savedemandelements_xpm); + myIcons[GUIIcon::SAVEDATAELEMENTS] = new FXXPMIcon(a, savedataelements_xpm); + + myIcons[GUIIcon::SUPERMODENETWORK] = new FXXPMIcon(a, supermodenetwork_xpm); + myIcons[GUIIcon::SUPERMODEDEMAND] = new FXXPMIcon(a, supermodedemand_xpm); + myIcons[GUIIcon::SUPERMODEDATA] = new FXXPMIcon(a, supermodedata_xpm); + + myIcons[GUIIcon::MODEADDITIONAL] = new FXXPMIcon(a, modeadditional_xpm); + myIcons[GUIIcon::MODECONNECTION] = new FXXPMIcon(a, modeconnection_xpm); + myIcons[GUIIcon::MODECREATEEDGE] = new FXXPMIcon(a, modecreateedge_xpm); + myIcons[GUIIcon::MODECROSSING] = new FXXPMIcon(a, modecrossing_xpm); + myIcons[GUIIcon::MODETAZ] = new FXXPMIcon(a, modetaz_xpm); + myIcons[GUIIcon::MODEDELETE] = new FXXPMIcon(a, modedelete_xpm); + myIcons[GUIIcon::MODEINSPECT] = new FXXPMIcon(a, modeinspect_xpm); + myIcons[GUIIcon::MODEMOVE] = new FXXPMIcon(a, modemove_xpm); + myIcons[GUIIcon::MODESELECT] = new FXXPMIcon(a, modeselect_xpm); + myIcons[GUIIcon::MODETLS] = new FXXPMIcon(a, modetrafficlight_xpm); + myIcons[GUIIcon::MODEPOLYGON] = new FXXPMIcon(a, modepolygon_xpm); + myIcons[GUIIcon::MODEPROHIBITION] = new FXXPMIcon(a, modeprohibition_xpm); + + 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::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::MODEEDGEDATA] = new FXXPMIcon(a, modeedgedata_xpm); + myIcons[GUIIcon::MODEEDGERELDATA] = new FXXPMIcon(a, modeedgereldata_xpm); + + myIcons[GUIIcon::COMPUTEJUNCTIONS] = new FXXPMIcon(a, computejunctions_xpm); + myIcons[GUIIcon::CLEANJUNCTIONS] = new FXXPMIcon(a, cleanjunctions_xpm); + myIcons[GUIIcon::JOINJUNCTIONS] = new FXXPMIcon(a, joinjunctions_xpm); + myIcons[GUIIcon::COMPUTEDEMAND] = new FXXPMIcon(a, computedemand_xpm); + myIcons[GUIIcon::CLEANROUTES] = new FXXPMIcon(a, cleanroutes_xpm); + myIcons[GUIIcon::JOINROUTES] = new FXXPMIcon(a, joinroutes_xpm); + + myIcons[GUIIcon::OPTIONS] = new FXXPMIcon(a, options_xpm); + + myIcons[GUIIcon::JUNCTION] = new FXXPMIcon(a, junction_xpm); + myIcons[GUIIcon::EDGE] = new FXXPMIcon(a, edge_xpm); + myIcons[GUIIcon::LANE] = new FXXPMIcon(a, lane_xpm); + myIcons[GUIIcon::CONNECTION] = new FXXPMIcon(a, connection_xpm); + myIcons[GUIIcon::PROHIBITION] = new FXXPMIcon(a, prohibition_xpm); + myIcons[GUIIcon::CROSSING] = new FXXPMIcon(a, crossing_xpm); + + myIcons[GUIIcon::BUSSTOP] = new FXXPMIcon(a, busstop_xpm); + myIcons[GUIIcon::ACCESS] = new FXXPMIcon(a, access_xpm); + myIcons[GUIIcon::CONTAINERSTOP] = new FXXPMIcon(a, containerstop_xpm); + myIcons[GUIIcon::CHARGINGSTATION] = new FXXPMIcon(a, chargingstation_xpm); + myIcons[GUIIcon::PARKINGAREA] = new FXXPMIcon(a, parkingarea_xpm); + myIcons[GUIIcon::PARKINGSPACE] = new FXXPMIcon(a, parkingspace_xpm); + myIcons[GUIIcon::E1] = new FXXPMIcon(a, e1_xpm); + myIcons[GUIIcon::E2] = new FXXPMIcon(a, e2_xpm); + myIcons[GUIIcon::E3] = new FXXPMIcon(a, e3_xpm); + myIcons[GUIIcon::E3ENTRY] = new FXXPMIcon(a, e3entry_xpm); + myIcons[GUIIcon::E3EXIT] = new FXXPMIcon(a, e3exit_xpm); + myIcons[GUIIcon::E1INSTANT] = new FXXPMIcon(a, e1instant_xpm); + myIcons[GUIIcon::REROUTER] = new FXXPMIcon(a, rerouter_xpm); + myIcons[GUIIcon::ROUTEPROBE] = new FXXPMIcon(a, routeprobe_xpm); + myIcons[GUIIcon::VAPORIZER] = new FXXPMIcon(a, vaporizer_xpm); + myIcons[GUIIcon::VARIABLESPEEDSIGN] = new FXXPMIcon(a, variablespeedsign_xpm); + myIcons[GUIIcon::CALIBRATOR] = new FXXPMIcon(a, calibrator_xpm); + myIcons[GUIIcon::REROUTERINTERVAL] = new FXXPMIcon(a, rerouterinterval_xpm); + myIcons[GUIIcon::VSSSTEP] = new FXXPMIcon(a, vssstep_xpm); + myIcons[GUIIcon::CLOSINGREROUTE] = new FXXPMIcon(a, closingreroute_xpm); + myIcons[GUIIcon::CLOSINGLANEREROUTE] = new FXXPMIcon(a, closinglanereroute_xpm); + myIcons[GUIIcon::DESTPROBREROUTE] = new FXXPMIcon(a, destprobreroute_xpm); + myIcons[GUIIcon::PARKINGZONEREROUTE] = new FXXPMIcon(a, parkingzonereroute_xpm); + myIcons[GUIIcon::ROUTEPROBREROUTE] = new FXXPMIcon(a, routeprobreroute_xpm); + myIcons[GUIIcon::TAZ] = new FXXPMIcon(a, taz_xpm); + myIcons[GUIIcon::TAZEDGE] = new FXXPMIcon(a, tazedge_xpm); + + 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::VEHICLE] = new FXXPMIcon(a, vehicle_xpm); + myIcons[GUIIcon::TRIP] = new FXXPMIcon(a, trip_xpm); + myIcons[GUIIcon::FLOW] = new FXXPMIcon(a, flow_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::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::RIDE_FROMTO] = new FXXPMIcon(a, ridefromto_xpm); + myIcons[GUIIcon::RIDE_BUSSTOP] = new FXXPMIcon(a, ridebusstop_xpm); + myIcons[GUIIcon::PERSON_BUSSTOP] = new FXXPMIcon(a, personbusstop_xpm); + myIcons[GUIIcon::PERSON_CONTAINERSTOP] = new FXXPMIcon(a, personcontainerstop_xpm); + myIcons[GUIIcon::PERSON_LANESTOP] = new FXXPMIcon(a, personlanestop_xpm); + + myIcons[GUIIcon::DATASET] = new FXXPMIcon(a, dataset_xpm); + myIcons[GUIIcon::DATAINTERVAL] = new FXXPMIcon(a, datainterval_xpm); + myIcons[GUIIcon::EDGEDATA] = new FXXPMIcon(a, edgedata_xpm); + myIcons[GUIIcon::EDGERELDATA] = new FXXPMIcon(a, edgereldata_xpm); + + myIcons[GUIIcon::VCLASS_IGNORING] = new FXXPMIcon(a, vclass_ignoring_xpm); + myIcons[GUIIcon::VCLASS_PRIVATE] = new FXXPMIcon(a, vclass_private_xpm); + myIcons[GUIIcon::VCLASS_EMERGENCY] = new FXXPMIcon(a, vclass_emergency_xpm); + myIcons[GUIIcon::VCLASS_AUTHORITY] = new FXXPMIcon(a, vclass_authority_xpm); + myIcons[GUIIcon::VCLASS_ARMY] = new FXXPMIcon(a, vclass_army_xpm); + myIcons[GUIIcon::VCLASS_VIP] = new FXXPMIcon(a, vclass_vip_xpm); + myIcons[GUIIcon::VCLASS_PASSENGER] = new FXXPMIcon(a, vclass_passenger_xpm); + myIcons[GUIIcon::VCLASS_HOV] = new FXXPMIcon(a, vclass_hov_xpm); + myIcons[GUIIcon::VCLASS_TAXI] = new FXXPMIcon(a, vclass_taxi_xpm); + myIcons[GUIIcon::VCLASS_BUS] = new FXXPMIcon(a, vclass_bus_xpm); + myIcons[GUIIcon::VCLASS_COACH] = new FXXPMIcon(a, vclass_coach_xpm); + myIcons[GUIIcon::VCLASS_DELIVERY] = new FXXPMIcon(a, vclass_delivery_xpm); + myIcons[GUIIcon::VCLASS_TRUCK] = new FXXPMIcon(a, vclass_truck_xpm); + myIcons[GUIIcon::VCLASS_TRAILER] = new FXXPMIcon(a, vclass_trailer_xpm); + myIcons[GUIIcon::VCLASS_TRAM] = new FXXPMIcon(a, vclass_tram_xpm); + myIcons[GUIIcon::VCLASS_RAIL_URBAN] = new FXXPMIcon(a, vclass_rail_urban_xpm); + myIcons[GUIIcon::VCLASS_RAIL] = new FXXPMIcon(a, vclass_rail_xpm); + myIcons[GUIIcon::VCLASS_RAIL_ELECTRIC] = new FXXPMIcon(a, vclass_rail_electric_xpm); + myIcons[GUIIcon::VCLASS_MOTORCYCLE] = new FXXPMIcon(a, vclass_motorcycle_xpm); + myIcons[GUIIcon::VCLASS_MOPED] = new FXXPMIcon(a, vclass_moped_xpm); + myIcons[GUIIcon::VCLASS_BICYCLE] = new FXXPMIcon(a, vclass_bicycle_xpm); + myIcons[GUIIcon::VCLASS_PEDESTRIAN] = new FXXPMIcon(a, vclass_pedestrian_xpm); + myIcons[GUIIcon::VCLASS_EVEHICLE] = new FXXPMIcon(a, vclass_evehicle_xpm); + myIcons[GUIIcon::VCLASS_SHIP] = new FXXPMIcon(a, vclass_ship_xpm); + myIcons[GUIIcon::VCLASS_CUSTOM1] = new FXXPMIcon(a, vclass_custom1_xpm); + myIcons[GUIIcon::VCLASS_CUSTOM2] = new FXXPMIcon(a, vclass_custom2_xpm); + + myIcons[GUIIcon::VSHAPE_PEDESTRIAN] = new FXXPMIcon(a, vshape_pedestrian_xpm); + myIcons[GUIIcon::VSHAPE_BICYCLE] = new FXXPMIcon(a, vshape_bicycle_xpm); + myIcons[GUIIcon::VSHAPE_MOPED] = new FXXPMIcon(a, vshape_moped_xpm); + myIcons[GUIIcon::VSHAPE_MOTORCYCLE] = new FXXPMIcon(a, vshape_motorcycle_xpm); + myIcons[GUIIcon::VSHAPE_PASSENGER] = new FXXPMIcon(a, vshape_passenger_xpm); + myIcons[GUIIcon::VSHAPE_PASSENGER_SEDAN] = new FXXPMIcon(a, vshape_passenger_sedan_xpm); + myIcons[GUIIcon::VSHAPE_PASSENGER_HATCHBACK] = new FXXPMIcon(a, vshape_passenger_hatchback_xpm); + myIcons[GUIIcon::VSHAPE_PASSENGER_WAGON] = new FXXPMIcon(a, vshape_passenger_wagon_xpm); + myIcons[GUIIcon::VSHAPE_PASSENGER_VAN] = new FXXPMIcon(a, vshape_passenger_van_xpm); + myIcons[GUIIcon::VSHAPE_DELIVERY] = new FXXPMIcon(a, vshape_delivery_xpm); + myIcons[GUIIcon::VSHAPE_TRUCK] = new FXXPMIcon(a, vshape_truck_xpm); + myIcons[GUIIcon::VSHAPE_TRUCK_SEMITRAILER] = new FXXPMIcon(a, vshape_truck_semitrailer_xpm); + myIcons[GUIIcon::VSHAPE_TRUCK_1TRAILER] = new FXXPMIcon(a, vshape_truck_1trailer_xpm); + myIcons[GUIIcon::VSHAPE_BUS] = new FXXPMIcon(a, vshape_bus_xpm); + myIcons[GUIIcon::VSHAPE_BUS_COACH] = new FXXPMIcon(a, vshape_bus_coach_xpm); + myIcons[GUIIcon::VSHAPE_BUS_FLEXIBLE] = new FXXPMIcon(a, vshape_bus_flexible_xpm); + myIcons[GUIIcon::VSHAPE_BUS_TROLLEY] = new FXXPMIcon(a, vshape_bus_trolley_xpm); + myIcons[GUIIcon::VSHAPE_RAIL] = new FXXPMIcon(a, vshape_rail_xpm); + myIcons[GUIIcon::VSHAPE_RAIL_CAR] = new FXXPMIcon(a, vshape_rail_car_xpm); + myIcons[GUIIcon::VSHAPE_RAIL_CARGO] = new FXXPMIcon(a, vshape_rail_cargo_xpm); + myIcons[GUIIcon::VSHAPE_E_VEHICLE] = new FXXPMIcon(a, vshape_e_vehicle_xpm); + myIcons[GUIIcon::VSHAPE_ANT] = new FXXPMIcon(a, vshape_ant_xpm); + myIcons[GUIIcon::VSHAPE_SHIP] = new FXXPMIcon(a, vshape_ship_xpm); + myIcons[GUIIcon::VSHAPE_EMERGENCY] = new FXXPMIcon(a, vshape_emergency_xpm); + 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_UNKNOWN] = new FXXPMIcon(a, vshape_unknown_xpm); + + myIcons[GUIIcon::OK] = new FXXPMIcon(a, accept_xpm); + myIcons[GUIIcon::ACCEPT] = new FXXPMIcon(a, accept_xpm); + myIcons[GUIIcon::CANCEL] = new FXXPMIcon(a, cancel_xpm); + myIcons[GUIIcon::CORRECT] = new FXXPMIcon(a, correct_xpm); + myIcons[GUIIcon::INCORRECT] = new FXXPMIcon(a, incorrect_xpm); + myIcons[GUIIcon::RESET] = new FXXPMIcon(a, reset_xpm); + myIcons[GUIIcon::WARNING] = new FXXPMIcon(a, warning_xpm); + + myIcons[GUIIcon::GRID1] = new FXXPMIcon(a, grid1_xpm); + myIcons[GUIIcon::GRID2] = new FXXPMIcon(a, grid2_xpm); + myIcons[GUIIcon::GRID3] = new FXXPMIcon(a, grid3_xpm); // ... and create them - for (int i = 0; i < ICON_MAX; i++) { - if (myIcons[i] != nullptr) { - myIcons[i]->create(); - } + for (const auto& icon : myIcons) { + icon.second->create(); } } GUIIconSubSys::~GUIIconSubSys() { - for (int i = 0; i < ICON_MAX; i++) { - delete myIcons[i]; + // remove all icons + for (const auto& icon : myIcons) { + delete icon.second; } } void GUIIconSubSys::initIcons(FXApp* a) { - assert(myInstance == 0); - myInstance = new GUIIconSubSys(a); + if (myInstance) { + throw ProcessError("Instance was previously created"); + } else { + myInstance = new GUIIconSubSys(a); + } } FXIcon* -GUIIconSubSys::getIcon(GUIIcon which) { - return myInstance->myIcons[which]; +GUIIconSubSys::getIcon(const GUIIcon which) { + return myInstance->myIcons.at(which); } void GUIIconSubSys::close() { + // delete instance and set null delete myInstance; myInstance = nullptr; } /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIconSubSys.h sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIconSubSys.h --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUIIconSubSys.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUIIconSubSys.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,16 +17,12 @@ /// // A class to manage icons of SUMO /****************************************************************************/ -#ifndef GUIIconSubSys_h -#define GUIIconSubSys_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include +#include + #include "GUIIcons.h" @@ -43,7 +39,7 @@ /**@brief returns a icon previously defined in the enum GUIIcon * @param[in] which GUIIcon enum */ - static FXIcon* getIcon(GUIIcon which); + static FXIcon* getIcon(const GUIIcon which); /// @brief close GUIIconSubSys static void close(); @@ -59,11 +55,5 @@ static GUIIconSubSys* myInstance; /// @brief vector with the icons - FXIcon* myIcons[ICON_MAX]; + std::map myIcons; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextures.h sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextures.h --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextures.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextures.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An enumeration of gifs used by the gui applications /****************************************************************************/ -#ifndef GUITextures_h -#define GUITextures_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -57,9 +51,3 @@ GNETEXTURE_LANEPEDESTRIAN, GIF_MAX }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUITexturesHelper.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GUITexturesHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUITexturesHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUITexturesHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Global storage for textures; manages and draws them /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -141,4 +136,5 @@ myTextures.clear(); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUITexturesHelper.h sumo-1.6.0+dfsg1/src/utils/gui/images/GUITexturesHelper.h --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUITexturesHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUITexturesHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Global storage for textures; manages and draws them /****************************************************************************/ -#ifndef GUITexturesHelper_h -#define GUITexturesHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -78,8 +72,3 @@ /// @brief whether textures are drawn static bool myAllowTextures; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextureSubSys.cpp sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextureSubSys.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextureSubSys.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextureSubSys.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Helper for Gifs loading and usage /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -193,4 +188,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextureSubSys.h sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextureSubSys.h --- sumo-1.5.0+dfsg1/src/utils/gui/images/GUITextureSubSys.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/GUITextureSubSys.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A class to manage gifs of SUMO /****************************************************************************/ -#ifndef GUITextureSubSys_h -#define GUITextureSubSys_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,9 +64,3 @@ /// @brief vector with the Gifs std::map myTextures; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/incorrect.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/incorrect.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/incorrect.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/incorrect.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,32 @@ +/* XPM */ +static const char *incorrect_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 10 1 ", +" c #E2564B", +". c #E1574C", +"X c #E2574C", +"o c #E3574C", +"O c #E2564D", +"+ c #E2574D", +"@ c #E3574D", +"# c #E2584B", +"$ c #E1584C", +"% c None", +/* pixels */ +"%%%%%#o@@.#%%%%%", +"%%%%o..o@@..%%%%", +"%%..#%%%%%%#o.%%", +"%%.%%%%%%%%%%.%%", +"%.@%%%%%%%%%%#.%", +"#o%%%%o%%.%%%%o%", +"o.%%%.o..o.%%%@o", +".o%%%%.oo.%%%%@@", +"@@%%%%o..o%%%%@@", +"o.%%%o.o@.o%%%@o", +"..%%%%.%%.%%%%.%", +"%o#%%%%%%%%%%#.%", +"%%.%%%%%%%%%%o%%", +"%%.o@%%%%%%#..%%", +"%%%%..@@@@@.%%%%", +"%%%%%..@@.#%%%%%" +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/modeedgedata.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/modeedgedata.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/modeedgedata.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/modeedgedata.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,29 @@ +/* XPM */ +static const char *modeedgedata_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 7 1 ", +" c black", +". c #7F0000", +"X c #007F0E", +"o c red", +"O c #FFD800", +"+ c #0026FF", +"@ c white", +/* pixels */ +" ", +" ", +" ", +" @@ @@ @@ @@ ", +" ", +" ", +" ", +"................", +".......@@@@@@@@.", +" @@++@@@@ ", +" oo++@@@@ ", +" oo++XX@@ ", +" @@ @@oo++XXOO ", +" oo++XXOO ", +" oo++XXOO ", +" " +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/modeedgereldata.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/modeedgereldata.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/modeedgereldata.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/modeedgereldata.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,38 @@ +/* XPM */ +static const char *modeedgereldata_xpm[] = { +/* columns rows colors chars-per-pixel */ +"16 16 16 1 ", +" c black", +". c #007F0E", +"X c #0026FF", +"o c red", +"O c #FFD800", +"+ c white", +"@ c black", +"# c black", +"$ c black", +"% c black", +"& c black", +"* c black", +"= c black", +"- c black", +"; c black", +": c black", +/* pixels */ +" . ", +" ... ", +" ..... ", +" . o ", +"........... oo ", +"oooooooooooooooo", +"XXXXXO oo ", +" XO o ", +" X XO ++++++++ ", +" XX XO ++XX++++ ", +"XXXXXO ooXX++++ ", +" XX O ooXX..++ ", +" X O ooXX..OO ", +" OOOOooXX..OO ", +" OOOooXX..OO ", +" O " +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/savedataelements.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/savedataelements.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/savedataelements.xpm 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/savedataelements.xpm 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,30 @@ +/* XPM */ +static const char *savedataelements_xpm[] = { +/* columns rows colors chars-per-pixel */ +"14 14 10 1 ", +" c black", +". c #040404", +"X c #007F0E", +"o c red", +"O c #808304", +"+ c #FFD800", +"@ c #0026FF", +"# c #BFC2BF", +"$ c white", +"% c None", +/* pixels */ +"..............", +".OOOOOOOOOOOO.", +".O O.", +".O $$@@$$$$ O.", +".O oo@@$$$$ O.", +".O oo@@XX$$ O.", +".O oo@@XX++ O.", +".O O.", +".OOOOOOOOOOOO.", +".OO.........O.", +".OO......##.O.", +".OO......##.O.", +".OO......##.O.", +"%............." +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/images/savenetelements.xpm sumo-1.6.0+dfsg1/src/utils/gui/images/savenetelements.xpm --- sumo-1.5.0+dfsg1/src/utils/gui/images/savenetelements.xpm 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/images/savenetelements.xpm 1970-01-01 00:00:00.000000000 +0000 @@ -1,276 +0,0 @@ -/* XPM */ -static const char *savenetelements_xpm[] = { -/* columns rows colors chars-per-pixel */ -"14 14 256 2 ", -" c black", -". c #040404", -"X c red", -"o c #808304", -"O c #BFC2BF", -"+ c white", -"@ 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", -" 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", +" #include "GUICompleteSchemeStorage.h" @@ -246,4 +241,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUICompleteSchemeStorage.h sumo-1.6.0+dfsg1/src/utils/gui/settings/GUICompleteSchemeStorage.h --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUICompleteSchemeStorage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUICompleteSchemeStorage.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Storage for available visualization settings /****************************************************************************/ -#ifndef GUICompleteSchemeStorage_h -#define GUICompleteSchemeStorage_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -148,9 +142,3 @@ }; extern GUICompleteSchemeStorage gSchemeStorage; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIPropertyScheme.h sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIPropertyScheme.h --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIPropertyScheme.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIPropertyScheme.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // /****************************************************************************/ -#ifndef GUIPropertyScheme_h -#define GUIPropertyScheme_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -52,7 +46,7 @@ GUIPropertyScheme(const std::string& name, const T& baseColor, const std::string& colName = "", const bool isFixed = false, double baseValue = 0, RGBColor bgColor = RGBColor::INVISIBLE, - GUIIcon icon = ICON_EMPTY) : + GUIIcon icon = GUIIcon::EMPTY) : myName(name), myIsInterpolated(!isFixed), myIsFixed(isFixed), myAllowNegativeValues(false), @@ -246,7 +240,3 @@ typedef GUIPropertyScheme GUIColorScheme; typedef GUIPropertyScheme GUIScaleScheme; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIPropertySchemeStorage.h sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIPropertySchemeStorage.h --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIPropertySchemeStorage.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIPropertySchemeStorage.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // /****************************************************************************/ -#ifndef GUIPropertySchemeStorage_h -#define GUIPropertySchemeStorage_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,7 +58,7 @@ void fill(MFXIconComboBox& cb) { for (const auto& scheme : mySchemes) { cb.appendIconItem(scheme.getName().c_str(), - scheme.getIcon() == ICON_EMPTY ? nullptr : GUIIconSubSys::getIcon(scheme.getIcon()), + scheme.getIcon() == GUIIcon::EMPTY ? nullptr : GUIIconSubSys::getIcon(scheme.getIcon()), MFXUtils::getFXColor(scheme.getBackgroundColor())); } cb.setCurrentItem((FXint)myActiveScheme); @@ -138,7 +132,3 @@ typedef GUIPropertySchemeStorage GUIColorer; typedef GUIPropertySchemeStorage GUIScaler; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.cpp sumo-1.6.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The dialog to change the view (gui) settings. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -251,6 +246,7 @@ mySettings.junctionColorer.setActive(StringUtils::toInt(attrs.getStringSecure("junctionMode", "0"))); mySettings.drawLinkTLIndex = parseTextSettings("drawLinkTLIndex", attrs, mySettings.drawLinkTLIndex); mySettings.drawLinkJunctionIndex = parseTextSettings("drawLinkJunctionIndex", attrs, mySettings.drawLinkJunctionIndex); + mySettings.junctionID = parseTextSettings("junctionID", attrs, mySettings.junctionID); mySettings.junctionName = parseTextSettings("junctionName", attrs, mySettings.junctionName); mySettings.internalJunctionName = parseTextSettings("internalJunctionName", attrs, mySettings.internalJunctionName); mySettings.tlsPhaseIndex = parseTextSettings("tlsPhaseIndex", attrs, mySettings.tlsPhaseIndex); @@ -461,4 +457,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.h sumo-1.6.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.h --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUISettingsHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The handler for parsing gui settings from xml. /****************************************************************************/ -#ifndef GUISettingsHandler_h -#define GUISettingsHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -187,7 +181,3 @@ GUIVisualizationSizeSettings defaults); }; - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.cpp sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Stores the information about how to visualize structures /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -185,6 +180,8 @@ const std::string GUIVisualizationSettings::SCHEME_NAME_TYPE("by type"); const std::string GUIVisualizationSettings::SCHEME_NAME_PERMISSION_CODE("by permission code"); +const double GUIVisualizationSettings::MISSING_DATA(std::numeric_limits::max()); + // color constants for scheme background #define COL_SCHEME_EMISSION RGBColor(255,255,210) #define COL_SCHEME_MISC RGBColor(210,220,255) @@ -309,7 +306,8 @@ selectedRouteColor(0, 0, 150, 255), selectedVehicleColor(0, 0, 100, 255), selectedPersonColor(0, 0, 120, 255), - selectedPersonPlanColor(0, 0, 130, 255) { + selectedPersonPlanColor(0, 0, 130, 255), + selectedEdgeDataColor(0, 0, 150, 255) { } @@ -325,7 +323,8 @@ (selectedRouteColor == v2.selectedRouteColor) && (selectedVehicleColor == v2.selectedVehicleColor) && (selectedPersonColor == v2.selectedPersonColor) && - (selectedPersonPlanColor == v2.selectedPersonPlanColor); + (selectedPersonPlanColor == v2.selectedPersonPlanColor) && + (selectedEdgeDataColor == v2.selectedEdgeDataColor); } @@ -341,7 +340,8 @@ (selectedRouteColor != v2.selectedRouteColor) || (selectedVehicleColor != v2.selectedVehicleColor) || (selectedPersonColor != v2.selectedPersonColor) || - (selectedPersonPlanColor != v2.selectedPersonPlanColor); + (selectedPersonPlanColor != v2.selectedPersonPlanColor) || + (selectedEdgeDataColor != v2.selectedEdgeDataColor); } // --------------------------------------------------------------------------- @@ -393,7 +393,8 @@ containerName(false, 60, RGBColor(0, 153, 204, 255)), drawLinkTLIndex(false, 65, RGBColor(128, 128, 255, 255), RGBColor::INVISIBLE, false), drawLinkJunctionIndex(false, 65, RGBColor(128, 128, 255, 255), RGBColor::INVISIBLE, false), - junctionName(false, 60, RGBColor(0, 255, 128, 255)), + junctionID(false, 60, RGBColor(0, 255, 128, 255)), + junctionName(false, 60, RGBColor(192, 255, 128, 255)), internalJunctionName(false, 50, RGBColor(0, 204, 128, 255)), tlsPhaseIndex(false, 150, RGBColor::YELLOW), tlsPhaseName(false, 150, RGBColor::ORANGE), @@ -438,10 +439,11 @@ scheme.addColor(RGBColor(0, 0, 0, 0), 3, "green verge"); scheme.addColor(RGBColor(150, 200, 200), 4, "waterway"); scheme.addColor(RGBColor::BLACK, 5, "railway"); - scheme.addColor(RGBColor(92, 92, 92), 6, "no passenger"); // paths, service roads etc - scheme.addColor(RGBColor::RED, 7, "closed"); // road closing - scheme.addColor(RGBColor::GREEN, 8, "connector"); // macro-connector - scheme.addColor(RGBColor::ORANGE, 9, "forbidden"); // forbidden road + scheme.addColor(RGBColor(64, 0, 64), 6, "rails on road"); + scheme.addColor(RGBColor(92, 92, 92), 7, "no passenger"); // paths, service roads etc + scheme.addColor(RGBColor::RED, 8, "closed"); // road closing + scheme.addColor(RGBColor::GREEN, 9, "connector"); // macro-connector + scheme.addColor(RGBColor::ORANGE, 10, "forbidden"); // forbidden road 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"); @@ -489,26 +491,61 @@ scheme.addColor(RGBColor::BLUE, (double)5); laneColorer.addScheme(scheme); // ... emissions ... - scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(10. / 7.5 / 5.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by CO emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(0.05 / 7.5 / 2.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by PMx emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(.005 / 7.5 / 5.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by NOx emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(.125 / 7.5 / 5.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by HC emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(.02 / 7.5 / 4.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by fuel consumption", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(.005 / 7.5 * 100.)); - laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by noise emissions (Harmonoise)", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)100); + scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 450); + scheme.addColor(RGBColor::GREEN, 900); + scheme.addColor(RGBColor::YELLOW, 1350); + scheme.addColor(RGBColor::ORANGE, 1800); + scheme.addColor(RGBColor::RED, 2250); + scheme.addColor(RGBColor::MAGENTA, 3000); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by CO emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 30); + scheme.addColor(RGBColor::GREEN, 60); + scheme.addColor(RGBColor::YELLOW, 90); + scheme.addColor(RGBColor::ORANGE, 120); + scheme.addColor(RGBColor::RED, 150); + scheme.addColor(RGBColor::MAGENTA, 200); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by PMx emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 0.3); + scheme.addColor(RGBColor::GREEN, 0.5); + scheme.addColor(RGBColor::YELLOW, 0.8); + scheme.addColor(RGBColor::ORANGE, 1); + scheme.addColor(RGBColor::RED, 1.3); + scheme.addColor(RGBColor::MAGENTA, 1.6); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by NOx emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 6); + scheme.addColor(RGBColor::GREEN, 12); + scheme.addColor(RGBColor::YELLOW, 18); + scheme.addColor(RGBColor::ORANGE, 24); + scheme.addColor(RGBColor::RED, 30); + scheme.addColor(RGBColor::MAGENTA, 40); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by HC emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 8); + scheme.addColor(RGBColor::GREEN, 16); + scheme.addColor(RGBColor::YELLOW, 24); + scheme.addColor(RGBColor::ORANGE, 32); + scheme.addColor(RGBColor::RED, 40); + scheme.addColor(RGBColor::MAGENTA, 50); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by fuel consumption", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 0.2); + scheme.addColor(RGBColor::GREEN, 0.4); + scheme.addColor(RGBColor::YELLOW, 0.6); + scheme.addColor(RGBColor::ORANGE, 0.8); + scheme.addColor(RGBColor::RED, 1); + scheme.addColor(RGBColor::MAGENTA, 1.3); + laneColorer.addScheme(scheme); + scheme = GUIColorScheme("by noise emissions (Harmonoise)", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 1.3); + scheme.addColor(RGBColor::GREEN, 1.4); + scheme.addColor(RGBColor::YELLOW, 1.6); + scheme.addColor(RGBColor::ORANGE, 1.7); + scheme.addColor(RGBColor::RED, 1.9); + scheme.addColor(RGBColor::MAGENTA, 2.4); laneColorer.addScheme(scheme); // ... weights (experimental) ... scheme = GUIColorScheme("by global travel time", RGBColor::GREEN); @@ -520,12 +557,13 @@ scheme.addColor(RGBColor::GREEN, (double)100); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by given length/geometrical length", RGBColor::BLACK); - scheme.addColor(RGBColor::RED, 0.25); + 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::BLUE, (double)4.0); + scheme.addColor(RGBColor::CYAN, (double)4.0); + scheme.addColor(RGBColor::BLUE, (double)100.0); laneColorer.addScheme(scheme); laneColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme("by loaded weight", RGBColor::GREEN); @@ -589,7 +627,12 @@ scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by electricity consumption", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)(1 / 7.5 / 5.)); + scheme.addColor(RGBColor::CYAN, 0.2); + scheme.addColor(RGBColor::GREEN, 0.4); + scheme.addColor(RGBColor::YELLOW, 0.6); + scheme.addColor(RGBColor::ORANGE, 0.8); + scheme.addColor(RGBColor::RED, 1.0); + 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); @@ -604,7 +647,7 @@ scheme = GUIColorScheme(SCHEME_NAME_LANE_PARAM_NUMERICAL, RGBColor(204, 204, 204)); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); - scheme = GUIColorScheme(SCHEME_NAME_EDGEDATA_NUMERICAL, RGBColor(204, 204, 204)); + scheme = GUIColorScheme(SCHEME_NAME_EDGEDATA_NUMERICAL, RGBColor(204, 204, 204), "missing data", false, MISSING_DATA); scheme.setAllowsNegativeValues(true); laneColorer.addScheme(scheme); scheme = GUIColorScheme("by distance (kilometrage)", RGBColor(204, 204, 204)); @@ -675,30 +718,65 @@ scheme.addColor(RGBColor::MAGENTA, (double)(150 / 3.6)); vehicleColorer.addScheme(scheme); // ... emissions ... - scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)5.); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by CO emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, 0.05); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by PMx emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double).005); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by NOx emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double).125); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by HC emissions", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double).02); + scheme = GUIColorScheme("by CO2 emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 23000); + scheme.addColor(RGBColor::GREEN, 46000); + scheme.addColor(RGBColor::YELLOW, 69000); + scheme.addColor(RGBColor::ORANGE, 92000); + scheme.addColor(RGBColor::RED, 115000); + scheme.addColor(RGBColor::MAGENTA, 150000); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by CO emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 1500); + scheme.addColor(RGBColor::GREEN, 3000); + scheme.addColor(RGBColor::YELLOW, 4500); + scheme.addColor(RGBColor::ORANGE, 6000); + scheme.addColor(RGBColor::RED, 7500); + scheme.addColor(RGBColor::MAGENTA, 10000); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by PMx emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 12); + scheme.addColor(RGBColor::GREEN, 24); + scheme.addColor(RGBColor::YELLOW, 36); + scheme.addColor(RGBColor::ORANGE, 48); + scheme.addColor(RGBColor::RED, 60); + scheme.addColor(RGBColor::MAGENTA, 80); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by NOx emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 300); + scheme.addColor(RGBColor::GREEN, 600); + scheme.addColor(RGBColor::YELLOW, 900); + scheme.addColor(RGBColor::ORANGE, 1200); + scheme.addColor(RGBColor::RED, 1500); + scheme.addColor(RGBColor::MAGENTA, 2000); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by HC emissions", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 400); + scheme.addColor(RGBColor::GREEN, 800); + scheme.addColor(RGBColor::YELLOW, 1200); + scheme.addColor(RGBColor::ORANGE, 1600); + scheme.addColor(RGBColor::RED, 2000); + scheme.addColor(RGBColor::MAGENTA, 2500); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by fuel consumption", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 10); + scheme.addColor(RGBColor::GREEN, 20); + scheme.addColor(RGBColor::YELLOW, 30); + scheme.addColor(RGBColor::ORANGE, 40); + scheme.addColor(RGBColor::RED, 50); + scheme.addColor(RGBColor::MAGENTA, 60); + vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by noise emissions (Harmonoise)", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 60); + scheme.addColor(RGBColor::GREEN, 70); + scheme.addColor(RGBColor::YELLOW, 80); + scheme.addColor(RGBColor::ORANGE, 90); + scheme.addColor(RGBColor::RED, 100); + scheme.addColor(RGBColor::MAGENTA, 120); vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by fuel consumption", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double).005); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by noise emissions (Harmonoise)", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)100.); - vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by reroute number", RGBColor::RED, "", false, 0, COL_SCHEME_DYNAMIC); + scheme = GUIColorScheme("by reroute number", RGBColor::GREY, "", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor::YELLOW, (double)1.); - scheme.addColor(RGBColor::WHITE, (double)10.); + scheme.addColor(RGBColor::RED, (double)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"); @@ -732,8 +810,13 @@ scheme.addColor(RGBColor::YELLOW, (double)200); scheme.addColor(RGBColor::RED, (double)300); vehicleColorer.addScheme(scheme); - scheme = GUIColorScheme("by electricity consumption", RGBColor::GREEN, "", false, 0, COL_SCHEME_EMISSION); - scheme.addColor(RGBColor::RED, (double)5); + scheme = GUIColorScheme("by electricity consumption", RGBColor::GREY, "", false, 0, COL_SCHEME_EMISSION); + scheme.addColor(RGBColor::CYAN, 10); + scheme.addColor(RGBColor::GREEN, 20); + scheme.addColor(RGBColor::YELLOW, 30); + scheme.addColor(RGBColor::ORANGE, 40); + scheme.addColor(RGBColor::RED, 60); + 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); @@ -741,6 +824,13 @@ scheme.addColor(RGBColor::YELLOW, (double)180); scheme.addColor(RGBColor::RED, (double)900); vehicleColorer.addScheme(scheme); + scheme = GUIColorScheme("by stop delay", RGBColor::BLUE, "", false, 0, COL_SCHEME_DYNAMIC); + 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); + vehicleColorer.addScheme(scheme); scheme = GUIColorScheme("by lateral speed", RGBColor(179, 179, 179, 255), "0", false, 0, COL_SCHEME_DYNAMIC); scheme.addColor(RGBColor(255, 0, 0, 255), -3, "-1.5"); scheme.addColor(RGBColor(255, 255, 0, 255), -1, "-0.5"); @@ -748,10 +838,11 @@ scheme.addColor(RGBColor(0, 0, 255, 255), 3, "1.5"); scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); - vehicleColorer.addScheme(GUIColorScheme("random", RGBColor::YELLOW, "", true)); scheme = GUIColorScheme(SCHEME_NAME_PARAM_NUMERICAL, RGBColor(204, 204, 204)); scheme.setAllowsNegativeValues(true); vehicleColorer.addScheme(scheme); + vehicleColorer.addScheme(GUIColorScheme("random", RGBColor::YELLOW, "", true)); + vehicleColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); /// add person coloring schemes personColorer.addScheme(GUIColorScheme("given person/type color", RGBColor::BLUE, "", true)); @@ -1056,12 +1147,17 @@ GUIVisualizationSettings::initNeteditDefaults() { // init color schemes GUIColorScheme scheme = GUIColorScheme("uniform", RGBColor::BLACK, "road", true); - scheme.addColor(RGBColor::GREY, 1, "Sidewalk"); + scheme.addColor(RGBColor::GREY, 1, "sidewalk"); scheme.addColor(RGBColor(192, 66, 44), 2, "bike lane"); scheme.addColor(RGBColor(200, 255, 200), 3, "green verge"); scheme.addColor(RGBColor(150, 200, 200), 4, "waterway"); scheme.addColor(RGBColor::BLACK, 5, "railway"); - scheme.addColor(RGBColor(92, 92, 92), 6, "no passenger"); // paths, service roads etc + scheme.addColor(RGBColor(64, 0, 64), 6, "rails on road"); + scheme.addColor(RGBColor(92, 92, 92), 7, "no passenger"); // paths, service roads etc + 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"); 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"); @@ -1092,12 +1188,13 @@ scheme.addColor(RGBColor::BLUE, (double)5); laneColorer.addScheme(scheme); - scheme = GUIColorScheme("by given length/geometrical length", RGBColor::BLACK); - scheme.addColor(RGBColor::RED, 0.25); + 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::BLUE, (double)4.0); + scheme.addColor(RGBColor::CYAN, (double)4.0); + scheme.addColor(RGBColor::BLUE, (double)100.0); laneColorer.addScheme(scheme); laneColorer.addScheme(GUIColorScheme("by angle", RGBColor::YELLOW, "", true)); @@ -1152,9 +1249,10 @@ scheme = GUIColorScheme("uniform", RGBColor(102, 0, 0), "", true); scheme.addColor(RGBColor(204, 0, 0), 1, "junction bubble"); - scheme.addColor(RGBColor::ORANGE, 2, "geometry points"); + scheme.addColor(RGBColor(230, 100, 115), 2, "geometry points"); scheme.addColor(GUIVisualizationColorSettings::SUMO_color_DEADEND_SHOW, 3, "connections missing"); scheme.addColor(RGBColor::GREEN, 3, "custom shape"); + scheme.addColor(RGBColor(205, 180, 180), 4, "data mode"); junctionColorer.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"); @@ -1357,6 +1455,9 @@ drawLinkJunctionIndex.print(dev, "drawLinkJunctionIndex"); dev.lf(); dev << " "; + junctionID.print(dev, "junctionID"); + dev.lf(); + dev << " "; junctionName.print(dev, "junctionName"); dev.lf(); dev << " "; @@ -1590,6 +1691,9 @@ if (drawLinkJunctionIndex != v2.drawLinkJunctionIndex) { return false; } + if (junctionID != v2.junctionID) { + return false; + } if (junctionName != v2.junctionName) { return false; } @@ -1714,6 +1818,18 @@ return objectAngle; } +bool +GUIVisualizationSettings::flippedTextAngle(double objectAngle) const { + double viewAngle = objectAngle - angle; + while (viewAngle < 0) { + viewAngle += 360; + } + // fmod round towards zero which is not want we want for negative numbers + viewAngle = fmod(viewAngle, 360); + return (viewAngle > 90 && viewAngle < 270); +} + + bool GUIVisualizationSettings::drawAdditionals(const double exaggeration) const { @@ -1744,6 +1860,5 @@ } } -/****************************************************************************/ - +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.h sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.h --- sumo-1.5.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/settings/GUIVisualizationSettings.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Stores the information about how to visualize structures /****************************************************************************/ -#ifndef GUIVisualizationSettings_h -#define GUIVisualizationSettings_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -162,6 +156,9 @@ /// @brief person plan selection color (Rides, Walks, personStops...) RGBColor selectedPersonPlanColor; + /// @brief edge data selection color + RGBColor selectedEdgeDataColor; + /// @brief color for highlighthing deadends static const RGBColor SUMO_color_DEADEND_SHOW; @@ -479,6 +476,9 @@ /// @brief return an angle that is suitable for reading text aligned with the given angle (degrees) double getTextAngle(double objectAngle) const; + /// @brief return wether the text was flipped for reading at the given angle + bool flippedTextAngle(double objectAngle) const; + /// @brief check if additionals must be drawn bool drawAdditionals(const double exaggeration) const; @@ -659,7 +659,7 @@ GUIColorer junctionColorer; // Setting bundles for optional drawing junction names and indices - GUIVisualizationTextSettings drawLinkTLIndex, drawLinkJunctionIndex, junctionName, internalJunctionName, tlsPhaseIndex, tlsPhaseName; + GUIVisualizationTextSettings drawLinkTLIndex, drawLinkJunctionIndex, junctionID, junctionName, internalJunctionName, tlsPhaseIndex, tlsPhaseName; /// @brief Information whether lane-to-lane arrows shall be drawn bool showLane2Lane; @@ -766,6 +766,8 @@ static const std::string SCHEME_NAME_TYPE; static const std::string SCHEME_NAME_PERMISSION_CODE; + static const double MISSING_DATA; + /// @brief color settings GUIVisualizationColorSettings colorSettings; @@ -787,9 +789,3 @@ /// @brief detail settings GUIVisualizationDetailSettings detailSettings; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcuts.h sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcuts.h --- sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcuts.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcuts.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An enumeration of shortcuts used by the gui applications /****************************************************************************/ -#ifndef GUIShortcuts_h -#define GUIShortcuts_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -125,8 +119,3 @@ KEYMODIFIER_ALT, KEYMODIFIER_CONTROL }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Helper for Shortcuts /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -43,11 +38,11 @@ GUIApp->getAccelTable()->addAccel(parseKey(KEY_a, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS)); GUIApp->getAccelTable()->addAccel(parseKey(KEY_A, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS)); - GUIApp->getAccelTable()->addAccel(parseKey(KEY_b, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT)); - GUIApp->getAccelTable()->addAccel(parseKey(KEY_B, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT)); + GUIApp->getAccelTable()->addAccel(parseKey(KEY_b, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS)); + GUIApp->getAccelTable()->addAccel(parseKey(KEY_B, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS)); - GUIApp->getAccelTable()->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND)); - GUIApp->getAccelTable()->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND)); + GUIApp->getAccelTable()->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS)); + GUIApp->getAccelTable()->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS)); GUIApp->getAccelTable()->addAccel(parseKey(KEY_f, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_F_FULSCREENMODE)); GUIApp->getAccelTable()->addAccel(parseKey(KEY_F, KEYMODIFIER_CONTROL), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_F_FULSCREENMODE)); @@ -103,8 +98,8 @@ // Function Hotkeys GUIApp->getAccelTable()->addAccel(parseKey(KEY_F1), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION)); - GUIApp->getAccelTable()->addAccel(parseKey(KEY_F2), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F2_ABOUT)); GUIApp->getAccelTable()->addAccel(parseKey(KEY_F9), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F9_EDIT_VIEWSCHEME)); + GUIApp->getAccelTable()->addAccel(parseKey(KEY_F12), GUIApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F12_ABOUT)); } @@ -113,44 +108,44 @@ // initialize single hotkeys using upper and lower Keys (to avoid problems in Linux) - GNEApp->getAccelTable()->addAccel(parseKey(KEY_a), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_A), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_a), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_A_MODES_ADDITIONAL_STOP)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_A), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_A_MODES_ADDITIONAL_STOP)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_c), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_C), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_c), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_C), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_d), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_D_DELETEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_D), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_D_DELETEMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_d), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_D), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_D_MODES_DELETE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_e), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_E_EDGEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_E), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_E_EDGEMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_e), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_E_MODES_EDGE_EDGEDATA)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_E), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_E_MODES_EDGE_EDGEDATA)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_i), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_I_INSPECTMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_I), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_I_INSPECTMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_i), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_I_MODES_INSPECT)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_I), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_I_MODES_INSPECT)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_m), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MOVEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_M), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MOVEMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_m), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_M), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_M_MODES_MOVE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_p), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_P_POLYGONMODE_PERSONMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_P), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_P_POLYGONMODE_PERSONMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_p), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_P), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_P_MODES_POLYGON_PERSON)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_r), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_R), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_r), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_R), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_s), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_S_SELECTMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_S), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_S_SELECTMODE)); + 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_TLSMODE_VTYPEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_T), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_T_TLSMODE_VTYPEMODE)); + 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_v), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_V_VEHICLEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_V), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_V_VEHICLEMODE)); + 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_PROHIBITIONMODE_PERSONTYPEMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_W), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE)); + 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_z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_TAZMODE)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_Z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_TAZMODE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_Z), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_Z_MODES_TAZ)); // Control Keys @@ -160,8 +155,8 @@ GNEApp->getAccelTable()->addAccel(parseKey(KEY_c, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_C, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_d, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_D, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_g, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_G, KEYMODIFIER_CONTROL), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID)); @@ -264,23 +259,24 @@ // Function Hotkeys GNEApp->getAccelTable()->addAccel(parseKey(KEY_F1), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F1_ONLINEDOCUMENTATION)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F2), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F2_ABOUT)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F3), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_NETWORK)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F4), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DEMAND)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F2), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F2_SUPERMODE_NETWORK)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F3), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F3_SUPERMODE_DEMAND)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F4), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F4_SUPERMODE_DATA)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F5), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F6), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F7), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F8), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F9), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F9_EDIT_VIEWSCHEME)); GNEApp->getAccelTable()->addAccel(parseKey(KEY_F10), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F10_OPTIONSMENU)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F12), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F12_FOCUSUPPERELEMENT)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F12), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_F12_ABOUT)); // Shift + Function Hotkeys - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F1, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F2, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F3, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR)); - GNEApp->getAccelTable()->addAccel(parseKey(KEY_F5, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F1, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F1_TEMPLATE_SET)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F2, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F3, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F5, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE)); + GNEApp->getAccelTable()->addAccel(parseKey(KEY_F12, KEYMODIFIER_SHIFT), GNEApp, FXSEL(SEL_COMMAND, MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT)); // Alt + Function Hotkeys @@ -348,5 +344,5 @@ return keyCode; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.h sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.h --- sumo-1.5.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/shortcuts/GUIShortcutsSubSys.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Helper for Shortcuts /****************************************************************************/ -#ifndef GUIShortcutsSubSys_h -#define GUIShortcutsSubSys_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -56,9 +50,3 @@ // @brief parse GUIShortcut to int with two modifiers static int parseKey(GUIShortcut key, GUIShortcutModifier firstModifier, GUIShortcutModifier secondModifier); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.cpp sumo-1.6.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -73,7 +68,7 @@ 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 GUIParameterTrackerPanel(glcanvasFrame, *myApplication, *this); setTitle(name.c_str()); - setIcon(GUIIconSubSys::getIcon(ICON_APP_TRACKER)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::APP_TRACKER)); } @@ -105,7 +100,7 @@ new FXToolBarGrip(myToolBar, myToolBar, FXToolBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip); // save button new FXButton(myToolBar, "\t\tSave the data...", - GUIIconSubSys::getIcon(ICON_SAVE), this, GUIParameterTracker::MID_SAVE, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::SAVE), this, GUIParameterTracker::MID_SAVE, GUIDesignButtonToolbar); // aggregation interval combo myAggregationInterval = new FXComboBox(myToolBar, 8, this, MID_AGGREGATIONINTERVAL, @@ -186,7 +181,7 @@ long GUIParameterTracker::onCmdSave(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write(this, "Save Data", ".csv", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Save Data", ".csv", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -437,6 +432,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.h sumo-1.6.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.h --- sumo-1.5.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/tracker/GUIParameterTracker.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A window which displays the time line of one (or more) value(s) /****************************************************************************/ -#ifndef GUIParameterTracker_h -#define GUIParameterTracker_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -210,9 +204,3 @@ FOX_CONSTRUCTOR(GUIParameterTracker) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.cpp sumo-1.6.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,9 +20,6 @@ /// // Storage for a tracked value /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -178,6 +175,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.h sumo-1.6.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.h --- sumo-1.5.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/tracker/TrackerValueDesc.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,7 @@ /// // Representation of a timeline of floats with their names and moments /****************************************************************************/ -#ifndef TrackerValueDesc_h -#define TrackerValueDesc_h -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -135,9 +131,3 @@ double myTmpLastAggValue; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIAppEnum.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIAppEnum.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIAppEnum.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIAppEnum.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Message and object IDs used by the FOX-version of the gui /****************************************************************************/ -#ifndef GUIAppEnum_h -#define GUIAppEnum_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -46,31 +40,31 @@ /// @{ /// @brief hotkey for mode editing additionals AND stops - MID_HOTKEY_A_ADDITIONALMODE_STOPMODE, + MID_HOTKEY_A_MODES_ADDITIONAL_STOP, /// @brief hotkey for mode connecting lanes - MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE, + MID_HOTKEY_C_MODES_CONNECT_PERSONPLAN, /// @brief hotkey for mode deleting things - MID_HOTKEY_D_DELETEMODE, - /// @brief hotkey for mode adding edges - MID_HOTKEY_E_EDGEMODE, + MID_HOTKEY_D_MODES_DELETE, + /// @brief hotkey for mode adding edges AND edgeDatas + MID_HOTKEY_E_MODES_EDGE_EDGEDATA, /// @brief hotkey for mode inspecting object attributes - MID_HOTKEY_I_INSPECTMODE, + MID_HOTKEY_I_MODES_INSPECT, /// @brief hotkey for mode moving element - MID_HOTKEY_M_MOVEMODE, + MID_HOTKEY_M_MODES_MOVE, /// @brief hotkey for mode creating polygons - MID_HOTKEY_P_POLYGONMODE_PERSONMODE, + MID_HOTKEY_P_MODES_POLYGON_PERSON, /// @brief hotkey for mode selecting objects - MID_HOTKEY_S_SELECTMODE, - /// @brief hotkey for mode editing crossing AND routes - MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE, + MID_HOTKEY_S_MODES_SELECT, + /// @brief hotkey for mode editing crossing, routes and edges + MID_HOTKEY_R_MODES_CROSSING_ROUTE_EDGERELDATA, /// @brief hotkey for mode editing TLS AND Vehicle Types - MID_HOTKEY_T_TLSMODE_VTYPEMODE, + MID_HOTKEY_T_MODES_TLS_VTYPE, /// @brief hotkey for mode create vehicles - MID_HOTKEY_V_VEHICLEMODE, + MID_HOTKEY_V_MODES_VEHICLE, /// @brief hotkey for mode editing connection prohibitions AND person types - MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE, + MID_HOTKEY_W_MODES_PROHIBITION_PERSONTYPE, /// @brief hotkey for mode editing TAZ - MID_HOTKEY_Z_TAZMODE, + MID_HOTKEY_Z_MODES_TAZ, /// @} @@ -79,12 +73,12 @@ /// @brief Start the simulation in SUMO and open Additionals Elemements in NETEDIT MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS, - /// @brief Edit simulation breakpoints - MID_HOTKEY_CTRL_B_EDITBREAKPOINT, + /// @brief Edit simulation breakpoints in SUMO and open Data Elements in NETEDIT + MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS, /// @brief Copy the current selection / element MID_HOTKEY_CTRL_C_COPY, /// @brief Perform a single simulation step in SUMO and open Demand Elements in NETEDIT - MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND, + MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS, /// @brief Toogle Gaming mode in SUMO and grid in NETEDIT MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID, /// @brief Open viewport editor @@ -153,6 +147,8 @@ /// @brief Save Additional Elements MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS, + /// @brief save Data Elements + MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS, /// @brief Save Demand Elements MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS, /// @brief save TLS Programs @@ -165,14 +161,14 @@ /// @name Functional hotkeys /// @{ - /// @brief hot key open online documentation + /// @brief open online documentation MID_HOTKEY_F1_ONLINEDOCUMENTATION, - /// @brief hot key open about dialog - MID_HOTKEY_F2_ABOUT, - /// @brief hot key set network mode in NETEDIT - MID_HOTKEY_F3_SUPERMODE_NETWORK, - /// @brief hot key set demand mode in NETEDIT - MID_HOTKEY_F4_SUPERMODE_DEMAND, + /// @brief select network supermode in NETEDIT + MID_HOTKEY_F2_SUPERMODE_NETWORK, + /// @brief select demand supermode in NETEDIT + MID_HOTKEY_F3_SUPERMODE_DEMAND, + /// @brief select data supermode in NETEDIT + MID_HOTKEY_F4_SUPERMODE_DATA, /// @brief compute Network in network mode and Demand elements in demand mode MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND, /// @brief clean junctions without edges in network mode and unused routes in demand mode @@ -185,8 +181,8 @@ MID_HOTKEY_F9_EDIT_VIEWSCHEME, /// @brief open options menu MID_HOTKEY_F10_OPTIONSMENU, - /// @brief hot key focus upper element of current frame - MID_HOTKEY_F12_FOCUSUPPERELEMENT, + /// @brief open about dialog + MID_HOTKEY_F12_ABOUT, /// @} /// @name shift + Functional hotkeys @@ -200,7 +196,8 @@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR, /// @brief compute junctions with volatile options MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE, - + /// @brief focus upper element of current frame (only used in NETEDIT) + MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT, /// @} /// @name Other hotkeys @@ -424,6 +421,10 @@ MID_SHOW_FUTUREROUTE, /// @brief Hide vehicle's future route MID_HIDE_FUTUREROUTE, + /// @brief Show vehicle's future route (without loops) + MID_SHOW_ROUTE_NOLOOPS, + /// @brief Hide vehicle's future route (without loops) + MID_HIDE_ROUTE_NOLOOPS, /// @brief Show vehicle's best lanes MID_SHOW_BEST_LANES, /// @brief Hide vehicle's best lanes @@ -579,6 +580,8 @@ MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS, /// @brief save demand elements as MID_GNE_TOOLBARFILE_SAVEDEMAND_AS, + /// @brief save data elements as + MID_GNE_TOOLBARFILE_SAVEDATA_AS, /// @} @@ -600,18 +603,13 @@ /// @} - /// @name GNEViewNet common view options messages + /// @name GNEViewNet Network view options messages /// @{ /// @brief show grid - MID_GNE_COMMONVIEWOPTIONS_SHOWGRID, + MID_GNE_NETWORKVIEWOPTIONS_SHOWGRID, /// @brief Draw vehicles in begin position or spread in lane - MID_GNE_COMMONVIEWOPTIONS_DRAWSPREADVEHICLES, - - /// @} - - /// @name GNEViewNet Network view options messages - /// @{ + MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES, /// @brief show demand elements MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS, /// @brief select edges @@ -640,6 +638,10 @@ /// @name GNEViewNet Demand view options messages /// @{ + /// @brief show grid + MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID, + /// @brief Draw vehicles in begin position or spread in lane + MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES, /// @brief hide non-inspected demand element MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED, /// @brief hide shapes @@ -651,6 +653,36 @@ /// @} + /// @name GNEViewNet Data view options messages + /// @{ + + /// @brief show additionals + MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS, + /// @brief show shapes + MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES, + /// @brief show demand elements + MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS, + + /// @} + + /// @name GNEViewNet interval bar messages + /// @{ + + /// @brief generic data selected + MID_GNE_INTERVALBAR_GENERICDATATYPE, + /// @brief data set selected + MID_GNE_INTERVALBAR_DATASET, + /// @brief enable/disable show data elements by interval + MID_GNE_INTERVALBAR_LIMITED, + /// @brief begin changed in InterbalBar + MID_GNE_INTERVALBAR_BEGIN, + /// @brief end changed in InterbalBar + MID_GNE_INTERVALBAR_END, + /// @brief attribute changed in InterbalBar + MID_GNE_INTERVALBAR_ATTRIBUTE, + + /// @} + /// @name GNEFrame messages /// @{ @@ -681,6 +713,12 @@ MID_GNE_TAGTYPE_SELECTED, /// @brief tag selected in ComboBox MID_GNE_TAG_SELECTED, + /// @brief create new data set + MID_GNE_DATASET_NEW, + /// @brief GNEDataInterval selected in comboBox of IntervalBar + MID_GNE_DATASET_SELECTED, + /// @brief GNEDataInterval selected in comboBox of IntervalBar + MID_GNE_DATAINTERVAL_SELECTED, /// @brief text attribute edited MID_GNE_SET_ATTRIBUTE_TEXT, /// @brief bool attribute edited @@ -715,7 +753,6 @@ MID_GNE_OVERLAPPED_SHOWLIST, /// @brief list item selected in overlapped modul MID_GNE_OVERLAPPED_ITEMSELECTED, - /// @} /// @name GNESelectorFrame messages @@ -729,6 +766,12 @@ MID_GNE_SELECTORFRAME_PROCESSSTRING, /// @brief changes the visual scaling of selected items MID_GNE_SELECTORFRAME_SELECTSCALE, + /// @brief change interval + MID_GNE_SELECTORFRAME_SETINTERVAL, + /// @brief edit begin text field + MID_GNE_SELECTORFRAME_SETBEGIN, + /// @brief end text field + MID_GNE_SELECTORFRAME_SETEND, /// @} @@ -983,15 +1026,23 @@ MID_GNE_PERSON_TRANSFORM, /// @} - /// @name Additional Dialog messages (used in all GNEAdditionalDialogs) + /// @name Netedit Dialogs /// @{ /// @brief accept button - MID_GNE_ADDITIONALDIALOG_BUTTONACCEPT, + MID_GNE_BUTTON_ACCEPT, /// @brief cancel button - MID_GNE_ADDITIONALDIALOG_BUTTONCANCEL, + MID_GNE_BUTTON_CANCEL, /// @brief reset button - MID_GNE_ADDITIONALDIALOG_BUTTONRESET, + MID_GNE_BUTTON_RESET, + /// @brief load button + MID_GNE_BUTTON_LOAD, + /// @brief save button + MID_GNE_BUTTON_SAVE, + /// @brief clear button + MID_GNE_BUTTON_CLEAR, + /// @brief sort button + MID_GNE_BUTTON_SORT, /// @} @@ -1055,8 +1106,6 @@ MID_GNE_CALIBRATORDIALOG_TABLE_VEHICLETYPE, /// @brief add vehicle type MID_GNE_CALIBRATORDIALOG_ADD_VEHICLETYPE, - /// @brief set new variable - MID_GNE_CALIBRATORDIALOG_SET_VARIABLE, /// @} @@ -1082,26 +1131,6 @@ /// @} - /// @name GNEParameters Dialog messages - /// @{ - - /// @brief load parameters - MID_GNE_PARAMETERS_LOAD, - /// @brief save parameters - MID_GNE_PARAMETERS_SAVE, - /// @brief clear parameters - MID_GNE_PARAMETERS_CLEAR, - /// @brief sort parameters - MID_GNE_PARAMETERS_SORT, - - /// @} - /// @brief last element of enum (not used) MID_LAST }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDanielPerspectiveChanger.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A class that allows to steer the visual output in dependence to /****************************************************************************/ -#ifndef GUIDanielPerspectiveChanger_h -#define GUIDanielPerspectiveChanger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -160,9 +154,3 @@ GUIDanielPerspectiveChanger& operator=(const GUIDanielPerspectiveChanger&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A dialog to change the viewport /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -67,9 +62,9 @@ // create frame for file icons FXHorizontalFrame* frameFiles = new FXHorizontalFrame(contentsFrame, GUIDesignHorizontalFrameIcons); myLoadButton = new FXButton(frameFiles, "Load\t\tLoad viewport from file", - GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, GUIDialog_EditViewport::MID_LOAD, GUIDesignButtonToolbarWithText); + GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, GUIDialog_EditViewport::MID_LOAD, GUIDesignButtonToolbarWithText); mySaveButton = new FXButton(frameFiles, "Save\t\tSave viewport to file", - GUIIconSubSys::getIcon(ICON_SAVE), this, GUIDialog_EditViewport::MID_SAVE, GUIDesignButtonToolbarWithText); + GUIIconSubSys::getIcon(GUIIcon::SAVE), this, GUIDialog_EditViewport::MID_SAVE, GUIDesignButtonToolbarWithText); // create horizontalframe for zoom elements and OSG FXHorizontalFrame* editElementsFrame = new FXHorizontalFrame(contentsFrame, GUIDesignAuxiliarHorizontalFrame); @@ -134,11 +129,11 @@ new FXHorizontalSeparator(contentsFrame, GUIDesignHorizontalSeparator); FXHorizontalFrame* frameButtons = new FXHorizontalFrame(contentsFrame, GUIDesignAuxiliarHorizontalFrame); new FXHorizontalFrame(frameButtons, GUIDesignAuxiliarHorizontalFrame); - myOKButton = new FXButton(frameButtons, "&OK\t\taccept", GUIIconSubSys::getIcon(ICON_ACCEPT), this, GUIDialog_EditViewport::MID_OK, GUIDesignButtonOK); - myCancelButton = new FXButton(frameButtons, "&Cancel\t\tclose", GUIIconSubSys::getIcon(ICON_CANCEL), this, GUIDialog_EditViewport::MID_CANCEL, GUIDesignButtonCancel); + myOKButton = new FXButton(frameButtons, "&OK\t\taccept", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, GUIDialog_EditViewport::MID_OK, GUIDesignButtonOK); + myCancelButton = new FXButton(frameButtons, "&Cancel\t\tclose", GUIIconSubSys::getIcon(GUIIcon::CANCEL), this, GUIDialog_EditViewport::MID_CANCEL, GUIDesignButtonCancel); new FXHorizontalFrame(frameButtons, GUIDesignAuxiliarHorizontalFrame); // set dialog icon - setIcon(GUIIconSubSys::getIcon(ICON_EDITVIEWPORT)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::EDITVIEWPORT)); } @@ -207,7 +202,7 @@ long GUIDialog_EditViewport::onCmdLoad(FXObject*, FXSelector, void*) { FXFileDialog opendialog(this, "Load Viewport"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("*.xml"); if (gCurrentFolder.length() != 0) { @@ -225,7 +220,7 @@ long GUIDialog_EditViewport::onCmdSave(FXObject*, FXSelector, void*) { - FXString file = MFXUtils::getFilename2Write(this, "Save Viewport", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Save Viewport", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -306,5 +301,5 @@ getApp()->reg().writeIntEntry("VIEWPORT_DIALOG_SETTINGS", "y", getY()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_EditViewport.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A dialog to change the viewport /****************************************************************************/ -#ifndef GUIDialog_EditViewport_h -#define GUIDialog_EditViewport_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -149,9 +143,3 @@ /// @brief Cancel button FXButton* myCancelButton; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -77,20 +72,20 @@ refreshList(ids); // build the buttons FXVerticalFrame* layoutRight = new FXVerticalFrame(hbox, GUIDesignChooserLayoutRight); - myCenterButton = new FXButton(layoutRight, "Center\t\t", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_CHOOSER_CENTER, GUIDesignChooserButtons); - myTrackButton = new FXButton(layoutRight, "Track\t\t", GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_CHOOSER_TRACK, GUIDesignChooserButtons); + myCenterButton = new FXButton(layoutRight, "Center\t\t", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_CHOOSER_CENTER, GUIDesignChooserButtons); + myTrackButton = new FXButton(layoutRight, "Track\t\t", GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_CHOOSER_TRACK, GUIDesignChooserButtons); // only enable Track Button if we're locating vehicles if (title.text() != std::string("Vehicle Chooser")) { myTrackButton->disable(); myTrackButton->hide(); } new FXHorizontalSeparator(layoutRight, GUIDesignHorizontalSeparator); - new FXButton(layoutRight, "&Hide Unselected\t\t", GUIIconSubSys::getIcon(ICON_FLAG), this, MID_CHOOSER_FILTER, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Hide Unselected\t\t", GUIIconSubSys::getIcon(GUIIcon::FLAG), this, MID_CHOOSER_FILTER, GUIDesignChooserButtons); new FXButton(layoutRight, "&Filter substring\t\t", nullptr, this, MID_CHOOSER_FILTER_SUBSTR, GUIDesignChooserButtons); - new FXButton(layoutRight, "&Select/deselect\tSelect/deselect current object\t", GUIIconSubSys::getIcon(ICON_FLAG), this, MID_CHOOSEN_INVERT, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Select/deselect\tSelect/deselect current object\t", GUIIconSubSys::getIcon(GUIIcon::FLAG), this, MID_CHOOSEN_INVERT, GUIDesignChooserButtons); new FXButton(layoutRight, "By &Name\tLocate item by name\t", nullptr, this, MID_CHOOSEN_NAME, GUIDesignChooserButtons); new FXHorizontalSeparator(layoutRight, GUIDesignHorizontalSeparator); - new FXButton(layoutRight, "&Close\t\t", GUIIconSubSys::getIcon(ICON_NO), this, MID_CANCEL, GUIDesignChooserButtons); + new FXButton(layoutRight, "&Close\t\t", GUIIconSubSys::getIcon(GUIIcon::NO), this, MID_CANCEL, GUIDesignChooserButtons); myParent->getParent()->addChild(this); // create and show dialog @@ -206,7 +201,7 @@ long GUIDialog_GLObjChooser::onCmdFilter(FXObject*, FXSelector, void*) { - FXIcon* flag = GUIIconSubSys::getIcon(ICON_FLAG); + FXIcon* flag = GUIIconSubSys::getIcon(GUIIcon::FLAG); std::vector selectedGlIDs; const int numItems = myList->getNumItems(); for (int i = 0; i < numItems; i++) { @@ -257,7 +252,7 @@ } const std::string& name = getObjectName(o); bool selected = myParent->isSelected(o); - FXIcon* icon = selected ? GUIIconSubSys::getIcon(ICON_FLAG) : nullptr; + FXIcon* icon = selected ? GUIIconSubSys::getIcon(GUIIcon::FLAG) : nullptr; myIDs.insert(o->getGlID()); myList->appendItem(name.c_str(), icon, (void*) & (*myIDs.find(o->getGlID()))); GUIGlObjectStorage::gIDStorage.unblockObject(i); @@ -268,7 +263,7 @@ long GUIDialog_GLObjChooser::onCmdToggleSelection(FXObject*, FXSelector, void*) { - FXIcon* flag = GUIIconSubSys::getIcon(ICON_FLAG); + FXIcon* flag = GUIIconSubSys::getIcon(GUIIcon::FLAG); int i = myList->getCurrentItem(); if (i >= 0) { toggleSelection(i); @@ -316,7 +311,4 @@ } - - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_GLObjChooser.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Class for the window that allows to choose a street, junction or vehicle /****************************************************************************/ -#ifndef GUIDialog_GLObjChooser_h -#define GUIDialog_GLObjChooser_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -162,9 +156,3 @@ FOX_CONSTRUCTOR(GUIDialog_GLObjChooser) }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // The "About" - dialog for NETEDIT, (adapted from GUIDialog_AboutSUMO) /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -96,7 +91,7 @@ } // ok-button - new FXButton(contentFrame, "OK\t\tAccept settings", GUIIconSubSys::getIcon(ICON_ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); + new FXButton(contentFrame, "OK\t\tAccept settings", GUIIconSubSys::getIcon(GUIIcon::ACCEPT), this, ID_ACCEPT, GUIDesignButtonOK); } diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_Options.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // A Dialog for setting options (see OptionsCont) /****************************************************************************/ -#ifndef GUIDialog_Options_h -#define GUIDialog_Options_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -141,9 +135,3 @@ FXTextField* myTextField; }; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // The dialog to change the view (gui) settings. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -101,10 +96,10 @@ } mySchemeName->setNumVisible(5); - new FXButton(frame0, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(ICON_SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar); - new FXButton(frame0, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(ICON_REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar); - new FXButton(frame0, "\t\tExport setting to file", GUIIconSubSys::getIcon(ICON_SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar); - new FXButton(frame0, "\t\tLoad setting from file", GUIIconSubSys::getIcon(ICON_OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar); + new FXButton(frame0, "\t\tSave the setting to registry", GUIIconSubSys::getIcon(GUIIcon::SAVEDB), this, MID_SIMPLE_VIEW_SAVE, GUIDesignButtonToolbar); + new FXButton(frame0, "\t\tRemove the setting from registry", GUIIconSubSys::getIcon(GUIIcon::REMOVEDB), this, MID_SIMPLE_VIEW_DELETE, GUIDesignButtonToolbar); + new FXButton(frame0, "\t\tExport setting to file", GUIIconSubSys::getIcon(GUIIcon::SAVE), this, MID_SIMPLE_VIEW_EXPORT, GUIDesignButtonToolbar); + new FXButton(frame0, "\t\tLoad setting from file", GUIIconSubSys::getIcon(GUIIcon::OPEN_CONFIG), this, MID_SIMPLE_VIEW_IMPORT, GUIDesignButtonToolbar); new FXVerticalSeparator(frame0); new FXLabel(frame0, "Export includes:", nullptr, GUIDesignViewSettingsLabel1); @@ -176,6 +171,7 @@ (BUTTON_DEFAULT | FRAME_RAISED | FRAME_THICK | LAYOUT_TOP | LAYOUT_LEFT), 0, 0, 0, 0, 20, 20, 4, 4); myLaneColorRainbowCheck = new FXCheckButton(m24, "hide below threshold", this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignCheckButtonViewSettings); myLaneColorRainbowThreshold = new FXRealSpinner(m24, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, REALSPIN_NOMIN | GUIDesignViewSettingsSpinDial2); + myLaneColorRainbowThreshold->setRange(-100000, 100000); new FXHorizontalSeparator(frame2, GUIDesignHorizontalSeparator); // ... scale settings @@ -225,16 +221,16 @@ mySpreadSuperposed->setCheck(mySettings->spreadSuperposed); new FXLabel(m22, "Exaggerate width by", nullptr, GUIDesignViewSettingsLabel1); myLaneWidthUpscaleDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2); - myLaneWidthUpscaleDialer->setRange(0, 10000); + myLaneWidthUpscaleDialer->setRange(0, 1000000); myLaneWidthUpscaleDialer->setValue(mySettings->laneWidthExaggeration); new FXLabel(m22, "Minimum size", nullptr, GUIDesignViewSettingsLabel1); myLaneMinWidthDialer = new FXRealSpinner(m22, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsSpinDial2); - myLaneMinWidthDialer->setRange(0, 10000); + myLaneMinWidthDialer->setRange(0, 1000000); myLaneMinWidthDialer->setValue(mySettings->laneMinSize); // edge name - myEdgeNamePanel = new NamePanel(m22, this, "Show edge name", mySettings->edgeName); + myEdgeNamePanel = new NamePanel(m22, this, "Show edge id", mySettings->edgeName); myStreetNamePanel = new NamePanel(m22, this, "Show street name", mySettings->streetName); myEdgeValuePanel = new NamePanel(m22, this, "Show edge color value", mySettings->edgeValue); } @@ -271,7 +267,7 @@ new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator); FXMatrix* m35 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings); - myVehicleNamePanel = new NamePanel(m35, this, "Show vehicle name", mySettings->vehicleName); + myVehicleNamePanel = new NamePanel(m35, this, "Show vehicle id", mySettings->vehicleName); myVehicleValuePanel = new NamePanel(m35, this, "Show vehicle color value", mySettings->vehicleValue); myVehicleTextPanel = new NamePanel(m35, this, "Show vehicle text param", mySettings->vehicleText); myVehicleTextParamKey = new FXComboBox(myVehicleTextPanel->myMatrix0, 1, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignComboBoxStatic); @@ -332,7 +328,7 @@ new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator); FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings); - myPersonNamePanel = new NamePanel(m103, this, "Show person name", mySettings->personName); + myPersonNamePanel = new NamePanel(m103, this, "Show person id", mySettings->personName); myPersonValuePanel = new NamePanel(m103, this, "Show person color value", mySettings->personValue); new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator); @@ -370,7 +366,7 @@ new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator); FXMatrix* m103 = new FXMatrix(frame3, 2, GUIDesignMatrixViewSettings); - myContainerNamePanel = new NamePanel(m103, this, "Show container name", mySettings->containerName); + myContainerNamePanel = new NamePanel(m103, this, "Show container id", mySettings->containerName); new FXHorizontalSeparator(frame3, GUIDesignHorizontalSeparator); @@ -406,12 +402,13 @@ myTLIndexPanel = new NamePanel(m42, this, "Show link tls index", mySettings->drawLinkTLIndex); myJunctionIndexPanel = new NamePanel(m42, this, "Show link junction index", mySettings->drawLinkJunctionIndex); - myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName); - myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction name", mySettings->internalJunctionName); - myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge name", mySettings->internalEdgeName); - myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea name", mySettings->cwaEdgeName); + myJunctionIDPanel = new NamePanel(m42, this, "Show junction id", mySettings->junctionID); + myInternalJunctionNamePanel = new NamePanel(m42, this, "Show internal junction id", mySettings->internalJunctionName); + myInternalEdgeNamePanel = new NamePanel(m42, this, "Show internal edge id", mySettings->internalEdgeName); + myCwaEdgeNamePanel = new NamePanel(m42, this, "Show crossing and walkingarea id", mySettings->cwaEdgeName); myTLSPhaseIndexPanel = new NamePanel(m42, this, "Show traffic light phase index", mySettings->tlsPhaseIndex); myTLSPhaseNamePanel = new NamePanel(m42, this, "Show traffic light phase name", mySettings->tlsPhaseName); + myJunctionNamePanel = new NamePanel(m42, this, "Show junction name", mySettings->junctionName); } { // detectors / triggers @@ -420,7 +417,7 @@ FXVerticalFrame* frame5 = new FXVerticalFrame(genScroll, GUIDesignViewSettingsVerticalFrame2); FXMatrix* m51 = new FXMatrix(frame5, 2, GUIDesignMatrixViewSettings); - myAddNamePanel = new NamePanel(m51, this, "Show object name", mySettings->addName); + myAddNamePanel = new NamePanel(m51, this, "Show object id", mySettings->addName); myAddFullNamePanel = new NamePanel(m51, this, "Show full name", mySettings->addFullName); new FXHorizontalSeparator(frame5, GUIDesignHorizontalSeparator); @@ -449,8 +446,8 @@ new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator); FXMatrix* m61 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings); - myPOINamePanel = new NamePanel(m61, this, "Show poi names", mySettings->poiName); - myPOITypePanel = new NamePanel(m61, this, "Show poi types", mySettings->poiType); + myPOINamePanel = new NamePanel(m61, this, "Show poi id", mySettings->poiName); + myPOITypePanel = new NamePanel(m61, this, "Show poi type", mySettings->poiType); new FXHorizontalSeparator(frame6, GUIDesignHorizontalSeparator); FXMatrix* m62 = new FXMatrix(frame6, 2, GUIDesignMatrixViewSettings); @@ -474,7 +471,7 @@ new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator); FXMatrix* m91 = new FXMatrix(frame9, 2, GUIDesignMatrixViewSettings); - myPolyNamePanel = new NamePanel(m91, this, "Show polygon name", mySettings->polyName); + myPolyNamePanel = new NamePanel(m91, this, "Show polygon id", mySettings->polyName); myPolyTypePanel = new NamePanel(m91, this, "Show polygon types", mySettings->polyType); new FXHorizontalSeparator(frame9, GUIDesignHorizontalSeparator); @@ -512,6 +509,8 @@ mySelectedPersonColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell); new FXLabel(m102, "PersonPlan", nullptr, GUIDesignViewSettingsLabel1); mySelectedPersonPlanColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedPersonPlanColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell); + new FXLabel(m102, "edgeData", nullptr, GUIDesignViewSettingsLabel1); + mySelectedEdgeDataColor = new FXColorWell(m102, MFXUtils::getFXColor(settings->colorSettings.selectedEdgeDataColor), this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsColorWell); } { // Legend @@ -555,7 +554,7 @@ initial->setFocus(); rebuildColorMatrices(false); - setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); loadWindowSize(); } @@ -572,6 +571,7 @@ delete myEdgeValuePanel; delete myJunctionIndexPanel; delete myTLIndexPanel; + delete myJunctionIDPanel; delete myJunctionNamePanel; delete myVehicleNamePanel; delete myVehicleValuePanel; @@ -658,6 +658,7 @@ mySelectedVehicleColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedVehicleColor)); mySelectedPersonColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonColor)); mySelectedPersonPlanColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedPersonPlanColor)); + mySelectedEdgeDataColor->setRGBA(MFXUtils::getFXColor(mySettings->colorSettings.selectedEdgeDataColor)); } myLaneEdgeColorMode->setCurrentItem((FXint) mySettings->getLaneEdgeMode()); @@ -708,6 +709,7 @@ myJunctionColorMode->setCurrentItem((FXint) mySettings->junctionColorer.getActive()); myTLIndexPanel->update(mySettings->drawLinkTLIndex); myJunctionIndexPanel->update(mySettings->drawLinkJunctionIndex); + myJunctionIDPanel->update(mySettings->junctionID); myJunctionNamePanel->update(mySettings->junctionName); myInternalJunctionNamePanel->update(mySettings->internalJunctionName); myTLSPhaseIndexPanel->update(mySettings->tlsPhaseIndex); @@ -876,7 +878,7 @@ tmpSettings.colorSettings.selectedVehicleColor = MFXUtils::getRGBColor(mySelectedVehicleColor->getRGBA()); tmpSettings.colorSettings.selectedPersonColor = MFXUtils::getRGBColor(mySelectedPersonColor->getRGBA()); tmpSettings.colorSettings.selectedPersonPlanColor = MFXUtils::getRGBColor(mySelectedPersonPlanColor->getRGBA()); - + tmpSettings.colorSettings.selectedEdgeDataColor = MFXUtils::getRGBColor(mySelectedEdgeDataColor->getRGBA()); } tmpSettings.showGrid = (myShowGrid->getCheck() != FALSE); @@ -953,6 +955,7 @@ tmpSettings.junctionColorer.setActive(myJunctionColorMode->getCurrentItem()); tmpSettings.drawLinkTLIndex = myTLIndexPanel->getSettings(); tmpSettings.drawLinkJunctionIndex = myJunctionIndexPanel->getSettings(); + tmpSettings.junctionID = myJunctionIDPanel->getSettings(); tmpSettings.junctionName = myJunctionNamePanel->getSettings(); tmpSettings.internalJunctionName = myInternalJunctionNamePanel->getSettings(); tmpSettings.tlsPhaseIndex = myTLSPhaseIndexPanel->getSettings(); @@ -1286,7 +1289,7 @@ long GUIDialog_ViewSettings::onCmdExportSetting(FXObject*, FXSelector, void* /*data*/) { - FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Export view settings", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -1335,7 +1338,7 @@ long GUIDialog_ViewSettings::onCmdImportSetting(FXObject*, FXSelector, void* /*data*/) { FXFileDialog opendialog(this, "Import view settings"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("*.xml"); if (gCurrentFolder.length() != 0) { @@ -1352,7 +1355,7 @@ long GUIDialog_ViewSettings::onCmdLoadDecals(FXObject*, FXSelector, void* /*data*/) { FXFileDialog opendialog(this, "Load Decals"); - opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY)); + opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::EMPTY)); opendialog.setSelectMode(SELECTFILE_ANY); opendialog.setPatternList("*.xml"); if (gCurrentFolder.length() != 0) { @@ -1368,7 +1371,7 @@ long GUIDialog_ViewSettings::onCmdSaveDecals(FXObject*, FXSelector, void* /*data*/) { - FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(ICON_EMPTY), gCurrentFolder); + FXString file = MFXUtils::getFilename2Write(this, "Save Decals", ".xml", GUIIconSubSys::getIcon(GUIIcon::EMPTY), gCurrentFolder); if (file == "") { return 1; } @@ -1466,8 +1469,17 @@ FXRealSpinner* threshDialer = new FXRealSpinner(m, 10, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignSpinDial | SPIN_NOMAX | dialerOptions); threshDialer->setValue(*threshIt); thresholds.push_back(threshDialer); - buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); - buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); + if (*threshIt == GUIVisualizationSettings::MISSING_DATA) { + threshDialer->disable(); + threshDialer->hide(); + buttons.push_back(new FXButton(m, "", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); + buttons.back()->hide(); + buttons.push_back(new FXButton(m, "No Data", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); + buttons.back()->disable(); + } else { + buttons.push_back(new FXButton(m, "Add", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); + buttons.push_back(new FXButton(m, "Remove", nullptr, this, MID_SIMPLE_VIEW_COLORCHANGE, GUIDesignViewSettingsButton1)); + } } colIt++; threshIt++; @@ -1912,5 +1924,5 @@ setHeight(MAX2(getApp()->reg().readIntEntry("VIEWSETTINGS", "height", 500), minSize)); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIDialog_ViewSettings.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The dialog to change the view (gui) settings. /****************************************************************************/ -#ifndef GUIDialog_ViewSettings_h -#define GUIDialog_ViewSettings_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -277,6 +271,7 @@ FXColorWell* mySelectedVehicleColor; FXColorWell* mySelectedPersonColor; FXColorWell* mySelectedPersonPlanColor; + FXColorWell* mySelectedEdgeDataColor; /// ... lane colorer MFXIconComboBox* myLaneEdgeColorMode; @@ -366,7 +361,7 @@ NamePanel* myEdgeNamePanel, *myInternalEdgeNamePanel, *myCwaEdgeNamePanel, *myStreetNamePanel, *myEdgeValuePanel, *myJunctionIndexPanel, *myTLIndexPanel, - *myJunctionNamePanel, *myInternalJunctionNamePanel, + *myJunctionIDPanel, *myJunctionNamePanel, *myInternalJunctionNamePanel, *myTLSPhaseIndexPanel, *myTLSPhaseNamePanel, *myVehicleNamePanel, *myVehicleValuePanel, *myVehicleTextPanel, *myPersonNamePanel, *myPersonValuePanel, @@ -394,9 +389,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -117,26 +112,26 @@ // recenter view new FXButton(myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tRecenter View\tRecenter view to the simulated area.", - GUIIconSubSys::getIcon(ICON_RECENTERVIEW), this, MID_RECENTERVIEW, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::RECENTERVIEW), this, MID_RECENTERVIEW, GUIDesignButtonToolbar); // add viewport button new FXButton(myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tEdit ViewporttOpens a menu which lets you edit the viewport.", - GUIIconSubSys::getIcon(ICON_EDITVIEWPORT), this, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::EDITVIEWPORT), this, MID_HOTKEY_CTRL_I_EDITVIEWPORT, GUIDesignButtonToolbar); // toggle button for zooming style MFXCheckableButton* zoomBut = new MFXCheckableButton(false, myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tToggles Zooming Style\tToggles whether zooming is based at cursor position or at the center of the view.", - GUIIconSubSys::getIcon(ICON_ZOOMSTYLE), this, MID_ZOOM_STYLE, GUIDesignButtonToolbarCheckable); + GUIIconSubSys::getIcon(GUIIcon::ZOOMSTYLE), this, MID_ZOOM_STYLE, GUIDesignButtonToolbarCheckable); zoomBut->setChecked(getApp()->reg().readIntEntry("gui", "zoomAtCenter", 0) != 1); // build the locator popup myLocatorPopup = new FXPopup(myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, POPUP_VERTICAL); // build locator button myLocatorButton = new FXMenuButton(myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tLocate Structures\tLocate structures within the network.", - GUIIconSubSys::getIcon(ICON_LOCATE), myLocatorPopup, GUIDesignButtonToolbarLocator); + GUIIconSubSys::getIcon(GUIIcon::LOCATE), myLocatorPopup, GUIDesignButtonToolbarLocator); // add toggle button for tool-tips on/off new MFXCheckableButton(false, myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tToggles Tool Tips\tToggles whether tool tips shall be shown.", - GUIIconSubSys::getIcon(ICON_SHOWTOOLTIPS), this, MID_SHOWTOOLTIPS, GUIDesignButtonToolbarCheckable); + GUIIconSubSys::getIcon(GUIIcon::SHOWTOOLTIPS), this, MID_SHOWTOOLTIPS, GUIDesignButtonToolbarCheckable); } @@ -150,7 +145,7 @@ // editor new FXButton(myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tEdit Coloring Schemes\tOpens a menu which lets you edit the coloring schemes.", - GUIIconSubSys::getIcon(ICON_COLORWHEEL), this, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::COLORWHEEL), this, MID_HOTKEY_F9_EDIT_VIEWSCHEME, GUIDesignButtonToolbar); } @@ -161,7 +156,7 @@ // snapshot new MFXCheckableButton(false, myGripNavigationToolbar ? myGripNavigationToolbar : myStaticNavigationToolBar, "\tMake Snapshot\tMakes a snapshot of the view.", - GUIIconSubSys::getIcon(ICON_CAMERA), this, MID_MAKESNAPSHOT, GUIDesignButtonToolbar); + GUIIconSubSys::getIcon(GUIIcon::CAMERA), this, MID_MAKESNAPSHOT, GUIDesignButtonToolbar); } @@ -259,5 +254,5 @@ return gSelected.isSelected(o->getType(), o->getGlID()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIGlChildWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,15 +19,7 @@ /// // /****************************************************************************/ -#ifndef GUIGlChildWindow_h -#define GUIGlChildWindow_h - - - -// =========================================================================== -// included modules -// =========================================================================== - +#pragma once #include #include @@ -136,9 +128,3 @@ /// @brief Invalidated assignment operator. GUIGlChildWindow& operator=(const GUIGlChildWindow&) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIMainWindow.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIMainWindow.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIMainWindow.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIMainWindow.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -251,5 +246,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIMainWindow.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIMainWindow.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIMainWindow.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIMainWindow.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // /****************************************************************************/ -#ifndef GUIMainWindow_h -#define GUIMainWindow_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -195,9 +189,3 @@ void storeWindowSizeAndPos(); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class that allows to steer the visual output in dependence to user /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include "GUISUMOAbstractView.h" @@ -139,5 +134,5 @@ return result; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUIPerspectiveChanger.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A virtual class that allows to steer the visual output in dependence to /****************************************************************************/ -#ifndef GUIPerspectiveChanger_h -#define GUIPerspectiveChanger_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -175,9 +169,3 @@ /// @brief Invalidated assignment operator. GUIPerspectiveChanger& operator=(const GUIPerspectiveChanger&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.cpp sumo-1.6.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.cpp --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // The base class for a view /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -128,7 +123,7 @@ FXGLCanvas(p, glVis, share, p, MID_GLCANVAS, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y, 0, 0, 0, 0), myApp(&app), myParent(parent), - myGrid(&((SUMORTree&)grid)), + myGrid(&grid), myChanger(nullptr), myMouseHotspotX(app.getDefaultCursor()->getHotX()), myMouseHotspotY(app.getDefaultCursor()->getHotY()), @@ -139,7 +134,8 @@ myViewportChooser(nullptr), myWindowCursorPositionX(getWidth() / 2), myWindowCursorPositionY(getHeight() / 2), - myVisualizationChanger(nullptr) { + myVisualizationChanger(nullptr), + myFrameDrawTime(0) { setTarget(this); enable(); flags |= FLAG_ENABLED; @@ -715,7 +711,7 @@ const double threshold = scheme.getThresholds()[i]; std::string name = scheme.getNames()[i]; - std::string text = fixed ? name : toString(threshold); + std::string text = fixed || threshold == GUIVisualizationSettings::MISSING_DATA ? name : toString(threshold); const double bgShift = 0.0; const double textShift = 0.02; diff -Nru sumo-1.5.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.h sumo-1.6.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.h --- sumo-1.5.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/gui/windows/GUISUMOAbstractView.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // The base class for a view /****************************************************************************/ -#ifndef GUISUMOAbstractView_h -#define GUISUMOAbstractView_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -451,7 +445,7 @@ GUIGlChildWindow* myParent; /// @brief The visualization speed-up - SUMORTree* myGrid; + const SUMORTree* myGrid; /// @brief The perspective changer GUIPerspectiveChanger* myChanger; @@ -517,9 +511,3 @@ // @brief sensitivity for "<>AtPosition(...) functions static const double SENSITIVITY; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/importio/LineHandler.h sumo-1.6.0+dfsg1/src/utils/importio/LineHandler.h --- sumo-1.5.0+dfsg1/src/utils/importio/LineHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/importio/LineHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Interface definition for a class which retrieves lines from a LineHandler /****************************************************************************/ -#ifndef LineHandler_h -#define LineHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -65,9 +59,3 @@ virtual bool report(const std::string& result) = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/importio/LineReader.cpp sumo-1.6.0+dfsg1/src/utils/importio/LineReader.cpp --- sumo-1.5.0+dfsg1/src/utils/importio/LineReader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/importio/LineReader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -128,6 +123,7 @@ if (idx == 0) { myStrBuffer = myStrBuffer.substr(1); myRread++; + myLinesRead++; return ""; } if (idx != std::string::npos) { @@ -148,6 +144,7 @@ toReport = myStrBuffer; myRread += 1024; if (toReport == "") { + myLinesRead++; return toReport; } } @@ -166,6 +163,7 @@ } else { toReport = ""; } + myLinesRead++; return toReport; } @@ -202,9 +200,19 @@ myStrm.seekg(0, std::ios::end); myAvailable = static_cast(myStrm.tellg()); myStrm.seekg(0, std::ios::beg); + if (myAvailable >= 3) { + // check for BOM + myStrm.read(myBuffer, 3); + if (myBuffer[0] == (char)0xef && myBuffer[1] == (char)0xbb && myBuffer[2] == (char)0xbf) { + myAvailable -= 3; + } else { + myStrm.seekg(0, std::ios::beg); + } + } myRead = 0; myRread = 0; myStrBuffer = ""; + myLinesRead = 0; } @@ -223,6 +231,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/importio/LineReader.h sumo-1.6.0+dfsg1/src/utils/importio/LineReader.h --- sumo-1.5.0+dfsg1/src/utils/importio/LineReader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/importio/LineReader.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Retrieves a file linewise and reports the lines to a handler. /****************************************************************************/ -#ifndef LineReader_h -#define LineReader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -146,6 +140,10 @@ bool good() const; + int getLineNumber() { + return myLinesRead; + } + private: /// @brief the name of the file to read the contents from std::string myFileName; @@ -168,10 +166,7 @@ /// @brief Information how many bytes were read by the reader from the file int myRread; -}; - - -#endif - -/****************************************************************************/ + /// @brief Information how many lines were read for meaningful error messages + int myLinesRead; +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/importio/NamedColumnsParser.cpp sumo-1.6.0+dfsg1/src/utils/importio/NamedColumnsParser.cpp --- sumo-1.5.0+dfsg1/src/utils/importio/NamedColumnsParser.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/importio/NamedColumnsParser.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A parser to retrieve information from a table with known column /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -75,7 +70,7 @@ i = myDefinitionsMap.find(StringUtils::to_lower_case(name)); } if (i == myDefinitionsMap.end()) { - throw UnknownElement(name); + throw UnknownElement("Element '" + name + "' is missing"); } } int pos = (*i).second; @@ -144,6 +139,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/importio/NamedColumnsParser.h sumo-1.6.0+dfsg1/src/utils/importio/NamedColumnsParser.h --- sumo-1.5.0+dfsg1/src/utils/importio/NamedColumnsParser.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/importio/NamedColumnsParser.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A parser to retrieve information from a table with known columns /****************************************************************************/ -#ifndef NamedColumnsParser_h -#define NamedColumnsParser_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -186,9 +180,3 @@ bool myAmCaseInsensitive; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryFormatter.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryFormatter.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryFormatter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryFormatter.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,239 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 BinaryFormatter.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date 2012 -/// -// Static storage of an output device and its base (abstract) implementation -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#ifdef HAVE_VERSION_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include "BinaryFormatter.h" - - -// =========================================================================== -// member method definitions -// =========================================================================== -BinaryFormatter::BinaryFormatter() { -} - - -void -BinaryFormatter::writeStaticHeader(std::ostream& into) { - FileHelpers::writeByte(into, BF_BYTE); - FileHelpers::writeByte(into, 2); - FileHelpers::writeByte(into, BF_STRING); - FileHelpers::writeString(into, VERSION_STRING); - writeStringList(into, SUMOXMLDefinitions::Tags.getStrings()); - writeStringList(into, SUMOXMLDefinitions::Attrs.getStrings()); - writeStringList(into, SUMOXMLDefinitions::NodeTypes.getStrings()); - writeStringList(into, SUMOXMLDefinitions::EdgeFunctions.getStrings()); -} - - -void -BinaryFormatter::writeStringList(std::ostream& into, const std::vector& list) { - FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, (int)list.size()); - for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) { - FileHelpers::writeByte(into, BF_STRING); - FileHelpers::writeString(into, *it); - } -} - - -bool -BinaryFormatter::writeXMLHeader(std::ostream& into, - const std::string& rootElement, - const std::map& attrs) { - if (myXMLStack.empty()) { - writeStaticHeader(into); - writeStringList(into, std::vector()); - writeStringList(into, std::vector()); - if (SUMOXMLDefinitions::Tags.hasString(rootElement)) { - openTag(into, rootElement); - for (std::map::const_iterator it = attrs.begin(); it != attrs.end(); ++it) { - writeAttr(into, it->first, it->second); - } - return true; - } - } - return false; -} - - -void -BinaryFormatter::openTag(std::ostream& into, const std::string& xmlElement) { - if (SUMOXMLDefinitions::Tags.hasString(xmlElement)) { - openTag(into, (const SumoXMLTag)(SUMOXMLDefinitions::Tags.get(xmlElement))); - } -} - - -void -BinaryFormatter::openTag(std::ostream& into, const SumoXMLTag& xmlElement) { - myXMLStack.push_back(xmlElement); - FileHelpers::writeByte(into, BF_XML_TAG_START); - const int tagNum = (int)xmlElement; - FileHelpers::writeByte(into, static_cast(tagNum % 256)); - FileHelpers::writeByte(into, static_cast(tagNum / 256)); -} - - -bool -BinaryFormatter::closeTag(std::ostream& into, const std::string& /*comment*/) { - if (!myXMLStack.empty()) { - FileHelpers::writeByte(into, BF_XML_TAG_END); - myXMLStack.pop_back(); - return true; - } - return false; -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const bool& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_BYTE); - FileHelpers::writeByte(into, val); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const double& val) { - if (into.precision() == 2 && val < 2e7 && val > -2e7) { // 2e7 is roughly INT_MAX/100 - BinaryFormatter::writeAttrHeader(into, attr, BF_SCALED2INT); - FileHelpers::writeInt(into, int(val * 100. + .5)); - } else { - BinaryFormatter::writeAttrHeader(into, attr, BF_FLOAT); - FileHelpers::writeFloat(into, val); - } -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const int& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_INTEGER); - FileHelpers::writeInt(into, val); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLNodeType& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_NODE_TYPE); - FileHelpers::writeByte(into, static_cast(val)); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLEdgeFunc& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_EDGE_FUNCTION); - FileHelpers::writeByte(into, static_cast(val)); -} - - -void BinaryFormatter::writePosition(std::ostream& into, const Position& val) { - if (val.z() != 0.) { - if (into.precision() == 2 && val.x() < 2e7 && val.x() > -2e7 && - val.y() < 2e7 && val.y() > -2e7 && val.z() < 2e7 && val.z() > -2e7) { // 2e7 is roughly INT_MAX/100 - FileHelpers::writeByte(into, BF_SCALED2INT_POSITION_3D); - FileHelpers::writeInt(into, int(val.x() * 100. + .5)); - FileHelpers::writeInt(into, int(val.y() * 100. + .5)); - FileHelpers::writeInt(into, int(val.z() * 100. + .5)); - } else { - FileHelpers::writeByte(into, BF_POSITION_3D); - FileHelpers::writeFloat(into, val.x()); - FileHelpers::writeFloat(into, val.y()); - FileHelpers::writeFloat(into, val.z()); - } - } else { - if (into.precision() == 2 && val.x() < 2e7 && val.x() > -2e7 && - val.y() < 2e7 && val.y() > -2e7) { // 2e7 is roughly INT_MAX/100 - FileHelpers::writeByte(into, BF_SCALED2INT_POSITION_2D); - FileHelpers::writeInt(into, int(val.x() * 100. + .5)); - FileHelpers::writeInt(into, int(val.y() * 100. + .5)); - } else { - FileHelpers::writeByte(into, BF_POSITION_2D); - FileHelpers::writeFloat(into, val.x()); - FileHelpers::writeFloat(into, val.y()); - } - } -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Position& val) { - BinaryFormatter::writeAttrHeader(into, attr); - writePosition(into, val); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const PositionVector& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_LIST); - FileHelpers::writeInt(into, static_cast(val.size())); - for (PositionVector::const_iterator pos = val.begin(); pos != val.end(); ++pos) { - writePosition(into, *pos); - } -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Boundary& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_BOUNDARY); - FileHelpers::writeFloat(into, val.xmin()); - FileHelpers::writeFloat(into, val.ymin()); - FileHelpers::writeFloat(into, val.xmax()); - FileHelpers::writeFloat(into, val.ymax()); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const RGBColor& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_COLOR); - FileHelpers::writeByte(into, val.red()); - FileHelpers::writeByte(into, val.green()); - FileHelpers::writeByte(into, val.blue()); - FileHelpers::writeByte(into, val.alpha()); -} - - -template<> -void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr /* attr */, const std::vector& val) { - FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, (int)val.size()); - for (std::vector::const_iterator it = val.begin(); it != val.end(); ++it) { - FileHelpers::writeByte(into, BF_INTEGER); - FileHelpers::writeInt(into, *it); - } -} - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryFormatter.h sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryFormatter.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryFormatter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryFormatter.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,336 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 BinaryFormatter.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date 2012 -/// -// Output formatter for plain XML output -/****************************************************************************/ -#ifndef BinaryFormatter_h -#define BinaryFormatter_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include "OutputFormatter.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class Position; -class PositionVector; -class Boundary; -class RGBColor; -class ROEdge; -class MSEdge; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class BinaryFormatter - * @brief Output formatter for plain XML output - * - * BinaryFormatter format XML like output into the output stream. - */ -class BinaryFormatter : public OutputFormatter { -public: - /// @brief data types in binary output - enum DataType { - /// @brief - BF_BYTE, - /// @brief - BF_INTEGER, - /// @brief - BF_FLOAT, - /// @brief - BF_STRING, - /// @brief - BF_LIST, - /// @brief - BF_XML_TAG_START, - /// @brief - BF_XML_TAG_END, - /// @brief - BF_XML_ATTRIBUTE, - /// @brief - BF_EDGE, - /// @brief - BF_LANE, - /// @brief - BF_POSITION_2D, - /// @brief - BF_POSITION_3D, - /// @brief - BF_BOUNDARY, - /// @brief - BF_COLOR, - /// @brief - BF_NODE_TYPE, - /// @brief - BF_EDGE_FUNCTION, - /// @brief - BF_ROUTE, - /// @brief - BF_SCALED2INT, - /// @brief - BF_SCALED2INT_POSITION_2D, - /// @brief - BF_SCALED2INT_POSITION_3D, - /// @brief - BF_INVALID - }; - - /// @brief Constructor - BinaryFormatter(); - - - /// @brief Destructor - virtual ~BinaryFormatter() { } - - - /** @brief Writes an XML header with optional configuration - * - * If something has been written (myXMLStack is not empty), nothing - * is written and false returned. - * - * @param[in] into The output stream to use - * @param[in] rootElement The root element to use - * @param[in] attrs Additional attributes to save within the rootElement - * @todo Describe what is saved - */ - bool writeXMLHeader(std::ostream& into, const std::string& rootElement, - const std::map& attrs); - - - /** @brief Writes a header with optional edge list and connections. - * - * If something has been written (myXMLStack is not empty), nothing - * is written and false returned. This header is only used by the binary formatter. - * - * @param[in] into The output stream to use - * @param[in] rootElement The root element to use - */ - template - bool writeHeader(std::ostream& into, const SumoXMLTag& rootElement); - - - /** @brief Opens an XML tag - * - * An indentation, depending on the current xml-element-stack size, is written followed - * by the given xml element ("<" + xmlElement) - * The xml element is added to the stack, then. - * - * @param[in] into The output stream to use - * @param[in] xmlElement Name of element to open - * @returns The OutputDevice for further processing - */ - void openTag(std::ostream& into, const std::string& xmlElement); - - - /** @brief Opens an XML tag - * - * Helper method which finds the correct string before calling openTag. - * - * @param[in] into The output stream to use - * @param[in] xmlElement Id of the element to open - */ - void openTag(std::ostream& into, const SumoXMLTag& xmlElement); - - - /** @brief Closes the most recently opened tag - * - * @param[in] into The output stream to use - * @returns Whether a further element existed in the stack and could be closed - * @todo it is not verified that the topmost element was closed - */ - bool closeTag(std::ostream& into, const std::string& comment = ""); - - - /** @brief writes an arbitrary attribute - * - * @param[in] into The output stream to use - * @param[in] attr The attribute (name) - * @param[in] val The attribute value - */ - template - static void writeAttr(dummy& into, const SumoXMLAttr attr, const T& val); - - - /** @brief writes a named attribute - * - * @param[in] into The output stream to use - * @param[in] attr The attribute (name) - * @param[in] val The attribute value - */ - template - static void writeAttr(dummy& into, const std::string& attr, const T& val); - - - /** @brief writes a preformatted tag to the device but ensures that any - * pending tags are closed - * @param[in] into The output stream to use - * @param[in] val The preformatted data - */ - void writePreformattedTag(std::ostream& into, const std::string& val) { - FileHelpers::writeString(into, val); - } - - /// @brief padding is ignored for binary output - void writePadding(std::ostream& /*into*/, const std::string&) { } - - - /* we need to use dummy templating here to compile those functions where they get - called to avoid an explicit dependency of utils/iodevices on the edge implementations */ - template - static void writeAttr(dummy& into, const SumoXMLAttr attr, const std::vector& val); - template - static void writeAttr(dummy& into, const SumoXMLAttr attr, const std::vector& val); - - -private: - /** @brief writes the header for an arbitrary attribute - * - * @param[in] into The output stream to use - * @param[in] attr The attribute (name) - * @param[in] type The attribute type - */ - static inline void writeAttrHeader(std::ostream& into, const SumoXMLAttr attr, const DataType type = BF_INVALID) { - FileHelpers::writeByte(into, static_cast(BF_XML_ATTRIBUTE)); - const int attrNum = (int)attr; - FileHelpers::writeByte(into, static_cast(attrNum % 256)); - FileHelpers::writeByte(into, static_cast(attrNum / 256)); - if (type != BF_INVALID) { - FileHelpers::writeByte(into, static_cast(type)); - } - } - - - /** @brief writes the part of the header which is always unchanged. - * - * This method exists only to reduce include dependencies of BinaryFormatter.h (which promote to OutputDevice.h, ...) - * - * @param[in] into The output stream to use - */ - static void writeStaticHeader(std::ostream& into); - - - /** @brief writes a list of strings - * - * @param[in] into The output stream to use - * @param[in] list the list to write - */ - static void writeStringList(std::ostream& into, const std::vector& list); - - - /** @brief writes a position - * - * @param[in] into The output stream to use - * @param[in] val the position to write - */ - static void writePosition(std::ostream& into, const Position& val); - - -private: - /// @brief The stack of begun xml elements - std::vector myXMLStack; - - -}; - - -template -bool BinaryFormatter::writeHeader(std::ostream& into, const SumoXMLTag& rootElement) { - if (myXMLStack.empty()) { - writeStaticHeader(into); - const int numEdges = (const int)E::getAllEdges().size(); - FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, numEdges); - for (int i = 0; i < numEdges; i++) { - FileHelpers::writeByte(into, BF_STRING); - FileHelpers::writeString(into, E::getAllEdges()[i]->getID()); - } - FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, numEdges); - for (int i = 0; i < numEdges; i++) { - E* e = E::getAllEdges()[i]; - FileHelpers::writeByte(into, BF_LIST); - FileHelpers::writeInt(into, e->getNumSuccessors()); - for (int j = 0; j < e->getNumSuccessors(); j++) { - FileHelpers::writeByte(into, BF_INTEGER); - FileHelpers::writeInt(into, e->getSuccessors()[j]->getNumericalID()); - } - } - openTag(into, rootElement); - return true; - } - return false; -} - - -template -void BinaryFormatter::writeAttr(dummy& into, const SumoXMLAttr attr, const T& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_STRING); - FileHelpers::writeString(into, toString(val, into.precision())); -} - - -template -void BinaryFormatter::writeAttr(dummy& into, const std::string& attr, const T& val) { - if (SUMOXMLDefinitions::Attrs.hasString(attr)) { - writeAttr(into, (const SumoXMLAttr)(SUMOXMLDefinitions::Attrs.get(attr)), val); - } -} - -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const bool& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const double& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const int& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLNodeType& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const SumoXMLEdgeFunc& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Position& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const PositionVector& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const Boundary& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const RGBColor& val); -template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const std::vector& val); -//template<> void BinaryFormatter::writeAttr(std::ostream& into, const SumoXMLAttr attr, const std::vector& val); - - -template -void BinaryFormatter::writeAttr(dummy& into, const SumoXMLAttr attr, const std::vector& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_ROUTE); - FileHelpers::writeEdgeVector(into, val); -} - - -template -void BinaryFormatter::writeAttr(dummy& into, const SumoXMLAttr attr, const std::vector& val) { - BinaryFormatter::writeAttrHeader(into, attr, BF_ROUTE); - FileHelpers::writeEdgeVector(into, val); -} - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryInputDevice.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryInputDevice.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryInputDevice.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryInputDevice.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,227 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 BinaryInputDevice.cpp -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @date 2005-09-15 -/// -// Encapsulates binary reading operations on a file -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include "BinaryFormatter.h" -#include "BinaryInputDevice.h" - -// =========================================================================== -// constants definitions -// =========================================================================== -#define BUF_MAX 10000 - - -// =========================================================================== -// method definitions -// =========================================================================== -BinaryInputDevice::BinaryInputDevice(const std::string& name, - const bool isTyped, const bool doValidate) - : myStream(name.c_str(), std::fstream::in | std::fstream::binary), - myAmTyped(isTyped), myEnableValidation(doValidate) {} - - -BinaryInputDevice::~BinaryInputDevice() {} - - -bool -BinaryInputDevice::good() const { - return myStream.good(); -} - - -int -BinaryInputDevice::peek() { - return myStream.peek(); -} - - -std::string -BinaryInputDevice::read(int numBytes) { - myStream.read((char*) &myBuffer, sizeof(char)*numBytes); - return std::string(myBuffer, numBytes); -} - - -void -BinaryInputDevice::putback(char c) { - myStream.putback(c); -} - - -int -BinaryInputDevice::checkType(BinaryFormatter::DataType t) { - if (myAmTyped) { - char c; - myStream.read(&c, sizeof(char)); - if (myEnableValidation && c != t) { - throw ProcessError("Unexpected type."); - } - return c; - } - return -1; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, char& c) { - os.checkType(BinaryFormatter::BF_BYTE); - os.myStream.read(&c, sizeof(char)); - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, unsigned char& c) { - os.checkType(BinaryFormatter::BF_BYTE); - os.myStream.read((char*) &c, sizeof(unsigned char)); - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, int& i) { - os.checkType(BinaryFormatter::BF_INTEGER); - os.myStream.read((char*) &i, sizeof(int)); - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, double& f) { - int t = os.checkType(BinaryFormatter::BF_FLOAT); - if (t == BinaryFormatter::BF_SCALED2INT) { - int v; - os.myStream.read((char*) &v, sizeof(int)); - f = v / 100.; - } else { - os.myStream.read((char*) &f, sizeof(double)); - } - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, bool& b) { - os.checkType(BinaryFormatter::BF_BYTE); - b = false; - os.myStream.read((char*) &b, sizeof(char)); - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, std::string& s) { - os.checkType(BinaryFormatter::BF_STRING); - int size; - os.myStream.read((char*) &size, sizeof(int)); - int done = 0; - while (done < size) { - const int toRead = MIN2((int)size - done, (int)BUF_MAX - 1); - os.myStream.read((char*) &os.myBuffer, sizeof(char)*toRead); - os.myBuffer[toRead] = 0; - s += std::string(os.myBuffer); - done += toRead; - } - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, std::vector& v) { - os.checkType(BinaryFormatter::BF_LIST); - int size; - os.myStream.read((char*) &size, sizeof(int)); - while (size > 0) { - std::string s; - os >> s; - v.push_back(s); - size--; - } - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, std::vector& v) { - os.checkType(BinaryFormatter::BF_LIST); - int size; - os.myStream.read((char*) &size, sizeof(int)); - while (size > 0) { - int i; - os >> i; - v.push_back(i); - size--; - } - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, std::vector< std::vector >& v) { - os.checkType(BinaryFormatter::BF_LIST); - int size; - os.myStream.read((char*) &size, sizeof(int)); - while (size > 0) { - std::vector nested; - os >> nested; - v.push_back(nested); - size--; - } - return os; -} - - -BinaryInputDevice& -operator>>(BinaryInputDevice& os, Position& p) { - int t = os.checkType(BinaryFormatter::BF_POSITION_2D); - double x, y, z = 0; - if (t == BinaryFormatter::BF_SCALED2INT_POSITION_2D || t == BinaryFormatter::BF_SCALED2INT_POSITION_2D) { - int v; - os.myStream.read((char*) &v, sizeof(int)); - x = v / 100.; - os.myStream.read((char*) &v, sizeof(int)); - y = v / 100.; - if (t == BinaryFormatter::BF_SCALED2INT_POSITION_3D) { - os.myStream.read((char*) &v, sizeof(int)); - z = v / 100.; - } - } else { - os.myStream.read((char*) &x, sizeof(double)); - os.myStream.read((char*) &y, sizeof(double)); - if (t == BinaryFormatter::BF_POSITION_3D) { - os.myStream.read((char*) &z, sizeof(double)); - } - } - p.set(x, y, z); - return os; -} - - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryInputDevice.h sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryInputDevice.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/BinaryInputDevice.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/BinaryInputDevice.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,237 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2005-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 BinaryInputDevice.h -/// @author Daniel Krajzewicz -/// @author Michael Behrisch -/// @author Jakob Erdmann -/// @date 2005-09-15 -/// -// Encapsulates binary reading operations on a file -/****************************************************************************/ -#ifndef BinaryInputDevice_h -#define BinaryInputDevice_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include "BinaryFormatter.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class BinaryInputDevice; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class BinaryInputDevice - * @brief Encapsulates binary reading operations on a file - * - * This class opens a binary file stream for reading and offers read access - * functions on it. - * - * Please note that the byte order is undefined. Also the length of each - * type is not defined on a global scale and may differ across compilers or - * platforms. - * - * @todo Recheck whether this class could be replaced by a "normal InputDevice" - * @todo Maybe some kind of a well-defined types should be used (so that they have a well-defined length) - * @todo Maybe the byte-order should be defined - */ -class BinaryInputDevice { -public: - /** @brief Constructor - * - * @param[in] name The name of the file to open for reading - */ - BinaryInputDevice(const std::string& name, const bool isTyped = false, const bool doValidate = false); - - - /// @brief Destructor - ~BinaryInputDevice(); - - - /** @brief Returns whether the underlying file stream can be used (is good()) - * - * @return Whether the file is good - */ - bool good() const; - - - /** @brief Returns the next character to be read by an actual parse. - * - * @return the next character which will be returned - */ - int peek(); - - - /** @brief Reads the defined number of bytes and returns them as a string. - * - * @param[in] numBytes The number of bytes to read - * @return the string read - */ - std::string read(int numBytes); - - - /** @brief Pushes a character back into the stream to be read by the next actual parse. - * - * @param[in] c The char to store in the stream - */ - void putback(char c); - - - /** @brief Reads a char from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the char from - * @param[in] c The char to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, char& c); - - - /** @brief Reads an unsigned char from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the char from - * @param[in] c The char to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, unsigned char& c); - - - /** @brief Reads an int from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the int from - * @param[in] i The int to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, int& i); - - - /** @brief Reads a double from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the double from - * @param[in] i The double to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, double& f); - - - /** @brief Reads a bool from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the bool from - * @param[in] i The bool to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, bool& b); - - - /** @brief Reads a string from the file (input operator) - * - * Reads the length of the string as an int, first. - * Reads then the specified number of chars into "myBuffer". - * Please note that the buffer has a fixed size - longer strings - * will cause an error. - * - * @param[in, out] os The BinaryInputDevice to read the string from - * @param[in] s The string to store the read value into - * @return The used BinaryInputDevice for further processing - * @todo Use either a buffer with a flexible size or report an error if the buffer is too small! - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, std::string& s); - - - /** @brief Reads a string vector from the file (input operator) - * - * Reads the length of the vector as an int, first. - * Reads then the specified number of strings using the string input operator. - * Please note that the buffer has a fixed size - longer strings - * will cause an error. - * - * @param[in, out] os The BinaryInputDevice to read the string from - * @param[in] v The string vector to store the read value into - * @return The used BinaryInputDevice for further processing - * @todo Use either a buffer with a flexible size or report an error if the buffer is too small! - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, std::vector& v); - - - /** @brief Reads a string vector from the file (input operator) - * - * Reads the length of the vector as an int, first. - * Reads then the specified number of strings using the string input operator. - * Please note that the buffer has a fixed size - longer strings - * will cause an error. - * - * @param[in, out] os The BinaryInputDevice to read the string from - * @param[in] v The string vector to store the read value into - * @return The used BinaryInputDevice for further processing - * @todo Use either a buffer with a flexible size or report an error if the buffer is too small! - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, std::vector& v); - - - /** @brief Reads a string vector from the file (input operator) - * - * Reads the length of the vector as an int, first. - * Reads then the specified number of strings using the string input operator. - * Please note that the buffer has a fixed size - longer strings - * will cause an error. - * - * @param[in, out] os The BinaryInputDevice to read the string from - * @param[in] v The string vector to store the read value into - * @return The used BinaryInputDevice for further processing - * @todo Use either a buffer with a flexible size or report an error if the buffer is too small! - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, std::vector< std::vector >& v); - - - /** @brief Reads a Position from the file (input operator) - * - * @param[in, out] os The BinaryInputDevice to read the Position from - * @param[in] p The Position to store the read value into - * @return The used BinaryInputDevice for further processing - */ - friend BinaryInputDevice& operator>>(BinaryInputDevice& os, Position& p); - -private: - int checkType(BinaryFormatter::DataType t); - -private: - /// @brief The encapsulated stream - std::ifstream myStream; - - const bool myAmTyped; - - /// @brief Information whether types shall be checked - const bool myEnableValidation; - - /// @brief The buffer used for string parsing - char myBuffer[10000]; - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/CMakeLists.txt sumo-1.6.0+dfsg1/src/utils/iodevices/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/utils/iodevices/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -1,10 +1,6 @@ set(utils_iodevices_STAT_SRCS OutputDevice.cpp OutputDevice.h - BinaryFormatter.cpp - BinaryFormatter.h - BinaryInputDevice.cpp - BinaryInputDevice.h OutputDevice_CERR.cpp OutputDevice_CERR.h OutputDevice_COUT.cpp diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // An output device that encapsulates cout /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_CERR.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An output device that encapsulates cerr /****************************************************************************/ -#ifndef OutputDevice_CERR_h -#define OutputDevice_CERR_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "OutputDevice.h" @@ -81,9 +75,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // An output device that encapsulates cout /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_COUT.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An output device that encapsulates cout /****************************************************************************/ -#ifndef OutputDevice_COUT_h -#define OutputDevice_COUT_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "OutputDevice.h" @@ -81,9 +75,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -92,7 +87,7 @@ } name2 = FileHelpers::prependToLastPathComponent(prefix, name); } - dev = new OutputDevice_File(name2, len > 4 && name.substr(len - 4) == ".sbx", len > 3 && name.substr(len - 3) == ".gz"); + dev = new OutputDevice_File(name2, len > 3 && name.substr(len - 3) == ".gz"); } dev->setPrecision(); dev->getOStream() << std::setiosflags(std::ios::fixed); @@ -180,14 +175,9 @@ // =========================================================================== // member method definitions // =========================================================================== -OutputDevice::OutputDevice(const bool binary, const int defaultIndentation, const std::string& filename) : - myAmBinary(binary), +OutputDevice::OutputDevice(const int defaultIndentation, const std::string& filename) : myFilename(filename) { - if (binary) { - myFormatter = new BinaryFormatter(); - } else { - myFormatter = new PlainXMLFormatter(defaultIndentation); - } + myFormatter = new PlainXMLFormatter(defaultIndentation); } @@ -279,4 +269,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_File.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_File.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_File.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_File.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // An output device that encapsulates an ofstream /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -39,8 +34,8 @@ // =========================================================================== // method definitions // =========================================================================== -OutputDevice_File::OutputDevice_File(const std::string& fullName, const bool binary, const bool compressed) - : OutputDevice(binary, 0, fullName), myFileStream(nullptr) { +OutputDevice_File::OutputDevice_File(const std::string& fullName, const bool compressed) + : OutputDevice(0, fullName), myFileStream(nullptr) { #ifdef WIN32 if (fullName == "/dev/null") { myFileStream = new std::ofstream("NUL"); @@ -54,12 +49,12 @@ #ifdef HAVE_ZLIB if (compressed) { try { - myFileStream = new zstr::ofstream(fullName.c_str(), binary ? std::ios::binary : std::ios_base::out); + myFileStream = new zstr::ofstream(fullName.c_str(), std::ios_base::out); } catch (zstr::Exception& e) { throw IOError("Could not build output file '" + fullName + "' (" + e.what() + ")."); } } else { - myFileStream = new std::ofstream(fullName.c_str(), binary ? std::ios::binary : std::ios_base::out); + myFileStream = new std::ofstream(fullName.c_str(), std::ios_base::out); } #else UNUSED_PARAMETER(compressed); @@ -84,4 +79,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_File.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_File.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_File.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_File.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // An output device that encapsulates an ofstream /****************************************************************************/ -#ifndef OutputDevice_File_h -#define OutputDevice_File_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -44,10 +38,11 @@ class OutputDevice_File : public OutputDevice { public: /** @brief Constructor - * @param[in] strm The output stream to used + * @param[in] fullName The name of the output file to use + * @param[in] compressed whether to apply gzip compression * @exception IOError Should not be thrown by this implementation */ - OutputDevice_File(const std::string& fullName, const bool binary, const bool compressed = false); + OutputDevice_File(const std::string& fullName, const bool compressed = false); /// @brief Destructor @@ -70,9 +65,3 @@ std::ostream* myFileStream; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ -#ifndef OutputDevice_h -#define OutputDevice_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -34,7 +28,6 @@ #include #include #include "PlainXMLFormatter.h" -#include "BinaryFormatter.h" // =========================================================================== @@ -140,7 +133,7 @@ /// @{ /// @brief Constructor - OutputDevice(const bool binary = false, const int defaultIndentation = 0, const std::string& filename = ""); + OutputDevice(const int defaultIndentation = 0, const std::string& filename = ""); /// @brief Destructor @@ -189,9 +182,6 @@ template bool writeHeader(const SumoXMLTag& rootElement) { - if (myAmBinary) { - return static_cast(myFormatter)->writeHeader(getOStream(), rootElement); - } return static_cast(myFormatter)->writeHeader(getOStream(), rootElement); } @@ -235,17 +225,7 @@ /** @brief writes a line feed if applicable */ void lf() { - if (!myAmBinary) { - getOStream() << "\n"; - } - } - - - /** @brief Returns whether we have a binary output - * @return whether we have a binary output - */ - bool isBinary() const { - return myAmBinary; + getOStream() << "\n"; } @@ -257,11 +237,7 @@ */ template OutputDevice& writeAttr(const SumoXMLAttr attr, const T& val) { - if (myAmBinary) { - BinaryFormatter::writeAttr(getOStream(), attr, val); - } else { - PlainXMLFormatter::writeAttr(getOStream(), attr, val); - } + PlainXMLFormatter::writeAttr(getOStream(), attr, val); return *this; } @@ -274,11 +250,7 @@ */ template OutputDevice& writeAttr(const std::string& attr, const T& val) { - if (myAmBinary) { - BinaryFormatter::writeAttr(getOStream(), attr, val); - } else { - PlainXMLFormatter::writeAttr(getOStream(), attr, val); - } + PlainXMLFormatter::writeAttr(getOStream(), attr, val); return *this; } @@ -357,8 +329,6 @@ /// @brief The formatter for XML OutputFormatter* myFormatter; - const bool myAmBinary; - protected: std::string myFilename; @@ -372,9 +342,3 @@ OutputDevice& operator=(const OutputDevice&); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_Network.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_Network.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_Network.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_Network.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An output device for TCP/IP Network connections /****************************************************************************/ -#ifndef OutputDevice_Network_h -#define OutputDevice_Network_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include // #ifdef _MSC_VER #include "foreign/tcpip/socket.h" @@ -97,8 +91,3 @@ tcpip::Socket* mySocket; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_String.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_String.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_String.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_String.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // An output device that encapsulates a stringstream /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -32,8 +27,8 @@ // =========================================================================== // method definitions // =========================================================================== -OutputDevice_String::OutputDevice_String(const bool binary, const int defaultIndentation) - : OutputDevice(binary, defaultIndentation) { +OutputDevice_String::OutputDevice_String(const int defaultIndentation) + : OutputDevice(defaultIndentation) { setPrecision(); myStream << std::setiosflags(std::ios::fixed); } diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_String.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_String.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputDevice_String.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputDevice_String.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // An output device that encapsulates a stringstream /****************************************************************************/ -#ifndef OutputDevice_String_h -#define OutputDevice_String_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -45,7 +39,7 @@ /** @brief Constructor * @exception IOError Should not be thrown by this implementation */ - OutputDevice_String(const bool binary = false, const int defaultIndentation = 0); + OutputDevice_String(const int defaultIndentation = 0); /// @brief Destructor @@ -73,9 +67,3 @@ std::ostringstream myStream; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/OutputFormatter.h sumo-1.6.0+dfsg1/src/utils/iodevices/OutputFormatter.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/OutputFormatter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/OutputFormatter.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Abstract base class for output formatters /****************************************************************************/ -#ifndef OutputFormatter_h -#define OutputFormatter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -109,9 +103,3 @@ virtual void writePadding(std::ostream& into, const std::string& val) = 0; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.cpp sumo-1.6.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.cpp --- sumo-1.5.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Static storage of an output device and its base (abstract) implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -114,5 +109,5 @@ into << val; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.h sumo-1.6.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.h --- sumo-1.5.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/iodevices/PlainXMLFormatter.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Output formatter for plain XML output /****************************************************************************/ -#ifndef PlainXMLFormatter_h -#define PlainXMLFormatter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "OutputFormatter.h" @@ -152,9 +146,3 @@ /// @brief whether a closing ">" might be missing bool myHavePendingOpener; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/Option.cpp sumo-1.6.0+dfsg1/src/utils/options/Option.cpp --- sumo-1.5.0+dfsg1/src/utils/options/Option.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/Option.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A class representing a single program option /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -610,4 +605,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/Option.h sumo-1.6.0+dfsg1/src/utils/options/Option.h --- sumo-1.5.0+dfsg1/src/utils/options/Option.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/Option.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Classes representing a single program option (with different types) /****************************************************************************/ -#ifndef Option_h -#define Option_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -832,7 +826,3 @@ */ std::string getValueString() const; }; -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsCont.cpp sumo-1.6.0+dfsg1/src/utils/options/OptionsCont.cpp --- sumo-1.5.0+dfsg1/src/utils/options/OptionsCont.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsCont.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,9 +20,6 @@ /// // A storage for options (typed value containers) /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsCont.h sumo-1.6.0+dfsg1/src/utils/options/OptionsCont.h --- sumo-1.5.0+dfsg1/src/utils/options/OptionsCont.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsCont.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,7 @@ /// // A storage for options (typed value containers) /****************************************************************************/ -#ifndef OptionsCont_h -#define OptionsCont_h -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -766,9 +762,3 @@ OptionsCont& operator=(const OptionsCont& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsIO.cpp sumo-1.6.0+dfsg1/src/utils/options/OptionsIO.cpp --- sumo-1.5.0+dfsg1/src/utils/options/OptionsIO.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsIO.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -80,7 +75,9 @@ if (myArgC == 2 && myArgV[1][0] != '-') { // special case only one parameter, check who can handle it if (OptionsCont::getOptions().setByRootElement(getRoot(myArgV[1]), myArgV[1])) { - loadConfiguration(); + if (!commandLineOnly) { + loadConfiguration(); + } return; } } @@ -91,12 +88,7 @@ } if (!commandLineOnly || OptionsCont::getOptions().isSet("save-configuration", false)) { // read the configuration when everything's ok - OptionsCont::getOptions().resetWritable(); loadConfiguration(); - // reparse the options - // (overwrite the settings from the configuration file) - OptionsCont::getOptions().resetWritable(); - OptionsParser::parse(myArgC, myArgV); } } @@ -107,11 +99,12 @@ if (!oc.exists("configuration-file") || !oc.isSet("configuration-file")) { return; } - std::string path = oc.getString("configuration-file"); + const std::string path = oc.getString("configuration-file"); if (!FileHelpers::isReadable(path)) { throw ProcessError("Could not access configuration '" + oc.getString("configuration-file") + "'."); } PROGRESS_BEGIN_MESSAGE("Loading configuration"); + oc.resetWritable(); // build parser XERCES_CPP_NAMESPACE::SAXParser parser; parser.setValidationScheme(XERCES_CPP_NAMESPACE::SAXParser::Val_Auto); @@ -130,6 +123,11 @@ throw ProcessError("Could not load configuration '" + path + "':\n " + StringUtils::transcode(e.getMessage())); } oc.relocateFiles(path); + if (myArgC > 2) { + // reparse the options (overwrite the settings from the configuration file) + oc.resetWritable(); + OptionsParser::parse(myArgC, myArgV); + } PROGRESS_DONE_MESSAGE(); } @@ -159,4 +157,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsIO.h sumo-1.6.0+dfsg1/src/utils/options/OptionsIO.h --- sumo-1.5.0+dfsg1/src/utils/options/OptionsIO.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsIO.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Helper for parsing command line arguments and reading configuration files /****************************************************************************/ -#ifndef OptionsIO_h -#define OptionsIO_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -95,7 +89,6 @@ static void loadConfiguration(); -private: /** @brief Retrieves the XML root element of a supposed configuration or net * * @param[in] filename the XML file to parse @@ -109,9 +102,3 @@ static char** myArgV; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsLoader.cpp sumo-1.6.0+dfsg1/src/utils/options/OptionsLoader.cpp --- sumo-1.5.0+dfsg1/src/utils/options/OptionsLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // A SAX-Handler for loading options /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -159,6 +154,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsLoader.h sumo-1.6.0+dfsg1/src/utils/options/OptionsLoader.h --- sumo-1.5.0+dfsg1/src/utils/options/OptionsLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A SAX-Handler for loading options /****************************************************************************/ -#ifndef OptionsLoader_h -#define OptionsLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -176,9 +170,3 @@ std::string myValue; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsParser.cpp sumo-1.6.0+dfsg1/src/utils/options/OptionsParser.cpp --- sumo-1.5.0+dfsg1/src/utils/options/OptionsParser.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsParser.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Parses the command line arguments /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -171,6 +166,4 @@ } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/options/OptionsParser.h sumo-1.6.0+dfsg1/src/utils/options/OptionsParser.h --- sumo-1.5.0+dfsg1/src/utils/options/OptionsParser.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/options/OptionsParser.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parses command line arguments /****************************************************************************/ -#ifndef OptionsParser_h -#define OptionsParser_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include @@ -122,9 +116,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/AccessEdge.h sumo-1.6.0+dfsg1/src/utils/router/AccessEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/AccessEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/AccessEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The AccessEdge is a special intermodal edge connecting different modes /****************************************************************************/ -#ifndef AccessEdge_h -#define AccessEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "IntermodalEdge.h" @@ -74,8 +68,3 @@ const SVCPermissions myVehicleRestriction; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/AStarLookupTable.h sumo-1.6.0+dfsg1/src/utils/router/AStarLookupTable.h --- sumo-1.5.0+dfsg1/src/utils/router/AStarLookupTable.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/AStarLookupTable.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Precomputed landmark distances to speed up the A* routing algorithm /****************************************************************************/ -#ifndef AStarLookupTable_h -#define AStarLookupTable_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -74,11 +68,11 @@ public: FullLookupTable(const std::string& filename, const int size) : myTable(size) { - BinaryInputDevice dev(filename); + std::ifstream strm(filename.c_str()); for (int i = 0; i < size; i++) { for (int j = 0; j < size; j++) { double val; - dev >> val; + strm >> val; myTable[i].push_back(val); } } @@ -414,11 +408,3 @@ return ""; } }; - - - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/AStarRouter.h sumo-1.6.0+dfsg1/src/utils/router/AStarRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/AStarRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/AStarRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ // A* Algorithm using euclidean distance heuristic. // Based on DijkstraRouter. For routing by effort a novel heuristic would be needed. /****************************************************************************/ -#ifndef AStarRouter_h -#define AStarRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -45,7 +39,6 @@ #include #include #include -#include #include #include "AStarLookupTable.h" #include "SUMOAbstractRouter.h" @@ -324,9 +317,3 @@ /// @brief maximum speed in the network double myMaxSpeed; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/CarEdge.h sumo-1.6.0+dfsg1/src/utils/router/CarEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/CarEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/CarEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The CarEdge is a special intermodal edge representing the SUMO network edge /****************************************************************************/ -#ifndef CarEdge_h -#define CarEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #ifdef HAVE_FOX @@ -104,16 +98,13 @@ } double getTravelTime(const IntermodalTrip* const trip, double time) const { - const double travelTime = E::getTravelTimeStatic(this->getEdge(), trip->vehicle, time); - double distTravelled = this->getLength(); - // checking arrivalPos first to have it correct for identical depart and arrival edge - if (this->getEdge() == trip->to) { - distTravelled = trip->arrivalPos - myStartPos; - } - if (this->getEdge() == trip->from) { - distTravelled -= trip->departPos - myStartPos; - } - return travelTime * distTravelled / this->getEdge()->getLength(); + assert(E::getTravelTimeStatic(this->getEdge(), trip->vehicle, time) >= 0.); + return getPartialTravelTime(E::getTravelTimeStatic(this->getEdge(), trip->vehicle, time), trip); + } + + double getTravelTimeAggregated(const IntermodalTrip* const trip, double time) const { + assert(E::getTravelTimeAggregated(this->getEdge(), trip->vehicle, time) >= 0.); + return getPartialTravelTime(E::getTravelTimeAggregated(this->getEdge(), trip->vehicle, time), trip); } double getStartPos() const { @@ -125,6 +116,21 @@ } private: + + inline double getPartialTravelTime(double fullTravelTime, const IntermodalTrip* const trip) const { + double distTravelled = this->getLength(); + // checking arrivalPos first to have it correct for identical depart and arrival edge + if (this->getEdge() == trip->to && trip->arrivalPos >= myStartPos && trip->arrivalPos < myStartPos + this->getLength()) { + distTravelled = trip->arrivalPos - myStartPos; + } + if (this->getEdge() == trip->from && trip->departPos >= myStartPos && trip->departPos < myStartPos + this->getLength()) { + distTravelled -= trip->departPos - myStartPos; + } + assert(fullTravelTime * distTravelled / this->getEdge()->getLength() >= 0.); + return fullTravelTime * distTravelled / this->getEdge()->getLength(); + } + +private: /// @brief the starting position for split edges const double myStartPos; @@ -139,8 +145,3 @@ mutable FXMutex myLock; #endif }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/CHBuilder.h sumo-1.6.0+dfsg1/src/utils/router/CHBuilder.h --- sumo-1.5.0+dfsg1/src/utils/router/CHBuilder.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/CHBuilder.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Contraction Hierarchy Builder for the shortest path search /****************************************************************************/ -#ifndef CHBuilder_h -#define CHBuilder_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -524,9 +518,3 @@ /// @brief Invalidated assignment operator CHBuilder& operator=(const CHBuilder& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/CHRouter.h sumo-1.6.0+dfsg1/src/utils/router/CHRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/CHRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/CHRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Shortest Path search using a Contraction Hierarchy /****************************************************************************/ -#ifndef CHRouter_h -#define CHRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -394,9 +388,3 @@ /// @brief the permissions for which the hierarchy was constructed const SUMOVehicleClass mySVC; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/CHRouterWrapper.h sumo-1.6.0+dfsg1/src/utils/router/CHRouterWrapper.h --- sumo-1.5.0+dfsg1/src/utils/router/CHRouterWrapper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/CHRouterWrapper.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Wraps multiple CHRouters for different vehicle types /****************************************************************************/ -#ifndef CHRouterWrapper_h -#define CHRouterWrapper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -127,9 +121,3 @@ const SUMOTime myWeightPeriod; const int myMaxNumInstances; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/CMakeLists.txt sumo-1.6.0+dfsg1/src/utils/router/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/utils/router/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -14,6 +14,8 @@ IntermodalNetwork.h IntermodalRouter.h IntermodalTrip.h + RailwayRouter.h + RailEdge.h EffortCalculator.h GawronCalculator.h LogitCalculator.h @@ -28,4 +30,4 @@ if (MSVC) add_custom_target(z_utils_router SOURCES ${utils_router_STAT_SRCS}) -endif() \ No newline at end of file +endif() diff -Nru sumo-1.5.0+dfsg1/src/utils/router/DijkstraRouter.h sumo-1.6.0+dfsg1/src/utils/router/DijkstraRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/DijkstraRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/DijkstraRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Dijkstra shortest path algorithm using travel time or other values /****************************************************************************/ -#ifndef DijkstraRouter_h -#define DijkstraRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -291,8 +285,3 @@ EdgeInfoByEffortComparator myComparator; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/EffortCalculator.h sumo-1.6.0+dfsg1/src/utils/router/EffortCalculator.h --- sumo-1.5.0+dfsg1/src/utils/router/EffortCalculator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/EffortCalculator.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The EffortCalculator is an interface for additional edge effort calculators /****************************************************************************/ -#ifndef EffortCalculator_h -#define EffortCalculator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -56,8 +50,3 @@ virtual std::string output(const int edge) const = 0; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/FareModul.h sumo-1.6.0+dfsg1/src/utils/router/FareModul.h --- sumo-1.5.0+dfsg1/src/utils/router/FareModul.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/FareModul.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,12 +17,7 @@ /// // Fare Modul for calculating prices during intermodal routing /****************************************************************************/ -#ifndef SUMO_FAREMODUL_H -#define SUMO_FAREMODUL_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -561,4 +556,3 @@ }; -#endif //SUMO_FAREMODUL_H diff -Nru sumo-1.5.0+dfsg1/src/utils/router/FareToken.h sumo-1.6.0+dfsg1/src/utils/router/FareToken.h --- sumo-1.5.0+dfsg1/src/utils/router/FareToken.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/FareToken.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,8 +18,7 @@ // Fare Modul for calculating prices during intermodal routing /****************************************************************************/ -#ifndef SUMO_FARETOKEN_H -#define SUMO_FARETOKEN_H +#pragma once enum class FareToken : int { None = 0, Free = 1, // walking and other things can be free @@ -206,4 +205,3 @@ } } -#endif //SUMO_FARETOKEN_H diff -Nru sumo-1.5.0+dfsg1/src/utils/router/FareZones.h sumo-1.6.0+dfsg1/src/utils/router/FareZones.h --- sumo-1.5.0+dfsg1/src/utils/router/FareZones.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/FareZones.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,12 +18,7 @@ // Fare Modul for calculating prices during intermodal routing /****************************************************************************/ -#ifndef SUMO_FAREZONES_H -#define SUMO_FAREZONES_H - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -209,4 +204,3 @@ } } -#endif //SUMO_FAREZONES_H diff -Nru sumo-1.5.0+dfsg1/src/utils/router/GawronCalculator.h sumo-1.6.0+dfsg1/src/utils/router/GawronCalculator.h --- sumo-1.5.0+dfsg1/src/utils/router/GawronCalculator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/GawronCalculator.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Calculators for route costs and probabilities /****************************************************************************/ -#ifndef GawronCalculator_h -#define GawronCalculator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,7 +109,3 @@ GawronCalculator& operator=(const GawronCalculator& s); }; -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/IntermodalEdge.h sumo-1.6.0+dfsg1/src/utils/router/IntermodalEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/IntermodalEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/IntermodalEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The Edge definition for the Intermodal Router /****************************************************************************/ -#ifndef IntermodalEdge_h -#define IntermodalEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,6 +109,10 @@ return 0.; } + virtual double getTravelTimeAggregated(const IntermodalTrip* const trip, double time) const { + return getTravelTime(trip, time); + } + /// @brief get intended vehicle id and departure time of next public transport ride virtual double getIntended(const double /* time */, std::string& /* intended */) const { return 0.; @@ -128,6 +126,11 @@ return edge == nullptr ? 0. : edge->getTravelTime(trip, time) * RandHelper::rand(1., gWeightsRandomFactor); } + static inline double getTravelTimeAggregated(const IntermodalEdge* const edge, const IntermodalTrip* const trip, double time) { + return edge == nullptr ? 0. : edge->getTravelTimeAggregated(trip, time); + } + + virtual double getEffort(const IntermodalTrip* const /* trip */, double /* time */) const { return 0.; } @@ -180,6 +183,11 @@ return myLength / trip->getMaxSpeed(); } + /// @brief only used by mono-modal routing + IntermodalEdge* getBidiEdge() const { + return nullptr; + } + protected: /// @brief List of edges that may be approached from this edge std::vector myFollowingEdges; @@ -211,8 +219,3 @@ IntermodalEdge& operator=(const IntermodalEdge& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/IntermodalNetwork.h sumo-1.6.0+dfsg1/src/utils/router/IntermodalNetwork.h --- sumo-1.5.0+dfsg1/src/utils/router/IntermodalNetwork.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/IntermodalNetwork.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The Edge definition for the Intermodal Router /****************************************************************************/ -#ifndef IntermodalNetwork_h -#define IntermodalNetwork_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -46,6 +40,7 @@ #include "StopEdge.h" //#define IntermodalRouter_DEBUG_NETWORK +//#define IntermodalRouter_DEBUG_ACCESS // =========================================================================== @@ -409,7 +404,7 @@ void addCarEdges(const std::vector& edges) { for (const E* const edge : edges) { - if (edge->getFunction() == EDGEFUNC_NORMAL || edge->getFunction() == EDGEFUNC_INTERNAL) { + if (edge->getFunction() == SumoXMLEdgeFunc::NORMAL || edge->getFunction() == SumoXMLEdgeFunc::INTERNAL) { myCarLookup[edge] = new CarEdge(myNumericalID++, edge); addEdge(myCarLookup[edge]); } @@ -500,7 +495,9 @@ assert(stopEdge != nullptr); const bool transferCarWalk = ((category == SUMO_TAG_PARKING_AREA && (myCarWalkTransfer & PARKING_AREAS) != 0) || (category == SUMO_TAG_BUS_STOP && (myCarWalkTransfer & PT_STOPS) != 0)); - //std::cout << "addAccess stopId=" << stopId << " stopEdge=" << stopEdge->getID() << " pos=" << pos << " length=" << length << " cat=" << category << "\n"; +#ifdef IntermodalRouter_DEBUG_ACCESS + std::cout << "addAccess stopId=" << stopId << " stopEdge=" << stopEdge->getID() << " pos=" << pos << " length=" << length << " cat=" << category << "\n"; +#endif if (myStopConnections.count(stopId) == 0) { myStopConnections[stopId] = new StopEdge(stopId, myNumericalID++, stopEdge); addEdge(myStopConnections[stopId]); @@ -588,6 +585,12 @@ splitList.insert(splitIt - 1, stopConn); // correct length of subsequent edge last->setLength(last->getLength() - newLength); +#ifdef IntermodalRouter_DEBUG_ACCESS + std::cout << " splitList:\n"; + for (auto conEdge : splitList) { + std::cout << " " << conEdge->getID() << " length=" << conEdge->getLength() << "\n"; + } +#endif } } @@ -833,8 +836,3 @@ IntermodalNetwork& operator=(const IntermodalNetwork& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/IntermodalRouter.h sumo-1.6.0+dfsg1/src/utils/router/IntermodalRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/IntermodalRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/IntermodalRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // The IntermodalRouter builds a special network and (delegates to a SUMOAbstractRouter) /****************************************************************************/ -#ifndef IntermodalRouter_h -#define IntermodalRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -258,10 +252,6 @@ gWeightsRandomFactor > 1 ? & _IntermodalEdge::getTravelTimeStaticRandomized : & _IntermodalEdge::getTravelTimeStatic)), myIntermodalNet(net), myCarWalkTransfer(carWalkTransfer), myRoutingAlgorithm(routingAlgorithm), myRoutingMode(routingMode), myExternalEffort(calc) {} - static inline double getEffortAggregated(const _IntermodalEdge* const edge, const _IntermodalTrip* const trip, double time) { - return edge == nullptr || !edge->hasEffort() ? 0. : edge->getEffort(trip, time); - } - static inline double getCombined(const _IntermodalEdge* const edge, const _IntermodalTrip* const trip, double time) { return edge->getTravelTime(trip, time) + trip->externalFactor * trip->calc->getEffort(edge->getNumericalID()); } @@ -282,7 +272,7 @@ } break; case 1: - myInternalRouter = new _InternalDijkstra(myIntermodalNet->getAllEdges(), true, &getEffortAggregated, &_IntermodalEdge::getTravelTimeStatic, false, nullptr, true); + myInternalRouter = new _InternalDijkstra(myIntermodalNet->getAllEdges(), true, &_IntermodalEdge::getTravelTimeAggregated, nullptr, false, nullptr, true); break; case 2: myInternalRouter = new _InternalDijkstra(myIntermodalNet->getAllEdges(), true, &_IntermodalEdge::getEffortStatic, &_IntermodalEdge::getTravelTimeStatic, false, nullptr, true); @@ -317,8 +307,3 @@ IntermodalRouter& operator=(const IntermodalRouter& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/IntermodalTrip.h sumo-1.6.0+dfsg1/src/utils/router/IntermodalTrip.h --- sumo-1.5.0+dfsg1/src/utils/router/IntermodalTrip.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/IntermodalTrip.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The "vehicle" definition for the Intermodal Router /****************************************************************************/ -#ifndef IntermodalTrip_h -#define IntermodalTrip_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -68,6 +62,11 @@ return vehicle != 0 ? vehicle->getVClass() : SVC_PEDESTRIAN; } + inline double getLength() const { + // person length is arbitrary (only used in the context of rail-reversal validity + return vehicle != 0 ? vehicle->getVehicleType().getLength() : 1; + } + // only used by AStar inline double getMaxSpeed() const { return vehicle != nullptr ? vehicle->getMaxSpeed() : speed; @@ -94,8 +93,3 @@ /// @brief Invalidated assignment operator. IntermodalTrip& operator=(const IntermodalTrip&); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/LogitCalculator.h sumo-1.6.0+dfsg1/src/utils/router/LogitCalculator.h --- sumo-1.5.0+dfsg1/src/utils/router/LogitCalculator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/LogitCalculator.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Calculators for route costs and probabilities /****************************************************************************/ -#ifndef LogitCalculator_h -#define LogitCalculator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -153,9 +147,3 @@ LogitCalculator& operator=(const LogitCalculator& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/PedestrianEdge.h sumo-1.6.0+dfsg1/src/utils/router/PedestrianEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/PedestrianEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/PedestrianEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // The pedestrian accessible edges for the Intermodal Router /****************************************************************************/ -#ifndef PedestrianEdge_h -#define PedestrianEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #define TL_RED_PENALTY 20 @@ -108,8 +102,3 @@ const double myStartPos; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/PedestrianRouter.h sumo-1.6.0+dfsg1/src/utils/router/PedestrianRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/PedestrianRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/PedestrianRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The Pedestrian Router builds a special network and delegates to a SUMOAbstractRouter. /****************************************************************************/ -#ifndef PedestrianRouter_h -#define PedestrianRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -149,8 +143,3 @@ PedestrianRouter& operator=(const PedestrianRouter& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/PublicTransportEdge.h sumo-1.6.0+dfsg1/src/utils/router/PublicTransportEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/PublicTransportEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/PublicTransportEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The PublicTransportEdge is a special intermodal edge connecting the stop edges with scheduled traffic /****************************************************************************/ -#ifndef PublicTransportEdge_h -#define PublicTransportEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "IntermodalEdge.h" @@ -161,8 +155,3 @@ const IntermodalEdge* const myEntryStop; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/RailEdge.h sumo-1.6.0+dfsg1/src/utils/router/RailEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/RailEdge.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/RailEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,260 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 RailEdge.h +/// @author Jakob Erdmann +/// @date 26.02.2020 +/// +// The RailEdge is a wrapper around a ROEdge or a MSEdge used for railway routing +/****************************************************************************/ +#pragma once +#include +#include + +//#define RailEdge_DEBUG_TURNS +//#define RailEdge_DEBUG_INIT +//#define RailEdge_DEBUG_SUCCESSORS +#define RailEdge_DEBUGID "" +//#define RailEdge_DEBUG_COND(obj) ((obj != 0 && (obj)->getID() == RailEdge_DEBUGID)) +#define RailEdge_DEBUG_COND(obj) (true) + +// =========================================================================== +// class definitions +// =========================================================================== +/// @brief the edge type representing backward edges +template +class RailEdge { +public: + typedef RailEdge _RailEdge; + typedef std::vector > ConstEdgePairVector; + + RailEdge(const E* orig) : + myNumericalID(orig->getNumericalID()), + myOriginal(orig), + myTurnaround(nullptr), + myIsVirtual(true) + { } + + RailEdge(const E* turnStart, const E* turnEnd, int numericalID) : + myNumericalID(numericalID), + myID("TrainReversal!" + turnStart->getID() + "->" + turnEnd->getID()), + myOriginal(nullptr), + myTurnaround(nullptr), + myIsVirtual(true), + myMaxLength(turnStart->getLength()), + myStartLength(turnStart->getLength()) { + myViaSuccessors.push_back(std::make_pair(turnEnd->getRailwayRoutingEdge(), nullptr)); + } + + void update(double maxTrainLength, const std::vector& replacementEdges) { + if (maxTrainLength > myMaxLength) { + myMaxLength = maxTrainLength; + myReplacementEdges = replacementEdges; +#ifdef RailEdge_DEBUG_INIT + std::cout << " update RailEdge " << getID() << " myMaxLength=" << myMaxLength << " repl=" << toString(myReplacementEdges) << "\n"; +#endif + } + } + + void addVirtualTurns(const E* forward, const E* backward, + std::vector<_RailEdge*>& railEdges, int& numericalID, double dist, + double maxTrainLength, const std::vector& replacementEdges) { + // search backwards until dist and add virtual turnaround edges with + // replacement edges up to the real turnaround +#ifdef RailEdge_DEBUG_INIT + std::cout << "addVirtualTurns forward=" << forward->getID() << " backward=" << backward->getID() << " dist=" << dist + << " maxLength=" << maxTrainLength << " repl=" << toString(replacementEdges) << "\n"; +#endif + if (dist <= 0) { + return; + } + for (const E* prev : forward->getPredecessors()) { + if (prev == backward) { + continue; + } + const E* bidi = prev->getBidiEdge(); + if (backward->isConnectedTo(*bidi, SVC_IGNORING)) { + _RailEdge* prevRailEdge = prev->getRailwayRoutingEdge(); + if (prevRailEdge->myTurnaround == nullptr) { + prevRailEdge->myTurnaround = new _RailEdge(prev, bidi, numericalID++); + prevRailEdge->myViaSuccessors.push_back(std::make_pair(prevRailEdge->myTurnaround, nullptr)); + railEdges.push_back(prevRailEdge->myTurnaround); +#ifdef RailEdge_DEBUG_INIT + std::cout << " RailEdge " << prevRailEdge->getID() << " virtual turnaround " << prevRailEdge->myTurnaround->getID() << "\n"; +#endif + } + prevRailEdge->myTurnaround->update(prev->getLength() + maxTrainLength, replacementEdges); + std::vector replacementEdges2; + replacementEdges2.push_back(prev); + replacementEdges2.insert(replacementEdges2.end(), replacementEdges.begin(), replacementEdges.end()); + addVirtualTurns(prev, bidi, railEdges, numericalID, dist - prev->getLength(), + maxTrainLength + prev->getLength(), replacementEdges2); + } + } + } + + void init(std::vector<_RailEdge*>& railEdges, int& numericalID, double maxTrainLength) { + // replace turnaround-via with an explicit RailEdge that checks length + for (const auto& viaPair : myOriginal->getViaSuccessors()) { + if (viaPair.first == myOriginal->getBidiEdge()) { + // direction reversal + if (myTurnaround == nullptr) { + myTurnaround = new _RailEdge(myOriginal, viaPair.first, numericalID++); + myViaSuccessors.push_back(std::make_pair(myTurnaround, nullptr)); + railEdges.push_back(myTurnaround); +#ifdef RailEdge_DEBUG_INIT + std::cout << "RailEdge " << getID() << " actual turnaround " << myTurnaround->getID() << "\n"; +#endif + } + myTurnaround->myIsVirtual = false; + addVirtualTurns(myOriginal, viaPair.first, railEdges, numericalID, + maxTrainLength - getLength(), getLength(), std::vector {myOriginal}); + } else { + myViaSuccessors.push_back(std::make_pair(viaPair.first->getRailwayRoutingEdge(), + viaPair.second == nullptr ? nullptr : viaPair.second->getRailwayRoutingEdge())); + } + } +#ifdef RailEdge_DEBUG_SUCCESSORS + std::cout << "RailEdge " << getID() << " successors=" << myViaSuccessors.size() << " orig=" << myOriginal->getViaSuccessors().size() << "\n"; + for (const auto& viaPair : myViaSuccessors) { + std::cout << " " << viaPair.first->getID() << "\n"; + } +#endif + } + + /// @brief Returns the index (numeric id) of the edge + inline int getNumericalID() const { + return myNumericalID; + } + + /// @brief Returns the original edge + const E* getOriginal() const { + return myOriginal; + } + + /** @brief Returns the id of the edge + * @return The original edge's id + */ + const std::string& getID() const { + return myOriginal != nullptr ? myOriginal->getID() : myID; + } + + void insertOriginalEdges(double length, std::vector& into) const { + if (myOriginal != nullptr) { + into.push_back(myOriginal); + } else { + double seen = myStartLength; + int nPushed = 0; + if (seen >= length && !myIsVirtual) { + return; + } + // we need to find a replacement edge that has a real turn + for (const E* edge : myReplacementEdges) { + into.push_back(edge); + nPushed++; + seen += edge->getLength(); + if (seen >= length && edge->isConnectedTo(*edge->getBidiEdge(), SVC_IGNORING)) { + break; + } + //std::cout << "insertOriginalEdges length=" << length << " seen=" << seen << " into=" << toString(into) << "\n"; + } + const int last = (int)into.size() - 1; + for (int i = 0; i < nPushed; i++) { + into.push_back(into[last - i]->getBidiEdge()); + } + } + } + + /** @brief Returns the length of the edge + * @return The original edge's length + */ + double getLength() const { + return myOriginal == nullptr ? 0 : myOriginal->getLength(); + } + + //const RailEdge* getBidiEdge() const { + // return myOriginal->getBidiEdge()->getRailwayRoutingEdge(); + //} + + bool isInternal() const { + return myOriginal->isInternal(); + } + + inline bool prohibits(const V* const vehicle) const { +#ifdef RailEdge_DEBUG_TURNS + if (myOriginal == nullptr && RailEdge_DEBUG_COND(vehicle)) { + std::cout << getID() << " maxLength=" << myMaxLength << " veh=" << vehicle->getID() << " length=" << vehicle->getLength() << "\n"; + } +#endif + return vehicle->getLength() > myMaxLength || (myOriginal != nullptr && myOriginal->prohibits(vehicle)); + } + + inline bool restricts(const V* const vehicle) const { + return myOriginal != nullptr && myOriginal->restricts(vehicle); + } + + const ConstEdgePairVector& getViaSuccessors(SUMOVehicleClass vClass = SVC_IGNORING) const { + if (vClass == SVC_IGNORING || myOriginal == nullptr || myOriginal->isTazConnector()) { // || !MSNet::getInstance()->hasPermissions()) { + return myViaSuccessors; + } +#ifdef HAVE_FOX + FXMutexLock lock(mySuccessorMutex); +#endif + auto i = myClassesViaSuccessorMap.find(vClass); + if (i != myClassesViaSuccessorMap.end()) { + // can use cached value + return i->second; + } + // instantiate vector + ConstEdgePairVector& result = myClassesViaSuccessorMap[vClass]; + // this vClass is requested for the first time. rebuild all successors + for (const auto& viaPair : myViaSuccessors) { + if (viaPair.first->myOriginal == nullptr + || viaPair.first->myOriginal->isTazConnector() + || myOriginal->isConnectedTo(*viaPair.first->myOriginal, vClass)) { + result.push_back(viaPair); + } + } + return result; + } + + bool isVirtual() const { + return myIsVirtual; + } + +private: + const int myNumericalID; + const std::string myID; + const E* myOriginal; + _RailEdge* myTurnaround; + bool myIsVirtual; + + /// @brief actual edges to return when passing this (turnaround) edge - only forward + std::vector myReplacementEdges; + + /// @brief maximum train length for passing this (turnaround) edge + double myMaxLength = std::numeric_limits::max(); + /// @brief length of the edge where this turn starts + double myStartLength = 0; + + /// @brief The successors available for a given vClass + mutable std::map myClassesViaSuccessorMap; + + mutable ConstEdgePairVector myViaSuccessors; + +#ifdef HAVE_FOX + /// @brief Mutex for accessing successor edges + mutable FXMutex mySuccessorMutex; +#endif + +}; diff -Nru sumo-1.5.0+dfsg1/src/utils/router/RailwayRouter.h sumo-1.6.0+dfsg1/src/utils/router/RailwayRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/RailwayRouter.h 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/RailwayRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,219 @@ +/****************************************************************************/ +// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +// Copyright (C) 2001-2020 German Aerospace Center (DLR) and others. +// This program and the accompanying materials are 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 RailwayRouter.h +/// @author Jakob Erdmann +/// @date Tue, 25 Feb 2020 +/// +// The RailwayRouter builds a special network for railway routing to handle train reversal restrictions (delegates to a SUMOAbstractRouter) +/****************************************************************************/ +#pragma once +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include "SUMOAbstractRouter.h" +#include "DijkstraRouter.h" +#include "RailEdge.h" + +//#define RailwayRouter_DEBUG_ROUTES + +// =========================================================================== +// class definitions +// =========================================================================== +/** + * @class RailwayRouter + * The router for pedestrians (on a bidirectional network of sidewalks and crossings) + */ +template +class RailwayRouter : public SUMOAbstractRouter { + +private: + + + typedef RailEdge _RailEdge; + typedef SUMOAbstractRouter<_RailEdge, V> _InternalRouter; + typedef DijkstraRouter<_RailEdge, V> _InternalDijkstra; + +public: + + /// Constructor + RailwayRouter(const std::vector& edges, bool unbuildIsWarning, typename SUMOAbstractRouter::Operation effortOperation, + typename SUMOAbstractRouter::Operation ttOperation = nullptr, bool silent = false, + const bool havePermissions = false, const bool haveRestrictions = false) : + SUMOAbstractRouter("RailwayRouter", true, effortOperation, ttOperation, havePermissions, haveRestrictions), + myInternalRouter(nullptr) { + myStaticOperation = effortOperation; + std::vector<_RailEdge*> railEdges1; // a RailEdge for existing edge + for (E* edge : edges) { + railEdges1.push_back(edge->getRailwayRoutingEdge()); + } + int numericalID = railEdges1.back()->getNumericalID() + 1; + std::vector<_RailEdge*> railEdges2 = railEdges1; // including additional edges for direction reversal + for (_RailEdge* railEdge : railEdges1) { + railEdge->init(railEdges2, numericalID, myMaxTrainLength); + } + myInternalRouter = new _InternalDijkstra(railEdges2, unbuildIsWarning, &getTravelTimeStatic, nullptr, silent, nullptr, havePermissions, haveRestrictions); + + } + + /// Destructor + virtual ~RailwayRouter() { + delete myInternalRouter; + } + + SUMOAbstractRouter* clone() { + return new RailwayRouter(this); + } + + /** @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 V* const vehicle, SUMOTime msTime, std::vector& into, bool silent = false) { + // make sure that the vehicle can turn-around when starting on a short edge (the virtual turn-around for this lies backwards along the route / track) + std::vector backLengths; + double backDist = vehicle->getLength() - from->getLength(); + const E* start = from; + 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)); + break; + } + backDist -= prev->getLength(); + backLengths.push_back(prev->getLength() + (backLengths.empty() ? from->getLength() : backLengths.back())); + start = prev; + } + + std::vector intoTmp; + bool success = myInternalRouter->compute(start->getRailwayRoutingEdge(), to->getRailwayRoutingEdge(), vehicle, msTime, intoTmp, silent); + //std::cout << "RailRouter veh=" << vehicle->getID() << " from=" << from->getID() << " to=" << to->getID() << " t=" << time2string(msTime) << " success=" << success << "\n"; + if (success) { + const size_t intoSize = into.size(); + const int backIndex = (int)backLengths.size() - 1;; + for (const _RailEdge* railEdge : intoTmp) { + // prevent premature reversal on back edge (extend train length) + const double length = backIndex >= 0 ? backLengths[backIndex] : vehicle->getLength(); + railEdge->insertOriginalEdges(length, into); + } +#ifdef RailwayRouter_DEBUG_ROUTES + std::cout << "RailRouter: internal result=" << toString(intoTmp) << "\n"; + std::cout << "RailRouter: expanded result=" << toString(into) << "\n"; +#endif + if (backLengths.size() > 0) { + // skip the virtual back-edges + into.erase(into.begin() + intoSize, into.begin() + intoSize + backLengths.size()); +#ifdef RailwayRouter_DEBUG_ROUTES + std::cout << "RailRouter: backLengths=" << toString(backLengths) << " final result=" << toString(into) << "\n"; +#endif + if (*(into.begin() + intoSize) != from) { + WRITE_WARNING("Railway routing failure due to turn-around on short edge '" + from->getID() + + "' for vehicle '" + vehicle->getID() + "' time=" + time2string(msTime) + "."); + } + } + } + return success; + } + + void prohibit(const std::vector& toProhibit) { + std::vector<_RailEdge*> railEdges; + for (E* edge : toProhibit) { + railEdges.push_back(edge->getRailwayRoutingEdge()); + } + myInternalRouter->prohibit(railEdges); + } + + +private: + RailwayRouter(RailwayRouter* other) : + SUMOAbstractRouter(other), + myInternalRouter(other->myInternalRouter->clone()) + {} + + static inline double getTravelTimeStatic(const RailEdge* const edge, const V* const veh, double time) { + if (edge->getOriginal() != nullptr) { + return (*myStaticOperation)(edge->getOriginal(), veh, time); + } else { + // turnaround edge + if (edge->isVirtual()) { + // add up time for replacement edges + std::vector repl; + edge->insertOriginalEdges(veh->getLength(), repl); + assert(repl.size() > 0); + double seenDist = 0; + double result = 0; + repl.pop_back(); // last edge must not be used fully + for (const E* e : repl) { + result += (*myStaticOperation)(e, veh, time + result); + seenDist += e->getLength(); + } + const double lengthOnLastEdge = MAX2(0.0, veh->getLength() - seenDist); + return result + myReversalPenalty + lengthOnLastEdge * myReversalPenaltyFactor; + } else { + // XXX if the edge from which this turnaround starts is longer + // than the vehicle, we could return a negative value here + // because the turnaround may happen once the vehicle has driven onto the edge + return myReversalPenalty; + } + } + } + + + static const E* getStraightPredecessor(const E* edge) { + const E* result = nullptr; + //std::cout << " getStraightPredecessor edge=" << edge->getID() << "\n"; + for (const E* cand : edge->getPredecessors()) { + if (!cand->isInternal() && cand->getBidiEdge() != edge) { + //std::cout << " cand=" << cand->getID() << "\n"; + if (result == nullptr) { + result = cand; + } else { + // predecessor not unique. Better abort with a warning + return nullptr; + } + } + } + return result; + } + +private: + _InternalRouter* myInternalRouter; + + /// @brief The object's operation to perform. (hack) + static typename SUMOAbstractRouter::Operation myStaticOperation; + + static double myReversalPenalty; + static double myReversalPenaltyFactor; + static double myMaxTrainLength; + +private: + /// @brief Invalidated assignment operator + RailwayRouter& operator=(const RailwayRouter& s); + +}; + +template +typename SUMOAbstractRouter::Operation RailwayRouter::myStaticOperation(nullptr); +template +double RailwayRouter::myReversalPenalty(60); +template +double RailwayRouter::myReversalPenaltyFactor(0.2); // 1/v +template +double RailwayRouter::myMaxTrainLength(5000); + + diff -Nru sumo-1.5.0+dfsg1/src/utils/router/ReversedEdge.h sumo-1.6.0+dfsg1/src/utils/router/ReversedEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/ReversedEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/ReversedEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ // backward search /****************************************************************************/ #pragma once - - -// =========================================================================== -// included modules -// =========================================================================== #include @@ -76,6 +71,10 @@ return myOriginal->getLength(); } + const ReversedEdge* getBidiEdge() const { + return myOriginal->getBidiEdge()->getReversedRoutingEdge(); + } + bool isInternal() const { return myOriginal->isInternal(); } @@ -128,6 +127,3 @@ #endif }; - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/RouteCostCalculator.h sumo-1.6.0+dfsg1/src/utils/router/RouteCostCalculator.h --- sumo-1.5.0+dfsg1/src/utils/router/RouteCostCalculator.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/RouteCostCalculator.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Calculators for route costs and probabilities /****************************************************************************/ -#ifndef RouteCostCalculator_h -#define RouteCostCalculator_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -119,7 +113,3 @@ } return *myInstance; } -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/RouterProvider.h sumo-1.6.0+dfsg1/src/utils/router/RouterProvider.h --- sumo-1.5.0+dfsg1/src/utils/router/RouterProvider.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/RouterProvider.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,16 +18,11 @@ /// // The RouterProvider provides car, pedestrian and intermodal routing in one object /****************************************************************************/ -#ifndef RouterProvider_h -#define RouterProvider_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "IntermodalRouter.h" +#include "RailwayRouter.h" // =========================================================================== @@ -42,16 +37,31 @@ public: RouterProvider(SUMOAbstractRouter* vehRouter, PedestrianRouter* pedRouter, - IntermodalRouter* interRouter) - : myVehRouter(vehRouter), myPedRouter(pedRouter), myInterRouter(interRouter) {} + IntermodalRouter* interRouter, + RailwayRouter* railRouter) : + myVehRouter(vehRouter), + myPedRouter(pedRouter), + myInterRouter(interRouter), + myRailRouter(railRouter) + {} + + RouterProvider(const RouterProvider& original) : + myVehRouter(original.myVehRouter->clone()), + myPedRouter(static_cast*>(original.myPedRouter == 0 ? 0 : original.myPedRouter->clone())), + myInterRouter(static_cast*>(original.myInterRouter == 0 ? 0 : original.myInterRouter->clone())), + myRailRouter(static_cast*>(original.myRailRouter == 0 ? 0 : original.myRailRouter->clone())) + {} - RouterProvider(const RouterProvider& original) - : myVehRouter(original.getVehicleRouter().clone()), - myPedRouter(static_cast*>(original.myPedRouter == 0 ? 0 : original.getPedestrianRouter().clone())), - myInterRouter(static_cast*>(original.myInterRouter == 0 ? 0 : original.getIntermodalRouter().clone())) {} + RouterProvider* clone() { + return new RouterProvider(*this); + } - SUMOAbstractRouter& getVehicleRouter() const { - return *myVehRouter; + SUMOAbstractRouter& getVehicleRouter(SUMOVehicleClass svc) const { + if (myRailRouter == nullptr || !isRailway(svc)) { + return *myVehRouter; + } else { + return *myRailRouter; + } } PedestrianRouter& getPedestrianRouter() const { @@ -62,10 +72,15 @@ return *myInterRouter; } + RailwayRouter& getRailwayRouter() const { + return *myRailRouter; + } + virtual ~RouterProvider() { delete myVehRouter; delete myPedRouter; delete myInterRouter; + delete myRailRouter; } @@ -73,6 +88,7 @@ SUMOAbstractRouter* const myVehRouter; PedestrianRouter* const myPedRouter; IntermodalRouter* const myInterRouter; + RailwayRouter* const myRailRouter; private: @@ -80,8 +96,3 @@ RouterProvider& operator=(const RouterProvider& src); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/SPTree.h sumo-1.6.0+dfsg1/src/utils/router/SPTree.h --- sumo-1.5.0+dfsg1/src/utils/router/SPTree.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/SPTree.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Shortest Path tree of limited depth using Dijkstras algorithm /****************************************************************************/ -#ifndef SPTree_h -#define SPTree_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -239,8 +233,3 @@ /// @brief vector of needed shortcuts after validation CHConnectionPairs myNeededShortcuts; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/router/StopEdge.h sumo-1.6.0+dfsg1/src/utils/router/StopEdge.h --- sumo-1.5.0+dfsg1/src/utils/router/StopEdge.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/StopEdge.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The StopEdge is a special intermodal edge representing bus and train stops /****************************************************************************/ -#ifndef StopEdge_h -#define StopEdge_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include "IntermodalEdge.h" @@ -43,8 +37,3 @@ return true; } }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/router/SUMOAbstractRouter.h sumo-1.6.0+dfsg1/src/utils/router/SUMOAbstractRouter.h --- sumo-1.5.0+dfsg1/src/utils/router/SUMOAbstractRouter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/router/SUMOAbstractRouter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An abstract router base class /****************************************************************************/ -#ifndef SUMOAbstractRouter_h -#define SUMOAbstractRouter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -115,6 +109,22 @@ myQueryTimeSum(0) { } + /// Copy Constructor + SUMOAbstractRouter(SUMOAbstractRouter* other) : + myErrorMsgHandler(other->myErrorMsgHandler), + myOperation(other->myOperation), myTTOperation(other->myTTOperation), + myBulkMode(false), + myAutoBulkMode(false), + myHavePermissions(other->myHavePermissions), + myHaveRestrictions(other->myHaveRestrictions), + myType(other->myType), + myQueryVisits(0), + myNumQueries(0), + myQueryStartTime(0), + myQueryTimeSum(0) { } + + + /// Destructor virtual ~SUMOAbstractRouter() { if (myNumQueries > 0) { @@ -125,6 +135,10 @@ virtual SUMOAbstractRouter* clone() = 0; + const std::string& getType() const { + return myType; + } + /** @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 */ virtual bool compute(const E* from, const E* to, const V* const vehicle, @@ -307,8 +321,3 @@ /// @brief Invalidated assignment operator SUMOAbstractRouter& operator=(const SUMOAbstractRouter& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/PointOfInterest.h sumo-1.6.0+dfsg1/src/utils/shapes/PointOfInterest.h --- sumo-1.5.0+dfsg1/src/utils/shapes/PointOfInterest.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/PointOfInterest.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,15 +20,10 @@ /// // A point-of-interest (2D) /****************************************************************************/ -#ifndef PointOfInterest_h -#define PointOfInterest_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include +#include #include #include #include @@ -195,9 +190,3 @@ double myHalfImgHeight; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/PolygonDynamics.h sumo-1.6.0+dfsg1/src/utils/shapes/PolygonDynamics.h --- sumo-1.5.0+dfsg1/src/utils/shapes/PolygonDynamics.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/PolygonDynamics.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,7 @@ /****************************************************************************/ -#ifndef UTILS_SHAPES_POLYGONDYNAMICS_H_ -#define UTILS_SHAPES_POLYGONDYNAMICS_H_ +#pragma once #include #include "SUMOPolygon.h" @@ -143,4 +142,3 @@ }; -#endif /* UTILS_SHAPES_POLYGONDYNAMICS_H_ */ diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/ShapeContainer.cpp sumo-1.6.0+dfsg1/src/utils/shapes/ShapeContainer.cpp --- sumo-1.5.0+dfsg1/src/utils/shapes/ShapeContainer.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/ShapeContainer.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/ShapeContainer.h sumo-1.6.0+dfsg1/src/utils/shapes/ShapeContainer.h --- sumo-1.5.0+dfsg1/src/utils/shapes/ShapeContainer.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/ShapeContainer.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Storage for geometrical objects, sorted by the layers they are in /****************************************************************************/ -#ifndef ShapeContainer_h -#define ShapeContainer_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -223,9 +217,3 @@ std::map*> myPolygonUpdateCommands; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/Shape.cpp sumo-1.6.0+dfsg1/src/utils/shapes/Shape.cpp --- sumo-1.5.0+dfsg1/src/utils/shapes/Shape.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/Shape.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,11 +18,6 @@ /// // A 2D- or 3D-Shape /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -61,4 +56,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/Shape.h sumo-1.6.0+dfsg1/src/utils/shapes/Shape.h --- sumo-1.5.0+dfsg1/src/utils/shapes/Shape.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/Shape.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A 2D- or 3D-Shape /****************************************************************************/ -#ifndef Shape_h -#define Shape_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -189,9 +183,3 @@ /// @brief Enable or disable save imgFile as relative path bool myRelativePath; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/ShapeHandler.cpp sumo-1.6.0+dfsg1/src/utils/shapes/ShapeHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/shapes/ShapeHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/ShapeHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,9 +17,6 @@ /// // The XML-Handler for network loading /****************************************************************************/ -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -299,4 +296,5 @@ return false; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/ShapeHandler.h sumo-1.6.0+dfsg1/src/utils/shapes/ShapeHandler.h --- sumo-1.5.0+dfsg1/src/utils/shapes/ShapeHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/ShapeHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // The XML-Handler for network loading /****************************************************************************/ -#ifndef ShapeHandler_h -#define ShapeHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -138,9 +132,3 @@ /// @brief invalidate assignment operator ShapeHandler& operator=(const ShapeHandler& s) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/SUMOPolygon.cpp sumo-1.6.0+dfsg1/src/utils/shapes/SUMOPolygon.cpp --- sumo-1.5.0+dfsg1/src/utils/shapes/SUMOPolygon.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/SUMOPolygon.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,10 @@ /// // A 2D-polygon /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include +#include #include #include #include "SUMOPolygon.h" diff -Nru sumo-1.5.0+dfsg1/src/utils/shapes/SUMOPolygon.h sumo-1.6.0+dfsg1/src/utils/shapes/SUMOPolygon.h --- sumo-1.5.0+dfsg1/src/utils/shapes/SUMOPolygon.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/shapes/SUMOPolygon.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // A 2D- or 3D-polygon /****************************************************************************/ -#ifndef Polygon_h -#define Polygon_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -144,8 +138,3 @@ /// @brief The line width for drawing an unfilled polygon double myLineWidth; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/traci/TraCIAPI.cpp sumo-1.6.0+dfsg1/src/utils/traci/TraCIAPI.cpp --- sumo-1.5.0+dfsg1/src/utils/traci/TraCIAPI.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traci/TraCIAPI.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // C++ TraCI client API implementation /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include "TraCIAPI.h" @@ -1927,7 +1922,7 @@ } myParent.myInput.readUnsignedByte(); const std::string name = myParent.myInput.readString(); - logic.phases.emplace_back(libsumo::TraCIPhase(duration, state, minDur, maxDur, next, name)); + logic.phases.emplace_back(new libsumo::TraCIPhase(duration, state, minDur, maxDur, next, name)); } myParent.myInput.readUnsignedByte(); const int paramNumber = myParent.myInput.readInt(); @@ -2068,25 +2063,25 @@ content.writeInt(logic.currentPhaseIndex); content.writeUnsignedByte(libsumo::TYPE_COMPOUND); content.writeInt((int)logic.phases.size()); - for (const libsumo::TraCIPhase& p : logic.phases) { + for (const libsumo::TraCIPhase* p : logic.phases) { content.writeUnsignedByte(libsumo::TYPE_COMPOUND); content.writeInt(6); content.writeUnsignedByte(libsumo::TYPE_DOUBLE); - content.writeDouble(p.duration); + content.writeDouble(p->duration); content.writeUnsignedByte(libsumo::TYPE_STRING); - content.writeString(p.state); + content.writeString(p->state); content.writeUnsignedByte(libsumo::TYPE_DOUBLE); - content.writeDouble(p.minDur); + content.writeDouble(p->minDur); content.writeUnsignedByte(libsumo::TYPE_DOUBLE); - content.writeDouble(p.maxDur); + content.writeDouble(p->maxDur); content.writeUnsignedByte(libsumo::TYPE_COMPOUND); - content.writeInt((int)p.next.size()); - for (int n : p.next) { + content.writeInt((int)p->next.size()); + for (int n : p->next) { content.writeUnsignedByte(libsumo::TYPE_INTEGER); content.writeInt(n); } content.writeUnsignedByte(libsumo::TYPE_STRING); - content.writeString(p.name); + content.writeString(p->name); } content.writeUnsignedByte(libsumo::TYPE_COMPOUND); content.writeInt((int)logic.subParameter.size()); @@ -2440,6 +2435,54 @@ } double +TraCIAPI::VehicleScope::getFollowSpeed(const std::string& vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) const { + tcpip::Storage content; + content.writeUnsignedByte(libsumo::TYPE_COMPOUND); + content.writeInt(5); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(speed); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(gap); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(leaderSpeed); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(leaderMaxDecel); + content.writeByte(libsumo::TYPE_STRING); + content.writeString(leaderID); + return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_FOLLOW_SPEED, vehicleID, &content); +} + + +double +TraCIAPI::VehicleScope::getSecureGap(const std::string& vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID) const { + tcpip::Storage content; + content.writeUnsignedByte(libsumo::TYPE_COMPOUND); + content.writeInt(4); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(speed); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(leaderSpeed); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(leaderMaxDecel); + content.writeByte(libsumo::TYPE_STRING); + content.writeString(leaderID); + return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_SECURE_GAP, vehicleID, &content); +} + +double +TraCIAPI::VehicleScope::getStopSpeed(const std::string& vehicleID, double speed, double gap) const { + tcpip::Storage content; + content.writeUnsignedByte(libsumo::TYPE_COMPOUND); + content.writeInt(2); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(speed); + content.writeByte(libsumo::TYPE_DOUBLE); + content.writeDouble(gap); + return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_STOP_SPEED, vehicleID, &content); +} + + +double TraCIAPI::VehicleScope::getMaxSpeed(const std::string& vehicleID) const { return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_MAXSPEED, vehicleID); } @@ -2712,6 +2755,12 @@ } double +TraCIAPI::VehicleScope::getStopDelay(const std::string& vehicleID) const { + return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_STOP_DELAY, vehicleID); +} + + +double TraCIAPI::VehicleScope::getAccel(const std::string& vehicleID) const { return myParent.getDouble(libsumo::CMD_GET_VEHICLE_VARIABLE, libsumo::VAR_ACCEL, vehicleID); } diff -Nru sumo-1.5.0+dfsg1/src/utils/traci/TraCIAPI.h sumo-1.6.0+dfsg1/src/utils/traci/TraCIAPI.h --- sumo-1.5.0+dfsg1/src/utils/traci/TraCIAPI.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traci/TraCIAPI.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // C++ TraCI client API implementation /****************************************************************************/ -#ifndef TraCIAPI_h -#define TraCIAPI_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -694,6 +688,9 @@ double getSpeed(const std::string& vehicleID) const; double getLateralSpeed(const std::string& vehicleID) const; double getAcceleration(const std::string& vehicleID) const; + double getFollowSpeed(const std::string& vehicleID, double speed, double gap, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID = "") const; + double getSecureGap(const std::string& vehicleID, double speed, double leaderSpeed, double leaderMaxDecel, const std::string& leaderID = "") const; + double getStopSpeed(const std::string& vehicleID, double speed, double gap) const; libsumo::TraCIPosition getPosition(const std::string& vehicleID) const; libsumo::TraCIPosition getPosition3D(const std::string& vehicleID) const; double getAngle(const std::string& vehicleID) const; @@ -734,6 +731,7 @@ std::vector getBestLanes(const std::string& vehicleID) const; std::pair getLeader(const std::string& vehicleID, double dist) const; int getRoutingMode(const std::string& vehicleID) const; + double getStopDelay(const std::string& vehicleID) const; std::pair getLaneChangeState(const std::string& vehicleID, int direction) const; /// @} @@ -1067,8 +1065,3 @@ /// @brief The reusable input storage mutable tcpip::Storage myInput; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Circuit.cpp sumo-1.6.0+dfsg1/src/utils/traction_wire/Circuit.cpp --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Circuit.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Circuit.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ // Representation of electric circuit of overhead wires /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include @@ -175,9 +171,9 @@ } #ifdef HAVE_EIGEN -void Circuit::removeColumn(Eigen::MatrixXd& matrix, unsigned int colToRemove) { - const unsigned int numRows = (unsigned int)matrix.rows(); - const unsigned int numCols = (unsigned int)matrix.cols() - 1; +void Circuit::removeColumn(Eigen::MatrixXd& matrix, int colToRemove) { + const int numRows = (int)matrix.rows(); + const int numCols = (int)matrix.cols() - 1; if (colToRemove < numCols) { matrix.block(0, colToRemove, numRows, numCols - colToRemove) = matrix.rightCols(numCols - colToRemove); @@ -188,12 +184,12 @@ bool Circuit::solveEquationsNRmethod(double* eqn, double* vals, std::vector* removable_ids) { // removable_ids includes nodes with voltage source already - int numofcolumn = voltageSources->size() + nodes->size() - 1; - int numofeqs = numofcolumn - (int) removable_ids->size(); + int numofcolumn = (int)voltageSources->size() + (int)nodes->size() - 1; + int numofeqs = numofcolumn - (int)removable_ids->size(); Eigen::MatrixXd A = Eigen::Map < Eigen::Matrix >(eqn, numofeqs, numofcolumn); - unsigned int id; + int id; // removing removable columns for (std::vector::reverse_iterator it = removable_ids->rbegin(); it != removable_ids->rend(); ++it) { id = (*it >= 0 ? *it : -(*it)); diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Circuit.h sumo-1.6.0+dfsg1/src/utils/traction_wire/Circuit.h --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Circuit.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Circuit.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,7 @@ // Representation of electric circuit of overhead wires /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ -#ifndef CIRCUIT_H -#define CIRCUIT_H +#pragma once #include #ifdef HAVE_EIGEN @@ -116,7 +115,7 @@ /* * removes the "colToRemove"-th column from matrix "matrix" */ - void removeColumn(Eigen::MatrixXd& matrix, const unsigned int colToRemove); + void removeColumn(Eigen::MatrixXd& matrix, const int colToRemove); /* * solves the system of nonlinear equations Ax = B(1/x) @@ -180,4 +179,3 @@ lastId--; }; }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Element.cpp sumo-1.6.0+dfsg1/src/utils/traction_wire/Element.cpp --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Element.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Element.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ // Representation of electric circuit elements: resistors, voltage and current sources /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include "Element.h" diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Element.h sumo-1.6.0+dfsg1/src/utils/traction_wire/Element.h --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Element.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Element.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,7 @@ // Representation of electric circuit elements: resistors, voltage and current sources /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ -#ifndef ELEMENT_H -#define ELEMENT_H +#pragma once #include #include @@ -94,4 +93,3 @@ void setType(ElementType ET); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Node.cpp sumo-1.6.0+dfsg1/src/utils/traction_wire/Node.cpp --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Node.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Node.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,10 +19,6 @@ // Representation of electric circuit nodes, i.e. wire junctions and connection points. /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include #include "Node.h" diff -Nru sumo-1.5.0+dfsg1/src/utils/traction_wire/Node.h sumo-1.6.0+dfsg1/src/utils/traction_wire/Node.h --- sumo-1.5.0+dfsg1/src/utils/traction_wire/Node.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/traction_wire/Node.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,8 +19,7 @@ // Representation of electric circuit nodes, i.e. wire junctions and connection points. /// @note based on work 2017 Ahmad Khaled, Ahmad Essam, Omnia Zakaria, Mary Nader /****************************************************************************/ -#ifndef NODE_H -#define NODE_H +#pragma once #include #include @@ -72,4 +71,3 @@ void setRemovability(bool isremovable); }; -#endif diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteHandler.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // Parser for routes during their loading /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -123,8 +118,14 @@ myVehicleParameter = SUMOVehicleParserHelper::parseFlowAttributes(attrs, myHardFail, myBeginDefault, myEndDefault); // check if myVehicleParameter was sucesfully created if (myVehicleParameter) { - // open a flow (using openTrip function) - openTrip(attrs); + // check tag + if ((myVehicleParameter->routeid.empty()) || (myVehicleParameter->tag == SUMO_TAG_ROUTEFLOW)) { + // open a route flow + openRouteFlow(attrs); + } else { + // open a route flow + openFlow(attrs); + } } break; case SUMO_TAG_PERSONFLOW: @@ -365,6 +366,9 @@ bool SUMORouteHandler::parseStop(SUMOVehicleParameter::Stop& stop, const SUMOSAXAttributes& attrs, std::string errorSuffix, MsgHandler* const errorOutput) { stop.parametersSet = 0; + if (attrs.hasAttribute(SUMO_ATTR_ARRIVAL)) { + stop.parametersSet |= STOP_ARRIVAL_SET; + } if (attrs.hasAttribute(SUMO_ATTR_DURATION)) { stop.parametersSet |= STOP_DURATION_SET; } @@ -445,6 +449,7 @@ triggers.push_back(toString(SUMO_TAG_CONTAINER)); }; SUMOVehicleParameter::parseStopTriggers(triggers, expectTrigger, stop); + stop.arrival = attrs.getOptSUMOTimeReporting(SUMO_ATTR_ARRIVAL, nullptr, ok, -1); stop.duration = attrs.getOptSUMOTimeReporting(SUMO_ATTR_DURATION, nullptr, ok, -1); stop.until = attrs.getOptSUMOTimeReporting(SUMO_ATTR_UNTIL, nullptr, ok, -1); if (!expectTrigger && (!ok || (stop.duration < 0 && stop.until < 0 && stop.speed == 0))) { @@ -502,4 +507,5 @@ return true; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteHandler.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteHandler.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Parser for routes during their loading /****************************************************************************/ -#ifndef SUMORouteHandler_h -#define SUMORouteHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -118,6 +112,9 @@ /// @brief opens a flow for reading virtual void openFlow(const SUMOSAXAttributes& attrs) = 0; + /// @brief opens a route flow for reading + virtual void openRouteFlow(const SUMOSAXAttributes& attrs) = 0; + /// @brief opens a trip for reading virtual void openTrip(const SUMOSAXAttributes& attrs) = 0; //@} @@ -258,8 +255,3 @@ /// @brief Invalidated assignment operator SUMORouteHandler& operator=(const SUMORouteHandler& s) = delete; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Class responsible for loading of routes from some files /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoaderControl.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Class responsible for loading of routes from some files /****************************************************************************/ -#ifndef SUMORouteLoaderControl_h -#define SUMORouteLoaderControl_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -97,9 +91,3 @@ /// @brief Invalidated assignment operator SUMORouteLoaderControl& operator=(const SUMORouteLoaderControl& src); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoader.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoader.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -18,10 +18,6 @@ /// // A class that performs the loading of routes /****************************************************************************/ - -// =========================================================================== -// included modules -// =========================================================================== #include #include diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoader.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoader.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMORouteLoader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMORouteLoader.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // A class that performs the loading of routes /****************************************************************************/ -#ifndef SUMORouteLoader_h -#define SUMORouteLoader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -70,9 +64,3 @@ /// @brief the used Handler SUMORouteHandler* myHandler; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOTrafficObject.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOTrafficObject.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOTrafficObject.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOTrafficObject.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Abstract base class for vehicle and person representations /****************************************************************************/ -#ifndef SUMOTrafficObject_h -#define SUMOTrafficObject_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -159,8 +153,3 @@ virtual bool hasArrived() const = 0; }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicle.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicle.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicle.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicle.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Abstract base class for vehicle representations /****************************************************************************/ -#ifndef SUMOVehicle_h -#define SUMOVehicle_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -91,6 +85,9 @@ /// Returns the current route virtual const MSRoute& getRoute() const = 0; + /// @brief return index of edge within route + virtual int getRoutePosition() const = 0; + /** @brief Returns the nSuccs'th successor of edge the vehicle is currently at * * If the rest of the route (counted from the current edge) than nSuccs, @@ -169,6 +166,11 @@ */ virtual bool isOnRoad() const = 0; + /** @brief Returns whether the vehicle is idling (waiting to re-enter the net + * @return true if the vehicle is waiting to enter the net (eg after parking) + */ + virtual bool isIdling() const = 0; + /** @brief Returns the information whether the front of the vehhicle is on the given lane * @return Whether the vehicle's front is on that lane */ @@ -265,6 +267,9 @@ /// @brief return list of route indices and stop positions for the remaining stops virtual std::vector > getStopIndices() const = 0; + /// @brief returns whether the vehicle serves a public transport line that serves the given stop + virtual bool isLineStop(double position) const = 0; + /** * returns the next imminent stop in the stop queue @@ -296,12 +301,17 @@ /** @brief Returns whether the vehicle stops at the given edge */ virtual bool stopsAtEdge(const MSEdge* edge) const = 0; + /** @brief Returns parameters of the next stop or nullptr **/ + virtual const SUMOVehicleParameter::Stop* getNextStopParameter() const = 0; + virtual void setChosenSpeedFactor(const double factor) = 0; virtual SUMOTime getAccumulatedWaitingTime() const = 0; virtual SUMOTime getDepartDelay() const = 0; + virtual SUMOTime getTimeLoss() const = 0; + /// @brief get distance for coming to a stop (used for rerouting checks) virtual double getBrakeGap() const = 0; @@ -331,6 +341,9 @@ // (especially fast comparison in maps which need vehicles as keys) virtual NumericalID getNumericalID() const = 0; + /// @brief Returns the vehicles's length + virtual double getLength() const = 0; + /// @name state io //@{ @@ -342,8 +355,3 @@ virtual void loadState(const SUMOSAXAttributes& attrs, const SUMOTime offset) = 0; //@} }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,12 +19,6 @@ /// // Structure representing possible vehicle parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== - #include #include #include @@ -177,7 +171,7 @@ void -SUMOVehicleParameter::Stop::write(OutputDevice& dev) const { +SUMOVehicleParameter::Stop::write(OutputDevice& dev, bool close) const { dev.openTag(SUMO_TAG_STOP); if (busstop != "") { dev.writeAttr(SUMO_ATTR_BUS_STOP, busstop); @@ -200,6 +194,9 @@ dev.writeAttr(SUMO_ATTR_ENDPOS, endPos); } } + if ((parametersSet & STOP_ARRIVAL_SET) && (arrival >= 0)) { + dev.writeAttr(SUMO_ATTR_ARRIVAL, time2string(arrival)); + } if ((parametersSet & STOP_DURATION_SET) && (duration >= 0)) { dev.writeAttr(SUMO_ATTR_DURATION, time2string(duration)); } @@ -242,7 +239,9 @@ if (!actType.empty()) { dev.writeAttr(SUMO_ATTR_ACTTYPE, actType); } - dev.closeTag(); + if (close) { + dev.closeTag(); + } } @@ -841,4 +840,5 @@ return val; } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParameter.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Structure representing possible vehicle parameter /****************************************************************************/ -#ifndef SUMOVehicleParameter_h -#define SUMOVehicleParameter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -90,6 +84,7 @@ const int STOP_SPEED_SET = 2 << 11; const int STOP_SPLIT_SET = 2 << 12; const int STOP_JOIN_SET = 2 << 13; +const int STOP_ARRIVAL_SET = 2 << 14; const double MIN_STOP_LENGTH = 2 * POSITION_EPS; @@ -327,7 +322,7 @@ * @param[in, out] dev The device to write into * @exception IOError not yet implemented */ - void write(OutputDevice& dev) const; + void write(OutputDevice& dev, bool close = true) const; /// @brief write trigger attribute void writeTriggers(OutputDevice& dev) const; @@ -356,6 +351,9 @@ /// @brief The stopping position end double endPos; + /// @brief The (expected) time at which the vehicle reaches the stop + SUMOTime arrival; + /// @brief The stopping duration SUMOTime duration; @@ -695,7 +693,7 @@ /// @brief individual speedFactor (overriding distribution from vType) double speedFactor; - /// @brief Information for the router which parameter were set, TraCI may modify this (whe changing color) + /// @brief Information for the router which parameter were set, TraCI may modify this (when changing color) mutable int parametersSet; protected: @@ -726,9 +724,3 @@ /// @brief obtain arrival speed parameter in string format std::string getArrivalSpeed() const; }; - -#endif - -/****************************************************************************/ - - diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -21,11 +21,6 @@ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -589,13 +584,12 @@ } } if (attrs.hasAttribute(SUMO_ATTR_IMPATIENCE)) { - // allow empty attribute because .sbx saves this only as float - bool okString; - bool okDouble; - if (attrs.get(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), okString, false) == "off") { + bool okString = true; + if (attrs.get(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), okString) == "off") { vtype->impatience = -std::numeric_limits::max(); } else { - double impatience = attrs.get(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), okDouble); + bool okDouble = true; + const double impatience = attrs.get(SUMO_ATTR_IMPATIENCE, vtype->id.c_str(), okDouble); if (okDouble) { vtype->impatience = impatience; vtype->parametersSet |= VTYPEPARS_IMPATIENCE_SET; @@ -1132,6 +1126,11 @@ std::set railParams; railParams.insert(SUMO_ATTR_TRAIN_TYPE); + railParams.insert(SUMO_ATTR_ACCEL); + railParams.insert(SUMO_ATTR_DECEL); + railParams.insert(SUMO_ATTR_APPARENTDECEL); + railParams.insert(SUMO_ATTR_EMERGENCYDECEL); + railParams.insert(SUMO_ATTR_COLLISION_MINGAP_FACTOR); allowedCFModelAttrs[SUMO_TAG_CF_RAIL] = railParams; allParams.insert(railParams.begin(), railParams.end()); @@ -1485,5 +1484,5 @@ } } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVehicleParserHelper.h 2020-04-27 21:47:56.000000000 +0000 @@ -20,13 +20,7 @@ /// // Helper methods for parsing vehicle attributes /****************************************************************************/ -#ifndef SUMOVehicleParserHelper_h -#define SUMOVehicleParserHelper_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -208,9 +202,3 @@ /// @brief allowed attrs for the junction model static std::set allowedJMAttrs; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.cpp sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.cpp --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Structure representing possible vehicle parameter /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -44,7 +39,7 @@ // =========================================================================== SUMOVTypeParameter::VClassDefaultValues::VClassDefaultValues(SUMOVehicleClass vclass) : - length(5./*4.3*/), + length(getDefaultVehicleLength(vclass)), minGap(2.5), maxSpeed(200. / 3.6), width(1.8), @@ -60,7 +55,6 @@ // update default values switch (vclass) { case SVC_PEDESTRIAN: - length = 0.215; minGap = 0.25; maxSpeed = DEFAULT_PEDESTRIAN_SPEED; width = 0.478; @@ -70,7 +64,6 @@ speedFactor.getParameter()[1] = 0.1; break; case SVC_BICYCLE: - length = 1.6; minGap = 0.5; maxSpeed = 20. / 3.6; width = 0.65; @@ -81,7 +74,6 @@ speedFactor.getParameter()[1] = 0.1; break; case SVC_MOPED: - length = 2.1; maxSpeed = 60. / 3.6; width = 0.8; height = 1.7; @@ -91,7 +83,6 @@ speedFactor.getParameter()[1] = 0.1; break; case SVC_MOTORCYCLE: - length = 2.2; width = 0.9; height = 1.5; shape = SVS_MOTORCYCLE; @@ -100,7 +91,6 @@ speedFactor.getParameter()[1] = 0.1; break; case SVC_TRUCK: - length = 7.1; maxSpeed = 130. / 3.6; width = 2.4; height = 2.4; @@ -112,7 +102,6 @@ speedFactor.getParameter()[1] = 0.05; break; case SVC_TRAILER: - length = 16.5; maxSpeed = 130. / 3.6; width = 2.55; height = 4.; @@ -124,7 +113,6 @@ speedFactor.getParameter()[1] = 0.05; break; case SVC_BUS: - length = 12.; maxSpeed = 100. / 3.6; width = 2.5; height = 3.4; @@ -134,7 +122,6 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "Bus", vclass); break; case SVC_COACH: - length = 14.; maxSpeed = 100. / 3.6; width = 2.6; height = 4.; @@ -145,7 +132,6 @@ speedFactor.getParameter()[1] = 0.05; break; case SVC_TRAM: - length = 22.; maxSpeed = 80. / 3.6; width = 2.4; height = 3.2; @@ -156,8 +142,8 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); break; case SVC_RAIL_URBAN: - length = 36.5 * 3; maxSpeed = 100. / 3.6; + minGap = 5; width = 3.0; height = 3.6; shape = SVS_RAIL_CAR; @@ -167,8 +153,8 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); break; case SVC_RAIL: - length = 67.5 * 2; maxSpeed = 160. / 3.6; + minGap = 5; width = 2.84; height = 3.75; shape = SVS_RAIL; @@ -179,8 +165,8 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "HDV_D_EU0", vclass); break; case SVC_RAIL_ELECTRIC: - length = 25. * 8; maxSpeed = 220. / 3.6; + minGap = 5; width = 2.95; height = 3.89; shape = SVS_RAIL; @@ -190,8 +176,8 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); break; case SVC_RAIL_FAST: - length = 25. * 8; maxSpeed = 330. / 3.6; + minGap = 5; width = 2.95; height = 3.89; shape = SVS_RAIL; @@ -201,7 +187,6 @@ emissionClass = PollutantsInterface::getClassByName(EMPREFIX + "zero", vclass); break; case SVC_DELIVERY: - length = 6.5; width = 2.16; height = 2.86; shape = SVS_DELIVERY; @@ -210,7 +195,6 @@ speedFactor.getParameter()[1] = 0.05; break; case SVC_EMERGENCY: - length = 6.5; width = 2.16; height = 2.86; shape = SVS_DELIVERY; @@ -236,7 +220,6 @@ speedFactor.getParameter()[1] = 0.1; break; case SVC_SHIP: - length = 17; width = 4; maxSpeed = 8 / 1.94; // 8 knots height = 4; @@ -701,7 +684,6 @@ } } - const SUMOVTypeParameter& SUMOVTypeParameter::getDefault() { static SUMOVTypeParameter defaultParams(""); diff -Nru sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.h sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.h --- sumo-1.5.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/vehicle/SUMOVTypeParameter.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Structure representing possible vehicle parameter /****************************************************************************/ -#ifndef SUMOVTypeParameter_h -#define SUMOVTypeParameter_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -319,6 +313,11 @@ /// @brief cached value of parameters which may restrict access to certain edges std::vector paramRestrictions; + /// @brief satisfy vType / router template requirements + inline double getLength() const { + return length; + } + /** @brief Returns the default acceleration for the given vehicle class * This needs to be a function because the actual value is stored in the car following model * @param[in] vc the vehicle class @@ -382,8 +381,3 @@ */ std::string getManoeuverAngleTimesS() const; }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/CMakeLists.txt sumo-1.6.0+dfsg1/src/utils/xml/CMakeLists.txt --- sumo-1.5.0+dfsg1/src/utils/xml/CMakeLists.txt 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/CMakeLists.txt 2020-04-27 21:47:56.000000000 +0000 @@ -4,8 +4,6 @@ IStreamInputSource.h SUMOSAXAttributes.cpp SUMOSAXAttributes.h - SUMOSAXAttributesImpl_Binary.cpp - SUMOSAXAttributesImpl_Binary.h SUMOSAXAttributesImpl_Xerces.cpp SUMOSAXAttributesImpl_Xerces.h SUMOSAXAttributesImpl_Cached.cpp diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/GenericSAXHandler.cpp sumo-1.6.0+dfsg1/src/utils/xml/GenericSAXHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/GenericSAXHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/GenericSAXHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,6 @@ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -53,9 +48,14 @@ } i = 0; while (attrs[i].key != terminatorAttr) { - assert(myPredefinedTags.find(attrs[i].key) == myPredefinedTags.end()); - myPredefinedTags[attrs[i].key] = convert(attrs[i].str); - myPredefinedTagsMML[attrs[i].key] = attrs[i].str; + int key = attrs[i].key; + assert(key >= 0); + while (key >= (int)myPredefinedTags.size()) { + myPredefinedTags.push_back(nullptr); + myPredefinedTagsMML.push_back(""); + } + myPredefinedTags[key] = convert(attrs[i].str); + myPredefinedTagsMML[key] = attrs[i].str; i++; } } @@ -63,7 +63,7 @@ GenericSAXHandler::~GenericSAXHandler() { for (AttrMap::iterator i1 = myPredefinedTags.begin(); i1 != myPredefinedTags.end(); i1++) { - delete[](*i1).second; + delete[](*i1); } } @@ -230,4 +230,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/GenericSAXHandler.h sumo-1.6.0+dfsg1/src/utils/xml/GenericSAXHandler.h --- sumo-1.5.0+dfsg1/src/utils/xml/GenericSAXHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/GenericSAXHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // A handler which converts occuring elements and attributes into enums /****************************************************************************/ -#ifndef GenericSAXHandler_h -#define GenericSAXHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -286,13 +280,13 @@ //@{ // the type of the map from ids to their unicode-string representation - typedef std::map AttrMap; + typedef std::vector AttrMap; // the map from ids to their unicode-string representation AttrMap myPredefinedTags; /// the map from ids to their string representation - std::map myPredefinedTagsMML; + std::vector myPredefinedTagsMML; //@} @@ -332,8 +326,3 @@ const GenericSAXHandler& operator=(const GenericSAXHandler& s); }; - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/IStreamInputSource.h sumo-1.6.0+dfsg1/src/utils/xml/IStreamInputSource.h --- sumo-1.5.0+dfsg1/src/utils/xml/IStreamInputSource.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/IStreamInputSource.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ // Xerces InputSource reading from arbitrary std::istream // reimplementation inspired by https://marc.info/?l=xerces-dev&m=86952133511623 /****************************************************************************/ -#ifndef IStreamInputSource_h -#define IStreamInputSource_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include #include @@ -72,9 +66,3 @@ private: std::istream& myIn; }; - - -#endif - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SAXWeightsHandler.cpp sumo-1.6.0+dfsg1/src/utils/xml/SAXWeightsHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SAXWeightsHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SAXWeightsHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,66 +19,64 @@ /// // An XML-handler for network weights /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include -#include -#include -#include #include -#include -#include -#include + #include "SAXWeightsHandler.h" // =========================================================================== // method definitions // =========================================================================== + // --------------------------------------------------------------------------- // SAXWeightsHandler::ToRetrieveDefinition methods // --------------------------------------------------------------------------- + SAXWeightsHandler::ToRetrieveDefinition::ToRetrieveDefinition(const std::string& attributeName, - bool edgeBased, EdgeFloatTimeLineRetriever& destination) - : myAttributeName(attributeName), myAmEdgeBased(edgeBased), myDestination(destination) { + bool edgeBased, EdgeFloatTimeLineRetriever& destination) : + myAttributeName(attributeName), + myAmEdgeBased(edgeBased), + myDestination(destination), + myAggValue(0), + myNoLanes(0), + myHadAttribute(0) { } SAXWeightsHandler::ToRetrieveDefinition::~ToRetrieveDefinition() { } - // --------------------------------------------------------------------------- // SAXWeightsHandler methods // --------------------------------------------------------------------------- -SAXWeightsHandler::SAXWeightsHandler(const std::vector& defs, - const std::string& file) - : SUMOSAXHandler(file), myDefinitions(defs), - myCurrentTimeBeg(-1), myCurrentTimeEnd(-1) {} +SAXWeightsHandler::SAXWeightsHandler(const std::vector& defs, const std::string& file) : + SUMOSAXHandler(file), + myDefinitions(defs), + myCurrentTimeBeg(-1), + myCurrentTimeEnd(-1) { +} -SAXWeightsHandler::SAXWeightsHandler(ToRetrieveDefinition* def, - const std::string& file) - : SUMOSAXHandler(file), - myCurrentTimeBeg(-1), myCurrentTimeEnd(-1) { - myDefinitions.push_back(def); + +SAXWeightsHandler::SAXWeightsHandler(ToRetrieveDefinition* def, const std::string& file) : + SUMOSAXHandler(file), + myDefinitions({def}), + myCurrentTimeBeg(-1), +myCurrentTimeEnd(-1) { } SAXWeightsHandler::~SAXWeightsHandler() { - std::vector::iterator i; - for (i = myDefinitions.begin(); i != myDefinitions.end(); ++i) { - delete *i; + for (const auto& definition : myDefinitions) { + delete definition; } } -void SAXWeightsHandler::myStartElement(int element, - const SUMOSAXAttributes& attrs) { +void +SAXWeightsHandler::myStartElement(int element, const SUMOSAXAttributes& attrs) { switch (element) { case SUMO_TAG_INTERVAL: { bool ok = true; @@ -92,6 +90,10 @@ tryParse(attrs, true); } break; + case SUMO_TAG_EDGEREL: { + tryParseEdgeRel(attrs); + } + break; case SUMO_TAG_LANE: { tryParse(attrs, false); } @@ -105,35 +107,35 @@ void SAXWeightsHandler::tryParse(const SUMOSAXAttributes& attrs, bool isEdge) { // !!!! no error handling! - std::vector::iterator i; if (isEdge) { // process all that want values directly from the edge - for (i = myDefinitions.begin(); i != myDefinitions.end(); ++i) { - if ((*i)->myAmEdgeBased) { - if (attrs.hasAttribute((*i)->myAttributeName)) { - (*i)->myAggValue = attrs.getFloat((*i)->myAttributeName); - (*i)->myNoLanes = 1; - (*i)->myHadAttribute = true; + for (const auto& definition : myDefinitions) { + if (definition->myAmEdgeBased) { + if (attrs.hasAttribute(definition->myAttributeName)) { + definition->myAggValue = attrs.getFloat(definition->myAttributeName); + definition->myNoLanes = 1; + definition->myHadAttribute = true; } else { - (*i)->myHadAttribute = false; + definition->myHadAttribute = false; } } else { - (*i)->myAggValue = 0; - (*i)->myNoLanes = 0; + definition->myAggValue = 0; + definition->myNoLanes = 0; } } } else { // process the current lane values - for (i = myDefinitions.begin(); i != myDefinitions.end(); ++i) { - if (!(*i)->myAmEdgeBased) { + for (const auto& definition : myDefinitions) { + if (!definition->myAmEdgeBased) { try { - (*i)->myAggValue += attrs.getFloat((*i)->myAttributeName); - ++((*i)->myNoLanes); - (*i)->myHadAttribute = true; + definition->myAggValue += attrs.getFloat(definition->myAttributeName); + definition->myNoLanes++; + definition->myHadAttribute = true; } catch (EmptyData&) { - WRITE_ERROR("Missing value '" + (*i)->myAttributeName + "' in edge '" + myCurrentEdgeID + "'."); + WRITE_ERROR("Missing value '" + definition->myAttributeName + "' in edge '" + myCurrentEdgeID + "'."); } catch (NumberFormatException&) { - WRITE_ERROR("The value should be numeric, but is not.\n In edge '" + myCurrentEdgeID + "' at time step " + toString(myCurrentTimeBeg) + "."); + WRITE_ERROR("The value should be numeric, but is not.\n In edge '" + myCurrentEdgeID + + "' at time step " + toString(myCurrentTimeBeg) + "."); } } } @@ -142,20 +144,34 @@ void +SAXWeightsHandler::tryParseEdgeRel(const SUMOSAXAttributes& attrs) { + if (attrs.hasAttribute(SUMO_ATTR_FROM) && attrs.hasAttribute(SUMO_ATTR_TO)) { + bool ok = true; + const std::string from = attrs.get(SUMO_ATTR_FROM, nullptr, ok); + const std::string to = attrs.get(SUMO_ATTR_TO, nullptr, ok); + for (ToRetrieveDefinition* ret : myDefinitions) { + if (attrs.hasAttribute(ret->myAttributeName)) { + ret->myDestination.addEdgeRelWeight(from, to, + attrs.getFloat(ret->myAttributeName), + myCurrentTimeBeg, myCurrentTimeEnd); + } + } + } +} + + +void SAXWeightsHandler::myEndElement(int element) { if (element == SUMO_TAG_EDGE) { - std::vector::iterator i; - for (i = myDefinitions.begin(); i != myDefinitions.end(); ++i) { - if ((*i)->myHadAttribute) { - (*i)->myDestination.addEdgeWeight(myCurrentEdgeID, - (*i)->myAggValue / (double)(*i)->myNoLanes, - myCurrentTimeBeg, myCurrentTimeEnd); + for (const auto& definition : myDefinitions) { + if (definition->myHadAttribute) { + definition->myDestination.addEdgeWeight(myCurrentEdgeID, + definition->myAggValue / (double)definition->myNoLanes, + myCurrentTimeBeg, myCurrentTimeEnd); } } } } - /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SAXWeightsHandler.h sumo-1.6.0+dfsg1/src/utils/xml/SAXWeightsHandler.h --- sumo-1.5.0+dfsg1/src/utils/xml/SAXWeightsHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SAXWeightsHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // An XML-handler for network weights /****************************************************************************/ -#ifndef SAXWeightsHandler_h -#define SAXWeightsHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -76,6 +70,7 @@ * @brief Interface for a class which obtains read weights for named edges */ class EdgeFloatTimeLineRetriever { + public: /// @brief Constructor EdgeFloatTimeLineRetriever() { } @@ -90,11 +85,20 @@ * @param[in] beg The begin of the interval the weight is valid for * @param[in] end The end of the interval the weight is valid for */ - virtual void addEdgeWeight(const std::string& id, - double val, double beg, double end) const = 0; + virtual void addEdgeWeight(const std::string& id, double val, double beg, double end) const = 0; + + virtual void addEdgeRelWeight(const std::string& from, const std::string& to, + double val, double beg, double end) const { + UNUSED_PARAMETER(from); + UNUSED_PARAMETER(to); + UNUSED_PARAMETER(val); + UNUSED_PARAMETER(beg); + UNUSED_PARAMETER(end); + } private: - EdgeFloatTimeLineRetriever& operator=(const EdgeFloatTimeLineRetriever&); // just to avoid a compiler warning + /// @brief we made the assignment operator invalid + EdgeFloatTimeLineRetriever& operator=(const EdgeFloatTimeLineRetriever&) = delete; }; /** @@ -103,7 +107,7 @@ */ class ToRetrieveDefinition { public: - /// Constructor + /// @brief Constructor ToRetrieveDefinition(const std::string& attributeName, bool edgeBased, EdgeFloatTimeLineRetriever& destination); @@ -111,31 +115,30 @@ ~ToRetrieveDefinition(); public: - /// The attribute name that shall be parsed + /// @brief The attribute name that shall be parsed std::string myAttributeName; - /// Information whether edge values shall be used (lane value if false) + /// @brief Information whether edge values shall be used (lane value if false) bool myAmEdgeBased; - /// The class that shall be called when new data is avaiable + /// @brief The class that shall be called when new data is avaiable EdgeFloatTimeLineRetriever& myDestination; - /// aggregated value over the lanes read within the current edge + /// @brief Aggregated value over the lanes read within the current edge double myAggValue; - /// The number of lanes read for the current edge + /// @brief The number of lanes read for the current edge int myNoLanes; - /// Information whether the attribute has been found for the current edge + /// @brief Information whether the attribute has been found for the current edge bool myHadAttribute; private: /// @brief Invalidated copy constructor. - ToRetrieveDefinition(const ToRetrieveDefinition&); + ToRetrieveDefinition(const ToRetrieveDefinition&) = delete; /// @brief Invalidated assignment operator. - ToRetrieveDefinition& operator=(const ToRetrieveDefinition&); - + ToRetrieveDefinition& operator=(const ToRetrieveDefinition&) = delete; }; /** @@ -144,23 +147,18 @@ * Gets a list of retriever definitions. Please note that the retrievers are * not deleted! */ - SAXWeightsHandler(const std::vector& defs, - const std::string& file); - + SAXWeightsHandler(const std::vector& defs, const std::string& file); /** * @brief Constructor * * Gets a single definition. Please note that the retrievers are not deleted! */ - SAXWeightsHandler(ToRetrieveDefinition* def, - const std::string& file); + SAXWeightsHandler(ToRetrieveDefinition* def, const std::string& file); - - /// Destructor + /// @brief Destructor ~SAXWeightsHandler(); - protected: /// @name inherited from GenericSAXHandler //@{ @@ -172,9 +170,7 @@ * @exception ProcessError If something fails * @see GenericSAXHandler::myStartElement */ - void myStartElement(int element, - const SUMOSAXAttributes& attrs); - + void myStartElement(int element, const SUMOSAXAttributes& attrs); /** @brief Called when a closing tag occurs * @@ -183,39 +179,31 @@ * @see GenericSAXHandler::myEndElement */ void myEndElement(int elemente); - //@} + //@} private: - /// Parses the efforts of a lane for the previously read times + /// @brief Parses the data of an edge or lane for the previously read times void tryParse(const SUMOSAXAttributes& attrs, bool isEdge); + /// @brief Parses the data of an edgeRel for the previously read times + void tryParseEdgeRel(const SUMOSAXAttributes& attrs); -private: - /// List of definitions what shall be read and whereto stored while parsing the file + /// @brief List of definitions what shall be read and whereto stored while parsing the file std::vector myDefinitions; - /// the begin of the time period that is currently processed + /// @brief the begin of the time period that is currently processed double myCurrentTimeBeg; - /// the end of the time period that is currently processed + /// @brief the end of the time period that is currently processed double myCurrentTimeEnd; - /// the edge which is currently being processed + /// @brief the edge which is currently being processed std::string myCurrentEdgeID; + /// @brief we made the copy constructor invalid + SAXWeightsHandler(const SAXWeightsHandler& src) = delete; -private: - /// we made the copy constructor invalid - SAXWeightsHandler(const SAXWeightsHandler& src); - - /// we made the assignment operator invalid - SAXWeightsHandler& operator=(const SAXWeightsHandler& src); - + /// @brief we made the assignment operator invalid + SAXWeightsHandler& operator=(const SAXWeightsHandler& src) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributes.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributes.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributes.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributes.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Encapsulated SAX-Attributes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -260,4 +255,5 @@ return getIntVector(attr); } + /****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributes.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributes.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributes.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributes.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Encapsulated SAX-Attributes /****************************************************************************/ -#ifndef SUMOSAXAttributes_h -#define SUMOSAXAttributes_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -538,9 +532,3 @@ ok = false; return invalid_return::value; } - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,386 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2002-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 SUMOSAXAttributesImpl_Binary.cpp -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Sept 2002 -/// -// Encapsulated xml-attributes that are retrieved from the sumo-binary-xml format (already typed) -/****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include "SUMOSAXAttributesImpl_Binary.h" -#include "SUMOSAXAttributesImpl_Cached.h" - - -// =========================================================================== -// class definitions -// =========================================================================== -SUMOSAXAttributesImpl_Binary::SUMOSAXAttributesImpl_Binary( - const std::map& predefinedTagsMML, - const std::string& objectType, - BinaryInputDevice* in, const char version) : SUMOSAXAttributes(objectType), myAttrIds(predefinedTagsMML) { - while (in->peek() == BinaryFormatter::BF_XML_ATTRIBUTE) { - int attr; - unsigned char attrByte; - *in >> attrByte; - attr = attrByte; - if (version > 1) { - in->putback(BinaryFormatter::BF_BYTE); - *in >> attrByte; - attr += 256 * attrByte; - } - int type = in->peek(); - switch (type) { - case BinaryFormatter::BF_BYTE: - *in >> myCharValues[attr]; - break; - case BinaryFormatter::BF_INTEGER: - *in >> myIntValues[attr]; - break; - case BinaryFormatter::BF_FLOAT: - case BinaryFormatter::BF_SCALED2INT: - *in >> myFloatValues[attr]; - break; - case BinaryFormatter::BF_STRING: - *in >> myStringValues[attr]; - break; - case BinaryFormatter::BF_LIST: { - int size; - *in >> size; - while (size > 0) { - const int type = in->peek(); - if (type != BinaryFormatter::BF_POSITION_2D && type != BinaryFormatter::BF_POSITION_3D && - type != BinaryFormatter::BF_SCALED2INT_POSITION_2D && - type != BinaryFormatter::BF_SCALED2INT_POSITION_3D) { - throw ProcessError("Invalid binary file, only supporting position vectors."); - } - size--; - Position p; - *in >> p; - myPositionVectors[attr].push_back(p); - } - break; - } - case BinaryFormatter::BF_EDGE: - *in >> myIntValues[attr]; - break; - case BinaryFormatter::BF_LANE: - *in >> myIntValues[attr]; - in->putback(BinaryFormatter::BF_BYTE); - *in >> myCharValues[attr]; - break; - case BinaryFormatter::BF_POSITION_2D: - case BinaryFormatter::BF_POSITION_3D: - case BinaryFormatter::BF_SCALED2INT_POSITION_2D: - case BinaryFormatter::BF_SCALED2INT_POSITION_3D: { - Position p; - *in >> p; - myPositionVectors[attr].push_back(p); - break; - } - case BinaryFormatter::BF_BOUNDARY: { - Position p; - *in >> p; - myPositionVectors[attr].push_back(p); - in->putback(BinaryFormatter::BF_POSITION_2D); - *in >> p; - myPositionVectors[attr].push_back(p); - break; - } - case BinaryFormatter::BF_COLOR: - *in >> myIntValues[attr]; - break; - case BinaryFormatter::BF_NODE_TYPE: - *in >> myCharValues[attr]; - break; - case BinaryFormatter::BF_EDGE_FUNCTION: - *in >> myCharValues[attr]; - break; - case BinaryFormatter::BF_ROUTE: { - std::ostringstream into(std::ios::binary); - int size; - *in >> size; - FileHelpers::writeByte(into, BinaryFormatter::BF_ROUTE); - FileHelpers::writeInt(into, size); - if (size > 0) { - int intsToRead = size - 1; - int bitsOrEntry; - in->putback(BinaryFormatter::BF_INTEGER); - *in >> bitsOrEntry; - FileHelpers::writeInt(into, bitsOrEntry); - if (bitsOrEntry < 0) { - intsToRead = (-bitsOrEntry * (size - 1) - 1) / sizeof(int) / 8 + 2; - } - while (intsToRead > 0) { - in->putback(BinaryFormatter::BF_INTEGER); - *in >> bitsOrEntry; - FileHelpers::writeInt(into, bitsOrEntry); - intsToRead--; - } - } - myStringValues[attr] = into.str(); - break; - } - default: - throw ProcessError("Binary file is invalid, attribute type is unknown."); - } - myAttrs.insert(attr); - } -} - - -SUMOSAXAttributesImpl_Binary::~SUMOSAXAttributesImpl_Binary() { -} - - -bool -SUMOSAXAttributesImpl_Binary::hasAttribute(int id) const { - return myAttrs.find(id) != myAttrs.end(); -} - - -bool -SUMOSAXAttributesImpl_Binary::getBool(int id) const { - const std::map::const_iterator i = myCharValues.find(id); - if (i == myCharValues.end()) { - throw EmptyData(); - } - return i->second != 0; -} - - -int -SUMOSAXAttributesImpl_Binary::getInt(int id) const { - const std::map::const_iterator i = myIntValues.find(id); - if (i == myIntValues.end()) { - throw EmptyData(); - } - return i->second; -} - - -long long int -SUMOSAXAttributesImpl_Binary::getLong(int id) const { - return StringUtils::toLong(getString(id)); -} - - -std::string -SUMOSAXAttributesImpl_Binary::getString(int id) const { - const std::map::const_iterator i = myStringValues.find(id); - if (i == myStringValues.end()) { - throw EmptyData(); - } - return i->second; -} - - -std::string -SUMOSAXAttributesImpl_Binary::getStringSecure(int id, - const std::string& str) const { - const std::map::const_iterator i = myStringValues.find(id); - if (i == myStringValues.end()) { - return str; - } - return i->second; -} - - -double -SUMOSAXAttributesImpl_Binary::getFloat(int id) const { - const std::map::const_iterator i = myFloatValues.find(id); - if (i == myFloatValues.end()) { - return StringUtils::toDouble(getString(id)); - } - return i->second; -} - - -double -SUMOSAXAttributesImpl_Binary::getFloat(const std::string& /* id */) const { - throw ProcessError("not implemented for binary data"); -} - - -bool -SUMOSAXAttributesImpl_Binary::hasAttribute(const std::string& /* id */) const { - throw ProcessError("not implemented for binary data"); -} - - -std::string -SUMOSAXAttributesImpl_Binary::getStringSecure(const std::string& /* id */, - const std::string& /* str */) const { - throw ProcessError("not implemented for binary data"); -} - - -SumoXMLEdgeFunc -SUMOSAXAttributesImpl_Binary::getEdgeFunc(bool& ok) const { - const std::map::const_iterator i = myCharValues.find(SUMO_ATTR_FUNCTION); - if (i != myCharValues.end()) { - const char func = i->second; - if (func < (char)SUMOXMLDefinitions::EdgeFunctions.size()) { - return (SumoXMLEdgeFunc)func; - } - ok = false; - } - return EDGEFUNC_NORMAL; -} - - -SumoXMLNodeType -SUMOSAXAttributesImpl_Binary::getNodeType(bool& ok) const { - const std::map::const_iterator i = myCharValues.find(SUMO_ATTR_TYPE); - if (i != myCharValues.end()) { - const char type = i->second; - if (type < (char)SUMOXMLDefinitions::NodeTypes.size()) { - return (SumoXMLNodeType)type; - } - ok = false; - } - return NODETYPE_UNKNOWN; -} - - -RightOfWay -SUMOSAXAttributesImpl_Binary::getRightOfWay(bool& ok) const { - try { - return SUMOXMLDefinitions::RightOfWayValues.get(getString(SUMO_ATTR_RIGHT_OF_WAY)); - } catch (InvalidArgument) { - ok = false; - return RIGHT_OF_WAY_DEFAULT; - } catch (EmptyData) { - return RIGHT_OF_WAY_DEFAULT; - } -} - - -FringeType -SUMOSAXAttributesImpl_Binary::getFringeType(bool& ok) const { - try { - return SUMOXMLDefinitions::FringeTypeValues.get(getString(SUMO_ATTR_FRINGE)); - } catch (InvalidArgument) { - ok = false; - return FRINGE_TYPE_DEFAULT; - } catch (EmptyData) { - return FRINGE_TYPE_DEFAULT; - } -} - - -RGBColor -SUMOSAXAttributesImpl_Binary::getColor() const { - const std::map::const_iterator i = myIntValues.find(SUMO_ATTR_COLOR); - if (i == myIntValues.end()) { - throw EmptyData(); - } - const int val = i->second; - return RGBColor(val & 0xff, (val >> 8) & 0xff, (val >> 16) & 0xff, (val >> 24) & 0xff); -} - - -PositionVector -SUMOSAXAttributesImpl_Binary::getShape(int attr) const { - const std::map::const_iterator i = myPositionVectors.find(attr); - if (i == myPositionVectors.end() || i->second.size() == 0) { - throw EmptyData(); - } - return i->second; -} - - -Boundary -SUMOSAXAttributesImpl_Binary::getBoundary(int attr) const { - const std::map::const_iterator i = myPositionVectors.find(attr); - if (i == myPositionVectors.end() || i->second.size() == 0) { - throw EmptyData(); - } - if (i->second.size() != 2) { - throw FormatException("boundary format"); - } - return Boundary(i->second[0].x(), i->second[0].y(), i->second[1].x(), i->second[1].y()); -} - - -std::string -SUMOSAXAttributesImpl_Binary::getName(int attr) const { - if (myAttrIds.find(attr) == myAttrIds.end()) { - return "?"; - } - return myAttrIds.find(attr)->second; -} - - -void -SUMOSAXAttributesImpl_Binary::serialize(std::ostream& os) const { - for (std::set::const_iterator i = myAttrs.begin(); i != myAttrs.end(); ++i) { - os << " " << getName(*i); - os << "=\"" << getStringSecure(*i, "?") << "\""; - } -} - -std::vector -SUMOSAXAttributesImpl_Binary::getAttributeNames() const { - std::vector result; - for (std::set::const_iterator i = myAttrs.begin(); i != myAttrs.end(); ++i) { - result.push_back(getName(*i)); - } - return result; -} - - -SUMOSAXAttributes* -SUMOSAXAttributesImpl_Binary::clone() const { - std::map attrs; - for (std::map::const_iterator it = myCharValues.begin(); it != myCharValues.end(); ++it) { - const std::string attrName = myAttrIds.find(it->first)->second; - attrs[attrName] = toString(it->second); - } - for (std::map::const_iterator it = myIntValues.begin(); it != myIntValues.end(); ++it) { - const std::string attrName = myAttrIds.find(it->first)->second; - attrs[attrName] = toString(it->second); - } - for (std::map::const_iterator it = myFloatValues.begin(); it != myFloatValues.end(); ++it) { - const std::string attrName = myAttrIds.find(it->first)->second; - attrs[attrName] = toString(it->second); - } - for (std::map::const_iterator it = myStringValues.begin(); it != myStringValues.end(); ++it) { - const std::string attrName = myAttrIds.find(it->first)->second; - attrs[attrName] = it->second; - } - for (std::map::const_iterator it = myPositionVectors.begin(); it != myPositionVectors.end(); ++it) { - const std::string attrName = myAttrIds.find(it->first)->second; - attrs[attrName] = toString(it->second); - } - return new SUMOSAXAttributesImpl_Cached(attrs, myAttrIds, getObjectType()); -} - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Binary.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,327 +0,0 @@ -/****************************************************************************/ -// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo -// Copyright (C) 2007-2020 German Aerospace Center (DLR) and others. -// This program and the accompanying materials are 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 SUMOSAXAttributesImpl_Binary.h -/// @author Daniel Krajzewicz -/// @author Jakob Erdmann -/// @author Michael Behrisch -/// @date Fri, 30 Mar 2007 -/// -// Encapsulated xml-attributes that are retrieved from the sumo-binary-xml format (already typed) -/****************************************************************************/ -#ifndef SUMOSAXAttributesImpl_Binary_h -#define SUMOSAXAttributesImpl_Binary_h - - -// =========================================================================== -// included modules -// =========================================================================== -#include - -#include -#include -#include "SUMOSAXAttributes.h" - - -// =========================================================================== -// class declarations -// =========================================================================== -class BinaryInputDevice; - - -// =========================================================================== -// class definitions -// =========================================================================== -/** - * @class SUMOSAXAttributesImpl_Binary - * @brief Encapsulated Xerces-SAX-attributes - * - * @see SUMOSAXAttributes - */ -class SUMOSAXAttributesImpl_Binary : public SUMOSAXAttributes { -public: - /** @brief Constructor - * - * @param[in] attrs The encapsulated xerces-attributes - * @param[in] predefinedTags Map of attribute ids to their xerces-representation - * @param[in] predefinedTagsMML Map of attribute ids to their (readable) string-representation - */ - SUMOSAXAttributesImpl_Binary(const std::map& predefinedTagsMML, - const std::string& objectType, - BinaryInputDevice* in, const char version); - - /// @brief Destructor - virtual ~SUMOSAXAttributesImpl_Binary(); - - - - - /// @name methods for retrieving attribute values - /// @{ - - /** @brief Returns the information whether the named (by its enum-value) attribute is within the current list - * - * @param[in] id The id of the searched attribute - * @return Whether the attribute is within the attributes - */ - bool hasAttribute(int id) const; - - - /** - * @brief Returns the bool-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2bool. - * If the attribute is empty or ==0, TplConvert::_2bool throws an - * EmptyData-exception which is passed. - * If the value can not be parsed to a bool, TplConvert::_2bool throws a - * BoolFormatException-exception which is passed. - * - * @param[in] id The id of the attribute to return the value of - * @return The attribute's value as a bool, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - * @exception BoolFormatException If the attribute value can not be parsed to a bool - */ - bool getBool(int id) const; - - - /** - * @brief Returns the int-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2int. - * If the attribute is empty or ==0, TplConvert::_2int throws an - * EmptyData-exception which is passed. - * If the value can not be parsed to an int, TplConvert::_2int throws a - * NumberFormatException-exception which is passed. - * - * @param[in] id The id of the attribute to return the value of - * @return The attribute's value as an int, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - * @exception NumberFormatException If the attribute value can not be parsed to an int - */ - int getInt(int id) const; - - - /** - * @brief Returns the long-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2long. - * If the attribute is empty or ==0, TplConvert::_2long throws an - * EmptyData-exception which is passed. - * If the value can not be parsed to a long, TplConvert::_2long throws a - * NumberFormatException-exception which is passed. - * - * @param[in] id The id of the attribute to return the value of - * @return The attribute's value as an int, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - * @exception NumberFormatException If the attribute value can not be parsed to an int - */ - long long int getLong(int id) const; - - - /** - * @brief Returns the string-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2str. - * If the attribute is ==0, TplConvert::_2str throws an - * EmptyData-exception which is passed. - * - * @param[in] id The id of the attribute to return the value of - * @return The attribute's value as a string, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - */ - std::string getString(int id) const; - - /** - * @brief Returns the string-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2strSec. - * If the attribute is ==0, TplConvert::_2strSec returns the default value. - * - * @param[in] id The id of the attribute to return the value of - * @param[in] def The default value to return if the attribute is not in attributes - * @return The attribute's value as a string, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - */ - std::string getStringSecure(int id, - const std::string& def) const; - - - /** - * @brief Returns the double-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2double. - * If the attribute is empty or ==0, TplConvert::_2double throws an - * EmptyData-exception which is passed. - * If the value can not be parsed to a double, TplConvert::_2double throws a - * NumberFormatException-exception which is passed. - * - * @param[in] id The id of the attribute to return the value of - * @return The attribute's value as a float, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - * @exception NumberFormatException If the attribute value can not be parsed to an double - */ - double getFloat(int id) const; - - - /** - * @brief Returns the information whether the named attribute is within the current list - */ - bool hasAttribute(const std::string& id) const; - - - /** - * @brief Returns the double-value of the named attribute - * - * Tries to retrieve the attribute from the the attribute list. The retrieved - * attribute (which may be 0) is then parsed using TplConvert::_2double. - * If the attribute is empty or ==0, TplConvert::_2double throws an - * EmptyData-exception which is passed. - * If the value can not be parsed to a double, TplConvert::_2double throws a - * NumberFormatException-exception which is passed. - * - * @param[in] id The name of the attribute to return the value of - * @return The attribute's value as a float, if it could be read and parsed - * @exception EmptyData If the attribute is not known or the attribute value is an empty string - * @exception NumberFormatException If the attribute value can not be parsed to an double - */ - double getFloat(const std::string& id) const; - - - /** - * @brief Returns the string-value of the named (by its enum-value) attribute - * - * Tries to retrieve the attribute from the the attribute list. - * If the attribute is ==0, TplConvert::_2strSec returns the default value. - * @param[in] id The name of the attribute to return the value of - * @param[in] def The default value to return if the attribute is not in attributes - * @return The attribute's value as a string, if it could be read and parsed - */ - std::string getStringSecure(const std::string& id, - const std::string& def) const; - //} - - - /** - * @brief Returns the value of the named attribute - * - * Tries to retrieve the attribute from the the attribute list. - * @return The attribute's value as a string, if it could be read and parsed - */ - SumoXMLEdgeFunc getEdgeFunc(bool& ok) const; - - - /** - * @brief Returns the value of the named attribute - * - * Tries to retrieve the attribute from the the attribute list. - * @return The attribute's value as a string, if it could be read and parsed - */ - SumoXMLNodeType getNodeType(bool& ok) const; - - /// @brief returns rightOfWay method - RightOfWay getRightOfWay(bool& ok) const; - - /// @brief returns fringe type - FringeType getFringeType(bool& ok) const; - - /** - * @brief Returns the value of the named attribute - * - * Tries to retrieve the attribute from the the attribute list. - * @return The attribute's value as a RGBColor, if it could be read and parsed - */ - RGBColor getColor() const; - - - /** @brief Tries to read given attribute assuming it is a PositionVector - * - * @param[in] attr The id of the attribute to read - * @return The read value if given and not empty; "" if an error occurred - */ - PositionVector getShape(int attr) const; - - - /** @brief Tries to read given attribute assuming it is a Boundary - * - * @param[in] attr The id of the attribute to read - * @return The read value if given and not empty; "" if an error occurred - */ - Boundary getBoundary(int attr) const; - - /** @brief Converts the given attribute id into a man readable string - * - * Returns a "?" if the attribute is not known. - * - * @param[in] attr The id of the attribute to return the name of - * @return The name of the described attribute - */ - std::string getName(int attr) const; - - - /** @brief Prints all attribute names and values into the given stream - * - * @param[in] os The stream to use - */ - void serialize(std::ostream& os) const; - - /** @brief Retrieves all attribute names - */ - std::vector getAttributeNames() const; - - /// @brief return a new deep-copy attributes object - SUMOSAXAttributes* clone() const; - -private: - /// @brief Map of attribute ids to names - const std::map& myAttrIds; - - /// @brief the attributes which are set - std::set myAttrs; - - /// @brief Map of attribute ids to char - std::map myCharValues; - - /// @brief Map of attribute ids to integers - std::map myIntValues; - - /// @brief Map of attribute ids to floats - std::map myFloatValues; - - /// @brief Map of attribute ids to string - std::map myStringValues; - - /// @brief Map of attribute ids to string - std::map myPositionVectors; - - -private: - /// @brief Invalidated copy constructor. - SUMOSAXAttributesImpl_Binary(const SUMOSAXAttributesImpl_Binary& src); - - /// @brief Invalidated assignment operator. - SUMOSAXAttributesImpl_Binary& operator=(const SUMOSAXAttributesImpl_Binary& src); - - -}; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -17,11 +17,6 @@ /// // Encapsulated xml-attributes that use a map from string-attr-names to string-attr-values as backend /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -45,7 +40,7 @@ // =========================================================================== SUMOSAXAttributesImpl_Cached::SUMOSAXAttributesImpl_Cached( const std::map& attrs, - const std::map& predefinedTagsMML, + const std::vector& predefinedTagsMML, const std::string& objectType) : SUMOSAXAttributes(objectType), myAttrs(attrs), @@ -54,7 +49,7 @@ SUMOSAXAttributesImpl_Cached::SUMOSAXAttributesImpl_Cached( const std::map& attrs, - const std::map& predefinedTagsMML, + const std::vector& predefinedTagsMML, const std::string& objectType) : SUMOSAXAttributes(objectType), myPredefinedTagsMML(predefinedTagsMML) { @@ -70,11 +65,9 @@ bool SUMOSAXAttributesImpl_Cached::hasAttribute(int id) const { - std::map::const_iterator i = myPredefinedTagsMML.find(id); - if (i == myPredefinedTagsMML.end()) { - return false; - } - return myAttrs.find((*i).second) != myAttrs.end(); + assert(id >= 0); + assert(id < (int)myPredefinedTagsMML.size()); + return myAttrs.find(myPredefinedTagsMML[id]) != myAttrs.end(); } @@ -117,9 +110,9 @@ const std::string& SUMOSAXAttributesImpl_Cached::getAttributeValueSecure(int id) const { - std::map::const_iterator i = myPredefinedTagsMML.find(id); - assert(i != myPredefinedTagsMML.end()); - return myAttrs.find(i->second)->second; + assert(id >= 0); + assert(id < (int)myPredefinedTagsMML.size()); + return myAttrs.find(myPredefinedTagsMML[id])->second; } @@ -156,7 +149,7 @@ } ok = false; } - return EDGEFUNC_NORMAL; + return SumoXMLEdgeFunc::NORMAL; } @@ -169,7 +162,7 @@ } ok = false; } - return NODETYPE_UNKNOWN; + return SumoXMLNodeType::UNKNOWN; } @@ -182,7 +175,7 @@ } ok = false; } - return RIGHT_OF_WAY_DEFAULT; + return RightOfWay::DEFAULT; } FringeType @@ -194,7 +187,7 @@ } ok = false; } - return FRINGE_TYPE_DEFAULT; + return FringeType::DEFAULT; } RGBColor @@ -242,10 +235,9 @@ std::string SUMOSAXAttributesImpl_Cached::getName(int attr) const { - if (myPredefinedTagsMML.find(attr) == myPredefinedTagsMML.end()) { - return "?"; - } - return myPredefinedTagsMML.find(attr)->second; + assert(attr >= 0); + assert(attr < (int)myPredefinedTagsMML.size()); + return myPredefinedTagsMML[attr]; } @@ -271,5 +263,5 @@ return new SUMOSAXAttributesImpl_Cached(myAttrs, myPredefinedTagsMML, getObjectType()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Cached.h 2020-04-27 21:47:56.000000000 +0000 @@ -17,13 +17,7 @@ /// // Encapsulated xml-attributes that use a map from string-attr-names to string-attr-values as backend /****************************************************************************/ -#ifndef SUMOSAXAttributesImpl_Cached_h -#define SUMOSAXAttributesImpl_Cached_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -53,7 +47,7 @@ * @param[in] objectType object type in string format */ SUMOSAXAttributesImpl_Cached(const std::map& attrs, - const std::map& predefinedTagsMML, + const std::vector& predefinedTagsMML, const std::string& objectType); /** @brief Constructor @@ -63,7 +57,7 @@ * @param[in] objectType object type in string format */ SUMOSAXAttributesImpl_Cached(const std::map& attrs, - const std::map& predefinedTagsMML, + const std::vector& predefinedTagsMML, const std::string& objectType); /// @brief Destructor @@ -289,7 +283,7 @@ std::map myAttrs; /// @brief Map of attribute ids to their (readable) string-representation - const std::map& myPredefinedTagsMML; + const std::vector& myPredefinedTagsMML; private: /// @brief Invalidated copy constructor. @@ -298,9 +292,3 @@ /// @brief Invalidated assignment operator. SUMOSAXAttributesImpl_Cached& operator=(const SUMOSAXAttributesImpl_Cached& src) = delete; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -44,8 +39,8 @@ // class definitions // =========================================================================== SUMOSAXAttributesImpl_Xerces::SUMOSAXAttributesImpl_Xerces(const XERCES_CPP_NAMESPACE::Attributes& attrs, - const std::map& predefinedTags, - const std::map& predefinedTagsMML, + const std::vector& predefinedTags, + const std::vector& predefinedTagsMML, const std::string& objectType) : SUMOSAXAttributes(objectType), myAttrs(attrs), @@ -59,11 +54,9 @@ bool SUMOSAXAttributesImpl_Xerces::hasAttribute(int id) const { - AttrMap::const_iterator i = myPredefinedTags.find(id); - if (i == myPredefinedTags.end()) { - return false; - } - return myAttrs.getIndex((*i).second) >= 0; + assert(id >= 0); + assert(id < (int)myPredefinedTags.size()); + return myAttrs.getIndex(myPredefinedTags[id]) >= 0; } @@ -111,9 +104,9 @@ const XMLCh* SUMOSAXAttributesImpl_Xerces::getAttributeValueSecure(int id) const { - AttrMap::const_iterator i = myPredefinedTags.find(id); - assert(i != myPredefinedTags.end()); - return myAttrs.getValue((*i).second); + assert(id >= 0); + assert(id < (int)myPredefinedTags.size()); + return myAttrs.getValue(myPredefinedTags[id]); } @@ -158,7 +151,7 @@ } ok = false; } - return EDGEFUNC_NORMAL; + return SumoXMLEdgeFunc::NORMAL; } @@ -171,7 +164,7 @@ } ok = false; } - return NODETYPE_UNKNOWN; + return SumoXMLNodeType::UNKNOWN; } RightOfWay @@ -183,7 +176,7 @@ } ok = false; } - return RIGHT_OF_WAY_DEFAULT; + return RightOfWay::DEFAULT; } FringeType @@ -195,7 +188,7 @@ } ok = false; } - return FRINGE_TYPE_DEFAULT; + return FringeType::DEFAULT; } RGBColor @@ -243,10 +236,9 @@ std::string SUMOSAXAttributesImpl_Xerces::getName(int attr) const { - if (myPredefinedTagsMML.find(attr) == myPredefinedTagsMML.end()) { - return "?"; - } - return myPredefinedTagsMML.find(attr)->second; + assert(attr >= 0); + assert(attr < (int)myPredefinedTagsMML.size()); + return myPredefinedTagsMML[attr]; } @@ -278,5 +270,5 @@ return new SUMOSAXAttributesImpl_Cached(attrs, myPredefinedTagsMML, getObjectType()); } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXAttributesImpl_Xerces.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // Encapsulated Xerces-SAX-attributes /****************************************************************************/ -#ifndef SUMOSAXAttributesImpl_Xerces_h -#define SUMOSAXAttributesImpl_Xerces_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -55,8 +49,8 @@ * @param[in] predefinedTagsMML Map of attribute ids to their (readable) string-representation */ SUMOSAXAttributesImpl_Xerces(const XERCES_CPP_NAMESPACE::Attributes& attrs, - const std::map& predefinedTags, - const std::map& predefinedTagsMML, + const std::vector& predefinedTags, + const std::vector& predefinedTagsMML, const std::string& objectType); @@ -302,13 +296,12 @@ const XERCES_CPP_NAMESPACE::Attributes& myAttrs; /// @brief Definition of a map of attribute ids to their xerces-representation - typedef std::map AttrMap; + typedef std::vector AttrMap; /// @brief Map of attribute ids to their xerces-representation const AttrMap& myPredefinedTags; /// @brief Map of attribute ids to their (readable) string-representation - const std::map& myPredefinedTagsMML; - + const std::vector& myPredefinedTagsMML; private: /// @brief Invalidated copy constructor. @@ -319,9 +312,3 @@ }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXHandler.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXHandler.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXHandler.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXHandler.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // SAX-handler base for SUMO-files /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -45,4 +40,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXHandler.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXHandler.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXHandler.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXHandler.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // SAX-handler base for SUMO-files /****************************************************************************/ -#ifndef SUMOSAXHandler_h -#define SUMOSAXHandler_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -64,9 +58,3 @@ const SUMOSAXHandler& operator=(const SUMOSAXHandler& s); }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXReader.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXReader.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXReader.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXReader.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // SAX-reader encapsulation containing binary reader /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -33,12 +28,10 @@ #include #include +#include #include #include #include -#include -#include -#include "SUMOSAXAttributesImpl_Binary.h" #include "GenericSAXHandler.h" #ifdef HAVE_ZLIB #include @@ -51,14 +44,13 @@ // method definitions // =========================================================================== SUMOSAXReader::SUMOSAXReader(GenericSAXHandler& handler, const XERCES_CPP_NAMESPACE::SAX2XMLReader::ValSchemes validationScheme) - : myHandler(nullptr), myValidationScheme(validationScheme), myXMLReader(nullptr), myBinaryInput(nullptr), myIStream(nullptr), myInputStream(nullptr) { + : myHandler(nullptr), myValidationScheme(validationScheme), myXMLReader(nullptr), myIStream(nullptr), myInputStream(nullptr) { setHandler(handler); } SUMOSAXReader::~SUMOSAXReader() { delete myXMLReader; - delete myBinaryInput; } @@ -93,27 +85,21 @@ void SUMOSAXReader::parse(std::string systemID) { - if (systemID.length() >= 4 && systemID.substr(systemID.length() - 4) == ".sbx") { - if (parseFirst(systemID)) { - while (parseNext()); - } - } else { - if (myXMLReader == nullptr) { - myXMLReader = getSAXReader(); - } - if (!FileHelpers::isReadable(systemID)) { - throw ProcessError("Cannot read file '" + systemID + "'!"); - } - if (FileHelpers::isDirectory(systemID)) { - throw ProcessError("File '" + systemID + "' is a directory!"); - } + if (myXMLReader == nullptr) { + myXMLReader = getSAXReader(); + } + if (!FileHelpers::isReadable(systemID)) { + throw ProcessError("Cannot read file '" + systemID + "'!"); + } + if (FileHelpers::isDirectory(systemID)) { + throw ProcessError("File '" + systemID + "' is a directory!"); + } #ifdef HAVE_ZLIB - zstr::ifstream istream(systemID.c_str(), std::fstream::in | std::fstream::binary); - myXMLReader->parse(IStreamInputSource(istream)); + zstr::ifstream istream(systemID.c_str(), std::fstream::in | std::fstream::binary); + myXMLReader->parse(IStreamInputSource(istream)); #else - myXMLReader->parse(systemID.c_str()); + myXMLReader->parse(systemID.c_str()); #endif - } } @@ -129,95 +115,29 @@ bool SUMOSAXReader::parseFirst(std::string systemID) { - if (systemID.length() >= 4 && systemID.substr(systemID.length() - 4) == ".sbx") { - myBinaryInput = new BinaryInputDevice(systemID, true, myValidationScheme == XERCES_CPP_NAMESPACE::SAX2XMLReader::Val_Always); - *myBinaryInput >> mySbxVersion; - if (mySbxVersion < 1 || mySbxVersion > 2) { - throw ProcessError("Unknown sbx version"); - } - std::string sumoVer; - *myBinaryInput >> sumoVer; - std::vector elems; - *myBinaryInput >> elems; - // !!! check elems here - elems.clear(); - *myBinaryInput >> elems; - // !!! check attrs here - elems.clear(); - *myBinaryInput >> elems; - // !!! check node types here - elems.clear(); - *myBinaryInput >> elems; - // !!! check edge types here - elems.clear(); - *myBinaryInput >> elems; - // !!! check edges here - std::vector< std::vector > followers; - *myBinaryInput >> followers; - // !!! check followers here - return parseNext(); - } else { - if (!FileHelpers::isReadable(systemID)) { - throw ProcessError("Cannot read file '" + systemID + "'!"); - } - if (myXMLReader == nullptr) { - myXMLReader = getSAXReader(); - } - myToken = XERCES_CPP_NAMESPACE::XMLPScanToken(); + if (!FileHelpers::isReadable(systemID)) { + throw ProcessError("Cannot read file '" + systemID + "'!"); + } + if (myXMLReader == nullptr) { + myXMLReader = getSAXReader(); + } + myToken = XERCES_CPP_NAMESPACE::XMLPScanToken(); #ifdef HAVE_ZLIB - myIStream = std::unique_ptr(new zstr::ifstream(systemID.c_str(), std::fstream::in | std::fstream::binary)); - myInputStream = std::unique_ptr(new IStreamInputSource(*myIStream)); - return myXMLReader->parseFirst(*myInputStream, myToken); + myIStream = std::unique_ptr(new zstr::ifstream(systemID.c_str(), std::fstream::in | std::fstream::binary)); + myInputStream = std::unique_ptr(new IStreamInputSource(*myIStream)); + return myXMLReader->parseFirst(*myInputStream, myToken); #else - return myXMLReader->parseFirst(systemID.c_str(), myToken); + return myXMLReader->parseFirst(systemID.c_str(), myToken); #endif - } } bool SUMOSAXReader::parseNext() { - if (myBinaryInput != nullptr) { - int next = myBinaryInput->peek(); - switch (next) { - case EOF: - delete myBinaryInput; - myBinaryInput = nullptr; - return false; - case BinaryFormatter::BF_XML_TAG_START: { - int tag; - unsigned char tagByte; - *myBinaryInput >> tagByte; - tag = tagByte; - if (mySbxVersion > 1) { - myBinaryInput->putback(BinaryFormatter::BF_BYTE); - *myBinaryInput >> tagByte; - tag += 256 * tagByte; - } - myXMLStack.push_back((SumoXMLTag)tag); - SUMOSAXAttributesImpl_Binary attrs(myHandler->myPredefinedTagsMML, toString((SumoXMLTag)tag), myBinaryInput, mySbxVersion); - myHandler->myStartElement(tag, attrs); - break; - } - case BinaryFormatter::BF_XML_TAG_END: { - if (myXMLStack.empty()) { - throw ProcessError("Binary file is invalid, unexpected tag end."); - } - myHandler->myEndElement(myXMLStack.back()); - myXMLStack.pop_back(); - myBinaryInput->read(mySbxVersion > 1 ? 1 : 2); - break; - } - default: - throw ProcessError("Binary file is invalid, expected tag start or tag end."); - } - return true; - } else { - if (myXMLReader == nullptr) { - throw ProcessError("The XML-parser was not initialized."); - } - return myXMLReader->parseNext(myToken); + if (myXMLReader == nullptr) { + throw ProcessError("The XML-parser was not initialized."); } + return myXMLReader->parseNext(myToken); } diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXReader.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXReader.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOSAXReader.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOSAXReader.h 2020-04-27 21:47:56.000000000 +0000 @@ -19,13 +19,7 @@ /// // SAX-reader encapsulation containing binary reader /****************************************************************************/ -#ifndef SUMOSAXReader_h -#define SUMOSAXReader_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -41,7 +35,6 @@ // class declarations // =========================================================================== class GenericSAXHandler; -class BinaryInputDevice; class IStreamInputSource; @@ -118,14 +111,10 @@ XERCES_CPP_NAMESPACE::SAX2XMLReader* myXMLReader; - BinaryInputDevice* myBinaryInput; - std::unique_ptr myIStream; std::unique_ptr myInputStream; - char mySbxVersion; - /// @brief The stack of begun xml elements std::vector myXMLStack; @@ -139,8 +128,3 @@ const SUMOSAXReader& operator=(const SUMOSAXReader& s); }; - - -#endif - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.cpp sumo-1.6.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -22,11 +22,6 @@ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -103,6 +98,7 @@ { "flowState", SUMO_TAG_FLOWSTATE }, { "step", SUMO_TAG_STEP }, { "interval", SUMO_TAG_INTERVAL }, + { "edgeRelation", SUMO_TAG_EDGEREL }, { "timedEvent", SUMO_TAG_TIMEDEVENT }, { "fromEdge", SUMO_TAG_FROMEDGE }, { "toEdge", SUMO_TAG_TOEDGE }, @@ -112,7 +108,7 @@ { "wautSwitch", SUMO_TAG_WAUT_SWITCH }, { "wautJunction", SUMO_TAG_WAUT_JUNCTION }, { "segment", SUMO_TAG_SEGMENT }, - { "delete", SUMO_TAG_DELETE }, + { "delete", SUMO_TAG_DEL }, { "stop", SUMO_TAG_STOP }, { "stopBusStop", SUMO_TAG_STOP_BUSSTOP }, { "stopContainerStop", SUMO_TAG_STOP_CONTAINERSTOP }, @@ -174,6 +170,7 @@ { "scalingScheme", SUMO_TAG_SCALINGSCHEME }, { "entry", SUMO_TAG_ENTRY }, { "rngState", SUMO_TAG_RNGSTATE }, + { "rngLane", SUMO_TAG_RNGLANE }, { "vehicleTransfer", SUMO_TAG_VEHICLETRANSFER }, { "device", SUMO_TAG_DEVICE }, // Cars @@ -210,6 +207,9 @@ { "rideBusStop", SUMO_TAG_RIDE_BUSSTOP }, { "personStopBusStop", SUMO_TAG_PERSONSTOP_BUSSTOP }, { "personStopLane", SUMO_TAG_PERSONSTOP_LANE }, + // Data (Netedit) + { "dataSet", SUMO_TAG_DATASET }, + { "dataInterval", SUMO_TAG_DATAINTERVAL }, // Transport { "container", SUMO_TAG_CONTAINER }, { "transport", SUMO_TAG_TRANSPORT }, @@ -246,14 +246,55 @@ StringBijection::Entry SUMOXMLDefinitions::attrs[] = { + // meandata + { "sampledSeconds", SUMO_ATTR_SAMPLEDSECONDS }, + { "density", SUMO_ATTR_DENSITY }, + { "laneDensity", SUMO_ATTR_LANEDENSITY }, + { "occupancy", SUMO_ATTR_OCCUPANCY }, + { "waitingTime", SUMO_ATTR_WAITINGTIME }, + { "speed", SUMO_ATTR_SPEED }, + { "departed", SUMO_ATTR_DEPARTED }, + { "arrived", SUMO_ATTR_ARRIVED }, + { "entered", SUMO_ATTR_ENTERED }, + { "left", SUMO_ATTR_LEFT }, + { "vaporized", SUMO_ATTR_VAPORIZED }, + { "traveltime", SUMO_ATTR_TRAVELTIME }, + { "laneChangedFrom", SUMO_ATTR_LANECHANGEDFROM }, + { "laneChangedTo", SUMO_ATTR_LANECHANGEDTO }, + { "overlapTraveltime", SUMO_ATTR_OVERLAPTRAVELTIME }, + { "CO_abs", SUMO_ATTR_CO_ABS }, + { "CO2_abs", SUMO_ATTR_CO2_ABS }, + { "HC_abs", SUMO_ATTR_HC_ABS }, + { "PMx_abs", SUMO_ATTR_PMX_ABS }, + { "NOx_abs", SUMO_ATTR_NOX_ABS }, + { "fuel_abs", SUMO_ATTR_FUEL_ABS }, + { "electricity_abs", SUMO_ATTR_ELECTRICITY_ABS }, + { "CO_normed", SUMO_ATTR_CO_NORMED }, + { "CO2_normed", SUMO_ATTR_CO2_NORMED }, + { "HC_normed", SUMO_ATTR_HC_NORMED }, + { "PMx_normed", SUMO_ATTR_PMX_NORMED }, + { "NOx_normed", SUMO_ATTR_NOX_NORMED }, + { "fuel_normed", SUMO_ATTR_FUEL_NORMED }, + { "electricity_normed", SUMO_ATTR_ELECTRICITY_NORMED }, + { "CO_perVeh", SUMO_ATTR_CO_PERVEH }, + { "CO2_perVeh", SUMO_ATTR_CO2_PERVEH }, + { "HC_perVeh", SUMO_ATTR_HC_PERVEH }, + { "PMx_perVeh", SUMO_ATTR_PMX_PERVEH }, + { "NOx_perVeh", SUMO_ATTR_NOX_PERVEH }, + { "fuel_perVeh", SUMO_ATTR_FUEL_PERVEH }, + { "electricity_perVeh", SUMO_ATTR_ELECTRICITY_PERVEH }, + { "noise", SUMO_ATTR_NOISE }, + { "amount", SUMO_ATTR_AMOUNT }, + { "averageSpeed", SUMO_ATTR_AVERAGESPEED }, + // Edge { "id", SUMO_ATTR_ID }, { "refId", SUMO_ATTR_REFID }, { "name", SUMO_ATTR_NAME }, { "type", SUMO_ATTR_TYPE }, + { "version", SUMO_ATTR_VERSION }, { "priority", SUMO_ATTR_PRIORITY }, { "numLanes", SUMO_ATTR_NUMLANES }, - { "speed", SUMO_ATTR_SPEED }, { "oneway", SUMO_ATTR_ONEWAY }, { "width", SUMO_ATTR_WIDTH }, { "widthResolution", SUMO_ATTR_WIDTHRESOLUTION }, @@ -447,6 +488,7 @@ { "costs", SUMO_ATTR_COSTS }, { "savings", SUMO_ATTR_SAVINGS }, { "probability", SUMO_ATTR_PROB }, + { "count", SUMO_ATTR_COUNT }, { "probabilities", SUMO_ATTR_PROBS }, { "routes", SUMO_ATTR_ROUTES }, { "vTypes", SUMO_ATTR_VTYPES }, @@ -462,11 +504,13 @@ { "fromJunction", SUMO_ATTR_FROMJUNCTION }, { "toJunction", SUMO_ATTR_TOJUNCTION }, { "period", SUMO_ATTR_PERIOD }, + { "repeat", SUMO_ATTR_REPEAT }, { "fromTaz", SUMO_ATTR_FROM_TAZ }, { "toTaz", SUMO_ATTR_TO_TAZ }, { "reroute", SUMO_ATTR_REROUTE }, { "personCapacity", SUMO_ATTR_PERSON_CAPACITY }, { "containerCapacity", SUMO_ATTR_CONTAINER_CAPACITY }, + { "parkingLength", SUMO_ATTR_PARKING_LENGTH }, { "personNumber", SUMO_ATTR_PERSON_NUMBER }, { "containerNumber", SUMO_ATTR_CONTAINER_NUMBER }, { "modes", SUMO_ATTR_MODES }, @@ -482,6 +526,7 @@ { "number", SUMO_ATTR_NUMBER }, { "duration", SUMO_ATTR_DURATION }, { "until", SUMO_ATTR_UNTIL }, + { "arrival", SUMO_ATTR_ARRIVAL }, { "extension", SUMO_ATTR_EXTENSION }, { "routeProbe", SUMO_ATTR_ROUTEPROBE }, { "crossingEdges", SUMO_ATTR_CROSSING_EDGES }, @@ -592,6 +637,7 @@ { "detectPersons", SUMO_ATTR_DETECT_PERSONS }, { "maxTraveltime", SUMO_ATTR_MAX_TRAVELTIME }, { "minSamples", SUMO_ATTR_MIN_SAMPLES }, + { "writeAttributes", SUMO_ATTR_WRITE_ATTRIBUTES }, { "lon", SUMO_ATTR_LON }, { "lat", SUMO_ATTR_LAT }, @@ -653,7 +699,6 @@ { "generateWalks", SUMO_ATTR_GENERATE_WALKS }, { "actType", SUMO_ATTR_ACTTYPE }, { "slope", SUMO_ATTR_SLOPE }, - { "version", SUMO_ATTR_VERSION }, { "junctionCornerDetail", SUMO_ATTR_CORNERDETAIL }, { "junctionLinkDetail", SUMO_ATTR_LINKDETAIL }, { "rectangularLaneCut", SUMO_ATTR_RECTANGULAR_LANE_CUT }, @@ -670,7 +715,6 @@ { "vehicleClass", SUMO_ATTR_VEHICLECLASS }, { "fuel", SUMO_ATTR_FUEL }, { "acceleration", SUMO_ATTR_ACCELERATION }, - { "amount", SUMO_ATTR_AMOUNT }, { "origin", SUMO_ATTR_ORIGIN }, { "destination", SUMO_ATTR_DESTINATION }, { "visible", SUMO_ATTR_VISIBLE }, @@ -722,6 +766,7 @@ { "blockShape", GNE_ATTR_BLOCK_SHAPE }, { "closedShape", GNE_ATTR_CLOSE_SHAPE }, { "parentItem", GNE_ATTR_PARENT }, + { "dataSet", GNE_ATTR_DATASET }, { "genericParameter", GNE_ATTR_PARAMETERS }, { "defaultVTypeModified", GNE_ATTR_DEFAULT_VTYPE_MODIFIED }, { "centerAfterCreation", GNE_ATTR_CENTER_AFTER_CREATION }, @@ -743,6 +788,7 @@ { "insertionControl", SUMO_ATTR_RNG_INSERTIONCONTROL }, { "device", SUMO_ATTR_RNG_DEVICE }, { "device.btreceiver", SUMO_ATTR_RNG_DEVICE_BT }, + { "device.toc", SUMO_ATTR_RNG_DEVICE_TOC }, { "driverState", SUMO_ATTR_RNG_DRIVERSTATE }, // @} @@ -755,57 +801,58 @@ StringBijection::Entry SUMOXMLDefinitions::sumoNodeTypeValues[] = { - {"traffic_light", NODETYPE_TRAFFIC_LIGHT}, - {"traffic_light_unregulated", NODETYPE_TRAFFIC_LIGHT_NOJUNCTION}, - {"traffic_light_right_on_red", NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED}, - {"rail_signal", NODETYPE_RAIL_SIGNAL}, - {"rail_crossing", NODETYPE_RAIL_CROSSING}, - {"priority", NODETYPE_PRIORITY}, - {"priority_stop", NODETYPE_PRIORITY_STOP}, - {"right_before_left", NODETYPE_RIGHT_BEFORE_LEFT}, - {"allway_stop", NODETYPE_ALLWAY_STOP}, - {"zipper", NODETYPE_ZIPPER}, - {"district", NODETYPE_DISTRICT}, - {"unregulated", NODETYPE_NOJUNCTION}, - {"internal", NODETYPE_INTERNAL}, - {"dead_end", NODETYPE_DEAD_END}, - {"DEAD_END", NODETYPE_DEAD_END_DEPRECATED}, - {"unknown", NODETYPE_UNKNOWN} //< must be the last one + {"traffic_light", SumoXMLNodeType::TRAFFIC_LIGHT}, + {"traffic_light_unregulated", SumoXMLNodeType::TRAFFIC_LIGHT_NOJUNCTION}, + {"traffic_light_right_on_red", SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED}, + {"rail_signal", SumoXMLNodeType::RAIL_SIGNAL}, + {"rail_crossing", SumoXMLNodeType::RAIL_CROSSING}, + {"priority", SumoXMLNodeType::PRIORITY}, + {"priority_stop", SumoXMLNodeType::PRIORITY_STOP}, + {"right_before_left", SumoXMLNodeType::RIGHT_BEFORE_LEFT}, + {"allway_stop", SumoXMLNodeType::ALLWAY_STOP}, + {"zipper", SumoXMLNodeType::ZIPPER}, + {"district", SumoXMLNodeType::DISTRICT}, + {"unregulated", SumoXMLNodeType::NOJUNCTION}, + {"internal", SumoXMLNodeType::INTERNAL}, + {"dead_end", SumoXMLNodeType::DEAD_END}, + {"DEAD_END", SumoXMLNodeType::DEAD_END_DEPRECATED}, + {"unknown", SumoXMLNodeType::UNKNOWN} //< must be the last one }; StringBijection::Entry SUMOXMLDefinitions::sumoEdgeFuncValues[] = { - {"unknown", EDGEFUNC_UNKNOWN}, - {"normal", EDGEFUNC_NORMAL}, - {"connector", EDGEFUNC_CONNECTOR}, - {"crossing", EDGEFUNC_CROSSING}, - {"walkingarea", EDGEFUNC_WALKINGAREA}, - {"internal", EDGEFUNC_INTERNAL} //< must be the last one + {"unknown", SumoXMLEdgeFunc::UNKNOWN}, + {"normal", SumoXMLEdgeFunc::NORMAL}, + {"connector", SumoXMLEdgeFunc::CONNECTOR}, + {"crossing", SumoXMLEdgeFunc::CROSSING}, + {"walkingarea", SumoXMLEdgeFunc::WALKINGAREA}, + {"internal", SumoXMLEdgeFunc::INTERNAL} //< must be the last one }; StringBijection::Entry SUMOXMLDefinitions::laneSpreadFunctionValues[] = { - {"right", LANESPREAD_RIGHT }, // default - {"center", LANESPREAD_CENTER } //< must be the last one + {"right", LaneSpreadFunction::RIGHT }, // default: geometry is left edge border, lanes flare to the right + {"roadCenter", LaneSpreadFunction::ROADCENTER }, // geometry is center of the bidirectional road + {"center", LaneSpreadFunction::CENTER } // geometry is center of the edge (must be the last one) }; StringBijection::Entry SUMOXMLDefinitions::rightOfWayValuesInitializer[] = { - {"edgePriority", RIGHT_OF_WAY_EDGEPRIORITY }, - {"default", RIGHT_OF_WAY_DEFAULT } // default (must be the last one) + {"edgePriority", RightOfWay::EDGEPRIORITY }, + {"default", RightOfWay::DEFAULT } // default (must be the last one) }; StringBijection::Entry SUMOXMLDefinitions::fringeTypeValuesInitializer[] = { - {"outer", FRINGE_TYPE_OUTER }, - {"inner", FRINGE_TYPE_INNER }, - {"default", FRINGE_TYPE_DEFAULT } // default (must be the last one) + {"outer", FringeType::OUTER }, + {"inner", FringeType::INNER }, + {"default", FringeType::DEFAULT } // default (must be the last one) }; StringBijection::Entry SUMOXMLDefinitions::personModeValuesInitializer[] = { - {"none", PERSONMODE_NONE}, - {"walk", PERSONMODE_WALK}, - {"bicycle", PERSONMODE_BICYCLE }, - {"car", PERSONMODE_CAR }, - {"public", PERSONMODE_PUBLIC} // (must be the last one) + {"none", PersonMode::NONE}, + {"walk", PersonMode::WALK}, + {"bicycle", PersonMode::BICYCLE }, + {"car", PersonMode::CAR }, + {"public", PersonMode::PUBLIC} // (must be the last one) }; StringBijection::Entry SUMOXMLDefinitions::linkStateValues[] = { @@ -829,7 +876,7 @@ const char SUMOXMLDefinitions::AllowedTLS_linkStatesInitializer[] = { LINKSTATE_TL_GREEN_MAJOR, LINKSTATE_TL_GREEN_MINOR, - LINKSTATE_STOP, // used for NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED + LINKSTATE_STOP, // used for SumoXMLNodeType::TRAFFIC_LIGHT_RIGHT_ON_RED LINKSTATE_TL_RED, LINKSTATE_TL_REDYELLOW, LINKSTATE_TL_YELLOW_MAJOR, @@ -840,32 +887,32 @@ const std::string SUMOXMLDefinitions::ALLOWED_TLS_LINKSTATES(AllowedTLS_linkStatesInitializer, 9); StringBijection::Entry SUMOXMLDefinitions::linkDirectionValues[] = { - { "s", LINKDIR_STRAIGHT }, - { "t", LINKDIR_TURN }, - { "T", LINKDIR_TURN_LEFTHAND }, - { "l", LINKDIR_LEFT }, - { "r", LINKDIR_RIGHT }, - { "L", LINKDIR_PARTLEFT }, - { "R", LINKDIR_PARTRIGHT }, - { "invalid", LINKDIR_NODIR } //< must be the last one + { "s", LinkDirection::STRAIGHT }, + { "t", LinkDirection::TURN }, + { "T", LinkDirection::TURN_LEFTHAND }, + { "l", LinkDirection::LEFT }, + { "r", LinkDirection::RIGHT }, + { "L", LinkDirection::PARTLEFT }, + { "R", LinkDirection::PARTRIGHT }, + { "invalid", LinkDirection::NODIR } //< must be the last one }; StringBijection::Entry SUMOXMLDefinitions::trafficLightTypesValues[] = { - { "static", TLTYPE_STATIC }, - { "railSignal", TLTYPE_RAIL_SIGNAL }, - { "railCrossing", TLTYPE_RAIL_CROSSING }, - { "actuated", TLTYPE_ACTUATED }, - { "delay_based", TLTYPE_DELAYBASED }, - { "sotl_phase", TLTYPE_SOTL_PHASE }, - { "sotl_platoon", TLTYPE_SOTL_PLATOON }, - { "sotl_request", TLTYPE_SOTL_REQUEST }, - { "sotl_wave", TLTYPE_SOTL_WAVE }, - { "sotl_marching", TLTYPE_SOTL_MARCHING }, - { "swarm", TLTYPE_SWARM_BASED }, - { "deterministic", TLTYPE_HILVL_DETERMINISTIC }, - { "off", TLTYPE_OFF }, - { "", TLTYPE_INVALID } //< must be the last one + { "static", TrafficLightType::STATIC }, + { "railSignal", TrafficLightType::RAIL_SIGNAL }, + { "railCrossing", TrafficLightType::RAIL_CROSSING }, + { "actuated", TrafficLightType::ACTUATED }, + { "delay_based", TrafficLightType::DELAYBASED }, + { "sotl_phase", TrafficLightType::SOTL_PHASE }, + { "sotl_platoon", TrafficLightType::SOTL_PLATOON }, + { "sotl_request", TrafficLightType::SOTL_REQUEST }, + { "sotl_wave", TrafficLightType::SOTL_WAVE }, + { "sotl_marching", TrafficLightType::SOTL_MARCHING }, + { "swarm", TrafficLightType::SWARM_BASED }, + { "deterministic", TrafficLightType::HILVL_DETERMINISTIC }, + { "off", TrafficLightType::OFF }, + { "", TrafficLightType::INVALID } //< must be the last one }; @@ -946,31 +993,31 @@ SUMOXMLDefinitions::attrs, SUMO_ATTR_NOTHING); StringBijection SUMOXMLDefinitions::NodeTypes( - SUMOXMLDefinitions::sumoNodeTypeValues, NODETYPE_UNKNOWN); + SUMOXMLDefinitions::sumoNodeTypeValues, SumoXMLNodeType::UNKNOWN); StringBijection SUMOXMLDefinitions::EdgeFunctions( - SUMOXMLDefinitions::sumoEdgeFuncValues, EDGEFUNC_INTERNAL); + SUMOXMLDefinitions::sumoEdgeFuncValues, SumoXMLEdgeFunc::INTERNAL); StringBijection SUMOXMLDefinitions::LaneSpreadFunctions( - SUMOXMLDefinitions::laneSpreadFunctionValues, LANESPREAD_CENTER); + SUMOXMLDefinitions::laneSpreadFunctionValues, LaneSpreadFunction::CENTER); StringBijection SUMOXMLDefinitions::RightOfWayValues( - SUMOXMLDefinitions::rightOfWayValuesInitializer, RIGHT_OF_WAY_DEFAULT); + SUMOXMLDefinitions::rightOfWayValuesInitializer, RightOfWay::DEFAULT); StringBijection SUMOXMLDefinitions::FringeTypeValues( - SUMOXMLDefinitions::fringeTypeValuesInitializer, FRINGE_TYPE_DEFAULT); + SUMOXMLDefinitions::fringeTypeValuesInitializer, FringeType::DEFAULT); StringBijection SUMOXMLDefinitions::PersonModeValues( - SUMOXMLDefinitions::personModeValuesInitializer, PERSONMODE_PUBLIC); + SUMOXMLDefinitions::personModeValuesInitializer, PersonMode::PUBLIC); StringBijection SUMOXMLDefinitions::LinkStates( SUMOXMLDefinitions::linkStateValues, LINKSTATE_DEADEND); StringBijection SUMOXMLDefinitions::LinkDirections( - SUMOXMLDefinitions::linkDirectionValues, LINKDIR_NODIR); + SUMOXMLDefinitions::linkDirectionValues, LinkDirection::NODIR); StringBijection SUMOXMLDefinitions::TrafficLightTypes( - SUMOXMLDefinitions::trafficLightTypesValues, TLTYPE_INVALID); + SUMOXMLDefinitions::trafficLightTypesValues, TrafficLightType::INVALID); StringBijection SUMOXMLDefinitions::LaneChangeModels( SUMOXMLDefinitions::laneChangeModelValues, LCM_DEFAULT); @@ -1094,5 +1141,5 @@ return true; } -/****************************************************************************/ +/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.h sumo-1.6.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.h --- sumo-1.5.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/SUMOXMLDefinitions.h 2020-04-27 21:47:56.000000000 +0000 @@ -22,13 +22,7 @@ /// // Definitions of elements and attributes known by SUMO /****************************************************************************/ -#ifndef SUMOXMLDefinitions_h -#define SUMOXMLDefinitions_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -169,6 +163,8 @@ SUMO_TAG_STEP, /// @brief an aggreagated-output interval SUMO_TAG_INTERVAL, + /// @brief a relation between two edges + SUMO_TAG_EDGEREL, /// @brief The definition of a periodic event SUMO_TAG_TIMEDEVENT, /// @brief Incoming edge specification (jtrrouter) @@ -184,8 +180,8 @@ SUMO_TAG_WAUT_JUNCTION, /// @brief segment of a lane SUMO_TAG_SEGMENT, - /// @brief delete certain element - SUMO_TAG_DELETE, + /// @brief delete certain element (note: DELETE is a macro) + SUMO_TAG_DEL, /// @brief stop for vehicles SUMO_TAG_STOP, /// @brief stop placed over a lane (used in netedit) @@ -276,6 +272,7 @@ SUMO_TAG_SCALINGSCHEME, SUMO_TAG_ENTRY, SUMO_TAG_RNGSTATE, + SUMO_TAG_RNGLANE, /// @} SUMO_TAG_VEHICLETRANSFER, @@ -324,6 +321,12 @@ SUMO_TAG_PERSONSTOP_LANE, /// @} + /// @name Data elements (used by Netedit) + /// @{ + SUMO_TAG_DATASET, + SUMO_TAG_DATAINTERVAL, + /// @} + SUMO_TAG_CONTAINER, SUMO_TAG_TRANSPORT, SUMO_TAG_TRANSHIP, @@ -382,7 +385,55 @@ */ enum SumoXMLAttr { /// @brief invalid attribute - SUMO_ATTR_NOTHING, + SUMO_ATTR_NOTHING = 0, + + /// @name meanData output attributes + /// @note: sorted first to simplify filtering written attributes with bit operations + /// @{ + /// MSMeanData_Net + SUMO_ATTR_SAMPLEDSECONDS = 1, + SUMO_ATTR_DENSITY = 2, + SUMO_ATTR_LANEDENSITY = 3, + SUMO_ATTR_OCCUPANCY = 4, + SUMO_ATTR_WAITINGTIME = 5, + SUMO_ATTR_SPEED = 6, + SUMO_ATTR_DEPARTED = 7, + SUMO_ATTR_ARRIVED = 8, + SUMO_ATTR_ENTERED = 9, + SUMO_ATTR_LEFT = 10, + SUMO_ATTR_VAPORIZED = 11, + SUMO_ATTR_TRAVELTIME = 12, + SUMO_ATTR_LANECHANGEDFROM = 13, + SUMO_ATTR_LANECHANGEDTO = 14, + SUMO_ATTR_OVERLAPTRAVELTIME = 15, + /// MSMeanData_Emissions + SUMO_ATTR_CO_ABS = 16, + SUMO_ATTR_CO2_ABS = 17, + SUMO_ATTR_HC_ABS = 18, + SUMO_ATTR_PMX_ABS = 19, + SUMO_ATTR_NOX_ABS = 20, + SUMO_ATTR_FUEL_ABS = 21, + SUMO_ATTR_ELECTRICITY_ABS = 22, + SUMO_ATTR_CO_NORMED = 23, + SUMO_ATTR_CO2_NORMED = 24, + SUMO_ATTR_HC_NORMED = 25, + SUMO_ATTR_PMX_NORMED = 26, + SUMO_ATTR_NOX_NORMED = 27, + SUMO_ATTR_FUEL_NORMED = 28, + SUMO_ATTR_ELECTRICITY_NORMED = 29, + SUMO_ATTR_CO_PERVEH = 30, + SUMO_ATTR_CO2_PERVEH = 31, + SUMO_ATTR_HC_PERVEH = 32, + SUMO_ATTR_PMX_PERVEH = 33, + SUMO_ATTR_NOX_PERVEH = 34, + SUMO_ATTR_FUEL_PERVEH = 35, + SUMO_ATTR_ELECTRICITY_PERVEH = 36, + /// MSMeanData_Harmonoise + SUMO_ATTR_NOISE = 37, + /// MSMeanData_Amitran + SUMO_ATTR_AMOUNT = 38, + SUMO_ATTR_AVERAGESPEED = 39, + /// @} /// @name common attributes /// @{ @@ -390,9 +441,9 @@ SUMO_ATTR_REFID, SUMO_ATTR_NAME, SUMO_ATTR_TYPE, + SUMO_ATTR_VERSION, SUMO_ATTR_PRIORITY, SUMO_ATTR_NUMLANES, - SUMO_ATTR_SPEED, SUMO_ATTR_ONEWAY, SUMO_ATTR_WIDTH, SUMO_ATTR_WIDTHRESOLUTION, @@ -686,6 +737,7 @@ SUMO_ATTR_COSTS, SUMO_ATTR_SAVINGS, SUMO_ATTR_PROB, + SUMO_ATTR_COUNT, SUMO_ATTR_PROBS, SUMO_ATTR_ROUTES, SUMO_ATTR_VTYPES, @@ -704,11 +756,13 @@ SUMO_ATTR_FROMJUNCTION, SUMO_ATTR_TOJUNCTION, SUMO_ATTR_PERIOD, + SUMO_ATTR_REPEAT, SUMO_ATTR_FROM_TAZ, SUMO_ATTR_TO_TAZ, SUMO_ATTR_REROUTE, SUMO_ATTR_PERSON_CAPACITY, SUMO_ATTR_CONTAINER_CAPACITY, + SUMO_ATTR_PARKING_LENGTH, SUMO_ATTR_PERSON_NUMBER, SUMO_ATTR_CONTAINER_NUMBER, SUMO_ATTR_MODES, @@ -727,6 +781,7 @@ SUMO_ATTR_NUMBER, SUMO_ATTR_DURATION, SUMO_ATTR_UNTIL, + SUMO_ATTR_ARRIVAL, SUMO_ATTR_EXTENSION, SUMO_ATTR_ROUTEPROBE, /// @} @@ -875,6 +930,7 @@ SUMO_ATTR_DETECT_PERSONS, SUMO_ATTR_MAX_TRAVELTIME, SUMO_ATTR_MIN_SAMPLES, + SUMO_ATTR_WRITE_ATTRIBUTES, SUMO_ATTR_LON, SUMO_ATTR_LAT, @@ -938,7 +994,6 @@ SUMO_ATTR_GENERATE_WALKS, SUMO_ATTR_ACTTYPE, SUMO_ATTR_SLOPE, - SUMO_ATTR_VERSION, SUMO_ATTR_CORNERDETAIL, SUMO_ATTR_LINKDETAIL, SUMO_ATTR_RECTANGULAR_LANE_CUT, @@ -956,7 +1011,6 @@ SUMO_ATTR_VEHICLECLASS, SUMO_ATTR_FUEL, SUMO_ATTR_ACCELERATION, - SUMO_ATTR_AMOUNT, SUMO_ATTR_ORIGIN, SUMO_ATTR_DESTINATION, SUMO_ATTR_VISIBLE, @@ -1051,6 +1105,8 @@ GNE_ATTR_CLOSE_SHAPE, /// @brief parent of an additional element GNE_ATTR_PARENT, + /// @brief data set of a generic data + GNE_ATTR_DATASET, /// @brief parameters "key1=value1|key2=value2|...|keyN=valueN" GNE_ATTR_PARAMETERS, /// @brief min source (used only by TAZs) @@ -1094,8 +1150,8 @@ SUMO_ATTR_RNG_INSERTIONCONTROL, SUMO_ATTR_RNG_DEVICE, SUMO_ATTR_RNG_DEVICE_BT, - SUMO_ATTR_RNG_DRIVERSTATE, - SUMO_ATTR_RNG_DEVICE_TOC + SUMO_ATTR_RNG_DEVICE_TOC, + SUMO_ATTR_RNG_DRIVERSTATE // @} }; @@ -1117,23 +1173,23 @@ * @brief Numbers representing special SUMO-XML-attribute values * for representing node- (junction-) types used in netbuild/netimport and netload */ -enum SumoXMLNodeType { - NODETYPE_UNKNOWN, // terminator - NODETYPE_TRAFFIC_LIGHT, - NODETYPE_TRAFFIC_LIGHT_NOJUNCTION, // junction controlled only by traffic light but without other prohibitions, - NODETYPE_TRAFFIC_LIGHT_RIGHT_ON_RED, - NODETYPE_RAIL_SIGNAL, - NODETYPE_RAIL_CROSSING, - NODETYPE_PRIORITY, - NODETYPE_PRIORITY_STOP, // like priority but all minor links have stop signs - NODETYPE_RIGHT_BEFORE_LEFT, - NODETYPE_ALLWAY_STOP, - NODETYPE_ZIPPER, - NODETYPE_DISTRICT, - NODETYPE_NOJUNCTION, - NODETYPE_INTERNAL, - NODETYPE_DEAD_END, - NODETYPE_DEAD_END_DEPRECATED +enum class SumoXMLNodeType { + UNKNOWN, // terminator + TRAFFIC_LIGHT, + TRAFFIC_LIGHT_NOJUNCTION, // junction controlled only by traffic light but without other prohibitions, + TRAFFIC_LIGHT_RIGHT_ON_RED, + RAIL_SIGNAL, + RAIL_CROSSING, + PRIORITY, + PRIORITY_STOP, // like priority but all minor links have stop signs + RIGHT_BEFORE_LEFT, + ALLWAY_STOP, + ZIPPER, + DISTRICT, + NOJUNCTION, + INTERNAL, + DEAD_END, + DEAD_END_DEPRECATED }; @@ -1142,13 +1198,13 @@ * @brief Numbers representing special SUMO-XML-attribute values * for representing edge functions used in netbuild/netimport and netload */ -enum SumoXMLEdgeFunc { - EDGEFUNC_UNKNOWN, - EDGEFUNC_NORMAL, - EDGEFUNC_CONNECTOR, - EDGEFUNC_CROSSING, - EDGEFUNC_WALKINGAREA, - EDGEFUNC_INTERNAL +enum class SumoXMLEdgeFunc { + UNKNOWN, + NORMAL, + CONNECTOR, + CROSSING, + WALKINGAREA, + INTERNAL }; @@ -1160,33 +1216,34 @@ * to both sides from the given edge geometry (Also used when node * positions are used as edge geometry). */ -enum LaneSpreadFunction { - LANESPREAD_RIGHT, - LANESPREAD_CENTER +enum class LaneSpreadFunction { + RIGHT = 0, + ROADCENTER = 1, + CENTER = 2 }; /// @brief algorithms for computing right of way -enum RightOfWay { - RIGHT_OF_WAY_DEFAULT, - RIGHT_OF_WAY_EDGEPRIORITY +enum class RightOfWay { + DEFAULT, + EDGEPRIORITY }; /// @brief algorithms for computing right of way -enum FringeType { - FRINGE_TYPE_OUTER, - FRINGE_TYPE_INNER, - FRINGE_TYPE_DEFAULT +enum class FringeType { + OUTER, + INNER, + DEFAULT }; /// @brief travel modes for persons -enum PersonMode { - PERSONMODE_NONE = 0, - PERSONMODE_WALK = 1, - PERSONMODE_BICYCLE = 2, - PERSONMODE_CAR = 4, - PERSONMODE_PUBLIC = 8, - PERSONMODE_TAXI = 16 +enum class PersonMode { + NONE = 0, + WALK = 1 << 1, + BICYCLE = 1 << 2, + CAR = 1 << 3, + PUBLIC = 1 << 4, + TAXI = 1 << 5 }; /** @@ -1240,42 +1297,42 @@ * stream between two edges). * used in netbuild (formerly NBMMLDirection) and MSLink */ -enum LinkDirection { +enum class LinkDirection { /// @brief The link is a straight direction - LINKDIR_STRAIGHT = 0, + STRAIGHT = 0, /// @brief The link is a 180 degree turn - LINKDIR_TURN, + TURN, /// @brief The link is a 180 degree turn (left-hand network) - LINKDIR_TURN_LEFTHAND, + TURN_LEFTHAND, /// @brief The link is a (hard) left direction - LINKDIR_LEFT, + LEFT, /// @brief The link is a (hard) right direction - LINKDIR_RIGHT, + RIGHT, /// @brief The link is a partial left direction - LINKDIR_PARTLEFT, + PARTLEFT, /// @brief The link is a partial right direction - LINKDIR_PARTRIGHT, + PARTRIGHT, /// @brief The link has no direction (is a dead end link) - LINKDIR_NODIR + NODIR }; /// @enum TrafficLightType -enum TrafficLightType { - TLTYPE_STATIC, - TLTYPE_RAIL_SIGNAL, - TLTYPE_RAIL_CROSSING, - TLTYPE_ACTUATED, - TLTYPE_DELAYBASED, - TLTYPE_SOTL_PHASE, - TLTYPE_SOTL_PLATOON, - TLTYPE_SOTL_REQUEST, - TLTYPE_SOTL_WAVE, - TLTYPE_SOTL_MARCHING, - TLTYPE_SWARM_BASED, - TLTYPE_HILVL_DETERMINISTIC, - TLTYPE_OFF, - TLTYPE_INVALID //< must be the last one +enum class TrafficLightType { + STATIC, + RAIL_SIGNAL, + RAIL_CROSSING, + ACTUATED, + DELAYBASED, + SOTL_PHASE, + SOTL_PLATOON, + SOTL_REQUEST, + SOTL_WAVE, + SOTL_MARCHING, + SWARM_BASED, + HILVL_DETERMINISTIC, + OFF, + INVALID //< must be the last one }; @@ -1572,8 +1629,3 @@ /// @brief all allowed characters for phase state static const char AllowedTLS_linkStatesInitializer[]; }; - -#endif - - -/****************************************************************************/ diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/XMLSubSys.cpp sumo-1.6.0+dfsg1/src/utils/xml/XMLSubSys.cpp --- sumo-1.5.0+dfsg1/src/utils/xml/XMLSubSys.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/XMLSubSys.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -19,11 +19,6 @@ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ - - -// =========================================================================== -// included modules -// =========================================================================== #include #include @@ -148,4 +143,3 @@ /****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/src/utils/xml/XMLSubSys.h sumo-1.6.0+dfsg1/src/utils/xml/XMLSubSys.h --- sumo-1.5.0+dfsg1/src/utils/xml/XMLSubSys.h 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/src/utils/xml/XMLSubSys.h 2020-04-27 21:47:56.000000000 +0000 @@ -18,13 +18,7 @@ /// // Utility methods for initialising, closing and using the XML-subsystem /****************************************************************************/ -#ifndef XMLSubSys_h -#define XMLSubSys_h - - -// =========================================================================== -// included modules -// =========================================================================== +#pragma once #include #include @@ -167,9 +161,3 @@ static XERCES_CPP_NAMESPACE::SAX2XMLReader::ValSchemes myNetValidationScheme; }; - - -#endif - -/****************************************************************************/ - diff -Nru sumo-1.5.0+dfsg1/sumo.doxyconf sumo-1.6.0+dfsg1/sumo.doxyconf --- sumo-1.5.0+dfsg1/sumo.doxyconf 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/sumo.doxyconf 2020-04-27 21:47:56.000000000 +0000 @@ -1104,7 +1104,7 @@ # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. -COLS_IN_ALPHA_INDEX = 5 +COLS_IN_ALPHA_INDEX = 3 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag @@ -2279,7 +2279,7 @@ # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -UML_LOOK = YES +UML_LOOK = NO # If the UML_LOOK tag is enabled, the fields and methods are shown inside the # class node. If there are many fields or methods and many nodes the graph may @@ -2342,7 +2342,7 @@ # The default value is: NO. # This tag requires that the tag HAVE_DOT is set to YES. -CALLER_GRAPH = NO +CALLER_GRAPH = YES # If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical # hierarchy of all classes instead of a textual one. @@ -2454,7 +2454,7 @@ # Minimum value: 0, maximum value: 1000, default value: 0. # This tag requires that the tag HAVE_DOT is set to YES. -MAX_DOT_GRAPH_DEPTH = 0 +MAX_DOT_GRAPH_DEPTH = 2 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, because dot on Windows does not seem diff -Nru sumo-1.5.0+dfsg1/tools/assign/duaIterate.py sumo-1.6.0+dfsg1/tools/assign/duaIterate.py --- sumo-1.5.0+dfsg1/tools/assign/duaIterate.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/assign/duaIterate.py 2020-04-27 21:47:56.000000000 +0000 @@ -167,8 +167,12 @@ help="give traffic jams a higher weight when using option --weight-memory") argParser.add_argument("--clean-alt", action="store_true", dest="clean_alt", default=False, help="Whether old rou.alt.xml files shall be removed") - argParser.add_argument("--binary", action="store_true", - default=False, help="Use binary format for intermediate and resulting route files") + argParser.add_argument("--binary", dest="gzip", action="store_true", default=False, + help="alias for --gzip") + argParser.add_argument("--gzip", action="store_true", default=False, + help="writing intermediate and resulting route files in gzipped format") + argParser.add_argument("--dualog", default="dua.log", help="log file path (default 'dua.log')") + argParser.add_argument("--log", default="stdout.log", help="log file path (default 'dua.log')") argParser.add_argument("remaining_args", nargs='*') return argParser @@ -480,8 +484,8 @@ dua_args = assign_remaining_args( duaBinary, 'duarouter', options.remaining_args) - sys.stdout = sumolib.TeeFile(sys.stdout, open("stdout.log", "w+")) - log = open("dua.log", "w+") + sys.stdout = sumolib.TeeFile(sys.stdout, open(options.log, "w+")) + log = open(options.dualog, "w+") if options.zip: if options.clean_alt: sys.exit( @@ -509,8 +513,8 @@ costmemory = CostMemory('traveltime', pessimism=options.pessimism, network_file=options.net ) routesSuffix = ".xml" - if options.binary: - routesSuffix = ".sbx" + if options.gzip: + routesSuffix = ".gz" if options.weightmemory and options.firstStep != 0: # load previous dump files when continuing a run diff -Nru sumo-1.5.0+dfsg1/tools/build/checkStyle.py sumo-1.6.0+dfsg1/tools/build/checkStyle.py --- sumo-1.5.0+dfsg1/tools/build/checkStyle.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/build/checkStyle.py 2020-04-27 21:47:56.000000000 +0000 @@ -46,7 +46,7 @@ except (OSError, subprocess.CalledProcessError): HAVE_ASTYLE = False -_SOURCE_EXT = set([".h", ".cpp", ".py", ".pyw", ".pl", ".java", ".am", ".cs"]) +_SOURCE_EXT = set([".h", ".cpp", ".py", ".pyw", ".pl", ".java", ".am", ".cs", ".c"]) _TESTDATA_EXT = [".xml", ".prog", ".csv", ".complex", ".dfrouter", ".duarouter", ".jtrrouter", ".marouter", ".astar", ".chrouter", ".internal", ".tcl", ".txt", @@ -138,7 +138,7 @@ return self._haveFixed = False idx = 0 - if ext in (".cpp", ".h", ".java"): + if ext in (".cpp", ".h", ".java", ".c"): if lines[idx] == SEPARATOR: year = lines[idx + 2][17:21] end = lines.index(SEPARATOR, idx + 1) + 1 diff -Nru sumo-1.5.0+dfsg1/tools/build/dailyBuildMSVC.py sumo-1.6.0+dfsg1/tools/build/dailyBuildMSVC.py --- sumo-1.5.0+dfsg1/tools/build/dailyBuildMSVC.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/build/dailyBuildMSVC.py 2020-04-27 21:47:56.000000000 +0000 @@ -48,11 +48,6 @@ "TraCITestClient") -def printLog(msg, log): - print(u"%s: %s" % (datetime.datetime.now(), msg), file=log) - log.flush() - - def repositoryUpdate(options, log): gitrev = "" cwd = os.getcwd() @@ -123,10 +118,10 @@ cmakeOpt += ["-DSUMO_UTILS=True"] # Create directory or clear it if already exists if os.path.exists(buildDir): - printLog("Cleaning directory of %s." % generator, log) + status.printLog("Cleaning directory of %s." % generator, log) shutil.rmtree(buildDir) os.makedirs(buildDir) - printLog("Creating solution for %s." % generator, log) + status.printLog("Creating solution for %s." % generator, log) subprocess.call(["cmake", "../..", "-G", generator] + cmakeOpt, cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) return buildDir @@ -187,7 +182,7 @@ pass # we need to use io.open here due to http://bugs.python.org/issue16273 with io.open(makeLog, 'a') as log: - printLog("Running %s build using python %s." % (msvcVersion, sys.version), log) + status.printLog("Running %s build using python %s." % (msvcVersion, sys.version), log) gitrev = repositoryUpdate(options, log) generator = "Visual Studio 12 2013" if platform == "x64": @@ -198,8 +193,6 @@ if os.path.exists(os.path.join("src", "libsumo", "_libsumo.vcxproj")): ret = subprocess.call(["cmake", "--build", ".", "--target", "_libsumo"], cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) - ret = subprocess.call(["cmake", "--build", ".", "--target", "cadyts"], - cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) ret = subprocess.call(["cmake", "--build", ".", "--target", "lisum-gui"], cwd=buildDir, stdout=log, stderr=subprocess.STDOUT) if ret == 0 and sumoAllZip: @@ -236,7 +229,7 @@ zipf.write(f, nameInZip) srcDir = os.path.join(options.rootDir, options.binDir.replace("bin", "src")) includeDir = binDir.replace("bin", "include") - printLog("Creating sumo.zip.", log) + status.printLog("Creating sumo.zip.", log) for f in (glob.glob(os.path.join(srcDir, "libsumo", "*.h")) + glob.glob(os.path.join(srcDir, "utils", "traci", "TraCIAPI.*")) + glob.glob(os.path.join(srcDir, "foreign", "tcpip", "s*.*"))): @@ -252,22 +245,22 @@ zipf.close() if options.suffix == "": # installers only for the vanilla build - printLog("Creating sumo.msi.", log) + status.printLog("Creating sumo.msi.", log) wix.buildMSI(binaryZip, binaryZip.replace(".zip", ".msi"), log=log) except IOError as ziperr: - printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), log) + status.printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), log) if platform == "x64": - printLog("Creating sumo-game.zip.", log) + status.printLog("Creating sumo-game.zip.", log) try: setup = os.path.join(env["SUMO_HOME"], 'tools', 'game', 'setup.py') subprocess.call(['python', setup, binaryZip], stdout=log, stderr=subprocess.STDOUT) except Exception as e: - printLog("Warning: Could not create nightly sumo-game.zip! (%s)" % e, log) + 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: - printLog("Creating sumoDebug.zip.", debugLog) + status.printLog("Creating sumoDebug.zip.", debugLog) try: debugZip = sumoAllZip.replace("-all-", "-%s%sDebug-" % (platform.lower().replace("x", "win"), options.suffix)) @@ -277,14 +270,14 @@ zipf.write(f, os.path.join(binDir, os.path.basename(f))) zipf.close() except IOError as ziperr: - printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), debugLog) - printLog("Running tests.", log) + status.printLog("Warning: Could not zip to %s (%s)!" % (binaryZip, ziperr), debugLog) + status.printLog("Running tests.", log) runTests(options, env, gitrev, log) with open(statusLog, 'w') as log: status.printStatus(makeLog, makeAllLog, env["SMTP_SERVER"], log) if not options.x64only: with open(makeAllLog, 'a') as debugLog: - printLog("Running debug tests.", 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) diff -Nru sumo-1.5.0+dfsg1/tools/build/dailyNetedit.py sumo-1.6.0+dfsg1/tools/build/dailyNetedit.py --- sumo-1.5.0+dfsg1/tools/build/dailyNetedit.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/build/dailyNetedit.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 dailyNetedit.py +# @author Michael Behrisch +# @author Jakob Erdmann +# @author Laura Bieker +# @date 2008 + +""" +Does the nightly git pull on the windows server and the visual +studio build. The script is also used for the meso build. +Some paths especially for the names of the texttest output dirs are +hard coded into this script. +""" +from __future__ import absolute_import +from __future__ import print_function +import datetime +import optparse +import os +import glob +import subprocess +import sys + +import status + +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +import sumolib # noqa + +BINARIES = ("netedit",) + + +def killall(debugSuffix): + bins = set([name + debugSuffix + ".exe" for name in BINARIES]) + for taskline in subprocess.check_output(["tasklist", "/nh"]).splitlines(): + task = taskline.split() + if task and task[0] in bins: + subprocess.call(["taskkill", "/f", "/im", task[0]]) + bins.remove(task[0]) + + +def runTests(options, env, gitrev, log, debugSuffix=""): + prefix = env["FILEPREFIX"] + debugSuffix + 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) + if not os.path.exists(env["SUMO_REPORT"]): + os.makedirs(env["SUMO_REPORT"]) + killall(debugSuffix) + for name in BINARIES: + binary = os.path.join(options.rootDir, options.binDir, name + debugSuffix + ".exe") + if os.path.exists(binary): + env[name.upper() + "_BINARY"] = binary + ttBin = "texttestc.py" + today = datetime.date.today() + tasks = sorted(glob.glob(os.path.join(env["TEXTTEST_HOME"], "netedit", "testsuite.netedit.daily.*"))) + 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)] + subprocess.call(cmd, 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) + killall(debugSuffix) + + +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("-p", "--python", help="path to python interpreter to use") +(options, args) = optParser.parse_args() + +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" +msvcVersion = "msvc12" + +platform = "x64" +env["FILEPREFIX"] = msvcVersion + options.suffix + platform +prefix = os.path.join(options.remoteDir, env["FILEPREFIX"]) +testLog = prefix + "NeteditTest.log" +gitrev = sumolib.version.gitDescribe() +with open(testLog, 'a') as log: + status.printLog("Running tests.", log) + runTests(options, env, gitrev, log) diff -Nru sumo-1.5.0+dfsg1/tools/build/dailyUpdateMakeGCC.sh sumo-1.6.0+dfsg1/tools/build/dailyUpdateMakeGCC.sh --- sumo-1.5.0+dfsg1/tools/build/dailyUpdateMakeGCC.sh 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/build/dailyUpdateMakeGCC.sh 2020-04-27 21:47:56.000000000 +0000 @@ -18,24 +18,14 @@ date >> $STATUSLOG echo "--" >> $STATUSLOG cd $PREFIX/sumo -if test "${CONFIGURE_OPT::5}" == "cmake"; then - rm -rf build/$FILEPREFIX -else - make distclean &> /dev/null - make -f Makefile.cvs clean &> /dev/null -fi +rm -rf build/$FILEPREFIX basename $MAKELOG >> $STATUSLOG git pull &> $MAKELOG || (echo "git pull failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) git submodule update >> $MAKELOG 2>&1 || (echo "git submodule update failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) GITREV=`tools/build/version.py -` date >> $MAKELOG -if test "${CONFIGURE_OPT::5}" == "cmake"; then - mkdir build/$FILEPREFIX && cd build/$FILEPREFIX - cmake ${CONFIGURE_OPT:5} -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. >> $MAKELOG 2>&1 || (echo "cmake failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) -else - make -f Makefile.cvs >> $MAKELOG 2>&1 || (echo "autoreconf failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) - ./configure --prefix=$PREFIX/sumo $CONFIGURE_OPT >> $MAKELOG 2>&1 || (echo "configure failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) -fi +mkdir build/$FILEPREFIX && cd build/$FILEPREFIX +cmake ${CONFIGURE_OPT:5} -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. >> $MAKELOG 2>&1 || (echo "cmake failed" | tee -a $STATUSLOG; tail -10 $MAKELOG) if make -j32 >> $MAKELOG 2>&1; then date >> $MAKELOG if make install >> $MAKELOG 2>&1; then @@ -85,14 +75,9 @@ echo "--" >> $STATUSLOG basename $MAKEALLLOG >> $STATUSLOG export CXXFLAGS="$CXXFLAGS -Wall -W -pedantic -Wno-long-long -Wformat -Wformat-security" -if test "${CONFIGURE_OPT::5}" == "cmake"; then - rm -rf build/debug-$FILEPREFIX - mkdir build/debug-$FILEPREFIX && cd build/debug-$FILEPREFIX - cmake ${CONFIGURE_OPT:5} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. > $MAKEALLLOG 2>&1 || (echo "cmake debug failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) -else - ./configure --prefix=$PREFIX/sumo --program-suffix=A --with-python --with-ffmpeg \ - $CONFIGURE_OPT &> $MAKEALLLOG || (echo "configure with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) -fi +rm -rf build/debug-$FILEPREFIX +mkdir build/debug-$FILEPREFIX && cd build/debug-$FILEPREFIX +cmake ${CONFIGURE_OPT:5} -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PREFIX ../.. > $MAKEALLLOG 2>&1 || (echo "cmake debug failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) if make -j32 >> $MAKEALLLOG 2>&1; then make install >> $MAKEALLLOG 2>&1 || (echo "make install with all options failed" | tee -a $STATUSLOG; tail -10 $MAKEALLLOG) else diff -Nru sumo-1.5.0+dfsg1/tools/build/status.py sumo-1.6.0+dfsg1/tools/build/status.py --- sumo-1.5.0+dfsg1/tools/build/status.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/build/status.py 2020-04-27 21:47:56.000000000 +0000 @@ -26,6 +26,11 @@ from datetime import datetime +def printLog(msg, log): + print(u"%s: %s" % (datetime.now(), msg), file=log) + log.flush() + + def findErrors(line, warnings, errors, failed): if re.search("[Ww]arn[ui]ng[: ]", line) or "[WARNING]" in line: if " test-case " not in line: diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/activitygen.py sumo-1.6.0+dfsg1/tools/contributed/saga/activitygen.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/activitygen.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/activitygen.py 2020-04-27 22:08:30.000000000 +0000 @@ -17,6 +17,7 @@ import json import logging import os +from pprint import pformat import pstats import sys import xml.etree.ElementTree @@ -78,7 +79,6 @@ class TripGenerationGenericError(Exception): """ During the trip generation, various erroroneous states can be reached. """ - message = None def __init__(self, message=None): """ Init the error message. """ super().__init__() @@ -89,37 +89,49 @@ class TripGenerationActivityError(TripGenerationGenericError): """ During the generation from the activity chains, various erroroneous states can be reached. """ - message = None - def __init__(self, message=None): + def __init__(self, message=None, activity=None): """ Init the error message. """ super().__init__() self.message = message - if self.message: + self.activity = activity + if self.message is not None: logging.debug(self.message) + if self.activity is not None: + with open('TripGenerationActivityError.log', 'a') as openfile: + openfile.write(message + '\n') + openfile.write(pformat(activity) + '\n') class TripGenerationRouteError(TripGenerationGenericError): """ During the step by step generation of the trip, it is possible to reach a state in which some of the chosen locations are impossible to reach. """ - message = None - def __init__(self, message=None): + def __init__(self, message=None, route=None): """ Init the error message. """ super().__init__() self.message = message - if self.message: + self.route = route + if self.message is not None: logging.debug(self.message) + if self.route is not None: + with open('TripGenerationRouteError.log', 'a') as openfile: + openfile.write(message + '\n') + openfile.write(pformat(route) + '\n') class TripGenerationInconsistencyError(TripGenerationGenericError): """ During the step by step generation of the trip, it is possible to reach a state in which some of the chosen modes are impossible to be used in that order. """ - message = None - def __init__(self, message=None): + def __init__(self, message=None, plan=None): """ Init the error message. """ super().__init__() self.message = message - if self.message: + self.plan = plan + if self.message is not None: logging.debug(self.message) + if self.plan is not None: + with open('TripGenerationInconsistencyError.log', 'a') as openfile: + openfile.write(message + '\n') + openfile.write(pformat(plan) + '\n') class ModeShare(Enum): """ Selector between two interpretation of the values used for the modes: @@ -241,9 +253,11 @@ weightreader = csv.reader(csvfile) header = None for row in weightreader: - if not header: + if not row: + continue # empty line + if header is None: header = row - else: + elif row: # ignoring empty lines self._taz_weights[row[0]] = { header[0]: row[0], header[1]: row[1], @@ -265,7 +279,9 @@ taz = None buildings = [] for row in weightreader: - if not header: + if not row: + continue # empty line + if header is None: header = row else: taz = row[0] @@ -295,6 +311,13 @@ ## Mobility Generation ## ## ---------------------------------------------------------------------------------------- ## + @staticmethod + def _hash_final_chain(chain): + activities = list() + for pos in range(1, len(chain)+1): + activities.append(chain[pos].activity) + return pformat(activities) + def _compute_entities_per_slice(self): """ Compute the absolute number of entities that are going to be created @@ -313,6 +336,7 @@ total = 0 _modes_stats = collections.defaultdict(int) + _chains_stats = collections.defaultdict(int) for name, m_slice in self._conf['slices'].items(): logging.info('[%s] Computing %d trips from %s to %s ... ', @@ -380,9 +404,11 @@ } complete_trip = self._generate_sumo_trip_from_activitygen(_person_trip) + _person_trip['string'] = complete_trip ## For statistical purposes. _modes_stats[_selected_mode] += 1 + _chains_stats[self._hash_final_chain(_final_chain)] += 1 except TripGenerationGenericError: _person_trip = None @@ -411,8 +437,12 @@ input("Press any key to continue..") logging.info('Generated %d trips.', total) + logging.info('Mode splits:') for mode, value in _modes_stats.items(): logging.info('\t %s: %d (%.2f).', mode, value, float(value/total)) + logging.info('Activity chains splits:') + for chain, value in _chains_stats.items(): + logging.info('\t %s: %d (%.2f).', chain, value, float(value/total)) ## ---- PARKING AREAS: location and selection ---- ## @@ -471,14 +501,14 @@ _mode, _ptype, _vtype = self._get_mode_parameters(mode) - pos = 1 - while pos in _person_stages: + for pos in range(1, len(_person_stages)+1): stage = _person_stages[pos] + logging.debug('STAGE %d: %s', pos, pformat(stage)) # findIntermodalRoute(self, fromEdge, toEdge, modes='', depart=-1.0, # routingMode=0, speed=-1.0, walkFactor=-1.0, # departPos=0.0, arrivalPos=-1073741824, departPosLat=0.0, # pType='', vType='', destStop='') - if not _new_start_time: + if _new_start_time is None: _new_start_time = stage.start if _person_steps: @@ -490,8 +520,10 @@ _last_final = _edges[-1] logging.debug('_generate_mode_traci: %s vs %s', _last_final, stage.fromEdge) if _last_final != stage.fromEdge: + logging.warning('_generate_mode_traci generated an inconsistent plan.') raise TripGenerationInconsistencyError( - '_generate_mode_traci generated an inconsistent plan.') + '_generate_mode_traci generated an inconsistent plan.', + _person_steps) route = None @@ -518,8 +550,7 @@ if route: ## build the waiting to destination (if required) if stage.duration: - wait = self._generate_waiting_stage(stage) - route.append(wait) + route.append(self._generate_waiting_stage(stage)) ## build the walk back to the parking walk_back = traci.simulation.findIntermodalRoute( @@ -549,17 +580,20 @@ for step in route: if _last_final: if step.edges[0] != _last_final: + logging.warning('_generate_mode_traci generated an inconsistent plan.') raise TripGenerationInconsistencyError( - '_generate_mode_traci generated an inconsistent plan.') + '_generate_mode_traci generated an inconsistent plan.', + route) _last_final = step.edges[-1] + if route: ## Set the arrival position in the edge route[-1].arrivalPos = stage.arrivalPos ## Add stop if stage.duration: route.append(self._generate_waiting_stage(stage)) - if not route: + if route is None: raise TripGenerationRouteError( 'Route not found between {} and {}.'.format(stage.fromEdge, stage.toEdge)) @@ -568,7 +602,6 @@ _new_start_time += step.travelTime _person_steps.append(step) - pos += 1 return _person_steps, _person_stages def _generate_trip(self, from_area, to_area, activity_chain, modes): @@ -616,8 +649,9 @@ best = sorted(solutions)[0] ## Ascending. trip = (best[2], best[1], best[3]) ## _person_stages, _person_steps, mode else: - raise TripGenerationRouteError('No solution foud for chain {} and modes {}.'.format( - activity_chain, _interpr_modes)) + raise TripGenerationRouteError( + 'No solution foud for chain {} and modes {}.'.format(activity_chain, + _interpr_modes)) return trip @staticmethod @@ -628,6 +662,7 @@ edges='{}_0'.format(stage.toEdge), travelTime=stage.duration, cost=stage.duration, vType=None, line=None, destStop=None, length=None, intended=None, depart=None, departPos=None, arrivalPos=None) + logging.debug('WAITING Stage: %s', pformat(wait)) return wait def _stages_define_main_locations(self, from_area, to_area, mode): @@ -705,14 +740,18 @@ destination = self._random_location_ellipse(home, primary) else: raise TripGenerationActivityError( - 'Invalid sequence in the activity chain: {} --> {}'.format(_prec, _succ)) + 'Invalid sequence in the activity chain: {} --> {}'.format(_prec, _succ), + person_stages) person_stages[pos] = stage._replace(toEdge=destination) return person_stages - @staticmethod - def _stages_compute_start_time(person_stages): + def _stages_compute_start_time(self, person_stages, mode): """ Compute the real starting time for the activity chain. """ + + ## Mode split: + _mode, _ptype, _vtype = self._get_mode_parameters(mode) + # Find the first 'start' defined. pos = 1 while pos in person_stages: @@ -722,12 +761,16 @@ start = person_stages[pos].start while pos in person_stages: - ett = 1800.0 # generic standard value + ett, route = None, None try: - ett = traci.simulation.findRoute( - person_stages[pos].fromEdge, person_stages[pos].toEdge).travelTime + route = traci.simulation.findIntermodalRoute( + person_stages[pos].fromEdge, person_stages[pos].toEdge, + modes=_mode, pType=_ptype, vType=_vtype) + ett = self._ett_from_route(route) except traci.exceptions.TraCIException: - pass + raise TripGenerationRouteError( + 'No solution foud for stage {} and modes {}.'.format( + pformat(person_stages[pos]), mode)) if pos-1 in person_stages: if person_stages[pos-1].duration: ett += person_stages[pos-1].duration @@ -810,9 +853,7 @@ ## Remove the initial 'Home' stage and update the from of the second stage. person_stages[1] = person_stages[1]._replace(fromEdge=person_stages[0].fromEdge) - is_start_to_fix = True if person_stages[0].start: - is_start_to_fix = False person_stages[1] = person_stages[1]._replace(start=person_stages[0].stage) del person_stages[0] @@ -822,10 +863,9 @@ person_stages[pos] = person_stages[pos]._replace(fromEdge=person_stages[pos-1].toEdge) pos += 1 - ## IF NECESSARY, compute the real starting time for the activity chain. - if is_start_to_fix: - start = self._stages_compute_start_time(person_stages) - person_stages[1] = person_stages[1]._replace(start=start) + ## Compute the real starting time for the activity chain based on ETT and durations + start = self._stages_compute_start_time(person_stages, mode) + person_stages[1] = person_stages[1]._replace(start=start) ## Define the position of each location in the activity chain. person_stages = self._stages_define_locations_position(person_stages) @@ -836,7 +876,8 @@ while pos in person_stages: if person_stages[pos].fromEdge != last_edge: raise TripGenerationActivityError( - 'Inconsistency in the locations for the chain of activities.') + 'Inconsistency in the locations for the chain of activities.', + person_stages) last_edge = person_stages[pos].toEdge pos += 1 @@ -967,6 +1008,11 @@ """ Select a TAZ from an area using its weight. """ selection = self._random_generator.uniform(0, 1) total_weight = sum([self._taz_weights[taz]['weight'] for taz in area]) + if total_weight <= 0: + error_msg = 'Error with area {}, total sum of weights is {}. '.format( + area, total_weight) + error_msg += 'It must be strictly positive.' + raise Exception(error_msg, [(taz, self._taz_weights[taz]['weight']) for taz in area]) cumulative = 0.0 for taz in area: cumulative += self._taz_weights[taz]['weight'] / total_weight @@ -1089,7 +1135,7 @@ # traci failed return False _mode, _ptype, _vtype = self._get_mode_parameters(mode) - if not isinstance(route, (list, tuple)): + if not isinstance(route, (list, tuple)): # list in until SUMO 1.4.0 included, tuple onward # only for findRoute if len(route.edges) >= 2: @@ -1116,6 +1162,14 @@ cost += stage.cost return cost + @staticmethod + def _ett_from_route(route): + """ Compute the route etimated travel time. """ + ett = 0.0 + for stage in route: + ett += stage.travelTime + return ett + ## ---------------------------------------------------------------------------------------- ## ## Saving trips to files ## ## ---------------------------------------------------------------------------------------- ## @@ -1176,12 +1230,12 @@ {route}{stops} """ - def _get_stopping_lane(self, edge): + def _get_stopping_lane(self, edge, vtype): """ Returns the vehicle-friendly stopping lange closer to the sidewalk. """ for lane in self._sumo_network.getEdge(edge).getLanes(): - if lane.allows('passenger'): + if lane.allows(vtype): return lane.getID() - raise TripGenerationGenericError("'passenger' cannot stop on edge {}".format(edge)) + raise TripGenerationGenericError('"{}" cannot stop on edge {}'.format(vtype, edge)) def _generate_sumo_trip_from_activitygen(self, person): """ Generate the XML string for SUMO route file from a person-trip. """ @@ -1195,8 +1249,10 @@ stages = '' _last_arrival_pos = None _internal_consistency_check = [] + _waiting_stages = [] for stage in person['stages']: if stage.type == tc.STAGE_WAITING: + _waiting_stages.append(stage) stages += self.WAIT.format(lane=stage.edges, duration=stage.travelTime, action=stage.description) @@ -1231,19 +1287,19 @@ end = stage.arrivalPos + self._conf['stopBufferDistance'] / 2.0 # ---- This check should not be necessary in a good scenario ---- # if start < 0: - logging.debug( + logging.warning( '_generate_sumo_trip_from_activitygen: [%s] start: %f --> 0.0', _ride_id, start) start = 0.0 if end > self._sumo_network.getEdge(stage.edges[-1]).getLength(): - logging.debug( + logging.warning( '_generate_sumo_trip_from_activitygen: [%s] end: %f --> %f', _ride_id, end, self._sumo_network.getEdge(stage.edges[-1]).getLength()) end = self._sumo_network.getEdge(stage.edges[-1]).getLength() ## ------------------------------------------------------------- ## _stop = self.ONDEMAND_TRIGGERED.format( - lane=self._get_stopping_lane(stage.edges[-1]), + lane=self._get_stopping_lane(stage.edges[-1], _vtype), start=start, end=end) if _last_arrival_pos: triggered += self.VEHICLE_TRIGGERED_DEPART.format( @@ -1261,8 +1317,10 @@ if _triggered_route: ## check for contiguity if _triggered_route[-1] != stage.edges[0]: + logging.warning('Triggered vehicle has a broken route.') raise TripGenerationInconsistencyError( - 'Triggered vehicle has a broken route.') + 'Triggered vehicle has a broken route.', + pformat(person['stages'])) ## remove the duplicated edge _triggered_route.extend(stage.edges[1:]) else: @@ -1274,7 +1332,7 @@ if stage.travelTime == LAST_STOP_PLACEHOLDER: # print('final stop') _stop = self.FINAL_STOP.format( - lane=self._get_stopping_lane(stage.edges[-1])) + lane=self._get_stopping_lane(stage.edges[-1], _triggered_vtype)) else: if stage.destStop: # print('parking') @@ -1285,7 +1343,7 @@ start = stage.arrivalPos - self._conf['stopBufferDistance'] / 2.0 end = stage.arrivalPos + self._conf['stopBufferDistance'] / 2.0 _stop = self.STOP_EDGE_TRIGGERED.format( - lane=self._get_stopping_lane(stage.edges[-1]), + lane=self._get_stopping_lane(stage.edges[-1], _triggered_vtype), person=person['id'], start=start, end=end) _triggered_stops += _stop @@ -1303,17 +1361,30 @@ ## internal consistency test if _internal_consistency_check: if person['stages'][0].type != tc.STAGE_DRIVING: + logging.warning('Triggered vehicle does not start from the beginning.') raise TripGenerationInconsistencyError( - 'Triggered vehicle does not start from the beginning.') + 'Triggered vehicle does not start from the beginning.', + pformat(person['stages'])) if person['stages'][-2].type != tc.STAGE_DRIVING: ## person['stages'][-1] is the stop + logging.warning('Triggered vehicle does not finish at the end.') raise TripGenerationInconsistencyError( - 'Triggered vehicle does not finish at the end.') + 'Triggered vehicle does not finish at the end.', + pformat(person['stages'])) + + ## waiting stages consistency test + if not _waiting_stages: + logging.warning('Person plan does not have any waiting stages.') + raise TripGenerationInconsistencyError( + 'Person plan does not have any waiting stages.', + pformat(person['stages'])) ## result complete_trip += triggered complete_trip += self.PERSON.format( id=person['id'], depart=person['depart'], stages=stages) + + logging.debug('Complete trip: \n%s', complete_trip) return complete_trip def _saving_trips_to_files(self): diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/activitygen.json sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/activitygen.json --- sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/activitygen.json 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/activitygen.json 2020-04-27 22:08:31.000000000 +0000 @@ -1,7 +1,7 @@ { "seed": 42, "maxNumTry": 10, - "outputPrefix": "osm_activitygen.", + "outputPrefix": "osm_activitygen", "mergeRoutesFiles": true, "sumocfg": "duarouter.sumocfg", diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/duarouter.sumocfg sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/duarouter.sumocfg --- sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/duarouter.sumocfg 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/duarouter.sumocfg 2020-04-27 22:08:31.000000000 +0000 @@ -20,13 +20,13 @@ - + @@ -48,6 +48,10 @@ + + + + diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/osm.sumocfg sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/osm.sumocfg --- sumo-1.5.0+dfsg1/tools/contributed/saga/defaults/osm.sumocfg 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/defaults/osm.sumocfg 2020-04-27 22:08:31.000000000 +0000 @@ -20,13 +20,20 @@ + + + + + + + - + @@ -48,8 +55,10 @@ - + + + diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/docs/HOWTO.md sumo-1.6.0+dfsg1/tools/contributed/saga/docs/HOWTO.md --- sumo-1.5.0+dfsg1/tools/contributed/saga/docs/HOWTO.md 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/docs/HOWTO.md 2020-04-27 22:08:31.000000000 +0000 @@ -31,16 +31,17 @@ --taz-plot Plots the TAZs to an HTML file as OSM overlay. (Requires folium) --from-step FROM_STEP For successive iteration of the script, it defines from which step it should start: - [0 - Copy default files.] - [1 - Run netconvert & polyconvert.] - [2 - Run ptlines2flows.py.] - [3 - Generate parking areas.] - [4 - Generate parking area rerouters.] - [5 - Extract TAZ from administrative boundaries.] - [6 - Generate OD-matrix.] - [7 - Generate SUMOActivityGen defaults.] - [8 - Run SUMOActivityGen.] - [9 - Launch SUMO.] + [ 0 - Copy default files.] + [ 1 - Run netconvert & polyconvert.] + [ 2 - Run ptlines2flows.py.] + [ 3 - Generate parking areas.] + [ 4 - Generate parking area rerouters.] + [ 5 - Extract TAZ from administrative boundaries.] + [ 6 - Generate OD-matrix.] + [ 7 - Generate SUMOActivityGen defaults.] + [ 8 - Run SUMOActivityGen.] + [ 9 - Launch SUMO.] + [10 - Report.] --profiling Enable Python3 cProfile feature. --no-profiling [default] Disable Python3 cProfile feature. ``` diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/docs/ScenarioGenerator.md sumo-1.6.0+dfsg1/tools/contributed/saga/docs/ScenarioGenerator.md --- sumo-1.5.0+dfsg1/tools/contributed/saga/docs/ScenarioGenerator.md 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/docs/ScenarioGenerator.md 2020-04-27 22:08:31.000000000 +0000 @@ -13,16 +13,17 @@ * `--admin-level` is used to filter the administrative boundaries using the `admin_level` values in OSM. This paprameter tunes `generateTAZBuildingsFromOSM.py`. * `--taz-plot` is used to plot the generated TAZs as an OSM overlay in a HTML file. It requires the folium library. This paprameter tunes `generateTAZBuildingsFromOSM.py`. * `--from-step` is used for successive iteration of the program after a manual change of the files. The number defines from which step the generation should be recomputed: - * 0 - Copy default files. - * 1 - Run netconvert & polyconvert. - * 2 - Run [ptlines2flows.py](https://github.com/eclipse/sumo/blob/master/tools/ptlines2flows.py). - * 3 - Generate parking areas using [generateParkingAreasFromOSM.py](../generateParkingAreasFromOSM.py). - * 4 - Generate parking area rerouters using [generateParkingAreaRerouters.py](https://github.com/eclipse/sumo/blob/master/tools/generateParkingAreaRerouters.py). - * 5 - Extract TAZ from administrative boundaries using [generateTAZBuildingsFromOSM.py](../generateTAZBuildingsFromOSM.py). - * 6 - Generate OD-matrix using [generateAmitranFromTAZWeights.py](../generateAmitranFromTAZWeights.py) - * 7 - Generate SUMOActivityGen defaults using [generateDefaultsActivityGen.py](../generateDefaultsActivityGen.py). - * 8 - Run the actual activity generation using [activitygen.py](../activitygen.py). - * 9 - Launch SUMO. + * 0 - Copy default files. + * 1 - Run netconvert & polyconvert. + * 2 - Run [ptlines2flows.py](https://github.com/eclipse/sumo/blob/master/tools/ptlines2flows.py). + * 3 - Generate parking areas using [generateParkingAreasFromOSM.py](../generateParkingAreasFromOSM.py). + * 4 - Generate parking area rerouters using [generateParkingAreaRerouters.py](https://github.com/eclipse/sumo/blob/master/tools/generateParkingAreaRerouters.py). + * 5 - Extract TAZ from administrative boundaries using [generateTAZBuildingsFromOSM.py](../generateTAZBuildingsFromOSM.py). + * 6 - Generate OD-matrix using [generateAmitranFromTAZWeights.py](../generateAmitranFromTAZWeights.py) + * 7 - Generate SUMOActivityGen defaults using [generateDefaultsActivityGen.py](../generateDefaultsActivityGen.py). + * 8 - Run the actual activity generation using [activitygen.py](../activitygen.py). + * 9 - Launch SUMO. + * 10 - Report. * `--profiling` is used to enable the Python 3 cProfile feature. * `--no-profiling` is the default option and it disables the Python 3 cProfile feature. @@ -82,3 +83,11 @@ * `--od-amitran` is the OD matrix in Amitran format. * `--out` is the output file. * `--population` is the number of entities to generate. + +## Report: sagaActivityReport.py + +The program `sagaActivityReport.py` starts from the tripinfo file generated from sumo and computes the average starting time and duration for each activity type defined in the `activitygen.py` configuration file. +The complete list of parameters is: + +* `----tripinfo` is the SUMO tripinfo.xml output file. +* `--out` is the output file. diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/generateAmitranFromTAZWeights.py sumo-1.6.0+dfsg1/tools/contributed/saga/generateAmitranFromTAZWeights.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/generateAmitranFromTAZWeights.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/generateAmitranFromTAZWeights.py 2020-04-27 22:08:31.000000000 +0000 @@ -37,13 +37,10 @@ class AmitranFromTAZWeightsGenerator(): """ Generate the default Amitran OD-matrix from TAZ weights. """ - _options = None - _taz_weights = dict() - _odpairs = list() - def __init__(self, options): - self._options = options + self._taz_weights = dict() + self._odpairs = list() self._load_weights_from_csv() self._generate_odpairs_from_taz() @@ -55,7 +52,7 @@ for row in weightreader: if not header: header = row - else: + elif row: # ignoring empty lines self._taz_weights[row[0]] = { header[0]: row[0], header[1]: row[1], diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/generateDefaultsActivityGen.py sumo-1.6.0+dfsg1/tools/contributed/saga/generateDefaultsActivityGen.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/generateDefaultsActivityGen.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/generateDefaultsActivityGen.py 2020-04-27 22:08:31.000000000 +0000 @@ -40,13 +40,11 @@ class ActivitygenDefaultGenerator(): """ Generate the default values for SUMOActivityGen. """ - _options = None - _config_struct = None - _amitran_struct = None - def __init__(self, options): self._options = options + self._config_struct = None + self._amitran_struct = None self._load_configurations() self._load_odmatrix() self._generate_taz() diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/generateParkingAreasFromOSM.py sumo-1.6.0+dfsg1/tools/contributed/saga/generateParkingAreasFromOSM.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/generateParkingAreasFromOSM.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/generateParkingAreasFromOSM.py 2020-04-27 22:08:31.000000000 +0000 @@ -53,21 +53,13 @@ class ParkingAreasFromOSMGenerator(): """ Generate the SUMO additional file for parkings based on OSM. """ - _options = None - - _osm = None - _net = None - - _parkings_edges_dict = dict() - - _osm_parkings = dict() - _sumo_parkings = dict() - def __init__(self, options): - self._options = options self._osm = self._parse_xml_file(options.osm_file) self._net = sumolib.net.readNet(options.net_file) + self._parkings_edges_dict = dict() + self._osm_parkings = dict() + self._sumo_parkings = dict() def parkings_generation(self): """ Main finction to generate all the parking areas. """ @@ -125,8 +117,9 @@ _PARKING_DICT = { 'amenity': ['parking', 'motorcycle_parking', 'parking_entrance'], + 'name': ['underground parking'], 'parking': ['surface', 'underground', 'multi-storey'], - 'name': ['underground parking'] + 'service': ['parking_aisle'], } def _is_parkings(self, tag): @@ -149,7 +142,7 @@ edge_info = None lane_info = None - dist_edge = sys.float_info.max + dist_lane = sys.float_info.max location = None radius = 50.0 @@ -160,18 +153,29 @@ continue if self._is_too_short(edge.getLength()): continue - index, pos, dist = edge.getClosestLanePosDist((float(parking['x']), - float(parking['y']))) - if dist < dist_edge: - edge_info = edge - lane_info = edge.getLane(index) - dist_edge = dist - location = pos + + # select the lane closer to the curb + selected_lane = None + for lane in edge.getLanes(): + if not lane.allows('passenger'): + continue + selected_lane = lane + break + + if selected_lane is not None: + + pos, dist = selected_lane.getClosestLanePosAndDist( + (float(parking['x']), float(parking['y']))) + if dist < dist_lane: + edge_info = edge + lane_info = selected_lane + dist_lane = dist + location = pos radius += 50.0 - if dist_edge > 50.0: - logging.info("Alert: parking lots %s is %d meters from edge %s.", - parking['id'], dist_edge, edge_info.getID()) + if dist_lane > 50.0: + logging.info("Alert: parking lots %s is %d meters from lane %s.", + parking['id'], dist_lane, lane_info.getID()) return (edge_info, lane_info, location) diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/generateTAZBuildingsFromOSM.py sumo-1.6.0+dfsg1/tools/contributed/saga/generateTAZBuildingsFromOSM.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/generateTAZBuildingsFromOSM.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/generateTAZBuildingsFromOSM.py 2020-04-27 22:08:29.000000000 +0000 @@ -68,30 +68,23 @@ class GenerateTAZandWeightsFromOSM(): """ Generate TAZ and Buildings weight from OSM.""" - - _param = None - - _osm = None - _net = None - - _osm_boundaries = { - 'relation': {}, - 'way': {}, - 'node': {}, - } - _osm_buildings = dict() - _taz = dict() - - _center = { - 'lat': 0.0, - 'lon': 0.0, - } - def __init__(self, parameters): self._param = parameters self._osm = _parse_xml_file(self._param.osm_file) self._net = sumolib.net.readNet(self._param.net_file) + self._osm_boundaries = { + 'relation': {}, + 'way': {}, + 'node': {}, + } + self._osm_buildings = dict() + self._taz = dict() + self._center = { + 'lat': 0.0, + 'lon': 0.0, + } + logging.info('Filtering administrative boudaries from OSM..') self._filter_boundaries_from_osm() logging.info("Extracting TAZ from OSM boundaries.") @@ -204,9 +197,17 @@ coord = self._osm_boundaries['node'][node['ref']] list_of_nodes.append((float(coord['lon']), float(coord['lat']))) + ## --------------------------- Consistency checks ---------------------------------- if len(list_of_nodes) <= 2: logging.critical('Boundary %s has %d nodes.', id_boundary, len(list_of_nodes)) continue + try: + _, _ = geometry.MultiPoint(list_of_nodes).convex_hull.exterior.coords.xy + except AttributeError: + logging.critical('Impossible to create the convex hull for boundary %s.', + id_boundary) + continue + # ---------------------------------------------------------------------------------- name = None ref = None @@ -343,8 +344,8 @@ # compute the approximated area approx = geometry.MultiPoint(points).convex_hull # http://openstreetmapdata.com/info/projections - proj = partial(pyproj.transform, pyproj.Proj(init='epsg:4326'), - pyproj.Proj(init='epsg:3857')) + proj = partial(pyproj.transform, pyproj.Proj('epsg:4326'), + pyproj.Proj('epsg:3857')) converted_approximation = transform(proj, approx) area = 0.0 if not numpy.isnan(converted_approximation.area): @@ -503,6 +504,8 @@ def _write_poly_files(self, prefix): """ Write the CSV file. """ for value in self._taz.values(): + if not value['buildings']: + continue filename = '{}.{}.csv'.format(prefix, value['ref']) with open(filename, 'w') as csvfile: csvwriter = csv.writer(csvfile, delimiter=',') @@ -519,8 +522,10 @@ csvwriter = csv.writer(csvfile, delimiter=',') csvwriter.writerow(['TAZ', 'Name', '#Nodes', 'Area']) for value in self._taz.values(): - csvwriter.writerow([value['ref'], value['name'], len(value['nodes']), - value['area']]) + num_nodes = len(value['nodes']) + if num_nodes <= 0: # the area is empty + continue + csvwriter.writerow([value['ref'], value['name'], num_nodes, value['area']]) def _parse_xml_file(xml_file): """ Extract all info from an OSM file. """ diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/sagaActivityReport.py sumo-1.6.0+dfsg1/tools/contributed/saga/sagaActivityReport.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/sagaActivityReport.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/sagaActivityReport.py 2020-04-27 22:08:31.000000000 +0000 @@ -0,0 +1,144 @@ +#!/usr/bin/env python3 + +""" From the Tripinfo file, generate the activities report. + + Author: Lara CODECA + + This program and the accompanying materials are made available under the + terms of the Eclipse Public License 2.0 which is available at + http://www.eclipse.org/legal/epl-2.0. +""" + +import argparse +import collections +import json +import logging +import os +from pprint import pformat +import sys + +from lxml import etree +import numpy as np + +def logs(): + """ Log init. """ + stdout_handler = logging.StreamHandler(sys.stdout) + logging.basicConfig(handlers=[stdout_handler], level=logging.INFO, + format='[%(asctime)s] %(levelname)s: %(message)s', + datefmt='%m/%d/%Y %I:%M:%S %p') + +def get_options(cmd_args=None): + """ Argument Parser. """ + parser = argparse.ArgumentParser( + prog='{}'.format(sys.argv[0]), usage='%(prog)s [options]', + description='SAGA Live Monitoring') + parser.add_argument( + '--tripinfo', type=str, required=True, + help='SUMO TripInfo file (XML).') + parser.add_argument( + '--out', type=str, required=True, + help='Output file (CSV).') + return parser.parse_args(cmd_args) + +class SAGAReport(object): + """ SAGA Activities Report """ + + TRIPINFO_SCHEMA = os.path.join(os.environ['SUMO_HOME'], 'data/xsd/tripinfo_file.xsd') + + def __init__(self, cfg): + self.tripinfo_file = cfg.tripinfo + self.output_file = cfg.out + + self.tripinfo = collections.defaultdict(dict) + self.personinfo = collections.defaultdict(dict) + + self.activity_stats = collections.defaultdict(list) + + def loadTripinfo(self): + # just in case.. + self.tripinfo = collections.defaultdict(dict) + self.personinfo = collections.defaultdict(dict) + + tree = None + try: + # Faster, but it may fail. + schema = etree.XMLSchema(file=self.TRIPINFO_SCHEMA) + parser = etree.XMLParser(schema=schema) + tree = etree.parse(self.tripinfo_file, parser) + except etree.XMLSyntaxError as excp: + logging.warning('Unable to use %s schema due to exception %s.', + self.TRIPINFO_SCHEMA, pformat(excp)) + tree = etree.parse(self.tripinfo_file) + + logging.info('Loading %s tripinfo file.', self.tripinfo_file) + for element in tree.getroot(): + if element.tag == 'tripinfo': + self.tripinfo[element.attrib['id']] = dict(element.attrib) + elif element.tag == 'personinfo': + self.personinfo[element.attrib['id']] = dict(element.attrib) + stages = [] + for stage in element: + stages.append([stage.tag, dict(stage.attrib)]) + self.personinfo[element.attrib['id']]['stages'] = stages + else: + raise Exception('Unrecognized element in the tripinfo file.') + logging.debug('TRIPINFO: \n%s', pformat(self.tripinfo)) + logging.debug('PERSONINFO: \n%s', pformat(self.personinfo)) + + def processTripinfo(self): + logging.info('Processing %s tripinfo file.', self.tripinfo_file) + for person, data in self.personinfo.items(): + for tag, stage in data['stages']: + logging.debug('[%s] %s \n%s', person, tag, pformat(stage)) + if tag == 'stop': + self.activity_stats[stage['actType']].append({ + 'arrival': stage['arrival'], + 'duration': stage['duration'], + }) + + def computeStats(self): + logging.info('Computing statistics..') + stats = dict() + for activity, data in self.activity_stats.items(): + duration = list() + start = list() + for value in data: + start.append(float(value['arrival']) - float(value['duration'])) + duration.append(float(value['duration'])) + stats[activity] = { + 'duration': { + 'min': min(duration), + 'max': max(duration), + 'mean': np.mean(duration), + 'median': np.median(duration), + 'std': np.std(duration), + }, + 'start': { + 'min': min(start), + 'max': max(start), + 'mean': np.mean(start), + 'median': np.median(start), + 'std': np.std(start), + } + } + logging.info('[%s] \n%s', activity, pformat(stats[activity])) + + logging.info('Saving statistics to %s file.', self.output_file) + with open(self.output_file, 'w') as output: + json.dump(stats, output) + +def main(cmd_args): + """ SAGA Activities Report """ + + args = get_options(cmd_args) + logging.debug('%s', args) + + report = SAGAReport(args) + report.loadTripinfo() + report.processTripinfo() + report.computeStats() + logging.info('Done.') + +if __name__ == '__main__': + logs() + main(sys.argv[1:]) diff -Nru sumo-1.5.0+dfsg1/tools/contributed/saga/scenarioFromOSM.py sumo-1.6.0+dfsg1/tools/contributed/saga/scenarioFromOSM.py --- sumo-1.5.0+dfsg1/tools/contributed/saga/scenarioFromOSM.py 2020-02-10 23:05:12.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/saga/scenarioFromOSM.py 2020-04-27 22:08:31.000000000 +0000 @@ -26,11 +26,13 @@ import generateAmitranFromTAZWeights import generateDefaultsActivityGen import activitygen +import sagaActivityReport if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import ptlines2flows import generateParkingAreaRerouters + from visualization import plot_summary else: sys.exit("please declare environment variable 'SUMO_HOME'") @@ -79,16 +81,17 @@ parser.add_argument( '--from-step', type=int, dest='from_step', default=0, help='For successive iteration of the script, it defines from which step it should start: ' - '[0 - Copy default files.] ' - '[1 - Run netconvert & polyconvert.] ' - '[2 - Run ptlines2flows.py.] ' - '[3 - Generate parking areas.] ' - '[4 - Generate parking area rerouters.] ' - '[5 - Extract TAZ from administrative boundaries.] ' - '[6 - Generate OD-matrix.] ' - '[7 - Generate SUMOActivityGen defaults.] ' - '[8 - Run SUMOActivityGen.] ' - '[9 - Launch SUMO.] ') + '[ 0 - Copy default files.] ' + '[ 1 - Run netconvert & polyconvert.] ' + '[ 2 - Run ptlines2flows.py.] ' + '[ 3 - Generate parking areas.] ' + '[ 4 - Generate parking area rerouters.] ' + '[ 5 - Extract TAZ from administrative boundaries.] ' + '[ 6 - Generate OD-matrix.] ' + '[ 7 - Generate SUMOActivityGen defaults.] ' + '[ 8 - Run SUMOActivityGen.] ' + '[ 9 - Launch SUMO.] ' + '[10 - Report.] ') parser.add_argument( '--profiling', dest='profiling', action='store_true', help='Enable Python3 cProfile feature.') @@ -144,6 +147,11 @@ ## SUMO DEFAULT_SUMOCFG = 'osm.sumocfg' +DEFAULT_TRIPINFO_FILE = 'output.tripinfo.xml' +DEFAULT_SUMMARY_FILE = 'output.summary.xml' + +## SAGA Report +DEFAULT_REPORT_FILE = 'activities_report.json' def _call_netconvert(filename, lefthand): """ Call netconvert using a subprocess. """ @@ -157,7 +165,7 @@ '--type-files', DEFAULT_TYPE_FILES] if lefthand: netconvert_options.append('--lefthand') - subprocess.call(netconvert_options) + subprocess.check_call(netconvert_options) def _call_pt_lines_to_flows(): """ Call directly ptlines2flows from sumo/tools. """ @@ -209,7 +217,7 @@ '--osm', filename, '--net', DEFAULT_NET_XML, '-o', DEFAULT_POLY_XML] - subprocess.call(polyconvert_options) + subprocess.check_call(polyconvert_options) def _call_generate_taz_buildings_from_osm(filename, single_taz, processes, admin_level, plot): """ Call directly generateTAZBuildingsFromOSM from SUMOActivityGen. """ @@ -266,7 +274,20 @@ def _call_sumo(): """ Call SUMO using a subprocess. """ - subprocess.call(['sumo', '-c', DEFAULT_SUMOCFG]) + subprocess.check_call(['sumo', '-c', DEFAULT_SUMOCFG]) + +def _call_saga_activity_report(): + """ Call directly sagaActivityReport from SUMOActivityGen.. """ + report_options = ['--tripinfo', DEFAULT_TRIPINFO_FILE, + '--out', DEFAULT_REPORT_FILE] + sagaActivityReport.main(report_options) + +def _call_plot_summary(): + """ Call directly plot_summary from sumo/tools """ + plot_options = ['-i', DEFAULT_SUMMARY_FILE, + '-o', 'summary.png', + '--xtime1', '--verbose', '--blind'] + plot_summary.main(plot_options) def main(cmd_args): """ Complete Scenario Generator. """ @@ -356,6 +377,11 @@ if args.from_step <= 9: logging.info('Launch sumo.') _call_sumo() + + if args.from_step <= 10: + logging.info('Report.') + _call_saga_activity_report() + _call_plot_summary() ## ======================== PROFILER ======================== ## if args.profiling: diff -Nru sumo-1.5.0+dfsg1/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java sumo-1.6.0+dfsg1/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java --- sumo-1.5.0+dfsg1/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/contributed/traas/src/main/java/de/tudresden/sumo/config/Constants.java 2020-04-27 21:47:56.000000000 +0000 @@ -13,7 +13,7 @@ /****************************************************************************/ /// @file Constants.java /// @author generated by "rebuildConstants.py" -/// @date 2020-02-10 21:09:49.586563 +/// @date 2020-03-20 13:39:41.950410 /// // This script contains TraCI constant definitions from /src/libsumo/TraCIConstants.h. /****************************************************************************/ @@ -78,6 +78,8 @@ public static final int CMD_GET_INDUCTIONLOOP_VARIABLE = 0xa0; // response: get induction loop (e1) variable public static final int RESPONSE_GET_INDUCTIONLOOP_VARIABLE = 0xb0; + // command: set induction loop (e1) variable, not used yet + //TRACI_CONST int CMD_GET_INDUCTIONLOOP_VARIABLE = 0xc0; // command: subscribe induction loop (e1) variable public static final int CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 0xd0; // response: subscribe induction loop (e1) variable @@ -91,6 +93,8 @@ public static final int CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xa1; // response: get multi-entry/multi-exit detector (e3) variable public static final int RESPONSE_GET_MULTIENTRYEXIT_VARIABLE = 0xb1; + // command: set multi-entry/multi-exit detector (e3) variable, not used yet + //TRACI_CONST int CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xc1; // command: subscribe multi-entry/multi-exit detector (e3) variable public static final int CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE = 0xd1; // response: subscribe multi-entry/multi-exit detector (e3) variable @@ -261,17 +265,19 @@ // response: subscribe GUI variable public static final int RESPONSE_SUBSCRIBE_GUI_VARIABLE = 0xec; - // command: subscribe areal detector (e2) context + // command: subscribe lane area detector (e2) context public static final int CMD_SUBSCRIBE_LANEAREA_CONTEXT = 0x8d; - // response: subscribe areal detector (e2) context + // response: subscribe lane area detector (e2) context public static final int RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT = 0x9d; - // command: get areal detector (e2) variable + // command: get lane area detector (e2) variable public static final int CMD_GET_LANEAREA_VARIABLE = 0xad; - // response: get areal detector (e2) variable + // response: get lane area detector (e2) variable public static final int RESPONSE_GET_LANEAREA_VARIABLE = 0xbd; - // command: subscribe areal detector (e2) variable + // command: set lane area detector (e2) variable, not used yet + //TRACI_CONST int CMD_GET_LANEAREA_VARIABLE = 0xcd; + // command: subscribe lane area detector (e2) variable public static final int CMD_SUBSCRIBE_LANEAREA_VARIABLE = 0xdd; - // response: subscribe areal detector (e2) variable + // response: subscribe lane area detector (e2) variable public static final int RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE = 0xed; // command: subscribe person context @@ -289,6 +295,141 @@ // response: subscribe person variable public static final int RESPONSE_SUBSCRIBE_PERSON_VARIABLE = 0xee; + // command: subscribe busstop context + public static final int CMD_SUBSCRIBE_BUSSTOP_CONTEXT = 0x8f; + // response: subscribe busstop context + public static final int RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT = 0x9f; + // command: get busstop variable + public static final int CMD_GET_BUSSTOP_VARIABLE = 0xaf; + // response: get busstop variable + public static final int RESPONSE_GET_BUSSTOP_VARIABLE = 0xbf; + // command: set busstop variable, not used yet + public static final int CMD_SET_BUSSTOP_VARIABLE = 0xcf; + // command: subscribe busstop variable + public static final int CMD_SUBSCRIBE_BUSSTOP_VARIABLE = 0xdf; + // response: subscribe busstop variable + public static final int RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE = 0xef; + + // command: subscribe parkingarea context + public static final int CMD_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x04; + // response: subscribe parkingarea context + public static final int RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x14; + // command: get parkingarea variable + public static final int CMD_GET_PARKINGAREA_VARIABLE = 0x24; + // response: get parkingarea variable + public static final int RESPONSE_GET_PARKINGAREA_VARIABLE = 0x34; + // command: set parkingarea variable + public static final int CMD_SET_PARKINGAREA_VARIABLE = 0x44; + // command: subscribe parkingarea variable + public static final int CMD_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x54; + // response: subscribe parkingarea variable + public static final int RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x64; + + // command: subscribe chargingstation context + public static final int CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x05; + // response: subscribe chargingstation context + public static final int RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x15; + // command: get chargingstation variable + public static final int CMD_GET_CHARGINGSTATION_VARIABLE = 0x25; + // response: get chargingstation variable + public static final int RESPONSE_GET_CHARGINGSTATION_VARIABLE = 0x35; + // command: set chargingstation variable + public static final int CMD_SET_CHARGINGSTATION_VARIABLE = 0x45; + // command: subscribe chargingstation variable + public static final int CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x55; + // response: subscribe chargingstation variable + public static final int RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x65; + + // command: subscribe routeprobe context + public static final int CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x06; + // response: subscribe routeprobe context + public static final int RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x16; + // command: get routeprobe variable + public static final int CMD_GET_ROUTEPROBE_VARIABLE = 0x26; + // response: get routeprobe variable + public static final int RESPONSE_GET_ROUTEPROBE_VARIABLE = 0x36; + // command: set routeprobe variable + public static final int CMD_SET_ROUTEPROBE_VARIABLE = 0x46; + // command: subscribe routeprobe variable + public static final int CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x56; + // response: subscribe routeprobe variable + public static final int RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x66; + + // command: subscribe calibrator context + public static final int CMD_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x07; + // response: subscribe calibrator context + public static final int RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x17; + // command: get calibrator variable + public static final int CMD_GET_CALIBRATOR_VARIABLE = 0x27; + // response: get calibrator variable + public static final int RESPONSE_GET_CALIBRATOR_VARIABLE = 0x37; + // command: set calibrator variable + public static final int CMD_SET_CALIBRATOR_VARIABLE = 0x47; + // command: subscribe calibrator variable + public static final int CMD_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x57; + // response: subscribe calibrator variable + public static final int RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x67; + + // command: subscribe rerouter context + public static final int CMD_SUBSCRIBE_REROUTER_CONTEXT = 0x08; + // response: subscribe rerouter context + public static final int RESPONSE_SUBSCRIBE_REROUTER_CONTEXT = 0x18; + // command: get rerouter variable + public static final int CMD_GET_REROUTER_VARIABLE = 0x28; + // response: get rerouter variable + public static final int RESPONSE_GET_REROUTER_VARIABLE = 0x38; + // command: set rerouter variable + public static final int CMD_SET_REROUTER_VARIABLE = 0x48; + // command: subscribe rerouter variable + public static final int CMD_SUBSCRIBE_REROUTER_VARIABLE = 0x58; + // response: subscribe rerouter variable + public static final int RESPONSE_SUBSCRIBE_REROUTER_VARIABLE = 0x68; + + // command: subscribe variablespeedsign context + public static final int CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x09; + // response: subscribe variablespeedsign context + public static final int RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x19; + // command: get variablespeedsign variable + public static final int CMD_GET_VARIABLESPEEDSIGN_VARIABLE = 0x29; + // response: get variablespeedsign variable + public static final int RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE = 0x39; + // command: set variablespeedsign variable + public static final int CMD_SET_VARIABLESPEEDSIGN_VARIABLE = 0x49; + // command: subscribe variablespeedsign variable + public static final int CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x59; + // response: subscribe variablespeedsign variable + public static final int RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x69; + + // command: subscribe meandata context + public static final int CMD_SUBSCRIBE_MEANDATA_CONTEXT = 0x0a; + // response: subscribe meandata context + public static final int RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT = 0x1a; + // command: get meandata variable + public static final int CMD_GET_MEANDATA_VARIABLE = 0x2a; + // response: get meandata variable + public static final int RESPONSE_GET_MEANDATA_VARIABLE = 0x3a; + // command: set meandata variable, not used yet + //TRACI_CONST int CMD_SET_MEANDATA_VARIABLE = 0x4a; + // command: subscribe meandata variable + public static final int CMD_SUBSCRIBE_MEANDATA_VARIABLE = 0x5a; + // response: subscribe meandata variable + public static final int RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE = 0x6a; + + // command: subscribe overheadwire context + public static final int CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x0b; + // response: subscribe overheadwire context + public static final int RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x1b; + // command: get overheadwire variable + public static final int CMD_GET_OVERHEADWIRE_VARIABLE = 0x2b; + // response: get overheadwire variable + public static final int RESPONSE_GET_OVERHEADWIRE_VARIABLE = 0x3b; + // command: set overheadwire variable + public static final int CMD_SET_OVERHEADWIRE_VARIABLE = 0x4b; + // command: subscribe overheadwire variable + public static final int CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x5b; + // response: subscribe overheadwire variable + public static final int RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x6b; + // **************************************** // POSITION REPRESENTATIONS @@ -535,6 +676,45 @@ // full name (get: edges, simulation, trafficlight) public static final int VAR_NAME = 0x1b; + // carFollowModel function followSpeed (get: vehicle) + public static final int VAR_FOLLOW_SPEED = 0x1c; + + // carFollowModel function stopSpeed (get: vehicle) + public static final int VAR_STOP_SPEED = 0x1d; + + // carFollowModel function getSecureGap (get: vehicle) + public static final int VAR_SECURE_GAP = 0x1e; + + // estimated delay for next stop + public static final int VAR_STOP_DELAY = 0x1f; + + // begin time(get: calibrator) + public static final int VAR_BEGIN = 0x1c; + + // end time(get: calibrator) + public static final int VAR_END = 0x1d; + + // vtype list (get: calibrator) + public static final int VAR_VTYPES = 0x1e; + + // vehicles per hour (get: calibrator) + public static final int VAR_VEHSPERHOUR = 0x13; + + // passed vehicle count (get: calibrator) + public static final int VAR_PASSED = 0x14; + + // inserted vehicle count (get: calibrator) + public static final int VAR_INSERTED = 0x15; + + // removed vehicle count (get: calibrator) + public static final int VAR_REMOVED = 0x16; + + // routeProbe id (get: calibrator) + public static final int VAR_ROUTE_PROBE = 0x17; + + // routeProbe id (get: calibrator) + public static final int CMD_SET_FLOW = 0x18; + // traffic light states, encoded as rRgGyYoO tuple (get: traffic lights) public static final int TL_RED_YELLOW_GREEN_STATE = 0x20; @@ -604,7 +784,7 @@ // maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes) public static final int VAR_MAXSPEED = 0x41; - // position (2D) (get: vehicle, poi, inductionloop, areadetector; set: poi) + // position (2D) (get: vehicle, poi, inductionloop, lane area detector; set: poi) public static final int VAR_POSITION = 0x42; // position (3D) (get: vehicle, poi, set: poi) @@ -613,7 +793,7 @@ // angle (get: vehicle, poi; set: poi) public static final int VAR_ANGLE = 0x43; - // angle (get: vehicle types, lanes, arealdetector, set: lanes) + // angle (get: vehicle types, lanes, lane area detector, set: lanes) public static final int VAR_LENGTH = 0x44; // color (get: vehicles, vehicle types, polygons, pois) @@ -664,7 +844,7 @@ // road id (get: vehicles) public static final int VAR_ROAD_ID = 0x50; - // lane id (get: vehicles, inductionloop, arealdetector) + // lane id (get: vehicles, inductionloop, lane area detector) public static final int VAR_LANE_ID = 0x51; // lane index (get: vehicle, edge) Binary files /tmp/tmpjXoL2t/GcAMOtUXbb/sumo-1.5.0+dfsg1/tools/contributed/traci4matlab/traci4matlab.jar and /tmp/tmpjXoL2t/03A0BgkmCW/sumo-1.6.0+dfsg1/tools/contributed/traci4matlab/traci4matlab.jar differ diff -Nru sumo-1.5.0+dfsg1/tools/detector/detector.py sumo-1.6.0+dfsg1/tools/detector/detector.py --- sumo-1.5.0+dfsg1/tools/detector/detector.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/detector/detector.py 2020-04-27 21:47:56.000000000 +0000 @@ -187,7 +187,7 @@ return self._edge2DetData[edge] def startElement(self, name, attrs): - if name == 'detectorDefinition' or name == 'e1Detector': + if name == 'detectorDefinition' or name == 'e1Detector' or name == 'inductionLoop': detType = attrs['type'] if 'type' in attrs else None self.addDetector(attrs['id'], float(attrs['pos']), self._laneMap.get(attrs['lane'], self._currentEdge), detType) diff -Nru sumo-1.5.0+dfsg1/tools/detector/edgeDataFromFlow.py sumo-1.6.0+dfsg1/tools/detector/edgeDataFromFlow.py --- sumo-1.5.0+dfsg1/tools/detector/edgeDataFromFlow.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/detector/edgeDataFromFlow.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 edgeDataFromFlow.py +# @author Jakob Erdmann +# @date 2020-02-27 + +""" +This script converts a flow file in csv-format to XML +(generalized meandata format : http://sumo.dlr.de/xsd/meandata_file.xsd) +""" +from __future__ import absolute_import +from __future__ import print_function +import sys +import os + +from optparse import OptionParser +from collections import defaultdict + +import detector + +SUMO_HOME = os.environ.get('SUMO_HOME', + os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')) +sys.path.append(os.path.join(SUMO_HOME, 'tools')) +import sumolib # noqa +from sumolib.xml import parse # noqa +DEBUG = False + + +def get_options(args=None): + optParser = OptionParser() + optParser.add_option("-d", "--detector-file", dest="detfile", + help="read detectors from FILE (mandatory)", metavar="FILE") + optParser.add_option("-f", "--detector-flow-file", dest="flowfile", + help="read detector flows to compare to from FILE (mandatory)", metavar="FILE") + optParser.add_option("-o", "--output-file", dest="output", + help="output edgeData FILE (mandatory)", metavar="FILE") + optParser.add_option("-c", "--flow-columns", dest="flowcols", default="qPKW,qLKW", + help="which columns contains flows", metavar="STRING") + optParser.add_option("-v", "--verbose", action="store_true", dest="verbose", + default=False, help="tell me what you are doing") + (options, args) = optParser.parse_args(args=args) + if not options.detfile or not options.flowfile or not options.output: + optParser.print_help() + sys.exit() + + return options + + +class LaneMap: + def get(self, key, default): + return key[0:-2] + + +def main(options): + readers = {} + for flowcol in options.flowcols.split(','): + detReader = detector.DetectorReader(options.detfile, LaneMap()) + hasData = detReader.readFlows(options.flowfile, flow=flowcol, time="Time", timeVal=0, timeMax=1440) + if options.verbose: + print("flowColumn: %s hasData: %s" % (flowcol, hasData)) + readers[flowcol] = detReader + + with open(options.output, "w") as outf: + edges = defaultdict(dict) # edge : {attr:val} + maxGroups = defaultdict(lambda: 0) # edge : nGroups + + for flowcol, detReader in readers.items(): + for edge, detData in detReader._edge2DetData.items(): + maxFlow = 0 + nGroups = 0 + for group in detData: + if group.isValid: + maxFlow = max(maxFlow, group.totalFlow) + nGroups += 1 + # if options.verbose: + # print("flowColumn: %s edge: %s flow: %s groups: %s" % ( + # flowcol, edge, maxFlow, nGroups)) + edges[edge][flowcol] = maxFlow + maxGroups[edge] = max(maxGroups[edge], nGroups) + + sumolib.writeXMLHeader(outf, "$Id$") # noqa + outf.write('\n') + outf.write(' \n') + for edge in sorted(edges.keys()): + attrs = ' '.join(['%s="%s"' % (k, v) for k, v in edges[edge].items()]) + outf.write(' \n' % (edge, attrs, nGroups)) + outf.write(' \n') + outf.write('\n') + + +if __name__ == "__main__": + main(get_options()) diff -Nru sumo-1.5.0+dfsg1/tools/edgesInDistricts.py sumo-1.6.0+dfsg1/tools/edgesInDistricts.py --- sumo-1.5.0+dfsg1/tools/edgesInDistricts.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/edgesInDistricts.py 2020-04-27 21:47:56.000000000 +0000 @@ -24,10 +24,12 @@ """ from __future__ import print_function from __future__ import absolute_import +import os import sys +import argparse import collections -from optparse import OptionParser from xml.sax import parse +sys.path.append(os.path.join(os.environ["SUMO_HOME"], 'tools')) import sumolib # noqa @@ -79,7 +81,7 @@ def getEdgeDistrictMap(self): result = {} - for edge, districts in self._edgeDistricts.iteritems(): + for edge, districts in self._edgeDistricts.items(): if len(districts) == 1: result[edge] = districts[0] return result @@ -88,10 +90,11 @@ fd = open(options.output, "w") sumolib.xml.writeHeader(fd, "$Id$", "tazs", "taz_file.xsd") # noqa lastId = None - lastEdges = None + lastEdges = set() key = (lambda i: i[0].attributes[options.merge_param]) if options.merge_param else None for idx, (district, edges) in enumerate(sorted(self._districtEdges.items(), key=key)): - filtered = [edge for edge in edges if edge not in self._invalidatedEdges] + filtered = [edge for edge in edges if edge not in self._invalidatedEdges and edge.getLength() > + options.min_length] if len(filtered) == 0: print("District '" + district.id + "' has no edges!") else: @@ -141,45 +144,50 @@ return edge.getLength() * edge.getLaneNumber() -def fillOptions(optParser): - optParser.add_option("-v", "--verbose", action="store_true", - default=False, help="tell me what you are doing") - optParser.add_option("-c", "--complete", action="store_true", - default=False, help="assign edges only if they are not in more than one district") - optParser.add_option("-n", "--net-file", - help="read SUMO network from FILE (mandatory)", metavar="FILE") - optParser.add_option("-t", "--taz-files", - help="read districts from FILEs", metavar="FILE") - optParser.add_option("-o", "--output", default="districts.taz.xml", - help="write results to FILE (default: %default)", metavar="FILE") - optParser.add_option("-x", "--max-speed", type="float", dest="maxspeed", - default=1000.0, help="use lanes where speed is not greater than this (m/s) " + - "(default: %default)") - optParser.add_option("-m", "--min-speed", type="float", dest="minspeed", - default=0., help="use lanes where speed is greater than this (m/s) (default: %default)") - optParser.add_option("-w", "--weighted", action="store_true", - default=False, help="Weights sources/sinks by lane number and length") - optParser.add_option("-f", "--assign-from", action="store_true", - default=False, help="Assign the edge always to the district where the \"from\" node " + - "is located") - optParser.add_option("-i", "--internal", action="store_true", - default=False, help="Include internal edges in output") - optParser.add_option("-l", "--vclass", help="Include only edges allowing VCLASS") - optParser.add_option("-s", "--shapeinfo", action="store_true", - default=False, help="write also the shape info in the file") - optParser.add_option("--merge-separator", - help="merge edge lists of taz starting with the same string up to the given separator") - optParser.add_option("--merge-param", - help="merge edge lists of taz/polygons having the same value for the given parameter") +def fillOptions(argParser): + argParser.add_argument("-v", "--verbose", action="store_true", + default=False, help="tell me what you are doing") + argParser.add_argument("--complete", action="store_true", + default=False, help="assign edges only if they are not in more than one district") + argParser.add_argument("-n", "--net-file", + help="read SUMO network from FILE (mandatory)", metavar="FILE") + argParser.add_argument("-t", "--taz-files", + help="read districts from FILEs", metavar="FILE") + argParser.add_argument("-o", "--output", default="districts.taz.xml", + help="write results to FILE", metavar="FILE") + argParser.add_argument("-x", "--max-speed", type=float, dest="maxspeed", + default=1000.0, help="use lanes where speed is not greater than this (m/s)") + argParser.add_argument("-m", "--min-speed", type=float, dest="minspeed", + default=0., help="use lanes where speed is greater than this (m/s)") + argParser.add_argument("-w", "--weighted", action="store_true", + default=False, help="Weights sources/sinks by lane number and length") + argParser.add_argument("-f", "--assign-from", action="store_true", + default=False, help="Assign the edge always to the district where the \"from\" node " + + "is located") + argParser.add_argument("-i", "--internal", action="store_true", + default=False, help="Include internal edges in output") + argParser.add_argument("-l", "--vclass", help="Include only edges allowing VCLASS") + argParser.add_argument("-s", "--shapeinfo", action="store_true", + default=False, help="write also the shape info in the file") + argParser.add_argument("--merge-separator", + help="merge edge lists of taz starting with the same string up to the given separator") + argParser.add_argument("--merge-param", + help="merge edge lists of taz/polygons having the same value for the given parameter") + argParser.add_argument("--min-length", type=float, + default=0., help="use edges where length is greater than this (m)") + + +def parse_args(args=None): + argParser = sumolib.options.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter) + fillOptions(argParser) + return argParser.parse_args(args), argParser if __name__ == "__main__": - optParser = OptionParser() - fillOptions(optParser) - (options, args) = optParser.parse_args() + options, argParser = parse_args() if not options.net_file: - optParser.print_help() - optParser.exit("Error! Providing a network is mandatory") + argParser.print_help() + argParser.exit("Error! Providing a network is mandatory") if options.verbose: print("Reading net '" + options.net_file + "'") diff -Nru sumo-1.5.0+dfsg1/tools/generateParkingAreaRerouters.py sumo-1.6.0+dfsg1/tools/generateParkingAreaRerouters.py --- sumo-1.5.0+dfsg1/tools/generateParkingAreaRerouters.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/generateParkingAreaRerouters.py 2020-04-27 21:47:56.000000000 +0000 @@ -88,15 +88,11 @@ class ReroutersGeneration(object): """ Generate parking area rerouters from the parking area definition. """ - _opt = None - - _sumo_net = None - _parking_areas = dict() - _sumo_rerouters = dict() - def __init__(self, options): self._opt = options + self._parking_areas = dict() + self._sumo_rerouters = dict() logging.info('Loading SUMO network: %s', options.sumo_net_definition) self._sumo_net = sumolib.net.readNet(options.sumo_net_definition) @@ -129,8 +125,6 @@ pool = multiprocessing.Pool(processes=self._opt.processes) list_parameters = list() splits = numpy.array_split(list(self._parking_areas.keys()), self._opt.processes) - import pickle - pickle.loads(pickle.dumps(self._parking_areas)) for parkings in splits: parameters = { 'selection': parkings, diff -Nru sumo-1.5.0+dfsg1/tools/generateTurnRatios.py sumo-1.6.0+dfsg1/tools/generateTurnRatios.py --- sumo-1.5.0+dfsg1/tools/generateTurnRatios.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/generateTurnRatios.py 2020-04-27 21:47:56.000000000 +0000 @@ -24,6 +24,7 @@ """ from __future__ import absolute_import from __future__ import print_function +from __future__ import division import os import sys @@ -45,6 +46,8 @@ help="define the route file seperated by comma(mandatory)") optParser.add_option("-p", "--probabilities", dest="prob", action="store_true", default=False, help=" calculate the turning probabilities instead of traffic volumes") + optParser.add_option("--id", default="generated", + help="define the interval id") optParser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False, help="tell me what you are doing") (options, args) = optParser.parse_args(args=args) @@ -85,25 +88,20 @@ edgePairFlowsMap, minDepart, maxDepart = getFlows(options.routefiles, options.verbose) with open(options.outfile, 'w') as outf: - sumolib.writeXMLHeader(outf, "$Id$", "turns") # noqa - outf.write(' \n' % (minDepart, maxDepart)) - for from_edge in edgePairFlowsMap: - outf.write(' \n' % from_edge) + sumolib.writeXMLHeader(outf, "$Id$", "edgeRelations", "edgerelations_file.xsd") # noqa + outf.write(' \n' % (options.id, minDepart, maxDepart)) + for from_edge in sorted(edgePairFlowsMap.keys()): if options.prob: - sum = 0. - for to_edge in edgePairFlowsMap[from_edge]: - sum += edgePairFlowsMap[from_edge][to_edge] - for to_edge in edgePairFlowsMap[from_edge]: - outf.write(' \n' % - (to_edge, edgePairFlowsMap[from_edge][to_edge]/sum)) + s = sum(edgePairFlowsMap[from_edge].values()) + for to_edge, count in sorted(edgePairFlowsMap[from_edge].items()): + outf.write(' ' * 8 + '\n' % + (from_edge, to_edge, count / s)) else: - for to_edge in edgePairFlowsMap[from_edge]: - outf.write(' \n' % - (to_edge, edgePairFlowsMap[from_edge][to_edge])) - outf.write(' \n') - + for to_edge, count in sorted(edgePairFlowsMap[from_edge].items()): + outf.write(' ' * 8 + '\n' % + (from_edge, to_edge, count)) outf.write(' \n') - outf.write('\n') + outf.write('\n') outf.close() diff -Nru sumo-1.5.0+dfsg1/tools/import/matsim/matsim_importPlans.py sumo-1.6.0+dfsg1/tools/import/matsim/matsim_importPlans.py --- sumo-1.5.0+dfsg1/tools/import/matsim/matsim_importPlans.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/import/matsim/matsim_importPlans.py 2020-04-27 21:47:56.000000000 +0000 @@ -25,6 +25,10 @@ import os import sys import optparse +try: + from StringIO import StringIO +except ImportError: + from io import StringIO if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) @@ -39,6 +43,10 @@ help="Output file (mandatory)") optParser.add_option("--vehicles-only", dest="carsOnly", action="store_true", default=False, help="Import only vehicles instead of persons") + optParser.add_option("--default-start", dest="defaultStart", default="0:0:0", + help="default start time for the first activity") + optParser.add_option("--default-end", dest="defaultEnd", default="24:0:0", + help="default end time for the last activity") optParser.add_option("-v", "--verbose", dest="verbose", action="store_true", default=False, help="tell me what you are doing") @@ -51,45 +59,80 @@ return options +def writeLeg(outf, options, idveh, leg, startLink, endLink): + depart = leg.dep_time if options.carsOnly else "triggered" + if leg.route is None or leg.route[0].distance == "NaN": + outf.write(' \n' + % (idveh, depart, startLink, endLink)) + else: + outf.write(' \n' % (idveh, depart)) + outf.write(' \n' % (leg.route[0].getText())) + outf.write(' \n') + + def main(options): - with open(options.outfile, 'w') as outf: - sumolib.writeXMLHeader(outf, "$Id: matsim_importPlans.py v1_3_1+0713-63b241ac79 michael.behrisch@dlr.de 2019-10-20 15:41:56 +0200 $", "routes") # noqa - for person in sumolib.output.parse(options.planfile, 'person'): - vehIndex = 0 - plan = person.plan[0] - attributes = person.attributes[0] - # write vehicles - vehicleslist = [] - untillist = [] - for leg in plan.leg: - depart = leg.dep_time if options.carsOnly else "triggered" - idveh = "%s_%s" % (person.id, vehIndex) - if leg.route[0].distance == "NaN": - outf.write(' \n' - % (idveh, depart, leg.route[0].start_link, leg.route[0].end_link)) + persons = [] # (depart, xmlsnippet) + for person in sumolib.output.parse(options.planfile, 'person'): + outf = StringIO() + vehIndex = 0 + plan = person.plan[0] + firstAct = plan.getChildList()[0] + depart = firstAct.start_time + if depart is None: + depart = options.defaultStart + attributes = person.attributes[0] if person.attributes else None + # write vehicles + vehicleslist = [] + untillist = [] + lastAct = None + lastLeg = None + for item in plan.getChildList(): + leg = None + idveh = "%s_%s" % (person.id, vehIndex) + if "act" in item.name: # act or activity + if lastLeg is not None: + leg = lastLeg + leg.dep_time = lastAct.end_time + writeLeg(outf, options, idveh, leg, lastAct.link, item.link) + lastLeg = None + lastAct = item + if item.name == "leg": + if item.route is None: + lastLeg = item else: - outf.write(' \n' % (idveh, depart)) - outf.write(' \n' % (leg.route[0].getText())) - outf.write(' \n') + leg = item + writeLeg(outf, options, idveh, leg, leg.route[0].start_link, leg.route[0].end_link) + if leg: untillist.append(leg.dep_time) vehicleslist.append(idveh) vehIndex = vehIndex+1 - untillist.append(plan.activity[-1].end_time) - # write person - if not options.carsOnly: - vehIndex = 0 - outf.write(' \n' % (person.id, plan.activity[0].start_time)) + untillist.append(lastAct.end_time if lastAct.end_time else options.defaultEnd) + # write person + if not options.carsOnly: + vehIndex = 0 + outf.write(' \n' % (person.id, depart)) + if attributes is not None: for attr in attributes.attribute: outf.write(' \n' % (attr.attr_name, attr.getText())) - for item in plan.getChildList(): - if item.name == "activity": - outf.write(' \n' % - (item.link, untillist[vehIndex], item.type)) - elif item.name == "leg": - outf.write(' \n' - % (vehicleslist[vehIndex], item.route[0].end_link)) + + lastLeg = None + for item in plan.getChildList(): + if "act" in item.name: # act or activity + if lastLeg is not None: + outf.write(' \n' % (vehicleslist[vehIndex], item.link)) vehIndex = vehIndex+1 - outf.write(' \n') + outf.write(' \n' % + (item.link, untillist[vehIndex], item.type)) + if item.name == "leg": + lastLeg = item + outf.write(' \n') + persons.append((sumolib.miscutils.parseTime(depart), outf.getvalue())) + + persons.sort() + with open(options.outfile, 'w') as outf: + sumolib.writeXMLHeader(outf, "$Id: matsim_importPlans.py v1_3_1+0713-63b241ac79 michael.behrisch@dlr.de 2019-10-20 15:41:56 +0200 $", "routes") # noqa + for depart, xml in persons: + outf.write(xml) outf.write('\n') outf.close() diff -Nru sumo-1.5.0+dfsg1/tools/jtcrouter.py sumo-1.6.0+dfsg1/tools/jtcrouter.py --- sumo-1.5.0+dfsg1/tools/jtcrouter.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/jtcrouter.py 2020-04-27 21:47:56.000000000 +0000 @@ -30,7 +30,9 @@ if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) + sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools/turn-defs')) import sumolib # noqa +from turnCount2EdgeCount import parseEdgeCounts # noqa def get_options(args=None): @@ -43,7 +45,7 @@ help="Intermediate turn-ratio-file") parser.add_argument("--flow-output", dest="flowOuput", default="flows.tmp.xml", help="Intermediate flow file") - parser.add_argument("--turn-attribute", dest="turnAttr", default="probability", + parser.add_argument("--turn-attribute", dest="turnAttr", default="count", help="Read turning counts from the given attribute") parser.add_argument("-b", "--begin", default=0, help="begin time") parser.add_argument("-e", "--end", default=3600, help="end time (default 3600)") @@ -121,18 +123,17 @@ options.turnOutput = options.turnFile with open(options.flowOuput, 'w') as ff: ff.write('\n') - for i, interval in enumerate(sumolib.xml.parse(options.turnFile, 'interval')): - for edge in interval.fromEdge: - count = 0 - for toEdge in edge.toEdge: - count += float(getattr(toEdge, options.turnAttr)) + for i, interval in enumerate(parseEdgeCounts(options.turnFile, options.turnAttr)): + interval_id, interval_begin, interval_end, counts = interval + for edge in sorted(counts.keys()): + count = counts[edge] if count > 0: - flowID = edge.id + flowID = edge if i > 0: flowID += "#%s" % i ff.write(' \n' % ( options.prefix, - flowID, edge.id, interval.begin, interval.end, + flowID, edge, interval_begin, interval_end, int(count), options.flowattrs)) ff.write('\n') diff -Nru sumo-1.5.0+dfsg1/tools/net/net2kml.py sumo-1.6.0+dfsg1/tools/net/net2kml.py --- sumo-1.5.0+dfsg1/tools/net/net2kml.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/net/net2kml.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 net2kml.py +# @author Jakob Erdmann +# @date 2020-02-21 + +""" +This script converts a sumo network to KML +""" +from __future__ import absolute_import +from __future__ import print_function +import os +import sys + +if 'SUMO_HOME' in os.environ: + sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) +import sumolib # noqa + + +def parse_args(): + USAGE = "Usage: " + sys.argv[0] + " -n " + argParser = sumolib.options.ArgumentParser(usage=USAGE) + argParser.add_argument("-n", "--net-file", dest="netFile", help="The .net.xml file to convert") + argParser.add_argument("-o", "--output-file", dest="outFile", help="The KML output file name") + argParser.add_argument("-l", "--lanes", action="store_true", default=False, + help="Export lane geometries instead of edge geometries") + argParser.add_argument("-i", "--internal", action="store_true", default=False, + help="Export internal geometries") + argParser.add_argument("--color", default="0f0000ff", help="Color for normal edges") + argParser.add_argument("--internal-color", dest="iColor", default="5f0000ff", help="Color for internal edges") + + options = argParser.parse_args() + if not options.netFile: + print("Missing arguments") + argParser.print_help() + exit() + return options + + +def getGeometries(options, net): + for edge in net.getEdges(): + if options.lanes: + for lane in edge.getLanes(): + yield lane.getID(), lane.getShape(), lane.getWidth() + else: + yield edge.getID(), edge.getShape(), sum([l.getWidth() for l in edge.getLanes()]) + + +if __name__ == "__main__": + options = parse_args() + net = sumolib.net.readNet(options.netFile, withInternal=options.internal) + geomType = 'lane' if options.lanes else 'edge' + + with open(options.outFile, 'w') as outf: + outf.write('\n') + outf.write('\n') + outf.write('\n') + for id, geometry, width in getGeometries(options, net): + color = options.iColor if id[0] == ":" else options.color + outf.write("\t%s\n" % options.netFile) + outf.write("\t1\n") + outf.write("\tnetwork geometries\n") + outf.write("\t\n") + outf.write("\t\n") + outf.write("\t\t%s %s\n" % (geomType, id)) + outf.write("\t\t#trace-%s\n" % id) + outf.write("\t\t\n") + outf.write("\t\t1\n") + outf.write("\t\t1\n") + outf.write("\t\t\t\n") + for x, y in geometry: + lon, lat = net.convertXY2LonLat(x, y) + outf.write('\t\t\t\t%.10f,%.10f\n' % (lon, lat)) + outf.write("\t\t\t\n") + outf.write("\t\t\n") + outf.write("\t\n") + outf.write('\n') + outf.write('\n') diff -Nru sumo-1.5.0+dfsg1/tools/osmWebWizard.py sumo-1.6.0+dfsg1/tools/osmWebWizard.py --- sumo-1.5.0+dfsg1/tools/osmWebWizard.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/osmWebWizard.py 2020-04-27 21:47:56.000000000 +0000 @@ -229,6 +229,8 @@ netconvertOptions += ",--railway.topology.repair" if self.data["leftHand"]: netconvertOptions += ",--lefthand" + if self.data["carOnlyNetwork"]: + netconvertOptions += ",--keep-edges.by-vclass,passenger" options += ["--netconvert-typemap", ','.join(typefiles)] options += ["--netconvert-options", netconvertOptions] @@ -275,10 +277,12 @@ os.mkdir("background_images") tileGet.get(tileOptions) self.report("Success.") + self.decalError = False except Exception: os.chdir(self.tmp) shutil.rmtree("background_images", ignore_errors=True) self.report("Error while downloading background images") + self.decalError = True if self.data["vehicles"] or ptOptions: # routenames stores all routefiles and will join the items later, will @@ -362,7 +366,7 @@ self.filename("guisettings", ".view.xml") with open(self.files["guisettings"], 'w') as f: - if self.data["decal"]: + if self.data["decal"] and not self.decalError: f.write(""" @@ -517,6 +521,7 @@ u'publicTransport': True, u'leftHand': False, u'decal': False, + u'carOnlyNetwork': False, u'testOutputDir': args.testOutputDir, } builder = Builder(data, True) diff -Nru sumo-1.5.0+dfsg1/tools/output/attributeStats.py sumo-1.6.0+dfsg1/tools/output/attributeStats.py --- sumo-1.5.0+dfsg1/tools/output/attributeStats.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/output/attributeStats.py 2020-04-27 21:47:56.000000000 +0000 @@ -23,19 +23,21 @@ import os import sys +from collections import defaultdict from optparse import OptionParser if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(os.path.join(tools)) - from sumolib.xml import parse # noqa + import sumolib + from sumolib.xml import parse, parse_fast # noqa from sumolib.miscutils import Statistics # noqa else: sys.exit("please declare environment variable 'SUMO_HOME'") def get_options(): - USAGE = """Usage %prog [options] """ + USAGE = """Usage %prog [options] """ optParser = OptionParser(usage=USAGE) optParser.add_option("-v", "--verbose", action="store_true", default=False, help="Give more output") @@ -43,36 +45,67 @@ default="tripinfo", help="element to analyze") optParser.add_option("--attribute", type="string", default="timeLoss", help="attribute to analyze") + optParser.add_option("--id-attribute", type="string", dest="idAttr", + default="id", help="attribute to identify data elements") optParser.add_option("--binwidth", type="float", default=50, help="binning width of result histogram") optParser.add_option("--hist-output", type="string", default=None, help="output file for histogram (gnuplot compatible)") optParser.add_option("--full-output", type="string", default=None, help="output file for full data dump") + optParser.add_option("--fast", action="store_true", + default=False, help="use fast parser (does not track missing data)") options, args = optParser.parse_args() if len(args) != 1: sys.exit(USAGE) - options.tripinfos = args[0] + options.datafile = args[0] return options def main(): options = get_options() - attribute_retriever = None - def attribute_retriever(tripinfo): - return - - vals = {} + vals = defaultdict(list) stats = Statistics("%s %ss" % (options.element, options.attribute), histogram=True, scale=options.binwidth) - for tripinfo in parse(options.tripinfos, options.element): - val = float(tripinfo.getAttribute(options.attribute)) - vals[tripinfo.id] = val - stats.add(val, tripinfo.id) + missingAttr = set() + invalidType = set() + + if options.fast: + def elements(): + for element in parse_fast(options.datafile, options.element, [options.idAttr, options.attribute]): + yield getattr(element, options.idAttr), getattr(element, options.attribute) + else: + def elements(): + for element in parse(options.datafile, options.element, heterogeneous=True): + elementID = None + if element.hasAttribute(options.idAttr): + elementID = element.getAttribute(options.idAttr) + stringVal = None + if element.hasAttribute(options.attribute): + stringVal = element.getAttribute(options.attribute) + yield elementID, stringVal + + for elementID, stringVal in elements(): + if stringVal is not None: + try: + val = sumolib.miscutils.parseTime(stringVal) + vals[elementID].append(val) + stats.add(val, elementID) + except Exception: + invalidType.add(stringVal) + else: + missingAttr.add(elementID) print(stats) + if missingAttr: + print("%s elements did not provide attribute '%s' Example ids: %s" % + (len(missingAttr), options.attribute, sorted(missingAttr)[:10])) + if invalidType: + print(("%s distinct values of attribute '%s' could not be interpreted " + + "as numerical value or time. Example values: %s") % + (len(invalidType), options.attribute, sorted(invalidType)[:10])) if options.hist_output is not None: with open(options.hist_output, 'w') as f: @@ -81,9 +114,9 @@ if options.full_output is not None: with open(options.full_output, 'w') as f: - data = [(v, k) for k, v in vals.items()] - for val, id in sorted(data): - f.write("%s %s\n" % (val, id)) + for id, data in vals.items(): + for x in data: + f.write("%s %s\n" % (x, id)) if __name__ == "__main__": diff -Nru sumo-1.5.0+dfsg1/tools/output/computeCoordination.py sumo-1.6.0+dfsg1/tools/output/computeCoordination.py --- sumo-1.5.0+dfsg1/tools/output/computeCoordination.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/output/computeCoordination.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2007-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 computeCoordination.py +# @author Daniel Wesemeyer +# @author Jakob Erdmann +# @date 2018-08-18 + +""" +This script analyses fcd output to compute the coordination factor for a given cooridor +The coordination factor is defined as the fraction of vehicles that passed the +corridor without stopping to the total number of vehicles on the corridor +""" +from __future__ import absolute_import +from __future__ import print_function +import os +import sys +from collections import defaultdict +import math # noqa + +if 'SUMO_HOME' in os.environ: + sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) +import sumolib # noqa +from sumolib.xml import parse_fast # noqa + + +def getOptions(args=None): + + usage = "generateTLSE2Detectors.py -n example.net.xml -l 250 -d .1 -f 60" + argParser = sumolib.options.ArgumentParser(usage=usage) + argParser.add_argument("-f", "--fcd-file", dest="fcdfile", + help="Input fcd file (mandatory)") + argParser.add_argument("-m", "--min-speed", dest="minspeed", type=float, default=5, + help="Minimum speed to consider vehicle undelayed") + argParser.add_argument("--filter-route", dest="filterRoute", + help="only consider vehicles that pass the given list of edges (regardless of gaps)") + + options = argParser.parse_args() + + if options.fcdfile is None: + sys.exit("mandatory argument FCD_FILE missing") + + if options.filterRoute is not None: + options.filterRoute = options.filterRoute.split(',') + else: + options.filterRoute = [] + return options + + +def main(options): + + routes = defaultdict(list) # vehID -> recorded edges + minSpeed = defaultdict(lambda: 1000) + active = set() # vehicles that have passed the first filterRoute edge + for vehicle in parse_fast(options.fcdfile, 'vehicle', ['id', 'speed', 'lane']): + vehID = vehicle.id + edge = vehicle.lane[0:vehicle.lane.rfind('_')] + if len(routes[vehID]) == 0 or routes[vehID][-1] != edge: + routes[vehID].append(edge) + if options.filterRoute and vehID not in active: + if edge in options.filterRoute: + active.add(vehID) + else: + continue + minSpeed[vehID] = min(minSpeed[vehID], float(vehicle.speed)) + + n = 0 + delayed = 0 + + for vehID, route in routes.items(): + skip = False + for required in options.filterRoute: + if required not in route: + skip = True + break + if not skip: + n += 1 + if minSpeed[vehID] < options.minspeed: + delayed += 1 + + print("n=%s d=%s coordinationFactor=%s" % (n, delayed, (n - delayed) / float(n))) + + +if __name__ == "__main__": + main(getOptions()) diff -Nru sumo-1.5.0+dfsg1/tools/output/generateTLSE2Detectors.py sumo-1.6.0+dfsg1/tools/output/generateTLSE2Detectors.py --- sumo-1.5.0+dfsg1/tools/output/generateTLSE2Detectors.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/output/generateTLSE2Detectors.py 2020-04-27 21:47:56.000000000 +0000 @@ -22,12 +22,11 @@ from __future__ import print_function import logging -import optparse import os import sys -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -import sumolib.xml # noqa +sys.path.append(os.path.join(os.environ["SUMO_HOME"], "tools")) +import sumolib # noqa def adjust_detector_length(requested_detector_length, @@ -73,47 +72,47 @@ logging.basicConfig(level="INFO") - option_parser = optparse.OptionParser() - option_parser.add_option("-n", "--net-file", - dest="net_file", - help="Network file to work with. Mandatory.", - type="string") - option_parser.add_option("-l", "--detector-length", - dest="requested_detector_length", - help="Length of the detector in meters " - "(-1 for maximal length).", - type="int", - default=250) - option_parser.add_option("-d", "--distance-to-TLS", - dest="requested_distance_to_tls", - help="Distance of the detector to the traffic " - "light in meters. Defaults to 0.1m.", - type="float", - default=.1) - option_parser.add_option("-f", "--frequency", - dest="frequency", - help="Detector's frequency. Defaults to 60.", - type="int", - default=60) - option_parser.add_option("-o", "--output", - dest="output", - help="The name of the file to write the detector " - "definitions into. Defaults to e2.add.xml.", - type="string", - default="e2.add.xml") - option_parser.add_option("-r", "--results-file", - dest="results", - help="The name of the file the detectors write " - "their output into. Defaults to e2output.xml.", - type="string", - default="e2output.xml") - option_parser.set_usage("generateTLSE2Detectors.py -n example.net.xml " - "-l 250 -d .1 -f 60") + usage = "generateTLSE2Detectors.py -n example.net.xml -l 250 -d .1 -f 60" + argParser = sumolib.options.ArgumentParser(usage=usage) + argParser.add_argument("-n", "--net-file", + dest="net_file", + help="Network file to work with. Mandatory.") + argParser.add_argument("-l", "--detector-length", + dest="requested_detector_length", + help="Length of the detector in meters " + "(-1 for maximal length).", + type=int, + default=250) + argParser.add_argument("-d", "--distance-to-TLS", + dest="requested_distance_to_tls", + help="Distance of the detector to the traffic " + "light in meters. Defaults to 0.1m.", + type=float, + default=.1) + argParser.add_argument("-f", "--frequency", + dest="frequency", + help="Detector's frequency. Defaults to 60.", + type=int, + default=60) + argParser.add_argument("-o", "--output", + dest="output", + help="The name of the file to write the detector " + "definitions into. Defaults to e2.add.xml.", + default="e2.add.xml") + argParser.add_argument("-r", "--results-file", + dest="results", + help="The name of the file the detectors write " + "their output into. Defaults to e2output.xml.", + default="e2output.xml") + argParser.add_argument("--tl-coupled", action="store_true", + dest="tlCoupled", + default=False, + help="Couple output frequency to traffic light phase") - (options, args) = option_parser.parse_args() + options = argParser.parse_args() if not options.net_file: print("Missing arguments") - option_parser.print_help() + argParser.print_help() exit() logging.info("Reading net...") @@ -147,7 +146,10 @@ detector_xml = detectors_xml.addChild("laneAreaDetector") detector_xml.setAttribute("file", options.results) - detector_xml.setAttribute("freq", str(options.frequency)) + if options.tlCoupled: + detector_xml.setAttribute("tl", tls.getID()) + else: + detector_xml.setAttribute("freq", str(options.frequency)) detector_xml.setAttribute("friendlyPos", "x") detector_xml.setAttribute("id", "e2det_" + str(lane_id)) detector_xml.setAttribute("lane", str(lane_id)) diff -Nru sumo-1.5.0+dfsg1/tools/plot_trajectories.py sumo-1.6.0+dfsg1/tools/plot_trajectories.py --- sumo-1.5.0+dfsg1/tools/plot_trajectories.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/plot_trajectories.py 2020-04-27 21:47:56.000000000 +0000 @@ -84,7 +84,7 @@ def short_names(filenames): if len(filenames) == 1: - return filenames[0] + return filenames reversedNames = [''.join(reversed(f)) for f in filenames] prefixLen = len(os.path.commonprefix(filenames)) suffixLen = len(os.path.commonprefix(reversedNames)) diff -Nru sumo-1.5.0+dfsg1/tools/randomTrips.py sumo-1.6.0+dfsg1/tools/randomTrips.py --- sumo-1.5.0+dfsg1/tools/randomTrips.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/randomTrips.py 2020-04-27 21:47:56.000000000 +0000 @@ -244,7 +244,7 @@ raise Exception("no trip found after %s tries" % maxtries) -def get_prob_fun(options, fringe_bonus, fringe_forbidden): +def get_prob_fun(options, fringe_bonus, fringe_forbidden, max_length): # fringe_bonus None generates intermediate way points def edge_probability(edge): if options.vclass and not edge.allows(options.vclass): @@ -257,7 +257,11 @@ return 0 # the wrong kind of fringe prob = 1 if options.length: - prob *= edge.getLength() + if options.fringe_factor != 1.0 and fringe_bonus is not None and edge.is_fringe(): + # short fringe edges should not suffer a penalty + prob *= max_length + else: + prob *= edge.getLength() if options.lanes: prob *= edge.getLaneNumber() prob *= (edge.getSpeed() ** options.speed_exponent) @@ -303,12 +307,16 @@ def buildTripGenerator(net, options): try: + max_length = 0 + for edge in net.getEdges(): + if not edge.is_fringe(): + max_length = max(max_length, edge.getLength()) forbidden_source_fringe = None if options.allow_fringe else "_outgoing" forbidden_sink_fringe = None if options.allow_fringe else "_incoming" source_generator = RandomEdgeGenerator( - net, get_prob_fun(options, "_incoming", forbidden_source_fringe)) + net, get_prob_fun(options, "_incoming", forbidden_source_fringe, max_length)) sink_generator = RandomEdgeGenerator( - net, get_prob_fun(options, "_outgoing", forbidden_sink_fringe)) + net, get_prob_fun(options, "_outgoing", forbidden_sink_fringe, max_length)) if options.weightsprefix: if os.path.isfile(options.weightsprefix + SOURCE_SUFFIX): source_generator = RandomEdgeGenerator( @@ -323,7 +331,7 @@ try: via_generator = RandomEdgeGenerator( - net, get_prob_fun(options, None, None)) + net, get_prob_fun(options, None, None, 1)) if options.weightsprefix and os.path.isfile(options.weightsprefix + VIA_SUFFIX): via_generator = RandomEdgeGenerator( net, LoadedProps(options.weightsprefix + VIA_SUFFIX)) diff -Nru sumo-1.5.0+dfsg1/tools/route/checkStopOrder.py sumo-1.6.0+dfsg1/tools/route/checkStopOrder.py --- sumo-1.5.0+dfsg1/tools/route/checkStopOrder.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/route/checkStopOrder.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2014-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 checkStopOrder.py +# @author Jakob Erdmann +# @date 2020-03-19 + +""" +Check order of arriving and leaving vehicles at stopping places. +Report if vehicles change their order at a stop (a vehicle arrives later but leaves earlier) +""" + +from __future__ import absolute_import +from __future__ import print_function + +import os +import sys +from collections import defaultdict + +if 'SUMO_HOME' in os.environ: + sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) + import sumolib # noqa + from sumolib.miscutils import parseTime, humanReadableTime +else: + sys.exit("please declare environment variable 'SUMO_HOME'") + + +def get_options(args=None): + parser = sumolib.options.ArgumentParser(description="Sample routes to match counts") + parser.add_argument("-r", "--route-files", dest="routeFiles", + help="Input route file file") + parser.add_argument("-H", "--human-readable-time", dest="hrTime", action="store_true", default=False, + help="Write time values as hour:minute:second or day:hour:minute:second rathern than seconds") + parser.add_argument("-p", "--ignore-parking", dest="ignoreParking", action="store_true", default=False, + help="Do not report conflicts with parking vehicles") + + options = parser.parse_args(args=args) + options.routeFiles = options.routeFiles.split(',') + + return options + + +def main(options): + + tf = humanReadableTime if options.hrTime else lambda x: x + + stopTimes = defaultdict(list) + for routefile in options.routeFiles: + for vehicle in sumolib.xml.parse(routefile, ['vehicle', 'trip'], heterogeneous=True): + if vehicle.stop is None: + continue + for stop in vehicle.stop: + if stop.parking == "true" and options.ignoreParking: + continue + until = parseTime(stop.until) + arrival = parseTime(stop.arrival) if stop.arrival else until - parseTime(stop.duration) + stopTimes[stop.busStop].append((arrival, until, vehicle.id)) + + for stop, times in stopTimes.items(): + times.sort() + for i, (a, u, v) in enumerate(times): + for a2, u2, v2 in times[i + 1:]: + if u2 < u: + print("Vehicle %s (%s, %s) overtakes %s (%s, %s) at stop %s" % ( + v2, tf(a2), tf(u2), v, tf(a), tf(u), stop)) + + +if __name__ == "__main__": + main(get_options()) diff -Nru sumo-1.5.0+dfsg1/tools/route/sort_routes.py sumo-1.6.0+dfsg1/tools/route/sort_routes.py --- sumo-1.5.0+dfsg1/tools/route/sort_routes.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/route/sort_routes.py 2020-04-27 21:47:56.000000000 +0000 @@ -19,14 +19,17 @@ from __future__ import absolute_import from __future__ import print_function +import os import sys from xml.dom import pulldom from xml.sax import handler from xml.sax import make_parser from optparse import OptionParser -import time -DEPART_ATTRS = {'vehicle': 'depart', 'flow': 'begin', 'person': 'depart'} +sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) +import sumolib # noqa + +DEPART_ATTRS = {'vehicle': 'depart', 'trip': 'depart', 'flow': 'begin', 'person': 'depart'} def get_options(args=None): @@ -59,7 +62,9 @@ if departAttr is not None: startString = parsenode.getAttribute(departAttr) if ':' in startString: - start = time.strptime(startString, "%d:%H:%M:%S") + start = sumolib.miscutils.parseTime(startString) + elif startString == "triggered": + start = -1 # before everything else else: start = float(startString) vehicles.append( diff -Nru sumo-1.5.0+dfsg1/tools/routeSampler.py sumo-1.6.0+dfsg1/tools/routeSampler.py --- sumo-1.5.0+dfsg1/tools/routeSampler.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/routeSampler.py 2020-04-27 21:47:56.000000000 +0000 @@ -24,25 +24,34 @@ import os import sys import random -from argparse import ArgumentParser +from collections import defaultdict +try: + from StringIO import StringIO +except ImportError: + from io import StringIO if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) import sumolib # noqa +from sumolib.miscutils import parseTime # noqa def get_options(args=None): - parser = ArgumentParser(description="Sample routes to match counts") - parser.add_argument("-t", "--turn-file", dest="turnFile", + parser = sumolib.options.ArgumentParser(description="Sample routes to match counts") + parser.add_argument("-r", "--route-files", dest="routeFiles", + help="Input route file file") + parser.add_argument("-t", "--turn-files", dest="turnFiles", help="Input turn-count file") - parser.add_argument("-d", "--edgedata-file", dest="edgeDataFile", + parser.add_argument("-d", "--edgedata-files", dest="edgeDataFiles", help="Input edgeData file file (for counts)") + parser.add_argument("-O", "--od-files", dest="odFiles", + help="Input edgeRelation file for origin-destination counts") parser.add_argument("--edgedata-attribute", dest="edgeDataAttr", default="entered", help="Read edgeData counts from the given attribute") - parser.add_argument("--turn-attribute", dest="turnAttr", default="probability", + parser.add_argument("--turn-attribute", dest="turnAttr", default="count", help="Read turning counts from the given attribute") - parser.add_argument("-r", "--route-file", dest="routeFile", - help="Input route file file") + parser.add_argument("--turn-max-gap", type=int, dest="turnMaxGap", default=0, + help="Allow at most a gap of INT edges between from-edge and to-edge") parser.add_argument("-o", "--output-file", dest="out", default="out.rou.xml", help="Output route file") parser.add_argument("--prefix", dest="prefix", default="", @@ -51,71 +60,193 @@ help="additional vehicle attributes") parser.add_argument("-s", "--seed", type=int, default=42, help="random seed") + parser.add_argument("--mismatch-output", dest="mismatchOut", + help="write cout-data with overflow/underflow information to FILE") + parser.add_argument("--optimize", + help="set optimization method level (full, INT boundary)") + parser.add_argument("--optimize-input", dest="optimizeInput", action="store_true", default=False, + help="Skip resampling and run optimize directly on the input routes") + parser.add_argument("--geh-ok", dest="gehOk", default=5, + help="threshold for acceptable GEH values") + parser.add_argument("-f", "--write-flows", dest="writeFlows", + help="write flows with the give style instead of vehicles [number|probability]") + parser.add_argument("-I", "--write-route-ids", dest="writeRouteIDs", action="store_true", default=False, + help="write routes with ids") + parser.add_argument("-u", "--write-route-distribution", dest="writeRouteDist", + help="write routeDistribution with the given ID instead of individual routes") + parser.add_argument("-b", "--begin", help="custom begin time (seconds or H:M:S)") + parser.add_argument("-e", "--end", help="custom end time (seconds or H:M:S)") + parser.add_argument("-i", "--interval", help="custom aggregation interval (seconds or H:M:S)") + parser.add_argument("-v", "--verbose", action="store_true", default=False, + help="tell me what you are doing") + parser.add_argument("-V", "--verbose.histograms", dest="verboseHistogram", action="store_true", default=False, + help="print histograms of edge numbers and detector passing count") options = parser.parse_args(args=args) - if (options.routeFile is None or - (options.turnFile is None and options.edgeDataFile is None)): + if (options.routeFiles is None or + (options.turnFiles is None and options.edgeDataFiles is None and options.odFiles is None)): parser.print_help() sys.exit() - options.turnFile = options.turnFile.split(',') if options.turnFile is not None else [] - options.edgeDataFile = options.edgeDataFile.split(',') if options.edgeDataFile is not None else [] + if options.writeRouteIDs and options.writeRouteDist: + sys.stderr.write("Only one of the options --write-route-ids and --write-route-distribution may be used") + sys.exit() + if options.writeFlows not in [None, "number", "probability"]: + sys.stderr.write("Options --write-flows only accepts arguments 'number' and 'probability'") + sys.exit() + + options.routeFiles = options.routeFiles.split(',') + options.turnFiles = options.turnFiles.split(',') if options.turnFiles is not None else [] + options.edgeDataFiles = options.edgeDataFiles.split(',') if options.edgeDataFiles is not None else [] + options.odFiles = options.odFiles.split(',') if options.odFiles is not None else [] if options.vehattrs and options.vehattrs[0] != ' ': options.vehattrs = ' ' + options.vehattrs + + if options.optimize is not None: + try: + import scipy.optimize # noqa + if options.optimize != "full": + try: + options.optimize = int(options.optimize) + except Exception: + print("Option optimize requires the value 'full' or an integer", file=sys.stderr) + sys.exit(1) + except ImportError: + print("Cannot use optimization (scipy not installed)", file=sys.stderr) + sys.exit(1) + + if options.optimizeInput and type(options.optimize) != int: + print("Option --optimize-input requires an integer argument for --optimize", file=sys.stderr) + sys.exit(1) + return options class CountData: - def __init__(self, count, edgeTuple, allRoutes): + def __init__(self, count, edgeTuple, allRoutes, isOD): + self.origCount = count self.count = count self.edgeTuple = edgeTuple + self.isOD = isOD self.routeSet = set() - for routeIndex, edges in enumerate(allRoutes): + for routeIndex, edges in enumerate(allRoutes.unique): if self.routePasses(edges): self.routeSet.add(routeIndex) - if self.count > 0 and not self.routeSet: - print("Warning: no routes pass edge '%s' (count %s)" % - (' '.join(self.edgeTuple), self.count), file=sys.stderr) def routePasses(self, edges): + if self.isOD: + return edges[0] == self.edgeTuple[0] and edges[-1] == self.edgeTuple[-1] try: i = edges.index(self.edgeTuple[0]) - if self.edgeTuple != tuple(edges[i:i + len(self.edgeTuple)]): - return False + maxDelta = sumolib.options.getOptions().turnMaxGap + 1 + for edge in self.edgeTuple[1:]: + i2 = edges.index(edge, i) + if i2 - i > maxDelta: + return False + i = i2 except ValueError: # first edge not in route return False return True + def addCount(self, count): + self.count += count + self.origCount += count + + def sampleOpen(self, openRoutes, routeCounts): + cands = list(self.routeSet.intersection(openRoutes)) + assert(cands) + probs = [routeCounts[i] for i in cands] + x = random.random() * sum(probs) + seen = 0 + for route, prob in zip(cands, probs): + seen += prob + if seen >= x: + return route + assert(False) + + +def getIntervals(options): + begin, end, interval = parseTimeRange(options.turnFiles + options.edgeDataFiles + options.odFiles) + if options.begin is not None: + begin = parseTime(options.begin) + if options.end is not None: + end = parseTime(options.end) + if options.interval is not None: + interval = parseTime(options.interval) -def parseTurnCounts(fnames, allRoutes, attr): result = [] - for fname in fnames: - for interval in sumolib.xml.parse(fname, 'interval'): - for fromEdge in interval.fromEdge: - for toEdge in fromEdge.toEdge: - result.append(CountData(int(getattr(toEdge, attr)), - (fromEdge.id, toEdge.id), allRoutes)) + while begin < end: + result.append((begin, begin + interval)) + begin += interval + return result -def parseEdgeCounts(fnames, allRoutes, attr): +def getOverlap(begin, end, iBegin, iEnd): + """return overlap of the given intervals as fraction""" + if iEnd <= begin or end <= iBegin: + return 0 # no overlap + elif iBegin >= begin and iEnd <= end: + return 1 # data interval fully within requested interval + elif iBegin <= begin and iEnd >= end: + return (end - begin) / (iEnd - iBegin) # only part of the data interval applies to the requested interval + elif iBegin <= begin and iEnd <= end: + return (iEnd - begin) / (iEnd - iBegin) # partial overlap + else: + return (end - iBegin) / (iEnd - iBegin) # partial overlap + + +def parseTurnCounts(interval, attr): + for edgeRel in interval.edgeRelation: + via = [] if edgeRel.via is None else edgeRel.via.split(' ') + edges = tuple([edgeRel.attr_from] + via + [edgeRel.to]) + value = getattr(edgeRel, attr) + yield edges, value + + +def parseEdgeCounts(interval, attr): + for edge in interval.edge: + yield (edge.id,), getattr(edge, attr) + + +def parseDataIntervals(parseFun, fnames, begin, end, allRoutes, attr, isOD=False, warn=False): + locations = {} # edges -> CountData result = [] for fname in fnames: - for interval in sumolib.xml.parse(fname, 'interval'): - for edge in interval.edge: - result.append(CountData(int(getattr(edge, attr)), - (edge.id,), allRoutes)) + for interval in sumolib.xml.parse(fname, 'interval', heterogeneous=True): + overlap = getOverlap(begin, end, parseTime(interval.begin), parseTime(interval.end)) + if overlap > 0: + # print(begin, end, interval.begin, interval.end, "overlap:", overlap) + for edges, value in parseFun(interval, attr): + try: + value = float(value) + except TypeError: + if warn: + print("Warning: Missing '%s' value in file '%s' for edge(s) '%s'" % + (attr, fname, ' '.join(edges)), file=sys.stderr) + continue + if edges not in locations: + result.append(CountData(0, edges, allRoutes, isOD)) + locations[edges] = result[-1] + elif isOD != locations[edges].isOD: + print("Warning: Edge relation '%s' occurs as turn relation and also as OD-relation" % + ' '.join(edges), file=sys.stderr) + locations[edges].addCount(int(value * overlap)) return result def parseTimeRange(fnames): begin = 1e20 end = 0 + minInterval = 1e20 for fname in fnames: for interval in sumolib.xml.parse(fname, 'interval'): - begin = min(begin, float(interval.begin)) - end = max(end, float(interval.end)) - return begin, end + iBegin = parseTime(interval.begin) + iEnd = parseTime(interval.end) + begin = min(begin, iBegin) + end = max(end, iEnd) + minInterval = min(minInterval, iEnd - iBegin) + return begin, end, minInterval def hasCapacity(dataIndices, countData): @@ -126,73 +257,390 @@ def updateOpenRoutes(openRoutes, routeUsage, countData): - return filter(lambda r: hasCapacity(routeUsage[r], countData), openRoutes) + return set(filter(lambda r: hasCapacity(routeUsage[r], countData), openRoutes)) def updateOpenCounts(openCounts, countData, openRoutes): - return filter(lambda i: countData[i].routeSet.intersection(openRoutes), openCounts) + return set(filter(lambda i: countData[i].routeSet.intersection(openRoutes), openCounts)) -def main(options): - if options.seed: - random.seed(options.seed) +def optimize(options, countData, routes, usedRoutes, routeUsage): + """ use relaxtion of the ILP problem for picking the number of times that each route is used + x = usageCount vector (count for each route index) + c = weight vector (vector of 1s) + A_eq = routeUsage encoding + b_eq = counts + + Rationale: + c: costs for using each route, + when minimizing x @ c, routes that pass multiple counting stations are getting an advantage + + """ + import scipy.optimize as opt + import scipy.version + import numpy as np + + k = routes.number + m = len(countData) + + priorRouteCounts = getRouteCounts(routes, usedRoutes) + + if options.optimize == "full": + # allow changing all prior usedRoutes + bounds = None + else: + u = int(options.optimize) + if u == 0: + print("Optimization skipped") + return + # limited optimization: change prior routeCounts by at most u per route + bounds = [(max(0, p - u), p + u) for p in priorRouteCounts] + [(0, None)] * m + + # Ax <= b + # x + s = b + # min s + # -> x2 = [x, s] + + A = np.zeros((m, k)) + for i in range(0, m): + for j in range(0, k): + A[i][j] = int(j in countData[i].routeSet) + A_eq = np.concatenate((A, np.identity(m)), 1) + + # constraint: achieve counts + b = np.asarray([cd.origCount for cd in countData]) + + # minimization objective + c = np.concatenate((np.zeros(k), np.ones(m))) # [x, s], only s counts for minimization + + # set x to prior counts and slack to deficit (otherwise solver may fail to any find soluton + x0 = priorRouteCounts + [cd.origCount - cd.count for cd in countData] + + # print("k=%s" % k) + # print("m=%s" % m) + # print("A_eq (%s) %s" % (A_eq.shape, A_eq)) + # print("b (%s) %s" % (len(b), b)) + # print("c (%s) %s" % (len(c), c)) + # print("bounds (%s) %s" % (len(bounds) if bounds is not None else "-", bounds)) + # print("x0 (%s) %s" % (len(x0), x0)) + + linProgOpts = {} + if options.verbose: + linProgOpts["disp"] = True + + try: + res = opt.linprog(c, A_eq=A_eq, b_eq=b, bounds=bounds, x0=x0, options=linProgOpts) + except TypeError: + if options.verbose: + print("Warning: Scipy version %s does not support initial guess for opt.linprog. Optimization may fail" + % scipy.version.version, file=sys.stderr) + res = opt.linprog(c, A_eq=A_eq, b_eq=b, bounds=bounds, options=linProgOpts) + + del usedRoutes[:] + if res.success: + print("Optimization succeeded") + routeCounts = res.x[:k] # cut of slack variables + # slack = res.x[k:] + # print("routeCounts (n=%s, sum=%s, intSum=%s, roundSum=%s) %s" % ( + # len(routeCounts), + # sum(routeCounts), + # sum(map(int, routeCounts)), + # sum(map(round, routeCounts)), + # routeCounts)) + # print("slack (n=%s, sum=%s) %s" % (len(slack), sum(slack), slack)) + usedRoutes.extend(sum([[i] * int(round(c)) for i, c in enumerate(routeCounts)], [])) + # print("#usedRoutes=%s" % len(usedRoutes)) + # update countData + else: + print("Optimization failed") + + +class Routes: + def __init__(self, routefiles): + self.all = [] + for routefile in routefiles: + self.all += [tuple(r.edges.split()) for r in sumolib.xml.parse(routefile, 'route')] + self.unique = sorted(list(set(self.all))) + self.number = len(self.unique) + self.edges2index = dict([(e, i) for i, e in enumerate(self.unique)]) + self.loadedCounts = [0] * len(self.edges2index) # route index to count + for e in self.all: + self.loadedCounts[self.edges2index[e]] += 1 + + +def resetCounts(usedRoutes, routeUsage, countData): + for cd in countData: + cd.count = cd.origCount + for r in usedRoutes: + for i in routeUsage[r]: + countData[i].count -= 1 - # store which routes are passing each counting location (using route index) - routes = [r.edges.split() for r in sumolib.xml.parse_fast(options.routeFile, 'route', ['edges'])] - countData = (parseTurnCounts(options.turnFile, routes, options.turnAttr) - + parseEdgeCounts(options.edgeDataFile, routes, options.edgeDataAttr)) +def getRouteCounts(routes, usedRoutes): + result = [0] * routes.number + for r in usedRoutes: + result[r] += 1 + return result + + +def getRouteUsage(routes, countData): # store which counting locations are used by each route (using countData index) - routeUsage = [set() for r in routes] + routeUsage = [set() for r in routes.unique] for i, cd in enumerate(countData): for routeIndex in cd.routeSet: routeUsage[routeIndex].add(i) + return routeUsage + + +def main(options): + if options.seed: + random.seed(options.seed) + + routes = Routes(options.routeFiles) + + intervals = getIntervals(options) + + # preliminary integrity check for the whole time range + b = intervals[0][0] + e = intervals[-1][-1] + countData = (parseDataIntervals(parseTurnCounts, options.turnFiles, b, e, + routes, options.turnAttr, warn=True) + + parseDataIntervals(parseEdgeCounts, options.edgeDataFiles, b, e, + routes, options.edgeDataAttr, warn=True) + + parseDataIntervals(parseTurnCounts, options.odFiles, b, e, + routes, options.turnAttr, True, warn=True)) + routeUsage = getRouteUsage(routes, countData) + + for cd in countData: + if cd.count > 0 and not cd.routeSet: + print("Warning: no routes pass edge '%s' (count %s)" % ( + ' '.join(cd.edgeTuple), cd.count), file=sys.stderr) + + if options.verbose: + print("Loaded %s routes (%s distinct)" % (len(routes.all), routes.number)) + if options.verboseHistogram: + edgeCount = sumolib.miscutils.Statistics("route edge count", histogram=True) + detectorCount = sumolib.miscutils.Statistics("route detector count", histogram=True) + for i, edges in enumerate(routes.unique): + edgeCount.add(len(edges), i) + detectorCount.add(len(routeUsage[i]), i) + print("input %s" % edgeCount) + print("input %s" % detectorCount) + + mismatchf = None + if options.mismatchOut: + mismatchf = open(options.mismatchOut, 'w') + sumolib.writeXMLHeader(mismatchf, "$Id$") # noqa + mismatchf.write('\n') + + underflowSummary = sumolib.miscutils.Statistics("all interval underflow") + overflowSummary = sumolib.miscutils.Statistics("all interval overflow") + gehSummary = sumolib.miscutils.Statistics("all interval GEH%") + + with open(options.out, 'w') as outf: + sumolib.writeXMLHeader(outf, "$Id$", "routes") # noqa + for begin, end in intervals: + intervalPrefix = "" if len(intervals) == 1 else "%s_" % int(begin) + uFlow, oFlow, gehOK = solveInterval(options, routes, begin, end, intervalPrefix, outf, mismatchf) + underflowSummary.add(uFlow, begin) + overflowSummary.add(oFlow, begin) + gehSummary.add(gehOK, begin) + outf.write('\n') + + if options.mismatchOut: + mismatchf.write('\n') + mismatchf.close() + + if len(intervals) > 1: + print(underflowSummary) + print(overflowSummary) + print(gehSummary) + + +def _sample(sampleSet): + population = tuple(sampleSet) + return population[(int)(random.random() * len(population))] + + +def solveInterval(options, routes, begin, end, intervalPrefix, outf, mismatchf): + # store which routes are passing each counting location (using route index) + countData = (parseDataIntervals(parseTurnCounts, options.turnFiles, begin, end, routes, options.turnAttr) + + parseDataIntervals(parseEdgeCounts, options.edgeDataFiles, begin, end, routes, options.edgeDataAttr) + + parseDataIntervals(parseTurnCounts, options.odFiles, begin, end, routes, options.turnAttr, True)) + + routeUsage = getRouteUsage(routes, countData) # pick a random couting location and select a new route that passes it until # all counts are satisfied or no routes can be used anymore - openRoutes = set(range(0, len(routes))) + openRoutes = set(range(0, routes.number)) openCounts = set(range(0, len(countData))) openRoutes = updateOpenRoutes(openRoutes, routeUsage, countData) openCounts = updateOpenCounts(openCounts, countData, openRoutes) usedRoutes = [] - totalCount = 0 - while openCounts: - cd = countData[random.sample(openCounts, 1)[0]] - routeIndex = random.sample(cd.routeSet.intersection(openRoutes), 1)[0] - usedRoutes.append(routeIndex) - for dataIndex in routeUsage[routeIndex]: - countData[dataIndex].count -= 1 - totalCount += 1 - openRoutes = updateOpenRoutes(openRoutes, routeUsage, countData) - openCounts = updateOpenCounts(openCounts, countData, openRoutes) + if options.optimizeInput: + usedRoutes = [routes.edges2index[e] for e in routes.all] + resetCounts(usedRoutes, routeUsage, countData) + else: + while openCounts: + cd = countData[_sample(openCounts)] + routeIndex = _sample(cd.routeSet.intersection(openRoutes)) + usedRoutes.append(routeIndex) + for dataIndex in routeUsage[routeIndex]: + countData[dataIndex].count -= 1 + openRoutes = updateOpenRoutes(openRoutes, routeUsage, countData) + openCounts = updateOpenCounts(openCounts, countData, openRoutes) + + totalMismatch = sum([cd.count for cd in countData]) + if totalMismatch > 0 and options.optimize is not None: + if options.verbose: + print("Starting optimization for interval [%s, %s] (mismatch %s)" % ( + begin, end, totalMismatch)) + optimize(options, countData, routes, usedRoutes, routeUsage) + resetCounts(usedRoutes, routeUsage, countData) + # avoid bias from sampling order / optimization + random.shuffle(usedRoutes, random.random) - begin, end = parseTimeRange(options.turnFile + options.edgeDataFile) - with open(options.out, 'w') as outf: - sumolib.writeXMLHeader(outf, "$Id$", "routes") # noqa + if usedRoutes: + outf.write('\n' % (begin, end)) period = (end - begin) / len(usedRoutes) depart = begin - for i, routeIndex in enumerate(usedRoutes): - outf.write(' \n' % ( - options.prefix, i, depart, options.vehattrs)) - outf.write(' \n' % ' '.join(routes[routeIndex])) - outf.write(' \n') - depart += period - outf.write('\n') - - unfilledLocations = 0 - missingCount = 0 + routeCounts = getRouteCounts(routes, usedRoutes) + if options.writeRouteIDs: + for routeIndex in sorted(set(usedRoutes)): + outf.write(' \n' % ( + intervalPrefix, routeIndex, ' '.join(routes.unique[routeIndex]), routeCounts[routeIndex])) + outf.write('\n') + elif options.writeRouteDist: + outf.write(' \n' % (intervalPrefix, options.writeRouteDist)) + for routeIndex in sorted(set(usedRoutes)): + outf.write(' \n' % ( + intervalPrefix, routeIndex, ' '.join(routes.unique[routeIndex]), routeCounts[routeIndex])) + outf.write(' \n\n') + + routeID = options.writeRouteDist + if options.writeFlows is None: + for i, routeIndex in enumerate(usedRoutes): + if options.writeRouteIDs: + routeID = routeIndex + vehID = options.prefix + intervalPrefix + str(i) + if routeID is not None: + outf.write(' \n' % ( + vehID, depart, intervalPrefix, routeID, options.vehattrs)) + else: + outf.write(' \n' % ( + vehID, depart, options.vehattrs)) + outf.write(' \n' % ' '.join(routes.unique[routeIndex])) + outf.write(' \n') + depart += period + else: + routeDeparts = defaultdict(list) + for routeIndex in usedRoutes: + routeDeparts[routeIndex].append(depart) + depart += period + if options.writeRouteDist: + totalCount = sum(routeCounts) + probability = totalCount / (end - begin) + flowID = options.prefix + intervalPrefix + options.writeRouteDist + if options.writeFlows == "number" or probability > 1.001: + repeat = 'number="%s"' % totalCount + if options.writeFlows == "probability": + sys.stderr.write("Warning: could not write flow %s with probability %.2f\n" % + (flowID, probability)) + else: + repeat = 'probability="%s"' % probability + outf.write(' \n' % ( + flowID, begin, end, repeat, + options.writeRouteDist, options.vehattrs)) + else: + # ensure flows are sorted + flows = [] + for routeIndex in sorted(set(usedRoutes)): + outf2 = StringIO() + fBegin = min(routeDeparts[routeIndex]) + fEnd = max(routeDeparts[routeIndex] + [fBegin + 1.0]) + probability = routeCounts[routeIndex] / (fEnd - fBegin) + flowID = "%s%s%s" % (options.prefix, intervalPrefix, routeIndex) + if options.writeFlows == "number" or probability > 1.001: + repeat = 'number="%s"' % routeCounts[routeIndex] + if options.writeFlows == "probability": + sys.stderr.write("Warning: could not write flow %s with probability %.2f\n" % ( + flowID, probability)) + else: + repeat = 'probability="%s"' % probability + if options.writeRouteIDs: + outf2.write(' \n' % ( + flowID, fBegin, fEnd, repeat, + intervalPrefix, routeIndex, options.vehattrs)) + else: + outf2.write(' \n' % ( + flowID, fBegin, fEnd, repeat, options.vehattrs)) + outf2.write(' \n' % ' '.join(routes.unique[routeIndex])) + outf2.write(' \n') + flows.append((fBegin, outf2)) + flows.sort() + for fBegin, outf2 in flows: + outf.write(outf2.getvalue()) + + underflow = sumolib.miscutils.Statistics("underflow locations") + overflow = sumolib.miscutils.Statistics("overflow locations") + gehStats = sumolib.miscutils.Statistics("GEH") + numGehOK = 0.0 + hourFraction = (end - begin) / 3600.0 + totalCount = 0 for cd in countData: + localCount = cd.origCount - cd.count + totalCount += localCount if cd.count > 0: - unfilledLocations += 1 - missingCount += cd.count - - print("Wrote %s routes to meet total count %s at %s locations" % ( - len(usedRoutes), totalCount, len(countData))) + underflow.add(cd.count, cd.edgeTuple) + elif cd.count < 0: + overflow.add(cd.count, cd.edgeTuple) + origHourly = cd.origCount / hourFraction + localHourly = localCount / hourFraction + geh = sumolib.miscutils.geh(origHourly, localHourly) + if geh < options.gehOk: + numGehOK += 1 + gehStats.add(geh, "[%s] %s %s" % ( + ' '.join(cd.edgeTuple), int(origHourly), int(localHourly))) + + outputIntervalPrefix = "" if intervalPrefix == "" else "%s: " % int(begin) + gehOKNum = (100 * numGehOK / len(countData)) if countData else 100 + gehOK = "%.2f%%" % gehOKNum if countData else "-" + print("%sWrote %s routes (%s distinct) achieving total count %s at %s locations. GEH<%s for %s" % ( + outputIntervalPrefix, + len(usedRoutes), len(set(usedRoutes)), totalCount, len(countData), + options.gehOk, gehOK)) + + if options.verboseHistogram: + edgeCount = sumolib.miscutils.Statistics("route edge count", histogram=True) + detectorCount = sumolib.miscutils.Statistics("route detector count", histogram=True) + for i, r in enumerate(usedRoutes): + edgeCount.add(len(routes.unique[r]), i) + detectorCount.add(len(routeUsage[r]), i) + print("result %s" % edgeCount) + print("result %s" % detectorCount) + print(gehStats) + + if underflow.count() > 0: + print("Warning: %s (total %s)" % (underflow, sum(underflow.values))) + if overflow.count() > 0: + print("Warning: %s (total %s)" % (overflow, sum(overflow.values))) + + if mismatchf: + mismatchf.write(' \n' % (begin, end)) + for cd in countData: + if len(cd.edgeTuple) == 1: + mismatchf.write(' \n' % ( + cd.edgeTuple[0], cd.origCount, cd.count)) + elif len(cd.edgeTuple) == 2: + mismatchf.write(' \n' % ( + cd.edgeTuple[0], cd.edgeTuple[1], cd.origCount, cd.count)) + else: + print("Warning: output for edge relations with more than 2 edges not supported (%s)" % cd.edgeTuple, + file=sys.stderr) + mismatchf.write(' \n') - if unfilledLocations > 0: - print("Warning: Count deficit of %s for %s locations" % - (missingCount, unfilledLocations)) + return sum(underflow.values), sum(overflow.values), gehOKNum if __name__ == "__main__": diff -Nru sumo-1.5.0+dfsg1/tools/sumolib/miscutils.py sumo-1.6.0+dfsg1/tools/sumolib/miscutils.py --- sumo-1.5.0+dfsg1/tools/sumolib/miscutils.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/sumolib/miscutils.py 2020-04-27 21:47:56.000000000 +0000 @@ -280,7 +280,7 @@ def __init__(self, hsv, cycleLength=10.67): self.hsv = hsv - self.cycle = [random.randint(0, 255) for x in self.hsv] + self.cycle = [int(random.random() * 256) for x in self.hsv] self.cycleOffset = int(round(256 / cycleLength)) self.distinctIndex = 0 @@ -341,6 +341,22 @@ return math.sqrt((a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2) +def humanReadableTime(seconds): + result = "" + ds = 3600 * 24 + if seconds > ds: + result = "%s:" % int(seconds / ds) + seconds = seconds % ds + result += "%02i:" % int(seconds / 3600) + seconds = seconds % 3600 + result += "%02i:" % int(seconds / 60) + seconds = seconds % 60 + if seconds == int(seconds): + seconds = int(seconds) + result += "%02i" % seconds + return result + + def parseTime(t): try: return float(t) diff -Nru sumo-1.5.0+dfsg1/tools/sumolib/net/edge.py sumo-1.6.0+dfsg1/tools/sumolib/net/edge.py --- sumo-1.5.0+dfsg1/tools/sumolib/net/edge.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/sumolib/net/edge.py 2020-04-27 21:47:56.000000000 +0000 @@ -51,6 +51,7 @@ self._tls = None self._name = name self._params = {} + self._bidi = None def getName(self): return self._name @@ -236,6 +237,9 @@ def getToNode(self): return self._to + def getBidi(self): + return self._bidi + def is_fringe(self, connections=None): """true if this edge has no incoming or no outgoing connections (except turnarounds) If connections is given, only those connections are considered""" diff -Nru sumo-1.5.0+dfsg1/tools/sumolib/net/__init__.py sumo-1.6.0+dfsg1/tools/sumolib/net/__init__.py --- sumo-1.5.0+dfsg1/tools/sumolib/net/__init__.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/sumolib/net/__init__.py 2020-04-27 21:47:56.000000000 +0000 @@ -483,7 +483,7 @@ for p in l.getShape3D()] e.rebuildShape() - def getShortestPath(self, fromEdge, toEdge, maxCost=1e400, vClass=None): + def getShortestPath(self, fromEdge, toEdge, maxCost=1e400, vClass=None, reversalPenalty=0): """ Finds the shortest path from fromEdge to toEdge respecting vClass, using Dijkstra's algorithm. It returns a pair of a tuple of edges and the cost. If no path is found the first element is None. @@ -516,8 +516,11 @@ if cost > maxCost: return None, cost for e2, conn in e1.getAllowedOutgoing(vClass).items(): + # print(cost, e1.getID(), e2.getID(), e2 in seen) if e2 not in seen: newCost = cost + e2.getLength() + if e2 == e1.getBidi(): + newCost += reversalPenalty if self.hasInternal: minInternalCost = 1e400 for c in conn: @@ -554,6 +557,7 @@ if self._withPedestrianConnections and not self._withInternal: sys.stderr.write("Warning: Option withPedestrianConnections requires withInternal\n") self._withInternal = True + self._bidiEdgeIDs = {} def startElement(self, name, attrs): if name == 'location': @@ -586,6 +590,10 @@ self._currentEdge.setRawShape( convertShape(attrs.get('shape', ''))) + + bidi = attrs.get('bidi', '') + if bidi: + self._bidiEdgeIDs[edgeID] = bidi else: if function in ['crossing', 'walkingarea']: self._net._crossings_and_walkingAreas.add(attrs['id']) @@ -726,6 +734,9 @@ # tl-logic is deprecated!!! if self._withPhases and (name == 'tlLogic' or name == 'tl-logic'): self._currentProgram = None + if name == 'net': + for edgeID, bidiID in self._bidiEdgeIDs.items(): + self._net.getEdge(edgeID)._bidi = self._net.getEdge(bidiID) def endDocument(self): # set crossed edges of pedestrian crossings diff -Nru sumo-1.5.0+dfsg1/tools/sumolib/options.py sumo-1.6.0+dfsg1/tools/sumolib/options.py --- sumo-1.5.0+dfsg1/tools/sumolib/options.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/sumolib/options.py 2020-04-27 21:47:56.000000000 +0000 @@ -25,16 +25,18 @@ from xml.sax import parse, handler import argparse +_OPTIONS = [None] + def get_long_option_names(application): # @todo using option "--save-template stdout" and parsing xml would be prettier - output = subprocess.check_output([application, '--help']) + output = subprocess.check_output([application, '--help'], universal_newlines=True) reprog = re.compile(r'(--\S*)\s') result = [] for line in output.splitlines(): m = reprog.search(line) if m: - result.append(m.group(1).decode('utf-8')) + result.append(m.group(1)) return result @@ -59,6 +61,11 @@ return optionReader.opts +def getOptions(): + # return global option value (after parse_args was called) + return _OPTIONS[0] + + class ArgumentParser(argparse.ArgumentParser): """Drop-in replacement for argparse.ArgumentParser that adds support for sumo-style config files. @@ -109,6 +116,9 @@ args, argv = self.parse_known_args(args, namespace) if argv: self.error('unrecognized arguments: %s' % ' '.join(argv)) + if _OPTIONS[0] is None: + # only save the "outermost" option instance + _OPTIONS[0] = args return args def parse_known_args(self, args=None, namespace=None): @@ -131,14 +141,18 @@ for s in a.option_strings: if s.startswith("--"): act_map[s[2:]] = a.option_strings - for option in readOptions(args[idx]): - is_set = False - for s in act_map.get(option.name, []): - if s in args: - is_set = True - break - if not is_set: - config_args += ["--" + option.name, option.value] + for cfg_file in args[idx].split(","): + for option in readOptions(cfg_file): + is_set = False + for s in act_map.get(option.name, []): + if s in args: + is_set = True + break + if not is_set: + if option.value == "True": + config_args += ["--" + option.name, option.value] + elif option.value != "False": + config_args += ["--" + option.name, option.value] namespace, unknown_args = argparse.ArgumentParser.parse_known_args( self, args=args+config_args, namespace=namespace) self.write_config_file(namespace) diff -Nru sumo-1.5.0+dfsg1/tools/sumolib/xml.py sumo-1.6.0+dfsg1/tools/sumolib/xml.py --- sumo-1.5.0+dfsg1/tools/sumolib/xml.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/sumolib/xml.py 2020-04-27 21:47:56.000000000 +0000 @@ -21,6 +21,8 @@ import os import sys import re +import gzip +import io import datetime try: import xml.etree.cElementTree as ET @@ -248,7 +250,7 @@ if isinstance(element_names, str): element_names = [element_names] elementTypes = {} - for _, parsenode in ET.iterparse(xmlfile): + for _, parsenode in ET.iterparse(_open(xmlfile, None)): if parsenode.tag in element_names: yield _get_compound_object(parsenode, elementTypes, parsenode.tag, element_attrs, @@ -322,7 +324,15 @@ return Record, reprog -def parse_fast(xmlfile, element_name, attrnames, warn=False, optional=False): +def _open(xmlfile, encoding="utf8"): + if isinstance(xmlfile, str): + if xmlfile.endswith(".gz"): + return gzip.open(xmlfile, "rt") + return open(xmlfile) if encoding is None else io.open(xmlfile, encoding=encoding) + return xmlfile + + +def parse_fast(xmlfile, element_name, attrnames, warn=False, optional=False, encoding="utf8"): """ Parses the given attrnames from all elements with element_name @Note: The element must be on its own line and the attributes must appear in @@ -330,7 +340,7 @@ @Example: parse_fast('plain.edg.xml', 'edge', ['id', 'speed']) """ Record, reprog = _createRecordAndPattern(element_name, attrnames, warn, optional) - for line in open(xmlfile): + for line in _open(xmlfile, encoding): m = reprog.search(line) if m: if optional: @@ -339,7 +349,8 @@ yield Record(*m.groups()) -def parse_fast_nested(xmlfile, element_name, attrnames, element_name2, attrnames2, warn=False, optional=False): +def parse_fast_nested(xmlfile, element_name, attrnames, element_name2, attrnames2, + warn=False, optional=False, encoding="utf8"): """ Parses the given attrnames from all elements with element_name And attrnames2 from element_name2 where element_name2 is a child element of element_name @@ -350,7 +361,7 @@ Record, reprog = _createRecordAndPattern(element_name, attrnames, warn, optional) Record2, reprog2 = _createRecordAndPattern(element_name2, attrnames2, warn, optional) record = None - for line in open(xmlfile): + for line in _open(xmlfile, encoding): m2 = reprog2.search(line) if m2: if optional: diff -Nru sumo-1.5.0+dfsg1/tools/tileGet.py sumo-1.6.0+dfsg1/tools/tileGet.py --- sumo-1.5.0+dfsg1/tools/tileGet.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/tileGet.py 2020-04-27 21:47:56.000000000 +0000 @@ -20,11 +20,14 @@ from __future__ import division import math import os + try: # python3 import urllib.request as urllib + from urllib.error import HTTPError as urlerror except ImportError: import urllib + from urllib2 import HTTPError as urlerror import optparse @@ -84,14 +87,21 @@ for y in range(sy, ey + 1): request = "%s/%s/%s/%s" % (url, zoom, y, x) # print(request) - urllib.urlretrieve(request, "%s%s_%s.jpeg" % (os.path.join(output_dir, prefix), x, y)) - lat, lon = fromTileToLatLon(x, y, zoom) - upperLeft = net.convertLonLat2XY(lon, lat) - lat, lon = fromTileToLatLon(x + 0.5, y + 0.5, zoom) - center = net.convertLonLat2XY(lon, lat) - print(' ' % - (prefix, x, y, center[0], center[1], - 2 * (center[0] - upperLeft[0]), 2 * (upperLeft[1] - center[1]), layer), file=decals) +# opener = urllib.build_opener() +# opener.addheaders = [('User-agent', 'Mozilla/5.0')] +# urllib.install_opener(opener) + try: + urllib.urlretrieve(request, "%s%s_%s.jpeg" % (os.path.join(output_dir, prefix), x, y)) + lat, lon = fromTileToLatLon(x, y, zoom) + upperLeft = net.convertLonLat2XY(lon, lat) + lat, lon = fromTileToLatLon(x + 0.5, y + 0.5, zoom) + center = net.convertLonLat2XY(lon, lat) + print(' ' % + (prefix, x, y, center[0], center[1], + 2 * (center[0] - upperLeft[0]), 2 * (upperLeft[1] - center[1]), layer), file=decals) + except urlerror as e: + print("Tile server returned HTTP response code: " + str(e.code)) + raise ValueError optParser = optparse.OptionParser() @@ -166,11 +176,15 @@ request = ("%s?%s¢er=%.6f,%.6f&zoom=%s&%s&key=%s" % (options.url, size, c[0], c[1], z, maptype, options.key)) # print(request) - urllib.urlretrieve(request, "%s%s.png" % (prefix, i)) - print(' ' % - (options.prefix, i, bbox[0][0] + (i + 0.5) * offset, (bbox[0][1] + bbox[1][1]) / 2, - offset, bbox[1][1] - bbox[0][1], options.layer), file=decals) - b = e + try: + urllib.urlretrieve(request, "%s%s.png" % (prefix, i)) + print(' ' % + (options.prefix, i, bbox[0][0] + (i + 0.5) * offset, (bbox[0][1] + bbox[1][1]) / 2, + offset, bbox[1][1] - bbox[0][1], options.layer), file=decals) + b = e + except urlerror as e: + print("Tile server returned HTTP response code: " + str(e.code)) + raise ValueError print("", file=decals) diff -Nru sumo-1.5.0+dfsg1/tools/tls/tls_csvSignalGroups.py sumo-1.6.0+dfsg1/tools/tls/tls_csvSignalGroups.py --- sumo-1.5.0+dfsg1/tools/tls/tls_csvSignalGroups.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/tls/tls_csvSignalGroups.py 2020-04-27 21:47:56.000000000 +0000 @@ -72,6 +72,18 @@ import sumolib.net # noqa +def getEdgeID(laneOrEdgeID): + sep = laneOrEdgeID.rfind('_') + if sep > 0 and laneOrEdgeID[sep + 1:].isdigit(): + return laneOrEdgeID[:sep] + else: + return laneOrEdgeID + + +def isLaneID(laneOrEdgeID): + return laneOrEdgeID != getEdgeID(laneOrEdgeID) + + class TlLogic(sumolib.net.TLSProgram): def __init__(self, id, programID, cycleTime, offset=0, parameters={}, net=None, debug=False): @@ -134,14 +146,12 @@ for fromLink, toLink in sgToLinks[sgID]: # check link validity (lane exists?) for connIn, connOut, tlIndex in connections: - fromLaneSep = fromLink.find('_') - if fromLaneSep > 0 and fromLink[fromLaneSep + 1:].isdigit(): + if isLaneID(fromLink): valid = fromLink == connIn.getID() else: valid = fromLink == connIn.getEdge().getID() if toLink != '' and valid: - toLaneSep = toLink.find('_') - if toLaneSep > 0 and toLink[toLaneSep + 1:].isdigit(): + if isLaneID(toLink): valid = toLink == connOut.getID() else: valid = toLink == connOut.getEdge().getID() @@ -391,7 +401,9 @@ # read SUMO network net = None if(len(options.net) > 0): - net = sumolib.net.readNet(options.net, withInternal=True) + net = sumolib.net.readNet(options.net, + withInternal=True, + withPedestrianConnections=True) if(len(options.make_input_dir) > 0): # check input template directory if(os.path.isdir(options.make_input_dir)): @@ -462,17 +474,21 @@ colIndices[line[colIndex].strip()] = colIndex secondFreeTime = "on2" in colIndices.keys() and "off2" in colIndices.keys() else: - sg = SignalGroup( - line[colIndices["id"]], - transTimeOn=int(line[colIndices["transOn"]]), - transTimeOff=int(line[colIndices["transOff"]]), - debug=options.debug) + sgID = line[colIndices["id"]] + sg = SignalGroup(sgID, + transTimeOn=int(line[colIndices["transOn"]]), + transTimeOff=int(line[colIndices["transOff"]]), + debug=options.debug) sg.addFreeTime(int(line[colIndices["on1"]]), int(line[colIndices["off1"]])) if(secondFreeTime): if(line[colIndices["on2"]] != "" and line[colIndices["off2"]] != ""): sg.addFreeTime(int(line[colIndices["on2"]]), int(line[colIndices["off2"]])) - signalGroups[sg._id] = sg - signalGroupOrder.append(sg._id) + signalGroups[sgID] = sg + signalGroupOrder.append(sgID) + sgFromLinkEdge = getEdgeID(sgToLinks[sgID][0][0]) + if net.getEdge(sgFromLinkEdge).getFunction() == "walkingarea": + sg._stop = 'r' + except Exception: print("In file %s, line %s" % (inputFileName, i + 1), file=sys.stderr) raise diff -Nru sumo-1.5.0+dfsg1/tools/traceExporter.py sumo-1.6.0+dfsg1/tools/traceExporter.py --- sumo-1.5.0+dfsg1/tools/traceExporter.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/traceExporter.py 2020-04-27 21:47:56.000000000 +0000 @@ -23,6 +23,7 @@ from __future__ import absolute_import import os import sys +import gzip import random import datetime sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'tools')) @@ -52,6 +53,8 @@ def _getOutputStream(name): if not name: return None + if name.endswith(".gz"): + return gzip.open(name, "wt") return open(name, "w") @@ -86,7 +89,7 @@ chosen = {} for q in fcdstream: pt = lt - lt = float(q.time) + lt = sumolib.miscutils.parseTime(q.time) if options.begin and options.begin > lt: continue # do not export steps before a set begin if options.end and options.end <= lt: diff -Nru sumo-1.5.0+dfsg1/tools/traci/_calibrator.py sumo-1.6.0+dfsg1/tools/traci/_calibrator.py --- sumo-1.5.0+dfsg1/tools/traci/_calibrator.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/traci/_calibrator.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,144 @@ +# -*- coding: utf-8 -*- +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2008-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 _calibrator.py +# @author Jakob Erdmann +# @date 2020-03-16 + +from __future__ import absolute_import +import struct +from . import constants as tc +from .domain import Domain +from .storage import Storage + +_RETURN_VALUE_FUNC = { + tc.VAR_ROAD_ID: Storage.readString, + tc.VAR_LANE_ID: Storage.readString, + tc.VAR_VEHSPERHOUR: Storage.readDouble, + tc.VAR_SPEED: Storage.readDouble, + tc.VAR_TYPE: Storage.readString, + tc.VAR_BEGIN: Storage.readDouble, + tc.VAR_END: Storage.readDouble, + tc.VAR_ROUTE_ID: Storage.readString, + tc.VAR_ROUTE_PROBE: Storage.readString, + tc.VAR_VTYPES: Storage.readStringList, + tc.VAR_PASSED: Storage.readInt, + tc.VAR_INSERTED: Storage.readInt, + tc.VAR_REMOVED: Storage.readInt, +} + + +class CalibratorDomain(Domain): + + def __init__(self): + Domain.__init__(self, "calibrator", tc.CMD_GET_CALIBRATOR_VARIABLE, tc.CMD_SET_CALIBRATOR_VARIABLE, + tc.CMD_SUBSCRIBE_CALIBRATOR_VARIABLE, tc.RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE, + tc.CMD_SUBSCRIBE_CALIBRATOR_CONTEXT, tc.RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT, + _RETURN_VALUE_FUNC) + + def getEdgeID(self, calibratorID): + """getEdgeID(string) -> string + Returns the edge of this calibrator + """ + return self._getUniversal(tc.VAR_ROAD_ID, calibratorID) + + def getLaneID(self, calibratorID): + """getLaneID(string) -> string + Returns the lane of this calibrator (if it applies to a single lane) + """ + return self._getUniversal(tc.VAR_LANE_ID, calibratorID) + + def getVehsPerHour(self, calibratorID): + """getVehsPerHour(string) -> double + Returns the number of vehicles per hour in the current calibration interval + """ + return self._getUniversal(tc.VAR_VEHSPERHOUR, calibratorID) + + def getSpeed(self, calibratorID): + """getSpeed(string) -> double + Returns the target speed of the current calibration interval + """ + return self._getUniversal(tc.VAR_SPEED, calibratorID) + + def getTypeID(self, calibratorID): + """getTypeID(string) -> string + Returns the type id for the current calibration interval + """ + return self._getUniversal(tc.VAR_TYPE, calibratorID) + + def getBegin(self, calibratorID): + """getBegin(string) -> double + Returns the begin time of the current calibration interval + """ + return self._getUniversal(tc.VAR_BEGIN, calibratorID) + + def getEnd(self, calibratorID): + """getEnd(string) -> double + Returns the end time of the current calibration interval + """ + return self._getUniversal(tc.VAR_END, calibratorID) + + def getRouteID(self, calibratorID): + """getRouteID(string) -> string + Returns the route id for the current calibration interval + """ + return self._getUniversal(tc.VAR_ROUTE_ID, calibratorID) + + def getRouteProbeID(self, calibratorID): + """getRouteProbeID(string) -> string + Returns the routeProbe id for this calibrator + """ + return self._getUniversal(tc.VAR_ROUTE_PROBE, calibratorID) + + def getVTypes(self, calibratorID): + """getVTypes(string) -> list(string) + + Returns a list of all types to which the calibrator applies (in a type filter is active) + """ + return self._getUniversal(tc.VAR_VTYPES, calibratorID) + + def getPassed(self, calibratorID): + """getPassed(string) -> double + Returns the number of passed vehicles in the current calibration interval + """ + return self._getUniversal(tc.VAR_PASSED, calibratorID) + + def getInserted(self, calibratorID): + """getInserted(string) -> double + Returns the number of inserted vehicles in the current calibration interval + """ + return self._getUniversal(tc.VAR_INSERTED, calibratorID) + + def getRemoved(self, calibratorID): + """getRemoved(string) -> double + Returns the number of removed vehicles in the current calibration interval + """ + return self._getUniversal(tc.VAR_REMOVED, calibratorID) + + def setFlow(self, calibratorID, begin, end, vehsPerHour, speed, typeID, + routeID, departLane="first", departSpeed="max"): + """setFlow(string, double, double, double, double, string, string, string, string) -> None + Update or add a calibrator interval + """ + messageString = struct.pack("!Bi", tc.TYPE_COMPOUND, 8) + messageString += struct.pack("!Bd", tc.TYPE_DOUBLE, begin) + messageString += struct.pack("!Bd", tc.TYPE_DOUBLE, end) + messageString += struct.pack("!Bd", tc.TYPE_DOUBLE, vehsPerHour) + messageString += struct.pack("!Bd", tc.TYPE_DOUBLE, speed) + for val in (typeID, routeID, departLane, departSpeed): + val = str(val) + messageString += struct.pack("!Bi", tc.TYPE_STRING, len(val)) + val.encode("latin1") + self._connection._beginMessage( + tc.CMD_SET_CALIBRATOR_VARIABLE, tc.CMD_SET_FLOW, calibratorID, len(messageString)) + self._connection._string += messageString + self._connection._sendExact() diff -Nru sumo-1.5.0+dfsg1/tools/traci/constants.py sumo-1.6.0+dfsg1/tools/traci/constants.py --- sumo-1.5.0+dfsg1/tools/traci/constants.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/traci/constants.py 2020-04-27 21:47:56.000000000 +0000 @@ -12,7 +12,7 @@ # @file constants.py # @author generated by "rebuildConstants.py" -# @date 2020-02-10 21:09:49.586563 +# @date 2020-03-20 13:39:41.950410 """ This script contains TraCI constant definitions from /src/libsumo/TraCIConstants.h. @@ -78,6 +78,8 @@ CMD_GET_INDUCTIONLOOP_VARIABLE = 0xa0 # response: get induction loop (e1) variable RESPONSE_GET_INDUCTIONLOOP_VARIABLE = 0xb0 +# command: set induction loop (e1) variable, not used yet +# TRACI_CONST int CMD_GET_INDUCTIONLOOP_VARIABLE = 0xc0; # command: subscribe induction loop (e1) variable CMD_SUBSCRIBE_INDUCTIONLOOP_VARIABLE = 0xd0 # response: subscribe induction loop (e1) variable @@ -91,6 +93,8 @@ CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xa1 # response: get multi-entry/multi-exit detector (e3) variable RESPONSE_GET_MULTIENTRYEXIT_VARIABLE = 0xb1 +# command: set multi-entry/multi-exit detector (e3) variable, not used yet +# TRACI_CONST int CMD_GET_MULTIENTRYEXIT_VARIABLE = 0xc1; # command: subscribe multi-entry/multi-exit detector (e3) variable CMD_SUBSCRIBE_MULTIENTRYEXIT_VARIABLE = 0xd1 # response: subscribe multi-entry/multi-exit detector (e3) variable @@ -261,17 +265,19 @@ # response: subscribe GUI variable RESPONSE_SUBSCRIBE_GUI_VARIABLE = 0xec -# command: subscribe areal detector (e2) context +# command: subscribe lane area detector (e2) context CMD_SUBSCRIBE_LANEAREA_CONTEXT = 0x8d -# response: subscribe areal detector (e2) context +# response: subscribe lane area detector (e2) context RESPONSE_SUBSCRIBE_LANEAREA_CONTEXT = 0x9d -# command: get areal detector (e2) variable +# command: get lane area detector (e2) variable CMD_GET_LANEAREA_VARIABLE = 0xad -# response: get areal detector (e2) variable +# response: get lane area detector (e2) variable RESPONSE_GET_LANEAREA_VARIABLE = 0xbd -# command: subscribe areal detector (e2) variable +# command: set lane area detector (e2) variable, not used yet +# TRACI_CONST int CMD_GET_LANEAREA_VARIABLE = 0xcd; +# command: subscribe lane area detector (e2) variable CMD_SUBSCRIBE_LANEAREA_VARIABLE = 0xdd -# response: subscribe areal detector (e2) variable +# response: subscribe lane area detector (e2) variable RESPONSE_SUBSCRIBE_LANEAREA_VARIABLE = 0xed # command: subscribe person context @@ -289,6 +295,141 @@ # response: subscribe person variable RESPONSE_SUBSCRIBE_PERSON_VARIABLE = 0xee +# command: subscribe busstop context +CMD_SUBSCRIBE_BUSSTOP_CONTEXT = 0x8f +# response: subscribe busstop context +RESPONSE_SUBSCRIBE_BUSSTOP_CONTEXT = 0x9f +# command: get busstop variable +CMD_GET_BUSSTOP_VARIABLE = 0xaf +# response: get busstop variable +RESPONSE_GET_BUSSTOP_VARIABLE = 0xbf +# command: set busstop variable, not used yet +CMD_SET_BUSSTOP_VARIABLE = 0xcf +# command: subscribe busstop variable +CMD_SUBSCRIBE_BUSSTOP_VARIABLE = 0xdf +# response: subscribe busstop variable +RESPONSE_SUBSCRIBE_BUSSTOP_VARIABLE = 0xef + +# command: subscribe parkingarea context +CMD_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x04 +# response: subscribe parkingarea context +RESPONSE_SUBSCRIBE_PARKINGAREA_CONTEXT = 0x14 +# command: get parkingarea variable +CMD_GET_PARKINGAREA_VARIABLE = 0x24 +# response: get parkingarea variable +RESPONSE_GET_PARKINGAREA_VARIABLE = 0x34 +# command: set parkingarea variable +CMD_SET_PARKINGAREA_VARIABLE = 0x44 +# command: subscribe parkingarea variable +CMD_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x54 +# response: subscribe parkingarea variable +RESPONSE_SUBSCRIBE_PARKINGAREA_VARIABLE = 0x64 + +# command: subscribe chargingstation context +CMD_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x05 +# response: subscribe chargingstation context +RESPONSE_SUBSCRIBE_CHARGINGSTATION_CONTEXT = 0x15 +# command: get chargingstation variable +CMD_GET_CHARGINGSTATION_VARIABLE = 0x25 +# response: get chargingstation variable +RESPONSE_GET_CHARGINGSTATION_VARIABLE = 0x35 +# command: set chargingstation variable +CMD_SET_CHARGINGSTATION_VARIABLE = 0x45 +# command: subscribe chargingstation variable +CMD_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x55 +# response: subscribe chargingstation variable +RESPONSE_SUBSCRIBE_CHARGINGSTATION_VARIABLE = 0x65 + +# command: subscribe routeprobe context +CMD_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x06 +# response: subscribe routeprobe context +RESPONSE_SUBSCRIBE_ROUTEPROBE_CONTEXT = 0x16 +# command: get routeprobe variable +CMD_GET_ROUTEPROBE_VARIABLE = 0x26 +# response: get routeprobe variable +RESPONSE_GET_ROUTEPROBE_VARIABLE = 0x36 +# command: set routeprobe variable +CMD_SET_ROUTEPROBE_VARIABLE = 0x46 +# command: subscribe routeprobe variable +CMD_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x56 +# response: subscribe routeprobe variable +RESPONSE_SUBSCRIBE_ROUTEPROBE_VARIABLE = 0x66 + +# command: subscribe calibrator context +CMD_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x07 +# response: subscribe calibrator context +RESPONSE_SUBSCRIBE_CALIBRATOR_CONTEXT = 0x17 +# command: get calibrator variable +CMD_GET_CALIBRATOR_VARIABLE = 0x27 +# response: get calibrator variable +RESPONSE_GET_CALIBRATOR_VARIABLE = 0x37 +# command: set calibrator variable +CMD_SET_CALIBRATOR_VARIABLE = 0x47 +# command: subscribe calibrator variable +CMD_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x57 +# response: subscribe calibrator variable +RESPONSE_SUBSCRIBE_CALIBRATOR_VARIABLE = 0x67 + +# command: subscribe rerouter context +CMD_SUBSCRIBE_REROUTER_CONTEXT = 0x08 +# response: subscribe rerouter context +RESPONSE_SUBSCRIBE_REROUTER_CONTEXT = 0x18 +# command: get rerouter variable +CMD_GET_REROUTER_VARIABLE = 0x28 +# response: get rerouter variable +RESPONSE_GET_REROUTER_VARIABLE = 0x38 +# command: set rerouter variable +CMD_SET_REROUTER_VARIABLE = 0x48 +# command: subscribe rerouter variable +CMD_SUBSCRIBE_REROUTER_VARIABLE = 0x58 +# response: subscribe rerouter variable +RESPONSE_SUBSCRIBE_REROUTER_VARIABLE = 0x68 + +# command: subscribe variablespeedsign context +CMD_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x09 +# response: subscribe variablespeedsign context +RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_CONTEXT = 0x19 +# command: get variablespeedsign variable +CMD_GET_VARIABLESPEEDSIGN_VARIABLE = 0x29 +# response: get variablespeedsign variable +RESPONSE_GET_VARIABLESPEEDSIGN_VARIABLE = 0x39 +# command: set variablespeedsign variable +CMD_SET_VARIABLESPEEDSIGN_VARIABLE = 0x49 +# command: subscribe variablespeedsign variable +CMD_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x59 +# response: subscribe variablespeedsign variable +RESPONSE_SUBSCRIBE_VARIABLESPEEDSIGN_VARIABLE = 0x69 + +# command: subscribe meandata context +CMD_SUBSCRIBE_MEANDATA_CONTEXT = 0x0a +# response: subscribe meandata context +RESPONSE_SUBSCRIBE_MEANDATA_CONTEXT = 0x1a +# command: get meandata variable +CMD_GET_MEANDATA_VARIABLE = 0x2a +# response: get meandata variable +RESPONSE_GET_MEANDATA_VARIABLE = 0x3a +# command: set meandata variable, not used yet +# TRACI_CONST int CMD_SET_MEANDATA_VARIABLE = 0x4a; +# command: subscribe meandata variable +CMD_SUBSCRIBE_MEANDATA_VARIABLE = 0x5a +# response: subscribe meandata variable +RESPONSE_SUBSCRIBE_MEANDATA_VARIABLE = 0x6a + +# command: subscribe overheadwire context +CMD_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x0b +# response: subscribe overheadwire context +RESPONSE_SUBSCRIBE_OVERHEADWIRE_CONTEXT = 0x1b +# command: get overheadwire variable +CMD_GET_OVERHEADWIRE_VARIABLE = 0x2b +# response: get overheadwire variable +RESPONSE_GET_OVERHEADWIRE_VARIABLE = 0x3b +# command: set overheadwire variable +CMD_SET_OVERHEADWIRE_VARIABLE = 0x4b +# command: subscribe overheadwire variable +CMD_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x5b +# response: subscribe overheadwire variable +RESPONSE_SUBSCRIBE_OVERHEADWIRE_VARIABLE = 0x6b + # **************************************** # POSITION REPRESENTATIONS @@ -535,6 +676,45 @@ # full name (get: edges, simulation, trafficlight) VAR_NAME = 0x1b +# carFollowModel function followSpeed (get: vehicle) +VAR_FOLLOW_SPEED = 0x1c + +# carFollowModel function stopSpeed (get: vehicle) +VAR_STOP_SPEED = 0x1d + +# carFollowModel function getSecureGap (get: vehicle) +VAR_SECURE_GAP = 0x1e + +# estimated delay for next stop +VAR_STOP_DELAY = 0x1f + +# begin time(get: calibrator) +VAR_BEGIN = 0x1c + +# end time(get: calibrator) +VAR_END = 0x1d + +# vtype list (get: calibrator) +VAR_VTYPES = 0x1e + +# vehicles per hour (get: calibrator) +VAR_VEHSPERHOUR = 0x13 + +# passed vehicle count (get: calibrator) +VAR_PASSED = 0x14 + +# inserted vehicle count (get: calibrator) +VAR_INSERTED = 0x15 + +# removed vehicle count (get: calibrator) +VAR_REMOVED = 0x16 + +# routeProbe id (get: calibrator) +VAR_ROUTE_PROBE = 0x17 + +# routeProbe id (get: calibrator) +CMD_SET_FLOW = 0x18 + # traffic light states, encoded as rRgGyYoO tuple (get: traffic lights) TL_RED_YELLOW_GREEN_STATE = 0x20 @@ -604,7 +784,7 @@ # maximum allowed/possible speed (get: vehicle types, lanes, set: edges, lanes) VAR_MAXSPEED = 0x41 -# position (2D) (get: vehicle, poi, inductionloop, areadetector; set: poi) +# position (2D) (get: vehicle, poi, inductionloop, lane area detector; set: poi) VAR_POSITION = 0x42 # position (3D) (get: vehicle, poi, set: poi) @@ -613,7 +793,7 @@ # angle (get: vehicle, poi; set: poi) VAR_ANGLE = 0x43 -# angle (get: vehicle types, lanes, arealdetector, set: lanes) +# angle (get: vehicle types, lanes, lane area detector, set: lanes) VAR_LENGTH = 0x44 # color (get: vehicles, vehicle types, polygons, pois) @@ -664,7 +844,7 @@ # road id (get: vehicles) VAR_ROAD_ID = 0x50 -# lane id (get: vehicles, inductionloop, arealdetector) +# lane id (get: vehicles, inductionloop, lane area detector) VAR_LANE_ID = 0x51 # lane index (get: vehicle, edge) diff -Nru sumo-1.5.0+dfsg1/tools/traci/main.py sumo-1.6.0+dfsg1/tools/traci/main.py --- sumo-1.5.0+dfsg1/tools/traci/main.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/traci/main.py 2020-04-27 21:47:56.000000000 +0000 @@ -45,6 +45,7 @@ from . import _inductionloop, _lanearea, _multientryexit, _trafficlight # noqa from . import _lane, _person, _route, _vehicle, _vehicletype # noqa from . import _edge, _gui, _junction, _poi, _polygon, _simulation # noqa +from . import _calibrator # noqa inductionloop = _inductionloop.InductionLoopDomain() lanearea = _lanearea.LaneAreaDomain() @@ -61,6 +62,7 @@ poi = _poi.PoiDomain() polygon = _polygon.PolygonDomain() simulation = _simulation.SimulationDomain() +calibrator = _calibrator.CalibratorDomain() _connections = {} # cannot use immutable type as global variable diff -Nru sumo-1.5.0+dfsg1/tools/traci/_vehicle.py sumo-1.6.0+dfsg1/tools/traci/_vehicle.py --- sumo-1.5.0+dfsg1/tools/traci/_vehicle.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/traci/_vehicle.py 2020-04-27 21:47:56.000000000 +0000 @@ -171,6 +171,7 @@ tc.DISTANCE_REQUEST: Storage.readDouble, tc.VAR_ROUTING_MODE: Storage.readInt, tc.VAR_STOPSTATE: Storage.readInt, + tc.VAR_STOP_DELAY: Storage.readDouble, tc.VAR_DISTANCE: Storage.readDouble} @@ -660,8 +661,9 @@ Return the leading vehicle id together with the distance. The distance is measured from the front + minGap to the back of the leader, so it does not include the minGap of the vehicle. - The dist parameter defines the maximum lookahead, 0 calculates a lookahead from the brake gap. - Note that the returned leader may be farther away than the given dist. + 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. """ self._connection._beginMessage( tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_LEADER, vehID, 1 + 8) @@ -729,6 +731,70 @@ self._connection._string += struct.pack("!BB", tc.TYPE_UBYTE, mode) return _readNeighbors(self._connection._checkResult(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_NEIGHBORS, vehID)) + def getFollowSpeed(self, vehID, speed, gap, leaderSpeed, leaderMaxDecel, leaderID=""): + """getFollowSpeed(string, double, double, double, double, string) -> double + Return the follow speed computed by the carFollowModel of vehID + """ + self._connection._beginMessage(tc.CMD_GET_VEHICLE_VARIABLE, + tc.VAR_FOLLOW_SPEED, vehID, + 1 + 4 + + 1 + 8 + + 1 + 8 + + 1 + 8 + + 1 + 8 + + 1 + 4 + + len(leaderID)) + self._connection._string += struct.pack( + "!BiBdBdBdBd", tc.TYPE_COMPOUND, 5, + tc.TYPE_DOUBLE, speed, + tc.TYPE_DOUBLE, gap, + tc.TYPE_DOUBLE, leaderSpeed, + tc.TYPE_DOUBLE, leaderMaxDecel) + self._connection._packString(leaderID) + return self._connection._checkResult(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_FOLLOW_SPEED, vehID).readDouble() + + def getSecureGap(self, vehID, speed, leaderSpeed, leaderMaxDecel, leaderID=""): + """getSecureGap(string, double, double, double, string) -> double + Return the secure gap computed by the carFollowModel of vehID + """ + self._connection._beginMessage(tc.CMD_GET_VEHICLE_VARIABLE, + tc.VAR_SECURE_GAP, vehID, + 1 + 4 + + 1 + 8 + + 1 + 8 + + 1 + 8 + + 1 + 4 + + len(leaderID)) + self._connection._string += struct.pack( + "!BiBdBdBd", tc.TYPE_COMPOUND, 4, + tc.TYPE_DOUBLE, speed, + tc.TYPE_DOUBLE, leaderSpeed, + tc.TYPE_DOUBLE, leaderMaxDecel) + self._connection._packString(leaderID) + return self._connection._checkResult(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_SECURE_GAP, vehID).readDouble() + + def getStopSpeed(self, vehID, speed, gap): + """getStopSpeed(string, double, double) -> double + Return the speed for stopping at gap computed by the carFollowModel of vehID + """ + self._connection._beginMessage(tc.CMD_GET_VEHICLE_VARIABLE, + tc.VAR_STOP_SPEED, vehID, + 1 + 4 + + 1 + 8 + + 1 + 8) + self._connection._string += struct.pack( + "!BiBdBd", tc.TYPE_COMPOUND, 2, + tc.TYPE_DOUBLE, speed, + tc.TYPE_DOUBLE, gap) + return self._connection._checkResult(tc.CMD_GET_VEHICLE_VARIABLE, tc.VAR_STOP_SPEED, vehID).readDouble() + + def getStopDelay(self, vehID): + """getStopDelay(string) -> double + Returns the expected delay at the next stop (if that stop defines the + until-attribute) in seconds. Returns -1 if the next stop is not applicable + """ + return self._getUniversal(tc.VAR_STOP_DELAY, vehID) + def getNextTLS(self, vehID): """getNextTLS(string) -> diff -Nru sumo-1.5.0+dfsg1/tools/turn-defs/turnCount2EdgeCount.py sumo-1.6.0+dfsg1/tools/turn-defs/turnCount2EdgeCount.py --- sumo-1.5.0+dfsg1/tools/turn-defs/turnCount2EdgeCount.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/turn-defs/turnCount2EdgeCount.py 2020-04-27 21:47:56.000000000 +0000 @@ -24,6 +24,7 @@ import os import sys from argparse import ArgumentParser +from collections import defaultdict if 'SUMO_HOME' in os.environ: sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) @@ -38,7 +39,7 @@ help="Output edgeData file") parser.add_argument("--edgedata-attribute", dest="edgeDataAttr", default="entered", help="Write edgeData counts with the given attribute") - parser.add_argument("--turn-attribute", dest="turnAttr", default="probability", + parser.add_argument("--turn-attribute", dest="turnAttr", default="count", help="Read turning counts from the given attribute") options = parser.parse_args(args=args) @@ -48,16 +49,25 @@ return options +def parseEdgeCounts(turnfile, attr): + for interval in sumolib.xml.parse(turnfile, 'interval'): + counts = defaultdict(lambda: 0) + for edgeRel in interval.edgeRelation: + count = float(getattr(edgeRel, attr)) + if count == int(count): + count = int(count) + counts[edgeRel.attr_from] += count + yield interval.id, interval.begin, interval.end, counts + + def main(options): with open(options.out, 'w') as outf: sumolib.writeXMLHeader(outf, "$Id$", "meandata") # noqa - for interval in sumolib.xml.parse(options.turnFile, 'interval'): - outf.write(' \n' % ( - interval.begin, interval.end)) - for fromEdge in interval.fromEdge: - count = int(sum([float(getattr(toEdge, options.turnAttr)) for toEdge in fromEdge.toEdge])) - outf.write(' \n' % ( - fromEdge.id, options.edgeDataAttr, count)) + for interval_id, interval_begin, interval_end, counts in parseEdgeCounts(options.turnFile, options.turnAttr): + outf.write(' \n' % ( + interval_id, interval_begin, interval_end)) + for edge in sorted(counts.keys()): + outf.write(' ' * 8 + '\n' % (edge, options.edgeDataAttr, counts[edge])) outf.write(' \n') outf.write('\n') diff -Nru sumo-1.5.0+dfsg1/tools/turn-defs/turndefinitions.py sumo-1.6.0+dfsg1/tools/turn-defs/turndefinitions.py --- sumo-1.5.0+dfsg1/tools/turn-defs/turndefinitions.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/turn-defs/turndefinitions.py 2020-04-27 21:47:56.000000000 +0000 @@ -142,17 +142,14 @@ for source in turn_definitions.get_sources(): LOGGER.debug("Converting turn definition with source %s" % (source)) - from_edge_element = interval_element.addChild("fromEdge", {"id": source}) - for destination in turn_definitions.get_destinations(source): + edgeRelation = interval_element.addChild("edgeRelation", {"from": source}) probability = turn_definitions.get_turning_probability(source, destination) LOGGER.debug("Converting turn definition destination %s " "with probability %f" % (destination, probability)) - - to_edge_element = from_edge_element.addChild("toEdge") - to_edge_element.setAttribute("id", destination) - to_edge_element.setAttribute("probability", "%.10g" % probability) + edgeRelation.setAttribute("to", destination) + edgeRelation.setAttribute("probability", "%.10g" % probability) return turn_definitions_xml.toXML() diff -Nru sumo-1.5.0+dfsg1/tools/turn-defs/turnFile2EdgeRelations.py sumo-1.6.0+dfsg1/tools/turn-defs/turnFile2EdgeRelations.py --- sumo-1.5.0+dfsg1/tools/turn-defs/turnFile2EdgeRelations.py 1970-01-01 00:00:00.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/turn-defs/turnFile2EdgeRelations.py 2020-04-27 21:47:56.000000000 +0000 @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo +# Copyright (C) 2012-2020 German Aerospace Center (DLR) and others. +# This program and the accompanying materials are 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 turnFile2EdgeRelations.py +# @author Jakob Erdmann +# @date 2020-02-09 + +""" +Converts turn-count data into edgeData +""" +from __future__ import absolute_import +from __future__ import print_function + +import os +import sys +from argparse import ArgumentParser + +if 'SUMO_HOME' in os.environ: + sys.path.append(os.path.join(os.environ['SUMO_HOME'], 'tools')) +import sumolib # noqa + + +def get_options(args=None): + parser = ArgumentParser(description="Sample routes to match counts") + parser.add_argument("-t", "--turn-file", dest="turnFile", + help="Input turn-count file") + parser.add_argument("-o", "--output-file", dest="out", + help="Output edgeRelations file") + parser.add_argument("--turn-attribute", dest="turnAttr", default="probability", + help="Write turning 'probability' to the given attribute") + + options = parser.parse_args(args=args) + if options.turnFile is None or options.out is None: + parser.print_help() + sys.exit() + return options + + +def main(options): + with open(options.out, 'w') as outf: + sumolib.writeXMLHeader(outf, "$Id$", "edgeRelations", "edgerelations_file.xsd") # noqa + for interval in sumolib.xml.parse(options.turnFile, 'interval'): + outf.write(' \n' % ( + interval.begin, interval.end)) + for fromEdge in interval.fromEdge: + for toEdge in fromEdge.toEdge: + outf.write(' ' * 8 + '\n' % ( + fromEdge.id, toEdge.id, options.turnAttr, toEdge.probability)) + outf.write(' \n') + outf.write('\n') + + +if __name__ == "__main__": + main(get_options()) diff -Nru sumo-1.5.0+dfsg1/tools/webWizard/index.html sumo-1.6.0+dfsg1/tools/webWizard/index.html --- sumo-1.5.0+dfsg1/tools/webWizard/index.html 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/webWizard/index.html 2020-04-27 21:47:56.000000000 +0000 @@ -56,6 +56,7 @@ + diff -Nru sumo-1.5.0+dfsg1/tools/webWizard/script.js sumo-1.6.0+dfsg1/tools/webWizard/script.js --- sumo-1.5.0+dfsg1/tools/webWizard/script.js 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/webWizard/script.js 2020-04-27 21:47:56.000000000 +0000 @@ -432,6 +432,7 @@ publicTransport: elem("#publicTransport").checked, leftHand: elem("#leftHand").checked, decal: elem("#decal").checked, + carOnlyNetwork: elem("#carOnlyNetwork").checked, vehicles: {} }; diff -Nru sumo-1.5.0+dfsg1/tools/xml/xml2csv.py sumo-1.6.0+dfsg1/tools/xml/xml2csv.py --- sumo-1.5.0+dfsg1/tools/xml/xml2csv.py 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/tools/xml/xml2csv.py 2020-04-27 21:47:56.000000000 +0000 @@ -24,6 +24,7 @@ import os import sys import socket +import gzip import io import collections from optparse import OptionParser @@ -140,18 +141,17 @@ self.outfiles = {} self.rootDepth = 1 if options.split else 0 for root in sorted(attrFinder.depthTags): - if len(attrFinder.depthTags) == 1: - if not options.output: + if not options.output: + if isinstance(options.source, str): options.output = os.path.splitext(options.source)[0] + else: + options.output = options.source.name + if len(attrFinder.depthTags) == 1: if not options.output.isdigit() and not options.output.endswith(".csv"): options.output += ".csv" self.outfiles[root] = getOutStream(options.output) else: - if options.output: - outfilename = options.output + "%s.csv" % root - else: - outfilename = os.path.splitext( - options.source)[0] + "%s.csv" % root + outfilename = options.output + "%s.csv" % root self.outfiles[root] = getOutStream(outfilename) self.outfiles[root].write( options.separator.join(map(self.quote, attrFinder.attrs[root])) + u"\n") @@ -206,13 +206,15 @@ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("localhost", port)) s.listen(1) - conn, addr = s.accept() + conn, _ = s.accept() return conn.makefile(mode) def getOutStream(output): if output.isdigit(): return getSocketStream(int(output), 'wb') + if output.endswith(".gz"): + return gzip.open(output, 'wb', encoding="utf8") return io.open(output, 'w', encoding="utf8") @@ -241,6 +243,8 @@ print("a schema is mandatory for stream parsing", file=sys.stderr) sys.exit() options.source = getSocketStream(int(args[0])) + elif args[0].endswith(".gz"): + options.source = gzip.open(args[0]) else: options.source = args[0] if options.output and options.output.isdigit() and options.split: @@ -261,6 +265,9 @@ tree = lxml.etree.parse(options.source, parser) lxml.sax.saxify(tree, handler) else: + if not options.xsd and hasattr(options.source, "name") and options.source.name.endswith(".gz"): + # we need to reopen the file because the AttrFinder already read and closed it + options.source = gzip.open(options.source.name) xml.sax.parse(options.source, handler) diff -Nru sumo-1.5.0+dfsg1/unittest/src/microsim/MSCFModel_IDMTest.cpp sumo-1.6.0+dfsg1/unittest/src/microsim/MSCFModel_IDMTest.cpp --- sumo-1.5.0+dfsg1/unittest/src/microsim/MSCFModel_IDMTest.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/unittest/src/microsim/MSCFModel_IDMTest.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -72,7 +72,7 @@ typeDefs.cfModel = SUMO_TAG_CF_IDM; //typeDefs.cfParameter[SUMO_ATTR_CF_IDM_STEPPING] = "1"; ConstMSEdgeVector edges; - MSEdge* dummyEdge = new MSEdge("dummy", 0, EDGEFUNC_NORMAL, "", "", -1, 0); + MSEdge* dummyEdge = new MSEdge("dummy", 0, SumoXMLEdgeFunc::NORMAL, "", "", -1, 0); MSLane* dummyLane = new MSLane("dummy_0", 50 / 3.6, 100, dummyEdge, 0, PositionVector(), SUMO_const_laneWidth, SVCAll, 0, false, ""); std::vector lanes; lanes.push_back(dummyLane); @@ -83,6 +83,7 @@ type = MSVehicleType::build(typeDefs); veh = new MSVehicleMock(defs, route, type, 1); veh->setTentativeLaneAndPosition(dummyLane, 0); + veh->initDevices(); MSGlobals::gSemiImplicitEulerUpdate = true; } diff -Nru sumo-1.5.0+dfsg1/unittest/src/netbuild/NBHeightMapperTest.cpp sumo-1.6.0+dfsg1/unittest/src/netbuild/NBHeightMapperTest.cpp --- sumo-1.5.0+dfsg1/unittest/src/netbuild/NBHeightMapperTest.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/unittest/src/netbuild/NBHeightMapperTest.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -26,7 +26,7 @@ protected : virtual void SetUp() { - NBHeightMapper& hm = NBHeightMapper::Singleton; + NBHeightMapper& hm = NBHeightMapper::myInstance; PositionVector t1; t1.push_back(Position(0, 0, 0)); t1.push_back(Position(1, 0, 0)); @@ -47,7 +47,7 @@ } virtual void TearDown() { - NBHeightMapper& hm = NBHeightMapper::Singleton; + NBHeightMapper& hm = NBHeightMapper::myInstance; hm.clearData(); } }; diff -Nru sumo-1.5.0+dfsg1/unittest/src/utils/geom/PositionVectorTest.cpp sumo-1.6.0+dfsg1/unittest/src/utils/geom/PositionVectorTest.cpp --- sumo-1.5.0+dfsg1/unittest/src/utils/geom/PositionVectorTest.cpp 2020-02-10 21:58:54.000000000 +0000 +++ sumo-1.6.0+dfsg1/unittest/src/utils/geom/PositionVectorTest.cpp 2020-04-27 21:47:56.000000000 +0000 @@ -561,6 +561,11 @@ vec5.push_back(Position(5, 7)); vec5.push_back(Position(4, 7)); + PositionVector vec6; + vec6.push_back(Position(4, 0)); + vec6.push_back(Position(4, 8)); + vec6.push_back(Position(-4, 8)); + PositionVector empty; EXPECT_TRUE(vec1.overlapsWith(vec1)); @@ -568,6 +573,8 @@ EXPECT_TRUE(vec1.overlapsWith(vec3)); EXPECT_TRUE(vec1.overlapsWith(vec4)); EXPECT_FALSE(vec1.overlapsWith(vec5, 0)); + EXPECT_TRUE(vec1.overlapsWith(vec6)); // overlapsWith implicitly closes the shape of vec6 + EXPECT_TRUE(vec6.overlapsWith(vec1)); // overlapsWith implicitly closes the shape of vec6 // growth is from centroid and thus different from Boundary behavior EXPECT_FALSE(vec1.overlapsWith(vec5, 1)); EXPECT_TRUE(vec1.overlapsWith(vec5, 3));